From 4692f54b49fafe42f9a76815ee6064c241237d20 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Wed, 1 Nov 2023 12:28:34 +0200 Subject: [PATCH 1/3] chore(docs-util): fix freshness check script (#5518) --- docs-util/packages/scripts/freshness-check.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs-util/packages/scripts/freshness-check.ts b/docs-util/packages/scripts/freshness-check.ts index cc3ab7ccbc455..97646d9ce90c9 100644 --- a/docs-util/packages/scripts/freshness-check.ts +++ b/docs-util/packages/scripts/freshness-check.ts @@ -4,6 +4,7 @@ import { LinearClient } from "@linear/sdk" import { Octokit } from "@octokit/core" import fs from "fs" import path from "path" +import { fileURLToPath } from "url" const octokit = new Octokit({ auth: process.env.GH_TOKEN, @@ -13,6 +14,9 @@ const linearClient = new LinearClient({ apiKey: process.env.LINEAR_API_KEY, }) +const __filename = fileURLToPath(import.meta.url) +const __dirname = path.dirname(__filename) + const repoPath = path.join( __dirname, "..", From 80fe362f33cba69e52418b57e2e2d476923fc510 Mon Sep 17 00:00:00 2001 From: Adrien de Peretti Date: Wed, 1 Nov 2023 18:56:12 +0100 Subject: [PATCH 2/3] fix(integration): setup (#5511) * fix(integration): setup --- .changeset/tough-cups-breathe.md | 6 ++ integration-tests/api/package.json | 2 +- .../environment-helpers/bootstrap-app.js | 82 +++++++++++++++---- .../environment-helpers/setup-server.js | 17 +--- .../environment-helpers/test-server.js | 19 +---- .../environment-helpers/use-container.js | 5 -- .../environment-helpers/use-db.js | 13 ++- .../environment-helpers/use-template-db.js | 7 +- integration-tests/globalTeardown.js | 25 +++++- .../plugins/__tests__/cart/store/index.ts | 26 +++--- .../plugins/__tests__/inventory/cart/cart.js | 23 +++--- .../inventory-items/ff-many-to-many.js | 40 ++++----- .../inventory/inventory-items/index.js | 27 +++--- .../__tests__/inventory/order/draft-order.js | 31 +++---- .../__tests__/inventory/order/order.js | 24 +++--- .../inventory/products/create-variant.js | 23 +++--- .../inventory/products/delete-variant.js | 23 +++--- .../inventory/products/get-product.js | 23 +++--- .../inventory/products/get-variant.js | 23 +++--- .../inventory/products/list-products.js | 23 +++--- .../inventory/products/list-variants.js | 23 +++--- .../inventory/reservation-items/index.js | 31 +++---- .../plugins/__tests__/inventory/service.js | 18 ++-- .../inventory/variant-inventory-service.js | 18 ++-- .../__tests__/medusa-plugin-sendgrid/index.js | 23 +++--- .../plugins/__tests__/pricing/get-product.ts | 18 ++-- .../__tests__/product/admin/create-product.ts | 8 +- .../plugins/__tests__/product/admin/index.ts | 21 ++--- .../admin/update-product-variant.spec.ts | 12 +-- .../product/admin/update-product.spec.ts | 35 ++++---- .../plugins/__tests__/services/product.ts | 22 ++--- .../stock-location/delete-sales-channels.js | 23 +++--- .../stock-location/delete-stock-location.js | 23 +++--- .../stock-location/sales-channels.js | 23 +++--- .../__tests__/stock-location/service.js | 18 ++-- .../inventory/create-inventory-items.ts | 11 ++- .../workflows/product/create-product.ts | 13 ++- .../workflows/product/update-product.ts | 14 ++-- integration-tests/plugins/medusa-config.js | 2 +- integration-tests/plugins/package.json | 2 +- integration-tests/setup-env.js | 2 + integration-tests/setup.js | 8 +- .../src/services/inmemory-cache.ts | 8 +- .../cache-redis/src/services/redis-cache.ts | 4 + packages/medusa/src/loaders/index.ts | 20 ++--- 45 files changed, 459 insertions(+), 403 deletions(-) create mode 100644 .changeset/tough-cups-breathe.md diff --git a/.changeset/tough-cups-breathe.md b/.changeset/tough-cups-breathe.md new file mode 100644 index 0000000000000..8c23b4675196f --- /dev/null +++ b/.changeset/tough-cups-breathe.md @@ -0,0 +1,6 @@ +--- +"@medusajs/cache-redis": major +"@medusajs/cache-inmemory": patch +--- + +Integration tests fixes and ignore ttl 0 on cache modules diff --git a/integration-tests/api/package.json b/integration-tests/api/package.json index 1c3c04a41b76f..fa7cbc9d27fe0 100644 --- a/integration-tests/api/package.json +++ b/integration-tests/api/package.json @@ -5,7 +5,7 @@ "license": "MIT", "private": true, "scripts": { - "test:integration": "jest --silent=false --maxWorkers=50% --bail --detectOpenHandles --forceExit", + "test:integration": "jest --silent=false --maxWorkers=50% --bail --detectOpenHandles --forceExit --logHeapUsage", "build": "babel src -d dist --extensions \".ts,.js\"" }, "dependencies": { diff --git a/integration-tests/environment-helpers/bootstrap-app.js b/integration-tests/environment-helpers/bootstrap-app.js index 382e00aaff990..13a1ce01501a7 100644 --- a/integration-tests/environment-helpers/bootstrap-app.js +++ b/integration-tests/environment-helpers/bootstrap-app.js @@ -2,30 +2,78 @@ const path = require("path") const express = require("express") const getPort = require("get-port") const { isObject } = require("@medusajs/utils") +const { setContainer } = require("./use-container") +const { setPort, setExpressServer } = require("./use-api") -module.exports = { - bootstrapApp: async ({ cwd, env = {} } = {}) => { - const app = express() +async function bootstrapApp({ cwd, env = {} } = {}) { + const app = express() - if (isObject(env)) { - Object.entries(env).forEach(([k, v]) => (process.env[k] = v)) - } + if (isObject(env)) { + Object.entries(env).forEach(([k, v]) => (process.env[k] = v)) + } + + const loaders = require("@medusajs/medusa/dist/loaders").default + + const { container, dbConnection, pgConnection } = await loaders({ + directory: path.resolve(cwd || process.cwd()), + expressApp: app, + isTest: false, + }) - const loaders = require("@medusajs/medusa/dist/loaders").default + const PORT = await getPort() - const { container, dbConnection } = await loaders({ - directory: path.resolve(cwd || process.cwd()), - expressApp: app, - isTest: false, + return { + container, + db: dbConnection, + pgConnection, + app, + port: PORT, + } +} + +module.exports = { + bootstrapApp, + startBootstrapApp: async ({ + cwd, + env = {}, + skipExpressListen = false, + } = {}) => { + const { app, port, container, db, pgConnection } = await bootstrapApp({ + cwd, + env, }) + let expressServer - const PORT = await getPort() + setContainer(container) - return { - container, - db: dbConnection, - app, - port: PORT, + if (skipExpressListen) { + return } + + const shutdown = async () => { + await Promise.all([ + expressServer.close(), + db?.destroy(), + pgConnection?.context?.destroy(), + ]) + + if (typeof global !== "undefined" && global?.gc) { + global.gc() + } + } + + return await new Promise((resolve, reject) => { + expressServer = app.listen(port, async (err) => { + if (err) { + await shutdown() + return reject(err) + } + setPort(port) + process.send(port) + resolve(shutdown) + }) + + setExpressServer(expressServer) + }) }, } diff --git a/integration-tests/environment-helpers/setup-server.js b/integration-tests/environment-helpers/setup-server.js index 17ac7565227d7..b70b85b7897ad 100644 --- a/integration-tests/environment-helpers/setup-server.js +++ b/integration-tests/environment-helpers/setup-server.js @@ -3,20 +3,9 @@ const { spawn } = require("child_process") const { setPort, useExpressServer } = require("./use-api") const { setContainer } = require("./use-container") -module.exports = ({ - cwd, - redisUrl, - uploadDir, - verbose, - env, - bootstrapApp = false, -}) => { +module.exports = async ({ cwd, redisUrl, uploadDir, verbose, env }) => { const serverPath = path.join(__dirname, "test-server.js") - if (bootstrapApp) { - require(serverPath) - } - // in order to prevent conflicts in redis, use a different db for each worker // same fix as for databases (works with up to 15) // redis dbs are 0-indexed and jest worker ids are indexed from 1 @@ -25,7 +14,7 @@ module.exports = ({ verbose = verbose ?? false - return new Promise((resolve, reject) => { + return await new Promise((resolve, reject) => { const medusaProcess = spawn("node", [path.resolve(serverPath)], { cwd, env: { @@ -44,11 +33,13 @@ module.exports = ({ medusaProcess.on("error", (err) => { console.log(err) + reject(err) process.exit() }) medusaProcess.on("uncaughtException", (err) => { console.log(err) + reject(err) medusaProcess.kill() }) diff --git a/integration-tests/environment-helpers/test-server.js b/integration-tests/environment-helpers/test-server.js index 8a049c032fe20..58da78e870c9a 100644 --- a/integration-tests/environment-helpers/test-server.js +++ b/integration-tests/environment-helpers/test-server.js @@ -1,18 +1,3 @@ -const { bootstrapApp } = require("./bootstrap-app") -const { setContainer } = require("./use-container") -const { setPort, setExpressServer } = require("./use-api") +const { startBootstrapApp } = require("./bootstrap-app") -const setup = async () => { - const { app, port, container } = await bootstrapApp() - - setContainer(container) - - const expressServer = app.listen(port, (err) => { - setPort(port) - process.send(port) - }) - - setExpressServer(expressServer) -} - -setup() +startBootstrapApp() diff --git a/integration-tests/environment-helpers/use-container.js b/integration-tests/environment-helpers/use-container.js index d1e66b1b14173..9d9520b0bba38 100644 --- a/integration-tests/environment-helpers/use-container.js +++ b/integration-tests/environment-helpers/use-container.js @@ -1,8 +1,3 @@ -const path = require("path") -const express = require("express") -const getPort = require("get-port") -const { isObject } = require("@medusajs/utils") - const AppUtils = { container_: null, diff --git a/integration-tests/environment-helpers/use-db.js b/integration-tests/environment-helpers/use-db.js index 36d02b0ee0ab2..3fe352f9a6bc9 100644 --- a/integration-tests/environment-helpers/use-db.js +++ b/integration-tests/environment-helpers/use-db.js @@ -1,11 +1,11 @@ const path = require("path") const { getConfigFile } = require("medusa-core-utils") +const { asValue } = require("awilix") const { isObject, createMedusaContainer } = require("@medusajs/utils") const { dropDatabase } = require("pg-god") const { DataSource } = require("typeorm") const dbFactory = require("./use-template-db") -const { getContainer } = require("./use-container") const { ContainerRegistrationKeys } = require("@medusajs/utils") const DB_HOST = process.env.DB_HOST @@ -69,10 +69,10 @@ const DbTestUtil = { }, shutdown: async function () { - await this.db_.destroy() + await this.db_?.destroy() await this.pgConnection_?.context?.destroy() - return await dropDatabase({ DB_NAME }, pgGodCredentials) + return await dropDatabase({ databaseName: DB_NAME }, pgGodCredentials) }, } @@ -157,6 +157,12 @@ module.exports = { const container = createMedusaContainer() + container.register({ + [ContainerRegistrationKeys.CONFIG_MODULE]: asValue(configModule), + [ContainerRegistrationKeys.LOGGER]: asValue(console), + [ContainerRegistrationKeys.MANAGER]: asValue(dbDataSource.manager), + }) + const pgConnection = await pgConnectionLoader({ configModule, container }) instance.setPgConnection(pgConnection) @@ -168,6 +174,7 @@ module.exports = { const options = { database: { clientUrl: DB_URL, + connection: pgConnection, }, } await runMigrations(options) diff --git a/integration-tests/environment-helpers/use-template-db.js b/integration-tests/environment-helpers/use-template-db.js index a20091f6e3163..943a1b1303220 100644 --- a/integration-tests/environment-helpers/use-template-db.js +++ b/integration-tests/environment-helpers/use-template-db.js @@ -21,14 +21,13 @@ const pgGodCredentials = { class DatabaseFactory { constructor() { - this.dataSource_ = null this.masterDataSourceName = "master" this.templateDbName = "medusa-integration-template" } async createTemplateDb_({ cwd }) { const { configModule } = getConfigFile(cwd, `medusa-config`) - const dataSource = await this.getMasterDataSource() + const migrationDir = path.resolve( path.join( __dirname, @@ -80,8 +79,6 @@ class DatabaseFactory { await templateDbDataSource.runMigrations() await templateDbDataSource.destroy() - - return dataSource } async getMasterDataSource() { @@ -103,7 +100,7 @@ class DatabaseFactory { async createFromTemplate(dbName) { const dataSource = await this.getMasterDataSource() - await dataSource.query(`DROP DATABASE IF EXISTS "${dbName}";`) + await dropDatabase({ databaseName: dbName }, pgGodCredentials) await dataSource.query( `CREATE DATABASE "${dbName}" TEMPLATE "${this.templateDbName}";` ) diff --git a/integration-tests/globalTeardown.js b/integration-tests/globalTeardown.js index 856f66345c366..9493eedea2643 100644 --- a/integration-tests/globalTeardown.js +++ b/integration-tests/globalTeardown.js @@ -1,5 +1,24 @@ -const dbFactory = require("./environment-helpers/use-template-db") +const { dropDatabase } = require("pg-god") -module.exports = async () => { - await dbFactory.destroy() +const DB_HOST = process.env.DB_HOST +const DB_USERNAME = process.env.DB_USERNAME +const DB_PASSWORD = process.env.DB_PASSWORD +const DB_NAME = process.env.DB_TEMP_NAME + +const pgGodCredentials = { + user: DB_USERNAME, + password: DB_PASSWORD, + host: DB_HOST, +} + +const teardown = async () => { + try { + await dropDatabase({ databaseName: DB_NAME }, pgGodCredentials) + } catch (e) { + console.error( + `This might fail if it is run during the unit tests since there is no database to drop. Otherwise, please check what is the issue. ${e.message}` + ) + } } + +module.exports = teardown diff --git a/integration-tests/plugins/__tests__/cart/store/index.ts b/integration-tests/plugins/__tests__/cart/store/index.ts index 75544ca654d7d..59f1b6a7ee056 100644 --- a/integration-tests/plugins/__tests__/cart/store/index.ts +++ b/integration-tests/plugins/__tests__/cart/store/index.ts @@ -1,19 +1,20 @@ -import { MoneyAmount, PriceList, Region } from "@medusajs/medusa" +import { + MoneyAmount, + PriceList, + ProductVariantMoneyAmount, + Region, +} from "@medusajs/medusa" import path from "path" - -import { ProductVariantMoneyAmount } from "@medusajs/medusa" -import { bootstrapApp } from "../../../../environment-helpers/bootstrap-app" -import setupServer from "../../../../environment-helpers/setup-server" -import { setPort, useApi } from "../../../../environment-helpers/use-api" +import { startBootstrapApp } from "../../../../environment-helpers/bootstrap-app" +import { useApi } from "../../../../environment-helpers/use-api" import { initDb, useDb } from "../../../../environment-helpers/use-db" import { simpleProductFactory } from "../../../../factories" jest.setTimeout(30000) describe("/store/carts", () => { - let medusaProcess let dbConnection - let express + let shutdownServer const doAfterEach = async () => { const db = useDb() @@ -23,18 +24,13 @@ describe("/store/carts", () => { beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..", "..")) dbConnection = await initDb({ cwd }) - medusaProcess = await setupServer({ cwd }) - const { app, port } = await bootstrapApp({ cwd }) - setPort(port) - express = app.listen(port, () => { - process.send?.(port) - }) + shutdownServer = await startBootstrapApp({ cwd }) }) afterAll(async () => { const db = useDb() await db.shutdown() - medusaProcess.kill() + await shutdownServer() }) describe("POST /store/carts", () => { diff --git a/integration-tests/plugins/__tests__/inventory/cart/cart.js b/integration-tests/plugins/__tests__/inventory/cart/cart.js index bd8058dc1c72c..adc1816c54058 100644 --- a/integration-tests/plugins/__tests__/inventory/cart/cart.js +++ b/integration-tests/plugins/__tests__/inventory/cart/cart.js @@ -1,22 +1,28 @@ const path = require("path") const { - bootstrapApp, + startBootstrapApp, } = require("../../../../environment-helpers/bootstrap-app") const { initDb, useDb } = require("../../../../environment-helpers/use-db") -const { setPort, useApi } = require("../../../../environment-helpers/use-api") +const { + useApi, + useExpressServer, +} = require("../../../../environment-helpers/use-api") const adminSeeder = require("../../../../helpers/admin-seeder") const cartSeeder = require("../../../../helpers/cart-seeder") const { simpleProductFactory } = require("../../../../factories") const { simpleSalesChannelFactory } = require("../../../../factories") +const { + getContainer, +} = require("../../../../environment-helpers/use-container") jest.setTimeout(30000) const adminHeaders = { headers: { "x-medusa-access-token": "test_token" } } describe("/store/carts", () => { - let express + let shutdownServer let appContainer let dbConnection @@ -32,19 +38,14 @@ describe("/store/carts", () => { beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..", "..")) dbConnection = await initDb({ cwd }) - const { container, app, port } = await bootstrapApp({ cwd }) - appContainer = container - - setPort(port) - express = app.listen(port, (err) => { - process.send(port) - }) + shutdownServer = await startBootstrapApp({ cwd }) + appContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() - express.close() + await shutdownServer() }) afterEach(async () => { diff --git a/integration-tests/plugins/__tests__/inventory/inventory-items/ff-many-to-many.js b/integration-tests/plugins/__tests__/inventory/inventory-items/ff-many-to-many.js index bd6f58f87f163..7e584d277f4df 100644 --- a/integration-tests/plugins/__tests__/inventory/inventory-items/ff-many-to-many.js +++ b/integration-tests/plugins/__tests__/inventory/inventory-items/ff-many-to-many.js @@ -2,51 +2,37 @@ const path = require("path") const { ProductVariantInventoryService } = require("@medusajs/medusa") const { - bootstrapApp, + startBootstrapApp, } = require("../../../../environment-helpers/bootstrap-app") const { initDb, useDb } = require("../../../../environment-helpers/use-db") -const { setPort, useApi } = require("../../../../environment-helpers/use-api") +const { + useApi, + useExpressServer, +} = require("../../../../environment-helpers/use-api") const adminSeeder = require("../../../../helpers/admin-seeder") jest.setTimeout(30000) const { - simpleProductFactory, - simpleOrderFactory, -} = require("../../../../factories") + getContainer, +} = require("../../../../environment-helpers/use-container") const adminHeaders = { headers: { "x-medusa-access-token": "test_token" } } describe("Inventory Items endpoints", () => { let appContainer let dbConnection - let express - - let variantId - let inventoryItems - let locationId - let location2Id - let location3Id + let shutdownServer beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..", "..")) dbConnection = await initDb({ cwd }) - - const { container, app, port } = await bootstrapApp({ cwd }) - appContainer = container + shutdownServer = await startBootstrapApp({ cwd }) + appContainer = getContainer() // Set feature flag const flagRouter = appContainer.resolve("featureFlagRouter") flagRouter.setFlag("many_to_many_inventory", true) - - setPort(port) - express = app.listen(port, (err) => { - process.send(port) - }) - }) - - beforeEach(async () => { - await adminSeeder(dbConnection) }) afterAll(async () => { @@ -55,7 +41,11 @@ describe("Inventory Items endpoints", () => { const db = useDb() await db.shutdown() - express.close() + await shutdownServer() + }) + + beforeEach(async () => { + await adminSeeder(dbConnection) }) afterEach(async () => { diff --git a/integration-tests/plugins/__tests__/inventory/inventory-items/index.js b/integration-tests/plugins/__tests__/inventory/inventory-items/index.js index e91ecfe267a7f..1494044f9e353 100644 --- a/integration-tests/plugins/__tests__/inventory/inventory-items/index.js +++ b/integration-tests/plugins/__tests__/inventory/inventory-items/index.js @@ -1,10 +1,13 @@ const path = require("path") const { - bootstrapApp, + startBootstrapApp, } = require("../../../../environment-helpers/bootstrap-app") const { initDb, useDb } = require("../../../../environment-helpers/use-db") -const { setPort, useApi } = require("../../../../environment-helpers/use-api") +const { + useApi, + useExpressServer, +} = require("../../../../environment-helpers/use-api") const adminSeeder = require("../../../../helpers/admin-seeder") @@ -14,12 +17,15 @@ const { simpleProductFactory, simpleOrderFactory, } = require("../../../../factories") +const { + getContainer, +} = require("../../../../environment-helpers/use-container") const adminHeaders = { headers: { "x-medusa-access-token": "test_token" } } describe("Inventory Items endpoints", () => { let appContainer let dbConnection - let express + let shutdownServer let variantId let inventoryItems @@ -30,13 +36,14 @@ describe("Inventory Items endpoints", () => { beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..", "..")) dbConnection = await initDb({ cwd }) - const { container, app, port } = await bootstrapApp({ cwd }) - appContainer = container + shutdownServer = await startBootstrapApp({ cwd }) + appContainer = getContainer() + }) - setPort(port) - express = app.listen(port, (err) => { - process.send(port) - }) + afterAll(async () => { + const db = useDb() + await db.shutdown() + await shutdownServer() }) beforeEach(async () => { @@ -122,7 +129,7 @@ describe("Inventory Items endpoints", () => { afterAll(async () => { const db = useDb() await db.shutdown() - express.close() + await shutdownServer() }) afterEach(async () => { diff --git a/integration-tests/plugins/__tests__/inventory/order/draft-order.js b/integration-tests/plugins/__tests__/inventory/order/draft-order.js index 591490f26c9c7..3630b666725e3 100644 --- a/integration-tests/plugins/__tests__/inventory/order/draft-order.js +++ b/integration-tests/plugins/__tests__/inventory/order/draft-order.js @@ -1,10 +1,13 @@ const path = require("path") const { - bootstrapApp, + startBootstrapApp, } = require("../../../../environment-helpers/bootstrap-app") const { initDb, useDb } = require("../../../../environment-helpers/use-db") -const { setPort, useApi } = require("../../../../environment-helpers/use-api") +const { + useApi, + useExpressServer, +} = require("../../../../environment-helpers/use-api") const adminSeeder = require("../../../../helpers/admin-seeder") const { @@ -18,31 +21,30 @@ const { const { simpleAddressFactory, } = require("../../../../factories/simple-address-factory") +const { + getContainer, +} = require("../../../../environment-helpers/use-container") jest.setTimeout(30000) const adminHeaders = { headers: { "x-medusa-access-token": "test_token" } } describe("/store/carts", () => { - let express + let shutdownServer let appContainer let dbConnection - const doAfterEach = async () => { - const db = useDb() - return await db.teardown() - } - beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..", "..")) dbConnection = await initDb({ cwd }) - const { container, app, port } = await bootstrapApp({ cwd }) - appContainer = container + shutdownServer = await startBootstrapApp({ cwd }) + appContainer = getContainer() + }) - setPort(port) - express = app.listen(port, (err) => { - process.send(port) - }) + afterAll(async () => { + const db = useDb() + await db.shutdown() + await shutdownServer() }) beforeEach(async () => {}) @@ -51,7 +53,6 @@ describe("/store/carts", () => { const variantId = "test-variant" let region - let order let invItemId let prodVarInventoryService let inventoryService diff --git a/integration-tests/plugins/__tests__/inventory/order/order.js b/integration-tests/plugins/__tests__/inventory/order/order.js index 0f3926075dc25..fab2ed92052fc 100644 --- a/integration-tests/plugins/__tests__/inventory/order/order.js +++ b/integration-tests/plugins/__tests__/inventory/order/order.js @@ -1,10 +1,14 @@ const path = require("path") const { - bootstrapApp, + startBootstrapApp, } = require("../../../../environment-helpers/bootstrap-app") const { initDb, useDb } = require("../../../../environment-helpers/use-db") -const { setPort, useApi } = require("../../../../environment-helpers/use-api") +const { + setPort, + useApi, + useExpressServer, +} = require("../../../../environment-helpers/use-api") const adminSeeder = require("../../../../helpers/admin-seeder") const { @@ -17,32 +21,30 @@ const { simpleCartFactory, simpleShippingOptionFactory, } = require("../../../../factories") +const { + getContainer, +} = require("../../../../environment-helpers/use-container") jest.setTimeout(150000) const adminHeaders = { headers: { "x-medusa-access-token": "test_token" } } describe("/store/carts", () => { - let express + let shutdownServer let appContainer let dbConnection beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..", "..")) dbConnection = await initDb({ cwd }) - const { container, app, port } = await bootstrapApp({ cwd }) - appContainer = container - - setPort(port) - express = app.listen(port, (err) => { - process.send(port) - }) + shutdownServer = await startBootstrapApp({ cwd }) + appContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() - express.close() + await shutdownServer() }) afterEach(async () => { diff --git a/integration-tests/plugins/__tests__/inventory/products/create-variant.js b/integration-tests/plugins/__tests__/inventory/products/create-variant.js index e36dcb3d63a94..44706b332ec7f 100644 --- a/integration-tests/plugins/__tests__/inventory/products/create-variant.js +++ b/integration-tests/plugins/__tests__/inventory/products/create-variant.js @@ -1,10 +1,13 @@ const path = require("path") const { - bootstrapApp, + startBootstrapApp, } = require("../../../../environment-helpers/bootstrap-app") const { initDb, useDb } = require("../../../../environment-helpers/use-db") -const { setPort, useApi } = require("../../../../environment-helpers/use-api") +const { + useApi, + useExpressServer, +} = require("../../../../environment-helpers/use-api") const { ProductVariantInventoryService, @@ -16,28 +19,26 @@ const adminSeeder = require("../../../../helpers/admin-seeder") jest.setTimeout(30000) const { simpleProductFactory } = require("../../../../factories") +const { + getContainer, +} = require("../../../../environment-helpers/use-container") describe("Create Variant", () => { let appContainer let dbConnection - let express + let shutdownServer beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..", "..")) dbConnection = await initDb({ cwd }) - const { container, app, port } = await bootstrapApp({ cwd }) - appContainer = container - - setPort(port) - express = app.listen(port, (err) => { - process.send(port) - }) + shutdownServer = await startBootstrapApp({ cwd }) + appContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() - express.close() + await shutdownServer() }) afterEach(async () => { diff --git a/integration-tests/plugins/__tests__/inventory/products/delete-variant.js b/integration-tests/plugins/__tests__/inventory/products/delete-variant.js index 176096888963c..2c2abc42d6a9c 100644 --- a/integration-tests/plugins/__tests__/inventory/products/delete-variant.js +++ b/integration-tests/plugins/__tests__/inventory/products/delete-variant.js @@ -1,38 +1,39 @@ const path = require("path") const { - bootstrapApp, + startBootstrapApp, } = require("../../../../environment-helpers/bootstrap-app") const { initDb, useDb } = require("../../../../environment-helpers/use-db") -const { setPort, useApi } = require("../../../../environment-helpers/use-api") +const { + useApi, + useExpressServer, +} = require("../../../../environment-helpers/use-api") const adminSeeder = require("../../../../helpers/admin-seeder") jest.setTimeout(30000) const { simpleProductFactory } = require("../../../../factories") +const { + getContainer, +} = require("../../../../environment-helpers/use-container") describe("Delete Variant", () => { let appContainer let dbConnection - let express + let shutdownServer beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..", "..")) dbConnection = await initDb({ cwd }) - const { container, app, port } = await bootstrapApp({ cwd }) - appContainer = container - - setPort(port) - express = app.listen(port, (err) => { - process.send(port) - }) + shutdownServer = await startBootstrapApp({ cwd }) + appContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() - express.close() + await shutdownServer() }) afterEach(async () => { diff --git a/integration-tests/plugins/__tests__/inventory/products/get-product.js b/integration-tests/plugins/__tests__/inventory/products/get-product.js index 57ba9cbe30f4a..4bce1cb1ab578 100644 --- a/integration-tests/plugins/__tests__/inventory/products/get-product.js +++ b/integration-tests/plugins/__tests__/inventory/products/get-product.js @@ -1,10 +1,13 @@ const path = require("path") const { - bootstrapApp, + startBootstrapApp, } = require("../../../../environment-helpers/bootstrap-app") const { initDb, useDb } = require("../../../../environment-helpers/use-db") -const { setPort, useApi } = require("../../../../environment-helpers/use-api") +const { + useApi, + useExpressServer, +} = require("../../../../environment-helpers/use-api") const adminSeeder = require("../../../../helpers/admin-seeder") @@ -14,13 +17,16 @@ const { simpleProductFactory, simpleSalesChannelFactory, } = require("../../../../factories") +const { + getContainer, +} = require("../../../../environment-helpers/use-container") const adminHeaders = { headers: { "x-medusa-access-token": "test_token" } } describe("Get products", () => { let appContainer let dbConnection - let express + let shutdownServer const productId = "test-product" const variantId = "test-variant" let invItem @@ -28,19 +34,14 @@ describe("Get products", () => { beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..", "..")) dbConnection = await initDb({ cwd }) - const { container, app, port } = await bootstrapApp({ cwd }) - appContainer = container - - setPort(port) - express = app.listen(port, (err) => { - process.send(port) - }) + shutdownServer = await startBootstrapApp({ cwd }) + appContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() - express.close() + await shutdownServer() }) afterEach(async () => { diff --git a/integration-tests/plugins/__tests__/inventory/products/get-variant.js b/integration-tests/plugins/__tests__/inventory/products/get-variant.js index c387a25b50c59..1c2d9a5d27b5b 100644 --- a/integration-tests/plugins/__tests__/inventory/products/get-variant.js +++ b/integration-tests/plugins/__tests__/inventory/products/get-variant.js @@ -1,10 +1,13 @@ const path = require("path") const { - bootstrapApp, + startBootstrapApp, } = require("../../../../environment-helpers/bootstrap-app") const { initDb, useDb } = require("../../../../environment-helpers/use-db") -const { setPort, useApi } = require("../../../../environment-helpers/use-api") +const { + useApi, + useExpressServer, +} = require("../../../../environment-helpers/use-api") const adminSeeder = require("../../../../helpers/admin-seeder") @@ -14,13 +17,16 @@ const { simpleProductFactory, simpleSalesChannelFactory, } = require("../../../../factories") +const { + getContainer, +} = require("../../../../environment-helpers/use-container") const adminHeaders = { headers: { "x-medusa-access-token": "test_token" } } describe("Get variant", () => { let appContainer let dbConnection - let express + let shutdownServer const productId = "test-product" const variantId = "test-variant" let invItem @@ -32,19 +38,14 @@ describe("Get variant", () => { beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..", "..")) dbConnection = await initDb({ cwd }) - const { container, app, port } = await bootstrapApp({ cwd }) - appContainer = container - - setPort(port) - express = app.listen(port, (err) => { - process.send(port) - }) + shutdownServer = await startBootstrapApp({ cwd }) + appContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() - express.close() + await shutdownServer() }) afterEach(async () => { diff --git a/integration-tests/plugins/__tests__/inventory/products/list-products.js b/integration-tests/plugins/__tests__/inventory/products/list-products.js index 7a0a037ec05b1..ea72b61ba7f0d 100644 --- a/integration-tests/plugins/__tests__/inventory/products/list-products.js +++ b/integration-tests/plugins/__tests__/inventory/products/list-products.js @@ -1,10 +1,13 @@ const path = require("path") const { - bootstrapApp, + startBootstrapApp, } = require("../../../../environment-helpers/bootstrap-app") const { initDb, useDb } = require("../../../../environment-helpers/use-db") -const { setPort, useApi } = require("../../../../environment-helpers/use-api") +const { + useApi, + useExpressServer, +} = require("../../../../environment-helpers/use-api") const adminSeeder = require("../../../../helpers/admin-seeder") @@ -12,30 +15,28 @@ jest.setTimeout(30000) const { simpleProductFactory } = require("../../../../factories") const { simpleSalesChannelFactory } = require("../../../../factories") +const { + getContainer, +} = require("../../../../environment-helpers/use-container") const adminHeaders = { headers: { "x-medusa-access-token": "test_token" } } describe("Create Variant", () => { let appContainer let dbConnection - let express + let shutdownServer beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..", "..")) dbConnection = await initDb({ cwd }) - const { container, app, port } = await bootstrapApp({ cwd }) - appContainer = container - - setPort(port) - express = app.listen(port, (err) => { - process.send(port) - }) + shutdownServer = await startBootstrapApp({ cwd }) + appContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() - express.close() + await shutdownServer() }) afterEach(async () => { diff --git a/integration-tests/plugins/__tests__/inventory/products/list-variants.js b/integration-tests/plugins/__tests__/inventory/products/list-variants.js index 5d557ac789ac8..cc099e8c084da 100644 --- a/integration-tests/plugins/__tests__/inventory/products/list-variants.js +++ b/integration-tests/plugins/__tests__/inventory/products/list-variants.js @@ -1,10 +1,13 @@ const path = require("path") const { - bootstrapApp, + startBootstrapApp, } = require("../../../../environment-helpers/bootstrap-app") const { initDb, useDb } = require("../../../../environment-helpers/use-db") -const { setPort, useApi } = require("../../../../environment-helpers/use-api") +const { + useApi, + useExpressServer, +} = require("../../../../environment-helpers/use-api") const adminSeeder = require("../../../../helpers/admin-seeder") @@ -12,29 +15,27 @@ jest.setTimeout(30000) const { simpleProductFactory } = require("../../../../factories") const { simpleSalesChannelFactory } = require("../../../../factories") +const { + getContainer, +} = require("../../../../environment-helpers/use-container") const adminHeaders = { headers: { "x-medusa-access-token": "test_token" } } describe("List Variants", () => { let appContainer let dbConnection - let express + let shutdownServer beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..", "..")) dbConnection = await initDb({ cwd }) - const { container, app, port } = await bootstrapApp({ cwd }) - appContainer = container - - setPort(port) - express = app.listen(port, (err) => { - process.send(port) - }) + shutdownServer = await startBootstrapApp({ cwd }) + appContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() - express.close() + await shutdownServer() }) afterEach(async () => { diff --git a/integration-tests/plugins/__tests__/inventory/reservation-items/index.js b/integration-tests/plugins/__tests__/inventory/reservation-items/index.js index cc99de4880f75..d873405d60eb7 100644 --- a/integration-tests/plugins/__tests__/inventory/reservation-items/index.js +++ b/integration-tests/plugins/__tests__/inventory/reservation-items/index.js @@ -1,10 +1,13 @@ const path = require("path") const { - bootstrapApp, + startBootstrapApp, } = require("../../../../environment-helpers/bootstrap-app") const { initDb, useDb } = require("../../../../environment-helpers/use-db") -const { setPort, useApi } = require("../../../../environment-helpers/use-api") +const { + useApi, + useExpressServer, +} = require("../../../../environment-helpers/use-api") const adminSeeder = require("../../../../helpers/admin-seeder") @@ -16,12 +19,15 @@ const { simpleRegionFactory, } = require("../../../../factories") const { simpleSalesChannelFactory } = require("../../../../factories") +const { + getContainer, +} = require("../../../../environment-helpers/use-container") const adminHeaders = { headers: { "x-medusa-access-token": "test_token" } } describe("Inventory Items endpoints", () => { let appContainer let dbConnection - let express + let shutdownServer let inventoryItem let locationId @@ -41,13 +47,14 @@ describe("Inventory Items endpoints", () => { beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..", "..")) dbConnection = await initDb({ cwd }) - const { container, app, port } = await bootstrapApp({ cwd }) - appContainer = container + shutdownServer = await startBootstrapApp({ cwd }) + appContainer = getContainer() + }) - setPort(port) - express = app.listen(port, (err) => { - process.send(port) - }) + afterAll(async () => { + const db = useDb() + await db.shutdown() + await shutdownServer() }) beforeEach(async () => { @@ -138,12 +145,6 @@ describe("Inventory Items endpoints", () => { }) }) - afterAll(async () => { - const db = useDb() - await db.shutdown() - express.close() - }) - afterEach(async () => { jest.clearAllMocks() const db = useDb() diff --git a/integration-tests/plugins/__tests__/inventory/service.js b/integration-tests/plugins/__tests__/inventory/service.js index 44f9330cdbc9d..cffee069f6db4 100644 --- a/integration-tests/plugins/__tests__/inventory/service.js +++ b/integration-tests/plugins/__tests__/inventory/service.js @@ -1,30 +1,30 @@ const path = require("path") -const { bootstrapApp } = require("../../../environment-helpers/bootstrap-app") +const { + startBootstrapApp, +} = require("../../../environment-helpers/bootstrap-app") const { initDb, useDb } = require("../../../environment-helpers/use-db") +const { getContainer } = require("../../../environment-helpers/use-container") +const { useExpressServer } = require("../../../environment-helpers/use-api") jest.setTimeout(50000) describe("Inventory Module", () => { + let shutdownServer let appContainer let dbConnection - let express beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..")) dbConnection = await initDb({ cwd }) - const { container, app, port } = await bootstrapApp({ cwd }) - appContainer = container - - express = app.listen(port, (err) => { - process.send(port) - }) + shutdownServer = await startBootstrapApp({ cwd }) + appContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() - express.close() + await shutdownServer() }) afterEach(async () => { diff --git a/integration-tests/plugins/__tests__/inventory/variant-inventory-service.js b/integration-tests/plugins/__tests__/inventory/variant-inventory-service.js index 022045fc453d6..5bf7ace38284a 100644 --- a/integration-tests/plugins/__tests__/inventory/variant-inventory-service.js +++ b/integration-tests/plugins/__tests__/inventory/variant-inventory-service.js @@ -1,15 +1,19 @@ const path = require("path") -const { bootstrapApp } = require("../../../environment-helpers/bootstrap-app") +const { + startBootstrapApp, +} = require("../../../environment-helpers/bootstrap-app") const { initDb, useDb } = require("../../../environment-helpers/use-db") const { simpleProductFactory } = require("../../../factories") +const { getContainer } = require("../../../environment-helpers/use-container") +const { useExpressServer } = require("../../../environment-helpers/use-api") jest.setTimeout(50000) describe("Inventory Module", () => { let appContainer let dbConnection - let express + let shutdownServer let invItem1 let invItem2 @@ -19,18 +23,14 @@ describe("Inventory Module", () => { beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..")) dbConnection = await initDb({ cwd }) - const { container, app, port } = await bootstrapApp({ cwd, verbose: false }) - appContainer = container - - express = app.listen(port, (err) => { - process.send(port) - }) + shutdownServer = await startBootstrapApp({ cwd }) + appContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() - express.close() + await shutdownServer() }) describe("ProductVariantInventoryService", () => { diff --git a/integration-tests/plugins/__tests__/medusa-plugin-sendgrid/index.js b/integration-tests/plugins/__tests__/medusa-plugin-sendgrid/index.js index f04eeb5f3d62d..06f628ceb739e 100644 --- a/integration-tests/plugins/__tests__/medusa-plugin-sendgrid/index.js +++ b/integration-tests/plugins/__tests__/medusa-plugin-sendgrid/index.js @@ -1,8 +1,13 @@ const path = require("path") -const { bootstrapApp } = require("../../../environment-helpers/bootstrap-app") +const { + startBootstrapApp, +} = require("../../../environment-helpers/bootstrap-app") const { initDb, useDb } = require("../../../environment-helpers/use-db") -const { setPort, useApi } = require("../../../environment-helpers/use-api") +const { + useApi, + useExpressServer, +} = require("../../../environment-helpers/use-api") const adminSeeder = require("../../../helpers/admin-seeder") @@ -14,11 +19,12 @@ const { simpleProductFactory, simpleShippingOptionFactory, } = require("../../../factories") +const { getContainer } = require("../../../environment-helpers/use-container") describe("medusa-plugin-sendgrid", () => { let appContainer let dbConnection - let express + let shutdownServer const doAfterEach = async () => { const db = useDb() @@ -28,19 +34,14 @@ describe("medusa-plugin-sendgrid", () => { beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..")) dbConnection = await initDb({ cwd }) - const { container, app, port } = await bootstrapApp({ cwd }) - appContainer = container - - setPort(port) - express = app.listen(port, (err) => { - process.send(port) - }) + shutdownServer = await startBootstrapApp({ cwd }) + appContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() - express.close() + await shutdownServer() }) afterEach(async () => { diff --git a/integration-tests/plugins/__tests__/pricing/get-product.ts b/integration-tests/plugins/__tests__/pricing/get-product.ts index 6591fa89467f5..88f71e93cc79c 100644 --- a/integration-tests/plugins/__tests__/pricing/get-product.ts +++ b/integration-tests/plugins/__tests__/pricing/get-product.ts @@ -1,11 +1,12 @@ -import { setPort, useApi } from "../../../environment-helpers/use-api" +import { useApi } from "../../../environment-helpers/use-api" import { initDb, useDb } from "../../../environment-helpers/use-db" import { simpleCartFactory, simpleRegionFactory } from "../../../factories" import { ModuleRegistrationName } from "@medusajs/modules-sdk" import { AxiosInstance } from "axios" import path from "path" -import { bootstrapApp } from "../../../environment-helpers/bootstrap-app" +import { startBootstrapApp } from "../../../environment-helpers/bootstrap-app" +import { getContainer } from "../../../environment-helpers/use-container" import adminSeeder from "../../../helpers/admin-seeder" jest.setTimeout(5000000) @@ -30,24 +31,19 @@ const env = { describe("Link Modules", () => { let medusaContainer let dbConnection - let express + let shutdownServer beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..")) dbConnection = await initDb({ cwd, env } as any) - - const { container, app, port } = await bootstrapApp({ cwd, env }) - medusaContainer = container - setPort(port) - - express = app.listen(port) + shutdownServer = await startBootstrapApp({ cwd, env }) + medusaContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() - - express.close() + await shutdownServer() }) beforeEach(async () => { diff --git a/integration-tests/plugins/__tests__/product/admin/create-product.ts b/integration-tests/plugins/__tests__/product/admin/create-product.ts index 03adb903687c7..ef1af2b397282 100644 --- a/integration-tests/plugins/__tests__/product/admin/create-product.ts +++ b/integration-tests/plugins/__tests__/product/admin/create-product.ts @@ -3,7 +3,7 @@ import { initDb, useDb } from "../../../../environment-helpers/use-db" import { Region } from "@medusajs/medusa" import { AxiosInstance } from "axios" import path from "path" -import setupServer from "../../../../environment-helpers/setup-server" +import { startBootstrapApp } from "../../../../environment-helpers/bootstrap-app" import { useApi } from "../../../../environment-helpers/use-api" import { getContainer } from "../../../../environment-helpers/use-container" import adminSeeder from "../../../../helpers/admin-seeder" @@ -25,19 +25,19 @@ const env = { describe.skip("[Product & Pricing Module] POST /admin/products", () => { let dbConnection let appContainer - let medusaProcess + let shutdownServer beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..", "..")) dbConnection = await initDb({ cwd, env } as any) - medusaProcess = await setupServer({ cwd, env, bootstrapApp: true } as any) + shutdownServer = await startBootstrapApp({ cwd, env }) appContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() - medusaProcess.kill() + await shutdownServer() }) beforeEach(async () => { diff --git a/integration-tests/plugins/__tests__/product/admin/index.ts b/integration-tests/plugins/__tests__/product/admin/index.ts index ffca3acb7f41c..64edca16346cc 100644 --- a/integration-tests/plugins/__tests__/product/admin/index.ts +++ b/integration-tests/plugins/__tests__/product/admin/index.ts @@ -1,6 +1,6 @@ import path from "path" -import { bootstrapApp } from "../../../../environment-helpers/bootstrap-app" -import { setPort, useApi } from "../../../../environment-helpers/use-api" +import { startBootstrapApp } from "../../../../environment-helpers/bootstrap-app" +import { useApi } from "../../../../environment-helpers/use-api" import { initDb, useDb } from "../../../../environment-helpers/use-db" import adminSeeder from "../../../../helpers/admin-seeder" @@ -9,6 +9,7 @@ import productSeeder from "../../../../helpers/product-seeder" import { Modules, ModulesDefinition } from "@medusajs/modules-sdk" import { Workflows } from "@medusajs/workflows" import { AxiosInstance } from "axios" +import { getContainer } from "../../../../environment-helpers/use-container" import { simpleProductFactory, simpleSalesChannelFactory, @@ -24,26 +25,20 @@ const adminHeaders = { describe("/admin/products", () => { let dbConnection - let express + let shutdownServer let medusaContainer beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..", "..")) - dbConnection = await initDb({ cwd } as any) - const { app, port, container } = await bootstrapApp({ cwd }) - medusaContainer = container - - setPort(port) - express = app.listen(port, () => { - process.send?.(port) - }) + dbConnection = await initDb({ cwd }) + shutdownServer = await startBootstrapApp({ cwd }) + medusaContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() - - express.close() + await shutdownServer() }) it("Should have loaded the product module", function () { diff --git a/integration-tests/plugins/__tests__/product/admin/update-product-variant.spec.ts b/integration-tests/plugins/__tests__/product/admin/update-product-variant.spec.ts index 5fa882358d3b0..7fc8bc53e18c1 100644 --- a/integration-tests/plugins/__tests__/product/admin/update-product-variant.spec.ts +++ b/integration-tests/plugins/__tests__/product/admin/update-product-variant.spec.ts @@ -1,4 +1,3 @@ -import setupServer from "../../../../environment-helpers/setup-server" import { useApi } from "../../../../environment-helpers/use-api" import { getContainer } from "../../../../environment-helpers/use-container" import { initDb, useDb } from "../../../../environment-helpers/use-db" @@ -7,11 +6,12 @@ import { simpleRegionFactory, } from "../../../../factories" +import { AxiosInstance } from "axios" import path from "path" +import { startBootstrapApp } from "../../../../environment-helpers/bootstrap-app" import adminSeeder from "../../../../helpers/admin-seeder" import { createDefaultRuleTypes } from "../../../helpers/create-default-rule-types" import { createVariantPriceSet } from "../../../helpers/create-variant-price-set" -import { AxiosInstance } from "axios" jest.setTimeout(50000) @@ -26,24 +26,24 @@ const env = { MEDUSA_FF_ISOLATE_PRODUCT_DOMAIN: true, } -describe("[Product & Pricing Module] POST /admin/products/:id/variants/:id", () => { +describe.skip("[Product & Pricing Module] POST /admin/products/:id/variants/:id", () => { let dbConnection let appContainer - let medusaProcess + let shutdownServer let product let variant beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..", "..")) dbConnection = await initDb({ cwd, env } as any) - medusaProcess = await setupServer({ cwd, env, bootstrapApp: true } as any) + shutdownServer = await startBootstrapApp({ cwd, env }) appContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() - medusaProcess.kill() + await shutdownServer() }) beforeEach(async () => { diff --git a/integration-tests/plugins/__tests__/product/admin/update-product.spec.ts b/integration-tests/plugins/__tests__/product/admin/update-product.spec.ts index f095368871e4f..c88f37457e786 100644 --- a/integration-tests/plugins/__tests__/product/admin/update-product.spec.ts +++ b/integration-tests/plugins/__tests__/product/admin/update-product.spec.ts @@ -1,4 +1,3 @@ -import setupServer from "../../../../environment-helpers/setup-server" import { useApi } from "../../../../environment-helpers/use-api" import { getContainer } from "../../../../environment-helpers/use-container" import { initDb, useDb } from "../../../../environment-helpers/use-db" @@ -7,6 +6,7 @@ import { simpleProductFactory } from "../../../../factories" import { Region } from "@medusajs/medusa" import { AxiosInstance } from "axios" import path from "path" +import { startBootstrapApp } from "../../../../environment-helpers/bootstrap-app" import adminSeeder from "../../../../helpers/admin-seeder" import { createDefaultRuleTypes } from "../../../helpers/create-default-rule-types" import { createVariantPriceSet } from "../../../helpers/create-variant-price-set" @@ -27,21 +27,21 @@ const env = { describe.skip("[Product & Pricing Module] POST /admin/products/:id", () => { let dbConnection let appContainer - let medusaProcess + let shutdownServer let product let variant beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..", "..")) dbConnection = await initDb({ cwd, env } as any) - medusaProcess = await setupServer({ cwd, env, bootstrapApp: true } as any) + shutdownServer = await startBootstrapApp({ cwd, env }) appContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() - medusaProcess.kill() + await shutdownServer() }) beforeEach(async () => { @@ -80,7 +80,7 @@ describe.skip("[Product & Pricing Module] POST /admin/products/:id", () => { }) it("should update product variant price sets and prices", async () => { - const api = useApi() + const api = useApi() as any const data = { title: "test product update", variants: [ @@ -102,14 +102,13 @@ describe.skip("[Product & Pricing Module] POST /admin/products/:id", () => { ], } - let response = await api.post( + await api.post(`/admin/products/${product.id}`, data, adminHeaders) + + const response = await api.get( `/admin/products/${product.id}`, - data, adminHeaders ) - response = await api.get(`/admin/products/${product.id}`, adminHeaders) - expect(response.status).toEqual(200) expect(response.data.product).toEqual( expect.objectContaining({ @@ -150,7 +149,7 @@ describe.skip("[Product & Pricing Module] POST /admin/products/:id", () => { const moneyAmountToUpdate = priceSet.money_amounts?.[0] - const api = useApi() + const api = useApi() as any const data = { title: "test product update", variants: [ @@ -173,14 +172,15 @@ describe.skip("[Product & Pricing Module] POST /admin/products/:id", () => { ], } - let response = await api.post( + console.log("I am here first") + await api.post(`/admin/products/${product.id}`, data, adminHeaders) + console.log("I am here") + + const response = await api.get( `/admin/products/${product.id}`, - data, adminHeaders ) - response = await api.get(`/admin/products/${product.id}`, adminHeaders) - expect(response.status).toEqual(200) expect(response.data.product).toEqual( expect.objectContaining({ @@ -248,14 +248,13 @@ describe.skip("[Product & Pricing Module] POST /admin/products/:id", () => { ], } - let response = await api.post( + await api.post(`/admin/products/${product.id}`, data, adminHeaders) + + const response = await api.get( `/admin/products/${product.id}`, - data, adminHeaders ) - response = await api.get(`/admin/products/${product.id}`, adminHeaders) - expect(response.status).toEqual(200) expect(response.data.product).toEqual( expect.objectContaining({ diff --git a/integration-tests/plugins/__tests__/services/product.ts b/integration-tests/plugins/__tests__/services/product.ts index ad3b8eeedf4a4..c42a531941699 100644 --- a/integration-tests/plugins/__tests__/services/product.ts +++ b/integration-tests/plugins/__tests__/services/product.ts @@ -1,35 +1,27 @@ import path from "path" +import { startBootstrapApp } from "../../../environment-helpers/bootstrap-app" +import { getContainer } from "../../../environment-helpers/use-container" import { initDb, useDb } from "../../../environment-helpers/use-db" -import { bootstrapApp } from "../../../environment-helpers/bootstrap-app" -import { setPort } from "../../../environment-helpers/use-api" jest.setTimeout(30000) describe("product", () => { - let dbConnection let medusaContainer let productService - let express + let shutdownServer beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..")) - dbConnection = await initDb({ cwd } as any) - const { container, port, app } = await bootstrapApp({ cwd }) - - setPort(port) - express = app.listen(port, () => { - process.send!(port) - }) - - medusaContainer = container + await initDb({ cwd }) + shutdownServer = shutdownServer = await startBootstrapApp({ cwd }) + medusaContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() - - express.close() + await shutdownServer() }) afterEach(async () => { diff --git a/integration-tests/plugins/__tests__/stock-location/delete-sales-channels.js b/integration-tests/plugins/__tests__/stock-location/delete-sales-channels.js index 30b67f70ca4fc..289993076a9b8 100644 --- a/integration-tests/plugins/__tests__/stock-location/delete-sales-channels.js +++ b/integration-tests/plugins/__tests__/stock-location/delete-sales-channels.js @@ -1,34 +1,35 @@ const path = require("path") -const { bootstrapApp } = require("../../../environment-helpers/bootstrap-app") +const { + startBootstrapApp, +} = require("../../../environment-helpers/bootstrap-app") const { initDb, useDb } = require("../../../environment-helpers/use-db") -const { setPort, useApi } = require("../../../environment-helpers/use-api") +const { + useApi, + useExpressServer, +} = require("../../../environment-helpers/use-api") const adminSeeder = require("../../../helpers/admin-seeder") +const { getContainer } = require("../../../environment-helpers/use-container") jest.setTimeout(30000) describe("Sales channels", () => { let appContainer let dbConnection - let express + let shutdownServer beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..")) dbConnection = await initDb({ cwd }) - const { container, app, port } = await bootstrapApp({ cwd }) - appContainer = container - - setPort(port) - express = app.listen(port, (err) => { - process.send(port) - }) + shutdownServer = await startBootstrapApp({ cwd }) + appContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() - express.close() + await shutdownServer() }) afterEach(async () => { diff --git a/integration-tests/plugins/__tests__/stock-location/delete-stock-location.js b/integration-tests/plugins/__tests__/stock-location/delete-stock-location.js index 2902f73b6d8ea..2262a3f5e36d3 100644 --- a/integration-tests/plugins/__tests__/stock-location/delete-stock-location.js +++ b/integration-tests/plugins/__tests__/stock-location/delete-stock-location.js @@ -1,34 +1,35 @@ const path = require("path") -const { bootstrapApp } = require("../../../environment-helpers/bootstrap-app") +const { + startBootstrapApp, +} = require("../../../environment-helpers/bootstrap-app") const { initDb, useDb } = require("../../../environment-helpers/use-db") -const { setPort, useApi } = require("../../../environment-helpers/use-api") +const { + useApi, + useExpressServer, +} = require("../../../environment-helpers/use-api") const adminSeeder = require("../../../helpers/admin-seeder") +const { getContainer } = require("../../../environment-helpers/use-container") jest.setTimeout(30000) describe("Sales channels", () => { let appContainer let dbConnection - let express + let shutdownServer beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..")) dbConnection = await initDb({ cwd }) - const { container, app, port } = await bootstrapApp({ cwd }) - appContainer = container - - setPort(port) - express = app.listen(port, (err) => { - process.send(port) - }) + shutdownServer = await startBootstrapApp({ cwd }) + appContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() - express.close() + await shutdownServer() }) afterEach(async () => { diff --git a/integration-tests/plugins/__tests__/stock-location/sales-channels.js b/integration-tests/plugins/__tests__/stock-location/sales-channels.js index 0b6b86164314d..08ef3020c228d 100644 --- a/integration-tests/plugins/__tests__/stock-location/sales-channels.js +++ b/integration-tests/plugins/__tests__/stock-location/sales-channels.js @@ -1,10 +1,16 @@ const path = require("path") -const { bootstrapApp } = require("../../../environment-helpers/bootstrap-app") +const { + startBootstrapApp, +} = require("../../../environment-helpers/bootstrap-app") const { initDb, useDb } = require("../../../environment-helpers/use-db") -const { setPort, useApi } = require("../../../environment-helpers/use-api") +const { + useApi, + useExpressServer, +} = require("../../../environment-helpers/use-api") const adminSeeder = require("../../../helpers/admin-seeder") +const { getContainer } = require("../../../environment-helpers/use-container") jest.setTimeout(30000) @@ -13,24 +19,19 @@ const adminHeaders = { headers: { "x-medusa-access-token": "test_token" } } describe("Sales channels", () => { let appContainer let dbConnection - let express + let shutdownServer beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..")) dbConnection = await initDb({ cwd }) - const { container, app, port } = await bootstrapApp({ cwd }) - appContainer = container - - setPort(port) - express = app.listen(port, (err) => { - process.send(port) - }) + shutdownServer = await startBootstrapApp({ cwd }) + appContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() - express.close() + await shutdownServer() }) afterEach(async () => { diff --git a/integration-tests/plugins/__tests__/stock-location/service.js b/integration-tests/plugins/__tests__/stock-location/service.js index 9cec2189efade..be40e14c8b504 100644 --- a/integration-tests/plugins/__tests__/stock-location/service.js +++ b/integration-tests/plugins/__tests__/stock-location/service.js @@ -1,30 +1,30 @@ const path = require("path") -const { bootstrapApp } = require("../../../environment-helpers/bootstrap-app") +const { + startBootstrapApp, +} = require("../../../environment-helpers/bootstrap-app") const { initDb, useDb } = require("../../../environment-helpers/use-db") +const { getContainer } = require("../../../environment-helpers/use-container") +const { useExpressServer } = require("../../../environment-helpers/use-api") jest.setTimeout(30000) describe("Inventory Module", () => { let appContainer let dbConnection - let express + let shutdownServer beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..")) dbConnection = await initDb({ cwd }) - const { container, app, port } = await bootstrapApp({ cwd }) - appContainer = container - - express = app.listen(port, (err) => { - process.send(port) - }) + shutdownServer = await startBootstrapApp({ cwd }) + appContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() - express.close() + await shutdownServer() }) afterEach(async () => { diff --git a/integration-tests/plugins/__tests__/workflows/inventory/create-inventory-items.ts b/integration-tests/plugins/__tests__/workflows/inventory/create-inventory-items.ts index 02fdb14ae3857..8b749de8c3d4c 100644 --- a/integration-tests/plugins/__tests__/workflows/inventory/create-inventory-items.ts +++ b/integration-tests/plugins/__tests__/workflows/inventory/create-inventory-items.ts @@ -6,24 +6,27 @@ import { pipe, } from "@medusajs/workflows" import path from "path" -import { bootstrapApp } from "../../../../environment-helpers/bootstrap-app" +import { startBootstrapApp } from "../../../../environment-helpers/bootstrap-app" +import { getContainer } from "../../../../environment-helpers/use-container" import { initDb, useDb } from "../../../../environment-helpers/use-db" jest.setTimeout(30000) describe("CreateInventoryItem workflow", function () { let medusaContainer + let shutdownServer beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..", "..")) - await initDb({ cwd } as any) - const { container } = await bootstrapApp({ cwd }) - medusaContainer = container + await initDb({ cwd }) + shutdownServer = await startBootstrapApp({ cwd, skipExpressListen: true }) + medusaContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() + await shutdownServer() }) it("should compensate all the invoke if something fails", async () => { diff --git a/integration-tests/plugins/__tests__/workflows/product/create-product.ts b/integration-tests/plugins/__tests__/workflows/product/create-product.ts index fb02d8e16b9be..5953965c6a5c7 100644 --- a/integration-tests/plugins/__tests__/workflows/product/create-product.ts +++ b/integration-tests/plugins/__tests__/workflows/product/create-product.ts @@ -7,24 +7,29 @@ import { pipe, } from "@medusajs/workflows" import path from "path" -import { bootstrapApp } from "../../../../environment-helpers/bootstrap-app" +import { startBootstrapApp } from "../../../../environment-helpers/bootstrap-app" +import { getContainer } from "../../../../environment-helpers/use-container" import { initDb, useDb } from "../../../../environment-helpers/use-db" jest.setTimeout(30000) describe("CreateProduct workflow", function () { let medusaContainer + let shutdownServer beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..", "..")) - await initDb({ cwd } as any) - const { container } = await bootstrapApp({ cwd }) - medusaContainer = container + await initDb({ cwd }) + shutdownServer = await startBootstrapApp({ cwd, skipExpressListen: true }) + medusaContainer = getContainer() }) afterAll(async () => { + console.log("GLOABL GC()", typeof global) + const db = useDb() await db.shutdown() + await shutdownServer() }) it("should compensate all the invoke if something fails", async () => { diff --git a/integration-tests/plugins/__tests__/workflows/product/update-product.ts b/integration-tests/plugins/__tests__/workflows/product/update-product.ts index 38d9772166a14..26e0863f60ff8 100644 --- a/integration-tests/plugins/__tests__/workflows/product/update-product.ts +++ b/integration-tests/plugins/__tests__/workflows/product/update-product.ts @@ -7,29 +7,29 @@ import { } from "@medusajs/workflows" import path from "path" -import { bootstrapApp } from "../../../../environment-helpers/bootstrap-app" +import { startBootstrapApp } from "../../../../environment-helpers/bootstrap-app" +import { getContainer } from "../../../../environment-helpers/use-container" import { initDb, useDb } from "../../../../environment-helpers/use-db" import { simpleProductFactory } from "../../../../factories" jest.setTimeout(30000) describe("UpdateProduct workflow", function () { - let medusaProcess let dbConnection let medusaContainer + let shutdownServer beforeAll(async () => { const cwd = path.resolve(path.join(__dirname, "..", "..", "..")) - dbConnection = await initDb({ cwd } as any) - const { container } = await bootstrapApp({ cwd }) - medusaContainer = container + dbConnection = await initDb({ cwd }) + shutdownServer = await startBootstrapApp({ cwd, skipExpressListen: true }) + medusaContainer = getContainer() }) afterAll(async () => { const db = useDb() await db.shutdown() - - medusaProcess.kill() + await shutdownServer() }) beforeEach(async () => { diff --git a/integration-tests/plugins/medusa-config.js b/integration-tests/plugins/medusa-config.js index fd215f04e2990..630721bb369f5 100644 --- a/integration-tests/plugins/medusa-config.js +++ b/integration-tests/plugins/medusa-config.js @@ -58,7 +58,7 @@ module.exports = { }, [Modules.CACHE]: { resolve: "@medusajs/cache-inmemory", - options: { ttl: 5 }, + options: { ttl: 0 }, // Cache disabled }, [Modules.PRODUCT]: { scope: "internal", diff --git a/integration-tests/plugins/package.json b/integration-tests/plugins/package.json index a5f73b935c1b3..0b1b18de06da5 100644 --- a/integration-tests/plugins/package.json +++ b/integration-tests/plugins/package.json @@ -5,7 +5,7 @@ "license": "MIT", "private": true, "scripts": { - "test:integration": "jest --silent=false --runInBand --bail --detectOpenHandles --forceExit", + "test:integration": "node --expose-gc ./../../node_modules/.bin/jest --silent=false --runInBand --bail --logHeapUsage --forceExit", "build": "babel src -d dist --extensions \".ts,.js\"" }, "dependencies": { diff --git a/integration-tests/setup-env.js b/integration-tests/setup-env.js index da786853ddeea..65ead03c62a91 100644 --- a/integration-tests/setup-env.js +++ b/integration-tests/setup-env.js @@ -6,3 +6,5 @@ if (typeof process.env.DB_TEMP_NAME === "undefined") { const tempName = parseInt(process.env.JEST_WORKER_ID || "1") process.env.DB_TEMP_NAME = `medusa-integration-${tempName}` } + +global.performance = require("perf_hooks").performance diff --git a/integration-tests/setup.js b/integration-tests/setup.js index 484988cd45b03..c41fd5105d929 100644 --- a/integration-tests/setup.js +++ b/integration-tests/setup.js @@ -12,5 +12,11 @@ const pgGodCredentials = { } afterAll(async () => { - await dropDatabase({ databaseName: DB_NAME }, pgGodCredentials) + try { + await dropDatabase({ databaseName: DB_NAME }, pgGodCredentials) + } catch (e) { + console.error( + `This might fail if it is run during the unit tests since there is no database to drop. Otherwise, please check what is the issue. ${e.message}` + ) + } }) diff --git a/packages/cache-inmemory/src/services/inmemory-cache.ts b/packages/cache-inmemory/src/services/inmemory-cache.ts index 37020a96e92f9..12552db07a031 100644 --- a/packages/cache-inmemory/src/services/inmemory-cache.ts +++ b/packages/cache-inmemory/src/services/inmemory-cache.ts @@ -45,6 +45,10 @@ class InMemoryCacheService implements ICacheService { * @param ttl - expiration time in seconds */ async set(key: string, data: T, ttl: number = this.TTL): Promise { + if (ttl === 0) { + return + } + const record: CacheRecord = { data, expire: ttl * 1000 + Date.now() } const oldRecord = this.store.get(key) @@ -54,8 +58,8 @@ class InMemoryCacheService implements ICacheService { this.timoutRefs.delete(key) } - const ref = setTimeout(() => { - this.invalidate(key) + const ref = setTimeout(async () => { + await this.invalidate(key) }, ttl * 1000) ref.unref() diff --git a/packages/cache-redis/src/services/redis-cache.ts b/packages/cache-redis/src/services/redis-cache.ts index 442bcc9a08f8d..b562ef8415459 100644 --- a/packages/cache-redis/src/services/redis-cache.ts +++ b/packages/cache-redis/src/services/redis-cache.ts @@ -35,6 +35,10 @@ class RedisCacheService implements ICacheService { data: Record, ttl: number = this.TTL ): Promise { + if (ttl === 0) { + return + } + await this.redis.set( this.getCacheKey(key), JSON.stringify(data), diff --git a/packages/medusa/src/loaders/index.ts b/packages/medusa/src/loaders/index.ts index c5ed4e7184cae..d2e8904900f24 100644 --- a/packages/medusa/src/loaders/index.ts +++ b/packages/medusa/src/loaders/index.ts @@ -1,32 +1,26 @@ -import { - MedusaApp, - ModulesDefinition, - moduleLoader, - registerModules, -} from "@medusajs/modules-sdk" +import { moduleLoader, registerModules } from "@medusajs/modules-sdk" import { Express, NextFunction, Request, Response } from "express" import databaseLoader, { dataSource } from "./database" import pluginsLoader, { registerPluginModels } from "./plugins" -import { Connection } from "typeorm" import { ContainerRegistrationKeys } from "@medusajs/utils" import { asValue } from "awilix" import { createMedusaContainer } from "medusa-core-utils" import { track } from "medusa-telemetry" import { EOL } from "os" import requestIp from "request-ip" -import modulesConfig from "../modules-config" +import { Connection } from "typeorm" import { MedusaContainer } from "../types/global" import apiLoader from "./api" +import loadConfig from "./config" import defaultsLoader from "./defaults" import expressLoader from "./express" import featureFlagsLoader from "./feature-flags" import IsolatePricingDomainFeatureFlag from "./feature-flags/isolate-pricing-domain" import IsolateProductDomainFeatureFlag from "./feature-flags/isolate-product-domain" import Logger from "./logger" -import { joinerConfig } from "../joiner-config" -import loadConfig from "./config" +import loadMedusaApp from "./medusa-app" import modelsLoader from "./models" import passportLoader from "./passport" import pgConnectionLoader from "./pg-connection" @@ -36,7 +30,6 @@ import searchIndexLoader from "./search-index" import servicesLoader from "./services" import strategiesLoader from "./strategies" import subscribersLoader from "./subscribers" -import loadMedusaApp from "./medusa-app" type Options = { directory: string @@ -52,6 +45,7 @@ export default async ({ container: MedusaContainer dbConnection: Connection app: Express + pgConnection: unknown }> => { const configModule = loadConfig(rootDirectory) @@ -102,7 +96,7 @@ export default async ({ const stratAct = Logger.success(stratActivity, "Strategies initialized") || {} track("STRATEGIES_INIT_COMPLETED", { duration: stratAct.duration }) - await pgConnectionLoader({ container, configModule }) + const pgConnection = await pgConnectionLoader({ container, configModule }) const modulesActivity = Logger.activity(`Initializing modules${EOL}`) @@ -202,5 +196,5 @@ export default async ({ Logger.success(searchActivity, "Indexing event emitted") || {} track("SEARCH_ENGINE_INDEXING_COMPLETED", { duration: searchAct.duration }) - return { container, dbConnection, app: expressApp } + return { container, dbConnection, app: expressApp, pgConnection } } From aa2bb7a31b5c265d6457e5dab536ff1200ac67e3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 2 Nov 2023 09:16:47 +0000 Subject: [PATCH 3/3] chore(docs): Generated References (#5516) Generated the following references: - `js-client` - `pricing` - `services` Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com> --- .../pricing/common/price-set-money-amount.ts | 8 + packages/types/src/pricing/service.ts | 204 +- ...artWorkflow.CreateCartWorkflowInputDTO.mdx | 102 + ...es.CartWorkflow.CreateLineItemInputDTO.mdx | 30 + ...nal-1.CommonTypes.AddressCreatePayload.mdx | 102 + ....internal-1.CommonTypes.AddressPayload.mdx | 102 + ...rnal.internal-1.CommonTypes.BaseEntity.mdx | 38 + ...ternal-1.CommonTypes.CustomFindOptions.mdx | 75 + ...l-1.CommonTypes.DateComparisonOperator.mdx | 46 + ...nternal-1.CommonTypes.EmptyQueryParams.mdx | 9 + ...nal.internal-1.CommonTypes.FindConfig.mdx} | 2 +- ...nal-1.CommonTypes.FindPaginationParams.mdx | 30 + ...rnal.internal-1.CommonTypes.FindParams.mdx | 30 + ...mmonTypes.NumericalComparisonOperator.mdx} | 2 +- ...CommonTypes.RepositoryTransformOptions.mdx | 9 + ...rnal-1.CommonTypes.SoftDeletableEntity.mdx | 46 + ....CommonTypes.StringComparisonOperator.mdx} | 2 +- ...pes.CommonWorkflow.WorkflowInputConfig.mdx | 62 + ...internal.internal-1.DAL.BaseFilterable.mdx | 45 + ...s.internal.internal-1.DAL.OptionsQuery.mdx | 91 + ...ernal.internal-1.DAL.RepositoryService.mdx | 601 ++ ....internal.internal-1.DAL.RestoreReturn.mdx | 37 + ...ternal.internal-1.DAL.SoftDeleteReturn.mdx | 37 + ...l.internal-1.DAL.TreeRepositoryService.mdx | 437 ++ ...ternal-1.FeatureFlagTypes.IFlagRouter.mdx} | 6 +- ...ryWorkflow.CreateInventoryItemInputDTO.mdx | 118 + ...w.CreateInventoryItemsWorkflowInputDTO.mdx | 22 + ....ModulesSdkTypes.MODULE_RESOURCE_TYPE.mdx} | 2 +- ...nternal-1.ModulesSdkTypes.MODULE_SCOPE.mdx | 21 + ...dkTypes.ModuleServiceInitializeOptions.mdx | 110 + ...l.internal-1.PricingTypes.AddPricesDTO.mdx | 32 + ...al.internal-1.PricingTypes.AddRulesDTO.mdx | 32 + ...l-1.PricingTypes.CalculatedPriceSetDTO.mdx | 56 + ...ernal-1.PricingTypes.CreateCurrencyDTO.mdx | 48 + ...al-1.PricingTypes.CreateMoneyAmountDTO.mdx | 64 + ...rnal-1.PricingTypes.CreatePriceRuleDTO.mdx | 72 + ...ernal-1.PricingTypes.CreatePriceSetDTO.mdx | 32 + ...cingTypes.CreatePriceSetMoneyAmountDTO.mdx | 38 + ...ypes.CreatePriceSetMoneyAmountRulesDTO.mdx | 40 + ...PricingTypes.CreatePriceSetRuleTypeDTO.mdx | 30 + ...nternal-1.PricingTypes.CreatePricesDTO.mdx | 72 + ...ernal-1.PricingTypes.CreateRuleTypeDTO.mdx | 48 + ...al.internal-1.PricingTypes.CurrencyDTO.mdx | 48 + ...1.PricingTypes.FilterableCurrencyProps.mdx | 40 + ...ricingTypes.FilterableMoneyAmountProps.mdx | 48 + ....PricingTypes.FilterablePriceRuleProps.mdx | 64 + ...pes.FilterablePriceSetMoneyAmountProps.mdx | 48 + ...ilterablePriceSetMoneyAmountRulesProps.mdx | 64 + ...1.PricingTypes.FilterablePriceSetProps.mdx | 48 + ...gTypes.FilterablePriceSetRuleTypeProps.mdx | 56 + ...1.PricingTypes.FilterableRuleTypeProps.mdx | 56 + ...internal-1.PricingTypes.MoneyAmountDTO.mdx | 64 + ...l.internal-1.PricingTypes.PriceRuleDTO.mdx | 88 + ...al.internal-1.PricingTypes.PriceSetDTO.mdx | 40 + ...-1.PricingTypes.PriceSetMoneyAmountDTO.mdx | 64 + ...icingTypes.PriceSetMoneyAmountRulesDTO.mdx | 48 + ...nal-1.PricingTypes.PriceSetRuleTypeDTO.mdx | 46 + ...internal-1.PricingTypes.PricingContext.mdx | 24 + ...internal-1.PricingTypes.PricingFilters.mdx | 24 + ...-1.PricingTypes.RemovePriceSetRulesDTO.mdx | 32 + ...al.internal-1.PricingTypes.RuleTypeDTO.mdx | 48 + ...ernal-1.PricingTypes.UpdateCurrencyDTO.mdx | 48 + ...al-1.PricingTypes.UpdateMoneyAmountDTO.mdx | 58 + ...rnal-1.PricingTypes.UpdatePriceRuleDTO.mdx | 72 + ...ernal-1.PricingTypes.UpdatePriceSetDTO.mdx | 24 + ...cingTypes.UpdatePriceSetMoneyAmountDTO.mdx | 46 + ...ypes.UpdatePriceSetMoneyAmountRulesDTO.mdx | 48 + ...PricingTypes.UpdatePriceSetRuleTypeDTO.mdx | 38 + ...ernal-1.PricingTypes.UpdateRuleTypeDTO.mdx | 48 + ....internal-1.ProductTypes.ProductStatus.mdx | 33 + ....ProductTypes.CreateProductCategoryDTO.mdx | 72 + ...roductTypes.CreateProductCollectionDTO.mdx | 48 + ...ternal-1.ProductTypes.CreateProductDTO.mdx | 216 + ...al-1.ProductTypes.CreateProductOnlyDTO.mdx | 190 + ...-1.ProductTypes.CreateProductOptionDTO.mdx | 32 + ...roductTypes.CreateProductOptionOnlyDTO.mdx | 38 + ...nal-1.ProductTypes.CreateProductTagDTO.mdx | 24 + ...al-1.ProductTypes.CreateProductTypeDTO.mdx | 40 + ...1.ProductTypes.CreateProductVariantDTO.mdx | 160 + ...oductTypes.CreateProductVariantOnlyDTO.mdx | 158 + ...uctTypes.CreateProductVariantOptionDTO.mdx | 24 + ...ctTypes.FilterableProductCategoryProps.mdx | 88 + ...Types.FilterableProductCollectionProps.mdx | 56 + ...ductTypes.FilterableProductOptionProps.mdx | 56 + ...-1.ProductTypes.FilterableProductProps.mdx | 120 + ...ProductTypes.FilterableProductTagProps.mdx | 48 + ...roductTypes.FilterableProductTypeProps.mdx | 48 + ...uctTypes.FilterableProductVariantProps.mdx | 72 + ...l-1.ProductTypes.IProductModuleService.mdx | 6626 +++++++++++++++++ ...rnal-1.ProductTypes.ProductCategoryDTO.mdx | 104 + ...al-1.ProductTypes.ProductCollectionDTO.mdx | 64 + ...nal.internal-1.ProductTypes.ProductDTO.mdx | 248 + ...nternal-1.ProductTypes.ProductImageDTO.mdx | 48 + ...ternal-1.ProductTypes.ProductOptionDTO.mdx | 64 + ...l-1.ProductTypes.ProductOptionValueDTO.mdx | 64 + ....internal-1.ProductTypes.ProductTagDTO.mdx | 48 + ...internal-1.ProductTypes.ProductTypeDTO.mdx | 48 + ...ernal-1.ProductTypes.ProductVariantDTO.mdx | 216 + ....ProductTypes.UpdateProductCategoryDTO.mdx | 72 + ...roductTypes.UpdateProductCollectionDTO.mdx | 64 + ...ternal-1.ProductTypes.UpdateProductDTO.mdx | 224 + ...-1.ProductTypes.UpdateProductOptionDTO.mdx | 38 + ...nal-1.ProductTypes.UpdateProductTagDTO.mdx | 32 + ...al-1.ProductTypes.UpdateProductTypeDTO.mdx | 40 + ...1.ProductTypes.UpdateProductVariantDTO.mdx | 168 + ...oductTypes.UpdateProductVariantOnlyDTO.mdx | 166 + ...nal-1.ProductTypes.UpsertProductTagDTO.mdx | 30 + ...al-1.ProductTypes.UpsertProductTypeDTO.mdx | 30 + ....ProductWorkflow.CreateProductInputDTO.mdx | 214 + ...ctWorkflow.CreateProductOptionInputDTO.mdx | 22 + ...w.CreateProductProductCategoryInputDTO.mdx | 22 + ...flow.CreateProductSalesChannelInputDTO.mdx | 22 + ...oductWorkflow.CreateProductTagInputDTO.mdx | 30 + ...ductWorkflow.CreateProductTypeInputDTO.mdx | 30 + ...tWorkflow.CreateProductVariantInputDTO.mdx | 174 + ...low.CreateProductVariantPricesInputDTO.mdx | 62 + ...orkflow.CreateProductsWorkflowInputDTO.mdx | 22 + ...flow.CreteProductVariantOptionInputDTO.mdx | 30 + ....ProductWorkflow.UpdateProductInputDTO.mdx | 206 + ...w.UpdateProductProductCategoryInputDTO.mdx | 22 + ...flow.UpdateProductSalesChannelInputDTO.mdx | 22 + ...oductWorkflow.UpdateProductTagInputDTO.mdx | 30 + ...ductWorkflow.UpdateProductTypeInputDTO.mdx | 30 + ...tWorkflow.UpdateProductVariantInputDTO.mdx | 174 + ...low.UpdateProductVariantOptionInputDTO.mdx | 30 + ...low.UpdateProductVariantPricesInputDTO.mdx | 62 + ...Workflow.UpdateProductVariantsInputDTO.mdx | 174 + ....UpdateProductVariantsWorkflowInputDTO.mdx | 22 + ...orkflow.UpdateProductsWorkflowInputDTO.mdx | 22 + ...low.UpsertProductVariantOptionInputDTO.mdx | 30 + ...low.UpsertProductVariantPricesInputDTO.mdx | 62 + ...al-1.SalesChannelTypes.SalesChannelDTO.mdx | 54 + ...esChannelTypes.SalesChannelLocationDTO.mdx | 38 + ...internal-1.SearchTypes.ISearchService.mdx} | 4 +- ....internal-1.WorkflowTypes.CartWorkflow.mdx | 14 + ...nternal-1.WorkflowTypes.CommonWorkflow.mdx | 13 + ...rnal-1.WorkflowTypes.InventoryWorkflow.mdx | 14 + ...ternal-1.WorkflowTypes.ProductWorkflow.mdx | 35 + .../classes/admin_auth.AdminAuthResource.mdx | 2 +- .../modules/admin_auth.internal.mdx | 4 +- .../modules/admin_discounts.internal.mdx | 2073 ++---- .../auth/classes/auth.AuthResource.mdx | 2 +- ..._discounts.internal.internal-1.Context.mdx | 71 + ...counts.internal.internal-1.ILinkModule.mdx | 461 ++ ...nts.internal.internal-1.JoinerArgument.mdx | 30 + ...ts.internal.internal-1.JoinerDirective.mdx | 30 + ...ternal.internal-1.JoinerServiceConfig.mdx} | 8 +- ...l.internal-1.JoinerServiceConfigAlias.mdx} | 2 +- ...rnal-1.ProductCategoryTransformOptions.mdx | 22 + ...ternal.internal-1.RemoteExpandProperty.mdx | 70 + ....internal.internal-1.RemoteJoinerQuery.mdx | 62 + ...nternal.internal-1.RemoteNestedExpands.mdx | 13 + ...scounts.internal.internal-1.CacheTypes.mdx | 15 + ...counts.internal.internal-1.CommonTypes.mdx | 503 ++ ...dmin_discounts.internal.internal-1.DAL.mdx | 97 + ...unts.internal.internal-1.EventBusTypes.mdx | 125 + ...s.internal.internal-1.FeatureFlagTypes.mdx | 79 + ...nts.internal.internal-1.InventoryTypes.mdx | 557 ++ ...counts.internal.internal-1.LoggerTypes.mdx | 15 + ...ts.internal.internal-1.ModulesSdkTypes.mdx | 617 ++ ...ounts.internal.internal-1.PricingTypes.mdx | 57 + ...ounts.internal.internal-1.ProductTypes.mdx | 54 + ....internal.internal-1.SalesChannelTypes.mdx | 14 + ...counts.internal.internal-1.SearchTypes.mdx | 48 + ...internal.internal-1.StockLocationTypes.mdx | 346 + ...ternal.internal-1.TransactionBaseTypes.mdx | 15 + ...unts.internal.internal-1.WorkflowTypes.mdx | 16 + ...iscounts.internal.internal-3.Writable.mdx} | 314 +- ...s.internal.internal-3.FinishedOptions.mdx} | 2 +- ...in_discounts.internal.internal-3.Pipe.mdx} | 2 +- ...s.internal.internal-3.PipelineOptions.mdx} | 2 +- ...s.internal.internal-3.ReadableOptions.mdx} | 6 +- ...nts.internal.internal-3.StreamOptions.mdx} | 2 +- ...s.internal.internal-3.WritableOptions.mdx} | 16 +- ...iscounts.internal.internal-3.finished.mdx} | 4 +- ...iscounts.internal.internal-3.pipeline.mdx} | 86 +- ...internal.AbstractEventBusModuleService.mdx | 10 +- ...scounts.internal.AbstractSearchService.mdx | 20 +- .../admin_discounts.internal.FlagRouter.mdx | 10 +- .../admin_discounts.internal.Readable.mdx | 4 +- .../admin_discounts.internal.ReadableBase.mdx | 2 +- .../admin_discounts.internal.Stream.mdx | 44 +- ...> admin_discounts.internal.internal-6.mdx} | 56 +- ...nternal.internal.AdminGetProductParams.mdx | 30 + ...l.internal.AdminPostProductsProductReq.mdx | 2 +- ...nts.internal.internal.NewTotalsService.mdx | 74 + ...ounts.internal.internal.PricingService.mdx | 144 + ...scounts.internal.BaseRepositoryService.mdx | 211 + ...admin_discounts.internal.DuplexOptions.mdx | 12 +- ...n_discounts.internal.IInventoryService.mdx | 96 +- ...scounts.internal.IPricingModuleService.mdx | 5665 ++++++++++++++ ...scounts.internal.IStockLocationService.mdx | 32 +- .../admin_discounts.internal.internal-1.mdx | 1367 +++- .../admin_discounts.internal.internal-2.mdx | 2112 ++---- .../admin_discounts.internal.internal-3.mdx | 1265 +++- .../admin_discounts.internal.internal-4.mdx | 605 +- .../admin_discounts.internal.internal-5.mdx | 255 + .../admin_discounts.internal.internal.mdx | 11 +- .../IPricingModuleService.addPrices.mdx | 8 +- .../methods/IPricingModuleService.create.mdx | 8 +- ...ricingModuleService.createMoneyAmounts.mdx | 4 +- ...rvice.listAndCountPriceSetMoneyAmounts.mdx | 290 + ...ModuleService.listPriceSetMoneyAmounts.mdx | 330 + ...rvice.retrievePriceSetMoneyAmountRules.mdx | 16 + .../docs/content/references/pricing/index.md | 1 + .../pricing/interfaces/AddPricesDTO.mdx | 4 +- .../interfaces/CreateMoneyAmountDTO.mdx | 4 +- .../pricing/interfaces/CreatePriceSetDTO.mdx | 4 +- .../pricing/interfaces/CreatePricesDTO.mdx | 4 +- .../FilterablePriceSetMoneyAmountProps.mdx | 46 + .../interfaces/IPricingModuleService.mdx | 2 + .../interfaces/PriceSetMoneyAmountDTO.mdx | 147 + .../PriceSetMoneyAmountRulesDTO.mdx | 89 + .../classes/AnalyticsConfigService.md | 125 +- .../services/classes/AuthService.md | 123 +- .../services/classes/BatchJobService.md | 228 +- .../services/classes/CartService.md | 669 +- .../services/classes/ClaimItemService.md | 143 +- .../services/classes/ClaimService.md | 277 +- .../services/classes/CurrencyService.md | 124 +- .../classes/CustomShippingOptionService.md | 117 +- .../services/classes/CustomerGroupService.md | 184 +- .../services/classes/CustomerService.md | 298 +- .../classes/DiscountConditionService.md | 140 +- .../services/classes/DiscountService.md | 375 +- .../services/classes/DraftOrderService.md | 210 +- .../services/classes/EventBusService.md | 183 +- .../classes/FulfillmentProviderService.md | 229 +- .../services/classes/FulfillmentService.md | 183 +- .../services/classes/GiftCardService.md | 211 +- .../services/classes/IdempotencyKeyService.md | 146 +- .../classes/LineItemAdjustmentService.md | 171 +- .../services/classes/LineItemService.md | 274 +- .../services/classes/MiddlewareService.md | 121 +- .../services/classes/NewTotalsService.md | 248 +- .../services/classes/NoteService.md | 157 +- .../services/classes/NotificationService.md | 210 +- .../services/classes/OauthService.md | 179 +- .../classes/OrderEditItemChangeService.md | 138 +- .../services/classes/OrderEditService.md | 337 +- .../services/classes/OrderService.md | 516 +- .../classes/PaymentCollectionService.md | 205 +- .../classes/PaymentProviderService.md | 425 +- .../services/classes/PaymentService.md | 151 +- .../services/classes/PriceListService.md | 304 +- .../services/classes/PricingService.md | 371 +- .../classes/ProductCategoryService.md | 242 +- .../classes/ProductCollectionService.md | 197 +- .../services/classes/ProductService.md | 371 +- .../services/classes/ProductTypeService.md | 113 +- .../classes/ProductVariantInventoryService.md | 304 +- .../services/classes/ProductVariantService.md | 381 +- .../services/classes/RegionService.md | 328 +- .../services/classes/ReturnReasonService.md | 133 +- .../services/classes/ReturnService.md | 274 +- .../classes/SalesChannelInventoryService.md | 97 +- .../classes/SalesChannelLocationService.md | 130 +- .../services/classes/SalesChannelService.md | 214 +- .../services/classes/SearchService.md | 111 +- .../services/classes/ShippingOptionService.md | 294 +- .../classes/ShippingProfileService.md | 277 +- .../services/classes/StagedJobService.md | 112 +- .../services/classes/StoreService.md | 148 +- .../classes/StrategyResolverService.md | 88 +- .../services/classes/SwapService.md | 342 +- .../classes/SystemPaymentProviderService.md | 224 +- .../services/classes/TaxProviderService.md | 244 +- .../services/classes/TaxRateService.md | 258 +- .../services/classes/TokenService.md | 38 +- .../services/classes/TotalsService.md | 358 +- .../services/classes/UserService.md | 208 +- 271 files changed, 38173 insertions(+), 9836 deletions(-) create mode 100644 www/apps/docs/content/references/js-client/CartWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.CartWorkflow.CreateCartWorkflowInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/CartWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.CartWorkflow.CreateLineItemInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.AddressCreatePayload.mdx create mode 100644 www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.AddressPayload.mdx create mode 100644 www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.BaseEntity.mdx create mode 100644 www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.CustomFindOptions.mdx create mode 100644 www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.DateComparisonOperator.mdx create mode 100644 www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.EmptyQueryParams.mdx rename www/apps/docs/content/references/js-client/{internal/interfaces/admin_discounts.internal.FindConfig.mdx => CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindConfig.mdx} (92%) create mode 100644 www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindPaginationParams.mdx create mode 100644 www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindParams.mdx rename www/apps/docs/content/references/js-client/{internal/interfaces/admin_discounts.internal.NumericalComparisonOperator.mdx => CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.NumericalComparisonOperator.mdx} (79%) create mode 100644 www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.RepositoryTransformOptions.mdx create mode 100644 www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.SoftDeletableEntity.mdx rename www/apps/docs/content/references/js-client/{internal/interfaces/admin_discounts.internal.StringComparisonOperator.mdx => CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.StringComparisonOperator.mdx} (86%) create mode 100644 www/apps/docs/content/references/js-client/CommonWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.CommonWorkflow.WorkflowInputConfig.mdx create mode 100644 www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx create mode 100644 www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.OptionsQuery.mdx create mode 100644 www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.RepositoryService.mdx create mode 100644 www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.RestoreReturn.mdx create mode 100644 www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.SoftDeleteReturn.mdx create mode 100644 www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.TreeRepositoryService.mdx rename www/apps/docs/content/references/js-client/{internal/interfaces/admin_discounts.internal.IFlagRouter.mdx => FeatureFlagTypes/interfaces/admin_discounts.internal.internal-1.FeatureFlagTypes.IFlagRouter.mdx} (54%) create mode 100644 www/apps/docs/content/references/js-client/InventoryWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.InventoryWorkflow.CreateInventoryItemInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/InventoryWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.InventoryWorkflow.CreateInventoryItemsWorkflowInputDTO.mdx rename www/apps/docs/content/references/js-client/{internal/enums/admin_discounts.internal.MODULE_RESOURCE_TYPE.mdx => ModulesSdkTypes/enums/admin_discounts.internal.internal-1.ModulesSdkTypes.MODULE_RESOURCE_TYPE.mdx} (56%) create mode 100644 www/apps/docs/content/references/js-client/ModulesSdkTypes/enums/admin_discounts.internal.internal-1.ModulesSdkTypes.MODULE_SCOPE.mdx create mode 100644 www/apps/docs/content/references/js-client/ModulesSdkTypes/interfaces/admin_discounts.internal.internal-1.ModulesSdkTypes.ModuleServiceInitializeOptions.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.AddPricesDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.AddRulesDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CalculatedPriceSetDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreateCurrencyDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreateMoneyAmountDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceRuleDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetMoneyAmountDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetMoneyAmountRulesDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetRuleTypeDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePricesDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreateRuleTypeDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterableCurrencyProps.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterableMoneyAmountProps.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceRuleProps.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetMoneyAmountProps.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetMoneyAmountRulesProps.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetProps.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetRuleTypeProps.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterableRuleTypeProps.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceRuleDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountRulesDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetRuleTypeDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PricingContext.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PricingFilters.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RemovePriceSetRulesDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdateCurrencyDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdateMoneyAmountDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceRuleDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetMoneyAmountDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetMoneyAmountRulesDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetRuleTypeDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdateRuleTypeDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductCategoryDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductCollectionDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductOnlyDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductOptionDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductOptionOnlyDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductTagDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductTypeDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantOnlyDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantOptionDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductCategoryProps.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductCollectionProps.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductOptionProps.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductProps.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductTagProps.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductTypeProps.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductVariantProps.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.IProductModuleService.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductImageDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductOptionValueDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductVariantDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductCategoryDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductCollectionDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductOptionDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductTagDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductTypeDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductVariantDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductVariantOnlyDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpsertProductTagDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpsertProductTypeDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductOptionInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductProductCategoryInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductSalesChannelInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductTagInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductTypeInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductVariantInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductVariantPricesInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductsWorkflowInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreteProductVariantOptionInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductProductCategoryInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductSalesChannelInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductTagInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductTypeInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantOptionInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantPricesInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantsInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantsWorkflowInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductsWorkflowInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpsertProductVariantOptionInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpsertProductVariantPricesInputDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/SalesChannelTypes/interfaces/admin_discounts.internal.internal-1.SalesChannelTypes.SalesChannelDTO.mdx create mode 100644 www/apps/docs/content/references/js-client/SalesChannelTypes/interfaces/admin_discounts.internal.internal-1.SalesChannelTypes.SalesChannelLocationDTO.mdx rename www/apps/docs/content/references/js-client/{internal/interfaces/admin_discounts.internal.ISearchService.mdx => SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx} (95%) create mode 100644 www/apps/docs/content/references/js-client/WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.CartWorkflow.mdx create mode 100644 www/apps/docs/content/references/js-client/WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.CommonWorkflow.mdx create mode 100644 www/apps/docs/content/references/js-client/WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.InventoryWorkflow.mdx create mode 100644 www/apps/docs/content/references/js-client/WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx create mode 100644 www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx create mode 100644 www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.ILinkModule.mdx create mode 100644 www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.JoinerArgument.mdx create mode 100644 www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.JoinerDirective.mdx rename www/apps/docs/content/references/js-client/{internal/interfaces/admin_discounts.internal.JoinerServiceConfig.mdx => internal-1/interfaces/admin_discounts.internal.internal-1.JoinerServiceConfig.mdx} (71%) rename www/apps/docs/content/references/js-client/{internal/interfaces/admin_discounts.internal.JoinerServiceConfigAlias.mdx => internal-1/interfaces/admin_discounts.internal.internal-1.JoinerServiceConfigAlias.mdx} (76%) create mode 100644 www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.ProductCategoryTransformOptions.mdx create mode 100644 www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.RemoteExpandProperty.mdx create mode 100644 www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.RemoteJoinerQuery.mdx create mode 100644 www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.RemoteNestedExpands.mdx create mode 100644 www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.CacheTypes.mdx create mode 100644 www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx create mode 100644 www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.DAL.mdx create mode 100644 www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.EventBusTypes.mdx create mode 100644 www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.FeatureFlagTypes.mdx create mode 100644 www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.InventoryTypes.mdx create mode 100644 www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.LoggerTypes.mdx create mode 100644 www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx create mode 100644 www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx create mode 100644 www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx create mode 100644 www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.SalesChannelTypes.mdx create mode 100644 www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.SearchTypes.mdx create mode 100644 www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.StockLocationTypes.mdx create mode 100644 www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.TransactionBaseTypes.mdx create mode 100644 www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx rename www/apps/docs/content/references/js-client/{internal-2/classes/admin_discounts.internal.internal-2.Writable.mdx => internal-3/classes/admin_discounts.internal.internal-3.Writable.mdx} (91%) rename www/apps/docs/content/references/js-client/{internal-2/interfaces/admin_discounts.internal.internal-2.FinishedOptions.mdx => internal-3/interfaces/admin_discounts.internal.internal-3.FinishedOptions.mdx} (96%) rename www/apps/docs/content/references/js-client/{internal-2/interfaces/admin_discounts.internal.internal-2.Pipe.mdx => internal-3/interfaces/admin_discounts.internal.internal-3.Pipe.mdx} (98%) rename www/apps/docs/content/references/js-client/{internal-2/interfaces/admin_discounts.internal.internal-2.PipelineOptions.mdx => internal-3/interfaces/admin_discounts.internal.internal-3.PipelineOptions.mdx} (94%) rename www/apps/docs/content/references/js-client/{internal-2/interfaces/admin_discounts.internal.internal-2.ReadableOptions.mdx => internal-3/interfaces/admin_discounts.internal.internal-3.ReadableOptions.mdx} (93%) rename www/apps/docs/content/references/js-client/{internal-2/interfaces/admin_discounts.internal.internal-2.StreamOptions.mdx => internal-3/interfaces/admin_discounts.internal.internal-3.StreamOptions.mdx} (98%) rename www/apps/docs/content/references/js-client/{internal-2/interfaces/admin_discounts.internal.internal-2.WritableOptions.mdx => internal-3/interfaces/admin_discounts.internal.internal-3.WritableOptions.mdx} (93%) rename www/apps/docs/content/references/js-client/{internal-2/modules/admin_discounts.internal.internal-2.finished.mdx => internal-3/modules/admin_discounts.internal.internal-3.finished.mdx} (94%) rename www/apps/docs/content/references/js-client/{internal-2/modules/admin_discounts.internal.internal-2.pipeline.mdx => internal-3/modules/admin_discounts.internal.internal-3.pipeline.mdx} (82%) rename www/apps/docs/content/references/js-client/internal/classes/{admin_discounts.internal.internal-5.mdx => admin_discounts.internal.internal-6.mdx} (96%) create mode 100644 www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.internal.AdminGetProductParams.mdx create mode 100644 www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.BaseRepositoryService.mdx create mode 100644 www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.IPricingModuleService.mdx create mode 100644 www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal-5.mdx create mode 100644 www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.listAndCountPriceSetMoneyAmounts.mdx create mode 100644 www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.listPriceSetMoneyAmounts.mdx create mode 100644 www/apps/docs/content/references/pricing/interfaces/FilterablePriceSetMoneyAmountProps.mdx diff --git a/packages/types/src/pricing/common/price-set-money-amount.ts b/packages/types/src/pricing/common/price-set-money-amount.ts index 2dc983e78d324..479d2818d22d1 100644 --- a/packages/types/src/pricing/common/price-set-money-amount.ts +++ b/packages/types/src/pricing/common/price-set-money-amount.ts @@ -35,6 +35,14 @@ export interface CreatePriceSetMoneyAmountDTO { money_amount?: MoneyAmountDTO | string } +/** + * @interface + * + * Filters to apply on price set money amounts. + * + * @prop id - The IDs to filter the price set money amounts by. + * @prop price_set_id - The IDs to filter the price set money amount's associated price set. + */ export interface FilterablePriceSetMoneyAmountProps extends BaseFilterable { id?: string[] diff --git a/packages/types/src/pricing/service.ts b/packages/types/src/pricing/service.ts index 12bc2c19705ce..a5c6e29beb044 100644 --- a/packages/types/src/pricing/service.ts +++ b/packages/types/src/pricing/service.ts @@ -2200,13 +2200,215 @@ export interface IPricingModuleService { sharedContext?: Context ): Promise<[PriceSetMoneyAmountRulesDTO[], number]> - + /** + * This method is used to retrieve a paginated list of price set money amounts based on optional filters and configuration. + * + * @param {FilterablePriceSetMoneyAmountProps} filters - The filters to apply on the retrieved price set money amounts. + * @param {FindConfig} config - + * The configurations determining how the price set money amounts are retrieved. Its properties, such as `select` or `relations`, accept the + * attributes or relations associated with a price set money amount. + * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module. + * @returns {Promise} The list of price set money amounts. + * + * @example + * + * To retrieve a list of price set money amounts using their IDs: + * + * ```ts + * import { + * initialize as initializePricingModule, + * } from "@medusajs/pricing" + * + * async function retrievePriceSetMoneyAmounts (id: string) { + * const pricingService = await initializePricingModule() + * + * const priceSetMoneyAmounts = await pricingService.listPriceSetMoneyAmounts({ + * id: [id] + * }) + * + * // do something with the price set money amounts or return them + * } + * ``` + * + * To specify relations that should be retrieved within the price set money amounts: + * + * ```ts + * import { + * initialize as initializePricingModule, + * } from "@medusajs/pricing" + * + * async function retrievePriceSetMoneyAmounts (id: string) { + * const pricingService = await initializePricingModule() + * + * const priceSetMoneyAmounts = await pricingService.listPriceSetMoneyAmounts({ + * id: [id] + * }, { + * relations: ["price_rules"] + * }) + * + * // do something with the price set money amounts or return them + * } + * ``` + * + * By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + * + * ```ts + * import { + * initialize as initializePricingModule, + * } from "@medusajs/pricing" + * + * async function retrievePriceSetMoneyAmounts (id: string, skip: number, take: number) { + * const pricingService = await initializePricingModule() + * + * const priceSetMoneyAmounts = await pricingService.listPriceSetMoneyAmounts({ + * id: [id] + * }, { + * relations: ["price_rules"], + * skip, + * take + * }) + * + * // do something with the price set money amounts or return them + * } + * ``` + * + * You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + * + * ```ts + * import { + * initialize as initializePricingModule, + * } from "@medusajs/pricing" + * + * async function retrievePriceSetMoneyAmounts (ids: string[], titles: string[], skip: number, take: number) { + * const pricingService = await initializePricingModule() + * + * const priceSetMoneyAmounts = await pricingService.listPriceSetMoneyAmounts({ + * $and: [ + * { + * id: ids + * }, + * { + * title: titles + * } + * ] + * }, { + * relations: ["price_rules"], + * skip, + * take + * }) + * + * // do something with the price set money amounts or return them + * } + * ``` + */ listPriceSetMoneyAmounts( filters?: FilterablePriceSetMoneyAmountProps, config?: FindConfig, sharedContext?: Context ): Promise + /** + * This method is used to retrieve a paginated list of price set money amounts along with the total count of + * available price set money amounts satisfying the provided filters. + * + * @param {FilterablePriceSetMoneyAmountProps} filters - The filters to apply on the retrieved price set money amounts. + * @param {FindConfig} config - + * The configurations determining how the price set money amounts are retrieved. Its properties, such as `select` or `relations`, accept the + * attributes or relations associated with a price set money amount. + * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module. + * @returns {Promise<[PriceSetMoneyAmountDTO[], number]>} The list of price set money amounts and their total count. + * + * @example + * + * To retrieve a list of price set money amounts using their IDs: + * + * ```ts + * import { + * initialize as initializePricingModule, + * } from "@medusajs/pricing" + * + * async function retrievePriceSetMoneyAmounts (id: string) { + * const pricingService = await initializePricingModule() + * + * const [priceSetMoneyAmounts, count] = await pricingService.listAndCountPriceSetMoneyAmounts({ + * id: [id] + * }) + * + * // do something with the price set money amounts or return them + * } + * ``` + * + * To specify relations that should be retrieved within the price set money amounts: + * + * ```ts + * import { + * initialize as initializePricingModule, + * } from "@medusajs/pricing" + * + * async function retrievePriceSetMoneyAmounts (id: string) { + * const pricingService = await initializePricingModule() + * + * const [priceSetMoneyAmounts, count] = await pricingService.listAndCountPriceSetMoneyAmounts({ + * id: [id] + * }, { + * relations: ["price_rules"], + * }) + * + * // do something with the price set money amounts or return them + * } + * ``` + * + * By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + * + * ```ts + * import { + * initialize as initializePricingModule, + * } from "@medusajs/pricing" + * + * async function retrievePriceSetMoneyAmounts (id: string, skip: number, take: number) { + * const pricingService = await initializePricingModule() + * + * const [priceSetMoneyAmounts, count] = await pricingService.listAndCountPriceSetMoneyAmounts({ + * id: [id] + * }, { + * relations: ["price_rules"], + * skip, + * take + * }) + * + * // do something with the price set money amounts or return them + * } + * ``` + * + * You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + * + * ```ts + * import { + * initialize as initializePricingModule, + * } from "@medusajs/pricing" + * + * async function retrievePriceSetMoneyAmounts (ids: string[], titles: string[], skip: number, take: number) { + * const pricingService = await initializePricingModule() + * + * const [priceSetMoneyAmounts, count] = await pricingService.listAndCountPriceSetMoneyAmounts({ + * $and: [ + * { + * id: ids + * }, + * { + * title: titles + * } + * ] + * }, { + * relations: ["price_rules"], + * skip, + * take + * }) + * + * // do something with the price set money amounts or return them + * } + * ``` + */ listAndCountPriceSetMoneyAmounts( filters?: FilterablePriceSetMoneyAmountProps, config?: FindConfig, diff --git a/www/apps/docs/content/references/js-client/CartWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.CartWorkflow.CreateCartWorkflowInputDTO.mdx b/www/apps/docs/content/references/js-client/CartWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.CartWorkflow.CreateCartWorkflowInputDTO.mdx new file mode 100644 index 0000000000000..d125350054b3c --- /dev/null +++ b/www/apps/docs/content/references/js-client/CartWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.CartWorkflow.CreateCartWorkflowInputDTO.mdx @@ -0,0 +1,102 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateCartWorkflowInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[CartWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.CartWorkflow.mdx).CreateCartWorkflowInputDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/CartWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.CartWorkflow.CreateLineItemInputDTO.mdx b/www/apps/docs/content/references/js-client/CartWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.CartWorkflow.CreateLineItemInputDTO.mdx new file mode 100644 index 0000000000000..6e25f2c9ba5c6 --- /dev/null +++ b/www/apps/docs/content/references/js-client/CartWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.CartWorkflow.CreateLineItemInputDTO.mdx @@ -0,0 +1,30 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateLineItemInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[CartWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.CartWorkflow.mdx).CreateLineItemInputDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.AddressCreatePayload.mdx b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.AddressCreatePayload.mdx new file mode 100644 index 0000000000000..5f92a1cb0ab8e --- /dev/null +++ b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.AddressCreatePayload.mdx @@ -0,0 +1,102 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# AddressCreatePayload + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[CommonTypes](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx).AddressCreatePayload + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.AddressPayload.mdx b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.AddressPayload.mdx new file mode 100644 index 0000000000000..5afaf735d3d2b --- /dev/null +++ b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.AddressPayload.mdx @@ -0,0 +1,102 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# AddressPayload + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[CommonTypes](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx).AddressPayload + +## Properties + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "phone", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "postal_code", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "province", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.BaseEntity.mdx b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.BaseEntity.mdx new file mode 100644 index 0000000000000..10b897c02da51 --- /dev/null +++ b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.BaseEntity.mdx @@ -0,0 +1,38 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# BaseEntity + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[CommonTypes](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx).BaseEntity + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.CustomFindOptions.mdx b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.CustomFindOptions.mdx new file mode 100644 index 0000000000000..974ea8edb3a94 --- /dev/null +++ b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.CustomFindOptions.mdx @@ -0,0 +1,75 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CustomFindOptions + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[CommonTypes](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx).CustomFindOptions + +## Type parameters + + + +## Properties + + \\| `FindOptionsSelectByString`<`TModel`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "where", + "type": "`FindOptionsWhere`<`TModel`\\> & { [P in string \\| number \\| symbol]?: TModel[P][] } \\| `FindOptionsWhere`<`TModel`\\>[] & { [P in string \\| number \\| symbol]?: TModel[P][] }", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.DateComparisonOperator.mdx b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.DateComparisonOperator.mdx new file mode 100644 index 0000000000000..0b8452cea55d1 --- /dev/null +++ b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.DateComparisonOperator.mdx @@ -0,0 +1,46 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# DateComparisonOperator + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[CommonTypes](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx).DateComparisonOperator + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.EmptyQueryParams.mdx b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.EmptyQueryParams.mdx new file mode 100644 index 0000000000000..c394ee295b03e --- /dev/null +++ b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.EmptyQueryParams.mdx @@ -0,0 +1,9 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# EmptyQueryParams + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[CommonTypes](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx).EmptyQueryParams diff --git a/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.FindConfig.mdx b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindConfig.mdx similarity index 92% rename from www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.FindConfig.mdx rename to www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindConfig.mdx index 29e3bf319e38b..1b03a2f3088c9 100644 --- a/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.FindConfig.mdx +++ b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindConfig.mdx @@ -6,7 +6,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" # FindConfig -[admin/discounts](../../modules/admin_discounts.mdx).[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).FindConfig +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[CommonTypes](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx).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. diff --git a/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindPaginationParams.mdx b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindPaginationParams.mdx new file mode 100644 index 0000000000000..02a1fbc2bdaae --- /dev/null +++ b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindPaginationParams.mdx @@ -0,0 +1,30 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FindPaginationParams + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[CommonTypes](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx).FindPaginationParams + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindParams.mdx b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindParams.mdx new file mode 100644 index 0000000000000..bdb179f11b927 --- /dev/null +++ b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindParams.mdx @@ -0,0 +1,30 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FindParams + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[CommonTypes](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx).FindParams + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.NumericalComparisonOperator.mdx b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.NumericalComparisonOperator.mdx similarity index 79% rename from www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.NumericalComparisonOperator.mdx rename to www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.NumericalComparisonOperator.mdx index e766a7acbbba3..b3f6a6cb384bf 100644 --- a/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.NumericalComparisonOperator.mdx +++ b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.NumericalComparisonOperator.mdx @@ -6,7 +6,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" # NumericalComparisonOperator -[admin/discounts](../../modules/admin_discounts.mdx).[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).NumericalComparisonOperator +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[CommonTypes](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx).NumericalComparisonOperator ## Properties diff --git a/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.RepositoryTransformOptions.mdx b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.RepositoryTransformOptions.mdx new file mode 100644 index 0000000000000..ac67c1c6685fd --- /dev/null +++ b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.RepositoryTransformOptions.mdx @@ -0,0 +1,9 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# RepositoryTransformOptions + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[CommonTypes](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx).RepositoryTransformOptions diff --git a/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.SoftDeletableEntity.mdx b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.SoftDeletableEntity.mdx new file mode 100644 index 0000000000000..82fff16f89b82 --- /dev/null +++ b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.SoftDeletableEntity.mdx @@ -0,0 +1,46 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# SoftDeletableEntity + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[CommonTypes](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx).SoftDeletableEntity + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.StringComparisonOperator.mdx b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.StringComparisonOperator.mdx similarity index 86% rename from www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.StringComparisonOperator.mdx rename to www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.StringComparisonOperator.mdx index a4da7a4121a79..af1e1749b1d6e 100644 --- a/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.StringComparisonOperator.mdx +++ b/www/apps/docs/content/references/js-client/CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.StringComparisonOperator.mdx @@ -6,7 +6,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" # StringComparisonOperator -[admin/discounts](../../modules/admin_discounts.mdx).[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).StringComparisonOperator +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[CommonTypes](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx).StringComparisonOperator ## Properties diff --git a/www/apps/docs/content/references/js-client/CommonWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.CommonWorkflow.WorkflowInputConfig.mdx b/www/apps/docs/content/references/js-client/CommonWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.CommonWorkflow.WorkflowInputConfig.mdx new file mode 100644 index 0000000000000..45d2814c13faa --- /dev/null +++ b/www/apps/docs/content/references/js-client/CommonWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.CommonWorkflow.WorkflowInputConfig.mdx @@ -0,0 +1,62 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# WorkflowInputConfig + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[CommonWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.CommonWorkflow.mdx).WorkflowInputConfig + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx b/www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx new file mode 100644 index 0000000000000..89c88cd6e5d12 --- /dev/null +++ b/www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx @@ -0,0 +1,45 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# BaseFilterable + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[DAL](../../internal-1/modules/admin_discounts.internal.internal-1.DAL.mdx).BaseFilterable + +An object used to allow specifying flexible queries with and/or conditions. + +## Type parameters + + + +## Properties + + \\| `T`)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`BaseFilterable`](admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx)<`T`\\> \\| `T`)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.OptionsQuery.mdx b/www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.OptionsQuery.mdx new file mode 100644 index 0000000000000..f6863b47a0988 --- /dev/null +++ b/www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.OptionsQuery.mdx @@ -0,0 +1,91 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# OptionsQuery + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[DAL](../../internal-1/modules/admin_discounts.internal.internal-1.DAL.mdx).OptionsQuery + +## Type parameters + + + +## Properties + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "groupBy", + "type": "`string` \\| `string`[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "limit", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "offset", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "orderBy", + "type": "[`Order`](../../admin_discounts/modules/admin_discounts.internal.mdx#order)<`T`\\> \\| [`Order`](../../admin_discounts/modules/admin_discounts.internal.mdx#order)<`T`\\>[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "populate", + "type": "`string`[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.RepositoryService.mdx b/www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.RepositoryService.mdx new file mode 100644 index 0000000000000..c20a86f9d39a1 --- /dev/null +++ b/www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.RepositoryService.mdx @@ -0,0 +1,601 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# RepositoryService + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[DAL](../../internal-1/modules/admin_discounts.internal.internal-1.DAL.mdx).RepositoryService + +Data access layer (DAL) interface to implements for any repository service. +This layer helps to separate the business logic (service layer) from accessing the +ORM directly and allows to switch to another ORM without changing the business logic. + +## Type parameters + + + +## Methods + +### create + +**create**(`data`, `context?`): `Promise`<`T`[]\> + +#### Parameters + + + +#### Returns + +`Promise`<`T`[]\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "T[]", + "type": "`T`[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### delete + +**delete**(`ids`, `context?`): `Promise`<`void`\> + +#### Parameters + + + +#### Returns + +`Promise`<`void`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } +]} /> + +___ + +### find + +**find**(`options?`, `context?`): `Promise`<`T`[]\> + +#### Parameters + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "context", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<`T`[]\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "T[]", + "type": "`T`[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### findAndCount + +**findAndCount**(`options?`, `context?`): `Promise`<[`T`[], `number`]\> + +#### Parameters + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "context", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`T`[], `number`]\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "T[]", + "type": "`T`[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### getActiveManager + +**getActiveManager**<`TManager`\>(): `TManager` + + + +#### Returns + +`TManager` + + + +#### Inherited from + +[BaseRepositoryService](../../internal/interfaces/admin_discounts.internal.BaseRepositoryService.mdx).[getActiveManager](../../internal/interfaces/admin_discounts.internal.BaseRepositoryService.mdx#getactivemanager) + +___ + +### getFreshManager + +**getFreshManager**<`TManager`\>(): `TManager` + + + +#### Returns + +`TManager` + + + +#### Inherited from + +[BaseRepositoryService](../../internal/interfaces/admin_discounts.internal.BaseRepositoryService.mdx).[getFreshManager](../../internal/interfaces/admin_discounts.internal.BaseRepositoryService.mdx#getfreshmanager) + +___ + +### restore + +**restore**(`ids`, `context?`): `Promise`<[`T`[], Record<`string`, `unknown`[]\>]\> + +#### Parameters + + + +#### Returns + +`Promise`<[`T`[], Record<`string`, `unknown`[]\>]\> + +]\\>", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "T[]", + "type": "`T`[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "Record", + "type": "Record<`string`, `unknown`[]\\>", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### serialize + +**serialize**<`TOutput`\>(`data`, `options?`): `Promise`<`TOutput`\> + + + +#### Parameters + + + +#### Returns + +`Promise`<`TOutput`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } +]} /> + +#### Inherited from + +[BaseRepositoryService](../../internal/interfaces/admin_discounts.internal.BaseRepositoryService.mdx).[serialize](../../internal/interfaces/admin_discounts.internal.BaseRepositoryService.mdx#serialize) + +___ + +### softDelete + +**softDelete**(`ids`, `context?`): `Promise`<[`T`[], Record<`string`, `unknown`[]\>]\> + +Soft delete entities and cascade to related entities if configured. + +#### Parameters + + + +#### Returns + +`Promise`<[`T`[], Record<`string`, `unknown`[]\>]\> + +]\\>", + "optional": false, + "defaultValue": "", + "description": "[T[], Record] the second value being the map of the entity names and ids that were soft deleted", + "children": [ + { + "name": "T[]", + "type": "`T`[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "Record", + "type": "Record<`string`, `unknown`[]\\>", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### transaction + +**transaction**<`TManager`\>(`task`, `context?`): `Promise`<`any`\> + + + +#### Parameters + + `Promise`<`any`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "context", + "type": "`object`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "context.enableNestedTransactions", + "type": "`boolean`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "context.isolationLevel", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "context.transaction", + "type": "`TManager`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<`any`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "any", + "type": "`any`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +#### Inherited from + +[BaseRepositoryService](../../internal/interfaces/admin_discounts.internal.BaseRepositoryService.mdx).[transaction](../../internal/interfaces/admin_discounts.internal.BaseRepositoryService.mdx#transaction) + +___ + +### update + +**update**(`data`, `context?`): `Promise`<`T`[]\> + +#### Parameters + + + +#### Returns + +`Promise`<`T`[]\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "T[]", + "type": "`T`[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.RestoreReturn.mdx b/www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.RestoreReturn.mdx new file mode 100644 index 0000000000000..c5ac2e3e0a756 --- /dev/null +++ b/www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.RestoreReturn.mdx @@ -0,0 +1,37 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# RestoreReturn + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[DAL](../../internal-1/modules/admin_discounts.internal.internal-1.DAL.mdx).RestoreReturn + +An object that is used to specify an entity's related entities that should be restored when the main entity is restored. + +## Type parameters + + + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.SoftDeleteReturn.mdx b/www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.SoftDeleteReturn.mdx new file mode 100644 index 0000000000000..a58df99f3866f --- /dev/null +++ b/www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.SoftDeleteReturn.mdx @@ -0,0 +1,37 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# SoftDeleteReturn + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[DAL](../../internal-1/modules/admin_discounts.internal.internal-1.DAL.mdx).SoftDeleteReturn + +An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted. + +## Type parameters + + + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.TreeRepositoryService.mdx b/www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.TreeRepositoryService.mdx new file mode 100644 index 0000000000000..33c6ba31fa9ab --- /dev/null +++ b/www/apps/docs/content/references/js-client/DAL/interfaces/admin_discounts.internal.internal-1.DAL.TreeRepositoryService.mdx @@ -0,0 +1,437 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# TreeRepositoryService + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[DAL](../../internal-1/modules/admin_discounts.internal.internal-1.DAL.mdx).TreeRepositoryService + +Data access layer (DAL) interface to implements for any repository service. +This layer helps to separate the business logic (service layer) from accessing the +ORM directly and allows to switch to another ORM without changing the business logic. + +## Type parameters + + + +## Methods + +### create + +**create**(`data`, `context?`): `Promise`<`T`\> + +#### Parameters + + + +#### Returns + +`Promise`<`T`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } +]} /> + +___ + +### delete + +**delete**(`id`, `context?`): `Promise`<`void`\> + +#### Parameters + + + +#### Returns + +`Promise`<`void`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } +]} /> + +___ + +### find + +**find**(`options?`, `transformOptions?`, `context?`): `Promise`<`T`[]\> + +#### Parameters + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transformOptions", + "type": "[`RepositoryTransformOptions`](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.RepositoryTransformOptions.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "context", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<`T`[]\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "T[]", + "type": "`T`[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### findAndCount + +**findAndCount**(`options?`, `transformOptions?`, `context?`): `Promise`<[`T`[], `number`]\> + +#### Parameters + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transformOptions", + "type": "[`RepositoryTransformOptions`](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.RepositoryTransformOptions.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "context", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`T`[], `number`]\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "T[]", + "type": "`T`[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### getActiveManager + +**getActiveManager**<`TManager`\>(): `TManager` + + + +#### Returns + +`TManager` + + + +#### Inherited from + +[BaseRepositoryService](../../internal/interfaces/admin_discounts.internal.BaseRepositoryService.mdx).[getActiveManager](../../internal/interfaces/admin_discounts.internal.BaseRepositoryService.mdx#getactivemanager) + +___ + +### getFreshManager + +**getFreshManager**<`TManager`\>(): `TManager` + + + +#### Returns + +`TManager` + + + +#### Inherited from + +[BaseRepositoryService](../../internal/interfaces/admin_discounts.internal.BaseRepositoryService.mdx).[getFreshManager](../../internal/interfaces/admin_discounts.internal.BaseRepositoryService.mdx#getfreshmanager) + +___ + +### serialize + +**serialize**<`TOutput`\>(`data`, `options?`): `Promise`<`TOutput`\> + + + +#### Parameters + + + +#### Returns + +`Promise`<`TOutput`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } +]} /> + +#### Inherited from + +[BaseRepositoryService](../../internal/interfaces/admin_discounts.internal.BaseRepositoryService.mdx).[serialize](../../internal/interfaces/admin_discounts.internal.BaseRepositoryService.mdx#serialize) + +___ + +### transaction + +**transaction**<`TManager`\>(`task`, `context?`): `Promise`<`any`\> + + + +#### Parameters + + `Promise`<`any`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "context", + "type": "`object`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "context.enableNestedTransactions", + "type": "`boolean`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "context.isolationLevel", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "context.transaction", + "type": "`TManager`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<`any`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "any", + "type": "`any`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +#### Inherited from + +[BaseRepositoryService](../../internal/interfaces/admin_discounts.internal.BaseRepositoryService.mdx).[transaction](../../internal/interfaces/admin_discounts.internal.BaseRepositoryService.mdx#transaction) diff --git a/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.IFlagRouter.mdx b/www/apps/docs/content/references/js-client/FeatureFlagTypes/interfaces/admin_discounts.internal.internal-1.FeatureFlagTypes.IFlagRouter.mdx similarity index 54% rename from www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.IFlagRouter.mdx rename to www/apps/docs/content/references/js-client/FeatureFlagTypes/interfaces/admin_discounts.internal.internal-1.FeatureFlagTypes.IFlagRouter.mdx index 6072a884a20a5..bc11b6c491540 100644 --- a/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.IFlagRouter.mdx +++ b/www/apps/docs/content/references/js-client/FeatureFlagTypes/interfaces/admin_discounts.internal.internal-1.FeatureFlagTypes.IFlagRouter.mdx @@ -6,11 +6,11 @@ import ParameterTypes from "@site/src/components/ParameterTypes" # IFlagRouter -[admin/discounts](../../modules/admin_discounts.mdx).[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).IFlagRouter +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[FeatureFlagTypes](../../internal-1/modules/admin_discounts.internal.internal-1.FeatureFlagTypes.mdx).IFlagRouter ## Implemented by -- [`FlagRouter`](../classes/admin_discounts.internal.FlagRouter.mdx) +- [`FlagRouter`](../../internal/classes/admin_discounts.internal.FlagRouter.mdx) ## Properties @@ -25,7 +25,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "listFlags", - "type": "() => [`FeatureFlagsResponse`](../../admin_discounts/modules/admin_discounts.internal.mdx#featureflagsresponse-1)", + "type": "() => [`FeatureFlagsResponse`](../../internal-1/modules/admin_discounts.internal.internal-1.FeatureFlagTypes.mdx#featureflagsresponse)", "description": "", "optional": false, "defaultValue": "", diff --git a/www/apps/docs/content/references/js-client/InventoryWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.InventoryWorkflow.CreateInventoryItemInputDTO.mdx b/www/apps/docs/content/references/js-client/InventoryWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.InventoryWorkflow.CreateInventoryItemInputDTO.mdx new file mode 100644 index 0000000000000..675041f4e238f --- /dev/null +++ b/www/apps/docs/content/references/js-client/InventoryWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.InventoryWorkflow.CreateInventoryItemInputDTO.mdx @@ -0,0 +1,118 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateInventoryItemInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[InventoryWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.InventoryWorkflow.mdx).CreateInventoryItemInputDTO + +## Properties + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/InventoryWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.InventoryWorkflow.CreateInventoryItemsWorkflowInputDTO.mdx b/www/apps/docs/content/references/js-client/InventoryWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.InventoryWorkflow.CreateInventoryItemsWorkflowInputDTO.mdx new file mode 100644 index 0000000000000..430346f39b0d0 --- /dev/null +++ b/www/apps/docs/content/references/js-client/InventoryWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.InventoryWorkflow.CreateInventoryItemsWorkflowInputDTO.mdx @@ -0,0 +1,22 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateInventoryItemsWorkflowInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[InventoryWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.InventoryWorkflow.mdx).CreateInventoryItemsWorkflowInputDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/internal/enums/admin_discounts.internal.MODULE_RESOURCE_TYPE.mdx b/www/apps/docs/content/references/js-client/ModulesSdkTypes/enums/admin_discounts.internal.internal-1.ModulesSdkTypes.MODULE_RESOURCE_TYPE.mdx similarity index 56% rename from www/apps/docs/content/references/js-client/internal/enums/admin_discounts.internal.MODULE_RESOURCE_TYPE.mdx rename to www/apps/docs/content/references/js-client/ModulesSdkTypes/enums/admin_discounts.internal.internal-1.ModulesSdkTypes.MODULE_RESOURCE_TYPE.mdx index e656260e0a580..1030deb21d8d6 100644 --- a/www/apps/docs/content/references/js-client/internal/enums/admin_discounts.internal.MODULE_RESOURCE_TYPE.mdx +++ b/www/apps/docs/content/references/js-client/ModulesSdkTypes/enums/admin_discounts.internal.internal-1.ModulesSdkTypes.MODULE_RESOURCE_TYPE.mdx @@ -6,7 +6,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" # MODULE\_RESOURCE\_TYPE -[admin/discounts](../../modules/admin_discounts.mdx).[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).MODULE_RESOURCE_TYPE +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ModulesSdkTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx).MODULE_RESOURCE_TYPE ## Enumeration Members diff --git a/www/apps/docs/content/references/js-client/ModulesSdkTypes/enums/admin_discounts.internal.internal-1.ModulesSdkTypes.MODULE_SCOPE.mdx b/www/apps/docs/content/references/js-client/ModulesSdkTypes/enums/admin_discounts.internal.internal-1.ModulesSdkTypes.MODULE_SCOPE.mdx new file mode 100644 index 0000000000000..236a0125bc61f --- /dev/null +++ b/www/apps/docs/content/references/js-client/ModulesSdkTypes/enums/admin_discounts.internal.internal-1.ModulesSdkTypes.MODULE_SCOPE.mdx @@ -0,0 +1,21 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# MODULE\_SCOPE + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ModulesSdkTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx).MODULE_SCOPE + +## Enumeration Members + +### EXTERNAL + + **EXTERNAL** = ``"external"`` + +___ + +### INTERNAL + + **INTERNAL** = ``"internal"`` diff --git a/www/apps/docs/content/references/js-client/ModulesSdkTypes/interfaces/admin_discounts.internal.internal-1.ModulesSdkTypes.ModuleServiceInitializeOptions.mdx b/www/apps/docs/content/references/js-client/ModulesSdkTypes/interfaces/admin_discounts.internal.internal-1.ModulesSdkTypes.ModuleServiceInitializeOptions.mdx new file mode 100644 index 0000000000000..c5fdcbf3ce239 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ModulesSdkTypes/interfaces/admin_discounts.internal.internal-1.ModulesSdkTypes.ModuleServiceInitializeOptions.mdx @@ -0,0 +1,110 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ModuleServiceInitializeOptions + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ModulesSdkTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx).ModuleServiceInitializeOptions + +## Properties + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "database.host", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "database.password", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "database.pool", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "database.port", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "database.schema", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "database.user", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.AddPricesDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.AddPricesDTO.mdx new file mode 100644 index 0000000000000..15dd72498632f --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.AddPricesDTO.mdx @@ -0,0 +1,32 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# AddPricesDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).AddPricesDTO + +The prices to add to a price set. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.AddRulesDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.AddRulesDTO.mdx new file mode 100644 index 0000000000000..7ddf5bf736e84 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.AddRulesDTO.mdx @@ -0,0 +1,32 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# AddRulesDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).AddRulesDTO + +The rules to add to a price set. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CalculatedPriceSetDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CalculatedPriceSetDTO.mdx new file mode 100644 index 0000000000000..4a04d66536565 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CalculatedPriceSetDTO.mdx @@ -0,0 +1,56 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CalculatedPriceSetDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).CalculatedPriceSetDTO + +A calculated price set's data. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreateCurrencyDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreateCurrencyDTO.mdx new file mode 100644 index 0000000000000..fe5e582a8e374 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreateCurrencyDTO.mdx @@ -0,0 +1,48 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateCurrencyDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).CreateCurrencyDTO + +A currency to create. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreateMoneyAmountDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreateMoneyAmountDTO.mdx new file mode 100644 index 0000000000000..85cb869696996 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreateMoneyAmountDTO.mdx @@ -0,0 +1,64 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateMoneyAmountDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).CreateMoneyAmountDTO + +The money amount to create. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceRuleDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceRuleDTO.mdx new file mode 100644 index 0000000000000..f1ee97f6ca70d --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceRuleDTO.mdx @@ -0,0 +1,72 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreatePriceRuleDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).CreatePriceRuleDTO + +A price rule to create. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetDTO.mdx new file mode 100644 index 0000000000000..2a0abf7c8224b --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetDTO.mdx @@ -0,0 +1,32 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreatePriceSetDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).CreatePriceSetDTO + +A price set to create. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetMoneyAmountDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetMoneyAmountDTO.mdx new file mode 100644 index 0000000000000..0732e3bda2c50 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetMoneyAmountDTO.mdx @@ -0,0 +1,38 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreatePriceSetMoneyAmountDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).CreatePriceSetMoneyAmountDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetMoneyAmountRulesDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetMoneyAmountRulesDTO.mdx new file mode 100644 index 0000000000000..22d6f993adcc0 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetMoneyAmountRulesDTO.mdx @@ -0,0 +1,40 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreatePriceSetMoneyAmountRulesDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).CreatePriceSetMoneyAmountRulesDTO + +The price set money amount rule to create. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetRuleTypeDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetRuleTypeDTO.mdx new file mode 100644 index 0000000000000..d55ead017cfa9 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetRuleTypeDTO.mdx @@ -0,0 +1,30 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreatePriceSetRuleTypeDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).CreatePriceSetRuleTypeDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePricesDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePricesDTO.mdx new file mode 100644 index 0000000000000..e580cb83cbf2a --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePricesDTO.mdx @@ -0,0 +1,72 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreatePricesDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).CreatePricesDTO + +The prices to create part of a price set. + +## Properties + +", + "description": "The rules to add to the price. The object's keys are rule types' `rule_attribute` attribute, and values are the value of that rule associated with this price.", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreateRuleTypeDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreateRuleTypeDTO.mdx new file mode 100644 index 0000000000000..cf2fa09c28ed9 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreateRuleTypeDTO.mdx @@ -0,0 +1,48 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateRuleTypeDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).CreateRuleTypeDTO + +The rule type to create. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx new file mode 100644 index 0000000000000..493c860f96bdc --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx @@ -0,0 +1,48 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CurrencyDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).CurrencyDTO + +A currency's data. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterableCurrencyProps.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterableCurrencyProps.mdx new file mode 100644 index 0000000000000..dc4314c1de3b9 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterableCurrencyProps.mdx @@ -0,0 +1,40 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterableCurrencyProps + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).FilterableCurrencyProps + +Filters to apply on a currency. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableCurrencyProps`](admin_discounts.internal.internal-1.PricingTypes.FilterableCurrencyProps.mdx) \\| [`BaseFilterable`](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx)<[`FilterableCurrencyProps`](admin_discounts.internal.internal-1.PricingTypes.FilterableCurrencyProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "code", + "type": "`string`[]", + "description": "The codes to filter the currencies by.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterableMoneyAmountProps.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterableMoneyAmountProps.mdx new file mode 100644 index 0000000000000..10977e454f897 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterableMoneyAmountProps.mdx @@ -0,0 +1,48 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterableMoneyAmountProps + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).FilterableMoneyAmountProps + +Filters to apply on a money amount. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableMoneyAmountProps`](admin_discounts.internal.internal-1.PricingTypes.FilterableMoneyAmountProps.mdx) \\| [`BaseFilterable`](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx)<[`FilterableMoneyAmountProps`](admin_discounts.internal.internal-1.PricingTypes.FilterableMoneyAmountProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "currency_code", + "type": "`string` \\| `string`[]", + "description": "Currency codes to filter money amounts by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`[]", + "description": "IDs to filter money amounts by.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceRuleProps.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceRuleProps.mdx new file mode 100644 index 0000000000000..d6141300e36e3 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceRuleProps.mdx @@ -0,0 +1,64 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterablePriceRuleProps + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).FilterablePriceRuleProps + +Filters to apply to price rules. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterablePriceRuleProps`](admin_discounts.internal.internal-1.PricingTypes.FilterablePriceRuleProps.mdx) \\| [`BaseFilterable`](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx)<[`FilterablePriceRuleProps`](admin_discounts.internal.internal-1.PricingTypes.FilterablePriceRuleProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`[]", + "description": "The IDs to filter price rules by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`[]", + "description": "The names to filter price rules by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_id", + "type": "`string`[]", + "description": "The IDs to filter the price rule's associated price set.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_type_id", + "type": "`string`[]", + "description": "The IDs to filter the price rule's associated rule type.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetMoneyAmountProps.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetMoneyAmountProps.mdx new file mode 100644 index 0000000000000..43d8a92a76a2b --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetMoneyAmountProps.mdx @@ -0,0 +1,48 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterablePriceSetMoneyAmountProps + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).FilterablePriceSetMoneyAmountProps + +An object used to allow specifying flexible queries with and/or conditions. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterablePriceSetMoneyAmountProps`](admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetMoneyAmountProps.mdx) \\| [`BaseFilterable`](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx)<[`FilterablePriceSetMoneyAmountProps`](admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetMoneyAmountProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_id", + "type": "`string`[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetMoneyAmountRulesProps.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetMoneyAmountRulesProps.mdx new file mode 100644 index 0000000000000..e66b9834ffdb3 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetMoneyAmountRulesProps.mdx @@ -0,0 +1,64 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterablePriceSetMoneyAmountRulesProps + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).FilterablePriceSetMoneyAmountRulesProps + +Filters to apply on price set money amount rules. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterablePriceSetMoneyAmountRulesProps`](admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetMoneyAmountRulesProps.mdx) \\| [`BaseFilterable`](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx)<[`FilterablePriceSetMoneyAmountRulesProps`](admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetMoneyAmountRulesProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`[]", + "description": "The ID to filter price set money amount rules by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_money_amount_id", + "type": "`string`[]", + "description": "The IDs to filter the price set money amount rule's associated price set money amount.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_type_id", + "type": "`string`[]", + "description": "The IDs to filter the price set money amount rule's associated rule type.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`[]", + "description": "The value to filter price set money amount rules by.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetProps.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetProps.mdx new file mode 100644 index 0000000000000..413a2bd9f82df --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetProps.mdx @@ -0,0 +1,48 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterablePriceSetProps + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).FilterablePriceSetProps + +Filters to apply on price sets. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterablePriceSetProps`](admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetProps.mdx) \\| [`BaseFilterable`](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx)<[`FilterablePriceSetProps`](admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`[]", + "description": "IDs to filter price sets by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "money_amounts", + "type": "[`FilterableMoneyAmountProps`](admin_discounts.internal.internal-1.PricingTypes.FilterableMoneyAmountProps.mdx)", + "description": "Filters to apply on a price set's associated money amounts.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetRuleTypeProps.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetRuleTypeProps.mdx new file mode 100644 index 0000000000000..ec9590a52f0f9 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetRuleTypeProps.mdx @@ -0,0 +1,56 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterablePriceSetRuleTypeProps + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).FilterablePriceSetRuleTypeProps + +An object used to allow specifying flexible queries with and/or conditions. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterablePriceSetRuleTypeProps`](admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetRuleTypeProps.mdx) \\| [`BaseFilterable`](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx)<[`FilterablePriceSetRuleTypeProps`](admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetRuleTypeProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_id", + "type": "`string`[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_type_id", + "type": "`string`[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterableRuleTypeProps.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterableRuleTypeProps.mdx new file mode 100644 index 0000000000000..cbaa0a815dc78 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterableRuleTypeProps.mdx @@ -0,0 +1,56 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterableRuleTypeProps + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).FilterableRuleTypeProps + +Filters to apply on rule types. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableRuleTypeProps`](admin_discounts.internal.internal-1.PricingTypes.FilterableRuleTypeProps.mdx) \\| [`BaseFilterable`](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx)<[`FilterableRuleTypeProps`](admin_discounts.internal.internal-1.PricingTypes.FilterableRuleTypeProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`[]", + "description": "The IDs to filter rule types by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`[]", + "description": "The names to filter rule types by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_attribute", + "type": "`string`[]", + "description": "The rule attributes to filter rule types by.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx new file mode 100644 index 0000000000000..599314c27b47b --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx @@ -0,0 +1,64 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# MoneyAmountDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).MoneyAmountDTO + +A money amount's data. A money amount represents a price. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceRuleDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceRuleDTO.mdx new file mode 100644 index 0000000000000..6467f9b0184a2 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceRuleDTO.mdx @@ -0,0 +1,88 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# PriceRuleDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).PriceRuleDTO + +A price rule's data. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx new file mode 100644 index 0000000000000..f49a1caf077de --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx @@ -0,0 +1,40 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# PriceSetDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).PriceSetDTO + +A price set's data. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountDTO.mdx new file mode 100644 index 0000000000000..6411331887824 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountDTO.mdx @@ -0,0 +1,64 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# PriceSetMoneyAmountDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).PriceSetMoneyAmountDTO + +A price set money amount's data. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountRulesDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountRulesDTO.mdx new file mode 100644 index 0000000000000..2d25493f3e171 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountRulesDTO.mdx @@ -0,0 +1,48 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# PriceSetMoneyAmountRulesDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).PriceSetMoneyAmountRulesDTO + +A price set money amount rule's data. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetRuleTypeDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetRuleTypeDTO.mdx new file mode 100644 index 0000000000000..4bee4eb8898d7 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetRuleTypeDTO.mdx @@ -0,0 +1,46 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# PriceSetRuleTypeDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).PriceSetRuleTypeDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PricingContext.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PricingContext.mdx new file mode 100644 index 0000000000000..839affd019a1b --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PricingContext.mdx @@ -0,0 +1,24 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# PricingContext + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).PricingContext + +The context to calculate prices. For example, you can specify the currency code to calculate prices in. + +## Properties + +", + "description": "an object whose keys are the name of the context attribute. Its value can be a string or a number. For example, you can pass the `currency_code` property with its value being the currency code to calculate the price in. Another example is passing the `quantity` property to calculate the price for that specified quantity, which finds a price set whose `min_quantity` and `max_quantity` conditions match the specified quantity.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PricingFilters.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PricingFilters.mdx new file mode 100644 index 0000000000000..c9c0d43a48a49 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PricingFilters.mdx @@ -0,0 +1,24 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# PricingFilters + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).PricingFilters + +Filters to apply on prices. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RemovePriceSetRulesDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RemovePriceSetRulesDTO.mdx new file mode 100644 index 0000000000000..a1466ca14f5c0 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RemovePriceSetRulesDTO.mdx @@ -0,0 +1,32 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# RemovePriceSetRulesDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).RemovePriceSetRulesDTO + +The rules to remove from a price set. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx new file mode 100644 index 0000000000000..4790640b03b51 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx @@ -0,0 +1,48 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# RuleTypeDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).RuleTypeDTO + +A rule type's data. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdateCurrencyDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdateCurrencyDTO.mdx new file mode 100644 index 0000000000000..8906c8edbb714 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdateCurrencyDTO.mdx @@ -0,0 +1,48 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateCurrencyDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).UpdateCurrencyDTO + +The data to update in a currency. The `code` is used to identify which currency to update. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdateMoneyAmountDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdateMoneyAmountDTO.mdx new file mode 100644 index 0000000000000..7a593988ca078 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdateMoneyAmountDTO.mdx @@ -0,0 +1,58 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateMoneyAmountDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).UpdateMoneyAmountDTO + +* + +The data to update in a money amount. The `id` is used to identify which money amount to update. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceRuleDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceRuleDTO.mdx new file mode 100644 index 0000000000000..e29868d735120 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceRuleDTO.mdx @@ -0,0 +1,72 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdatePriceRuleDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).UpdatePriceRuleDTO + +The data to update in a price rule. The `id` is used to identify which money amount to update. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetDTO.mdx new file mode 100644 index 0000000000000..930e6d31e42db --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetDTO.mdx @@ -0,0 +1,24 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdatePriceSetDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).UpdatePriceSetDTO + +The data to update in a price set. The `id` is used to identify which price set to update. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetMoneyAmountDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetMoneyAmountDTO.mdx new file mode 100644 index 0000000000000..08f140f7f08d6 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetMoneyAmountDTO.mdx @@ -0,0 +1,46 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdatePriceSetMoneyAmountDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).UpdatePriceSetMoneyAmountDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetMoneyAmountRulesDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetMoneyAmountRulesDTO.mdx new file mode 100644 index 0000000000000..2458b2a5c3712 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetMoneyAmountRulesDTO.mdx @@ -0,0 +1,48 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdatePriceSetMoneyAmountRulesDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).UpdatePriceSetMoneyAmountRulesDTO + +The data to update in a price set money amount rule. The `id` is used to identify which money amount to update. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetRuleTypeDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetRuleTypeDTO.mdx new file mode 100644 index 0000000000000..0bde26d07c721 --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetRuleTypeDTO.mdx @@ -0,0 +1,38 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdatePriceSetRuleTypeDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).UpdatePriceSetRuleTypeDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdateRuleTypeDTO.mdx b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdateRuleTypeDTO.mdx new file mode 100644 index 0000000000000..9f41cc16d363e --- /dev/null +++ b/www/apps/docs/content/references/js-client/PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdateRuleTypeDTO.mdx @@ -0,0 +1,48 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateRuleTypeDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx).UpdateRuleTypeDTO + +The data to update in a rule type. The `id` is used to identify which price set to update. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductTypes/enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx b/www/apps/docs/content/references/js-client/ProductTypes/enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx new file mode 100644 index 0000000000000..362bd8d049163 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx @@ -0,0 +1,33 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ProductStatus + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).ProductStatus + +## Enumeration Members + +### DRAFT + + **DRAFT** = ``"draft"`` + +___ + +### PROPOSED + + **PROPOSED** = ``"proposed"`` + +___ + +### PUBLISHED + + **PUBLISHED** = ``"published"`` + +___ + +### REJECTED + + **REJECTED** = ``"rejected"`` diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductCategoryDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductCategoryDTO.mdx new file mode 100644 index 0000000000000..49c1e5f30df75 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductCategoryDTO.mdx @@ -0,0 +1,72 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductCategoryDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).CreateProductCategoryDTO + +A product category to create. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The product category's name.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category_id", + "type": "``null`` \\| `string`", + "description": "The ID of the parent product category, if it has any. It may also be `null`.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rank", + "type": "`number`", + "description": "The ranking of the category among sibling categories.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductCollectionDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductCollectionDTO.mdx new file mode 100644 index 0000000000000..48b729e87e0d3 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductCollectionDTO.mdx @@ -0,0 +1,48 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductCollectionDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).CreateProductCollectionDTO + +A product collection to create. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product_ids", + "type": "`string`[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The product collection's title.", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductDTO.mdx new file mode 100644 index 0000000000000..797f161d7fcdb --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductDTO.mdx @@ -0,0 +1,216 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).CreateProductDTO + +A product to create. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "`string`", + "description": "The MID Code of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`CreateProductOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.CreateProductOptionDTO.mdx)[]", + "description": "The product options to be created and associated with the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "`string`", + "description": "The origin country of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx).", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "`string`", + "description": "The subttle of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`CreateProductTagDTO`](admin_discounts.internal.internal-1.ProductTypes.CreateProductTagDTO.mdx)[]", + "description": "The product tags to be created and associated with the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "`string`", + "description": "The URL of the product's thumbnail.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`CreateProductTypeDTO`](admin_discounts.internal.internal-1.ProductTypes.CreateProductTypeDTO.mdx)", + "description": "The product type to create and associate with the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "type_id", + "type": "`string`", + "description": "The product type to be associated with the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`CreateProductVariantDTO`](admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantDTO.mdx)[]", + "description": "The product variants to be created and associated with the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "`number`", + "description": "The weight of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "`number`", + "description": "The width of the product.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductOnlyDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductOnlyDTO.mdx new file mode 100644 index 0000000000000..5721669591418 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductOnlyDTO.mdx @@ -0,0 +1,190 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductOnlyDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).CreateProductOnlyDTO + +## Properties + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "{ `id`: `string` }[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type_id", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductOptionDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductOptionDTO.mdx new file mode 100644 index 0000000000000..260c5b9cd8250 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductOptionDTO.mdx @@ -0,0 +1,32 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductOptionDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).CreateProductOptionDTO + +A product option to create. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductOptionOnlyDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductOptionOnlyDTO.mdx new file mode 100644 index 0000000000000..72f136216b4e3 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductOptionOnlyDTO.mdx @@ -0,0 +1,38 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductOptionOnlyDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).CreateProductOptionOnlyDTO + +## Properties + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product_id", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductTagDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductTagDTO.mdx new file mode 100644 index 0000000000000..9d6b27a5f37c8 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductTagDTO.mdx @@ -0,0 +1,24 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductTagDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).CreateProductTagDTO + +A product tag to create. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductTypeDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductTypeDTO.mdx new file mode 100644 index 0000000000000..65bea6b0c342e --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductTypeDTO.mdx @@ -0,0 +1,40 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductTypeDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).CreateProductTypeDTO + +A product type to create. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The product type's value.", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantDTO.mdx new file mode 100644 index 0000000000000..01e2fe89841c3 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantDTO.mdx @@ -0,0 +1,160 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductVariantDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).CreateProductVariantDTO + +A product variant to create. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "`string`", + "description": "The MID Code of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`CreateProductVariantOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantOptionDTO.mdx)[]", + "description": "The product variant options to create and associate with the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "`string`", + "description": "The origin country of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "`string`", + "description": "The SKU of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The tile of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "`string`", + "description": "The UPC of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "`number`", + "description": "The weight of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "`number`", + "description": "The width of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantOnlyDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantOnlyDTO.mdx new file mode 100644 index 0000000000000..e97ed16fe6d66 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantOnlyDTO.mdx @@ -0,0 +1,158 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductVariantOnlyDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).CreateProductVariantOnlyDTO + +## Properties + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`CreateProductVariantOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantOptionDTO.mdx) & { `option`: `any` }[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantOptionDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantOptionDTO.mdx new file mode 100644 index 0000000000000..540789c90444d --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantOptionDTO.mdx @@ -0,0 +1,24 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductVariantOptionDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).CreateProductVariantOptionDTO + +A product variant option to create. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductCategoryProps.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductCategoryProps.mdx new file mode 100644 index 0000000000000..99d219ce6e1ad --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductCategoryProps.mdx @@ -0,0 +1,88 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterableProductCategoryProps + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).FilterableProductCategoryProps + +The filters to apply on retrieved product categories. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductCategoryProps`](admin_discounts.internal.internal-1.ProductTypes.FilterableProductCategoryProps.mdx) \\| [`BaseFilterable`](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx)<[`FilterableProductCategoryProps`](admin_discounts.internal.internal-1.ProductTypes.FilterableProductCategoryProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string` \\| `string`[]", + "description": "The handles to filter product categories by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product categories by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "include_descendants_tree", + "type": "`boolean`", + "description": "Whether to include children of retrieved product categories.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "is_active", + "type": "`boolean`", + "description": "Filter product categories by whether they're active.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "is_internal", + "type": "`boolean`", + "description": "Filter product categories by whether they're internal.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string` \\| `string`[]", + "description": "The names to filter product categories by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category_id", + "type": "``null`` \\| `string` \\| `string`[]", + "description": "Filter product categories by their parent category's ID.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductCollectionProps.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductCollectionProps.mdx new file mode 100644 index 0000000000000..e4a7e27051e07 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductCollectionProps.mdx @@ -0,0 +1,56 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterableProductCollectionProps + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).FilterableProductCollectionProps + +The filters to apply on retrieved product collections. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductCollectionProps`](admin_discounts.internal.internal-1.ProductTypes.FilterableProductCollectionProps.mdx) \\| [`BaseFilterable`](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx)<[`FilterableProductCollectionProps`](admin_discounts.internal.internal-1.ProductTypes.FilterableProductCollectionProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string` \\| `string`[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product collections by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title to filter product collections by.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductOptionProps.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductOptionProps.mdx new file mode 100644 index 0000000000000..dab9ae3fdc967 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductOptionProps.mdx @@ -0,0 +1,56 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterableProductOptionProps + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).FilterableProductOptionProps + +The filters to apply on retrieved product options. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductOptionProps`](admin_discounts.internal.internal-1.ProductTypes.FilterableProductOptionProps.mdx) \\| [`BaseFilterable`](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx)<[`FilterableProductOptionProps`](admin_discounts.internal.internal-1.ProductTypes.FilterableProductOptionProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product options by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product_id", + "type": "`string` \\| `string`[]", + "description": "Filter the product options by their associated products' IDs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The titles to filter product options by.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductProps.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductProps.mdx new file mode 100644 index 0000000000000..003d257e069a1 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductProps.mdx @@ -0,0 +1,120 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterableProductProps + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).FilterableProductProps + +The filters to apply on retrieved products. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductProps`](admin_discounts.internal.internal-1.ProductTypes.FilterableProductProps.mdx) \\| [`BaseFilterable`](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx)<[`FilterableProductProps`](admin_discounts.internal.internal-1.ProductTypes.FilterableProductProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "categories", + "type": "`object`", + "description": "Filters on a product's categories.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "categories.id", + "type": "`string` \\| `string`[] \\| [`OperatorMap`](../../admin_discounts/modules/admin_discounts.internal.mdx#operatormap)<`string`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "categories.is_active", + "type": "`boolean`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "categories.is_internal", + "type": "`boolean`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "category_id", + "type": "`string` \\| `string`[] \\| [`OperatorMap`](../../admin_discounts/modules/admin_discounts.internal.mdx#operatormap)<`string`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection_id", + "type": "`string` \\| `string`[] \\| [`OperatorMap`](../../admin_discounts/modules/admin_discounts.internal.mdx#operatormap)<`string`\\>", + "description": "Filters a product by its associated collections.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string` \\| `string`[]", + "description": "The handles to filter products by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter products by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "q", + "type": "`string`", + "description": "Search through the products' attributes, such as titles and descriptions, using this search term.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "`object`", + "description": "Filters on a product's tags.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags.value", + "type": "`string`[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductTagProps.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductTagProps.mdx new file mode 100644 index 0000000000000..bf616b415d440 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductTagProps.mdx @@ -0,0 +1,48 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterableProductTagProps + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).FilterableProductTagProps + +The filters to apply on retrieved product tags. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductTagProps`](admin_discounts.internal.internal-1.ProductTypes.FilterableProductTagProps.mdx) \\| [`BaseFilterable`](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx)<[`FilterableProductTagProps`](admin_discounts.internal.internal-1.ProductTypes.FilterableProductTagProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product tags by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value to filter product tags by.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductTypeProps.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductTypeProps.mdx new file mode 100644 index 0000000000000..309f6ae5c08d4 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductTypeProps.mdx @@ -0,0 +1,48 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterableProductTypeProps + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).FilterableProductTypeProps + +The filters to apply on retrieved product types. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductTypeProps`](admin_discounts.internal.internal-1.ProductTypes.FilterableProductTypeProps.mdx) \\| [`BaseFilterable`](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx)<[`FilterableProductTypeProps`](admin_discounts.internal.internal-1.ProductTypes.FilterableProductTypeProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product types by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value to filter product types by.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductVariantProps.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductVariantProps.mdx new file mode 100644 index 0000000000000..b3a291b451b90 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductVariantProps.mdx @@ -0,0 +1,72 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterableProductVariantProps + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).FilterableProductVariantProps + +The filters to apply on retrieved product variants. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterableProductVariantProps`](admin_discounts.internal.internal-1.ProductTypes.FilterableProductVariantProps.mdx) \\| [`BaseFilterable`](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx)<[`FilterableProductVariantProps`](admin_discounts.internal.internal-1.ProductTypes.FilterableProductVariantProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string` \\| `string`[]", + "description": "The IDs to filter product variants by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "`object`", + "description": "Filter product variants by their associated options.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options.id", + "type": "`string`[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product_id", + "type": "`string` \\| `string`[]", + "description": "Filter the product variants by their associated products' IDs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "`string` \\| `string`[]", + "description": "The SKUs to filter product variants by.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.IProductModuleService.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.IProductModuleService.mdx new file mode 100644 index 0000000000000..00e8c0611a11d --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.IProductModuleService.mdx @@ -0,0 +1,6626 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# IProductModuleService + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).IProductModuleService + +## Methods + +### create + +**create**(`data`, `sharedContext?`): `Promise`<[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)[]\> + +This method is used to create a product. + +#### Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function createProduct (title: string) { + const productModule = await initializeProductModule() + + const products = await productModule.create([ + { + title + } + ]) + + // do something with the products or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of created products.", + "children": [ + { + "name": "ProductDTO[]", + "type": "[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "categories", + "type": "``null`` \\| [`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)[]", + "description": "The associated product categories. It may only be available if the `categories` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection", + "type": "[`ProductCollectionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx)", + "description": "The associated product collection. It may only be available if the `collection` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### createCategory + +**createCategory**(`data`, `sharedContext?`): `Promise`<[`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)\> + +This method is used to create a product category. + +#### Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function createCategory (name: string, parent_category_id: string | null) { + const productModule = await initializeProductModule() + + const category = await productModule.createCategory({ + name, + parent_category_id + }) + + // do something with the product category or return it +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)\> + +", + "optional": false, + "defaultValue": "", + "description": "The created product category.", + "children": [ + { + "name": "category_children", + "type": "[`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)[]", + "description": "The associated child categories. It may only be available if the `category_children` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product category was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "`string`", + "description": "The description of the product category.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product category. The handle can be used to create slug URL paths.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_active", + "type": "`boolean`", + "description": "Whether the product category is active.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "is_internal", + "type": "`boolean`", + "description": "Whether the product category is internal. This can be used to only show the product category to admins and hide it from customers.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category", + "type": "[`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)", + "description": "The associated parent category. It may only be available if the `parent_category` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rank", + "type": "`number`", + "description": "The ranking of the product category among sibling categories.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product category was updated.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +___ + +### createCollections + +**createCollections**(`data`, `sharedContext?`): `Promise`<[`ProductCollectionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx)[]\> + +This method is used to create product collections. + +#### Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function createCollection (title: string) { + const productModule = await initializeProductModule() + + const collections = await productModule.createCollections([ + { + title + } + ]) + + // do something with the product collections or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`ProductCollectionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of created product collections.", + "children": [ + { + "name": "ProductCollectionDTO[]", + "type": "[`ProductCollectionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product collection was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product collection. The handle can be used to create slug URL paths.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### createOptions + +**createOptions**(`data`, `sharedContext?`): `Promise`<[`ProductOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx)[]\> + +This method is used to create product options. + +#### Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function createProductOption (title: string, productId: string) { + const productModule = await initializeProductModule() + + const productOptions = await productModule.createOptions([ + { + title, + product_id: productId + } + ]) + + // do something with the product options or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`ProductOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of created product options.", + "children": [ + { + "name": "ProductOptionDTO[]", + "type": "[`ProductOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "values", + "type": "[`ProductOptionValueDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionValueDTO.mdx)[]", + "description": "The associated product option values. It may only be available if the `values` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### createTags + +**createTags**(`data`, `sharedContext?`): `Promise`<[`ProductTagDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx)[]\> + +This method is used to create product tags. + +#### Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function createProductTags (values: string[]) { + const productModule = await initializeProductModule() + + const productTags = await productModule.createTags( + values.map((value) => ({ + value + })) + ) + + // do something with the product tags or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`ProductTagDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of product tags.", + "children": [ + { + "name": "ProductTagDTO[]", + "type": "[`ProductTagDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### createTypes + +**createTypes**(`data`, `sharedContext?`): `Promise`<[`ProductTypeDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx)[]\> + +This method is used to create a product type. + +#### Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function createProductType (value: string) { + const productModule = await initializeProductModule() + + const productTypes = await productModule.createTypes([ + { + value + } + ]) + + // do something with the product types or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`ProductTypeDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of created product types.", + "children": [ + { + "name": "ProductTypeDTO[]", + "type": "[`ProductTypeDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product type was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### delete + +**delete**(`productIds`, `sharedContext?`): `Promise`<`void`\> + +This method is used to delete products. Unlike the [softDelete](admin_discounts.internal.internal-1.ProductTypes.IProductModuleService.mdx#softdelete) method, this method will completely remove the products and they can no longer be accessed or retrieved. + +#### Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function deleteProducts (ids: string[]) { + const productModule = await initializeProductModule() + + await productModule.delete(ids) +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<`void`\> + +", + "optional": false, + "defaultValue": "", + "description": "Resolves when the products are successfully deleted.", + "children": [] + } +]} /> + +___ + +### deleteCategory + +**deleteCategory**(`categoryId`, `sharedContext?`): `Promise`<`void`\> + +This method is used to delete a product category by its ID. + +#### Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function deleteCategory (id: string) { + const productModule = await initializeProductModule() + + await productModule.deleteCategory(id) +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<`void`\> + +", + "optional": false, + "defaultValue": "", + "description": "Resolves when the product category is successfully deleted.", + "children": [] + } +]} /> + +___ + +### deleteCollections + +**deleteCollections**(`productCollectionIds`, `sharedContext?`): `Promise`<`void`\> + +This method is used to delete collections by their ID. + +#### Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function deleteCollection (ids: string[]) { + const productModule = await initializeProductModule() + + await productModule.deleteCollections(ids) +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<`void`\> + +", + "optional": false, + "defaultValue": "", + "description": "Resolves when the product options are successfully deleted.", + "children": [] + } +]} /> + +___ + +### deleteOptions + +**deleteOptions**(`productOptionIds`, `sharedContext?`): `Promise`<`void`\> + +This method is used to delete a product option. + +#### Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function deleteProductOptions (ids: string[]) { + const productModule = await initializeProductModule() + + await productModule.deleteOptions(ids) +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<`void`\> + +", + "optional": false, + "defaultValue": "", + "description": "Resolves when the product options are successfully deleted.", + "children": [] + } +]} /> + +___ + +### deleteTags + +**deleteTags**(`productTagIds`, `sharedContext?`): `Promise`<`void`\> + +This method is used to delete product tags by their ID. + +#### Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function deleteProductTags (ids: string[]) { + const productModule = await initializeProductModule() + + await productModule.deleteTags(ids) + +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<`void`\> + +", + "optional": false, + "defaultValue": "", + "description": "Resolves when the product tags are successfully deleted.", + "children": [] + } +]} /> + +___ + +### deleteTypes + +**deleteTypes**(`productTypeIds`, `sharedContext?`): `Promise`<`void`\> + +This method is used to delete a product type. + +#### Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function deleteProductTypes (ids: string[]) { + const productModule = await initializeProductModule() + + await productModule.deleteTypes(ids) +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<`void`\> + +", + "optional": false, + "defaultValue": "", + "description": "Resolves when the product types are successfully deleted.", + "children": [] + } +]} /> + +___ + +### list + +**list**(`filters?`, `config?`, `sharedContext?`): `Promise`<[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)[]\> + +This method is used to retrieve a paginated list of price sets based on optional filters and configuration. + +#### Example + +To retrieve a list of products using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProducts (ids: string[]) { + const productModule = await initializeProductModule() + + const products = await productModule.list({ + id: ids + }) + + // do something with the products or return them +} +``` + +To specify relations that should be retrieved within the products: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProducts (ids: string[]) { + const productModule = await initializeProductModule() + + const products = await productModule.list({ + id: ids + }, { + relations: ["categories"] + }) + + // do something with the products or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProducts (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const products = await productModule.list({ + id: ids + }, { + relations: ["categories"], + skip, + take + }) + + // do something with the products or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProducts (ids: string[], title: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const products = await productModule.list({ + $and: [ + { + id: ids + }, + { + q: title + } + ] + }, { + relations: ["categories"], + skip, + take + }) + + // do something with the products or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the products are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of products.", + "children": [ + { + "name": "ProductDTO[]", + "type": "[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "categories", + "type": "``null`` \\| [`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)[]", + "description": "The associated product categories. It may only be available if the `categories` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection", + "type": "[`ProductCollectionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx)", + "description": "The associated product collection. It may only be available if the `collection` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### listAndCount + +**listAndCount**(`filters?`, `config?`, `sharedContext?`): `Promise`<[[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)[], `number`]\> + +This method is used to retrieve a paginated list of products along with the total count of available products satisfying the provided filters. + +#### Example + +To retrieve a list of products using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProducts (ids: string[]) { + const productModule = await initializeProductModule() + + const [products, count] = await productModule.listAndCount({ + id: ids + }) + + // do something with the products or return them +} +``` + +To specify relations that should be retrieved within the products: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProducts (ids: string[]) { + const productModule = await initializeProductModule() + + const [products, count] = await productModule.listAndCount({ + id: ids + }, { + relations: ["categories"] + }) + + // do something with the products or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProducts (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const [products, count] = await productModule.listAndCount({ + id: ids + }, { + relations: ["categories"], + skip, + take + }) + + // do something with the products or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProducts (ids: string[], title: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const [products, count] = await productModule.listAndCount({ + $and: [ + { + id: ids + }, + { + q: title + } + ] + }, { + relations: ["categories"], + skip, + take + }) + + // do something with the products or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the products are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)[], `number`]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of products along with the total count.", + "children": [ + { + "name": "ProductDTO[]", + "type": "[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### listAndCountCategories + +**listAndCountCategories**(`filters?`, `config?`, `sharedContext?`): `Promise`<[[`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)[], `number`]\> + +This method is used to retrieve a paginated list of product categories along with the total count of available product categories satisfying the provided filters. + +#### Example + +To retrieve a list of product categories using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCategories (ids: string[]) { + const productModule = await initializeProductModule() + + const [categories, count] = await productModule.listAndCountCategories({ + id: ids + }) + + // do something with the product category or return it +} +``` + +To specify relations that should be retrieved within the product categories: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCategories (ids: string[]) { + const productModule = await initializeProductModule() + + const [categories, count] = await productModule.listAndCountCategories({ + id: ids + }, { + relations: ["parent_category"] + }) + + // do something with the product category or return it +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCategories (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const [categories, count] = await productModule.listAndCountCategories({ + id: ids + }, { + relations: ["parent_category"], + skip, + take + }) + + // do something with the product category or return it +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCategories (ids: string[], name: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const [categories, count] = await productModule.listAndCountCategories({ + $or: [ + { + id: ids + }, + { + name + } + ] + }, { + relations: ["parent_category"], + skip, + take + }) + + // do something with the product category or return it +} +``` + +#### Parameters + +", + "description": "The configurations determining how the product categories are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product category.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[[`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)[], `number`]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of product categories along with their total count.", + "children": [ + { + "name": "ProductCategoryDTO[]", + "type": "[`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### listAndCountCollections + +**listAndCountCollections**(`filters?`, `config?`, `sharedContext?`): `Promise`<[[`ProductCollectionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx)[], `number`]\> + +This method is used to retrieve a paginated list of product collections along with the total count of available product collections satisfying the provided filters. + +#### Example + +To retrieve a list of product collections using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCollections (ids: string[]) { + const productModule = await initializeProductModule() + + const [collections, count] = await productModule.listAndCountCollections({ + id: ids + }) + + // do something with the product collections or return them +} +``` + +To specify relations that should be retrieved within the product collections: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCollections (ids: string[]) { + const productModule = await initializeProductModule() + + const [collections, count] = await productModule.listAndCountCollections({ + id: ids + }, { + relations: ["products"] + }) + + // do something with the product collections or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCollections (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const [collections, count] = await productModule.listAndCountCollections({ + id: ids + }, { + relations: ["products"], + skip, + take + }) + + // do something with the product collections or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCollections (ids: string[], title: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const [collections, count] = await productModule.listAndCountCollections({ + $and: [ + { + id: ids + }, + { + title + } + ] + }, { + relations: ["products"], + skip, + take + }) + + // do something with the product collections or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the product collections are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product collection.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[[`ProductCollectionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx)[], `number`]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of product collections along with the total count.", + "children": [ + { + "name": "ProductCollectionDTO[]", + "type": "[`ProductCollectionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### listAndCountOptions + +**listAndCountOptions**(`filters?`, `config?`, `sharedContext?`): `Promise`<[[`ProductOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx)[], `number`]\> + +This method is used to retrieve a paginated list of product options along with the total count of available product options satisfying the provided filters. + +#### Example + +To retrieve a list of product options using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductOptions (ids: string[]) { + const productModule = await initializeProductModule() + + const [productOptions, count] = await productModule.listAndCountOptions({ + id: ids + }) + + // do something with the product options or return them +} +``` + +To specify relations that should be retrieved within the product types: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductOptions (ids: string[]) { + const productModule = await initializeProductModule() + + const [productOptions, count] = await productModule.listAndCountOptions({ + id: ids + }, { + relations: ["product"] + }) + + // do something with the product options or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductOptions (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const [productOptions, count] = await productModule.listAndCountOptions({ + id: ids + }, { + relations: ["product"], + skip, + take + }) + + // do something with the product options or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductOptions (ids: string[], title: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const [productOptions, count] = await productModule.listAndCountOptions({ + $and: [ + { + id: ids + }, + { + title + } + ] + }, { + relations: ["product"], + skip, + take + }) + + // do something with the product options or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the product options are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product option.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[[`ProductOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx)[], `number`]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of product options along with the total count.", + "children": [ + { + "name": "ProductOptionDTO[]", + "type": "[`ProductOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### listAndCountTags + +**listAndCountTags**(`filters?`, `config?`, `sharedContext?`): `Promise`<[[`ProductTagDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx)[], `number`]\> + +This method is used to retrieve a paginated list of product tags along with the total count of available product tags satisfying the provided filters. + +#### Example + +To retrieve a list of product tags using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTag (tagIds: string[]) { + const productModule = await initializeProductModule() + + const [productTags, count] = await productModule.listAndCountTags({ + id: tagIds + }) + + // do something with the product tags or return them +} +``` + +To specify relations that should be retrieved within the product tags: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTag (tagIds: string[]) { + const productModule = await initializeProductModule() + + const [productTags, count] = await productModule.listAndCountTags({ + id: tagIds + }, { + relations: ["products"] + }) + + // do something with the product tags or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTag (tagIds: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const [productTags, count] = await productModule.listAndCountTags({ + id: tagIds + }, { + relations: ["products"], + skip, + take + }) + + // do something with the product tags or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTag (tagIds: string[], value: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const [productTags, count] = await productModule.listAndCountTags({ + $and: [ + { + id: tagIds + }, + { + value + } + ] + }, { + relations: ["products"], + skip, + take + }) + + // do something with the product tags or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the product tags are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product tag.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[[`ProductTagDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx)[], `number`]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of product tags along with the total count.", + "children": [ + { + "name": "ProductTagDTO[]", + "type": "[`ProductTagDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### listAndCountTypes + +**listAndCountTypes**(`filters?`, `config?`, `sharedContext?`): `Promise`<[[`ProductTypeDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx)[], `number`]\> + +This method is used to retrieve a paginated list of product types along with the total count of available product types satisfying the provided filters. + +#### Example + +To retrieve a list of product types using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTypes (ids: string[]) { + const productModule = await initializeProductModule() + + const [productTypes, count] = await productModule.listAndCountTypes({ + id: ids + }) + + // do something with the product types or return them +} +``` + +To specify attributes that should be retrieved within the product types: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTypes (ids: string[]) { + const productModule = await initializeProductModule() + + const [productTypes, count] = await productModule.listAndCountTypes({ + id: ids + }, { + select: ["value"] + }) + + // do something with the product types or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTypes (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const [productTypes, count] = await productModule.listAndCountTypes({ + id: ids + }, { + select: ["value"], + skip, + take + }) + + // do something with the product types or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTypes (ids: string[], value: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const [productTypes, count] = await productModule.listAndCountTypes({ + $and: [ + { + id: ids + }, + { + value + } + ] + }, { + select: ["value"], + skip, + take + }) + + // do something with the product types or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the product types are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product type.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[[`ProductTypeDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx)[], `number`]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of product types along with their total count.", + "children": [ + { + "name": "ProductTypeDTO[]", + "type": "[`ProductTypeDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### listAndCountVariants + +**listAndCountVariants**(`filters?`, `config?`, `sharedContext?`): `Promise`<[[`ProductVariantDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductVariantDTO.mdx)[], `number`]\> + +This method is used to retrieve a paginated list of product variants along with the total count of available product variants satisfying the provided filters. + +#### Example + +To retrieve a list of product variants using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductVariants (ids: string[]) { + const productModule = await initializeProductModule() + + const [variants, count] = await productModule.listAndCountVariants({ + id: ids + }) + + // do something with the product variants or return them +} +``` + +To specify relations that should be retrieved within the product variants: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductVariants (ids: string[]) { + const productModule = await initializeProductModule() + + const [variants, count] = await productModule.listAndCountVariants({ + id: ids + }, { + relations: ["options"] + }) + + // do something with the product variants or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductVariants (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const [variants, count] = await productModule.listAndCountVariants({ + id: ids + }, { + relations: ["options"], + skip, + take + }) + + // do something with the product variants or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductVariants (ids: string[], sku: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const [variants, count] = await productModule.listAndCountVariants({ + $and: [ + { + id: ids + }, + { + sku + } + ] + }, { + relations: ["options"], + skip, + take + }) + + // do something with the product variants or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the product variants are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[[`ProductVariantDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductVariantDTO.mdx)[], `number`]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of product variants along with their total count.", + "children": [ + { + "name": "ProductVariantDTO[]", + "type": "[`ProductVariantDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductVariantDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### listCategories + +**listCategories**(`filters?`, `config?`, `sharedContext?`): `Promise`<[`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)[]\> + +This method is used to retrieve a paginated list of product categories based on optional filters and configuration. + +#### Example + +To retrieve a list of product categories using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCategories (ids: string[]) { + const productModule = await initializeProductModule() + + const categories = await productModule.listCategories({ + id: ids + }) + + // do something with the product category or return it +} +``` + +To specify relations that should be retrieved within the product categories: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCategories (ids: string[]) { + const productModule = await initializeProductModule() + + const categories = await productModule.listCategories({ + id: ids + }, { + relations: ["parent_category"] + }) + + // do something with the product category or return it +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCategories (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const categories = await productModule.listCategories({ + id: ids + }, { + relations: ["parent_category"], + skip, + take + }) + + // do something with the product category or return it +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCategories (ids: string[], name: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const categories = await productModule.listCategories({ + $or: [ + { + id: ids + }, + { + name + } + ] + }, { + relations: ["parent_category"], + skip, + take + }) + + // do something with the product category or return it +} +``` + +#### Parameters + +", + "description": "The configurations determining how the product categories are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product category.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of product categories.", + "children": [ + { + "name": "ProductCategoryDTO[]", + "type": "[`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "category_children", + "type": "[`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)[]", + "description": "The associated child categories. It may only be available if the `category_children` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product category was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "`string`", + "description": "The description of the product category.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product category. The handle can be used to create slug URL paths.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_active", + "type": "`boolean`", + "description": "Whether the product category is active.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "is_internal", + "type": "`boolean`", + "description": "Whether the product category is internal. This can be used to only show the product category to admins and hide it from customers.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category", + "type": "[`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)", + "description": "The associated parent category. It may only be available if the `parent_category` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rank", + "type": "`number`", + "description": "The ranking of the product category among sibling categories.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product category was updated.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### listCollections + +**listCollections**(`filters?`, `config?`, `sharedContext?`): `Promise`<[`ProductCollectionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx)[]\> + +This method is used to retrieve a paginated list of product collections based on optional filters and configuration. + +#### Example + +To retrieve a list of product collections using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCollections (ids: string[]) { + const productModule = await initializeProductModule() + + const collections = await productModule.listCollections({ + id: ids + }) + + // do something with the product collections or return them +} +``` + +To specify relations that should be retrieved within the product collections: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCollections (ids: string[]) { + const productModule = await initializeProductModule() + + const collections = await productModule.listCollections({ + id: ids + }, { + relations: ["products"] + }) + + // do something with the product collections or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCollections (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const collections = await productModule.listCollections({ + id: ids + }, { + relations: ["products"], + skip, + take + }) + + // do something with the product collections or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCollections (ids: string[], title: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const collections = await productModule.listCollections({ + $and: [ + { + id: ids + }, + { + title + } + ] + }, { + relations: ["products"], + skip, + take + }) + + // do something with the product collections or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the product collections are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product collection.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`ProductCollectionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of product collections.", + "children": [ + { + "name": "ProductCollectionDTO[]", + "type": "[`ProductCollectionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product collection was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product collection. The handle can be used to create slug URL paths.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### listOptions + +**listOptions**(`filters?`, `config?`, `sharedContext?`): `Promise`<[`ProductOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx)[]\> + +This method is used to retrieve a paginated list of product options based on optional filters and configuration. + +#### Example + +To retrieve a list of product options using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductOptions (ids: string[]) { + const productModule = await initializeProductModule() + + const productOptions = await productModule.listOptions({ + id: ids + }) + + // do something with the product options or return them +} +``` + +To specify relations that should be retrieved within the product types: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductOptions (ids: string[]) { + const productModule = await initializeProductModule() + + const productOptions = await productModule.listOptions({ + id: ids + }, { + relations: ["product"] + }) + + // do something with the product options or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductOptions (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const productOptions = await productModule.listOptions({ + id: ids + }, { + relations: ["product"], + skip, + take + }) + + // do something with the product options or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductOptions (ids: string[], title: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const productOptions = await productModule.listOptions({ + $and: [ + { + id: ids + }, + { + title + } + ] + }, { + relations: ["product"], + skip, + take + }) + + // do something with the product options or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the product options are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product option.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`ProductOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of product options.", + "children": [ + { + "name": "ProductOptionDTO[]", + "type": "[`ProductOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "values", + "type": "[`ProductOptionValueDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionValueDTO.mdx)[]", + "description": "The associated product option values. It may only be available if the `values` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### listTags + +**listTags**(`filters?`, `config?`, `sharedContext?`): `Promise`<[`ProductTagDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx)[]\> + +This method is used to retrieve a paginated list of tags based on optional filters and configuration. + +#### Example + +To retrieve a list of product tags using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTag (tagIds: string[]) { + const productModule = await initializeProductModule() + + const productTags = await productModule.listTags({ + id: tagIds + }) + + // do something with the product tags or return them +} +``` + +To specify relations that should be retrieved within the product tags: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTag (tagIds: string[]) { + const productModule = await initializeProductModule() + + const productTags = await productModule.listTags({ + id: tagIds + }, { + relations: ["products"] + }) + + // do something with the product tags or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTag (tagIds: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const productTags = await productModule.listTags({ + id: tagIds + }, { + relations: ["products"], + skip, + take + }) + + // do something with the product tags or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTag (tagIds: string[], value: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const productTags = await productModule.listTags({ + $and: [ + { + id: tagIds + }, + { + value + } + ] + }, { + relations: ["products"], + skip, + take + }) + + // do something with the product tags or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the product tags are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product tag.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`ProductTagDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of product tags.", + "children": [ + { + "name": "ProductTagDTO[]", + "type": "[`ProductTagDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### listTypes + +**listTypes**(`filters?`, `config?`, `sharedContext?`): `Promise`<[`ProductTypeDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx)[]\> + +This method is used to retrieve a paginated list of product types based on optional filters and configuration. + +#### Example + +To retrieve a list of product types using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTypes (ids: string[]) { + const productModule = await initializeProductModule() + + const productTypes = await productModule.listTypes({ + id: ids + }) + + // do something with the product types or return them +} +``` + +To specify attributes that should be retrieved within the product types: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTypes (ids: string[]) { + const productModule = await initializeProductModule() + + const productTypes = await productModule.listTypes({ + id: ids + }, { + select: ["value"] + }) + + // do something with the product types or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTypes (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const productTypes = await productModule.listTypes({ + id: ids + }, { + select: ["value"], + skip, + take + }) + + // do something with the product types or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTypes (ids: string[], value: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const productTypes = await productModule.listTypes({ + $and: [ + { + id: ids + }, + { + value + } + ] + }, { + select: ["value"], + skip, + take + }) + + // do something with the product types or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the product types are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product type.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`ProductTypeDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of product types.", + "children": [ + { + "name": "ProductTypeDTO[]", + "type": "[`ProductTypeDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product type was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### listVariants + +**listVariants**(`filters?`, `config?`, `sharedContext?`): `Promise`<[`ProductVariantDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductVariantDTO.mdx)[]\> + +This method is used to retrieve a paginated list of product variants based on optional filters and configuration. + +#### Example + +To retrieve a list of product variants using their IDs: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductVariants (ids: string[]) { + const productModule = await initializeProductModule() + + const variants = await productModule.listVariants({ + id: ids + }) + + // do something with the product variants or return them +} +``` + +To specify relations that should be retrieved within the product variants: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductVariants (ids: string[]) { + const productModule = await initializeProductModule() + + const variants = await productModule.listVariants({ + id: ids + }, { + relations: ["options"] + }) + + // do something with the product variants or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductVariants (ids: string[], skip: number, take: number) { + const productModule = await initializeProductModule() + + const variants = await productModule.listVariants({ + id: ids + }, { + relations: ["options"], + skip, + take + }) + + // do something with the product variants or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductVariants (ids: string[], sku: string, skip: number, take: number) { + const productModule = await initializeProductModule() + + const variants = await productModule.listVariants({ + $and: [ + { + id: ids + }, + { + sku + } + ] + }, { + relations: ["options"], + skip, + take + }) + + // do something with the product variants or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the product variants are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`ProductVariantDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductVariantDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of product variants.", + "children": [ + { + "name": "ProductVariantDTO[]", + "type": "[`ProductVariantDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductVariantDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "allow_backorder", + "type": "`boolean`", + "description": "Whether the product variant can be ordered when it's out of stock.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "barcode", + "type": "``null`` \\| `string`", + "description": "The barcode of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was deleted.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "ean", + "type": "``null`` \\| `string`", + "description": "The EAN of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "inventory_quantity", + "type": "`number`", + "description": "The inventory quantiy of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manage_inventory", + "type": "`boolean`", + "description": "Whether the product variant's inventory should be managed by the core system.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionValueDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionValueDTO.mdx)", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "product_id", + "type": "`string`", + "description": "The ID of the associated product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "``null`` \\| `string`", + "description": "The SKU of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The tile of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "``null`` \\| `string`", + "description": "The UPC of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was updated.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant_rank", + "type": "``null`` \\| `number`", + "description": "The ranking of the variant among other variants associated with the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "The width of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### restore + +**restore**<`TReturnableLinkableKeys`\>(`productIds`, `config?`, `sharedContext?`): `Promise`<`void` \| Record<`string`, `string`[]\>\> + +This method is used to restore products which were deleted using the [softDelete](admin_discounts.internal.internal-1.ProductTypes.IProductModuleService.mdx#softdelete) method. + + + +#### Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function restoreProducts (ids: string[]) { + const productModule = await initializeProductModule() + + const cascadedEntities = await productModule.restore(ids, { + returnLinkableKeys: ["variant_id"] + }) + + // do something with the returned cascaded entity IDs or return them +} +``` + +#### Parameters + +", + "description": "Configurations determining which relations to restore along with the each of the products. You can pass to its `returnLinkableKeys` property any of the product's relation attribute names, such as `variant_id`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<`void` \| Record<`string`, `string`[]\>\> + +\\>", + "optional": false, + "defaultValue": "", + "description": "An object that includes the IDs of related records that were restored, such as the ID of associated product variants. The object's keys are the ID attribute names of the product entity's relations, such as `variant_id`, and its value is an array of strings, each being the ID of the record associated with the product through this relation, such as the IDs of associated product variants.\n\nIf there are no related records that were restored, the promise resolved to `void`.", + "children": [ + { + "name": "void \\| Record", + "type": "`void` \\| Record<`string`, `string`[]\\>", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### restoreVariants + +**restoreVariants**<`TReturnableLinkableKeys`\>(`variantIds`, `config?`, `sharedContext?`): `Promise`<`void` \| Record<`string`, `string`[]\>\> + + + +#### Parameters + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<`void` \| Record<`string`, `string`[]\>\> + +\\>", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "void \\| Record", + "type": "`void` \\| Record<`string`, `string`[]\\>", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### retrieve + +**retrieve**(`productId`, `config?`, `sharedContext?`): `Promise`<[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)\> + +This method is used to retrieve a product by its ID + +#### Example + +A simple example that retrieves a product by its ID: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProduct (id: string) { + const productModule = await initializeProductModule() + + const product = await productModule.retrieve(id) + + // do something with the product or return it +} +``` + +To specify relations that should be retrieved: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSet (priceSetId: string) { + const pricingService = await initializePricingModule() + + const priceSet = await pricingService.retrieve( + priceSetId, + { + relations: ["money_amounts"] + } + ) + + // do something with the price set or return it +} +``` + +#### Parameters + +", + "description": "The configurations determining how the product is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)\> + +", + "optional": false, + "defaultValue": "", + "description": "The retrieved product.", + "children": [ + { + "name": "categories", + "type": "``null`` \\| [`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)[]", + "description": "The associated product categories. It may only be available if the `categories` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection", + "type": "[`ProductCollectionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx)", + "description": "The associated product collection. It may only be available if the `collection` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +___ + +### retrieveCategory + +**retrieveCategory**(`productCategoryId`, `config?`, `sharedContext?`): `Promise`<[`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)\> + +This method is used to retrieve a product category by its ID. + +#### Example + +A simple example that retrieves a product category by its ID: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCategory (id: string) { + const productModule = await initializeProductModule() + + const category = await productModule.retrieveCategory(id) + + // do something with the product category or return it +} +``` + +To specify relations that should be retrieved: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCategory (id: string) { + const productModule = await initializeProductModule() + + const category = await productModule.retrieveCategory(id, { + relations: ["parent_category"] + }) + + // do something with the product category or return it +} +``` + +#### Parameters + +", + "description": "The configurations determining how the product category is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product category.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)\> + +", + "optional": false, + "defaultValue": "", + "description": "The retrieved product category.", + "children": [ + { + "name": "category_children", + "type": "[`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)[]", + "description": "The associated child categories. It may only be available if the `category_children` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product category was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "`string`", + "description": "The description of the product category.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product category. The handle can be used to create slug URL paths.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_active", + "type": "`boolean`", + "description": "Whether the product category is active.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "is_internal", + "type": "`boolean`", + "description": "Whether the product category is internal. This can be used to only show the product category to admins and hide it from customers.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category", + "type": "[`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)", + "description": "The associated parent category. It may only be available if the `parent_category` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rank", + "type": "`number`", + "description": "The ranking of the product category among sibling categories.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product category was updated.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +___ + +### retrieveCollection + +**retrieveCollection**(`productCollectionId`, `config?`, `sharedContext?`): `Promise`<[`ProductCollectionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx)\> + +This method is used to retrieve a product collection by its ID. + +#### Example + +A simple example that retrieves a product collection by its ID: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCollection (id: string) { + const productModule = await initializeProductModule() + + const collection = await productModule.retrieveCollection(id) + + // do something with the product collection or return it +} +``` + +To specify relations that should be retrieved: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveCollection (id: string) { + const productModule = await initializeProductModule() + + const collection = await productModule.retrieveCollection(id, { + relations: ["products"] + }) + + // do something with the product collection or return it +} +``` + +#### Parameters + +", + "description": "The configurations determining how the product collection is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product collection.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`ProductCollectionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx)\> + +", + "optional": false, + "defaultValue": "", + "description": "The retrieved product collection.", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product collection was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product collection. The handle can be used to create slug URL paths.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +___ + +### retrieveOption + +**retrieveOption**(`optionId`, `config?`, `sharedContext?`): `Promise`<[`ProductOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx)\> + +This method is used to retrieve a product option by its ID. + +#### Example + +A simple example that retrieves a product option by its ID: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductOption (id: string) { + const productModule = await initializeProductModule() + + const productOption = await productModule.retrieveOption(id) + + // do something with the product option or return it +} +``` + +To specify relations that should be retrieved: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductOption (id: string) { + const productModule = await initializeProductModule() + + const productOption = await productModule.retrieveOption(id, { + relations: ["product"] + }) + + // do something with the product option or return it +} +``` + +#### Parameters + +", + "description": "The configurations determining how the product option is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product option.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`ProductOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx)\> + +", + "optional": false, + "defaultValue": "", + "description": "The retrieved product option.", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "values", + "type": "[`ProductOptionValueDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionValueDTO.mdx)[]", + "description": "The associated product option values. It may only be available if the `values` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +___ + +### retrieveTag + +**retrieveTag**(`tagId`, `config?`, `sharedContext?`): `Promise`<[`ProductTagDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx)\> + +This method is used to retrieve a tag by its ID. + +#### Example + +A simple example that retrieves a product tag by its ID: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTag (tagId: string) { + const productModule = await initializeProductModule() + + const productTag = await productModule.retrieveTag(tagId) + + // do something with the product tag or return it +} +``` + +To specify relations that should be retrieved: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductTag (tagId: string) { + const productModule = await initializeProductModule() + + const productTag = await productModule.retrieveTag(tagId, { + relations: ["products"] + }) + + // do something with the product tag or return it +} +``` + +#### Parameters + +", + "description": "The configurations determining how the product tag is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product tag.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`ProductTagDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx)\> + +", + "optional": false, + "defaultValue": "", + "description": "The retrieved product tag.", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +___ + +### retrieveType + +**retrieveType**(`typeId`, `config?`, `sharedContext?`): `Promise`<[`ProductTypeDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx)\> + +This method is used to retrieve a product type by its ID. + +#### Example + +A simple example that retrieves a product type by its ID: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductType (id: string) { + const productModule = await initializeProductModule() + + const productType = await productModule.retrieveType(id) + + // do something with the product type or return it +} +``` + +To specify attributes that should be retrieved: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductType (id: string) { + const productModule = await initializeProductModule() + + const productType = await productModule.retrieveType(id, { + select: ["value"] + }) + + // do something with the product type or return it +} +``` + +#### Parameters + +", + "description": "The configurations determining how the product type is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product type.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`ProductTypeDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx)\> + +", + "optional": false, + "defaultValue": "", + "description": "The retrieved product type.", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product type was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +___ + +### retrieveVariant + +**retrieveVariant**(`productVariantId`, `config?`, `sharedContext?`): `Promise`<[`ProductVariantDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductVariantDTO.mdx)\> + +This method is used to retrieve a product variant by its ID. + +#### Example + +A simple example that retrieves a product variant by its ID: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductVariant (id: string) { + const productModule = await initializeProductModule() + + const variant = await productModule.retrieveVariant(id) + + // do something with the product variant or return it +} +``` + +To specify relations that should be retrieved: + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function retrieveProductVariant (id: string) { + const productModule = await initializeProductModule() + + const variant = await productModule.retrieveVariant(id, { + relations: ["options"] + }) + + // do something with the product variant or return it +} +``` + +#### Parameters + +", + "description": "The configurations determining how the product variant is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`ProductVariantDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductVariantDTO.mdx)\> + +", + "optional": false, + "defaultValue": "", + "description": "The retrieved product variant.", + "children": [ + { + "name": "allow_backorder", + "type": "`boolean`", + "description": "Whether the product variant can be ordered when it's out of stock.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "barcode", + "type": "``null`` \\| `string`", + "description": "The barcode of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was deleted.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "ean", + "type": "``null`` \\| `string`", + "description": "The EAN of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "inventory_quantity", + "type": "`number`", + "description": "The inventory quantiy of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manage_inventory", + "type": "`boolean`", + "description": "Whether the product variant's inventory should be managed by the core system.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionValueDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionValueDTO.mdx)", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "product_id", + "type": "`string`", + "description": "The ID of the associated product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "``null`` \\| `string`", + "description": "The SKU of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The tile of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "``null`` \\| `string`", + "description": "The UPC of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was updated.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant_rank", + "type": "``null`` \\| `number`", + "description": "The ranking of the variant among other variants associated with the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "The width of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +___ + +### softDelete + +**softDelete**<`TReturnableLinkableKeys`\>(`productIds`, `config?`, `sharedContext?`): `Promise`<`void` \| Record<`string`, `string`[]\>\> + +This method is used to delete products. Unlike the [delete](admin_discounts.internal.internal-1.ProductTypes.IProductModuleService.mdx#delete) method, this method won't completely remove the product. It can still be accessed or retrieved using methods like [retrieve](admin_discounts.internal.internal-1.ProductTypes.IProductModuleService.mdx#retrieve) if you pass the `withDeleted` property to the `config` object parameter. + +The soft-deleted products can be restored using the [restore](admin_discounts.internal.internal-1.ProductTypes.IProductModuleService.mdx#restore) method. + + + +#### Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function deleteProducts (ids: string[]) { + const productModule = await initializeProductModule() + + const cascadedEntities = await productModule.softDelete(ids) + + // do something with the returned cascaded entity IDs or return them +} +``` + +#### Parameters + +", + "description": "Configurations determining which relations to soft delete along with the each of the products. You can pass to its `returnLinkableKeys` property any of the product's relation attribute names, such as `variant_id`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<`void` \| Record<`string`, `string`[]\>\> + +\\>", + "optional": false, + "defaultValue": "", + "description": "An object that includes the IDs of related records that were also soft deleted, such as the ID of associated product variants. The object's keys are the ID attribute names of the product entity's relations, such as `variant_id`, and its value is an array of strings, each being the ID of a record associated with the product through this relation, such as the IDs of associated product variants.\n\nIf there are no related records, the promise resolved to `void`.", + "children": [ + { + "name": "void \\| Record", + "type": "`void` \\| Record<`string`, `string`[]\\>", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### update + +**update**(`data`, `sharedContext?`): `Promise`<[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)[]\> + +This method is used to update a product. + +#### Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function updateProduct (id: string, title: string) { + const productModule = await initializeProductModule() + + const products = await productModule.update([ + { + id, + title + } + ]) + + // do something with the products or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of updated products.", + "children": [ + { + "name": "ProductDTO[]", + "type": "[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "categories", + "type": "``null`` \\| [`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)[]", + "description": "The associated product categories. It may only be available if the `categories` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "collection", + "type": "[`ProductCollectionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx)", + "description": "The associated product collection. It may only be available if the `collection` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product was created.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "``null`` \\| `string`", + "description": "The description of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discountable", + "type": "`boolean`", + "description": "Whether the product can be discounted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "external_id", + "type": "``null`` \\| `string`", + "description": "The ID of the product in an external system. This is useful if you're integrating the product with a third-party service and want to maintain a reference to the ID in the integrated service.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "``null`` \\| `string`", + "description": "The handle of the product. The handle can be used to create slug URL paths. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "height", + "type": "``null`` \\| `number`", + "description": "The height of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "hs_code", + "type": "``null`` \\| `string`", + "description": "The HS Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "images", + "type": "[`ProductImageDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductImageDTO.mdx)[]", + "description": "The associated product images. It may only be available if the `images` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_giftcard", + "type": "`boolean`", + "description": "Whether the product is a gift card.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "length", + "type": "``null`` \\| `number`", + "description": "The length of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "material", + "type": "``null`` \\| `string`", + "description": "The material of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### updateCategory + +**updateCategory**(`categoryId`, `data`, `sharedContext?`): `Promise`<[`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)\> + +This method is used to update a product category by its ID. + +#### Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function updateCategory (id: string, name: string) { + const productModule = await initializeProductModule() + + const category = await productModule.updateCategory(id, { + name, + }) + + // do something with the product category or return it +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)\> + +", + "optional": false, + "defaultValue": "", + "description": "The updated product category.", + "children": [ + { + "name": "category_children", + "type": "[`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)[]", + "description": "The associated child categories. It may only be available if the `category_children` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "When the product category was created.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "description", + "type": "`string`", + "description": "The description of the product category.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product category. The handle can be used to create slug URL paths.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "is_active", + "type": "`boolean`", + "description": "Whether the product category is active.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "is_internal", + "type": "`boolean`", + "description": "Whether the product category is internal. This can be used to only show the product category to admins and hide it from customers.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the product category.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category", + "type": "[`ProductCategoryDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx)", + "description": "The associated parent category. It may only be available if the `parent_category` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rank", + "type": "`number`", + "description": "The ranking of the product category among sibling categories.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product category was updated.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +___ + +### updateCollections + +**updateCollections**(`data`, `sharedContext?`): `Promise`<[`ProductCollectionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx)[]\> + +This method is used to update existing product collections. + +#### Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function updateCollection (id: string, title: string) { + const productModule = await initializeProductModule() + + const collections = await productModule.updateCollections([ + { + id, + title + } + ]) + + // do something with the product collections or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`ProductCollectionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of updated product collections.", + "children": [ + { + "name": "ProductCollectionDTO[]", + "type": "[`ProductCollectionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product collection was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "handle", + "type": "`string`", + "description": "The handle of the product collection. The handle can be used to create slug URL paths.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### updateOptions + +**updateOptions**(`data`, `sharedContext?`): `Promise`<[`ProductOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx)[]\> + +This method is used to update existing product options. + +#### Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function updateProductOption (id: string, title: string) { + const productModule = await initializeProductModule() + + const productOptions = await productModule.updateOptions([ + { + id, + title + } + ]) + + // do something with the product options or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`ProductOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of updated product options.", + "children": [ + { + "name": "ProductOptionDTO[]", + "type": "[`ProductOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product option was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "values", + "type": "[`ProductOptionValueDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionValueDTO.mdx)[]", + "description": "The associated product option values. It may only be available if the `values` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### updateTags + +**updateTags**(`data`, `sharedContext?`): `Promise`<[`ProductTagDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx)[]\> + +This method is used to update existing product tags. + +#### Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function updateProductTag (id: string, value: string) { + const productModule = await initializeProductModule() + + const productTags = await productModule.updateTags([ + { + id, + value + } + ]) + + // do something with the product tags or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`ProductTagDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of updated product tags.", + "children": [ + { + "name": "ProductTagDTO[]", + "type": "[`ProductTagDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### updateTypes + +**updateTypes**(`data`, `sharedContext?`): `Promise`<[`ProductTypeDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx)[]\> + +This method is used to update a product type + +#### Example + +```ts +import { + initialize as initializeProductModule, +} from "@medusajs/product" + +async function updateProductType (id: string, value: string) { + const productModule = await initializeProductModule() + + const productTypes = await productModule.updateTypes([ + { + id, + value + } + ]) + + // do something with the product types or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`ProductTypeDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of updated product types.", + "children": [ + { + "name": "ProductTypeDTO[]", + "type": "[`ProductTypeDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "deleted_at", + "type": "`string` \\| `Date`", + "description": "When the product type was deleted.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "``null`` \\| Record<`string`, `unknown`\\>", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx new file mode 100644 index 0000000000000..a9534a42b9427 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx @@ -0,0 +1,104 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ProductCategoryDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).ProductCategoryDTO + +A product category's data. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx new file mode 100644 index 0000000000000..279b8113f480b --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx @@ -0,0 +1,64 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ProductCollectionDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).ProductCollectionDTO + +A product collection's data. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product collection.", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx new file mode 100644 index 0000000000000..f75bb60abdd56 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx @@ -0,0 +1,248 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ProductDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).ProductDTO + +A product's data. + +## Properties + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx)[]", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx).", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "``null`` \\| `string`", + "description": "The subttle of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`ProductTagDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx)[]", + "description": "The associated product tags. It may only be available if the `tags` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The URL of the product's thumbnail. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`ProductTypeDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx)[]", + "description": "The associated product type. It may only be available if the `type` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product was updated.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`ProductVariantDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductVariantDTO.mdx)[]", + "description": "The associated product variants. It may only be available if the `variants` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductImageDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductImageDTO.mdx new file mode 100644 index 0000000000000..24062c4295c16 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductImageDTO.mdx @@ -0,0 +1,48 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ProductImageDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).ProductImageDTO + +The product image's data. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "url", + "type": "`string`", + "description": "The URL of the product image.", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx new file mode 100644 index 0000000000000..00bc055a662d4 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx @@ -0,0 +1,64 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ProductOptionDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).ProductOptionDTO + +A product option's data. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product option.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "values", + "type": "[`ProductOptionValueDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionValueDTO.mdx)[]", + "description": "The associated product option values. It may only be available if the `values` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductOptionValueDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductOptionValueDTO.mdx new file mode 100644 index 0000000000000..4ffea35b256c1 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductOptionValueDTO.mdx @@ -0,0 +1,64 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ProductOptionValueDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).ProductOptionValueDTO + +The product option value's data. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "option", + "type": "[`ProductOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx)", + "description": "The associated product option. It may only be available if the `option` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product option value.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant", + "type": "[`ProductVariantDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductVariantDTO.mdx)", + "description": "The associated product variant. It may only be available if the `variant` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx new file mode 100644 index 0000000000000..157ddf1d4015c --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx @@ -0,0 +1,48 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ProductTagDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).ProductTagDTO + +A product tag's data. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "products", + "type": "[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)[]", + "description": "The associated products. It may only be available if the `products` relation is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product tag.", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx new file mode 100644 index 0000000000000..cd85d2a31c371 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx @@ -0,0 +1,48 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ProductTypeDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).ProductTypeDTO + +A product type's data. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product type.", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductVariantDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductVariantDTO.mdx new file mode 100644 index 0000000000000..bcc132ecc2da3 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductVariantDTO.mdx @@ -0,0 +1,216 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ProductVariantDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).ProductVariantDTO + +A product variant's data. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID Code of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`ProductOptionValueDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductOptionValueDTO.mdx)", + "description": "The associated product options. It may only be available if the `options` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product", + "type": "[`ProductDTO`](admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx)", + "description": "The associated product. It may only be available if the `product` relation is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "product_id", + "type": "`string`", + "description": "The ID of the associated product.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "``null`` \\| `string`", + "description": "The SKU of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The tile of the product variant.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "``null`` \\| `string`", + "description": "The UPC of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "When the product variant was updated.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "variant_rank", + "type": "``null`` \\| `number`", + "description": "The ranking of the variant among other variants associated with the product. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "The width of the product variant. It can possibly be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductCategoryDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductCategoryDTO.mdx new file mode 100644 index 0000000000000..7b9e1b1d7cc33 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductCategoryDTO.mdx @@ -0,0 +1,72 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductCategoryDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).UpdateProductCategoryDTO + +The data to update in a product category. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the product category.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "parent_category_id", + "type": "``null`` \\| `string`", + "description": "The ID of the parent product category, if it has any. It may also be `null`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rank", + "type": "`number`", + "description": "The ranking of the category among sibling categories.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductCollectionDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductCollectionDTO.mdx new file mode 100644 index 0000000000000..dc0a8ae341356 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductCollectionDTO.mdx @@ -0,0 +1,64 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductCollectionDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).UpdateProductCollectionDTO + +The data to update in a product collection. The `id` is used to identify which product collection to update. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "product_ids", + "type": "`string`[]", + "description": "The IDs of the products to associate with the product collection.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product collection.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the product collection.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductDTO.mdx new file mode 100644 index 0000000000000..6d451f572f0c9 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductDTO.mdx @@ -0,0 +1,224 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).UpdateProductDTO + +The data to update in a product. The `id` is used to identify which product to update. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "`string`", + "description": "The MID Code of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`CreateProductOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.CreateProductOptionDTO.mdx)[]", + "description": "The product options to be created and associated with the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "`string`", + "description": "The origin country of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx)", + "description": "The status of the product. Its value can be one of the values of the enum [ProductStatus](../enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx).", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "`string`", + "description": "The subttle of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`CreateProductTagDTO`](admin_discounts.internal.internal-1.ProductTypes.CreateProductTagDTO.mdx)[]", + "description": "The product tags to be created and associated with the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "`string`", + "description": "The URL of the product's thumbnail.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`CreateProductTypeDTO`](admin_discounts.internal.internal-1.ProductTypes.CreateProductTypeDTO.mdx)", + "description": "The product type to create and associate with the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "type_id", + "type": "``null`` \\| `string`", + "description": "The product type to be associated with the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "([`CreateProductVariantDTO`](admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantDTO.mdx) \\| [`UpdateProductVariantDTO`](admin_discounts.internal.internal-1.ProductTypes.UpdateProductVariantDTO.mdx))[]", + "description": "The product variants to be created and associated with the product. You can also update existing product variants associated with the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "`number`", + "description": "The weight of the product.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "`number`", + "description": "The width of the product.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductOptionDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductOptionDTO.mdx new file mode 100644 index 0000000000000..a682044cd45b2 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductOptionDTO.mdx @@ -0,0 +1,38 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductOptionDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).UpdateProductOptionDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductTagDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductTagDTO.mdx new file mode 100644 index 0000000000000..2c475bb789cb4 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductTagDTO.mdx @@ -0,0 +1,32 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductTagDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).UpdateProductTagDTO + +The data to update in a product tag. The `id` is used to identify which product tag to update. + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductTypeDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductTypeDTO.mdx new file mode 100644 index 0000000000000..7630b5e5bf67f --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductTypeDTO.mdx @@ -0,0 +1,40 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductTypeDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).UpdateProductTypeDTO + +The data to update in a product type. The `id` is used to identify which product type to update. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The new value of the product type.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductVariantDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductVariantDTO.mdx new file mode 100644 index 0000000000000..ac2b4f292d8fd --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductVariantDTO.mdx @@ -0,0 +1,168 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductVariantDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).UpdateProductVariantDTO + +The data to update in a product variant. The `id` is used to identify which product variant to update. + +## Properties + +", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "`string`", + "description": "The MID Code of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`CreateProductVariantOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantOptionDTO.mdx)[]", + "description": "The product variant options to create and associate with the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "`string`", + "description": "The origin country of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "`string`", + "description": "The SKU of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The tile of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "`string`", + "description": "The UPC of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "`number`", + "description": "The weight of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "`number`", + "description": "The width of the product variant.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductVariantOnlyDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductVariantOnlyDTO.mdx new file mode 100644 index 0000000000000..1b3b1d07c8295 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductVariantOnlyDTO.mdx @@ -0,0 +1,166 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductVariantOnlyDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).UpdateProductVariantOnlyDTO + +## Properties + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`CreateProductVariantOptionDTO`](admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantOptionDTO.mdx) & { `option`: `any` }[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpsertProductTagDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpsertProductTagDTO.mdx new file mode 100644 index 0000000000000..ca0efe4051dfc --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpsertProductTagDTO.mdx @@ -0,0 +1,30 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpsertProductTagDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).UpsertProductTagDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpsertProductTypeDTO.mdx b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpsertProductTypeDTO.mdx new file mode 100644 index 0000000000000..81db467f2c646 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpsertProductTypeDTO.mdx @@ -0,0 +1,30 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpsertProductTypeDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx).UpsertProductTypeDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductInputDTO.mdx new file mode 100644 index 0000000000000..0d599d1ecd448 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductInputDTO.mdx @@ -0,0 +1,214 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).CreateProductInputDTO + +## Properties + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`CreateProductOptionInputDTO`](admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductOptionInputDTO.mdx)[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sales_channels", + "type": "[`CreateProductSalesChannelInputDTO`](admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductSalesChannelInputDTO.mdx)[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../../ProductTypes/enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`CreateProductTagInputDTO`](admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductTagInputDTO.mdx)[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`CreateProductTypeInputDTO`](admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductTypeInputDTO.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`CreateProductVariantInputDTO`](admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductVariantInputDTO.mdx)[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductOptionInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductOptionInputDTO.mdx new file mode 100644 index 0000000000000..06c87bae53508 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductOptionInputDTO.mdx @@ -0,0 +1,22 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductOptionInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).CreateProductOptionInputDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductProductCategoryInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductProductCategoryInputDTO.mdx new file mode 100644 index 0000000000000..31944a21f042a --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductProductCategoryInputDTO.mdx @@ -0,0 +1,22 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductProductCategoryInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).CreateProductProductCategoryInputDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductSalesChannelInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductSalesChannelInputDTO.mdx new file mode 100644 index 0000000000000..965074f2bb595 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductSalesChannelInputDTO.mdx @@ -0,0 +1,22 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductSalesChannelInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).CreateProductSalesChannelInputDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductTagInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductTagInputDTO.mdx new file mode 100644 index 0000000000000..7d7be3466fc46 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductTagInputDTO.mdx @@ -0,0 +1,30 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductTagInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).CreateProductTagInputDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductTypeInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductTypeInputDTO.mdx new file mode 100644 index 0000000000000..b622cb54a6fb4 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductTypeInputDTO.mdx @@ -0,0 +1,30 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductTypeInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).CreateProductTypeInputDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductVariantInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductVariantInputDTO.mdx new file mode 100644 index 0000000000000..5b42996def77a --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductVariantInputDTO.mdx @@ -0,0 +1,174 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductVariantInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).CreateProductVariantInputDTO + +## Properties + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`CreteProductVariantOptionInputDTO`](admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreteProductVariantOptionInputDTO.mdx)[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "prices", + "type": "[`CreateProductVariantPricesInputDTO`](admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductVariantPricesInputDTO.mdx)[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductVariantPricesInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductVariantPricesInputDTO.mdx new file mode 100644 index 0000000000000..7d82c08d3014a --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductVariantPricesInputDTO.mdx @@ -0,0 +1,62 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductVariantPricesInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).CreateProductVariantPricesInputDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductsWorkflowInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductsWorkflowInputDTO.mdx new file mode 100644 index 0000000000000..9a4ae1abf2e21 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductsWorkflowInputDTO.mdx @@ -0,0 +1,22 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateProductsWorkflowInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).CreateProductsWorkflowInputDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreteProductVariantOptionInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreteProductVariantOptionInputDTO.mdx new file mode 100644 index 0000000000000..e26dc7f74c2cb --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreteProductVariantOptionInputDTO.mdx @@ -0,0 +1,30 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreteProductVariantOptionInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).CreteProductVariantOptionInputDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductInputDTO.mdx new file mode 100644 index 0000000000000..e8c744a9aac4a --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductInputDTO.mdx @@ -0,0 +1,206 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).UpdateProductInputDTO + +## Properties + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sales_channels", + "type": "[`UpdateProductSalesChannelInputDTO`](admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductSalesChannelInputDTO.mdx)[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "status", + "type": "[`ProductStatus`](../../ProductTypes/enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "subtitle", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tags", + "type": "[`UpdateProductTagInputDTO`](admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductTagInputDTO.mdx)[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "[`UpdateProductTypeInputDTO`](admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductTypeInputDTO.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "variants", + "type": "[`UpdateProductVariantInputDTO`](admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantInputDTO.mdx)[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductProductCategoryInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductProductCategoryInputDTO.mdx new file mode 100644 index 0000000000000..f34374bb2d612 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductProductCategoryInputDTO.mdx @@ -0,0 +1,22 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductProductCategoryInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).UpdateProductProductCategoryInputDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductSalesChannelInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductSalesChannelInputDTO.mdx new file mode 100644 index 0000000000000..ba81910e7e260 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductSalesChannelInputDTO.mdx @@ -0,0 +1,22 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductSalesChannelInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).UpdateProductSalesChannelInputDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductTagInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductTagInputDTO.mdx new file mode 100644 index 0000000000000..c2e872e9a658c --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductTagInputDTO.mdx @@ -0,0 +1,30 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductTagInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).UpdateProductTagInputDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductTypeInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductTypeInputDTO.mdx new file mode 100644 index 0000000000000..bacd7db866a00 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductTypeInputDTO.mdx @@ -0,0 +1,30 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductTypeInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).UpdateProductTypeInputDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantInputDTO.mdx new file mode 100644 index 0000000000000..e0e8d1a277467 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantInputDTO.mdx @@ -0,0 +1,174 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductVariantInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).UpdateProductVariantInputDTO + +## Properties + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`UpdateProductVariantOptionInputDTO`](admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantOptionInputDTO.mdx)[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "prices", + "type": "[`UpdateProductVariantPricesInputDTO`](admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantPricesInputDTO.mdx)[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantOptionInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantOptionInputDTO.mdx new file mode 100644 index 0000000000000..2649c6f23f250 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantOptionInputDTO.mdx @@ -0,0 +1,30 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductVariantOptionInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).UpdateProductVariantOptionInputDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantPricesInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantPricesInputDTO.mdx new file mode 100644 index 0000000000000..f184ce7d1ccd1 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantPricesInputDTO.mdx @@ -0,0 +1,62 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductVariantPricesInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).UpdateProductVariantPricesInputDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantsInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantsInputDTO.mdx new file mode 100644 index 0000000000000..98ef46d857fa1 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantsInputDTO.mdx @@ -0,0 +1,174 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductVariantsInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).UpdateProductVariantsInputDTO + +## Properties + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`UpsertProductVariantOptionInputDTO`](admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpsertProductVariantOptionInputDTO.mdx)[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "prices", + "type": "[`UpsertProductVariantPricesInputDTO`](admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpsertProductVariantPricesInputDTO.mdx)[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "upc", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantsWorkflowInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantsWorkflowInputDTO.mdx new file mode 100644 index 0000000000000..9ce80ee657273 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantsWorkflowInputDTO.mdx @@ -0,0 +1,22 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductVariantsWorkflowInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).UpdateProductVariantsWorkflowInputDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductsWorkflowInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductsWorkflowInputDTO.mdx new file mode 100644 index 0000000000000..5ce4a3ba928f7 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductsWorkflowInputDTO.mdx @@ -0,0 +1,22 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateProductsWorkflowInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).UpdateProductsWorkflowInputDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpsertProductVariantOptionInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpsertProductVariantOptionInputDTO.mdx new file mode 100644 index 0000000000000..6fdf6b36ced61 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpsertProductVariantOptionInputDTO.mdx @@ -0,0 +1,30 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpsertProductVariantOptionInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).UpsertProductVariantOptionInputDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpsertProductVariantPricesInputDTO.mdx b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpsertProductVariantPricesInputDTO.mdx new file mode 100644 index 0000000000000..c45bed60e8411 --- /dev/null +++ b/www/apps/docs/content/references/js-client/ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpsertProductVariantPricesInputDTO.mdx @@ -0,0 +1,62 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpsertProductVariantPricesInputDTO + +[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).[ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx).UpsertProductVariantPricesInputDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/SalesChannelTypes/interfaces/admin_discounts.internal.internal-1.SalesChannelTypes.SalesChannelDTO.mdx b/www/apps/docs/content/references/js-client/SalesChannelTypes/interfaces/admin_discounts.internal.internal-1.SalesChannelTypes.SalesChannelDTO.mdx new file mode 100644 index 0000000000000..8f3b5d5452856 --- /dev/null +++ b/www/apps/docs/content/references/js-client/SalesChannelTypes/interfaces/admin_discounts.internal.internal-1.SalesChannelTypes.SalesChannelDTO.mdx @@ -0,0 +1,54 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# SalesChannelDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[SalesChannelTypes](../../internal-1/modules/admin_discounts.internal.internal-1.SalesChannelTypes.mdx).SalesChannelDTO + +## Properties + +", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/SalesChannelTypes/interfaces/admin_discounts.internal.internal-1.SalesChannelTypes.SalesChannelLocationDTO.mdx b/www/apps/docs/content/references/js-client/SalesChannelTypes/interfaces/admin_discounts.internal.internal-1.SalesChannelTypes.SalesChannelLocationDTO.mdx new file mode 100644 index 0000000000000..3eac6e3fee3cc --- /dev/null +++ b/www/apps/docs/content/references/js-client/SalesChannelTypes/interfaces/admin_discounts.internal.internal-1.SalesChannelTypes.SalesChannelLocationDTO.mdx @@ -0,0 +1,38 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# SalesChannelLocationDTO + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[SalesChannelTypes](../../internal-1/modules/admin_discounts.internal.internal-1.SalesChannelTypes.mdx).SalesChannelLocationDTO + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.ISearchService.mdx b/www/apps/docs/content/references/js-client/SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx similarity index 95% rename from www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.ISearchService.mdx rename to www/apps/docs/content/references/js-client/SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx index c84cd2f91bcc5..4c3e297e4d8fc 100644 --- a/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.ISearchService.mdx +++ b/www/apps/docs/content/references/js-client/SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx @@ -6,11 +6,11 @@ import ParameterTypes from "@site/src/components/ParameterTypes" # ISearchService -[admin/discounts](../../modules/admin_discounts.mdx).[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).ISearchService +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[SearchTypes](../../internal-1/modules/admin_discounts.internal.internal-1.SearchTypes.mdx).ISearchService ## Implemented by -- [`AbstractSearchService`](../classes/admin_discounts.internal.AbstractSearchService.mdx) +- [`AbstractSearchService`](../../internal/classes/admin_discounts.internal.AbstractSearchService.mdx) ## Properties diff --git a/www/apps/docs/content/references/js-client/WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.CartWorkflow.mdx b/www/apps/docs/content/references/js-client/WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.CartWorkflow.mdx new file mode 100644 index 0000000000000..140fbc28b9831 --- /dev/null +++ b/www/apps/docs/content/references/js-client/WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.CartWorkflow.mdx @@ -0,0 +1,14 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CartWorkflow + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).CartWorkflow + +## Interfaces + +- [CreateCartWorkflowInputDTO](../../CartWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.CartWorkflow.CreateCartWorkflowInputDTO.mdx) +- [CreateLineItemInputDTO](../../CartWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.CartWorkflow.CreateLineItemInputDTO.mdx) diff --git a/www/apps/docs/content/references/js-client/WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.CommonWorkflow.mdx b/www/apps/docs/content/references/js-client/WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.CommonWorkflow.mdx new file mode 100644 index 0000000000000..5fc27822538d1 --- /dev/null +++ b/www/apps/docs/content/references/js-client/WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.CommonWorkflow.mdx @@ -0,0 +1,13 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CommonWorkflow + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).CommonWorkflow + +## Interfaces + +- [WorkflowInputConfig](../../CommonWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.CommonWorkflow.WorkflowInputConfig.mdx) diff --git a/www/apps/docs/content/references/js-client/WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.InventoryWorkflow.mdx b/www/apps/docs/content/references/js-client/WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.InventoryWorkflow.mdx new file mode 100644 index 0000000000000..c83d37eab7842 --- /dev/null +++ b/www/apps/docs/content/references/js-client/WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.InventoryWorkflow.mdx @@ -0,0 +1,14 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# InventoryWorkflow + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).InventoryWorkflow + +## Interfaces + +- [CreateInventoryItemInputDTO](../../InventoryWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.InventoryWorkflow.CreateInventoryItemInputDTO.mdx) +- [CreateInventoryItemsWorkflowInputDTO](../../InventoryWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.InventoryWorkflow.CreateInventoryItemsWorkflowInputDTO.mdx) diff --git a/www/apps/docs/content/references/js-client/WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx b/www/apps/docs/content/references/js-client/WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx new file mode 100644 index 0000000000000..95163a26145ed --- /dev/null +++ b/www/apps/docs/content/references/js-client/WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx @@ -0,0 +1,35 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ProductWorkflow + +[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).[WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx).ProductWorkflow + +## Interfaces + +- [CreateProductInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductInputDTO.mdx) +- [CreateProductOptionInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductOptionInputDTO.mdx) +- [CreateProductProductCategoryInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductProductCategoryInputDTO.mdx) +- [CreateProductSalesChannelInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductSalesChannelInputDTO.mdx) +- [CreateProductTagInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductTagInputDTO.mdx) +- [CreateProductTypeInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductTypeInputDTO.mdx) +- [CreateProductVariantInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductVariantInputDTO.mdx) +- [CreateProductVariantPricesInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductVariantPricesInputDTO.mdx) +- [CreateProductsWorkflowInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreateProductsWorkflowInputDTO.mdx) +- [CreteProductVariantOptionInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.CreteProductVariantOptionInputDTO.mdx) +- [UpdateProductInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductInputDTO.mdx) +- [UpdateProductProductCategoryInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductProductCategoryInputDTO.mdx) +- [UpdateProductSalesChannelInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductSalesChannelInputDTO.mdx) +- [UpdateProductTagInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductTagInputDTO.mdx) +- [UpdateProductTypeInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductTypeInputDTO.mdx) +- [UpdateProductVariantInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantInputDTO.mdx) +- [UpdateProductVariantOptionInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantOptionInputDTO.mdx) +- [UpdateProductVariantPricesInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantPricesInputDTO.mdx) +- [UpdateProductVariantsInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantsInputDTO.mdx) +- [UpdateProductVariantsWorkflowInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductVariantsWorkflowInputDTO.mdx) +- [UpdateProductsWorkflowInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpdateProductsWorkflowInputDTO.mdx) +- [UpsertProductVariantOptionInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpsertProductVariantOptionInputDTO.mdx) +- [UpsertProductVariantPricesInputDTO](../../ProductWorkflow/interfaces/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.UpsertProductVariantPricesInputDTO.mdx) diff --git a/www/apps/docs/content/references/js-client/admin_auth/classes/admin_auth.AdminAuthResource.mdx b/www/apps/docs/content/references/js-client/admin_auth/classes/admin_auth.AdminAuthResource.mdx index dc1101f4f9cd2..f5be29faff389 100644 --- a/www/apps/docs/content/references/js-client/admin_auth/classes/admin_auth.AdminAuthResource.mdx +++ b/www/apps/docs/content/references/js-client/admin_auth/classes/admin_auth.AdminAuthResource.mdx @@ -191,7 +191,7 @@ ___ { "name": "AdminBearerAuthRes", "type": "`object`", - "description": "#### Schema AdminBearerAuthRes type: object properties: accessToken: description: Access token for subsequent authorization. type: string", + "description": "#### Schema AdminBearerAuthRes type: object properties: access_token: description: Access token that can be used to send authenticated requests. type: string", "optional": false, "defaultValue": "", "children": [] diff --git a/www/apps/docs/content/references/js-client/admin_auth/modules/admin_auth.internal.mdx b/www/apps/docs/content/references/js-client/admin_auth/modules/admin_auth.internal.mdx index 954ba6b5c55d8..9ecc0e61ef148 100644 --- a/www/apps/docs/content/references/js-client/admin_auth/modules/admin_auth.internal.mdx +++ b/www/apps/docs/content/references/js-client/admin_auth/modules/admin_auth.internal.mdx @@ -58,8 +58,8 @@ ___ AdminBearerAuthRes type: object properties: - accessToken: - description: Access token for subsequent authorization. + access_token: + description: Access token that can be used to send authenticated requests. type: string #### Type declaration diff --git a/www/apps/docs/content/references/js-client/admin_discounts/modules/admin_discounts.internal.mdx b/www/apps/docs/content/references/js-client/admin_discounts/modules/admin_discounts.internal.mdx index 5424e77a3d046..8fcf36b826729 100644 --- a/www/apps/docs/content/references/js-client/admin_discounts/modules/admin_discounts.internal.mdx +++ b/www/apps/docs/content/references/js-client/admin_discounts/modules/admin_discounts.internal.mdx @@ -14,13 +14,13 @@ import ParameterTypes from "@site/src/components/ParameterTypes" - [internal](../../internal/modules/admin_discounts.internal.internal-2.mdx) - [internal](../../internal/modules/admin_discounts.internal.internal-3.mdx) - [internal](../../internal/modules/admin_discounts.internal.internal-4.mdx) +- [internal](../../internal/modules/admin_discounts.internal.internal-5.mdx) ## Enumerations - [DefaultPriceType](../../internal/enums/admin_discounts.internal.DefaultPriceType.mdx) - [DiscountConditionJoinTableForeignKey](../../internal/enums/admin_discounts.internal.DiscountConditionJoinTableForeignKey.mdx) - [FulfillmentStatus](../../internal/enums/admin_discounts.internal.FulfillmentStatus.mdx) -- [MODULE\_RESOURCE\_TYPE](../../internal/enums/admin_discounts.internal.MODULE_RESOURCE_TYPE.mdx) - [OrderStatus](../../internal/enums/admin_discounts.internal.OrderStatus.mdx) - [PaymentStatus](../../internal/enums/admin_discounts.internal.PaymentStatus.mdx) @@ -122,7 +122,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" - [Tag](../../internal/classes/admin_discounts.internal.Tag.mdx) - [Transform](../../internal/classes/admin_discounts.internal.Transform.mdx) - [WritableBase](../../internal/classes/admin_discounts.internal.WritableBase.mdx) -- [internal](../../internal/classes/admin_discounts.internal.internal-5.mdx) +- [internal](../../internal/classes/admin_discounts.internal.internal-6.mdx) ## Interfaces @@ -134,6 +134,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" - [AsyncIterable](../../internal/interfaces/admin_discounts.internal.AsyncIterable.mdx) - [AsyncIterableIterator](../../internal/interfaces/admin_discounts.internal.AsyncIterableIterator.mdx) - [AsyncIterator](../../internal/interfaces/admin_discounts.internal.AsyncIterator.mdx) +- [BaseRepositoryService](../../internal/interfaces/admin_discounts.internal.BaseRepositoryService.mdx) - [BlobOptions](../../internal/interfaces/admin_discounts.internal.BlobOptions.mdx) - [Buffer](../../internal/interfaces/admin_discounts.internal.Buffer.mdx) - [BufferConstructor](../../internal/interfaces/admin_discounts.internal.BufferConstructor.mdx) @@ -147,13 +148,11 @@ import ParameterTypes from "@site/src/components/ParameterTypes" - [Error](../../internal/interfaces/admin_discounts.internal.Error.mdx) - [EventEmitter](../../internal/interfaces/admin_discounts.internal.EventEmitter-2.mdx) - [EventEmitterOptions](../../internal/interfaces/admin_discounts.internal.EventEmitterOptions.mdx) -- [FindConfig](../../internal/interfaces/admin_discounts.internal.FindConfig.mdx) - [ICacheService](../../internal/interfaces/admin_discounts.internal.ICacheService.mdx) - [IEventBusModuleService](../../internal/interfaces/admin_discounts.internal.IEventBusModuleService.mdx) - [IEventBusService](../../internal/interfaces/admin_discounts.internal.IEventBusService.mdx) -- [IFlagRouter](../../internal/interfaces/admin_discounts.internal.IFlagRouter.mdx) - [IInventoryService](../../internal/interfaces/admin_discounts.internal.IInventoryService.mdx) -- [ISearchService](../../internal/interfaces/admin_discounts.internal.ISearchService.mdx) +- [IPricingModuleService](../../internal/interfaces/admin_discounts.internal.IPricingModuleService.mdx) - [IStockLocationService](../../internal/interfaces/admin_discounts.internal.IStockLocationService.mdx) - [ITransactionBaseService](../../internal/interfaces/admin_discounts.internal.ITransactionBaseService.mdx) - [IncomingHttpHeaders](../../internal/interfaces/admin_discounts.internal.IncomingHttpHeaders.mdx) @@ -163,12 +162,9 @@ import ParameterTypes from "@site/src/components/ParameterTypes" - [Iterator](../../internal/interfaces/admin_discounts.internal.Iterator.mdx) - [IteratorReturnResult](../../internal/interfaces/admin_discounts.internal.IteratorReturnResult.mdx) - [IteratorYieldResult](../../internal/interfaces/admin_discounts.internal.IteratorYieldResult.mdx) -- [JoinerServiceConfig](../../internal/interfaces/admin_discounts.internal.JoinerServiceConfig.mdx) -- [JoinerServiceConfigAlias](../../internal/interfaces/admin_discounts.internal.JoinerServiceConfigAlias.mdx) - [Logger](../../internal/interfaces/admin_discounts.internal.Logger.mdx) - [LookupOneOptions](../../internal/interfaces/admin_discounts.internal.LookupOneOptions.mdx) - [LookupOptions](../../internal/interfaces/admin_discounts.internal.LookupOptions.mdx) -- [NumericalComparisonOperator](../../internal/interfaces/admin_discounts.internal.NumericalComparisonOperator.mdx) - [Object](../../internal/interfaces/admin_discounts.internal.Object.mdx) - [OnReadOpts](../../internal/interfaces/admin_discounts.internal.OnReadOpts.mdx) - [PromiseLike](../../internal/interfaces/admin_discounts.internal.PromiseLike.mdx) @@ -191,7 +187,6 @@ import ParameterTypes from "@site/src/components/ParameterTypes" - [SocketConstructorOpts](../../internal/interfaces/admin_discounts.internal.SocketConstructorOpts.mdx) - [StaticEventEmitterOptions](../../internal/interfaces/admin_discounts.internal.StaticEventEmitterOptions.mdx) - [StreamPipeOptions](../../internal/interfaces/admin_discounts.internal.StreamPipeOptions.mdx) -- [StringComparisonOperator](../../internal/interfaces/admin_discounts.internal.StringComparisonOperator.mdx) - [TcpSocketConnectOpts](../../internal/interfaces/admin_discounts.internal.TcpSocketConnectOpts.mdx) - [TransformOptions](../../internal/interfaces/admin_discounts.internal.TransformOptions.mdx) - [UnderlyingByteSource](../../internal/interfaces/admin_discounts.internal.UnderlyingByteSource.mdx) @@ -222,13 +217,13 @@ ___ ### ReadableOptions -Re-exports [ReadableOptions](../../internal-2/interfaces/admin_discounts.internal.internal-2.ReadableOptions.mdx) +Re-exports [ReadableOptions](../../internal-3/interfaces/admin_discounts.internal.internal-3.ReadableOptions.mdx) ___ ### WritableOptions -Re-exports [WritableOptions](../../internal-2/interfaces/admin_discounts.internal.internal-2.WritableOptions.mdx) +Re-exports [WritableOptions](../../internal-3/interfaces/admin_discounts.internal.internal-3.WritableOptions.mdx) ## Enumeration Members @@ -236,18 +231,6 @@ Re-exports [WritableOptions](../../internal-2/interfaces/admin_discounts.interna **DEFAULT**: ``"default"`` -___ - -### EXTERNAL - - **EXTERNAL**: ``"external"`` - -___ - -### INTERNAL - - **INTERNAL**: ``"internal"`` - ## Type Aliases ### AddOrderEditLineItemInput @@ -965,7 +948,7 @@ ___ }, { "name": "modules", - "type": "Record<`string`, ``false`` \\| `string` \\| [`Partial`](admin_discounts.internal.mdx#partial)<[`InternalModuleDeclaration`](admin_discounts.internal.mdx#internalmoduledeclaration) \\| [`ExternalModuleDeclaration`](admin_discounts.internal.mdx#externalmoduledeclaration)\\>\\>", + "type": "Record<`string`, ``false`` \\| `string` \\| [`Partial`](admin_discounts.internal.mdx#partial)<[`InternalModuleDeclaration`](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#internalmoduledeclaration) \\| [`ExternalModuleDeclaration`](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#externalmoduledeclaration)\\>\\>", "description": "", "optional": true, "defaultValue": "", @@ -981,7 +964,7 @@ ___ }, { "name": "projectConfig", - "type": "[`ProjectConfigOptions`](admin_discounts.internal.mdx#projectconfigoptions)", + "type": "[`ProjectConfigOptions`](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx#projectconfigoptions)", "description": "", "optional": false, "defaultValue": "", @@ -1802,180 +1785,6 @@ ___ ___ -### CreateInventoryItemInput - - **CreateInventoryItemInput**: `Object` - -#### Type declaration - - \\| ``null``", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "mid_code", - "type": "`string` \\| ``null``", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "origin_country", - "type": "`string` \\| ``null``", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "requires_shipping", - "type": "`boolean`", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "sku", - "type": "`string` \\| ``null``", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "thumbnail", - "type": "`string` \\| ``null``", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "title", - "type": "`string` \\| ``null``", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "weight", - "type": "`number` \\| ``null``", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "width", - "type": "`number` \\| ``null``", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - } -]} /> - -___ - -### CreateInventoryLevelInput - - **CreateInventoryLevelInput**: `Object` - -#### Type declaration - - - -___ - ### CreateOauthInput **CreateOauthInput**: `Object` @@ -3072,81 +2881,6 @@ ___ ___ -### CreateReservationItemInput - - **CreateReservationItemInput**: `Object` - -#### Type declaration - - \\| ``null``", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "quantity", - "type": "`number`", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } -]} /> - -___ - ### CreateReturnInput **CreateReturnInput**: `Object` @@ -3604,56 +3338,9 @@ ___ ___ -### CreateStockLocationInput - - **CreateStockLocationInput**: `Object` - -#### Schema +### CreateTaxRateInput -Represents the Input to create a Stock Location - -#### Type declaration - -", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "name", - "type": "`string`", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } -]} /> - -___ - -### CreateTaxRateInput - - **CreateTaxRateInput**: `Object` + **CreateTaxRateInput**: `Object` #### Type declaration @@ -3737,7 +3424,7 @@ ___ ### DefaultWithoutRelations - **DefaultWithoutRelations**: [`Omit`](../../admin_auth/modules/admin_auth.internal.mdx#omit)<[`ExtendedFindConfig`](admin_discounts.internal.mdx#extendedfindconfig)<[`Product`](../../internal/classes/admin_collections.internal.Product.mdx)\>, ``"relations"``\> + **DefaultWithoutRelations**: [`Omit`](../../admin_auth/modules/admin_auth.internal.mdx#omit)<[`ExtendedFindConfig`](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx#extendedfindconfig)<[`Product`](../../internal/classes/admin_collections.internal.Product.mdx)\>, ``"relations"``\> ___ @@ -3799,6 +3486,29 @@ ___ ___ +### Dictionary + + **Dictionary**<`T`\>: `object` + +#### Type parameters + + + +#### Index signature + +▪ [k: `string`]: `T` + +___ + ### Discount **Discount**: `Object` @@ -4099,15 +3809,15 @@ ___ ___ -### ExtendedFindConfig +### ExpandScalar - **ExtendedFindConfig**<`TEntity`\>: [`Omit`](../../admin_auth/modules/admin_auth.internal.mdx#omit)<`FindOneOptions`<`TEntity`\>, ``"where"`` \| ``"relations"`` \| ``"select"``\> \| [`Omit`](../../admin_auth/modules/admin_auth.internal.mdx#omit)<`FindManyOptions`<`TEntity`\>, ``"where"`` \| ``"relations"`` \| ``"select"``\> & { `order?`: `FindOptionsOrder`<`TEntity`\> ; `relations?`: `FindOptionsRelations`<`TEntity`\> ; `select?`: `FindOptionsSelect`<`TEntity`\> ; `skip?`: `number` ; `take?`: `number` ; `where`: `FindOptionsWhere`<`TEntity`\> \| `FindOptionsWhere`<`TEntity`\>[] } + **ExpandScalar**<`T`\>: ``null`` \| `T` extends `string` ? `string` \| `RegExp` : `T` extends `Date` ? `Date` \| `string` : `T` #### Type parameters ", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "scope", - "type": "[`EXTERNAL`](admin_discounts.internal.mdx#external)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "server", - "type": "`object`", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "server.keepAlive", - "type": "`boolean`", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "server.type", - "type": "``\"http\"``", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "server.url", - "type": "`string`", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } -]} /> - -___ - -### FeatureFlagsResponse - - **FeatureFlagsResponse**: { `key`: `string` ; `value`: `boolean` \| Record<`string`, `boolean`\> }[] - -#### Schema - -FeatureFlagsResponse -type: array -items: - type: object - required: - - key - - value - properties: - key: - description: The key of the feature flag. - type: string - value: - description: The value of the feature flag. - type: boolean - -___ - ### FeatureFlagsResponse **FeatureFlagsResponse**: { `key`: `string` ; `value`: `boolean` \| Record<`string`, `boolean`\> }[] @@ -4348,39 +3952,77 @@ ___ ___ -### FilterableInventoryItemProps +### FilterValue + + **FilterValue**<`T`\>: [`OperatorMap`](admin_discounts.internal.mdx#operatormap)<[`FilterValue2`](admin_discounts.internal.mdx#filtervalue2)<`T`\>\> \| [`FilterValue2`](admin_discounts.internal.mdx#filtervalue2)<`T`\> \| [`FilterValue2`](admin_discounts.internal.mdx#filtervalue2)<`T`\>[] \| ``null`` + +#### Type parameters + + + +___ + +### FilterValue2 + + **FilterValue2**<`T`\>: `T` \| [`ExpandScalar`](admin_discounts.internal.mdx#expandscalar)<`T`\> \| [`Primary`](admin_discounts.internal.mdx#primary)<`T`\> + +#### Type parameters + + + +___ + +### FilterableTaxRateProps - **FilterableInventoryItemProps**: `Object` + **FilterableTaxRateProps**: `Object` #### Type declaration + +___ + +### FindProductConfig + + **FindProductConfig**: [`FindConfig`](../../internal/interfaces/admin_discounts.internal.internal.FindConfig.mdx)<[`Product`](../../internal/classes/admin_collections.internal.Product.mdx)\> & [`PriceListLoadConfig`](../../internal/modules/admin_discounts.internal.internal.mdx#pricelistloadconfig) + +___ + +### FindWithRelationsOptions + + **FindWithRelationsOptions**: `FindManyOptions`<[`ProductVariant`](../../internal/classes/admin_collections.internal.ProductVariant.mdx)\> & { `order?`: `FindOptionsOrder`<[`ProductVariant`](../../internal/classes/admin_collections.internal.ProductVariant.mdx)\> ; `withDeleted?`: `boolean` } + +___ + +### FindWithoutRelationsOptions + + **FindWithoutRelationsOptions**: [`DefaultWithoutRelations`](admin_discounts.internal.mdx#defaultwithoutrelations) & { `where`: [`DefaultWithoutRelations`](admin_discounts.internal.mdx#defaultwithoutrelations)[``"where"``] & { `discount_condition_id?`: `string` \| `FindOperator`<`string`\> } } + +___ + +### FindWithoutRelationsOptions + + **FindWithoutRelationsOptions**: [`DefaultWithoutRelations`](admin_discounts.internal.mdx#defaultwithoutrelations-1) & { `where`: [`DefaultWithoutRelations`](admin_discounts.internal.mdx#defaultwithoutrelations-1)[``"where"``] & { `categories?`: `FindOptionsWhere`<[`ProductCategory`](../../internal/classes/admin_collections.internal.ProductCategory.mdx)\> ; `category_id?`: [`CategoryQueryParams`](admin_discounts.internal.mdx#categoryqueryparams) ; `discount_condition_id?`: `string` ; `include_category_children?`: `boolean` ; `price_list_id?`: `FindOperator`<[`PriceList`](../../internal/classes/admin_collections.internal.PriceList.mdx)\> ; `sales_channel_id?`: `FindOperator`<[`SalesChannel`](../../internal/classes/admin_collections.internal.SalesChannel.mdx)\> ; `tags?`: `FindOperator`<[`ProductTag`](../../internal/classes/admin_collections.internal.ProductTag.mdx)\> } } + +___ + +### FulFillmentItemType - **FilterableInventoryLevelProps**: `Object` + **FulFillmentItemType**: `Object` #### Type declaration - -___ - -### FilterableReservationItemProps - - **FilterableReservationItemProps**: `Object` - -#### Type declaration - - - -___ - -### FilterableStockLocationProps - - **FilterableStockLocationProps**: `Object` - -#### Type declaration - - - -___ - -### FilterableTaxRateProps - - **FilterableTaxRateProps**: `Object` - -#### Type declaration - - - -___ - -### FilterableUserProps - - **FilterableUserProps**: [`PartialPick`](../../internal/modules/admin_discounts.internal.internal.mdx#partialpick)<[`User`](../../internal/classes/admin_auth.internal.User.mdx), ``"email"`` \| ``"first_name"`` \| ``"last_name"`` \| ``"created_at"`` \| ``"updated_at"`` \| ``"deleted_at"``\> - -___ - -### FindProductConfig - - **FindProductConfig**: [`FindConfig`](../../internal/interfaces/admin_discounts.internal.internal.FindConfig.mdx)<[`Product`](../../internal/classes/admin_collections.internal.Product.mdx)\> & [`PriceListLoadConfig`](../../internal/modules/admin_discounts.internal.internal.mdx#pricelistloadconfig) - -___ - -### FindWithRelationsOptions - - **FindWithRelationsOptions**: `FindManyOptions`<[`ProductVariant`](../../internal/classes/admin_collections.internal.ProductVariant.mdx)\> & { `order?`: `FindOptionsOrder`<[`ProductVariant`](../../internal/classes/admin_collections.internal.ProductVariant.mdx)\> ; `withDeleted?`: `boolean` } - -___ - -### FindWithoutRelationsOptions - - **FindWithoutRelationsOptions**: [`DefaultWithoutRelations`](admin_discounts.internal.mdx#defaultwithoutrelations) & { `where`: [`DefaultWithoutRelations`](admin_discounts.internal.mdx#defaultwithoutrelations)[``"where"``] & { `discount_condition_id?`: `string` \| `FindOperator`<`string`\> } } - -___ - -### FindWithoutRelationsOptions - - **FindWithoutRelationsOptions**: [`DefaultWithoutRelations`](admin_discounts.internal.mdx#defaultwithoutrelations-1) & { `where`: [`DefaultWithoutRelations`](admin_discounts.internal.mdx#defaultwithoutrelations-1)[``"where"``] & { `categories?`: `FindOptionsWhere`<[`ProductCategory`](../../internal/classes/admin_collections.internal.ProductCategory.mdx)\> ; `category_id?`: [`CategoryQueryParams`](admin_discounts.internal.mdx#categoryqueryparams) ; `discount_condition_id?`: `string` ; `include_category_children?`: `boolean` ; `price_list_id?`: `FindOperator`<[`PriceList`](../../internal/classes/admin_collections.internal.PriceList.mdx)\> ; `sales_channel_id?`: `FindOperator`<[`SalesChannel`](../../internal/classes/admin_collections.internal.SalesChannel.mdx)\> ; `tags?`: `FindOperator`<[`ProductTag`](../../internal/classes/admin_collections.internal.ProductTag.mdx)\> } } - -___ - -### FulFillmentItemType - - **FulFillmentItemType**: `Object` - -#### Type declaration - - - -___ - -### HttpCompressionOptions - - **HttpCompressionOptions**: `Object` - -#### Type declaration - -", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "resolve", - "type": "`string`", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "resources", - "type": "[`MODULE_RESOURCE_TYPE`](../../internal/enums/admin_discounts.internal.MODULE_RESOURCE_TYPE.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "scope", - "type": "[`INTERNAL`](admin_discounts.internal.mdx#internal)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } -]} /> - -___ - ### InventoryItemDTO **InventoryItemDTO**: `Object` @@ -8264,81 +7584,6 @@ ___ ___ -### JoinerRelationship - - **JoinerRelationship**: `Object` - -#### Type declaration - -", - "description": "Extra arguments to pass to the remoteFetchData callback", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "foreignKey", - "type": "`string`", - "description": "", - "optional": false, - "defaultValue": "", - "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": "", - "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": "", - "children": [] - }, - { - "name": "isList", - "type": "`boolean`", - "description": "Force the relationship to return a list", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "primaryKey", - "type": "`string`", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "serviceName", - "type": "`string`", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } -]} /> - -___ - ### LineAllocationsMap **LineAllocationsMap**: `object` @@ -8866,47 +8111,89 @@ ___ ___ -### ModuleDefinition +### ModuleDeclaration + + **ModuleDeclaration**: [`ExternalModuleDeclaration`](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#externalmoduledeclaration) \| [`InternalModuleDeclaration`](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#internalmoduledeclaration) + +___ + +### ModulesResponse + + **ModulesResponse**: [`ModulesResponse`](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#modulesresponse) + +#### Schema + +ModulesResponse +type: array +items: + type: object + required: + - module + - resolution + properties: + module: + description: The key of the module. + type: string + resolution: + description: The resolution path of the module or false if module is not installed. + type: string + +___ + +### OperatorMap + + **OperatorMap**<`T`\>: `Object` + +#### Type parameters - **ModuleDefinition**: `Object` + #### Type declaration []", + "description": "", "optional": true, "defaultValue": "", "children": [] }, { - "name": "defaultModuleDeclaration", - "type": "[`InternalModuleDeclaration`](admin_discounts.internal.mdx#internalmoduledeclaration) \\| [`ExternalModuleDeclaration`](admin_discounts.internal.mdx#externalmoduledeclaration)", + "name": "$contained", + "type": "`string`[]", "description": "", - "optional": false, + "optional": true, "defaultValue": "", "children": [] }, { - "name": "defaultPackage", - "type": "`string` \\| ``false``", + "name": "$contains", + "type": "`string`[]", "description": "", - "optional": false, + "optional": true, "defaultValue": "", "children": [] }, { - "name": "dependencies", - "type": "`string`[]", + "name": "$eq", + "type": "[`ExpandScalar`](admin_discounts.internal.mdx#expandscalar)<`T`\\> \\| [`ExpandScalar`](admin_discounts.internal.mdx#expandscalar)<`T`\\>[]", "description": "", "optional": true, "defaultValue": "", "children": [] }, { - "name": "isLegacy", + "name": "$exists", "type": "`boolean`", "description": "", "optional": true, @@ -8914,42 +8201,114 @@ ___ "children": [] }, { - "name": "isQueryable", - "type": "`boolean`", + "name": "$fulltext", + "type": "`string`", "description": "", "optional": true, "defaultValue": "", "children": [] }, { - "name": "isRequired", - "type": "`boolean`", - "description": "#### Deprecated property will be removed in future versions", + "name": "$gt", + "type": "[`ExpandScalar`](admin_discounts.internal.mdx#expandscalar)<`T`\\>", + "description": "", "optional": true, "defaultValue": "", "children": [] }, { - "name": "key", + "name": "$gte", + "type": "[`ExpandScalar`](admin_discounts.internal.mdx#expandscalar)<`T`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$ilike", "type": "`string`", "description": "", - "optional": false, + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$in", + "type": "[`ExpandScalar`](admin_discounts.internal.mdx#expandscalar)<`T`\\>[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$like", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$lt", + "type": "[`ExpandScalar`](admin_discounts.internal.mdx#expandscalar)<`T`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$lte", + "type": "[`ExpandScalar`](admin_discounts.internal.mdx#expandscalar)<`T`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$ne", + "type": "[`ExpandScalar`](admin_discounts.internal.mdx#expandscalar)<`T`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$nin", + "type": "[`ExpandScalar`](admin_discounts.internal.mdx#expandscalar)<`T`\\>[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$not", + "type": "[`Query`](admin_discounts.internal.mdx#query)<`T`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "[`Query`](admin_discounts.internal.mdx#query)<`T`\\>[]", + "description": "", + "optional": true, "defaultValue": "", "children": [] }, { - "name": "label", - "type": "`string`", + "name": "$overlap", + "type": "`string`[]", "description": "", - "optional": false, + "optional": true, "defaultValue": "", "children": [] }, { - "name": "registrationName", + "name": "$re", "type": "`string`", "description": "", - "optional": false, + "optional": true, "defaultValue": "", "children": [] } @@ -8957,44 +8316,22 @@ ___ ___ -### ModuleJoinerConfig - - **ModuleJoinerConfig**: [`Omit`](../../admin_auth/modules/admin_auth.internal.mdx#omit)<[`JoinerServiceConfig`](../../internal/interfaces/admin_discounts.internal.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`](admin_discounts.internal.mdx#modulejoinerrelationship) ; `serviceName`: `string` }[] ; `isLink?`: `boolean` ; `isReadOnlyLink?`: `boolean` ; `linkableKeys?`: Record<`string`, `string`\> ; `primaryKeys?`: `string`[] ; `relationships?`: [`ModuleJoinerRelationship`](admin_discounts.internal.mdx#modulejoinerrelationship)[] ; `schema?`: `string` ; `serviceName?`: `string` } - -___ - -### ModuleJoinerRelationship - - **ModuleJoinerRelationship**: [`JoinerRelationship`](admin_discounts.internal.mdx#joinerrelationship) & { `deleteCascade?`: `boolean` ; `isInternalService?`: `boolean` } - -___ - -### ModulesResponse - - **ModulesResponse**: [`ModulesResponse`](admin_discounts.internal.mdx#modulesresponse-1) - -#### Schema - -ModulesResponse -type: array -items: - type: object - required: - - module - - resolution - properties: - module: - description: The key of the module. - type: string - resolution: - description: The resolution path of the module or false if module is not installed. - type: string +### Order -___ + **Order**<`T`\>: { [key in keyof T]?: "ASC" \| "DESC" \| Order } -### ModulesResponse +#### Type parameters - **ModulesResponse**: { `module`: `string` ; `resolution`: `string` \| ``false`` }[] + ___ @@ -9275,6 +8612,12 @@ ___ ___ +### PrevLimit + + **PrevLimit**: [`never`, ``1``, ``2``, ``3``] + +___ + ### Price **Price**: [`Partial`](admin_discounts.internal.mdx#partial)<[`Omit`](../../admin_auth/modules/admin_auth.internal.mdx#omit)<[`MoneyAmount`](../../internal/classes/admin_collections.internal.MoneyAmount.mdx), ``"created_at"`` \| ``"updated_at"`` \| ``"deleted_at"``\>\> & { `amount`: `number` } @@ -9505,6 +8848,25 @@ ___ ___ +### Primary + + **Primary**<`T`\>: `T` extends { `[PrimaryKeyType]?`: infer PK } ? [`ReadonlyPrimary`](admin_discounts.internal.mdx#readonlyprimary)<`PK`\> : `T` extends { `_id?`: infer PK } ? [`ReadonlyPrimary`](admin_discounts.internal.mdx#readonlyprimary)<`PK`\> \| `string` : `T` extends { `uuid?`: infer PK } ? [`ReadonlyPrimary`](admin_discounts.internal.mdx#readonlyprimary)<`PK`\> : `T` extends { `id?`: infer PK } ? [`ReadonlyPrimary`](admin_discounts.internal.mdx#readonlyprimary)<`PK`\> : `never` + +#### Type parameters + + + +___ + ### ProductCategoryInput **ProductCategoryInput**: `Object` @@ -9689,137 +9051,6 @@ ___ ___ -### ProjectConfigOptions - - **ProjectConfigOptions**: `Object` - -#### Type declaration - - & { `ssl`: { `rejectUnauthorized`: ``false`` } }", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "database_logging", - "type": "`LoggerOptions`", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "database_schema", - "type": "`string`", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "database_type", - "type": "`string`", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "database_url", - "type": "`string`", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "http_compression", - "type": "[`HttpCompressionOptions`](admin_discounts.internal.mdx#httpcompressionoptions)", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "jwt_secret", - "type": "`string`", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "redis_options", - "type": "`RedisOptions`", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "redis_prefix", - "type": "`string`", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "redis_url", - "type": "`string`", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "session_options", - "type": "[`SessionOptions`](admin_discounts.internal.mdx#sessionoptions)", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "store_cors", - "type": "`string`", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - } -]} /> - -___ - ### PropertyDecorator **PropertyDecorator**: (`target`: [`Object`](admin_discounts.internal.mdx#object), `propertyKey`: `string` \| `symbol`) => `void` @@ -9986,6 +9217,25 @@ A union type of the possible provider tax lines. ___ +### Query + + **Query**<`T`\>: `T` extends `object` ? `T` extends [`Scalar`](admin_discounts.internal.mdx#scalar) ? `never` : [`FilterQuery`](../../internal-1/modules/admin_discounts.internal.internal-1.DAL.mdx#filterquery)<`T`\> : [`FilterValue`](admin_discounts.internal.mdx#filtervalue)<`T`\> + +#### Type parameters + + + +___ + ### ReadableStreamController **ReadableStreamController**<`T`\>: [`ReadableStreamDefaultController`](admin_discounts.internal.mdx#readablestreamdefaultcontroller)<`T`\> @@ -10024,27 +9274,113 @@ ___ ___ +### Readonly + + **Readonly**<`T`\>: { readonly [P in keyof T]: T[P] } + +Make all properties in T readonly + +#### Type parameters + + + +___ + +### ReadonlyPrimary + + **ReadonlyPrimary**<`T`\>: `T` extends `any`[] ? [`Readonly`](admin_discounts.internal.mdx#readonly)<`T`\> : `T` + +#### Type parameters + + + +___ + ### RegionDetails - **RegionDetails**: `Object` + **RegionDetails**: `Object` + +#### Type declaration + + + +___ + +### RemoteQueryFunction + + **RemoteQueryFunction**: (`query`: `string` \| [`RemoteJoinerQuery`](../../internal-1/interfaces/admin_discounts.internal.internal-1.RemoteJoinerQuery.mdx) \| `object`, `variables?`: Record<`string`, `unknown`\>) => `Promise`<`any`\> \| ``null`` #### Type declaration +(`query`, `variables?`): `Promise`<`any`\> \| ``null`` + +##### Parameters + ", "description": "", - "optional": false, + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +##### Returns + +`Promise`<`any`\> \| ``null`` + + \\| ``null``", + "type": "`Promise`<`any`\\> \\| ``null``", + "optional": true, "defaultValue": "", + "description": "", "children": [] } ]} /> @@ -10332,6 +9668,12 @@ ___ ___ +### Scalar + + **Scalar**: `boolean` \| `number` \| `string` \| `bigint` \| `symbol` \| `Date` \| `RegExp` \| [`Buffer`](admin_discounts.internal.mdx#buffer) \| { `toHexString`: Method toHexString } + +___ + ### SessionOptions **SessionOptions**: `Object` @@ -10391,33 +9733,6 @@ ___ ___ -### SharedContext - - **SharedContext**: `Object` - -#### Type declaration - - - -___ - ### ShippingMethod **ShippingMethod**: `Object` @@ -10566,284 +9881,85 @@ ___ "children": [] }, { - "name": "tax_lines", - "type": "[`ShippingMethodTaxLine`](../../internal/classes/admin_collections.internal.ShippingMethodTaxLine.mdx)[]", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "tax_total", - "type": "`number`", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "total", - "type": "`number`", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } -]} /> - -___ - -### ShippingMethodUpdate - - **ShippingMethodUpdate**: `Object` - -#### Type declaration - - - -___ - -### ShippingOptionData - - **ShippingOptionData**: Record<`string`, `unknown`\> - -___ - -### ShippingOptionPricing - - **ShippingOptionPricing**: `Object` - -#### Type declaration - - - -___ - -### SocketConnectOpts - - **SocketConnectOpts**: [`TcpSocketConnectOpts`](../../internal/interfaces/admin_discounts.internal.TcpSocketConnectOpts.mdx) \| [`IpcSocketConnectOpts`](../../internal/interfaces/admin_discounts.internal.IpcSocketConnectOpts.mdx) - -___ - -### SocketReadyState - - **SocketReadyState**: ``"opening"`` \| ``"open"`` \| ``"readOnly"`` \| ``"writeOnly"`` \| ``"closed"`` - -___ - -### StagedJobServiceProps - - **StagedJobServiceProps**: `Object` - -#### Type declaration - - - -___ - -### StockLocationAddressDTO - - **StockLocationAddressDTO**: `Object` - -#### Schema - -Represents a Stock Location Address - -#### Type declaration - - + +___ + +### ShippingMethodUpdate + + **ShippingMethodUpdate**: `Object` + +#### Type declaration + + \\| ``null``", + "name": "data", + "type": "`any`", "description": "", "optional": true, "defaultValue": "", "children": [] }, { - "name": "phone", - "type": "`string` \\| ``null``", + "name": "order_id", + "type": "`string`", "description": "", "optional": true, "defaultValue": "", "children": [] }, { - "name": "postal_code", - "type": "`string` \\| ``null``", + "name": "price", + "type": "`number`", "description": "", "optional": true, "defaultValue": "", "children": [] }, { - "name": "province", - "type": "`string` \\| ``null``", + "name": "return_id", + "type": "`string`", "description": "", "optional": true, "defaultValue": "", "children": [] }, { - "name": "updated_at", - "type": "`string` \\| `Date`", + "name": "swap_id", + "type": "`string`", "description": "", - "optional": false, + "optional": true, "defaultValue": "", "children": [] } @@ -10851,78 +9967,79 @@ Represents a Stock Location Address ___ -### StockLocationAddressInput +### ShippingOptionData + + **ShippingOptionData**: Record<`string`, `unknown`\> - **StockLocationAddressInput**: `Object` +___ -#### Schema +### ShippingOptionPricing -Represents a Stock Location Address Input + **ShippingOptionPricing**: `Object` #### Type declaration ", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "phone", - "type": "`string`", + "name": "tax_rates", + "type": "[`TaxServiceRate`](admin_discounts.internal.mdx#taxservicerate)[] \\| ``null``", "description": "", - "optional": true, + "optional": false, "defaultValue": "", "children": [] - }, + } +]} /> + +___ + +### SocketConnectOpts + + **SocketConnectOpts**: [`TcpSocketConnectOpts`](../../internal/interfaces/admin_discounts.internal.TcpSocketConnectOpts.mdx) \| [`IpcSocketConnectOpts`](../../internal/interfaces/admin_discounts.internal.IpcSocketConnectOpts.mdx) + +___ + +### SocketReadyState + + **SocketReadyState**: ``"opening"`` \| ``"open"`` \| ``"readOnly"`` \| ``"writeOnly"`` \| ``"closed"`` + +___ + +### StagedJobServiceProps + + **StagedJobServiceProps**: `Object` + +#### Type declaration + + - -___ - ### SubtotalOptions **SubtotalOptions**: `Object` @@ -12011,33 +11101,6 @@ ___ ___ -### UpdateInventoryLevelInput - - **UpdateInventoryLevelInput**: `Object` - -#### Type declaration - - - -___ - ### UpdateOauthInput **UpdateOauthInput**: `Object` @@ -12735,49 +11798,6 @@ ___ ___ -### UpdateReservationItemInput - - **UpdateReservationItemInput**: `Object` - -#### Type declaration - - \\| ``null``", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "quantity", - "type": "`number`", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - } -]} /> - -___ - ### UpdateReturnInput **UpdateReturnInput**: `Object` @@ -13038,53 +12058,6 @@ ___ ___ -### UpdateStockLocationInput - - **UpdateStockLocationInput**: `Object` - -#### Schema - -Represents the Input to update a Stock Location - -#### Type declaration - -", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - }, - { - "name": "name", - "type": "`string`", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - } -]} /> - -___ - ### UpdateStoreInput **UpdateStoreInput**: `Object` diff --git a/www/apps/docs/content/references/js-client/auth/classes/auth.AuthResource.mdx b/www/apps/docs/content/references/js-client/auth/classes/auth.AuthResource.mdx index 3ed1a0a58b0ab..b2172b1d45327 100644 --- a/www/apps/docs/content/references/js-client/auth/classes/auth.AuthResource.mdx +++ b/www/apps/docs/content/references/js-client/auth/classes/auth.AuthResource.mdx @@ -246,7 +246,7 @@ ___ { "name": "StoreBearerAuthRes", "type": "`object`", - "description": "#### Schema StoreBearerAuthRes type: object properties: accessToken: description: Access token for subsequent authorization. type: string", + "description": "#### Schema StoreBearerAuthRes type: object properties: access_token: description: Access token that can be used to send authenticated requests. type: string", "optional": false, "defaultValue": "", "children": [] diff --git a/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx b/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx new file mode 100644 index 0000000000000..8ab9e420bb64f --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx @@ -0,0 +1,71 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Context + +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).Context + +The interface tag is used to ensure that the type is documented similar to interfaces. + +A shared context object that is used to share resources between the application and the module. + +## Type parameters + + + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.ILinkModule.mdx b/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.ILinkModule.mdx new file mode 100644 index 0000000000000..5c75d88a021cd --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.ILinkModule.mdx @@ -0,0 +1,461 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ILinkModule + +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).ILinkModule + +## Methods + +### \_\_joinerConfig + +**__joinerConfig**(): [`ModuleJoinerConfig`](../modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#modulejoinerconfig) + +#### Returns + +[`ModuleJoinerConfig`](../modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#modulejoinerconfig) + + & { `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`](../modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#modulejoinerrelationship) ; `serviceName`: `string` }[] ; `isLink?`: `boolean` ; `isReadOnlyLink?`: `boolean` ; `linkableKeys?`: Record<`string`, `string`\\> ; `primaryKeys?`: `string`[] ; `relationships?`: [`ModuleJoinerRelationship`](../modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#modulejoinerrelationship)[] ; `schema?`: `string` ; `serviceName?`: `string` }", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +___ + +### create + +**create**(`primaryKeyOrBulkData`, `foreignKeyData?`, `sharedContext?`): `Promise`<`unknown`[]\> + +#### Parameters + +?][]", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "foreignKeyData", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](admin_discounts.internal.internal-1.Context.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<`unknown`[]\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "unknown[]", + "type": "`unknown`[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "unknown", + "type": "`unknown`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### delete + +**delete**(`data`, `sharedContext?`): `Promise`<`void`\> + +#### Parameters + + + +#### Returns + +`Promise`<`void`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } +]} /> + +___ + +### dismiss + +**dismiss**(`primaryKeyOrBulkData`, `foreignKeyData?`, `sharedContext?`): `Promise`<`unknown`[]\> + +#### Parameters + + + +#### Returns + +`Promise`<`unknown`[]\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "unknown[]", + "type": "`unknown`[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "unknown", + "type": "`unknown`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### list + +**list**(`filters?`, `config?`, `sharedContext?`): `Promise`<`unknown`[]\> + +#### Parameters + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "config", + "type": "[`FindConfig`](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindConfig.mdx)<`unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](admin_discounts.internal.internal-1.Context.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<`unknown`[]\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "unknown[]", + "type": "`unknown`[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "unknown", + "type": "`unknown`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### listAndCount + +**listAndCount**(`filters?`, `config?`, `sharedContext?`): `Promise`<[`unknown`[], `number`]\> + +#### Parameters + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "config", + "type": "[`FindConfig`](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindConfig.mdx)<`unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](admin_discounts.internal.internal-1.Context.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`unknown`[], `number`]\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "unknown[]", + "type": "`unknown`[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### restore + +**restore**(`data`, `config?`, `sharedContext?`): `Promise`<`void` \| Record<`string`, `unknown`[]\>\> + +#### Parameters + + + +#### Returns + +`Promise`<`void` \| Record<`string`, `unknown`[]\>\> + +\\>", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "void \\| Record", + "type": "`void` \\| Record<`string`, `unknown`[]\\>", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### softDelete + +**softDelete**(`data`, `config?`, `sharedContext?`): `Promise`<`void` \| Record<`string`, `unknown`[]\>\> + +#### Parameters + + + +#### Returns + +`Promise`<`void` \| Record<`string`, `unknown`[]\>\> + +\\>", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "void \\| Record", + "type": "`void` \\| Record<`string`, `unknown`[]\\>", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.JoinerArgument.mdx b/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.JoinerArgument.mdx new file mode 100644 index 0000000000000..95922115dc56e --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.JoinerArgument.mdx @@ -0,0 +1,30 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# JoinerArgument + +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).JoinerArgument + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.JoinerDirective.mdx b/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.JoinerDirective.mdx new file mode 100644 index 0000000000000..8bdd4284495c0 --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.JoinerDirective.mdx @@ -0,0 +1,30 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# JoinerDirective + +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).JoinerDirective + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.JoinerServiceConfig.mdx b/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.JoinerServiceConfig.mdx similarity index 71% rename from www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.JoinerServiceConfig.mdx rename to www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.JoinerServiceConfig.mdx index d69c537456d60..d075c957929b0 100644 --- a/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.JoinerServiceConfig.mdx +++ b/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.JoinerServiceConfig.mdx @@ -6,14 +6,14 @@ import ParameterTypes from "@site/src/components/ParameterTypes" # JoinerServiceConfig -[admin/discounts](../../modules/admin_discounts.mdx).[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).JoinerServiceConfig +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).JoinerServiceConfig ## Properties diff --git a/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.RemoteExpandProperty.mdx b/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.RemoteExpandProperty.mdx new file mode 100644 index 0000000000000..9e407ccf0449a --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.RemoteExpandProperty.mdx @@ -0,0 +1,70 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# RemoteExpandProperty + +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).RemoteExpandProperty + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.RemoteJoinerQuery.mdx b/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.RemoteJoinerQuery.mdx new file mode 100644 index 0000000000000..b8859885acd9c --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.RemoteJoinerQuery.mdx @@ -0,0 +1,62 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# RemoteJoinerQuery + +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).RemoteJoinerQuery + +## Properties + + diff --git a/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.RemoteNestedExpands.mdx b/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.RemoteNestedExpands.mdx new file mode 100644 index 0000000000000..050f90bd8f9d0 --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal-1/interfaces/admin_discounts.internal.internal-1.RemoteNestedExpands.mdx @@ -0,0 +1,13 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# RemoteNestedExpands + +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).RemoteNestedExpands + +## Indexable + +▪ [key: `string`]: { `args?`: [`JoinerArgument`](admin_discounts.internal.internal-1.JoinerArgument.mdx)[] ; `expands?`: [`RemoteNestedExpands`](admin_discounts.internal.internal-1.RemoteNestedExpands.mdx) ; `fields`: `string`[] } diff --git a/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.CacheTypes.mdx b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.CacheTypes.mdx new file mode 100644 index 0000000000000..97e17220fe842 --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.CacheTypes.mdx @@ -0,0 +1,15 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CacheTypes + +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).CacheTypes + +## References + +### ICacheService + +Re-exports [ICacheService](../../internal/interfaces/admin_discounts.internal.ICacheService.mdx) diff --git a/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx new file mode 100644 index 0000000000000..b113446d728f1 --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx @@ -0,0 +1,503 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CommonTypes + +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).CommonTypes + +## Interfaces + +- [AddressCreatePayload](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.AddressCreatePayload.mdx) +- [AddressPayload](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.AddressPayload.mdx) +- [BaseEntity](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.BaseEntity.mdx) +- [CustomFindOptions](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.CustomFindOptions.mdx) +- [DateComparisonOperator](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.DateComparisonOperator.mdx) +- [EmptyQueryParams](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.EmptyQueryParams.mdx) +- [FindConfig](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindConfig.mdx) +- [FindPaginationParams](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindPaginationParams.mdx) +- [FindParams](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindParams.mdx) +- [NumericalComparisonOperator](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.NumericalComparisonOperator.mdx) +- [RepositoryTransformOptions](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.RepositoryTransformOptions.mdx) +- [SoftDeletableEntity](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.SoftDeletableEntity.mdx) +- [StringComparisonOperator](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.StringComparisonOperator.mdx) + +## References + +### ConfigModule + +Re-exports [ConfigModule](../../admin_discounts/modules/admin_discounts.internal.mdx#configmodule) + +___ + +### DeleteResponse + +Re-exports [DeleteResponse](../../admin_discounts/modules/admin_discounts.internal.mdx#deleteresponse) + +___ + +### MedusaContainer + +Re-exports [MedusaContainer](../../admin_discounts/modules/admin_discounts.internal.mdx#medusacontainer) + +___ + +### PaginatedResponse + +Re-exports [PaginatedResponse](../../admin_discounts/modules/admin_discounts.internal.mdx#paginatedresponse) + +## Type Aliases + +### ExtendedFindConfig + + **ExtendedFindConfig**<`TEntity`\>: [`Omit`](../../admin_auth/modules/admin_auth.internal.mdx#omit)<`FindOneOptions`<`TEntity`\>, ``"where"`` \| ``"relations"`` \| ``"select"``\> \| [`Omit`](../../admin_auth/modules/admin_auth.internal.mdx#omit)<`FindManyOptions`<`TEntity`\>, ``"where"`` \| ``"relations"`` \| ``"select"``\> & { `order?`: `FindOptionsOrder`<`TEntity`\> ; `relations?`: `FindOptionsRelations`<`TEntity`\> ; `select?`: `FindOptionsSelect`<`TEntity`\> ; `skip?`: `number` ; `take?`: `number` ; `where`: `FindOptionsWhere`<`TEntity`\> \| `FindOptionsWhere`<`TEntity`\>[] } + +#### Type parameters + + + +___ + +### HttpCompressionOptions + + **HttpCompressionOptions**: `Object` + +#### Type declaration + + + +___ + +### PartialPick + + **PartialPick**<`T`, `K`\>: { [P in K]?: T[P] } + +#### Type parameters + + + +___ + +### ProjectConfigOptions + + **ProjectConfigOptions**: `Object` + +#### Type declaration + + & { `ssl`: { `rejectUnauthorized`: ``false`` } }", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "database_logging", + "type": "`LoggerOptions`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "database_schema", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "database_type", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "database_url", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "http_compression", + "type": "[`HttpCompressionOptions`](admin_discounts.internal.internal-1.CommonTypes.mdx#httpcompressionoptions)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "jwt_secret", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "redis_options", + "type": "`RedisOptions`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "redis_prefix", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "redis_url", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "session_options", + "type": "[`SessionOptions`](../../admin_discounts/modules/admin_discounts.internal.mdx#sessionoptions)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "store_cors", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +___ + +### QueryConfig + + **QueryConfig**<`TEntity`\>: `Object` + +#### Type parameters + + + +#### Type declaration + + + +___ + +### QuerySelector + + **QuerySelector**<`TEntity`\>: [`Selector`](admin_discounts.internal.internal-1.CommonTypes.mdx#selector)<`TEntity`\> & { `q?`: `string` } + +#### Type parameters + + + +___ + +### RequestQueryFields + + **RequestQueryFields**: `Object` + +#### Type declaration + + + +___ + +### Selector + + **Selector**<`TEntity`\>: { [key in keyof TEntity]?: TEntity[key] \| TEntity[key][] \| DateComparisonOperator \| StringComparisonOperator \| NumericalComparisonOperator \| FindOperator } + +#### Type parameters + + + +___ + +### TotalField + + **TotalField**: ``"shipping_total"`` \| ``"discount_total"`` \| ``"tax_total"`` \| ``"refunded_total"`` \| ``"total"`` \| ``"subtotal"`` \| ``"refundable_amount"`` \| ``"gift_card_total"`` \| ``"gift_card_tax_total"`` + +___ + +### TreeQuerySelector + + **TreeQuerySelector**<`TEntity`\>: [`QuerySelector`](admin_discounts.internal.internal-1.CommonTypes.mdx#queryselector)<`TEntity`\> & { `include_descendants_tree?`: `boolean` } + +#### Type parameters + + + +___ + +### WithRequiredProperty + + **WithRequiredProperty**<`T`, `K`\>: `T` & { [Property in K]-?: T[Property] } + +Utility type used to remove some optional attributes (coming from K) from a type T + +#### Type parameters + + + +___ + +### Writable + + **Writable**<`T`\>: { -readonly [key in keyof T]: T[key] \| FindOperator \| FindOperator \| FindOperator } + +#### Type parameters + + diff --git a/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.DAL.mdx b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.DAL.mdx new file mode 100644 index 0000000000000..2f415c1b7eb9a --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.DAL.mdx @@ -0,0 +1,97 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# DAL + +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).DAL + +## Interfaces + +- [BaseFilterable](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx) +- [OptionsQuery](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.OptionsQuery.mdx) +- [RepositoryService](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.RepositoryService.mdx) +- [RestoreReturn](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.RestoreReturn.mdx) +- [SoftDeleteReturn](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.SoftDeleteReturn.mdx) +- [TreeRepositoryService](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.TreeRepositoryService.mdx) + +## Type Aliases + +### EntityDateColumns + + **EntityDateColumns**: ``"created_at"`` \| ``"updated_at"`` + +___ + +### FilterQuery + + **FilterQuery**<`T`, `Prev`\>: `Prev` extends `never` ? `never` : { [Key in keyof T]?: T[Key] extends boolean \| number \| string \| bigint \| symbol \| Date ? T[Key] \| OperatorMap : T[Key] extends infer U ? U extends Object ? V extends object ? FilterQuery, PrevLimit[Prev]\\> : never : never : never } + +#### Type parameters + + + +___ + +### FindOptions + + **FindOptions**<`T`\>: `Object` + +#### Type parameters + + + +#### Type declaration + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "where", + "type": "[`FilterQuery`](admin_discounts.internal.internal-1.DAL.mdx#filterquery)<`T`\\> & [`BaseFilterable`](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx)<[`FilterQuery`](admin_discounts.internal.internal-1.DAL.mdx#filterquery)<`T`\\>\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +___ + +### SoftDeletableEntityDateColumns + + **SoftDeletableEntityDateColumns**: ``"deleted_at"`` \| [`EntityDateColumns`](admin_discounts.internal.internal-1.DAL.mdx#entitydatecolumns) diff --git a/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.EventBusTypes.mdx b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.EventBusTypes.mdx new file mode 100644 index 0000000000000..6d88c7c98fd98 --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.EventBusTypes.mdx @@ -0,0 +1,125 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# EventBusTypes + +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).EventBusTypes + +## References + +### EmitData + +Re-exports [EmitData](../../admin_discounts/modules/admin_discounts.internal.mdx#emitdata) + +___ + +### IEventBusModuleService + +Re-exports [IEventBusModuleService](../../internal/interfaces/admin_discounts.internal.IEventBusModuleService.mdx) + +___ + +### IEventBusService + +Re-exports [IEventBusService](../../internal/interfaces/admin_discounts.internal.IEventBusService.mdx) + +___ + +### Subscriber + +Re-exports [Subscriber](../../admin_discounts/modules/admin_discounts.internal.mdx#subscriber) + +___ + +### SubscriberContext + +Re-exports [SubscriberContext](../../admin_discounts/modules/admin_discounts.internal.mdx#subscribercontext) + +## Type Aliases + +### EventHandler + + **EventHandler**<`T`\>: (`data`: `T`, `eventName`: `string`) => `Promise`<`void`\> + +#### Type parameters + + + +#### Type declaration + +(`data`, `eventName`): `Promise`<`void`\> + +##### Parameters + + + +##### Returns + +`Promise`<`void`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } +]} /> + +___ + +### SubscriberDescriptor + + **SubscriberDescriptor**: `Object` + +#### Type declaration + + diff --git a/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.FeatureFlagTypes.mdx b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.FeatureFlagTypes.mdx new file mode 100644 index 0000000000000..7728d16dad529 --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.FeatureFlagTypes.mdx @@ -0,0 +1,79 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FeatureFlagTypes + +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).FeatureFlagTypes + +## Interfaces + +- [IFlagRouter](../../FeatureFlagTypes/interfaces/admin_discounts.internal.internal-1.FeatureFlagTypes.IFlagRouter.mdx) + +## Type Aliases + +### FeatureFlagsResponse + + **FeatureFlagsResponse**: { `key`: `string` ; `value`: `boolean` \| Record<`string`, `boolean`\> }[] + +#### Schema + +FeatureFlagsResponse +type: array +items: + type: object + required: + - key + - value + properties: + key: + description: The key of the feature flag. + type: string + value: + description: The value of the feature flag. + type: boolean + +___ + +### FlagSettings + + **FlagSettings**: `Object` + +#### Type declaration + + diff --git a/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.InventoryTypes.mdx b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.InventoryTypes.mdx new file mode 100644 index 0000000000000..54815637cff0d --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.InventoryTypes.mdx @@ -0,0 +1,557 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# InventoryTypes + +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).InventoryTypes + +## References + +### IInventoryService + +Re-exports [IInventoryService](../../internal/interfaces/admin_discounts.internal.IInventoryService.mdx) + +___ + +### InventoryItemDTO + +Re-exports [InventoryItemDTO](../../admin_discounts/modules/admin_discounts.internal.mdx#inventoryitemdto) + +___ + +### InventoryLevelDTO + +Re-exports [InventoryLevelDTO](../../admin_discounts/modules/admin_discounts.internal.mdx#inventoryleveldto) + +___ + +### ReservationItemDTO + +Re-exports [ReservationItemDTO](../../admin_discounts/modules/admin_discounts.internal.mdx#reservationitemdto) + +___ + +### ReserveQuantityContext + +Re-exports [ReserveQuantityContext](../../admin_discounts/modules/admin_discounts.internal.mdx#reservequantitycontext) + +## Type Aliases + +### BulkUpdateInventoryLevelInput + + **BulkUpdateInventoryLevelInput**: { `inventory_item_id`: `string` ; `location_id`: `string` } & [`UpdateInventoryLevelInput`](admin_discounts.internal.internal-1.InventoryTypes.mdx#updateinventorylevelinput) + +___ + +### CreateInventoryItemInput + + **CreateInventoryItemInput**: `Object` + +#### Type declaration + + \\| ``null``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "mid_code", + "type": "`string` \\| ``null``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "origin_country", + "type": "`string` \\| ``null``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "requires_shipping", + "type": "`boolean`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sku", + "type": "`string` \\| ``null``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "thumbnail", + "type": "`string` \\| ``null``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string` \\| ``null``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "weight", + "type": "`number` \\| ``null``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "width", + "type": "`number` \\| ``null``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +___ + +### CreateInventoryLevelInput + + **CreateInventoryLevelInput**: `Object` + +#### Type declaration + + + +___ + +### CreateReservationItemInput + + **CreateReservationItemInput**: `Object` + +#### Type declaration + + \\| ``null``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "quantity", + "type": "`number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +___ + +### FilterableInventoryItemProps + + **FilterableInventoryItemProps**: `Object` + +#### Type declaration + + + +___ + +### FilterableInventoryLevelProps + + **FilterableInventoryLevelProps**: `Object` + +#### Type declaration + + + +___ + +### FilterableReservationItemProps + + **FilterableReservationItemProps**: `Object` + +#### Type declaration + + + +___ + +### UpdateInventoryLevelInput + + **UpdateInventoryLevelInput**: `Object` + +#### Type declaration + + + +___ + +### UpdateReservationItemInput + + **UpdateReservationItemInput**: `Object` + +#### Type declaration + + \\| ``null``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "quantity", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.LoggerTypes.mdx b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.LoggerTypes.mdx new file mode 100644 index 0000000000000..142178dd0a504 --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.LoggerTypes.mdx @@ -0,0 +1,15 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# LoggerTypes + +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).LoggerTypes + +## References + +### Logger + +Re-exports [Logger](../../internal/interfaces/admin_discounts.internal.Logger.mdx) diff --git a/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx new file mode 100644 index 0000000000000..c4e57d669c209 --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx @@ -0,0 +1,617 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ModulesSdkTypes + +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).ModulesSdkTypes + +## Enumerations + +- [MODULE\_RESOURCE\_TYPE](../../ModulesSdkTypes/enums/admin_discounts.internal.internal-1.ModulesSdkTypes.MODULE_RESOURCE_TYPE.mdx) +- [MODULE\_SCOPE](../../ModulesSdkTypes/enums/admin_discounts.internal.internal-1.ModulesSdkTypes.MODULE_SCOPE.mdx) + +## Interfaces + +- [ModuleServiceInitializeOptions](../../ModulesSdkTypes/interfaces/admin_discounts.internal.internal-1.ModulesSdkTypes.ModuleServiceInitializeOptions.mdx) + +## References + +### Constructor + +Re-exports [Constructor](../../admin_discounts/modules/admin_discounts.internal.mdx#constructor) + +___ + +### MedusaContainer + +Re-exports [MedusaContainer](../../admin_discounts/modules/admin_discounts.internal.mdx#medusacontainer) + +___ + +### RemoteQueryFunction + +Re-exports [RemoteQueryFunction](../../admin_discounts/modules/admin_discounts.internal.mdx#remotequeryfunction) + +## Type Aliases + +### ExternalModuleDeclaration + + **ExternalModuleDeclaration**: `Object` + +#### Type declaration + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "scope", + "type": "[`EXTERNAL`](../../ModulesSdkTypes/enums/admin_discounts.internal.internal-1.ModulesSdkTypes.MODULE_SCOPE.mdx#external)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "server", + "type": "`object`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "server.keepAlive", + "type": "`boolean`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "server.type", + "type": "``\"http\"``", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "server.url", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +___ + +### InternalModuleDeclaration + + **InternalModuleDeclaration**: `Object` + +#### Type declaration + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "resolve", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "resources", + "type": "[`MODULE_RESOURCE_TYPE`](../../ModulesSdkTypes/enums/admin_discounts.internal.internal-1.ModulesSdkTypes.MODULE_RESOURCE_TYPE.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "scope", + "type": "[`INTERNAL`](../../ModulesSdkTypes/enums/admin_discounts.internal.internal-1.ModulesSdkTypes.MODULE_SCOPE.mdx#internal)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +___ + +### LinkModuleDefinition + + **LinkModuleDefinition**: `Object` + +#### Type declaration + + + +___ + +### LoadedModule + + **LoadedModule**: `unknown` & { `__definition`: [`ModuleDefinition`](admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#moduledefinition) ; `__joinerConfig`: [`ModuleJoinerConfig`](admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#modulejoinerconfig) } + +___ + +### LoaderOptions + + **LoaderOptions**<`TOptions`\>: `Object` + +#### Type parameters + + + +#### Type declaration + + + +___ + +### LogLevel + + **LogLevel**: ``"query"`` \| ``"schema"`` \| ``"error"`` \| ``"warn"`` \| ``"info"`` \| ``"log"`` \| ``"migration"`` + +___ + +### LoggerOptions + + **LoggerOptions**: `boolean` \| ``"all"`` \| [`LogLevel`](admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#loglevel)[] + +___ + +### ModuleConfig + + **ModuleConfig**: [`ModuleDeclaration`](../../admin_discounts/modules/admin_discounts.internal.mdx#moduledeclaration) & { `definition`: [`ModuleDefinition`](admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#moduledefinition) ; `module`: `string` ; `path`: `string` } + +___ + +### ModuleDefinition + + **ModuleDefinition**: `Object` + +#### Type declaration + + + +___ + +### ModuleExports + + **ModuleExports**: `Object` + +#### Type declaration + +[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "service", + "type": "[`Constructor`](../../admin_discounts/modules/admin_discounts.internal.mdx#constructor)<`any`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "revertMigration", + "type": "(`options`: [`LoaderOptions`](admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#loaderoptions)\\>, `moduleDeclaration?`: [`InternalModuleDeclaration`](admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#internalmoduledeclaration)) => `Promise`<`void`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "runMigrations", + "type": "(`options`: [`LoaderOptions`](admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#loaderoptions)\\>, `moduleDeclaration?`: [`InternalModuleDeclaration`](admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#internalmoduledeclaration)) => `Promise`<`void`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +___ + +### ModuleJoinerConfig + + **ModuleJoinerConfig**: [`Omit`](../../admin_auth/modules/admin_auth.internal.mdx#omit)<[`JoinerServiceConfig`](../interfaces/admin_discounts.internal.internal-1.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`](admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#modulejoinerrelationship) ; `serviceName`: `string` }[] ; `isLink?`: `boolean` ; `isReadOnlyLink?`: `boolean` ; `linkableKeys?`: Record<`string`, `string`\> ; `primaryKeys?`: `string`[] ; `relationships?`: [`ModuleJoinerRelationship`](admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#modulejoinerrelationship)[] ; `schema?`: `string` ; `serviceName?`: `string` } + +___ + +### ModuleJoinerRelationship + + **ModuleJoinerRelationship**: [`JoinerRelationship`](../../internal/modules/admin_discounts.internal.internal-1.mdx#joinerrelationship) & { `deleteCascade?`: `boolean` ; `isInternalService?`: `boolean` } + +___ + +### ModuleLoaderFunction + + **ModuleLoaderFunction**: (`options`: [`LoaderOptions`](admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#loaderoptions), `moduleDeclaration?`: [`InternalModuleDeclaration`](admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#internalmoduledeclaration)) => `Promise`<`void`\> + +#### Type declaration + +(`options`, `moduleDeclaration?`): `Promise`<`void`\> + +##### Parameters + + + +##### Returns + +`Promise`<`void`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } +]} /> + +___ + +### ModuleResolution + + **ModuleResolution**: `Object` + +#### Type declaration + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "resolutionPath", + "type": "`string` \\| ``false``", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +___ + +### ModuleServiceInitializeCustomDataLayerOptions + + **ModuleServiceInitializeCustomDataLayerOptions**: `Object` + +#### Type declaration + + + +___ + +### ModulesResponse + + **ModulesResponse**: { `module`: `string` ; `resolution`: `string` \| ``false`` }[] diff --git a/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx new file mode 100644 index 0000000000000..d30a7a123d20d --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx @@ -0,0 +1,57 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# PricingTypes + +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).PricingTypes + +## Interfaces + +- [AddPricesDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.AddPricesDTO.mdx) +- [AddRulesDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.AddRulesDTO.mdx) +- [CalculatedPriceSetDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CalculatedPriceSetDTO.mdx) +- [CreateCurrencyDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreateCurrencyDTO.mdx) +- [CreateMoneyAmountDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreateMoneyAmountDTO.mdx) +- [CreatePriceRuleDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceRuleDTO.mdx) +- [CreatePriceSetDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetDTO.mdx) +- [CreatePriceSetMoneyAmountDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetMoneyAmountDTO.mdx) +- [CreatePriceSetMoneyAmountRulesDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetMoneyAmountRulesDTO.mdx) +- [CreatePriceSetRuleTypeDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetRuleTypeDTO.mdx) +- [CreatePricesDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePricesDTO.mdx) +- [CreateRuleTypeDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreateRuleTypeDTO.mdx) +- [CurrencyDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx) +- [FilterableCurrencyProps](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterableCurrencyProps.mdx) +- [FilterableMoneyAmountProps](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterableMoneyAmountProps.mdx) +- [FilterablePriceRuleProps](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceRuleProps.mdx) +- [FilterablePriceSetMoneyAmountProps](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetMoneyAmountProps.mdx) +- [FilterablePriceSetMoneyAmountRulesProps](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetMoneyAmountRulesProps.mdx) +- [FilterablePriceSetProps](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetProps.mdx) +- [FilterablePriceSetRuleTypeProps](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetRuleTypeProps.mdx) +- [FilterableRuleTypeProps](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterableRuleTypeProps.mdx) +- [MoneyAmountDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx) +- [PriceRuleDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceRuleDTO.mdx) +- [PriceSetDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx) +- [PriceSetMoneyAmountDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountDTO.mdx) +- [PriceSetMoneyAmountRulesDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountRulesDTO.mdx) +- [PriceSetRuleTypeDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetRuleTypeDTO.mdx) +- [PricingContext](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PricingContext.mdx) +- [PricingFilters](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PricingFilters.mdx) +- [RemovePriceSetRulesDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RemovePriceSetRulesDTO.mdx) +- [RuleTypeDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx) +- [UpdateCurrencyDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdateCurrencyDTO.mdx) +- [UpdateMoneyAmountDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdateMoneyAmountDTO.mdx) +- [UpdatePriceRuleDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceRuleDTO.mdx) +- [UpdatePriceSetDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetDTO.mdx) +- [UpdatePriceSetMoneyAmountDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetMoneyAmountDTO.mdx) +- [UpdatePriceSetMoneyAmountRulesDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetMoneyAmountRulesDTO.mdx) +- [UpdatePriceSetRuleTypeDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetRuleTypeDTO.mdx) +- [UpdateRuleTypeDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdateRuleTypeDTO.mdx) + +## References + +### IPricingModuleService + +Re-exports [IPricingModuleService](../../internal/interfaces/admin_discounts.internal.IPricingModuleService.mdx) diff --git a/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx new file mode 100644 index 0000000000000..75cd363792060 --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx @@ -0,0 +1,54 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ProductTypes + +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).ProductTypes + +## Enumerations + +- [ProductStatus](../../ProductTypes/enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx) + +## Interfaces + +- [CreateProductCategoryDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductCategoryDTO.mdx) +- [CreateProductCollectionDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductCollectionDTO.mdx) +- [CreateProductDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductDTO.mdx) +- [CreateProductOnlyDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductOnlyDTO.mdx) +- [CreateProductOptionDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductOptionDTO.mdx) +- [CreateProductOptionOnlyDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductOptionOnlyDTO.mdx) +- [CreateProductTagDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductTagDTO.mdx) +- [CreateProductTypeDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductTypeDTO.mdx) +- [CreateProductVariantDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantDTO.mdx) +- [CreateProductVariantOnlyDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantOnlyDTO.mdx) +- [CreateProductVariantOptionDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantOptionDTO.mdx) +- [FilterableProductCategoryProps](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductCategoryProps.mdx) +- [FilterableProductCollectionProps](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductCollectionProps.mdx) +- [FilterableProductOptionProps](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductOptionProps.mdx) +- [FilterableProductProps](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductProps.mdx) +- [FilterableProductTagProps](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductTagProps.mdx) +- [FilterableProductTypeProps](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductTypeProps.mdx) +- [FilterableProductVariantProps](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductVariantProps.mdx) +- [IProductModuleService](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.IProductModuleService.mdx) +- [ProductCategoryDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx) +- [ProductCollectionDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx) +- [ProductDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx) +- [ProductImageDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductImageDTO.mdx) +- [ProductOptionDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx) +- [ProductOptionValueDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductOptionValueDTO.mdx) +- [ProductTagDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx) +- [ProductTypeDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx) +- [ProductVariantDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductVariantDTO.mdx) +- [UpdateProductCategoryDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductCategoryDTO.mdx) +- [UpdateProductCollectionDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductCollectionDTO.mdx) +- [UpdateProductDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductDTO.mdx) +- [UpdateProductOptionDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductOptionDTO.mdx) +- [UpdateProductTagDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductTagDTO.mdx) +- [UpdateProductTypeDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductTypeDTO.mdx) +- [UpdateProductVariantDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductVariantDTO.mdx) +- [UpdateProductVariantOnlyDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductVariantOnlyDTO.mdx) +- [UpsertProductTagDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpsertProductTagDTO.mdx) +- [UpsertProductTypeDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpsertProductTypeDTO.mdx) diff --git a/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.SalesChannelTypes.mdx b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.SalesChannelTypes.mdx new file mode 100644 index 0000000000000..267d2c2a872f7 --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.SalesChannelTypes.mdx @@ -0,0 +1,14 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# SalesChannelTypes + +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).SalesChannelTypes + +## Interfaces + +- [SalesChannelDTO](../../SalesChannelTypes/interfaces/admin_discounts.internal.internal-1.SalesChannelTypes.SalesChannelDTO.mdx) +- [SalesChannelLocationDTO](../../SalesChannelTypes/interfaces/admin_discounts.internal.internal-1.SalesChannelTypes.SalesChannelLocationDTO.mdx) diff --git a/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.SearchTypes.mdx b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.SearchTypes.mdx new file mode 100644 index 0000000000000..4bfa2dad6ac91 --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.SearchTypes.mdx @@ -0,0 +1,48 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# SearchTypes + +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).SearchTypes + +## Interfaces + +- [ISearchService](../../SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx) + +## Type Aliases + +### IndexSettings + + **IndexSettings**: `Object` + +#### Type declaration + +", + "description": "Settings specific to the provider. E.g. `searchableAttributes`.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "primaryKey", + "type": "`string`", + "description": "Primary key for the index. Used to enforce unique documents in an index. See more in Meilisearch' https://docs.meilisearch.com/learn/core_concepts/primary_key.html.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transformer", + "type": "(`document`: `any`) => `any`", + "description": "Document transformer. Used to transform documents before they are added to the index.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.StockLocationTypes.mdx b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.StockLocationTypes.mdx new file mode 100644 index 0000000000000..a62e9166804d6 --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.StockLocationTypes.mdx @@ -0,0 +1,346 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# StockLocationTypes + +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).StockLocationTypes + +## References + +### IStockLocationService + +Re-exports [IStockLocationService](../../internal/interfaces/admin_discounts.internal.IStockLocationService.mdx) + +___ + +### StockLocationDTO + +Re-exports [StockLocationDTO](../../admin_discounts/modules/admin_discounts.internal.mdx#stocklocationdto) + +___ + +### StockLocationExpandedDTO + +Re-exports [StockLocationExpandedDTO](../../admin_discounts/modules/admin_discounts.internal.mdx#stocklocationexpandeddto) + +## Type Aliases + +### CreateStockLocationInput + + **CreateStockLocationInput**: `Object` + +#### Schema + +Represents the Input to create a Stock Location + +#### Type declaration + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +___ + +### FilterableStockLocationProps + + **FilterableStockLocationProps**: `Object` + +#### Type declaration + + + +___ + +### StockLocationAddressDTO + + **StockLocationAddressDTO**: `Object` + +#### Schema + +Represents a Stock Location Address + +#### Type declaration + + \\| ``null``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "phone", + "type": "`string` \\| ``null``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "postal_code", + "type": "`string` \\| ``null``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "province", + "type": "`string` \\| ``null``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +___ + +### StockLocationAddressInput + + **StockLocationAddressInput**: `Object` + +#### Schema + +Represents a Stock Location Address Input + +#### Type declaration + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "phone", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "postal_code", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "province", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +___ + +### UpdateStockLocationInput + + **UpdateStockLocationInput**: `Object` + +#### Schema + +Represents the Input to update a Stock Location + +#### Type declaration + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.TransactionBaseTypes.mdx b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.TransactionBaseTypes.mdx new file mode 100644 index 0000000000000..0c45d75b33e86 --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.TransactionBaseTypes.mdx @@ -0,0 +1,15 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# TransactionBaseTypes + +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).TransactionBaseTypes + +## References + +### ITransactionBaseService + +Re-exports [ITransactionBaseService](../../internal/interfaces/admin_discounts.internal.ITransactionBaseService.mdx) diff --git a/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx new file mode 100644 index 0000000000000..661e86db66401 --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx @@ -0,0 +1,16 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# WorkflowTypes + +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-1.mdx).WorkflowTypes + +## Namespaces + +- [CartWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.CartWorkflow.mdx) +- [CommonWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.CommonWorkflow.mdx) +- [InventoryWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.InventoryWorkflow.mdx) +- [ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx) diff --git a/www/apps/docs/content/references/js-client/internal-2/classes/admin_discounts.internal.internal-2.Writable.mdx b/www/apps/docs/content/references/js-client/internal-3/classes/admin_discounts.internal.internal-3.Writable.mdx similarity index 91% rename from www/apps/docs/content/references/js-client/internal-2/classes/admin_discounts.internal.internal-2.Writable.mdx rename to www/apps/docs/content/references/js-client/internal-3/classes/admin_discounts.internal.internal-3.Writable.mdx index 7f38f19a59368..b3c0e3a0f201d 100644 --- a/www/apps/docs/content/references/js-client/internal-2/classes/admin_discounts.internal.internal-2.Writable.mdx +++ b/www/apps/docs/content/references/js-client/internal-3/classes/admin_discounts.internal.internal-3.Writable.mdx @@ -6,7 +6,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" # Writable -[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-2.mdx).Writable +[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).[internal](../../internal/modules/admin_discounts.internal.internal-3.mdx).Writable #### Since @@ -363,7 +363,7 @@ ___ ### addListener -**addListener**(`event`, `listener`): [`Writable`](admin_discounts.internal.internal-2.Writable.mdx) +**addListener**(`event`, `listener`): [`Writable`](admin_discounts.internal.internal-3.Writable.mdx) Event emitter The defined events on documents including: @@ -397,12 +397,12 @@ The defined events on documents including: #### Returns -[`Writable`](admin_discounts.internal.internal-2.Writable.mdx) +[`Writable`](admin_discounts.internal.internal-3.Writable.mdx) ", + "type": "[`Pick`](../../admin_auth/modules/admin_auth.internal.mdx#pick)<[`WritableOptions`](../interfaces/admin_discounts.internal.internal-3.WritableOptions.mdx), ``\"signal\"`` \\| ``\"decodeStrings\"`` \\| ``\"highWaterMark\"`` \\| ``\"objectMode\"``\\>", "description": "", "optional": true, "defaultValue": "", @@ -3648,12 +3648,12 @@ A utility method for creating a `Writable` from a web `WritableStream`. #### Returns -[`Writable`](admin_discounts.internal.internal-2.Writable.mdx) +[`Writable`](admin_discounts.internal.internal-3.Writable.mdx) (`source`, `destination`, `options?`): [`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinepromise)<`B`\> +**__promisify__**<`A`, `B`\>(`source`, `destination`, `options?`): [`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\> ", + "type": "[`PipelineSource`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinesource)<`any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -25,7 +25,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "B", - "type": "[`WritableStream`](../../internal/interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", + "type": "[`WritableStream`](../../internal/interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -54,7 +54,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "options", - "type": "[`PipelineOptions`](../interfaces/admin_discounts.internal.internal-2.PipelineOptions.mdx)", + "type": "[`PipelineOptions`](../interfaces/admin_discounts.internal.internal-3.PipelineOptions.mdx)", "description": "", "optional": true, "defaultValue": "", @@ -64,12 +64,12 @@ import ParameterTypes from "@site/src/components/ParameterTypes" #### Returns -[`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinepromise)<`B`\> +[`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\> ", + "type": "[`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\\>", "optional": false, "defaultValue": "", "description": "", @@ -77,12 +77,12 @@ import ParameterTypes from "@site/src/components/ParameterTypes" } ]} /> -**__promisify__**<`A`, `T1`, `B`\>(`source`, `transform1`, `destination`, `options?`): [`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinepromise)<`B`\> +**__promisify__**<`A`, `T1`, `B`\>(`source`, `transform1`, `destination`, `options?`): [`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\> ", + "type": "[`PipelineSource`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinesource)<`any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -90,7 +90,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "T1", - "type": "[`PipelineTransform`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinetransform)<`A`, `any`\\>", + "type": "[`PipelineTransform`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinetransform)<`A`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -98,7 +98,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "B", - "type": "[`WritableStream`](../../internal/interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", + "type": "[`WritableStream`](../../internal/interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -135,7 +135,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "options", - "type": "[`PipelineOptions`](../interfaces/admin_discounts.internal.internal-2.PipelineOptions.mdx)", + "type": "[`PipelineOptions`](../interfaces/admin_discounts.internal.internal-3.PipelineOptions.mdx)", "description": "", "optional": true, "defaultValue": "", @@ -145,12 +145,12 @@ import ParameterTypes from "@site/src/components/ParameterTypes" #### Returns -[`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinepromise)<`B`\> +[`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\> ", + "type": "[`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\\>", "optional": false, "defaultValue": "", "description": "", @@ -158,12 +158,12 @@ import ParameterTypes from "@site/src/components/ParameterTypes" } ]} /> -**__promisify__**<`A`, `T1`, `T2`, `B`\>(`source`, `transform1`, `transform2`, `destination`, `options?`): [`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinepromise)<`B`\> +**__promisify__**<`A`, `T1`, `T2`, `B`\>(`source`, `transform1`, `transform2`, `destination`, `options?`): [`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\> ", + "type": "[`PipelineSource`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinesource)<`any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -171,7 +171,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "T1", - "type": "[`PipelineTransform`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinetransform)<`A`, `any`\\>", + "type": "[`PipelineTransform`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinetransform)<`A`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -179,7 +179,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "T2", - "type": "[`PipelineTransform`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinetransform)<`T1`, `any`\\>", + "type": "[`PipelineTransform`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinetransform)<`T1`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -187,7 +187,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "B", - "type": "[`WritableStream`](../../internal/interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", + "type": "[`WritableStream`](../../internal/interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -232,7 +232,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "options", - "type": "[`PipelineOptions`](../interfaces/admin_discounts.internal.internal-2.PipelineOptions.mdx)", + "type": "[`PipelineOptions`](../interfaces/admin_discounts.internal.internal-3.PipelineOptions.mdx)", "description": "", "optional": true, "defaultValue": "", @@ -242,12 +242,12 @@ import ParameterTypes from "@site/src/components/ParameterTypes" #### Returns -[`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinepromise)<`B`\> +[`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\> ", + "type": "[`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\\>", "optional": false, "defaultValue": "", "description": "", @@ -255,12 +255,12 @@ import ParameterTypes from "@site/src/components/ParameterTypes" } ]} /> -**__promisify__**<`A`, `T1`, `T2`, `T3`, `B`\>(`source`, `transform1`, `transform2`, `transform3`, `destination`, `options?`): [`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinepromise)<`B`\> +**__promisify__**<`A`, `T1`, `T2`, `T3`, `B`\>(`source`, `transform1`, `transform2`, `transform3`, `destination`, `options?`): [`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\> ", + "type": "[`PipelineSource`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinesource)<`any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -268,7 +268,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "T1", - "type": "[`PipelineTransform`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinetransform)<`A`, `any`\\>", + "type": "[`PipelineTransform`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinetransform)<`A`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -276,7 +276,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "T2", - "type": "[`PipelineTransform`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinetransform)<`T1`, `any`\\>", + "type": "[`PipelineTransform`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinetransform)<`T1`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -284,7 +284,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "T3", - "type": "[`PipelineTransform`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinetransform)<`T2`, `any`\\>", + "type": "[`PipelineTransform`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinetransform)<`T2`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -292,7 +292,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "B", - "type": "[`WritableStream`](../../internal/interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", + "type": "[`WritableStream`](../../internal/interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -345,7 +345,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "options", - "type": "[`PipelineOptions`](../interfaces/admin_discounts.internal.internal-2.PipelineOptions.mdx)", + "type": "[`PipelineOptions`](../interfaces/admin_discounts.internal.internal-3.PipelineOptions.mdx)", "description": "", "optional": true, "defaultValue": "", @@ -355,12 +355,12 @@ import ParameterTypes from "@site/src/components/ParameterTypes" #### Returns -[`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinepromise)<`B`\> +[`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\> ", + "type": "[`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\\>", "optional": false, "defaultValue": "", "description": "", @@ -368,12 +368,12 @@ import ParameterTypes from "@site/src/components/ParameterTypes" } ]} /> -**__promisify__**<`A`, `T1`, `T2`, `T3`, `T4`, `B`\>(`source`, `transform1`, `transform2`, `transform3`, `transform4`, `destination`, `options?`): [`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinepromise)<`B`\> +**__promisify__**<`A`, `T1`, `T2`, `T3`, `T4`, `B`\>(`source`, `transform1`, `transform2`, `transform3`, `transform4`, `destination`, `options?`): [`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\> ", + "type": "[`PipelineSource`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinesource)<`any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -381,7 +381,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "T1", - "type": "[`PipelineTransform`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinetransform)<`A`, `any`\\>", + "type": "[`PipelineTransform`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinetransform)<`A`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -389,7 +389,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "T2", - "type": "[`PipelineTransform`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinetransform)<`T1`, `any`\\>", + "type": "[`PipelineTransform`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinetransform)<`T1`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -397,7 +397,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "T3", - "type": "[`PipelineTransform`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinetransform)<`T2`, `any`\\>", + "type": "[`PipelineTransform`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinetransform)<`T2`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -405,7 +405,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "T4", - "type": "[`PipelineTransform`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinetransform)<`T3`, `any`\\>", + "type": "[`PipelineTransform`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinetransform)<`T3`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -413,7 +413,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "B", - "type": "[`WritableStream`](../../internal/interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", + "type": "[`WritableStream`](../../internal/interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -474,7 +474,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "options", - "type": "[`PipelineOptions`](../interfaces/admin_discounts.internal.internal-2.PipelineOptions.mdx)", + "type": "[`PipelineOptions`](../interfaces/admin_discounts.internal.internal-3.PipelineOptions.mdx)", "description": "", "optional": true, "defaultValue": "", @@ -484,12 +484,12 @@ import ParameterTypes from "@site/src/components/ParameterTypes" #### Returns -[`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-2.mdx#pipelinepromise)<`B`\> +[`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\> ", + "type": "[`PipelinePromise`](../../internal/modules/admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\\>", "optional": false, "defaultValue": "", "description": "", @@ -512,7 +512,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "options", - "type": "[`PipelineOptions`](../interfaces/admin_discounts.internal.internal-2.PipelineOptions.mdx)", + "type": "[`PipelineOptions`](../interfaces/admin_discounts.internal.internal-3.PipelineOptions.mdx)", "description": "", "optional": true, "defaultValue": "", @@ -558,7 +558,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "streams", - "type": "([`WritableStream`](../../internal/interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`ReadWriteStream`](../../internal/interfaces/admin_discounts.internal.ReadWriteStream.mdx) \\| [`PipelineOptions`](../interfaces/admin_discounts.internal.internal-2.PipelineOptions.mdx))[]", + "type": "([`WritableStream`](../../internal/interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`ReadWriteStream`](../../internal/interfaces/admin_discounts.internal.ReadWriteStream.mdx) \\| [`PipelineOptions`](../interfaces/admin_discounts.internal.internal-3.PipelineOptions.mdx))[]", "description": "", "optional": false, "defaultValue": "", diff --git a/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.AbstractEventBusModuleService.mdx b/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.AbstractEventBusModuleService.mdx index d2afb2f8cc073..c72e47c7c9010 100644 --- a/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.AbstractEventBusModuleService.mdx +++ b/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.AbstractEventBusModuleService.mdx @@ -17,7 +17,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" ", + "type": "`Map`<`string` \\| `symbol`, [`SubscriberDescriptor`](../../internal-1/modules/admin_discounts.internal.internal-1.EventBusTypes.mdx#subscriberdescriptor)[]\\>", "description": "", "optional": false, "defaultValue": "", @@ -29,16 +29,16 @@ import ParameterTypes from "@site/src/components/ParameterTypes" ### eventToSubscribersMap -`get` **eventToSubscribersMap**(): `Map`<`string` \| `symbol`, [`SubscriberDescriptor`](../../admin_discounts/modules/admin_discounts.internal.mdx#subscriberdescriptor)[]\> +`get` **eventToSubscribersMap**(): `Map`<`string` \| `symbol`, [`SubscriberDescriptor`](../../internal-1/modules/admin_discounts.internal.internal-1.EventBusTypes.mdx#subscriberdescriptor)[]\> #### Returns -`Map`<`string` \| `symbol`, [`SubscriberDescriptor`](../../admin_discounts/modules/admin_discounts.internal.mdx#subscriberdescriptor)[]\> +`Map`<`string` \| `symbol`, [`SubscriberDescriptor`](../../internal-1/modules/admin_discounts.internal.internal-1.EventBusTypes.mdx#subscriberdescriptor)[]\> ", + "type": "`Map`<`string` \\| `symbol`, [`SubscriberDescriptor`](../../internal-1/modules/admin_discounts.internal.internal-1.EventBusTypes.mdx#subscriberdescriptor)[]\\>", "optional": false, "defaultValue": "", "description": "", @@ -53,7 +53,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" }, { "name": "SubscriberDescriptor[]", - "type": "[`SubscriberDescriptor`](../../admin_discounts/modules/admin_discounts.internal.mdx#subscriberdescriptor)[]", + "type": "[`SubscriberDescriptor`](../../internal-1/modules/admin_discounts.internal.internal-1.EventBusTypes.mdx#subscriberdescriptor)[]", "optional": false, "defaultValue": "", "description": "", diff --git a/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.AbstractSearchService.mdx b/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.AbstractSearchService.mdx index cbffaf56435ff..54aea8fda3c73 100644 --- a/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.AbstractSearchService.mdx +++ b/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.AbstractSearchService.mdx @@ -10,7 +10,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" ## Implements -- [`ISearchService`](../interfaces/admin_discounts.internal.ISearchService.mdx) +- [`ISearchService`](../../SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx) ## Properties @@ -73,7 +73,7 @@ Record<`string`, `unknown`\> #### Implementation of -[ISearchService](../interfaces/admin_discounts.internal.ISearchService.mdx).[options](../interfaces/admin_discounts.internal.ISearchService.mdx#options) +[ISearchService](../../SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx).[options](../../SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx#options) ## Methods @@ -129,7 +129,7 @@ Used to index documents by the search engine provider #### Implementation of -[ISearchService](../interfaces/admin_discounts.internal.ISearchService.mdx).[addDocuments](../interfaces/admin_discounts.internal.ISearchService.mdx#adddocuments) +[ISearchService](../../SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx).[addDocuments](../../SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx#adddocuments) ___ @@ -177,7 +177,7 @@ Used to create an index #### Implementation of -[ISearchService](../interfaces/admin_discounts.internal.ISearchService.mdx).[createIndex](../interfaces/admin_discounts.internal.ISearchService.mdx#createindex) +[ISearchService](../../SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx).[createIndex](../../SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx#createindex) ___ @@ -217,7 +217,7 @@ Used to delete all documents #### Implementation of -[ISearchService](../interfaces/admin_discounts.internal.ISearchService.mdx).[deleteAllDocuments](../interfaces/admin_discounts.internal.ISearchService.mdx#deletealldocuments) +[ISearchService](../../SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx).[deleteAllDocuments](../../SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx#deletealldocuments) ___ @@ -265,7 +265,7 @@ Used to delete document #### Implementation of -[ISearchService](../interfaces/admin_discounts.internal.ISearchService.mdx).[deleteDocument](../interfaces/admin_discounts.internal.ISearchService.mdx#deletedocument) +[ISearchService](../../SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx).[deleteDocument](../../SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx#deletedocument) ___ @@ -305,7 +305,7 @@ Used to get an index #### Implementation of -[ISearchService](../interfaces/admin_discounts.internal.ISearchService.mdx).[getIndex](../interfaces/admin_discounts.internal.ISearchService.mdx#getindex) +[ISearchService](../../SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx).[getIndex](../../SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx#getindex) ___ @@ -361,7 +361,7 @@ Used to replace documents #### Implementation of -[ISearchService](../interfaces/admin_discounts.internal.ISearchService.mdx).[replaceDocuments](../interfaces/admin_discounts.internal.ISearchService.mdx#replacedocuments) +[ISearchService](../../SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx).[replaceDocuments](../../SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx#replacedocuments) ___ @@ -417,7 +417,7 @@ Used to search for a document in an index #### Implementation of -[ISearchService](../interfaces/admin_discounts.internal.ISearchService.mdx).[search](../interfaces/admin_discounts.internal.ISearchService.mdx#search) +[ISearchService](../../SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx).[search](../../SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx#search) ___ @@ -465,4 +465,4 @@ Used to update the settings of an index #### Implementation of -[ISearchService](../interfaces/admin_discounts.internal.ISearchService.mdx).[updateSettings](../interfaces/admin_discounts.internal.ISearchService.mdx#updatesettings) +[ISearchService](../../SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx).[updateSettings](../../SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx#updatesettings) diff --git a/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.FlagRouter.mdx b/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.FlagRouter.mdx index edeb32102dc49..78a9eb606014b 100644 --- a/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.FlagRouter.mdx +++ b/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.FlagRouter.mdx @@ -10,7 +10,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" ## Implements -- [`IFlagRouter`](../interfaces/admin_discounts.internal.IFlagRouter.mdx) +- [`IFlagRouter`](../../FeatureFlagTypes/interfaces/admin_discounts.internal.internal-1.FeatureFlagTypes.IFlagRouter.mdx) ## Properties @@ -69,17 +69,17 @@ An example of a nested flag is workflows. To use it, you would do: #### Implementation of -[IFlagRouter](../interfaces/admin_discounts.internal.IFlagRouter.mdx).[isFeatureEnabled](../interfaces/admin_discounts.internal.IFlagRouter.mdx#isfeatureenabled) +[IFlagRouter](../../FeatureFlagTypes/interfaces/admin_discounts.internal.internal-1.FeatureFlagTypes.IFlagRouter.mdx).[isFeatureEnabled](../../FeatureFlagTypes/interfaces/admin_discounts.internal.internal-1.FeatureFlagTypes.IFlagRouter.mdx#isfeatureenabled) ___ ### listFlags -**listFlags**(): [`FeatureFlagsResponse`](../../admin_discounts/modules/admin_discounts.internal.mdx#featureflagsresponse-1) +**listFlags**(): [`FeatureFlagsResponse`](../../internal-1/modules/admin_discounts.internal.internal-1.FeatureFlagTypes.mdx#featureflagsresponse) #### Returns -[`FeatureFlagsResponse`](../../admin_discounts/modules/admin_discounts.internal.mdx#featureflagsresponse-1) +[`FeatureFlagsResponse`](../../internal-1/modules/admin_discounts.internal.internal-1.FeatureFlagTypes.mdx#featureflagsresponse) ", + "type": "[`Pick`](../../admin_auth/modules/admin_auth.internal.mdx#pick)<[`ReadableOptions`](../../internal-3/interfaces/admin_discounts.internal.internal-3.ReadableOptions.mdx), ``\"signal\"`` \\| ``\"encoding\"`` \\| ``\"highWaterMark\"`` \\| ``\"objectMode\"``\\>", "description": "", "optional": true, "defaultValue": "", diff --git a/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.ReadableBase.mdx b/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.ReadableBase.mdx index 7d5d8eebd09e4..011be9dcabc08 100644 --- a/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.ReadableBase.mdx +++ b/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.ReadableBase.mdx @@ -4264,7 +4264,7 @@ A utility method for creating Readable Streams out of iterators. }, { "name": "options", - "type": "[`ReadableOptions`](../../internal-2/interfaces/admin_discounts.internal.internal-2.ReadableOptions.mdx)", + "type": "[`ReadableOptions`](../../internal-3/interfaces/admin_discounts.internal.internal-3.ReadableOptions.mdx)", "description": "", "optional": true, "defaultValue": "", diff --git a/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.Stream.mdx b/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.Stream.mdx index 518ca20ebe958..78cff5853e882 100644 --- a/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.Stream.mdx +++ b/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.Stream.mdx @@ -110,7 +110,7 @@ v0.1.26 #### Inherited from -[internal](admin_discounts.internal.internal-5.mdx).[addListener](admin_discounts.internal.internal-5.mdx#addlistener) +[internal](admin_discounts.internal.internal-6.mdx).[addListener](admin_discounts.internal.internal-6.mdx#addlistener) ___ @@ -198,7 +198,7 @@ v0.1.26 #### Inherited from -[internal](admin_discounts.internal.internal-5.mdx).[emit](admin_discounts.internal.internal-5.mdx#emit) +[internal](admin_discounts.internal.internal-6.mdx).[emit](admin_discounts.internal.internal-6.mdx#emit) ___ @@ -253,7 +253,7 @@ v6.0.0 #### Inherited from -[internal](admin_discounts.internal.internal-5.mdx).[eventNames](admin_discounts.internal.internal-5.mdx#eventnames) +[internal](admin_discounts.internal.internal-6.mdx).[eventNames](admin_discounts.internal.internal-6.mdx#eventnames) ___ @@ -285,7 +285,7 @@ v1.0.0 #### Inherited from -[internal](admin_discounts.internal.internal-5.mdx).[getMaxListeners](admin_discounts.internal.internal-5.mdx#getmaxlisteners) +[internal](admin_discounts.internal.internal-6.mdx).[getMaxListeners](admin_discounts.internal.internal-6.mdx#getmaxlisteners) ___ @@ -339,7 +339,7 @@ v3.2.0 #### Inherited from -[internal](admin_discounts.internal.internal-5.mdx).[listenerCount](admin_discounts.internal.internal-5.mdx#listenercount) +[internal](admin_discounts.internal.internal-6.mdx).[listenerCount](admin_discounts.internal.internal-6.mdx#listenercount) ___ @@ -391,7 +391,7 @@ v0.1.26 #### Inherited from -[internal](admin_discounts.internal.internal-5.mdx).[listeners](admin_discounts.internal.internal-5.mdx#listeners) +[internal](admin_discounts.internal.internal-6.mdx).[listeners](admin_discounts.internal.internal-6.mdx#listeners) ___ @@ -443,7 +443,7 @@ v10.0.0 #### Inherited from -[internal](admin_discounts.internal.internal-5.mdx).[off](admin_discounts.internal.internal-5.mdx#off) +[internal](admin_discounts.internal.internal-6.mdx).[off](admin_discounts.internal.internal-6.mdx#off) ___ @@ -520,7 +520,7 @@ v0.1.101 #### Inherited from -[internal](admin_discounts.internal.internal-5.mdx).[on](admin_discounts.internal.internal-5.mdx#on) +[internal](admin_discounts.internal.internal-6.mdx).[on](admin_discounts.internal.internal-6.mdx#on) ___ @@ -595,7 +595,7 @@ v0.3.0 #### Inherited from -[internal](admin_discounts.internal.internal-5.mdx).[once](admin_discounts.internal.internal-5.mdx#once) +[internal](admin_discounts.internal.internal-6.mdx).[once](admin_discounts.internal.internal-6.mdx#once) ___ @@ -651,7 +651,7 @@ ___ #### Inherited from -[internal](admin_discounts.internal.internal-5.mdx).[pipe](admin_discounts.internal.internal-5.mdx#pipe) +[internal](admin_discounts.internal.internal-6.mdx).[pipe](admin_discounts.internal.internal-6.mdx#pipe) ___ @@ -714,7 +714,7 @@ v6.0.0 #### Inherited from -[internal](admin_discounts.internal.internal-5.mdx).[prependListener](admin_discounts.internal.internal-5.mdx#prependlistener) +[internal](admin_discounts.internal.internal-6.mdx).[prependListener](admin_discounts.internal.internal-6.mdx#prependlistener) ___ @@ -775,7 +775,7 @@ v6.0.0 #### Inherited from -[internal](admin_discounts.internal.internal-5.mdx).[prependOnceListener](admin_discounts.internal.internal-5.mdx#prependoncelistener) +[internal](admin_discounts.internal.internal-6.mdx).[prependOnceListener](admin_discounts.internal.internal-6.mdx#prependoncelistener) ___ @@ -845,7 +845,7 @@ v9.4.0 #### Inherited from -[internal](admin_discounts.internal.internal-5.mdx).[rawListeners](admin_discounts.internal.internal-5.mdx#rawlisteners) +[internal](admin_discounts.internal.internal-6.mdx).[rawListeners](admin_discounts.internal.internal-6.mdx#rawlisteners) ___ @@ -895,7 +895,7 @@ v0.1.26 #### Inherited from -[internal](admin_discounts.internal.internal-5.mdx).[removeAllListeners](admin_discounts.internal.internal-5.mdx#removealllisteners) +[internal](admin_discounts.internal.internal-6.mdx).[removeAllListeners](admin_discounts.internal.internal-6.mdx#removealllisteners) ___ @@ -1025,7 +1025,7 @@ v0.1.26 #### Inherited from -[internal](admin_discounts.internal.internal-5.mdx).[removeListener](admin_discounts.internal.internal-5.mdx#removelistener) +[internal](admin_discounts.internal.internal-6.mdx).[removeListener](admin_discounts.internal.internal-6.mdx#removelistener) ___ @@ -1074,7 +1074,7 @@ v0.3.5 #### Inherited from -[internal](admin_discounts.internal.internal-5.mdx).[setMaxListeners](admin_discounts.internal.internal-5.mdx#setmaxlisteners) +[internal](admin_discounts.internal.internal-6.mdx).[setMaxListeners](admin_discounts.internal.internal-6.mdx#setmaxlisteners) ___ @@ -1149,7 +1149,7 @@ v15.2.0, v14.17.0 #### Inherited from -[internal](admin_discounts.internal.internal-5.mdx).[getEventListeners](admin_discounts.internal.internal-5.mdx#geteventlisteners) +[internal](admin_discounts.internal.internal-6.mdx).[getEventListeners](admin_discounts.internal.internal-6.mdx#geteventlisteners) ___ @@ -1215,7 +1215,7 @@ Since v3.2.0 - Use `listenerCount` instead. #### Inherited from -[internal](admin_discounts.internal.internal-5.mdx).[listenerCount](admin_discounts.internal.internal-5.mdx#listenercount-1) +[internal](admin_discounts.internal.internal-6.mdx).[listenerCount](admin_discounts.internal.internal-6.mdx#listenercount-1) ___ @@ -1337,7 +1337,7 @@ v13.6.0, v12.16.0 #### Inherited from -[internal](admin_discounts.internal.internal-5.mdx).[on](admin_discounts.internal.internal-5.mdx#on-1) +[internal](admin_discounts.internal.internal-6.mdx).[on](admin_discounts.internal.internal-6.mdx#on-1) ___ @@ -1490,7 +1490,7 @@ v11.13.0, v10.16.0 #### Inherited from -[internal](admin_discounts.internal.internal-5.mdx).[once](admin_discounts.internal.internal-5.mdx#once-1) +[internal](admin_discounts.internal.internal-6.mdx).[once](admin_discounts.internal.internal-6.mdx#once-1) `Static` **once**(`emitter`, `eventName`, `options?`): `Promise`<`any`[]\> @@ -1558,7 +1558,7 @@ v11.13.0, v10.16.0 #### Inherited from -[internal](admin_discounts.internal.internal-5.mdx).[once](admin_discounts.internal.internal-5.mdx#once-1) +[internal](admin_discounts.internal.internal-6.mdx).[once](admin_discounts.internal.internal-6.mdx#once-1) ___ @@ -1617,4 +1617,4 @@ v15.4.0 #### Inherited from -[internal](admin_discounts.internal.internal-5.mdx).[setMaxListeners](admin_discounts.internal.internal-5.mdx#setmaxlisteners-1) +[internal](admin_discounts.internal.internal-6.mdx).[setMaxListeners](admin_discounts.internal.internal-6.mdx#setmaxlisteners-1) diff --git a/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.internal-5.mdx b/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.internal-6.mdx similarity index 96% rename from www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.internal-5.mdx rename to www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.internal-6.mdx index 381269f70c639..fe4c60d5d0a45 100644 --- a/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.internal-5.mdx +++ b/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.internal-6.mdx @@ -64,7 +64,7 @@ v0.1.26 ### addListener -**addListener**(`eventName`, `listener`): [`internal`](admin_discounts.internal.internal-5.mdx) +**addListener**(`eventName`, `listener`): [`internal`](admin_discounts.internal.internal-6.mdx) Alias for `emitter.on(eventName, listener)`. @@ -91,12 +91,12 @@ Alias for `emitter.on(eventName, listener)`. #### Returns -[`internal`](admin_discounts.internal.internal-5.mdx) +[`internal`](admin_discounts.internal.internal-6.mdx) diff --git a/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.internal.AdminPostProductsProductReq.mdx b/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.internal.AdminPostProductsProductReq.mdx index baf255c18698a..7e6b4855d266b 100644 --- a/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.internal.AdminPostProductsProductReq.mdx +++ b/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.internal.AdminPostProductsProductReq.mdx @@ -164,7 +164,7 @@ The title of the Product`published`. "name": "status", "type": "[`ProductStatus`](../enums/admin_collections.internal.ProductStatus.mdx)", "description": "", - "optional": false, + "optional": true, "defaultValue": "", "children": [] }, diff --git a/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.internal.NewTotalsService.mdx b/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.internal.NewTotalsService.mdx index 728d671ba1917..bb634407afc32 100644 --- a/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.internal.NewTotalsService.mdx +++ b/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.internal.NewTotalsService.mdx @@ -345,6 +345,80 @@ Calculate and return the gift cards totals based on their transactions ___ +### getGiftCardableAmount + +**getGiftCardableAmount**(`«destructured»`): `number` + +#### Parameters + + + +#### Returns + +`number` + + + +___ + ### getLineItemRefund **getLineItemRefund**(`lineItem`, `«destructured»`): `number` diff --git a/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.internal.PricingService.mdx b/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.internal.PricingService.mdx index b03bd8d67dac1..80aee0cdd7c9c 100644 --- a/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.internal.PricingService.mdx +++ b/www/apps/docs/content/references/js-client/internal/classes/admin_discounts.internal.internal.PricingService.mdx @@ -45,6 +45,14 @@ Allows retrieval of prices. "defaultValue": "", "children": [] }, + { + "name": "getPricingModuleVariantMoneyAmounts", + "type": "`any`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, { "name": "getProductPricing_", "type": "`any`", @@ -53,6 +61,14 @@ Allows retrieval of prices. "defaultValue": "", "children": [] }, + { + "name": "getProductVariantPricingModulePricing_", + "type": "`any`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, { "name": "getProductVariantPricing_", "type": "`any`", @@ -77,6 +93,14 @@ Allows retrieval of prices. "defaultValue": "", "children": [] }, + { + "name": "pricingModuleService", + "type": "[`IPricingModuleService`](../interfaces/admin_discounts.internal.IPricingModuleService.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, { "name": "productVariantService", "type": "[`ProductVariantService`](admin_discounts.internal.internal.ProductVariantService.mdx)", @@ -93,6 +117,14 @@ Allows retrieval of prices. "defaultValue": "", "children": [] }, + { + "name": "remoteQuery", + "type": "[`RemoteQueryFunction`](../../admin_discounts/modules/admin_discounts.internal.mdx#remotequeryfunction)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, { "name": "taxProviderService", "type": "[`TaxProviderService`](admin_discounts.internal.internal.TaxProviderService.mdx)", @@ -662,6 +694,118 @@ Gets the prices for a shipping option. ___ +### setAdminProductPricing + +**setAdminProductPricing**(`products`): `Promise`<([`Product`](admin_collections.internal.Product.mdx) \| [`PricedProduct`](../../admin_discounts/modules/admin_discounts.internal.mdx#pricedproduct))[]\> + +#### Parameters + + + +#### Returns + +`Promise`<([`Product`](admin_collections.internal.Product.mdx) \| [`PricedProduct`](../../admin_discounts/modules/admin_discounts.internal.mdx#pricedproduct))[]\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "(Product \\| PricedProduct)[]", + "type": "([`Product`](admin_collections.internal.Product.mdx) \\| [`PricedProduct`](../../admin_discounts/modules/admin_discounts.internal.mdx#pricedproduct))[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "Product \\| PricedProduct", + "type": "[`Product`](admin_collections.internal.Product.mdx) \\| [`PricedProduct`](../../admin_discounts/modules/admin_discounts.internal.mdx#pricedproduct)", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### setAdminVariantPricing + +**setAdminVariantPricing**(`variants`, `context?`): `Promise`<[`PricedVariant`](../../admin_discounts/modules/admin_discounts.internal.mdx#pricedvariant)[]\> + +#### Parameters + + + +#### Returns + +`Promise`<[`PricedVariant`](../../admin_discounts/modules/admin_discounts.internal.mdx#pricedvariant)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "PricedVariant[]", + "type": "[`PricedVariant`](../../admin_discounts/modules/admin_discounts.internal.mdx#pricedvariant)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "PricedVariant", + "type": "[`Partial`](../../admin_discounts/modules/admin_discounts.internal.mdx#partial)<[`ProductVariant`](admin_collections.internal.ProductVariant.mdx)\\> & [`ProductVariantPricing`](../../admin_discounts/modules/admin_discounts.internal.mdx#productvariantpricing)", + "description": "#### Schema PricedVariant title: \"Priced Product Variant\" type: object allOf: - $ref: \"#/components/schemas/ProductVariant\" - type: object properties: original_price: type: number description: The original price of the variant without any discounted prices applied. calculated_price: type: number description: The calculated price of the variant. Can be a discounted price. original_price_incl_tax: type: number description: The original price of the variant including taxes. calculated_price_incl_tax: type: number description: The calculated price of the variant including taxes. original_tax: type: number description: The taxes applied on the original price. calculated_tax: type: number description: The taxes applied on the calculated price. tax_rates: type: array description: An array of applied tax rates items: type: object properties: rate: type: number description: The tax rate value name: type: string description: The name of the tax rate code: type: string description: The code of the tax rate", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + ### setProductPrices **setProductPrices**(`products`, `context?`): `Promise`<([`Product`](admin_collections.internal.Product.mdx) \| [`PricedProduct`](../../admin_discounts/modules/admin_discounts.internal.mdx#pricedproduct))[]\> diff --git a/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.BaseRepositoryService.mdx b/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.BaseRepositoryService.mdx new file mode 100644 index 0000000000000..7d6f9a5eec0b1 --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.BaseRepositoryService.mdx @@ -0,0 +1,211 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# BaseRepositoryService + +[admin/discounts](../../modules/admin_discounts.mdx).[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).BaseRepositoryService + +Data access layer (DAL) interface to implements for any repository service. +This layer helps to separate the business logic (service layer) from accessing the +ORM directly and allows to switch to another ORM without changing the business logic. + +## Type parameters + + + +## Methods + +### getActiveManager + +**getActiveManager**<`TManager`\>(): `TManager` + + + +#### Returns + +`TManager` + + + +___ + +### getFreshManager + +**getFreshManager**<`TManager`\>(): `TManager` + + + +#### Returns + +`TManager` + + + +___ + +### serialize + +**serialize**<`TOutput`\>(`data`, `options?`): `Promise`<`TOutput`\> + + + +#### Parameters + + + +#### Returns + +`Promise`<`TOutput`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } +]} /> + +___ + +### transaction + +**transaction**<`TManager`\>(`task`, `context?`): `Promise`<`any`\> + + + +#### Parameters + + `Promise`<`any`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "context", + "type": "`object`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "context.enableNestedTransactions", + "type": "`boolean`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "context.isolationLevel", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "context.transaction", + "type": "`TManager`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<`any`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "any", + "type": "`any`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.DuplexOptions.mdx b/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.DuplexOptions.mdx index 51fa88081748a..e39ad1ab69fd9 100644 --- a/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.DuplexOptions.mdx +++ b/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.DuplexOptions.mdx @@ -169,7 +169,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" #### Overrides -[WritableOptions](../../internal-2/interfaces/admin_discounts.internal.internal-2.WritableOptions.mdx).[construct](../../internal-2/interfaces/admin_discounts.internal.internal-2.WritableOptions.mdx#construct) +[WritableOptions](../../internal-3/interfaces/admin_discounts.internal.internal-3.WritableOptions.mdx).[construct](../../internal-3/interfaces/admin_discounts.internal.internal-3.WritableOptions.mdx#construct) ___ @@ -223,7 +223,7 @@ ___ #### Overrides -[WritableOptions](../../internal-2/interfaces/admin_discounts.internal.internal-2.WritableOptions.mdx).[destroy](../../internal-2/interfaces/admin_discounts.internal.internal-2.WritableOptions.mdx#destroy) +[WritableOptions](../../internal-3/interfaces/admin_discounts.internal.internal-3.WritableOptions.mdx).[destroy](../../internal-3/interfaces/admin_discounts.internal.internal-3.WritableOptions.mdx#destroy) ___ @@ -269,7 +269,7 @@ ___ #### Overrides -[WritableOptions](../../internal-2/interfaces/admin_discounts.internal.internal-2.WritableOptions.mdx).[final](../../internal-2/interfaces/admin_discounts.internal.internal-2.WritableOptions.mdx#final) +[WritableOptions](../../internal-3/interfaces/admin_discounts.internal.internal-3.WritableOptions.mdx).[final](../../internal-3/interfaces/admin_discounts.internal.internal-3.WritableOptions.mdx#final) ___ @@ -315,7 +315,7 @@ ___ #### Overrides -[ReadableOptions](../../internal-2/interfaces/admin_discounts.internal.internal-2.ReadableOptions.mdx).[read](../../internal-2/interfaces/admin_discounts.internal.internal-2.ReadableOptions.mdx#read) +[ReadableOptions](../../internal-3/interfaces/admin_discounts.internal.internal-3.ReadableOptions.mdx).[read](../../internal-3/interfaces/admin_discounts.internal.internal-3.ReadableOptions.mdx#read) ___ @@ -377,7 +377,7 @@ ___ #### Overrides -[WritableOptions](../../internal-2/interfaces/admin_discounts.internal.internal-2.WritableOptions.mdx).[write](../../internal-2/interfaces/admin_discounts.internal.internal-2.WritableOptions.mdx#write) +[WritableOptions](../../internal-3/interfaces/admin_discounts.internal.internal-3.WritableOptions.mdx).[write](../../internal-3/interfaces/admin_discounts.internal.internal-3.WritableOptions.mdx#write) ___ @@ -431,4 +431,4 @@ ___ #### Overrides -[WritableOptions](../../internal-2/interfaces/admin_discounts.internal.internal-2.WritableOptions.mdx).[writev](../../internal-2/interfaces/admin_discounts.internal.internal-2.WritableOptions.mdx#writev) +[WritableOptions](../../internal-3/interfaces/admin_discounts.internal.internal-3.WritableOptions.mdx).[writev](../../internal-3/interfaces/admin_discounts.internal.internal-3.WritableOptions.mdx#writev) diff --git a/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.IInventoryService.mdx b/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.IInventoryService.mdx index 443cd70b143b7..d544463266142 100644 --- a/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.IInventoryService.mdx +++ b/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.IInventoryService.mdx @@ -12,16 +12,16 @@ import ParameterTypes from "@site/src/components/ParameterTypes" ### \_\_joinerConfig -**__joinerConfig**(): [`ModuleJoinerConfig`](../../admin_discounts/modules/admin_discounts.internal.mdx#modulejoinerconfig) +**__joinerConfig**(): [`ModuleJoinerConfig`](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#modulejoinerconfig) #### Returns -[`ModuleJoinerConfig`](../../admin_discounts/modules/admin_discounts.internal.mdx#modulejoinerconfig) +[`ModuleJoinerConfig`](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#modulejoinerconfig) & { `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`](../../admin_discounts/modules/admin_discounts.internal.mdx#modulejoinerrelationship) ; `serviceName`: `string` }[] ; `isLink?`: `boolean` ; `isReadOnlyLink?`: `boolean` ; `linkableKeys?`: Record<`string`, `string`\\> ; `primaryKeys?`: `string`[] ; `relationships?`: [`ModuleJoinerRelationship`](../../admin_discounts/modules/admin_discounts.internal.mdx#modulejoinerrelationship)[] ; `schema?`: `string` ; `serviceName?`: `string` }", + "type": "[`Omit`](../../admin_auth/modules/admin_auth.internal.mdx#omit)<[`JoinerServiceConfig`](../../internal-1/interfaces/admin_discounts.internal.internal-1.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`](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#modulejoinerrelationship) ; `serviceName`: `string` }[] ; `isLink?`: `boolean` ; `isReadOnlyLink?`: `boolean` ; `linkableKeys?`: Record<`string`, `string`\\> ; `primaryKeys?`: `string`[] ; `relationships?`: [`ModuleJoinerRelationship`](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#modulejoinerrelationship)[] ; `schema?`: `string` ; `serviceName?`: `string` }", "description": "", "optional": false, "defaultValue": "", @@ -64,7 +64,7 @@ ___ }, { "name": "context", - "type": "[`SharedContext`](../../admin_discounts/modules/admin_discounts.internal.mdx#sharedcontext)", + "type": "[`SharedContext`](../modules/admin_discounts.internal.internal-1.mdx#sharedcontext)", "description": "", "optional": true, "defaultValue": "", @@ -131,7 +131,7 @@ ___ }, { "name": "context", - "type": "[`SharedContext`](../../admin_discounts/modules/admin_discounts.internal.mdx#sharedcontext)", + "type": "[`SharedContext`](../modules/admin_discounts.internal.internal-1.mdx#sharedcontext)", "description": "", "optional": true, "defaultValue": "", @@ -174,7 +174,7 @@ ___ ", + "type": "[`FindConfig`](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindConfig.mdx)<[`InventoryItemDTO`](../../admin_discounts/modules/admin_discounts.internal.mdx#inventoryitemdto)\\>", "description": "", "optional": true, "defaultValue": "", @@ -783,7 +783,7 @@ ___ }, { "name": "context", - "type": "[`SharedContext`](../../admin_discounts/modules/admin_discounts.internal.mdx#sharedcontext)", + "type": "[`SharedContext`](../modules/admin_discounts.internal.internal-1.mdx#sharedcontext)", "description": "", "optional": true, "defaultValue": "", @@ -834,7 +834,7 @@ ___ ", + "type": "[`FindConfig`](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindConfig.mdx)<[`InventoryLevelDTO`](../../admin_discounts/modules/admin_discounts.internal.mdx#inventoryleveldto)\\>", "description": "", "optional": true, "defaultValue": "", @@ -850,7 +850,7 @@ ___ }, { "name": "context", - "type": "[`SharedContext`](../../admin_discounts/modules/admin_discounts.internal.mdx#sharedcontext)", + "type": "[`SharedContext`](../modules/admin_discounts.internal.internal-1.mdx#sharedcontext)", "description": "", "optional": true, "defaultValue": "", @@ -901,7 +901,7 @@ ___ ", + "type": "[`FindConfig`](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindConfig.mdx)<[`ReservationItemDTO`](../../admin_discounts/modules/admin_discounts.internal.mdx#reservationitemdto)\\>", "description": "", "optional": true, "defaultValue": "", @@ -917,7 +917,7 @@ ___ }, { "name": "context", - "type": "[`SharedContext`](../../admin_discounts/modules/admin_discounts.internal.mdx#sharedcontext)", + "type": "[`SharedContext`](../modules/admin_discounts.internal.internal-1.mdx#sharedcontext)", "description": "", "optional": true, "defaultValue": "", @@ -976,7 +976,7 @@ ___ }, { "name": "context", - "type": "[`SharedContext`](../../admin_discounts/modules/admin_discounts.internal.mdx#sharedcontext)", + "type": "[`SharedContext`](../modules/admin_discounts.internal.internal-1.mdx#sharedcontext)", "description": "", "optional": true, "defaultValue": "", @@ -1026,7 +1026,7 @@ ___ }, { "name": "context", - "type": "[`SharedContext`](../../admin_discounts/modules/admin_discounts.internal.mdx#sharedcontext)", + "type": "[`SharedContext`](../modules/admin_discounts.internal.internal-1.mdx#sharedcontext)", "description": "", "optional": true, "defaultValue": "", @@ -1077,7 +1077,7 @@ ___ }, { "name": "config", - "type": "[`FindConfig`](admin_discounts.internal.FindConfig.mdx)<[`InventoryItemDTO`](../../admin_discounts/modules/admin_discounts.internal.mdx#inventoryitemdto)\\>", + "type": "[`FindConfig`](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindConfig.mdx)<[`InventoryItemDTO`](../../admin_discounts/modules/admin_discounts.internal.mdx#inventoryitemdto)\\>", "description": "", "optional": true, "defaultValue": "", @@ -1085,7 +1085,7 @@ ___ }, { "name": "context", - "type": "[`SharedContext`](../../admin_discounts/modules/admin_discounts.internal.mdx#sharedcontext)", + "type": "[`SharedContext`](../modules/admin_discounts.internal.internal-1.mdx#sharedcontext)", "description": "", "optional": true, "defaultValue": "", @@ -1144,7 +1144,7 @@ ___ }, { "name": "context", - "type": "[`SharedContext`](../../admin_discounts/modules/admin_discounts.internal.mdx#sharedcontext)", + "type": "[`SharedContext`](../modules/admin_discounts.internal.internal-1.mdx#sharedcontext)", "description": "", "optional": true, "defaultValue": "", @@ -1195,7 +1195,7 @@ ___ }, { "name": "context", - "type": "[`SharedContext`](../../admin_discounts/modules/admin_discounts.internal.mdx#sharedcontext)", + "type": "[`SharedContext`](../modules/admin_discounts.internal.internal-1.mdx#sharedcontext)", "description": "", "optional": true, "defaultValue": "", @@ -1254,7 +1254,7 @@ ___ }, { "name": "context", - "type": "[`SharedContext`](../../admin_discounts/modules/admin_discounts.internal.mdx#sharedcontext)", + "type": "[`SharedContext`](../modules/admin_discounts.internal.internal-1.mdx#sharedcontext)", "description": "", "optional": true, "defaultValue": "", @@ -1313,7 +1313,7 @@ ___ }, { "name": "context", - "type": "[`SharedContext`](../../admin_discounts/modules/admin_discounts.internal.mdx#sharedcontext)", + "type": "[`SharedContext`](../modules/admin_discounts.internal.internal-1.mdx#sharedcontext)", "description": "", "optional": true, "defaultValue": "", @@ -1364,7 +1364,7 @@ ___ }, { "name": "input", - "type": "[`CreateInventoryItemInput`](../../admin_discounts/modules/admin_discounts.internal.mdx#createinventoryiteminput)", + "type": "[`CreateInventoryItemInput`](../../internal-1/modules/admin_discounts.internal.internal-1.InventoryTypes.mdx#createinventoryiteminput)", "description": "", "optional": false, "defaultValue": "", @@ -1372,7 +1372,7 @@ ___ }, { "name": "context", - "type": "[`SharedContext`](../../admin_discounts/modules/admin_discounts.internal.mdx#sharedcontext)", + "type": "[`SharedContext`](../modules/admin_discounts.internal.internal-1.mdx#sharedcontext)", "description": "", "optional": true, "defaultValue": "", @@ -1431,7 +1431,7 @@ ___ }, { "name": "update", - "type": "[`UpdateInventoryLevelInput`](../../admin_discounts/modules/admin_discounts.internal.mdx#updateinventorylevelinput)", + "type": "[`UpdateInventoryLevelInput`](../../internal-1/modules/admin_discounts.internal.internal-1.InventoryTypes.mdx#updateinventorylevelinput)", "description": "", "optional": false, "defaultValue": "", @@ -1439,7 +1439,7 @@ ___ }, { "name": "context", - "type": "[`SharedContext`](../../admin_discounts/modules/admin_discounts.internal.mdx#sharedcontext)", + "type": "[`SharedContext`](../modules/admin_discounts.internal.internal-1.mdx#sharedcontext)", "description": "", "optional": true, "defaultValue": "", @@ -1482,7 +1482,7 @@ ___ + +This method adds prices to a price set. + +#### Example + +To add a default price to a price set, don't pass it any rules and make sure to pass it the `currency_code`: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function addPricesToPriceSet (priceSetId: string) { + const pricingService = await initializePricingModule() + + const priceSet = await pricingService.addPrices({ + priceSetId, + prices: [ + { + amount: 500, + currency_code: "USD", + rules: {}, + }, + ], + }) + + // do something with the price set or return it +} +``` + +To add prices with rules: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function addPricesToPriceSet (priceSetId: string) { + const pricingService = await initializePricingModule() + + const priceSet = await pricingService.addPrices({ + priceSetId, + prices: [ + { + amount: 300, + currency_code: "EUR", + rules: { + region_id: "PL", + city: "krakow" + }, + }, + { + amount: 400, + currency_code: "EUR", + min_quantity: 0, + max_quantity: 4, + rules: { + region_id: "PL" + }, + }, + { + amount: 450, + currency_code: "EUR", + rules: { + city: "krakow" + }, + } + ], + }) + + // do something with the price set or return it +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)\> + +", + "optional": false, + "defaultValue": "", + "description": "The price set that the prices were added to.", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the price set.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "money_amounts", + "type": "[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)[]", + "description": "The prices that belong to this price set.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_types", + "type": "[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)[]", + "description": "The rule types applied on this price set.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +**addPrices**(`data`, `sharedContext?`): `Promise`<[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)[]\> + +This method adds prices to multiple price sets. + +#### Example + +To add a default price to a price set, don't pass it any rules and make sure to pass it the `currency_code`: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function addPricesToPriceSet (priceSetId: string) { + const pricingService = await initializePricingModule() + + const priceSets = await pricingService.addPrices([{ + priceSetId, + prices: [ + { + amount: 500, + currency_code: "USD", + rules: {}, + }, + ], + }]) + + // do something with the price sets or return them +} +``` + +To add prices with rules: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function addPricesToPriceSet (priceSetId: string) { + const pricingService = await initializePricingModule() + + const priceSets = await pricingService.addPrices([{ + priceSetId, + prices: [ + { + amount: 300, + currency_code: "EUR", + rules: { + region_id: "PL", + city: "krakow" + }, + }, + { + amount: 400, + currency_code: "EUR", + min_quantity: 0, + max_quantity: 4, + rules: { + region_id: "PL" + }, + }, + { + amount: 450, + currency_code: "EUR", + rules: { + city: "krakow" + }, + } + ], + }]) + + // do something with the price sets or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of the price sets that prices were added to.", + "children": [ + { + "name": "PriceSetDTO[]", + "type": "[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the price set.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "money_amounts", + "type": "[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)[]", + "description": "The prices that belong to this price set.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_types", + "type": "[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)[]", + "description": "The rule types applied on this price set.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### addRules + +**addRules**(`data`, `sharedContext?`): `Promise`<[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)\> + +This method adds rules to a price set. + +#### Example + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function addRulesToPriceSet (priceSetId: string) { + const pricingService = await initializePricingModule() + + const priceSet = await pricingService.addRules({ + priceSetId, + rules: [{ + attribute: "region_id" + }] + }) + + // do something with the price set or return it +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)\> + +", + "optional": false, + "defaultValue": "", + "description": "The price set that the rules were added to.", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the price set.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "money_amounts", + "type": "[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)[]", + "description": "The prices that belong to this price set.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_types", + "type": "[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)[]", + "description": "The rule types applied on this price set.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +**addRules**(`data`, `sharedContext?`): `Promise`<[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)[]\> + +This method adds rules to multiple price sets. + +#### Example + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function addRulesToPriceSet (priceSetId: string) { + const pricingService = await initializePricingModule() + + const priceSets = await pricingService.addRules([{ + priceSetId, + rules: [{ + attribute: "region_id" + }] + }]) + + // do something with the price sets or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of the price sets that the rules were added to.", + "children": [ + { + "name": "PriceSetDTO[]", + "type": "[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the price set.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "money_amounts", + "type": "[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)[]", + "description": "The prices that belong to this price set.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_types", + "type": "[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)[]", + "description": "The rule types applied on this price set.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### calculatePrices + +**calculatePrices**(`filters`, `context?`, `sharedContext?`): `Promise`<[`CalculatedPriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CalculatedPriceSetDTO.mdx)\> + +This method is used to calculate prices based on the provided filters and context. + +#### Example + +When you calculate prices, you must at least specify the currency code: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" +async function calculatePrice (priceSetId: string, currencyCode: string) { + const pricingService = await initializePricingModule() + + const price = await pricingService.calculatePrices( + { id: [priceSetId] }, + { + context: { + currency_code: currencyCode + } + } + ) + + // do something with the price or return it +} +``` + +To calculate prices for specific minimum and/or maximum quantity: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" +async function calculatePrice (priceSetId: string, currencyCode: string) { + const pricingService = await initializePricingModule() + + const price = await pricingService.calculatePrices( + { id: [priceSetId] }, + { + context: { + currency_code: currencyCode, + min_quantity: 4 + } + } + ) + + // do something with the price or return it +} +``` + +To calculate prices for custom rule types: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" +async function calculatePrice (priceSetId: string, currencyCode: string) { + const pricingService = await initializePricingModule() + + const price = await pricingService.calculatePrices( + { id: [priceSetId] }, + { + context: { + currency_code: currencyCode, + region_id: "US" + } + } + ) + + // do something with the price or return it +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`CalculatedPriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CalculatedPriceSetDTO.mdx)\> + +", + "optional": false, + "defaultValue": "", + "description": "The calculated price matching the context and filters provided.", + "children": [ + { + "name": "amount", + "type": "``null`` \\| `number`", + "description": "The calculated amount. It can possibly be `null` if there's no price set up for the provided context.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "currency_code", + "type": "``null`` \\| `string`", + "description": "The currency code of the calculated price. It can possibly be `null`.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the price set.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "max_quantity", + "type": "``null`` \\| `number`", + "description": "The maximum quantity required to be purchased for this price to apply. It's set if the `quantity` property is provided in the context. Otherwise, its value will be `null`.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "min_quantity", + "type": "``null`` \\| `number`", + "description": "The minimum quantity required to be purchased for this price to apply. It's set if the `quantity` property is provided in the context. Otherwise, its value will be `null`.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +___ + +### create + +**create**(`data`, `sharedContext?`): `Promise`<[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)\> + +This method is used to create a new price set. + +#### Example + +To create a default price set, don't pass any rules. For example: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function createPriceSet () { + const pricingService = await initializePricingModule() + + const priceSet = await pricingService.create( + { + rules: [], + prices: [ + { + amount: 500, + currency_code: "USD", + min_quantity: 0, + max_quantity: 4, + rules: {}, + }, + { + amount: 400, + currency_code: "USD", + min_quantity: 5, + max_quantity: 10, + rules: {}, + }, + ], + }, + ) + + // do something with the price set or return it +} +``` + +To create a price set and associate it with rule types: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function createPriceSet () { + const pricingService = await initializePricingModule() + + const priceSet = await pricingService.create( + { + rules: [{ rule_attribute: "region_id" }, { rule_attribute: "city" }], + prices: [ + { + amount: 300, + currency_code: "EUR", + rules: { + region_id: "PL", + city: "krakow" + }, + }, + { + amount: 400, + currency_code: "EUR", + rules: { + region_id: "PL" + }, + }, + { + amount: 450, + currency_code: "EUR", + rules: { + city: "krakow" + }, + } + ], + }, + ) + + // do something with the price set or return it +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)\> + +", + "optional": false, + "defaultValue": "", + "description": "The created price set.", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the price set.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "money_amounts", + "type": "[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)[]", + "description": "The prices that belong to this price set.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_types", + "type": "[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)[]", + "description": "The rule types applied on this price set.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +**create**(`data`, `sharedContext?`): `Promise`<[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)[]\> + +This method is used to create multiple price sets. + +#### Example + +To create price sets with a default price, don't pass any rules and make sure to pass the `currency_code` of the price. For example: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function createPriceSets () { + const pricingService = await initializePricingModule() + + const priceSets = await pricingService.create([ + { + rules: [], + prices: [ + { + amount: 500, + currency_code: "USD", + rules: {}, + }, + ], + }, + ]) + + // do something with the price sets or return them +} +``` + +To create price sets and associate them with rule types: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function createPriceSets () { + const pricingService = await initializePricingModule() + + const priceSets = await pricingService.create([ + { + rules: [{ rule_attribute: "region_id" }, { rule_attribute: "city" }], + prices: [ + { + amount: 300, + currency_code: "EUR", + rules: { + region_id: "PL", + city: "krakow" + }, + }, + { + amount: 400, + currency_code: "EUR", + min_quantity: 0, + max_quantity: 4, + rules: { + region_id: "PL" + }, + }, + { + amount: 450, + currency_code: "EUR", + rules: { + city: "krakow" + }, + } + ], + }, + ]) + + // do something with the price sets or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of created price sets.", + "children": [ + { + "name": "PriceSetDTO[]", + "type": "[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the price set.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "money_amounts", + "type": "[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)[]", + "description": "The prices that belong to this price set.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_types", + "type": "[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)[]", + "description": "The rule types applied on this price set.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### createCurrencies + +**createCurrencies**(`data`, `sharedContext?`): `Promise`<[`CurrencyDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx)[]\> + +This method is used to create new currencies. + +#### Example + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function createCurrencies () { + const pricingService = await initializePricingModule() + + const currencies = await pricingService.createCurrencies([ + { + code: "USD", + symbol: "$", + symbol_native: "$", + name: "US Dollar", + } + ]) + + // do something with the currencies or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`CurrencyDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of created currencies.", + "children": [ + { + "name": "CurrencyDTO[]", + "type": "[`CurrencyDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "code", + "type": "`string`", + "description": "The code of the currency.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the currency.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "symbol", + "type": "`string`", + "description": "The symbol of the currency.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "symbol_native", + "type": "`string`", + "description": "The symbol of the currecy in its native form. This is typically the symbol used when displaying a price.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### createMoneyAmounts + +**createMoneyAmounts**(`data`, `sharedContext?`): `Promise`<[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)[]\> + +This method creates money amounts. + +#### Example + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveMoneyAmounts () { + const pricingService = await initializePricingModule() + + const moneyAmounts = await pricingService.createMoneyAmounts([ + { + amount: 500, + currency_code: "USD", + }, + { + amount: 400, + currency_code: "USD", + min_quantity: 0, + max_quantity: 4 + } + ]) + + // do something with the money amounts or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of created money amounts.", + "children": [ + { + "name": "MoneyAmountDTO[]", + "type": "[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "amount", + "type": "`number`", + "description": "The price of this money amount.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "currency", + "type": "[`CurrencyDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx)", + "description": "The money amount's currency. Since this is a relation, it will only be retrieved if it's passed to the `relations` array of the find-configuration options.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "currency_code", + "type": "`string`", + "description": "The currency code of this money amount.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the money amount.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "max_quantity", + "type": "`number`", + "description": "The maximum quantity required to be purchased for this price to be applied.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "min_quantity", + "type": "`number`", + "description": "The minimum quantity required to be purchased for this price to be applied.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### createPriceRules + +**createPriceRules**(`data`, `sharedContext?`): `Promise`<[`PriceRuleDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceRuleDTO.mdx)[]\> + +This method is used to create new price rules based on the provided data. + +#### Example + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function createPriceRules ( + id: string, + priceSetId: string, + ruleTypeId: string, + value: string, + priceSetMoneyAmountId: string, + priceListId: string +) { + const pricingService = await initializePricingModule() + + const priceRules = await pricingService.createPriceRules([ + { + id, + price_set_id: priceSetId, + rule_type_id: ruleTypeId, + value, + price_set_money_amount_id: priceSetMoneyAmountId, + price_list_id: priceListId + } + ]) + + // do something with the price rules or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`PriceRuleDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceRuleDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of created price rules.", + "children": [ + { + "name": "PriceRuleDTO[]", + "type": "[`PriceRuleDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceRuleDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the price rule.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_list_id", + "type": "`string`", + "description": "The ID of the associated price list.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set", + "type": "[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)", + "description": "The associated price set. It may only be available if the relation `price_set` is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_id", + "type": "`string`", + "description": "The ID of the associated price set.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_money_amount_id", + "type": "`string`", + "description": "The ID of the associated price set money amount.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "priority", + "type": "`number`", + "description": "The priority of the price rule in comparison to other applicable price rules.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_type", + "type": "[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)", + "description": "The associated rule type. It may only be available if the relation `rule_type` is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_type_id", + "type": "`string`", + "description": "The ID of the associated rule type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the price rule.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### createPriceSetMoneyAmountRules + +**createPriceSetMoneyAmountRules**(`data`, `sharedContext?`): `Promise`<[`PriceSetMoneyAmountRulesDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountRulesDTO.mdx)[]\> + +This method is used to create new price set money amount rules. A price set money amount rule creates an association between a price set money amount and +a rule type. + +#### Example + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function createPriceSetMoneyAmountRules (priceSetMoneyAmountId: string, ruleTypeId: string, value: string) { + const pricingService = await initializePricingModule() + + const priceSetMoneyAmountRules = await pricingService.createPriceSetMoneyAmountRules([ + { + price_set_money_amount: priceSetMoneyAmountId, + rule_type: ruleTypeId, + value + } + ]) + + // do something with the price set money amount rules or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`PriceSetMoneyAmountRulesDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountRulesDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of created price set money amount rules.", + "children": [ + { + "name": "PriceSetMoneyAmountRulesDTO[]", + "type": "[`PriceSetMoneyAmountRulesDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountRulesDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the price set money amount.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_money_amount", + "type": "[`PriceSetMoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountDTO.mdx)", + "description": "The associated price set money amount. It may only be available if the relation `price_set_money_amount` is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_type", + "type": "[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)", + "description": "The associated rule type. It may only be available if the relation `rule_type` is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the price set money amount rule.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### createRuleTypes + +**createRuleTypes**(`data`, `sharedContext?`): `Promise`<[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)[]\> + +This method is used to create new rule types. + +#### Example + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function createRuleTypes () { + const pricingService = await initializePricingModule() + + const ruleTypes = await pricingService.createRuleTypes([ + { + name: "Region", + rule_attribute: "region_id" + } + ]) + + // do something with the rule types or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of created rule types.", + "children": [ + { + "name": "RuleTypeDTO[]", + "type": "[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "default_priority", + "type": "`number`", + "description": "The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy the provided context. The higher the value, the higher the priority of the rule type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the rule type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The display name of the rule type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_attribute", + "type": "`string`", + "description": "The unique name used to later identify the rule_attribute. For example, it can be used in the `context` parameter of the `calculatePrices` method to specify a rule for calculating the price.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### delete + +**delete**(`ids`, `sharedContext?`): `Promise`<`void`\> + +This method deletes price sets by their IDs. + +#### Example + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function removePriceSetRule (priceSetIds: string[]) { + const pricingService = await initializePricingModule() + + await pricingService.delete(priceSetIds) +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<`void`\> + +", + "optional": false, + "defaultValue": "", + "description": "Resolves when the price sets are successfully deleted.", + "children": [] + } +]} /> + +___ + +### deleteCurrencies + +**deleteCurrencies**(`currencyCodes`, `sharedContext?`): `Promise`<`void`\> + +This method is used to delete currencies based on their currency code. + +#### Example + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function deleteCurrencies () { + const pricingService = await initializePricingModule() + + await pricingService.deleteCurrencies(["USD"]) + +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<`void`\> + +", + "optional": false, + "defaultValue": "", + "description": "Resolves once the currencies are deleted.", + "children": [] + } +]} /> + +___ + +### deleteMoneyAmounts + +**deleteMoneyAmounts**(`ids`, `sharedContext?`): `Promise`<`void`\> + +This method deletes money amounts by their IDs. + +#### Example + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function deleteMoneyAmounts (moneyAmountIds: string[]) { + const pricingService = await initializePricingModule() + + await pricingService.deleteMoneyAmounts( + moneyAmountIds + ) +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<`void`\> + +", + "optional": false, + "defaultValue": "", + "description": "Resolves when the money amounts are successfully deleted.", + "children": [] + } +]} /> + +___ + +### deletePriceRules + +**deletePriceRules**(`priceRuleIds`, `sharedContext?`): `Promise`<`void`\> + +This method is used to delete price rules based on the specified IDs. + +#### Example + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function deletePriceRules ( + id: string, +) { + const pricingService = await initializePricingModule() + + await pricingService.deletePriceRules([id]) +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<`void`\> + +", + "optional": false, + "defaultValue": "", + "description": "Resolves once the price rules are deleted.", + "children": [] + } +]} /> + +___ + +### deletePriceSetMoneyAmountRules + +**deletePriceSetMoneyAmountRules**(`ids`, `sharedContext?`): `Promise`<`void`\> + +This method is used to delete price set money amount rules based on the specified IDs. + +#### Example + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function deletePriceSetMoneyAmountRule (id: string) { + const pricingService = await initializePricingModule() + + await pricingService.deletePriceSetMoneyAmountRules([id]) +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<`void`\> + +", + "optional": false, + "defaultValue": "", + "description": "Resolves once the price set money amount rules are deleted.", + "children": [] + } +]} /> + +___ + +### deleteRuleTypes + +**deleteRuleTypes**(`ruleTypeIds`, `sharedContext?`): `Promise`<`void`\> + +This method is used to delete rule types based on the provided IDs. + +#### Example + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function deleteRuleTypes (ruleTypeId: string) { + const pricingService = await initializePricingModule() + + await pricingService.deleteRuleTypes([ruleTypeId]) +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<`void`\> + +", + "optional": false, + "defaultValue": "", + "description": "Resolves once the rule types are deleted.", + "children": [] + } +]} /> + +___ + +### list + +**list**(`filters?`, `config?`, `sharedContext?`): `Promise`<[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)[]\> + +This method is used to retrieve a paginated list of price sets based on optional filters and configuration. + +#### Example + +To retrieve a list of price sets using their IDs: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSets (priceSetIds: string[]) { + const pricingService = await initializePricingModule() + + const priceSets = await pricingService.list( + { + id: priceSetIds + }, + ) + + // do something with the price sets or return them +} +``` + +To specify relations that should be retrieved within the price sets: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSets (priceSetIds: string[]) { + const pricingService = await initializePricingModule() + + const priceSets = await pricingService.list( + { + id: priceSetIds + }, + { + relations: ["money_amounts"] + } + ) + + // do something with the price sets or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSets (priceSetIds: string[], skip: number, take: number) { + const pricingService = await initializePricingModule() + + const priceSets = await pricingService.list( + { + id: priceSetIds + }, + { + relations: ["money_amounts"], + skip, + take + } + ) + + // do something with the price sets or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSets (priceSetIds: string[], moneyAmountIds: string[], skip: number, take: number) { + const pricingService = await initializePricingModule() + + const priceSets = await pricingService.list( + { + $and: [ + { + id: priceSetIds + }, + { + money_amounts: { + id: moneyAmountIds + } + } + ] + }, + { + relations: ["money_amounts"], + skip, + take + } + ) + + // do something with the price sets or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the price sets are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a price set.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of price sets.", + "children": [ + { + "name": "PriceSetDTO[]", + "type": "[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the price set.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "money_amounts", + "type": "[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)[]", + "description": "The prices that belong to this price set.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_types", + "type": "[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)[]", + "description": "The rule types applied on this price set.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### listAndCount + +**listAndCount**(`filters?`, `config?`, `sharedContext?`): `Promise`<[[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)[], `number`]\> + +This method is used to retrieve a paginated list of price sets along with the total count of available price sets satisfying the provided filters. + +#### Example + +To retrieve a list of prices sets using their IDs: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSets (priceSetIds: string[]) { + const pricingService = await initializePricingModule() + + const [priceSets, count] = await pricingService.listAndCount( + { + id: priceSetIds + }, + ) + + // do something with the price sets or return them +} +``` + +To specify relations that should be retrieved within the price sets: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSets (priceSetIds: string[]) { + const pricingService = await initializePricingModule() + + const [priceSets, count] = await pricingService.listAndCount( + { + id: priceSetIds + }, + { + relations: ["money_amounts"] + } + ) + + // do something with the price sets or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSets (priceSetIds: string[], skip: number, take: number) { + const pricingService = await initializePricingModule() + + const [priceSets, count] = await pricingService.listAndCount( + { + id: priceSetIds + }, + { + relations: ["money_amounts"], + skip, + take + } + ) + + // do something with the price sets or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSets (priceSetIds: string[], moneyAmountIds: string[], skip: number, take: number) { + const pricingService = await initializePricingModule() + + const [priceSets, count] = await pricingService.listAndCount( + { + $and: [ + { + id: priceSetIds + }, + { + money_amounts: { + id: moneyAmountIds + } + } + ] + }, + { + relations: ["money_amounts"], + skip, + take + } + ) + + // do something with the price sets or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the price sets are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a price set.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)[], `number`]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of price sets along with their total count.", + "children": [ + { + "name": "PriceSetDTO[]", + "type": "[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### listAndCountCurrencies + +**listAndCountCurrencies**(`filters?`, `config?`, `sharedContext?`): `Promise`<[[`CurrencyDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx)[], `number`]\> + +This method is used to retrieve a paginated list of currencies along with the total count of available currencies satisfying the provided filters. + +#### Example + +To retrieve a list of currencies using their codes: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveCurrencies (codes: string[]) { + const pricingService = await initializePricingModule() + + const [currencies, count] = await pricingService.listAndCountCurrencies( + { + code: codes + }, + ) + + // do something with the currencies or return them +} +``` + +To specify attributes that should be retrieved within the money amounts: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveCurrencies (codes: string[]) { + const pricingService = await initializePricingModule() + + const [currencies, count] = await pricingService.listAndCountCurrencies( + { + code: codes + }, + { + select: ["symbol_native"] + } + ) + + // do something with the currencies or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveCurrencies (codes: string[], skip: number, take: number) { + const pricingService = await initializePricingModule() + + const [currencies, count] = await pricingService.listAndCountCurrencies( + { + code: codes + }, + { + select: ["symbol_native"], + skip, + take + } + ) + + // do something with the currencies or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the currencies are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a currency.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[[`CurrencyDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx)[], `number`]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of currencies along with the total count.", + "children": [ + { + "name": "CurrencyDTO[]", + "type": "[`CurrencyDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### listAndCountMoneyAmounts + +**listAndCountMoneyAmounts**(`filters?`, `config?`, `sharedContext?`): `Promise`<[[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)[], `number`]\> + +This method is used to retrieve a paginated list of money amounts along with the total count of available money amounts satisfying the provided filters. + +#### Example + +To retrieve a list of money amounts using their IDs: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveMoneyAmounts (moneyAmountIds: string[]) { + const pricingService = await initializePricingModule() + + const [moneyAmounts, count] = await pricingService.listAndCountMoneyAmounts( + { + id: moneyAmountIds + } + ) + + // do something with the money amounts or return them +} +``` + +To specify relations that should be retrieved within the money amounts: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveMoneyAmounts (moneyAmountIds: string[]) { + const pricingService = await initializePricingModule() + + const [moneyAmounts, count] = await pricingService.listAndCountMoneyAmounts( + { + id: moneyAmountIds + }, + { + relations: ["currency"] + } + ) + + // do something with the money amounts or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveMoneyAmounts (moneyAmountIds: string[], skip: number, take: number) { + const pricingService = await initializePricingModule() + + const [moneyAmounts, count] = await pricingService.listAndCountMoneyAmounts( + { + id: moneyAmountIds + }, + { + relations: ["currency"], + skip, + take + } + ) + + // do something with the money amounts or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveMoneyAmounts (moneyAmountIds: string[], currencyCode: string[], skip: number, take: number) { + const pricingService = await initializePricingModule() + + const [moneyAmounts, count] = await pricingService.listAndCountMoneyAmounts( + { + $and: [ + { + id: moneyAmountIds + }, + { + currency_code: currencyCode + } + ] + }, + { + relations: ["currency"], + skip, + take + } + ) + + // do something with the money amounts or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the money amounts are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a money amount.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)[], `number`]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of money amounts along with their total count.", + "children": [ + { + "name": "MoneyAmountDTO[]", + "type": "[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### listAndCountPriceRules + +**listAndCountPriceRules**(`filters?`, `config?`, `sharedContext?`): `Promise`<[[`PriceRuleDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceRuleDTO.mdx)[], `number`]\> + +This method is used to retrieve a paginated list of price rules along with the total count of available price rules satisfying the provided filters. + +#### Example + +To retrieve a list of price rules using their IDs: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceRules (id: string) { + const pricingService = await initializePricingModule() + + const [priceRules, count] = await pricingService.listAndCountPriceRules({ + id: [id] + }) + + // do something with the price rules or return them +} +``` + +To specify relations that should be retrieved within the price rules: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceRules (id: string) { + const pricingService = await initializePricingModule() + + const [priceRules, count] = await pricingService.listAndCountPriceRules({ + id: [id], + }, { + relations: ["price_set"] + }) + + // do something with the price rules or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceRules (id: string, skip: number, take: number) { + const pricingService = await initializePricingModule() + + const [priceRules, count] = await pricingService.listAndCountPriceRules({ + id: [id], + }, { + relations: ["price_set"], + skip, + take + }) + + // do something with the price rules or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceRules (ids: string[], name: string[], skip: number, take: number) { + const pricingService = await initializePricingModule() + + const [priceRules, count] = await pricingService.listAndCountPriceRules({ + $and: [ + { + id: ids + }, + { + name + } + ] + }, { + relations: ["price_set"], + skip, + take + }) + + // do something with the price rules or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the price rule is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a price rule.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[[`PriceRuleDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceRuleDTO.mdx)[], `number`]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of price rules along with their total count.", + "children": [ + { + "name": "PriceRuleDTO[]", + "type": "[`PriceRuleDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceRuleDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### listAndCountPriceSetMoneyAmountRules + +**listAndCountPriceSetMoneyAmountRules**(`filters?`, `config?`, `sharedContext?`): `Promise`<[[`PriceSetMoneyAmountRulesDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountRulesDTO.mdx)[], `number`]\> + +This method is used to retrieve a paginated list of price set money amount rules along with the total count of +available price set money amount rules satisfying the provided filters. + +#### Example + +To retrieve a list of price set money amounts using their IDs: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSetMoneyAmountRules (id: string) { + const pricingService = await initializePricingModule() + + const [priceSetMoneyAmountRules, count] = await pricingService.listAndCountPriceSetMoneyAmountRules({ + id: [id] + }) + + // do something with the price set money amount rules or return them +} +``` + +To specify relations that should be retrieved within the price set money amount rules: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSetMoneyAmountRules (id: string) { + const pricingService = await initializePricingModule() + + const [priceSetMoneyAmountRules, count] = await pricingService.listAndCountPriceSetMoneyAmountRules({ + id: [id] + }, { + relations: ["price_set_money_amount"], + }) + + // do something with the price set money amount rules or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSetMoneyAmountRules (id: string, skip: number, take: number) { + const pricingService = await initializePricingModule() + + const [priceSetMoneyAmountRules, count] = await pricingService.listAndCountPriceSetMoneyAmountRules({ + id: [id] + }, { + relations: ["price_set_money_amount"], + skip, + take + }) + + // do something with the price set money amount rules or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSetMoneyAmountRules (ids: string[], ruleTypeId: string[], skip: number, take: number) { + const pricingService = await initializePricingModule() + + const [priceSetMoneyAmountRules, count] = await pricingService.listAndCountPriceSetMoneyAmountRules({ + $and: [ + { + id: ids + }, + { + rule_type_id: ruleTypeId + } + ] + }, { + relations: ["price_set_money_amount"], + skip, + take + }) + + // do something with the price set money amount rules or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the price set money amount rules are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a price set money amount rule.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[[`PriceSetMoneyAmountRulesDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountRulesDTO.mdx)[], `number`]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of price set money amount rules and their total count.", + "children": [ + { + "name": "PriceSetMoneyAmountRulesDTO[]", + "type": "[`PriceSetMoneyAmountRulesDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountRulesDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### listAndCountPriceSetMoneyAmounts + +**listAndCountPriceSetMoneyAmounts**(`filters?`, `config?`, `sharedContext?`): `Promise`<[[`PriceSetMoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountDTO.mdx)[], `number`]\> + +#### Parameters + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[[`PriceSetMoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountDTO.mdx)[], `number`]\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "PriceSetMoneyAmountDTO[]", + "type": "[`PriceSetMoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### listAndCountRuleTypes + +**listAndCountRuleTypes**(`filters?`, `config?`, `sharedContext?`): `Promise`<[[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)[], `number`]\> + +This method is used to retrieve a paginated list of rule types along with the total count of available rule types satisfying the provided filters. + +#### Example + +To retrieve a list of rule types using their IDs: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveRuleTypes (ruleTypeId: string) { + const pricingService = await initializePricingModule() + + const [ruleTypes, count] = await pricingService.listAndCountRuleTypes({ + id: [ + ruleTypeId + ] + }) + + // do something with the rule types or return them +} +``` + +To specify attributes that should be retrieved within the rule types: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveRuleTypes (ruleTypeId: string) { + const pricingService = await initializePricingModule() + + const [ruleTypes, count] = await pricingService.listAndCountRuleTypes({ + id: [ + ruleTypeId + ] + }, { + select: ["name"] + }) + + // do something with the rule types or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveRuleTypes (ruleTypeId: string, skip: number, take: number) { + const pricingService = await initializePricingModule() + + const [ruleTypes, count] = await pricingService.listAndCountRuleTypes({ + id: [ + ruleTypeId + ] + }, { + select: ["name"], + skip, + take + }) + + // do something with the rule types or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveRuleTypes (ruleTypeId: string[], name: string[], skip: number, take: number) { + const pricingService = await initializePricingModule() + + const [ruleTypes, count] = await pricingService.listAndCountRuleTypes({ + $and: [ + { + id: ruleTypeId + }, + { + name + } + ] + }, { + select: ["name"], + skip, + take + }) + + // do something with the rule types or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the rule types are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a rule type.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)[], `number`]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of rule types along with their total count.", + "children": [ + { + "name": "RuleTypeDTO[]", + "type": "[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### listCurrencies + +**listCurrencies**(`filters?`, `config?`, `sharedContext?`): `Promise`<[`CurrencyDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx)[]\> + +This method is used to retrieve a paginated list of currencies based on optional filters and configuration. + +#### Example + +To retrieve a list of currencies using their codes: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveCurrencies (codes: string[]) { + const pricingService = await initializePricingModule() + + const currencies = await pricingService.listCurrencies( + { + code: codes + }, + ) + + // do something with the currencies or return them +} +``` + +To specify attributes that should be retrieved within the money amounts: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveCurrencies (codes: string[]) { + const pricingService = await initializePricingModule() + + const currencies = await pricingService.listCurrencies( + { + code: codes + }, + { + select: ["symbol_native"] + } + ) + + // do something with the currencies or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveCurrencies (codes: string[], skip: number, take: number) { + const pricingService = await initializePricingModule() + + const currencies = await pricingService.listCurrencies( + { + code: codes + }, + { + select: ["symbol_native"], + skip, + take + } + ) + + // do something with the currencies or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the currencies are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a currency.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`CurrencyDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of currencies.", + "children": [ + { + "name": "CurrencyDTO[]", + "type": "[`CurrencyDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "code", + "type": "`string`", + "description": "The code of the currency.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the currency.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "symbol", + "type": "`string`", + "description": "The symbol of the currency.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "symbol_native", + "type": "`string`", + "description": "The symbol of the currecy in its native form. This is typically the symbol used when displaying a price.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### listMoneyAmounts + +**listMoneyAmounts**(`filters?`, `config?`, `sharedContext?`): `Promise`<[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)[]\> + +This method is used to retrieve a paginated list of money amounts based on optional filters and configuration. + +#### Example + +To retrieve a list of money amounts using their IDs: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveMoneyAmounts (moneyAmountIds: string[]) { + const pricingService = await initializePricingModule() + + const moneyAmounts = await pricingService.listMoneyAmounts( + { + id: moneyAmountIds + } + ) + + // do something with the money amounts or return them +} +``` + +To specify relations that should be retrieved within the money amounts: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveMoneyAmounts (moneyAmountIds: string[]) { + const pricingService = await initializePricingModule() + + const moneyAmounts = await pricingService.listMoneyAmounts( + { + id: moneyAmountIds + }, + { + relations: ["currency"] + } + ) + + // do something with the money amounts or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveMoneyAmounts (moneyAmountIds: string[], skip: number, take: number) { + const pricingService = await initializePricingModule() + + const moneyAmounts = await pricingService.listMoneyAmounts( + { + id: moneyAmountIds + }, + { + relations: ["currency"], + skip, + take + } + ) + + // do something with the money amounts or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveMoneyAmounts (moneyAmountIds: string[], currencyCode: string[], skip: number, take: number) { + const pricingService = await initializePricingModule() + + const moneyAmounts = await pricingService.listMoneyAmounts( + { + $and: [ + { + id: moneyAmountIds + }, + { + currency_code: currencyCode + } + ] + }, + { + relations: ["currency"], + skip, + take + } + ) + + // do something with the money amounts or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the money amounts are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a money amount.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of money amounts.", + "children": [ + { + "name": "MoneyAmountDTO[]", + "type": "[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "amount", + "type": "`number`", + "description": "The price of this money amount.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "currency", + "type": "[`CurrencyDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx)", + "description": "The money amount's currency. Since this is a relation, it will only be retrieved if it's passed to the `relations` array of the find-configuration options.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "currency_code", + "type": "`string`", + "description": "The currency code of this money amount.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the money amount.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "max_quantity", + "type": "`number`", + "description": "The maximum quantity required to be purchased for this price to be applied.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "min_quantity", + "type": "`number`", + "description": "The minimum quantity required to be purchased for this price to be applied.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### listPriceRules + +**listPriceRules**(`filters?`, `config?`, `sharedContext?`): `Promise`<[`PriceRuleDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceRuleDTO.mdx)[]\> + +This method is used to retrieve a paginated list of price rules based on optional filters and configuration. + +#### Example + +To retrieve a list of price rules using their IDs: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceRules (id: string) { + const pricingService = await initializePricingModule() + + const priceRules = await pricingService.listPriceRules({ + id: [id] + }) + + // do something with the price rules or return them +} +``` + +To specify relations that should be retrieved within the price rules: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceRules (id: string) { + const pricingService = await initializePricingModule() + + const priceRules = await pricingService.listPriceRules({ + id: [id], + }, { + relations: ["price_set"] + }) + + // do something with the price rules or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceRules (id: string, skip: number, take: number) { + const pricingService = await initializePricingModule() + + const priceRules = await pricingService.listPriceRules({ + id: [id], + }, { + relations: ["price_set"], + skip, + take + }) + + // do something with the price rules or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceRules (ids: string[], name: string[], skip: number, take: number) { + const pricingService = await initializePricingModule() + + const priceRules = await pricingService.listPriceRules({ + $and: [ + { + id: ids + }, + { + name + } + ] + }, { + relations: ["price_set"], + skip, + take + }) + + // do something with the price rules or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the price rule is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a price rule.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`PriceRuleDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceRuleDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of price rules.", + "children": [ + { + "name": "PriceRuleDTO[]", + "type": "[`PriceRuleDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceRuleDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the price rule.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_list_id", + "type": "`string`", + "description": "The ID of the associated price list.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set", + "type": "[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)", + "description": "The associated price set. It may only be available if the relation `price_set` is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_id", + "type": "`string`", + "description": "The ID of the associated price set.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_money_amount_id", + "type": "`string`", + "description": "The ID of the associated price set money amount.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "priority", + "type": "`number`", + "description": "The priority of the price rule in comparison to other applicable price rules.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_type", + "type": "[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)", + "description": "The associated rule type. It may only be available if the relation `rule_type` is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_type_id", + "type": "`string`", + "description": "The ID of the associated rule type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the price rule.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### listPriceSetMoneyAmountRules + +**listPriceSetMoneyAmountRules**(`filters?`, `config?`, `sharedContext?`): `Promise`<[`PriceSetMoneyAmountRulesDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountRulesDTO.mdx)[]\> + +This method is used to retrieve a paginated list of price set money amount rules based on optional filters and configuration. + +#### Example + +To retrieve a list of price set money amount rules using their IDs: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSetMoneyAmountRules (id: string) { + const pricingService = await initializePricingModule() + + const priceSetMoneyAmountRules = await pricingService.listPriceSetMoneyAmountRules({ + id: [id] + }) + + // do something with the price set money amount rules or return them +} +``` + +To specify relations that should be retrieved within the price set money amount rules: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSetMoneyAmountRules (id: string) { + const pricingService = await initializePricingModule() + + const priceSetMoneyAmountRules = await pricingService.listPriceSetMoneyAmountRules({ + id: [id] + }, { + relations: ["price_set_money_amount"] + }) + + // do something with the price set money amount rules or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSetMoneyAmountRules (id: string, skip: number, take: number) { + const pricingService = await initializePricingModule() + + const priceSetMoneyAmountRules = await pricingService.listPriceSetMoneyAmountRules({ + id: [id] + }, { + relations: ["price_set_money_amount"], + skip, + take + }) + + // do something with the price set money amount rules or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSetMoneyAmountRules (ids: string[], ruleTypeId: string[], skip: number, take: number) { + const pricingService = await initializePricingModule() + + const priceSetMoneyAmountRules = await pricingService.listPriceSetMoneyAmountRules({ + $and: [ + { + id: ids + }, + { + rule_type_id: ruleTypeId + } + ] + }, { + relations: ["price_set_money_amount"], + skip, + take + }) + + // do something with the price set money amount rules or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the price set money amount rules are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a price set money amount rule.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`PriceSetMoneyAmountRulesDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountRulesDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of price set money amount rules.", + "children": [ + { + "name": "PriceSetMoneyAmountRulesDTO[]", + "type": "[`PriceSetMoneyAmountRulesDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountRulesDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the price set money amount.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_money_amount", + "type": "[`PriceSetMoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountDTO.mdx)", + "description": "The associated price set money amount. It may only be available if the relation `price_set_money_amount` is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_type", + "type": "[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)", + "description": "The associated rule type. It may only be available if the relation `rule_type` is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the price set money amount rule.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### listPriceSetMoneyAmounts + +**listPriceSetMoneyAmounts**(`filters?`, `config?`, `sharedContext?`): `Promise`<[`PriceSetMoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountDTO.mdx)[]\> + +#### Parameters + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`PriceSetMoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "PriceSetMoneyAmountDTO[]", + "type": "[`PriceSetMoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of a price set money amount.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "money_amount", + "type": "[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)", + "description": "The money amount associated with the price set money amount. It may only be available if the relation `money_amount` is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "price_rules", + "type": "[`PriceRuleDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceRuleDTO.mdx)[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set", + "type": "[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)", + "description": "The price set associated with the price set money amount. It may only be available if the relation `price_set` is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_id", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the price set money amount.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### listRuleTypes + +**listRuleTypes**(`filters?`, `config?`, `sharedContext?`): `Promise`<[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)[]\> + +This method is used to retrieve a paginated list of rule types based on optional filters and configuration. + +#### Example + +To retrieve a list of rule types using their IDs: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveRuleTypes (ruleTypeId: string) { + const pricingService = await initializePricingModule() + + const ruleTypes = await pricingService.listRuleTypes({ + id: [ + ruleTypeId + ] + }) + + // do something with the rule types or return them +} +``` + +To specify attributes that should be retrieved within the rule types: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveRuleTypes (ruleTypeId: string) { + const pricingService = await initializePricingModule() + + const ruleTypes = await pricingService.listRuleTypes({ + id: [ + ruleTypeId + ] + }, { + select: ["name"] + }) + + // do something with the rule types or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveRuleTypes (ruleTypeId: string, skip: number, take: number) { + const pricingService = await initializePricingModule() + + const ruleTypes = await pricingService.listRuleTypes({ + id: [ + ruleTypeId + ] + }, { + select: ["name"], + skip, + take + }) + + // do something with the rule types or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveRuleTypes (ruleTypeId: string[], name: string[], skip: number, take: number) { + const pricingService = await initializePricingModule() + + const ruleTypes = await pricingService.listRuleTypes({ + $and: [ + { + id: ruleTypeId + }, + { + name + } + ] + }, { + select: ["name"], + skip, + take + }) + + // do something with the rule types or return them +} +``` + +#### Parameters + +", + "description": "The configurations determining how the rule types are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a rule type.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of rule types.", + "children": [ + { + "name": "RuleTypeDTO[]", + "type": "[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "default_priority", + "type": "`number`", + "description": "The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy the provided context. The higher the value, the higher the priority of the rule type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the rule type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The display name of the rule type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_attribute", + "type": "`string`", + "description": "The unique name used to later identify the rule_attribute. For example, it can be used in the `context` parameter of the `calculatePrices` method to specify a rule for calculating the price.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### removeRules + +**removeRules**(`data`, `sharedContext?`): `Promise`<`void`\> + +This method remove rules from a price set. + +#### Example + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function removePriceSetRule (priceSetId: string, ruleAttributes: []) { + const pricingService = await initializePricingModule() + + await pricingService.removeRules([ + { + id: priceSetId, + rules: ruleAttributes + }, + ]) +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<`void`\> + +", + "optional": false, + "defaultValue": "", + "description": "Resolves when rules are successfully removed.", + "children": [] + } +]} /> + +___ + +### retrieve + +**retrieve**(`id`, `config?`, `sharedContext?`): `Promise`<[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)\> + +This method is used to retrieves a price set by its ID. + +#### Example + +A simple example that retrieves a price set by its ID: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSet (priceSetId: string) { + const pricingService = await initializePricingModule() + + const priceSet = await pricingService.retrieve( + priceSetId + ) + + // do something with the price set or return it +} +``` + +To specify relations that should be retrieved: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSet (priceSetId: string) { + const pricingService = await initializePricingModule() + + const priceSet = await pricingService.retrieve( + priceSetId, + { + relations: ["money_amounts"] + } + ) + + // do something with the price set or return it +} +``` + +#### Parameters + +", + "description": "The configurations determining how the price set is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a price set.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)\> + +", + "optional": false, + "defaultValue": "", + "description": "The retrieved price set.", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the price set.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "money_amounts", + "type": "[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)[]", + "description": "The prices that belong to this price set.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_types", + "type": "[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)[]", + "description": "The rule types applied on this price set.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +___ + +### retrieveCurrency + +**retrieveCurrency**(`code`, `config?`, `sharedContext?`): `Promise`<[`CurrencyDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx)\> + +This method retrieves a currency by its code and and optionally based on the provided configurations. + +#### Example + +A simple example that retrieves a currency by its code: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveCurrency (code: string) { + const pricingService = await initializePricingModule() + + const currency = await pricingService.retrieveCurrency( + code + ) + + // do something with the currency or return it +} +``` + +To specify attributes that should be retrieved: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveCurrency (code: string) { + const pricingService = await initializePricingModule() + + const currency = await pricingService.retrieveCurrency( + code, + { + select: ["symbol_native"] + } + ) + + // do something with the currency or return it +} +``` + +#### Parameters + +", + "description": "The configurations determining how the currency is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a currency.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`CurrencyDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx)\> + +", + "optional": false, + "defaultValue": "", + "description": "The retrieved currency.", + "children": [ + { + "name": "code", + "type": "`string`", + "description": "The code of the currency.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the currency.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "symbol", + "type": "`string`", + "description": "The symbol of the currency.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "symbol_native", + "type": "`string`", + "description": "The symbol of the currecy in its native form. This is typically the symbol used when displaying a price.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +___ + +### retrieveMoneyAmount + +**retrieveMoneyAmount**(`id`, `config?`, `sharedContext?`): `Promise`<[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)\> + +This method retrieves a money amount by its ID. + +#### Example + +To retrieve a money amount by its ID: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveMoneyAmount (moneyAmountId: string) { + const pricingService = await initializePricingModule() + + const moneyAmount = await pricingService.retrieveMoneyAmount( + moneyAmountId, + ) + + // do something with the money amount or return it +} +``` + +To retrieve relations along with the money amount: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveMoneyAmount (moneyAmountId: string) { + const pricingService = await initializePricingModule() + + const moneyAmount = await pricingService.retrieveMoneyAmount( + moneyAmountId, + { + relations: ["currency"] + } + ) + + // do something with the money amount or return it +} +``` + +#### Parameters + +", + "description": "The configurations determining how a money amount is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a money amount.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)\> + +", + "optional": false, + "defaultValue": "", + "description": "The retrieved money amount.", + "children": [ + { + "name": "amount", + "type": "`number`", + "description": "The price of this money amount.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "currency", + "type": "[`CurrencyDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx)", + "description": "The money amount's currency. Since this is a relation, it will only be retrieved if it's passed to the `relations` array of the find-configuration options.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "currency_code", + "type": "`string`", + "description": "The currency code of this money amount.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the money amount.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "max_quantity", + "type": "`number`", + "description": "The maximum quantity required to be purchased for this price to be applied.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "min_quantity", + "type": "`number`", + "description": "The minimum quantity required to be purchased for this price to be applied.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +___ + +### retrievePriceRule + +**retrievePriceRule**(`id`, `config?`, `sharedContext?`): `Promise`<[`PriceRuleDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceRuleDTO.mdx)\> + +This method is used to retrieve a price rule by its ID. + +#### Example + +A simple example that retrieves a price rule by its ID: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceRule (id: string) { + const pricingService = await initializePricingModule() + + const priceRule = await pricingService.retrievePriceRule(id) + + // do something with the price rule or return it +} +``` + +To specify relations that should be retrieved: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceRule (id: string) { + const pricingService = await initializePricingModule() + + const priceRule = await pricingService.retrievePriceRule(id, { + relations: ["price_set"] + }) + + // do something with the price rule or return it +} +``` + +#### Parameters + +", + "description": "The configurations determining how the price rule is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a price rule.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`PriceRuleDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceRuleDTO.mdx)\> + +", + "optional": false, + "defaultValue": "", + "description": "The retrieved price rule.", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the price rule.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_list_id", + "type": "`string`", + "description": "The ID of the associated price list.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set", + "type": "[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)", + "description": "The associated price set. It may only be available if the relation `price_set` is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_id", + "type": "`string`", + "description": "The ID of the associated price set.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_money_amount_id", + "type": "`string`", + "description": "The ID of the associated price set money amount.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "priority", + "type": "`number`", + "description": "The priority of the price rule in comparison to other applicable price rules.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_type", + "type": "[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)", + "description": "The associated rule type. It may only be available if the relation `rule_type` is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_type_id", + "type": "`string`", + "description": "The ID of the associated rule type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the price rule.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +___ + +### retrievePriceSetMoneyAmountRules + +**retrievePriceSetMoneyAmountRules**(`id`, `config?`, `sharedContext?`): `Promise`<[`PriceSetMoneyAmountRulesDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountRulesDTO.mdx)\> + +This method is used to a price set money amount rule by its ID based on the provided configuration. + +#### Example + +A simple example that retrieves a price set money amount rule by its ID: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSetMoneyAmountRule (id: string) { + const pricingService = await initializePricingModule() + + const priceSetMoneyAmountRule = await pricingService.retrievePriceSetMoneyAmountRules(id) + + // do something with the price set money amount rule or return it +} +``` + +To specify relations that should be retrieved: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSetMoneyAmountRule (id: string) { + const pricingService = await initializePricingModule() + + const priceSetMoneyAmountRule = await pricingService.retrievePriceSetMoneyAmountRules(id, { + relations: ["price_set_money_amount"] + }) + + // do something with the price set money amount rule or return it +} +``` + +#### Parameters + +", + "description": "The configurations determining how the price set money amount rule is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a price set money amount rule.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`PriceSetMoneyAmountRulesDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountRulesDTO.mdx)\> + +", + "optional": false, + "defaultValue": "", + "description": "The retrieved price set money amount rule.", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the price set money amount.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_money_amount", + "type": "[`PriceSetMoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountDTO.mdx)", + "description": "The associated price set money amount. It may only be available if the relation `price_set_money_amount` is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_type", + "type": "[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)", + "description": "The associated rule type. It may only be available if the relation `rule_type` is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the price set money amount rule.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +___ + +### retrieveRuleType + +**retrieveRuleType**(`id`, `config?`, `sharedContext?`): `Promise`<[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)\> + +This method is used to retrieve a rule type by its ID and and optionally based on the provided configurations. + +#### Example + +A simple example that retrieves a rule type by its code: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveRuleType (ruleTypeId: string) { + const pricingService = await initializePricingModule() + + const ruleType = await pricingService.retrieveRuleType(ruleTypeId) + + // do something with the rule type or return it +} +``` + +To specify attributes that should be retrieved: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrieveRuleType (ruleTypeId: string) { + const pricingService = await initializePricingModule() + + const ruleType = await pricingService.retrieveRuleType(ruleTypeId, { + select: ["name"] + }) + + // do something with the rule type or return it +} +``` + +#### Parameters + +", + "description": "The configurations determining how the rule type is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a rule type.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)\> + +", + "optional": false, + "defaultValue": "", + "description": "The retrieved rule type.", + "children": [ + { + "name": "default_priority", + "type": "`number`", + "description": "The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy the provided context. The higher the value, the higher the priority of the rule type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the rule type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The display name of the rule type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_attribute", + "type": "`string`", + "description": "The unique name used to later identify the rule_attribute. For example, it can be used in the `context` parameter of the `calculatePrices` method to specify a rule for calculating the price.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +___ + +### updateCurrencies + +**updateCurrencies**(`data`, `sharedContext?`): `Promise`<[`CurrencyDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx)[]\> + +This method is used to update existing currencies with the provided data. In each currency object, the currency code must be provided to identify which currency to update. + +#### Example + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function updateCurrencies () { + const pricingService = await initializePricingModule() + + const currencies = await pricingService.updateCurrencies([ + { + code: "USD", + symbol: "$", + } + ]) + + // do something with the currencies or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`CurrencyDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of updated currencies.", + "children": [ + { + "name": "CurrencyDTO[]", + "type": "[`CurrencyDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "code", + "type": "`string`", + "description": "The code of the currency.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the currency.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "symbol", + "type": "`string`", + "description": "The symbol of the currency.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "symbol_native", + "type": "`string`", + "description": "The symbol of the currecy in its native form. This is typically the symbol used when displaying a price.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### updateMoneyAmounts + +**updateMoneyAmounts**(`data`, `sharedContext?`): `Promise`<[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)[]\> + +This method updates existing money amounts. + +#### Example + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function updateMoneyAmounts (moneyAmountId: string, amount: number) { + const pricingService = await initializePricingModule() + + const moneyAmounts = await pricingService.updateMoneyAmounts([ + { + id: moneyAmountId, + amount + } + ]) + + // do something with the money amounts or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of updated money amounts.", + "children": [ + { + "name": "MoneyAmountDTO[]", + "type": "[`MoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "amount", + "type": "`number`", + "description": "The price of this money amount.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "currency", + "type": "[`CurrencyDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx)", + "description": "The money amount's currency. Since this is a relation, it will only be retrieved if it's passed to the `relations` array of the find-configuration options.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "currency_code", + "type": "`string`", + "description": "The currency code of this money amount.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the money amount.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "max_quantity", + "type": "`number`", + "description": "The maximum quantity required to be purchased for this price to be applied.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "min_quantity", + "type": "`number`", + "description": "The minimum quantity required to be purchased for this price to be applied.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### updatePriceRules + +**updatePriceRules**(`data`, `sharedContext?`): `Promise`<[`PriceRuleDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceRuleDTO.mdx)[]\> + +This method is used to update price rules, each with their provided data. + +#### Example + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function updatePriceRules ( + id: string, + priceSetId: string, +) { + const pricingService = await initializePricingModule() + + const priceRules = await pricingService.updatePriceRules([ + { + id, + price_set_id: priceSetId, + } + ]) + + // do something with the price rules or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`PriceRuleDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceRuleDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of updated price rules.", + "children": [ + { + "name": "PriceRuleDTO[]", + "type": "[`PriceRuleDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceRuleDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the price rule.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_list_id", + "type": "`string`", + "description": "The ID of the associated price list.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set", + "type": "[`PriceSetDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx)", + "description": "The associated price set. It may only be available if the relation `price_set` is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_id", + "type": "`string`", + "description": "The ID of the associated price set.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_money_amount_id", + "type": "`string`", + "description": "The ID of the associated price set money amount.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "priority", + "type": "`number`", + "description": "The priority of the price rule in comparison to other applicable price rules.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_type", + "type": "[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)", + "description": "The associated rule type. It may only be available if the relation `rule_type` is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_type_id", + "type": "`string`", + "description": "The ID of the associated rule type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the price rule.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### updatePriceSetMoneyAmountRules + +**updatePriceSetMoneyAmountRules**(`data`, `sharedContext?`): `Promise`<[`PriceSetMoneyAmountRulesDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountRulesDTO.mdx)[]\> + +This method is used to update price set money amount rules, each with their provided data. + +#### Example + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function updatePriceSetMoneyAmountRules (id: string, value: string) { + const pricingService = await initializePricingModule() + + const priceSetMoneyAmountRules = await pricingService.updatePriceSetMoneyAmountRules([ + { + id, + value + } + ]) + + // do something with the price set money amount rules or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`PriceSetMoneyAmountRulesDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountRulesDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of updated price set money amount rules.", + "children": [ + { + "name": "PriceSetMoneyAmountRulesDTO[]", + "type": "[`PriceSetMoneyAmountRulesDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountRulesDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the price set money amount.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_money_amount", + "type": "[`PriceSetMoneyAmountDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountDTO.mdx)", + "description": "The associated price set money amount. It may only be available if the relation `price_set_money_amount` is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_type", + "type": "[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)", + "description": "The associated rule type. It may only be available if the relation `rule_type` is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the price set money amount rule.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> + +___ + +### updateRuleTypes + +**updateRuleTypes**(`data`, `sharedContext?`): `Promise`<[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)[]\> + +This method is used to update existing rule types with the provided data. + +#### Example + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function updateRuleTypes (ruleTypeId: string) { + const pricingService = await initializePricingModule() + + const ruleTypes = await pricingService.updateRuleTypes([ + { + id: ruleTypeId, + name: "Region", + } + ]) + + // do something with the rule types or return them +} +``` + +#### Parameters + + + +#### Returns + +`Promise`<[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)[]\> + +", + "optional": false, + "defaultValue": "", + "description": "The list of updated rule types.", + "children": [ + { + "name": "RuleTypeDTO[]", + "type": "[`RuleTypeDTO`](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "default_priority", + "type": "`number`", + "description": "The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy the provided context. The higher the value, the higher the priority of the rule type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the rule type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The display name of the rule type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_attribute", + "type": "`string`", + "description": "The unique name used to later identify the rule_attribute. For example, it can be used in the `context` parameter of the `calculatePrices` method to specify a rule for calculating the price.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.IStockLocationService.mdx b/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.IStockLocationService.mdx index aca1b779726bf..e59be925446ec 100644 --- a/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.IStockLocationService.mdx +++ b/www/apps/docs/content/references/js-client/internal/interfaces/admin_discounts.internal.IStockLocationService.mdx @@ -12,16 +12,16 @@ import ParameterTypes from "@site/src/components/ParameterTypes" ### \_\_joinerConfig -**__joinerConfig**(): [`ModuleJoinerConfig`](../../admin_discounts/modules/admin_discounts.internal.mdx#modulejoinerconfig) +**__joinerConfig**(): [`ModuleJoinerConfig`](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#modulejoinerconfig) #### Returns -[`ModuleJoinerConfig`](../../admin_discounts/modules/admin_discounts.internal.mdx#modulejoinerconfig) +[`ModuleJoinerConfig`](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#modulejoinerconfig) & { `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`](../../admin_discounts/modules/admin_discounts.internal.mdx#modulejoinerrelationship) ; `serviceName`: `string` }[] ; `isLink?`: `boolean` ; `isReadOnlyLink?`: `boolean` ; `linkableKeys?`: Record<`string`, `string`\\> ; `primaryKeys?`: `string`[] ; `relationships?`: [`ModuleJoinerRelationship`](../../admin_discounts/modules/admin_discounts.internal.mdx#modulejoinerrelationship)[] ; `schema?`: `string` ; `serviceName?`: `string` }", + "type": "[`Omit`](../../admin_auth/modules/admin_auth.internal.mdx#omit)<[`JoinerServiceConfig`](../../internal-1/interfaces/admin_discounts.internal.internal-1.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`](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#modulejoinerrelationship) ; `serviceName`: `string` }[] ; `isLink?`: `boolean` ; `isReadOnlyLink?`: `boolean` ; `linkableKeys?`: Record<`string`, `string`\\> ; `primaryKeys?`: `string`[] ; `relationships?`: [`ModuleJoinerRelationship`](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#modulejoinerrelationship)[] ; `schema?`: `string` ; `serviceName?`: `string` }", "description": "", "optional": false, "defaultValue": "", @@ -40,7 +40,7 @@ ___ ", + "type": "[`FindConfig`](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindConfig.mdx)<[`StockLocationDTO`](../../admin_discounts/modules/admin_discounts.internal.mdx#stocklocationdto)\\>", "description": "", "optional": true, "defaultValue": "", @@ -149,7 +149,7 @@ ___ }, { "name": "context", - "type": "[`SharedContext`](../../admin_discounts/modules/admin_discounts.internal.mdx#sharedcontext)", + "type": "[`SharedContext`](../modules/admin_discounts.internal.internal-1.mdx#sharedcontext)", "description": "", "optional": true, "defaultValue": "", @@ -201,7 +201,7 @@ ___ ", + "type": "[`FindConfig`](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindConfig.mdx)<[`StockLocationDTO`](../../admin_discounts/modules/admin_discounts.internal.mdx#stocklocationdto)\\>", "description": "", "optional": true, "defaultValue": "", @@ -217,7 +217,7 @@ ___ }, { "name": "context", - "type": "[`SharedContext`](../../admin_discounts/modules/admin_discounts.internal.mdx#sharedcontext)", + "type": "[`SharedContext`](../modules/admin_discounts.internal.internal-1.mdx#sharedcontext)", "description": "", "optional": true, "defaultValue": "", @@ -276,7 +276,7 @@ ___ }, { "name": "config", - "type": "[`FindConfig`](admin_discounts.internal.FindConfig.mdx)<[`StockLocationDTO`](../../admin_discounts/modules/admin_discounts.internal.mdx#stocklocationdto)\\>", + "type": "[`FindConfig`](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindConfig.mdx)<[`StockLocationDTO`](../../admin_discounts/modules/admin_discounts.internal.mdx#stocklocationdto)\\>", "description": "", "optional": true, "defaultValue": "", @@ -284,7 +284,7 @@ ___ }, { "name": "context", - "type": "[`SharedContext`](../../admin_discounts/modules/admin_discounts.internal.mdx#sharedcontext)", + "type": "[`SharedContext`](../modules/admin_discounts.internal.internal-1.mdx#sharedcontext)", "description": "", "optional": true, "defaultValue": "", @@ -335,7 +335,7 @@ ___ }, { "name": "input", - "type": "[`UpdateStockLocationInput`](../../admin_discounts/modules/admin_discounts.internal.mdx#updatestocklocationinput)", + "type": "[`UpdateStockLocationInput`](../../internal-1/modules/admin_discounts.internal.internal-1.StockLocationTypes.mdx#updatestocklocationinput)", "description": "", "optional": false, "defaultValue": "", @@ -343,7 +343,7 @@ ___ }, { "name": "context", - "type": "[`SharedContext`](../../admin_discounts/modules/admin_discounts.internal.mdx#sharedcontext)", + "type": "[`SharedContext`](../modules/admin_discounts.internal.internal-1.mdx#sharedcontext)", "description": "", "optional": true, "defaultValue": "", diff --git a/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal-1.mdx b/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal-1.mdx index 8082cfccbdda9..2559e80f75b58 100644 --- a/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal-1.mdx +++ b/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal-1.mdx @@ -8,638 +8,1583 @@ import ParameterTypes from "@site/src/components/ParameterTypes" [admin/discounts](../../modules/admin_discounts.mdx).[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).internal +## Namespaces + +- [CacheTypes](../../internal-1/modules/admin_discounts.internal.internal-1.CacheTypes.mdx) +- [CommonTypes](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx) +- [DAL](../../internal-1/modules/admin_discounts.internal.internal-1.DAL.mdx) +- [EventBusTypes](../../internal-1/modules/admin_discounts.internal.internal-1.EventBusTypes.mdx) +- [FeatureFlagTypes](../../internal-1/modules/admin_discounts.internal.internal-1.FeatureFlagTypes.mdx) +- [InventoryTypes](../../internal-1/modules/admin_discounts.internal.internal-1.InventoryTypes.mdx) +- [LoggerTypes](../../internal-1/modules/admin_discounts.internal.internal-1.LoggerTypes.mdx) +- [ModulesSdkTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx) +- [PricingTypes](../../internal-1/modules/admin_discounts.internal.internal-1.PricingTypes.mdx) +- [ProductTypes](../../internal-1/modules/admin_discounts.internal.internal-1.ProductTypes.mdx) +- [SalesChannelTypes](../../internal-1/modules/admin_discounts.internal.internal-1.SalesChannelTypes.mdx) +- [SearchTypes](../../internal-1/modules/admin_discounts.internal.internal-1.SearchTypes.mdx) +- [StockLocationTypes](../../internal-1/modules/admin_discounts.internal.internal-1.StockLocationTypes.mdx) +- [TransactionBaseTypes](../../internal-1/modules/admin_discounts.internal.internal-1.TransactionBaseTypes.mdx) +- [WorkflowTypes](../../internal-1/modules/admin_discounts.internal.internal-1.WorkflowTypes.mdx) + +## Interfaces + +- [Context](../../internal-1/interfaces/admin_discounts.internal.internal-1.Context.mdx) +- [ILinkModule](../../internal-1/interfaces/admin_discounts.internal.internal-1.ILinkModule.mdx) +- [JoinerArgument](../../internal-1/interfaces/admin_discounts.internal.internal-1.JoinerArgument.mdx) +- [JoinerDirective](../../internal-1/interfaces/admin_discounts.internal.internal-1.JoinerDirective.mdx) +- [JoinerServiceConfig](../../internal-1/interfaces/admin_discounts.internal.internal-1.JoinerServiceConfig.mdx) +- [JoinerServiceConfigAlias](../../internal-1/interfaces/admin_discounts.internal.internal-1.JoinerServiceConfigAlias.mdx) +- [ProductCategoryTransformOptions](../../internal-1/interfaces/admin_discounts.internal.internal-1.ProductCategoryTransformOptions.mdx) +- [RemoteExpandProperty](../../internal-1/interfaces/admin_discounts.internal.internal-1.RemoteExpandProperty.mdx) +- [RemoteJoinerQuery](../../internal-1/interfaces/admin_discounts.internal.internal-1.RemoteJoinerQuery.mdx) +- [RemoteNestedExpands](../../internal-1/interfaces/admin_discounts.internal.internal-1.RemoteNestedExpands.mdx) + ## References -### Address +### AddPricesDTO + +Re-exports [AddPricesDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.AddPricesDTO.mdx) + +___ + +### AddRulesDTO + +Re-exports [AddRulesDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.AddRulesDTO.mdx) + +___ + +### AddressCreatePayload + +Re-exports [AddressCreatePayload](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.AddressCreatePayload.mdx) + +___ + +### AddressPayload + +Re-exports [AddressPayload](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.AddressPayload.mdx) + +___ + +### BaseEntity + +Re-exports [BaseEntity](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.BaseEntity.mdx) + +___ + +### BaseFilterable + +Re-exports [BaseFilterable](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.BaseFilterable.mdx) + +___ + +### BulkUpdateInventoryLevelInput + +Re-exports [BulkUpdateInventoryLevelInput](../../internal-1/modules/admin_discounts.internal.internal-1.InventoryTypes.mdx#bulkupdateinventorylevelinput) + +___ + +### CalculatedPriceSetDTO + +Re-exports [CalculatedPriceSetDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CalculatedPriceSetDTO.mdx) + +___ + +### CartWorkflow + +Re-exports [CartWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.CartWorkflow.mdx) + +___ + +### CommonWorkflow + +Re-exports [CommonWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.CommonWorkflow.mdx) + +___ + +### ConfigModule + +Re-exports [ConfigModule](../../admin_discounts/modules/admin_discounts.internal.mdx#configmodule) + +___ + +### Constructor + +Re-exports [Constructor](../../admin_discounts/modules/admin_discounts.internal.mdx#constructor) + +___ + +### CreateCurrencyDTO + +Re-exports [CreateCurrencyDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreateCurrencyDTO.mdx) + +___ + +### CreateInventoryItemInput + +Re-exports [CreateInventoryItemInput](../../internal-1/modules/admin_discounts.internal.internal-1.InventoryTypes.mdx#createinventoryiteminput) + +___ + +### CreateInventoryLevelInput + +Re-exports [CreateInventoryLevelInput](../../internal-1/modules/admin_discounts.internal.internal-1.InventoryTypes.mdx#createinventorylevelinput) + +___ + +### CreateMoneyAmountDTO + +Re-exports [CreateMoneyAmountDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreateMoneyAmountDTO.mdx) + +___ + +### CreatePriceRuleDTO + +Re-exports [CreatePriceRuleDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceRuleDTO.mdx) + +___ + +### CreatePriceSetDTO + +Re-exports [CreatePriceSetDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetDTO.mdx) + +___ + +### CreatePriceSetMoneyAmountDTO + +Re-exports [CreatePriceSetMoneyAmountDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetMoneyAmountDTO.mdx) + +___ + +### CreatePriceSetMoneyAmountRulesDTO + +Re-exports [CreatePriceSetMoneyAmountRulesDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetMoneyAmountRulesDTO.mdx) + +___ + +### CreatePriceSetRuleTypeDTO + +Re-exports [CreatePriceSetRuleTypeDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePriceSetRuleTypeDTO.mdx) + +___ + +### CreatePricesDTO + +Re-exports [CreatePricesDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreatePricesDTO.mdx) + +___ + +### CreateProductCategoryDTO + +Re-exports [CreateProductCategoryDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductCategoryDTO.mdx) + +___ + +### CreateProductCollectionDTO + +Re-exports [CreateProductCollectionDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductCollectionDTO.mdx) + +___ + +### CreateProductDTO + +Re-exports [CreateProductDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductDTO.mdx) + +___ + +### CreateProductOnlyDTO + +Re-exports [CreateProductOnlyDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductOnlyDTO.mdx) + +___ + +### CreateProductOptionDTO + +Re-exports [CreateProductOptionDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductOptionDTO.mdx) + +___ + +### CreateProductOptionOnlyDTO + +Re-exports [CreateProductOptionOnlyDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductOptionOnlyDTO.mdx) + +___ + +### CreateProductTagDTO + +Re-exports [CreateProductTagDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductTagDTO.mdx) + +___ + +### CreateProductTypeDTO + +Re-exports [CreateProductTypeDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductTypeDTO.mdx) + +___ + +### CreateProductVariantDTO + +Re-exports [CreateProductVariantDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantDTO.mdx) + +___ + +### CreateProductVariantOnlyDTO + +Re-exports [CreateProductVariantOnlyDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantOnlyDTO.mdx) + +___ + +### CreateProductVariantOptionDTO + +Re-exports [CreateProductVariantOptionDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.CreateProductVariantOptionDTO.mdx) + +___ + +### CreateReservationItemInput + +Re-exports [CreateReservationItemInput](../../internal-1/modules/admin_discounts.internal.internal-1.InventoryTypes.mdx#createreservationiteminput) + +___ + +### CreateRuleTypeDTO + +Re-exports [CreateRuleTypeDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CreateRuleTypeDTO.mdx) + +___ + +### CreateStockLocationInput + +Re-exports [CreateStockLocationInput](../../internal-1/modules/admin_discounts.internal.internal-1.StockLocationTypes.mdx#createstocklocationinput) + +___ + +### CurrencyDTO + +Re-exports [CurrencyDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.CurrencyDTO.mdx) + +___ + +### CustomFindOptions + +Re-exports [CustomFindOptions](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.CustomFindOptions.mdx) + +___ + +### DateComparisonOperator + +Re-exports [DateComparisonOperator](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.DateComparisonOperator.mdx) + +___ + +### DeleteFileType + +Re-exports [DeleteFileType](../../admin_discounts/modules/admin_discounts.internal.mdx#deletefiletype) + +___ + +### DeleteResponse + +Re-exports [DeleteResponse](../../admin_discounts/modules/admin_discounts.internal.mdx#deleteresponse) + +___ + +### EmitData -Re-exports [Address](../classes/admin_collections.internal.Address.mdx) +Re-exports [EmitData](../../admin_discounts/modules/admin_discounts.internal.mdx#emitdata) ___ -### AllocationType +### EmptyQueryParams -Re-exports [AllocationType](../enums/admin_collections.internal.AllocationType.mdx) +Re-exports [EmptyQueryParams](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.EmptyQueryParams.mdx) ___ -### AnalyticsConfig +### EntityDateColumns -Re-exports [AnalyticsConfig](../classes/admin_discounts.internal.internal.AnalyticsConfig.mdx) +Re-exports [EntityDateColumns](../../internal-1/modules/admin_discounts.internal.internal-1.DAL.mdx#entitydatecolumns) ___ -### BatchJob +### EventHandler -Re-exports [BatchJob](../classes/admin_batch_jobs.internal.BatchJob.mdx) +Re-exports [EventHandler](../../internal-1/modules/admin_discounts.internal.internal-1.EventBusTypes.mdx#eventhandler) ___ -### Cart +### ExtendedFindConfig -Re-exports [Cart](../classes/admin_collections.internal.Cart.mdx) +Re-exports [ExtendedFindConfig](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx#extendedfindconfig) ___ -### CartType +### ExternalModuleDeclaration -Re-exports [CartType](../enums/admin_collections.internal.CartType.mdx) +Re-exports [ExternalModuleDeclaration](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#externalmoduledeclaration) ___ -### ClaimFulfillmentStatus +### FeatureFlagsResponse -Re-exports [ClaimFulfillmentStatus](../enums/admin_collections.internal.ClaimFulfillmentStatus.mdx) +Re-exports [FeatureFlagsResponse](../../internal-1/modules/admin_discounts.internal.internal-1.FeatureFlagTypes.mdx#featureflagsresponse) ___ -### ClaimImage +### FileServiceGetUploadStreamResult -Re-exports [ClaimImage](../classes/admin_collections.internal.ClaimImage.mdx) +Re-exports [FileServiceGetUploadStreamResult](../../admin_discounts/modules/admin_discounts.internal.mdx#fileservicegetuploadstreamresult) ___ -### ClaimItem +### FileServiceUploadResult -Re-exports [ClaimItem](../classes/admin_collections.internal.ClaimItem.mdx) +Re-exports [FileServiceUploadResult](../../admin_discounts/modules/admin_discounts.internal.mdx#fileserviceuploadresult) ___ -### ClaimOrder +### FilterQuery -Re-exports [ClaimOrder](../classes/admin_collections.internal.ClaimOrder.mdx) +Re-exports [FilterQuery](../../internal-1/modules/admin_discounts.internal.internal-1.DAL.mdx#filterquery) ___ -### ClaimPaymentStatus +### FilterableCurrencyProps -Re-exports [ClaimPaymentStatus](../enums/admin_collections.internal.ClaimPaymentStatus.mdx) +Re-exports [FilterableCurrencyProps](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterableCurrencyProps.mdx) ___ -### ClaimReason +### FilterableInventoryItemProps -Re-exports [ClaimReason](../enums/admin_collections.internal.ClaimReason.mdx) +Re-exports [FilterableInventoryItemProps](../../internal-1/modules/admin_discounts.internal.internal-1.InventoryTypes.mdx#filterableinventoryitemprops) ___ -### ClaimTag +### FilterableInventoryLevelProps -Re-exports [ClaimTag](../classes/admin_collections.internal.ClaimTag.mdx) +Re-exports [FilterableInventoryLevelProps](../../internal-1/modules/admin_discounts.internal.internal-1.InventoryTypes.mdx#filterableinventorylevelprops) ___ -### ClaimType +### FilterableMoneyAmountProps -Re-exports [ClaimType](../enums/admin_collections.internal.ClaimType.mdx) +Re-exports [FilterableMoneyAmountProps](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterableMoneyAmountProps.mdx) ___ -### Country +### FilterablePriceRuleProps -Re-exports [Country](../classes/admin_collections.internal.Country.mdx) +Re-exports [FilterablePriceRuleProps](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceRuleProps.mdx) ___ -### Currency +### FilterablePriceSetMoneyAmountProps -Re-exports [Currency](../classes/admin_collections.internal.Currency.mdx) +Re-exports [FilterablePriceSetMoneyAmountProps](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetMoneyAmountProps.mdx) ___ -### CustomShippingOption +### FilterablePriceSetMoneyAmountRulesProps -Re-exports [CustomShippingOption](../classes/admin_discounts.internal.internal.CustomShippingOption.mdx) +Re-exports [FilterablePriceSetMoneyAmountRulesProps](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetMoneyAmountRulesProps.mdx) ___ -### Customer +### FilterablePriceSetProps -Re-exports [Customer](../classes/admin_collections.internal.Customer.mdx) +Re-exports [FilterablePriceSetProps](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetProps.mdx) ___ -### CustomerGroup +### FilterablePriceSetRuleTypeProps -Re-exports [CustomerGroup](../classes/admin_collections.internal.CustomerGroup.mdx) +Re-exports [FilterablePriceSetRuleTypeProps](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterablePriceSetRuleTypeProps.mdx) ___ -### Discount +### FilterableProductCategoryProps -Re-exports [Discount](../classes/admin_collections.internal.Discount.mdx) +Re-exports [FilterableProductCategoryProps](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductCategoryProps.mdx) ___ -### DiscountCondition +### FilterableProductCollectionProps -Re-exports [DiscountCondition](../classes/admin_collections.internal.DiscountCondition.mdx) +Re-exports [FilterableProductCollectionProps](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductCollectionProps.mdx) ___ -### DiscountConditionCustomerGroup +### FilterableProductOptionProps -Re-exports [DiscountConditionCustomerGroup](../classes/admin_discounts.internal.internal.DiscountConditionCustomerGroup.mdx) +Re-exports [FilterableProductOptionProps](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductOptionProps.mdx) ___ -### DiscountConditionOperator +### FilterableProductProps -Re-exports [DiscountConditionOperator](../enums/admin_collections.internal.DiscountConditionOperator.mdx) +Re-exports [FilterableProductProps](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductProps.mdx) ___ -### DiscountConditionProduct +### FilterableProductTagProps -Re-exports [DiscountConditionProduct](../classes/admin_discounts.internal.internal.DiscountConditionProduct.mdx) +Re-exports [FilterableProductTagProps](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductTagProps.mdx) ___ -### DiscountConditionProductCollection +### FilterableProductTypeProps -Re-exports [DiscountConditionProductCollection](../classes/admin_discounts.internal.internal.DiscountConditionProductCollection.mdx) +Re-exports [FilterableProductTypeProps](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductTypeProps.mdx) ___ -### DiscountConditionProductTag +### FilterableProductVariantProps -Re-exports [DiscountConditionProductTag](../classes/admin_discounts.internal.internal.DiscountConditionProductTag.mdx) +Re-exports [FilterableProductVariantProps](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.FilterableProductVariantProps.mdx) ___ -### DiscountConditionProductType +### FilterableReservationItemProps -Re-exports [DiscountConditionProductType](../classes/admin_discounts.internal.internal.DiscountConditionProductType.mdx) +Re-exports [FilterableReservationItemProps](../../internal-1/modules/admin_discounts.internal.internal-1.InventoryTypes.mdx#filterablereservationitemprops) ___ -### DiscountConditionType +### FilterableRuleTypeProps -Re-exports [DiscountConditionType](../enums/admin_collections.internal.DiscountConditionType.mdx) +Re-exports [FilterableRuleTypeProps](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.FilterableRuleTypeProps.mdx) ___ -### DiscountRule +### FilterableStockLocationProps -Re-exports [DiscountRule](../classes/admin_collections.internal.DiscountRule.mdx) +Re-exports [FilterableStockLocationProps](../../internal-1/modules/admin_discounts.internal.internal-1.StockLocationTypes.mdx#filterablestocklocationprops) ___ -### DiscountRuleType +### FindConfig -Re-exports [DiscountRuleType](../enums/admin_collections.internal.DiscountRuleType.mdx) +Re-exports [FindConfig](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindConfig.mdx) ___ -### DraftOrder +### FindOptions -Re-exports [DraftOrder](../classes/admin_collections.internal.DraftOrder.mdx) +Re-exports [FindOptions](../../internal-1/modules/admin_discounts.internal.internal-1.DAL.mdx#findoptions) ___ -### DraftOrderStatus +### FindPaginationParams -Re-exports [DraftOrderStatus](../enums/admin_collections.internal.DraftOrderStatus.mdx) +Re-exports [FindPaginationParams](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindPaginationParams.mdx) ___ -### Fulfillment +### FindParams -Re-exports [Fulfillment](../classes/admin_collections.internal.Fulfillment.mdx) +Re-exports [FindParams](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.FindParams.mdx) ___ -### FulfillmentItem +### FlagSettings -Re-exports [FulfillmentItem](../classes/admin_collections.internal.FulfillmentItem.mdx) +Re-exports [FlagSettings](../../internal-1/modules/admin_discounts.internal.internal-1.FeatureFlagTypes.mdx#flagsettings) ___ -### FulfillmentProvider +### GetUploadedFileType -Re-exports [FulfillmentProvider](../classes/admin_collections.internal.FulfillmentProvider.mdx) +Re-exports [GetUploadedFileType](../../admin_discounts/modules/admin_discounts.internal.mdx#getuploadedfiletype) ___ -### FulfillmentStatus +### HttpCompressionOptions -Re-exports [FulfillmentStatus](../enums/admin_collections.internal.FulfillmentStatus.mdx) +Re-exports [HttpCompressionOptions](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx#httpcompressionoptions) ___ -### GiftCard +### ICacheService -Re-exports [GiftCard](../classes/admin_collections.internal.GiftCard.mdx) +Re-exports [ICacheService](../interfaces/admin_discounts.internal.ICacheService.mdx) ___ -### GiftCardTransaction +### IEventBusModuleService -Re-exports [GiftCardTransaction](../classes/admin_collections.internal.GiftCardTransaction.mdx) +Re-exports [IEventBusModuleService](../interfaces/admin_discounts.internal.IEventBusModuleService.mdx) ___ -### IdempotencyKey +### IEventBusService -Re-exports [IdempotencyKey](../classes/admin_discounts.internal.internal.IdempotencyKey.mdx) +Re-exports [IEventBusService](../interfaces/admin_discounts.internal.IEventBusService.mdx) ___ -### Image +### IFlagRouter -Re-exports [Image](../classes/admin_collections.internal.Image.mdx) +Re-exports [IFlagRouter](../../FeatureFlagTypes/interfaces/admin_discounts.internal.internal-1.FeatureFlagTypes.IFlagRouter.mdx) ___ -### Invite +### IInventoryService -Re-exports [Invite](../classes/admin_discounts.internal.internal.Invite.mdx) +Re-exports [IInventoryService](../interfaces/admin_discounts.internal.IInventoryService.mdx) ___ -### LineItem +### IPricingModuleService -Re-exports [LineItem](../classes/admin_collections.internal.LineItem.mdx) +Re-exports [IPricingModuleService](../interfaces/admin_discounts.internal.IPricingModuleService.mdx) ___ -### LineItemAdjustment +### IProductModuleService -Re-exports [LineItemAdjustment](../classes/admin_collections.internal.LineItemAdjustment.mdx) +Re-exports [IProductModuleService](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.IProductModuleService.mdx) ___ -### LineItemTaxLine +### ISearchService -Re-exports [LineItemTaxLine](../classes/admin_collections.internal.LineItemTaxLine.mdx) +Re-exports [ISearchService](../../SearchTypes/interfaces/admin_discounts.internal.internal-1.SearchTypes.ISearchService.mdx) ___ -### MoneyAmount +### IStockLocationService -Re-exports [MoneyAmount](../classes/admin_collections.internal.MoneyAmount.mdx) +Re-exports [IStockLocationService](../interfaces/admin_discounts.internal.IStockLocationService.mdx) ___ -### Note +### ITransactionBaseService -Re-exports [Note](../classes/admin_discounts.internal.internal.Note.mdx) +Re-exports [ITransactionBaseService](../interfaces/admin_discounts.internal.ITransactionBaseService.mdx) ___ -### Notification +### IndexSettings -Re-exports [Notification](../classes/admin_discounts.internal.internal.Notification.mdx) +Re-exports [IndexSettings](../../internal-1/modules/admin_discounts.internal.internal-1.SearchTypes.mdx#indexsettings) ___ -### Oauth +### InternalModuleDeclaration -Re-exports [Oauth](../classes/admin_discounts.internal.internal.Oauth.mdx) +Re-exports [InternalModuleDeclaration](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#internalmoduledeclaration) ___ -### Order +### InventoryItemDTO -Re-exports [Order](../classes/admin_collections.internal.Order.mdx) +Re-exports [InventoryItemDTO](../../admin_discounts/modules/admin_discounts.internal.mdx#inventoryitemdto) ___ -### OrderEdit +### InventoryLevelDTO -Re-exports [OrderEdit](../classes/admin_collections.internal.OrderEdit.mdx) +Re-exports [InventoryLevelDTO](../../admin_discounts/modules/admin_discounts.internal.mdx#inventoryleveldto) ___ -### OrderEditItemChangeType +### InventoryWorkflow -Re-exports [OrderEditItemChangeType](../enums/admin_collections.internal.OrderEditItemChangeType.mdx) +Re-exports [InventoryWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.InventoryWorkflow.mdx) ___ -### OrderEditStatus +### LinkModuleDefinition -Re-exports [OrderEditStatus](../enums/admin_collections.internal.OrderEditStatus.mdx) +Re-exports [LinkModuleDefinition](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#linkmoduledefinition) ___ -### OrderItemChange +### LoadedModule -Re-exports [OrderItemChange](../classes/admin_collections.internal.OrderItemChange.mdx) +Re-exports [LoadedModule](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#loadedmodule) ___ -### OrderStatus +### LoaderOptions -Re-exports [OrderStatus](../enums/admin_collections.internal.OrderStatus.mdx) +Re-exports [LoaderOptions](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#loaderoptions) ___ -### Payment +### LogLevel -Re-exports [Payment](../classes/admin_collections.internal.Payment.mdx) +Re-exports [LogLevel](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#loglevel) ___ -### PaymentCollection +### Logger -Re-exports [PaymentCollection](../classes/admin_collections.internal.PaymentCollection.mdx) +Re-exports [Logger](../interfaces/admin_discounts.internal.Logger.mdx) ___ -### PaymentCollectionStatus +### LoggerOptions -Re-exports [PaymentCollectionStatus](../enums/admin_collections.internal.PaymentCollectionStatus.mdx) +Re-exports [LoggerOptions](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#loggeroptions) ___ -### PaymentCollectionType +### MODULE\_RESOURCE\_TYPE -Re-exports [PaymentCollectionType](../enums/admin_discounts.internal.internal.PaymentCollectionType.mdx) +Re-exports [MODULE_RESOURCE_TYPE](../../ModulesSdkTypes/enums/admin_discounts.internal.internal-1.ModulesSdkTypes.MODULE_RESOURCE_TYPE.mdx) ___ -### PaymentProvider +### MODULE\_SCOPE -Re-exports [PaymentProvider](../classes/admin_collections.internal.PaymentProvider.mdx) +Re-exports [MODULE_SCOPE](../../ModulesSdkTypes/enums/admin_discounts.internal.internal-1.ModulesSdkTypes.MODULE_SCOPE.mdx) ___ -### PaymentSession +### MedusaContainer -Re-exports [PaymentSession](../classes/admin_collections.internal.PaymentSession.mdx) +Re-exports [MedusaContainer](../../admin_discounts/modules/admin_discounts.internal.mdx#medusacontainer) ___ -### PaymentSessionStatus +### ModuleConfig -Re-exports [PaymentSessionStatus](../enums/admin_discounts.internal.internal.PaymentSessionStatus.mdx) +Re-exports [ModuleConfig](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#moduleconfig) ___ -### PaymentStatus +### ModuleDefinition -Re-exports [PaymentStatus](../enums/admin_collections.internal.PaymentStatus.mdx) +Re-exports [ModuleDefinition](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#moduledefinition) ___ -### PriceList +### ModuleExports -Re-exports [PriceList](../classes/admin_collections.internal.PriceList.mdx) +Re-exports [ModuleExports](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#moduleexports) ___ -### Product +### ModuleJoinerConfig -Re-exports [Product](../classes/admin_collections.internal.Product.mdx) +Re-exports [ModuleJoinerConfig](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#modulejoinerconfig) ___ -### ProductCategory +### ModuleJoinerRelationship -Re-exports [ProductCategory](../classes/admin_collections.internal.ProductCategory.mdx) +Re-exports [ModuleJoinerRelationship](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#modulejoinerrelationship) ___ -### ProductCollection +### ModuleLoaderFunction -Re-exports [ProductCollection](../classes/admin_collections.internal.ProductCollection.mdx) +Re-exports [ModuleLoaderFunction](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#moduleloaderfunction) ___ -### ProductOption +### ModuleResolution -Re-exports [ProductOption](../classes/admin_collections.internal.ProductOption.mdx) +Re-exports [ModuleResolution](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#moduleresolution) ___ -### ProductOptionValue +### ModuleServiceInitializeCustomDataLayerOptions -Re-exports [ProductOptionValue](../classes/admin_collections.internal.ProductOptionValue.mdx) +Re-exports [ModuleServiceInitializeCustomDataLayerOptions](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#moduleserviceinitializecustomdatalayeroptions) + +___ + +### ModuleServiceInitializeOptions + +Re-exports [ModuleServiceInitializeOptions](../../ModulesSdkTypes/interfaces/admin_discounts.internal.internal-1.ModulesSdkTypes.ModuleServiceInitializeOptions.mdx) + +___ + +### ModulesResponse + +Re-exports [ModulesResponse](../../internal-1/modules/admin_discounts.internal.internal-1.ModulesSdkTypes.mdx#modulesresponse) + +___ + +### MoneyAmountDTO + +Re-exports [MoneyAmountDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.MoneyAmountDTO.mdx) + +___ + +### NumericalComparisonOperator + +Re-exports [NumericalComparisonOperator](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.NumericalComparisonOperator.mdx) + +___ + +### OptionsQuery + +Re-exports [OptionsQuery](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.OptionsQuery.mdx) + +___ + +### PaginatedResponse + +Re-exports [PaginatedResponse](../../admin_discounts/modules/admin_discounts.internal.mdx#paginatedresponse) + +___ + +### PartialPick + +Re-exports [PartialPick](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx#partialpick) + +___ + +### PriceRuleDTO + +Re-exports [PriceRuleDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceRuleDTO.mdx) + +___ + +### PriceSetDTO + +Re-exports [PriceSetDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetDTO.mdx) + +___ + +### PriceSetMoneyAmountDTO + +Re-exports [PriceSetMoneyAmountDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountDTO.mdx) + +___ + +### PriceSetMoneyAmountRulesDTO + +Re-exports [PriceSetMoneyAmountRulesDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetMoneyAmountRulesDTO.mdx) + +___ + +### PriceSetRuleTypeDTO + +Re-exports [PriceSetRuleTypeDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PriceSetRuleTypeDTO.mdx) + +___ + +### PricingContext + +Re-exports [PricingContext](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PricingContext.mdx) + +___ + +### PricingFilters + +Re-exports [PricingFilters](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.PricingFilters.mdx) + +___ + +### ProductCategoryDTO + +Re-exports [ProductCategoryDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductCategoryDTO.mdx) + +___ + +### ProductCollectionDTO + +Re-exports [ProductCollectionDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductCollectionDTO.mdx) + +___ + +### ProductDTO + +Re-exports [ProductDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductDTO.mdx) + +___ + +### ProductImageDTO + +Re-exports [ProductImageDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductImageDTO.mdx) + +___ + +### ProductOptionDTO + +Re-exports [ProductOptionDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductOptionDTO.mdx) + +___ + +### ProductOptionValueDTO + +Re-exports [ProductOptionValueDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductOptionValueDTO.mdx) ___ ### ProductStatus -Re-exports [ProductStatus](../enums/admin_collections.internal.ProductStatus.mdx) +Re-exports [ProductStatus](../../ProductTypes/enums/admin_discounts.internal.internal-1.ProductTypes.ProductStatus.mdx) ___ -### ProductTag +### ProductTagDTO -Re-exports [ProductTag](../classes/admin_collections.internal.ProductTag.mdx) +Re-exports [ProductTagDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductTagDTO.mdx) ___ -### ProductTaxRate +### ProductTypeDTO -Re-exports [ProductTaxRate](../classes/admin_discounts.internal.internal.ProductTaxRate.mdx) +Re-exports [ProductTypeDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductTypeDTO.mdx) ___ -### ProductType +### ProductVariantDTO -Re-exports [ProductType](../classes/admin_collections.internal.ProductType.mdx) +Re-exports [ProductVariantDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.ProductVariantDTO.mdx) ___ -### ProductTypeTaxRate +### ProductWorkflow -Re-exports [ProductTypeTaxRate](../classes/admin_discounts.internal.internal.ProductTypeTaxRate.mdx) +Re-exports [ProductWorkflow](../../WorkflowTypes/modules/admin_discounts.internal.internal-1.WorkflowTypes.ProductWorkflow.mdx) ___ -### ProductVariant +### ProjectConfigOptions -Re-exports [ProductVariant](../classes/admin_collections.internal.ProductVariant.mdx) +Re-exports [ProjectConfigOptions](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx#projectconfigoptions) ___ -### ProductVariantInventoryItem +### QueryConfig -Re-exports [ProductVariantInventoryItem](../classes/admin_collections.internal.ProductVariantInventoryItem.mdx) +Re-exports [QueryConfig](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx#queryconfig) ___ -### ProductVariantMoneyAmount +### QuerySelector -Re-exports [ProductVariantMoneyAmount](../classes/admin_discounts.internal.internal.ProductVariantMoneyAmount.mdx) +Re-exports [QuerySelector](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx#queryselector) ___ -### PublishableApiKey +### RemoteQueryFunction -Re-exports [PublishableApiKey](../classes/admin_discounts.internal.internal.PublishableApiKey.mdx) +Re-exports [RemoteQueryFunction](../../admin_discounts/modules/admin_discounts.internal.mdx#remotequeryfunction) ___ -### PublishableApiKeySalesChannel +### RemovePriceSetRulesDTO -Re-exports [PublishableApiKeySalesChannel](../classes/admin_discounts.internal.internal.PublishableApiKeySalesChannel.mdx) +Re-exports [RemovePriceSetRulesDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RemovePriceSetRulesDTO.mdx) ___ -### Refund +### RepositoryService -Re-exports [Refund](../classes/admin_collections.internal.Refund.mdx) +Re-exports [RepositoryService](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.RepositoryService.mdx) ___ -### RefundReason +### RepositoryTransformOptions -Re-exports [RefundReason](../enums/admin_discounts.internal.internal.RefundReason.mdx) +Re-exports [RepositoryTransformOptions](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.RepositoryTransformOptions.mdx) ___ -### Region +### RequestQueryFields -Re-exports [Region](../classes/admin_collections.internal.Region.mdx) +Re-exports [RequestQueryFields](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx#requestqueryfields) ___ -### RequirementType +### ReservationItemDTO -Re-exports [RequirementType](../enums/admin_collections.internal.RequirementType.mdx) +Re-exports [ReservationItemDTO](../../admin_discounts/modules/admin_discounts.internal.mdx#reservationitemdto) ___ -### Return +### ReserveQuantityContext -Re-exports [Return](../classes/admin_collections.internal.Return.mdx) +Re-exports [ReserveQuantityContext](../../admin_discounts/modules/admin_discounts.internal.mdx#reservequantitycontext) ___ -### ReturnItem +### RestoreReturn -Re-exports [ReturnItem](../classes/admin_collections.internal.ReturnItem.mdx) +Re-exports [RestoreReturn](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.RestoreReturn.mdx) ___ -### ReturnReason +### RuleTypeDTO -Re-exports [ReturnReason](../classes/admin_collections.internal.ReturnReason.mdx) +Re-exports [RuleTypeDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.RuleTypeDTO.mdx) ___ -### ReturnStatus +### SalesChannelDTO -Re-exports [ReturnStatus](../enums/admin_collections.internal.ReturnStatus.mdx) +Re-exports [SalesChannelDTO](../../SalesChannelTypes/interfaces/admin_discounts.internal.internal-1.SalesChannelTypes.SalesChannelDTO.mdx) ___ -### SalesChannel +### SalesChannelLocationDTO -Re-exports [SalesChannel](../classes/admin_collections.internal.SalesChannel.mdx) +Re-exports [SalesChannelLocationDTO](../../SalesChannelTypes/interfaces/admin_discounts.internal.internal-1.SalesChannelTypes.SalesChannelLocationDTO.mdx) ___ -### SalesChannelLocation +### Selector -Re-exports [SalesChannelLocation](../classes/admin_collections.internal.SalesChannelLocation.mdx) +Re-exports [Selector](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx#selector) ___ -### ShippingMethod +### SoftDeletableEntity -Re-exports [ShippingMethod](../classes/admin_collections.internal.ShippingMethod.mdx) +Re-exports [SoftDeletableEntity](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.SoftDeletableEntity.mdx) ___ -### ShippingMethodTaxLine +### SoftDeletableEntityDateColumns -Re-exports [ShippingMethodTaxLine](../classes/admin_collections.internal.ShippingMethodTaxLine.mdx) +Re-exports [SoftDeletableEntityDateColumns](../../internal-1/modules/admin_discounts.internal.internal-1.DAL.mdx#softdeletableentitydatecolumns) ___ -### ShippingOption +### SoftDeleteReturn -Re-exports [ShippingOption](../classes/admin_collections.internal.ShippingOption.mdx) +Re-exports [SoftDeleteReturn](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.SoftDeleteReturn.mdx) ___ -### ShippingOptionPriceType +### StockLocationAddressDTO -Re-exports [ShippingOptionPriceType](../enums/admin_collections.internal.ShippingOptionPriceType.mdx) +Re-exports [StockLocationAddressDTO](../../internal-1/modules/admin_discounts.internal.internal-1.StockLocationTypes.mdx#stocklocationaddressdto) ___ -### ShippingOptionRequirement +### StockLocationAddressInput -Re-exports [ShippingOptionRequirement](../classes/admin_collections.internal.ShippingOptionRequirement.mdx) +Re-exports [StockLocationAddressInput](../../internal-1/modules/admin_discounts.internal.internal-1.StockLocationTypes.mdx#stocklocationaddressinput) ___ -### ShippingProfile +### StockLocationDTO -Re-exports [ShippingProfile](../classes/admin_collections.internal.ShippingProfile.mdx) +Re-exports [StockLocationDTO](../../admin_discounts/modules/admin_discounts.internal.mdx#stocklocationdto) ___ -### ShippingProfileType +### StockLocationExpandedDTO -Re-exports [ShippingProfileType](../enums/admin_collections.internal.ShippingProfileType.mdx) +Re-exports [StockLocationExpandedDTO](../../admin_discounts/modules/admin_discounts.internal.mdx#stocklocationexpandeddto) ___ -### ShippingTaxRate +### StringComparisonOperator -Re-exports [ShippingTaxRate](../classes/admin_discounts.internal.internal.ShippingTaxRate.mdx) +Re-exports [StringComparisonOperator](../../CommonTypes/interfaces/admin_discounts.internal.internal-1.CommonTypes.StringComparisonOperator.mdx) ___ -### StagedJob +### Subscriber -Re-exports [StagedJob](../classes/admin_discounts.internal.internal.StagedJob.mdx) +Re-exports [Subscriber](../../admin_discounts/modules/admin_discounts.internal.mdx#subscriber) ___ -### Store +### SubscriberContext -Re-exports [Store](../classes/admin_discounts.internal.internal.Store.mdx) +Re-exports [SubscriberContext](../../admin_discounts/modules/admin_discounts.internal.mdx#subscribercontext) ___ -### Swap +### SubscriberDescriptor -Re-exports [Swap](../classes/admin_collections.internal.Swap.mdx) +Re-exports [SubscriberDescriptor](../../internal-1/modules/admin_discounts.internal.internal-1.EventBusTypes.mdx#subscriberdescriptor) ___ -### SwapFulfillmentStatus +### TotalField -Re-exports [SwapFulfillmentStatus](../enums/admin_collections.internal.SwapFulfillmentStatus.mdx) +Re-exports [TotalField](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx#totalfield) ___ -### SwapPaymentStatus +### TreeQuerySelector -Re-exports [SwapPaymentStatus](../enums/admin_collections.internal.SwapPaymentStatus.mdx) +Re-exports [TreeQuerySelector](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx#treequeryselector) ___ -### TaxProvider +### TreeRepositoryService -Re-exports [TaxProvider](../classes/admin_collections.internal.TaxProvider.mdx) +Re-exports [TreeRepositoryService](../../DAL/interfaces/admin_discounts.internal.internal-1.DAL.TreeRepositoryService.mdx) ___ -### TaxRate +### UpdateCurrencyDTO -Re-exports [TaxRate](../classes/admin_collections.internal.TaxRate.mdx) +Re-exports [UpdateCurrencyDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdateCurrencyDTO.mdx) ___ -### TrackingLink +### UpdateInventoryLevelInput -Re-exports [TrackingLink](../classes/admin_collections.internal.TrackingLink.mdx) +Re-exports [UpdateInventoryLevelInput](../../internal-1/modules/admin_discounts.internal.internal-1.InventoryTypes.mdx#updateinventorylevelinput) ___ -### User +### UpdateMoneyAmountDTO -Re-exports [User](../classes/admin_auth.internal.User.mdx) +Re-exports [UpdateMoneyAmountDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdateMoneyAmountDTO.mdx) ___ -### UserRoles +### UpdatePriceRuleDTO + +Re-exports [UpdatePriceRuleDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceRuleDTO.mdx) + +___ + +### UpdatePriceSetDTO + +Re-exports [UpdatePriceSetDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetDTO.mdx) + +___ + +### UpdatePriceSetMoneyAmountDTO + +Re-exports [UpdatePriceSetMoneyAmountDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetMoneyAmountDTO.mdx) + +___ + +### UpdatePriceSetMoneyAmountRulesDTO + +Re-exports [UpdatePriceSetMoneyAmountRulesDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetMoneyAmountRulesDTO.mdx) + +___ + +### UpdatePriceSetRuleTypeDTO + +Re-exports [UpdatePriceSetRuleTypeDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdatePriceSetRuleTypeDTO.mdx) + +___ + +### UpdateProductCategoryDTO + +Re-exports [UpdateProductCategoryDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductCategoryDTO.mdx) + +___ + +### UpdateProductCollectionDTO + +Re-exports [UpdateProductCollectionDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductCollectionDTO.mdx) + +___ + +### UpdateProductDTO + +Re-exports [UpdateProductDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductDTO.mdx) + +___ + +### UpdateProductOptionDTO + +Re-exports [UpdateProductOptionDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductOptionDTO.mdx) + +___ + +### UpdateProductTagDTO + +Re-exports [UpdateProductTagDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductTagDTO.mdx) + +___ + +### UpdateProductTypeDTO + +Re-exports [UpdateProductTypeDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductTypeDTO.mdx) + +___ + +### UpdateProductVariantDTO + +Re-exports [UpdateProductVariantDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductVariantDTO.mdx) + +___ + +### UpdateProductVariantOnlyDTO + +Re-exports [UpdateProductVariantOnlyDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpdateProductVariantOnlyDTO.mdx) + +___ + +### UpdateReservationItemInput + +Re-exports [UpdateReservationItemInput](../../internal-1/modules/admin_discounts.internal.internal-1.InventoryTypes.mdx#updatereservationiteminput) + +___ + +### UpdateRuleTypeDTO + +Re-exports [UpdateRuleTypeDTO](../../PricingTypes/interfaces/admin_discounts.internal.internal-1.PricingTypes.UpdateRuleTypeDTO.mdx) + +___ + +### UpdateStockLocationInput + +Re-exports [UpdateStockLocationInput](../../internal-1/modules/admin_discounts.internal.internal-1.StockLocationTypes.mdx#updatestocklocationinput) + +___ + +### UploadStreamDescriptorType + +Re-exports [UploadStreamDescriptorType](../../admin_discounts/modules/admin_discounts.internal.mdx#uploadstreamdescriptortype) + +___ + +### UpsertProductTagDTO + +Re-exports [UpsertProductTagDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpsertProductTagDTO.mdx) + +___ + +### UpsertProductTypeDTO + +Re-exports [UpsertProductTypeDTO](../../ProductTypes/interfaces/admin_discounts.internal.internal-1.ProductTypes.UpsertProductTypeDTO.mdx) + +___ + +### WithRequiredProperty + +Re-exports [WithRequiredProperty](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx#withrequiredproperty) + +___ + +### Writable + +Re-exports [Writable](../../internal-1/modules/admin_discounts.internal.internal-1.CommonTypes.mdx#writable) + +## Type Aliases + +### AddressDTO + + **AddressDTO**: `Object` + +#### Type declaration -Re-exports [UserRoles](../enums/admin_auth.internal.UserRoles.mdx) + \\| ``null``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "phone", + "type": "`string` \\| ``null``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "postal_code", + "type": "`string` \\| ``null``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "province", + "type": "`string` \\| ``null``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +___ + +### CartDTO + + **CartDTO**: `Object` + +#### Type declaration + +", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "customer_id", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "discount_total", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "email", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "gift_card_tax_total", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "gift_card_total", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "idempotency_key", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "item_tax_total", + "type": "`number` \\| ``null``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "metadata", + "type": "Record<`string`, `unknown`\\>", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "payment_authorized_at", + "type": "`Date`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "payment_id", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "raw_discount_total", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "refundable_amount", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "refunded_total", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "region_id", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "sales_channel_id", + "type": "`string` \\| ``null``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "shipping_address_id", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "shipping_tax_total", + "type": "`number` \\| ``null``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "shipping_total", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "subtotal", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "tax_total", + "type": "`number` \\| ``null``", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "total", + "type": "`number`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> + +___ + +### JoinerRelationship + + **JoinerRelationship**: `Object` + +#### Type declaration + +", + "description": "Extra arguments to pass to the remoteFetchData callback", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "foreignKey", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "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": "", + "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": "", + "children": [] + }, + { + "name": "isList", + "type": "`boolean`", + "description": "Force the relationship to return a list", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "primaryKey", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "serviceName", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +___ + +### SharedContext + + **SharedContext**: `Object` + +#### Type declaration + + diff --git a/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal-2.mdx b/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal-2.mdx index f2bbb3c7d862b..8082cfccbdda9 100644 --- a/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal-2.mdx +++ b/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal-2.mdx @@ -8,1736 +8,638 @@ import ParameterTypes from "@site/src/components/ParameterTypes" [admin/discounts](../../modules/admin_discounts.mdx).[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).internal -## Namespaces +## References -- [finished](../../internal-2/modules/admin_discounts.internal.internal-2.finished.mdx) -- [pipeline](../../internal-2/modules/admin_discounts.internal.internal-2.pipeline.mdx) +### Address -## Classes +Re-exports [Address](../classes/admin_collections.internal.Address.mdx) -- [Writable](../../internal-2/classes/admin_discounts.internal.internal-2.Writable.mdx) +___ -## Interfaces +### AllocationType -- [FinishedOptions](../../internal-2/interfaces/admin_discounts.internal.internal-2.FinishedOptions.mdx) -- [Pipe](../../internal-2/interfaces/admin_discounts.internal.internal-2.Pipe.mdx) -- [PipelineOptions](../../internal-2/interfaces/admin_discounts.internal.internal-2.PipelineOptions.mdx) -- [ReadableOptions](../../internal-2/interfaces/admin_discounts.internal.internal-2.ReadableOptions.mdx) -- [StreamOptions](../../internal-2/interfaces/admin_discounts.internal.internal-2.StreamOptions.mdx) -- [WritableOptions](../../internal-2/interfaces/admin_discounts.internal.internal-2.WritableOptions.mdx) +Re-exports [AllocationType](../enums/admin_collections.internal.AllocationType.mdx) -## References +___ + +### AnalyticsConfig + +Re-exports [AnalyticsConfig](../classes/admin_discounts.internal.internal.AnalyticsConfig.mdx) + +___ + +### BatchJob + +Re-exports [BatchJob](../classes/admin_batch_jobs.internal.BatchJob.mdx) + +___ + +### Cart + +Re-exports [Cart](../classes/admin_collections.internal.Cart.mdx) + +___ + +### CartType + +Re-exports [CartType](../enums/admin_collections.internal.CartType.mdx) + +___ + +### ClaimFulfillmentStatus + +Re-exports [ClaimFulfillmentStatus](../enums/admin_collections.internal.ClaimFulfillmentStatus.mdx) + +___ + +### ClaimImage + +Re-exports [ClaimImage](../classes/admin_collections.internal.ClaimImage.mdx) + +___ + +### ClaimItem + +Re-exports [ClaimItem](../classes/admin_collections.internal.ClaimItem.mdx) + +___ + +### ClaimOrder + +Re-exports [ClaimOrder](../classes/admin_collections.internal.ClaimOrder.mdx) + +___ + +### ClaimPaymentStatus + +Re-exports [ClaimPaymentStatus](../enums/admin_collections.internal.ClaimPaymentStatus.mdx) + +___ + +### ClaimReason + +Re-exports [ClaimReason](../enums/admin_collections.internal.ClaimReason.mdx) + +___ + +### ClaimTag + +Re-exports [ClaimTag](../classes/admin_collections.internal.ClaimTag.mdx) + +___ + +### ClaimType + +Re-exports [ClaimType](../enums/admin_collections.internal.ClaimType.mdx) + +___ + +### Country + +Re-exports [Country](../classes/admin_collections.internal.Country.mdx) + +___ + +### Currency + +Re-exports [Currency](../classes/admin_collections.internal.Currency.mdx) + +___ + +### CustomShippingOption + +Re-exports [CustomShippingOption](../classes/admin_discounts.internal.internal.CustomShippingOption.mdx) + +___ + +### Customer + +Re-exports [Customer](../classes/admin_collections.internal.Customer.mdx) + +___ + +### CustomerGroup + +Re-exports [CustomerGroup](../classes/admin_collections.internal.CustomerGroup.mdx) + +___ + +### Discount + +Re-exports [Discount](../classes/admin_collections.internal.Discount.mdx) + +___ + +### DiscountCondition + +Re-exports [DiscountCondition](../classes/admin_collections.internal.DiscountCondition.mdx) + +___ + +### DiscountConditionCustomerGroup + +Re-exports [DiscountConditionCustomerGroup](../classes/admin_discounts.internal.internal.DiscountConditionCustomerGroup.mdx) + +___ + +### DiscountConditionOperator + +Re-exports [DiscountConditionOperator](../enums/admin_collections.internal.DiscountConditionOperator.mdx) + +___ + +### DiscountConditionProduct + +Re-exports [DiscountConditionProduct](../classes/admin_discounts.internal.internal.DiscountConditionProduct.mdx) + +___ + +### DiscountConditionProductCollection + +Re-exports [DiscountConditionProductCollection](../classes/admin_discounts.internal.internal.DiscountConditionProductCollection.mdx) + +___ + +### DiscountConditionProductTag + +Re-exports [DiscountConditionProductTag](../classes/admin_discounts.internal.internal.DiscountConditionProductTag.mdx) + +___ + +### DiscountConditionProductType + +Re-exports [DiscountConditionProductType](../classes/admin_discounts.internal.internal.DiscountConditionProductType.mdx) + +___ + +### DiscountConditionType + +Re-exports [DiscountConditionType](../enums/admin_collections.internal.DiscountConditionType.mdx) + +___ + +### DiscountRule + +Re-exports [DiscountRule](../classes/admin_collections.internal.DiscountRule.mdx) + +___ + +### DiscountRuleType + +Re-exports [DiscountRuleType](../enums/admin_collections.internal.DiscountRuleType.mdx) + +___ + +### DraftOrder + +Re-exports [DraftOrder](../classes/admin_collections.internal.DraftOrder.mdx) + +___ + +### DraftOrderStatus + +Re-exports [DraftOrderStatus](../enums/admin_collections.internal.DraftOrderStatus.mdx) + +___ + +### Fulfillment + +Re-exports [Fulfillment](../classes/admin_collections.internal.Fulfillment.mdx) + +___ + +### FulfillmentItem + +Re-exports [FulfillmentItem](../classes/admin_collections.internal.FulfillmentItem.mdx) + +___ + +### FulfillmentProvider + +Re-exports [FulfillmentProvider](../classes/admin_collections.internal.FulfillmentProvider.mdx) + +___ + +### FulfillmentStatus + +Re-exports [FulfillmentStatus](../enums/admin_collections.internal.FulfillmentStatus.mdx) + +___ + +### GiftCard + +Re-exports [GiftCard](../classes/admin_collections.internal.GiftCard.mdx) + +___ + +### GiftCardTransaction + +Re-exports [GiftCardTransaction](../classes/admin_collections.internal.GiftCardTransaction.mdx) + +___ -### Duplex +### IdempotencyKey -Re-exports [Duplex](../classes/admin_discounts.internal.Duplex.mdx) +Re-exports [IdempotencyKey](../classes/admin_discounts.internal.internal.IdempotencyKey.mdx) ___ -### DuplexOptions +### Image -Re-exports [DuplexOptions](../interfaces/admin_discounts.internal.DuplexOptions.mdx) +Re-exports [Image](../classes/admin_collections.internal.Image.mdx) ___ -### PassThrough +### Invite -Re-exports [PassThrough](../classes/admin_discounts.internal.PassThrough.mdx) +Re-exports [Invite](../classes/admin_discounts.internal.internal.Invite.mdx) ___ -### Readable +### LineItem -Re-exports [Readable](../classes/admin_discounts.internal.Readable.mdx) +Re-exports [LineItem](../classes/admin_collections.internal.LineItem.mdx) ___ -### Stream +### LineItemAdjustment -Re-exports [Stream](../classes/admin_discounts.internal.Stream.mdx) +Re-exports [LineItemAdjustment](../classes/admin_collections.internal.LineItemAdjustment.mdx) ___ -### Transform +### LineItemTaxLine -Re-exports [Transform](../classes/admin_discounts.internal.Transform.mdx) +Re-exports [LineItemTaxLine](../classes/admin_collections.internal.LineItemTaxLine.mdx) ___ -### TransformCallback +### MoneyAmount -Re-exports [TransformCallback](../../admin_discounts/modules/admin_discounts.internal.mdx#transformcallback) +Re-exports [MoneyAmount](../classes/admin_collections.internal.MoneyAmount.mdx) ___ -### TransformOptions +### Note -Re-exports [TransformOptions](../interfaces/admin_discounts.internal.TransformOptions.mdx) +Re-exports [Note](../classes/admin_discounts.internal.internal.Note.mdx) -## Type Aliases +___ + +### Notification + +Re-exports [Notification](../classes/admin_discounts.internal.internal.Notification.mdx) + +___ + +### Oauth + +Re-exports [Oauth](../classes/admin_discounts.internal.internal.Oauth.mdx) + +___ + +### Order + +Re-exports [Order](../classes/admin_collections.internal.Order.mdx) + +___ + +### OrderEdit + +Re-exports [OrderEdit](../classes/admin_collections.internal.OrderEdit.mdx) + +___ + +### OrderEditItemChangeType + +Re-exports [OrderEditItemChangeType](../enums/admin_collections.internal.OrderEditItemChangeType.mdx) + +___ + +### OrderEditStatus + +Re-exports [OrderEditStatus](../enums/admin_collections.internal.OrderEditStatus.mdx) + +___ + +### OrderItemChange + +Re-exports [OrderItemChange](../classes/admin_collections.internal.OrderItemChange.mdx) + +___ + +### OrderStatus + +Re-exports [OrderStatus](../enums/admin_collections.internal.OrderStatus.mdx) + +___ + +### Payment + +Re-exports [Payment](../classes/admin_collections.internal.Payment.mdx) + +___ + +### PaymentCollection + +Re-exports [PaymentCollection](../classes/admin_collections.internal.PaymentCollection.mdx) + +___ + +### PaymentCollectionStatus + +Re-exports [PaymentCollectionStatus](../enums/admin_collections.internal.PaymentCollectionStatus.mdx) + +___ + +### PaymentCollectionType + +Re-exports [PaymentCollectionType](../enums/admin_discounts.internal.internal.PaymentCollectionType.mdx) + +___ + +### PaymentProvider + +Re-exports [PaymentProvider](../classes/admin_collections.internal.PaymentProvider.mdx) + +___ + +### PaymentSession + +Re-exports [PaymentSession](../classes/admin_collections.internal.PaymentSession.mdx) + +___ + +### PaymentSessionStatus + +Re-exports [PaymentSessionStatus](../enums/admin_discounts.internal.internal.PaymentSessionStatus.mdx) + +___ + +### PaymentStatus + +Re-exports [PaymentStatus](../enums/admin_collections.internal.PaymentStatus.mdx) + +___ + +### PriceList + +Re-exports [PriceList](../classes/admin_collections.internal.PriceList.mdx) + +___ + +### Product + +Re-exports [Product](../classes/admin_collections.internal.Product.mdx) + +___ + +### ProductCategory -### PipelineCallback +Re-exports [ProductCategory](../classes/admin_collections.internal.ProductCategory.mdx) - **PipelineCallback**<`S`\>: `S` extends [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`any`, infer P\> ? (`err`: [`ErrnoException`](../interfaces/admin_discounts.internal.ErrnoException.mdx) \| ``null``, `value`: `P`) => `void` : (`err`: [`ErrnoException`](../interfaces/admin_discounts.internal.ErrnoException.mdx) \| ``null``) => `void` +___ + +### ProductCollection + +Re-exports [ProductCollection](../classes/admin_collections.internal.ProductCollection.mdx) + +___ + +### ProductOption + +Re-exports [ProductOption](../classes/admin_collections.internal.ProductOption.mdx) + +___ + +### ProductOptionValue + +Re-exports [ProductOptionValue](../classes/admin_collections.internal.ProductOptionValue.mdx) + +___ + +### ProductStatus + +Re-exports [ProductStatus](../enums/admin_collections.internal.ProductStatus.mdx) + +___ + +### ProductTag + +Re-exports [ProductTag](../classes/admin_collections.internal.ProductTag.mdx) + +___ + +### ProductTaxRate + +Re-exports [ProductTaxRate](../classes/admin_discounts.internal.internal.ProductTaxRate.mdx) + +___ + +### ProductType + +Re-exports [ProductType](../classes/admin_collections.internal.ProductType.mdx) + +___ + +### ProductTypeTaxRate + +Re-exports [ProductTypeTaxRate](../classes/admin_discounts.internal.internal.ProductTypeTaxRate.mdx) + +___ + +### ProductVariant + +Re-exports [ProductVariant](../classes/admin_collections.internal.ProductVariant.mdx) + +___ -#### Type parameters +### ProductVariantInventoryItem -", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } -]} /> +Re-exports [ProductVariantInventoryItem](../classes/admin_collections.internal.ProductVariantInventoryItem.mdx) ___ -### PipelineDestination +### ProductVariantMoneyAmount - **PipelineDestination**<`S`, `P`\>: `S` extends [`PipelineTransformSource`](admin_discounts.internal.internal-2.mdx#pipelinetransformsource) ? [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`ST`\> \| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`ST`, `P`\> : `never` +Re-exports [ProductVariantMoneyAmount](../classes/admin_discounts.internal.internal.ProductVariantMoneyAmount.mdx) -#### Type parameters +___ + +### PublishableApiKey -", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "P", - "type": "`object`", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } -]} /> +Re-exports [PublishableApiKey](../classes/admin_discounts.internal.internal.PublishableApiKey.mdx) ___ -### PipelineDestinationIterableFunction +### PublishableApiKeySalesChannel - **PipelineDestinationIterableFunction**<`T`\>: (`source`: [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`T`\>) => [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`any`\> +Re-exports [PublishableApiKeySalesChannel](../classes/admin_discounts.internal.internal.PublishableApiKeySalesChannel.mdx) -#### Type parameters +___ - +### Refund -#### Type declaration +Re-exports [Refund](../classes/admin_collections.internal.Refund.mdx) + +___ -(`source`): [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`any`\> +### RefundReason -##### Parameters +Re-exports [RefundReason](../enums/admin_discounts.internal.internal.RefundReason.mdx) -", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } -]} /> +___ -##### Returns +### Region -[`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`any`\> +Re-exports [Region](../classes/admin_collections.internal.Region.mdx) -", - "optional": false, - "defaultValue": "", - "description": "", - "children": [ - { - "name": "any", - "type": "`any`", - "optional": true, - "defaultValue": "", - "description": "", - "children": [] - } - ] - } -]} /> - -___ - -### PipelineDestinationPromiseFunction - - **PipelineDestinationPromiseFunction**<`T`, `P`\>: (`source`: [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`T`\>) => `Promise`<`P`\> +___ -#### Type parameters +### RequirementType - - -#### Type declaration - -(`source`): `Promise`<`P`\> - -##### Parameters - -", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } -]} /> +Re-exports [RequirementType](../enums/admin_collections.internal.RequirementType.mdx) -##### Returns +___ -`Promise`<`P`\> +### Return -", - "optional": false, - "defaultValue": "", - "description": "", - "children": [] - } -]} /> - -___ - -### PipelinePromise - - **PipelinePromise**<`S`\>: `S` extends [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`any`, infer P\> ? `Promise`<`P`\> : `Promise`<`void`\> - -#### Type parameters - -", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } -]} /> +Re-exports [Return](../classes/admin_collections.internal.Return.mdx) -___ - -### PipelineSource - - **PipelineSource**<`T`\>: [`Iterable`](../interfaces/admin_discounts.internal.Iterable.mdx)<`T`\> \| [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`T`\> \| [`ReadableStream`](../interfaces/admin_discounts.internal.ReadableStream.mdx) \| [`PipelineSourceFunction`](admin_discounts.internal.internal-2.mdx#pipelinesourcefunction)<`T`\> +___ -#### Type parameters +### ReturnItem - +Re-exports [ReturnItem](../classes/admin_collections.internal.ReturnItem.mdx) ___ -### PipelineSourceFunction +### ReturnReason - **PipelineSourceFunction**<`T`\>: () => [`Iterable`](../interfaces/admin_discounts.internal.Iterable.mdx)<`T`\> \| [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`T`\> +Re-exports [ReturnReason](../classes/admin_collections.internal.ReturnReason.mdx) -#### Type parameters +___ - +### ReturnStatus -#### Type declaration +Re-exports [ReturnStatus](../enums/admin_collections.internal.ReturnStatus.mdx) -(): [`Iterable`](../interfaces/admin_discounts.internal.Iterable.mdx)<`T`\> \| [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`T`\> +___ + +### SalesChannel -##### Returns +Re-exports [SalesChannel](../classes/admin_collections.internal.SalesChannel.mdx) -[`Iterable`](../interfaces/admin_discounts.internal.Iterable.mdx)<`T`\> \| [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`T`\> +___ - \\| AsyncIterable", - "type": "[`Iterable`](../interfaces/admin_discounts.internal.Iterable.mdx)<`T`\\> \\| [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`T`\\>", - "optional": true, - "defaultValue": "", - "description": "", - "children": [] - } -]} /> +### SalesChannelLocation + +Re-exports [SalesChannelLocation](../classes/admin_collections.internal.SalesChannelLocation.mdx) ___ -### PipelineTransform +### ShippingMethod - **PipelineTransform**<`S`, `U`\>: [`ReadWriteStream`](../interfaces/admin_discounts.internal.ReadWriteStream.mdx) \| (`source`: `S` extends (...`args`: `any`[]) => [`Iterable`](../interfaces/admin_discounts.internal.Iterable.mdx) \| [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx) ? [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`ST`\> : `S`) => [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`U`\> +Re-exports [ShippingMethod](../classes/admin_collections.internal.ShippingMethod.mdx) -#### Type parameters +___ -", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "U", - "type": "`object`", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } -]} /> +### ShippingMethodTaxLine + +Re-exports [ShippingMethodTaxLine](../classes/admin_collections.internal.ShippingMethodTaxLine.mdx) ___ -### PipelineTransformSource +### ShippingOption - **PipelineTransformSource**<`T`\>: [`PipelineSource`](admin_discounts.internal.internal-2.mdx#pipelinesource)<`T`\> \| [`PipelineTransform`](admin_discounts.internal.internal-2.mdx#pipelinetransform)<`any`, `T`\> +Re-exports [ShippingOption](../classes/admin_collections.internal.ShippingOption.mdx) -#### Type parameters +___ - +### ShippingOptionPriceType -## Variables - -### consumers - - `Const` **consumers**: typeof [`internal`](admin_discounts.internal.internal-4.mdx) - -___ - -### promises - - `Const` **promises**: typeof [`internal`](admin_discounts.internal.internal-3.mdx) - -## Functions - -### addAbortSignal - -**addAbortSignal**<`T`\>(`signal`, `stream`): `T` - -A stream to attach a signal to. - -Attaches an AbortSignal to a readable or writeable stream. This lets code -control stream destruction using an `AbortController`. - -Calling `abort` on the `AbortController` corresponding to the passed`AbortSignal` will behave the same way as calling `.destroy(new AbortError())`on the stream, and `controller.error(new -AbortError())` for webstreams. - -```js -const fs = require('node:fs'); - -const controller = new AbortController(); -const read = addAbortSignal( - controller.signal, - fs.createReadStream(('object.json')), -); -// Later, abort the operation closing the stream -controller.abort(); -``` - -Or using an `AbortSignal` with a readable stream as an async iterable: - -```js -const controller = new AbortController(); -setTimeout(() => controller.abort(), 10_000); // set a timeout -const stream = addAbortSignal( - controller.signal, - fs.createReadStream(('object.json')), -); -(async () => { - try { - for await (const chunk of stream) { - await process(chunk); - } - } catch (e) { - if (e.name === 'AbortError') { - // The operation was cancelled - } else { - throw e; - } - } -})(); -``` - -Or using an `AbortSignal` with a ReadableStream: - -```js -const controller = new AbortController(); -const rs = new ReadableStream({ - start(controller) { - controller.enqueue('hello'); - controller.enqueue('world'); - controller.close(); - }, -}); +Re-exports [ShippingOptionPriceType](../enums/admin_collections.internal.ShippingOptionPriceType.mdx) -addAbortSignal(controller.signal, rs); +___ -finished(rs, (err) => { - if (err) { - if (err.name === 'AbortError') { - // The operation was cancelled - } - } -}); +### ShippingOptionRequirement -const reader = rs.getReader(); - -reader.read().then(({ value, done }) => { - console.log(value); // hello - console.log(done); // false - controller.abort(); -}); -``` - - - -#### Parameters - - - -#### Returns - -`T` - - - -#### Since - -v15.4.0 - -___ - -### finished - -**finished**(`stream`, `options`, `callback`): () => `void` - -A readable and/or writable stream/webstream. - -A function to get notified when a stream is no longer readable, writable -or has experienced an error or a premature close event. - -```js -const { finished } = require('node:stream'); -const fs = require('node:fs'); - -const rs = fs.createReadStream('archive.tar'); - -finished(rs, (err) => { - if (err) { - console.error('Stream failed.', err); - } else { - console.log('Stream is done reading.'); - } -}); - -rs.resume(); // Drain the stream. -``` - -Especially useful in error handling scenarios where a stream is destroyed -prematurely (like an aborted HTTP request), and will not emit `'end'`or `'finish'`. - -The `finished` API provides `promise version`. - -`stream.finished()` leaves dangling event listeners (in particular`'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been -invoked. The reason for this is so that unexpected `'error'` events (due to -incorrect stream implementations) do not cause unexpected crashes. -If this is unwanted behavior then the returned cleanup function needs to be -invoked in the callback: - -```js -const cleanup = finished(rs, (err) => { - cleanup(); - // ... -}); -``` - -#### Parameters - - `void`", - "description": "A callback function that takes an optional error argument.", - "optional": false, - "defaultValue": "", - "children": [] - } -]} /> - -#### Returns - -`fn` - - `void`", - "type": "() => `void`", - "optional": true, - "defaultValue": "", - "description": "A cleanup function which removes all registered listeners.", - "children": [] - } -]} /> - -(): `void` - -##### Returns - -`void` - - - -#### Since - -v10.0.0 - -**finished**(`stream`, `callback`): () => `void` - -#### Parameters - - `void`", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } -]} /> - -#### Returns - -`fn` - - `void`", - "type": "() => `void`", - "optional": true, - "defaultValue": "", - "description": "", - "children": [] - } -]} /> - -(): `void` - -##### Returns - -`void` - - +Re-exports [ShippingOptionRequirement](../classes/admin_collections.internal.ShippingOptionRequirement.mdx) ___ -### getDefaultHighWaterMark +### ShippingProfile -**getDefaultHighWaterMark**(`objectMode`): `number` +Re-exports [ShippingProfile](../classes/admin_collections.internal.ShippingProfile.mdx) -Returns the default highWaterMark used by streams. -Defaults to `16384` (16 KiB), or `16` for `objectMode`. +___ -#### Parameters +### ShippingProfileType - +Re-exports [ShippingProfileType](../enums/admin_collections.internal.ShippingProfileType.mdx) -#### Returns +___ + +### ShippingTaxRate + +Re-exports [ShippingTaxRate](../classes/admin_discounts.internal.internal.ShippingTaxRate.mdx) + +___ + +### StagedJob + +Re-exports [StagedJob](../classes/admin_discounts.internal.internal.StagedJob.mdx) + +___ -`number` +### Store - +Re-exports [Store](../classes/admin_discounts.internal.internal.Store.mdx) -#### Since +___ + +### Swap -v19.9.0 +Re-exports [Swap](../classes/admin_collections.internal.Swap.mdx) ___ -### isErrored +### SwapFulfillmentStatus -**isErrored**(`stream`): `boolean` +Re-exports [SwapFulfillmentStatus](../enums/admin_collections.internal.SwapFulfillmentStatus.mdx) -Returns whether the stream has encountered an error. +___ -#### Parameters +### SwapPaymentStatus - +Re-exports [SwapPaymentStatus](../enums/admin_collections.internal.SwapPaymentStatus.mdx) -#### Returns +___ -`boolean` +### TaxProvider - +Re-exports [TaxProvider](../classes/admin_collections.internal.TaxProvider.mdx) -#### Since +___ -v17.3.0, v16.14.0 +### TaxRate + +Re-exports [TaxRate](../classes/admin_collections.internal.TaxRate.mdx) ___ -### isReadable +### TrackingLink + +Re-exports [TrackingLink](../classes/admin_collections.internal.TrackingLink.mdx) -**isReadable**(`stream`): `boolean` +___ -Returns whether the stream is readable. +### User -#### Parameters +Re-exports [User](../classes/admin_auth.internal.User.mdx) - +___ -#### Returns +### UserRoles -`boolean` - - - -#### Since - -v17.4.0, v16.14.0 - -___ - -### pipeline - -**pipeline**<`A`, `B`\>(`source`, `destination`, `callback?`): `B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) - -A module method to pipe between streams and generators forwarding errors and -properly cleaning up and provide a callback when the pipeline is complete. - -```js -const { pipeline } = require('node:stream'); -const fs = require('node:fs'); -const zlib = require('node:zlib'); - -// Use the pipeline API to easily pipe a series of streams -// together and get notified when the pipeline is fully done. - -// A pipeline to gzip a potentially huge tar file efficiently: - -pipeline( - fs.createReadStream('archive.tar'), - zlib.createGzip(), - fs.createWriteStream('archive.tar.gz'), - (err) => { - if (err) { - console.error('Pipeline failed.', err); - } else { - console.log('Pipeline succeeded.'); - } - }, -); -``` - -The `pipeline` API provides a `promise version`. - -`stream.pipeline()` will call `stream.destroy(err)` on all streams except: - -* `Readable` streams which have emitted `'end'` or `'close'`. -* `Writable` streams which have emitted `'finish'` or `'close'`. - -`stream.pipeline()` leaves dangling event listeners on the streams -after the `callback` has been invoked. In the case of reuse of streams after -failure, this can cause event listener leaks and swallowed errors. If the last -stream is readable, dangling event listeners will be removed so that the last -stream can be consumed later. - -`stream.pipeline()` closes all the streams when an error is raised. -The `IncomingRequest` usage with `pipeline` could lead to an unexpected behavior -once it would destroy the socket without sending the expected response. -See the example below: - -```js -const fs = require('node:fs'); -const http = require('node:http'); -const { pipeline } = require('node:stream'); - -const server = http.createServer((req, res) => { - const fileStream = fs.createReadStream('./fileNotExist.txt'); - pipeline(fileStream, res, (err) => { - if (err) { - console.log(err); // No such file - // this message can't be sent once `pipeline` already destroyed the socket - return res.end('error!!!'); - } - }); -}); -``` - -", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "B", - "type": "[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } -]} /> - -#### Parameters - -", - "description": "Called when the pipeline is fully done.", - "optional": true, - "defaultValue": "", - "children": [] - } -]} /> - -#### Returns - -`B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) - - - -#### Since - -v10.0.0 - -**pipeline**<`A`, `T1`, `B`\>(`source`, `transform1`, `destination`, `callback?`): `B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) - -", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "T1", - "type": "[`PipelineTransform`](admin_discounts.internal.internal-2.mdx#pipelinetransform)<`A`, `any`\\>", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "B", - "type": "[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } -]} /> - -#### Parameters - -", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - } -]} /> - -#### Returns - -`B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) - - - -**pipeline**<`A`, `T1`, `T2`, `B`\>(`source`, `transform1`, `transform2`, `destination`, `callback?`): `B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) - -", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "T1", - "type": "[`PipelineTransform`](admin_discounts.internal.internal-2.mdx#pipelinetransform)<`A`, `any`\\>", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "T2", - "type": "[`PipelineTransform`](admin_discounts.internal.internal-2.mdx#pipelinetransform)<`T1`, `any`\\>", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "B", - "type": "[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } -]} /> - -#### Parameters - -", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - } -]} /> - -#### Returns - -`B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) - - - -**pipeline**<`A`, `T1`, `T2`, `T3`, `B`\>(`source`, `transform1`, `transform2`, `transform3`, `destination`, `callback?`): `B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) - -", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "T1", - "type": "[`PipelineTransform`](admin_discounts.internal.internal-2.mdx#pipelinetransform)<`A`, `any`\\>", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "T2", - "type": "[`PipelineTransform`](admin_discounts.internal.internal-2.mdx#pipelinetransform)<`T1`, `any`\\>", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "T3", - "type": "[`PipelineTransform`](admin_discounts.internal.internal-2.mdx#pipelinetransform)<`T2`, `any`\\>", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "B", - "type": "[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } -]} /> - -#### Parameters - -", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - } -]} /> - -#### Returns - -`B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) - - - -**pipeline**<`A`, `T1`, `T2`, `T3`, `T4`, `B`\>(`source`, `transform1`, `transform2`, `transform3`, `transform4`, `destination`, `callback?`): `B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) - -", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "T1", - "type": "[`PipelineTransform`](admin_discounts.internal.internal-2.mdx#pipelinetransform)<`A`, `any`\\>", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "T2", - "type": "[`PipelineTransform`](admin_discounts.internal.internal-2.mdx#pipelinetransform)<`T1`, `any`\\>", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "T3", - "type": "[`PipelineTransform`](admin_discounts.internal.internal-2.mdx#pipelinetransform)<`T2`, `any`\\>", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "T4", - "type": "[`PipelineTransform`](admin_discounts.internal.internal-2.mdx#pipelinetransform)<`T3`, `any`\\>", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "B", - "type": "[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } -]} /> - -#### Parameters - -", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - } -]} /> - -#### Returns - -`B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) - - - -**pipeline**(`streams`, `callback?`): [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) - -#### Parameters - - `void`", - "description": "", - "optional": true, - "defaultValue": "", - "children": [] - } -]} /> - -#### Returns - -[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) - - `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "emit", - "type": "(`eventName`: `string` \\| `symbol`, ...`args`: `any`[]) => `boolean`", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "end", - "type": "(`cb?`: () => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)(`data`: `string` \\| `Uint8Array`, `cb?`: () => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)(`str`: `string`, `encoding?`: [`BufferEncoding`](../../admin_discounts/modules/admin_discounts.internal.mdx#bufferencoding), `cb?`: () => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "eventNames", - "type": "() => (`string` \\| `symbol`)[]", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "getMaxListeners", - "type": "() => `number`", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "listenerCount", - "type": "(`eventName`: `string` \\| `symbol`, `listener?`: `Function`) => `number`", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "listeners", - "type": "(`eventName`: `string` \\| `symbol`) => `Function`[]", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "off", - "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "on", - "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "once", - "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "prependListener", - "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "prependOnceListener", - "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "rawListeners", - "type": "(`eventName`: `string` \\| `symbol`) => `Function`[]", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "removeAllListeners", - "type": "(`event?`: `string` \\| `symbol`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "removeListener", - "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "setMaxListeners", - "type": "(`n`: `number`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "write", - "type": "(`buffer`: `string` \\| `Uint8Array`, `cb?`: (`err?`: ``null`` \\| [`Error`](../../admin_discounts/modules/admin_discounts.internal.mdx#error)) => `void`) => `boolean`(`str`: `string`, `encoding?`: [`BufferEncoding`](../../admin_discounts/modules/admin_discounts.internal.mdx#bufferencoding), `cb?`: (`err?`: ``null`` \\| [`Error`](../../admin_discounts/modules/admin_discounts.internal.mdx#error)) => `void`) => `boolean`", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } -]} /> - -**pipeline**(`stream1`, `stream2`, `...streams`): [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) - -#### Parameters - - `void`)[]", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } -]} /> - -#### Returns - -[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) - - `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "emit", - "type": "(`eventName`: `string` \\| `symbol`, ...`args`: `any`[]) => `boolean`", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "end", - "type": "(`cb?`: () => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)(`data`: `string` \\| `Uint8Array`, `cb?`: () => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)(`str`: `string`, `encoding?`: [`BufferEncoding`](../../admin_discounts/modules/admin_discounts.internal.mdx#bufferencoding), `cb?`: () => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "eventNames", - "type": "() => (`string` \\| `symbol`)[]", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "getMaxListeners", - "type": "() => `number`", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "listenerCount", - "type": "(`eventName`: `string` \\| `symbol`, `listener?`: `Function`) => `number`", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "listeners", - "type": "(`eventName`: `string` \\| `symbol`) => `Function`[]", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "off", - "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "on", - "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "once", - "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "prependListener", - "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "prependOnceListener", - "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "rawListeners", - "type": "(`eventName`: `string` \\| `symbol`) => `Function`[]", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "removeAllListeners", - "type": "(`event?`: `string` \\| `symbol`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "removeListener", - "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "setMaxListeners", - "type": "(`n`: `number`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "write", - "type": "(`buffer`: `string` \\| `Uint8Array`, `cb?`: (`err?`: ``null`` \\| [`Error`](../../admin_discounts/modules/admin_discounts.internal.mdx#error)) => `void`) => `boolean`(`str`: `string`, `encoding?`: [`BufferEncoding`](../../admin_discounts/modules/admin_discounts.internal.mdx#bufferencoding), `cb?`: (`err?`: ``null`` \\| [`Error`](../../admin_discounts/modules/admin_discounts.internal.mdx#error)) => `void`) => `boolean`", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } -]} /> - -___ - -### setDefaultHighWaterMark - -**setDefaultHighWaterMark**(`objectMode`, `value`): `void` - -Sets the default highWaterMark used by streams. - -#### Parameters - - - -#### Returns - -`void` - - - -#### Since - -v19.9.0 +Re-exports [UserRoles](../enums/admin_auth.internal.UserRoles.mdx) diff --git a/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal-3.mdx b/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal-3.mdx index 74047f77d9bee..b60d500b41176 100644 --- a/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal-3.mdx +++ b/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal-3.mdx @@ -8,11 +8,539 @@ import ParameterTypes from "@site/src/components/ParameterTypes" [admin/discounts](../../modules/admin_discounts.mdx).[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).internal +## Namespaces + +- [finished](../../internal-3/modules/admin_discounts.internal.internal-3.finished.mdx) +- [pipeline](../../internal-3/modules/admin_discounts.internal.internal-3.pipeline.mdx) + +## Classes + +- [Writable](../../internal-3/classes/admin_discounts.internal.internal-3.Writable.mdx) + +## Interfaces + +- [FinishedOptions](../../internal-3/interfaces/admin_discounts.internal.internal-3.FinishedOptions.mdx) +- [Pipe](../../internal-3/interfaces/admin_discounts.internal.internal-3.Pipe.mdx) +- [PipelineOptions](../../internal-3/interfaces/admin_discounts.internal.internal-3.PipelineOptions.mdx) +- [ReadableOptions](../../internal-3/interfaces/admin_discounts.internal.internal-3.ReadableOptions.mdx) +- [StreamOptions](../../internal-3/interfaces/admin_discounts.internal.internal-3.StreamOptions.mdx) +- [WritableOptions](../../internal-3/interfaces/admin_discounts.internal.internal-3.WritableOptions.mdx) + +## References + +### Duplex + +Re-exports [Duplex](../classes/admin_discounts.internal.Duplex.mdx) + +___ + +### DuplexOptions + +Re-exports [DuplexOptions](../interfaces/admin_discounts.internal.DuplexOptions.mdx) + +___ + +### PassThrough + +Re-exports [PassThrough](../classes/admin_discounts.internal.PassThrough.mdx) + +___ + +### Readable + +Re-exports [Readable](../classes/admin_discounts.internal.Readable.mdx) + +___ + +### Stream + +Re-exports [Stream](../classes/admin_discounts.internal.Stream.mdx) + +___ + +### Transform + +Re-exports [Transform](../classes/admin_discounts.internal.Transform.mdx) + +___ + +### TransformCallback + +Re-exports [TransformCallback](../../admin_discounts/modules/admin_discounts.internal.mdx#transformcallback) + +___ + +### TransformOptions + +Re-exports [TransformOptions](../interfaces/admin_discounts.internal.TransformOptions.mdx) + +## Type Aliases + +### PipelineCallback + + **PipelineCallback**<`S`\>: `S` extends [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`any`, infer P\> ? (`err`: [`ErrnoException`](../interfaces/admin_discounts.internal.ErrnoException.mdx) \| ``null``, `value`: `P`) => `void` : (`err`: [`ErrnoException`](../interfaces/admin_discounts.internal.ErrnoException.mdx) \| ``null``) => `void` + +#### Type parameters + +", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +___ + +### PipelineDestination + + **PipelineDestination**<`S`, `P`\>: `S` extends [`PipelineTransformSource`](admin_discounts.internal.internal-3.mdx#pipelinetransformsource) ? [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`ST`\> \| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`ST`, `P`\> : `never` + +#### Type parameters + +", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "P", + "type": "`object`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +___ + +### PipelineDestinationIterableFunction + + **PipelineDestinationIterableFunction**<`T`\>: (`source`: [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`T`\>) => [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`any`\> + +#### Type parameters + + + +#### Type declaration + +(`source`): [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`any`\> + +##### Parameters + +", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +##### Returns + +[`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`any`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "any", + "type": "`any`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### PipelineDestinationPromiseFunction + + **PipelineDestinationPromiseFunction**<`T`, `P`\>: (`source`: [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`T`\>) => `Promise`<`P`\> + +#### Type parameters + + + +#### Type declaration + +(`source`): `Promise`<`P`\> + +##### Parameters + +", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +##### Returns + +`Promise`<`P`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } +]} /> + +___ + +### PipelinePromise + + **PipelinePromise**<`S`\>: `S` extends [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`any`, infer P\> ? `Promise`<`P`\> : `Promise`<`void`\> + +#### Type parameters + +", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +___ + +### PipelineSource + + **PipelineSource**<`T`\>: [`Iterable`](../interfaces/admin_discounts.internal.Iterable.mdx)<`T`\> \| [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`T`\> \| [`ReadableStream`](../interfaces/admin_discounts.internal.ReadableStream.mdx) \| [`PipelineSourceFunction`](admin_discounts.internal.internal-3.mdx#pipelinesourcefunction)<`T`\> + +#### Type parameters + + + +___ + +### PipelineSourceFunction + + **PipelineSourceFunction**<`T`\>: () => [`Iterable`](../interfaces/admin_discounts.internal.Iterable.mdx)<`T`\> \| [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`T`\> + +#### Type parameters + + + +#### Type declaration + +(): [`Iterable`](../interfaces/admin_discounts.internal.Iterable.mdx)<`T`\> \| [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`T`\> + +##### Returns + +[`Iterable`](../interfaces/admin_discounts.internal.Iterable.mdx)<`T`\> \| [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`T`\> + + \\| AsyncIterable", + "type": "[`Iterable`](../interfaces/admin_discounts.internal.Iterable.mdx)<`T`\\> \\| [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`T`\\>", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } +]} /> + +___ + +### PipelineTransform + + **PipelineTransform**<`S`, `U`\>: [`ReadWriteStream`](../interfaces/admin_discounts.internal.ReadWriteStream.mdx) \| (`source`: `S` extends (...`args`: `any`[]) => [`Iterable`](../interfaces/admin_discounts.internal.Iterable.mdx) \| [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx) ? [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`ST`\> : `S`) => [`AsyncIterable`](../interfaces/admin_discounts.internal.AsyncIterable.mdx)<`U`\> + +#### Type parameters + +", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "U", + "type": "`object`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +___ + +### PipelineTransformSource + + **PipelineTransformSource**<`T`\>: [`PipelineSource`](admin_discounts.internal.internal-3.mdx#pipelinesource)<`T`\> \| [`PipelineTransform`](admin_discounts.internal.internal-3.mdx#pipelinetransform)<`any`, `T`\> + +#### Type parameters + + + +## Variables + +### consumers + + `Const` **consumers**: typeof [`internal`](admin_discounts.internal.internal-5.mdx) + +___ + +### promises + + `Const` **promises**: typeof [`internal`](admin_discounts.internal.internal-4.mdx) + ## Functions +### addAbortSignal + +**addAbortSignal**<`T`\>(`signal`, `stream`): `T` + +A stream to attach a signal to. + +Attaches an AbortSignal to a readable or writeable stream. This lets code +control stream destruction using an `AbortController`. + +Calling `abort` on the `AbortController` corresponding to the passed`AbortSignal` will behave the same way as calling `.destroy(new AbortError())`on the stream, and `controller.error(new +AbortError())` for webstreams. + +```js +const fs = require('node:fs'); + +const controller = new AbortController(); +const read = addAbortSignal( + controller.signal, + fs.createReadStream(('object.json')), +); +// Later, abort the operation closing the stream +controller.abort(); +``` + +Or using an `AbortSignal` with a readable stream as an async iterable: + +```js +const controller = new AbortController(); +setTimeout(() => controller.abort(), 10_000); // set a timeout +const stream = addAbortSignal( + controller.signal, + fs.createReadStream(('object.json')), +); +(async () => { + try { + for await (const chunk of stream) { + await process(chunk); + } + } catch (e) { + if (e.name === 'AbortError') { + // The operation was cancelled + } else { + throw e; + } + } +})(); +``` + +Or using an `AbortSignal` with a ReadableStream: + +```js +const controller = new AbortController(); +const rs = new ReadableStream({ + start(controller) { + controller.enqueue('hello'); + controller.enqueue('world'); + controller.close(); + }, +}); + +addAbortSignal(controller.signal, rs); + +finished(rs, (err) => { + if (err) { + if (err.name === 'AbortError') { + // The operation was cancelled + } + } +}); + +const reader = rs.getReader(); + +reader.read().then(({ value, done }) => { + console.log(value); // hello + console.log(done); // false + controller.abort(); +}); +``` + + + +#### Parameters + + + +#### Returns + +`T` + + + +#### Since + +v15.4.0 + +___ + ### finished -**finished**(`stream`, `options?`): `Promise`<`void`\> +**finished**(`stream`, `options`, `callback`): () => `void` + +A readable and/or writable stream/webstream. + +A function to get notified when a stream is no longer readable, writable +or has experienced an error or a premature close event. + +```js +const { finished } = require('node:stream'); +const fs = require('node:fs'); + +const rs = fs.createReadStream('archive.tar'); + +finished(rs, (err) => { + if (err) { + console.error('Stream failed.', err); + } else { + console.log('Stream is done reading.'); + } +}); + +rs.resume(); // Drain the stream. +``` + +Especially useful in error handling scenarios where a stream is destroyed +prematurely (like an aborted HTTP request), and will not emit `'end'`or `'finish'`. + +The `finished` API provides `promise version`. + +`stream.finished()` leaves dangling event listeners (in particular`'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been +invoked. The reason for this is so that unexpected `'error'` events (due to +incorrect stream implementations) do not cause unexpected crashes. +If this is unwanted behavior then the returned cleanup function needs to be +invoked in the callback: + +```js +const cleanup = finished(rs, (err) => { + cleanup(); + // ... +}); +``` #### Parameters @@ -20,46 +548,313 @@ import ParameterTypes from "@site/src/components/ParameterTypes" { "name": "stream", "type": "[`ReadableStream`](../interfaces/admin_discounts.internal.ReadableStream.mdx) \\| [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`ReadWriteStream`](../interfaces/admin_discounts.internal.ReadWriteStream.mdx)", - "description": "", + "description": "A readable and/or writable stream.", "optional": false, "defaultValue": "", "children": [] }, { "name": "options", - "type": "[`FinishedOptions`](../../internal-2/interfaces/admin_discounts.internal.internal-2.FinishedOptions.mdx)", + "type": "[`FinishedOptions`](../../internal-3/interfaces/admin_discounts.internal.internal-3.FinishedOptions.mdx)", "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "callback", + "type": "(`err?`: ``null`` \\| [`ErrnoException`](../interfaces/admin_discounts.internal.ErrnoException.mdx)) => `void`", + "description": "A callback function that takes an optional error argument.", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`fn` + + `void`", + "type": "() => `void`", + "optional": true, + "defaultValue": "", + "description": "A cleanup function which removes all registered listeners.", + "children": [] + } +]} /> + +(): `void` + +##### Returns + +`void` + + + +#### Since + +v10.0.0 + +**finished**(`stream`, `callback`): () => `void` + +#### Parameters + + `void`", + "description": "", + "optional": false, + "defaultValue": "", "children": [] } ]} /> #### Returns -`Promise`<`void`\> +`fn` ", + "name": "() => `void`", + "type": "() => `void`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } +]} /> + +(): `void` + +##### Returns + +`void` + + + +___ + +### getDefaultHighWaterMark + +**getDefaultHighWaterMark**(`objectMode`): `number` + +Returns the default highWaterMark used by streams. +Defaults to `16384` (16 KiB), or `16` for `objectMode`. + +#### Parameters + + + +#### Returns + +`number` + + + +#### Since + +v19.9.0 + +___ + +### isErrored + +**isErrored**(`stream`): `boolean` + +Returns whether the stream has encountered an error. + +#### Parameters + + + +#### Returns + +`boolean` + + + +#### Since + +v17.3.0, v16.14.0 + +___ + +### isReadable + +**isReadable**(`stream`): `boolean` + +Returns whether the stream is readable. + +#### Parameters + + + +#### Returns + +`boolean` + + +#### Since + +v17.4.0, v16.14.0 + ___ ### pipeline -**pipeline**<`A`, `B`\>(`source`, `destination`, `options?`): [`PipelinePromise`](admin_discounts.internal.internal-2.mdx#pipelinepromise)<`B`\> +**pipeline**<`A`, `B`\>(`source`, `destination`, `callback?`): `B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) + +A module method to pipe between streams and generators forwarding errors and +properly cleaning up and provide a callback when the pipeline is complete. + +```js +const { pipeline } = require('node:stream'); +const fs = require('node:fs'); +const zlib = require('node:zlib'); + +// Use the pipeline API to easily pipe a series of streams +// together and get notified when the pipeline is fully done. + +// A pipeline to gzip a potentially huge tar file efficiently: + +pipeline( + fs.createReadStream('archive.tar'), + zlib.createGzip(), + fs.createWriteStream('archive.tar.gz'), + (err) => { + if (err) { + console.error('Pipeline failed.', err); + } else { + console.log('Pipeline succeeded.'); + } + }, +); +``` + +The `pipeline` API provides a `promise version`. + +`stream.pipeline()` will call `stream.destroy(err)` on all streams except: + +* `Readable` streams which have emitted `'end'` or `'close'`. +* `Writable` streams which have emitted `'finish'` or `'close'`. + +`stream.pipeline()` leaves dangling event listeners on the streams +after the `callback` has been invoked. In the case of reuse of streams after +failure, this can cause event listener leaks and swallowed errors. If the last +stream is readable, dangling event listeners will be removed so that the last +stream can be consumed later. + +`stream.pipeline()` closes all the streams when an error is raised. +The `IncomingRequest` usage with `pipeline` could lead to an unexpected behavior +once it would destroy the socket without sending the expected response. +See the example below: + +```js +const fs = require('node:fs'); +const http = require('node:http'); +const { pipeline } = require('node:stream'); + +const server = http.createServer((req, res) => { + const fileStream = fs.createReadStream('./fileNotExist.txt'); + pipeline(fileStream, res, (err) => { + if (err) { + console.log(err); // No such file + // this message can't be sent once `pipeline` already destroyed the socket + return res.end('error!!!'); + } + }); +}); +``` ", + "type": "[`PipelineSource`](admin_discounts.internal.internal-3.mdx#pipelinesource)<`any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -67,7 +862,7 @@ ___ }, { "name": "B", - "type": "[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", + "type": "[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -95,9 +890,9 @@ ___ "children": [] }, { - "name": "options", - "type": "[`PipelineOptions`](../../internal-2/interfaces/admin_discounts.internal.internal-2.PipelineOptions.mdx)", - "description": "", + "name": "callback", + "type": "[`PipelineCallback`](admin_discounts.internal.internal-3.mdx#pipelinecallback)<`B`\\>", + "description": "Called when the pipeline is fully done.", "optional": true, "defaultValue": "", "children": [] @@ -106,25 +901,29 @@ ___ #### Returns -[`PipelinePromise`](admin_discounts.internal.internal-2.mdx#pipelinepromise)<`B`\> +`B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ", - "optional": false, + "name": "`B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "type": "`B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "optional": true, "defaultValue": "", "description": "", "children": [] } ]} /> -**pipeline**<`A`, `T1`, `B`\>(`source`, `transform1`, `destination`, `options?`): [`PipelinePromise`](admin_discounts.internal.internal-2.mdx#pipelinepromise)<`B`\> +#### Since + +v10.0.0 + +**pipeline**<`A`, `T1`, `B`\>(`source`, `transform1`, `destination`, `callback?`): `B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ", + "type": "[`PipelineSource`](admin_discounts.internal.internal-3.mdx#pipelinesource)<`any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -132,7 +931,7 @@ ___ }, { "name": "T1", - "type": "[`PipelineTransform`](admin_discounts.internal.internal-2.mdx#pipelinetransform)<`A`, `any`\\>", + "type": "[`PipelineTransform`](admin_discounts.internal.internal-3.mdx#pipelinetransform)<`A`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -140,7 +939,7 @@ ___ }, { "name": "B", - "type": "[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", + "type": "[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -176,8 +975,8 @@ ___ "children": [] }, { - "name": "options", - "type": "[`PipelineOptions`](../../internal-2/interfaces/admin_discounts.internal.internal-2.PipelineOptions.mdx)", + "name": "callback", + "type": "[`PipelineCallback`](admin_discounts.internal.internal-3.mdx#pipelinecallback)<`B`\\>", "description": "", "optional": true, "defaultValue": "", @@ -187,25 +986,25 @@ ___ #### Returns -[`PipelinePromise`](admin_discounts.internal.internal-2.mdx#pipelinepromise)<`B`\> +`B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ", - "optional": false, + "name": "`B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "type": "`B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "optional": true, "defaultValue": "", "description": "", "children": [] } ]} /> -**pipeline**<`A`, `T1`, `T2`, `B`\>(`source`, `transform1`, `transform2`, `destination`, `options?`): [`PipelinePromise`](admin_discounts.internal.internal-2.mdx#pipelinepromise)<`B`\> +**pipeline**<`A`, `T1`, `T2`, `B`\>(`source`, `transform1`, `transform2`, `destination`, `callback?`): `B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ", + "type": "[`PipelineSource`](admin_discounts.internal.internal-3.mdx#pipelinesource)<`any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -213,7 +1012,7 @@ ___ }, { "name": "T1", - "type": "[`PipelineTransform`](admin_discounts.internal.internal-2.mdx#pipelinetransform)<`A`, `any`\\>", + "type": "[`PipelineTransform`](admin_discounts.internal.internal-3.mdx#pipelinetransform)<`A`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -221,7 +1020,7 @@ ___ }, { "name": "T2", - "type": "[`PipelineTransform`](admin_discounts.internal.internal-2.mdx#pipelinetransform)<`T1`, `any`\\>", + "type": "[`PipelineTransform`](admin_discounts.internal.internal-3.mdx#pipelinetransform)<`T1`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -229,7 +1028,7 @@ ___ }, { "name": "B", - "type": "[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", + "type": "[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -273,8 +1072,8 @@ ___ "children": [] }, { - "name": "options", - "type": "[`PipelineOptions`](../../internal-2/interfaces/admin_discounts.internal.internal-2.PipelineOptions.mdx)", + "name": "callback", + "type": "[`PipelineCallback`](admin_discounts.internal.internal-3.mdx#pipelinecallback)<`B`\\>", "description": "", "optional": true, "defaultValue": "", @@ -284,25 +1083,25 @@ ___ #### Returns -[`PipelinePromise`](admin_discounts.internal.internal-2.mdx#pipelinepromise)<`B`\> +`B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ", - "optional": false, + "name": "`B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "type": "`B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "optional": true, "defaultValue": "", "description": "", "children": [] } ]} /> -**pipeline**<`A`, `T1`, `T2`, `T3`, `B`\>(`source`, `transform1`, `transform2`, `transform3`, `destination`, `options?`): [`PipelinePromise`](admin_discounts.internal.internal-2.mdx#pipelinepromise)<`B`\> +**pipeline**<`A`, `T1`, `T2`, `T3`, `B`\>(`source`, `transform1`, `transform2`, `transform3`, `destination`, `callback?`): `B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ", + "type": "[`PipelineSource`](admin_discounts.internal.internal-3.mdx#pipelinesource)<`any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -310,7 +1109,7 @@ ___ }, { "name": "T1", - "type": "[`PipelineTransform`](admin_discounts.internal.internal-2.mdx#pipelinetransform)<`A`, `any`\\>", + "type": "[`PipelineTransform`](admin_discounts.internal.internal-3.mdx#pipelinetransform)<`A`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -318,7 +1117,7 @@ ___ }, { "name": "T2", - "type": "[`PipelineTransform`](admin_discounts.internal.internal-2.mdx#pipelinetransform)<`T1`, `any`\\>", + "type": "[`PipelineTransform`](admin_discounts.internal.internal-3.mdx#pipelinetransform)<`T1`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -326,7 +1125,7 @@ ___ }, { "name": "T3", - "type": "[`PipelineTransform`](admin_discounts.internal.internal-2.mdx#pipelinetransform)<`T2`, `any`\\>", + "type": "[`PipelineTransform`](admin_discounts.internal.internal-3.mdx#pipelinetransform)<`T2`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -334,7 +1133,7 @@ ___ }, { "name": "B", - "type": "[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", + "type": "[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -386,8 +1185,8 @@ ___ "children": [] }, { - "name": "options", - "type": "[`PipelineOptions`](../../internal-2/interfaces/admin_discounts.internal.internal-2.PipelineOptions.mdx)", + "name": "callback", + "type": "[`PipelineCallback`](admin_discounts.internal.internal-3.mdx#pipelinecallback)<`B`\\>", "description": "", "optional": true, "defaultValue": "", @@ -397,25 +1196,25 @@ ___ #### Returns -[`PipelinePromise`](admin_discounts.internal.internal-2.mdx#pipelinepromise)<`B`\> +`B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ", - "optional": false, + "name": "`B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "type": "`B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "optional": true, "defaultValue": "", "description": "", "children": [] } ]} /> -**pipeline**<`A`, `T1`, `T2`, `T3`, `T4`, `B`\>(`source`, `transform1`, `transform2`, `transform3`, `transform4`, `destination`, `options?`): [`PipelinePromise`](admin_discounts.internal.internal-2.mdx#pipelinepromise)<`B`\> +**pipeline**<`A`, `T1`, `T2`, `T3`, `T4`, `B`\>(`source`, `transform1`, `transform2`, `transform3`, `transform4`, `destination`, `callback?`): `B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ", + "type": "[`PipelineSource`](admin_discounts.internal.internal-3.mdx#pipelinesource)<`any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -423,7 +1222,7 @@ ___ }, { "name": "T1", - "type": "[`PipelineTransform`](admin_discounts.internal.internal-2.mdx#pipelinetransform)<`A`, `any`\\>", + "type": "[`PipelineTransform`](admin_discounts.internal.internal-3.mdx#pipelinetransform)<`A`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -431,7 +1230,7 @@ ___ }, { "name": "T2", - "type": "[`PipelineTransform`](admin_discounts.internal.internal-2.mdx#pipelinetransform)<`T1`, `any`\\>", + "type": "[`PipelineTransform`](admin_discounts.internal.internal-3.mdx#pipelinetransform)<`T1`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -439,7 +1238,7 @@ ___ }, { "name": "T3", - "type": "[`PipelineTransform`](admin_discounts.internal.internal-2.mdx#pipelinetransform)<`T2`, `any`\\>", + "type": "[`PipelineTransform`](admin_discounts.internal.internal-3.mdx#pipelinetransform)<`T2`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -447,7 +1246,7 @@ ___ }, { "name": "T4", - "type": "[`PipelineTransform`](admin_discounts.internal.internal-2.mdx#pipelinetransform)<`T3`, `any`\\>", + "type": "[`PipelineTransform`](admin_discounts.internal.internal-3.mdx#pipelinetransform)<`T3`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -455,7 +1254,7 @@ ___ }, { "name": "B", - "type": "[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-2.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", + "type": "[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", "description": "", "optional": false, "defaultValue": "", @@ -515,8 +1314,8 @@ ___ "children": [] }, { - "name": "options", - "type": "[`PipelineOptions`](../../internal-2/interfaces/admin_discounts.internal.internal-2.PipelineOptions.mdx)", + "name": "callback", + "type": "[`PipelineCallback`](admin_discounts.internal.internal-3.mdx#pipelinecallback)<`B`\\>", "description": "", "optional": true, "defaultValue": "", @@ -526,20 +1325,20 @@ ___ #### Returns -[`PipelinePromise`](admin_discounts.internal.internal-2.mdx#pipelinepromise)<`B`\> +`B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ", - "optional": false, + "name": "`B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "type": "`B` extends [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ? `B` : [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "optional": true, "defaultValue": "", "description": "", "children": [] } ]} /> -**pipeline**(`streams`, `options?`): `Promise`<`void`\> +**pipeline**(`streams`, `callback?`): [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) #### Parameters @@ -553,8 +1352,8 @@ ___ "children": [] }, { - "name": "options", - "type": "[`PipelineOptions`](../../internal-2/interfaces/admin_discounts.internal.internal-2.PipelineOptions.mdx)", + "name": "callback", + "type": "(`err`: ``null`` \\| [`ErrnoException`](../interfaces/admin_discounts.internal.ErrnoException.mdx)) => `void`", "description": "", "optional": true, "defaultValue": "", @@ -564,20 +1363,156 @@ ___ #### Returns -`Promise`<`void`\> +[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ", + "name": "writable", + "type": "`boolean`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "addListener", + "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "emit", + "type": "(`eventName`: `string` \\| `symbol`, ...`args`: `any`[]) => `boolean`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "end", + "type": "(`cb?`: () => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)(`data`: `string` \\| `Uint8Array`, `cb?`: () => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)(`str`: `string`, `encoding?`: [`BufferEncoding`](../../admin_discounts/modules/admin_discounts.internal.mdx#bufferencoding), `cb?`: () => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "eventNames", + "type": "() => (`string` \\| `symbol`)[]", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "getMaxListeners", + "type": "() => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "listenerCount", + "type": "(`eventName`: `string` \\| `symbol`, `listener?`: `Function`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "listeners", + "type": "(`eventName`: `string` \\| `symbol`) => `Function`[]", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "off", + "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "on", + "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "once", + "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "prependListener", + "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "prependOnceListener", + "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rawListeners", + "type": "(`eventName`: `string` \\| `symbol`) => `Function`[]", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "removeAllListeners", + "type": "(`event?`: `string` \\| `symbol`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "removeListener", + "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "setMaxListeners", + "type": "(`n`: `number`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "description": "", "optional": false, "defaultValue": "", + "children": [] + }, + { + "name": "write", + "type": "(`buffer`: `string` \\| `Uint8Array`, `cb?`: (`err?`: ``null`` \\| [`Error`](../../admin_discounts/modules/admin_discounts.internal.mdx#error)) => `void`) => `boolean`(`str`: `string`, `encoding?`: [`BufferEncoding`](../../admin_discounts/modules/admin_discounts.internal.mdx#bufferencoding), `cb?`: (`err?`: ``null`` \\| [`Error`](../../admin_discounts/modules/admin_discounts.internal.mdx#error)) => `void`) => `boolean`", "description": "", + "optional": false, + "defaultValue": "", "children": [] } ]} /> -**pipeline**(`stream1`, `stream2`, `...streams`): `Promise`<`void`\> +**pipeline**(`stream1`, `stream2`, `...streams`): [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) #### Parameters @@ -600,7 +1535,7 @@ ___ }, { "name": "streams", - "type": "([`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`ReadWriteStream`](../interfaces/admin_discounts.internal.ReadWriteStream.mdx) \\| [`PipelineOptions`](../../internal-2/interfaces/admin_discounts.internal.internal-2.PipelineOptions.mdx))[]", + "type": "([`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`ReadWriteStream`](../interfaces/admin_discounts.internal.ReadWriteStream.mdx) \\| (`err`: ``null`` \\| [`ErrnoException`](../interfaces/admin_discounts.internal.ErrnoException.mdx)) => `void`)[]", "description": "", "optional": false, "defaultValue": "", @@ -610,15 +1545,199 @@ ___ #### Returns -`Promise`<`void`\> +[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) ", + "name": "writable", + "type": "`boolean`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "addListener", + "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "emit", + "type": "(`eventName`: `string` \\| `symbol`, ...`args`: `any`[]) => `boolean`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "end", + "type": "(`cb?`: () => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)(`data`: `string` \\| `Uint8Array`, `cb?`: () => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)(`str`: `string`, `encoding?`: [`BufferEncoding`](../../admin_discounts/modules/admin_discounts.internal.mdx#bufferencoding), `cb?`: () => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "eventNames", + "type": "() => (`string` \\| `symbol`)[]", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "getMaxListeners", + "type": "() => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "listenerCount", + "type": "(`eventName`: `string` \\| `symbol`, `listener?`: `Function`) => `number`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "listeners", + "type": "(`eventName`: `string` \\| `symbol`) => `Function`[]", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "off", + "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "on", + "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "once", + "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "prependListener", + "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "prependOnceListener", + "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "description": "", "optional": false, "defaultValue": "", + "children": [] + }, + { + "name": "rawListeners", + "type": "(`eventName`: `string` \\| `symbol`) => `Function`[]", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "removeAllListeners", + "type": "(`event?`: `string` \\| `symbol`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "removeListener", + "type": "(`eventName`: `string` \\| `symbol`, `listener`: (...`args`: `any`[]) => `void`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "setMaxListeners", + "type": "(`n`: `number`) => [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "write", + "type": "(`buffer`: `string` \\| `Uint8Array`, `cb?`: (`err?`: ``null`` \\| [`Error`](../../admin_discounts/modules/admin_discounts.internal.mdx#error)) => `void`) => `boolean`(`str`: `string`, `encoding?`: [`BufferEncoding`](../../admin_discounts/modules/admin_discounts.internal.mdx#bufferencoding), `cb?`: (`err?`: ``null`` \\| [`Error`](../../admin_discounts/modules/admin_discounts.internal.mdx#error)) => `void`) => `boolean`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +___ + +### setDefaultHighWaterMark + +**setDefaultHighWaterMark**(`objectMode`, `value`): `void` + +Sets the default highWaterMark used by streams. + +#### Parameters + + + +#### Returns + +`void` + + + +#### Since + +v19.9.0 diff --git a/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal-4.mdx b/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal-4.mdx index c1816b44a3970..411a4d5951f7d 100644 --- a/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal-4.mdx +++ b/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal-4.mdx @@ -10,31 +10,39 @@ import ParameterTypes from "@site/src/components/ParameterTypes" ## Functions -### arrayBuffer +### finished -**arrayBuffer**(`stream`): `Promise`<`ArrayBuffer`\> +**finished**(`stream`, `options?`): `Promise`<`void`\> #### Parameters ", + "type": "[`ReadableStream`](../interfaces/admin_discounts.internal.ReadableStream.mdx) \\| [`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`ReadWriteStream`](../interfaces/admin_discounts.internal.ReadWriteStream.mdx)", "description": "", "optional": false, "defaultValue": "", "children": [] + }, + { + "name": "options", + "type": "[`FinishedOptions`](../../internal-3/interfaces/admin_discounts.internal.internal-3.FinishedOptions.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] } ]} /> #### Returns -`Promise`<`ArrayBuffer`\> +`Promise`<`void`\> ", + "type": "`Promise`<`void`\\>", "optional": false, "defaultValue": "", "description": "", @@ -44,185 +52,555 @@ import ParameterTypes from "@site/src/components/ParameterTypes" ___ -### blob +### pipeline + +**pipeline**<`A`, `B`\>(`source`, `destination`, `options?`): [`PipelinePromise`](admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\> -**blob**(`stream`): `Promise`<[`Blob`](../classes/admin_discounts.internal.Blob.mdx)\> +", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "B", + "type": "[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> #### Parameters ", + "name": "source", + "type": "`A`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "destination", + "type": "`B`", "description": "", "optional": false, "defaultValue": "", "children": [] + }, + { + "name": "options", + "type": "[`PipelineOptions`](../../internal-3/interfaces/admin_discounts.internal.internal-3.PipelineOptions.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] } ]} /> #### Returns -`Promise`<[`Blob`](../classes/admin_discounts.internal.Blob.mdx)\> +[`PipelinePromise`](admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\> ", - "optional": false, - "defaultValue": "", - "description": "", - "children": [ - { - "name": "size", - "type": "`number`", - "description": "The total size of the `Blob` in bytes. #### Since v15.7.0, v14.18.0", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "type", - "type": "`string`", - "description": "The content-type of the `Blob`. #### Since v15.7.0, v14.18.0", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "arrayBuffer", - "type": "() => `Promise`<`ArrayBuffer`\\>", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "slice", - "type": "(`start?`: `number`, `end?`: `number`, `type?`: `string`) => [`Blob`](../classes/admin_discounts.internal.Blob.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "stream", - "type": "() => [`ReadableStream`](../../admin_discounts/modules/admin_discounts.internal.mdx#readablestream)<`any`\\>", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - }, - { - "name": "text", - "type": "() => `Promise`<`string`\\>", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } - ] + "name": "PipelinePromise", + "type": "[`PipelinePromise`](admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\\>", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] } ]} /> -___ +**pipeline**<`A`, `T1`, `B`\>(`source`, `transform1`, `destination`, `options?`): [`PipelinePromise`](admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\> + +", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "T1", + "type": "[`PipelineTransform`](admin_discounts.internal.internal-3.mdx#pipelinetransform)<`A`, `any`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "B", + "type": "[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +#### Parameters + + -### buffer +#### Returns -**buffer**(`stream`): `Promise`<[`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\> +[`PipelinePromise`](admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } +]} /> + +**pipeline**<`A`, `T1`, `T2`, `B`\>(`source`, `transform1`, `transform2`, `destination`, `options?`): [`PipelinePromise`](admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\> + +", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "T1", + "type": "[`PipelineTransform`](admin_discounts.internal.internal-3.mdx#pipelinetransform)<`A`, `any`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "T2", + "type": "[`PipelineTransform`](admin_discounts.internal.internal-3.mdx#pipelinetransform)<`T1`, `any`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "B", + "type": "[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> #### Parameters ", + "name": "source", + "type": "`A`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "transform1", + "type": "`T1`", "description": "", "optional": false, "defaultValue": "", "children": [] + }, + { + "name": "transform2", + "type": "`T2`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "destination", + "type": "`B`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "options", + "type": "[`PipelineOptions`](../../internal-3/interfaces/admin_discounts.internal.internal-3.PipelineOptions.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] } ]} /> #### Returns -`Promise`<[`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\> +[`PipelinePromise`](admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\> ", + "name": "PipelinePromise", + "type": "[`PipelinePromise`](admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\\>", "optional": false, "defaultValue": "", "description": "", - "children": [ - { - "name": "Buffer", - "type": "[`BufferConstructor`](../interfaces/admin_discounts.internal.BufferConstructor.mdx)", - "description": "", - "optional": false, - "defaultValue": "", - "children": [] - } - ] + "children": [] } ]} /> -___ +**pipeline**<`A`, `T1`, `T2`, `T3`, `B`\>(`source`, `transform1`, `transform2`, `transform3`, `destination`, `options?`): [`PipelinePromise`](admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\> -### json +", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "T1", + "type": "[`PipelineTransform`](admin_discounts.internal.internal-3.mdx#pipelinetransform)<`A`, `any`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "T2", + "type": "[`PipelineTransform`](admin_discounts.internal.internal-3.mdx#pipelinetransform)<`T1`, `any`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "T3", + "type": "[`PipelineTransform`](admin_discounts.internal.internal-3.mdx#pipelinetransform)<`T2`, `any`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "B", + "type": "[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +#### Parameters + + -**json**(`stream`): `Promise`<`unknown`\> +#### Returns + +[`PipelinePromise`](admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } +]} /> + +**pipeline**<`A`, `T1`, `T2`, `T3`, `T4`, `B`\>(`source`, `transform1`, `transform2`, `transform3`, `transform4`, `destination`, `options?`): [`PipelinePromise`](admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\> + +", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "T1", + "type": "[`PipelineTransform`](admin_discounts.internal.internal-3.mdx#pipelinetransform)<`A`, `any`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "T2", + "type": "[`PipelineTransform`](admin_discounts.internal.internal-3.mdx#pipelinetransform)<`T1`, `any`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "T3", + "type": "[`PipelineTransform`](admin_discounts.internal.internal-3.mdx#pipelinetransform)<`T2`, `any`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "T4", + "type": "[`PipelineTransform`](admin_discounts.internal.internal-3.mdx#pipelinetransform)<`T3`, `any`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "B", + "type": "[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`string` \\| [`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer), `any`\\> \\| [`PipelineDestinationIterableFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationiterablefunction)<`any`\\> \\| [`PipelineDestinationPromiseFunction`](admin_discounts.internal.internal-3.mdx#pipelinedestinationpromisefunction)<`any`, `any`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> #### Parameters ", + "name": "source", + "type": "`A`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "transform1", + "type": "`T1`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "transform2", + "type": "`T2`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "transform3", + "type": "`T3`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "transform4", + "type": "`T4`", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "destination", + "type": "`B`", "description": "", "optional": false, "defaultValue": "", "children": [] + }, + { + "name": "options", + "type": "[`PipelineOptions`](../../internal-3/interfaces/admin_discounts.internal.internal-3.PipelineOptions.mdx)", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] } ]} /> #### Returns -`Promise`<`unknown`\> +[`PipelinePromise`](admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\> ", + "name": "PipelinePromise", + "type": "[`PipelinePromise`](admin_discounts.internal.internal-3.mdx#pipelinepromise)<`B`\\>", "optional": false, "defaultValue": "", "description": "", - "children": [ - { - "name": "unknown", - "type": "`unknown`", - "optional": true, - "defaultValue": "", - "description": "", - "children": [] - } - ] + "children": [] } ]} /> -___ +**pipeline**(`streams`, `options?`): `Promise`<`void`\> -### text +#### Parameters + + + +#### Returns -**text**(`stream`): `Promise`<`string`\> +`Promise`<`void`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } +]} /> + +**pipeline**(`stream1`, `stream2`, `...streams`): `Promise`<`void`\> #### Parameters ", + "name": "stream1", + "type": "[`ReadableStream`](../interfaces/admin_discounts.internal.ReadableStream.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "stream2", + "type": "[`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`ReadWriteStream`](../interfaces/admin_discounts.internal.ReadWriteStream.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "streams", + "type": "([`WritableStream`](../interfaces/admin_discounts.internal.WritableStream.mdx) \\| [`ReadWriteStream`](../interfaces/admin_discounts.internal.ReadWriteStream.mdx) \\| [`PipelineOptions`](../../internal-3/interfaces/admin_discounts.internal.internal-3.PipelineOptions.mdx))[]", "description": "", "optional": false, "defaultValue": "", @@ -232,24 +610,15 @@ ___ #### Returns -`Promise`<`string`\> +`Promise`<`void`\> ", + "type": "`Promise`<`void`\\>", "optional": false, "defaultValue": "", "description": "", - "children": [ - { - "name": "string", - "type": "`string`", - "optional": true, - "defaultValue": "", - "description": "", - "children": [] - } - ] + "children": [] } ]} /> diff --git a/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal-5.mdx b/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal-5.mdx new file mode 100644 index 0000000000000..c1816b44a3970 --- /dev/null +++ b/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal-5.mdx @@ -0,0 +1,255 @@ +--- +displayed_sidebar: jsClientSidebar +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# internal + +[admin/discounts](../../modules/admin_discounts.mdx).[internal](../../admin_discounts/modules/admin_discounts.internal.mdx).internal + +## Functions + +### arrayBuffer + +**arrayBuffer**(`stream`): `Promise`<`ArrayBuffer`\> + +#### Parameters + +", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<`ArrayBuffer`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + } +]} /> + +___ + +### blob + +**blob**(`stream`): `Promise`<[`Blob`](../classes/admin_discounts.internal.Blob.mdx)\> + +#### Parameters + +", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`Blob`](../classes/admin_discounts.internal.Blob.mdx)\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "size", + "type": "`number`", + "description": "The total size of the `Blob` in bytes. #### Since v15.7.0, v14.18.0", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "type", + "type": "`string`", + "description": "The content-type of the `Blob`. #### Since v15.7.0, v14.18.0", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "arrayBuffer", + "type": "() => `Promise`<`ArrayBuffer`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "slice", + "type": "(`start?`: `number`, `end?`: `number`, `type?`: `string`) => [`Blob`](../classes/admin_discounts.internal.Blob.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "stream", + "type": "() => [`ReadableStream`](../../admin_discounts/modules/admin_discounts.internal.mdx#readablestream)<`any`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "text", + "type": "() => `Promise`<`string`\\>", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +___ + +### buffer + +**buffer**(`stream`): `Promise`<[`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\> + +#### Parameters + +", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<[`Buffer`](../../admin_discounts/modules/admin_discounts.internal.mdx#buffer)\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "Buffer", + "type": "[`BufferConstructor`](../interfaces/admin_discounts.internal.BufferConstructor.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +___ + +### json + +**json**(`stream`): `Promise`<`unknown`\> + +#### Parameters + +", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<`unknown`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "unknown", + "type": "`unknown`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> + +___ + +### text + +**text**(`stream`): `Promise`<`string`\> + +#### Parameters + +", + "description": "", + "optional": false, + "defaultValue": "", + "children": [] + } +]} /> + +#### Returns + +`Promise`<`string`\> + +", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "string", + "type": "`string`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal.mdx b/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal.mdx index 41a83c2a4b46b..048d9a21a1c1a 100644 --- a/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal.mdx +++ b/www/apps/docs/content/references/js-client/internal/modules/admin_discounts.internal.internal.mdx @@ -59,6 +59,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" - [AdminGetPriceListsPriceListProductsParams](../classes/admin_discounts.internal.internal.AdminGetPriceListsPriceListProductsParams.mdx) - [AdminGetProductCategoriesParams](../classes/admin_discounts.internal.internal.AdminGetProductCategoriesParams.mdx) - [AdminGetProductCategoryParams](../classes/admin_discounts.internal.internal.AdminGetProductCategoryParams.mdx) +- [AdminGetProductParams](../classes/admin_discounts.internal.internal.AdminGetProductParams.mdx) - [AdminGetProductTagsPaginationParams](../classes/admin_discounts.internal.internal.AdminGetProductTagsPaginationParams.mdx) - [AdminGetProductTagsParams](../classes/admin_discounts.internal.internal.AdminGetProductTagsParams.mdx) - [AdminGetProductTypesParams](../classes/admin_discounts.internal.internal.AdminGetProductTypesParams.mdx) @@ -5756,8 +5757,8 @@ ___ StoreBearerAuthRes type: object properties: - accessToken: - description: Access token for subsequent authorization. + access_token: + description: Access token that can be used to send authenticated requests. type: string #### Type declaration @@ -7630,6 +7631,12 @@ ___ `Const` **filterableAdminOrdersFields**: `string`[] +___ + +### joinerConfig + + `Const` **joinerConfig**: [`internal`](admin_discounts.internal.internal-1.mdx)[] + ## Functions ### DbAwareColumn diff --git a/www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.addPrices.mdx b/www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.addPrices.mdx index 55a219c630fee..770f928b4737b 100644 --- a/www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.addPrices.mdx +++ b/www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.addPrices.mdx @@ -147,7 +147,7 @@ async function addPricesToPriceSet (priceSetId: string) { }, { "name": "max_quantity", - "type": "`number`", + "type": "``null`` \\| `number`", "description": "The maximum quantity required to be purchased for this money amount to be applied.", "optional": true, "defaultValue": "", @@ -155,7 +155,7 @@ async function addPricesToPriceSet (priceSetId: string) { }, { "name": "min_quantity", - "type": "`number`", + "type": "``null`` \\| `number`", "description": "The minimum quantity required to be purchased for this money amount to be applied.", "optional": true, "defaultValue": "", @@ -478,7 +478,7 @@ async function addPricesToPriceSet (priceSetId: string) { }, { "name": "max_quantity", - "type": "`number`", + "type": "``null`` \\| `number`", "description": "The maximum quantity required to be purchased for this money amount to be applied.", "optional": true, "defaultValue": "", @@ -486,7 +486,7 @@ async function addPricesToPriceSet (priceSetId: string) { }, { "name": "min_quantity", - "type": "`number`", + "type": "``null`` \\| `number`", "description": "The minimum quantity required to be purchased for this money amount to be applied.", "optional": true, "defaultValue": "", diff --git a/www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.create.mdx b/www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.create.mdx index db39cc31dd16a..a3fc3e220dade 100644 --- a/www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.create.mdx +++ b/www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.create.mdx @@ -150,7 +150,7 @@ async function createPriceSet () { }, { "name": "max_quantity", - "type": "`number`", + "type": "``null`` \\| `number`", "description": "The maximum quantity required to be purchased for this money amount to be applied.", "optional": true, "defaultValue": "", @@ -158,7 +158,7 @@ async function createPriceSet () { }, { "name": "min_quantity", - "type": "`number`", + "type": "``null`` \\| `number`", "description": "The minimum quantity required to be purchased for this money amount to be applied.", "optional": true, "defaultValue": "", @@ -485,7 +485,7 @@ async function createPriceSets () { }, { "name": "max_quantity", - "type": "`number`", + "type": "``null`` \\| `number`", "description": "The maximum quantity required to be purchased for this money amount to be applied.", "optional": true, "defaultValue": "", @@ -493,7 +493,7 @@ async function createPriceSets () { }, { "name": "min_quantity", - "type": "`number`", + "type": "``null`` \\| `number`", "description": "The minimum quantity required to be purchased for this money amount to be applied.", "optional": true, "defaultValue": "", diff --git a/www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.createMoneyAmounts.mdx b/www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.createMoneyAmounts.mdx index 846d29e7dc0ba..385cc0c5306cf 100644 --- a/www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.createMoneyAmounts.mdx +++ b/www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.createMoneyAmounts.mdx @@ -119,7 +119,7 @@ async function retrieveMoneyAmounts () { }, { "name": "max_quantity", - "type": "`number`", + "type": "``null`` \\| `number`", "description": "The maximum quantity required to be purchased for this money amount to be applied.", "optional": true, "defaultValue": "", @@ -127,7 +127,7 @@ async function retrieveMoneyAmounts () { }, { "name": "min_quantity", - "type": "`number`", + "type": "``null`` \\| `number`", "description": "The minimum quantity required to be purchased for this money amount to be applied.", "optional": true, "defaultValue": "", diff --git a/www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.listAndCountPriceSetMoneyAmounts.mdx b/www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.listAndCountPriceSetMoneyAmounts.mdx new file mode 100644 index 0000000000000..6f58ce91da951 --- /dev/null +++ b/www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.listAndCountPriceSetMoneyAmounts.mdx @@ -0,0 +1,290 @@ +--- +displayed_sidebar: pricingReference +badge: + variant: orange + text: Beta +slug: /references/pricing/listAndCountPriceSetMoneyAmounts +sidebar_label: listAndCountPriceSetMoneyAmounts +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# listAndCountPriceSetMoneyAmounts - Pricing Module Reference + +This documentation provides a reference to the `listAndCountPriceSetMoneyAmounts` method. This belongs to the Pricing Module. + +This method is used to retrieve a paginated list of price set money amounts along with the total count of +available price set money amounts satisfying the provided filters. + +## Example + +To retrieve a list of price set money amounts using their IDs: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSetMoneyAmounts (id: string) { + const pricingService = await initializePricingModule() + + const [priceSetMoneyAmounts, count] = await pricingService.listAndCountPriceSetMoneyAmounts({ + id: [id] + }) + + // do something with the price set money amounts or return them +} +``` + +To specify relations that should be retrieved within the price set money amounts: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSetMoneyAmounts (id: string) { + const pricingService = await initializePricingModule() + + const [priceSetMoneyAmounts, count] = await pricingService.listAndCountPriceSetMoneyAmounts({ + id: [id] + }, { + relations: ["price_rules"], + }) + + // do something with the price set money amounts or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSetMoneyAmounts (id: string, skip: number, take: number) { + const pricingService = await initializePricingModule() + + const [priceSetMoneyAmounts, count] = await pricingService.listAndCountPriceSetMoneyAmounts({ + id: [id] + }, { + relations: ["price_rules"], + skip, + take + }) + + // do something with the price set money amounts or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSetMoneyAmounts (ids: string[], titles: string[], skip: number, take: number) { + const pricingService = await initializePricingModule() + + const [priceSetMoneyAmounts, count] = await pricingService.listAndCountPriceSetMoneyAmounts({ + $and: [ + { + id: ids + }, + { + title: titles + } + ] + }, { + relations: ["price_rules"], + skip, + take + }) + + // do something with the price set money amounts or return them +} +``` + +## Parameters + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterablePriceSetMoneyAmountProps`](../../interfaces/FilterablePriceSetMoneyAmountProps.mdx) \\| [`BaseFilterable`](../../interfaces/BaseFilterable.mdx)<[`FilterablePriceSetMoneyAmountProps`](../../interfaces/FilterablePriceSetMoneyAmountProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`[]", + "description": "The IDs to filter the price set money amounts by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_id", + "type": "`string`[]", + "description": "The IDs to filter the price set money amount's associated price set.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "config", + "type": "[`FindConfig`](../../interfaces/FindConfig.mdx)<[`PriceSetMoneyAmountDTO`](../../interfaces/PriceSetMoneyAmountDTO.mdx)\\>", + "description": "The configurations determining how the price set money amounts are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a price set money amount.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of price set money amounts and their total count.", + "children": [ + { + "name": "PriceSetMoneyAmountDTO[]", + "type": "[`PriceSetMoneyAmountDTO`](../../interfaces/PriceSetMoneyAmountDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [] + }, + { + "name": "number", + "type": "`number`", + "optional": true, + "defaultValue": "", + "description": "", + "children": [] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.listPriceSetMoneyAmounts.mdx b/www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.listPriceSetMoneyAmounts.mdx new file mode 100644 index 0000000000000..99f5c7914dc46 --- /dev/null +++ b/www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.listPriceSetMoneyAmounts.mdx @@ -0,0 +1,330 @@ +--- +displayed_sidebar: pricingReference +badge: + variant: orange + text: Beta +slug: /references/pricing/listPriceSetMoneyAmounts +sidebar_label: listPriceSetMoneyAmounts +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# listPriceSetMoneyAmounts - Pricing Module Reference + +This documentation provides a reference to the `listPriceSetMoneyAmounts` method. This belongs to the Pricing Module. + +This method is used to retrieve a paginated list of price set money amounts based on optional filters and configuration. + +## Example + +To retrieve a list of price set money amounts using their IDs: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSetMoneyAmounts (id: string) { + const pricingService = await initializePricingModule() + + const priceSetMoneyAmounts = await pricingService.listPriceSetMoneyAmounts({ + id: [id] + }) + + // do something with the price set money amounts or return them +} +``` + +To specify relations that should be retrieved within the price set money amounts: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSetMoneyAmounts (id: string) { + const pricingService = await initializePricingModule() + + const priceSetMoneyAmounts = await pricingService.listPriceSetMoneyAmounts({ + id: [id] + }, { + relations: ["price_rules"] + }) + + // do something with the price set money amounts or return them +} +``` + +By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSetMoneyAmounts (id: string, skip: number, take: number) { + const pricingService = await initializePricingModule() + + const priceSetMoneyAmounts = await pricingService.listPriceSetMoneyAmounts({ + id: [id] + }, { + relations: ["price_rules"], + skip, + take + }) + + // do something with the price set money amounts or return them +} +``` + +You can also use the `$and` or `$or` properties of the `filter` parameter to use and/or conditions in your filters. For example: + +```ts +import { + initialize as initializePricingModule, +} from "@medusajs/pricing" + +async function retrievePriceSetMoneyAmounts (ids: string[], titles: string[], skip: number, take: number) { + const pricingService = await initializePricingModule() + + const priceSetMoneyAmounts = await pricingService.listPriceSetMoneyAmounts({ + $and: [ + { + id: ids + }, + { + title: titles + } + ] + }, { + relations: ["price_rules"], + skip, + take + }) + + // do something with the price set money amounts or return them +} +``` + +## Parameters + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterablePriceSetMoneyAmountProps`](../../interfaces/FilterablePriceSetMoneyAmountProps.mdx) \\| [`BaseFilterable`](../../interfaces/BaseFilterable.mdx)<[`FilterablePriceSetMoneyAmountProps`](../../interfaces/FilterablePriceSetMoneyAmountProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`[]", + "description": "The IDs to filter the price set money amounts by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_id", + "type": "`string`[]", + "description": "The IDs to filter the price set money amount's associated price set.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "config", + "type": "[`FindConfig`](../../interfaces/FindConfig.mdx)<[`PriceSetMoneyAmountDTO`](../../interfaces/PriceSetMoneyAmountDTO.mdx)\\>", + "description": "The configurations determining how the price set money amounts are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a price set money amount.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "order", + "type": "`object`", + "description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "relations", + "type": "`string`[]", + "description": "An array of strings, each being relation names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "select", + "type": "(`string` \\| keyof `Entity`)[]", + "description": "An array of strings, each being attribute names of the entity to retrieve in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "skip", + "type": "`number`", + "description": "A number indicating the number of records to skip before retrieving the results.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "take", + "type": "`number`", + "description": "A number indicating the number of records to return in the result.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "withDeleted", + "type": "`boolean`", + "description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "sharedContext", + "type": "[`Context`](../../interfaces/Context.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "enableNestedTransactions", + "type": "`boolean`", + "description": "a boolean value indicating whether nested transactions are enabled.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "isolationLevel", + "type": "`string`", + "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "manager", + "type": "`TManager`", + "description": "An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionId", + "type": "`string`", + "description": "a string indicating the ID of the current transaction.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "transactionManager", + "type": "`TManager`", + "description": "An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } +]} /> + +## Returns + +", + "optional": false, + "defaultValue": "", + "description": "The list of price set money amounts.", + "children": [ + { + "name": "PriceSetMoneyAmountDTO[]", + "type": "[`PriceSetMoneyAmountDTO`](../../interfaces/PriceSetMoneyAmountDTO.mdx)[]", + "optional": false, + "defaultValue": "", + "description": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of a price set money amount.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "money_amount", + "type": "[`MoneyAmountDTO`](../../interfaces/MoneyAmountDTO.mdx)", + "description": "The money amount associated with the price set money amount. It may only be available if the relation `money_amount` is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "price_rules", + "type": "[`PriceRuleDTO`](../../interfaces/PriceRuleDTO.mdx)[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set", + "type": "[`PriceSetDTO`](../../interfaces/PriceSetDTO.mdx)", + "description": "The price set associated with the price set money amount. It may only be available if the relation `price_set` is expanded.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_id", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "title", + "type": "`string`", + "description": "The title of the price set money amount.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.retrievePriceSetMoneyAmountRules.mdx b/www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.retrievePriceSetMoneyAmountRules.mdx index ee92a1ab46ce2..dd9b523b482b6 100644 --- a/www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.retrievePriceSetMoneyAmountRules.mdx +++ b/www/apps/docs/content/references/pricing/IPricingModuleService/methods/IPricingModuleService.retrievePriceSetMoneyAmountRules.mdx @@ -211,6 +211,14 @@ async function retrievePriceSetMoneyAmountRule (id: string) { "defaultValue": "", "children": [] }, + { + "name": "price_rules", + "type": "[`PriceRuleDTO`](../../interfaces/PriceRuleDTO.mdx)[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, { "name": "price_set", "type": "[`PriceSetDTO`](../../interfaces/PriceSetDTO.mdx)", @@ -219,6 +227,14 @@ async function retrievePriceSetMoneyAmountRule (id: string) { "defaultValue": "", "children": [] }, + { + "name": "price_set_id", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, { "name": "title", "type": "`string`", diff --git a/www/apps/docs/content/references/pricing/index.md b/www/apps/docs/content/references/pricing/index.md index 05dc1ea26fa5b..b26a8bdae3bce 100644 --- a/www/apps/docs/content/references/pricing/index.md +++ b/www/apps/docs/content/references/pricing/index.md @@ -24,6 +24,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes" - [FilterableCurrencyProps](interfaces/FilterableCurrencyProps.mdx) - [FilterableMoneyAmountProps](interfaces/FilterableMoneyAmountProps.mdx) - [FilterablePriceRuleProps](interfaces/FilterablePriceRuleProps.mdx) +- [FilterablePriceSetMoneyAmountProps](interfaces/FilterablePriceSetMoneyAmountProps.mdx) - [FilterablePriceSetMoneyAmountRulesProps](interfaces/FilterablePriceSetMoneyAmountRulesProps.mdx) - [FilterablePriceSetProps](interfaces/FilterablePriceSetProps.mdx) - [FilterableRuleTypeProps](interfaces/FilterableRuleTypeProps.mdx) diff --git a/www/apps/docs/content/references/pricing/interfaces/AddPricesDTO.mdx b/www/apps/docs/content/references/pricing/interfaces/AddPricesDTO.mdx index dc83f198682ab..14072c469acc3 100644 --- a/www/apps/docs/content/references/pricing/interfaces/AddPricesDTO.mdx +++ b/www/apps/docs/content/references/pricing/interfaces/AddPricesDTO.mdx @@ -93,7 +93,7 @@ The prices to add to a price set. }, { "name": "max_quantity", - "type": "`number`", + "type": "``null`` \\| `number`", "description": "The maximum quantity required to be purchased for this money amount to be applied.", "optional": true, "defaultValue": "", @@ -101,7 +101,7 @@ The prices to add to a price set. }, { "name": "min_quantity", - "type": "`number`", + "type": "``null`` \\| `number`", "description": "The minimum quantity required to be purchased for this money amount to be applied.", "optional": true, "defaultValue": "", diff --git a/www/apps/docs/content/references/pricing/interfaces/CreateMoneyAmountDTO.mdx b/www/apps/docs/content/references/pricing/interfaces/CreateMoneyAmountDTO.mdx index ac0af79b04d92..28d21aa91540c 100644 --- a/www/apps/docs/content/references/pricing/interfaces/CreateMoneyAmountDTO.mdx +++ b/www/apps/docs/content/references/pricing/interfaces/CreateMoneyAmountDTO.mdx @@ -78,7 +78,7 @@ The money amount to create. }, { "name": "max_quantity", - "type": "`number`", + "type": "``null`` \\| `number`", "description": "The maximum quantity required to be purchased for this money amount to be applied.", "optional": true, "defaultValue": "", @@ -86,7 +86,7 @@ The money amount to create. }, { "name": "min_quantity", - "type": "`number`", + "type": "``null`` \\| `number`", "description": "The minimum quantity required to be purchased for this money amount to be applied.", "optional": true, "defaultValue": "", diff --git a/www/apps/docs/content/references/pricing/interfaces/CreatePriceSetDTO.mdx b/www/apps/docs/content/references/pricing/interfaces/CreatePriceSetDTO.mdx index 49e0f98cc6573..81608cb49d3c2 100644 --- a/www/apps/docs/content/references/pricing/interfaces/CreatePriceSetDTO.mdx +++ b/www/apps/docs/content/references/pricing/interfaces/CreatePriceSetDTO.mdx @@ -85,7 +85,7 @@ A price set to create. }, { "name": "max_quantity", - "type": "`number`", + "type": "``null`` \\| `number`", "description": "The maximum quantity required to be purchased for this money amount to be applied.", "optional": true, "defaultValue": "", @@ -93,7 +93,7 @@ A price set to create. }, { "name": "min_quantity", - "type": "`number`", + "type": "``null`` \\| `number`", "description": "The minimum quantity required to be purchased for this money amount to be applied.", "optional": true, "defaultValue": "", diff --git a/www/apps/docs/content/references/pricing/interfaces/CreatePricesDTO.mdx b/www/apps/docs/content/references/pricing/interfaces/CreatePricesDTO.mdx index 8c2f89445be9c..8d8c949cd6914 100644 --- a/www/apps/docs/content/references/pricing/interfaces/CreatePricesDTO.mdx +++ b/www/apps/docs/content/references/pricing/interfaces/CreatePricesDTO.mdx @@ -78,7 +78,7 @@ The prices to create part of a price set. }, { "name": "max_quantity", - "type": "`number`", + "type": "``null`` \\| `number`", "description": "The maximum quantity required to be purchased for this money amount to be applied.", "optional": true, "defaultValue": "", @@ -86,7 +86,7 @@ The prices to create part of a price set. }, { "name": "min_quantity", - "type": "`number`", + "type": "``null`` \\| `number`", "description": "The minimum quantity required to be purchased for this money amount to be applied.", "optional": true, "defaultValue": "", diff --git a/www/apps/docs/content/references/pricing/interfaces/FilterablePriceSetMoneyAmountProps.mdx b/www/apps/docs/content/references/pricing/interfaces/FilterablePriceSetMoneyAmountProps.mdx new file mode 100644 index 0000000000000..99c63e81e8a35 --- /dev/null +++ b/www/apps/docs/content/references/pricing/interfaces/FilterablePriceSetMoneyAmountProps.mdx @@ -0,0 +1,46 @@ +--- +displayed_sidebar: pricingReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterablePriceSetMoneyAmountProps + +Filters to apply on price set money amounts. + +## Properties + +)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "$or", + "type": "([`FilterablePriceSetMoneyAmountProps`](FilterablePriceSetMoneyAmountProps.mdx) \\| [`BaseFilterable`](BaseFilterable.mdx)<[`FilterablePriceSetMoneyAmountProps`](FilterablePriceSetMoneyAmountProps.mdx)\\>)[]", + "description": "An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`[]", + "description": "The IDs to filter the price set money amounts by.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_id", + "type": "`string`[]", + "description": "The IDs to filter the price set money amount's associated price set.", + "optional": true, + "defaultValue": "", + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/pricing/interfaces/IPricingModuleService.mdx b/www/apps/docs/content/references/pricing/interfaces/IPricingModuleService.mdx index 2473108f066ca..5e92b653f2514 100644 --- a/www/apps/docs/content/references/pricing/interfaces/IPricingModuleService.mdx +++ b/www/apps/docs/content/references/pricing/interfaces/IPricingModuleService.mdx @@ -35,11 +35,13 @@ This section of the documentation provides a reference to the `IPricingModuleSer - [listAndCountMoneyAmounts](../IPricingModuleService/methods/IPricingModuleService.listAndCountMoneyAmounts.mdx) - [listAndCountPriceRules](../IPricingModuleService/methods/IPricingModuleService.listAndCountPriceRules.mdx) - [listAndCountPriceSetMoneyAmountRules](../IPricingModuleService/methods/IPricingModuleService.listAndCountPriceSetMoneyAmountRules.mdx) +- [listAndCountPriceSetMoneyAmounts](../IPricingModuleService/methods/IPricingModuleService.listAndCountPriceSetMoneyAmounts.mdx) - [listAndCountRuleTypes](../IPricingModuleService/methods/IPricingModuleService.listAndCountRuleTypes.mdx) - [listCurrencies](../IPricingModuleService/methods/IPricingModuleService.listCurrencies.mdx) - [listMoneyAmounts](../IPricingModuleService/methods/IPricingModuleService.listMoneyAmounts.mdx) - [listPriceRules](../IPricingModuleService/methods/IPricingModuleService.listPriceRules.mdx) - [listPriceSetMoneyAmountRules](../IPricingModuleService/methods/IPricingModuleService.listPriceSetMoneyAmountRules.mdx) +- [listPriceSetMoneyAmounts](../IPricingModuleService/methods/IPricingModuleService.listPriceSetMoneyAmounts.mdx) - [listRuleTypes](../IPricingModuleService/methods/IPricingModuleService.listRuleTypes.mdx) - [removeRules](../IPricingModuleService/methods/IPricingModuleService.removeRules.mdx) - [retrieve](../IPricingModuleService/methods/IPricingModuleService.retrieve.mdx) diff --git a/www/apps/docs/content/references/pricing/interfaces/PriceSetMoneyAmountDTO.mdx b/www/apps/docs/content/references/pricing/interfaces/PriceSetMoneyAmountDTO.mdx index eb01740eb1afe..6f10fbe1fd300 100644 --- a/www/apps/docs/content/references/pricing/interfaces/PriceSetMoneyAmountDTO.mdx +++ b/www/apps/docs/content/references/pricing/interfaces/PriceSetMoneyAmountDTO.mdx @@ -109,6 +109,145 @@ A price set money amount's data. } ] }, + { + "name": "price_rules", + "type": "[`PriceRuleDTO`](PriceRuleDTO.mdx)[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the price rule.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_list_id", + "type": "`string`", + "description": "The ID of the associated price list.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set", + "type": "[`PriceSetDTO`](PriceSetDTO.mdx)", + "description": "The associated price set. It may only be available if the relation `price_set` is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the price set.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "money_amounts", + "type": "[`MoneyAmountDTO`](MoneyAmountDTO.mdx)[]", + "description": "The prices that belong to this price set.", + "optional": true, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_types", + "type": "[`RuleTypeDTO`](RuleTypeDTO.mdx)[]", + "description": "The rule types applied on this price set.", + "optional": true, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "price_set_id", + "type": "`string`", + "description": "The ID of the associated price set.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_money_amount_id", + "type": "`string`", + "description": "The ID of the associated price set money amount.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "priority", + "type": "`number`", + "description": "The priority of the price rule in comparison to other applicable price rules.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_type", + "type": "[`RuleTypeDTO`](RuleTypeDTO.mdx)", + "description": "The associated rule type. It may only be available if the relation `rule_type` is expanded.", + "optional": false, + "defaultValue": "", + "children": [ + { + "name": "default_priority", + "type": "`number`", + "description": "The priority of the rule type. This is useful when calculating the price of a price set, and multiple rules satisfy the provided context. The higher the value, the higher the priority of the rule type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The ID of the rule type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The display name of the rule type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_attribute", + "type": "`string`", + "description": "The unique name used to later identify the rule_attribute. For example, it can be used in the `context` parameter of the `calculatePrices` method to specify a rule for calculating the price.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, + { + "name": "rule_type_id", + "type": "`string`", + "description": "The ID of the associated rule type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the price rule.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, { "name": "price_set", "type": "[`PriceSetDTO`](PriceSetDTO.mdx)", @@ -224,6 +363,14 @@ A price set money amount's data. } ] }, + { + "name": "price_set_id", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, { "name": "title", "type": "`string`", diff --git a/www/apps/docs/content/references/pricing/interfaces/PriceSetMoneyAmountRulesDTO.mdx b/www/apps/docs/content/references/pricing/interfaces/PriceSetMoneyAmountRulesDTO.mdx index 9c89093a6cd04..92ae38c2293c9 100644 --- a/www/apps/docs/content/references/pricing/interfaces/PriceSetMoneyAmountRulesDTO.mdx +++ b/www/apps/docs/content/references/pricing/interfaces/PriceSetMoneyAmountRulesDTO.mdx @@ -91,6 +91,87 @@ A price set money amount rule's data. } ] }, + { + "name": "price_rules", + "type": "[`PriceRuleDTO`](PriceRuleDTO.mdx)[]", + "description": "", + "optional": true, + "defaultValue": "", + "children": [ + { + "name": "id", + "type": "`string`", + "description": "The ID of the price rule.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_list_id", + "type": "`string`", + "description": "The ID of the associated price list.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set", + "type": "[`PriceSetDTO`](PriceSetDTO.mdx)", + "description": "The associated price set. It may only be available if the relation `price_set` is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_id", + "type": "`string`", + "description": "The ID of the associated price set.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "price_set_money_amount_id", + "type": "`string`", + "description": "The ID of the associated price set money amount.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "priority", + "type": "`number`", + "description": "The priority of the price rule in comparison to other applicable price rules.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_type", + "type": "[`RuleTypeDTO`](RuleTypeDTO.mdx)", + "description": "The associated rule type. It may only be available if the relation `rule_type` is expanded.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "rule_type_id", + "type": "`string`", + "description": "The ID of the associated rule type.", + "optional": false, + "defaultValue": "", + "children": [] + }, + { + "name": "value", + "type": "`string`", + "description": "The value of the price rule.", + "optional": false, + "defaultValue": "", + "children": [] + } + ] + }, { "name": "price_set", "type": "[`PriceSetDTO`](PriceSetDTO.mdx)", @@ -124,6 +205,14 @@ A price set money amount rule's data. } ] }, + { + "name": "price_set_id", + "type": "`string`", + "description": "", + "optional": true, + "defaultValue": "", + "children": [] + }, { "name": "title", "type": "`string`", diff --git a/www/apps/docs/content/references/services/classes/AnalyticsConfigService.md b/www/apps/docs/content/references/services/classes/AnalyticsConfigService.md index 8b9abc1fcdf2a..367707f241883 100644 --- a/www/apps/docs/content/references/services/classes/AnalyticsConfigService.md +++ b/www/apps/docs/content/references/services/classes/AnalyticsConfigService.md @@ -1,4 +1,4 @@ -# Class: AnalyticsConfigService +# AnalyticsConfigService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new AnalyticsConfigService**(`«destructured»`) +**new AnalyticsConfigService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/analytics-config.ts:21](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/analytics-config.ts#L21) +[medusa/src/services/analytics-config.ts:21](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/analytics-config.ts#L21) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,23 +66,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### analyticsConfigRepository\_ -• `Protected` `Readonly` **analyticsConfigRepository\_**: `Repository`<`AnalyticsConfig`\> + `Protected` `Readonly` **analyticsConfigRepository\_**: `Repository`<`AnalyticsConfig`\> #### Defined in -[medusa/src/services/analytics-config.ts:18](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/analytics-config.ts#L18) +[medusa/src/services/analytics-config.ts:18](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/analytics-config.ts#L18) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -90,13 +90,13 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -104,57 +104,57 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### userService\_ -• `Protected` `Readonly` **userService\_**: [`UserService`](UserService.md) + `Protected` `Readonly` **userService\_**: [`UserService`](UserService.md) #### Defined in -[medusa/src/services/analytics-config.ts:19](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/analytics-config.ts#L19) +[medusa/src/services/analytics-config.ts:19](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/analytics-config.ts#L19) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -163,7 +163,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -171,20 +171,20 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**(`userId`, `data`): `Promise`<`AnalyticsConfig`\> +**create**(`userId`, `data`): `Promise`<`AnalyticsConfig`\> Creates an analytics config. #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `userId` | `string` | | `data` | `CreateAnalyticsConfig` | @@ -192,88 +192,98 @@ Creates an analytics config. `Promise`<`AnalyticsConfig`\> +-`Promise`: + -`AnalyticsConfig`: + #### Defined in -[medusa/src/services/analytics-config.ts:50](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/analytics-config.ts#L50) +[medusa/src/services/analytics-config.ts:50](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/analytics-config.ts#L50) ___ ### delete -▸ **delete**(`userId`): `Promise`<`void`\> +**delete**(`userId`): `Promise`<`void`\> Deletes an analytics config. #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `userId` | `string` | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/analytics-config.ts:94](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/analytics-config.ts#L94) +[medusa/src/services/analytics-config.ts:94](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/analytics-config.ts#L94) ___ ### retrieve -▸ **retrieve**(`userId`): `Promise`<`AnalyticsConfig`\> +**retrieve**(`userId`): `Promise`<`AnalyticsConfig`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `userId` | `string` | #### Returns `Promise`<`AnalyticsConfig`\> +-`Promise`: + -`AnalyticsConfig`: + #### Defined in -[medusa/src/services/analytics-config.ts:28](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/analytics-config.ts#L28) +[medusa/src/services/analytics-config.ts:28](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/analytics-config.ts#L28) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`userId`, `update`): `Promise`<`AnalyticsConfig`\> +**update**(`userId`, `update`): `Promise`<`AnalyticsConfig`\> Updates an analytics config. If the config does not exist, it will be created instead. #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `userId` | `string` | | `update` | `UpdateAnalyticsConfig` | @@ -281,30 +291,35 @@ Updates an analytics config. If the config does not exist, it will be created in `Promise`<`AnalyticsConfig`\> +-`Promise`: + -`AnalyticsConfig`: + #### Defined in -[medusa/src/services/analytics-config.ts:65](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/analytics-config.ts#L65) +[medusa/src/services/analytics-config.ts:65](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/analytics-config.ts#L65) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`AnalyticsConfigService`](AnalyticsConfigService.md) +**withTransaction**(`transactionManager?`): [`AnalyticsConfigService`](AnalyticsConfigService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`AnalyticsConfigService`](AnalyticsConfigService.md) +-`AnalyticsConfigService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/AuthService.md b/www/apps/docs/content/references/services/classes/AuthService.md index a5bd54d5c9793..d4f7dca2ac98a 100644 --- a/www/apps/docs/content/references/services/classes/AuthService.md +++ b/www/apps/docs/content/references/services/classes/AuthService.md @@ -1,4 +1,4 @@ -# Class: AuthService +# AuthService Can authenticate a user based on email password combination @@ -12,12 +12,12 @@ Can authenticate a user based on email password combination ### constructor -• **new AuthService**(`«destructured»`) +**new AuthService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -26,13 +26,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/auth.ts:22](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/auth.ts#L22) +[medusa/src/services/auth.ts:22](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/auth.ts#L22) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -68,23 +68,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### customerService\_ -• `Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md) + `Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md) #### Defined in -[medusa/src/services/auth.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/auth.ts#L20) +[medusa/src/services/auth.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/auth.ts#L20) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -92,13 +92,13 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -106,57 +106,57 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### userService\_ -• `Protected` `Readonly` **userService\_**: [`UserService`](UserService.md) + `Protected` `Readonly` **userService\_**: [`UserService`](UserService.md) #### Defined in -[medusa/src/services/auth.ts:19](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/auth.ts#L19) +[medusa/src/services/auth.ts:19](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/auth.ts#L19) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -165,7 +165,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -173,21 +173,21 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### authenticate -▸ **authenticate**(`email`, `password`): `Promise`<`AuthenticateResult`\> +**authenticate**(`email`, `password`): `Promise`<`AuthenticateResult`\> Authenticates a given user based on an email, password combination. Uses scrypt to match password with hashed value. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `email` | `string` | the email of the user | | `password` | `string` | the password of the user | @@ -195,53 +195,53 @@ scrypt to match password with hashed value. `Promise`<`AuthenticateResult`\> -success: whether authentication succeeded +-`Promise`: success: whether authentication succeeded user: the user document if authentication succeeded error: a string with the error message #### Defined in -[medusa/src/services/auth.ts:81](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/auth.ts#L81) +[medusa/src/services/auth.ts:81](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/auth.ts#L81) ___ ### authenticateAPIToken -▸ **authenticateAPIToken**(`token`): `Promise`<`AuthenticateResult`\> +**authenticateAPIToken**(`token`): `Promise`<`AuthenticateResult`\> Authenticates a given user with an API token #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `token` | `string` | the api_token of the user to authenticate | #### Returns `Promise`<`AuthenticateResult`\> -success: whether authentication succeeded +-`Promise`: success: whether authentication succeeded user: the user document if authentication succeeded error: a string with the error message #### Defined in -[medusa/src/services/auth.ts:52](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/auth.ts#L52) +[medusa/src/services/auth.ts:52](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/auth.ts#L52) ___ ### authenticateCustomer -▸ **authenticateCustomer**(`email`, `password`): `Promise`<`AuthenticateResult`\> +**authenticateCustomer**(`email`, `password`): `Promise`<`AuthenticateResult`\> Authenticates a customer based on an email, password combination. Uses scrypt to match password with hashed value. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `email` | `string` | the email of the user | | `password` | `string` | the password of the user | @@ -249,26 +249,26 @@ scrypt to match password with hashed value. `Promise`<`AuthenticateResult`\> -success: whether authentication succeeded +-`Promise`: success: whether authentication succeeded customer: the customer document if authentication succeded error: a string with the error message #### Defined in -[medusa/src/services/auth.ts:130](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/auth.ts#L130) +[medusa/src/services/auth.ts:130](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/auth.ts#L130) ___ ### comparePassword\_ -▸ `Protected` **comparePassword_**(`password`, `hash`): `Promise`<`boolean`\> +`Protected` **comparePassword_**(`password`, `hash`): `Promise`<`boolean`\> Verifies if a password is valid given the provided password hash #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `password` | `string` | the raw password to check | | `hash` | `string` | the hash to compare against | @@ -276,56 +276,61 @@ Verifies if a password is valid given the provided password hash `Promise`<`boolean`\> -the result of the comparison +-`Promise`: the result of the comparison + -`boolean`: (optional) #### Defined in -[medusa/src/services/auth.ts:36](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/auth.ts#L36) +[medusa/src/services/auth.ts:36](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/auth.ts#L36) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`AuthService`](AuthService.md) +**withTransaction**(`transactionManager?`): [`AuthService`](AuthService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`AuthService`](AuthService.md) +-`AuthService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/BatchJobService.md b/www/apps/docs/content/references/services/classes/BatchJobService.md index a3f3852df2f21..a9c54234b0a29 100644 --- a/www/apps/docs/content/references/services/classes/BatchJobService.md +++ b/www/apps/docs/content/references/services/classes/BatchJobService.md @@ -1,4 +1,4 @@ -# Class: BatchJobService +# BatchJobService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new BatchJobService**(`«destructured»`) +**new BatchJobService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/batch-job.ts:91](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L91) +[medusa/src/services/batch-job.ts:91](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L91) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,43 +66,43 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### batchJobRepository\_ -• `Protected` `Readonly` **batchJobRepository\_**: `Repository`<`BatchJob`\> + `Protected` `Readonly` **batchJobRepository\_**: `Repository`<`BatchJob`\> #### Defined in -[medusa/src/services/batch-job.ts:39](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L39) +[medusa/src/services/batch-job.ts:39](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L39) ___ ### batchJobStatusMapToProps -• `Protected` **batchJobStatusMapToProps**: `Map`<`BatchJobStatus`, { `entityColumnName`: `string` ; `eventType`: `string` }\> + `Protected` **batchJobStatusMapToProps**: `Map`<`BatchJobStatus`, { `entityColumnName`: `string` ; `eventType`: `string` }\> #### Defined in -[medusa/src/services/batch-job.ts:43](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L43) +[medusa/src/services/batch-job.ts:43](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L43) ___ ### eventBus\_ -• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/batch-job.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L40) +[medusa/src/services/batch-job.ts:40](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L40) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -110,23 +110,23 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### strategyResolver\_ -• `Protected` `Readonly` **strategyResolver\_**: [`StrategyResolverService`](StrategyResolverService.md) + `Protected` `Readonly` **strategyResolver\_**: [`StrategyResolverService`](StrategyResolverService.md) #### Defined in -[medusa/src/services/batch-job.ts:41](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L41) +[medusa/src/services/batch-job.ts:41](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L41) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -134,13 +134,13 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### Events -▪ `Static` `Readonly` **Events**: `Object` + `Static` `Readonly` **Events**: `Object` #### Type declaration @@ -157,47 +157,47 @@ ___ #### Defined in -[medusa/src/services/batch-job.ts:28](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L28) +[medusa/src/services/batch-job.ts:28](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L28) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -206,7 +206,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -214,98 +214,110 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### cancel -▸ **cancel**(`batchJobOrId`): `Promise`<`BatchJob`\> +**cancel**(`batchJobOrId`): `Promise`<`BatchJob`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `batchJobOrId` | `string` \| `BatchJob` | #### Returns `Promise`<`BatchJob`\> +-`Promise`: + -`BatchJob`: + #### Defined in -[medusa/src/services/batch-job.ts:270](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L270) +[medusa/src/services/batch-job.ts:270](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L270) ___ ### complete -▸ **complete**(`batchJobOrId`): `Promise`<`BatchJob`\> +**complete**(`batchJobOrId`): `Promise`<`BatchJob`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `batchJobOrId` | `string` \| `BatchJob` | #### Returns `Promise`<`BatchJob`\> +-`Promise`: + -`BatchJob`: + #### Defined in -[medusa/src/services/batch-job.ts:252](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L252) +[medusa/src/services/batch-job.ts:252](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L252) ___ ### confirm -▸ **confirm**(`batchJobOrId`): `Promise`<`BatchJob`\> +**confirm**(`batchJobOrId`): `Promise`<`BatchJob`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `batchJobOrId` | `string` \| `BatchJob` | #### Returns `Promise`<`BatchJob`\> +-`Promise`: + -`BatchJob`: + #### Defined in -[medusa/src/services/batch-job.ts:234](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L234) +[medusa/src/services/batch-job.ts:234](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L234) ___ ### create -▸ **create**(`data`): `Promise`<`BatchJob`\> +**create**(`data`): `Promise`<`BatchJob`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `data` | `BatchJobCreateProps` | #### Returns `Promise`<`BatchJob`\> +-`Promise`: + -`BatchJob`: + #### Defined in -[medusa/src/services/batch-job.ts:144](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L144) +[medusa/src/services/batch-job.ts:144](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L144) ___ ### listAndCount -▸ **listAndCount**(`selector?`, `config?`): `Promise`<[`BatchJob`[], `number`]\> +**listAndCount**(`selector?`, `config?`): `Promise`<[`BatchJob`[], `number`]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `selector` | `FilterableBatchJobProps` | | `config` | `FindConfig`<`BatchJob`\> | @@ -313,41 +325,47 @@ ___ `Promise`<[`BatchJob`[], `number`]\> +-`Promise`: + -`BatchJob[]`: + -`number`: (optional) + #### Defined in -[medusa/src/services/batch-job.ts:132](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L132) +[medusa/src/services/batch-job.ts:132](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L132) ___ ### prepareBatchJobForProcessing -▸ **prepareBatchJobForProcessing**(`data`, `req`): `Promise`<`CreateBatchJobInput`\> +**prepareBatchJobForProcessing**(`data`, `req`): `Promise`<`CreateBatchJobInput`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `data` | `CreateBatchJobInput` | -| `req` | `Request`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, `Record`<`string`, `any`\>\> | +| `req` | `Request`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, Record<`string`, `any`\>\> | #### Returns `Promise`<`CreateBatchJobInput`\> +-`Promise`: + #### Defined in -[medusa/src/services/batch-job.ts:367](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L367) +[medusa/src/services/batch-job.ts:367](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L367) ___ ### retrieve -▸ **retrieve**(`batchJobId`, `config?`): `Promise`<`BatchJob`\> +**retrieve**(`batchJobId`, `config?`): `Promise`<`BatchJob`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `batchJobId` | `string` | | `config` | `FindConfig`<`BatchJob`\> | @@ -355,20 +373,23 @@ ___ `Promise`<`BatchJob`\> +-`Promise`: + -`BatchJob`: + #### Defined in -[medusa/src/services/batch-job.ts:104](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L104) +[medusa/src/services/batch-job.ts:104](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L104) ___ ### setFailed -▸ **setFailed**(`batchJobOrId`, `error?`): `Promise`<`BatchJob`\> +**setFailed**(`batchJobOrId`, `error?`): `Promise`<`BatchJob`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `batchJobOrId` | `string` \| `BatchJob` | | `error?` | `string` \| `BatchJobResultError` | @@ -376,84 +397,95 @@ ___ `Promise`<`BatchJob`\> +-`Promise`: + -`BatchJob`: + #### Defined in -[medusa/src/services/batch-job.ts:341](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L341) +[medusa/src/services/batch-job.ts:341](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L341) ___ ### setPreProcessingDone -▸ **setPreProcessingDone**(`batchJobOrId`): `Promise`<`BatchJob`\> +**setPreProcessingDone**(`batchJobOrId`): `Promise`<`BatchJob`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `batchJobOrId` | `string` \| `BatchJob` | #### Returns `Promise`<`BatchJob`\> +-`Promise`: + -`BatchJob`: + #### Defined in -[medusa/src/services/batch-job.ts:288](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L288) +[medusa/src/services/batch-job.ts:288](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L288) ___ ### setProcessing -▸ **setProcessing**(`batchJobOrId`): `Promise`<`BatchJob`\> +**setProcessing**(`batchJobOrId`): `Promise`<`BatchJob`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `batchJobOrId` | `string` \| `BatchJob` | #### Returns `Promise`<`BatchJob`\> +-`Promise`: + -`BatchJob`: + #### Defined in -[medusa/src/services/batch-job.ts:321](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L321) +[medusa/src/services/batch-job.ts:321](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L321) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`batchJobOrId`, `data`): `Promise`<`BatchJob`\> +**update**(`batchJobOrId`, `data`): `Promise`<`BatchJob`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `batchJobOrId` | `string` \| `BatchJob` | | `data` | `Partial`<`Pick`<`BatchJob`, ``"context"`` \| ``"result"``\>\> | @@ -461,20 +493,23 @@ ___ `Promise`<`BatchJob`\> +-`Promise`: + -`BatchJob`: + #### Defined in -[medusa/src/services/batch-job.ts:161](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L161) +[medusa/src/services/batch-job.ts:161](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L161) ___ ### updateStatus -▸ `Protected` **updateStatus**(`batchJobOrId`, `status`): `Promise`<`BatchJob`\> +`Protected` **updateStatus**(`batchJobOrId`, `status`): `Promise`<`BatchJob`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `batchJobOrId` | `string` \| `BatchJob` | | `status` | `BatchJobStatus` | @@ -482,30 +517,35 @@ ___ `Promise`<`BatchJob`\> +-`Promise`: + -`BatchJob`: + #### Defined in -[medusa/src/services/batch-job.ts:200](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/batch-job.ts#L200) +[medusa/src/services/batch-job.ts:200](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/batch-job.ts#L200) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`BatchJobService`](BatchJobService.md) +**withTransaction**(`transactionManager?`): [`BatchJobService`](BatchJobService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`BatchJobService`](BatchJobService.md) +-`BatchJobService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/CartService.md b/www/apps/docs/content/references/services/classes/CartService.md index f1d7e215ca1b9..6452107050158 100644 --- a/www/apps/docs/content/references/services/classes/CartService.md +++ b/www/apps/docs/content/references/services/classes/CartService.md @@ -1,4 +1,4 @@ -# Class: CartService +# CartService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new CartService**(`«destructured»`) +**new CartService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/cart.ts:143](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L143) +[medusa/src/services/cart.ts:141](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L141) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,123 +66,123 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### addressRepository\_ -• `Protected` `Readonly` **addressRepository\_**: `Repository`<`Address`\> + `Protected` `Readonly` **addressRepository\_**: `Repository`<`Address`\> #### Defined in -[medusa/src/services/cart.ts:116](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L116) +[medusa/src/services/cart.ts:114](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L114) ___ ### cartRepository\_ -• `Protected` `Readonly` **cartRepository\_**: `Repository`<`Cart`\> & { `findOneWithRelations`: (`relations`: `FindOptionsRelations`<`Cart`\>, `optionsWithoutRelations`: `Omit`<`FindManyOptions`<`Cart`\>, ``"relations"``\>) => `Promise`<`Cart`\> ; `findWithRelations`: (`relations`: `FindOptionsRelations`<`Cart`\>, `optionsWithoutRelations`: `Omit`<`FindManyOptions`<`Cart`\>, ``"relations"``\>) => `Promise`<`Cart`[]\> } + `Protected` `Readonly` **cartRepository\_**: `Repository`<`Cart`\> & { `findOneWithRelations`: Method findOneWithRelations ; `findWithRelations`: Method findWithRelations } #### Defined in -[medusa/src/services/cart.ts:115](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L115) +[medusa/src/services/cart.ts:113](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L113) ___ ### customShippingOptionService\_ -• `Protected` `Readonly` **customShippingOptionService\_**: [`CustomShippingOptionService`](CustomShippingOptionService.md) + `Protected` `Readonly` **customShippingOptionService\_**: [`CustomShippingOptionService`](CustomShippingOptionService.md) #### Defined in -[medusa/src/services/cart.ts:135](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L135) +[medusa/src/services/cart.ts:133](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L133) ___ ### customerService\_ -• `Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md) + `Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md) #### Defined in -[medusa/src/services/cart.ts:127](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L127) +[medusa/src/services/cart.ts:125](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L125) ___ ### discountService\_ -• `Protected` `Readonly` **discountService\_**: [`DiscountService`](DiscountService.md) + `Protected` `Readonly` **discountService\_**: [`DiscountService`](DiscountService.md) #### Defined in -[medusa/src/services/cart.ts:130](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L130) +[medusa/src/services/cart.ts:128](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L128) ___ ### eventBus\_ -• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/cart.ts:119](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L119) +[medusa/src/services/cart.ts:117](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L117) ___ ### featureFlagRouter\_ -• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` + `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` #### Defined in -[medusa/src/services/cart.ts:138](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L138) +[medusa/src/services/cart.ts:136](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L136) ___ ### giftCardService\_ -• `Protected` `Readonly` **giftCardService\_**: [`GiftCardService`](GiftCardService.md) + `Protected` `Readonly` **giftCardService\_**: [`GiftCardService`](GiftCardService.md) #### Defined in -[medusa/src/services/cart.ts:131](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L131) +[medusa/src/services/cart.ts:129](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L129) ___ ### lineItemAdjustmentService\_ -• `Protected` `Readonly` **lineItemAdjustmentService\_**: [`LineItemAdjustmentService`](LineItemAdjustmentService.md) + `Protected` `Readonly` **lineItemAdjustmentService\_**: [`LineItemAdjustmentService`](LineItemAdjustmentService.md) #### Defined in -[medusa/src/services/cart.ts:137](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L137) +[medusa/src/services/cart.ts:135](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L135) ___ ### lineItemRepository\_ -• `Protected` `Readonly` **lineItemRepository\_**: `Repository`<`LineItem`\> & { `findByReturn`: (`returnId`: `string`) => `Promise`<`LineItem` & { `return_item`: `ReturnItem` }[]\> } + `Protected` `Readonly` **lineItemRepository\_**: `Repository`<`LineItem`\> & { `findByReturn`: Method findByReturn } #### Defined in -[medusa/src/services/cart.ts:118](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L118) +[medusa/src/services/cart.ts:116](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L116) ___ ### lineItemService\_ -• `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md) + `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md) #### Defined in -[medusa/src/services/cart.ts:125](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L125) +[medusa/src/services/cart.ts:123](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L123) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -190,173 +190,173 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### newTotalsService\_ -• `Protected` `Readonly` **newTotalsService\_**: [`NewTotalsService`](NewTotalsService.md) + `Protected` `Readonly` **newTotalsService\_**: [`NewTotalsService`](NewTotalsService.md) #### Defined in -[medusa/src/services/cart.ts:134](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L134) +[medusa/src/services/cart.ts:132](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L132) ___ ### paymentProviderService\_ -• `Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md) + `Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md) #### Defined in -[medusa/src/services/cart.ts:126](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L126) +[medusa/src/services/cart.ts:124](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L124) ___ ### paymentSessionRepository\_ -• `Protected` `Readonly` **paymentSessionRepository\_**: `Repository`<`PaymentSession`\> + `Protected` `Readonly` **paymentSessionRepository\_**: `Repository`<`PaymentSession`\> #### Defined in -[medusa/src/services/cart.ts:117](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L117) +[medusa/src/services/cart.ts:115](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L115) ___ ### priceSelectionStrategy\_ -• `Protected` `Readonly` **priceSelectionStrategy\_**: `IPriceSelectionStrategy` + `Protected` `Readonly` **priceSelectionStrategy\_**: `IPriceSelectionStrategy` #### Defined in -[medusa/src/services/cart.ts:136](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L136) +[medusa/src/services/cart.ts:134](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L134) ___ ### pricingService\_ -• `Protected` `Readonly` **pricingService\_**: [`PricingService`](PricingService.md) + `Protected` `Readonly` **pricingService\_**: [`PricingService`](PricingService.md) #### Defined in -[medusa/src/services/cart.ts:141](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L141) +[medusa/src/services/cart.ts:139](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L139) ___ ### productService\_ -• `Protected` `Readonly` **productService\_**: [`ProductService`](ProductService.md) + `Protected` `Readonly` **productService\_**: [`ProductService`](ProductService.md) #### Defined in -[medusa/src/services/cart.ts:121](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L121) +[medusa/src/services/cart.ts:119](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L119) ___ ### productVariantInventoryService\_ -• `Protected` `Readonly` **productVariantInventoryService\_**: [`ProductVariantInventoryService`](ProductVariantInventoryService.md) + `Protected` `Readonly` **productVariantInventoryService\_**: [`ProductVariantInventoryService`](ProductVariantInventoryService.md) #### Defined in -[medusa/src/services/cart.ts:140](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L140) +[medusa/src/services/cart.ts:138](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L138) ___ ### productVariantService\_ -• `Protected` `Readonly` **productVariantService\_**: [`ProductVariantService`](ProductVariantService.md) + `Protected` `Readonly` **productVariantService\_**: [`ProductVariantService`](ProductVariantService.md) #### Defined in -[medusa/src/services/cart.ts:120](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L120) +[medusa/src/services/cart.ts:118](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L118) ___ ### regionService\_ -• `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md) + `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md) #### Defined in -[medusa/src/services/cart.ts:124](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L124) +[medusa/src/services/cart.ts:122](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L122) ___ ### salesChannelService\_ -• `Protected` `Readonly` **salesChannelService\_**: [`SalesChannelService`](SalesChannelService.md) + `Protected` `Readonly` **salesChannelService\_**: [`SalesChannelService`](SalesChannelService.md) #### Defined in -[medusa/src/services/cart.ts:123](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L123) +[medusa/src/services/cart.ts:121](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L121) ___ ### shippingMethodRepository\_ -• `Protected` `Readonly` **shippingMethodRepository\_**: `Repository`<`ShippingMethod`\> + `Protected` `Readonly` **shippingMethodRepository\_**: `Repository`<`ShippingMethod`\> #### Defined in -[medusa/src/services/cart.ts:114](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L114) +[medusa/src/services/cart.ts:112](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L112) ___ ### shippingOptionService\_ -• `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md) + `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md) #### Defined in -[medusa/src/services/cart.ts:128](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L128) +[medusa/src/services/cart.ts:126](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L126) ___ ### shippingProfileService\_ -• `Protected` `Readonly` **shippingProfileService\_**: [`ShippingProfileService`](ShippingProfileService.md) + `Protected` `Readonly` **shippingProfileService\_**: [`ShippingProfileService`](ShippingProfileService.md) #### Defined in -[medusa/src/services/cart.ts:129](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L129) +[medusa/src/services/cart.ts:127](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L127) ___ ### storeService\_ -• `Protected` `Readonly` **storeService\_**: [`StoreService`](StoreService.md) + `Protected` `Readonly` **storeService\_**: [`StoreService`](StoreService.md) #### Defined in -[medusa/src/services/cart.ts:122](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L122) +[medusa/src/services/cart.ts:120](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L120) ___ ### taxProviderService\_ -• `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md) + `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md) #### Defined in -[medusa/src/services/cart.ts:132](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L132) +[medusa/src/services/cart.ts:130](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L130) ___ ### totalsService\_ -• `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md) + `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md) #### Defined in -[medusa/src/services/cart.ts:133](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L133) +[medusa/src/services/cart.ts:131](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L131) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -364,13 +364,13 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### Events -▪ `Static` `Readonly` **Events**: `Object` + `Static` `Readonly` **Events**: `Object` #### Type declaration @@ -382,90 +382,92 @@ ___ #### Defined in -[medusa/src/services/cart.ts:108](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L108) +[medusa/src/services/cart.ts:106](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L106) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### addLineItem -▸ **addLineItem**(`cartId`, `lineItem`, `config?`): `Promise`<`void`\> +**addLineItem**(`cartId`, `lineItem`, `config?`): `Promise`<`void`\> Adds a line item to the cart. #### Parameters -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `cartId` | `string` | `undefined` | the id of the cart that we will add to | -| `lineItem` | `LineItem` | `undefined` | the line item to add. | -| `config` | `Object` | `undefined` | validateSalesChannels - should check if product belongs to the same sales channel as cart (if cart has associated sales channel) | -| `config.validateSalesChannels` | `boolean` | `true` | - | +| Name | Default value | Description | +| :------ | :------ | :------ | +| `cartId` | `string` | the id of the cart that we will add to | +| `lineItem` | `LineItem` | the line item to add. | +| `config` | `object` | validateSalesChannels - should check if product belongs to the same sales channel as cart (if cart has associated sales channel) | +| `config.validateSalesChannels` | `boolean` | `true` | #### Returns `Promise`<`void`\> -the result of the update operation +-`Promise`: the result of the update operation -**`Deprecated`** +**Deprecated** Use [addOrUpdateLineItems](CartService.md#addorupdatelineitems) instead. #### Defined in -[medusa/src/services/cart.ts:654](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L654) +[medusa/src/services/cart.ts:652](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L652) ___ ### addOrUpdateLineItems -▸ **addOrUpdateLineItems**(`cartId`, `lineItems`, `config?`): `Promise`<`void`\> +**addOrUpdateLineItems**(`cartId`, `lineItems`, `config?`): `Promise`<`void`\> Adds or update one or multiple line items to the cart. It also update all existing items in the cart to have has_shipping to false. Finally, the adjustments will be updated. #### Parameters -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `cartId` | `string` | `undefined` | the id of the cart that we will add to | -| `lineItems` | `LineItem` \| `LineItem`[] | `undefined` | the line items to add. | -| `config` | `Object` | `undefined` | validateSalesChannels - should check if product belongs to the same sales channel as cart (if cart has associated sales channel) | -| `config.validateSalesChannels` | `boolean` | `true` | - | +| Name | Default value | Description | +| :------ | :------ | :------ | +| `cartId` | `string` | the id of the cart that we will add to | +| `lineItems` | `LineItem` \| `LineItem`[] | the line items to add. | +| `config` | `object` | validateSalesChannels - should check if product belongs to the same sales channel as cart (if cart has associated sales channel) | +| `config.validateSalesChannels` | `boolean` | `true` | #### Returns `Promise`<`void`\> -the result of the update operation +-`Promise`: the result of the update operation #### Defined in -[medusa/src/services/cart.ts:794](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L794) +[medusa/src/services/cart.ts:792](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L792) ___ ### addShippingMethod -▸ **addShippingMethod**(`cartOrId`, `optionId`, `data?`): `Promise`<`Cart`\> +**addShippingMethod**(`cartOrId`, `optionId`, `data?`): `Promise`<`Cart`\> Adds the shipping method to the list of shipping methods associated with the cart. Shipping Methods are the ways that an order is shipped, whereas a @@ -475,27 +477,28 @@ shop. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartOrId` | `string` \| `Cart` | the id of the cart to add shipping method to | | `optionId` | `string` | id of shipping option to add as valid method | -| `data` | `Record`<`string`, `unknown`\> | the fulmillment data for the method | +| `data` | Record<`string`, `unknown`\> | the fulmillment data for the method | #### Returns `Promise`<`Cart`\> -the result of the update operation +-`Promise`: the result of the update operation + -`Cart`: #### Defined in -[medusa/src/services/cart.ts:2179](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L2179) +[medusa/src/services/cart.ts:2177](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L2177) ___ ### adjustFreeShipping\_ -▸ `Protected` **adjustFreeShipping_**(`cart`, `shouldAdd`): `Promise`<`void`\> +`Protected` **adjustFreeShipping_**(`cart`, `shouldAdd`): `Promise`<`void`\> Ensures shipping total on cart is correct in regards to a potential free shipping discount @@ -504,8 +507,8 @@ if a free shipping was present, we set shipping methods to original amount #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cart` | `Cart` | the cart to adjust free shipping for | | `shouldAdd` | `boolean` | flag to indicate, if we should add or remove | @@ -513,17 +516,17 @@ if a free shipping was present, we set shipping methods to original amount `Promise`<`void`\> -void +-`Promise`: void #### Defined in -[medusa/src/services/cart.ts:1113](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L1113) +[medusa/src/services/cart.ts:1111](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L1111) ___ ### applyDiscount -▸ **applyDiscount**(`cart`, `discountCode`): `Promise`<`void`\> +**applyDiscount**(`cart`, `discountCode`): `Promise`<`void`\> Updates the cart's discounts. If discount besides free shipping is already applied, this @@ -532,8 +535,8 @@ Throws if discount regions does not include the cart region #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cart` | `Cart` | the cart to update | | `discountCode` | `string` | the discount code | @@ -541,15 +544,17 @@ Throws if discount regions does not include the cart region `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/cart.ts:1524](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L1524) +[medusa/src/services/cart.ts:1522](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L1522) ___ ### applyDiscounts -▸ **applyDiscounts**(`cart`, `discountCodes`): `Promise`<`void`\> +**applyDiscounts**(`cart`, `discountCodes`): `Promise`<`void`\> Updates the cart's discounts. If discount besides free shipping is already applied, this @@ -558,8 +563,8 @@ Throws if discount regions does not include the cart region #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cart` | `Cart` | the cart to update | | `discountCodes` | `string`[] | the discount code(s) to apply | @@ -567,20 +572,22 @@ Throws if discount regions does not include the cart region `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/cart.ts:1536](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L1536) +[medusa/src/services/cart.ts:1534](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L1534) ___ ### applyGiftCard\_ -▸ `Protected` **applyGiftCard_**(`cart`, `code`): `Promise`<`void`\> +`Protected` **applyGiftCard_**(`cart`, `code`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `cart` | `Cart` | | `code` | `string` | @@ -588,31 +595,31 @@ ___ `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/cart.ts:1489](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L1489) +[medusa/src/services/cart.ts:1487](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L1487) ___ ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -621,7 +628,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -629,13 +636,13 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### authorizePayment -▸ **authorizePayment**(`cartId`, `context?`): `Promise`<`Cart`\> +**authorizePayment**(`cartId`, `context?`): `Promise`<`Cart`\> Authorizes a payment for a cart. Will authorize with chosen payment provider. This will return @@ -645,99 +652,104 @@ set the payment on the cart. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartId` | `string` | the id of the cart to authorize payment for | -| `context` | `Record`<`string`, `unknown`\> & { `cart_id`: `string` } | object containing whatever is relevant for authorizing the payment with the payment provider. As an example, this could be IP address or similar for fraud handling. | +| `context` | Record<`string`, `unknown`\> & { `cart_id`: `string` } | object containing whatever is relevant for authorizing the payment with the payment provider. As an example, this could be IP address or similar for fraud handling. | #### Returns `Promise`<`Cart`\> -the resulting cart +-`Promise`: the resulting cart + -`Cart`: #### Defined in -[medusa/src/services/cart.ts:1703](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L1703) +[medusa/src/services/cart.ts:1701](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L1701) ___ ### create -▸ **create**(`data`): `Promise`<`Cart`\> +**create**(`data`): `Promise`<`Cart`\> Creates a cart. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `data` | `CartCreateProps` | the data to create the cart with | #### Returns `Promise`<`Cart`\> -the result of the create operation +-`Promise`: the result of the create operation + -`Cart`: #### Defined in -[medusa/src/services/cart.ts:352](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L352) +[medusa/src/services/cart.ts:350](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L350) ___ ### createOrFetchGuestCustomerFromEmail\_ -▸ `Protected` **createOrFetchGuestCustomerFromEmail_**(`email`): `Promise`<`Customer`\> +`Protected` **createOrFetchGuestCustomerFromEmail_**(`email`): `Promise`<`Customer`\> Creates or fetches a user based on an email. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `email` | `string` | the email to use | #### Returns `Promise`<`Customer`\> -the resultign customer object +-`Promise`: the resultign customer object + -`Customer`: #### Defined in -[medusa/src/services/cart.ts:1375](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L1375) +[medusa/src/services/cart.ts:1373](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L1373) ___ ### createTaxLines -▸ **createTaxLines**(`cartOrId`): `Promise`<`void`\> +**createTaxLines**(`cartOrId`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `cartOrId` | `string` \| `Cart` | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/cart.ts:2630](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L2630) +[medusa/src/services/cart.ts:2628](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L2628) ___ ### decorateTotals -▸ **decorateTotals**(`cart`, `totalsConfig?`): `Promise`<`WithRequiredProperty`<`Cart`, ``"total"``\>\> +**decorateTotals**(`cart`, `totalsConfig?`): `Promise`<`WithRequiredProperty`<`Cart`, ``"total"``\>\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `cart` | `Cart` | | `totalsConfig` | `TotalsConfig` | @@ -745,20 +757,25 @@ ___ `Promise`<`WithRequiredProperty`<`Cart`, ``"total"``\>\> +-`Promise`: + -`WithRequiredProperty`: + -`Cart`: + -```"total"```: (optional) + #### Defined in -[medusa/src/services/cart.ts:2682](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L2682) +[medusa/src/services/cart.ts:2680](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L2680) ___ ### decorateTotals\_ -▸ `Protected` **decorateTotals_**(`cart`, `totalsToSelect`, `options?`): `Promise`<`Cart`\> +`Protected` **decorateTotals_**(`cart`, `totalsToSelect`, `options?`): `Promise`<`Cart`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `cart` | `Cart` | | `totalsToSelect` | `TotalField`[] | | `options` | `TotalsConfig` | @@ -767,50 +784,54 @@ ___ `Promise`<`Cart`\> -**`Deprecated`** +-`Promise`: + -`Cart`: + +**Deprecated** Use decorateTotals instead #### Defined in -[medusa/src/services/cart.ts:2857](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L2857) +[medusa/src/services/cart.ts:2863](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L2863) ___ ### delete -▸ **delete**(`cartId`): `Promise`<`Cart`\> +**delete**(`cartId`): `Promise`<`Cart`\> Deletes a cart from the database. Completed carts cannot be deleted. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartId` | `string` | the id of the cart to delete | #### Returns `Promise`<`Cart`\> -the deleted cart or undefined if the cart was not found. +-`Promise`: the deleted cart or undefined if the cart was not found. + -`Cart`: #### Defined in -[medusa/src/services/cart.ts:2549](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L2549) +[medusa/src/services/cart.ts:2547](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L2547) ___ ### deletePaymentSession -▸ **deletePaymentSession**(`cartId`, `providerId`): `Promise`<`void`\> +**deletePaymentSession**(`cartId`, `providerId`): `Promise`<`void`\> Removes a payment session from the cart. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartId` | `string` | the id of the cart to remove from | | `providerId` | `string` | the id of the provider whose payment session should be removed. | @@ -818,45 +839,47 @@ Removes a payment session from the cart. `Promise`<`void`\> -the resulting cart. +-`Promise`: the resulting cart. #### Defined in -[medusa/src/services/cart.ts:2072](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L2072) +[medusa/src/services/cart.ts:2070](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L2070) ___ ### deleteTaxLines -▸ **deleteTaxLines**(`id`): `Promise`<`void`\> +**deleteTaxLines**(`id`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `id` | `string` | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/cart.ts:2662](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L2662) +[medusa/src/services/cart.ts:2660](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L2660) ___ ### findCustomShippingOption -▸ **findCustomShippingOption**(`cartCustomShippingOptions`, `optionId`): `undefined` \| `CustomShippingOption` +**findCustomShippingOption**(`cartCustomShippingOptions`, `optionId`): `undefined` \| `CustomShippingOption` Finds the cart's custom shipping options based on the passed option id. throws if custom options is not empty and no shipping option corresponds to optionId #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartCustomShippingOptions` | `CustomShippingOption`[] | the cart's custom shipping options | | `optionId` | `string` | id of the normal or custom shipping option to find in the cartCustomShippingOptions | @@ -864,62 +887,68 @@ throws if custom options is not empty and no shipping option corresponds to opti `undefined` \| `CustomShippingOption` -custom shipping option +-`undefined \| CustomShippingOption`: (optional) custom shipping option #### Defined in -[medusa/src/services/cart.ts:2312](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L2312) +[medusa/src/services/cart.ts:2310](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L2310) ___ ### getTotalsRelations -▸ `Private` **getTotalsRelations**(`config`): `string`[] +`Private` **getTotalsRelations**(`config`): `string`[] #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `config` | `FindConfig`<`Cart`\> | #### Returns `string`[] +-`string[]`: + -`string`: (optional) + #### Defined in -[medusa/src/services/cart.ts:2908](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L2908) +[medusa/src/services/cart.ts:2914](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L2914) ___ ### getValidatedSalesChannel -▸ `Protected` **getValidatedSalesChannel**(`salesChannelId?`): `Promise`<`SalesChannel`\> +`Protected` **getValidatedSalesChannel**(`salesChannelId?`): `Promise`<`SalesChannel`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `salesChannelId?` | `string` | #### Returns `Promise`<`SalesChannel`\> +-`Promise`: + -`SalesChannel`: + #### Defined in -[medusa/src/services/cart.ts:490](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L490) +[medusa/src/services/cart.ts:488](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L488) ___ ### list -▸ **list**(`selector`, `config?`): `Promise`<`Cart`[]\> +**list**(`selector`, `config?`): `Promise`<`Cart`[]\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `FilterableCartProps` | the query object for find | | `config` | `FindConfig`<`Cart`\> | config object | @@ -927,24 +956,26 @@ ___ `Promise`<`Cart`[]\> -the result of the find operation +-`Promise`: the result of the find operation + -`Cart[]`: + -`Cart`: #### Defined in -[medusa/src/services/cart.ts:209](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L209) +[medusa/src/services/cart.ts:207](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L207) ___ ### onSalesChannelChange -▸ `Protected` **onSalesChannelChange**(`cart`, `newSalesChannelId`): `Promise`<`void`\> +`Protected` **onSalesChannelChange**(`cart`, `newSalesChannelId`): `Promise`<`void`\> Remove the cart line item that does not belongs to the newly assigned sales channel #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cart` | `Cart` | The cart being updated | | `newSalesChannelId` | `string` | The new sales channel being assigned to the cart | @@ -952,44 +983,46 @@ Remove the cart line item that does not belongs to the newly assigned sales chan `Promise`<`void`\> -void +-`Promise`: void #### Defined in -[medusa/src/services/cart.ts:1321](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L1321) +[medusa/src/services/cart.ts:1319](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L1319) ___ ### refreshAdjustments\_ -▸ `Protected` **refreshAdjustments_**(`cart`): `Promise`<`void`\> +`Protected` **refreshAdjustments_**(`cart`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `cart` | `Cart` | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/cart.ts:2781](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L2781) +[medusa/src/services/cart.ts:2787](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L2787) ___ ### refreshPaymentSession -▸ **refreshPaymentSession**(`cartId`, `providerId`): `Promise`<`void`\> +**refreshPaymentSession**(`cartId`, `providerId`): `Promise`<`void`\> Refreshes a payment session on a cart #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartId` | `string` | the id of the cart to remove from | | `providerId` | `string` | the id of the provider whose payment session should be removed. | @@ -997,24 +1030,24 @@ Refreshes a payment session on a cart `Promise`<`void`\> -the resulting cart. +-`Promise`: the resulting cart. #### Defined in -[medusa/src/services/cart.ts:2124](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L2124) +[medusa/src/services/cart.ts:2122](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L2122) ___ ### removeDiscount -▸ **removeDiscount**(`cartId`, `discountCode`): `Promise`<`Cart`\> +**removeDiscount**(`cartId`, `discountCode`): `Promise`<`Cart`\> Removes a discount based on a discount code. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartId` | `string` | the id of the cart to remove from | | `discountCode` | `string` | the discount code to remove | @@ -1022,24 +1055,25 @@ Removes a discount based on a discount code. `Promise`<`Cart`\> -the resulting cart +-`Promise`: the resulting cart + -`Cart`: #### Defined in -[medusa/src/services/cart.ts:1614](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L1614) +[medusa/src/services/cart.ts:1612](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L1612) ___ ### removeLineItem -▸ **removeLineItem**(`cartId`, `lineItemId`): `Promise`<`Cart`\> +**removeLineItem**(`cartId`, `lineItemId`): `Promise`<`Cart`\> Removes a line item from the cart. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartId` | `string` | the id of the cart that we will remove from | | `lineItemId` | `string` | the line item to remove. | @@ -1047,48 +1081,50 @@ Removes a line item from the cart. `Promise`<`Cart`\> -the result of the update operation +-`Promise`: the result of the update operation + -`Cart`: #### Defined in -[medusa/src/services/cart.ts:522](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L522) +[medusa/src/services/cart.ts:520](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L520) ___ ### retrieve -▸ **retrieve**(`cartId`, `options?`, `totalsConfig?`): `Promise`<`Cart`\> +**retrieve**(`cartId`, `options?`, `totalsConfig?`): `Promise`<`Cart`\> Gets a cart by id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartId` | `string` | the id of the cart to get. | | `options` | `FindConfig`<`Cart`\> | the options to get a cart | -| `totalsConfig` | `TotalsConfig` | | +| `totalsConfig` | `TotalsConfig` | #### Returns `Promise`<`Cart`\> -the cart document. +-`Promise`: the cart document. + -`Cart`: #### Defined in -[medusa/src/services/cart.ts:226](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L226) +[medusa/src/services/cart.ts:224](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L224) ___ ### retrieveLegacy -▸ `Protected` **retrieveLegacy**(`cartId`, `options?`, `totalsConfig?`): `Promise`<`Cart`\> +`Protected` **retrieveLegacy**(`cartId`, `options?`, `totalsConfig?`): `Promise`<`Cart`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `cartId` | `string` | | `options` | `FindConfig`<`Cart`\> | | `totalsConfig` | `TotalsConfig` | @@ -1097,22 +1133,25 @@ ___ `Promise`<`Cart`\> -**`Deprecated`** +-`Promise`: + -`Cart`: + +**Deprecated** #### Defined in -[medusa/src/services/cart.ts:289](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L289) +[medusa/src/services/cart.ts:287](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L287) ___ ### retrieveWithTotals -▸ **retrieveWithTotals**(`cartId`, `options?`, `totalsConfig?`): `Promise`<`WithRequiredProperty`<`Cart`, ``"total"``\>\> +**retrieveWithTotals**(`cartId`, `options?`, `totalsConfig?`): `Promise`<`WithRequiredProperty`<`Cart`, ``"total"``\>\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `cartId` | `string` | | `options` | `FindConfig`<`Cart`\> | | `totalsConfig` | `TotalsConfig` | @@ -1121,15 +1160,20 @@ ___ `Promise`<`WithRequiredProperty`<`Cart`, ``"total"``\>\> +-`Promise`: + -`WithRequiredProperty`: + -`Cart`: + -```"total"```: (optional) + #### Defined in -[medusa/src/services/cart.ts:317](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L317) +[medusa/src/services/cart.ts:315](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L315) ___ ### setMetadata -▸ **setMetadata**(`cartId`, `key`, `value`): `Promise`<`Cart`\> +**setMetadata**(`cartId`, `key`, `value`): `Promise`<`Cart`\> Dedicated method to set metadata for a cart. To ensure that plugins does not overwrite each @@ -1137,8 +1181,8 @@ others metadata fields, setMetadata is provided. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartId` | `string` | the cart to apply metadata to. | | `key` | `string` | key for metadata field | | `value` | `string` \| `number` | value for metadata field. | @@ -1147,24 +1191,25 @@ others metadata fields, setMetadata is provided. `Promise`<`Cart`\> -resolves to the updated result. +-`Promise`: resolves to the updated result. + -`Cart`: #### Defined in -[medusa/src/services/cart.ts:2590](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L2590) +[medusa/src/services/cart.ts:2588](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L2588) ___ ### setPaymentSession -▸ **setPaymentSession**(`cartId`, `providerId`): `Promise`<`void`\> +**setPaymentSession**(`cartId`, `providerId`): `Promise`<`void`\> Selects a payment session for a cart and creates a payment object in the external provider system #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartId` | `string` | the id of the cart to add payment method to | | `providerId` | `string` | the id of the provider to be set to the cart | @@ -1172,15 +1217,17 @@ Selects a payment session for a cart and creates a payment object in the externa `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/cart.ts:1777](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L1777) +[medusa/src/services/cart.ts:1775](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L1775) ___ ### setPaymentSessions -▸ **setPaymentSessions**(`cartOrCartId`): `Promise`<`void`\> +**setPaymentSessions**(`cartOrCartId`): `Promise`<`void`\> Creates, updates and sets payment sessions associated with the cart. The first time the method is called payment sessions will be created for each @@ -1190,32 +1237,32 @@ that are not available for the cart's region. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartOrCartId` | `string` \| `Cart` | the id of the cart to set payment session for | #### Returns `Promise`<`void`\> -the result of the update operation. +-`Promise`: the result of the update operation. #### Defined in -[medusa/src/services/cart.ts:1893](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L1893) +[medusa/src/services/cart.ts:1891](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L1891) ___ ### setRegion\_ -▸ `Protected` **setRegion_**(`cart`, `regionId`, `countryCode`): `Promise`<`void`\> +`Protected` **setRegion_**(`cart`, `regionId`, `countryCode`): `Promise`<`void`\> Set's the region of a cart. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cart` | `Cart` | the cart to set region on | | `regionId` | `string` | the id of the region to set the region to | | `countryCode` | ``null`` \| `string` | the country code to set the country to | @@ -1224,66 +1271,70 @@ Set's the region of a cart. `Promise`<`void`\> -the result of the update operation +-`Promise`: the result of the update operation #### Defined in -[medusa/src/services/cart.ts:2410](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L2410) +[medusa/src/services/cart.ts:2408](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L2408) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### transformQueryForTotals\_ -▸ `Protected` **transformQueryForTotals_**(`config`): `FindConfig`<`Cart`\> & { `totalsToSelect`: `TotalField`[] } +`Protected` **transformQueryForTotals_**(`config`): `FindConfig`<`Cart`\> & { `totalsToSelect`: `TotalField`[] } #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `config` | `FindConfig`<`Cart`\> | #### Returns `FindConfig`<`Cart`\> & { `totalsToSelect`: `TotalField`[] } +-``FindConfig`<`Cart`\> & { `totalsToSelect`: `TotalField`[] }`: (optional) + #### Defined in -[medusa/src/services/cart.ts:2799](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L2799) +[medusa/src/services/cart.ts:2805](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L2805) ___ ### update -▸ **update**(`cartOrId`, `data`): `Promise`<`Cart`\> +**update**(`cartOrId`, `data`): `Promise`<`Cart`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `cartOrId` | `string` \| `Cart` | | `data` | `CartUpdateProps` | @@ -1291,22 +1342,25 @@ ___ `Promise`<`Cart`\> +-`Promise`: + -`Cart`: + #### Defined in -[medusa/src/services/cart.ts:1154](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L1154) +[medusa/src/services/cart.ts:1152](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L1152) ___ ### updateBillingAddress\_ -▸ `Protected` **updateBillingAddress_**(`cart`, `addressOrId`, `addrRepo`): `Promise`<`void`\> +`Protected` **updateBillingAddress_**(`cart`, `addressOrId`, `addrRepo`): `Promise`<`void`\> Updates the cart's billing address. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cart` | `Cart` | the cart to update | | `addressOrId` | `string` \| `AddressPayload` \| `Partial`<`Address`\> | the value to set the billing address to | | `addrRepo` | `Repository`<`Address`\> | the repository to use for address updates | @@ -1315,24 +1369,24 @@ Updates the cart's billing address. `Promise`<`void`\> -the result of the update operation +-`Promise`: the result of the update operation #### Defined in -[medusa/src/services/cart.ts:1402](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L1402) +[medusa/src/services/cart.ts:1400](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L1400) ___ ### updateCustomerId\_ -▸ `Protected` **updateCustomerId_**(`cart`, `customerId`): `Promise`<`void`\> +`Protected` **updateCustomerId_**(`cart`, `customerId`): `Promise`<`void`\> Sets the customer id of a cart #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cart` | `Cart` | the cart to add email to | | `customerId` | `string` | the customer to add to cart | @@ -1340,75 +1394,77 @@ Sets the customer id of a cart `Promise`<`void`\> -the result of the update operation +-`Promise`: the result of the update operation #### Defined in -[medusa/src/services/cart.ts:1357](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L1357) +[medusa/src/services/cart.ts:1355](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L1355) ___ ### updateLineItem -▸ **updateLineItem**(`cartId`, `lineItemId`, `update`): `Promise`<`Cart`\> +**updateLineItem**(`cartId`, `lineItemId`, `update`): `Promise`<`Cart`\> Updates a cart's existing line item. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartId` | `string` | the id of the cart to update | | `lineItemId` | `string` | the id of the line item to update. | -| `update` | `LineItemUpdate` | - | +| `update` | `LineItemUpdate` | #### Returns `Promise`<`Cart`\> -the result of the update operation +-`Promise`: the result of the update operation + -`Cart`: #### Defined in -[medusa/src/services/cart.ts:1001](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L1001) +[medusa/src/services/cart.ts:999](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L999) ___ ### updatePaymentSession -▸ **updatePaymentSession**(`cartId`, `update`): `Promise`<`Cart`\> +**updatePaymentSession**(`cartId`, `update`): `Promise`<`Cart`\> Updates the currently selected payment session. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartId` | `string` | the id of the cart to update the payment session for | -| `update` | `Record`<`string`, `unknown`\> | the data to update the payment session with | +| `update` | Record<`string`, `unknown`\> | the data to update the payment session with | #### Returns `Promise`<`Cart`\> -the resulting cart +-`Promise`: the resulting cart + -`Cart`: #### Defined in -[medusa/src/services/cart.ts:1665](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L1665) +[medusa/src/services/cart.ts:1663](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L1663) ___ ### updateShippingAddress\_ -▸ `Protected` **updateShippingAddress_**(`cart`, `addressOrId`, `addrRepo`): `Promise`<`void`\> +`Protected` **updateShippingAddress_**(`cart`, `addressOrId`, `addrRepo`): `Promise`<`void`\> Updates the cart's shipping address. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cart` | `Cart` | the cart to update | | `addressOrId` | `string` \| `AddressPayload` \| `Partial`<`Address`\> | the value to set the shipping address to | | `addrRepo` | `Repository`<`Address`\> | the repository to use for address updates | @@ -1417,22 +1473,22 @@ Updates the cart's shipping address. `Promise`<`void`\> -the result of the update operation +-`Promise`: the result of the update operation #### Defined in -[medusa/src/services/cart.ts:1440](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L1440) +[medusa/src/services/cart.ts:1438](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L1438) ___ ### updateUnitPrices\_ -▸ `Protected` **updateUnitPrices_**(`cart`, `regionId?`, `customer_id?`): `Promise`<`void`\> +`Protected` **updateUnitPrices_**(`cart`, `regionId?`, `customer_id?`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `cart` | `Cart` | | `regionId?` | `string` | | `customer_id?` | `string` | @@ -1441,41 +1497,44 @@ ___ `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/cart.ts:2331](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L2331) +[medusa/src/services/cart.ts:2329](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L2329) ___ ### validateLineItem -▸ `Protected` **validateLineItem**(`sales_channel_id`, `lineItem`): `Promise`<`boolean`\> +`Protected` **validateLineItem**(`sales_channel_id`, `lineItem`): `Promise`<`boolean`\> Check if line item's variant belongs to the cart's sales channel. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `sales_channel_id` | `Object` | the cart for the line item | -| `sales_channel_id.sales_channel_id` | ``null`` \| `string` | - | +| Name | Description | +| :------ | :------ | +| `sales_channel_id` | `object` | the cart for the line item | +| `sales_channel_id.sales_channel_id` | ``null`` \| `string` | | `lineItem` | `LineItemValidateData` | the line item being added | #### Returns `Promise`<`boolean`\> -a boolean indicating validation result +-`Promise`: a boolean indicating validation result + -`boolean`: (optional) #### Defined in -[medusa/src/services/cart.ts:620](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L620) +[medusa/src/services/cart.ts:618](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L618) ___ ### validateLineItemShipping\_ -▸ `Protected` **validateLineItemShipping_**(`shippingMethods`, `lineItemShippingProfiledId`): `boolean` +`Protected` **validateLineItemShipping_**(`shippingMethods`, `lineItemShippingProfiledId`): `boolean` Checks if a given line item has a shipping method that can fulfill it. Returns true if all products in the cart can be fulfilled with the current @@ -1483,41 +1542,43 @@ shipping methods. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `shippingMethods` | `ShippingMethod`[] | the set of shipping methods to check from | -| `lineItemShippingProfiledId` | `string` | - | +| `lineItemShippingProfiledId` | `string` | #### Returns `boolean` -boolean representing whether shipping method is validated +-`boolean`: (optional) boolean representing whether shipping method is validated #### Defined in -[medusa/src/services/cart.ts:591](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/cart.ts#L591) +[medusa/src/services/cart.ts:589](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/cart.ts#L589) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`CartService`](CartService.md) +**withTransaction**(`transactionManager?`): [`CartService`](CartService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`CartService`](CartService.md) +-`CartService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/ClaimItemService.md b/www/apps/docs/content/references/services/classes/ClaimItemService.md index 862b021d7714f..ff968c71a97e5 100644 --- a/www/apps/docs/content/references/services/classes/ClaimItemService.md +++ b/www/apps/docs/content/references/services/classes/ClaimItemService.md @@ -1,4 +1,4 @@ -# Class: ClaimItemService +# ClaimItemService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new ClaimItemService**(`«destructured»`) +**new ClaimItemService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `Object` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/claim-item.ts:26](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim-item.ts#L26) +[medusa/src/services/claim-item.ts:26](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim-item.ts#L26) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,63 +66,63 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### claimImageRepository\_ -• `Protected` `Readonly` **claimImageRepository\_**: `Repository`<`ClaimImage`\> + `Protected` `Readonly` **claimImageRepository\_**: `Repository`<`ClaimImage`\> #### Defined in -[medusa/src/services/claim-item.ts:24](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim-item.ts#L24) +[medusa/src/services/claim-item.ts:24](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim-item.ts#L24) ___ ### claimItemRepository\_ -• `Protected` `Readonly` **claimItemRepository\_**: `Repository`<`ClaimItem`\> + `Protected` `Readonly` **claimItemRepository\_**: `Repository`<`ClaimItem`\> #### Defined in -[medusa/src/services/claim-item.ts:22](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim-item.ts#L22) +[medusa/src/services/claim-item.ts:22](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim-item.ts#L22) ___ ### claimTagRepository\_ -• `Protected` `Readonly` **claimTagRepository\_**: `Repository`<`ClaimTag`\> + `Protected` `Readonly` **claimTagRepository\_**: `Repository`<`ClaimTag`\> #### Defined in -[medusa/src/services/claim-item.ts:23](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim-item.ts#L23) +[medusa/src/services/claim-item.ts:23](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim-item.ts#L23) ___ ### eventBus\_ -• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/claim-item.ts:21](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim-item.ts#L21) +[medusa/src/services/claim-item.ts:21](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim-item.ts#L21) ___ ### lineItemService\_ -• `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md) + `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md) #### Defined in -[medusa/src/services/claim-item.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim-item.ts#L20) +[medusa/src/services/claim-item.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim-item.ts#L20) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -130,13 +130,13 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -144,13 +144,13 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### Events -▪ `Static` **Events**: `Object` + `Static` **Events**: `Object` #### Type declaration @@ -162,47 +162,47 @@ ___ #### Defined in -[medusa/src/services/claim-item.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim-item.ts#L14) +[medusa/src/services/claim-item.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim-item.ts#L14) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -211,7 +211,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -219,38 +219,41 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**(`data`): `Promise`<`ClaimItem`\> +**create**(`data`): `Promise`<`ClaimItem`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `data` | `CreateClaimItemInput` | #### Returns `Promise`<`ClaimItem`\> +-`Promise`: + -`ClaimItem`: + #### Defined in -[medusa/src/services/claim-item.ts:43](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim-item.ts#L43) +[medusa/src/services/claim-item.ts:43](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim-item.ts#L43) ___ ### list -▸ **list**(`selector`, `config?`): `Promise`<`ClaimItem`[]\> +**list**(`selector`, `config?`): `Promise`<`ClaimItem`[]\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`ClaimItem`\> | the query object for find | | `config` | `FindConfig`<`ClaimItem`\> | the config object for find | @@ -258,24 +261,26 @@ ___ `Promise`<`ClaimItem`[]\> -the result of the find operation +-`Promise`: the result of the find operation + -`ClaimItem[]`: + -`ClaimItem`: #### Defined in -[medusa/src/services/claim-item.ts:205](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim-item.ts#L205) +[medusa/src/services/claim-item.ts:205](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim-item.ts#L205) ___ ### retrieve -▸ **retrieve**(`claimItemId`, `config?`): `Promise`<`ClaimItem`\> +**retrieve**(`claimItemId`, `config?`): `Promise`<`ClaimItem`\> Gets a claim item by id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `claimItemId` | `string` | id of ClaimItem to retrieve | | `config` | `FindConfig`<`ClaimItem`\> | configuration for the find operation | @@ -283,46 +288,49 @@ Gets a claim item by id. `Promise`<`ClaimItem`\> -the ClaimItem +-`Promise`: the ClaimItem + -`ClaimItem`: #### Defined in -[medusa/src/services/claim-item.ts:224](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim-item.ts#L224) +[medusa/src/services/claim-item.ts:224](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim-item.ts#L224) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`id`, `data`): `Promise`<`ClaimItem`\> +**update**(`id`, `data`): `Promise`<`ClaimItem`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `id` | `any` | | `data` | `any` | @@ -330,30 +338,35 @@ ___ `Promise`<`ClaimItem`\> +-`Promise`: + -`ClaimItem`: + #### Defined in -[medusa/src/services/claim-item.ts:127](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim-item.ts#L127) +[medusa/src/services/claim-item.ts:127](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim-item.ts#L127) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`ClaimItemService`](ClaimItemService.md) +**withTransaction**(`transactionManager?`): [`ClaimItemService`](ClaimItemService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`ClaimItemService`](ClaimItemService.md) +-`ClaimItemService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/ClaimService.md b/www/apps/docs/content/references/services/classes/ClaimService.md index d3aa02598611d..bfa2680646724 100644 --- a/www/apps/docs/content/references/services/classes/ClaimService.md +++ b/www/apps/docs/content/references/services/classes/ClaimService.md @@ -1,4 +1,4 @@ -# Class: ClaimService +# ClaimService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new ClaimService**(`«destructured»`) +**new ClaimService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/claim.ts:86](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L86) +[medusa/src/services/claim.ts:86](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L86) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,93 +66,93 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### addressRepository\_ -• `Protected` `Readonly` **addressRepository\_**: `Repository`<`Address`\> + `Protected` `Readonly` **addressRepository\_**: `Repository`<`Address`\> #### Defined in -[medusa/src/services/claim.ts:68](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L68) +[medusa/src/services/claim.ts:68](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L68) ___ ### claimItemService\_ -• `Protected` `Readonly` **claimItemService\_**: [`ClaimItemService`](ClaimItemService.md) + `Protected` `Readonly` **claimItemService\_**: [`ClaimItemService`](ClaimItemService.md) #### Defined in -[medusa/src/services/claim.ts:72](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L72) +[medusa/src/services/claim.ts:72](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L72) ___ ### claimRepository\_ -• `Protected` `Readonly` **claimRepository\_**: `Repository`<`ClaimOrder`\> + `Protected` `Readonly` **claimRepository\_**: `Repository`<`ClaimOrder`\> #### Defined in -[medusa/src/services/claim.ts:69](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L69) +[medusa/src/services/claim.ts:69](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L69) ___ ### eventBus\_ -• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/claim.ts:73](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L73) +[medusa/src/services/claim.ts:73](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L73) ___ ### fulfillmentProviderService\_ -• `Protected` `Readonly` **fulfillmentProviderService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md) + `Protected` `Readonly` **fulfillmentProviderService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md) #### Defined in -[medusa/src/services/claim.ts:74](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L74) +[medusa/src/services/claim.ts:74](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L74) ___ ### fulfillmentService\_ -• `Protected` `Readonly` **fulfillmentService\_**: [`FulfillmentService`](FulfillmentService.md) + `Protected` `Readonly` **fulfillmentService\_**: [`FulfillmentService`](FulfillmentService.md) #### Defined in -[medusa/src/services/claim.ts:75](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L75) +[medusa/src/services/claim.ts:75](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L75) ___ ### lineItemRepository\_ -• `Protected` `Readonly` **lineItemRepository\_**: `Repository`<`LineItem`\> & { `findByReturn`: (`returnId`: `string`) => `Promise`<`LineItem` & { `return_item`: `ReturnItem` }[]\> } + `Protected` `Readonly` **lineItemRepository\_**: `Repository`<`LineItem`\> & { `findByReturn`: Method findByReturn } #### Defined in -[medusa/src/services/claim.ts:71](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L71) +[medusa/src/services/claim.ts:71](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L71) ___ ### lineItemService\_ -• `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md) + `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md) #### Defined in -[medusa/src/services/claim.ts:76](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L76) +[medusa/src/services/claim.ts:76](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L76) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -160,93 +160,93 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### paymentProviderService\_ -• `Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md) + `Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md) #### Defined in -[medusa/src/services/claim.ts:77](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L77) +[medusa/src/services/claim.ts:77](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L77) ___ ### productVariantInventoryService\_ -• `Protected` `Readonly` **productVariantInventoryService\_**: [`ProductVariantInventoryService`](ProductVariantInventoryService.md) + `Protected` `Readonly` **productVariantInventoryService\_**: [`ProductVariantInventoryService`](ProductVariantInventoryService.md) #### Defined in -[medusa/src/services/claim.ts:84](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L84) +[medusa/src/services/claim.ts:84](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L84) ___ ### regionService\_ -• `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md) + `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md) #### Defined in -[medusa/src/services/claim.ts:78](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L78) +[medusa/src/services/claim.ts:78](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L78) ___ ### returnService\_ -• `Protected` `Readonly` **returnService\_**: [`ReturnService`](ReturnService.md) + `Protected` `Readonly` **returnService\_**: [`ReturnService`](ReturnService.md) #### Defined in -[medusa/src/services/claim.ts:79](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L79) +[medusa/src/services/claim.ts:79](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L79) ___ ### shippingMethodRepository\_ -• `Protected` `Readonly` **shippingMethodRepository\_**: `Repository`<`ShippingMethod`\> + `Protected` `Readonly` **shippingMethodRepository\_**: `Repository`<`ShippingMethod`\> #### Defined in -[medusa/src/services/claim.ts:70](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L70) +[medusa/src/services/claim.ts:70](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L70) ___ ### shippingOptionService\_ -• `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md) + `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md) #### Defined in -[medusa/src/services/claim.ts:80](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L80) +[medusa/src/services/claim.ts:80](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L80) ___ ### taxProviderService\_ -• `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md) + `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md) #### Defined in -[medusa/src/services/claim.ts:81](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L81) +[medusa/src/services/claim.ts:81](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L81) ___ ### totalsService\_ -• `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md) + `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md) #### Defined in -[medusa/src/services/claim.ts:82](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L82) +[medusa/src/services/claim.ts:82](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L82) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -254,13 +254,13 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### Events -▪ `Static` `Readonly` **Events**: `Object` + `Static` `Readonly` **Events**: `Object` #### Type declaration @@ -275,47 +275,47 @@ ___ #### Defined in -[medusa/src/services/claim.ts:59](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L59) +[medusa/src/services/claim.ts:59](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L59) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -324,7 +324,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -332,53 +332,59 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### cancel -▸ **cancel**(`id`): `Promise`<`ClaimOrder`\> +**cancel**(`id`): `Promise`<`ClaimOrder`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `id` | `string` | #### Returns `Promise`<`ClaimOrder`\> +-`Promise`: + -`ClaimOrder`: + #### Defined in -[medusa/src/services/claim.ts:814](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L814) +[medusa/src/services/claim.ts:814](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L814) ___ ### cancelFulfillment -▸ **cancelFulfillment**(`fulfillmentId`): `Promise`<`ClaimOrder`\> +**cancelFulfillment**(`fulfillmentId`): `Promise`<`ClaimOrder`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `fulfillmentId` | `string` | #### Returns `Promise`<`ClaimOrder`\> +-`Promise`: + -`ClaimOrder`: + #### Defined in -[medusa/src/services/claim.ts:662](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L662) +[medusa/src/services/claim.ts:662](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L662) ___ ### create -▸ **create**(`data`): `Promise`<`ClaimOrder`\> +**create**(`data`): `Promise`<`ClaimOrder`\> Creates a Claim on an Order. Claims consists of items that are claimed and optionally items to be sent as replacement for the claimed items. The @@ -386,76 +392,81 @@ shipping address that the new items will be shipped to #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `data` | `CreateClaimInput` | the object containing all data required to create a claim | #### Returns `Promise`<`ClaimOrder`\> -created claim +-`Promise`: created claim + -`ClaimOrder`: #### Defined in -[medusa/src/services/claim.ts:331](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L331) +[medusa/src/services/claim.ts:331](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L331) ___ ### createFulfillment -▸ **createFulfillment**(`id`, `config?`): `Promise`<`ClaimOrder`\> +**createFulfillment**(`id`, `config?`): `Promise`<`ClaimOrder`\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `id` | `string` | the object containing all data required to create a claim | -| `config` | `Object` | config object | -| `config.location_id?` | `string` | - | -| `config.metadata?` | `Record`<`string`, `unknown`\> | config metadata | +| `config` | `object` | config object | +| `config.location_id?` | `string` | +| `config.metadata?` | Record<`string`, `unknown`\> | config metadata | | `config.no_notification?` | `boolean` | config no notification | #### Returns `Promise`<`ClaimOrder`\> -created claim +-`Promise`: created claim + -`ClaimOrder`: #### Defined in -[medusa/src/services/claim.ts:512](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L512) +[medusa/src/services/claim.ts:512](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L512) ___ ### createShipment -▸ **createShipment**(`id`, `fulfillmentId`, `trackingLinks?`, `config?`): `Promise`<`ClaimOrder`\> +**createShipment**(`id`, `fulfillmentId`, `trackingLinks?`, `config?`): `Promise`<`ClaimOrder`\> #### Parameters -| Name | Type | Default value | -| :------ | :------ | :------ | -| `id` | `string` | `undefined` | -| `fulfillmentId` | `string` | `undefined` | +| Name | Default value | +| :------ | :------ | +| `id` | `string` | +| `fulfillmentId` | `string` | | `trackingLinks` | { `tracking_number`: `string` }[] | `[]` | -| `config` | `Object` | `undefined` | -| `config.metadata` | `Object` | `{}` | +| `config` | `object` | +| `config.metadata` | `object` | | `config.no_notification` | `undefined` | `undefined` | #### Returns `Promise`<`ClaimOrder`\> +-`Promise`: + -`ClaimOrder`: + #### Defined in -[medusa/src/services/claim.ts:734](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L734) +[medusa/src/services/claim.ts:734](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L734) ___ ### getRefundTotalForClaimLinesOnOrder -▸ `Protected` **getRefundTotalForClaimLinesOnOrder**(`order`, `claimItems`): `Promise`<`number`\> +`Protected` **getRefundTotalForClaimLinesOnOrder**(`order`, `claimItems`): `Promise`<`number`\> Finds claim line items on an order and calculates the refund amount. There are three places too look: @@ -466,8 +477,8 @@ Note, it will attempt to return early from each of these places to avoid having #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `order` | `Order` | the order to find claim lines on | | `claimItems` | `CreateClaimItemInput`[] | the claim items to match against | @@ -475,22 +486,23 @@ Note, it will attempt to return early from each of these places to avoid having `Promise`<`number`\> -the refund amount +-`Promise`: the refund amount + -`number`: (optional) #### Defined in -[medusa/src/services/claim.ts:273](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L273) +[medusa/src/services/claim.ts:273](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L273) ___ ### list -▸ **list**(`selector`, `config?`): `Promise`<`ClaimOrder`[]\> +**list**(`selector`, `config?`): `Promise`<`ClaimOrder`[]\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `any` | the query object for find | | `config` | `FindConfig`<`ClaimOrder`\> | the config object containing query settings | @@ -498,44 +510,49 @@ ___ `Promise`<`ClaimOrder`[]\> -the result of the find operation +-`Promise`: the result of the find operation + -`ClaimOrder[]`: + -`ClaimOrder`: #### Defined in -[medusa/src/services/claim.ts:870](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L870) +[medusa/src/services/claim.ts:870](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L870) ___ ### processRefund -▸ **processRefund**(`id`): `Promise`<`ClaimOrder`\> +**processRefund**(`id`): `Promise`<`ClaimOrder`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `id` | `string` | #### Returns `Promise`<`ClaimOrder`\> +-`Promise`: + -`ClaimOrder`: + #### Defined in -[medusa/src/services/claim.ts:688](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L688) +[medusa/src/services/claim.ts:688](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L688) ___ ### retrieve -▸ **retrieve**(`claimId`, `config?`): `Promise`<`ClaimOrder`\> +**retrieve**(`claimId`, `config?`): `Promise`<`ClaimOrder`\> Gets an order by id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `claimId` | `string` | id of the claim order to retrieve | | `config` | `FindConfig`<`ClaimOrder`\> | the config object containing query settings | @@ -543,46 +560,49 @@ Gets an order by id. `Promise`<`ClaimOrder`\> -the order document +-`Promise`: the order document + -`ClaimOrder`: #### Defined in -[medusa/src/services/claim.ts:889](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L889) +[medusa/src/services/claim.ts:889](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L889) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`id`, `data`): `Promise`<`ClaimOrder`\> +**update**(`id`, `data`): `Promise`<`ClaimOrder`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `id` | `string` | | `data` | `UpdateClaimInput` | @@ -590,50 +610,57 @@ ___ `Promise`<`ClaimOrder`\> +-`Promise`: + -`ClaimOrder`: + #### Defined in -[medusa/src/services/claim.ts:125](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L125) +[medusa/src/services/claim.ts:125](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L125) ___ ### validateCreateClaimInput -▸ `Protected` **validateCreateClaimInput**(`data`): `Promise`<`void`\> +`Protected` **validateCreateClaimInput**(`data`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `data` | `CreateClaimInput` | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/claim.ts:206](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/claim.ts#L206) +[medusa/src/services/claim.ts:206](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/claim.ts#L206) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`ClaimService`](ClaimService.md) +**withTransaction**(`transactionManager?`): [`ClaimService`](ClaimService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`ClaimService`](ClaimService.md) +-`default`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/CurrencyService.md b/www/apps/docs/content/references/services/classes/CurrencyService.md index 47803974ca51f..b75178e227543 100644 --- a/www/apps/docs/content/references/services/classes/CurrencyService.md +++ b/www/apps/docs/content/references/services/classes/CurrencyService.md @@ -1,4 +1,4 @@ -# Class: CurrencyService +# CurrencyService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new CurrencyService**(`«destructured»`) +**new CurrencyService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/currency.ts:29](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/currency.ts#L29) +[medusa/src/services/currency.ts:29](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/currency.ts#L29) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,43 +66,43 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### currencyRepository\_ -• `Protected` `Readonly` **currencyRepository\_**: `Repository`<`Currency`\> + `Protected` `Readonly` **currencyRepository\_**: `Repository`<`Currency`\> #### Defined in -[medusa/src/services/currency.ts:25](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/currency.ts#L25) +[medusa/src/services/currency.ts:25](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/currency.ts#L25) ___ ### eventBusService\_ -• `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/currency.ts:26](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/currency.ts#L26) +[medusa/src/services/currency.ts:26](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/currency.ts#L26) ___ ### featureFlagRouter\_ -• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` + `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` #### Defined in -[medusa/src/services/currency.ts:27](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/currency.ts#L27) +[medusa/src/services/currency.ts:27](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/currency.ts#L27) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -110,13 +110,13 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -124,13 +124,13 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### Events -▪ `Static` `Readonly` **Events**: `Object` + `Static` `Readonly` **Events**: `Object` #### Type declaration @@ -140,47 +140,47 @@ ___ #### Defined in -[medusa/src/services/currency.ts:21](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/currency.ts#L21) +[medusa/src/services/currency.ts:21](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/currency.ts#L21) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -189,7 +189,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -197,21 +197,21 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### listAndCount -▸ **listAndCount**(`selector`, `config?`): `Promise`<[`Currency`[], `number`]\> +**listAndCount**(`selector`, `config?`): `Promise`<[`Currency`[], `number`]\> Lists currencies based on the provided parameters and includes the count of currencies that match the query. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`Currency`\> | an object that defines rules to filter currencies by | | `config` | `FindConfig`<`Currency`\> | object that defines the scope for what should be returned | @@ -219,74 +219,79 @@ currencies that match the query. `Promise`<[`Currency`[], `number`]\> -an array containing the currencies as +-`Promise`: an array containing the currencies as the first element and the total count of products that matches the query as the second element. + -`Currency[]`: + -`number`: (optional) #### Defined in -[medusa/src/services/currency.ts:78](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/currency.ts#L78) +[medusa/src/services/currency.ts:78](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/currency.ts#L78) ___ ### retrieveByCode -▸ **retrieveByCode**(`code`): `Promise`<`Currency`\> +**retrieveByCode**(`code`): `Promise`<`Currency`\> Return the currency #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `code` | `string` | The code of the currency that must be retrieve | #### Returns `Promise`<`Currency`\> -The currency +-`Promise`: The currency + -`Currency`: #### Defined in -[medusa/src/services/currency.ts:47](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/currency.ts#L47) +[medusa/src/services/currency.ts:47](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/currency.ts#L47) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`code`, `data`): `Promise`<`undefined` \| `Currency`\> +**update**(`code`, `data`): `Promise`<`undefined` \| `Currency`\> Update a currency #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `code` | `string` | The code of the currency to update | | `data` | `UpdateCurrencyInput` | The data that must be updated on the currency | @@ -294,32 +299,35 @@ Update a currency `Promise`<`undefined` \| `Currency`\> -The updated currency +-`Promise`: The updated currency + -`undefined \| Currency`: (optional) #### Defined in -[medusa/src/services/currency.ts:100](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/currency.ts#L100) +[medusa/src/services/currency.ts:100](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/currency.ts#L100) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`CurrencyService`](CurrencyService.md) +**withTransaction**(`transactionManager?`): [`CurrencyService`](CurrencyService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`CurrencyService`](CurrencyService.md) +-`default`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/CustomShippingOptionService.md b/www/apps/docs/content/references/services/classes/CustomShippingOptionService.md index 3a7f8cdbfeda3..4c121f606ac12 100644 --- a/www/apps/docs/content/references/services/classes/CustomShippingOptionService.md +++ b/www/apps/docs/content/references/services/classes/CustomShippingOptionService.md @@ -1,4 +1,4 @@ -# Class: CustomShippingOptionService +# CustomShippingOptionService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new CustomShippingOptionService**(`«destructured»`) +**new CustomShippingOptionService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/custom-shipping-option.ts:18](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/custom-shipping-option.ts#L18) +[medusa/src/services/custom-shipping-option.ts:18](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/custom-shipping-option.ts#L18) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,23 +66,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### customShippingOptionRepository\_ -• `Protected` **customShippingOptionRepository\_**: `Repository`<`CustomShippingOption`\> + `Protected` **customShippingOptionRepository\_**: `Repository`<`CustomShippingOption`\> #### Defined in -[medusa/src/services/custom-shipping-option.ts:16](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/custom-shipping-option.ts#L16) +[medusa/src/services/custom-shipping-option.ts:16](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/custom-shipping-option.ts#L16) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -90,13 +90,13 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -104,47 +104,47 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -153,7 +153,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -161,51 +161,49 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**<`T`, `TResult`\>(`data`): `Promise`<`TResult`\> +**create**<`T`, `TResult`\>(`data`): `Promise`<`TResult`\> Creates a custom shipping option -#### Type parameters - | Name | Type | | :------ | :------ | -| `T` | `CreateCustomShippingOptionInput` \| `CreateCustomShippingOptionInput`[] | -| `TResult` | `T` extends `CreateCustomShippingOptionInput`[] ? `CustomShippingOption`[] : `CustomShippingOption` | +| `T` | `object` | +| `TResult` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `data` | `T` | the custom shipping option to create | #### Returns `Promise`<`TResult`\> -resolves to the creation result +-`Promise`: resolves to the creation result #### Defined in -[medusa/src/services/custom-shipping-option.ts:80](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/custom-shipping-option.ts#L80) +[medusa/src/services/custom-shipping-option.ts:80](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/custom-shipping-option.ts#L80) ___ ### list -▸ **list**(`selector`, `config?`): `Promise`<`CustomShippingOption`[]\> +**list**(`selector`, `config?`): `Promise`<`CustomShippingOption`[]\> Fetches all custom shipping options based on the given selector #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`CustomShippingOption`\> | the query object for find | | `config` | `FindConfig`<`CustomShippingOption`\> | the configuration used to find the objects. contains relations, skip, and take. | @@ -213,24 +211,26 @@ Fetches all custom shipping options based on the given selector `Promise`<`CustomShippingOption`[]\> -custom shipping options matching the query +-`Promise`: custom shipping options matching the query + -`CustomShippingOption[]`: + -`CustomShippingOption`: #### Defined in -[medusa/src/services/custom-shipping-option.ts:58](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/custom-shipping-option.ts#L58) +[medusa/src/services/custom-shipping-option.ts:58](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/custom-shipping-option.ts#L58) ___ ### retrieve -▸ **retrieve**(`id`, `config?`): `Promise`<`CustomShippingOption`\> +**retrieve**(`id`, `config?`): `Promise`<`CustomShippingOption`\> Retrieves a specific shipping option. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `id` | `string` | the id of the custom shipping option to retrieve. | | `config` | `FindConfig`<`CustomShippingOption`\> | any options needed to query for the result. | @@ -238,56 +238,61 @@ Retrieves a specific shipping option. `Promise`<`CustomShippingOption`\> -the requested custom shipping option. +-`Promise`: the requested custom shipping option. + -`CustomShippingOption`: #### Defined in -[medusa/src/services/custom-shipping-option.ts:31](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/custom-shipping-option.ts#L31) +[medusa/src/services/custom-shipping-option.ts:31](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/custom-shipping-option.ts#L31) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`CustomShippingOptionService`](CustomShippingOptionService.md) +**withTransaction**(`transactionManager?`): [`CustomShippingOptionService`](CustomShippingOptionService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`CustomShippingOptionService`](CustomShippingOptionService.md) +-`CustomShippingOptionService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/CustomerGroupService.md b/www/apps/docs/content/references/services/classes/CustomerGroupService.md index 0850b7d624b19..e0bc172f372bd 100644 --- a/www/apps/docs/content/references/services/classes/CustomerGroupService.md +++ b/www/apps/docs/content/references/services/classes/CustomerGroupService.md @@ -1,4 +1,4 @@ -# Class: CustomerGroupService +# CustomerGroupService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new CustomerGroupService**(`«destructured»`) +**new CustomerGroupService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `CustomerGroupConstructorProps` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/customer-group.ts:24](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L24) +[medusa/src/services/customer-group.ts:24](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L24) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,33 +66,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### customerGroupRepository\_ -• `Protected` `Readonly` **customerGroupRepository\_**: `Repository`<`CustomerGroup`\> & { `addCustomers`: (`groupId`: `string`, `customerIds`: `string`[]) => `Promise`<`CustomerGroup`\> ; `findWithRelationsAndCount`: (`relations`: `FindOptionsRelations`<`CustomerGroup`\>, `idsOrOptionsWithoutRelations`: `string`[] \| `FindWithoutRelationsOptions`) => `Promise`<[`CustomerGroup`[], `number`]\> ; `removeCustomers`: (`groupId`: `string`, `customerIds`: `string`[]) => `Promise`<`DeleteResult`\> } + `Protected` `Readonly` **customerGroupRepository\_**: `Repository`<`CustomerGroup`\> & { `addCustomers`: Method addCustomers ; `findWithRelationsAndCount`: Method findWithRelationsAndCount ; `removeCustomers`: Method removeCustomers } #### Defined in -[medusa/src/services/customer-group.ts:21](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L21) +[medusa/src/services/customer-group.ts:21](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L21) ___ ### customerService\_ -• `Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md) + `Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md) #### Defined in -[medusa/src/services/customer-group.ts:22](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L22) +[medusa/src/services/customer-group.ts:22](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L22) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -100,13 +100,13 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -114,38 +114,40 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### addCustomers -▸ **addCustomers**(`id`, `customerIds`): `Promise`<`CustomerGroup`\> +**addCustomers**(`id`, `customerIds`): `Promise`<`CustomerGroup`\> Add a batch of customers to a customer group at once #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `id` | `string` | id of the customer group to add customers to | | `customerIds` | `string` \| `string`[] | customer id's to add to the group | @@ -153,33 +155,32 @@ Add a batch of customers to a customer group at once `Promise`<`CustomerGroup`\> -the customer group after insertion +-`Promise`: the customer group after insertion + -`CustomerGroup`: #### Defined in -[medusa/src/services/customer-group.ts:89](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L89) +[medusa/src/services/customer-group.ts:89](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L89) ___ ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -188,7 +189,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -196,66 +197,67 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**(`group`): `Promise`<`CustomerGroup`\> +**create**(`group`): `Promise`<`CustomerGroup`\> Creates a customer group with the provided data. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `group` | `DeepPartial`<`CustomerGroup`\> | the customer group to create | #### Returns `Promise`<`CustomerGroup`\> -the result of the create operation +-`Promise`: the result of the create operation + -`CustomerGroup`: #### Defined in -[medusa/src/services/customer-group.ts:65](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L65) +[medusa/src/services/customer-group.ts:65](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L65) ___ ### delete -▸ **delete**(`groupId`): `Promise`<`void`\> +**delete**(`groupId`): `Promise`<`void`\> Remove customer group #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `groupId` | `string` | id of the customer group to delete | #### Returns `Promise`<`void`\> -a promise +-`Promise`: a promise #### Defined in -[medusa/src/services/customer-group.ts:153](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L153) +[medusa/src/services/customer-group.ts:153](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L153) ___ ### handleCreationFail -▸ `Private` **handleCreationFail**(`id`, `ids`, `error`): `Promise`<`never`\> +`Private` **handleCreationFail**(`id`, `ids`, `error`): `Promise`<`never`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `id` | `string` | | `ids` | `string`[] | | `error` | `any` | @@ -264,22 +266,25 @@ ___ `Promise`<`never`\> +-`Promise`: + -`never`: (optional) + #### Defined in -[medusa/src/services/customer-group.ts:257](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L257) +[medusa/src/services/customer-group.ts:257](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L257) ___ ### list -▸ **list**(`selector?`, `config`): `Promise`<`CustomerGroup`[]\> +**list**(`selector?`, `config`): `Promise`<`CustomerGroup`[]\> List customer groups. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`CustomerGroup`\> & { `discount_condition_id?`: `string` ; `q?`: `string` } | the query object for find | | `config` | `FindConfig`<`CustomerGroup`\> | the config to be used for find | @@ -287,24 +292,26 @@ List customer groups. `Promise`<`CustomerGroup`[]\> -the result of the find operation +-`Promise`: the result of the find operation + -`CustomerGroup[]`: + -`CustomerGroup`: #### Defined in -[medusa/src/services/customer-group.ts:176](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L176) +[medusa/src/services/customer-group.ts:176](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L176) ___ ### listAndCount -▸ **listAndCount**(`selector?`, `config`): `Promise`<[`CustomerGroup`[], `number`]\> +**listAndCount**(`selector?`, `config`): `Promise`<[`CustomerGroup`[], `number`]\> Retrieve a list of customer groups and total count of records that match the query. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`CustomerGroup`\> & { `discount_condition_id?`: `string` ; `q?`: `string` } | the query object for find | | `config` | `FindConfig`<`CustomerGroup`\> | the config to be used for find | @@ -312,24 +319,26 @@ Retrieve a list of customer groups and total count of records that match the que `Promise`<[`CustomerGroup`[], `number`]\> -the result of the find operation +-`Promise`: the result of the find operation + -`CustomerGroup[]`: + -`number`: (optional) #### Defined in -[medusa/src/services/customer-group.ts:194](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L194) +[medusa/src/services/customer-group.ts:194](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L194) ___ ### removeCustomer -▸ **removeCustomer**(`id`, `customerIds`): `Promise`<`CustomerGroup`\> +**removeCustomer**(`id`, `customerIds`): `Promise`<`CustomerGroup`\> Remove list of customers from a customergroup #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `id` | `string` | id of the customer group from which the customers are removed | | `customerIds` | `string` \| `string`[] | id's of the customer to remove from group | @@ -337,69 +346,75 @@ Remove list of customers from a customergroup `Promise`<`CustomerGroup`\> -the customergroup with the provided id +-`Promise`: the customergroup with the provided id + -`CustomerGroup`: #### Defined in -[medusa/src/services/customer-group.ts:236](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L236) +[medusa/src/services/customer-group.ts:236](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L236) ___ ### retrieve -▸ **retrieve**(`customerGroupId`, `config?`): `Promise`<`CustomerGroup`\> +**retrieve**(`customerGroupId`, `config?`): `Promise`<`CustomerGroup`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `customerGroupId` | `string` | -| `config` | `Object` | +| `config` | `object` | #### Returns `Promise`<`CustomerGroup`\> +-`Promise`: + -`CustomerGroup`: + #### Defined in -[medusa/src/services/customer-group.ts:35](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L35) +[medusa/src/services/customer-group.ts:35](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L35) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`customerGroupId`, `update`): `Promise`<`CustomerGroup`\> +**update**(`customerGroupId`, `update`): `Promise`<`CustomerGroup`\> Update a customer group. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `customerGroupId` | `string` | id of the customer group | | `update` | `CustomerGroupUpdate` | customer group partial data | @@ -407,32 +422,35 @@ Update a customer group. `Promise`<`CustomerGroup`\> -resulting customer group +-`Promise`: resulting customer group + -`CustomerGroup`: #### Defined in -[medusa/src/services/customer-group.ts:120](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer-group.ts#L120) +[medusa/src/services/customer-group.ts:120](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer-group.ts#L120) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`CustomerGroupService`](CustomerGroupService.md) +**withTransaction**(`transactionManager?`): [`CustomerGroupService`](CustomerGroupService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`CustomerGroupService`](CustomerGroupService.md) +-`CustomerGroupService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/CustomerService.md b/www/apps/docs/content/references/services/classes/CustomerService.md index 9c2d944a16b68..b8178b4af396c 100644 --- a/www/apps/docs/content/references/services/classes/CustomerService.md +++ b/www/apps/docs/content/references/services/classes/CustomerService.md @@ -1,4 +1,4 @@ -# Class: CustomerService +# CustomerService Provides layer to manipulate customers. @@ -12,12 +12,12 @@ Provides layer to manipulate customers. ### constructor -• **new CustomerService**(`«destructured»`) +**new CustomerService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -26,13 +26,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/customer.ts:46](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L46) +[medusa/src/services/customer.ts:46](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L46) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -68,43 +68,43 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### addressRepository\_ -• `Protected` `Readonly` **addressRepository\_**: `Repository`<`Address`\> + `Protected` `Readonly` **addressRepository\_**: `Repository`<`Address`\> #### Defined in -[medusa/src/services/customer.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L37) +[medusa/src/services/customer.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L37) ___ ### customerRepository\_ -• `Protected` `Readonly` **customerRepository\_**: `Repository`<`Customer`\> & { `listAndCount`: (`query`: `Object`, `q`: `undefined` \| `string`) => `Promise`<[`Customer`[], `number`]\> } + `Protected` `Readonly` **customerRepository\_**: `Repository`<`Customer`\> & { `listAndCount`: Method listAndCount } #### Defined in -[medusa/src/services/customer.ts:36](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L36) +[medusa/src/services/customer.ts:36](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L36) ___ ### eventBusService\_ -• `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/customer.ts:38](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L38) +[medusa/src/services/customer.ts:38](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L38) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -112,13 +112,13 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -126,13 +126,13 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### Events -▪ `Static` **Events**: `Object` + `Static` **Events**: `Object` #### Type declaration @@ -144,36 +144,38 @@ ___ #### Defined in -[medusa/src/services/customer.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L40) +[medusa/src/services/customer.ts:40](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L40) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### addAddress -▸ **addAddress**(`customerId`, `address`): `Promise`<`Customer` \| `Address`\> +**addAddress**(`customerId`, `address`): `Promise`<`Customer` \| `Address`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `customerId` | `string` | | `address` | `AddressCreatePayload` | @@ -181,31 +183,32 @@ TransactionBaseService.activeManager\_ `Promise`<`Customer` \| `Address`\> +-`Promise`: + -`Customer \| Address`: (optional) + #### Defined in -[medusa/src/services/customer.ts:519](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L519) +[medusa/src/services/customer.ts:519](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L519) ___ ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -214,7 +217,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -222,13 +225,13 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### count -▸ **count**(): `Promise`<`number`\> +**count**(): `Promise`<`number`\> Return the total number of documents in database @@ -236,17 +239,18 @@ Return the total number of documents in database `Promise`<`number`\> -the result of the count operation +-`Promise`: the result of the count operation + -`number`: (optional) #### Defined in -[medusa/src/services/customer.ts:178](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L178) +[medusa/src/services/customer.ts:178](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L178) ___ ### create -▸ **create**(`customer`): `Promise`<`Customer`\> +**create**(`customer`): `Promise`<`Customer`\> Creates a customer from an email - customers can have accounts associated, e.g. to login and view order history, etc. If a password is provided the @@ -255,49 +259,51 @@ used to hold details of customers. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `customer` | `CreateCustomerInput` | the customer to create | #### Returns `Promise`<`Customer`\> -the result of create +-`Promise`: the result of create + -`Customer`: #### Defined in -[medusa/src/services/customer.ts:306](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L306) +[medusa/src/services/customer.ts:306](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L306) ___ ### delete -▸ **delete**(`customerId`): `Promise`<`void` \| `Customer`\> +**delete**(`customerId`): `Promise`<`void` \| `Customer`\> Deletes a customer from a given customer id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `customerId` | `string` | the id of the customer to delete. Must be castable as an ObjectId | #### Returns `Promise`<`void` \| `Customer`\> -the result of the delete operation. +-`Promise`: the result of the delete operation. + -`void \| Customer`: (optional) #### Defined in -[medusa/src/services/customer.ts:565](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L565) +[medusa/src/services/customer.ts:565](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L565) ___ ### generateResetPasswordToken -▸ **generateResetPasswordToken**(`customerId`): `Promise`<`string`\> +**generateResetPasswordToken**(`customerId`): `Promise`<`string`\> Generate a JSON Web token, that will be sent to a customer, that wishes to reset password. @@ -307,54 +313,56 @@ which is always 15 minutes. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `customerId` | `string` | the customer to reset the password for | #### Returns `Promise`<`string`\> -the generated JSON web token +-`Promise`: the generated JSON web token + -`string`: (optional) #### Defined in -[medusa/src/services/customer.ts:68](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L68) +[medusa/src/services/customer.ts:68](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L68) ___ ### hashPassword\_ -▸ **hashPassword_**(`password`): `Promise`<`string`\> +**hashPassword_**(`password`): `Promise`<`string`\> Hashes a password #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `password` | `string` | the value to hash | #### Returns `Promise`<`string`\> -hashed password +-`Promise`: hashed password + -`string`: (optional) #### Defined in -[medusa/src/services/customer.ts:293](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L293) +[medusa/src/services/customer.ts:293](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L293) ___ ### list -▸ **list**(`selector?`, `config?`): `Promise`<`Customer`[]\> +**list**(`selector?`, `config?`): `Promise`<`Customer`[]\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`Customer`\> & { `groups?`: `string`[] ; `q?`: `string` } | the query object for find | | `config` | `FindConfig`<`Customer`\> | the config object containing query settings | @@ -362,22 +370,24 @@ ___ `Promise`<`Customer`[]\> -the result of the find operation +-`Promise`: the result of the find operation + -`Customer[]`: + -`Customer`: #### Defined in -[medusa/src/services/customer.ts:111](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L111) +[medusa/src/services/customer.ts:111](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L111) ___ ### listAndCount -▸ **listAndCount**(`selector`, `config?`): `Promise`<[`Customer`[], `number`]\> +**listAndCount**(`selector`, `config?`): `Promise`<[`Customer`[], `number`]\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`Customer`\> & { `groups?`: `string`[] ; `q?`: `string` } | the query object for find | | `config` | `FindConfig`<`Customer`\> | the config object containing query settings | @@ -385,22 +395,24 @@ ___ `Promise`<[`Customer`[], `number`]\> -the result of the find operation +-`Promise`: the result of the find operation + -`Customer[]`: + -`number`: (optional) #### Defined in -[medusa/src/services/customer.ts:143](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L143) +[medusa/src/services/customer.ts:143](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L143) ___ ### listByEmail -▸ **listByEmail**(`email`, `config?`): `Promise`<`Customer`[]\> +**listByEmail**(`email`, `config?`): `Promise`<`Customer`[]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `email` | `string` | | `config` | `FindConfig`<`Customer`\> | @@ -408,20 +420,24 @@ ___ `Promise`<`Customer`[]\> +-`Promise`: + -`Customer[]`: + -`Customer`: + #### Defined in -[medusa/src/services/customer.ts:249](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L249) +[medusa/src/services/customer.ts:249](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L249) ___ ### removeAddress -▸ **removeAddress**(`customerId`, `addressId`): `Promise`<`void`\> +**removeAddress**(`customerId`, `addressId`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `customerId` | `string` | | `addressId` | `string` | @@ -429,22 +445,24 @@ ___ `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/customer.ts:502](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L502) +[medusa/src/services/customer.ts:502](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L502) ___ ### retrieve -▸ **retrieve**(`customerId`, `config?`): `Promise`<`Customer`\> +**retrieve**(`customerId`, `config?`): `Promise`<`Customer`\> Gets a customer by id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `customerId` | `string` | the id of the customer to get. | | `config` | `FindConfig`<`Customer`\> | the config object containing query settings | @@ -452,24 +470,25 @@ Gets a customer by id. `Promise`<`Customer`\> -the customer document. +-`Promise`: the customer document. + -`Customer`: #### Defined in -[medusa/src/services/customer.ts:274](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L274) +[medusa/src/services/customer.ts:274](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L274) ___ ### retrieveByEmail -▸ **retrieveByEmail**(`email`, `config?`): `Promise`<`Customer`\> +**retrieveByEmail**(`email`, `config?`): `Promise`<`Customer`\> Gets a registered customer by email. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `email` | `string` | the email of the customer to get. | | `config` | `FindConfig`<`Customer`\> | the config object containing query settings | @@ -477,26 +496,27 @@ Gets a registered customer by email. `Promise`<`Customer`\> -the customer document. +-`Promise`: the customer document. + -`Customer`: -**`Deprecated`** +**Deprecated** #### Defined in -[medusa/src/services/customer.ts:216](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L216) +[medusa/src/services/customer.ts:216](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L216) ___ ### retrieveByPhone -▸ **retrieveByPhone**(`phone`, `config?`): `Promise`<`Customer`\> +**retrieveByPhone**(`phone`, `config?`): `Promise`<`Customer`\> Gets a customer by phone. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `phone` | `string` | the phone of the customer to get. | | `config` | `FindConfig`<`Customer`\> | the config object containing query settings | @@ -504,22 +524,23 @@ Gets a customer by phone. `Promise`<`Customer`\> -the customer document. +-`Promise`: the customer document. + -`Customer`: #### Defined in -[medusa/src/services/customer.ts:261](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L261) +[medusa/src/services/customer.ts:261](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L261) ___ ### retrieveRegisteredByEmail -▸ **retrieveRegisteredByEmail**(`email`, `config?`): `Promise`<`Customer`\> +**retrieveRegisteredByEmail**(`email`, `config?`): `Promise`<`Customer`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `email` | `string` | | `config` | `FindConfig`<`Customer`\> | @@ -527,20 +548,23 @@ ___ `Promise`<`Customer`\> +-`Promise`: + -`Customer`: + #### Defined in -[medusa/src/services/customer.ts:239](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L239) +[medusa/src/services/customer.ts:239](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L239) ___ ### retrieveUnregisteredByEmail -▸ **retrieveUnregisteredByEmail**(`email`, `config?`): `Promise`<`Customer`\> +**retrieveUnregisteredByEmail**(`email`, `config?`): `Promise`<`Customer`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `email` | `string` | | `config` | `FindConfig`<`Customer`\> | @@ -548,20 +572,23 @@ ___ `Promise`<`Customer`\> +-`Promise`: + -`Customer`: + #### Defined in -[medusa/src/services/customer.ts:230](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L230) +[medusa/src/services/customer.ts:230](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L230) ___ ### retrieve\_ -▸ `Private` **retrieve_**(`selector`, `config?`): `Promise`<`Customer`\> +`Private` **retrieve_**(`selector`, `config?`): `Promise`<`Customer`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `selector` | `Selector`<`Customer`\> | | `config` | `FindConfig`<`Customer`\> | @@ -569,46 +596,51 @@ ___ `Promise`<`Customer`\> +-`Promise`: + -`Customer`: + #### Defined in -[medusa/src/services/customer.ts:185](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L185) +[medusa/src/services/customer.ts:185](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L185) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`customerId`, `update`): `Promise`<`Customer`\> +**update**(`customerId`, `update`): `Promise`<`Customer`\> Updates a customer. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `customerId` | `string` | the id of the variant. Must be a string that can be casted to an ObjectId | | `update` | `UpdateCustomerInput` | an object with the update values. | @@ -616,22 +648,23 @@ Updates a customer. `Promise`<`Customer`\> -resolves to the update result. +-`Promise`: resolves to the update result. + -`Customer`: #### Defined in -[medusa/src/services/customer.ts:362](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L362) +[medusa/src/services/customer.ts:362](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L362) ___ ### updateAddress -▸ **updateAddress**(`customerId`, `addressId`, `address`): `Promise`<`Address`\> +**updateAddress**(`customerId`, `addressId`, `address`): `Promise`<`Address`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `customerId` | `string` | | `addressId` | `string` | | `address` | `StorePostCustomersCustomerAddressesAddressReq` | @@ -640,22 +673,25 @@ ___ `Promise`<`Address`\> +-`Promise`: + -`Address`: + #### Defined in -[medusa/src/services/customer.ts:474](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L474) +[medusa/src/services/customer.ts:474](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L474) ___ ### updateBillingAddress\_ -▸ **updateBillingAddress_**(`customer`, `addressOrId`): `Promise`<`void`\> +**updateBillingAddress_**(`customer`, `addressOrId`): `Promise`<`void`\> Updates the customers' billing address. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `customer` | `Customer` | the Customer to update | | `addressOrId` | `undefined` \| `string` \| `DeepPartial`<`Address`\> | the value to set the billing address to | @@ -663,32 +699,34 @@ Updates the customers' billing address. `Promise`<`void`\> -the result of the update operation +-`Promise`: the result of the update operation #### Defined in -[medusa/src/services/customer.ts:422](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/customer.ts#L422) +[medusa/src/services/customer.ts:422](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/customer.ts#L422) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`CustomerService`](CustomerService.md) +**withTransaction**(`transactionManager?`): [`CustomerService`](CustomerService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`CustomerService`](CustomerService.md) +-`CustomerService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/DiscountConditionService.md b/www/apps/docs/content/references/services/classes/DiscountConditionService.md index e7a16509a15ef..74f46c495a350 100644 --- a/www/apps/docs/content/references/services/classes/DiscountConditionService.md +++ b/www/apps/docs/content/references/services/classes/DiscountConditionService.md @@ -1,8 +1,8 @@ -# Class: DiscountConditionService +# DiscountConditionService Provides layer to manipulate discount conditions. -**`Implements`** +**Implements** ## Hierarchy @@ -14,12 +14,12 @@ Provides layer to manipulate discount conditions. ### constructor -• **new DiscountConditionService**(`«destructured»`) +**new DiscountConditionService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -28,13 +28,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/discount-condition.ts:34](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount-condition.ts#L34) +[medusa/src/services/discount-condition.ts:34](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount-condition.ts#L34) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -42,13 +42,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -56,13 +56,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -70,33 +70,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### discountConditionRepository\_ -• `Protected` `Readonly` **discountConditionRepository\_**: `Repository`<`DiscountCondition`\> & { `addConditionResources`: (`conditionId`: `string`, `resourceIds`: (`string` \| { `id`: `string` })[], `type`: `DiscountConditionType`, `overrideExisting`: `boolean`) => `Promise`<(`DiscountConditionProduct` \| `DiscountConditionProductType` \| `DiscountConditionProductCollection` \| `DiscountConditionProductTag` \| `DiscountConditionCustomerGroup`)[]\> ; `canApplyForCustomer`: (`discountRuleId`: `string`, `customerId`: `string`) => `Promise`<`boolean`\> ; `findOneWithDiscount`: (`conditionId`: `string`, `discountId`: `string`) => `Promise`<`undefined` \| `DiscountCondition` & { `discount`: `Discount` }\> ; `getJoinTableResourceIdentifiers`: (`type`: `string`) => { `conditionTable`: `DiscountConditionResourceType` ; `joinTable`: `string` ; `joinTableForeignKey`: `DiscountConditionJoinTableForeignKey` ; `joinTableKey`: `string` ; `relatedTable`: `string` ; `resourceKey`: `string` } ; `isValidForProduct`: (`discountRuleId`: `string`, `productId`: `string`) => `Promise`<`boolean`\> ; `queryConditionTable`: (`__namedParameters`: `Object`) => `Promise`<`number`\> ; `removeConditionResources`: (`id`: `string`, `type`: `DiscountConditionType`, `resourceIds`: (`string` \| { `id`: `string` })[]) => `Promise`<`void` \| `DeleteResult`\> } + `Protected` `Readonly` **discountConditionRepository\_**: `Repository`<`DiscountCondition`\> & { `addConditionResources`: Method addConditionResources ; `canApplyForCustomer`: Method canApplyForCustomer ; `findOneWithDiscount`: Method findOneWithDiscount ; `getJoinTableResourceIdentifiers`: Method getJoinTableResourceIdentifiers ; `isValidForProduct`: Method isValidForProduct ; `queryConditionTable`: Method queryConditionTable ; `removeConditionResources`: Method removeConditionResources } #### Defined in -[medusa/src/services/discount-condition.ts:31](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount-condition.ts#L31) +[medusa/src/services/discount-condition.ts:31](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount-condition.ts#L31) ___ ### eventBus\_ -• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/discount-condition.ts:32](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount-condition.ts#L32) +[medusa/src/services/discount-condition.ts:32](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount-condition.ts#L32) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -104,13 +104,13 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -118,47 +118,47 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -167,7 +167,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -175,58 +175,63 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### delete -▸ **delete**(`discountConditionId`): `Promise`<`void` \| `DiscountCondition`\> +**delete**(`discountConditionId`): `Promise`<`void` \| `DiscountCondition`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `discountConditionId` | `string` | #### Returns `Promise`<`void` \| `DiscountCondition`\> +-`Promise`: + -`void \| DiscountCondition`: (optional) + #### Defined in -[medusa/src/services/discount-condition.ts:217](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount-condition.ts#L217) +[medusa/src/services/discount-condition.ts:217](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount-condition.ts#L217) ___ ### removeResources -▸ **removeResources**(`data`): `Promise`<`void`\> +**removeResources**(`data`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `data` | `Omit`<`DiscountConditionInput`, ``"id"``\> & { `id`: `string` } | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/discount-condition.ts:184](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount-condition.ts#L184) +[medusa/src/services/discount-condition.ts:184](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount-condition.ts#L184) ___ ### retrieve -▸ **retrieve**(`conditionId`, `config?`): `Promise`<`DiscountCondition`\> +**retrieve**(`conditionId`, `config?`): `Promise`<`DiscountCondition`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `conditionId` | `string` | | `config?` | `FindConfig`<`DiscountCondition`\> | @@ -234,95 +239,108 @@ ___ `Promise`<`DiscountCondition`\> +-`Promise`: + -`DiscountCondition`: + #### Defined in -[medusa/src/services/discount-condition.ts:45](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount-condition.ts#L45) +[medusa/src/services/discount-condition.ts:45](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount-condition.ts#L45) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### upsertCondition -▸ **upsertCondition**(`data`, `overrideExisting?`): `Promise`<(`DiscountConditionProduct` \| `DiscountConditionProductType` \| `DiscountConditionProductCollection` \| `DiscountConditionProductTag` \| `DiscountConditionCustomerGroup`)[]\> +**upsertCondition**(`data`, `overrideExisting?`): `Promise`<(`DiscountConditionProduct` \| `DiscountConditionProductType` \| `DiscountConditionProductCollection` \| `DiscountConditionProductTag` \| `DiscountConditionCustomerGroup`)[]\> #### Parameters -| Name | Type | Default value | -| :------ | :------ | :------ | -| `data` | `DiscountConditionInput` | `undefined` | +| Name | Default value | +| :------ | :------ | +| `data` | `DiscountConditionInput` | | `overrideExisting` | `boolean` | `true` | #### Returns `Promise`<(`DiscountConditionProduct` \| `DiscountConditionProductType` \| `DiscountConditionProductCollection` \| `DiscountConditionProductTag` \| `DiscountConditionCustomerGroup`)[]\> +-`Promise`: + -`(DiscountConditionProduct \| DiscountConditionProductType \| DiscountConditionProductCollection \| DiscountConditionProductTag \| DiscountConditionCustomerGroup)[]`: + -`DiscountConditionProduct \| DiscountConditionProductType \| DiscountConditionProductCollection \| DiscountConditionProductTag \| DiscountConditionCustomerGroup`: (optional) + #### Defined in -[medusa/src/services/discount-condition.ts:111](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount-condition.ts#L111) +[medusa/src/services/discount-condition.ts:111](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount-condition.ts#L111) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`DiscountConditionService`](DiscountConditionService.md) +**withTransaction**(`transactionManager?`): [`DiscountConditionService`](DiscountConditionService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`DiscountConditionService`](DiscountConditionService.md) +-`DiscountConditionService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) ___ ### resolveConditionType\_ -▸ `Static` `Protected` **resolveConditionType_**(`data`): `undefined` \| { `resource_ids`: (`string` \| { `id`: `string` })[] ; `type`: `DiscountConditionType` } +`Static` `Protected` **resolveConditionType_**(`data`): `undefined` \| { `resource_ids`: (`string` \| { `id`: `string` })[] ; `type`: `DiscountConditionType` } #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `data` | `DiscountConditionInput` | #### Returns `undefined` \| { `resource_ids`: (`string` \| { `id`: `string` })[] ; `type`: `DiscountConditionType` } +-`undefined \| { `resource_ids`: (`string` \| { `id`: `string` })[] ; `type`: `DiscountConditionType` }`: (optional) + #### Defined in -[medusa/src/services/discount-condition.ts:74](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount-condition.ts#L74) +[medusa/src/services/discount-condition.ts:74](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount-condition.ts#L74) diff --git a/www/apps/docs/content/references/services/classes/DiscountService.md b/www/apps/docs/content/references/services/classes/DiscountService.md index 1bb7f3b9f63a1..83c3a8b3fab72 100644 --- a/www/apps/docs/content/references/services/classes/DiscountService.md +++ b/www/apps/docs/content/references/services/classes/DiscountService.md @@ -1,8 +1,8 @@ -# Class: DiscountService +# DiscountService Provides layer to manipulate discounts. -**`Implements`** +**Implements** ## Hierarchy @@ -14,12 +14,12 @@ Provides layer to manipulate discounts. ### constructor -• **new DiscountService**(`«destructured»`) +**new DiscountService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `Object` | #### Overrides @@ -28,13 +28,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/discount.ts:71](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L71) +[medusa/src/services/discount.ts:71](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L71) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -42,13 +42,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -56,13 +56,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -70,93 +70,93 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### customerService\_ -• `Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md) + `Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md) #### Defined in -[medusa/src/services/discount.ts:58](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L58) +[medusa/src/services/discount.ts:58](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L58) ___ ### discountConditionRepository\_ -• `Protected` `Readonly` **discountConditionRepository\_**: `Repository`<`DiscountCondition`\> & { `addConditionResources`: (`conditionId`: `string`, `resourceIds`: (`string` \| { `id`: `string` })[], `type`: `DiscountConditionType`, `overrideExisting`: `boolean`) => `Promise`<(`DiscountConditionProduct` \| `DiscountConditionProductType` \| `DiscountConditionProductCollection` \| `DiscountConditionProductTag` \| `DiscountConditionCustomerGroup`)[]\> ; `canApplyForCustomer`: (`discountRuleId`: `string`, `customerId`: `string`) => `Promise`<`boolean`\> ; `findOneWithDiscount`: (`conditionId`: `string`, `discountId`: `string`) => `Promise`<`undefined` \| `DiscountCondition` & { `discount`: `Discount` }\> ; `getJoinTableResourceIdentifiers`: (`type`: `string`) => { `conditionTable`: `DiscountConditionResourceType` ; `joinTable`: `string` ; `joinTableForeignKey`: `DiscountConditionJoinTableForeignKey` ; `joinTableKey`: `string` ; `relatedTable`: `string` ; `resourceKey`: `string` } ; `isValidForProduct`: (`discountRuleId`: `string`, `productId`: `string`) => `Promise`<`boolean`\> ; `queryConditionTable`: (`__namedParameters`: `Object`) => `Promise`<`number`\> ; `removeConditionResources`: (`id`: `string`, `type`: `DiscountConditionType`, `resourceIds`: (`string` \| { `id`: `string` })[]) => `Promise`<`void` \| `DeleteResult`\> } + `Protected` `Readonly` **discountConditionRepository\_**: `Repository`<`DiscountCondition`\> & { `addConditionResources`: Method addConditionResources ; `canApplyForCustomer`: Method canApplyForCustomer ; `findOneWithDiscount`: Method findOneWithDiscount ; `getJoinTableResourceIdentifiers`: Method getJoinTableResourceIdentifiers ; `isValidForProduct`: Method isValidForProduct ; `queryConditionTable`: Method queryConditionTable ; `removeConditionResources`: Method removeConditionResources } #### Defined in -[medusa/src/services/discount.ts:62](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L62) +[medusa/src/services/discount.ts:62](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L62) ___ ### discountConditionService\_ -• `Protected` `Readonly` **discountConditionService\_**: [`DiscountConditionService`](DiscountConditionService.md) + `Protected` `Readonly` **discountConditionService\_**: [`DiscountConditionService`](DiscountConditionService.md) #### Defined in -[medusa/src/services/discount.ts:63](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L63) +[medusa/src/services/discount.ts:63](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L63) ___ ### discountRepository\_ -• `Protected` `Readonly` **discountRepository\_**: `Repository`<`Discount`\> + `Protected` `Readonly` **discountRepository\_**: `Repository`<`Discount`\> #### Defined in -[medusa/src/services/discount.ts:57](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L57) +[medusa/src/services/discount.ts:57](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L57) ___ ### discountRuleRepository\_ -• `Protected` `Readonly` **discountRuleRepository\_**: `Repository`<`DiscountRule`\> + `Protected` `Readonly` **discountRuleRepository\_**: `Repository`<`DiscountRule`\> #### Defined in -[medusa/src/services/discount.ts:59](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L59) +[medusa/src/services/discount.ts:59](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L59) ___ ### eventBus\_ -• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/discount.ts:68](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L68) +[medusa/src/services/discount.ts:68](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L68) ___ ### featureFlagRouter\_ -• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` + `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` #### Defined in -[medusa/src/services/discount.ts:69](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L69) +[medusa/src/services/discount.ts:69](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L69) ___ ### giftCardRepository\_ -• `Protected` `Readonly` **giftCardRepository\_**: `Repository`<`GiftCard`\> & { `listGiftCardsAndCount`: (`query`: `ExtendedFindConfig`<`GiftCard`\>, `q?`: `string`) => `Promise`<[`GiftCard`[], `number`]\> } + `Protected` `Readonly` **giftCardRepository\_**: `Repository`<`GiftCard`\> & { `listGiftCardsAndCount`: Method listGiftCardsAndCount } #### Defined in -[medusa/src/services/discount.ts:60](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L60) +[medusa/src/services/discount.ts:60](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L60) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -164,53 +164,53 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### newTotalsService\_ -• `Protected` `Readonly` **newTotalsService\_**: [`NewTotalsService`](NewTotalsService.md) + `Protected` `Readonly` **newTotalsService\_**: [`NewTotalsService`](NewTotalsService.md) #### Defined in -[medusa/src/services/discount.ts:65](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L65) +[medusa/src/services/discount.ts:65](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L65) ___ ### productService\_ -• `Protected` `Readonly` **productService\_**: [`ProductService`](ProductService.md) + `Protected` `Readonly` **productService\_**: [`ProductService`](ProductService.md) #### Defined in -[medusa/src/services/discount.ts:66](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L66) +[medusa/src/services/discount.ts:66](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L66) ___ ### regionService\_ -• `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md) + `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md) #### Defined in -[medusa/src/services/discount.ts:67](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L67) +[medusa/src/services/discount.ts:67](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L67) ___ ### totalsService\_ -• `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md) + `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md) #### Defined in -[medusa/src/services/discount.ts:64](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L64) +[medusa/src/services/discount.ts:64](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L64) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -218,38 +218,40 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### addRegion -▸ **addRegion**(`discountId`, `regionId`): `Promise`<`Discount`\> +**addRegion**(`discountId`, `regionId`): `Promise`<`Discount`\> Adds a region to the discount regions array. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `discountId` | `string` | id of discount | | `regionId` | `string` | id of region to add | @@ -257,33 +259,32 @@ Adds a region to the discount regions array. `Promise`<`Discount`\> -the result of the update operation +-`Promise`: the result of the update operation + -`Discount`: #### Defined in -[medusa/src/services/discount.ts:503](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L503) +[medusa/src/services/discount.ts:503](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L503) ___ ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -292,7 +293,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -300,18 +301,18 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### calculateDiscountForLineItem -▸ **calculateDiscountForLineItem**(`discountId`, `lineItem`, `calculationContextData`): `Promise`<`number`\> +**calculateDiscountForLineItem**(`discountId`, `lineItem`, `calculationContextData`): `Promise`<`number`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `discountId` | `string` | | `lineItem` | `LineItem` | | `calculationContextData` | `CalculationContextData` | @@ -320,20 +321,23 @@ ___ `Promise`<`number`\> +-`Promise`: + -`number`: (optional) + #### Defined in -[medusa/src/services/discount.ts:599](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L599) +[medusa/src/services/discount.ts:599](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L599) ___ ### canApplyForCustomer -▸ **canApplyForCustomer**(`discountRuleId`, `customerId`): `Promise`<`boolean`\> +**canApplyForCustomer**(`discountRuleId`, `customerId`): `Promise`<`boolean`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `discountRuleId` | `string` | | `customerId` | `undefined` \| `string` | @@ -341,47 +345,51 @@ ___ `Promise`<`boolean`\> +-`Promise`: + -`boolean`: (optional) + #### Defined in -[medusa/src/services/discount.ts:791](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L791) +[medusa/src/services/discount.ts:791](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L791) ___ ### create -▸ **create**(`discount`): `Promise`<`Discount`\> +**create**(`discount`): `Promise`<`Discount`\> Creates a discount with provided data given that the data is validated. Normalizes discount code to uppercase. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `discount` | `CreateDiscountInput` | the discount data to create | #### Returns `Promise`<`Discount`\> -the result of the create operation +-`Promise`: the result of the create operation + -`Discount`: #### Defined in -[medusa/src/services/discount.ts:178](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L178) +[medusa/src/services/discount.ts:178](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L178) ___ ### createDynamicCode -▸ **createDynamicCode**(`discountId`, `data`): `Promise`<`Discount`\> +**createDynamicCode**(`discountId`, `data`): `Promise`<`Discount`\> Creates a dynamic code for a discount id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `discountId` | `string` | the id of the discount to create a code for | | `data` | `CreateDynamicDiscountInput` | the object containing a code to identify the discount by | @@ -389,48 +397,49 @@ Creates a dynamic code for a discount id. `Promise`<`Discount`\> -the newly created dynamic code +-`Promise`: the newly created dynamic code + -`Discount`: #### Defined in -[medusa/src/services/discount.ts:431](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L431) +[medusa/src/services/discount.ts:431](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L431) ___ ### delete -▸ **delete**(`discountId`): `Promise`<`void`\> +**delete**(`discountId`): `Promise`<`void`\> Deletes a discount idempotently #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `discountId` | `string` | id of discount to delete | #### Returns `Promise`<`void`\> -the result of the delete operation +-`Promise`: the result of the delete operation #### Defined in -[medusa/src/services/discount.ts:563](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L563) +[medusa/src/services/discount.ts:563](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L563) ___ ### deleteDynamicCode -▸ **deleteDynamicCode**(`discountId`, `code`): `Promise`<`void`\> +**deleteDynamicCode**(`discountId`, `code`): `Promise`<`void`\> Deletes a dynamic code for a discount id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `discountId` | `string` | the id of the discount to create a code for | | `code` | `string` | the code to identify the discount by | @@ -438,122 +447,132 @@ Deletes a dynamic code for a discount id. `Promise`<`void`\> -the newly created dynamic code +-`Promise`: the newly created dynamic code #### Defined in -[medusa/src/services/discount.ts:482](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L482) +[medusa/src/services/discount.ts:482](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L482) ___ ### hasCustomersGroupCondition -▸ **hasCustomersGroupCondition**(`discount`): `boolean` +**hasCustomersGroupCondition**(`discount`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `discount` | `Discount` | #### Returns `boolean` +-`boolean`: (optional) + #### Defined in -[medusa/src/services/discount.ts:744](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L744) +[medusa/src/services/discount.ts:744](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L744) ___ ### hasExpired -▸ **hasExpired**(`discount`): `boolean` +**hasExpired**(`discount`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `discount` | `Discount` | #### Returns `boolean` +-`boolean`: (optional) + #### Defined in -[medusa/src/services/discount.ts:760](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L760) +[medusa/src/services/discount.ts:760](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L760) ___ ### hasNotStarted -▸ **hasNotStarted**(`discount`): `boolean` +**hasNotStarted**(`discount`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `discount` | `Discount` | #### Returns `boolean` +-`boolean`: (optional) + #### Defined in -[medusa/src/services/discount.ts:756](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L756) +[medusa/src/services/discount.ts:756](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L756) ___ ### hasReachedLimit -▸ **hasReachedLimit**(`discount`): `boolean` +**hasReachedLimit**(`discount`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `discount` | `Discount` | #### Returns `boolean` +-`boolean`: (optional) + #### Defined in -[medusa/src/services/discount.ts:750](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L750) +[medusa/src/services/discount.ts:750](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L750) ___ ### isDisabled -▸ **isDisabled**(`discount`): `boolean` +**isDisabled**(`discount`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `discount` | `Discount` | #### Returns `boolean` +-`boolean`: (optional) + #### Defined in -[medusa/src/services/discount.ts:768](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L768) +[medusa/src/services/discount.ts:768](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L768) ___ ### isValidForRegion -▸ **isValidForRegion**(`discount`, `region_id`): `Promise`<`boolean`\> +**isValidForRegion**(`discount`, `region_id`): `Promise`<`boolean`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `discount` | `Discount` | | `region_id` | `string` | @@ -561,20 +580,23 @@ ___ `Promise`<`boolean`\> +-`Promise`: + -`boolean`: (optional) + #### Defined in -[medusa/src/services/discount.ts:772](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L772) +[medusa/src/services/discount.ts:772](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L772) ___ ### list -▸ **list**(`selector?`, `config?`): `Promise`<`Discount`[]\> +**list**(`selector?`, `config?`): `Promise`<`Discount`[]\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `FilterableDiscountProps` | the query object for find | | `config` | `FindConfig`<`Discount`\> | the config object containing query settings | @@ -582,22 +604,24 @@ ___ `Promise`<`Discount`[]\> -the result of the find operation +-`Promise`: the result of the find operation + -`Discount[]`: + -`Discount`: #### Defined in -[medusa/src/services/discount.ts:125](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L125) +[medusa/src/services/discount.ts:125](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L125) ___ ### listAndCount -▸ **listAndCount**(`selector?`, `config?`): `Promise`<[`Discount`[], `number`]\> +**listAndCount**(`selector?`, `config?`): `Promise`<[`Discount`[], `number`]\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `FilterableDiscountProps` | the query object for find | | `config` | `FindConfig`<`Discount`\> | the config object containing query settings | @@ -605,24 +629,26 @@ ___ `Promise`<[`Discount`[], `number`]\> -the result of the find operation +-`Promise`: the result of the find operation + -`Discount[]`: + -`number`: (optional) #### Defined in -[medusa/src/services/discount.ts:142](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L142) +[medusa/src/services/discount.ts:142](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L142) ___ ### listByCodes -▸ **listByCodes**(`discountCodes`, `config?`): `Promise`<`Discount`[]\> +**listByCodes**(`discountCodes`, `config?`): `Promise`<`Discount`[]\> List all the discounts corresponding to the given codes #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `discountCodes` | `string`[] | discount codes of discounts to retrieve | | `config` | `FindConfig`<`Discount`\> | the config object containing query settings | @@ -630,24 +656,26 @@ List all the discounts corresponding to the given codes `Promise`<`Discount`[]\> -the discounts +-`Promise`: the discounts + -`Discount[]`: + -`Discount`: #### Defined in -[medusa/src/services/discount.ts:307](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L307) +[medusa/src/services/discount.ts:307](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L307) ___ ### removeRegion -▸ **removeRegion**(`discountId`, `regionId`): `Promise`<`Discount`\> +**removeRegion**(`discountId`, `regionId`): `Promise`<`Discount`\> Removes a region from the discount regions array. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `discountId` | `string` | id of discount | | `regionId` | `string` | id of region to remove | @@ -655,24 +683,25 @@ Removes a region from the discount regions array. `Promise`<`Discount`\> -the result of the update operation +-`Promise`: the result of the update operation + -`Discount`: #### Defined in -[medusa/src/services/discount.ts:538](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L538) +[medusa/src/services/discount.ts:538](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L538) ___ ### retrieve -▸ **retrieve**(`discountId`, `config?`): `Promise`<`Discount`\> +**retrieve**(`discountId`, `config?`): `Promise`<`Discount`\> Gets a discount by id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `discountId` | `string` | id of discount to retrieve | | `config` | `FindConfig`<`Discount`\> | the config object containing query settings | @@ -680,24 +709,25 @@ Gets a discount by id. `Promise`<`Discount`\> -the discount +-`Promise`: the discount + -`Discount`: #### Defined in -[medusa/src/services/discount.ts:244](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L244) +[medusa/src/services/discount.ts:244](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L244) ___ ### retrieveByCode -▸ **retrieveByCode**(`discountCode`, `config?`): `Promise`<`Discount`\> +**retrieveByCode**(`discountCode`, `config?`): `Promise`<`Discount`\> Gets the discount by discount code. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `discountCode` | `string` | discount code of discount to retrieve | | `config` | `FindConfig`<`Discount`\> | the config object containing query settings | @@ -705,48 +735,51 @@ Gets the discount by discount code. `Promise`<`Discount`\> -the discount +-`Promise`: the discount + -`Discount`: #### Defined in -[medusa/src/services/discount.ts:278](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L278) +[medusa/src/services/discount.ts:278](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L278) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`discountId`, `update`): `Promise`<`Discount`\> +**update**(`discountId`, `update`): `Promise`<`Discount`\> Updates a discount. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `discountId` | `string` | discount id of discount to update | | `update` | `UpdateDiscountInput` | the data to update the discount with | @@ -754,22 +787,23 @@ Updates a discount. `Promise`<`Discount`\> -the result of the update operation +-`Promise`: the result of the update operation + -`Discount`: #### Defined in -[medusa/src/services/discount.ts:338](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L338) +[medusa/src/services/discount.ts:338](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L338) ___ ### validateDiscountForCartOrThrow -▸ **validateDiscountForCartOrThrow**(`cart`, `discount`): `Promise`<`void`\> +**validateDiscountForCartOrThrow**(`cart`, `discount`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `cart` | `Cart` | | `discount` | `Discount` \| `Discount`[] | @@ -777,20 +811,22 @@ ___ `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/discount.ts:672](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L672) +[medusa/src/services/discount.ts:672](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L672) ___ ### validateDiscountForProduct -▸ **validateDiscountForProduct**(`discountRuleId`, `productId?`): `Promise`<`boolean`\> +**validateDiscountForProduct**(`discountRuleId`, `productId?`): `Promise`<`boolean`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `discountRuleId` | `string` | | `productId?` | `string` | @@ -798,60 +834,61 @@ ___ `Promise`<`boolean`\> +-`Promise`: + -`boolean`: (optional) + #### Defined in -[medusa/src/services/discount.ts:577](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L577) +[medusa/src/services/discount.ts:577](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L577) ___ ### validateDiscountRule\_ -▸ **validateDiscountRule_**<`T`\>(`discountRule`): `T` +**validateDiscountRule_**<`T`\>(`discountRule`): `T` Creates a discount rule with provided data given that the data is validated. -#### Type parameters - | Name | Type | | :------ | :------ | -| `T` | extends `Object` | +| `T` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `discountRule` | `T` | the discount rule to create | #### Returns `T` -the result of the create operation - #### Defined in -[medusa/src/services/discount.ts:107](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/discount.ts#L107) +[medusa/src/services/discount.ts:107](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/discount.ts#L107) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`DiscountService`](DiscountService.md) +**withTransaction**(`transactionManager?`): [`DiscountService`](DiscountService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`DiscountService`](DiscountService.md) +-`DiscountService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/DraftOrderService.md b/www/apps/docs/content/references/services/classes/DraftOrderService.md index 5a1325f3f770c..4d2689b351be4 100644 --- a/www/apps/docs/content/references/services/classes/DraftOrderService.md +++ b/www/apps/docs/content/references/services/classes/DraftOrderService.md @@ -1,8 +1,8 @@ -# Class: DraftOrderService +# DraftOrderService Handles draft orders -**`Implements`** +**Implements** ## Hierarchy @@ -14,12 +14,12 @@ Handles draft orders ### constructor -• **new DraftOrderService**(`«destructured»`) +**new DraftOrderService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -28,13 +28,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/draft-order.ts:67](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L67) +[medusa/src/services/draft-order.ts:67](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L67) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -42,13 +42,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -56,13 +56,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -70,63 +70,63 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### cartService\_ -• `Protected` `Readonly` **cartService\_**: [`CartService`](CartService.md) + `Protected` `Readonly` **cartService\_**: [`CartService`](CartService.md) #### Defined in -[medusa/src/services/draft-order.ts:61](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L61) +[medusa/src/services/draft-order.ts:61](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L61) ___ ### customShippingOptionService\_ -• `Protected` `Readonly` **customShippingOptionService\_**: [`CustomShippingOptionService`](CustomShippingOptionService.md) + `Protected` `Readonly` **customShippingOptionService\_**: [`CustomShippingOptionService`](CustomShippingOptionService.md) #### Defined in -[medusa/src/services/draft-order.ts:65](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L65) +[medusa/src/services/draft-order.ts:65](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L65) ___ ### draftOrderRepository\_ -• `Protected` `Readonly` **draftOrderRepository\_**: `Repository`<`DraftOrder`\> + `Protected` `Readonly` **draftOrderRepository\_**: `Repository`<`DraftOrder`\> #### Defined in -[medusa/src/services/draft-order.ts:57](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L57) +[medusa/src/services/draft-order.ts:57](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L57) ___ ### eventBus\_ -• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/draft-order.ts:60](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L60) +[medusa/src/services/draft-order.ts:60](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L60) ___ ### lineItemService\_ -• `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md) + `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md) #### Defined in -[medusa/src/services/draft-order.ts:62](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L62) +[medusa/src/services/draft-order.ts:62](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L62) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -134,53 +134,53 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### orderRepository\_ -• `Protected` `Readonly` **orderRepository\_**: `Repository`<`Order`\> & { `findOneWithRelations`: (`relations`: `FindOptionsRelations`<`Order`\>, `optionsWithoutRelations`: `Omit`<`FindManyOptions`<`Order`\>, ``"relations"``\>) => `Promise`<`Order`\> ; `findWithRelations`: (`relations`: `FindOptionsRelations`<`Order`\>, `optionsWithoutRelations`: `Omit`<`FindManyOptions`<`Order`\>, ``"relations"``\>) => `Promise`<`Order`[]\> } + `Protected` `Readonly` **orderRepository\_**: `Repository`<`Order`\> & { `findOneWithRelations`: Method findOneWithRelations ; `findWithRelations`: Method findWithRelations } #### Defined in -[medusa/src/services/draft-order.ts:59](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L59) +[medusa/src/services/draft-order.ts:59](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L59) ___ ### paymentRepository\_ -• `Protected` `Readonly` **paymentRepository\_**: `Repository`<`Payment`\> + `Protected` `Readonly` **paymentRepository\_**: `Repository`<`Payment`\> #### Defined in -[medusa/src/services/draft-order.ts:58](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L58) +[medusa/src/services/draft-order.ts:58](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L58) ___ ### productVariantService\_ -• `Protected` `Readonly` **productVariantService\_**: [`ProductVariantService`](ProductVariantService.md) + `Protected` `Readonly` **productVariantService\_**: [`ProductVariantService`](ProductVariantService.md) #### Defined in -[medusa/src/services/draft-order.ts:63](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L63) +[medusa/src/services/draft-order.ts:63](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L63) ___ ### shippingOptionService\_ -• `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md) + `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md) #### Defined in -[medusa/src/services/draft-order.ts:64](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L64) +[medusa/src/services/draft-order.ts:64](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L64) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -188,13 +188,13 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### Events -▪ `Static` `Readonly` **Events**: `Object` + `Static` `Readonly` **Events**: `Object` #### Type declaration @@ -205,47 +205,47 @@ ___ #### Defined in -[medusa/src/services/draft-order.ts:52](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L52) +[medusa/src/services/draft-order.ts:52](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L52) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -254,7 +254,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -262,68 +262,70 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**(`data`): `Promise`<`DraftOrder`\> +**create**(`data`): `Promise`<`DraftOrder`\> Creates a draft order. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `data` | `DraftOrderCreateProps` | data to create draft order from | #### Returns `Promise`<`DraftOrder`\> -the created draft order +-`Promise`: the created draft order + -`DraftOrder`: #### Defined in -[medusa/src/services/draft-order.ts:260](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L260) +[medusa/src/services/draft-order.ts:260](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L260) ___ ### delete -▸ **delete**(`draftOrderId`): `Promise`<`undefined` \| `DraftOrder`\> +**delete**(`draftOrderId`): `Promise`<`undefined` \| `DraftOrder`\> Deletes draft order idempotently. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `draftOrderId` | `string` | id of draft order to delete | #### Returns `Promise`<`undefined` \| `DraftOrder`\> -empty promise +-`Promise`: empty promise + -`undefined \| DraftOrder`: (optional) #### Defined in -[medusa/src/services/draft-order.ts:156](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L156) +[medusa/src/services/draft-order.ts:156](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L156) ___ ### list -▸ **list**(`selector`, `config?`): `Promise`<`DraftOrder`[]\> +**list**(`selector`, `config?`): `Promise`<`DraftOrder`[]\> Lists draft orders #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `any` | query object for find | | `config` | `FindConfig`<`DraftOrder`\> | configurable attributes for find | @@ -331,24 +333,26 @@ Lists draft orders `Promise`<`DraftOrder`[]\> -list of draft orders +-`Promise`: list of draft orders + -`DraftOrder[]`: + -`DraftOrder`: #### Defined in -[medusa/src/services/draft-order.ts:238](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L238) +[medusa/src/services/draft-order.ts:238](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L238) ___ ### listAndCount -▸ **listAndCount**(`selector`, `config?`): `Promise`<[`DraftOrder`[], `number`]\> +**listAndCount**(`selector`, `config?`): `Promise`<[`DraftOrder`[], `number`]\> Lists draft orders alongside the count #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `any` | query selector to filter draft orders | | `config` | `FindConfig`<`DraftOrder`\> | query config | @@ -356,24 +360,26 @@ Lists draft orders alongside the count `Promise`<[`DraftOrder`[], `number`]\> -draft orders +-`Promise`: draft orders + -`DraftOrder[]`: + -`number`: (optional) #### Defined in -[medusa/src/services/draft-order.ts:180](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L180) +[medusa/src/services/draft-order.ts:180](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L180) ___ ### registerCartCompletion -▸ **registerCartCompletion**(`draftOrderId`, `orderId`): `Promise`<`UpdateResult`\> +**registerCartCompletion**(`draftOrderId`, `orderId`): `Promise`<`UpdateResult`\> Registers a draft order as completed, when an order has been completed. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `draftOrderId` | `string` | id of draft order to complete | | `orderId` | `string` | id of order completed from draft order cart | @@ -381,24 +387,25 @@ Registers a draft order as completed, when an order has been completed. `Promise`<`UpdateResult`\> -the created order +-`Promise`: the created order + -`UpdateResult`: #### Defined in -[medusa/src/services/draft-order.ts:420](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L420) +[medusa/src/services/draft-order.ts:420](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L420) ___ ### retrieve -▸ **retrieve**(`draftOrderId`, `config?`): `Promise`<`DraftOrder`\> +**retrieve**(`draftOrderId`, `config?`): `Promise`<`DraftOrder`\> Retrieves a draft order with the given id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `draftOrderId` | `string` | id of the draft order to retrieve | | `config` | `FindConfig`<`DraftOrder`\> | query object for findOne | @@ -406,24 +413,25 @@ Retrieves a draft order with the given id. `Promise`<`DraftOrder`\> -the draft order +-`Promise`: the draft order + -`DraftOrder`: #### Defined in -[medusa/src/services/draft-order.ts:98](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L98) +[medusa/src/services/draft-order.ts:98](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L98) ___ ### retrieveByCartId -▸ **retrieveByCartId**(`cartId`, `config?`): `Promise`<`DraftOrder`\> +**retrieveByCartId**(`cartId`, `config?`): `Promise`<`DraftOrder`\> Retrieves a draft order based on its associated cart id #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartId` | `string` | cart id that the draft orders's cart has | | `config` | `FindConfig`<`DraftOrder`\> | query object for findOne | @@ -431,82 +439,88 @@ Retrieves a draft order based on its associated cart id `Promise`<`DraftOrder`\> -the draft order +-`Promise`: the draft order + -`DraftOrder`: #### Defined in -[medusa/src/services/draft-order.ts:131](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L131) +[medusa/src/services/draft-order.ts:131](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L131) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`id`, `data`): `Promise`<`DraftOrder`\> +**update**(`id`, `data`): `Promise`<`DraftOrder`\> Updates a draft order with the given data #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `id` | `string` | id of the draft order | -| `data` | `Object` | values to update the order with | -| `data.no_notification_order` | `boolean` | - | +| `data` | `object` | values to update the order with | +| `data.no_notification_order` | `boolean` | #### Returns `Promise`<`DraftOrder`\> -the updated draft order +-`Promise`: the updated draft order + -`DraftOrder`: #### Defined in -[medusa/src/services/draft-order.ts:449](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/draft-order.ts#L449) +[medusa/src/services/draft-order.ts:449](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/draft-order.ts#L449) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`DraftOrderService`](DraftOrderService.md) +**withTransaction**(`transactionManager?`): [`DraftOrderService`](DraftOrderService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`DraftOrderService`](DraftOrderService.md) +-`DraftOrderService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/EventBusService.md b/www/apps/docs/content/references/services/classes/EventBusService.md index aa8a00f98bcb0..843c223d1c119 100644 --- a/www/apps/docs/content/references/services/classes/EventBusService.md +++ b/www/apps/docs/content/references/services/classes/EventBusService.md @@ -1,4 +1,4 @@ -# Class: EventBusService +# EventBusService Can keep track of multiple subscribers to different events and run the subscribers when events happen. Events will run asynchronously. @@ -17,14 +17,14 @@ subscribers when events happen. Events will run asynchronously. ### constructor -• **new EventBusService**(`«destructured»`, `config`, `isSingleton?`) +**new EventBusService**(`«destructured»`, `config`, `isSingleton?`) #### Parameters -| Name | Type | Default value | -| :------ | :------ | :------ | -| `«destructured»` | `InjectedDependencies` | `undefined` | -| `config` | `any` | `undefined` | +| Name | Default value | +| :------ | :------ | +| `«destructured»` | `InjectedDependencies` | +| `config` | `any` | | `isSingleton` | `boolean` | `true` | #### Overrides @@ -33,13 +33,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/event-bus.ts:36](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L36) +[medusa/src/services/event-bus.ts:36](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L36) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -47,13 +47,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -61,13 +61,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -75,53 +75,53 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### config\_ -• `Protected` `Readonly` **config\_**: `ConfigModule` + `Protected` `Readonly` **config\_**: `ConfigModule` #### Defined in -[medusa/src/services/event-bus.ts:27](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L27) +[medusa/src/services/event-bus.ts:27](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L27) ___ ### enqueue\_ -• `Protected` **enqueue\_**: `Promise`<`void`\> + `Protected` **enqueue\_**: `Promise`<`void`\> #### Defined in -[medusa/src/services/event-bus.ts:34](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L34) +[medusa/src/services/event-bus.ts:34](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L34) ___ ### eventBusModuleService\_ -• `Protected` `Readonly` **eventBusModuleService\_**: `IEventBusModuleService` + `Protected` `Readonly` **eventBusModuleService\_**: `IEventBusModuleService` #### Defined in -[medusa/src/services/event-bus.ts:30](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L30) +[medusa/src/services/event-bus.ts:30](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L30) ___ ### logger\_ -• `Protected` `Readonly` **logger\_**: `Logger` + `Protected` `Readonly` **logger\_**: `Logger` #### Defined in -[medusa/src/services/event-bus.ts:31](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L31) +[medusa/src/services/event-bus.ts:31](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L31) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -129,33 +129,33 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### shouldEnqueuerRun -• `Protected` **shouldEnqueuerRun**: `boolean` + `Protected` **shouldEnqueuerRun**: `boolean` #### Defined in -[medusa/src/services/event-bus.ts:33](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L33) +[medusa/src/services/event-bus.ts:33](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L33) ___ ### stagedJobService\_ -• `Protected` `Readonly` **stagedJobService\_**: [`StagedJobService`](StagedJobService.md) + `Protected` `Readonly` **stagedJobService\_**: [`StagedJobService`](StagedJobService.md) #### Defined in -[medusa/src/services/event-bus.ts:28](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L28) +[medusa/src/services/event-bus.ts:28](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L28) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -163,47 +163,47 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -212,7 +212,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -220,33 +220,32 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### emit -▸ **emit**<`T`\>(`data`): `Promise`<`void` \| `StagedJob`[]\> +**emit**<`T`\>(`data`): `Promise`<`void` \| `StagedJob`[]\> Calls all subscribers when an event occurs. -#### Type parameters - | Name | | :------ | -| `T` | +| `T` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `data` | `EmitData`<`T`\>[] | The data to use to process the events | #### Returns `Promise`<`void` \| `StagedJob`[]\> -the jobs from our queue +-`Promise`: the jobs from our queue + -`void \| StagedJob[]`: (optional) #### Implementation of @@ -254,31 +253,30 @@ EventBusTypes.IEventBusService.emit #### Defined in -[medusa/src/services/event-bus.ts:117](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L117) +[medusa/src/services/event-bus.ts:117](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L117) -▸ **emit**<`T`\>(`eventName`, `data`, `options?`): `Promise`<`void` \| `StagedJob`\> +**emit**<`T`\>(`eventName`, `data`, `options?`): `Promise`<`void` \| `StagedJob`\> Calls all subscribers when an event occurs. -#### Type parameters - | Name | | :------ | -| `T` | +| `T` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `eventName` | `string` | the name of the event to be process. | | `data` | `T` | the data to send to the subscriber. | -| `options?` | `Record`<`string`, `unknown`\> | options to add the job with | +| `options?` | Record<`string`, `unknown`\> | options to add the job with | #### Returns `Promise`<`void` \| `StagedJob`\> -the job from our queue +-`Promise`: the job from our queue + -`void \| StagedJob`: (optional) #### Implementation of @@ -286,106 +284,117 @@ EventBusTypes.IEventBusService.emit #### Defined in -[medusa/src/services/event-bus.ts:126](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L126) +[medusa/src/services/event-bus.ts:126](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L126) ___ ### enqueuer\_ -▸ **enqueuer_**(): `Promise`<`void`\> +**enqueuer_**(): `Promise`<`void`\> #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/event-bus.ts:190](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L190) +[medusa/src/services/event-bus.ts:190](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L190) ___ ### listJobs -▸ `Protected` **listJobs**(`listConfig`): `Promise`<`never`[] \| `StagedJob`[]\> +`Protected` **listJobs**(`listConfig`): `Promise`<`never`[] \| `StagedJob`[]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `listConfig` | `FindConfig`<`StagedJob`\> | #### Returns `Promise`<`never`[] \| `StagedJob`[]\> +-`Promise`: + -`never[] \| StagedJob[]`: (optional) + #### Defined in -[medusa/src/services/event-bus.ts:220](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L220) +[medusa/src/services/event-bus.ts:220](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L220) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### startEnqueuer -▸ **startEnqueuer**(): `void` +**startEnqueuer**(): `void` #### Returns `void` +-`void`: (optional) + #### Defined in -[medusa/src/services/event-bus.ts:180](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L180) +[medusa/src/services/event-bus.ts:180](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L180) ___ ### stopEnqueuer -▸ **stopEnqueuer**(): `Promise`<`void`\> +**stopEnqueuer**(): `Promise`<`void`\> #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/event-bus.ts:185](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L185) +[medusa/src/services/event-bus.ts:185](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L185) ___ ### subscribe -▸ **subscribe**(`event`, `subscriber`, `context?`): [`EventBusService`](EventBusService.md) +**subscribe**(`event`, `subscriber`, `context?`): [`EventBusService`](EventBusService.md) Adds a function to a list of event subscribers. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `event` | `string` \| `symbol` | the event that the subscriber will listen for. | | `subscriber` | `Subscriber`<`unknown`\> | the function to be called when a certain event happens. Subscribers must return a Promise. | | `context?` | `SubscriberContext` | subscriber context | @@ -394,7 +403,7 @@ Adds a function to a list of event subscribers. [`EventBusService`](EventBusService.md) -this +-`default`: this #### Implementation of @@ -402,20 +411,20 @@ EventBusTypes.IEventBusService.subscribe #### Defined in -[medusa/src/services/event-bus.ts:83](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L83) +[medusa/src/services/event-bus.ts:83](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L83) ___ ### unsubscribe -▸ **unsubscribe**(`event`, `subscriber`, `context`): [`EventBusService`](EventBusService.md) +**unsubscribe**(`event`, `subscriber`, `context`): [`EventBusService`](EventBusService.md) Removes function from the list of event subscribers. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `event` | `string` \| `symbol` | the event of the subcriber. | | `subscriber` | `Subscriber`<`unknown`\> | the function to be removed | | `context` | `SubscriberContext` | subscriber context | @@ -424,7 +433,7 @@ Removes function from the list of event subscribers. [`EventBusService`](EventBusService.md) -this +-`default`: this #### Implementation of @@ -432,24 +441,26 @@ EventBusTypes.IEventBusService.unsubscribe #### Defined in -[medusa/src/services/event-bus.ts:103](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L103) +[medusa/src/services/event-bus.ts:103](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L103) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`EventBusService`](EventBusService.md) +**withTransaction**(`transactionManager?`): [`EventBusService`](EventBusService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`EventBusService`](EventBusService.md) +-`default`: + #### Implementation of EventBusTypes.IEventBusService.withTransaction @@ -460,4 +471,4 @@ TransactionBaseService.withTransaction #### Defined in -[medusa/src/services/event-bus.ts:54](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/event-bus.ts#L54) +[medusa/src/services/event-bus.ts:54](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/event-bus.ts#L54) diff --git a/www/apps/docs/content/references/services/classes/FulfillmentProviderService.md b/www/apps/docs/content/references/services/classes/FulfillmentProviderService.md index 5b4b4cbd4b5da..d7afd6d8d5f60 100644 --- a/www/apps/docs/content/references/services/classes/FulfillmentProviderService.md +++ b/www/apps/docs/content/references/services/classes/FulfillmentProviderService.md @@ -1,4 +1,4 @@ -# Class: FulfillmentProviderService +# FulfillmentProviderService Helps retrieve fulfillment providers @@ -12,12 +12,12 @@ Helps retrieve fulfillment providers ### constructor -• **new FulfillmentProviderService**(`container`) +**new FulfillmentProviderService**(`container`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `container` | `FulfillmentProviderContainer` | #### Overrides @@ -26,13 +26,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/fulfillment-provider.ts:44](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L44) +[medusa/src/services/fulfillment-provider.ts:44](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L44) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -68,33 +68,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### container\_ -• `Protected` `Readonly` **container\_**: `FulfillmentProviderContainer` + `Protected` `Readonly` **container\_**: `FulfillmentProviderContainer` #### Defined in -[medusa/src/services/fulfillment-provider.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L40) +[medusa/src/services/fulfillment-provider.ts:40](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L40) ___ ### fulfillmentProviderRepository\_ -• `Protected` `Readonly` **fulfillmentProviderRepository\_**: `Repository`<`FulfillmentProvider`\> + `Protected` `Readonly` **fulfillmentProviderRepository\_**: `Repository`<`FulfillmentProvider`\> #### Defined in -[medusa/src/services/fulfillment-provider.ts:42](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L42) +[medusa/src/services/fulfillment-provider.ts:42](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L42) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -102,13 +102,13 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -116,47 +116,47 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -165,7 +165,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -173,80 +173,89 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### calculatePrice -▸ **calculatePrice**(`option`, `data`, `cart?`): `Promise`<`number`\> +**calculatePrice**(`option`, `data`, `cart?`): `Promise`<`number`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `option` | `ShippingOption` | -| `data` | `Record`<`string`, `unknown`\> | +| `data` | Record<`string`, `unknown`\> | | `cart?` | `Order` \| `Cart` | #### Returns `Promise`<`number`\> +-`Promise`: + -`number`: (optional) + #### Defined in -[medusa/src/services/fulfillment-provider.ts:147](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L147) +[medusa/src/services/fulfillment-provider.ts:147](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L147) ___ ### canCalculate -▸ **canCalculate**(`option`): `Promise`<`boolean`\> +**canCalculate**(`option`): `Promise`<`boolean`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `option` | `CalculateOptionPriceInput` | #### Returns `Promise`<`boolean`\> +-`Promise`: + -`boolean`: (optional) + #### Defined in -[medusa/src/services/fulfillment-provider.ts:122](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L122) +[medusa/src/services/fulfillment-provider.ts:122](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L122) ___ ### cancelFulfillment -▸ **cancelFulfillment**(`fulfillment`): `Promise`<`Fulfillment`\> +**cancelFulfillment**(`fulfillment`): `Promise`<`Fulfillment`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `fulfillment` | `Fulfillment` | #### Returns `Promise`<`Fulfillment`\> +-`Promise`: + -`Fulfillment`: + #### Defined in -[medusa/src/services/fulfillment-provider.ts:140](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L140) +[medusa/src/services/fulfillment-provider.ts:140](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L140) ___ ### createFulfillment -▸ **createFulfillment**(`method`, `items`, `order`, `fulfillment`): `Promise`<`Record`<`string`, `unknown`\>\> +**createFulfillment**(`method`, `items`, `order`, `fulfillment`): `Promise`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `method` | `ShippingMethod` | | `items` | `LineItem`[] | | `order` | `CreateFulfillmentOrder` | @@ -254,220 +263,252 @@ ___ #### Returns -`Promise`<`Record`<`string`, `unknown`\>\> +`Promise`\> + +-`Promise`: + -`Record`: + -`string`: (optional) + -`unknown`: (optional) #### Defined in -[medusa/src/services/fulfillment-provider.ts:107](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L107) +[medusa/src/services/fulfillment-provider.ts:107](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L107) ___ ### createReturn -▸ **createReturn**(`returnOrder`): `Promise`<`Record`<`string`, `unknown`\>\> +**createReturn**(`returnOrder`): `Promise`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `returnOrder` | `CreateReturnType` | #### Returns -`Promise`<`Record`<`string`, `unknown`\>\> +`Promise`\> + +-`Promise`: + -`Record`: + -`string`: (optional) + -`unknown`: (optional) #### Defined in -[medusa/src/services/fulfillment-provider.ts:165](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L165) +[medusa/src/services/fulfillment-provider.ts:165](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L165) ___ ### list -▸ **list**(): `Promise`<`FulfillmentProvider`[]\> +**list**(): `Promise`<`FulfillmentProvider`[]\> #### Returns `Promise`<`FulfillmentProvider`[]\> +-`Promise`: + -`FulfillmentProvider[]`: + -`FulfillmentProvider`: + #### Defined in -[medusa/src/services/fulfillment-provider.ts:67](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L67) +[medusa/src/services/fulfillment-provider.ts:67](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L67) ___ ### listFulfillmentOptions -▸ **listFulfillmentOptions**(`providerIds`): `Promise`<`FulfillmentOptions`[]\> +**listFulfillmentOptions**(`providerIds`): `Promise`<`FulfillmentOptions`[]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `providerIds` | `string`[] | #### Returns `Promise`<`FulfillmentOptions`[]\> +-`Promise`: + -`FulfillmentOptions[]`: + #### Defined in -[medusa/src/services/fulfillment-provider.ts:75](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L75) +[medusa/src/services/fulfillment-provider.ts:75](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L75) ___ ### registerInstalledProviders -▸ **registerInstalledProviders**(`providers`): `Promise`<`void`\> +**registerInstalledProviders**(`providers`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `providers` | `string`[] | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/fulfillment-provider.ts:53](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L53) +[medusa/src/services/fulfillment-provider.ts:53](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L53) ___ ### retrieveDocuments -▸ **retrieveDocuments**(`providerId`, `fulfillmentData`, `documentType`): `Promise`<`any`\> +**retrieveDocuments**(`providerId`, `fulfillmentData`, `documentType`): `Promise`<`any`\> Fetches documents from the fulfillment provider #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `providerId` | `string` | the id of the provider | -| `fulfillmentData` | `Record`<`string`, `unknown`\> | the data relating to the fulfillment | +| `fulfillmentData` | Record<`string`, `unknown`\> | the data relating to the fulfillment | | `documentType` | ``"label"`` \| ``"invoice"`` | the typ of | #### Returns `Promise`<`any`\> -document to fetch +-`Promise`: document to fetch + -`any`: (optional) #### Defined in -[medusa/src/services/fulfillment-provider.ts:184](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L184) +[medusa/src/services/fulfillment-provider.ts:184](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L184) ___ ### retrieveProvider -▸ **retrieveProvider**(`providerId`): `any` +**retrieveProvider**(`providerId`): `any` #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `providerId` | `string` | the provider id | #### Returns `any` -the payment fulfillment provider +-`any`: (optional) the payment fulfillment provider #### Defined in -[medusa/src/services/fulfillment-provider.ts:96](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L96) +[medusa/src/services/fulfillment-provider.ts:96](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L96) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### validateFulfillmentData -▸ **validateFulfillmentData**(`option`, `data`, `cart`): `Promise`<`Record`<`string`, `unknown`\>\> +**validateFulfillmentData**(`option`, `data`, `cart`): `Promise`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `option` | `ShippingOption` | -| `data` | `Record`<`string`, `unknown`\> | -| `cart` | `Record`<`string`, `unknown`\> \| `Cart` | +| `data` | Record<`string`, `unknown`\> | +| `cart` | Record<`string`, `unknown`\> \| `Cart` | #### Returns -`Promise`<`Record`<`string`, `unknown`\>\> +`Promise`\> + +-`Promise`: + -`Record`: + -`string`: (optional) + -`unknown`: (optional) #### Defined in -[medusa/src/services/fulfillment-provider.ts:127](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L127) +[medusa/src/services/fulfillment-provider.ts:127](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L127) ___ ### validateOption -▸ **validateOption**(`option`): `Promise`<`boolean`\> +**validateOption**(`option`): `Promise`<`boolean`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `option` | `ShippingOption` | #### Returns `Promise`<`boolean`\> +-`Promise`: + -`boolean`: (optional) + #### Defined in -[medusa/src/services/fulfillment-provider.ts:160](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment-provider.ts#L160) +[medusa/src/services/fulfillment-provider.ts:160](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment-provider.ts#L160) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`FulfillmentProviderService`](FulfillmentProviderService.md) +**withTransaction**(`transactionManager?`): [`FulfillmentProviderService`](FulfillmentProviderService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`FulfillmentProviderService`](FulfillmentProviderService.md) +-`FulfillmentProviderService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/FulfillmentService.md b/www/apps/docs/content/references/services/classes/FulfillmentService.md index a34ab37ae112c..8179e4181d889 100644 --- a/www/apps/docs/content/references/services/classes/FulfillmentService.md +++ b/www/apps/docs/content/references/services/classes/FulfillmentService.md @@ -1,4 +1,4 @@ -# Class: FulfillmentService +# FulfillmentService Handles Fulfillments @@ -12,12 +12,12 @@ Handles Fulfillments ### constructor -• **new FulfillmentService**(`«destructured»`) +**new FulfillmentService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -26,13 +26,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/fulfillment.ts:47](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L47) +[medusa/src/services/fulfillment.ts:47](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L47) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -68,53 +68,53 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### fulfillmentProviderService\_ -• `Protected` `Readonly` **fulfillmentProviderService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md) + `Protected` `Readonly` **fulfillmentProviderService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md) #### Defined in -[medusa/src/services/fulfillment.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L40) +[medusa/src/services/fulfillment.ts:40](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L40) ___ ### fulfillmentRepository\_ -• `Protected` `Readonly` **fulfillmentRepository\_**: `Repository`<`Fulfillment`\> + `Protected` `Readonly` **fulfillmentRepository\_**: `Repository`<`Fulfillment`\> #### Defined in -[medusa/src/services/fulfillment.ts:41](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L41) +[medusa/src/services/fulfillment.ts:41](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L41) ___ ### lineItemRepository\_ -• `Protected` `Readonly` **lineItemRepository\_**: `Repository`<`LineItem`\> & { `findByReturn`: (`returnId`: `string`) => `Promise`<`LineItem` & { `return_item`: `ReturnItem` }[]\> } + `Protected` `Readonly` **lineItemRepository\_**: `Repository`<`LineItem`\> & { `findByReturn`: Method findByReturn } #### Defined in -[medusa/src/services/fulfillment.ts:43](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L43) +[medusa/src/services/fulfillment.ts:43](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L43) ___ ### lineItemService\_ -• `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md) + `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md) #### Defined in -[medusa/src/services/fulfillment.ts:38](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L38) +[medusa/src/services/fulfillment.ts:38](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L38) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -122,53 +122,53 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### productVariantInventoryService\_ -• `Protected` `Readonly` **productVariantInventoryService\_**: [`ProductVariantInventoryService`](ProductVariantInventoryService.md) + `Protected` `Readonly` **productVariantInventoryService\_**: [`ProductVariantInventoryService`](ProductVariantInventoryService.md) #### Defined in -[medusa/src/services/fulfillment.ts:45](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L45) +[medusa/src/services/fulfillment.ts:45](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L45) ___ ### shippingProfileService\_ -• `Protected` `Readonly` **shippingProfileService\_**: [`ShippingProfileService`](ShippingProfileService.md) + `Protected` `Readonly` **shippingProfileService\_**: [`ShippingProfileService`](ShippingProfileService.md) #### Defined in -[medusa/src/services/fulfillment.ts:39](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L39) +[medusa/src/services/fulfillment.ts:39](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L39) ___ ### totalsService\_ -• `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md) + `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md) #### Defined in -[medusa/src/services/fulfillment.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L37) +[medusa/src/services/fulfillment.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L37) ___ ### trackingLinkRepository\_ -• `Protected` `Readonly` **trackingLinkRepository\_**: `Repository`<`TrackingLink`\> + `Protected` `Readonly` **trackingLinkRepository\_**: `Repository`<`TrackingLink`\> #### Defined in -[medusa/src/services/fulfillment.ts:42](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L42) +[medusa/src/services/fulfillment.ts:42](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L42) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -176,47 +176,47 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -225,7 +225,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -233,13 +233,13 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### cancelFulfillment -▸ **cancelFulfillment**(`fulfillmentOrId`): `Promise`<`Fulfillment`\> +**cancelFulfillment**(`fulfillmentOrId`): `Promise`<`Fulfillment`\> Cancels a fulfillment with the fulfillment provider. Will decrement the fulfillment_quantity on the line items associated with the fulfillment. @@ -247,25 +247,26 @@ Throws if the fulfillment has already been shipped. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `fulfillmentOrId` | `string` \| `Fulfillment` | the fulfillment object or id. | #### Returns `Promise`<`Fulfillment`\> -the result of the save operation +-`Promise`: the result of the save operation + -`Fulfillment`: #### Defined in -[medusa/src/services/fulfillment.ts:260](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L260) +[medusa/src/services/fulfillment.ts:260](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L260) ___ ### createFulfillment -▸ **createFulfillment**(`order`, `itemsToFulfill`, `custom?`): `Promise`<`Fulfillment`[]\> +**createFulfillment**(`order`, `itemsToFulfill`, `custom?`): `Promise`<`Fulfillment`[]\> Creates an order fulfillment If items needs to be fulfilled by different provider, we make @@ -274,8 +275,8 @@ those partitions. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `order` | `CreateFulfillmentOrder` | order to create fulfillment for | | `itemsToFulfill` | `FulFillmentItemType`[] | the items in the order to fulfill | | `custom` | `Partial`<`Fulfillment`\> | potential custom values to add | @@ -284,25 +285,27 @@ those partitions. `Promise`<`Fulfillment`[]\> -the created fulfillments +-`Promise`: the created fulfillments + -`Fulfillment[]`: + -`Fulfillment`: #### Defined in -[medusa/src/services/fulfillment.ts:205](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L205) +[medusa/src/services/fulfillment.ts:205](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L205) ___ ### createShipment -▸ **createShipment**(`fulfillmentId`, `trackingLinks?`, `config?`): `Promise`<`Fulfillment`\> +**createShipment**(`fulfillmentId`, `trackingLinks?`, `config?`): `Promise`<`Fulfillment`\> Creates a shipment by marking a fulfillment as shipped. Adds tracking links and potentially more metadata. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `fulfillmentId` | `string` | the fulfillment to ship | | `trackingLinks?` | { `tracking_number`: `string` }[] | tracking links for the shipment | | `config` | `CreateShipmentConfig` | potential configuration settings, such as no_notification and metadata | @@ -311,24 +314,25 @@ tracking links and potentially more metadata. `Promise`<`Fulfillment`\> -the shipped fulfillment +-`Promise`: the shipped fulfillment + -`Fulfillment`: #### Defined in -[medusa/src/services/fulfillment.ts:312](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L312) +[medusa/src/services/fulfillment.ts:312](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L312) ___ ### getFulfillmentItems\_ -▸ **getFulfillmentItems_**(`order`, `items`): `Promise`<(``null`` \| `LineItem`)[]\> +**getFulfillmentItems_**(`order`, `items`): `Promise`<(``null`` \| `LineItem`)[]\> Retrieves the order line items, given an array of items. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `order` | `CreateFulfillmentOrder` | the order to get line items from | | `items` | `FulFillmentItemType`[] | the items to get | @@ -336,22 +340,24 @@ Retrieves the order line items, given an array of items. `Promise`<(``null`` \| `LineItem`)[]\> -the line items generated by the transformer. +-`Promise`: the line items generated by the transformer. + -`(``null`` \| LineItem)[]`: + -```null`` \| LineItem`: (optional) #### Defined in -[medusa/src/services/fulfillment.ts:109](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L109) +[medusa/src/services/fulfillment.ts:109](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L109) ___ ### partitionItems\_ -▸ **partitionItems_**(`shippingMethods`, `items`): `FulfillmentItemPartition`[] +**partitionItems_**(`shippingMethods`, `items`): `FulfillmentItemPartition`[] #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `shippingMethods` | `ShippingMethod`[] | | `items` | `LineItem`[] | @@ -359,22 +365,24 @@ ___ `FulfillmentItemPartition`[] +-`FulfillmentItemPartition[]`: + #### Defined in -[medusa/src/services/fulfillment.ts:70](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L70) +[medusa/src/services/fulfillment.ts:70](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L70) ___ ### retrieve -▸ **retrieve**(`fulfillmentId`, `config?`): `Promise`<`Fulfillment`\> +**retrieve**(`fulfillmentId`, `config?`): `Promise`<`Fulfillment`\> Retrieves a fulfillment by its id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `fulfillmentId` | `string` | the id of the fulfillment to retrieve | | `config` | `FindConfig`<`Fulfillment`\> | optional values to include with fulfillmentRepository query | @@ -382,41 +390,44 @@ Retrieves a fulfillment by its id. `Promise`<`Fulfillment`\> -the fulfillment +-`Promise`: the fulfillment + -`Fulfillment`: #### Defined in -[medusa/src/services/fulfillment.ts:167](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L167) +[medusa/src/services/fulfillment.ts:167](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L167) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### validateFulfillmentLineItem\_ -▸ **validateFulfillmentLineItem_**(`item`, `quantity`): ``null`` \| `LineItem` +**validateFulfillmentLineItem_**(`item`, `quantity`): ``null`` \| `LineItem` Checks that a given quantity of a line item can be fulfilled. Fails if the fulfillable quantity is lower than the requested fulfillment quantity. @@ -425,8 +436,8 @@ quantity from the quantity that was originally purchased. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `item` | `undefined` \| `LineItem` | the line item to check has sufficient fulfillable quantity. | | `quantity` | `number` | the quantity that is requested to be fulfilled. | @@ -434,33 +445,35 @@ quantity from the quantity that was originally purchased. ``null`` \| `LineItem` -a line item that has the requested fulfillment quantity +-```null`` \| LineItem`: (optional) a line item that has the requested fulfillment quantity set. #### Defined in -[medusa/src/services/fulfillment.ts:134](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/fulfillment.ts#L134) +[medusa/src/services/fulfillment.ts:134](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/fulfillment.ts#L134) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`FulfillmentService`](FulfillmentService.md) +**withTransaction**(`transactionManager?`): [`FulfillmentService`](FulfillmentService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`FulfillmentService`](FulfillmentService.md) +-`FulfillmentService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/GiftCardService.md b/www/apps/docs/content/references/services/classes/GiftCardService.md index b25dd02c23903..4ae90c1214b60 100644 --- a/www/apps/docs/content/references/services/classes/GiftCardService.md +++ b/www/apps/docs/content/references/services/classes/GiftCardService.md @@ -1,4 +1,4 @@ -# Class: GiftCardService +# GiftCardService Provides layer to manipulate gift cards. @@ -12,12 +12,12 @@ Provides layer to manipulate gift cards. ### constructor -• **new GiftCardService**(`«destructured»`) +**new GiftCardService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -26,13 +26,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/gift-card.ts:39](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L39) +[medusa/src/services/gift-card.ts:39](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L39) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -68,43 +68,43 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### eventBus\_ -• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/gift-card.ts:33](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L33) +[medusa/src/services/gift-card.ts:33](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L33) ___ ### giftCardRepository\_ -• `Protected` `Readonly` **giftCardRepository\_**: `Repository`<`GiftCard`\> & { `listGiftCardsAndCount`: (`query`: `ExtendedFindConfig`<`GiftCard`\>, `q?`: `string`) => `Promise`<[`GiftCard`[], `number`]\> } + `Protected` `Readonly` **giftCardRepository\_**: `Repository`<`GiftCard`\> & { `listGiftCardsAndCount`: Method listGiftCardsAndCount } #### Defined in -[medusa/src/services/gift-card.ts:29](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L29) +[medusa/src/services/gift-card.ts:29](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L29) ___ ### giftCardTransactionRepo\_ -• `Protected` `Readonly` **giftCardTransactionRepo\_**: `Repository`<`GiftCardTransaction`\> + `Protected` `Readonly` **giftCardTransactionRepo\_**: `Repository`<`GiftCardTransaction`\> #### Defined in -[medusa/src/services/gift-card.ts:31](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L31) +[medusa/src/services/gift-card.ts:31](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L31) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -112,23 +112,23 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### regionService\_ -• `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md) + `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md) #### Defined in -[medusa/src/services/gift-card.ts:32](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L32) +[medusa/src/services/gift-card.ts:32](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L32) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -136,13 +136,13 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### Events -▪ `Static` **Events**: `Object` + `Static` **Events**: `Object` #### Type declaration @@ -152,47 +152,47 @@ ___ #### Defined in -[medusa/src/services/gift-card.ts:35](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L35) +[medusa/src/services/gift-card.ts:35](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L35) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -201,7 +201,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -209,86 +209,91 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**(`giftCard`): `Promise`<`GiftCard`\> +**create**(`giftCard`): `Promise`<`GiftCard`\> Creates a gift card with provided data given that the data is validated. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `giftCard` | `CreateGiftCardInput` | the gift card data to create | #### Returns `Promise`<`GiftCard`\> -the result of the create operation +-`Promise`: the result of the create operation + -`GiftCard`: #### Defined in -[medusa/src/services/gift-card.ts:122](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L122) +[medusa/src/services/gift-card.ts:122](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L122) ___ ### createTransaction -▸ **createTransaction**(`data`): `Promise`<`string`\> +**createTransaction**(`data`): `Promise`<`string`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `data` | `CreateGiftCardTransactionInput` | #### Returns `Promise`<`string`\> +-`Promise`: + -`string`: (optional) + #### Defined in -[medusa/src/services/gift-card.ts:106](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L106) +[medusa/src/services/gift-card.ts:106](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L106) ___ ### delete -▸ **delete**(`giftCardId`): `Promise`<`void` \| `GiftCard`\> +**delete**(`giftCardId`): `Promise`<`void` \| `GiftCard`\> Deletes a gift card idempotently #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `giftCardId` | `string` | id of gift card to delete | #### Returns `Promise`<`void` \| `GiftCard`\> -the result of the delete operation +-`Promise`: the result of the delete operation + -`void \| GiftCard`: (optional) #### Defined in -[medusa/src/services/gift-card.ts:295](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L295) +[medusa/src/services/gift-card.ts:295](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L295) ___ ### list -▸ **list**(`selector?`, `config?`): `Promise`<`GiftCard`[]\> +**list**(`selector?`, `config?`): `Promise`<`GiftCard`[]\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `QuerySelector`<`GiftCard`\> | the query object for find | | `config` | `FindConfig`<`GiftCard`\> | the configuration used to find the objects. contains relations, skip, and take. | @@ -296,22 +301,24 @@ ___ `Promise`<`GiftCard`[]\> -the result of the find operation +-`Promise`: the result of the find operation + -`GiftCard[]`: + -`GiftCard`: #### Defined in -[medusa/src/services/gift-card.ts:98](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L98) +[medusa/src/services/gift-card.ts:98](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L98) ___ ### listAndCount -▸ **listAndCount**(`selector?`, `config?`): `Promise`<[`GiftCard`[], `number`]\> +**listAndCount**(`selector?`, `config?`): `Promise`<[`GiftCard`[], `number`]\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `QuerySelector`<`GiftCard`\> | the query object for find | | `config` | `FindConfig`<`GiftCard`\> | the configuration used to find the objects. contains relations, skip, and take. | @@ -319,24 +326,26 @@ ___ `Promise`<[`GiftCard`[], `number`]\> -the result of the find operation +-`Promise`: the result of the find operation + -`GiftCard[]`: + -`number`: (optional) #### Defined in -[medusa/src/services/gift-card.ts:74](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L74) +[medusa/src/services/gift-card.ts:74](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L74) ___ ### retrieve -▸ **retrieve**(`giftCardId`, `config?`): `Promise`<`GiftCard`\> +**retrieve**(`giftCardId`, `config?`): `Promise`<`GiftCard`\> Gets a gift card by id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `giftCardId` | `string` | id of gift card to retrieve | | `config` | `FindConfig`<`GiftCard`\> | optional values to include with gift card query | @@ -344,22 +353,23 @@ Gets a gift card by id. `Promise`<`GiftCard`\> -the gift card +-`Promise`: the gift card + -`GiftCard`: #### Defined in -[medusa/src/services/gift-card.ts:215](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L215) +[medusa/src/services/gift-card.ts:215](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L215) ___ ### retrieveByCode -▸ **retrieveByCode**(`code`, `config?`): `Promise`<`GiftCard`\> +**retrieveByCode**(`code`, `config?`): `Promise`<`GiftCard`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `code` | `string` | | `config` | `FindConfig`<`GiftCard`\> | @@ -367,20 +377,23 @@ ___ `Promise`<`GiftCard`\> +-`Promise`: + -`GiftCard`: + #### Defined in -[medusa/src/services/gift-card.ts:229](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L229) +[medusa/src/services/gift-card.ts:229](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L229) ___ ### retrieve\_ -▸ `Protected` **retrieve_**(`selector`, `config?`): `Promise`<`GiftCard`\> +`Protected` **retrieve_**(`selector`, `config?`): `Promise`<`GiftCard`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `selector` | `Selector`<`GiftCard`\> | | `config` | `FindConfig`<`GiftCard`\> | @@ -388,46 +401,51 @@ ___ `Promise`<`GiftCard`\> +-`Promise`: + -`GiftCard`: + #### Defined in -[medusa/src/services/gift-card.ts:182](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L182) +[medusa/src/services/gift-card.ts:182](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L182) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`giftCardId`, `update`): `Promise`<`GiftCard`\> +**update**(`giftCardId`, `update`): `Promise`<`GiftCard`\> Updates a giftCard. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `giftCardId` | `string` | giftCard id of giftCard to update | | `update` | `UpdateGiftCardInput` | the data to update the giftCard with | @@ -435,41 +453,44 @@ Updates a giftCard. `Promise`<`GiftCard`\> -the result of the update operation +-`Promise`: the result of the update operation + -`GiftCard`: #### Defined in -[medusa/src/services/gift-card.ts:249](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L249) +[medusa/src/services/gift-card.ts:249](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L249) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`GiftCardService`](GiftCardService.md) +**withTransaction**(`transactionManager?`): [`GiftCardService`](GiftCardService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`GiftCardService`](GiftCardService.md) +-`GiftCardService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) ___ ### generateCode -▸ `Static` **generateCode**(): `string` +`Static` **generateCode**(): `string` Generates a 16 character gift card code @@ -477,25 +498,25 @@ Generates a 16 character gift card code `string` -the generated gift card code +-`string`: (optional) the generated gift card code #### Defined in -[medusa/src/services/gift-card.ts:58](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L58) +[medusa/src/services/gift-card.ts:58](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L58) ___ ### resolveTaxRate -▸ `Static` `Protected` **resolveTaxRate**(`giftCardTaxRate`, `region`): ``null`` \| `number` +`Static` `Protected` **resolveTaxRate**(`giftCardTaxRate`, `region`): ``null`` \| `number` The tax_rate of the giftcard can depend on whether regions tax gift cards, an input provided by the user or the tax rate. Based on these conditions, tax_rate changes. #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `giftCardTaxRate` | ``null`` \| `number` | | `region` | `Region` | @@ -503,8 +524,8 @@ provided by the user or the tax rate. Based on these conditions, tax_rate change ``null`` \| `number` -the tax rate for the gift card +-```null`` \| number`: (optional) the tax rate for the gift card #### Defined in -[medusa/src/services/gift-card.ts:161](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/gift-card.ts#L161) +[medusa/src/services/gift-card.ts:161](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/gift-card.ts#L161) diff --git a/www/apps/docs/content/references/services/classes/IdempotencyKeyService.md b/www/apps/docs/content/references/services/classes/IdempotencyKeyService.md index c6f9b5dbbe23b..d98abf42e5470 100644 --- a/www/apps/docs/content/references/services/classes/IdempotencyKeyService.md +++ b/www/apps/docs/content/references/services/classes/IdempotencyKeyService.md @@ -1,4 +1,4 @@ -# Class: IdempotencyKeyService +# IdempotencyKeyService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new IdempotencyKeyService**(`«destructured»`) +**new IdempotencyKeyService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/idempotency-key.ts:25](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/idempotency-key.ts#L25) +[medusa/src/services/idempotency-key.ts:25](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/idempotency-key.ts#L25) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,23 +66,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### idempotencyKeyRepository\_ -• `Protected` `Readonly` **idempotencyKeyRepository\_**: `Repository`<`IdempotencyKey`\> + `Protected` `Readonly` **idempotencyKeyRepository\_**: `Repository`<`IdempotencyKey`\> #### Defined in -[medusa/src/services/idempotency-key.ts:23](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/idempotency-key.ts#L23) +[medusa/src/services/idempotency-key.ts:23](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/idempotency-key.ts#L23) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -90,13 +90,13 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -104,47 +104,47 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -153,7 +153,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -161,13 +161,13 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**(`payload`): `Promise`<`IdempotencyKey`\> +**create**(`payload`): `Promise`<`IdempotencyKey`\> Creates an idempotency key for a request. If no idempotency key is provided in request, we will create a unique @@ -175,131 +175,137 @@ identifier. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `payload` | `CreateIdempotencyKeyInput` | payload of request to create idempotency key for | #### Returns `Promise`<`IdempotencyKey`\> -the created idempotency key +-`Promise`: the created idempotency key + -`IdempotencyKey`: #### Defined in -[medusa/src/services/idempotency-key.ts:68](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/idempotency-key.ts#L68) +[medusa/src/services/idempotency-key.ts:68](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/idempotency-key.ts#L68) ___ ### initializeRequest -▸ **initializeRequest**(`headerKey`, `reqMethod`, `reqParams`, `reqPath`): `Promise`<`IdempotencyKey`\> +**initializeRequest**(`headerKey`, `reqMethod`, `reqParams`, `reqPath`): `Promise`<`IdempotencyKey`\> Execute the initial steps in a idempotent request. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `headerKey` | `string` | potential idempotency key from header | | `reqMethod` | `string` | method of request | -| `reqParams` | `Record`<`string`, `unknown`\> | params of request | +| `reqParams` | Record<`string`, `unknown`\> | params of request | | `reqPath` | `string` | path of request | #### Returns `Promise`<`IdempotencyKey`\> -the existing or created idempotency key +-`Promise`: the existing or created idempotency key + -`IdempotencyKey`: #### Defined in -[medusa/src/services/idempotency-key.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/idempotency-key.ts#L40) +[medusa/src/services/idempotency-key.ts:40](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/idempotency-key.ts#L40) ___ ### lock -▸ **lock**(`idempotencyKey`): `Promise`<`IdempotencyKey`\> +**lock**(`idempotencyKey`): `Promise`<`IdempotencyKey`\> Locks an idempotency. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `idempotencyKey` | `string` | key to lock | #### Returns `Promise`<`IdempotencyKey`\> -result of the update operation +-`Promise`: result of the update operation + -`IdempotencyKey`: #### Defined in -[medusa/src/services/idempotency-key.ts:138](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/idempotency-key.ts#L138) +[medusa/src/services/idempotency-key.ts:138](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/idempotency-key.ts#L138) ___ ### retrieve -▸ **retrieve**(`idempotencyKeyOrSelector`): `Promise`<`IdempotencyKey`\> +**retrieve**(`idempotencyKeyOrSelector`): `Promise`<`IdempotencyKey`\> Retrieves an idempotency key #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `idempotencyKeyOrSelector` | `string` \| `Selector`<`IdempotencyKey`\> | key or selector to retrieve | #### Returns `Promise`<`IdempotencyKey`\> -idempotency key +-`Promise`: idempotency key + -`IdempotencyKey`: #### Defined in -[medusa/src/services/idempotency-key.ts:86](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/idempotency-key.ts#L86) +[medusa/src/services/idempotency-key.ts:86](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/idempotency-key.ts#L86) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`idempotencyKey`, `update`): `Promise`<`IdempotencyKey`\> +**update**(`idempotencyKey`, `update`): `Promise`<`IdempotencyKey`\> Locks an idempotency. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `idempotencyKey` | `string` | key to update | | `update` | `DeepPartial`<`IdempotencyKey`\> | update object | @@ -307,41 +313,44 @@ Locks an idempotency. `Promise`<`IdempotencyKey`\> -result of the update operation +-`Promise`: result of the update operation + -`IdempotencyKey`: #### Defined in -[medusa/src/services/idempotency-key.ts:167](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/idempotency-key.ts#L167) +[medusa/src/services/idempotency-key.ts:167](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/idempotency-key.ts#L167) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`IdempotencyKeyService`](IdempotencyKeyService.md) +**withTransaction**(`transactionManager?`): [`IdempotencyKeyService`](IdempotencyKeyService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`IdempotencyKeyService`](IdempotencyKeyService.md) +-`IdempotencyKeyService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) ___ ### workStage -▸ **workStage**(`idempotencyKey`, `callback`): `Promise`<`IdempotencyKey`\> +**workStage**(`idempotencyKey`, `callback`): `Promise`<`IdempotencyKey`\> Performs an atomic work stage. An atomic work stage contains some related functionality, that needs to be @@ -351,8 +360,8 @@ always consist of 2 or more of these phases. The required phases are #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `idempotencyKey` | `string` | current idempotency key | | `callback` | (`transactionManager`: `EntityManager`) => `Promise`<`IdempotencyCallbackResult`\> | functionality to execute within the phase | @@ -360,8 +369,9 @@ always consist of 2 or more of these phases. The required phases are `Promise`<`IdempotencyKey`\> -new updated idempotency key +-`Promise`: new updated idempotency key + -`IdempotencyKey`: #### Defined in -[medusa/src/services/idempotency-key.ts:196](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/idempotency-key.ts#L196) +[medusa/src/services/idempotency-key.ts:196](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/idempotency-key.ts#L196) diff --git a/www/apps/docs/content/references/services/classes/LineItemAdjustmentService.md b/www/apps/docs/content/references/services/classes/LineItemAdjustmentService.md index dcabb6676f98b..2d24971d63853 100644 --- a/www/apps/docs/content/references/services/classes/LineItemAdjustmentService.md +++ b/www/apps/docs/content/references/services/classes/LineItemAdjustmentService.md @@ -1,4 +1,4 @@ -# Class: LineItemAdjustmentService +# LineItemAdjustmentService Provides layer to manipulate line item adjustments. @@ -12,12 +12,12 @@ Provides layer to manipulate line item adjustments. ### constructor -• **new LineItemAdjustmentService**(`«destructured»`) +**new LineItemAdjustmentService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `LineItemAdjustmentServiceProps` | #### Overrides @@ -26,13 +26,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/line-item-adjustment.ts:36](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item-adjustment.ts#L36) +[medusa/src/services/line-item-adjustment.ts:36](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item-adjustment.ts#L36) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -68,33 +68,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### discountService -• `Private` `Readonly` **discountService**: [`DiscountService`](DiscountService.md) + `Private` `Readonly` **discountService**: [`DiscountService`](DiscountService.md) #### Defined in -[medusa/src/services/line-item-adjustment.ts:34](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item-adjustment.ts#L34) +[medusa/src/services/line-item-adjustment.ts:34](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item-adjustment.ts#L34) ___ ### lineItemAdjustmentRepo\_ -• `Private` `Readonly` **lineItemAdjustmentRepo\_**: `Repository`<`LineItemAdjustment`\> + `Private` `Readonly` **lineItemAdjustmentRepo\_**: `Repository`<`LineItemAdjustment`\> #### Defined in -[medusa/src/services/line-item-adjustment.ts:33](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item-adjustment.ts#L33) +[medusa/src/services/line-item-adjustment.ts:33](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item-adjustment.ts#L33) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -102,13 +102,13 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -116,47 +116,47 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -165,7 +165,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -173,44 +173,45 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**(`data`): `Promise`<`LineItemAdjustment`\> +**create**(`data`): `Promise`<`LineItemAdjustment`\> Creates a line item adjustment #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `data` | `Partial`<`LineItemAdjustment`\> | the line item adjustment to create | #### Returns `Promise`<`LineItemAdjustment`\> -line item adjustment +-`Promise`: line item adjustment + -`LineItemAdjustment`: #### Defined in -[medusa/src/services/line-item-adjustment.ts:86](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item-adjustment.ts#L86) +[medusa/src/services/line-item-adjustment.ts:86](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item-adjustment.ts#L86) ___ ### createAdjustmentForLineItem -▸ **createAdjustmentForLineItem**(`cart`, `lineItem`): `Promise`<`LineItemAdjustment`[]\> +**createAdjustmentForLineItem**(`cart`, `lineItem`): `Promise`<`LineItemAdjustment`[]\> Creates adjustment for a line item #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cart` | `Cart` | the cart object holding discounts | | `lineItem` | `LineItem` | the line item for which a line item adjustment might be created | @@ -218,24 +219,26 @@ Creates adjustment for a line item `Promise`<`LineItemAdjustment`[]\> -a line item adjustment or undefined if no adjustment was created +-`Promise`: a line item adjustment or undefined if no adjustment was created + -`LineItemAdjustment[]`: + -`LineItemAdjustment`: #### Defined in -[medusa/src/services/line-item-adjustment.ts:262](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item-adjustment.ts#L262) +[medusa/src/services/line-item-adjustment.ts:262](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item-adjustment.ts#L262) ___ ### createAdjustments -▸ **createAdjustments**(`cart`, `lineItem?`): `Promise`<`LineItemAdjustment`[] \| `LineItemAdjustment`[][]\> +**createAdjustments**(`cart`, `lineItem?`): `Promise`<`LineItemAdjustment`[] \| `LineItemAdjustment`[][]\> Creates adjustment for a line item #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cart` | `Cart` | the cart object holding discounts | | `lineItem?` | `LineItem` | the line item for which a line item adjustment might be created | @@ -243,49 +246,50 @@ Creates adjustment for a line item `Promise`<`LineItemAdjustment`[] \| `LineItemAdjustment`[][]\> -if a lineItem was given, returns a line item adjustment or undefined if no adjustment was created +-`Promise`: if a lineItem was given, returns a line item adjustment or undefined if no adjustment was created otherwise returns an array of line item adjustments for each line item in the cart + -`LineItemAdjustment[] \| LineItemAdjustment[][]`: (optional) #### Defined in -[medusa/src/services/line-item-adjustment.ts:290](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item-adjustment.ts#L290) +[medusa/src/services/line-item-adjustment.ts:290](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item-adjustment.ts#L290) ___ ### delete -▸ **delete**(`selectorOrIds`): `Promise`<`void`\> +**delete**(`selectorOrIds`): `Promise`<`void`\> Deletes line item adjustments matching a selector #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selectorOrIds` | `string` \| `string`[] \| `FilterableLineItemAdjustmentProps` & { `discount_id?`: `FindOperator`<``null`` \| `string`\> } | the query object for find or the line item adjustment id | #### Returns `Promise`<`void`\> -the result of the delete operation +-`Promise`: the result of the delete operation #### Defined in -[medusa/src/services/line-item-adjustment.ts:153](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item-adjustment.ts#L153) +[medusa/src/services/line-item-adjustment.ts:153](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item-adjustment.ts#L153) ___ ### generateAdjustments -▸ **generateAdjustments**(`calculationContextData`, `generatedLineItem`, `context`): `Promise`<`GeneratedAdjustment`[]\> +**generateAdjustments**(`calculationContextData`, `generatedLineItem`, `context`): `Promise`<`GeneratedAdjustment`[]\> Creates adjustment for a line item #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `calculationContextData` | `CalculationContextData` | the calculationContextData object holding discounts | | `generatedLineItem` | `LineItem` | the line item for which a line item adjustment might be created | | `context` | `AdjustmentContext` | the line item for which a line item adjustment might be created | @@ -294,24 +298,25 @@ Creates adjustment for a line item `Promise`<`GeneratedAdjustment`[]\> -a line item adjustment or undefined if no adjustment was created +-`Promise`: a line item adjustment or undefined if no adjustment was created + -`GeneratedAdjustment[]`: #### Defined in -[medusa/src/services/line-item-adjustment.ts:188](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item-adjustment.ts#L188) +[medusa/src/services/line-item-adjustment.ts:188](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item-adjustment.ts#L188) ___ ### list -▸ **list**(`selector?`, `config?`): `Promise`<`LineItemAdjustment`[]\> +**list**(`selector?`, `config?`): `Promise`<`LineItemAdjustment`[]\> Lists line item adjustments #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `FilterableLineItemAdjustmentProps` | the query object for find | | `config` | `FindConfig`<`LineItemAdjustment`\> | the config to be used for find | @@ -319,24 +324,26 @@ Lists line item adjustments `Promise`<`LineItemAdjustment`[]\> -the result of the find operation +-`Promise`: the result of the find operation + -`LineItemAdjustment[]`: + -`LineItemAdjustment`: #### Defined in -[medusa/src/services/line-item-adjustment.ts:136](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item-adjustment.ts#L136) +[medusa/src/services/line-item-adjustment.ts:136](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item-adjustment.ts#L136) ___ ### retrieve -▸ **retrieve**(`lineItemAdjustmentId`, `config?`): `Promise`<`LineItemAdjustment`\> +**retrieve**(`lineItemAdjustmentId`, `config?`): `Promise`<`LineItemAdjustment`\> Retrieves a line item adjustment by id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `lineItemAdjustmentId` | `string` | the id of the line item adjustment to retrieve | | `config` | `FindConfig`<`LineItemAdjustment`\> | the config to retrieve the line item adjustment by | @@ -344,48 +351,51 @@ Retrieves a line item adjustment by id. `Promise`<`LineItemAdjustment`\> -the line item adjustment. +-`Promise`: the line item adjustment. + -`LineItemAdjustment`: #### Defined in -[medusa/src/services/line-item-adjustment.ts:53](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item-adjustment.ts#L53) +[medusa/src/services/line-item-adjustment.ts:53](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item-adjustment.ts#L53) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`id`, `data`): `Promise`<`LineItemAdjustment`\> +**update**(`id`, `data`): `Promise`<`LineItemAdjustment`\> Creates a line item adjustment #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `id` | `string` | the line item adjustment id to update | | `data` | `Partial`<`LineItemAdjustment`\> | the line item adjustment to create | @@ -393,32 +403,35 @@ Creates a line item adjustment `Promise`<`LineItemAdjustment`\> -line item adjustment +-`Promise`: line item adjustment + -`LineItemAdjustment`: #### Defined in -[medusa/src/services/line-item-adjustment.ts:104](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item-adjustment.ts#L104) +[medusa/src/services/line-item-adjustment.ts:104](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item-adjustment.ts#L104) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`LineItemAdjustmentService`](LineItemAdjustmentService.md) +**withTransaction**(`transactionManager?`): [`LineItemAdjustmentService`](LineItemAdjustmentService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`LineItemAdjustmentService`](LineItemAdjustmentService.md) +-`LineItemAdjustmentService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/LineItemService.md b/www/apps/docs/content/references/services/classes/LineItemService.md index a8ff7f91b0de7..04cc6ec6dbe11 100644 --- a/www/apps/docs/content/references/services/classes/LineItemService.md +++ b/www/apps/docs/content/references/services/classes/LineItemService.md @@ -1,4 +1,4 @@ -# Class: LineItemService +# LineItemService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new LineItemService**(`«destructured»`) +**new LineItemService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/line-item.ts:57](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L57) +[medusa/src/services/line-item.ts:57](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L57) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,63 +66,63 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### cartRepository\_ -• `Protected` `Readonly` **cartRepository\_**: `Repository`<`Cart`\> & { `findOneWithRelations`: (`relations`: `FindOptionsRelations`<`Cart`\>, `optionsWithoutRelations`: `Omit`<`FindManyOptions`<`Cart`\>, ``"relations"``\>) => `Promise`<`Cart`\> ; `findWithRelations`: (`relations`: `FindOptionsRelations`<`Cart`\>, `optionsWithoutRelations`: `Omit`<`FindManyOptions`<`Cart`\>, ``"relations"``\>) => `Promise`<`Cart`[]\> } + `Protected` `Readonly` **cartRepository\_**: `Repository`<`Cart`\> & { `findOneWithRelations`: Method findOneWithRelations ; `findWithRelations`: Method findWithRelations } #### Defined in -[medusa/src/services/line-item.ts:48](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L48) +[medusa/src/services/line-item.ts:48](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L48) ___ ### featureFlagRouter\_ -• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` + `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` #### Defined in -[medusa/src/services/line-item.ts:53](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L53) +[medusa/src/services/line-item.ts:53](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L53) ___ ### itemTaxLineRepo\_ -• `Protected` `Readonly` **itemTaxLineRepo\_**: `Repository`<`LineItemTaxLine`\> & { `deleteForCart`: (`cartId`: `string`) => `Promise`<`void`\> ; `upsertLines`: (`lines`: `LineItemTaxLine`[]) => `Promise`<`LineItemTaxLine`[]\> } + `Protected` `Readonly` **itemTaxLineRepo\_**: `Repository`<`LineItemTaxLine`\> & { `deleteForCart`: Method deleteForCart ; `upsertLines`: Method upsertLines } #### Defined in -[medusa/src/services/line-item.ts:47](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L47) +[medusa/src/services/line-item.ts:47](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L47) ___ ### lineItemAdjustmentService\_ -• `Protected` `Readonly` **lineItemAdjustmentService\_**: [`LineItemAdjustmentService`](LineItemAdjustmentService.md) + `Protected` `Readonly` **lineItemAdjustmentService\_**: [`LineItemAdjustmentService`](LineItemAdjustmentService.md) #### Defined in -[medusa/src/services/line-item.ts:54](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L54) +[medusa/src/services/line-item.ts:54](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L54) ___ ### lineItemRepository\_ -• `Protected` `Readonly` **lineItemRepository\_**: `Repository`<`LineItem`\> & { `findByReturn`: (`returnId`: `string`) => `Promise`<`LineItem` & { `return_item`: `ReturnItem` }[]\> } + `Protected` `Readonly` **lineItemRepository\_**: `Repository`<`LineItem`\> & { `findByReturn`: Method findByReturn } #### Defined in -[medusa/src/services/line-item.ts:46](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L46) +[medusa/src/services/line-item.ts:46](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L46) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -130,63 +130,63 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### pricingService\_ -• `Protected` `Readonly` **pricingService\_**: [`PricingService`](PricingService.md) + `Protected` `Readonly` **pricingService\_**: [`PricingService`](PricingService.md) #### Defined in -[medusa/src/services/line-item.ts:51](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L51) +[medusa/src/services/line-item.ts:51](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L51) ___ ### productService\_ -• `Protected` `Readonly` **productService\_**: [`ProductService`](ProductService.md) + `Protected` `Readonly` **productService\_**: [`ProductService`](ProductService.md) #### Defined in -[medusa/src/services/line-item.ts:50](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L50) +[medusa/src/services/line-item.ts:50](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L50) ___ ### productVariantService\_ -• `Protected` `Readonly` **productVariantService\_**: [`ProductVariantService`](ProductVariantService.md) + `Protected` `Readonly` **productVariantService\_**: [`ProductVariantService`](ProductVariantService.md) #### Defined in -[medusa/src/services/line-item.ts:49](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L49) +[medusa/src/services/line-item.ts:49](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L49) ___ ### regionService\_ -• `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md) + `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md) #### Defined in -[medusa/src/services/line-item.ts:52](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L52) +[medusa/src/services/line-item.ts:52](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L52) ___ ### taxProviderService\_ -• `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md) + `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md) #### Defined in -[medusa/src/services/line-item.ts:55](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L55) +[medusa/src/services/line-item.ts:55](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L55) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -194,47 +194,47 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -243,7 +243,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -251,75 +251,77 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### cloneTo -▸ **cloneTo**(`ids`, `data?`, `options?`): `Promise`<`LineItem`[]\> +**cloneTo**(`ids`, `data?`, `options?`): `Promise`<`LineItem`[]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `ids` | `string` \| `string`[] | | `data` | `DeepPartial`<`LineItem`\> | -| `options` | `Object` | +| `options` | `object` | | `options.setOriginalLineItemId?` | `boolean` | #### Returns `Promise`<`LineItem`[]\> +-`Promise`: + -`LineItem[]`: + -`LineItem`: + #### Defined in -[medusa/src/services/line-item.ts:541](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L541) +[medusa/src/services/line-item.ts:541](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L541) ___ ### create -▸ **create**<`T`, `TResult`\>(`data`): `Promise`<`TResult`\> +**create**<`T`, `TResult`\>(`data`): `Promise`<`TResult`\> Create a line item -#### Type parameters - | Name | Type | | :------ | :------ | -| `T` | `LineItem` \| `LineItem`[] | -| `TResult` | `T` extends `LineItem`[] ? `LineItem`[] : `LineItem` | +| `T` | `object` | +| `TResult` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `data` | `T` | the line item object to create | #### Returns `Promise`<`TResult`\> -the created line item +-`Promise`: the created line item #### Defined in -[medusa/src/services/line-item.ts:421](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L421) +[medusa/src/services/line-item.ts:421](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L421) ___ ### createReturnLines -▸ **createReturnLines**(`returnId`, `cartId`): `Promise`<`LineItem`[]\> +**createReturnLines**(`returnId`, `cartId`): `Promise`<`LineItem`[]\> Creates return line items for a given cart based on the return items in a return. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `returnId` | `string` | the id to generate return items from. | | `cartId` | `string` | the cart to assign the return line items to. | @@ -327,106 +329,108 @@ return. `Promise`<`LineItem`[]\> -the created line items +-`Promise`: the created line items + -`LineItem[]`: + -`LineItem`: #### Defined in -[medusa/src/services/line-item.ts:131](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L131) +[medusa/src/services/line-item.ts:131](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L131) ___ ### createTaxLine -▸ **createTaxLine**(`args`): `LineItemTaxLine` +**createTaxLine**(`args`): `LineItemTaxLine` Create a line item tax line. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `args` | `DeepPartial`<`LineItemTaxLine`\> | tax line partial passed to the repo create method | #### Returns `LineItemTaxLine` -a new line item tax line +-`LineItemTaxLine`: a new line item tax line #### Defined in -[medusa/src/services/line-item.ts:533](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L533) +[medusa/src/services/line-item.ts:533](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L533) ___ ### delete -▸ **delete**(`id`): `Promise`<`undefined` \| ``null`` \| `LineItem`\> +**delete**(`id`): `Promise`<`undefined` \| ``null`` \| `LineItem`\> Deletes a line item. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `id` | `string` | the id of the line item to delete | #### Returns `Promise`<`undefined` \| ``null`` \| `LineItem`\> -the result of the delete operation +-`Promise`: the result of the delete operation + -`undefined \| ``null`` \| LineItem`: (optional) #### Defined in -[medusa/src/services/line-item.ts:494](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L494) +[medusa/src/services/line-item.ts:494](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L494) ___ ### deleteWithTaxLines -▸ **deleteWithTaxLines**(`id`): `Promise`<`undefined` \| ``null`` \| `LineItem`\> +**deleteWithTaxLines**(`id`): `Promise`<`undefined` \| ``null`` \| `LineItem`\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `id` | `string` | the id of the line item to delete | #### Returns `Promise`<`undefined` \| ``null`` \| `LineItem`\> -the result of the delete operation +-`Promise`: the result of the delete operation + -`undefined \| ``null`` \| LineItem`: (optional) -**`Deprecated`** +**Deprecated** no the cascade on the entity takes care of it Deletes a line item with the tax lines. #### Defined in -[medusa/src/services/line-item.ts:516](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L516) +[medusa/src/services/line-item.ts:516](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L516) ___ ### generate -▸ **generate**<`T`, `TResult`\>(`variantIdOrData`, `regionIdOrContext`, `quantity?`, `context?`): `Promise`<`TResult`\> +**generate**<`T`, `TResult`\>(`variantIdOrData`, `regionIdOrContext`, `quantity?`, `context?`): `Promise`<`TResult`\> Generate a single or multiple line item without persisting the data into the db -#### Type parameters - | Name | Type | | :------ | :------ | -| `T` | `string` \| `GenerateInputData` \| `GenerateInputData`[] | -| `TResult` | `T` extends `string` ? `LineItem` : `T` extends `LineItem` ? `LineItem` : `LineItem`[] | +| `T` | `object` | +| `TResult` | `object` | #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `variantIdOrData` | `T` | | `regionIdOrContext` | `T` extends `string` ? `string` : `GenerateLineItemContext` | | `quantity?` | `number` | @@ -436,23 +440,25 @@ Generate a single or multiple line item without persisting the data into the db `Promise`<`TResult`\> +-`Promise`: + #### Defined in -[medusa/src/services/line-item.ts:192](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L192) +[medusa/src/services/line-item.ts:192](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L192) ___ ### generateLineItem -▸ `Protected` **generateLineItem**(`variant`, `quantity`, `context`): `Promise`<`LineItem`\> +`Protected` **generateLineItem**(`variant`, `quantity`, `context`): `Promise`<`LineItem`\> #### Parameters -| Name | Type | -| :------ | :------ | -| `variant` | `Object` | +| Name | +| :------ | +| `variant` | `object` | | `variant.id` | `string` | -| `variant.product` | `Object` | +| `variant.product` | `object` | | `variant.product.discountable` | `boolean` | | `variant.product.is_giftcard` | `boolean` | | `variant.product.thumbnail` | ``null`` \| `string` | @@ -466,20 +472,23 @@ ___ `Promise`<`LineItem`\> +-`Promise`: + -`LineItem`: + #### Defined in -[medusa/src/services/line-item.ts:337](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L337) +[medusa/src/services/line-item.ts:337](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L337) ___ ### list -▸ **list**(`selector`, `config?`): `Promise`<`LineItem`[]\> +**list**(`selector`, `config?`): `Promise`<`LineItem`[]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `selector` | `Selector`<`LineItem`\> | | `config` | `FindConfig`<`LineItem`\> | @@ -487,71 +496,78 @@ ___ `Promise`<`LineItem`[]\> +-`Promise`: + -`LineItem[]`: + -`LineItem`: + #### Defined in -[medusa/src/services/line-item.ts:84](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L84) +[medusa/src/services/line-item.ts:84](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L84) ___ ### retrieve -▸ **retrieve**(`id`, `config?`): `Promise`<`LineItem`\> +**retrieve**(`id`, `config?`): `Promise`<`LineItem`\> Retrieves a line item by its id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `id` | `string` | the id of the line item to retrieve | -| `config` | `Object` | the config to be used at query building | +| `config` | `object` | the config to be used at query building | #### Returns `Promise`<`LineItem`\> -the line item +-`Promise`: the line item + -`LineItem`: #### Defined in -[medusa/src/services/line-item.ts:105](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L105) +[medusa/src/services/line-item.ts:105](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L105) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`idOrSelector`, `data`): `Promise`<`LineItem`[]\> +**update**(`idOrSelector`, `data`): `Promise`<`LineItem`[]\> Updates a line item #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `idOrSelector` | `string` \| `Selector`<`LineItem`\> | the id or selector of the line item(s) to update | | `data` | `Partial`<`LineItem`\> | the properties to update the line item(s) | @@ -559,29 +575,29 @@ Updates a line item `Promise`<`LineItem`[]\> -the updated line item(s) +-`Promise`: the updated line item(s) + -`LineItem[]`: + -`LineItem`: #### Defined in -[medusa/src/services/line-item.ts:451](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L451) +[medusa/src/services/line-item.ts:451](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L451) ___ ### validateGenerateArguments -▸ `Protected` **validateGenerateArguments**<`T`, `TResult`\>(`variantIdOrData`, `regionIdOrContext`, `quantity?`): `void` - -#### Type parameters +`Protected` **validateGenerateArguments**<`T`, `TResult`\>(`variantIdOrData`, `regionIdOrContext`, `quantity?`): `void` | Name | Type | | :------ | :------ | -| `T` | `string` \| `GenerateInputData` \| `GenerateInputData`[] | -| `TResult` | `T` extends `string` ? `LineItem` : `T` extends `LineItem` ? `LineItem` : `LineItem`[] | +| `T` | `object` | +| `TResult` | `object` | #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `variantIdOrData` | `string` \| `T` | | `regionIdOrContext` | `T` extends `string` ? `string` : `GenerateLineItemContext` | | `quantity?` | `number` | @@ -590,30 +606,34 @@ ___ `void` +-`void`: (optional) + #### Defined in -[medusa/src/services/line-item.ts:612](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/line-item.ts#L612) +[medusa/src/services/line-item.ts:612](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/line-item.ts#L612) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`LineItemService`](LineItemService.md) +**withTransaction**(`transactionManager?`): [`LineItemService`](LineItemService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`LineItemService`](LineItemService.md) +-`LineItemService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/MiddlewareService.md b/www/apps/docs/content/references/services/classes/MiddlewareService.md index 35cf581fcf058..614ffea41535f 100644 --- a/www/apps/docs/content/references/services/classes/MiddlewareService.md +++ b/www/apps/docs/content/references/services/classes/MiddlewareService.md @@ -1,4 +1,4 @@ -# Class: MiddlewareService +# MiddlewareService Orchestrates dynamic middleware registered through the Medusa Middleware API @@ -6,134 +6,136 @@ Orchestrates dynamic middleware registered through the Medusa Middleware API ### constructor -• **new MiddlewareService**() +**new MiddlewareService**() #### Defined in -[medusa/src/services/middleware.ts:22](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L22) +[medusa/src/services/middleware.ts:22](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L22) ## Properties ### postAuthentication\_ -• `Protected` `Readonly` **postAuthentication\_**: `middlewareType`[] + `Protected` `Readonly` **postAuthentication\_**: `middlewareType`[] #### Defined in -[medusa/src/services/middleware.ts:17](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L17) +[medusa/src/services/middleware.ts:17](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L17) ___ ### preAuthentication\_ -• `Protected` `Readonly` **preAuthentication\_**: `middlewareType`[] + `Protected` `Readonly` **preAuthentication\_**: `middlewareType`[] #### Defined in -[medusa/src/services/middleware.ts:18](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L18) +[medusa/src/services/middleware.ts:18](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L18) ___ ### preCartCreation\_ -• `Protected` `Readonly` **preCartCreation\_**: `RequestHandler`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, `Record`<`string`, `any`\>\>[] + `Protected` `Readonly` **preCartCreation\_**: `RequestHandler`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, Record<`string`, `any`\>\>[] #### Defined in -[medusa/src/services/middleware.ts:19](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L19) +[medusa/src/services/middleware.ts:19](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L19) ___ ### routers -• `Protected` `Readonly` **routers**: `Record`<`string`, `Router`[]\> + `Protected` `Readonly` **routers**: Record<`string`, `Router`[]\> #### Defined in -[medusa/src/services/middleware.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L20) +[medusa/src/services/middleware.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L20) ## Methods ### addPostAuthentication -▸ **addPostAuthentication**(`middleware`, `options`): `void` +**addPostAuthentication**(`middleware`, `options`): `void` Adds a middleware function to be called after authentication is completed. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `middleware` | `middlewareHandlerType` | the middleware function. Should return a middleware function. | -| `options` | `Record`<`string`, `unknown`\> | the arguments that will be passed to the middleware | +| `options` | Record<`string`, `unknown`\> | the arguments that will be passed to the middleware | #### Returns `void` -void +-`void`: (optional) void #### Defined in -[medusa/src/services/middleware.ts:60](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L60) +[medusa/src/services/middleware.ts:60](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L60) ___ ### addPreAuthentication -▸ **addPreAuthentication**(`middleware`, `options`): `void` +**addPreAuthentication**(`middleware`, `options`): `void` Adds a middleware function to be called before authentication is completed. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `middleware` | `middlewareHandlerType` | the middleware function. Should return a middleware function. | -| `options` | `Record`<`string`, `unknown`\> | the arguments that will be passed to the middleware | +| `options` | Record<`string`, `unknown`\> | the arguments that will be passed to the middleware | #### Returns `void` -void +-`void`: (optional) void #### Defined in -[medusa/src/services/middleware.ts:79](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L79) +[medusa/src/services/middleware.ts:79](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L79) ___ ### addPreCartCreation -▸ **addPreCartCreation**(`middleware`): `void` +**addPreCartCreation**(`middleware`): `void` Adds a middleware function to be called before cart creation #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `middleware` | `RequestHandler`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, `Record`<`string`, `any`\>\> | the middleware function. Should return a middleware function. | +| Name | Description | +| :------ | :------ | +| `middleware` | `RequestHandler`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, Record<`string`, `any`\>\> | the middleware function. Should return a middleware function. | #### Returns `void` +-`void`: (optional) + #### Defined in -[medusa/src/services/middleware.ts:96](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L96) +[medusa/src/services/middleware.ts:96](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L96) ___ ### addRouter -▸ **addRouter**(`path`, `router`): `void` +**addRouter**(`path`, `router`): `void` #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `path` | `string` | | `router` | `Router` | @@ -141,108 +143,123 @@ ___ `void` +-`void`: (optional) + #### Defined in -[medusa/src/services/middleware.ts:29](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L29) +[medusa/src/services/middleware.ts:29](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L29) ___ ### getRouters -▸ **getRouters**(`path`): `Router`[] +**getRouters**(`path`): `Router`[] #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `path` | `string` | #### Returns `Router`[] +-`Router[]`: + -`Router`: + #### Defined in -[medusa/src/services/middleware.ts:34](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L34) +[medusa/src/services/middleware.ts:34](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L34) ___ ### usePostAuthentication -▸ **usePostAuthentication**(`app`): `void` +**usePostAuthentication**(`app`): `void` Adds post authentication middleware to an express app. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `app` | `Router` | the express app to add the middleware to | #### Returns `void` +-`void`: (optional) + #### Defined in -[medusa/src/services/middleware.ts:106](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L106) +[medusa/src/services/middleware.ts:106](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L106) ___ ### usePreAuthentication -▸ **usePreAuthentication**(`app`): `void` +**usePreAuthentication**(`app`): `void` Adds pre authentication middleware to an express app. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `app` | `Router` | the express app to add the middleware to | #### Returns `void` +-`void`: (optional) + #### Defined in -[medusa/src/services/middleware.ts:117](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L117) +[medusa/src/services/middleware.ts:117](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L117) ___ ### usePreCartCreation -▸ **usePreCartCreation**(): `RequestHandler`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, `Record`<`string`, `any`\>\>[] +**usePreCartCreation**(): `RequestHandler`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, Record<`string`, `any`\>\>[] #### Returns -`RequestHandler`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, `Record`<`string`, `any`\>\>[] +`RequestHandler`<`ParamsDictionary`, `any`, `any`, `ParsedQs`, Record<`string`, `any`\>\>[] + +-`RequestHandler\>[]`: + -`RequestHandler`: + -`any`: (optional) + -`any`: (optional) + -`Record`: #### Defined in -[medusa/src/services/middleware.ts:123](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L123) +[medusa/src/services/middleware.ts:123](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L123) ___ ### validateMiddleware\_ -▸ **validateMiddleware_**(`fn`): `void` +**validateMiddleware_**(`fn`): `void` Validates a middleware function, throws if fn is not of type function. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `fn` | `unknown` | the middleware function to validate. | #### Returns `void` -nothing if the middleware is a function +-`void`: (optional) nothing if the middleware is a function #### Defined in -[medusa/src/services/middleware.ts:43](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/middleware.ts#L43) +[medusa/src/services/middleware.ts:43](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/middleware.ts#L43) diff --git a/www/apps/docs/content/references/services/classes/NewTotalsService.md b/www/apps/docs/content/references/services/classes/NewTotalsService.md index 57800893c4c5b..b887711cd11bd 100644 --- a/www/apps/docs/content/references/services/classes/NewTotalsService.md +++ b/www/apps/docs/content/references/services/classes/NewTotalsService.md @@ -1,4 +1,4 @@ -# Class: NewTotalsService +# NewTotalsService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new NewTotalsService**(`«destructured»`) +**new NewTotalsService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/new-totals.ts:67](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L67) +[medusa/src/services/new-totals.ts:67](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L67) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,23 +66,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### featureFlagRouter\_ -• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` + `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` #### Defined in -[medusa/src/services/new-totals.ts:64](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L64) +[medusa/src/services/new-totals.ts:64](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L64) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -90,33 +90,33 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### taxCalculationStrategy\_ -• `Protected` `Readonly` **taxCalculationStrategy\_**: `ITaxCalculationStrategy` + `Protected` `Readonly` **taxCalculationStrategy\_**: `ITaxCalculationStrategy` #### Defined in -[medusa/src/services/new-totals.ts:65](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L65) +[medusa/src/services/new-totals.ts:65](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L65) ___ ### taxProviderService\_ -• `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md) + `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md) #### Defined in -[medusa/src/services/new-totals.ts:63](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L63) +[medusa/src/services/new-totals.ts:63](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L63) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -124,47 +124,47 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -173,7 +173,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -181,22 +181,22 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### getGiftCardTotals -▸ **getGiftCardTotals**(`giftCardableAmount`, `«destructured»`): `Promise`<{ `tax_total`: `number` ; `total`: `number` }\> +**getGiftCardTotals**(`giftCardableAmount`, `«destructured»`): `Promise`<{ `tax_total`: `number` ; `total`: `number` }\> Calculate and return the gift cards totals #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `giftCardableAmount` | `number` | -| `«destructured»` | `Object` | +| `«destructured»` | `object` | | › `giftCardTransactions?` | `GiftCardTransaction`[] | | › `giftCards?` | `GiftCard`[] | | › `region` | `Region` | @@ -205,31 +205,36 @@ Calculate and return the gift cards totals `Promise`<{ `tax_total`: `number` ; `total`: `number` }\> +-`Promise`: + -``object``: (optional) + #### Defined in -[medusa/src/services/new-totals.ts:447](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L447) +[medusa/src/services/new-totals.ts:447](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L447) ___ ### getGiftCardTransactionsTotals -▸ **getGiftCardTransactionsTotals**(`«destructured»`): `Object` +**getGiftCardTransactionsTotals**(`«destructured»`): { `tax_total`: `number` ; `total`: `number` } Calculate and return the gift cards totals based on their transactions #### Parameters -| Name | Type | -| :------ | :------ | -| `«destructured»` | `Object` | +| Name | +| :------ | +| `«destructured»` | `object` | | › `giftCardTransactions` | `GiftCardTransaction`[] | -| › `region` | `Object` | +| › `region` | `object` | | › `region.gift_cards_taxable` | `boolean` | | › `region.tax_rate` | `number` | #### Returns -`Object` +`object` + +-``object``: (optional) | Name | Type | | :------ | :------ | @@ -238,27 +243,54 @@ Calculate and return the gift cards totals based on their transactions #### Defined in -[medusa/src/services/new-totals.ts:526](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L526) +[medusa/src/services/new-totals.ts:526](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L526) + +___ + +### getGiftCardableAmount + +**getGiftCardableAmount**(`«destructured»`): `number` + +#### Parameters + +| Name | +| :------ | +| `«destructured»` | `object` | +| › `discount_total` | `number` | +| › `gift_cards_taxable?` | `boolean` | +| › `shipping_total` | `number` | +| › `subtotal` | `number` | +| › `tax_total` | `number` | + +#### Returns + +`number` + +-`number`: (optional) + +#### Defined in + +[medusa/src/services/new-totals.ts:638](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L638) ___ ### getLineItemRefund -▸ **getLineItemRefund**(`lineItem`, `«destructured»`): `number` +**getLineItemRefund**(`lineItem`, `«destructured»`): `number` Return the amount that can be refund on a line item #### Parameters -| Name | Type | -| :------ | :------ | -| `lineItem` | `Object` | +| Name | +| :------ | +| `lineItem` | `object` | | `lineItem.id` | `string` | | `lineItem.includes_tax` | `boolean` | | `lineItem.quantity` | `number` | | `lineItem.tax_lines` | `LineItemTaxLine`[] | | `lineItem.unit_price` | `number` | -| `«destructured»` | `Object` | +| `«destructured»` | `object` | | › `calculationContext` | `TaxCalculationContext` | | › `taxRate?` | ``null`` \| `number` | @@ -266,26 +298,28 @@ Return the amount that can be refund on a line item `number` +-`number`: (optional) + #### Defined in -[medusa/src/services/new-totals.ts:333](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L333) +[medusa/src/services/new-totals.ts:333](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L333) ___ ### getLineItemRefundLegacy -▸ `Protected` **getLineItemRefundLegacy**(`lineItem`, `«destructured»`): `number` +`Protected` **getLineItemRefundLegacy**(`lineItem`, `«destructured»`): `number` #### Parameters -| Name | Type | -| :------ | :------ | -| `lineItem` | `Object` | +| Name | +| :------ | +| `lineItem` | `object` | | `lineItem.id` | `string` | | `lineItem.includes_tax` | `boolean` | | `lineItem.quantity` | `number` | | `lineItem.unit_price` | `number` | -| `«destructured»` | `Object` | +| `«destructured»` | `object` | | › `calculationContext` | `TaxCalculationContext` | | › `taxRate` | `number` | @@ -293,24 +327,26 @@ ___ `number` +-`number`: (optional) + #### Defined in -[medusa/src/services/new-totals.ts:403](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L403) +[medusa/src/services/new-totals.ts:403](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L403) ___ ### getLineItemTotals -▸ **getLineItemTotals**(`items`, `«destructured»`): `Promise`<{ `[lineItemId: string]`: `LineItemTotals`; }\> +**getLineItemTotals**(`items`, `«destructured»`): `Promise`<{ `[lineItemId: string]`: `LineItemTotals`; }\> Calculate and return the items totals for either the legacy calculation or the new calculation #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `items` | `LineItem` \| `LineItem`[] | -| `«destructured»` | `Object` | +| `«destructured»` | `object` | | › `calculationContext` | `TaxCalculationContext` | | › `includeTax?` | `boolean` | | › `taxRate?` | ``null`` \| `number` | @@ -319,26 +355,29 @@ Calculate and return the items totals for either the legacy calculation or the n `Promise`<{ `[lineItemId: string]`: `LineItemTotals`; }\> +-`Promise`: + -``object``: (optional) + #### Defined in -[medusa/src/services/new-totals.ts:87](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L87) +[medusa/src/services/new-totals.ts:87](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L87) ___ ### getLineItemTotalsLegacy -▸ `Protected` **getLineItemTotalsLegacy**(`item`, `«destructured»`): `Promise`<`LineItemTotals`\> +`Protected` **getLineItemTotalsLegacy**(`item`, `«destructured»`): `Promise`<`LineItemTotals`\> Calculate and return the legacy calculated totals using the tax rate #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `item` | `LineItem` | -| `«destructured»` | `Object` | +| `«destructured»` | `object` | | › `calculationContext` | `TaxCalculationContext` | -| › `lineItemAllocation` | `Object` | +| › `lineItemAllocation` | `object` | | › `lineItemAllocation.discount?` | `DiscountAllocation` | | › `lineItemAllocation.gift_card?` | `GiftCardAllocation` | | › `taxRate` | `number` | @@ -347,27 +386,29 @@ Calculate and return the legacy calculated totals using the tax rate `Promise`<`LineItemTotals`\> +-`Promise`: + #### Defined in -[medusa/src/services/new-totals.ts:254](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L254) +[medusa/src/services/new-totals.ts:254](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L254) ___ ### getLineItemTotals\_ -▸ `Protected` **getLineItemTotals_**(`item`, `«destructured»`): `Promise`<`LineItemTotals`\> +`Protected` **getLineItemTotals_**(`item`, `«destructured»`): `Promise`<`LineItemTotals`\> Calculate and return the totals for an item #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `item` | `LineItem` | -| `«destructured»` | `Object` | +| `«destructured»` | `object` | | › `calculationContext` | `TaxCalculationContext` | | › `includeTax?` | `boolean` | -| › `lineItemAllocation` | `Object` | +| › `lineItemAllocation` | `object` | | › `lineItemAllocation.discount?` | `DiscountAllocation` | | › `lineItemAllocation.gift_card?` | `GiftCardAllocation` | | › `taxLines?` | `LineItemTaxLine`[] | @@ -376,24 +417,26 @@ Calculate and return the totals for an item `Promise`<`LineItemTotals`\> +-`Promise`: + #### Defined in -[medusa/src/services/new-totals.ts:147](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L147) +[medusa/src/services/new-totals.ts:147](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L147) ___ ### getShippingMethodTotals -▸ **getShippingMethodTotals**(`shippingMethods`, `«destructured»`): `Promise`<{ `[shippingMethodId: string]`: `ShippingMethodTotals`; }\> +**getShippingMethodTotals**(`shippingMethods`, `«destructured»`): `Promise`<{ `[shippingMethodId: string]`: `ShippingMethodTotals`; }\> Calculate and return the shipping methods totals for either the legacy calculation or the new calculation #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `shippingMethods` | `ShippingMethod` \| `ShippingMethod`[] | -| `«destructured»` | `Object` | +| `«destructured»` | `object` | | › `calculationContext` | `TaxCalculationContext` | | › `discounts?` | `Discount`[] | | › `includeTax?` | `boolean` | @@ -403,24 +446,27 @@ Calculate and return the shipping methods totals for either the legacy calculati `Promise`<{ `[shippingMethodId: string]`: `ShippingMethodTotals`; }\> +-`Promise`: + -``object``: (optional) + #### Defined in -[medusa/src/services/new-totals.ts:572](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L572) +[medusa/src/services/new-totals.ts:572](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L572) ___ ### getShippingMethodTotalsLegacy -▸ `Protected` **getShippingMethodTotalsLegacy**(`shippingMethod`, `«destructured»`): `Promise`<`ShippingMethodTotals`\> +`Protected` **getShippingMethodTotalsLegacy**(`shippingMethod`, `«destructured»`): `Promise`<`ShippingMethodTotals`\> Calculate and return the shipping method totals legacy using the tax rate #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `shippingMethod` | `ShippingMethod` | -| `«destructured»` | `Object` | +| `«destructured»` | `object` | | › `calculationContext` | `TaxCalculationContext` | | › `discounts?` | `Discount`[] | | › `taxRate` | `number` | @@ -429,24 +475,26 @@ Calculate and return the shipping method totals legacy using the tax rate `Promise`<`ShippingMethodTotals`\> +-`Promise`: + #### Defined in -[medusa/src/services/new-totals.ts:729](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L729) +[medusa/src/services/new-totals.ts:749](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L749) ___ ### getShippingMethodTotals\_ -▸ `Protected` **getShippingMethodTotals_**(`shippingMethod`, `«destructured»`): `Promise`<`ShippingMethodTotals`\> +`Protected` **getShippingMethodTotals_**(`shippingMethod`, `«destructured»`): `Promise`<`ShippingMethodTotals`\> Calculate and return the shipping method totals #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `shippingMethod` | `ShippingMethod` | -| `«destructured»` | `Object` | +| `«destructured»` | `object` | | › `calculationContext` | `TaxCalculationContext` | | › `discounts?` | `Discount`[] | | › `includeTax?` | `boolean` | @@ -456,54 +504,60 @@ Calculate and return the shipping method totals `Promise`<`ShippingMethodTotals`\> +-`Promise`: + #### Defined in -[medusa/src/services/new-totals.ts:646](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/new-totals.ts#L646) +[medusa/src/services/new-totals.ts:666](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/new-totals.ts#L666) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`NewTotalsService`](NewTotalsService.md) +**withTransaction**(`transactionManager?`): [`NewTotalsService`](NewTotalsService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`NewTotalsService`](NewTotalsService.md) +-`default`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/NoteService.md b/www/apps/docs/content/references/services/classes/NoteService.md index 1b9af47d78c97..7b9720d6028d7 100644 --- a/www/apps/docs/content/references/services/classes/NoteService.md +++ b/www/apps/docs/content/references/services/classes/NoteService.md @@ -1,4 +1,4 @@ -# Class: NoteService +# NoteService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new NoteService**(`«destructured»`) +**new NoteService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/note.ts:28](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/note.ts#L28) +[medusa/src/services/note.ts:28](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/note.ts#L28) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,23 +66,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### eventBus\_ -• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/note.ts:26](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/note.ts#L26) +[medusa/src/services/note.ts:26](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/note.ts#L26) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -90,23 +90,23 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### noteRepository\_ -• `Protected` `Readonly` **noteRepository\_**: `Repository`<`Note`\> + `Protected` `Readonly` **noteRepository\_**: `Repository`<`Note`\> #### Defined in -[medusa/src/services/note.ts:25](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/note.ts#L25) +[medusa/src/services/note.ts:25](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/note.ts#L25) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -114,13 +114,13 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### Events -▪ `Static` `Readonly` **Events**: `Object` + `Static` `Readonly` **Events**: `Object` #### Type declaration @@ -132,47 +132,47 @@ ___ #### Defined in -[medusa/src/services/note.ts:19](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/note.ts#L19) +[medusa/src/services/note.ts:19](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/note.ts#L19) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -181,7 +181,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -189,68 +189,71 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**(`data`, `config?`): `Promise`<`Note`\> +**create**(`data`, `config?`): `Promise`<`Note`\> Creates a note associated with a given author #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `data` | `CreateNoteInput` | the note to create | -| `config` | `Object` | any configurations if needed, including meta data | -| `config.metadata` | `Record`<`string`, `unknown`\> | - | +| `config` | `object` | any configurations if needed, including meta data | +| `config.metadata` | Record<`string`, `unknown`\> | #### Returns `Promise`<`Note`\> -resolves to the creation result +-`Promise`: resolves to the creation result + -`Note`: #### Defined in -[medusa/src/services/note.ts:119](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/note.ts#L119) +[medusa/src/services/note.ts:119](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/note.ts#L119) ___ ### delete -▸ **delete**(`noteId`): `Promise`<`void`\> +**delete**(`noteId`): `Promise`<`void`\> Deletes a given note #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `noteId` | `string` | id of the note to delete | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/note.ts:177](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/note.ts#L177) +[medusa/src/services/note.ts:177](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/note.ts#L177) ___ ### list -▸ **list**(`selector`, `config?`): `Promise`<`Note`[]\> +**list**(`selector`, `config?`): `Promise`<`Note`[]\> Fetches all notes related to the given selector #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`Note`\> | the query object for find | | `config` | `FindConfig`<`Note`\> | the configuration used to find the objects. contains relations, skip, and take. | @@ -258,24 +261,26 @@ Fetches all notes related to the given selector `Promise`<`Note`[]\> -notes related to the given search. +-`Promise`: notes related to the given search. + -`Note[]`: + -`Note`: #### Defined in -[medusa/src/services/note.ts:77](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/note.ts#L77) +[medusa/src/services/note.ts:77](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/note.ts#L77) ___ ### listAndCount -▸ **listAndCount**(`selector`, `config?`): `Promise`<[`Note`[], `number`]\> +**listAndCount**(`selector`, `config?`): `Promise`<[`Note`[], `number`]\> Fetches all notes related to the given selector #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`Note`\> | the query object for find | | `config` | `FindConfig`<`Note`\> | the configuration used to find the objects. contains relations, skip, and take. | @@ -283,24 +288,26 @@ Fetches all notes related to the given selector `Promise`<[`Note`[], `number`]\> -notes related to the given search. +-`Promise`: notes related to the given search. + -`Note[]`: + -`number`: (optional) #### Defined in -[medusa/src/services/note.ts:98](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/note.ts#L98) +[medusa/src/services/note.ts:98](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/note.ts#L98) ___ ### retrieve -▸ **retrieve**(`noteId`, `config?`): `Promise`<`Note`\> +**retrieve**(`noteId`, `config?`): `Promise`<`Note`\> Retrieves a specific note. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `noteId` | `string` | the id of the note to retrieve. | | `config` | `FindConfig`<`Note`\> | any options needed to query for the result. | @@ -308,48 +315,51 @@ Retrieves a specific note. `Promise`<`Note`\> -which resolves to the requested note. +-`Promise`: which resolves to the requested note. + -`Note`: #### Defined in -[medusa/src/services/note.ts:42](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/note.ts#L42) +[medusa/src/services/note.ts:42](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/note.ts#L42) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`noteId`, `value`): `Promise`<`Note`\> +**update**(`noteId`, `value`): `Promise`<`Note`\> Updates a given note with a new value #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `noteId` | `string` | the id of the note to update | | `value` | `string` | the new value | @@ -357,32 +367,35 @@ Updates a given note with a new value `Promise`<`Note`\> -resolves to the updated element +-`Promise`: resolves to the updated element + -`Note`: #### Defined in -[medusa/src/services/note.ts:155](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/note.ts#L155) +[medusa/src/services/note.ts:155](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/note.ts#L155) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`NoteService`](NoteService.md) +**withTransaction**(`transactionManager?`): [`NoteService`](NoteService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`NoteService`](NoteService.md) +-`NoteService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/NotificationService.md b/www/apps/docs/content/references/services/classes/NotificationService.md index 83fbffe6cde03..d845ca5ddfc0e 100644 --- a/www/apps/docs/content/references/services/classes/NotificationService.md +++ b/www/apps/docs/content/references/services/classes/NotificationService.md @@ -1,4 +1,4 @@ -# Class: NotificationService +# NotificationService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new NotificationService**(`container`) +**new NotificationService**(`container`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `container` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/notification.ts:34](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L34) +[medusa/src/services/notification.ts:34](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L34) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,43 +66,43 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### attachmentGenerator\_ -• `Protected` **attachmentGenerator\_**: `unknown` = `null` + `Protected` **attachmentGenerator\_**: `unknown` = `null` #### Defined in -[medusa/src/services/notification.ts:25](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L25) +[medusa/src/services/notification.ts:25](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L25) ___ ### container\_ -• `Protected` `Readonly` **container\_**: `InjectedDependencies` & {} + `Protected` `Readonly` **container\_**: `InjectedDependencies` & {} #### Defined in -[medusa/src/services/notification.ts:26](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L26) +[medusa/src/services/notification.ts:26](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L26) ___ ### logger\_ -• `Protected` `Readonly` **logger\_**: `Logger` + `Protected` `Readonly` **logger\_**: `Logger` #### Defined in -[medusa/src/services/notification.ts:29](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L29) +[medusa/src/services/notification.ts:29](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L29) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -110,43 +110,43 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### notificationProviderRepository\_ -• `Protected` `Readonly` **notificationProviderRepository\_**: `Repository`<`NotificationProvider`\> + `Protected` `Readonly` **notificationProviderRepository\_**: `Repository`<`NotificationProvider`\> #### Defined in -[medusa/src/services/notification.ts:32](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L32) +[medusa/src/services/notification.ts:32](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L32) ___ ### notificationRepository\_ -• `Protected` `Readonly` **notificationRepository\_**: `Repository`<`Notification`\> + `Protected` `Readonly` **notificationRepository\_**: `Repository`<`Notification`\> #### Defined in -[medusa/src/services/notification.ts:30](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L30) +[medusa/src/services/notification.ts:30](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L30) ___ ### subscribers\_ -• `Protected` **subscribers\_**: `Object` = `{}` + `Protected` **subscribers\_**: `object` = `{}` #### Defined in -[medusa/src/services/notification.ts:24](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L24) +[medusa/src/services/notification.ts:24](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L24) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -154,47 +154,47 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -203,7 +203,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -211,13 +211,13 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### handleEvent -▸ **handleEvent**(`eventName`, `data`): `Promise`<`undefined` \| `void` \| `Notification`[]\> +**handleEvent**(`eventName`, `data`): `Promise`<`undefined` \| `void` \| `Notification`[]\> Handles an event by relaying the event data to the subscribing providers. The result of the notification send will be persisted in the database in @@ -225,33 +225,34 @@ order to allow for resends. Will log any errors that are encountered. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `eventName` | `string` | the event to handle | -| `data` | `Record`<`string`, `unknown`\> | the data the event was sent with | +| `data` | Record<`string`, `unknown`\> | the data the event was sent with | #### Returns `Promise`<`undefined` \| `void` \| `Notification`[]\> -the result of notification subscribed +-`Promise`: the result of notification subscribed + -`undefined \| void \| Notification[]`: (optional) #### Defined in -[medusa/src/services/notification.ts:185](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L185) +[medusa/src/services/notification.ts:185](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L185) ___ ### list -▸ **list**(`selector`, `config?`): `Promise`<`Notification`[]\> +**list**(`selector`, `config?`): `Promise`<`Notification`[]\> Retrieves a list of notifications. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`Notification`\> | the params to select the notifications by. | | `config` | `FindConfig`<`Notification`\> | the configuration to apply to the query | @@ -259,24 +260,26 @@ Retrieves a list of notifications. `Promise`<`Notification`[]\> -the notifications that satisfy the query. +-`Promise`: the notifications that satisfy the query. + -`Notification[]`: + -`Notification`: #### Defined in -[medusa/src/services/notification.ts:78](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L78) +[medusa/src/services/notification.ts:78](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L78) ___ ### listAndCount -▸ **listAndCount**(`selector`, `config?`): `Promise`<[`Notification`[], `number`]\> +**listAndCount**(`selector`, `config?`): `Promise`<[`Notification`[], `number`]\> Retrieves a list of notifications and total count. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`Notification`\> | the params to select the notifications by. | | `config` | `FindConfig`<`Notification`\> | the configuration to apply to the query | @@ -284,70 +287,76 @@ Retrieves a list of notifications and total count. `Promise`<[`Notification`[], `number`]\> -the notifications that satisfy the query as well as the count. +-`Promise`: the notifications that satisfy the query as well as the count. + -`Notification[]`: + -`number`: (optional) #### Defined in -[medusa/src/services/notification.ts:97](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L97) +[medusa/src/services/notification.ts:97](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L97) ___ ### registerAttachmentGenerator -▸ **registerAttachmentGenerator**(`service`): `void` +**registerAttachmentGenerator**(`service`): `void` Registers an attachment generator to the service. The generator can be used to generate on demand invoices or other documents. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `service` | `unknown` | the service to assign to the attachmentGenerator | #### Returns `void` +-`void`: (optional) + #### Defined in -[medusa/src/services/notification.ts:52](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L52) +[medusa/src/services/notification.ts:52](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L52) ___ ### registerInstalledProviders -▸ **registerInstalledProviders**(`providerIds`): `Promise`<`void`\> +**registerInstalledProviders**(`providerIds`): `Promise`<`void`\> Takes a list of notification provider ids and persists them in the database. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `providerIds` | `string`[] | a list of provider ids | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/notification.ts:60](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L60) +[medusa/src/services/notification.ts:60](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L60) ___ ### resend -▸ **resend**(`id`, `config?`): `Promise`<`Notification`\> +**resend**(`id`, `config?`): `Promise`<`Notification`\> Resends a notification by retrieving a prior notification and calling the underlying provider's resendNotification method. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `id` | `string` | the id of the notification | | `config` | `FindConfig`<`Notification`\> | any configuration that might override the previous send | @@ -355,24 +364,25 @@ underlying provider's resendNotification method. `Promise`<`Notification`\> -the newly created notification +-`Promise`: the newly created notification + -`Notification`: #### Defined in -[medusa/src/services/notification.ts:265](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L265) +[medusa/src/services/notification.ts:265](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L265) ___ ### retrieve -▸ **retrieve**(`id`, `config?`): `Promise`<`Notification`\> +**retrieve**(`id`, `config?`): `Promise`<`Notification`\> Retrieves a notification with a given id #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `id` | `string` | the id of the notification | | `config` | `FindConfig`<`Notification`\> | the configuration to apply to the query | @@ -380,100 +390,104 @@ Retrieves a notification with a given id `Promise`<`Notification`\> -the notification +-`Promise`: the notification + -`Notification`: #### Defined in -[medusa/src/services/notification.ts:118](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L118) +[medusa/src/services/notification.ts:118](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L118) ___ ### retrieveProvider\_ -▸ `Protected` **retrieveProvider_**(`id`): `AbstractNotificationService` +`Protected` **retrieveProvider_**(`id`): `AbstractNotificationService` Finds a provider with a given id. Will throw a NOT_FOUND error if the resolution fails. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `id` | `string` | the id of the provider | #### Returns `AbstractNotificationService` -the notification provider +-`AbstractNotificationService`: the notification provider #### Defined in -[medusa/src/services/notification.ts:166](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L166) +[medusa/src/services/notification.ts:166](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L166) ___ ### send -▸ **send**(`event`, `eventData`, `providerId`): `Promise`<`undefined` \| `Notification`\> +**send**(`event`, `eventData`, `providerId`): `Promise`<`undefined` \| `Notification`\> Sends a notification, by calling the given provider's sendNotification method. Persists the Notification in the database. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `event` | `string` | the name of the event | -| `eventData` | `Record`<`string`, `unknown`\> | the data the event was sent with | +| `eventData` | Record<`string`, `unknown`\> | the data the event was sent with | | `providerId` | `string` | the provider that should handle the event. | #### Returns `Promise`<`undefined` \| `Notification`\> -the created notification +-`Promise`: the created notification + -`undefined \| Notification`: (optional) #### Defined in -[medusa/src/services/notification.ts:217](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L217) +[medusa/src/services/notification.ts:217](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L217) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### subscribe -▸ **subscribe**(`eventName`, `providerId`): `void` +**subscribe**(`eventName`, `providerId`): `void` Subscribes a given provider to an event. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `eventName` | `string` | the event to subscribe to | | `providerId` | `string` | the provider that the event will be sent to | @@ -481,30 +495,34 @@ Subscribes a given provider to an event. `void` +-`void`: (optional) + #### Defined in -[medusa/src/services/notification.ts:145](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/notification.ts#L145) +[medusa/src/services/notification.ts:145](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/notification.ts#L145) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`NotificationService`](NotificationService.md) +**withTransaction**(`transactionManager?`): [`NotificationService`](NotificationService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`NotificationService`](NotificationService.md) +-`NotificationService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/OauthService.md b/www/apps/docs/content/references/services/classes/OauthService.md index f3a42cbe7f158..fece9ad5af9d1 100644 --- a/www/apps/docs/content/references/services/classes/OauthService.md +++ b/www/apps/docs/content/references/services/classes/OauthService.md @@ -1,4 +1,4 @@ -# Class: OauthService +# OauthService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new OauthService**(`cradle`) +**new OauthService**(`cradle`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `cradle` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/oauth.ts:28](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L28) +[medusa/src/services/oauth.ts:28](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L28) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,33 +66,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### container\_ -• `Protected` **container\_**: `InjectedDependencies` + `Protected` **container\_**: `InjectedDependencies` #### Defined in -[medusa/src/services/oauth.ts:24](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L24) +[medusa/src/services/oauth.ts:24](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L24) ___ ### eventBus\_ -• `Protected` **eventBus\_**: [`EventBusService`](EventBusService.md) + `Protected` **eventBus\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/oauth.ts:26](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L26) +[medusa/src/services/oauth.ts:26](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L26) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -100,23 +100,23 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### oauthRepository\_ -• `Protected` **oauthRepository\_**: `Repository`<`Oauth`\> + `Protected` **oauthRepository\_**: `Repository`<`Oauth`\> #### Defined in -[medusa/src/services/oauth.ts:25](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L25) +[medusa/src/services/oauth.ts:25](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L25) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -124,13 +124,13 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### Events -▪ `Static` **Events**: `Object` + `Static` **Events**: `Object` #### Type declaration @@ -141,47 +141,47 @@ ___ #### Defined in -[medusa/src/services/oauth.ts:19](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L19) +[medusa/src/services/oauth.ts:19](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L19) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -190,7 +190,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -198,38 +198,41 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**(`data`): `Promise`<`Oauth`\> +**create**(`data`): `Promise`<`Oauth`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `data` | `CreateOauthInput` | #### Returns `Promise`<`Oauth`\> +-`Promise`: + -`Oauth`: + #### Defined in -[medusa/src/services/oauth.ts:87](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L87) +[medusa/src/services/oauth.ts:87](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L87) ___ ### generateToken -▸ **generateToken**(`appName`, `code`, `state`): `Promise`<`Oauth`\> +**generateToken**(`appName`, `code`, `state`): `Promise`<`Oauth`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `appName` | `string` | | `code` | `string` | | `state` | `string` | @@ -238,144 +241,165 @@ ___ `Promise`<`Oauth`\> +-`Promise`: + -`Oauth`: + #### Defined in -[medusa/src/services/oauth.ts:121](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L121) +[medusa/src/services/oauth.ts:121](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L121) ___ ### list -▸ **list**(`selector`): `Promise`<`Oauth`[]\> +**list**(`selector`): `Promise`<`Oauth`[]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `selector` | `Selector`<`Oauth`\> | #### Returns `Promise`<`Oauth`[]\> +-`Promise`: + -`Oauth[]`: + -`Oauth`: + #### Defined in -[medusa/src/services/oauth.ts:79](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L79) +[medusa/src/services/oauth.ts:79](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L79) ___ ### refreshToken -▸ **refreshToken**(`appName`): `Promise`<`Oauth`\> +**refreshToken**(`appName`): `Promise`<`Oauth`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `appName` | `string` | #### Returns `Promise`<`Oauth`\> +-`Promise`: + -`Oauth`: + #### Defined in -[medusa/src/services/oauth.ts:155](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L155) +[medusa/src/services/oauth.ts:155](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L155) ___ ### registerOauthApp -▸ **registerOauthApp**(`appDetails`): `Promise`<`Oauth`\> +**registerOauthApp**(`appDetails`): `Promise`<`Oauth`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `appDetails` | `CreateOauthInput` | #### Returns `Promise`<`Oauth`\> +-`Promise`: + -`Oauth`: + #### Defined in -[medusa/src/services/oauth.ts:111](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L111) +[medusa/src/services/oauth.ts:111](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L111) ___ ### retrieve -▸ **retrieve**(`oauthId`): `Promise`<`Oauth`\> +**retrieve**(`oauthId`): `Promise`<`Oauth`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `oauthId` | `string` | #### Returns `Promise`<`Oauth`\> +-`Promise`: + -`Oauth`: + #### Defined in -[medusa/src/services/oauth.ts:54](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L54) +[medusa/src/services/oauth.ts:54](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L54) ___ ### retrieveByName -▸ **retrieveByName**(`appName`): `Promise`<`Oauth`\> +**retrieveByName**(`appName`): `Promise`<`Oauth`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `appName` | `string` | #### Returns `Promise`<`Oauth`\> +-`Promise`: + -`Oauth`: + #### Defined in -[medusa/src/services/oauth.ts:36](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L36) +[medusa/src/services/oauth.ts:36](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L36) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`id`, `update`): `Promise`<`Oauth`\> +**update**(`id`, `update`): `Promise`<`Oauth`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `id` | `string` | | `update` | `UpdateOauthInput` | @@ -383,30 +407,35 @@ ___ `Promise`<`Oauth`\> +-`Promise`: + -`Oauth`: + #### Defined in -[medusa/src/services/oauth.ts:100](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/oauth.ts#L100) +[medusa/src/services/oauth.ts:100](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/oauth.ts#L100) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`OauthService`](OauthService.md) +**withTransaction**(`transactionManager?`): [`OauthService`](OauthService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`OauthService`](OauthService.md) +-`Oauth`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/OrderEditItemChangeService.md b/www/apps/docs/content/references/services/classes/OrderEditItemChangeService.md index 99645f4ae72fe..3f1b01341d86b 100644 --- a/www/apps/docs/content/references/services/classes/OrderEditItemChangeService.md +++ b/www/apps/docs/content/references/services/classes/OrderEditItemChangeService.md @@ -1,4 +1,4 @@ -# Class: OrderEditItemChangeService +# OrderEditItemChangeService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new OrderEditItemChangeService**(`«destructured»`) +**new OrderEditItemChangeService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/order-edit-item-change.ts:33](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit-item-change.ts#L33) +[medusa/src/services/order-edit-item-change.ts:33](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit-item-change.ts#L33) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,33 +66,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### eventBus\_ -• `Protected` `Readonly` **eventBus\_**: `IEventBusService` + `Protected` `Readonly` **eventBus\_**: `IEventBusService` #### Defined in -[medusa/src/services/order-edit-item-change.ts:29](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit-item-change.ts#L29) +[medusa/src/services/order-edit-item-change.ts:29](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit-item-change.ts#L29) ___ ### lineItemService\_ -• `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md) + `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md) #### Defined in -[medusa/src/services/order-edit-item-change.ts:30](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit-item-change.ts#L30) +[medusa/src/services/order-edit-item-change.ts:30](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit-item-change.ts#L30) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -100,33 +100,33 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### orderItemChangeRepository\_ -• `Protected` `Readonly` **orderItemChangeRepository\_**: `Repository`<`OrderItemChange`\> + `Protected` `Readonly` **orderItemChangeRepository\_**: `Repository`<`OrderItemChange`\> #### Defined in -[medusa/src/services/order-edit-item-change.ts:28](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit-item-change.ts#L28) +[medusa/src/services/order-edit-item-change.ts:28](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit-item-change.ts#L28) ___ ### taxProviderService\_ -• `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md) + `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md) #### Defined in -[medusa/src/services/order-edit-item-change.ts:31](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit-item-change.ts#L31) +[medusa/src/services/order-edit-item-change.ts:31](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit-item-change.ts#L31) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -134,13 +134,13 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### Events -▪ `Static` `Readonly` **Events**: `Object` + `Static` `Readonly` **Events**: `Object` #### Type declaration @@ -151,47 +151,47 @@ ___ #### Defined in -[medusa/src/services/order-edit-item-change.ts:22](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit-item-change.ts#L22) +[medusa/src/services/order-edit-item-change.ts:22](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit-item-change.ts#L22) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -200,7 +200,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -208,58 +208,63 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**(`data`): `Promise`<`OrderItemChange`\> +**create**(`data`): `Promise`<`OrderItemChange`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `data` | `CreateOrderEditItemChangeInput` | #### Returns `Promise`<`OrderItemChange`\> +-`Promise`: + -`OrderItemChange`: + #### Defined in -[medusa/src/services/order-edit-item-change.ts:81](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit-item-change.ts#L81) +[medusa/src/services/order-edit-item-change.ts:81](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit-item-change.ts#L81) ___ ### delete -▸ **delete**(`itemChangeIds`): `Promise`<`void`\> +**delete**(`itemChangeIds`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `itemChangeIds` | `string` \| `string`[] | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/order-edit-item-change.ts:97](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit-item-change.ts#L97) +[medusa/src/services/order-edit-item-change.ts:97](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit-item-change.ts#L97) ___ ### list -▸ **list**(`selector`, `config?`): `Promise`<`OrderItemChange`[]\> +**list**(`selector`, `config?`): `Promise`<`OrderItemChange`[]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `selector` | `Selector`<`OrderItemChange`\> | | `config` | `FindConfig`<`OrderItemChange`\> | @@ -267,20 +272,24 @@ ___ `Promise`<`OrderItemChange`[]\> +-`Promise`: + -`OrderItemChange[]`: + -`OrderItemChange`: + #### Defined in -[medusa/src/services/order-edit-item-change.ts:69](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit-item-change.ts#L69) +[medusa/src/services/order-edit-item-change.ts:69](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit-item-change.ts#L69) ___ ### retrieve -▸ **retrieve**(`id`, `config?`): `Promise`<`OrderItemChange`\> +**retrieve**(`id`, `config?`): `Promise`<`OrderItemChange`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `id` | `string` | | `config` | `FindConfig`<`OrderItemChange`\> | @@ -288,54 +297,61 @@ ___ `Promise`<`OrderItemChange`\> +-`Promise`: + -`OrderItemChange`: + #### Defined in -[medusa/src/services/order-edit-item-change.ts:48](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit-item-change.ts#L48) +[medusa/src/services/order-edit-item-change.ts:48](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit-item-change.ts#L48) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`OrderEditItemChangeService`](OrderEditItemChangeService.md) +**withTransaction**(`transactionManager?`): [`OrderEditItemChangeService`](OrderEditItemChangeService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`OrderEditItemChangeService`](OrderEditItemChangeService.md) +-`default`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/OrderEditService.md b/www/apps/docs/content/references/services/classes/OrderEditService.md index 228072633bdd0..39417e133bfa1 100644 --- a/www/apps/docs/content/references/services/classes/OrderEditService.md +++ b/www/apps/docs/content/references/services/classes/OrderEditService.md @@ -1,4 +1,4 @@ -# Class: OrderEditService +# OrderEditService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new OrderEditService**(`«destructured»`) +**new OrderEditService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/order-edit.ts:75](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L75) +[medusa/src/services/order-edit.ts:75](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L75) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,53 +66,53 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### eventBusService\_ -• `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/order-edit.ts:69](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L69) +[medusa/src/services/order-edit.ts:69](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L69) ___ ### inventoryService\_ -• `Protected` `Readonly` **inventoryService\_**: `undefined` \| `IInventoryService` + `Protected` `Readonly` **inventoryService\_**: `undefined` \| `IInventoryService` #### Defined in -[medusa/src/services/order-edit.ts:73](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L73) +[medusa/src/services/order-edit.ts:73](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L73) ___ ### lineItemAdjustmentService\_ -• `Protected` `Readonly` **lineItemAdjustmentService\_**: [`LineItemAdjustmentService`](LineItemAdjustmentService.md) + `Protected` `Readonly` **lineItemAdjustmentService\_**: [`LineItemAdjustmentService`](LineItemAdjustmentService.md) #### Defined in -[medusa/src/services/order-edit.ts:71](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L71) +[medusa/src/services/order-edit.ts:71](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L71) ___ ### lineItemService\_ -• `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md) + `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md) #### Defined in -[medusa/src/services/order-edit.ts:68](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L68) +[medusa/src/services/order-edit.ts:68](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L68) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -120,73 +120,73 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### newTotalsService\_ -• `Protected` `Readonly` **newTotalsService\_**: [`NewTotalsService`](NewTotalsService.md) + `Protected` `Readonly` **newTotalsService\_**: [`NewTotalsService`](NewTotalsService.md) #### Defined in -[medusa/src/services/order-edit.ts:67](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L67) +[medusa/src/services/order-edit.ts:67](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L67) ___ ### orderEditItemChangeService\_ -• `Protected` `Readonly` **orderEditItemChangeService\_**: [`OrderEditItemChangeService`](OrderEditItemChangeService.md) + `Protected` `Readonly` **orderEditItemChangeService\_**: [`OrderEditItemChangeService`](OrderEditItemChangeService.md) #### Defined in -[medusa/src/services/order-edit.ts:72](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L72) +[medusa/src/services/order-edit.ts:72](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L72) ___ ### orderEditRepository\_ -• `Protected` `Readonly` **orderEditRepository\_**: `Repository`<`OrderEdit`\> + `Protected` `Readonly` **orderEditRepository\_**: `Repository`<`OrderEdit`\> #### Defined in -[medusa/src/services/order-edit.ts:63](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L63) +[medusa/src/services/order-edit.ts:63](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L63) ___ ### orderService\_ -• `Protected` `Readonly` **orderService\_**: [`OrderService`](OrderService.md) + `Protected` `Readonly` **orderService\_**: [`OrderService`](OrderService.md) #### Defined in -[medusa/src/services/order-edit.ts:65](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L65) +[medusa/src/services/order-edit.ts:65](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L65) ___ ### taxProviderService\_ -• `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md) + `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md) #### Defined in -[medusa/src/services/order-edit.ts:70](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L70) +[medusa/src/services/order-edit.ts:70](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L70) ___ ### totalsService\_ -• `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md) + `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md) #### Defined in -[medusa/src/services/order-edit.ts:66](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L66) +[medusa/src/services/order-edit.ts:66](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L66) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -194,13 +194,13 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### Events -▪ `Static` `Readonly` **Events**: `Object` + `Static` `Readonly` **Events**: `Object` #### Type declaration @@ -215,36 +215,38 @@ ___ #### Defined in -[medusa/src/services/order-edit.ts:54](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L54) +[medusa/src/services/order-edit.ts:54](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L54) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### addLineItem -▸ **addLineItem**(`orderEditId`, `data`): `Promise`<`void`\> +**addLineItem**(`orderEditId`, `data`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `orderEditId` | `string` | | `data` | `AddOrderEditLineItemInput` | @@ -252,31 +254,31 @@ TransactionBaseService.activeManager\_ `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/order-edit.ts:541](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L541) +[medusa/src/services/order-edit.ts:541](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L541) ___ ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -285,7 +287,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -293,86 +295,95 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### cancel -▸ **cancel**(`orderEditId`, `context?`): `Promise`<`OrderEdit`\> +**cancel**(`orderEditId`, `context?`): `Promise`<`OrderEdit`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `orderEditId` | `string` | -| `context` | `Object` | +| `context` | `object` | | `context.canceledBy?` | `string` | #### Returns `Promise`<`OrderEdit`\> +-`Promise`: + -`OrderEdit`: + #### Defined in -[medusa/src/services/order-edit.ts:687](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L687) +[medusa/src/services/order-edit.ts:687](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L687) ___ ### confirm -▸ **confirm**(`orderEditId`, `context?`): `Promise`<`OrderEdit`\> +**confirm**(`orderEditId`, `context?`): `Promise`<`OrderEdit`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `orderEditId` | `string` | -| `context` | `Object` | +| `context` | `object` | | `context.confirmedBy?` | `string` | #### Returns `Promise`<`OrderEdit`\> +-`Promise`: + -`OrderEdit`: + #### Defined in -[medusa/src/services/order-edit.ts:726](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L726) +[medusa/src/services/order-edit.ts:726](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L726) ___ ### create -▸ **create**(`data`, `context`): `Promise`<`OrderEdit`\> +**create**(`data`, `context`): `Promise`<`OrderEdit`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `data` | `CreateOrderEditInput` | -| `context` | `Object` | +| `context` | `object` | | `context.createdBy` | `string` | #### Returns `Promise`<`OrderEdit`\> +-`Promise`: + -`OrderEdit`: + #### Defined in -[medusa/src/services/order-edit.ts:162](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L162) +[medusa/src/services/order-edit.ts:162](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L162) ___ ### decline -▸ **decline**(`orderEditId`, `context`): `Promise`<`OrderEdit`\> +**decline**(`orderEditId`, `context`): `Promise`<`OrderEdit`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `orderEditId` | `string` | -| `context` | `Object` | +| `context` | `object` | | `context.declinedBy?` | `string` | | `context.declinedReason?` | `string` | @@ -380,80 +391,90 @@ ___ `Promise`<`OrderEdit`\> +-`Promise`: + -`OrderEdit`: + #### Defined in -[medusa/src/services/order-edit.ts:260](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L260) +[medusa/src/services/order-edit.ts:260](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L260) ___ ### decorateTotals -▸ **decorateTotals**(`orderEdit`): `Promise`<`OrderEdit`\> +**decorateTotals**(`orderEdit`): `Promise`<`OrderEdit`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `orderEdit` | `OrderEdit` | #### Returns `Promise`<`OrderEdit`\> +-`Promise`: + -`OrderEdit`: + #### Defined in -[medusa/src/services/order-edit.ts:490](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L490) +[medusa/src/services/order-edit.ts:490](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L490) ___ ### delete -▸ **delete**(`id`): `Promise`<`void`\> +**delete**(`id`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `id` | `string` | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/order-edit.ts:238](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L238) +[medusa/src/services/order-edit.ts:238](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L238) ___ ### deleteClonedItems -▸ `Protected` **deleteClonedItems**(`orderEditId`): `Promise`<`void`\> +`Protected` **deleteClonedItems**(`orderEditId`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `orderEditId` | `string` | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/order-edit.ts:808](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L808) +[medusa/src/services/order-edit.ts:808](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L808) ___ ### deleteItemChange -▸ **deleteItemChange**(`orderEditId`, `itemChangeId`): `Promise`<`void`\> +**deleteItemChange**(`orderEditId`, `itemChangeId`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `orderEditId` | `string` | | `itemChangeId` | `string` | @@ -461,20 +482,22 @@ ___ `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/order-edit.ts:613](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L613) +[medusa/src/services/order-edit.ts:613](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L613) ___ ### list -▸ **list**(`selector`, `config?`): `Promise`<`OrderEdit`[]\> +**list**(`selector`, `config?`): `Promise`<`OrderEdit`[]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `selector` | `Selector`<`OrderEdit`\> | | `config?` | `FindConfig`<`OrderEdit`\> | @@ -482,20 +505,24 @@ ___ `Promise`<`OrderEdit`[]\> +-`Promise`: + -`OrderEdit[]`: + -`OrderEdit`: + #### Defined in -[medusa/src/services/order-edit.ts:154](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L154) +[medusa/src/services/order-edit.ts:154](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L154) ___ ### listAndCount -▸ **listAndCount**(`selector`, `config?`): `Promise`<[`OrderEdit`[], `number`]\> +**listAndCount**(`selector`, `config?`): `Promise`<[`OrderEdit`[], `number`]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `selector` | `Selector`<`OrderEdit`\> & { `q?`: `string` } | | `config?` | `FindConfig`<`OrderEdit`\> | @@ -503,42 +530,48 @@ ___ `Promise`<[`OrderEdit`[], `number`]\> +-`Promise`: + -`OrderEdit[]`: + -`number`: (optional) + #### Defined in -[medusa/src/services/order-edit.ts:130](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L130) +[medusa/src/services/order-edit.ts:130](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L130) ___ ### refreshAdjustments -▸ **refreshAdjustments**(`orderEditId`, `config?`): `Promise`<`void`\> +**refreshAdjustments**(`orderEditId`, `config?`): `Promise`<`void`\> #### Parameters -| Name | Type | Default value | -| :------ | :------ | :------ | -| `orderEditId` | `string` | `undefined` | -| `config` | `Object` | `undefined` | +| Name | Default value | +| :------ | :------ | +| `orderEditId` | `string` | +| `config` | `object` | | `config.preserveCustomAdjustments` | `boolean` | `false` | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/order-edit.ts:439](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L439) +[medusa/src/services/order-edit.ts:439](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L439) ___ ### removeLineItem -▸ **removeLineItem**(`orderEditId`, `lineItemId`): `Promise`<`void`\> +**removeLineItem**(`orderEditId`, `lineItemId`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `orderEditId` | `string` | | `lineItemId` | `string` | @@ -546,42 +579,47 @@ ___ `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/order-edit.ts:382](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L382) +[medusa/src/services/order-edit.ts:382](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L382) ___ ### requestConfirmation -▸ **requestConfirmation**(`orderEditId`, `context?`): `Promise`<`OrderEdit`\> +**requestConfirmation**(`orderEditId`, `context?`): `Promise`<`OrderEdit`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `orderEditId` | `string` | -| `context` | `Object` | +| `context` | `object` | | `context.requestedBy?` | `string` | #### Returns `Promise`<`OrderEdit`\> +-`Promise`: + -`OrderEdit`: + #### Defined in -[medusa/src/services/order-edit.ts:645](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L645) +[medusa/src/services/order-edit.ts:645](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L645) ___ ### retrieve -▸ **retrieve**(`orderEditId`, `config?`): `Promise`<`OrderEdit`\> +**retrieve**(`orderEditId`, `config?`): `Promise`<`OrderEdit`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `orderEditId` | `string` | | `config` | `FindConfig`<`OrderEdit`\> | @@ -589,20 +627,23 @@ ___ `Promise`<`OrderEdit`\> +-`Promise`: + -`OrderEdit`: + #### Defined in -[medusa/src/services/order-edit.ts:102](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L102) +[medusa/src/services/order-edit.ts:102](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L102) ___ ### retrieveActive -▸ `Protected` **retrieveActive**(`orderId`, `config?`): `Promise`<`undefined` \| ``null`` \| `OrderEdit`\> +`Protected` **retrieveActive**(`orderId`, `config?`): `Promise`<`undefined` \| ``null`` \| `OrderEdit`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `orderId` | `string` | | `config` | `FindConfig`<`OrderEdit`\> | @@ -610,44 +651,49 @@ ___ `Promise`<`undefined` \| ``null`` \| `OrderEdit`\> +-`Promise`: + -`undefined \| ``null`` \| OrderEdit`: (optional) + #### Defined in -[medusa/src/services/order-edit.ts:788](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L788) +[medusa/src/services/order-edit.ts:788](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L788) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`orderEditId`, `data`): `Promise`<`OrderEdit`\> +**update**(`orderEditId`, `data`): `Promise`<`OrderEdit`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `orderEditId` | `string` | | `data` | `DeepPartial`<`OrderEdit`\> | @@ -655,15 +701,18 @@ ___ `Promise`<`OrderEdit`\> +-`Promise`: + -`OrderEdit`: + #### Defined in -[medusa/src/services/order-edit.ts:211](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L211) +[medusa/src/services/order-edit.ts:211](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L211) ___ ### updateLineItem -▸ **updateLineItem**(`orderEditId`, `itemId`, `data`): `Promise`<`void`\> +**updateLineItem**(`orderEditId`, `itemId`, `data`): `Promise`<`void`\> Create or update order edit item change line item and apply the quantity - If the item change already exists then update the quantity of the line item as well as the line adjustments @@ -671,61 +720,67 @@ Create or update order edit item change line item and apply the quantity #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `orderEditId` | `string` | | `itemId` | `string` | -| `data` | `Object` | +| `data` | `object` | | `data.quantity` | `number` | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/order-edit.ts:309](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L309) +[medusa/src/services/order-edit.ts:309](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L309) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`OrderEditService`](OrderEditService.md) +**withTransaction**(`transactionManager?`): [`OrderEditService`](OrderEditService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`OrderEditService`](OrderEditService.md) +-`default`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) ___ ### isOrderEditActive -▸ `Static` `Private` **isOrderEditActive**(`orderEdit`): `boolean` +`Static` `Private` **isOrderEditActive**(`orderEdit`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `orderEdit` | `OrderEdit` | #### Returns `boolean` +-`boolean`: (optional) + #### Defined in -[medusa/src/services/order-edit.ts:860](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order-edit.ts#L860) +[medusa/src/services/order-edit.ts:860](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order-edit.ts#L860) diff --git a/www/apps/docs/content/references/services/classes/OrderService.md b/www/apps/docs/content/references/services/classes/OrderService.md index 7281a087189fc..569967a894810 100644 --- a/www/apps/docs/content/references/services/classes/OrderService.md +++ b/www/apps/docs/content/references/services/classes/OrderService.md @@ -1,4 +1,4 @@ -# Class: OrderService +# OrderService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new OrderService**(`«destructured»`) +**new OrderService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/order.ts:137](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L137) +[medusa/src/services/order.ts:137](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L137) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,133 +66,133 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### addressRepository\_ -• `Protected` `Readonly` **addressRepository\_**: `Repository`<`Address`\> + `Protected` `Readonly` **addressRepository\_**: `Repository`<`Address`\> #### Defined in -[medusa/src/services/order.ts:128](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L128) +[medusa/src/services/order.ts:128](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L128) ___ ### cartService\_ -• `Protected` `Readonly` **cartService\_**: [`CartService`](CartService.md) + `Protected` `Readonly` **cartService\_**: [`CartService`](CartService.md) #### Defined in -[medusa/src/services/order.ts:127](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L127) +[medusa/src/services/order.ts:127](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L127) ___ ### customerService\_ -• `Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md) + `Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md) #### Defined in -[medusa/src/services/order.ts:115](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L115) +[medusa/src/services/order.ts:115](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L115) ___ ### discountService\_ -• `Protected` `Readonly` **discountService\_**: [`DiscountService`](DiscountService.md) + `Protected` `Readonly` **discountService\_**: [`DiscountService`](DiscountService.md) #### Defined in -[medusa/src/services/order.ts:119](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L119) +[medusa/src/services/order.ts:119](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L119) ___ ### draftOrderService\_ -• `Protected` `Readonly` **draftOrderService\_**: [`DraftOrderService`](DraftOrderService.md) + `Protected` `Readonly` **draftOrderService\_**: [`DraftOrderService`](DraftOrderService.md) #### Defined in -[medusa/src/services/order.ts:130](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L130) +[medusa/src/services/order.ts:130](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L130) ___ ### eventBus\_ -• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/order.ts:132](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L132) +[medusa/src/services/order.ts:132](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L132) ___ ### featureFlagRouter\_ -• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` + `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` #### Defined in -[medusa/src/services/order.ts:133](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L133) +[medusa/src/services/order.ts:133](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L133) ___ ### fulfillmentProviderService\_ -• `Protected` `Readonly` **fulfillmentProviderService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md) + `Protected` `Readonly` **fulfillmentProviderService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md) #### Defined in -[medusa/src/services/order.ts:120](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L120) +[medusa/src/services/order.ts:120](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L120) ___ ### fulfillmentService\_ -• `Protected` `Readonly` **fulfillmentService\_**: [`FulfillmentService`](FulfillmentService.md) + `Protected` `Readonly` **fulfillmentService\_**: [`FulfillmentService`](FulfillmentService.md) #### Defined in -[medusa/src/services/order.ts:121](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L121) +[medusa/src/services/order.ts:121](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L121) ___ ### giftCardService\_ -• `Protected` `Readonly` **giftCardService\_**: [`GiftCardService`](GiftCardService.md) + `Protected` `Readonly` **giftCardService\_**: [`GiftCardService`](GiftCardService.md) #### Defined in -[medusa/src/services/order.ts:129](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L129) +[medusa/src/services/order.ts:129](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L129) ___ ### inventoryService\_ -• `Protected` `Readonly` **inventoryService\_**: `IInventoryService` + `Protected` `Readonly` **inventoryService\_**: `IInventoryService` #### Defined in -[medusa/src/services/order.ts:131](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L131) +[medusa/src/services/order.ts:131](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L131) ___ ### lineItemService\_ -• `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md) + `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md) #### Defined in -[medusa/src/services/order.ts:122](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L122) +[medusa/src/services/order.ts:122](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L122) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -200,103 +200,103 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### newTotalsService\_ -• `Protected` `Readonly` **newTotalsService\_**: [`NewTotalsService`](NewTotalsService.md) + `Protected` `Readonly` **newTotalsService\_**: [`NewTotalsService`](NewTotalsService.md) #### Defined in -[medusa/src/services/order.ts:124](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L124) +[medusa/src/services/order.ts:124](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L124) ___ ### orderRepository\_ -• `Protected` `Readonly` **orderRepository\_**: `Repository`<`Order`\> & { `findOneWithRelations`: (`relations`: `FindOptionsRelations`<`Order`\>, `optionsWithoutRelations`: `Omit`<`FindManyOptions`<`Order`\>, ``"relations"``\>) => `Promise`<`Order`\> ; `findWithRelations`: (`relations`: `FindOptionsRelations`<`Order`\>, `optionsWithoutRelations`: `Omit`<`FindManyOptions`<`Order`\>, ``"relations"``\>) => `Promise`<`Order`[]\> } + `Protected` `Readonly` **orderRepository\_**: `Repository`<`Order`\> & { `findOneWithRelations`: Method findOneWithRelations ; `findWithRelations`: Method findWithRelations } #### Defined in -[medusa/src/services/order.ts:114](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L114) +[medusa/src/services/order.ts:114](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L114) ___ ### paymentProviderService\_ -• `Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md) + `Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md) #### Defined in -[medusa/src/services/order.ts:116](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L116) +[medusa/src/services/order.ts:116](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L116) ___ ### productVariantInventoryService\_ -• `Protected` `Readonly` **productVariantInventoryService\_**: [`ProductVariantInventoryService`](ProductVariantInventoryService.md) + `Protected` `Readonly` **productVariantInventoryService\_**: [`ProductVariantInventoryService`](ProductVariantInventoryService.md) #### Defined in -[medusa/src/services/order.ts:135](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L135) +[medusa/src/services/order.ts:135](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L135) ___ ### regionService\_ -• `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md) + `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md) #### Defined in -[medusa/src/services/order.ts:126](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L126) +[medusa/src/services/order.ts:126](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L126) ___ ### shippingOptionService\_ -• `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md) + `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md) #### Defined in -[medusa/src/services/order.ts:117](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L117) +[medusa/src/services/order.ts:117](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L117) ___ ### shippingProfileService\_ -• `Protected` `Readonly` **shippingProfileService\_**: [`ShippingProfileService`](ShippingProfileService.md) + `Protected` `Readonly` **shippingProfileService\_**: [`ShippingProfileService`](ShippingProfileService.md) #### Defined in -[medusa/src/services/order.ts:118](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L118) +[medusa/src/services/order.ts:118](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L118) ___ ### taxProviderService\_ -• `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md) + `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md) #### Defined in -[medusa/src/services/order.ts:125](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L125) +[medusa/src/services/order.ts:125](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L125) ___ ### totalsService\_ -• `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md) + `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md) #### Defined in -[medusa/src/services/order.ts:123](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L123) +[medusa/src/services/order.ts:123](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L123) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -304,13 +304,13 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### Events -▪ `Static` `Readonly` **Events**: `Object` + `Static` `Readonly` **Events**: `Object` #### Type declaration @@ -335,95 +335,99 @@ ___ #### Defined in -[medusa/src/services/order.ts:95](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L95) +[medusa/src/services/order.ts:95](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L95) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### addShippingMethod -▸ **addShippingMethod**(`orderId`, `optionId`, `data?`, `config?`): `Promise`<`Order`\> +**addShippingMethod**(`orderId`, `optionId`, `data?`, `config?`): `Promise`<`Order`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `orderId` | `string` | | `optionId` | `string` | -| `data?` | `Record`<`string`, `unknown`\> | +| `data?` | Record<`string`, `unknown`\> | | `config` | `CreateShippingMethodDto` | #### Returns `Promise`<`Order`\> +-`Promise`: + -`Order`: + #### Defined in -[medusa/src/services/order.ts:1033](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L1033) +[medusa/src/services/order.ts:1030](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L1030) ___ ### archive -▸ **archive**(`orderId`): `Promise`<`Order`\> +**archive**(`orderId`): `Promise`<`Order`\> Archives an order. It only alloved, if the order has been fulfilled and payment has been captured. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `orderId` | `string` | the order to archive | #### Returns `Promise`<`Order`\> -the result of the update operation +-`Promise`: the result of the update operation + -`Order`: #### Defined in -[medusa/src/services/order.ts:1565](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L1565) +[medusa/src/services/order.ts:1562](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L1562) ___ ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -432,7 +436,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -440,13 +444,13 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### cancel -▸ **cancel**(`orderId`): `Promise`<`Order`\> +**cancel**(`orderId`): `Promise`<`Order`\> Cancels an order. Throws if fulfillment process has been initiated. @@ -454,119 +458,124 @@ Throws if payment process has been initiated. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `orderId` | `string` | id of order to cancel. | #### Returns `Promise`<`Order`\> -result of the update operation. +-`Promise`: result of the update operation. + -`Order`: #### Defined in -[medusa/src/services/order.ts:1183](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L1183) +[medusa/src/services/order.ts:1180](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L1180) ___ ### cancelFulfillment -▸ **cancelFulfillment**(`fulfillmentId`): `Promise`<`Order`\> +**cancelFulfillment**(`fulfillmentId`): `Promise`<`Order`\> Cancels a fulfillment (if related to an order) #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `fulfillmentId` | `string` | the ID of the fulfillment to cancel | #### Returns `Promise`<`Order`\> -updated order +-`Promise`: updated order + -`Order`: #### Defined in -[medusa/src/services/order.ts:1502](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L1502) +[medusa/src/services/order.ts:1499](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L1499) ___ ### capturePayment -▸ **capturePayment**(`orderId`): `Promise`<`Order`\> +**capturePayment**(`orderId`): `Promise`<`Order`\> Captures payment for an order. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `orderId` | `string` | id of order to capture payment for. | #### Returns `Promise`<`Order`\> -result of the update operation. +-`Promise`: result of the update operation. + -`Order`: #### Defined in -[medusa/src/services/order.ts:1272](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L1272) +[medusa/src/services/order.ts:1269](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L1269) ___ ### completeOrder -▸ **completeOrder**(`orderId`): `Promise`<`Order`\> +**completeOrder**(`orderId`): `Promise`<`Order`\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `orderId` | `string` | id of the order to complete | #### Returns `Promise`<`Order`\> -the result of the find operation +-`Promise`: the result of the find operation + -`Order`: #### Defined in -[medusa/src/services/order.ts:577](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L577) +[medusa/src/services/order.ts:577](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L577) ___ ### createFromCart -▸ **createFromCart**(`cartOrId`): `Promise`<`Order`\> +**createFromCart**(`cartOrId`): `Promise`<`Order`\> Creates an order from a cart #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `cartOrId` | `string` \| `Cart` | #### Returns `Promise`<`Order`\> -resolves to the creation result. +-`Promise`: resolves to the creation result. + -`Order`: #### Defined in -[medusa/src/services/order.ts:607](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L607) +[medusa/src/services/order.ts:607](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L607) ___ ### createFulfillment -▸ **createFulfillment**(`orderId`, `itemsToFulfill`, `config?`): `Promise`<`Order`\> +**createFulfillment**(`orderId`, `itemsToFulfill`, `config?`): `Promise`<`Order`\> Creates fulfillments for an order. In a situation where the order has more than one shipping method, @@ -575,35 +584,36 @@ to their respective fulfillment provider. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `orderId` | `string` | id of order to fulfil. | | `itemsToFulfill` | `FulFillmentItemType`[] | items to fulfil. | -| `config` | `Object` | the config to fulfil. | -| `config.location_id?` | `string` | - | -| `config.metadata?` | `Record`<`string`, `unknown`\> | - | -| `config.no_notification?` | `boolean` | - | +| `config` | `object` | the config to fulfil. | +| `config.location_id?` | `string` | +| `config.metadata?` | Record<`string`, `unknown`\> | +| `config.no_notification?` | `boolean` | #### Returns `Promise`<`Order`\> -result of the update operation. +-`Promise`: result of the update operation. + -`Order`: #### Defined in -[medusa/src/services/order.ts:1377](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L1377) +[medusa/src/services/order.ts:1374](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L1374) ___ ### createGiftCardsFromLineItem\_ -▸ `Protected` **createGiftCardsFromLineItem_**(`order`, `lineItem`, `manager`): `Promise`<`GiftCard`\>[] +`Protected` **createGiftCardsFromLineItem_**(`order`, `lineItem`, `manager`): `Promise`<`GiftCard`\>[] #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `order` | `Order` | | `lineItem` | `LineItem` | | `manager` | `EntityManager` | @@ -612,44 +622,49 @@ ___ `Promise`<`GiftCard`\>[] +-`Promise[]`: + -`Promise`: + -`GiftCard`: + #### Defined in -[medusa/src/services/order.ts:814](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L814) +[medusa/src/services/order.ts:811](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L811) ___ ### createRefund -▸ **createRefund**(`orderId`, `refundAmount`, `reason`, `note?`, `config?`): `Promise`<`Order`\> +**createRefund**(`orderId`, `refundAmount`, `reason`, `note?`, `config?`): `Promise`<`Order`\> Refunds a given amount back to the customer. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `orderId` | `string` | id of the order to refund. | | `refundAmount` | `number` | the amount to refund. | | `reason` | `string` | the reason to refund. | | `note?` | `string` | note for refund. | -| `config` | `Object` | the config for refund. | -| `config.no_notification?` | `boolean` | - | +| `config` | `object` | the config for refund. | +| `config.no_notification?` | `boolean` | #### Returns `Promise`<`Order`\> -the result of the refund operation. +-`Promise`: the result of the refund operation. + -`Order`: #### Defined in -[medusa/src/services/order.ts:1591](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L1591) +[medusa/src/services/order.ts:1588](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L1588) ___ ### createShipment -▸ **createShipment**(`orderId`, `fulfillmentId`, `trackingLinks?`, `config?`): `Promise`<`Order`\> +**createShipment**(`orderId`, `fulfillmentId`, `trackingLinks?`, `config?`): `Promise`<`Order`\> Adds a shipment to the order to indicate that an order has left the warehouse. Will ask the fulfillment provider for any documents that may @@ -657,37 +672,38 @@ have been created in regards to the shipment. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `orderId` | `string` | the id of the order that has been shipped | | `fulfillmentId` | `string` | the fulfillment that has now been shipped | | `trackingLinks?` | `TrackingLink`[] | array of tracking numbers associated with the shipment | -| `config` | `Object` | the config of the order that has been shipped | -| `config.metadata` | `Record`<`string`, `unknown`\> | - | -| `config.no_notification?` | `boolean` | - | +| `config` | `object` | the config of the order that has been shipped | +| `config.metadata` | Record<`string`, `unknown`\> | +| `config.no_notification?` | `boolean` | #### Returns `Promise`<`Order`\> -the resulting order following the update. +-`Promise`: the resulting order following the update. + -`Order`: #### Defined in -[medusa/src/services/order.ts:867](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L867) +[medusa/src/services/order.ts:864](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L864) ___ ### decorateTotals -▸ **decorateTotals**(`order`, `totalsFields?`): `Promise`<`Order`\> +**decorateTotals**(`order`, `totalsFields?`): `Promise`<`Order`\> Calculate and attach the different total fields on the object #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `order` | `Order` | | `totalsFields?` | `string`[] | @@ -695,18 +711,21 @@ Calculate and attach the different total fields on the object `Promise`<`Order`\> +-`Promise`: + -`Order`: + #### Defined in -[medusa/src/services/order.ts:1788](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L1788) +[medusa/src/services/order.ts:1785](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L1785) -▸ **decorateTotals**(`order`, `context?`): `Promise`<`Order`\> +**decorateTotals**(`order`, `context?`): `Promise`<`Order`\> Calculate and attach the different total fields on the object #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `order` | `Order` | | `context?` | `TotalsContext` | @@ -714,43 +733,49 @@ Calculate and attach the different total fields on the object `Promise`<`Order`\> +-`Promise`: + -`Order`: + #### Defined in -[medusa/src/services/order.ts:1790](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L1790) +[medusa/src/services/order.ts:1787](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L1787) ___ ### decorateTotalsLegacy -▸ `Protected` **decorateTotalsLegacy**(`order`, `totalsFields?`): `Promise`<`Order`\> +`Protected` **decorateTotalsLegacy**(`order`, `totalsFields?`): `Promise`<`Order`\> #### Parameters -| Name | Type | Default value | -| :------ | :------ | :------ | -| `order` | `Order` | `undefined` | +| Name | Default value | +| :------ | :------ | +| `order` | `Order` | | `totalsFields` | `string`[] | `[]` | #### Returns `Promise`<`Order`\> +-`Promise`: + -`Order`: + #### Defined in -[medusa/src/services/order.ts:1659](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L1659) +[medusa/src/services/order.ts:1656](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L1656) ___ ### getFulfillmentItems -▸ `Protected` **getFulfillmentItems**(`order`, `items`, `transformer`): `Promise`<`LineItem`[]\> +`Protected` **getFulfillmentItems**(`order`, `items`, `transformer`): `Promise`<`LineItem`[]\> Retrieves the order line items, given an array of items. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `order` | `Order` | the order to get line items from | | `items` | `FulFillmentItemType`[] | the items to get | | `transformer` | (`item`: `undefined` \| `LineItem`, `quantity`: `number`) => `unknown` | a function to apply to each of the items retrieved from the order, should return a line item. If the transformer returns an undefined value the line item will be filtered from the returned array. | @@ -759,42 +784,47 @@ Retrieves the order line items, given an array of items. `Promise`<`LineItem`[]\> -the line items generated by the transformer. +-`Promise`: the line items generated by the transformer. + -`LineItem[]`: + -`LineItem`: #### Defined in -[medusa/src/services/order.ts:1544](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L1544) +[medusa/src/services/order.ts:1541](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L1541) ___ ### getTotalsRelations -▸ `Private` **getTotalsRelations**(`config`): `string`[] +`Private` **getTotalsRelations**(`config`): `string`[] #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `config` | `FindConfig`<`Order`\> | #### Returns `string`[] +-`string[]`: + -`string`: (optional) + #### Defined in -[medusa/src/services/order.ts:2057](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L2057) +[medusa/src/services/order.ts:2061](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L2061) ___ ### list -▸ **list**(`selector`, `config?`): `Promise`<`Order`[]\> +**list**(`selector`, `config?`): `Promise`<`Order`[]\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`Order`\> | the query object for find | | `config` | `FindConfig`<`Order`\> | the config to be used for find | @@ -802,22 +832,24 @@ ___ `Promise`<`Order`[]\> -the result of the find operation +-`Promise`: the result of the find operation + -`Order[]`: + -`Order`: #### Defined in -[medusa/src/services/order.ts:189](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L189) +[medusa/src/services/order.ts:189](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L189) ___ ### listAndCount -▸ **listAndCount**(`selector`, `config?`): `Promise`<[`Order`[], `number`]\> +**listAndCount**(`selector`, `config?`): `Promise`<[`Order`[], `number`]\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `QuerySelector`<`Order`\> | the query object for find | | `config` | `FindConfig`<`Order`\> | the config to be used for find | @@ -825,17 +857,19 @@ ___ `Promise`<[`Order`[], `number`]\> -the result of the find operation +-`Promise`: the result of the find operation + -`Order[]`: + -`number`: (optional) #### Defined in -[medusa/src/services/order.ts:206](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L206) +[medusa/src/services/order.ts:206](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L206) ___ ### registerReturnReceived -▸ **registerReturnReceived**(`orderId`, `receivedReturn`, `customRefundAmount?`): `Promise`<`Order`\> +**registerReturnReceived**(`orderId`, `receivedReturn`, `customRefundAmount?`): `Promise`<`Order`\> Handles receiving a return. This will create a refund to the customer. If the returned items don't match the requested @@ -847,8 +881,8 @@ mismatches. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `orderId` | `string` | the order to return. | | `receivedReturn` | `Return` | the received return | | `customRefundAmount?` | `number` | the custom refund amount return | @@ -857,24 +891,25 @@ mismatches. `Promise`<`Order`\> -the result of the update operation +-`Promise`: the result of the update operation + -`Order`: #### Defined in -[medusa/src/services/order.ts:1982](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L1982) +[medusa/src/services/order.ts:1986](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L1986) ___ ### retrieve -▸ **retrieve**(`orderId`, `config?`): `Promise`<`Order`\> +**retrieve**(`orderId`, `config?`): `Promise`<`Order`\> Gets an order by id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `orderId` | `string` | id or selector of order to retrieve | | `config` | `FindConfig`<`Order`\> | config of order to retrieve | @@ -882,24 +917,25 @@ Gets an order by id. `Promise`<`Order`\> -the order document +-`Promise`: the order document + -`Order`: #### Defined in -[medusa/src/services/order.ts:388](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L388) +[medusa/src/services/order.ts:388](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L388) ___ ### retrieveByCartId -▸ **retrieveByCartId**(`cartId`, `config?`): `Promise`<`Order`\> +**retrieveByCartId**(`cartId`, `config?`): `Promise`<`Order`\> Gets an order by cart id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartId` | `string` | cart id to find order | | `config` | `FindConfig`<`Order`\> | the config to be used to find order | @@ -907,22 +943,23 @@ Gets an order by cart id. `Promise`<`Order`\> -the order document +-`Promise`: the order document + -`Order`: #### Defined in -[medusa/src/services/order.ts:484](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L484) +[medusa/src/services/order.ts:484](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L484) ___ ### retrieveByCartIdWithTotals -▸ **retrieveByCartIdWithTotals**(`cartId`, `options?`): `Promise`<`Order`\> +**retrieveByCartIdWithTotals**(`cartId`, `options?`): `Promise`<`Order`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `cartId` | `string` | | `options` | `FindConfig`<`Order`\> | @@ -930,22 +967,25 @@ ___ `Promise`<`Order`\> +-`Promise`: + -`Order`: + #### Defined in -[medusa/src/services/order.ts:518](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L518) +[medusa/src/services/order.ts:518](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L518) ___ ### retrieveByExternalId -▸ **retrieveByExternalId**(`externalId`, `config?`): `Promise`<`Order`\> +**retrieveByExternalId**(`externalId`, `config?`): `Promise`<`Order`\> Gets an order by id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `externalId` | `string` | id of order to retrieve | | `config` | `FindConfig`<`Order`\> | query config to get order by | @@ -953,22 +993,23 @@ Gets an order by id. `Promise`<`Order`\> -the order document +-`Promise`: the order document + -`Order`: #### Defined in -[medusa/src/services/order.ts:533](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L533) +[medusa/src/services/order.ts:533](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L533) ___ ### retrieveLegacy -▸ `Protected` **retrieveLegacy**(`orderIdOrSelector`, `config?`): `Promise`<`Order`\> +`Protected` **retrieveLegacy**(`orderIdOrSelector`, `config?`): `Promise`<`Order`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `orderIdOrSelector` | `string` \| `Selector`<`Order`\> | | `config` | `FindConfig`<`Order`\> | @@ -976,20 +1017,23 @@ ___ `Promise`<`Order`\> +-`Promise`: + -`Order`: + #### Defined in -[medusa/src/services/order.ts:428](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L428) +[medusa/src/services/order.ts:428](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L428) ___ ### retrieveWithTotals -▸ **retrieveWithTotals**(`orderId`, `options?`, `context?`): `Promise`<`Order`\> +**retrieveWithTotals**(`orderId`, `options?`, `context?`): `Promise`<`Order`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `orderId` | `string` | | `options` | `FindConfig`<`Order`\> | | `context` | `TotalsContext` | @@ -998,49 +1042,56 @@ ___ `Promise`<`Order`\> +-`Promise`: + -`Order`: + #### Defined in -[medusa/src/services/order.ts:467](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L467) +[medusa/src/services/order.ts:467](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L467) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### transformQueryForTotals -▸ `Protected` **transformQueryForTotals**(`config`): `Object` +`Protected` **transformQueryForTotals**(`config`): { `relations`: `undefined` \| `string`[] ; `select`: `undefined` \| keyof `Order`[] ; `totalsToSelect`: `undefined` \| keyof `Order`[] } #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `config` | `FindConfig`<`Order`\> | #### Returns -`Object` +`object` + +-``object``: (optional) | Name | Type | | :------ | :------ | @@ -1050,13 +1101,13 @@ ___ #### Defined in -[medusa/src/services/order.ts:312](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L312) +[medusa/src/services/order.ts:312](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L312) ___ ### update -▸ **update**(`orderId`, `update`): `Promise`<`Order`\> +**update**(`orderId`, `update`): `Promise`<`Order`\> Updates an order. Metadata updates should use dedicated method, e.g. `setMetadata` etc. The function @@ -1064,8 +1115,8 @@ will throw errors if metadata updates are attempted. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `orderId` | `string` | the id of the order. Must be a string that can be casted to an ObjectId | | `update` | `UpdateOrderInput` | an object with the update values. | @@ -1073,24 +1124,25 @@ will throw errors if metadata updates are attempted. `Promise`<`Order`\> -resolves to the update result. +-`Promise`: resolves to the update result. + -`Order`: #### Defined in -[medusa/src/services/order.ts:1094](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L1094) +[medusa/src/services/order.ts:1091](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L1091) ___ ### updateBillingAddress -▸ `Protected` **updateBillingAddress**(`order`, `address`): `Promise`<`void`\> +`Protected` **updateBillingAddress**(`order`, `address`): `Promise`<`void`\> Updates the order's billing address. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `order` | `Order` | the order to update | | `address` | `Address` | the value to set the billing address to | @@ -1098,24 +1150,24 @@ Updates the order's billing address. `Promise`<`void`\> -the result of the update operation +-`Promise`: the result of the update operation #### Defined in -[medusa/src/services/order.ts:955](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L955) +[medusa/src/services/order.ts:952](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L952) ___ ### updateShippingAddress -▸ `Protected` **updateShippingAddress**(`order`, `address`): `Promise`<`void`\> +`Protected` **updateShippingAddress**(`order`, `address`): `Promise`<`void`\> Updates the order's shipping address. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `order` | `Order` | the order to update | | `address` | `Address` | the value to set the shipping address to | @@ -1123,17 +1175,17 @@ Updates the order's shipping address. `Promise`<`void`\> -the result of the update operation +-`Promise`: the result of the update operation #### Defined in -[medusa/src/services/order.ts:1002](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L1002) +[medusa/src/services/order.ts:999](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L999) ___ ### validateFulfillmentLineItem -▸ `Protected` **validateFulfillmentLineItem**(`item`, `quantity`): ``null`` \| `LineItem` +`Protected` **validateFulfillmentLineItem**(`item`, `quantity`): ``null`` \| `LineItem` Checks that a given quantity of a line item can be fulfilled. Fails if the fulfillable quantity is lower than the requested fulfillment quantity. @@ -1142,8 +1194,8 @@ quantity from the quantity that was originally purchased. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `item` | `LineItem` | the line item to check has sufficient fulfillable quantity. | | `quantity` | `number` | the quantity that is requested to be fulfilled. | @@ -1151,33 +1203,35 @@ quantity from the quantity that was originally purchased. ``null`` \| `LineItem` -a line item that has the requested fulfillment quantity +-```null`` \| LineItem`: (optional) a line item that has the requested fulfillment quantity set. #### Defined in -[medusa/src/services/order.ts:1344](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/order.ts#L1344) +[medusa/src/services/order.ts:1341](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/order.ts#L1341) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`OrderService`](OrderService.md) +**withTransaction**(`transactionManager?`): [`OrderService`](OrderService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`OrderService`](OrderService.md) +-`OrderService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/PaymentCollectionService.md b/www/apps/docs/content/references/services/classes/PaymentCollectionService.md index 587b735c3cf63..66da964ceb634 100644 --- a/www/apps/docs/content/references/services/classes/PaymentCollectionService.md +++ b/www/apps/docs/content/references/services/classes/PaymentCollectionService.md @@ -1,4 +1,4 @@ -# Class: PaymentCollectionService +# PaymentCollectionService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new PaymentCollectionService**(`«destructured»`) +**new PaymentCollectionService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/payment-collection.ts:46](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L46) +[medusa/src/services/payment-collection.ts:46](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L46) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,33 +66,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### customerService\_ -• `Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md) + `Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md) #### Defined in -[medusa/src/services/payment-collection.ts:42](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L42) +[medusa/src/services/payment-collection.ts:42](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L42) ___ ### eventBusService\_ -• `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/payment-collection.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L40) +[medusa/src/services/payment-collection.ts:40](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L40) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -100,33 +100,33 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### paymentCollectionRepository\_ -• `Protected` `Readonly` **paymentCollectionRepository\_**: `Repository`<`PaymentCollection`\> & { `getPaymentCollectionIdByPaymentId`: (`paymentId`: `string`, `config`: `FindManyOptions`<`PaymentCollection`\>) => `Promise`<`PaymentCollection`\> ; `getPaymentCollectionIdBySessionId`: (`sessionId`: `string`, `config`: `FindManyOptions`<`PaymentCollection`\>) => `Promise`<`PaymentCollection`\> } + `Protected` `Readonly` **paymentCollectionRepository\_**: `Repository`<`PaymentCollection`\> & { `getPaymentCollectionIdByPaymentId`: Method getPaymentCollectionIdByPaymentId ; `getPaymentCollectionIdBySessionId`: Method getPaymentCollectionIdBySessionId } #### Defined in -[medusa/src/services/payment-collection.ts:44](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L44) +[medusa/src/services/payment-collection.ts:44](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L44) ___ ### paymentProviderService\_ -• `Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md) + `Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md) #### Defined in -[medusa/src/services/payment-collection.ts:41](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L41) +[medusa/src/services/payment-collection.ts:41](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L41) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -134,13 +134,13 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### Events -▪ `Static` `Readonly` **Events**: `Object` + `Static` `Readonly` **Events**: `Object` #### Type declaration @@ -153,47 +153,47 @@ ___ #### Defined in -[medusa/src/services/payment-collection.ts:33](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L33) +[medusa/src/services/payment-collection.ts:33](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L33) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -202,7 +202,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -210,92 +210,95 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### authorizePaymentSessions -▸ **authorizePaymentSessions**(`paymentCollectionId`, `sessionIds`, `context?`): `Promise`<`PaymentCollection`\> +**authorizePaymentSessions**(`paymentCollectionId`, `sessionIds`, `context?`): `Promise`<`PaymentCollection`\> Authorizes the payment sessions of a payment collection. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `paymentCollectionId` | `string` | the id of the payment collection | | `sessionIds` | `string`[] | array of payment session ids to be authorized | -| `context` | `Record`<`string`, `unknown`\> | additional data required by payment providers | +| `context` | Record<`string`, `unknown`\> | additional data required by payment providers | #### Returns `Promise`<`PaymentCollection`\> -the payment collection and its payment session. +-`Promise`: the payment collection and its payment session. + -`PaymentCollection`: #### Defined in -[medusa/src/services/payment-collection.ts:528](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L528) +[medusa/src/services/payment-collection.ts:528](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L528) ___ ### create -▸ **create**(`data`): `Promise`<`PaymentCollection`\> +**create**(`data`): `Promise`<`PaymentCollection`\> Creates a new payment collection. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `data` | `CreatePaymentCollectionInput` | info to create the payment collection | #### Returns `Promise`<`PaymentCollection`\> -the payment collection created. +-`Promise`: the payment collection created. + -`PaymentCollection`: #### Defined in -[medusa/src/services/payment-collection.ts:103](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L103) +[medusa/src/services/payment-collection.ts:103](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L103) ___ ### delete -▸ **delete**(`paymentCollectionId`): `Promise`<`undefined` \| `PaymentCollection`\> +**delete**(`paymentCollectionId`): `Promise`<`undefined` \| `PaymentCollection`\> Deletes a payment collection. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `paymentCollectionId` | `string` | the id of the payment collection to be removed | #### Returns `Promise`<`undefined` \| `PaymentCollection`\> -the payment collection removed. +-`Promise`: the payment collection removed. + -`undefined \| PaymentCollection`: (optional) #### Defined in -[medusa/src/services/payment-collection.ts:172](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L172) +[medusa/src/services/payment-collection.ts:172](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L172) ___ ### isValidTotalAmount -▸ `Private` **isValidTotalAmount**(`total`, `sessionsInput`): `boolean` +`Private` **isValidTotalAmount**(`total`, `sessionsInput`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `total` | `number` | | `sessionsInput` | `PaymentCollectionsSessionsBatchInput`[] | @@ -303,46 +306,49 @@ ___ `boolean` +-`boolean`: (optional) + #### Defined in -[medusa/src/services/payment-collection.ts:210](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L210) +[medusa/src/services/payment-collection.ts:210](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L210) ___ ### markAsAuthorized -▸ **markAsAuthorized**(`paymentCollectionId`): `Promise`<`PaymentCollection`\> +**markAsAuthorized**(`paymentCollectionId`): `Promise`<`PaymentCollection`\> Marks a payment collection as authorized bypassing the payment flow. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `paymentCollectionId` | `string` | the id of the payment collection | #### Returns `Promise`<`PaymentCollection`\> -the payment session authorized. +-`Promise`: the payment session authorized. + -`PaymentCollection`: #### Defined in -[medusa/src/services/payment-collection.ts:499](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L499) +[medusa/src/services/payment-collection.ts:499](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L499) ___ ### refreshPaymentSession -▸ **refreshPaymentSession**(`paymentCollectionId`, `sessionId`, `customerId`): `Promise`<`PaymentSession`\> +**refreshPaymentSession**(`paymentCollectionId`, `sessionId`, `customerId`): `Promise`<`PaymentSession`\> Removes and recreate a payment session of a payment collection. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `paymentCollectionId` | `string` | the id of the payment collection | | `sessionId` | `string` | the id of the payment session to be replaced | | `customerId` | `string` | the id of the customer | @@ -351,24 +357,25 @@ Removes and recreate a payment session of a payment collection. `Promise`<`PaymentSession`\> -the new payment session created. +-`Promise`: the new payment session created. + -`PaymentSession`: #### Defined in -[medusa/src/services/payment-collection.ts:406](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L406) +[medusa/src/services/payment-collection.ts:406](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L406) ___ ### retrieve -▸ **retrieve**(`paymentCollectionId`, `config?`): `Promise`<`PaymentCollection`\> +**retrieve**(`paymentCollectionId`, `config?`): `Promise`<`PaymentCollection`\> Retrieves a payment collection by id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `paymentCollectionId` | `string` | the id of the payment collection | | `config` | `FindConfig`<`PaymentCollection`\> | the config to retrieve the payment collection | @@ -376,24 +383,25 @@ Retrieves a payment collection by id. `Promise`<`PaymentCollection`\> -the payment collection. +-`Promise`: the payment collection. + -`PaymentCollection`: #### Defined in -[medusa/src/services/payment-collection.ts:67](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L67) +[medusa/src/services/payment-collection.ts:67](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L67) ___ ### setPaymentSession -▸ **setPaymentSession**(`paymentCollectionId`, `sessionInput`, `customerId`): `Promise`<`PaymentCollection`\> +**setPaymentSession**(`paymentCollectionId`, `sessionInput`, `customerId`): `Promise`<`PaymentCollection`\> Manages a single payment sessions of a payment collection. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `paymentCollectionId` | `string` | the id of the payment collection | | `sessionInput` | `PaymentCollectionsSessionsInput` | object containing payment session info | | `customerId` | `string` | the id of the customer | @@ -402,24 +410,25 @@ Manages a single payment sessions of a payment collection. `Promise`<`PaymentCollection`\> -the payment collection and its payment session. +-`Promise`: the payment collection and its payment session. + -`PaymentCollection`: #### Defined in -[medusa/src/services/payment-collection.ts:360](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L360) +[medusa/src/services/payment-collection.ts:360](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L360) ___ ### setPaymentSessionsBatch -▸ **setPaymentSessionsBatch**(`paymentCollectionOrId`, `sessionsInput`, `customerId`): `Promise`<`PaymentCollection`\> +**setPaymentSessionsBatch**(`paymentCollectionOrId`, `sessionsInput`, `customerId`): `Promise`<`PaymentCollection`\> Manages multiple payment sessions of a payment collection. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `paymentCollectionOrId` | `string` \| `PaymentCollection` | the id of the payment collection | | `sessionsInput` | `PaymentCollectionsSessionsBatchInput`[] | array containing payment session info | | `customerId` | `string` | the id of the customer | @@ -428,48 +437,51 @@ Manages multiple payment sessions of a payment collection. `Promise`<`PaymentCollection`\> -the payment collection and its payment sessions. +-`Promise`: the payment collection and its payment sessions. + -`PaymentCollection`: #### Defined in -[medusa/src/services/payment-collection.ts:225](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L225) +[medusa/src/services/payment-collection.ts:225](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L225) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`paymentCollectionId`, `data`): `Promise`<`PaymentCollection`\> +**update**(`paymentCollectionId`, `data`): `Promise`<`PaymentCollection`\> Updates a payment collection. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `paymentCollectionId` | `string` | the id of the payment collection to update | | `data` | `DeepPartial`<`PaymentCollection`\> | info to be updated | @@ -477,32 +489,35 @@ Updates a payment collection. `Promise`<`PaymentCollection`\> -the payment collection updated. +-`Promise`: the payment collection updated. + -`PaymentCollection`: #### Defined in -[medusa/src/services/payment-collection.ts:138](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-collection.ts#L138) +[medusa/src/services/payment-collection.ts:138](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-collection.ts#L138) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`PaymentCollectionService`](PaymentCollectionService.md) +**withTransaction**(`transactionManager?`): [`PaymentCollectionService`](PaymentCollectionService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`PaymentCollectionService`](PaymentCollectionService.md) +-`default`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/PaymentProviderService.md b/www/apps/docs/content/references/services/classes/PaymentProviderService.md index 280e2b17c162d..8626a53aabcd8 100644 --- a/www/apps/docs/content/references/services/classes/PaymentProviderService.md +++ b/www/apps/docs/content/references/services/classes/PaymentProviderService.md @@ -1,4 +1,4 @@ -# Class: PaymentProviderService +# PaymentProviderService Helps retrieve payment providers @@ -12,12 +12,12 @@ Helps retrieve payment providers ### constructor -• **new PaymentProviderService**(`container`) +**new PaymentProviderService**(`container`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `container` | `InjectedDependencies` | #### Overrides @@ -26,13 +26,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/payment-provider.ts:70](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L70) +[medusa/src/services/payment-provider.ts:70](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L70) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -68,53 +68,53 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### container\_ -• `Protected` `Readonly` **container\_**: `InjectedDependencies` + `Protected` `Readonly` **container\_**: `InjectedDependencies` #### Defined in -[medusa/src/services/payment-provider.ts:55](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L55) +[medusa/src/services/payment-provider.ts:55](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L55) ___ ### customerService\_ -• `Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md) + `Protected` `Readonly` **customerService\_**: [`CustomerService`](CustomerService.md) #### Defined in -[medusa/src/services/payment-provider.ts:65](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L65) +[medusa/src/services/payment-provider.ts:65](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L65) ___ ### featureFlagRouter\_ -• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` + `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` #### Defined in -[medusa/src/services/payment-provider.ts:68](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L68) +[medusa/src/services/payment-provider.ts:68](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L68) ___ ### logger\_ -• `Protected` `Readonly` **logger\_**: `Logger` + `Protected` `Readonly` **logger\_**: `Logger` #### Defined in -[medusa/src/services/payment-provider.ts:66](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L66) +[medusa/src/services/payment-provider.ts:66](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L66) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -122,53 +122,53 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### paymentProviderRepository\_ -• `Protected` `Readonly` **paymentProviderRepository\_**: `Repository`<`PaymentProvider`\> + `Protected` `Readonly` **paymentProviderRepository\_**: `Repository`<`PaymentProvider`\> #### Defined in -[medusa/src/services/payment-provider.ts:58](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L58) +[medusa/src/services/payment-provider.ts:58](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L58) ___ ### paymentRepository\_ -• `Protected` `Readonly` **paymentRepository\_**: `Repository`<`Payment`\> + `Protected` `Readonly` **paymentRepository\_**: `Repository`<`Payment`\> #### Defined in -[medusa/src/services/payment-provider.ts:59](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L59) +[medusa/src/services/payment-provider.ts:59](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L59) ___ ### paymentSessionRepository\_ -• `Protected` `Readonly` **paymentSessionRepository\_**: `Repository`<`PaymentSession`\> + `Protected` `Readonly` **paymentSessionRepository\_**: `Repository`<`PaymentSession`\> #### Defined in -[medusa/src/services/payment-provider.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L56) +[medusa/src/services/payment-provider.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L56) ___ ### refundRepository\_ -• `Protected` `Readonly` **refundRepository\_**: `Repository`<`Refund`\> + `Protected` `Readonly` **refundRepository\_**: `Repository`<`Refund`\> #### Defined in -[medusa/src/services/payment-provider.ts:64](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L64) +[medusa/src/services/payment-provider.ts:64](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L64) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -176,61 +176,63 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ___ ### paymentService\_ -• `Protected` `get` **paymentService_**(): [`PaymentService`](PaymentService.md) +`Protected` `get` **paymentService_**(): [`PaymentService`](PaymentService.md) #### Returns [`PaymentService`](PaymentService.md) +-`default`: + #### Defined in -[medusa/src/services/payment-provider.ts:60](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L60) +[medusa/src/services/payment-provider.ts:60](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L60) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -239,7 +241,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -247,121 +249,135 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### authorizePayment -▸ **authorizePayment**(`paymentSession`, `context`): `Promise`<`undefined` \| `PaymentSession`\> +**authorizePayment**(`paymentSession`, `context`): `Promise`<`undefined` \| `PaymentSession`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `paymentSession` | `PaymentSession` | -| `context` | `Record`<`string`, `unknown`\> | +| `context` | Record<`string`, `unknown`\> | #### Returns `Promise`<`undefined` \| `PaymentSession`\> +-`Promise`: + -`undefined \| PaymentSession`: (optional) + #### Defined in -[medusa/src/services/payment-provider.ts:523](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L523) +[medusa/src/services/payment-provider.ts:523](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L523) ___ ### buildPaymentProcessorContext -▸ `Protected` **buildPaymentProcessorContext**(`cartOrData`): `Cart` & `PaymentContext` +`Protected` **buildPaymentProcessorContext**(`cartOrData`): `Cart` & `PaymentContext` Build the create session context for both legacy and new API #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `cartOrData` | `Cart` \| `PaymentSessionInput` | #### Returns `Cart` & `PaymentContext` +-``Cart` & `PaymentContext``: (optional) + #### Defined in -[medusa/src/services/payment-provider.ts:845](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L845) +[medusa/src/services/payment-provider.ts:845](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L845) ___ ### cancelPayment -▸ **cancelPayment**(`paymentObj`): `Promise`<`Payment`\> +**cancelPayment**(`paymentObj`): `Promise`<`Payment`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `paymentObj` | `Partial`<`Payment`\> & { `id`: `string` } | #### Returns `Promise`<`Payment`\> +-`Promise`: + -`Payment`: + #### Defined in -[medusa/src/services/payment-provider.ts:602](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L602) +[medusa/src/services/payment-provider.ts:602](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L602) ___ ### capturePayment -▸ **capturePayment**(`paymentObj`): `Promise`<`Payment`\> +**capturePayment**(`paymentObj`): `Promise`<`Payment`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `paymentObj` | `Partial`<`Payment`\> & { `id`: `string` } | #### Returns `Promise`<`Payment`\> +-`Promise`: + -`Payment`: + #### Defined in -[medusa/src/services/payment-provider.ts:641](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L641) +[medusa/src/services/payment-provider.ts:641](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L641) ___ ### createPayment -▸ **createPayment**(`data`): `Promise`<`Payment`\> +**createPayment**(`data`): `Promise`<`Payment`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `data` | `CreatePaymentInput` | #### Returns `Promise`<`Payment`\> +-`Promise`: + -`Payment`: + #### Defined in -[medusa/src/services/payment-provider.ts:471](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L471) +[medusa/src/services/payment-provider.ts:471](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L471) ___ ### createSession -▸ **createSession**(`providerId`, `cart`): `Promise`<`PaymentSession`\> +**createSession**(`providerId`, `cart`): `Promise`<`PaymentSession`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `providerId` | `string` | | `cart` | `Cart` | @@ -369,96 +385,111 @@ ___ `Promise`<`PaymentSession`\> -**`Deprecated`** +-`Promise`: + -`PaymentSession`: + +**Deprecated** #### Defined in -[medusa/src/services/payment-provider.ts:205](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L205) +[medusa/src/services/payment-provider.ts:205](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L205) -▸ **createSession**(`sessionInput`): `Promise`<`PaymentSession`\> +**createSession**(`sessionInput`): `Promise`<`PaymentSession`\> Creates a payment session with the given provider. #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `sessionInput` | `PaymentSessionInput` | #### Returns `Promise`<`PaymentSession`\> +-`Promise`: + -`PaymentSession`: + #### Defined in -[medusa/src/services/payment-provider.ts:211](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L211) +[medusa/src/services/payment-provider.ts:211](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L211) ___ ### deleteSession -▸ **deleteSession**(`paymentSession`): `Promise`<`undefined` \| `PaymentSession`\> +**deleteSession**(`paymentSession`): `Promise`<`undefined` \| `PaymentSession`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `paymentSession` | `PaymentSession` | #### Returns `Promise`<`undefined` \| `PaymentSession`\> +-`Promise`: + -`undefined \| PaymentSession`: (optional) + #### Defined in -[medusa/src/services/payment-provider.ts:402](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L402) +[medusa/src/services/payment-provider.ts:402](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L402) ___ ### getStatus -▸ **getStatus**(`payment`): `Promise`<`PaymentSessionStatus`\> +**getStatus**(`payment`): `Promise`<`PaymentSessionStatus`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `payment` | `Payment` | #### Returns `Promise`<`PaymentSessionStatus`\> +-`Promise`: + #### Defined in -[medusa/src/services/payment-provider.ts:630](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L630) +[medusa/src/services/payment-provider.ts:630](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L630) ___ ### list -▸ **list**(): `Promise`<`PaymentProvider`[]\> +**list**(): `Promise`<`PaymentProvider`[]\> #### Returns `Promise`<`PaymentProvider`[]\> +-`Promise`: + -`PaymentProvider[]`: + -`PaymentProvider`: + #### Defined in -[medusa/src/services/payment-provider.ts:102](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L102) +[medusa/src/services/payment-provider.ts:102](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L102) ___ ### listPayments -▸ **listPayments**(`selector`, `config?`): `Promise`<`Payment`[]\> +**listPayments**(`selector`, `config?`): `Promise`<`Payment`[]\> List all the payments according to the given selector and config. #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `selector` | `Selector`<`Payment`\> | | `config` | `FindConfig`<`Payment`\> | @@ -466,74 +497,81 @@ List all the payments according to the given selector and config. `Promise`<`Payment`[]\> +-`Promise`: + -`Payment[]`: + -`Payment`: + #### Defined in -[medusa/src/services/payment-provider.ts:154](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L154) +[medusa/src/services/payment-provider.ts:154](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L154) ___ ### processUpdateRequestsData -▸ `Protected` **processUpdateRequestsData**(`data?`, `paymentResponse`): `Promise`<`void`\> +`Protected` **processUpdateRequestsData**(`data?`, `paymentResponse`): `Promise`<`void`\> Process the collected data. Can be used every time we need to process some collected data returned by the provider #### Parameters -| Name | Type | -| :------ | :------ | -| `data` | `Object` | -| `data.customer?` | `Object` | +| Name | +| :------ | +| `data` | `object` | +| `data.customer?` | `object` | | `data.customer.id?` | `string` | -| `paymentResponse` | `Record`<`string`, `unknown`\> \| `PaymentSessionResponse` | +| `paymentResponse` | Record<`string`, `unknown`\> \| `PaymentSessionResponse` | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/payment-provider.ts:935](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L935) +[medusa/src/services/payment-provider.ts:935](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L935) ___ ### refreshSession -▸ **refreshSession**(`paymentSession`, `sessionInput`): `Promise`<`PaymentSession`\> +**refreshSession**(`paymentSession`, `sessionInput`): `Promise`<`PaymentSession`\> Refreshes a payment session with the given provider. This means, that we delete the current one and create a new. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `paymentSession` | `Object` | the payment session object to update | -| `paymentSession.data` | `Record`<`string`, `unknown`\> | - | -| `paymentSession.id` | `string` | - | -| `paymentSession.provider_id` | `string` | - | -| `sessionInput` | `PaymentSessionInput` | | +| Name | Description | +| :------ | :------ | +| `paymentSession` | `object` | the payment session object to update | +| `paymentSession.data` | Record<`string`, `unknown`\> | +| `paymentSession.id` | `string` | +| `paymentSession.provider_id` | `string` | +| `sessionInput` | `PaymentSessionInput` | #### Returns `Promise`<`PaymentSession`\> -the payment session +-`Promise`: the payment session + -`PaymentSession`: #### Defined in -[medusa/src/services/payment-provider.ts:301](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L301) +[medusa/src/services/payment-provider.ts:301](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L301) ___ ### refundFromPayment -▸ **refundFromPayment**(`payment`, `amount`, `reason`, `note?`): `Promise`<`Refund`\> +**refundFromPayment**(`payment`, `amount`, `reason`, `note?`): `Promise`<`Refund`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `payment` | `Payment` | | `amount` | `number` | | `reason` | `string` | @@ -543,20 +581,23 @@ ___ `Promise`<`Refund`\> +-`Promise`: + -`Refund`: + #### Defined in -[medusa/src/services/payment-provider.ts:771](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L771) +[medusa/src/services/payment-provider.ts:771](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L771) ___ ### refundPayment -▸ **refundPayment**(`payObjs`, `amount`, `reason`, `note?`): `Promise`<`Refund`\> +**refundPayment**(`payObjs`, `amount`, `reason`, `note?`): `Promise`<`Refund`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `payObjs` | `Payment`[] | | `amount` | `number` | | `reason` | `string` | @@ -566,93 +607,99 @@ ___ `Promise`<`Refund`\> +-`Promise`: + -`Refund`: + #### Defined in -[medusa/src/services/payment-provider.ts:672](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L672) +[medusa/src/services/payment-provider.ts:672](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L672) ___ ### registerInstalledProviders -▸ **registerInstalledProviders**(`providerIds`): `Promise`<`void`\> +**registerInstalledProviders**(`providerIds`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `providerIds` | `string`[] | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/payment-provider.ts:83](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L83) +[medusa/src/services/payment-provider.ts:83](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L83) ___ ### retrievePayment -▸ **retrievePayment**(`paymentId`, `relations?`): `Promise`<`Payment`\> +**retrievePayment**(`paymentId`, `relations?`): `Promise`<`Payment`\> Retrieve a payment entity with the given id. #### Parameters -| Name | Type | Default value | -| :------ | :------ | :------ | -| `paymentId` | `string` | `undefined` | +| Name | Default value | +| :------ | :------ | +| `paymentId` | `string` | | `relations` | `string`[] | `[]` | #### Returns `Promise`<`Payment`\> +-`Promise`: + -`Payment`: + #### Defined in -[medusa/src/services/payment-provider.ts:114](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L114) +[medusa/src/services/payment-provider.ts:114](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L114) ___ ### retrieveProvider -▸ **retrieveProvider**<`TProvider`\>(`providerId`): `TProvider` extends `AbstractPaymentService` ? `AbstractPaymentService` : `TProvider` extends `AbstractPaymentProcessor` ? `AbstractPaymentProcessor` : `any` +**retrieveProvider**<`TProvider`\>(`providerId`): `TProvider` extends `AbstractPaymentService` ? `AbstractPaymentService` : `TProvider` extends `AbstractPaymentProcessor` ? `AbstractPaymentProcessor` : `any` Finds a provider given an id -#### Type parameters - | Name | Type | | :------ | :------ | -| `TProvider` | extends `unknown` | +| `TProvider` | `unknown` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `providerId` | `string` | the id of the provider to get | #### Returns `TProvider` extends `AbstractPaymentService` ? `AbstractPaymentService` : `TProvider` extends `AbstractPaymentProcessor` ? `AbstractPaymentProcessor` : `any` -the payment provider +-``TProvider` extends `AbstractPaymentService` ? `AbstractPaymentService` : `TProvider` extends `AbstractPaymentProcessor` ? `AbstractPaymentProcessor` : `any``: (optional) the payment provider #### Defined in -[medusa/src/services/payment-provider.ts:442](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L442) +[medusa/src/services/payment-provider.ts:442](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L442) ___ ### retrieveRefund -▸ **retrieveRefund**(`id`, `config?`): `Promise`<`Refund`\> +**retrieveRefund**(`id`, `config?`): `Promise`<`Refund`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `id` | `string` | | `config` | `FindConfig`<`Refund`\> | @@ -660,119 +707,132 @@ ___ `Promise`<`Refund`\> +-`Promise`: + -`Refund`: + #### Defined in -[medusa/src/services/payment-provider.ts:822](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L822) +[medusa/src/services/payment-provider.ts:822](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L822) ___ ### retrieveSession -▸ **retrieveSession**(`paymentSessionId`, `relations?`): `Promise`<`PaymentSession`\> +**retrieveSession**(`paymentSessionId`, `relations?`): `Promise`<`PaymentSession`\> Return the payment session for the given id. #### Parameters -| Name | Type | Default value | -| :------ | :------ | :------ | -| `paymentSessionId` | `string` | `undefined` | +| Name | Default value | +| :------ | :------ | +| `paymentSessionId` | `string` | | `relations` | `string`[] | `[]` | #### Returns `Promise`<`PaymentSession`\> +-`Promise`: + -`PaymentSession`: + #### Defined in -[medusa/src/services/payment-provider.ts:172](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L172) +[medusa/src/services/payment-provider.ts:172](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L172) ___ ### saveSession -▸ `Protected` **saveSession**(`providerId`, `data`): `Promise`<`PaymentSession`\> +`Protected` **saveSession**(`providerId`, `data`): `Promise`<`PaymentSession`\> Create or update a Payment session data. #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `providerId` | `string` | -| `data` | `Object` | +| `data` | `object` | | `data.amount?` | `number` | | `data.cartId?` | `string` | | `data.isInitiated?` | `boolean` | | `data.isSelected?` | `boolean` | | `data.payment_session_id?` | `string` | -| `data.sessionData` | `Record`<`string`, `unknown`\> | +| `data.sessionData` | Record<`string`, `unknown`\> | | `data.status?` | `PaymentSessionStatus` | #### Returns `Promise`<`PaymentSession`\> +-`Promise`: + -`PaymentSession`: + #### Defined in -[medusa/src/services/payment-provider.ts:887](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L887) +[medusa/src/services/payment-provider.ts:887](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L887) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### throwFromPaymentProcessorError -▸ `Private` **throwFromPaymentProcessorError**(`errObj`): `void` +`Private` **throwFromPaymentProcessorError**(`errObj`): `void` #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `errObj` | `PaymentProcessorError` | #### Returns `void` +-`void`: (optional) + #### Defined in -[medusa/src/services/payment-provider.ts:954](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L954) +[medusa/src/services/payment-provider.ts:954](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L954) ___ ### updatePayment -▸ **updatePayment**(`paymentId`, `data`): `Promise`<`Payment`\> +**updatePayment**(`paymentId`, `data`): `Promise`<`Payment`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `paymentId` | `string` | -| `data` | `Object` | +| `data` | `object` | | `data.order_id?` | `string` | | `data.swap_id?` | `string` | @@ -780,79 +840,88 @@ ___ `Promise`<`Payment`\> +-`Promise`: + -`Payment`: + #### Defined in -[medusa/src/services/payment-provider.ts:512](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L512) +[medusa/src/services/payment-provider.ts:512](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L512) ___ ### updateSession -▸ **updateSession**(`paymentSession`, `sessionInput`): `Promise`<`PaymentSession`\> +**updateSession**(`paymentSession`, `sessionInput`): `Promise`<`PaymentSession`\> Update a payment session with the given provider. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `paymentSession` | `Object` | The paymentSession to update | -| `paymentSession.data` | `Record`<`string`, `unknown`\> | - | -| `paymentSession.id` | `string` | - | -| `paymentSession.provider_id` | `string` | - | -| `sessionInput` | `Cart` \| `PaymentSessionInput` | | +| Name | Description | +| :------ | :------ | +| `paymentSession` | `object` | The paymentSession to update | +| `paymentSession.data` | Record<`string`, `unknown`\> | +| `paymentSession.id` | `string` | +| `paymentSession.provider_id` | `string` | +| `sessionInput` | `Cart` \| `PaymentSessionInput` | #### Returns `Promise`<`PaymentSession`\> -the payment session +-`Promise`: the payment session + -`PaymentSession`: #### Defined in -[medusa/src/services/payment-provider.ts:342](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L342) +[medusa/src/services/payment-provider.ts:342](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L342) ___ ### updateSessionData -▸ **updateSessionData**(`paymentSession`, `data`): `Promise`<`PaymentSession`\> +**updateSessionData**(`paymentSession`, `data`): `Promise`<`PaymentSession`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `paymentSession` | `PaymentSession` | -| `data` | `Record`<`string`, `unknown`\> | +| `data` | Record<`string`, `unknown`\> | #### Returns `Promise`<`PaymentSession`\> +-`Promise`: + -`PaymentSession`: + #### Defined in -[medusa/src/services/payment-provider.ts:569](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment-provider.ts#L569) +[medusa/src/services/payment-provider.ts:569](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment-provider.ts#L569) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`PaymentProviderService`](PaymentProviderService.md) +**withTransaction**(`transactionManager?`): [`PaymentProviderService`](PaymentProviderService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`PaymentProviderService`](PaymentProviderService.md) +-`default`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/PaymentService.md b/www/apps/docs/content/references/services/classes/PaymentService.md index a482c7efe552a..2d41005e8222a 100644 --- a/www/apps/docs/content/references/services/classes/PaymentService.md +++ b/www/apps/docs/content/references/services/classes/PaymentService.md @@ -1,4 +1,4 @@ -# Class: PaymentService +# PaymentService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new PaymentService**(`«destructured»`) +**new PaymentService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/payment.ts:39](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment.ts#L39) +[medusa/src/services/payment.ts:39](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment.ts#L39) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,23 +66,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### eventBusService\_ -• `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/payment.ts:27](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment.ts#L27) +[medusa/src/services/payment.ts:27](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment.ts#L27) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -90,33 +90,33 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### paymentProviderService\_ -• `Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md) + `Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md) #### Defined in -[medusa/src/services/payment.ts:28](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment.ts#L28) +[medusa/src/services/payment.ts:28](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment.ts#L28) ___ ### paymentRepository\_ -• `Protected` `Readonly` **paymentRepository\_**: `Repository`<`Payment`\> + `Protected` `Readonly` **paymentRepository\_**: `Repository`<`Payment`\> #### Defined in -[medusa/src/services/payment.ts:29](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment.ts#L29) +[medusa/src/services/payment.ts:29](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment.ts#L29) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -124,13 +124,13 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### Events -▪ `Static` `Readonly` **Events**: `Object` + `Static` `Readonly` **Events**: `Object` #### Type declaration @@ -145,47 +145,47 @@ ___ #### Defined in -[medusa/src/services/payment.ts:30](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment.ts#L30) +[medusa/src/services/payment.ts:30](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment.ts#L30) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -194,7 +194,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -202,68 +202,70 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### capture -▸ **capture**(`paymentOrId`): `Promise`<`Payment`\> +**capture**(`paymentOrId`): `Promise`<`Payment`\> Captures a payment. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `paymentOrId` | `string` \| `Payment` | the id or the class instance of the payment | #### Returns `Promise`<`Payment`\> -the payment captured. +-`Promise`: the payment captured. + -`Payment`: #### Defined in -[medusa/src/services/payment.ts:153](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment.ts#L153) +[medusa/src/services/payment.ts:153](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment.ts#L153) ___ ### create -▸ **create**(`paymentInput`): `Promise`<`Payment`\> +**create**(`paymentInput`): `Promise`<`Payment`\> Created a new payment. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `paymentInput` | `PaymentDataInput` | info to create the payment | #### Returns `Promise`<`Payment`\> -the payment created. +-`Promise`: the payment created. + -`Payment`: #### Defined in -[medusa/src/services/payment.ts:92](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment.ts#L92) +[medusa/src/services/payment.ts:92](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment.ts#L92) ___ ### refund -▸ **refund**(`paymentOrId`, `amount`, `reason`, `note?`): `Promise`<`Refund`\> +**refund**(`paymentOrId`, `amount`, `reason`, `note?`): `Promise`<`Refund`\> refunds a payment. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `paymentOrId` | `string` \| `Payment` | the id or the class instance of the payment | | `amount` | `number` | the amount to be refunded from the payment | | `reason` | `string` | the refund reason | @@ -273,24 +275,25 @@ refunds a payment. `Promise`<`Refund`\> -the refund created. +-`Promise`: the refund created. + -`Refund`: #### Defined in -[medusa/src/services/payment.ts:202](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment.ts#L202) +[medusa/src/services/payment.ts:202](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment.ts#L202) ___ ### retrieve -▸ **retrieve**(`paymentId`, `config?`): `Promise`<`Payment`\> +**retrieve**(`paymentId`, `config?`): `Promise`<`Payment`\> Retrieves a payment by id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `paymentId` | `string` | the id of the payment | | `config` | `FindConfig`<`Payment`\> | the config to retrieve the payment | @@ -298,83 +301,89 @@ Retrieves a payment by id. `Promise`<`Payment`\> -the payment. +-`Promise`: the payment. + -`Payment`: #### Defined in -[medusa/src/services/payment.ts:58](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment.ts#L58) +[medusa/src/services/payment.ts:58](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment.ts#L58) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`paymentId`, `data`): `Promise`<`Payment`\> +**update**(`paymentId`, `data`): `Promise`<`Payment`\> Updates a payment in order to link it to an order or a swap. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `paymentId` | `string` | the id of the payment | -| `data` | `Object` | order_id or swap_id to link the payment | -| `data.order_id?` | `string` | - | -| `data.swap_id?` | `string` | - | +| `data` | `object` | order_id or swap_id to link the payment | +| `data.order_id?` | `string` | +| `data.swap_id?` | `string` | #### Returns `Promise`<`Payment`\> -the payment updated. +-`Promise`: the payment updated. + -`Payment`: #### Defined in -[medusa/src/services/payment.ts:121](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/payment.ts#L121) +[medusa/src/services/payment.ts:121](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/payment.ts#L121) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`PaymentService`](PaymentService.md) +**withTransaction**(`transactionManager?`): [`PaymentService`](PaymentService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`PaymentService`](PaymentService.md) +-`default`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/PriceListService.md b/www/apps/docs/content/references/services/classes/PriceListService.md index ae5ee51865566..dcdedcc6e413e 100644 --- a/www/apps/docs/content/references/services/classes/PriceListService.md +++ b/www/apps/docs/content/references/services/classes/PriceListService.md @@ -1,4 +1,4 @@ -# Class: PriceListService +# PriceListService Provides layer to manipulate product tags. @@ -12,12 +12,12 @@ Provides layer to manipulate product tags. ### constructor -• **new PriceListService**(`«destructured»`) +**new PriceListService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `PriceListConstructorProps` | #### Overrides @@ -26,13 +26,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/price-list.ts:52](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L52) +[medusa/src/services/price-list.ts:52](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L52) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -68,33 +68,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### customerGroupService\_ -• `Protected` `Readonly` **customerGroupService\_**: [`CustomerGroupService`](CustomerGroupService.md) + `Protected` `Readonly` **customerGroupService\_**: [`CustomerGroupService`](CustomerGroupService.md) #### Defined in -[medusa/src/services/price-list.ts:43](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L43) +[medusa/src/services/price-list.ts:43](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L43) ___ ### featureFlagRouter\_ -• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` + `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` #### Defined in -[medusa/src/services/price-list.ts:50](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L50) +[medusa/src/services/price-list.ts:50](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L50) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -102,63 +102,63 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### moneyAmountRepo\_ -• `Protected` `Readonly` **moneyAmountRepo\_**: `Repository`<`MoneyAmount`\> & { `addPriceListPrices`: (`priceListId`: `string`, `prices`: `PriceListPriceCreateInput`[], `overrideExisting`: `boolean`) => `Promise`<`MoneyAmount`[]\> ; `createProductVariantMoneyAmounts`: (`toCreate`: { `money_amount_id`: `string` ; `variant_id`: `string` }[]) => `Promise`<`InsertResult`\> ; `deletePriceListPrices`: (`priceListId`: `string`, `moneyAmountIds`: `string`[]) => `Promise`<`void`\> ; `deleteVariantPricesNotIn`: (`variantIdOrData`: `string` \| { `prices`: `ProductVariantPrice`[] ; `variantId`: `string` }[], `prices?`: `Price`[]) => `Promise`<`void`\> ; `findCurrencyMoneyAmounts`: (`where`: { `currency_code`: `string` ; `variant_id`: `string` }[]) => `Promise`<{ `amount`: `number` ; `created_at`: `Date` ; `currency?`: `Currency` ; `currency_code`: `string` ; `deleted_at`: ``null`` \| `Date` ; `id`: `string` ; `max_quantity`: ``null`` \| `number` ; `min_quantity`: ``null`` \| `number` ; `price_list`: ``null`` \| `PriceList` ; `price_list_id`: ``null`` \| `string` ; `region?`: `Region` ; `region_id`: `string` ; `updated_at`: `Date` ; `variant`: `ProductVariant` ; `variant_id`: `any` ; `variants`: `ProductVariant`[] }[]\> ; `findManyForVariantInPriceList`: (`variant_id`: `string`, `price_list_id`: `string`, `requiresPriceList`: `boolean`) => `Promise`<[`MoneyAmount`[], `number`]\> ; `findManyForVariantInRegion`: (`variant_id`: `string`, `region_id?`: `string`, `currency_code?`: `string`, `customer_id?`: `string`, `include_discount_prices?`: `boolean`, `include_tax_inclusive_pricing`: `boolean`) => `Promise`<[`MoneyAmount`[], `number`]\> ; `findManyForVariantsInRegion`: (`variant_ids`: `string` \| `string`[], `region_id?`: `string`, `currency_code?`: `string`, `customer_id?`: `string`, `include_discount_prices?`: `boolean`, `include_tax_inclusive_pricing`: `boolean`) => `Promise`<[`Record`<`string`, `MoneyAmount`[]\>, `number`]\> ; `findRegionMoneyAmounts`: (`where`: { `region_id`: `string` ; `variant_id`: `string` }[]) => `Promise`<{ `amount`: `number` ; `created_at`: `Date` ; `currency?`: `Currency` ; `currency_code`: `string` ; `deleted_at`: ``null`` \| `Date` ; `id`: `string` ; `max_quantity`: ``null`` \| `number` ; `min_quantity`: ``null`` \| `number` ; `price_list`: ``null`` \| `PriceList` ; `price_list_id`: ``null`` \| `string` ; `region?`: `Region` ; `region_id`: `string` ; `updated_at`: `Date` ; `variant`: `ProductVariant` ; `variant_id`: `any` ; `variants`: `ProductVariant`[] }[]\> ; `findVariantPricesNotIn`: (`variantId`: `string`, `prices`: `Price`[]) => `Promise`<`MoneyAmount`[]\> ; `getPricesForVariantInRegion`: (`variantId`: `string`, `regionId`: `undefined` \| `string`) => `Promise`<`MoneyAmount`[]\> ; `insertBulk`: (`data`: `_QueryDeepPartialEntity`<`MoneyAmount`\>[]) => `Promise`<`MoneyAmount`[]\> ; `updatePriceListPrices`: (`priceListId`: `string`, `updates`: `PriceListPriceUpdateInput`[]) => `Promise`<`MoneyAmount`[]\> ; `upsertVariantCurrencyPrice`: (`variantId`: `string`, `price`: `Price`) => `Promise`<`MoneyAmount`\> } + `Protected` `Readonly` **moneyAmountRepo\_**: `Repository`<`MoneyAmount`\> & { `addPriceListPrices`: Method addPriceListPrices ; `createProductVariantMoneyAmounts`: Method createProductVariantMoneyAmounts ; `deletePriceListPrices`: Method deletePriceListPrices ; `deleteVariantPricesNotIn`: Method deleteVariantPricesNotIn ; `findCurrencyMoneyAmounts`: Method findCurrencyMoneyAmounts ; `findManyForVariantInPriceList`: Method findManyForVariantInPriceList ; `findManyForVariantInRegion`: Method findManyForVariantInRegion ; `findManyForVariantsInRegion`: Method findManyForVariantsInRegion ; `findRegionMoneyAmounts`: Method findRegionMoneyAmounts ; `findVariantPricesNotIn`: Method findVariantPricesNotIn ; `getPricesForVariantInRegion`: Method getPricesForVariantInRegion ; `insertBulk`: Method insertBulk ; `updatePriceListPrices`: Method updatePriceListPrices ; `upsertVariantCurrencyPrice`: Method upsertVariantCurrencyPrice } #### Defined in -[medusa/src/services/price-list.ts:48](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L48) +[medusa/src/services/price-list.ts:48](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L48) ___ ### priceListRepo\_ -• `Protected` `Readonly` **priceListRepo\_**: `Repository`<`PriceList`\> & { `listAndCount`: (`query`: `ExtendedFindConfig`<`PriceList`\>, `q?`: `string`) => `Promise`<[`PriceList`[], `number`]\> ; `listPriceListsVariantIdsMap`: (`priceListIds`: `string` \| `string`[]) => `Promise`<{ `[priceListId: string]`: `string`[]; }\> } + `Protected` `Readonly` **priceListRepo\_**: `Repository`<`PriceList`\> & { `listAndCount`: Method listAndCount ; `listPriceListsVariantIdsMap`: Method listPriceListsVariantIdsMap } #### Defined in -[medusa/src/services/price-list.ts:47](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L47) +[medusa/src/services/price-list.ts:47](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L47) ___ ### productService\_ -• `Protected` `Readonly` **productService\_**: [`ProductService`](ProductService.md) + `Protected` `Readonly` **productService\_**: [`ProductService`](ProductService.md) #### Defined in -[medusa/src/services/price-list.ts:45](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L45) +[medusa/src/services/price-list.ts:45](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L45) ___ ### productVariantRepo\_ -• `Protected` `Readonly` **productVariantRepo\_**: `Repository`<`ProductVariant`\> + `Protected` `Readonly` **productVariantRepo\_**: `Repository`<`ProductVariant`\> #### Defined in -[medusa/src/services/price-list.ts:49](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L49) +[medusa/src/services/price-list.ts:49](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L49) ___ ### regionService\_ -• `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md) + `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md) #### Defined in -[medusa/src/services/price-list.ts:44](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L44) +[medusa/src/services/price-list.ts:44](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L44) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -166,113 +166,113 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### variantService\_ -• `Protected` `Readonly` **variantService\_**: [`ProductVariantService`](ProductVariantService.md) + `Protected` `Readonly` **variantService\_**: [`ProductVariantService`](ProductVariantService.md) #### Defined in -[medusa/src/services/price-list.ts:46](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L46) +[medusa/src/services/price-list.ts:46](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L46) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### addCurrencyFromRegion -▸ `Protected` **addCurrencyFromRegion**<`T`\>(`prices`): `Promise`<`T`[]\> +`Protected` **addCurrencyFromRegion**<`T`\>(`prices`): `Promise`<`T`[]\> Add `currency_code` to an MA record if `region_id`is passed. -#### Type parameters - | Name | Type | | :------ | :------ | -| `T` | extends `PriceListPriceUpdateInput` \| `PriceListPriceCreateInput` | +| `T` | `PriceListPriceUpdateInput` \| `PriceListPriceCreateInput` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `prices` | `T`[] | a list of PriceListPrice(Create/Update)Input records | #### Returns `Promise`<`T`[]\> -updated `prices` list +-`Promise`: updated `prices` list + -`T[]`: #### Defined in -[medusa/src/services/price-list.ts:524](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L524) +[medusa/src/services/price-list.ts:524](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L524) ___ ### addPrices -▸ **addPrices**(`id`, `prices`, `replace?`): `Promise`<`PriceList`\> +**addPrices**(`id`, `prices`, `replace?`): `Promise`<`PriceList`\> Adds prices to a price list in bulk, optionally replacing all existing prices #### Parameters -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `id` | `string` | `undefined` | id of the price list | -| `prices` | `PriceListPriceCreateInput`[] | `undefined` | prices to add | +| Name | Default value | Description | +| :------ | :------ | :------ | +| `id` | `string` | id of the price list | +| `prices` | `PriceListPriceCreateInput`[] | prices to add | | `replace` | `boolean` | `false` | whether to replace existing prices | #### Returns `Promise`<`PriceList`\> -updated Price List +-`Promise`: updated Price List + -`PriceList`: #### Defined in -[medusa/src/services/price-list.ts:242](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L242) +[medusa/src/services/price-list.ts:242](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L242) ___ ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -281,7 +281,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -289,93 +289,94 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### clearPrices -▸ **clearPrices**(`id`): `Promise`<`void`\> +**clearPrices**(`id`): `Promise`<`void`\> Removes all prices from a price list and deletes the removed prices in bulk #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `id` | `string` | id of the price list | #### Returns `Promise`<`void`\> -updated Price List +-`Promise`: updated Price List #### Defined in -[medusa/src/services/price-list.ts:282](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L282) +[medusa/src/services/price-list.ts:282](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L282) ___ ### create -▸ **create**(`priceListObject`): `Promise`<`PriceList`\> +**create**(`priceListObject`): `Promise`<`PriceList`\> Creates a Price List #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `priceListObject` | `CreatePriceListInput` | the Price List to create | #### Returns `Promise`<`PriceList`\> -created Price List +-`Promise`: created Price List + -`PriceList`: #### Defined in -[medusa/src/services/price-list.ts:143](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L143) +[medusa/src/services/price-list.ts:143](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L143) ___ ### delete -▸ **delete**(`id`): `Promise`<`void`\> +**delete**(`id`): `Promise`<`void`\> Deletes a Price List Will never fail due to delete being idempotent. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `id` | `string` | id of the price list | #### Returns `Promise`<`void`\> -empty promise +-`Promise`: empty promise #### Defined in -[medusa/src/services/price-list.ts:296](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L296) +[medusa/src/services/price-list.ts:296](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L296) ___ ### deletePrices -▸ **deletePrices**(`id`, `priceIds`): `Promise`<`void`\> +**deletePrices**(`id`, `priceIds`): `Promise`<`void`\> Removes prices from a price list and deletes the removed prices in bulk #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `id` | `string` | id of the price list | | `priceIds` | `string`[] | ids of the prices to delete | @@ -383,22 +384,22 @@ Removes prices from a price list and deletes the removed prices in bulk `Promise`<`void`\> -updated Price List +-`Promise`: updated Price List #### Defined in -[medusa/src/services/price-list.ts:267](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L267) +[medusa/src/services/price-list.ts:267](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L267) ___ ### deleteProductPrices -▸ **deleteProductPrices**(`priceListId`, `productIds`): `Promise`<[`string`[], `number`]\> +**deleteProductPrices**(`priceListId`, `productIds`): `Promise`<[`string`[], `number`]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `priceListId` | `string` | | `productIds` | `string`[] | @@ -406,20 +407,24 @@ ___ `Promise`<[`string`[], `number`]\> +-`Promise`: + -`string[]`: + -`number`: (optional) + #### Defined in -[medusa/src/services/price-list.ts:451](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L451) +[medusa/src/services/price-list.ts:451](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L451) ___ ### deleteVariantPrices -▸ **deleteVariantPrices**(`priceListId`, `variantIds`): `Promise`<[`string`[], `number`]\> +**deleteVariantPrices**(`priceListId`, `variantIds`): `Promise`<[`string`[], `number`]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `priceListId` | `string` | | `variantIds` | `string`[] | @@ -427,22 +432,26 @@ ___ `Promise`<[`string`[], `number`]\> +-`Promise`: + -`string[]`: + -`number`: (optional) + #### Defined in -[medusa/src/services/price-list.ts:488](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L488) +[medusa/src/services/price-list.ts:488](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L488) ___ ### list -▸ **list**(`selector?`, `config?`): `Promise`<`PriceList`[]\> +**list**(`selector?`, `config?`): `Promise`<`PriceList`[]\> Lists Price Lists #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `FilterablePriceListProps` | the query object for find | | `config` | `FindConfig`<`PriceList`\> | the config to be used for find | @@ -450,24 +459,26 @@ Lists Price Lists `Promise`<`PriceList`[]\> -the result of the find operation +-`Promise`: the result of the find operation + -`PriceList[]`: + -`PriceList`: #### Defined in -[medusa/src/services/price-list.ts:316](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L316) +[medusa/src/services/price-list.ts:316](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L316) ___ ### listAndCount -▸ **listAndCount**(`selector?`, `config?`): `Promise`<[`PriceList`[], `number`]\> +**listAndCount**(`selector?`, `config?`): `Promise`<[`PriceList`[], `number`]\> Lists Price Lists and adds count #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `FilterablePriceListProps` | the query object for find | | `config` | `FindConfig`<`PriceList`\> | the config to be used for find | @@ -475,90 +486,103 @@ Lists Price Lists and adds count `Promise`<[`PriceList`[], `number`]\> -the result of the find operation +-`Promise`: the result of the find operation + -`PriceList[]`: + -`number`: (optional) #### Defined in -[medusa/src/services/price-list.ts:330](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L330) +[medusa/src/services/price-list.ts:330](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L330) ___ ### listPriceListsVariantIdsMap -▸ **listPriceListsVariantIdsMap**(`priceListIds`): `Promise`<{ `[priceListId: string]`: `string`[]; }\> +**listPriceListsVariantIdsMap**(`priceListIds`): `Promise`<{ `[priceListId: string]`: `string`[]; }\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `priceListIds` | `string` \| `string`[] | #### Returns `Promise`<{ `[priceListId: string]`: `string`[]; }\> +-`Promise`: + -``object``: (optional) + #### Defined in -[medusa/src/services/price-list.ts:109](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L109) +[medusa/src/services/price-list.ts:109](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L109) ___ ### listProducts -▸ **listProducts**(`priceListId`, `selector?`, `config?`, `requiresPriceList?`): `Promise`<[`Product`[], `number`]\> +**listProducts**(`priceListId`, `selector?`, `config?`, `requiresPriceList?`): `Promise`<[`Product`[], `number`]\> #### Parameters -| Name | Type | Default value | -| :------ | :------ | :------ | -| `priceListId` | `string` | `undefined` | -| `selector` | `FilterableProductProps` \| `Selector`<`Product`\> | `{}` | -| `config` | `FindConfig`<`Product`\> | `undefined` | +| Name | Default value | +| :------ | :------ | +| `priceListId` | `string` | +| `selector` | `FilterableProductProps` \| `Selector`<`Product`\> | +| `config` | `FindConfig`<`Product`\> | | `requiresPriceList` | `boolean` | `false` | #### Returns `Promise`<[`Product`[], `number`]\> +-`Promise`: + -`Product[]`: + -`number`: (optional) + #### Defined in -[medusa/src/services/price-list.ts:367](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L367) +[medusa/src/services/price-list.ts:367](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L367) ___ ### listVariants -▸ **listVariants**(`priceListId`, `selector?`, `config?`, `requiresPriceList?`): `Promise`<[`ProductVariant`[], `number`]\> +**listVariants**(`priceListId`, `selector?`, `config?`, `requiresPriceList?`): `Promise`<[`ProductVariant`[], `number`]\> #### Parameters -| Name | Type | Default value | -| :------ | :------ | :------ | -| `priceListId` | `string` | `undefined` | -| `selector` | `FilterableProductVariantProps` | `{}` | -| `config` | `FindConfig`<`ProductVariant`\> | `undefined` | +| Name | Default value | +| :------ | :------ | +| `priceListId` | `string` | +| `selector` | `FilterableProductVariantProps` | +| `config` | `FindConfig`<`ProductVariant`\> | | `requiresPriceList` | `boolean` | `false` | #### Returns `Promise`<[`ProductVariant`[], `number`]\> +-`Promise`: + -`ProductVariant[]`: + -`number`: (optional) + #### Defined in -[medusa/src/services/price-list.ts:417](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L417) +[medusa/src/services/price-list.ts:417](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L417) ___ ### retrieve -▸ **retrieve**(`priceListId`, `config?`): `Promise`<`PriceList`\> +**retrieve**(`priceListId`, `config?`): `Promise`<`PriceList`\> Retrieves a product tag by id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `priceListId` | `string` | the id of the product tag to retrieve | | `config` | `FindConfig`<`PriceList`\> | the config to retrieve the tag by | @@ -566,48 +590,51 @@ Retrieves a product tag by id. `Promise`<`PriceList`\> -the collection. +-`Promise`: the collection. + -`PriceList`: #### Defined in -[medusa/src/services/price-list.ts:81](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L81) +[medusa/src/services/price-list.ts:81](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L81) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`id`, `update`): `Promise`<`PriceList`\> +**update**(`id`, `update`): `Promise`<`PriceList`\> Updates a Price List #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `id` | `string` | the id of the Product List to update | | `update` | `UpdatePriceListInput` | the update to apply | @@ -615,22 +642,23 @@ Updates a Price List `Promise`<`PriceList`\> -updated Price List +-`Promise`: updated Price List + -`PriceList`: #### Defined in -[medusa/src/services/price-list.ts:191](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L191) +[medusa/src/services/price-list.ts:191](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L191) ___ ### upsertCustomerGroups\_ -▸ `Protected` **upsertCustomerGroups_**(`priceListId`, `customerGroups`): `Promise`<`void`\> +`Protected` **upsertCustomerGroups_**(`priceListId`, `customerGroups`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `priceListId` | `string` | | `customerGroups` | { `id`: `string` }[] | @@ -638,30 +666,34 @@ ___ `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/price-list.ts:346](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/price-list.ts#L346) +[medusa/src/services/price-list.ts:346](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/price-list.ts#L346) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`PriceListService`](PriceListService.md) +**withTransaction**(`transactionManager?`): [`PriceListService`](PriceListService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`PriceListService`](PriceListService.md) +-`PriceListService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/PricingService.md b/www/apps/docs/content/references/services/classes/PricingService.md index 704dbf27df835..7dbe48ef570d8 100644 --- a/www/apps/docs/content/references/services/classes/PricingService.md +++ b/www/apps/docs/content/references/services/classes/PricingService.md @@ -1,4 +1,4 @@ -# Class: PricingService +# PricingService Allows retrieval of prices. @@ -12,12 +12,12 @@ Allows retrieval of prices. ### constructor -• **new PricingService**(`«destructured»`) +**new PricingService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -26,13 +26,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/pricing.ts:42](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L42) +[medusa/src/services/pricing.ts:62](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L62) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -68,23 +68,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### featureFlagRouter -• `Protected` `Readonly` **featureFlagRouter**: `FlagRouter` + `Protected` `Readonly` **featureFlagRouter**: `FlagRouter` #### Defined in -[medusa/src/services/pricing.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L40) +[medusa/src/services/pricing.ts:58](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L58) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -92,53 +92,73 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### priceSelectionStrategy -• `Protected` `Readonly` **priceSelectionStrategy**: `IPriceSelectionStrategy` + `Protected` `Readonly` **priceSelectionStrategy**: `IPriceSelectionStrategy` #### Defined in -[medusa/src/services/pricing.ts:38](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L38) +[medusa/src/services/pricing.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L56) + +___ + +### pricingModuleService + + `Protected` `Readonly` **pricingModuleService**: `IPricingModuleService` + +#### Defined in + +[medusa/src/services/pricing.ts:59](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L59) ___ ### productVariantService -• `Protected` `Readonly` **productVariantService**: [`ProductVariantService`](ProductVariantService.md) + `Protected` `Readonly` **productVariantService**: [`ProductVariantService`](ProductVariantService.md) #### Defined in -[medusa/src/services/pricing.ts:39](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L39) +[medusa/src/services/pricing.ts:57](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L57) ___ ### regionService -• `Protected` `Readonly` **regionService**: [`RegionService`](RegionService.md) + `Protected` `Readonly` **regionService**: [`RegionService`](RegionService.md) #### Defined in -[medusa/src/services/pricing.ts:36](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L36) +[medusa/src/services/pricing.ts:54](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L54) + +___ + +### remoteQuery + + `Protected` `Readonly` **remoteQuery**: `RemoteQueryFunction` + +#### Defined in + +[medusa/src/services/pricing.ts:60](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L60) ___ ### taxProviderService -• `Protected` `Readonly` **taxProviderService**: [`TaxProviderService`](TaxProviderService.md) + `Protected` `Readonly` **taxProviderService**: [`TaxProviderService`](TaxProviderService.md) #### Defined in -[medusa/src/services/pricing.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L37) +[medusa/src/services/pricing.ts:55](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L55) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -146,47 +166,47 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -195,7 +215,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -203,20 +223,20 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### calculateTaxes -▸ **calculateTaxes**(`variantPricing`, `productRates`): `TaxedPricing` +**calculateTaxes**(`variantPricing`, `productRates`): `TaxedPricing` Gets the prices for a product variant #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `variantPricing` | `ProductVariantPricing` | the prices retrieved from a variant | | `productRates` | `TaxServiceRate`[] | the tax rates that the product has applied | @@ -224,146 +244,178 @@ Gets the prices for a product variant `TaxedPricing` -The tax related variant prices. - #### Defined in -[medusa/src/services/pricing.ts:101](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L101) +[medusa/src/services/pricing.ts:125](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L125) ___ ### collectPricingContext -▸ **collectPricingContext**(`context`): `Promise`<`PricingContext`\> +**collectPricingContext**(`context`): `Promise`<`PricingContext`\> Collects additional information necessary for completing the price selection. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `context` | `PriceSelectionContext` | the price selection context to use | #### Returns `Promise`<`PricingContext`\> -The pricing context +-`Promise`: The pricing context + +#### Defined in + +[medusa/src/services/pricing.ts:89](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L89) + +___ + +### getPricingModuleVariantMoneyAmounts + +`Private` **getPricingModuleVariantMoneyAmounts**(`variantIds`): `Promise`<`Map`<`string`, `MoneyAmount`[]\>\> + +#### Parameters + +| Name | +| :------ | +| `variantIds` | `string`[] | + +#### Returns + +`Promise`<`Map`<`string`, `MoneyAmount`[]\>\> + +-`Promise`: + -`Map`: + -`string`: (optional) + -`MoneyAmount[]`: #### Defined in -[medusa/src/services/pricing.ts:65](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L65) +[medusa/src/services/pricing.ts:640](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L640) ___ ### getProductPricing -▸ **getProductPricing**(`product`, `context`): `Promise`<`Record`<`string`, `ProductVariantPricing`\>\> +**getProductPricing**(`product`, `context`): `Promise`\> Gets all the variant prices for a product. All the product's variants will be fetched. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `product` | `Pick`<`Product`, ``"id"`` \| ``"variants"``\> | the product to get pricing for. | | `context` | `PriceSelectionContext` | the price selection context to use | #### Returns -`Promise`<`Record`<`string`, `ProductVariantPricing`\>\> +`Promise`\> -A map of variant ids to their corresponding prices +-`Promise`: A map of variant ids to their corresponding prices + -`Record`: + -`string`: (optional) #### Defined in -[medusa/src/services/pricing.ts:419](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L419) +[medusa/src/services/pricing.ts:538](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L538) ___ ### getProductPricingById -▸ **getProductPricingById**(`productId`, `context`): `Promise`<`Record`<`string`, `ProductVariantPricing`\>\> +**getProductPricingById**(`productId`, `context`): `Promise`\> Gets all the variant prices for a product by the product id #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `productId` | `string` | the id of the product to get prices for | | `context` | `PriceSelectionContext` | the price selection context to use | #### Returns -`Promise`<`Record`<`string`, `ProductVariantPricing`\>\> +`Promise`\> -A map of variant ids to their corresponding prices +-`Promise`: A map of variant ids to their corresponding prices + -`Record`: + -`string`: (optional) #### Defined in -[medusa/src/services/pricing.ts:437](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L437) +[medusa/src/services/pricing.ts:556](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L556) ___ ### getProductPricing\_ -▸ `Private` **getProductPricing_**(`data`, `context`): `Promise`<`Map`<`string`, `Record`<`string`, `ProductVariantPricing`\>\>\> +`Private` **getProductPricing_**(`data`, `context`): `Promise`<`Map`<`string`, Record<`string`, `ProductVariantPricing`\>\>\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `data` | { `productId`: `string` ; `variants`: `ProductVariant`[] }[] | | `context` | `PricingContext` | #### Returns -`Promise`<`Map`<`string`, `Record`<`string`, `ProductVariantPricing`\>\>\> +`Promise`<`Map`<`string`, Record<`string`, `ProductVariantPricing`\>\>\> + +-`Promise`: + -`Map`: + -`string`: (optional) + -`Record`: #### Defined in -[medusa/src/services/pricing.ts:362](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L362) +[medusa/src/services/pricing.ts:481](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L481) ___ ### getProductVariantPricing -▸ **getProductVariantPricing**(`variant`, `context`): `Promise`<`ProductVariantPricing`\> +**getProductVariantPricing**(`variant`, `context`): `Promise`<`ProductVariantPricing`\> Gets the prices for a product variant. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `variant` | `Pick`<`ProductVariant`, ``"id"`` \| ``"product_id"``\> | | +| Name | Description | +| :------ | :------ | +| `variant` | `Pick`<`ProductVariant`, ``"id"`` \| ``"product_id"``\> | | `context` | `PriceSelectionContext` \| `PricingContext` | the price selection context to use | #### Returns `Promise`<`ProductVariantPricing`\> -The product variant prices +-`Promise`: The product variant prices #### Defined in -[medusa/src/services/pricing.ts:216](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L216) +[medusa/src/services/pricing.ts:335](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L335) ___ ### getProductVariantPricingById -▸ **getProductVariantPricingById**(`variantId`, `context`): `Promise`<`ProductVariantPricing`\> +**getProductVariantPricingById**(`variantId`, `context`): `Promise`<`ProductVariantPricing`\> Gets the prices for a product variant by a variant id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `variantId` | `string` | the id of the variant to get prices for | | `context` | `PriceSelectionContext` \| `PricingContext` | the price selection context to use | @@ -371,26 +423,52 @@ Gets the prices for a product variant by a variant id. `Promise`<`ProductVariantPricing`\> -The product variant prices +-`Promise`: The product variant prices -**`Deprecated`** +**Deprecated** Use [getProductVariantsPricing](PricingService.md#getproductvariantspricing) instead. #### Defined in -[medusa/src/services/pricing.ts:265](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L265) +[medusa/src/services/pricing.ts:384](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L384) + +___ + +### getProductVariantPricingModulePricing\_ + +`Private` **getProductVariantPricingModulePricing_**(`variantPriceData`, `context`): `Promise`<`Map`<`any`, `any`\>\> + +#### Parameters + +| Name | +| :------ | +| `variantPriceData` | { `quantity?`: `number` ; `variantId`: `string` }[] | +| `context` | `PricingContext` | + +#### Returns + +`Promise`<`Map`<`any`, `any`\>\> + +-`Promise`: + -`Map`: + -`any`: (optional) + -`any`: (optional) + +#### Defined in + +[medusa/src/services/pricing.ts:187](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L187) ___ ### getProductVariantPricing\_ -▸ `Private` **getProductVariantPricing_**(`data`, `context`): `Promise`<`Map`<`string`, `ProductVariantPricing`\>\> +`Private` **getProductVariantPricing_**(`data`, `context`): `Promise`<`Map`<`string`, `ProductVariantPricing`\>\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `data` | { `quantity?`: `number` ; `variantId`: `string` }[] | | `context` | `PricingContext` | @@ -398,47 +476,52 @@ ___ `Promise`<`Map`<`string`, `ProductVariantPricing`\>\> +-`Promise`: + -`Map`: + -`string`: (optional) + #### Defined in -[medusa/src/services/pricing.ts:163](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L163) +[medusa/src/services/pricing.ts:271](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L271) ___ ### getProductVariantsPricing -▸ **getProductVariantsPricing**(`data`, `context`): `Promise`<{ `[variant_id: string]`: `ProductVariantPricing`; }\> +**getProductVariantsPricing**(`data`, `context`): `Promise`<{ `[variant_id: string]`: `ProductVariantPricing`; }\> Gets the prices for a collection of variants. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `data` | { `quantity?`: `number` ; `variantId`: `string` }[] | | +| Name | Description | +| :------ | :------ | +| `data` | { `quantity?`: `number` ; `variantId`: `string` }[] | | `context` | `PriceSelectionContext` \| `PricingContext` | the price selection context to use | #### Returns `Promise`<{ `[variant_id: string]`: `ProductVariantPricing`; }\> -The product variant prices +-`Promise`: The product variant prices + -``object``: (optional) #### Defined in -[medusa/src/services/pricing.ts:310](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L310) +[medusa/src/services/pricing.ts:429](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L429) ___ ### getShippingOptionPricing -▸ **getShippingOptionPricing**(`shippingOption`, `context`): `Promise`<`PricedShippingOption`\> +**getShippingOptionPricing**(`shippingOption`, `context`): `Promise`<`PricedShippingOption`\> Gets the prices for a shipping option. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `shippingOption` | `ShippingOption` | the shipping option to get prices for | | `context` | `PriceSelectionContext` \| `PricingContext` | the price selection context to use | @@ -446,24 +529,72 @@ Gets the prices for a shipping option. `Promise`<`PricedShippingOption`\> -The shipping option prices +-`Promise`: The shipping option prices + +#### Defined in + +[medusa/src/services/pricing.ts:807](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L807) + +___ + +### setAdminProductPricing + +**setAdminProductPricing**(`products`): `Promise`<(`Product` \| `PricedProduct`)[]\> + +#### Parameters + +| Name | +| :------ | +| `products` | `Product`[] | + +#### Returns + +`Promise`<(`Product` \| `PricedProduct`)[]\> + +-`Promise`: + -`(Product \| PricedProduct)[]`: + -`Product \| PricedProduct`: (optional) #### Defined in -[medusa/src/services/pricing.ts:526](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L526) +[medusa/src/services/pricing.ts:754](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L754) + +___ + +### setAdminVariantPricing + +**setAdminVariantPricing**(`variants`, `context?`): `Promise`<`PricedVariant`[]\> + +#### Parameters + +| Name | +| :------ | +| `variants` | `ProductVariant`[] | +| `context` | `PriceSelectionContext` | + +#### Returns + +`Promise`<`PricedVariant`[]\> + +-`Promise`: + -`PricedVariant[]`: + +#### Defined in + +[medusa/src/services/pricing.ts:717](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L717) ___ ### setProductPrices -▸ **setProductPrices**(`products`, `context?`): `Promise`<(`Product` \| `PricedProduct`)[]\> +**setProductPrices**(`products`, `context?`): `Promise`<(`Product` \| `PricedProduct`)[]\> Set additional prices on a list of products. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `products` | `Product`[] | list of products on which to set additional prices | | `context` | `PriceSelectionContext` | the price selection context to use | @@ -471,24 +602,26 @@ Set additional prices on a list of products. `Promise`<(`Product` \| `PricedProduct`)[]\> -A list of products with variants decorated with prices +-`Promise`: A list of products with variants decorated with prices + -`(Product \| PricedProduct)[]`: + -`Product \| PricedProduct`: (optional) #### Defined in -[medusa/src/services/pricing.ts:486](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L486) +[medusa/src/services/pricing.ts:605](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L605) ___ ### setShippingOptionPrices -▸ **setShippingOptionPrices**(`shippingOptions`, `context?`): `Promise`<`PricedShippingOption`[]\> +**setShippingOptionPrices**(`shippingOptions`, `context?`): `Promise`<`PricedShippingOption`[]\> Set additional prices on a list of shipping options. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `shippingOptions` | `ShippingOption`[] | list of shipping options on which to set additional prices | | `context` | `Omit`<`PriceSelectionContext`, ``"region_id"``\> | the price selection context to use | @@ -496,81 +629,87 @@ Set additional prices on a list of shipping options. `Promise`<`PricedShippingOption`[]\> -A list of shipping options with prices +-`Promise`: A list of shipping options with prices + -`PricedShippingOption[]`: #### Defined in -[medusa/src/services/pricing.ts:588](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L588) +[medusa/src/services/pricing.ts:869](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L869) ___ ### setVariantPrices -▸ **setVariantPrices**(`variants`, `context?`): `Promise`<`PricedVariant`[]\> +**setVariantPrices**(`variants`, `context?`): `Promise`<`PricedVariant`[]\> Set additional prices on a list of product variants. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `variants` | `ProductVariant`[] | | +| Name | Description | +| :------ | :------ | +| `variants` | `ProductVariant`[] | | `context` | `PriceSelectionContext` | the price selection context to use | #### Returns `Promise`<`PricedVariant`[]\> -A list of products with variants decorated with prices +-`Promise`: A list of products with variants decorated with prices + -`PricedVariant[]`: #### Defined in -[medusa/src/services/pricing.ts:459](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/pricing.ts#L459) +[medusa/src/services/pricing.ts:578](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/pricing.ts#L578) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`PricingService`](PricingService.md) +**withTransaction**(`transactionManager?`): [`PricingService`](PricingService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`PricingService`](PricingService.md) +-`PricingService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/ProductCategoryService.md b/www/apps/docs/content/references/services/classes/ProductCategoryService.md index 0c26e8d4ff676..ccd34d786e8cc 100644 --- a/www/apps/docs/content/references/services/classes/ProductCategoryService.md +++ b/www/apps/docs/content/references/services/classes/ProductCategoryService.md @@ -1,4 +1,4 @@ -# Class: ProductCategoryService +# ProductCategoryService Provides layer to manipulate product categories. @@ -12,12 +12,12 @@ Provides layer to manipulate product categories. ### constructor -• **new ProductCategoryService**(`«destructured»`) +**new ProductCategoryService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -26,13 +26,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/product-category.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L40) +[medusa/src/services/product-category.ts:40](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L40) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -68,23 +68,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### eventBusService\_ -• `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/product-category.ts:32](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L32) +[medusa/src/services/product-category.ts:32](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L32) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -92,23 +92,23 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### productCategoryRepo\_ -• `Protected` `Readonly` **productCategoryRepo\_**: `TreeRepository`<`ProductCategory`\> & { `addProducts`: (`productCategoryId`: `string`, `productIds`: `string`[]) => `Promise`<`void`\> ; `findOneWithDescendants`: (`query`: `FindOneOptions`<`ProductCategory`\>, `treeScope`: `QuerySelector`<`ProductCategory`\>) => `Promise`<``null`` \| `ProductCategory`\> ; `getFreeTextSearchResultsAndCount`: (`options`: `ExtendedFindConfig`<`ProductCategory`\>, `q?`: `string`, `treeScope`: `QuerySelector`<`ProductCategory`\>, `includeTree`: `boolean`) => `Promise`<[`ProductCategory`[], `number`]\> ; `removeProducts`: (`productCategoryId`: `string`, `productIds`: `string`[]) => `Promise`<`DeleteResult`\> } + `Protected` `Readonly` **productCategoryRepo\_**: `TreeRepository`<`ProductCategory`\> & { `addProducts`: Method addProducts ; `findOneWithDescendants`: Method findOneWithDescendants ; `getFreeTextSearchResultsAndCount`: Method getFreeTextSearchResultsAndCount ; `removeProducts`: Method removeProducts } #### Defined in -[medusa/src/services/product-category.ts:31](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L31) +[medusa/src/services/product-category.ts:31](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L31) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -116,13 +116,13 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### Events -▪ `Static` **Events**: `Object` + `Static` **Events**: `Object` #### Type declaration @@ -134,38 +134,40 @@ ___ #### Defined in -[medusa/src/services/product-category.ts:34](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L34) +[medusa/src/services/product-category.ts:34](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L34) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### addProducts -▸ **addProducts**(`productCategoryId`, `productIds`): `Promise`<`void`\> +**addProducts**(`productCategoryId`, `productIds`): `Promise`<`void`\> Add a batch of product to a product category #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `productCategoryId` | `string` | The id of the product category on which to add the products | | `productIds` | `string`[] | The products ids to attach to the product category | @@ -173,33 +175,31 @@ Add a batch of product to a product category `Promise`<`void`\> -the product category on which the products have been added +-`Promise`: the product category on which the products have been added #### Defined in -[medusa/src/services/product-category.ts:314](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L314) +[medusa/src/services/product-category.ts:314](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L314) ___ ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -208,7 +208,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -216,68 +216,69 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**(`productCategoryInput`): `Promise`<`ProductCategory`\> +**create**(`productCategoryInput`): `Promise`<`ProductCategory`\> Creates a product category #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `productCategoryInput` | `CreateProductCategoryInput` | parameters to create a product category | #### Returns `Promise`<`ProductCategory`\> -created product category +-`Promise`: created product category + -`ProductCategory`: #### Defined in -[medusa/src/services/product-category.ts:187](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L187) +[medusa/src/services/product-category.ts:187](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L187) ___ ### delete -▸ **delete**(`productCategoryId`): `Promise`<`void`\> +**delete**(`productCategoryId`): `Promise`<`void`\> Deletes a product category #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `productCategoryId` | `string` | is the id of the product category to delete | #### Returns `Promise`<`void`\> -a promise +-`Promise`: a promise #### Defined in -[medusa/src/services/product-category.ts:268](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L268) +[medusa/src/services/product-category.ts:268](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L268) ___ ### fetchReorderConditions -▸ `Protected` **fetchReorderConditions**(`productCategory`, `input`, `shouldDeleteElement?`): `ReorderConditions` +`Protected` **fetchReorderConditions**(`productCategory`, `input`, `shouldDeleteElement?`): `ReorderConditions` #### Parameters -| Name | Type | Default value | -| :------ | :------ | :------ | -| `productCategory` | `ProductCategory` | `undefined` | -| `input` | `UpdateProductCategoryInput` | `undefined` | +| Name | Default value | +| :------ | :------ | +| `productCategory` | `ProductCategory` | +| `input` | `UpdateProductCategoryInput` | | `shouldDeleteElement` | `boolean` | `false` | #### Returns @@ -286,21 +287,21 @@ ___ #### Defined in -[medusa/src/services/product-category.ts:349](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L349) +[medusa/src/services/product-category.ts:349](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L349) ___ ### listAndCount -▸ **listAndCount**(`selector`, `config?`, `treeSelector?`): `Promise`<[`ProductCategory`[], `number`]\> +**listAndCount**(`selector`, `config?`, `treeSelector?`): `Promise`<[`ProductCategory`[], `number`]\> Lists product category based on the provided parameters and includes the count of product category that match the query. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `TreeQuerySelector`<`ProductCategory`\> | Filter options for product category. | | `config` | `FindConfig`<`ProductCategory`\> | Configuration for query. | | `treeSelector` | `QuerySelector`<`ProductCategory`\> | Filter options for product category tree relations | @@ -309,47 +310,51 @@ product category that match the query. `Promise`<[`ProductCategory`[], `number`]\> -an array containing the product category as +-`Promise`: an array containing the product category as the first element and the total count of product category that matches the query as the second element. + -`ProductCategory[]`: + -`number`: (optional) #### Defined in -[medusa/src/services/product-category.ts:61](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L61) +[medusa/src/services/product-category.ts:61](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L61) ___ ### performReordering -▸ `Protected` **performReordering**(`repository`, `conditions`): `Promise`<`void`\> +`Protected` **performReordering**(`repository`, `conditions`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | -| `repository` | `TreeRepository`<`ProductCategory`\> & { `addProducts`: (`productCategoryId`: `string`, `productIds`: `string`[]) => `Promise`<`void`\> ; `findOneWithDescendants`: (`query`: `FindOneOptions`<`ProductCategory`\>, `treeScope`: `QuerySelector`<`ProductCategory`\>) => `Promise`<``null`` \| `ProductCategory`\> ; `getFreeTextSearchResultsAndCount`: (`options`: `ExtendedFindConfig`<`ProductCategory`\>, `q?`: `string`, `treeScope`: `QuerySelector`<`ProductCategory`\>, `includeTree`: `boolean`) => `Promise`<[`ProductCategory`[], `number`]\> ; `removeProducts`: (`productCategoryId`: `string`, `productIds`: `string`[]) => `Promise`<`DeleteResult`\> } | +| Name | +| :------ | +| `repository` | `TreeRepository`<`ProductCategory`\> & { `addProducts`: Method addProducts ; `findOneWithDescendants`: Method findOneWithDescendants ; `getFreeTextSearchResultsAndCount`: Method getFreeTextSearchResultsAndCount ; `removeProducts`: Method removeProducts } | | `conditions` | `ReorderConditions` | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/product-category.ts:377](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L377) +[medusa/src/services/product-category.ts:377](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L377) ___ ### removeProducts -▸ **removeProducts**(`productCategoryId`, `productIds`): `Promise`<`void`\> +**removeProducts**(`productCategoryId`, `productIds`): `Promise`<`void`\> Remove a batch of product from a product category #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `productCategoryId` | `string` | The id of the product category on which to remove the products | | `productIds` | `string`[] | The products ids to remove from the product category | @@ -357,174 +362,182 @@ Remove a batch of product from a product category `Promise`<`void`\> -the product category on which the products have been removed +-`Promise`: the product category on which the products have been removed #### Defined in -[medusa/src/services/product-category.ts:333](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L333) +[medusa/src/services/product-category.ts:333](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L333) ___ ### retrieve -▸ **retrieve**(`productCategoryId`, `config?`, `selector?`, `treeSelector?`): `Promise`<`ProductCategory`\> +**retrieve**(`productCategoryId`, `config?`, `selector?`, `treeSelector?`): `Promise`<`ProductCategory`\> Retrieves a product category by id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `productCategoryId` | `string` | the id of the product category to retrieve. | | `config` | `FindConfig`<`ProductCategory`\> | the config of the product category to retrieve. | -| `selector` | `Selector`<`ProductCategory`\> | | -| `treeSelector` | `QuerySelector`<`ProductCategory`\> | | +| `selector` | `Selector`<`ProductCategory`\> | +| `treeSelector` | `QuerySelector`<`ProductCategory`\> | #### Returns `Promise`<`ProductCategory`\> -the product category. +-`Promise`: the product category. + -`ProductCategory`: #### Defined in -[medusa/src/services/product-category.ts:139](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L139) +[medusa/src/services/product-category.ts:139](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L139) ___ ### retrieveByHandle -▸ **retrieveByHandle**(`handle`, `config?`, `selector?`, `treeSelector?`): `Promise`<`ProductCategory`\> +**retrieveByHandle**(`handle`, `config?`, `selector?`, `treeSelector?`): `Promise`<`ProductCategory`\> Retrieves a product category by handle. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `handle` | `string` | the handle of the category | | `config` | `FindConfig`<`ProductCategory`\> | the config of the product category to retrieve. | -| `selector` | `Selector`<`ProductCategory`\> | | -| `treeSelector` | `QuerySelector`<`ProductCategory`\> | | +| `selector` | `Selector`<`ProductCategory`\> | +| `treeSelector` | `QuerySelector`<`ProductCategory`\> | #### Returns `Promise`<`ProductCategory`\> -the product category. +-`Promise`: the product category. + -`ProductCategory`: #### Defined in -[medusa/src/services/product-category.ts:165](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L165) +[medusa/src/services/product-category.ts:165](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L165) ___ ### retrieve\_ -▸ `Protected` **retrieve_**(`config?`, `selector?`, `treeSelector?`): `Promise`<`ProductCategory`\> +`Protected` **retrieve_**(`config?`, `selector?`, `treeSelector?`): `Promise`<`ProductCategory`\> A generic retrieve for fining product categories by different attributes. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `config` | `FindConfig`<`ProductCategory`\> | the config of the product category to retrieve. | -| `selector` | `Selector`<`ProductCategory`\> | | -| `treeSelector` | `QuerySelector`<`ProductCategory`\> | | +| `selector` | `Selector`<`ProductCategory`\> | +| `treeSelector` | `QuerySelector`<`ProductCategory`\> | #### Returns `Promise`<`ProductCategory`\> -the product category. +-`Promise`: the product category. + -`ProductCategory`: #### Defined in -[medusa/src/services/product-category.ts:102](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L102) +[medusa/src/services/product-category.ts:102](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L102) ___ ### shiftSiblings -▸ `Protected` **shiftSiblings**(`repository`, `conditions`): `Promise`<`void`\> +`Protected` **shiftSiblings**(`repository`, `conditions`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | -| `repository` | `TreeRepository`<`ProductCategory`\> & { `addProducts`: (`productCategoryId`: `string`, `productIds`: `string`[]) => `Promise`<`void`\> ; `findOneWithDescendants`: (`query`: `FindOneOptions`<`ProductCategory`\>, `treeScope`: `QuerySelector`<`ProductCategory`\>) => `Promise`<``null`` \| `ProductCategory`\> ; `getFreeTextSearchResultsAndCount`: (`options`: `ExtendedFindConfig`<`ProductCategory`\>, `q?`: `string`, `treeScope`: `QuerySelector`<`ProductCategory`\>, `includeTree`: `boolean`) => `Promise`<[`ProductCategory`[], `number`]\> ; `removeProducts`: (`productCategoryId`: `string`, `productIds`: `string`[]) => `Promise`<`DeleteResult`\> } | +| Name | +| :------ | +| `repository` | `TreeRepository`<`ProductCategory`\> & { `addProducts`: Method addProducts ; `findOneWithDescendants`: Method findOneWithDescendants ; `getFreeTextSearchResultsAndCount`: Method getFreeTextSearchResultsAndCount ; `removeProducts`: Method removeProducts } | | `conditions` | `ReorderConditions` | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/product-category.ts:415](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L415) +[medusa/src/services/product-category.ts:415](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L415) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### transformParentIdToEntity -▸ `Protected` **transformParentIdToEntity**(`productCategoryInput`): `Promise`<`CreateProductCategoryInput` \| `UpdateProductCategoryInput`\> +`Protected` **transformParentIdToEntity**(`productCategoryInput`): `Promise`<`CreateProductCategoryInput` \| `UpdateProductCategoryInput`\> Accepts an input object and transforms product_category_id into product_category entity. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `productCategoryInput` | `CreateProductCategoryInput` \| `UpdateProductCategoryInput` | params used to create/update | #### Returns `Promise`<`CreateProductCategoryInput` \| `UpdateProductCategoryInput`\> -transformed productCategoryInput +-`Promise`: transformed productCategoryInput + -`CreateProductCategoryInput \| UpdateProductCategoryInput`: (optional) #### Defined in -[medusa/src/services/product-category.ts:513](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L513) +[medusa/src/services/product-category.ts:513](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L513) ___ ### update -▸ **update**(`productCategoryId`, `productCategoryInput`): `Promise`<`ProductCategory`\> +**update**(`productCategoryId`, `productCategoryInput`): `Promise`<`ProductCategory`\> Updates a product category #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `productCategoryId` | `string` | id of product category to update | | `productCategoryInput` | `UpdateProductCategoryInput` | parameters to update in product category | @@ -532,32 +545,35 @@ Updates a product category `Promise`<`ProductCategory`\> -updated product category +-`Promise`: updated product category + -`ProductCategory`: #### Defined in -[medusa/src/services/product-category.ts:221](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-category.ts#L221) +[medusa/src/services/product-category.ts:221](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-category.ts#L221) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`ProductCategoryService`](ProductCategoryService.md) +**withTransaction**(`transactionManager?`): [`ProductCategoryService`](ProductCategoryService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`ProductCategoryService`](ProductCategoryService.md) +-`ProductCategoryService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/ProductCollectionService.md b/www/apps/docs/content/references/services/classes/ProductCollectionService.md index 22ab6dff9368f..01e599188be1c 100644 --- a/www/apps/docs/content/references/services/classes/ProductCollectionService.md +++ b/www/apps/docs/content/references/services/classes/ProductCollectionService.md @@ -1,4 +1,4 @@ -# Class: ProductCollectionService +# ProductCollectionService Provides layer to manipulate product collections. @@ -12,12 +12,12 @@ Provides layer to manipulate product collections. ### constructor -• **new ProductCollectionService**(`«destructured»`) +**new ProductCollectionService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -26,13 +26,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/product-collection.ts:49](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L49) +[medusa/src/services/product-collection.ts:49](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L49) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -68,23 +68,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### eventBus\_ -• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/product-collection.ts:36](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L36) +[medusa/src/services/product-collection.ts:36](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L36) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -92,33 +92,33 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### productCollectionRepository\_ -• `Protected` `Readonly` **productCollectionRepository\_**: `Repository`<`ProductCollection`\> & { `findAndCountByDiscountConditionId`: (`conditionId`: `string`, `query`: `ExtendedFindConfig`<`ProductCollection`\>) => `Promise`<[`ProductCollection`[], `number`]\> } + `Protected` `Readonly` **productCollectionRepository\_**: `Repository`<`ProductCollection`\> & { `findAndCountByDiscountConditionId`: Method findAndCountByDiscountConditionId } #### Defined in -[medusa/src/services/product-collection.ts:38](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L38) +[medusa/src/services/product-collection.ts:38](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L38) ___ ### productRepository\_ -• `Protected` `Readonly` **productRepository\_**: `Repository`<`Product`\> & { `_applyCategoriesQuery`: (`qb`: `SelectQueryBuilder`<`Product`\>, `__namedParameters`: `Object`) => `SelectQueryBuilder`<`Product`\> ; `_findWithRelations`: (`__namedParameters`: { `idsOrOptionsWithoutRelations`: `string`[] \| `FindWithoutRelationsOptions` ; `relations`: `string`[] ; `shouldCount`: `boolean` ; `withDeleted`: `boolean` }) => `Promise`<[`Product`[], `number`]\> ; `bulkAddToCollection`: (`productIds`: `string`[], `collectionId`: `string`) => `Promise`<`Product`[]\> ; `bulkRemoveFromCollection`: (`productIds`: `string`[], `collectionId`: `string`) => `Promise`<`Product`[]\> ; `findOneWithRelations`: (`relations`: `string`[], `optionsWithoutRelations`: `FindWithoutRelationsOptions`) => `Promise`<`Product`\> ; `findWithRelations`: (`relations`: `string`[], `idsOrOptionsWithoutRelations`: `string`[] \| `FindWithoutRelationsOptions`, `withDeleted`: `boolean`) => `Promise`<`Product`[]\> ; `findWithRelationsAndCount`: (`relations`: `string`[], `idsOrOptionsWithoutRelations`: `FindWithoutRelationsOptions`) => `Promise`<[`Product`[], `number`]\> ; `getCategoryIdsFromInput`: (`categoryId?`: `CategoryQueryParams`, `includeCategoryChildren`: `boolean`) => `Promise`<`string`[]\> ; `getCategoryIdsRecursively`: (`productCategory`: `ProductCategory`) => `string`[] ; `getFreeTextSearchResultsAndCount`: (`q`: `string`, `options`: `FindWithoutRelationsOptions`, `relations`: `string`[]) => `Promise`<[`Product`[], `number`]\> ; `isProductInSalesChannels`: (`id`: `string`, `salesChannelIds`: `string`[]) => `Promise`<`boolean`\> ; `queryProducts`: (`optionsWithoutRelations`: `FindWithoutRelationsOptions`, `shouldCount`: `boolean`) => `Promise`<[`Product`[], `number`]\> ; `queryProductsWithIds`: (`__namedParameters`: { `entityIds`: `string`[] ; `groupedRelations`: { `[toplevel: string]`: `string`[]; } ; `order?`: { `[column: string]`: ``"ASC"`` \| ``"DESC"``; } ; `select?`: keyof `Product`[] ; `where?`: `FindOptionsWhere`<`Product`\> ; `withDeleted?`: `boolean` }) => `Promise`<`Product`[]\> } + `Protected` `Readonly` **productRepository\_**: `Repository`<`Product`\> & { `_applyCategoriesQuery`: Method \_applyCategoriesQuery ; `_findWithRelations`: Method \_findWithRelations ; `bulkAddToCollection`: Method bulkAddToCollection ; `bulkRemoveFromCollection`: Method bulkRemoveFromCollection ; `findOneWithRelations`: Method findOneWithRelations ; `findWithRelations`: Method findWithRelations ; `findWithRelationsAndCount`: Method findWithRelationsAndCount ; `getCategoryIdsFromInput`: Method getCategoryIdsFromInput ; `getCategoryIdsRecursively`: Method getCategoryIdsRecursively ; `getFreeTextSearchResultsAndCount`: Method getFreeTextSearchResultsAndCount ; `isProductInSalesChannels`: Method isProductInSalesChannels ; `queryProducts`: Method queryProducts ; `queryProductsWithIds`: Method queryProductsWithIds } #### Defined in -[medusa/src/services/product-collection.ts:39](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L39) +[medusa/src/services/product-collection.ts:39](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L39) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -126,13 +126,13 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### Events -▪ `Static` `Readonly` **Events**: `Object` + `Static` `Readonly` **Events**: `Object` #### Type declaration @@ -146,36 +146,38 @@ ___ #### Defined in -[medusa/src/services/product-collection.ts:41](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L41) +[medusa/src/services/product-collection.ts:41](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L41) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### addProducts -▸ **addProducts**(`collectionId`, `productIds`): `Promise`<`ProductCollection`\> +**addProducts**(`collectionId`, `productIds`): `Promise`<`ProductCollection`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `collectionId` | `string` | | `productIds` | `string`[] | @@ -183,31 +185,32 @@ TransactionBaseService.activeManager\_ `Promise`<`ProductCollection`\> +-`Promise`: + -`ProductCollection`: + #### Defined in -[medusa/src/services/product-collection.ts:216](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L216) +[medusa/src/services/product-collection.ts:216](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L216) ___ ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -216,7 +219,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -224,95 +227,98 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**(`collection`): `Promise`<`ProductCollection`\> +**create**(`collection`): `Promise`<`ProductCollection`\> Creates a product collection #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `collection` | `CreateProductCollection` | the collection to create | #### Returns `Promise`<`ProductCollection`\> -created collection +-`Promise`: created collection + -`ProductCollection`: #### Defined in -[medusa/src/services/product-collection.ts:128](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L128) +[medusa/src/services/product-collection.ts:128](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L128) ___ ### delete -▸ **delete**(`collectionId`): `Promise`<`void`\> +**delete**(`collectionId`): `Promise`<`void`\> Deletes a product collection idempotently #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `collectionId` | `string` | id of collection to delete | #### Returns `Promise`<`void`\> -empty promise +-`Promise`: empty promise #### Defined in -[medusa/src/services/product-collection.ts:192](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L192) +[medusa/src/services/product-collection.ts:192](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L192) ___ ### list -▸ **list**(`selector?`, `config?`): `Promise`<`ProductCollection`[]\> +**list**(`selector?`, `config?`): `Promise`<`ProductCollection`[]\> Lists product collections #### Parameters -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `selector` | `Selector`<`ProductCollection`\> & { `discount_condition_id?`: `string` ; `q?`: `string` } | `{}` | the query object for find | -| `config` | `Object` | `undefined` | the config to be used for find | -| `config.skip` | `number` | `0` | - | -| `config.take` | `number` | `20` | - | +| Name | Default value | Description | +| :------ | :------ | :------ | +| `selector` | `Selector`<`ProductCollection`\> & { `discount_condition_id?`: `string` ; `q?`: `string` } | the query object for find | +| `config` | `object` | the config to be used for find | +| `config.skip` | `number` | `0` | +| `config.take` | `number` | `20` | #### Returns `Promise`<`ProductCollection`[]\> -the result of the find operation +-`Promise`: the result of the find operation + -`ProductCollection[]`: + -`ProductCollection`: #### Defined in -[medusa/src/services/product-collection.ts:274](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L274) +[medusa/src/services/product-collection.ts:274](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L274) ___ ### listAndCount -▸ **listAndCount**(`selector?`, `config?`): `Promise`<[`ProductCollection`[], `number`]\> +**listAndCount**(`selector?`, `config?`): `Promise`<[`ProductCollection`[], `number`]\> Lists product collections and add count. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `ListAndCountSelector` | the query object for find | | `config` | `FindConfig`<`ProductCollection`\> | the config to be used for find | @@ -320,22 +326,24 @@ Lists product collections and add count. `Promise`<[`ProductCollection`[], `number`]\> -the result of the find operation +-`Promise`: the result of the find operation + -`ProductCollection[]`: + -`number`: (optional) #### Defined in -[medusa/src/services/product-collection.ts:291](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L291) +[medusa/src/services/product-collection.ts:291](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L291) ___ ### removeProducts -▸ **removeProducts**(`collectionId`, `productIds`): `Promise`<`void`\> +**removeProducts**(`collectionId`, `productIds`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `collectionId` | `string` | | `productIds` | `string`[] | @@ -343,22 +351,24 @@ ___ `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/product-collection.ts:242](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L242) +[medusa/src/services/product-collection.ts:242](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L242) ___ ### retrieve -▸ **retrieve**(`collectionId`, `config?`): `Promise`<`ProductCollection`\> +**retrieve**(`collectionId`, `config?`): `Promise`<`ProductCollection`\> Retrieves a product collection by id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `collectionId` | `string` | the id of the collection to retrieve. | | `config` | `FindConfig`<`ProductCollection`\> | the config of the collection to retrieve. | @@ -366,24 +376,25 @@ Retrieves a product collection by id. `Promise`<`ProductCollection`\> -the collection. +-`Promise`: the collection. + -`ProductCollection`: #### Defined in -[medusa/src/services/product-collection.ts:68](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L68) +[medusa/src/services/product-collection.ts:68](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L68) ___ ### retrieveByHandle -▸ **retrieveByHandle**(`collectionHandle`, `config?`): `Promise`<`ProductCollection`\> +**retrieveByHandle**(`collectionHandle`, `config?`): `Promise`<`ProductCollection`\> Retrieves a product collection by id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `collectionHandle` | `string` | the handle of the collection to retrieve. | | `config` | `FindConfig`<`ProductCollection`\> | query config for request | @@ -391,48 +402,51 @@ Retrieves a product collection by id. `Promise`<`ProductCollection`\> -the collection. +-`Promise`: the collection. + -`ProductCollection`: #### Defined in -[medusa/src/services/product-collection.ts:102](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L102) +[medusa/src/services/product-collection.ts:102](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L102) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`collectionId`, `update`): `Promise`<`ProductCollection`\> +**update**(`collectionId`, `update`): `Promise`<`ProductCollection`\> Updates a product collection #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `collectionId` | `string` | id of collection to update | | `update` | `UpdateProductCollection` | update object | @@ -440,32 +454,35 @@ Updates a product collection `Promise`<`ProductCollection`\> -update collection +-`Promise`: update collection + -`ProductCollection`: #### Defined in -[medusa/src/services/product-collection.ts:154](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-collection.ts#L154) +[medusa/src/services/product-collection.ts:154](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-collection.ts#L154) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`ProductCollectionService`](ProductCollectionService.md) +**withTransaction**(`transactionManager?`): [`ProductCollectionService`](ProductCollectionService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`ProductCollectionService`](ProductCollectionService.md) +-`ProductCollectionService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/ProductService.md b/www/apps/docs/content/references/services/classes/ProductService.md index 2fce86cc037da..143f4b10c30bc 100644 --- a/www/apps/docs/content/references/services/classes/ProductService.md +++ b/www/apps/docs/content/references/services/classes/ProductService.md @@ -1,4 +1,4 @@ -# Class: ProductService +# ProductService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new ProductService**(`«destructured»`) +**new ProductService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/product.ts:78](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L78) +[medusa/src/services/product.ts:81](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L81) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,43 +66,43 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### eventBus\_ -• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/product.ts:68](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L68) +[medusa/src/services/product.ts:71](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L71) ___ ### featureFlagRouter\_ -• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` + `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` #### Defined in -[medusa/src/services/product.ts:69](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L69) +[medusa/src/services/product.ts:72](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L72) ___ ### imageRepository\_ -• `Protected` `Readonly` **imageRepository\_**: `Repository`<`Image`\> & { `insertBulk`: (`data`: `_QueryDeepPartialEntity`<`Image`\>[]) => `Promise`<`Image`[]\> ; `upsertImages`: (`imageUrls`: `string`[]) => `Promise`<`Image`[]\> } + `Protected` `Readonly` **imageRepository\_**: `Repository`<`Image`\> & { `insertBulk`: Method insertBulk ; `upsertImages`: Method upsertImages } #### Defined in -[medusa/src/services/product.ts:63](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L63) +[medusa/src/services/product.ts:66](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L66) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -110,93 +110,93 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### productCategoryRepository\_ -• `Protected` `Readonly` **productCategoryRepository\_**: `TreeRepository`<`ProductCategory`\> & { `addProducts`: (`productCategoryId`: `string`, `productIds`: `string`[]) => `Promise`<`void`\> ; `findOneWithDescendants`: (`query`: `FindOneOptions`<`ProductCategory`\>, `treeScope`: `QuerySelector`<`ProductCategory`\>) => `Promise`<``null`` \| `ProductCategory`\> ; `getFreeTextSearchResultsAndCount`: (`options`: `ExtendedFindConfig`<`ProductCategory`\>, `q?`: `string`, `treeScope`: `QuerySelector`<`ProductCategory`\>, `includeTree`: `boolean`) => `Promise`<[`ProductCategory`[], `number`]\> ; `removeProducts`: (`productCategoryId`: `string`, `productIds`: `string`[]) => `Promise`<`DeleteResult`\> } + `Protected` `Readonly` **productCategoryRepository\_**: `TreeRepository`<`ProductCategory`\> & { `addProducts`: Method addProducts ; `findOneWithDescendants`: Method findOneWithDescendants ; `getFreeTextSearchResultsAndCount`: Method getFreeTextSearchResultsAndCount ; `removeProducts`: Method removeProducts } #### Defined in -[medusa/src/services/product.ts:65](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L65) +[medusa/src/services/product.ts:68](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L68) ___ ### productOptionRepository\_ -• `Protected` `Readonly` **productOptionRepository\_**: `Repository`<`ProductOption`\> + `Protected` `Readonly` **productOptionRepository\_**: `Repository`<`ProductOption`\> #### Defined in -[medusa/src/services/product.ts:58](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L58) +[medusa/src/services/product.ts:61](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L61) ___ ### productRepository\_ -• `Protected` `Readonly` **productRepository\_**: `Repository`<`Product`\> & { `_applyCategoriesQuery`: (`qb`: `SelectQueryBuilder`<`Product`\>, `__namedParameters`: `Object`) => `SelectQueryBuilder`<`Product`\> ; `_findWithRelations`: (`__namedParameters`: { `idsOrOptionsWithoutRelations`: `string`[] \| `FindWithoutRelationsOptions` ; `relations`: `string`[] ; `shouldCount`: `boolean` ; `withDeleted`: `boolean` }) => `Promise`<[`Product`[], `number`]\> ; `bulkAddToCollection`: (`productIds`: `string`[], `collectionId`: `string`) => `Promise`<`Product`[]\> ; `bulkRemoveFromCollection`: (`productIds`: `string`[], `collectionId`: `string`) => `Promise`<`Product`[]\> ; `findOneWithRelations`: (`relations`: `string`[], `optionsWithoutRelations`: `FindWithoutRelationsOptions`) => `Promise`<`Product`\> ; `findWithRelations`: (`relations`: `string`[], `idsOrOptionsWithoutRelations`: `string`[] \| `FindWithoutRelationsOptions`, `withDeleted`: `boolean`) => `Promise`<`Product`[]\> ; `findWithRelationsAndCount`: (`relations`: `string`[], `idsOrOptionsWithoutRelations`: `FindWithoutRelationsOptions`) => `Promise`<[`Product`[], `number`]\> ; `getCategoryIdsFromInput`: (`categoryId?`: `CategoryQueryParams`, `includeCategoryChildren`: `boolean`) => `Promise`<`string`[]\> ; `getCategoryIdsRecursively`: (`productCategory`: `ProductCategory`) => `string`[] ; `getFreeTextSearchResultsAndCount`: (`q`: `string`, `options`: `FindWithoutRelationsOptions`, `relations`: `string`[]) => `Promise`<[`Product`[], `number`]\> ; `isProductInSalesChannels`: (`id`: `string`, `salesChannelIds`: `string`[]) => `Promise`<`boolean`\> ; `queryProducts`: (`optionsWithoutRelations`: `FindWithoutRelationsOptions`, `shouldCount`: `boolean`) => `Promise`<[`Product`[], `number`]\> ; `queryProductsWithIds`: (`__namedParameters`: { `entityIds`: `string`[] ; `groupedRelations`: { `[toplevel: string]`: `string`[]; } ; `order?`: { `[column: string]`: ``"ASC"`` \| ``"DESC"``; } ; `select?`: keyof `Product`[] ; `where?`: `FindOptionsWhere`<`Product`\> ; `withDeleted?`: `boolean` }) => `Promise`<`Product`[]\> } + `Protected` `Readonly` **productRepository\_**: `Repository`<`Product`\> & { `_applyCategoriesQuery`: Method \_applyCategoriesQuery ; `_findWithRelations`: Method \_findWithRelations ; `bulkAddToCollection`: Method bulkAddToCollection ; `bulkRemoveFromCollection`: Method bulkRemoveFromCollection ; `findOneWithRelations`: Method findOneWithRelations ; `findWithRelations`: Method findWithRelations ; `findWithRelationsAndCount`: Method findWithRelationsAndCount ; `getCategoryIdsFromInput`: Method getCategoryIdsFromInput ; `getCategoryIdsRecursively`: Method getCategoryIdsRecursively ; `getFreeTextSearchResultsAndCount`: Method getFreeTextSearchResultsAndCount ; `isProductInSalesChannels`: Method isProductInSalesChannels ; `queryProducts`: Method queryProducts ; `queryProductsWithIds`: Method queryProductsWithIds } #### Defined in -[medusa/src/services/product.ts:59](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L59) +[medusa/src/services/product.ts:62](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L62) ___ ### productTagRepository\_ -• `Protected` `Readonly` **productTagRepository\_**: `Repository`<`ProductTag`\> & { `findAndCountByDiscountConditionId`: (`conditionId`: `string`, `query`: `ExtendedFindConfig`<`ProductTag`\>) => `Promise`<[`ProductTag`[], `number`]\> ; `insertBulk`: (`data`: `_QueryDeepPartialEntity`<`ProductTag`\>[]) => `Promise`<`ProductTag`[]\> ; `listTagsByUsage`: (`take`: `number`) => `Promise`<`ProductTag`[]\> ; `upsertTags`: (`tags`: `UpsertTagsInput`) => `Promise`<`ProductTag`[]\> } + `Protected` `Readonly` **productTagRepository\_**: `Repository`<`ProductTag`\> & { `findAndCountByDiscountConditionId`: Method findAndCountByDiscountConditionId ; `insertBulk`: Method insertBulk ; `listTagsByUsage`: Method listTagsByUsage ; `upsertTags`: Method upsertTags } #### Defined in -[medusa/src/services/product.ts:62](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L62) +[medusa/src/services/product.ts:65](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L65) ___ ### productTypeRepository\_ -• `Protected` `Readonly` **productTypeRepository\_**: `Repository`<`ProductType`\> & { `findAndCountByDiscountConditionId`: (`conditionId`: `string`, `query`: `ExtendedFindConfig`<`ProductType`\>) => `Promise`<[`ProductType`[], `number`]\> ; `upsertType`: (`type?`: `UpsertTypeInput`) => `Promise`<``null`` \| `ProductType`\> } + `Protected` `Readonly` **productTypeRepository\_**: `Repository`<`ProductType`\> & { `findAndCountByDiscountConditionId`: Method findAndCountByDiscountConditionId ; `upsertType`: Method upsertType } #### Defined in -[medusa/src/services/product.ts:61](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L61) +[medusa/src/services/product.ts:64](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L64) ___ ### productVariantRepository\_ -• `Protected` `Readonly` **productVariantRepository\_**: `Repository`<`ProductVariant`\> + `Protected` `Readonly` **productVariantRepository\_**: `Repository`<`ProductVariant`\> #### Defined in -[medusa/src/services/product.ts:60](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L60) +[medusa/src/services/product.ts:63](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L63) ___ ### productVariantService\_ -• `Protected` `Readonly` **productVariantService\_**: [`ProductVariantService`](ProductVariantService.md) + `Protected` `Readonly` **productVariantService\_**: [`ProductVariantService`](ProductVariantService.md) #### Defined in -[medusa/src/services/product.ts:66](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L66) +[medusa/src/services/product.ts:69](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L69) ___ ### searchService\_ -• `Protected` `Readonly` **searchService\_**: [`SearchService`](SearchService.md) + `Protected` `Readonly` **searchService\_**: [`SearchService`](SearchService.md) #### Defined in -[medusa/src/services/product.ts:67](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L67) +[medusa/src/services/product.ts:70](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L70) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -204,13 +204,13 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### Events -▪ `Static` `Readonly` **Events**: `Object` + `Static` `Readonly` **Events**: `Object` #### Type declaration @@ -222,41 +222,43 @@ ___ #### Defined in -[medusa/src/services/product.ts:72](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L72) +[medusa/src/services/product.ts:75](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L75) ___ ### IndexName -▪ `Static` `Readonly` **IndexName**: ``"products"`` + `Static` `Readonly` **IndexName**: ``"products"`` #### Defined in -[medusa/src/services/product.ts:71](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L71) +[medusa/src/services/product.ts:74](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L74) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### addOption -▸ **addOption**(`productId`, `optionTitle`): `Promise`<`Product`\> +**addOption**(`productId`, `optionTitle`): `Promise`<`Product`\> Adds an option to a product. Options can, for example, be "Size", "Color", etc. Will update all the products variants with a dummy value for the newly @@ -264,8 +266,8 @@ created option. The same option cannot be added more than once. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `productId` | `string` | the product to apply the new option to | | `optionTitle` | `string` | the display title of the option, e.g. "Size" | @@ -273,33 +275,32 @@ created option. The same option cannot be added more than once. `Promise`<`Product`\> -the result of the model update operation +-`Promise`: the result of the model update operation + -`Product`: #### Defined in -[medusa/src/services/product.ts:697](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L697) +[medusa/src/services/product.ts:722](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L722) ___ ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -308,7 +309,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -316,93 +317,95 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### count -▸ **count**(`selector?`): `Promise`<`number`\> +**count**(`selector?`): `Promise`<`number`\> Return the total number of documents in database #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`Product`\> | the selector to choose products by | #### Returns `Promise`<`number`\> -the result of the count operation +-`Promise`: the result of the count operation + -`number`: (optional) #### Defined in -[medusa/src/services/product.ts:184](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L184) +[medusa/src/services/product.ts:187](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L187) ___ ### create -▸ **create**(`productObject`): `Promise`<`Product`\> +**create**(`productObject`): `Promise`<`Product`\> Creates a product. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `productObject` | `CreateProductInput` | the product to create | #### Returns `Promise`<`Product`\> -resolves to the creation result. +-`Promise`: resolves to the creation result. + -`Product`: #### Defined in -[medusa/src/services/product.ts:417](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L417) +[medusa/src/services/product.ts:420](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L420) ___ ### delete -▸ **delete**(`productId`): `Promise`<`void`\> +**delete**(`productId`): `Promise`<`void`\> Deletes a product from a given product id. The product's associated variants will also be deleted. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `productId` | `string` | the id of the product to delete. Must be castable as an ObjectId | #### Returns `Promise`<`void`\> -empty promise +-`Promise`: empty promise #### Defined in -[medusa/src/services/product.ts:658](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L658) +[medusa/src/services/product.ts:683](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L683) ___ ### deleteOption -▸ **deleteOption**(`productId`, `optionId`): `Promise`<`void` \| `Product`\> +**deleteOption**(`productId`, `optionId`): `Promise`<`void` \| `Product`\> Delete an option from a product. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `productId` | `string` | the product to delete an option from | | `optionId` | `string` | the option to delete | @@ -410,22 +413,23 @@ Delete an option from a product. `Promise`<`void` \| `Product`\> -the updated product +-`Promise`: the updated product + -`void \| Product`: (optional) #### Defined in -[medusa/src/services/product.ts:862](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L862) +[medusa/src/services/product.ts:887](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L887) ___ ### filterProductsBySalesChannel -▸ **filterProductsBySalesChannel**(`productIds`, `salesChannelId`, `config?`): `Promise`<`Product`[]\> +**filterProductsBySalesChannel**(`productIds`, `salesChannelId`, `config?`): `Promise`<`Product`[]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `productIds` | `string`[] | | `salesChannelId` | `string` | | `config` | `FindProductConfig` | @@ -434,22 +438,26 @@ ___ `Promise`<`Product`[]\> +-`Promise`: + -`Product[]`: + -`Product`: + #### Defined in -[medusa/src/services/product.ts:342](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L342) +[medusa/src/services/product.ts:345](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L345) ___ ### isProductInSalesChannels -▸ **isProductInSalesChannels**(`id`, `salesChannelIds`): `Promise`<`boolean`\> +**isProductInSalesChannels**(`id`, `salesChannelIds`): `Promise`<`boolean`\> Check if the product is assigned to at least one of the provided sales channels. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `id` | `string` | product id | | `salesChannelIds` | `string`[] | an array of sales channel ids | @@ -457,22 +465,25 @@ Check if the product is assigned to at least one of the provided sales channels. `Promise`<`boolean`\> +-`Promise`: + -`boolean`: (optional) + #### Defined in -[medusa/src/services/product.ts:395](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L395) +[medusa/src/services/product.ts:398](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L398) ___ ### list -▸ **list**(`selector`, `config?`): `Promise`<`Product`[]\> +**list**(`selector`, `config?`): `Promise`<`Product`[]\> Lists products based on the provided parameters. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `ProductSelector` | an object that defines rules to filter products by | | `config` | `FindProductConfig` | object that defines the scope for what should be returned | @@ -480,25 +491,27 @@ Lists products based on the provided parameters. `Promise`<`Product`[]\> -the result of the find operation +-`Promise`: the result of the find operation + -`Product[]`: + -`Product`: #### Defined in -[medusa/src/services/product.ts:115](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L115) +[medusa/src/services/product.ts:118](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L118) ___ ### listAndCount -▸ **listAndCount**(`selector`, `config?`): `Promise`<[`Product`[], `number`]\> +**listAndCount**(`selector`, `config?`): `Promise`<[`Product`[], `number`]\> Lists products based on the provided parameters and includes the count of products that match the query. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `ProductSelector` | an object that defines rules to filter products by | | `config` | `FindProductConfig` | object that defines the scope for what should be returned | @@ -506,66 +519,78 @@ products that match the query. `Promise`<[`Product`[], `number`]\> -an array containing the products as +-`Promise`: an array containing the products as the first element and the total count of products that matches the query as the second element. + -`Product[]`: + -`number`: (optional) #### Defined in -[medusa/src/services/product.ts:139](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L139) +[medusa/src/services/product.ts:142](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L142) ___ ### listTagsByUsage -▸ **listTagsByUsage**(`take?`): `Promise`<`ProductTag`[]\> +**listTagsByUsage**(`take?`): `Promise`<`ProductTag`[]\> #### Parameters -| Name | Type | Default value | -| :------ | :------ | :------ | +| Name | Default value | +| :------ | :------ | | `take` | `number` | `10` | #### Returns `Promise`<`ProductTag`[]\> +-`Promise`: + -`ProductTag[]`: + -`ProductTag`: + #### Defined in -[medusa/src/services/product.ts:381](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L381) +[medusa/src/services/product.ts:384](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L384) ___ ### listTypes -▸ **listTypes**(): `Promise`<`ProductType`[]\> +**listTypes**(): `Promise`<`ProductType`[]\> #### Returns `Promise`<`ProductType`[]\> +-`Promise`: + -`ProductType[]`: + -`ProductType`: + #### Defined in -[medusa/src/services/product.ts:373](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L373) +[medusa/src/services/product.ts:376](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L376) ___ ### prepareListQuery\_ -▸ `Protected` **prepareListQuery_**(`selector`, `config`): `Object` +`Protected` **prepareListQuery_**(`selector`, `config`): { `q`: `string` ; `query`: `FindWithoutRelationsOptions` ; `relations`: keyof `Product`[] } Temporary method to be used in place we need custom query strategy to prevent typeorm bug #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `selector` | `FilterableProductProps` \| `Selector`<`Product`\> | | `config` | `FindProductConfig` | #### Returns -`Object` +`object` + +-``object``: (optional) | Name | Type | | :------ | :------ | @@ -575,18 +600,18 @@ Temporary method to be used in place we need custom query strategy to prevent ty #### Defined in -[medusa/src/services/product.ts:970](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L970) +[medusa/src/services/product.ts:995](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L995) ___ ### reorderVariants -▸ **reorderVariants**(`productId`, `variantOrder`): `Promise`<`Product`\> +**reorderVariants**(`productId`, `variantOrder`): `Promise`<`Product`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `productId` | `string` | | `variantOrder` | `string`[] | @@ -594,23 +619,26 @@ ___ `Promise`<`Product`\> +-`Promise`: + -`Product`: + #### Defined in -[medusa/src/services/product.ts:740](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L740) +[medusa/src/services/product.ts:765](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L765) ___ ### retrieve -▸ **retrieve**(`productId`, `config?`): `Promise`<`Product`\> +**retrieve**(`productId`, `config?`): `Promise`<`Product`\> Gets a product by id. Throws in case of DB Error and if product was not found. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `productId` | `string` | id of the product to get. | | `config` | `FindProductConfig` | object that defines what should be included in the query response | @@ -618,25 +646,26 @@ Throws in case of DB Error and if product was not found. `Promise`<`Product`\> -the result of the find one operation. +-`Promise`: the result of the find one operation. + -`Product`: #### Defined in -[medusa/src/services/product.ts:200](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L200) +[medusa/src/services/product.ts:203](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L203) ___ ### retrieveByExternalId -▸ **retrieveByExternalId**(`externalId`, `config?`): `Promise`<`Product`\> +**retrieveByExternalId**(`externalId`, `config?`): `Promise`<`Product`\> Gets a product by external id. Throws in case of DB Error and if product was not found. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `externalId` | `string` | handle of the product to get. | | `config` | `FindProductConfig` | details about what to get from the product | @@ -644,25 +673,26 @@ Throws in case of DB Error and if product was not found. `Promise`<`Product`\> -the result of the find one operation. +-`Promise`: the result of the find one operation. + -`Product`: #### Defined in -[medusa/src/services/product.ts:244](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L244) +[medusa/src/services/product.ts:247](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L247) ___ ### retrieveByHandle -▸ **retrieveByHandle**(`productHandle`, `config?`): `Promise`<`Product`\> +**retrieveByHandle**(`productHandle`, `config?`): `Promise`<`Product`\> Gets a product by handle. Throws in case of DB Error and if product was not found. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `productHandle` | `string` | handle of the product to get. | | `config` | `FindProductConfig` | details about what to get from the product | @@ -670,24 +700,25 @@ Throws in case of DB Error and if product was not found. `Promise`<`Product`\> -the result of the find one operation. +-`Promise`: the result of the find one operation. + -`Product`: #### Defined in -[medusa/src/services/product.ts:223](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L223) +[medusa/src/services/product.ts:226](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L226) ___ ### retrieveOptionByTitle -▸ **retrieveOptionByTitle**(`title`, `productId`): `Promise`<``null`` \| `ProductOption`\> +**retrieveOptionByTitle**(`title`, `productId`): `Promise`<``null`` \| `ProductOption`\> Retrieve product's option by title. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `title` | `string` | title of the option | | `productId` | `string` | id of a product | @@ -695,24 +726,25 @@ Retrieve product's option by title. `Promise`<``null`` \| `ProductOption`\> -product option +-`Promise`: product option + -```null`` \| ProductOption`: (optional) #### Defined in -[medusa/src/services/product.ts:843](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L843) +[medusa/src/services/product.ts:868](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L868) ___ ### retrieveVariants -▸ **retrieveVariants**(`productId`, `config?`): `Promise`<`ProductVariant`[]\> +**retrieveVariants**(`productId`, `config?`): `Promise`<`ProductVariant`[]\> Gets all variants belonging to a product. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `productId` | `string` | the id of the product to get variants from. | | `config` | `FindProductConfig` | The config to select and configure relations etc... | @@ -720,25 +752,27 @@ Gets all variants belonging to a product. `Promise`<`ProductVariant`[]\> -an array of variants +-`Promise`: an array of variants + -`ProductVariant[]`: + -`ProductVariant`: #### Defined in -[medusa/src/services/product.ts:324](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L324) +[medusa/src/services/product.ts:327](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L327) ___ ### retrieve\_ -▸ **retrieve_**(`selector`, `config?`): `Promise`<`Product`\> +**retrieve_**(`selector`, `config?`): `Promise`<`Product`\> Gets a product by selector. Throws in case of DB Error and if product was not found. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`Product`\> | selector object | | `config` | `FindProductConfig` | object that defines what should be included in the query response | @@ -746,41 +780,44 @@ Throws in case of DB Error and if product was not found. `Promise`<`Product`\> -the result of the find one operation. +-`Promise`: the result of the find one operation. + -`Product`: #### Defined in -[medusa/src/services/product.ts:266](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L266) +[medusa/src/services/product.ts:269](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L269) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`productId`, `update`): `Promise`<`Product`\> +**update**(`productId`, `update`): `Promise`<`Product`\> Updates a product. Product variant updates should use dedicated methods, e.g. `addVariant`, etc. The function will throw errors if metadata or @@ -788,8 +825,8 @@ product variant updates are attempted. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `productId` | `string` | the id of the product. Must be a string that can be casted to an ObjectId | | `update` | `UpdateProductInput` | an object with the update values. | @@ -797,25 +834,26 @@ product variant updates are attempted. `Promise`<`Product`\> -resolves to the update result. +-`Promise`: resolves to the update result. + -`Product`: #### Defined in -[medusa/src/services/product.ts:526](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L526) +[medusa/src/services/product.ts:551](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L551) ___ ### updateOption -▸ **updateOption**(`productId`, `optionId`, `data`): `Promise`<`Product`\> +**updateOption**(`productId`, `optionId`, `data`): `Promise`<`Product`\> Updates a product's option. Throws if the call tries to update an option not associated with the product. Throws if the updated title already exists. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `productId` | `string` | the product whose option we are updating | | `optionId` | `string` | the id of the option we are updating | | `data` | `ProductOptionInput` | the data to update the option with | @@ -824,24 +862,25 @@ not associated with the product. Throws if the updated title already exists. `Promise`<`Product`\> -the updated product +-`Promise`: the updated product + -`Product`: #### Defined in -[medusa/src/services/product.ts:786](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L786) +[medusa/src/services/product.ts:811](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L811) ___ ### updateShippingProfile -▸ **updateShippingProfile**(`productIds`, `profileId`): `Promise`<`Product`[]\> +**updateShippingProfile**(`productIds`, `profileId`): `Promise`<`Product`[]\> Assign a product to a profile, if a profile id null is provided then detach the product from the profile #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `productIds` | `string` \| `string`[] | ID or IDs of the products to update | | `profileId` | ``null`` \| `string` | Shipping profile ID to update the shipping options with | @@ -849,32 +888,36 @@ Assign a product to a profile, if a profile id null is provided then detach the `Promise`<`Product`[]\> -updated products +-`Promise`: updated products + -`Product[]`: + -`Product`: #### Defined in -[medusa/src/services/product.ts:933](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product.ts#L933) +[medusa/src/services/product.ts:958](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product.ts#L958) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`ProductService`](ProductService.md) +**withTransaction**(`transactionManager?`): [`ProductService`](ProductService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`ProductService`](ProductService.md) +-`ProductService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/ProductTypeService.md b/www/apps/docs/content/references/services/classes/ProductTypeService.md index 7e076f9c9fcba..028ffb9d1c3b6 100644 --- a/www/apps/docs/content/references/services/classes/ProductTypeService.md +++ b/www/apps/docs/content/references/services/classes/ProductTypeService.md @@ -1,4 +1,4 @@ -# Class: ProductTypeService +# ProductTypeService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new ProductTypeService**(`«destructured»`) +**new ProductTypeService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `Object` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/product-type.ts:12](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-type.ts#L12) +[medusa/src/services/product-type.ts:12](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-type.ts#L12) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,13 +66,13 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -80,13 +80,13 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -94,57 +94,57 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### typeRepository\_ -• `Protected` `Readonly` **typeRepository\_**: `Repository`<`ProductType`\> & { `findAndCountByDiscountConditionId`: (`conditionId`: `string`, `query`: `ExtendedFindConfig`<`ProductType`\>) => `Promise`<[`ProductType`[], `number`]\> ; `upsertType`: (`type?`: `UpsertTypeInput`) => `Promise`<``null`` \| `ProductType`\> } + `Protected` `Readonly` **typeRepository\_**: `Repository`<`ProductType`\> & { `findAndCountByDiscountConditionId`: Method findAndCountByDiscountConditionId ; `upsertType`: Method upsertType } #### Defined in -[medusa/src/services/product-type.ts:10](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-type.ts#L10) +[medusa/src/services/product-type.ts:10](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-type.ts#L10) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -153,7 +153,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -161,20 +161,20 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### list -▸ **list**(`selector?`, `config?`): `Promise`<`ProductType`[]\> +**list**(`selector?`, `config?`): `Promise`<`ProductType`[]\> Lists product types #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`ProductType`\> & { `discount_condition_id?`: `string` ; `q?`: `string` } | the query object for find | | `config` | `FindConfig`<`ProductType`\> | the config to be used for find | @@ -182,24 +182,26 @@ Lists product types `Promise`<`ProductType`[]\> -the result of the find operation +-`Promise`: the result of the find operation + -`ProductType[]`: + -`ProductType`: #### Defined in -[medusa/src/services/product-type.ts:52](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-type.ts#L52) +[medusa/src/services/product-type.ts:52](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-type.ts#L52) ___ ### listAndCount -▸ **listAndCount**(`selector?`, `config?`): `Promise`<[`ProductType`[], `number`]\> +**listAndCount**(`selector?`, `config?`): `Promise`<[`ProductType`[], `number`]\> Lists product types and adds count. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`ProductType`\> & { `discount_condition_id?`: `string` ; `q?`: `string` } | the query object for find | | `config` | `FindConfig`<`ProductType`\> | the config to be used for find | @@ -207,25 +209,27 @@ Lists product types and adds count. `Promise`<[`ProductType`[], `number`]\> -the result of the find operation +-`Promise`: the result of the find operation + -`ProductType[]`: + -`number`: (optional) #### Defined in -[medusa/src/services/product-type.ts:69](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-type.ts#L69) +[medusa/src/services/product-type.ts:69](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-type.ts#L69) ___ ### retrieve -▸ **retrieve**(`id`, `config?`): `Promise`<`ProductType`\> +**retrieve**(`id`, `config?`): `Promise`<`ProductType`\> Gets a product type by id. Throws in case of DB Error and if product was not found. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `id` | `string` | id of the product to get. | | `config` | `FindConfig`<`ProductType`\> | object that defines what should be included in the query response | @@ -233,56 +237,61 @@ Throws in case of DB Error and if product was not found. `Promise`<`ProductType`\> -the result of the find one operation. +-`Promise`: the result of the find one operation. + -`ProductType`: #### Defined in -[medusa/src/services/product-type.ts:27](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-type.ts#L27) +[medusa/src/services/product-type.ts:27](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-type.ts#L27) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`ProductTypeService`](ProductTypeService.md) +**withTransaction**(`transactionManager?`): [`ProductTypeService`](ProductTypeService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`ProductTypeService`](ProductTypeService.md) +-`ProductTypeService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/ProductVariantInventoryService.md b/www/apps/docs/content/references/services/classes/ProductVariantInventoryService.md index 464273fcfc440..57a500d1cd964 100644 --- a/www/apps/docs/content/references/services/classes/ProductVariantInventoryService.md +++ b/www/apps/docs/content/references/services/classes/ProductVariantInventoryService.md @@ -1,4 +1,4 @@ -# Class: ProductVariantInventoryService +# ProductVariantInventoryService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new ProductVariantInventoryService**(`«destructured»`) +**new ProductVariantInventoryService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/product-variant-inventory.ts:50](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L50) +[medusa/src/services/product-variant-inventory.ts:50](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L50) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,43 +66,43 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### cacheService\_ -• `Protected` `Readonly` **cacheService\_**: `ICacheService` + `Protected` `Readonly` **cacheService\_**: `ICacheService` #### Defined in -[medusa/src/services/product-variant-inventory.ts:48](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L48) +[medusa/src/services/product-variant-inventory.ts:48](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L48) ___ ### eventBusService\_ -• `Protected` `Readonly` **eventBusService\_**: `IEventBusService` + `Protected` `Readonly` **eventBusService\_**: `IEventBusService` #### Defined in -[medusa/src/services/product-variant-inventory.ts:47](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L47) +[medusa/src/services/product-variant-inventory.ts:47](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L47) ___ ### inventoryService\_ -• `Protected` `Readonly` **inventoryService\_**: `IInventoryService` + `Protected` `Readonly` **inventoryService\_**: `IInventoryService` #### Defined in -[medusa/src/services/product-variant-inventory.ts:46](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L46) +[medusa/src/services/product-variant-inventory.ts:46](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L46) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Overrides @@ -110,53 +110,53 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/services/product-variant-inventory.ts:39](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L39) +[medusa/src/services/product-variant-inventory.ts:39](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L39) ___ ### productVariantService\_ -• `Protected` `Readonly` **productVariantService\_**: [`ProductVariantService`](ProductVariantService.md) + `Protected` `Readonly` **productVariantService\_**: [`ProductVariantService`](ProductVariantService.md) #### Defined in -[medusa/src/services/product-variant-inventory.ts:44](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L44) +[medusa/src/services/product-variant-inventory.ts:44](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L44) ___ ### salesChannelInventoryService\_ -• `Protected` `Readonly` **salesChannelInventoryService\_**: [`SalesChannelInventoryService`](SalesChannelInventoryService.md) + `Protected` `Readonly` **salesChannelInventoryService\_**: [`SalesChannelInventoryService`](SalesChannelInventoryService.md) #### Defined in -[medusa/src/services/product-variant-inventory.ts:43](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L43) +[medusa/src/services/product-variant-inventory.ts:43](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L43) ___ ### salesChannelLocationService\_ -• `Protected` `Readonly` **salesChannelLocationService\_**: [`SalesChannelLocationService`](SalesChannelLocationService.md) + `Protected` `Readonly` **salesChannelLocationService\_**: [`SalesChannelLocationService`](SalesChannelLocationService.md) #### Defined in -[medusa/src/services/product-variant-inventory.ts:42](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L42) +[medusa/src/services/product-variant-inventory.ts:42](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L42) ___ ### stockLocationService\_ -• `Protected` `Readonly` **stockLocationService\_**: `IStockLocationService` + `Protected` `Readonly` **stockLocationService\_**: `IStockLocationService` #### Defined in -[medusa/src/services/product-variant-inventory.ts:45](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L45) +[medusa/src/services/product-variant-inventory.ts:45](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L45) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Overrides @@ -164,38 +164,40 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/services/product-variant-inventory.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L40) +[medusa/src/services/product-variant-inventory.ts:40](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L40) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### adjustInventory -▸ **adjustInventory**(`variantId`, `locationId`, `quantity`): `Promise`<`void`\> +**adjustInventory**(`variantId`, `locationId`, `quantity`): `Promise`<`void`\> Adjusts inventory of a variant on a location #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `variantId` | `string` | variant id | | `locationId` | `string` | location id | | `quantity` | `number` | quantity to adjust | @@ -204,22 +206,24 @@ Adjusts inventory of a variant on a location `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/product-variant-inventory.ts:740](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L740) +[medusa/src/services/product-variant-inventory.ts:740](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L740) ___ ### adjustReservationsQuantityByLineItem -▸ **adjustReservationsQuantityByLineItem**(`lineItemId`, `variantId`, `locationId`, `quantity`): `Promise`<`void`\> +**adjustReservationsQuantityByLineItem**(`lineItemId`, `variantId`, `locationId`, `quantity`): `Promise`<`void`\> Adjusts the quantity of reservations for a line item by a given amount. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `lineItemId` | `string` | The ID of the line item | | `variantId` | `string` | The ID of the variant | | `locationId` | `string` | The ID of the location to prefer adjusting quantities at | @@ -229,31 +233,31 @@ Adjusts the quantity of reservations for a line item by a given amount. `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/product-variant-inventory.ts:530](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L530) +[medusa/src/services/product-variant-inventory.ts:530](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L530) ___ ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -262,7 +266,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -270,38 +274,40 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### attachInventoryItem -▸ **attachInventoryItem**(`attachments`): `Promise`<`ProductVariantInventoryItem`[]\> +**attachInventoryItem**(`attachments`): `Promise`<`ProductVariantInventoryItem`[]\> Attach a variant to an inventory item #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `attachments` | { `inventoryItemId`: `string` ; `requiredQuantity?`: `number` ; `variantId`: `string` }[] | #### Returns `Promise`<`ProductVariantInventoryItem`[]\> -the variant inventory item +-`Promise`: the variant inventory item + -`ProductVariantInventoryItem[]`: + -`ProductVariantInventoryItem`: #### Defined in -[medusa/src/services/product-variant-inventory.ts:257](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L257) +[medusa/src/services/product-variant-inventory.ts:257](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L257) -▸ **attachInventoryItem**(`variantId`, `inventoryItemId`, `requiredQuantity?`): `Promise`<`ProductVariantInventoryItem`[]\> +**attachInventoryItem**(`variantId`, `inventoryItemId`, `requiredQuantity?`): `Promise`<`ProductVariantInventoryItem`[]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `variantId` | `string` | | `inventoryItemId` | `string` | | `requiredQuantity?` | `number` | @@ -310,49 +316,53 @@ the variant inventory item `Promise`<`ProductVariantInventoryItem`[]\> +-`Promise`: + -`ProductVariantInventoryItem[]`: + -`ProductVariantInventoryItem`: + #### Defined in -[medusa/src/services/product-variant-inventory.ts:264](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L264) +[medusa/src/services/product-variant-inventory.ts:264](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L264) ___ ### confirmInventory -▸ **confirmInventory**(`variantId`, `quantity`, `context?`): `Promise`<`Boolean`\> +**confirmInventory**(`variantId`, `quantity`, `context?`): `Promise`<`Boolean`\> confirms if requested inventory is available #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `variantId` | `string` | id of the variant to confirm inventory for | | `quantity` | `number` | quantity of inventory to confirm is available | -| `context` | `Object` | optionally include a sales channel if applicable | -| `context.salesChannelId?` | ``null`` \| `string` | - | +| `context` | `object` | optionally include a sales channel if applicable | +| `context.salesChannelId?` | ``null`` \| `string` | #### Returns `Promise`<`Boolean`\> -boolean indicating if inventory is available +-`Promise`: boolean indicating if inventory is available #### Defined in -[medusa/src/services/product-variant-inventory.ts:76](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L76) +[medusa/src/services/product-variant-inventory.ts:76](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L76) ___ ### deleteReservationsByLineItem -▸ **deleteReservationsByLineItem**(`lineItemId`, `variantId`, `quantity`): `Promise`<`void`\> +**deleteReservationsByLineItem**(`lineItemId`, `variantId`, `quantity`): `Promise`<`void`\> delete a reservation of variant quantity #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `lineItemId` | `string` \| `string`[] | line item id | | `variantId` | `string` | variant id | | `quantity` | `number` | quantity to release | @@ -361,22 +371,24 @@ delete a reservation of variant quantity `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/product-variant-inventory.ts:705](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L705) +[medusa/src/services/product-variant-inventory.ts:705](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L705) ___ ### detachInventoryItem -▸ **detachInventoryItem**(`inventoryItemId`, `variantId?`): `Promise`<`void`\> +**detachInventoryItem**(`inventoryItemId`, `variantId?`): `Promise`<`void`\> Remove a variant from an inventory item #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `inventoryItemId` | `string` | inventory item id | | `variantId?` | `string` | variant id or undefined if all the variants will be affected | @@ -384,20 +396,22 @@ Remove a variant from an inventory item `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/product-variant-inventory.ts:409](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L409) +[medusa/src/services/product-variant-inventory.ts:409](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L409) ___ ### getAvailabilityContext -▸ `Private` **getAvailabilityContext**(`variants`, `salesChannelId`, `existingContext?`): `Promise`<`Required`<`AvailabilityContext`\>\> +`Private` **getAvailabilityContext**(`variants`, `salesChannelId`, `existingContext?`): `Promise`<`Required`<`AvailabilityContext`\>\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `variants` | `string`[] | | `salesChannelId` | `undefined` \| `string` \| `string`[] | | `existingContext` | `AvailabilityContext` | @@ -406,15 +420,18 @@ ___ `Promise`<`Required`<`AvailabilityContext`\>\> +-`Promise`: + -`Required`: + #### Defined in -[medusa/src/services/product-variant-inventory.ts:843](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L843) +[medusa/src/services/product-variant-inventory.ts:843](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L843) ___ ### getVariantQuantityFromVariantInventoryItems -▸ **getVariantQuantityFromVariantInventoryItems**(`variantInventoryItems`, `channelId`): `Promise`<`number`\> +**getVariantQuantityFromVariantInventoryItems**(`variantInventoryItems`, `channelId`): `Promise`<`number`\> Get the quantity of a variant from a list of variantInventoryItems The inventory quantity of the variant should be equal to the inventory @@ -423,8 +440,8 @@ the given variant. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `variantInventoryItems` | `ProductVariantInventoryItem`[] | List of inventoryItems for a given variant, These must all be for the same variant | | `channelId` | `string` | Sales channel id to fetch availability for | @@ -432,120 +449,128 @@ the given variant. `Promise`<`number`\> -The available quantity of the variant from the inventoryItems +-`Promise`: The available quantity of the variant from the inventoryItems + -`number`: (optional) #### Defined in -[medusa/src/services/product-variant-inventory.ts:954](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L954) +[medusa/src/services/product-variant-inventory.ts:954](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L954) ___ ### listByItem -▸ **listByItem**(`itemIds`): `Promise`<`ProductVariantInventoryItem`[]\> +**listByItem**(`itemIds`): `Promise`<`ProductVariantInventoryItem`[]\> list registered inventory items #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `itemIds` | `string`[] | list inventory item ids | #### Returns `Promise`<`ProductVariantInventoryItem`[]\> -list of inventory items +-`Promise`: list of inventory items + -`ProductVariantInventoryItem[]`: + -`ProductVariantInventoryItem`: #### Defined in -[medusa/src/services/product-variant-inventory.ts:179](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L179) +[medusa/src/services/product-variant-inventory.ts:179](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L179) ___ ### listByVariant -▸ **listByVariant**(`variantId`): `Promise`<`ProductVariantInventoryItem`[]\> +**listByVariant**(`variantId`): `Promise`<`ProductVariantInventoryItem`[]\> List inventory items for a specific variant #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `variantId` | `string` \| `string`[] | variant id | #### Returns `Promise`<`ProductVariantInventoryItem`[]\> -variant inventory items for the variant id +-`Promise`: variant inventory items for the variant id + -`ProductVariantInventoryItem[]`: + -`ProductVariantInventoryItem`: #### Defined in -[medusa/src/services/product-variant-inventory.ts:196](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L196) +[medusa/src/services/product-variant-inventory.ts:196](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L196) ___ ### listInventoryItemsByVariant -▸ **listInventoryItemsByVariant**(`variantId`): `Promise`<`InventoryItemDTO`[]\> +**listInventoryItemsByVariant**(`variantId`): `Promise`<`InventoryItemDTO`[]\> lists inventory items for a given variant #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `variantId` | `string` | variant id | #### Returns `Promise`<`InventoryItemDTO`[]\> -lidt of inventory items for the variant +-`Promise`: lidt of inventory items for the variant + -`InventoryItemDTO[]`: #### Defined in -[medusa/src/services/product-variant-inventory.ts:235](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L235) +[medusa/src/services/product-variant-inventory.ts:235](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L235) ___ ### listVariantsByItem -▸ **listVariantsByItem**(`itemId`): `Promise`<`ProductVariant`[]\> +**listVariantsByItem**(`itemId`): `Promise`<`ProductVariant`[]\> lists variant by inventory item id #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `itemId` | `string` | item id | #### Returns `Promise`<`ProductVariant`[]\> -a list of product variants that are associated with the item id +-`Promise`: a list of product variants that are associated with the item id + -`ProductVariant[]`: + -`ProductVariant`: #### Defined in -[medusa/src/services/product-variant-inventory.ts:217](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L217) +[medusa/src/services/product-variant-inventory.ts:217](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L217) ___ ### reserveQuantity -▸ **reserveQuantity**(`variantId`, `quantity`, `context?`): `Promise`<`void` \| `ReservationItemDTO`[]\> +**reserveQuantity**(`variantId`, `quantity`, `context?`): `Promise`<`void` \| `ReservationItemDTO`[]\> Reserves a quantity of a variant #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `variantId` | `string` | variant id | | `quantity` | `number` | quantity to reserve | | `context` | `ReserveQuantityContext` | optional parameters | @@ -554,22 +579,25 @@ Reserves a quantity of a variant `Promise`<`void` \| `ReservationItemDTO`[]\> +-`Promise`: + -`void \| ReservationItemDTO[]`: (optional) + #### Defined in -[medusa/src/services/product-variant-inventory.ts:439](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L439) +[medusa/src/services/product-variant-inventory.ts:439](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L439) ___ ### retrieve -▸ **retrieve**(`inventoryItemId`, `variantId`): `Promise`<`ProductVariantInventoryItem`\> +**retrieve**(`inventoryItemId`, `variantId`): `Promise`<`ProductVariantInventoryItem`\> Retrieves a product variant inventory item by its inventory item ID and variant ID. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `inventoryItemId` | `string` | The ID of the inventory item to retrieve. | | `variantId` | `string` | The ID of the variant to retrieve. | @@ -577,22 +605,23 @@ Retrieves a product variant inventory item by its inventory item ID and variant `Promise`<`ProductVariantInventoryItem`\> -A promise that resolves with the product variant inventory item. +-`Promise`: A promise that resolves with the product variant inventory item. + -`ProductVariantInventoryItem`: #### Defined in -[medusa/src/services/product-variant-inventory.ts:152](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L152) +[medusa/src/services/product-variant-inventory.ts:152](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L152) ___ ### setProductAvailability -▸ **setProductAvailability**(`products`, `salesChannelId`): `Promise`<(`Product` \| `PricedProduct`)[]\> +**setProductAvailability**(`products`, `salesChannelId`): `Promise`<(`Product` \| `PricedProduct`)[]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `products` | (`Product` \| `PricedProduct`)[] | | `salesChannelId` | `undefined` \| `string` \| `string`[] | @@ -600,20 +629,24 @@ ___ `Promise`<(`Product` \| `PricedProduct`)[]\> +-`Promise`: + -`(Product \| PricedProduct)[]`: + -`Product \| PricedProduct`: (optional) + #### Defined in -[medusa/src/services/product-variant-inventory.ts:910](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L910) +[medusa/src/services/product-variant-inventory.ts:910](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L910) ___ ### setVariantAvailability -▸ **setVariantAvailability**(`variants`, `salesChannelId`, `availabilityContext?`): `Promise`<`ProductVariant`[] \| `PricedVariant`[]\> +**setVariantAvailability**(`variants`, `salesChannelId`, `availabilityContext?`): `Promise`<`ProductVariant`[] \| `PricedVariant`[]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `variants` | `ProductVariant`[] \| `PricedVariant`[] | | `salesChannelId` | `undefined` \| `string` \| `string`[] | | `availabilityContext` | `AvailabilityContext` | @@ -622,46 +655,51 @@ ___ `Promise`<`ProductVariant`[] \| `PricedVariant`[]\> +-`Promise`: + -`ProductVariant[] \| PricedVariant[]`: (optional) + #### Defined in -[medusa/src/services/product-variant-inventory.ts:784](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L784) +[medusa/src/services/product-variant-inventory.ts:784](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L784) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### validateInventoryAtLocation -▸ **validateInventoryAtLocation**(`items`, `locationId`): `Promise`<`void`\> +**validateInventoryAtLocation**(`items`, `locationId`): `Promise`<`void`\> Validate stock at a location for fulfillment items #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `items` | `Omit`<`LineItem`, ``"beforeInsert"``\>[] | Fulfillment Line items to validate quantities for | | `locationId` | `string` | Location to validate stock at | @@ -669,32 +707,34 @@ Validate stock at a location for fulfillment items `Promise`<`void`\> -nothing if successful, throws error if not +-`Promise`: nothing if successful, throws error if not #### Defined in -[medusa/src/services/product-variant-inventory.ts:640](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant-inventory.ts#L640) +[medusa/src/services/product-variant-inventory.ts:640](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant-inventory.ts#L640) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`ProductVariantInventoryService`](ProductVariantInventoryService.md) +**withTransaction**(`transactionManager?`): [`ProductVariantInventoryService`](ProductVariantInventoryService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`ProductVariantInventoryService`](ProductVariantInventoryService.md) +-`ProductVariantInventoryService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/ProductVariantService.md b/www/apps/docs/content/references/services/classes/ProductVariantService.md index e92cd6cc538fb..b3546c63be307 100644 --- a/www/apps/docs/content/references/services/classes/ProductVariantService.md +++ b/www/apps/docs/content/references/services/classes/ProductVariantService.md @@ -1,4 +1,4 @@ -# Class: ProductVariantService +# ProductVariantService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new ProductVariantService**(`«destructured»`) +**new ProductVariantService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `Object` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/product-variant.ts:74](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L74) +[medusa/src/services/product-variant.ts:74](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L74) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,33 +66,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### cartRepository\_ -• `Protected` `Readonly` **cartRepository\_**: `Repository`<`Cart`\> & { `findOneWithRelations`: (`relations`: `FindOptionsRelations`<`Cart`\>, `optionsWithoutRelations`: `Omit`<`FindManyOptions`<`Cart`\>, ``"relations"``\>) => `Promise`<`Cart`\> ; `findWithRelations`: (`relations`: `FindOptionsRelations`<`Cart`\>, `optionsWithoutRelations`: `Omit`<`FindManyOptions`<`Cart`\>, ``"relations"``\>) => `Promise`<`Cart`[]\> } + `Protected` `Readonly` **cartRepository\_**: `Repository`<`Cart`\> & { `findOneWithRelations`: Method findOneWithRelations ; `findWithRelations`: Method findWithRelations } #### Defined in -[medusa/src/services/product-variant.ts:72](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L72) +[medusa/src/services/product-variant.ts:72](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L72) ___ ### eventBus\_ -• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/product-variant.ts:66](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L66) +[medusa/src/services/product-variant.ts:66](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L66) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -100,73 +100,73 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### moneyAmountRepository\_ -• `Protected` `Readonly` **moneyAmountRepository\_**: `Repository`<`MoneyAmount`\> & { `addPriceListPrices`: (`priceListId`: `string`, `prices`: `PriceListPriceCreateInput`[], `overrideExisting`: `boolean`) => `Promise`<`MoneyAmount`[]\> ; `createProductVariantMoneyAmounts`: (`toCreate`: { `money_amount_id`: `string` ; `variant_id`: `string` }[]) => `Promise`<`InsertResult`\> ; `deletePriceListPrices`: (`priceListId`: `string`, `moneyAmountIds`: `string`[]) => `Promise`<`void`\> ; `deleteVariantPricesNotIn`: (`variantIdOrData`: `string` \| { `prices`: `ProductVariantPrice`[] ; `variantId`: `string` }[], `prices?`: `Price`[]) => `Promise`<`void`\> ; `findCurrencyMoneyAmounts`: (`where`: { `currency_code`: `string` ; `variant_id`: `string` }[]) => `Promise`<{ `amount`: `number` ; `created_at`: `Date` ; `currency?`: `Currency` ; `currency_code`: `string` ; `deleted_at`: ``null`` \| `Date` ; `id`: `string` ; `max_quantity`: ``null`` \| `number` ; `min_quantity`: ``null`` \| `number` ; `price_list`: ``null`` \| `PriceList` ; `price_list_id`: ``null`` \| `string` ; `region?`: `Region` ; `region_id`: `string` ; `updated_at`: `Date` ; `variant`: `ProductVariant` ; `variant_id`: `any` ; `variants`: `ProductVariant`[] }[]\> ; `findManyForVariantInPriceList`: (`variant_id`: `string`, `price_list_id`: `string`, `requiresPriceList`: `boolean`) => `Promise`<[`MoneyAmount`[], `number`]\> ; `findManyForVariantInRegion`: (`variant_id`: `string`, `region_id?`: `string`, `currency_code?`: `string`, `customer_id?`: `string`, `include_discount_prices?`: `boolean`, `include_tax_inclusive_pricing`: `boolean`) => `Promise`<[`MoneyAmount`[], `number`]\> ; `findManyForVariantsInRegion`: (`variant_ids`: `string` \| `string`[], `region_id?`: `string`, `currency_code?`: `string`, `customer_id?`: `string`, `include_discount_prices?`: `boolean`, `include_tax_inclusive_pricing`: `boolean`) => `Promise`<[`Record`<`string`, `MoneyAmount`[]\>, `number`]\> ; `findRegionMoneyAmounts`: (`where`: { `region_id`: `string` ; `variant_id`: `string` }[]) => `Promise`<{ `amount`: `number` ; `created_at`: `Date` ; `currency?`: `Currency` ; `currency_code`: `string` ; `deleted_at`: ``null`` \| `Date` ; `id`: `string` ; `max_quantity`: ``null`` \| `number` ; `min_quantity`: ``null`` \| `number` ; `price_list`: ``null`` \| `PriceList` ; `price_list_id`: ``null`` \| `string` ; `region?`: `Region` ; `region_id`: `string` ; `updated_at`: `Date` ; `variant`: `ProductVariant` ; `variant_id`: `any` ; `variants`: `ProductVariant`[] }[]\> ; `findVariantPricesNotIn`: (`variantId`: `string`, `prices`: `Price`[]) => `Promise`<`MoneyAmount`[]\> ; `getPricesForVariantInRegion`: (`variantId`: `string`, `regionId`: `undefined` \| `string`) => `Promise`<`MoneyAmount`[]\> ; `insertBulk`: (`data`: `_QueryDeepPartialEntity`<`MoneyAmount`\>[]) => `Promise`<`MoneyAmount`[]\> ; `updatePriceListPrices`: (`priceListId`: `string`, `updates`: `PriceListPriceUpdateInput`[]) => `Promise`<`MoneyAmount`[]\> ; `upsertVariantCurrencyPrice`: (`variantId`: `string`, `price`: `Price`) => `Promise`<`MoneyAmount`\> } + `Protected` `Readonly` **moneyAmountRepository\_**: `Repository`<`MoneyAmount`\> & { `addPriceListPrices`: Method addPriceListPrices ; `createProductVariantMoneyAmounts`: Method createProductVariantMoneyAmounts ; `deletePriceListPrices`: Method deletePriceListPrices ; `deleteVariantPricesNotIn`: Method deleteVariantPricesNotIn ; `findCurrencyMoneyAmounts`: Method findCurrencyMoneyAmounts ; `findManyForVariantInPriceList`: Method findManyForVariantInPriceList ; `findManyForVariantInRegion`: Method findManyForVariantInRegion ; `findManyForVariantsInRegion`: Method findManyForVariantsInRegion ; `findRegionMoneyAmounts`: Method findRegionMoneyAmounts ; `findVariantPricesNotIn`: Method findVariantPricesNotIn ; `getPricesForVariantInRegion`: Method getPricesForVariantInRegion ; `insertBulk`: Method insertBulk ; `updatePriceListPrices`: Method updatePriceListPrices ; `upsertVariantCurrencyPrice`: Method upsertVariantCurrencyPrice } #### Defined in -[medusa/src/services/product-variant.ts:69](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L69) +[medusa/src/services/product-variant.ts:69](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L69) ___ ### priceSelectionStrategy\_ -• `Protected` `Readonly` **priceSelectionStrategy\_**: `IPriceSelectionStrategy` + `Protected` `Readonly` **priceSelectionStrategy\_**: `IPriceSelectionStrategy` #### Defined in -[medusa/src/services/product-variant.ts:68](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L68) +[medusa/src/services/product-variant.ts:68](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L68) ___ ### productOptionValueRepository\_ -• `Protected` `Readonly` **productOptionValueRepository\_**: `Repository`<`ProductOptionValue`\> + `Protected` `Readonly` **productOptionValueRepository\_**: `Repository`<`ProductOptionValue`\> #### Defined in -[medusa/src/services/product-variant.ts:71](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L71) +[medusa/src/services/product-variant.ts:71](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L71) ___ ### productRepository\_ -• `Protected` `Readonly` **productRepository\_**: `Repository`<`Product`\> & { `_applyCategoriesQuery`: (`qb`: `SelectQueryBuilder`<`Product`\>, `__namedParameters`: `Object`) => `SelectQueryBuilder`<`Product`\> ; `_findWithRelations`: (`__namedParameters`: { `idsOrOptionsWithoutRelations`: `string`[] \| `FindWithoutRelationsOptions` ; `relations`: `string`[] ; `shouldCount`: `boolean` ; `withDeleted`: `boolean` }) => `Promise`<[`Product`[], `number`]\> ; `bulkAddToCollection`: (`productIds`: `string`[], `collectionId`: `string`) => `Promise`<`Product`[]\> ; `bulkRemoveFromCollection`: (`productIds`: `string`[], `collectionId`: `string`) => `Promise`<`Product`[]\> ; `findOneWithRelations`: (`relations`: `string`[], `optionsWithoutRelations`: `FindWithoutRelationsOptions`) => `Promise`<`Product`\> ; `findWithRelations`: (`relations`: `string`[], `idsOrOptionsWithoutRelations`: `string`[] \| `FindWithoutRelationsOptions`, `withDeleted`: `boolean`) => `Promise`<`Product`[]\> ; `findWithRelationsAndCount`: (`relations`: `string`[], `idsOrOptionsWithoutRelations`: `FindWithoutRelationsOptions`) => `Promise`<[`Product`[], `number`]\> ; `getCategoryIdsFromInput`: (`categoryId?`: `CategoryQueryParams`, `includeCategoryChildren`: `boolean`) => `Promise`<`string`[]\> ; `getCategoryIdsRecursively`: (`productCategory`: `ProductCategory`) => `string`[] ; `getFreeTextSearchResultsAndCount`: (`q`: `string`, `options`: `FindWithoutRelationsOptions`, `relations`: `string`[]) => `Promise`<[`Product`[], `number`]\> ; `isProductInSalesChannels`: (`id`: `string`, `salesChannelIds`: `string`[]) => `Promise`<`boolean`\> ; `queryProducts`: (`optionsWithoutRelations`: `FindWithoutRelationsOptions`, `shouldCount`: `boolean`) => `Promise`<[`Product`[], `number`]\> ; `queryProductsWithIds`: (`__namedParameters`: { `entityIds`: `string`[] ; `groupedRelations`: { `[toplevel: string]`: `string`[]; } ; `order?`: { `[column: string]`: ``"ASC"`` \| ``"DESC"``; } ; `select?`: keyof `Product`[] ; `where?`: `FindOptionsWhere`<`Product`\> ; `withDeleted?`: `boolean` }) => `Promise`<`Product`[]\> } + `Protected` `Readonly` **productRepository\_**: `Repository`<`Product`\> & { `_applyCategoriesQuery`: Method \_applyCategoriesQuery ; `_findWithRelations`: Method \_findWithRelations ; `bulkAddToCollection`: Method bulkAddToCollection ; `bulkRemoveFromCollection`: Method bulkRemoveFromCollection ; `findOneWithRelations`: Method findOneWithRelations ; `findWithRelations`: Method findWithRelations ; `findWithRelationsAndCount`: Method findWithRelationsAndCount ; `getCategoryIdsFromInput`: Method getCategoryIdsFromInput ; `getCategoryIdsRecursively`: Method getCategoryIdsRecursively ; `getFreeTextSearchResultsAndCount`: Method getFreeTextSearchResultsAndCount ; `isProductInSalesChannels`: Method isProductInSalesChannels ; `queryProducts`: Method queryProducts ; `queryProductsWithIds`: Method queryProductsWithIds } #### Defined in -[medusa/src/services/product-variant.ts:65](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L65) +[medusa/src/services/product-variant.ts:65](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L65) ___ ### productVariantRepository\_ -• `Protected` `Readonly` **productVariantRepository\_**: `Repository`<`ProductVariant`\> + `Protected` `Readonly` **productVariantRepository\_**: `Repository`<`ProductVariant`\> #### Defined in -[medusa/src/services/product-variant.ts:64](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L64) +[medusa/src/services/product-variant.ts:64](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L64) ___ ### regionService\_ -• `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md) + `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md) #### Defined in -[medusa/src/services/product-variant.ts:67](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L67) +[medusa/src/services/product-variant.ts:67](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L67) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -174,13 +174,13 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### Events -▪ `Static` **Events**: `Object` + `Static` **Events**: `Object` #### Type declaration @@ -192,31 +192,33 @@ ___ #### Defined in -[medusa/src/services/product-variant.ts:58](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L58) +[medusa/src/services/product-variant.ts:58](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L58) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### addOptionValue -▸ **addOptionValue**(`variantId`, `optionId`, `optionValue`): `Promise`<`ProductOptionValue`\> +**addOptionValue**(`variantId`, `optionId`, `optionValue`): `Promise`<`ProductOptionValue`\> Adds option value to a variant. Fails when product with variant does not exist or @@ -226,8 +228,8 @@ Option value must be of type string or number. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `variantId` | `string` | the variant to decorate. | | `optionId` | `string` | the option from product. | | `optionValue` | `string` | option value to add. | @@ -236,33 +238,32 @@ Option value must be of type string or number. `Promise`<`ProductOptionValue`\> -the result of the update operation. +-`Promise`: the result of the update operation. + -`ProductOptionValue`: #### Defined in -[medusa/src/services/product-variant.ts:843](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L843) +[medusa/src/services/product-variant.ts:843](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L843) ___ ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -271,7 +272,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -279,79 +280,77 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**<`TVariants`, `TOutput`\>(`productOrProductId`, `variants`): `Promise`<`TOutput`\> +**create**<`TVariants`, `TOutput`\>(`productOrProductId`, `variants`): `Promise`<`TOutput`\> Creates an unpublished product variant. Will validate against parent product to ensure that the variant can in fact be created. -#### Type parameters - | Name | Type | | :------ | :------ | -| `TVariants` | extends `CreateProductVariantInput` \| `CreateProductVariantInput`[] | -| `TOutput` | `TVariants` extends `CreateProductVariantInput`[] ? `CreateProductVariantInput`[] : `CreateProductVariantInput` | +| `TVariants` | `CreateProductVariantInput` \| `CreateProductVariantInput`[] | +| `TOutput` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `productOrProductId` | `string` \| `Product` | the product the variant will be added to | -| `variants` | `CreateProductVariantInput` \| `CreateProductVariantInput`[] | | +| `variants` | `CreateProductVariantInput` \| `CreateProductVariantInput`[] | #### Returns `Promise`<`TOutput`\> -resolves to the creation result. +-`Promise`: resolves to the creation result. #### Defined in -[medusa/src/services/product-variant.ts:167](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L167) +[medusa/src/services/product-variant.ts:167](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L167) ___ ### delete -▸ **delete**(`variantIds`): `Promise`<`void`\> +**delete**(`variantIds`): `Promise`<`void`\> Deletes variant or variants. Will never fail due to delete being idempotent. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `variantIds` | `string` \| `string`[] | the id of the variant to delete. Must be castable as an ObjectId | #### Returns `Promise`<`void`\> -empty promise +-`Promise`: empty promise #### Defined in -[medusa/src/services/product-variant.ts:1013](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L1013) +[medusa/src/services/product-variant.ts:1013](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L1013) ___ ### deleteOptionValue -▸ **deleteOptionValue**(`variantId`, `optionId`): `Promise`<`void`\> +**deleteOptionValue**(`variantId`, `optionId`): `Promise`<`void`\> Deletes option value from given variant. Will never fail due to delete being idempotent. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `variantId` | `string` | the variant to decorate. | | `optionId` | `string` | the option from product. | @@ -359,25 +358,25 @@ Will never fail due to delete being idempotent. `Promise`<`void`\> -empty promise +-`Promise`: empty promise #### Defined in -[medusa/src/services/product-variant.ts:870](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L870) +[medusa/src/services/product-variant.ts:870](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L870) ___ ### getFreeTextQueryBuilder\_ -▸ **getFreeTextQueryBuilder_**(`variantRepo`, `query`, `q?`): `SelectQueryBuilder`<`ProductVariant`\> +**getFreeTextQueryBuilder_**(`variantRepo`, `query`, `q?`): `SelectQueryBuilder`<`ProductVariant`\> Lists variants based on the provided parameters and includes the count of variants that match the query. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `variantRepo` | `Repository`<`ProductVariant`\> | the variant repository | | `query` | `FindWithRelationsOptions` | object that defines the scope for what should be returned | | `q?` | `string` | free text query | @@ -386,18 +385,19 @@ variants that match the query. `SelectQueryBuilder`<`ProductVariant`\> -an array containing the products as the first element and the total +-`SelectQueryBuilder`: an array containing the products as the first element and the total count of products that matches the query as the second element. + -`ProductVariant`: #### Defined in -[medusa/src/services/product-variant.ts:1076](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L1076) +[medusa/src/services/product-variant.ts:1076](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L1076) ___ ### getRegionPrice -▸ **getRegionPrice**(`variantId`, `context`): `Promise`<``null`` \| `number`\> +**getRegionPrice**(`variantId`, `context`): `Promise`<``null`` \| `number`\> Gets the price specific to a region. If no region specific money amount exists the function will try to use a currency price. If no default @@ -405,8 +405,8 @@ currency price exists the function will throw an error. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `variantId` | `string` | the id of the variant to get price from | | `context` | `GetRegionPriceContext` | context for getting region price | @@ -414,24 +414,25 @@ currency price exists the function will throw an error. `Promise`<``null`` \| `number`\> -the price specific to the region +-`Promise`: the price specific to the region + -```null`` \| number`: (optional) #### Defined in -[medusa/src/services/product-variant.ts:708](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L708) +[medusa/src/services/product-variant.ts:708](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L708) ___ ### isVariantInSalesChannels -▸ **isVariantInSalesChannels**(`id`, `salesChannelIds`): `Promise`<`boolean`\> +**isVariantInSalesChannels**(`id`, `salesChannelIds`): `Promise`<`boolean`\> Check if the variant is assigned to at least one of the provided sales channels. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `id` | `string` | product variant id | | `salesChannelIds` | `string`[] | an array of sales channel ids | @@ -439,20 +440,23 @@ Check if the variant is assigned to at least one of the provided sales channels. `Promise`<`boolean`\> +-`Promise`: + -`boolean`: (optional) + #### Defined in -[medusa/src/services/product-variant.ts:1051](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L1051) +[medusa/src/services/product-variant.ts:1051](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L1051) ___ ### list -▸ **list**(`selector`, `config?`): `Promise`<`ProductVariant`[]\> +**list**(`selector`, `config?`): `Promise`<`ProductVariant`[]\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `FilterableProductVariantProps` | the query object for find | | `config` | `FindConfig`<`ProductVariant`\> & `PriceSelectionContext` | query config object for variant retrieval | @@ -460,22 +464,24 @@ ___ `Promise`<`ProductVariant`[]\> -the result of the find operation +-`Promise`: the result of the find operation + -`ProductVariant[]`: + -`ProductVariant`: #### Defined in -[medusa/src/services/product-variant.ts:959](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L959) +[medusa/src/services/product-variant.ts:959](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L959) ___ ### listAndCount -▸ **listAndCount**(`selector`, `config?`): `Promise`<[`ProductVariant`[], `number`]\> +**listAndCount**(`selector`, `config?`): `Promise`<[`ProductVariant`[], `number`]\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `FilterableProductVariantProps` | the query object for find | | `config` | `FindConfig`<`ProductVariant`\> & `PriceSelectionContext` | query config object for variant retrieval | @@ -483,24 +489,26 @@ ___ `Promise`<[`ProductVariant`[], `number`]\> -the result of the find operation +-`Promise`: the result of the find operation + -`ProductVariant[]`: + -`number`: (optional) #### Defined in -[medusa/src/services/product-variant.ts:898](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L898) +[medusa/src/services/product-variant.ts:898](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L898) ___ ### retrieve -▸ **retrieve**(`variantId`, `config?`): `Promise`<`ProductVariant`\> +**retrieve**(`variantId`, `config?`): `Promise`<`ProductVariant`\> Gets a product variant by id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `variantId` | `string` | the id of the product to get. | | `config` | `FindConfig`<`ProductVariant`\> & `PriceSelectionContext` | query config object for variant retrieval. | @@ -508,24 +516,25 @@ Gets a product variant by id. `Promise`<`ProductVariant`\> -the product document. +-`Promise`: the product document. + -`ProductVariant`: #### Defined in -[medusa/src/services/product-variant.ts:103](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L103) +[medusa/src/services/product-variant.ts:103](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L103) ___ ### retrieveBySKU -▸ **retrieveBySKU**(`sku`, `config?`): `Promise`<`ProductVariant`\> +**retrieveBySKU**(`sku`, `config?`): `Promise`<`ProductVariant`\> Gets a product variant by id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `sku` | `string` | The unique stock keeping unit used to identify the product variant. | | `config` | `FindConfig`<`ProductVariant`\> & `PriceSelectionContext` | query config object for variant retrieval. | @@ -533,22 +542,23 @@ Gets a product variant by id. `Promise`<`ProductVariant`\> -the product document. +-`Promise`: the product document. + -`ProductVariant`: #### Defined in -[medusa/src/services/product-variant.ts:131](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L131) +[medusa/src/services/product-variant.ts:131](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L131) ___ ### setCurrencyPrice -▸ **setCurrencyPrice**(`variantId`, `price`): `Promise`<`MoneyAmount`\> +**setCurrencyPrice**(`variantId`, `price`): `Promise`<`MoneyAmount`\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `variantId` | `string` | the id of the variant to set prices for | | `price` | `ProductVariantPrice` | the price for the variant | @@ -556,27 +566,28 @@ ___ `Promise`<`MoneyAmount`\> -the result of the update operation +-`Promise`: the result of the update operation + -`MoneyAmount`: -**`Deprecated`** +**Deprecated** use addOrUpdateCurrencyPrices instead Sets the default price for the given currency. #### Defined in -[medusa/src/services/product-variant.ts:784](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L784) +[medusa/src/services/product-variant.ts:784](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L784) ___ ### setRegionPrice -▸ **setRegionPrice**(`variantId`, `price`): `Promise`<`MoneyAmount`\> +**setRegionPrice**(`variantId`, `price`): `Promise`<`MoneyAmount`\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `variantId` | `string` | the id of the variant to update | | `price` | `ProductVariantPrice` | the price for the variant. | @@ -584,66 +595,71 @@ ___ `Promise`<`MoneyAmount`\> -the result of the update operation +-`Promise`: the result of the update operation + -`MoneyAmount`: -**`Deprecated`** +**Deprecated** use addOrUpdateRegionPrices instead Sets the default price of a specific region #### Defined in -[medusa/src/services/product-variant.ts:737](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L737) +[medusa/src/services/product-variant.ts:737](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L737) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`variantData`): `Promise`<`ProductVariant`[]\> +**update**(`variantData`): `Promise`<`ProductVariant`[]\> Updates a collection of variant. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `variantData` | { `updateData`: `UpdateProductVariantInput` ; `variant`: `ProductVariant` }[] | a collection of variant and the data to update. | #### Returns `Promise`<`ProductVariant`[]\> -resolves to the update result. +-`Promise`: resolves to the update result. + -`ProductVariant[]`: + -`ProductVariant`: #### Defined in -[medusa/src/services/product-variant.ts:265](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L265) +[medusa/src/services/product-variant.ts:265](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L265) -▸ **update**(`variantOrVariantId`, `update`): `Promise`<`ProductVariant`\> +**update**(`variantOrVariantId`, `update`): `Promise`<`ProductVariant`\> Updates a variant. Price updates should use dedicated methods. @@ -651,8 +667,8 @@ The function will throw, if price updates are attempted. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `variantOrVariantId` | `string` \| `Partial`<`ProductVariant`\> | variant or id of a variant. | | `update` | `UpdateProductVariantInput` | an object with the update values. | @@ -660,18 +676,19 @@ The function will throw, if price updates are attempted. `Promise`<`ProductVariant`\> -resolves to the update result. +-`Promise`: resolves to the update result. + -`ProductVariant`: #### Defined in -[medusa/src/services/product-variant.ts:280](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L280) +[medusa/src/services/product-variant.ts:280](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L280) -▸ **update**(`variantOrVariantId`, `update`): `Promise`<`ProductVariant`\> +**update**(`variantOrVariantId`, `update`): `Promise`<`ProductVariant`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `variantOrVariantId` | `string` \| `Partial`<`ProductVariant`\> | | `update` | `UpdateProductVariantInput` | @@ -679,43 +696,50 @@ resolves to the update result. `Promise`<`ProductVariant`\> +-`Promise`: + -`ProductVariant`: + #### Defined in -[medusa/src/services/product-variant.ts:285](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L285) +[medusa/src/services/product-variant.ts:285](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L285) ___ ### updateBatch -▸ `Protected` **updateBatch**(`variantData`): `Promise`<`ProductVariant`[]\> +`Protected` **updateBatch**(`variantData`): `Promise`<`ProductVariant`[]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `variantData` | `UpdateProductVariantData`[] | #### Returns `Promise`<`ProductVariant`[]\> +-`Promise`: + -`ProductVariant[]`: + -`ProductVariant`: + #### Defined in -[medusa/src/services/product-variant.ts:339](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L339) +[medusa/src/services/product-variant.ts:339](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L339) ___ ### updateOptionValue -▸ **updateOptionValue**(`variantId`, `optionId`, `optionValue`): `Promise`<`ProductOptionValue`\> +**updateOptionValue**(`variantId`, `optionId`, `optionValue`): `Promise`<`ProductOptionValue`\> Updates variant's option value. Option value must be of type string or number. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `variantId` | `string` | the variant to decorate. | | `optionId` | `string` | the option from product. | | `optionValue` | `string` | option value to add. | @@ -724,46 +748,47 @@ Option value must be of type string or number. `Promise`<`ProductOptionValue`\> -the result of the update operation. +-`Promise`: the result of the update operation. + -`ProductOptionValue`: #### Defined in -[medusa/src/services/product-variant.ts:805](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L805) +[medusa/src/services/product-variant.ts:805](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L805) ___ ### updateVariantPrices -▸ **updateVariantPrices**(`data`): `Promise`<`void`\> +**updateVariantPrices**(`data`): `Promise`<`void`\> Updates variant/prices collection. Deletes any prices that are not in the update object, and is not associated with a price list. #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `data` | `UpdateVariantPricesData`[] | #### Returns `Promise`<`void`\> -empty promise +-`Promise`: empty promise #### Defined in -[medusa/src/services/product-variant.ts:438](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L438) +[medusa/src/services/product-variant.ts:438](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L438) -▸ **updateVariantPrices**(`variantId`, `prices`): `Promise`<`void`\> +**updateVariantPrices**(`variantId`, `prices`): `Promise`<`void`\> Updates a variant's prices. Deletes any prices that are not in the update object, and is not associated with a price list. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `variantId` | `string` | the id of variant | | `prices` | `ProductVariantPrice`[] | the update prices | @@ -771,82 +796,88 @@ Deletes any prices that are not in the update object, and is not associated with `Promise`<`void`\> -empty promise +-`Promise`: empty promise #### Defined in -[medusa/src/services/product-variant.ts:447](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L447) +[medusa/src/services/product-variant.ts:447](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L447) ___ ### updateVariantPricesBatch -▸ `Protected` **updateVariantPricesBatch**(`data`): `Promise`<`void`\> +`Protected` **updateVariantPricesBatch**(`data`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `data` | `UpdateVariantPricesData`[] | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/product-variant.ts:467](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L467) +[medusa/src/services/product-variant.ts:467](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L467) ___ ### upsertCurrencyPrices -▸ **upsertCurrencyPrices**(`data`): `Promise`<`void`\> +**upsertCurrencyPrices**(`data`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `data` | { `price`: `WithRequiredProperty`<`ProductVariantPrice`, ``"currency_code"``\> ; `variantId`: `string` }[] | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/product-variant.ts:618](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L618) +[medusa/src/services/product-variant.ts:618](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L618) ___ ### upsertRegionPrices -▸ **upsertRegionPrices**(`data`): `Promise`<`void`\> +**upsertRegionPrices**(`data`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `data` | `UpdateVariantRegionPriceData`[] | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/product-variant.ts:540](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L540) +[medusa/src/services/product-variant.ts:540](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L540) ___ ### validateVariantsToCreate\_ -▸ `Protected` **validateVariantsToCreate_**(`product`, `variants`): `void` +`Protected` **validateVariantsToCreate_**(`product`, `variants`): `void` #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `product` | `Product` | | `variants` | `CreateProductVariantInput`[] | @@ -854,30 +885,34 @@ ___ `void` +-`void`: (optional) + #### Defined in -[medusa/src/services/product-variant.ts:1111](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/product-variant.ts#L1111) +[medusa/src/services/product-variant.ts:1111](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/product-variant.ts#L1111) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`ProductVariantService`](ProductVariantService.md) +**withTransaction**(`transactionManager?`): [`ProductVariantService`](ProductVariantService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`ProductVariantService`](ProductVariantService.md) +-`ProductVariantService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/RegionService.md b/www/apps/docs/content/references/services/classes/RegionService.md index 7532f334741e8..f345184d2dfa2 100644 --- a/www/apps/docs/content/references/services/classes/RegionService.md +++ b/www/apps/docs/content/references/services/classes/RegionService.md @@ -1,4 +1,4 @@ -# Class: RegionService +# RegionService Provides layer to manipulate regions. @@ -12,12 +12,12 @@ Provides layer to manipulate regions. ### constructor -• **new RegionService**(`«destructured»`) +**new RegionService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -26,13 +26,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/region.ts:64](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L64) +[medusa/src/services/region.ts:64](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L64) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -68,73 +68,73 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### countryRepository\_ -• `Protected` `Readonly` **countryRepository\_**: `Repository`<`Country`\> + `Protected` `Readonly` **countryRepository\_**: `Repository`<`Country`\> #### Defined in -[medusa/src/services/region.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L56) +[medusa/src/services/region.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L56) ___ ### currencyRepository\_ -• `Protected` `Readonly` **currencyRepository\_**: `Repository`<`Currency`\> + `Protected` `Readonly` **currencyRepository\_**: `Repository`<`Currency`\> #### Defined in -[medusa/src/services/region.ts:57](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L57) +[medusa/src/services/region.ts:57](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L57) ___ ### eventBus\_ -• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/region.ts:51](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L51) +[medusa/src/services/region.ts:51](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L51) ___ ### featureFlagRouter\_ -• `Protected` **featureFlagRouter\_**: `FlagRouter` + `Protected` **featureFlagRouter\_**: `FlagRouter` #### Defined in -[medusa/src/services/region.ts:49](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L49) +[medusa/src/services/region.ts:49](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L49) ___ ### fulfillmentProviderRepository\_ -• `Protected` `Readonly` **fulfillmentProviderRepository\_**: `Repository`<`FulfillmentProvider`\> + `Protected` `Readonly` **fulfillmentProviderRepository\_**: `Repository`<`FulfillmentProvider`\> #### Defined in -[medusa/src/services/region.ts:61](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L61) +[medusa/src/services/region.ts:61](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L61) ___ ### fulfillmentProviderService\_ -• `Protected` `Readonly` **fulfillmentProviderService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md) + `Protected` `Readonly` **fulfillmentProviderService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md) #### Defined in -[medusa/src/services/region.ts:54](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L54) +[medusa/src/services/region.ts:54](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L54) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -142,63 +142,63 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### paymentProviderRepository\_ -• `Protected` `Readonly` **paymentProviderRepository\_**: `Repository`<`PaymentProvider`\> + `Protected` `Readonly` **paymentProviderRepository\_**: `Repository`<`PaymentProvider`\> #### Defined in -[medusa/src/services/region.ts:59](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L59) +[medusa/src/services/region.ts:59](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L59) ___ ### paymentProviderService\_ -• `Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md) + `Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md) #### Defined in -[medusa/src/services/region.ts:53](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L53) +[medusa/src/services/region.ts:53](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L53) ___ ### regionRepository\_ -• `Protected` `Readonly` **regionRepository\_**: `Repository`<`Region`\> + `Protected` `Readonly` **regionRepository\_**: `Repository`<`Region`\> #### Defined in -[medusa/src/services/region.ts:55](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L55) +[medusa/src/services/region.ts:55](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L55) ___ ### storeService\_ -• `Protected` `Readonly` **storeService\_**: [`StoreService`](StoreService.md) + `Protected` `Readonly` **storeService\_**: [`StoreService`](StoreService.md) #### Defined in -[medusa/src/services/region.ts:52](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L52) +[medusa/src/services/region.ts:52](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L52) ___ ### taxProviderRepository\_ -• `Protected` `Readonly` **taxProviderRepository\_**: `Repository`<`TaxProvider`\> + `Protected` `Readonly` **taxProviderRepository\_**: `Repository`<`TaxProvider`\> #### Defined in -[medusa/src/services/region.ts:62](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L62) +[medusa/src/services/region.ts:62](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L62) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -206,13 +206,13 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### Events -▪ `Static` **Events**: `Object` + `Static` **Events**: `Object` #### Type declaration @@ -224,38 +224,40 @@ ___ #### Defined in -[medusa/src/services/region.ts:43](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L43) +[medusa/src/services/region.ts:43](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L43) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### addCountry -▸ **addCountry**(`regionId`, `code`): `Promise`<`Region`\> +**addCountry**(`regionId`, `code`): `Promise`<`Region`\> Adds a country to the region. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `regionId` | `string` | the region to add a country to | | `code` | `string` | a 2 digit alphanumeric ISO country code. | @@ -263,25 +265,26 @@ Adds a country to the region. `Promise`<`Region`\> -the updated Region +-`Promise`: the updated Region + -`Region`: #### Defined in -[medusa/src/services/region.ts:577](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L577) +[medusa/src/services/region.ts:577](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L577) ___ ### addFulfillmentProvider -▸ **addFulfillmentProvider**(`regionId`, `providerId`): `Promise`<`Region`\> +**addFulfillmentProvider**(`regionId`, `providerId`): `Promise`<`Region`\> Adds a fulfillment provider that is available in the region. Fails if the provider doesn't exist. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `regionId` | `string` | the region to add the provider to | | `providerId` | `string` | the provider to add to the region | @@ -289,25 +292,26 @@ provider doesn't exist. `Promise`<`Region`\> -the updated Region +-`Promise`: the updated Region + -`Region`: #### Defined in -[medusa/src/services/region.ts:705](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L705) +[medusa/src/services/region.ts:705](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L705) ___ ### addPaymentProvider -▸ **addPaymentProvider**(`regionId`, `providerId`): `Promise`<`Region`\> +**addPaymentProvider**(`regionId`, `providerId`): `Promise`<`Region`\> Adds a payment provider that is available in the region. Fails if the provider doesn't exist. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `regionId` | `string` | the region to add the provider to | | `providerId` | `string` | the provider to add to the region | @@ -315,33 +319,32 @@ provider doesn't exist. `Promise`<`Region`\> -the updated Region +-`Promise`: the updated Region + -`Region`: #### Defined in -[medusa/src/services/region.ts:656](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L656) +[medusa/src/services/region.ts:656](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L656) ___ ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -350,7 +353,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -358,68 +361,69 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**(`data`): `Promise`<`Region`\> +**create**(`data`): `Promise`<`Region`\> Creates a region. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `data` | `CreateRegionInput` | the unvalidated region | #### Returns `Promise`<`Region`\> -the newly created region +-`Promise`: the newly created region + -`Region`: #### Defined in -[medusa/src/services/region.ts:100](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L100) +[medusa/src/services/region.ts:100](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L100) ___ ### delete -▸ **delete**(`regionId`): `Promise`<`void`\> +**delete**(`regionId`): `Promise`<`void`\> Deletes a region. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `regionId` | `string` | the region to delete | #### Returns `Promise`<`void`\> -the result of the delete operation +-`Promise`: the result of the delete operation #### Defined in -[medusa/src/services/region.ts:546](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L546) +[medusa/src/services/region.ts:546](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L546) ___ ### list -▸ **list**(`selector?`, `config?`): `Promise`<`Region`[]\> +**list**(`selector?`, `config?`): `Promise`<`Region`[]\> Lists all regions based on a query #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`Region`\> | query object for find | | `config` | `FindConfig`<`Region`\> | configuration settings | @@ -427,24 +431,26 @@ Lists all regions based on a query `Promise`<`Region`[]\> -result of the find operation +-`Promise`: result of the find operation + -`Region[]`: + -`Region`: #### Defined in -[medusa/src/services/region.ts:505](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L505) +[medusa/src/services/region.ts:505](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L505) ___ ### listAndCount -▸ **listAndCount**(`selector?`, `config?`): `Promise`<[`Region`[], `number`]\> +**listAndCount**(`selector?`, `config?`): `Promise`<[`Region`[], `number`]\> Lists all regions based on a query and returns them along with count #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`Region`\> | query object for find | | `config` | `FindConfig`<`Region`\> | configuration settings | @@ -452,24 +458,26 @@ Lists all regions based on a query and returns them along with count `Promise`<[`Region`[], `number`]\> -result of the find operation +-`Promise`: result of the find operation + -`Region[]`: + -`number`: (optional) #### Defined in -[medusa/src/services/region.ts:524](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L524) +[medusa/src/services/region.ts:524](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L524) ___ ### removeCountry -▸ **removeCountry**(`regionId`, `code`): `Promise`<`Region`\> +**removeCountry**(`regionId`, `code`): `Promise`<`Region`\> Removes a country from a Region. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `regionId` | `string` | the region to remove from | | `code` | `string` | a 2 digit alphanumeric ISO country code to remove | @@ -477,24 +485,25 @@ Removes a country from a Region. `Promise`<`Region`\> -the updated Region +-`Promise`: the updated Region + -`Region`: #### Defined in -[medusa/src/services/region.ts:615](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L615) +[medusa/src/services/region.ts:615](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L615) ___ ### removeFulfillmentProvider -▸ **removeFulfillmentProvider**(`regionId`, `providerId`): `Promise`<`Region`\> +**removeFulfillmentProvider**(`regionId`, `providerId`): `Promise`<`Region`\> Removes a fulfillment provider from a region. Is idempotent. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `regionId` | `string` | the region to remove the provider from | | `providerId` | `string` | the provider to remove from the region | @@ -502,24 +511,25 @@ Removes a fulfillment provider from a region. Is idempotent. `Promise`<`Region`\> -the updated Region +-`Promise`: the updated Region + -`Region`: #### Defined in -[medusa/src/services/region.ts:791](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L791) +[medusa/src/services/region.ts:791](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L791) ___ ### removePaymentProvider -▸ **removePaymentProvider**(`regionId`, `providerId`): `Promise`<`Region`\> +**removePaymentProvider**(`regionId`, `providerId`): `Promise`<`Region`\> Removes a payment provider from a region. Is idempotent. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `regionId` | `string` | the region to remove the provider from | | `providerId` | `string` | the provider to remove from the region | @@ -527,24 +537,25 @@ Removes a payment provider from a region. Is idempotent. `Promise`<`Region`\> -the updated Region +-`Promise`: the updated Region + -`Region`: #### Defined in -[medusa/src/services/region.ts:752](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L752) +[medusa/src/services/region.ts:752](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L752) ___ ### retrieve -▸ **retrieve**(`regionId`, `config?`): `Promise`<`Region`\> +**retrieve**(`regionId`, `config?`): `Promise`<`Region`\> Retrieves a region by its id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `regionId` | `string` | the id of the region to retrieve | | `config` | `FindConfig`<`Region`\> | configuration settings | @@ -552,24 +563,25 @@ Retrieves a region by its id. `Promise`<`Region`\> -the region +-`Promise`: the region + -`Region`: #### Defined in -[medusa/src/services/region.ts:470](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L470) +[medusa/src/services/region.ts:470](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L470) ___ ### retrieveByCountryCode -▸ **retrieveByCountryCode**(`code`, `config?`): `Promise`<`Region`\> +**retrieveByCountryCode**(`code`, `config?`): `Promise`<`Region`\> Retrieve a region by country code. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `code` | `string` | a 2 digit alphanumeric ISO country code | | `config` | `FindConfig`<`Region`\> | region find config | @@ -577,72 +589,76 @@ Retrieve a region by country code. `Promise`<`Region`\> -a Region with country code +-`Promise`: a Region with country code + -`Region`: #### Defined in -[medusa/src/services/region.ts:416](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L416) +[medusa/src/services/region.ts:416](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L416) ___ ### retrieveByName -▸ **retrieveByName**(`name`): `Promise`<`Region`\> +**retrieveByName**(`name`): `Promise`<`Region`\> Retrieves a region by name. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `name` | `string` | the name of the region to retrieve | #### Returns `Promise`<`Region`\> -region with the matching name +-`Promise`: region with the matching name + -`Region`: #### Defined in -[medusa/src/services/region.ts:450](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L450) +[medusa/src/services/region.ts:450](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L450) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`regionId`, `update`): `Promise`<`Region`\> +**update**(`regionId`, `update`): `Promise`<`Region`\> Updates a region #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `regionId` | `string` | the region to update | | `update` | `UpdateRegionInput` | the data to update the region with | @@ -650,25 +666,26 @@ Updates a region `Promise`<`Region`\> -the result of the update operation +-`Promise`: the result of the update operation + -`Region`: #### Defined in -[medusa/src/services/region.ts:171](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L171) +[medusa/src/services/region.ts:171](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L171) ___ ### validateCountry -▸ `Protected` **validateCountry**(`code`, `regionId`): `Promise`<`Country`\> +`Protected` **validateCountry**(`code`, `regionId`): `Promise`<`Country`\> Validates a country code. Will normalize the code before checking for existence. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `code` | `string` | a 2 digit alphanumeric ISO country code | | `regionId` | `string` | the id of the current region to check against | @@ -676,59 +693,58 @@ existence. `Promise`<`Country`\> -the validated Country +-`Promise`: the validated Country + -`Country`: #### Defined in -[medusa/src/services/region.ts:367](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L367) +[medusa/src/services/region.ts:367](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L367) ___ ### validateCurrency -▸ `Protected` **validateCurrency**(`currencyCode`): `Promise`<`void`\> +`Protected` **validateCurrency**(`currencyCode`): `Promise`<`void`\> Validates a currency code. Will throw if the currency code doesn't exist. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `currencyCode` | `string` | an ISO currency code | #### Returns `Promise`<`void`\> -void +-`Promise`: void -**`Throws`** +**Throws** if the provided currency code is invalid #### Defined in -[medusa/src/services/region.ts:342](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L342) +[medusa/src/services/region.ts:342](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L342) ___ ### validateFields -▸ `Protected` **validateFields**<`T`\>(`regionData`, `id?`): `Promise`<`DeepPartial`<`Region`\>\> +`Protected` **validateFields**<`T`\>(`regionData`, `id?`): `Promise`<`DeepPartial`<`Region`\>\> Validates fields for creation and updates. If the region already exists the id can be passed to check that country updates are allowed. -#### Type parameters - | Name | Type | | :------ | :------ | -| `T` | extends `UpdateRegionInput` \| `CreateRegionInput` | +| `T` | `UpdateRegionInput` \| `CreateRegionInput` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `regionData` | `Omit`<`T`, ``"metadata"`` \| ``"currency_code"``\> | the region data to validate | | `id?` | `T` extends `UpdateRegionInput` ? `string` : `undefined` | optional id of the region to check against | @@ -736,60 +752,64 @@ the id can be passed to check that country updates are allowed. `Promise`<`DeepPartial`<`Region`\>\> -the validated region data +-`Promise`: the validated region data + -`DeepPartial`: + -`Region`: #### Defined in -[medusa/src/services/region.ts:240](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L240) +[medusa/src/services/region.ts:240](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L240) ___ ### validateTaxRate -▸ `Protected` **validateTaxRate**(`taxRate`): `void` +`Protected` **validateTaxRate**(`taxRate`): `void` Validates a tax rate. Will throw if the tax rate is not between 0 and 1. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `taxRate` | `number` | a number representing the tax rate of the region | #### Returns `void` -void +-`void`: (optional) void -**`Throws`** +**Throws** if the tax rate isn't number between 0-100 #### Defined in -[medusa/src/services/region.ts:326](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/region.ts#L326) +[medusa/src/services/region.ts:326](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/region.ts#L326) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`RegionService`](RegionService.md) +**withTransaction**(`transactionManager?`): [`RegionService`](RegionService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`RegionService`](RegionService.md) +-`RegionService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/ReturnReasonService.md b/www/apps/docs/content/references/services/classes/ReturnReasonService.md index 13adcc57221df..79a689983943f 100644 --- a/www/apps/docs/content/references/services/classes/ReturnReasonService.md +++ b/www/apps/docs/content/references/services/classes/ReturnReasonService.md @@ -1,4 +1,4 @@ -# Class: ReturnReasonService +# ReturnReasonService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new ReturnReasonService**(`«destructured»`) +**new ReturnReasonService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/return-reason.ts:18](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return-reason.ts#L18) +[medusa/src/services/return-reason.ts:18](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return-reason.ts#L18) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,13 +66,13 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -80,23 +80,23 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### retReasonRepo\_ -• `Protected` `Readonly` **retReasonRepo\_**: `Repository`<`ReturnReason`\> + `Protected` `Readonly` **retReasonRepo\_**: `Repository`<`ReturnReason`\> #### Defined in -[medusa/src/services/return-reason.ts:16](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return-reason.ts#L16) +[medusa/src/services/return-reason.ts:16](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return-reason.ts#L16) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -104,47 +104,47 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -153,7 +153,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -161,58 +161,63 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**(`data`): `Promise`<`ReturnReason`\> +**create**(`data`): `Promise`<`ReturnReason`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `data` | `CreateReturnReason` | #### Returns `Promise`<`ReturnReason`\> +-`Promise`: + -`ReturnReason`: + #### Defined in -[medusa/src/services/return-reason.ts:25](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return-reason.ts#L25) +[medusa/src/services/return-reason.ts:25](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return-reason.ts#L25) ___ ### delete -▸ **delete**(`returnReasonId`): `Promise`<`void`\> +**delete**(`returnReasonId`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `returnReasonId` | `string` | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/return-reason.ts:113](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return-reason.ts#L113) +[medusa/src/services/return-reason.ts:113](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return-reason.ts#L113) ___ ### list -▸ **list**(`selector`, `config?`): `Promise`<`ReturnReason`[]\> +**list**(`selector`, `config?`): `Promise`<`ReturnReason`[]\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`ReturnReason`\> | the query object for find | | `config` | `FindConfig`<`ReturnReason`\> | config object | @@ -220,24 +225,26 @@ ___ `Promise`<`ReturnReason`[]\> -the result of the find operation +-`Promise`: the result of the find operation + -`ReturnReason[]`: + -`ReturnReason`: #### Defined in -[medusa/src/services/return-reason.ts:68](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return-reason.ts#L68) +[medusa/src/services/return-reason.ts:68](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return-reason.ts#L68) ___ ### retrieve -▸ **retrieve**(`returnReasonId`, `config?`): `Promise`<`ReturnReason`\> +**retrieve**(`returnReasonId`, `config?`): `Promise`<`ReturnReason`\> Gets an order by id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `returnReasonId` | `string` | id of order to retrieve | | `config` | `FindConfig`<`ReturnReason`\> | config object | @@ -245,46 +252,49 @@ Gets an order by id. `Promise`<`ReturnReason`\> -the order document +-`Promise`: the order document + -`ReturnReason`: #### Defined in -[medusa/src/services/return-reason.ts:87](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return-reason.ts#L87) +[medusa/src/services/return-reason.ts:87](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return-reason.ts#L87) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`id`, `data`): `Promise`<`ReturnReason`\> +**update**(`id`, `data`): `Promise`<`ReturnReason`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `id` | `string` | | `data` | `UpdateReturnReason` | @@ -292,30 +302,35 @@ ___ `Promise`<`ReturnReason`\> +-`Promise`: + -`ReturnReason`: + #### Defined in -[medusa/src/services/return-reason.ts:46](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return-reason.ts#L46) +[medusa/src/services/return-reason.ts:46](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return-reason.ts#L46) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`ReturnReasonService`](ReturnReasonService.md) +**withTransaction**(`transactionManager?`): [`ReturnReasonService`](ReturnReasonService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`ReturnReasonService`](ReturnReasonService.md) +-`ReturnReasonService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/ReturnService.md b/www/apps/docs/content/references/services/classes/ReturnService.md index 493fba601b4a6..c37178cc93b32 100644 --- a/www/apps/docs/content/references/services/classes/ReturnService.md +++ b/www/apps/docs/content/references/services/classes/ReturnService.md @@ -1,4 +1,4 @@ -# Class: ReturnService +# ReturnService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new ReturnService**(`«destructured»`) +**new ReturnService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/return.ts:68](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L68) +[medusa/src/services/return.ts:68](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L68) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,43 +66,43 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### featureFlagRouter\_ -• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` + `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` #### Defined in -[medusa/src/services/return.ts:66](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L66) +[medusa/src/services/return.ts:66](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L66) ___ ### fulfillmentProviderService\_ -• `Protected` `Readonly` **fulfillmentProviderService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md) + `Protected` `Readonly` **fulfillmentProviderService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md) #### Defined in -[medusa/src/services/return.ts:61](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L61) +[medusa/src/services/return.ts:61](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L61) ___ ### lineItemService\_ -• `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md) + `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md) #### Defined in -[medusa/src/services/return.ts:58](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L58) +[medusa/src/services/return.ts:58](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L58) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -110,93 +110,93 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### orderService\_ -• `Protected` `Readonly` **orderService\_**: [`OrderService`](OrderService.md) + `Protected` `Readonly` **orderService\_**: [`OrderService`](OrderService.md) #### Defined in -[medusa/src/services/return.ts:63](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L63) +[medusa/src/services/return.ts:63](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L63) ___ ### productVariantInventoryService\_ -• `Protected` `Readonly` **productVariantInventoryService\_**: [`ProductVariantInventoryService`](ProductVariantInventoryService.md) + `Protected` `Readonly` **productVariantInventoryService\_**: [`ProductVariantInventoryService`](ProductVariantInventoryService.md) #### Defined in -[medusa/src/services/return.ts:65](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L65) +[medusa/src/services/return.ts:65](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L65) ___ ### returnItemRepository\_ -• `Protected` `Readonly` **returnItemRepository\_**: `Repository`<`ReturnItem`\> + `Protected` `Readonly` **returnItemRepository\_**: `Repository`<`ReturnItem`\> #### Defined in -[medusa/src/services/return.ts:57](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L57) +[medusa/src/services/return.ts:57](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L57) ___ ### returnReasonService\_ -• `Protected` `Readonly` **returnReasonService\_**: [`ReturnReasonService`](ReturnReasonService.md) + `Protected` `Readonly` **returnReasonService\_**: [`ReturnReasonService`](ReturnReasonService.md) #### Defined in -[medusa/src/services/return.ts:62](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L62) +[medusa/src/services/return.ts:62](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L62) ___ ### returnRepository\_ -• `Protected` `Readonly` **returnRepository\_**: `Repository`<`Return`\> + `Protected` `Readonly` **returnRepository\_**: `Repository`<`Return`\> #### Defined in -[medusa/src/services/return.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L56) +[medusa/src/services/return.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L56) ___ ### shippingOptionService\_ -• `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md) + `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md) #### Defined in -[medusa/src/services/return.ts:60](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L60) +[medusa/src/services/return.ts:60](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L60) ___ ### taxProviderService\_ -• `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md) + `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md) #### Defined in -[medusa/src/services/return.ts:59](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L59) +[medusa/src/services/return.ts:59](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L59) ___ ### totalsService\_ -• `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md) + `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md) #### Defined in -[medusa/src/services/return.ts:55](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L55) +[medusa/src/services/return.ts:55](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L55) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -204,47 +204,47 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -253,7 +253,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -261,37 +261,38 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### cancel -▸ **cancel**(`returnId`): `Promise`<`Return`\> +**cancel**(`returnId`): `Promise`<`Return`\> Cancels a return if possible. Returns can be canceled if it has not been received. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `returnId` | `string` | the id of the return to cancel. | #### Returns `Promise`<`Return`\> -the updated Return +-`Promise`: the updated Return + -`Return`: #### Defined in -[medusa/src/services/return.ts:184](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L184) +[medusa/src/services/return.ts:184](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L184) ___ ### create -▸ **create**(`data`): `Promise`<`Return`\> +**create**(`data`): `Promise`<`Return`\> Creates a return request for an order, with given items, and a shipping method. If no refund amount is provided the refund amount is calculated from @@ -299,52 +300,56 @@ the return lines and the shipping cost. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `data` | `CreateReturnInput` | data to use for the return e.g. shipping_method, items or refund_amount | #### Returns `Promise`<`Return`\> -the created return +-`Promise`: the created return + -`Return`: #### Defined in -[medusa/src/services/return.ts:369](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L369) +[medusa/src/services/return.ts:369](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L369) ___ ### fulfill -▸ **fulfill**(`returnId`): `Promise`<`Return`\> +**fulfill**(`returnId`): `Promise`<`Return`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `returnId` | `string` | #### Returns `Promise`<`Return`\> +-`Promise`: + -`Return`: + #### Defined in -[medusa/src/services/return.ts:535](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L535) +[medusa/src/services/return.ts:535](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L535) ___ ### getFulfillmentItems -▸ `Protected` **getFulfillmentItems**(`order`, `items`, `transformer`): `Promise`<`LineItem` & { `note?`: `string` ; `reason_id?`: `string` }[]\> +`Protected` **getFulfillmentItems**(`order`, `items`, `transformer`): `Promise`<`LineItem` & { `note?`: `string` ; `reason_id?`: `string` }[]\> Retrieves the order line items, given an array of items #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `order` | `Order` | the order to get line items from | | `items` | `OrdersReturnItem`[] | the items to get | | `transformer` | `Transformer` | a function to apply to each of the items retrieved from the order, should return a line item. If the transformer returns an undefined value the line item will be filtered from the returned array. | @@ -353,22 +358,24 @@ Retrieves the order line items, given an array of items `Promise`<`LineItem` & { `note?`: `string` ; `reason_id?`: `string` }[]\> -the line items generated by the transformer. +-`Promise`: the line items generated by the transformer. + -``LineItem` & { `note?`: `string` ; `reason_id?`: `string` }[]`: + -``LineItem` & { `note?`: `string` ; `reason_id?`: `string` }`: (optional) #### Defined in -[medusa/src/services/return.ts:107](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L107) +[medusa/src/services/return.ts:107](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L107) ___ ### list -▸ **list**(`selector`, `config?`): `Promise`<`Return`[]\> +**list**(`selector`, `config?`): `Promise`<`Return`[]\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`Return`\> | the query object for find | | `config` | `FindConfig`<`Return`\> | the config object for find | @@ -376,22 +383,24 @@ ___ `Promise`<`Return`[]\> -the result of the find operation +-`Promise`: the result of the find operation + -`Return[]`: + -`Return`: #### Defined in -[medusa/src/services/return.ts:147](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L147) +[medusa/src/services/return.ts:147](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L147) ___ ### listAndCount -▸ **listAndCount**(`selector`, `config?`): `Promise`<[`Return`[], `number`]\> +**listAndCount**(`selector`, `config?`): `Promise`<[`Return`[], `number`]\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`Return`\> | the query object for find | | `config` | `FindConfig`<`Return`\> | the config object for find | @@ -399,17 +408,19 @@ ___ `Promise`<[`Return`[], `number`]\> -the result of the find operation +-`Promise`: the result of the find operation + -`Return[]`: + -`number`: (optional) #### Defined in -[medusa/src/services/return.ts:164](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L164) +[medusa/src/services/return.ts:164](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L164) ___ ### receive -▸ **receive**(`returnId`, `receivedItems`, `refundAmount?`, `allowMismatch?`, `context?`): `Promise`<`Return`\> +**receive**(`returnId`, `receivedItems`, `refundAmount?`, `allowMismatch?`, `context?`): `Promise`<`Return`\> Registers a previously requested return as received. This will create a refund to the customer. If the returned items don't match the requested @@ -421,37 +432,38 @@ mismatches. #### Parameters -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `returnId` | `string` | `undefined` | the orderId to return to | -| `receivedItems` | `OrdersReturnItem`[] | `undefined` | the items received after return. | -| `refundAmount?` | `number` | `undefined` | the amount to return | +| Name | Default value | Description | +| :------ | :------ | :------ | +| `returnId` | `string` | the orderId to return to | +| `receivedItems` | `OrdersReturnItem`[] | the items received after return. | +| `refundAmount?` | `number` | the amount to return | | `allowMismatch` | `boolean` | `false` | whether to ignore return/received product mismatch | -| `context` | `Object` | `{}` | - | -| `context.locationId?` | `string` | `undefined` | - | +| `context` | `object` | +| `context.locationId?` | `string` | #### Returns `Promise`<`Return`\> -the result of the update operation +-`Promise`: the result of the update operation + -`Return`: #### Defined in -[medusa/src/services/return.ts:608](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L608) +[medusa/src/services/return.ts:608](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L608) ___ ### retrieve -▸ **retrieve**(`returnId`, `config?`): `Promise`<`Return`\> +**retrieve**(`returnId`, `config?`): `Promise`<`Return`\> Retrieves a return by its id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `returnId` | `string` | the id of the return to retrieve | | `config` | `FindConfig`<`Return`\> | the config object | @@ -459,67 +471,73 @@ Retrieves a return by its id. `Promise`<`Return`\> -the return +-`Promise`: the return + -`Return`: #### Defined in -[medusa/src/services/return.ts:282](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L282) +[medusa/src/services/return.ts:282](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L282) ___ ### retrieveBySwap -▸ **retrieveBySwap**(`swapId`, `relations?`): `Promise`<`Return`\> +**retrieveBySwap**(`swapId`, `relations?`): `Promise`<`Return`\> #### Parameters -| Name | Type | Default value | -| :------ | :------ | :------ | -| `swapId` | `string` | `undefined` | +| Name | Default value | +| :------ | :------ | +| `swapId` | `string` | | `relations` | `string`[] | `[]` | #### Returns `Promise`<`Return`\> +-`Promise`: + -`Return`: + #### Defined in -[medusa/src/services/return.ts:310](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L310) +[medusa/src/services/return.ts:310](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L310) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`returnId`, `update`): `Promise`<`Return`\> +**update**(`returnId`, `update`): `Promise`<`Return`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `returnId` | `string` | | `update` | `UpdateReturnInput` | @@ -527,15 +545,18 @@ ___ `Promise`<`Return`\> +-`Promise`: + -`Return`: + #### Defined in -[medusa/src/services/return.ts:335](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L335) +[medusa/src/services/return.ts:335](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L335) ___ ### validateReturnLineItem -▸ `Protected` **validateReturnLineItem**(`item?`, `quantity?`, `additional?`): `DeepPartial`<`LineItem`\> +`Protected` **validateReturnLineItem**(`item?`, `quantity?`, `additional?`): `DeepPartial`<`LineItem`\> Checks that a given quantity of a line item can be returned. Fails if the item is undefined or if the returnable quantity of the item is lower, than @@ -543,30 +564,31 @@ the quantity that is requested to be returned. #### Parameters -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `item?` | `LineItem` | `undefined` | the line item to check has sufficient returnable quantity. | +| Name | Default value | Description | +| :------ | :------ | :------ | +| `item?` | `LineItem` | the line item to check has sufficient returnable quantity. | | `quantity` | `number` | `0` | the quantity that is requested to be returned. | -| `additional` | `Object` | `{}` | the quantity that is requested to be returned. | -| `additional.note?` | `string` | `undefined` | - | -| `additional.reason_id?` | `string` | `undefined` | - | +| `additional` | `object` | the quantity that is requested to be returned. | +| `additional.note?` | `string` | +| `additional.reason_id?` | `string` | #### Returns `DeepPartial`<`LineItem`\> -a line item where the quantity is set to the requested +-`DeepPartial`: a line item where the quantity is set to the requested return quantity. + -`LineItem`: #### Defined in -[medusa/src/services/return.ts:240](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L240) +[medusa/src/services/return.ts:240](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L240) ___ ### validateReturnStatuses -▸ `Protected` **validateReturnStatuses**(`order`): `void` +`Protected` **validateReturnStatuses**(`order`): `void` Checks that an order has the statuses necessary to complete a return. fulfillment_status cannot be not_fulfilled or returned. @@ -574,42 +596,46 @@ payment_status must be captured. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `order` | `Order` | the order to check statuses on | #### Returns `void` -**`Throws`** +-`void`: (optional) + +**Throws** when statuses are not sufficient for returns. #### Defined in -[medusa/src/services/return.ts:210](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/return.ts#L210) +[medusa/src/services/return.ts:210](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/return.ts#L210) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`ReturnService`](ReturnService.md) +**withTransaction**(`transactionManager?`): [`ReturnService`](ReturnService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`ReturnService`](ReturnService.md) +-`ReturnService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/SalesChannelInventoryService.md b/www/apps/docs/content/references/services/classes/SalesChannelInventoryService.md index d9b06201d5c23..4fdccadd6fb20 100644 --- a/www/apps/docs/content/references/services/classes/SalesChannelInventoryService.md +++ b/www/apps/docs/content/references/services/classes/SalesChannelInventoryService.md @@ -1,4 +1,4 @@ -# Class: SalesChannelInventoryService +# SalesChannelInventoryService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new SalesChannelInventoryService**(`«destructured»`) +**new SalesChannelInventoryService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/sales-channel-inventory.ts:18](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-inventory.ts#L18) +[medusa/src/services/sales-channel-inventory.ts:18](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-inventory.ts#L18) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,33 +66,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### eventBusService\_ -• `Protected` `Readonly` **eventBusService\_**: `IEventBusService` + `Protected` `Readonly` **eventBusService\_**: `IEventBusService` #### Defined in -[medusa/src/services/sales-channel-inventory.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-inventory.ts#L15) +[medusa/src/services/sales-channel-inventory.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-inventory.ts#L15) ___ ### inventoryService\_ -• `Protected` `Readonly` **inventoryService\_**: `IInventoryService` + `Protected` `Readonly` **inventoryService\_**: `IInventoryService` #### Defined in -[medusa/src/services/sales-channel-inventory.ts:16](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-inventory.ts#L16) +[medusa/src/services/sales-channel-inventory.ts:16](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-inventory.ts#L16) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -100,23 +100,23 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### salesChannelLocationService\_ -• `Protected` `Readonly` **salesChannelLocationService\_**: [`SalesChannelLocationService`](SalesChannelLocationService.md) + `Protected` `Readonly` **salesChannelLocationService\_**: [`SalesChannelLocationService`](SalesChannelLocationService.md) #### Defined in -[medusa/src/services/sales-channel-inventory.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-inventory.ts#L14) +[medusa/src/services/sales-channel-inventory.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-inventory.ts#L14) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -124,47 +124,47 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -173,7 +173,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -181,20 +181,20 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### retrieveAvailableItemQuantity -▸ **retrieveAvailableItemQuantity**(`salesChannelId`, `inventoryItemId`): `Promise`<`number`\> +**retrieveAvailableItemQuantity**(`salesChannelId`, `inventoryItemId`): `Promise`<`number`\> Retrieves the available quantity of an item across all sales channel locations #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `salesChannelId` | `string` | Sales channel id | | `inventoryItemId` | `string` | Item id | @@ -202,56 +202,61 @@ Retrieves the available quantity of an item across all sales channel locations `Promise`<`number`\> -available quantity of item across all sales channel locations +-`Promise`: available quantity of item across all sales channel locations + -`number`: (optional) #### Defined in -[medusa/src/services/sales-channel-inventory.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-inventory.ts#L37) +[medusa/src/services/sales-channel-inventory.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-inventory.ts#L37) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`SalesChannelInventoryService`](SalesChannelInventoryService.md) +**withTransaction**(`transactionManager?`): [`SalesChannelInventoryService`](SalesChannelInventoryService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`SalesChannelInventoryService`](SalesChannelInventoryService.md) +-`SalesChannelInventoryService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/SalesChannelLocationService.md b/www/apps/docs/content/references/services/classes/SalesChannelLocationService.md index 9a6aefd3f8934..917c5bb31affd 100644 --- a/www/apps/docs/content/references/services/classes/SalesChannelLocationService.md +++ b/www/apps/docs/content/references/services/classes/SalesChannelLocationService.md @@ -1,4 +1,4 @@ -# Class: SalesChannelLocationService +# SalesChannelLocationService Service for managing the stock locations of sales channels @@ -12,12 +12,12 @@ Service for managing the stock locations of sales channels ### constructor -• **new SalesChannelLocationService**(`«destructured»`) +**new SalesChannelLocationService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -26,13 +26,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/sales-channel-location.ts:24](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-location.ts#L24) +[medusa/src/services/sales-channel-location.ts:24](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-location.ts#L24) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -68,23 +68,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### eventBusService\_ -• `Protected` `Readonly` **eventBusService\_**: `IEventBusService` + `Protected` `Readonly` **eventBusService\_**: `IEventBusService` #### Defined in -[medusa/src/services/sales-channel-location.ts:21](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-location.ts#L21) +[medusa/src/services/sales-channel-location.ts:21](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-location.ts#L21) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -92,33 +92,33 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### salesChannelService\_ -• `Protected` `Readonly` **salesChannelService\_**: [`SalesChannelService`](SalesChannelService.md) + `Protected` `Readonly` **salesChannelService\_**: [`SalesChannelService`](SalesChannelService.md) #### Defined in -[medusa/src/services/sales-channel-location.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-location.ts#L20) +[medusa/src/services/sales-channel-location.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-location.ts#L20) ___ ### stockLocationService\_ -• `Protected` `Readonly` **stockLocationService\_**: `IStockLocationService` + `Protected` `Readonly` **stockLocationService\_**: `IStockLocationService` #### Defined in -[medusa/src/services/sales-channel-location.ts:22](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-location.ts#L22) +[medusa/src/services/sales-channel-location.ts:22](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-location.ts#L22) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -126,38 +126,40 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### associateLocation -▸ **associateLocation**(`salesChannelId`, `locationId`): `Promise`<`void`\> +**associateLocation**(`salesChannelId`, `locationId`): `Promise`<`void`\> Associates a sales channel with a stock location. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `salesChannelId` | `string` | The ID of the sales channel. | | `locationId` | `string` | The ID of the stock location. | @@ -165,33 +167,31 @@ Associates a sales channel with a stock location. `Promise`<`void`\> -A promise that resolves when the association has been created. +-`Promise`: A promise that resolves when the association has been created. #### Defined in -[medusa/src/services/sales-channel-location.ts:72](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-location.ts#L72) +[medusa/src/services/sales-channel-location.ts:72](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-location.ts#L72) ___ ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -200,7 +200,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -208,68 +208,72 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### listLocationIds -▸ **listLocationIds**(`salesChannelId`): `Promise`<`string`[]\> +**listLocationIds**(`salesChannelId`): `Promise`<`string`[]\> Lists the stock locations associated with a sales channel. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `salesChannelId` | `string` \| `string`[] | The ID of the sales channel. | #### Returns `Promise`<`string`[]\> -A promise that resolves with an array of location IDs. +-`Promise`: A promise that resolves with an array of location IDs. + -`string[]`: + -`string`: (optional) #### Defined in -[medusa/src/services/sales-channel-location.ts:103](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-location.ts#L103) +[medusa/src/services/sales-channel-location.ts:103](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-location.ts#L103) ___ ### listSalesChannelIds -▸ **listSalesChannelIds**(`locationId`): `Promise`<`string`[]\> +**listSalesChannelIds**(`locationId`): `Promise`<`string`[]\> Lists the sales channels associated with a stock location. #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `locationId` | `string` | #### Returns `Promise`<`string`[]\> -A promise that resolves with an array of sales channel IDs. +-`Promise`: A promise that resolves with an array of sales channel IDs. + -`string[]`: + -`string`: (optional) #### Defined in -[medusa/src/services/sales-channel-location.ts:132](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-location.ts#L132) +[medusa/src/services/sales-channel-location.ts:132](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-location.ts#L132) ___ ### removeLocation -▸ **removeLocation**(`locationId`, `salesChannelId?`): `Promise`<`void`\> +**removeLocation**(`locationId`, `salesChannelId?`): `Promise`<`void`\> Removes an association between a sales channel and a stock location. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `locationId` | `string` | The ID of the stock location. | | `salesChannelId?` | `string` | The ID of the sales channel or undefined if all the sales channel will be affected. | @@ -277,56 +281,60 @@ Removes an association between a sales channel and a stock location. `Promise`<`void`\> -A promise that resolves when the association has been removed. +-`Promise`: A promise that resolves when the association has been removed. #### Defined in -[medusa/src/services/sales-channel-location.ts:43](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel-location.ts#L43) +[medusa/src/services/sales-channel-location.ts:43](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel-location.ts#L43) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`SalesChannelLocationService`](SalesChannelLocationService.md) +**withTransaction**(`transactionManager?`): [`SalesChannelLocationService`](SalesChannelLocationService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`SalesChannelLocationService`](SalesChannelLocationService.md) +-`SalesChannelLocationService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/SalesChannelService.md b/www/apps/docs/content/references/services/classes/SalesChannelService.md index fac3a4bf7dfc4..4b33f4ceae33d 100644 --- a/www/apps/docs/content/references/services/classes/SalesChannelService.md +++ b/www/apps/docs/content/references/services/classes/SalesChannelService.md @@ -1,4 +1,4 @@ -# Class: SalesChannelService +# SalesChannelService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new SalesChannelService**(`«destructured»`) +**new SalesChannelService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/sales-channel.ts:34](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L34) +[medusa/src/services/sales-channel.ts:34](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L34) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,23 +66,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### eventBusService\_ -• `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBusService\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/sales-channel.ts:31](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L31) +[medusa/src/services/sales-channel.ts:31](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L31) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -90,33 +90,33 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### salesChannelRepository\_ -• `Protected` `Readonly` **salesChannelRepository\_**: `Repository`<`SalesChannel`\> & { `addProducts`: (`salesChannelId`: `string`, `productIds`: `string`[]) => `Promise`<`void`\> ; `getFreeTextSearchResultsAndCount`: (`q`: `string`, `options`: `ExtendedFindConfig`<`SalesChannel`\>) => `Promise`<[`SalesChannel`[], `number`]\> ; `listProductIdsBySalesChannelIds`: (`salesChannelIds`: `string` \| `string`[]) => `Promise`<{ `[salesChannelId: string]`: `string`[]; }\> ; `removeProducts`: (`salesChannelId`: `string`, `productIds`: `string`[]) => `Promise`<`DeleteResult`\> } + `Protected` `Readonly` **salesChannelRepository\_**: `Repository`<`SalesChannel`\> & { `addProducts`: Method addProducts ; `getFreeTextSearchResultsAndCount`: Method getFreeTextSearchResultsAndCount ; `listProductIdsBySalesChannelIds`: Method listProductIdsBySalesChannelIds ; `removeProducts`: Method removeProducts } #### Defined in -[medusa/src/services/sales-channel.ts:30](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L30) +[medusa/src/services/sales-channel.ts:30](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L30) ___ ### storeService\_ -• `Protected` `Readonly` **storeService\_**: [`StoreService`](StoreService.md) + `Protected` `Readonly` **storeService\_**: [`StoreService`](StoreService.md) #### Defined in -[medusa/src/services/sales-channel.ts:32](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L32) +[medusa/src/services/sales-channel.ts:32](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L32) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -124,13 +124,13 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### Events -▪ `Static` **Events**: `Object` + `Static` **Events**: `Object` #### Type declaration @@ -142,38 +142,40 @@ ___ #### Defined in -[medusa/src/services/sales-channel.ts:24](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L24) +[medusa/src/services/sales-channel.ts:24](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L24) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### addProducts -▸ **addProducts**(`salesChannelId`, `productIds`): `Promise`<`SalesChannel`\> +**addProducts**(`salesChannelId`, `productIds`): `Promise`<`SalesChannel`\> Add a batch of product to a sales channel #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `salesChannelId` | `string` | The id of the sales channel on which to add the products | | `productIds` | `string`[] | The products ids to attach to the sales channel | @@ -181,33 +183,32 @@ Add a batch of product to a sales channel `Promise`<`SalesChannel`\> -the sales channel on which the products have been added +-`Promise`: the sales channel on which the products have been added + -`SalesChannel`: #### Defined in -[medusa/src/services/sales-channel.ts:348](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L348) +[medusa/src/services/sales-channel.ts:348](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L348) ___ ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -216,7 +217,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -224,13 +225,13 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**(`data`): `Promise`<`SalesChannel`\> +**create**(`data`): `Promise`<`SalesChannel`\> Creates a SalesChannel @@ -239,25 +240,26 @@ To use this feature please enable the corresponding feature flag in your medusa #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `data` | `CreateSalesChannelInput` | #### Returns `Promise`<`SalesChannel`\> -the created channel +-`Promise`: the created channel + -`SalesChannel`: #### Defined in -[medusa/src/services/sales-channel.ts:168](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L168) +[medusa/src/services/sales-channel.ts:168](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L168) ___ ### createDefault -▸ **createDefault**(): `Promise`<`SalesChannel`\> +**createDefault**(): `Promise`<`SalesChannel`\> Creates a default sales channel, if this does not already exist. @@ -265,17 +267,18 @@ Creates a default sales channel, if this does not already exist. `Promise`<`SalesChannel`\> -the sales channel +-`Promise`: the sales channel + -`SalesChannel`: #### Defined in -[medusa/src/services/sales-channel.ts:258](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L258) +[medusa/src/services/sales-channel.ts:258](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L258) ___ ### delete -▸ **delete**(`salesChannelId`): `Promise`<`void`\> +**delete**(`salesChannelId`): `Promise`<`void`\> Deletes a sales channel from This feature is under development and may change in the future. @@ -283,31 +286,33 @@ To use this feature please enable the corresponding feature flag in your medusa #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `salesChannelId` | `string` | the id of the sales channel to delete | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/sales-channel.ts:219](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L219) +[medusa/src/services/sales-channel.ts:219](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L219) ___ ### listAndCount -▸ **listAndCount**(`selector`, `config?`): `Promise`<[`SalesChannel`[], `number`]\> +**listAndCount**(`selector`, `config?`): `Promise`<[`SalesChannel`[], `number`]\> Lists sales channels based on the provided parameters and includes the count of sales channels that match the query. #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `selector` | `QuerySelector`<`SalesChannel`\> | | `config` | `FindConfig`<`SalesChannel`\> | @@ -315,48 +320,53 @@ sales channels that match the query. `Promise`<[`SalesChannel`[], `number`]\> -an array containing the sales channels as +-`Promise`: an array containing the sales channels as the first element and the total count of sales channels that matches the query as the second element. + -`SalesChannel[]`: + -`number`: (optional) #### Defined in -[medusa/src/services/sales-channel.ts:134](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L134) +[medusa/src/services/sales-channel.ts:134](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L134) ___ ### listProductIdsBySalesChannelIds -▸ **listProductIdsBySalesChannelIds**(`salesChannelIds`): `Promise`<{ `[salesChannelId: string]`: `string`[]; }\> +**listProductIdsBySalesChannelIds**(`salesChannelIds`): `Promise`<{ `[salesChannelId: string]`: `string`[]; }\> List all product ids that belongs to the sales channels ids #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `salesChannelIds` | `string` \| `string`[] | #### Returns `Promise`<{ `[salesChannelId: string]`: `string`[]; }\> +-`Promise`: + -``object``: (optional) + #### Defined in -[medusa/src/services/sales-channel.ts:310](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L310) +[medusa/src/services/sales-channel.ts:310](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L310) ___ ### removeProducts -▸ **removeProducts**(`salesChannelId`, `productIds`): `Promise`<`SalesChannel`\> +**removeProducts**(`salesChannelId`, `productIds`): `Promise`<`SalesChannel`\> Remove a batch of product from a sales channel #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `salesChannelId` | `string` | The id of the sales channel on which to remove the products | | `productIds` | `string`[] | The products ids to remove from the sales channel | @@ -364,24 +374,25 @@ Remove a batch of product from a sales channel `Promise`<`SalesChannel`\> -the sales channel on which the products have been removed +-`Promise`: the sales channel on which the products have been removed + -`SalesChannel`: #### Defined in -[medusa/src/services/sales-channel.ts:327](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L327) +[medusa/src/services/sales-channel.ts:327](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L327) ___ ### retrieve -▸ **retrieve**(`salesChannelId`, `config?`): `Promise`<`SalesChannel`\> +**retrieve**(`salesChannelId`, `config?`): `Promise`<`SalesChannel`\> Retrieve a SalesChannel by id #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `salesChannelId` | `string` | id of the channel to retrieve | | `config` | `FindConfig`<`SalesChannel`\> | SC config This feature is under development and may change in the future. To use this feature please enable the corresponding feature flag in your medusa backend project. | @@ -389,24 +400,25 @@ Retrieve a SalesChannel by id `Promise`<`SalesChannel`\> -a sales channel +-`Promise`: a sales channel + -`SalesChannel`: #### Defined in -[medusa/src/services/sales-channel.ts:92](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L92) +[medusa/src/services/sales-channel.ts:92](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L92) ___ ### retrieveByName -▸ **retrieveByName**(`name`, `config?`): `Promise`<`unknown`\> +**retrieveByName**(`name`, `config?`): `Promise`<`unknown`\> Find a sales channel by name. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `name` | `string` | of the sales channel | | `config` | `FindConfig`<`SalesChannel`\> | find config | @@ -414,17 +426,18 @@ Find a sales channel by name. `Promise`<`unknown`\> -a sales channel with matching name +-`Promise`: a sales channel with matching name + -`unknown`: (optional) #### Defined in -[medusa/src/services/sales-channel.ts:113](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L113) +[medusa/src/services/sales-channel.ts:113](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L113) ___ ### retrieveDefault -▸ **retrieveDefault**(): `Promise`<`SalesChannel`\> +**retrieveDefault**(): `Promise`<`SalesChannel`\> Retrieves the default sales channel. @@ -432,24 +445,25 @@ Retrieves the default sales channel. `Promise`<`SalesChannel`\> -the sales channel +-`Promise`: the sales channel + -`SalesChannel`: #### Defined in -[medusa/src/services/sales-channel.ts:288](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L288) +[medusa/src/services/sales-channel.ts:288](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L288) ___ ### retrieve\_ -▸ `Protected` **retrieve_**(`selector`, `config?`): `Promise`<`SalesChannel`\> +`Protected` **retrieve_**(`selector`, `config?`): `Promise`<`SalesChannel`\> A generic retrieve used to find a sales channel by different attributes. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`SalesChannel`\> | SC selector | | `config` | `FindConfig`<`SalesChannel`\> | find config | @@ -457,46 +471,49 @@ A generic retrieve used to find a sales channel by different attributes. `Promise`<`SalesChannel`\> -a single SC matching the query or throws +-`Promise`: a single SC matching the query or throws + -`SalesChannel`: #### Defined in -[medusa/src/services/sales-channel.ts:54](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L54) +[medusa/src/services/sales-channel.ts:54](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L54) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`salesChannelId`, `data`): `Promise`<`SalesChannel`\> +**update**(`salesChannelId`, `data`): `Promise`<`SalesChannel`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `salesChannelId` | `string` | | `data` | `Partial`<`CreateSalesChannelInput`\> | @@ -504,30 +521,35 @@ ___ `Promise`<`SalesChannel`\> +-`Promise`: + -`SalesChannel`: + #### Defined in -[medusa/src/services/sales-channel.ts:185](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/sales-channel.ts#L185) +[medusa/src/services/sales-channel.ts:185](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/sales-channel.ts#L185) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`SalesChannelService`](SalesChannelService.md) +**withTransaction**(`transactionManager?`): [`SalesChannelService`](SalesChannelService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`SalesChannelService`](SalesChannelService.md) +-`SalesChannelService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/SearchService.md b/www/apps/docs/content/references/services/classes/SearchService.md index 1fbb7da61fb36..ac113afe59489 100644 --- a/www/apps/docs/content/references/services/classes/SearchService.md +++ b/www/apps/docs/content/references/services/classes/SearchService.md @@ -1,4 +1,4 @@ -# Class: SearchService +# SearchService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new SearchService**(`«destructured»`, `options`) +**new SearchService**(`«destructured»`, `options`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | | `options` | `any` | @@ -25,13 +25,13 @@ AbstractSearchService.constructor #### Defined in -[medusa/src/services/search.ts:16](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L16) +[medusa/src/services/search.ts:16](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L16) ## Properties ### isDefault -• **isDefault**: `boolean` = `true` + **isDefault**: `boolean` = `true` #### Overrides @@ -39,23 +39,23 @@ AbstractSearchService.isDefault #### Defined in -[medusa/src/services/search.ts:11](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L11) +[medusa/src/services/search.ts:11](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L11) ___ ### logger\_ -• `Protected` `Readonly` **logger\_**: `Logger` + `Protected` `Readonly` **logger\_**: `Logger` #### Defined in -[medusa/src/services/search.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L13) +[medusa/src/services/search.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L13) ___ ### options\_ -• `Protected` `Readonly` **options\_**: `Record`<`string`, `unknown`\> + `Protected` `Readonly` **options\_**: Record<`string`, `unknown`\> #### Overrides @@ -63,17 +63,21 @@ AbstractSearchService.options\_ #### Defined in -[medusa/src/services/search.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L14) +[medusa/src/services/search.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L14) ## Accessors ### options -• `get` **options**(): `Record`<`string`, `unknown`\> +`get` **options**(): Record<`string`, `unknown`\> #### Returns -`Record`<`string`, `unknown`\> +Record<`string`, `unknown`\> + +-`Record`: + -`string`: (optional) + -`unknown`: (optional) #### Inherited from @@ -87,12 +91,12 @@ utils/dist/search/abstract-service.d.ts:5 ### addDocuments -▸ **addDocuments**(`indexName`, `documents`, `type`): `Promise`<`void`\> +**addDocuments**(`indexName`, `documents`, `type`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `indexName` | `string` | | `documents` | `unknown` | | `type` | `string` | @@ -101,24 +105,26 @@ utils/dist/search/abstract-service.d.ts:5 `Promise`<`void`\> +-`Promise`: + #### Overrides AbstractSearchService.addDocuments #### Defined in -[medusa/src/services/search.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L40) +[medusa/src/services/search.ts:40](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L40) ___ ### createIndex -▸ **createIndex**(`indexName`, `options`): `Promise`<`void`\> +**createIndex**(`indexName`, `options`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `indexName` | `string` | | `options` | `unknown` | @@ -126,48 +132,52 @@ ___ `Promise`<`void`\> +-`Promise`: + #### Overrides AbstractSearchService.createIndex #### Defined in -[medusa/src/services/search.ts:28](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L28) +[medusa/src/services/search.ts:28](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L28) ___ ### deleteAllDocuments -▸ **deleteAllDocuments**(`indexName`): `Promise`<`void`\> +**deleteAllDocuments**(`indexName`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `indexName` | `string` | #### Returns `Promise`<`void`\> +-`Promise`: + #### Overrides AbstractSearchService.deleteAllDocuments #### Defined in -[medusa/src/services/search.ts:69](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L69) +[medusa/src/services/search.ts:69](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L69) ___ ### deleteDocument -▸ **deleteDocument**(`indexName`, `document_id`): `Promise`<`void`\> +**deleteDocument**(`indexName`, `document_id`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `indexName` | `string` | | `document_id` | `string` \| `number` | @@ -175,48 +185,52 @@ ___ `Promise`<`void`\> +-`Promise`: + #### Overrides AbstractSearchService.deleteDocument #### Defined in -[medusa/src/services/search.ts:60](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L60) +[medusa/src/services/search.ts:60](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L60) ___ ### getIndex -▸ **getIndex**(`indexName`): `Promise`<`void`\> +**getIndex**(`indexName`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `indexName` | `string` | #### Returns `Promise`<`void`\> +-`Promise`: + #### Overrides AbstractSearchService.getIndex #### Defined in -[medusa/src/services/search.ts:34](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L34) +[medusa/src/services/search.ts:34](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L34) ___ ### replaceDocuments -▸ **replaceDocuments**(`indexName`, `documents`, `type`): `Promise`<`void`\> +**replaceDocuments**(`indexName`, `documents`, `type`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `indexName` | `string` | | `documents` | `unknown` | | `type` | `string` | @@ -225,24 +239,26 @@ ___ `Promise`<`void`\> +-`Promise`: + #### Overrides AbstractSearchService.replaceDocuments #### Defined in -[medusa/src/services/search.ts:50](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L50) +[medusa/src/services/search.ts:50](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L50) ___ ### search -▸ **search**(`indexName`, `query`, `options`): `Promise`<{ `hits`: `unknown`[] }\> +**search**(`indexName`, `query`, `options`): `Promise`<{ `hits`: `unknown`[] }\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `indexName` | `string` | | `query` | `unknown` | | `options` | `unknown` | @@ -251,24 +267,27 @@ ___ `Promise`<{ `hits`: `unknown`[] }\> +-`Promise`: + -``object``: (optional) + #### Overrides AbstractSearchService.search #### Defined in -[medusa/src/services/search.ts:75](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L75) +[medusa/src/services/search.ts:75](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L75) ___ ### updateSettings -▸ **updateSettings**(`indexName`, `settings`): `Promise`<`void`\> +**updateSettings**(`indexName`, `settings`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `indexName` | `string` | | `settings` | `unknown` | @@ -276,10 +295,12 @@ ___ `Promise`<`void`\> +-`Promise`: + #### Overrides AbstractSearchService.updateSettings #### Defined in -[medusa/src/services/search.ts:86](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/search.ts#L86) +[medusa/src/services/search.ts:86](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/search.ts#L86) diff --git a/www/apps/docs/content/references/services/classes/ShippingOptionService.md b/www/apps/docs/content/references/services/classes/ShippingOptionService.md index 1c64510576166..d7e08cc7e13e4 100644 --- a/www/apps/docs/content/references/services/classes/ShippingOptionService.md +++ b/www/apps/docs/content/references/services/classes/ShippingOptionService.md @@ -1,4 +1,4 @@ -# Class: ShippingOptionService +# ShippingOptionService Provides layer to manipulate profiles. @@ -12,12 +12,12 @@ Provides layer to manipulate profiles. ### constructor -• **new ShippingOptionService**(`«destructured»`) +**new ShippingOptionService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -26,13 +26,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/shipping-option.ts:52](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L52) +[medusa/src/services/shipping-option.ts:52](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L52) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -68,23 +68,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### featureFlagRouter\_ -• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` + `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` #### Defined in -[medusa/src/services/shipping-option.ts:50](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L50) +[medusa/src/services/shipping-option.ts:50](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L50) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -92,63 +92,63 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### methodRepository\_ -• `Protected` `Readonly` **methodRepository\_**: `Repository`<`ShippingMethod`\> + `Protected` `Readonly` **methodRepository\_**: `Repository`<`ShippingMethod`\> #### Defined in -[medusa/src/services/shipping-option.ts:49](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L49) +[medusa/src/services/shipping-option.ts:49](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L49) ___ ### optionRepository\_ -• `Protected` `Readonly` **optionRepository\_**: `Repository`<`ShippingOption`\> & { `upsertShippingProfile`: (`shippingOptionIds`: `string`[], `shippingProfileId`: `string`) => `Promise`<`ShippingOption`[]\> } + `Protected` `Readonly` **optionRepository\_**: `Repository`<`ShippingOption`\> & { `upsertShippingProfile`: Method upsertShippingProfile } #### Defined in -[medusa/src/services/shipping-option.ts:48](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L48) +[medusa/src/services/shipping-option.ts:48](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L48) ___ ### providerService\_ -• `Protected` `Readonly` **providerService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md) + `Protected` `Readonly` **providerService\_**: [`FulfillmentProviderService`](FulfillmentProviderService.md) #### Defined in -[medusa/src/services/shipping-option.ts:44](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L44) +[medusa/src/services/shipping-option.ts:44](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L44) ___ ### regionService\_ -• `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md) + `Protected` `Readonly` **regionService\_**: [`RegionService`](RegionService.md) #### Defined in -[medusa/src/services/shipping-option.ts:45](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L45) +[medusa/src/services/shipping-option.ts:45](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L45) ___ ### requirementRepository\_ -• `Protected` `Readonly` **requirementRepository\_**: `Repository`<`ShippingOptionRequirement`\> + `Protected` `Readonly` **requirementRepository\_**: `Repository`<`ShippingOptionRequirement`\> #### Defined in -[medusa/src/services/shipping-option.ts:47](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L47) +[medusa/src/services/shipping-option.ts:47](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L47) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -156,39 +156,41 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### addRequirement -▸ **addRequirement**(`optionId`, `requirement`): `Promise`<`ShippingOption`\> +**addRequirement**(`optionId`, `requirement`): `Promise`<`ShippingOption`\> Adds a requirement to a shipping option. Only 1 requirement of each type is allowed. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `optionId` | `string` | the option to add the requirement to. | | `requirement` | `ShippingOptionRequirement` | the requirement for the option. | @@ -196,33 +198,32 @@ is allowed. `Promise`<`ShippingOption`\> -the result of update +-`Promise`: the result of update + -`ShippingOption`: #### Defined in -[medusa/src/services/shipping-option.ts:693](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L693) +[medusa/src/services/shipping-option.ts:693](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L693) ___ ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -231,7 +232,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -239,13 +240,13 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**(`data`): `Promise`<`ShippingOption`\> +**create**(`data`): `Promise`<`ShippingOption`\> Creates a new shipping option. Used both for outbound and inbound shipping options. The difference is registered by the `is_return` field which @@ -253,99 +254,104 @@ defaults to false. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `data` | `CreateShippingOptionInput` | the data to create shipping options | #### Returns `Promise`<`ShippingOption`\> -the result of the create operation +-`Promise`: the result of the create operation + -`ShippingOption`: #### Defined in -[medusa/src/services/shipping-option.ts:431](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L431) +[medusa/src/services/shipping-option.ts:431](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L431) ___ ### createShippingMethod -▸ **createShippingMethod**(`optionId`, `data`, `config`): `Promise`<`ShippingMethod`\> +**createShippingMethod**(`optionId`, `data`, `config`): `Promise`<`ShippingMethod`\> Creates a shipping method for a given cart. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `optionId` | `string` | the id of the option to use for the method. | -| `data` | `Record`<`string`, `unknown`\> | the optional provider data to use. | +| `data` | Record<`string`, `unknown`\> | the optional provider data to use. | | `config` | `CreateShippingMethodDto` | the cart to create the shipping method for. | #### Returns `Promise`<`ShippingMethod`\> -the resulting shipping method. +-`Promise`: the resulting shipping method. + -`ShippingMethod`: #### Defined in -[medusa/src/services/shipping-option.ts:258](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L258) +[medusa/src/services/shipping-option.ts:258](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L258) ___ ### delete -▸ **delete**(`optionId`): `Promise`<`void` \| `ShippingOption`\> +**delete**(`optionId`): `Promise`<`void` \| `ShippingOption`\> Deletes a profile with a given profile id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `optionId` | `string` | the id of the profile to delete. Must be castable as an ObjectId | #### Returns `Promise`<`void` \| `ShippingOption`\> -the result of the delete operation. +-`Promise`: the result of the delete operation. + -`void \| ShippingOption`: (optional) #### Defined in -[medusa/src/services/shipping-option.ts:671](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L671) +[medusa/src/services/shipping-option.ts:671](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L671) ___ ### deleteShippingMethods -▸ **deleteShippingMethods**(`shippingMethods`): `Promise`<`ShippingMethod`[]\> +**deleteShippingMethods**(`shippingMethods`): `Promise`<`ShippingMethod`[]\> Removes a given shipping method #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `shippingMethods` | `ShippingMethod` \| `ShippingMethod`[] | the shipping method to remove | #### Returns `Promise`<`ShippingMethod`[]\> -removed shipping methods +-`Promise`: removed shipping methods + -`ShippingMethod[]`: + -`ShippingMethod`: #### Defined in -[medusa/src/services/shipping-option.ts:238](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L238) +[medusa/src/services/shipping-option.ts:238](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L238) ___ ### getPrice\_ -▸ **getPrice_**(`option`, `data`, `cart`): `Promise`<`number`\> +**getPrice_**(`option`, `data`, `cart`): `Promise`<`number`\> Returns the amount to be paid for a shipping method. Will ask the fulfillment provider to calculate the price if the shipping option has the @@ -353,32 +359,33 @@ price type "calculated". #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `option` | `ShippingOption` | the shipping option to retrieve the price for. | -| `data` | `Record`<`string`, `unknown`\> | the shipping data to retrieve the price. | +| `data` | Record<`string`, `unknown`\> | the shipping data to retrieve the price. | | `cart` | `undefined` \| `Order` \| `Cart` | the context in which the price should be retrieved. | #### Returns `Promise`<`number`\> -the price of the shipping option. +-`Promise`: the price of the shipping option. + -`number`: (optional) #### Defined in -[medusa/src/services/shipping-option.ts:771](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L771) +[medusa/src/services/shipping-option.ts:771](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L771) ___ ### list -▸ **list**(`selector`, `config?`): `Promise`<`ShippingOption`[]\> +**list**(`selector`, `config?`): `Promise`<`ShippingOption`[]\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`ShippingOption`\> | the query object for find | | `config` | `FindConfig`<`ShippingOption`\> | config object | @@ -386,22 +393,24 @@ ___ `Promise`<`ShippingOption`[]\> -the result of the find operation +-`Promise`: the result of the find operation + -`ShippingOption[]`: + -`ShippingOption`: #### Defined in -[medusa/src/services/shipping-option.ts:145](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L145) +[medusa/src/services/shipping-option.ts:145](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L145) ___ ### listAndCount -▸ **listAndCount**(`selector`, `config?`): `Promise`<[`ShippingOption`[], `number`]\> +**listAndCount**(`selector`, `config?`): `Promise`<[`ShippingOption`[], `number`]\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`ShippingOption`\> | the query object for find | | `config` | `FindConfig`<`ShippingOption`\> | config object | @@ -409,49 +418,52 @@ ___ `Promise`<[`ShippingOption`[], `number`]\> -the result of the find operation +-`Promise`: the result of the find operation + -`ShippingOption[]`: + -`number`: (optional) #### Defined in -[medusa/src/services/shipping-option.ts:160](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L160) +[medusa/src/services/shipping-option.ts:160](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L160) ___ ### removeRequirement -▸ **removeRequirement**(`requirementId`): `Promise`<`void` \| `ShippingOptionRequirement`\> +**removeRequirement**(`requirementId`): `Promise`<`void` \| `ShippingOptionRequirement`\> Removes a requirement from a shipping option #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `requirementId` | `any` | the id of the requirement to remove | #### Returns `Promise`<`void` \| `ShippingOptionRequirement`\> -the result of update +-`Promise`: the result of update + -`void \| ShippingOptionRequirement`: (optional) #### Defined in -[medusa/src/services/shipping-option.ts:722](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L722) +[medusa/src/services/shipping-option.ts:722](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L722) ___ ### retrieve -▸ **retrieve**(`optionId`, `options?`): `Promise`<`ShippingOption`\> +**retrieve**(`optionId`, `options?`): `Promise`<`ShippingOption`\> Gets a profile by id. Throws in case of DB Error and if profile was not found. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `optionId` | `any` | the id of the profile to get. | | `options` | `FindConfig`<`ShippingOption`\> | the options to get a profile | @@ -459,41 +471,44 @@ Throws in case of DB Error and if profile was not found. `Promise`<`ShippingOption`\> -the profile document. +-`Promise`: the profile document. + -`ShippingOption`: #### Defined in -[medusa/src/services/shipping-option.ts:177](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L177) +[medusa/src/services/shipping-option.ts:177](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L177) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`optionId`, `update`): `Promise`<`ShippingOption`\> +**update**(`optionId`, `update`): `Promise`<`ShippingOption`\> Updates a profile. Metadata updates and product updates should use dedicated methods, e.g. `setMetadata`, etc. The function @@ -501,8 +516,8 @@ will throw errors if metadata or product updates are attempted. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `optionId` | `string` | the id of the option. Must be a string that can be casted to an ObjectId | | `update` | `UpdateShippingOptionInput` | an object with the update values. | @@ -510,25 +525,26 @@ will throw errors if metadata or product updates are attempted. `Promise`<`ShippingOption`\> -resolves to the update result. +-`Promise`: resolves to the update result. + -`ShippingOption`: #### Defined in -[medusa/src/services/shipping-option.ts:559](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L559) +[medusa/src/services/shipping-option.ts:559](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L559) ___ ### updateShippingMethod -▸ **updateShippingMethod**(`id`, `update`): `Promise`<`undefined` \| `ShippingMethod`\> +**updateShippingMethod**(`id`, `update`): `Promise`<`undefined` \| `ShippingMethod`\> Updates a shipping method's associations. Useful when a cart is completed and its methods should be copied to an order/swap entity. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `id` | `string` | the id of the shipping method to update | | `update` | `ShippingMethodUpdate` | the values to update the method with | @@ -536,22 +552,23 @@ and its methods should be copied to an order/swap entity. `Promise`<`undefined` \| `ShippingMethod`\> -the resulting shipping method +-`Promise`: the resulting shipping method + -`undefined \| ShippingMethod`: (optional) #### Defined in -[medusa/src/services/shipping-option.ts:211](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L211) +[medusa/src/services/shipping-option.ts:211](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L211) ___ ### updateShippingProfile -▸ **updateShippingProfile**(`optionIds`, `profileId`): `Promise`<`ShippingOption`[]\> +**updateShippingProfile**(`optionIds`, `profileId`): `Promise`<`ShippingOption`[]\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `optionIds` | `string` \| `string`[] | ID or IDs of the shipping options to update | | `profileId` | `string` | Shipping profile ID to update the shipping options with | @@ -559,22 +576,24 @@ ___ `Promise`<`ShippingOption`[]\> -updated shipping options +-`Promise`: updated shipping options + -`ShippingOption[]`: + -`ShippingOption`: #### Defined in -[medusa/src/services/shipping-option.ts:747](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L747) +[medusa/src/services/shipping-option.ts:747](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L747) ___ ### validateAndMutatePrice -▸ `Private` **validateAndMutatePrice**(`option`, `priceInput`): `Promise`<`CreateShippingOptionInput` \| `Omit`<`ShippingOption`, ``"beforeInsert"``\>\> +`Private` **validateAndMutatePrice**(`option`, `priceInput`): `Promise`<`CreateShippingOptionInput` \| `Omit`<`ShippingOption`, ``"beforeInsert"``\>\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `option` | `ShippingOption` \| `CreateShippingOptionInput` | | `priceInput` | `ValidatePriceTypeAndAmountInput` | @@ -582,15 +601,18 @@ ___ `Promise`<`CreateShippingOptionInput` \| `Omit`<`ShippingOption`, ``"beforeInsert"``\>\> +-`Promise`: + -`CreateShippingOptionInput \| Omit`: (optional) + #### Defined in -[medusa/src/services/shipping-option.ts:388](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L388) +[medusa/src/services/shipping-option.ts:388](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L388) ___ ### validateCartOption -▸ **validateCartOption**(`option`, `cart`): `Promise`<``null`` \| `ShippingOption`\> +**validateCartOption**(`option`, `cart`): `Promise`<``null`` \| `ShippingOption`\> Checks if a given option id is a valid option for a cart. If it is the option is returned with the correct price. Throws when region_ids do not @@ -598,8 +620,8 @@ match, or when the shipping option requirements are not satisfied. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `option` | `ShippingOption` | the option object to check | | `cart` | `Cart` | the cart object to check against | @@ -607,24 +629,25 @@ match, or when the shipping option requirements are not satisfied. `Promise`<``null`` \| `ShippingOption`\> -the validated shipping option +-`Promise`: the validated shipping option + -```null`` \| ShippingOption`: (optional) #### Defined in -[medusa/src/services/shipping-option.ts:346](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L346) +[medusa/src/services/shipping-option.ts:346](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L346) ___ ### validatePriceType\_ -▸ **validatePriceType_**(`priceType`, `option`): `Promise`<`ShippingOptionPriceType`\> +**validatePriceType_**(`priceType`, `option`): `Promise`<`ShippingOptionPriceType`\> Validates a shipping option price #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `priceType` | `ShippingOptionPriceType` | the price to validate | | `option` | `ShippingOption` | the option to validate against | @@ -632,57 +655,60 @@ Validates a shipping option price `Promise`<`ShippingOptionPriceType`\> -the validated price +-`Promise`: the validated price #### Defined in -[medusa/src/services/shipping-option.ts:519](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L519) +[medusa/src/services/shipping-option.ts:519](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L519) ___ ### validateRequirement\_ -▸ **validateRequirement_**(`requirement`, `optionId?`): `Promise`<`ShippingOptionRequirement`\> +**validateRequirement_**(`requirement`, `optionId?`): `Promise`<`ShippingOptionRequirement`\> Validates a requirement #### Parameters -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `requirement` | `ShippingOptionRequirement` | `undefined` | the requirement to validate | +| Name | Default value | Description | +| :------ | :------ | :------ | +| `requirement` | `ShippingOptionRequirement` | the requirement to validate | | `optionId` | `undefined` \| `string` | `undefined` | the id to validate the requirement | #### Returns `Promise`<`ShippingOptionRequirement`\> -a validated shipping requirement +-`Promise`: a validated shipping requirement + -`ShippingOptionRequirement`: #### Defined in -[medusa/src/services/shipping-option.ts:77](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-option.ts#L77) +[medusa/src/services/shipping-option.ts:77](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-option.ts#L77) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`ShippingOptionService`](ShippingOptionService.md) +**withTransaction**(`transactionManager?`): [`ShippingOptionService`](ShippingOptionService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`ShippingOptionService`](ShippingOptionService.md) +-`ShippingOptionService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/ShippingProfileService.md b/www/apps/docs/content/references/services/classes/ShippingProfileService.md index 7efec0d16b5f3..9f4d38a1e20ea 100644 --- a/www/apps/docs/content/references/services/classes/ShippingProfileService.md +++ b/www/apps/docs/content/references/services/classes/ShippingProfileService.md @@ -1,8 +1,8 @@ -# Class: ShippingProfileService +# ShippingProfileService Provides layer to manipulate profiles. -**`Implements`** +**Implements** ## Hierarchy @@ -14,12 +14,12 @@ Provides layer to manipulate profiles. ### constructor -• **new ShippingProfileService**(`«destructured»`) +**new ShippingProfileService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -28,13 +28,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/shipping-profile.ts:49](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L49) +[medusa/src/services/shipping-profile.ts:49](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L49) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -42,13 +42,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -56,13 +56,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -70,33 +70,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### customShippingOptionService\_ -• `Protected` `Readonly` **customShippingOptionService\_**: [`CustomShippingOptionService`](CustomShippingOptionService.md) + `Protected` `Readonly` **customShippingOptionService\_**: [`CustomShippingOptionService`](CustomShippingOptionService.md) #### Defined in -[medusa/src/services/shipping-profile.ts:43](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L43) +[medusa/src/services/shipping-profile.ts:43](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L43) ___ ### featureFlagRouter\_ -• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` + `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` #### Defined in -[medusa/src/services/shipping-profile.ts:47](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L47) +[medusa/src/services/shipping-profile.ts:47](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L47) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -104,53 +104,53 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### productRepository\_ -• `Protected` `Readonly` **productRepository\_**: `Repository`<`Product`\> & { `_applyCategoriesQuery`: (`qb`: `SelectQueryBuilder`<`Product`\>, `__namedParameters`: `Object`) => `SelectQueryBuilder`<`Product`\> ; `_findWithRelations`: (`__namedParameters`: { `idsOrOptionsWithoutRelations`: `string`[] \| `FindWithoutRelationsOptions` ; `relations`: `string`[] ; `shouldCount`: `boolean` ; `withDeleted`: `boolean` }) => `Promise`<[`Product`[], `number`]\> ; `bulkAddToCollection`: (`productIds`: `string`[], `collectionId`: `string`) => `Promise`<`Product`[]\> ; `bulkRemoveFromCollection`: (`productIds`: `string`[], `collectionId`: `string`) => `Promise`<`Product`[]\> ; `findOneWithRelations`: (`relations`: `string`[], `optionsWithoutRelations`: `FindWithoutRelationsOptions`) => `Promise`<`Product`\> ; `findWithRelations`: (`relations`: `string`[], `idsOrOptionsWithoutRelations`: `string`[] \| `FindWithoutRelationsOptions`, `withDeleted`: `boolean`) => `Promise`<`Product`[]\> ; `findWithRelationsAndCount`: (`relations`: `string`[], `idsOrOptionsWithoutRelations`: `FindWithoutRelationsOptions`) => `Promise`<[`Product`[], `number`]\> ; `getCategoryIdsFromInput`: (`categoryId?`: `CategoryQueryParams`, `includeCategoryChildren`: `boolean`) => `Promise`<`string`[]\> ; `getCategoryIdsRecursively`: (`productCategory`: `ProductCategory`) => `string`[] ; `getFreeTextSearchResultsAndCount`: (`q`: `string`, `options`: `FindWithoutRelationsOptions`, `relations`: `string`[]) => `Promise`<[`Product`[], `number`]\> ; `isProductInSalesChannels`: (`id`: `string`, `salesChannelIds`: `string`[]) => `Promise`<`boolean`\> ; `queryProducts`: (`optionsWithoutRelations`: `FindWithoutRelationsOptions`, `shouldCount`: `boolean`) => `Promise`<[`Product`[], `number`]\> ; `queryProductsWithIds`: (`__namedParameters`: { `entityIds`: `string`[] ; `groupedRelations`: { `[toplevel: string]`: `string`[]; } ; `order?`: { `[column: string]`: ``"ASC"`` \| ``"DESC"``; } ; `select?`: keyof `Product`[] ; `where?`: `FindOptionsWhere`<`Product`\> ; `withDeleted?`: `boolean` }) => `Promise`<`Product`[]\> } + `Protected` `Readonly` **productRepository\_**: `Repository`<`Product`\> & { `_applyCategoriesQuery`: Method \_applyCategoriesQuery ; `_findWithRelations`: Method \_findWithRelations ; `bulkAddToCollection`: Method bulkAddToCollection ; `bulkRemoveFromCollection`: Method bulkRemoveFromCollection ; `findOneWithRelations`: Method findOneWithRelations ; `findWithRelations`: Method findWithRelations ; `findWithRelationsAndCount`: Method findWithRelationsAndCount ; `getCategoryIdsFromInput`: Method getCategoryIdsFromInput ; `getCategoryIdsRecursively`: Method getCategoryIdsRecursively ; `getFreeTextSearchResultsAndCount`: Method getFreeTextSearchResultsAndCount ; `isProductInSalesChannels`: Method isProductInSalesChannels ; `queryProducts`: Method queryProducts ; `queryProductsWithIds`: Method queryProductsWithIds } #### Defined in -[medusa/src/services/shipping-profile.ts:46](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L46) +[medusa/src/services/shipping-profile.ts:46](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L46) ___ ### productService\_ -• `Protected` `Readonly` **productService\_**: [`ProductService`](ProductService.md) + `Protected` `Readonly` **productService\_**: [`ProductService`](ProductService.md) #### Defined in -[medusa/src/services/shipping-profile.ts:41](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L41) +[medusa/src/services/shipping-profile.ts:41](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L41) ___ ### shippingOptionService\_ -• `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md) + `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md) #### Defined in -[medusa/src/services/shipping-profile.ts:42](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L42) +[medusa/src/services/shipping-profile.ts:42](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L42) ___ ### shippingProfileRepository\_ -• `Protected` `Readonly` **shippingProfileRepository\_**: `Repository`<`ShippingProfile`\> & { `findByProducts`: (`productIds`: `string` \| `string`[]) => `Promise`<{ `[product_id: string]`: `ShippingProfile`[]; }\> } + `Protected` `Readonly` **shippingProfileRepository\_**: `Repository`<`ShippingProfile`\> & { `findByProducts`: Method findByProducts } #### Defined in -[medusa/src/services/shipping-profile.ts:45](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L45) +[medusa/src/services/shipping-profile.ts:45](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L45) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -158,36 +158,38 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### addProduct -▸ **addProduct**(`profileId`, `productId`): `Promise`<`ShippingProfile`\> +**addProduct**(`profileId`, `productId`): `Promise`<`ShippingProfile`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `profileId` | `string` | | `productId` | `string` \| `string`[] | @@ -195,26 +197,29 @@ TransactionBaseService.activeManager\_ `Promise`<`ShippingProfile`\> -**`Deprecated`** +-`Promise`: + -`ShippingProfile`: + +**Deprecated** use [addProducts](ShippingProfileService.md#addproducts) instead #### Defined in -[medusa/src/services/shipping-profile.ts:371](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L371) +[medusa/src/services/shipping-profile.ts:371](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L371) ___ ### addProducts -▸ **addProducts**(`profileId`, `productId`): `Promise`<`ShippingProfile`\> +**addProducts**(`profileId`, `productId`): `Promise`<`ShippingProfile`\> Adds a product or an array of products to the profile. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `profileId` | `string` | the profile to add the products to. | | `productId` | `string` \| `string`[] | the ID of the product or multiple products to add. | @@ -222,25 +227,26 @@ Adds a product or an array of products to the profile. `Promise`<`ShippingProfile`\> -the result of update +-`Promise`: the result of update + -`ShippingProfile`: #### Defined in -[medusa/src/services/shipping-profile.ts:384](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L384) +[medusa/src/services/shipping-profile.ts:384](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L384) ___ ### addShippingOption -▸ **addShippingOption**(`profileId`, `optionId`): `Promise`<`ShippingProfile`\> +**addShippingOption**(`profileId`, `optionId`): `Promise`<`ShippingProfile`\> Adds a shipping option to the profile. The shipping option can be used to fulfill the products in the products field. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `profileId` | `string` | the profile to apply the shipping option to | | `optionId` | `string` \| `string`[] | the ID of the option or multiple options to add to the profile | @@ -248,33 +254,32 @@ fulfill the products in the products field. `Promise`<`ShippingProfile`\> -the result of the model update operation +-`Promise`: the result of the model update operation + -`ShippingProfile`: #### Defined in -[medusa/src/services/shipping-profile.ts:427](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L427) +[medusa/src/services/shipping-profile.ts:427](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L427) ___ ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -283,7 +288,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -291,37 +296,38 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**(`profile`): `Promise`<`ShippingProfile`\> +**create**(`profile`): `Promise`<`ShippingProfile`\> Creates a new shipping profile. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `profile` | `CreateShippingProfile` | the shipping profile to create from | #### Returns `Promise`<`ShippingProfile`\> -the result of the create operation +-`Promise`: the result of the create operation + -`ShippingProfile`: #### Defined in -[medusa/src/services/shipping-profile.ts:275](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L275) +[medusa/src/services/shipping-profile.ts:275](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L275) ___ ### createDefault -▸ **createDefault**(): `Promise`<`ShippingProfile`\> +**createDefault**(): `Promise`<`ShippingProfile`\> Creates a default shipping profile, if this does not already exist. @@ -329,17 +335,18 @@ Creates a default shipping profile, if this does not already exist. `Promise`<`ShippingProfile`\> -the shipping profile +-`Promise`: the shipping profile + -`ShippingProfile`: #### Defined in -[medusa/src/services/shipping-profile.ts:205](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L205) +[medusa/src/services/shipping-profile.ts:205](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L205) ___ ### createGiftCardDefault -▸ **createGiftCardDefault**(): `Promise`<`ShippingProfile`\> +**createGiftCardDefault**(): `Promise`<`ShippingProfile`\> Creates a default shipping profile, for gift cards if unless it already exists. @@ -348,115 +355,125 @@ exists. `Promise`<`ShippingProfile`\> -the shipping profile +-`Promise`: the shipping profile + -`ShippingProfile`: #### Defined in -[medusa/src/services/shipping-profile.ts:249](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L249) +[medusa/src/services/shipping-profile.ts:249](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L249) ___ ### delete -▸ **delete**(`profileId`): `Promise`<`void`\> +**delete**(`profileId`): `Promise`<`void`\> Deletes a profile with a given profile id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `profileId` | `string` | the id of the profile to delete. Must be castable as an ObjectId | #### Returns `Promise`<`void`\> -the result of the delete operation. +-`Promise`: the result of the delete operation. #### Defined in -[medusa/src/services/shipping-profile.ts:349](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L349) +[medusa/src/services/shipping-profile.ts:349](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L349) ___ ### fetchCartOptions -▸ **fetchCartOptions**(`cart`): `Promise`<`ShippingOption`[]\> +**fetchCartOptions**(`cart`): `Promise`<`ShippingOption`[]\> Finds all the shipping profiles that cover the products in a cart, and validates all options that are available for the cart. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cart` | `any` | the cart object to find shipping options for | #### Returns `Promise`<`ShippingOption`[]\> -a list of the available shipping options +-`Promise`: a list of the available shipping options + -`ShippingOption[]`: + -`ShippingOption`: #### Defined in -[medusa/src/services/shipping-profile.ts:452](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L452) +[medusa/src/services/shipping-profile.ts:452](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L452) ___ ### getMapProfileIdsByProductIds -▸ **getMapProfileIdsByProductIds**(`productIds`): `Promise`<`Map`<`string`, `string`\>\> +**getMapProfileIdsByProductIds**(`productIds`): `Promise`<`Map`<`string`, `string`\>\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `productIds` | `string`[] | #### Returns `Promise`<`Map`<`string`, `string`\>\> +-`Promise`: + -`Map`: + -`string`: (optional) + -`string`: (optional) + #### Defined in -[medusa/src/services/shipping-profile.ts:88](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L88) +[medusa/src/services/shipping-profile.ts:88](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L88) ___ ### getProfilesInCart -▸ `Protected` **getProfilesInCart**(`cart`): `Promise`<`string`[]\> +`Protected` **getProfilesInCart**(`cart`): `Promise`<`string`[]\> Returns a list of all the productIds in the cart. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cart` | `Cart` | the cart to extract products from | #### Returns `Promise`<`string`[]\> -a list of product ids +-`Promise`: a list of product ids + -`string[]`: + -`string`: (optional) #### Defined in -[medusa/src/services/shipping-profile.ts:518](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L518) +[medusa/src/services/shipping-profile.ts:518](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L518) ___ ### list -▸ **list**(`selector?`, `config?`): `Promise`<`ShippingProfile`[]\> +**list**(`selector?`, `config?`): `Promise`<`ShippingProfile`[]\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`ShippingProfile`\> | the query object for find | | `config` | `FindConfig`<`ShippingProfile`\> | the config object for find | @@ -464,24 +481,26 @@ ___ `Promise`<`ShippingProfile`[]\> -the result of the find operation +-`Promise`: the result of the find operation + -`ShippingProfile[]`: + -`ShippingProfile`: #### Defined in -[medusa/src/services/shipping-profile.ts:73](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L73) +[medusa/src/services/shipping-profile.ts:73](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L73) ___ ### removeProducts -▸ **removeProducts**(`profileId`, `productId`): `Promise`<`void` \| `ShippingProfile`\> +**removeProducts**(`profileId`, `productId`): `Promise`<`void` \| `ShippingProfile`\> Removes a product or an array of products from the profile. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `profileId` | ``null`` \| `string` | the profile to add the products to. | | `productId` | `string` \| `string`[] | the ID of the product or multiple products to add. | @@ -489,25 +508,26 @@ Removes a product or an array of products from the profile. `Promise`<`void` \| `ShippingProfile`\> -the result of update +-`Promise`: the result of update + -`void \| ShippingProfile`: (optional) #### Defined in -[medusa/src/services/shipping-profile.ts:406](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L406) +[medusa/src/services/shipping-profile.ts:406](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L406) ___ ### retrieve -▸ **retrieve**(`profileId`, `options?`): `Promise`<`ShippingProfile`\> +**retrieve**(`profileId`, `options?`): `Promise`<`ShippingProfile`\> Gets a profile by id. Throws in case of DB Error and if profile was not found. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `profileId` | `string` | the id of the profile to get. | | `options` | `FindConfig`<`ShippingProfile`\> | options opf the query. | @@ -515,51 +535,58 @@ Throws in case of DB Error and if profile was not found. `Promise`<`ShippingProfile`\> -the profile document. +-`Promise`: the profile document. + -`ShippingProfile`: #### Defined in -[medusa/src/services/shipping-profile.ts:130](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L130) +[medusa/src/services/shipping-profile.ts:130](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L130) ___ ### retrieveDefault -▸ **retrieveDefault**(): `Promise`<``null`` \| `ShippingProfile`\> +**retrieveDefault**(): `Promise`<``null`` \| `ShippingProfile`\> #### Returns `Promise`<``null`` \| `ShippingProfile`\> +-`Promise`: + -```null`` \| ShippingProfile`: (optional) + #### Defined in -[medusa/src/services/shipping-profile.ts:189](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L189) +[medusa/src/services/shipping-profile.ts:189](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L189) ___ ### retrieveForProducts -▸ **retrieveForProducts**(`productIds`): `Promise`<{ `[product_id: string]`: `ShippingProfile`[]; }\> +**retrieveForProducts**(`productIds`): `Promise`<{ `[product_id: string]`: `ShippingProfile`[]; }\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `productIds` | `string` \| `string`[] | #### Returns `Promise`<{ `[product_id: string]`: `ShippingProfile`[]; }\> +-`Promise`: + -``object``: (optional) + #### Defined in -[medusa/src/services/shipping-profile.ts:159](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L159) +[medusa/src/services/shipping-profile.ts:159](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L159) ___ ### retrieveGiftCardDefault -▸ **retrieveGiftCardDefault**(): `Promise`<``null`` \| `ShippingProfile`\> +**retrieveGiftCardDefault**(): `Promise`<``null`` \| `ShippingProfile`\> Retrieves the default gift card profile @@ -567,41 +594,44 @@ Retrieves the default gift card profile `Promise`<``null`` \| `ShippingProfile`\> -the shipping profile for gift cards +-`Promise`: the shipping profile for gift cards + -```null`` \| ShippingProfile`: (optional) #### Defined in -[medusa/src/services/shipping-profile.ts:232](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L232) +[medusa/src/services/shipping-profile.ts:232](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L232) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`profileId`, `update`): `Promise`<`ShippingProfile`\> +**update**(`profileId`, `update`): `Promise`<`ShippingProfile`\> Updates a profile. Metadata updates and product updates should use dedicated methods, e.g. `setMetadata`, `addProduct`, etc. The function @@ -609,8 +639,8 @@ will throw errors if metadata or product updates are attempted. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `profileId` | `string` | the id of the profile. Must be a string that can be casted to an ObjectId | | `update` | `UpdateShippingProfile` | an object with the update values. | @@ -618,32 +648,35 @@ will throw errors if metadata or product updates are attempted. `Promise`<`ShippingProfile`\> -resolves to the update result. +-`Promise`: resolves to the update result. + -`ShippingProfile`: #### Defined in -[medusa/src/services/shipping-profile.ts:310](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/shipping-profile.ts#L310) +[medusa/src/services/shipping-profile.ts:310](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/shipping-profile.ts#L310) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`ShippingProfileService`](ShippingProfileService.md) +**withTransaction**(`transactionManager?`): [`ShippingProfileService`](ShippingProfileService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`ShippingProfileService`](ShippingProfileService.md) +-`ShippingProfileService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/StagedJobService.md b/www/apps/docs/content/references/services/classes/StagedJobService.md index 6c4667c01a6f3..547c842abeb79 100644 --- a/www/apps/docs/content/references/services/classes/StagedJobService.md +++ b/www/apps/docs/content/references/services/classes/StagedJobService.md @@ -1,4 +1,4 @@ -# Class: StagedJobService +# StagedJobService Provides layer to manipulate users. @@ -12,12 +12,12 @@ Provides layer to manipulate users. ### constructor -• **new StagedJobService**(`«destructured»`) +**new StagedJobService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `StagedJobServiceProps` | #### Overrides @@ -26,13 +26,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/staged-job.ts:22](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/staged-job.ts#L22) +[medusa/src/services/staged-job.ts:22](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/staged-job.ts#L22) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -68,13 +68,13 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -82,23 +82,23 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### stagedJobRepository\_ -• `Protected` **stagedJobRepository\_**: `Repository`<`StagedJob`\> & { `insertBulk`: (`jobToCreates`: `_QueryDeepPartialEntity`<`StagedJob`\>[]) => `Promise`<`StagedJob`[]\> } + `Protected` **stagedJobRepository\_**: `Repository`<`StagedJob`\> & { `insertBulk`: Method insertBulk } #### Defined in -[medusa/src/services/staged-job.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/staged-job.ts#L20) +[medusa/src/services/staged-job.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/staged-job.ts#L20) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -106,47 +106,47 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -155,7 +155,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -163,112 +163,126 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**(`data`): `Promise`<`StagedJob`[]\> +**create**(`data`): `Promise`<`StagedJob`[]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `data` | `EmitData`<`unknown`\> \| `EmitData`<`unknown`\>[] | #### Returns `Promise`<`StagedJob`[]\> +-`Promise`: + -`StagedJob[]`: + -`StagedJob`: + #### Defined in -[medusa/src/services/staged-job.ts:45](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/staged-job.ts#L45) +[medusa/src/services/staged-job.ts:45](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/staged-job.ts#L45) ___ ### delete -▸ **delete**(`stagedJobIds`): `Promise`<`void`\> +**delete**(`stagedJobIds`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `stagedJobIds` | `string` \| `string`[] | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/staged-job.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/staged-job.ts#L37) +[medusa/src/services/staged-job.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/staged-job.ts#L37) ___ ### list -▸ **list**(`config`): `Promise`<`StagedJob`[]\> +**list**(`config`): `Promise`<`StagedJob`[]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `config` | `FindConfig`<`StagedJob`\> | #### Returns `Promise`<`StagedJob`[]\> +-`Promise`: + -`StagedJob[]`: + -`StagedJob`: + #### Defined in -[medusa/src/services/staged-job.ts:29](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/staged-job.ts#L29) +[medusa/src/services/staged-job.ts:29](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/staged-job.ts#L29) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`StagedJobService`](StagedJobService.md) +**withTransaction**(`transactionManager?`): [`StagedJobService`](StagedJobService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`StagedJobService`](StagedJobService.md) +-`StagedJobService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/StoreService.md b/www/apps/docs/content/references/services/classes/StoreService.md index ea858c95efbde..857a503cddac7 100644 --- a/www/apps/docs/content/references/services/classes/StoreService.md +++ b/www/apps/docs/content/references/services/classes/StoreService.md @@ -1,4 +1,4 @@ -# Class: StoreService +# StoreService Provides layer to manipulate store settings. @@ -12,12 +12,12 @@ Provides layer to manipulate store settings. ### constructor -• **new StoreService**(`«destructured»`) +**new StoreService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Overrides @@ -26,13 +26,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/store.ts:28](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/store.ts#L28) +[medusa/src/services/store.ts:28](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/store.ts#L28) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -68,33 +68,33 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### currencyRepository\_ -• `Protected` `Readonly` **currencyRepository\_**: `Repository`<`Currency`\> + `Protected` `Readonly` **currencyRepository\_**: `Repository`<`Currency`\> #### Defined in -[medusa/src/services/store.ts:25](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/store.ts#L25) +[medusa/src/services/store.ts:25](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/store.ts#L25) ___ ### eventBus\_ -• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/store.ts:26](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/store.ts#L26) +[medusa/src/services/store.ts:26](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/store.ts#L26) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -102,23 +102,23 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### storeRepository\_ -• `Protected` `Readonly` **storeRepository\_**: `Repository`<`Store`\> + `Protected` `Readonly` **storeRepository\_**: `Repository`<`Store`\> #### Defined in -[medusa/src/services/store.ts:24](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/store.ts#L24) +[medusa/src/services/store.ts:24](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/store.ts#L24) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -126,71 +126,72 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### addCurrency -▸ **addCurrency**(`code`): `Promise`<`Store`\> +**addCurrency**(`code`): `Promise`<`Store`\> Add a currency to the store #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `code` | `string` | 3 character ISO currency code | #### Returns `Promise`<`Store`\> -result after update +-`Promise`: result after update + -`Store`: #### Defined in -[medusa/src/services/store.ts:208](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/store.ts#L208) +[medusa/src/services/store.ts:208](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/store.ts#L208) ___ ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -199,7 +200,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -207,13 +208,13 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**(): `Promise`<`Store`\> +**create**(): `Promise`<`Store`\> Creates a store if it doesn't already exist. @@ -221,148 +222,159 @@ Creates a store if it doesn't already exist. `Promise`<`Store`\> -The store. +-`Promise`: The store. + -`Store`: #### Defined in -[medusa/src/services/store.ts:45](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/store.ts#L45) +[medusa/src/services/store.ts:45](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/store.ts#L45) ___ ### getDefaultCurrency\_ -▸ `Protected` **getDefaultCurrency_**(`code`): `Partial`<`Currency`\> +`Protected` **getDefaultCurrency_**(`code`): `Partial`<`Currency`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `code` | `string` | #### Returns `Partial`<`Currency`\> +-`Partial`: + -`Currency`: + #### Defined in -[medusa/src/services/store.ts:100](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/store.ts#L100) +[medusa/src/services/store.ts:100](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/store.ts#L100) ___ ### removeCurrency -▸ **removeCurrency**(`code`): `Promise`<`any`\> +**removeCurrency**(`code`): `Promise`<`any`\> Removes a currency from the store #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `code` | `string` | 3 character ISO currency code | #### Returns `Promise`<`any`\> -result after update +-`Promise`: result after update + -`any`: (optional) #### Defined in -[medusa/src/services/store.ts:252](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/store.ts#L252) +[medusa/src/services/store.ts:252](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/store.ts#L252) ___ ### retrieve -▸ **retrieve**(`config?`): `Promise`<`Store`\> +**retrieve**(`config?`): `Promise`<`Store`\> Retrieve the store settings. There is always a maximum of one store. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `config` | `FindConfig`<`Store`\> | The config object from which the query will be built | #### Returns `Promise`<`Store`\> -the store +-`Promise`: the store + -`Store`: #### Defined in -[medusa/src/services/store.ts:83](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/store.ts#L83) +[medusa/src/services/store.ts:83](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/store.ts#L83) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`data`): `Promise`<`Store`\> +**update**(`data`): `Promise`<`Store`\> Updates a store #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `data` | `UpdateStoreInput` | an object with the update values. | #### Returns `Promise`<`Store`\> -resolves to the update result. +-`Promise`: resolves to the update result. + -`Store`: #### Defined in -[medusa/src/services/store.ts:116](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/store.ts#L116) +[medusa/src/services/store.ts:116](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/store.ts#L116) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`StoreService`](StoreService.md) +**withTransaction**(`transactionManager?`): [`StoreService`](StoreService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`StoreService`](StoreService.md) +-`StoreService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/StrategyResolverService.md b/www/apps/docs/content/references/services/classes/StrategyResolverService.md index cf5f2c6e4f73e..8132064522793 100644 --- a/www/apps/docs/content/references/services/classes/StrategyResolverService.md +++ b/www/apps/docs/content/references/services/classes/StrategyResolverService.md @@ -1,4 +1,4 @@ -# Class: StrategyResolverService +# StrategyResolverService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new StrategyResolverService**(`container`) +**new StrategyResolverService**(`container`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `container` | `InjectedDependencies` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/strategy-resolver.ts:11](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/strategy-resolver.ts#L11) +[medusa/src/services/strategy-resolver.ts:11](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/strategy-resolver.ts#L11) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,23 +66,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### container -• `Protected` `Readonly` **container**: `InjectedDependencies` + `Protected` `Readonly` **container**: `InjectedDependencies` #### Defined in -[medusa/src/services/strategy-resolver.ts:11](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/strategy-resolver.ts#L11) +[medusa/src/services/strategy-resolver.ts:11](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/strategy-resolver.ts#L11) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -90,13 +90,13 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -104,47 +104,47 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -153,7 +153,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -161,72 +161,78 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### resolveBatchJobByType -▸ **resolveBatchJobByType**(`type`): `AbstractBatchJobStrategy` +**resolveBatchJobByType**(`type`): `AbstractBatchJobStrategy` #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `type` | `string` | #### Returns `AbstractBatchJobStrategy` +-`AbstractBatchJobStrategy`: + #### Defined in -[medusa/src/services/strategy-resolver.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/strategy-resolver.ts#L15) +[medusa/src/services/strategy-resolver.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/strategy-resolver.ts#L15) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`StrategyResolverService`](StrategyResolverService.md) +**withTransaction**(`transactionManager?`): [`StrategyResolverService`](StrategyResolverService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`StrategyResolverService`](StrategyResolverService.md) +-`default`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/SwapService.md b/www/apps/docs/content/references/services/classes/SwapService.md index 54c1798d517df..2e8e5dbe55bc9 100644 --- a/www/apps/docs/content/references/services/classes/SwapService.md +++ b/www/apps/docs/content/references/services/classes/SwapService.md @@ -1,4 +1,4 @@ -# Class: SwapService +# SwapService Handles swaps @@ -12,12 +12,12 @@ Handles swaps ### constructor -• **new SwapService**(`«destructured»`) +**new SwapService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedProps` | #### Overrides @@ -26,13 +26,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/swap.ts:91](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L91) +[medusa/src/services/swap.ts:91](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L91) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -68,73 +68,73 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### cartService\_ -• `Protected` `Readonly` **cartService\_**: [`CartService`](CartService.md) + `Protected` `Readonly` **cartService\_**: [`CartService`](CartService.md) #### Defined in -[medusa/src/services/swap.ts:77](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L77) +[medusa/src/services/swap.ts:77](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L77) ___ ### customShippingOptionService\_ -• `Protected` `Readonly` **customShippingOptionService\_**: [`CustomShippingOptionService`](CustomShippingOptionService.md) + `Protected` `Readonly` **customShippingOptionService\_**: [`CustomShippingOptionService`](CustomShippingOptionService.md) #### Defined in -[medusa/src/services/swap.ts:87](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L87) +[medusa/src/services/swap.ts:87](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L87) ___ ### eventBus\_ -• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/swap.ts:78](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L78) +[medusa/src/services/swap.ts:78](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L78) ___ ### fulfillmentService\_ -• `Protected` `Readonly` **fulfillmentService\_**: [`FulfillmentService`](FulfillmentService.md) + `Protected` `Readonly` **fulfillmentService\_**: [`FulfillmentService`](FulfillmentService.md) #### Defined in -[medusa/src/services/swap.ts:83](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L83) +[medusa/src/services/swap.ts:83](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L83) ___ ### lineItemAdjustmentService\_ -• `Protected` `Readonly` **lineItemAdjustmentService\_**: [`LineItemAdjustmentService`](LineItemAdjustmentService.md) + `Protected` `Readonly` **lineItemAdjustmentService\_**: [`LineItemAdjustmentService`](LineItemAdjustmentService.md) #### Defined in -[medusa/src/services/swap.ts:86](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L86) +[medusa/src/services/swap.ts:86](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L86) ___ ### lineItemService\_ -• `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md) + `Protected` `Readonly` **lineItemService\_**: [`LineItemService`](LineItemService.md) #### Defined in -[medusa/src/services/swap.ts:82](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L82) +[medusa/src/services/swap.ts:82](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L82) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -142,83 +142,83 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### orderService\_ -• `Protected` `Readonly` **orderService\_**: [`OrderService`](OrderService.md) + `Protected` `Readonly` **orderService\_**: [`OrderService`](OrderService.md) #### Defined in -[medusa/src/services/swap.ts:79](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L79) +[medusa/src/services/swap.ts:79](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L79) ___ ### paymentProviderService\_ -• `Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md) + `Protected` `Readonly` **paymentProviderService\_**: [`PaymentProviderService`](PaymentProviderService.md) #### Defined in -[medusa/src/services/swap.ts:85](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L85) +[medusa/src/services/swap.ts:85](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L85) ___ ### productVariantInventoryService\_ -• `Protected` `Readonly` **productVariantInventoryService\_**: [`ProductVariantInventoryService`](ProductVariantInventoryService.md) + `Protected` `Readonly` **productVariantInventoryService\_**: [`ProductVariantInventoryService`](ProductVariantInventoryService.md) #### Defined in -[medusa/src/services/swap.ts:89](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L89) +[medusa/src/services/swap.ts:89](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L89) ___ ### returnService\_ -• `Protected` `Readonly` **returnService\_**: [`ReturnService`](ReturnService.md) + `Protected` `Readonly` **returnService\_**: [`ReturnService`](ReturnService.md) #### Defined in -[medusa/src/services/swap.ts:80](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L80) +[medusa/src/services/swap.ts:80](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L80) ___ ### shippingOptionService\_ -• `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md) + `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md) #### Defined in -[medusa/src/services/swap.ts:84](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L84) +[medusa/src/services/swap.ts:84](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L84) ___ ### swapRepository\_ -• `Protected` `Readonly` **swapRepository\_**: `Repository`<`Swap`\> + `Protected` `Readonly` **swapRepository\_**: `Repository`<`Swap`\> #### Defined in -[medusa/src/services/swap.ts:75](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L75) +[medusa/src/services/swap.ts:75](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L75) ___ ### totalsService\_ -• `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md) + `Protected` `Readonly` **totalsService\_**: [`TotalsService`](TotalsService.md) #### Defined in -[medusa/src/services/swap.ts:81](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L81) +[medusa/src/services/swap.ts:81](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L81) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -226,13 +226,13 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### Events -▪ `Static` **Events**: `Object` + `Static` **Events**: `Object` #### Type declaration @@ -250,67 +250,70 @@ ___ #### Defined in -[medusa/src/services/swap.ts:63](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L63) +[medusa/src/services/swap.ts:63](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L63) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### areReturnItemsValid -▸ `Protected` **areReturnItemsValid**(`returnItems`): `Promise`<`boolean`\> +`Protected` **areReturnItemsValid**(`returnItems`): `Promise`<`boolean`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `returnItems` | `WithRequiredProperty`<`Partial`<`ReturnItem`\>, ``"item_id"``\>[] | #### Returns `Promise`<`boolean`\> +-`Promise`: + -`boolean`: (optional) + #### Defined in -[medusa/src/services/swap.ts:1240](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L1240) +[medusa/src/services/swap.ts:1240](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L1240) ___ ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -319,7 +322,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -327,13 +330,13 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### cancel -▸ **cancel**(`swapId`): `Promise`<`Swap`\> +**cancel**(`swapId`): `Promise`<`Swap`\> Cancels a given swap if possible. A swap can only be canceled if all related returns, fulfillments, and payments have been canceled. If a swap @@ -341,84 +344,87 @@ is associated with a refund, it cannot be canceled. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `swapId` | `string` | the id of the swap to cancel. | #### Returns `Promise`<`Swap`\> -the canceled swap. +-`Promise`: the canceled swap. + -`Swap`: #### Defined in -[medusa/src/services/swap.ts:857](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L857) +[medusa/src/services/swap.ts:857](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L857) ___ ### cancelFulfillment -▸ **cancelFulfillment**(`fulfillmentId`): `Promise`<`Swap`\> +**cancelFulfillment**(`fulfillmentId`): `Promise`<`Swap`\> Cancels a fulfillment (if related to a swap) #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `fulfillmentId` | `string` | the ID of the fulfillment to cancel | #### Returns `Promise`<`Swap`\> -updated swap +-`Promise`: updated swap + -`Swap`: #### Defined in -[medusa/src/services/swap.ts:1059](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L1059) +[medusa/src/services/swap.ts:1059](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L1059) ___ ### create -▸ **create**(`order`, `returnItems`, `additionalItems?`, `returnShipping?`, `custom?`): `Promise`<`Swap`\> +**create**(`order`, `returnItems`, `additionalItems?`, `returnShipping?`, `custom?`): `Promise`<`Swap`\> Creates a swap from an order, with given return items, additional items and an optional return shipping method. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `order` | `Order` | the order to base the swap off | | `returnItems` | `WithRequiredProperty`<`Partial`<`ReturnItem`\>, ``"item_id"``\>[] | the items to return in the swap | | `additionalItems?` | `Pick`<`LineItem`, ``"variant_id"`` \| ``"quantity"``\>[] | the items to send to the customer | -| `returnShipping?` | `Object` | an optional shipping method for returning the returnItems | -| `returnShipping.option_id` | `string` | - | -| `returnShipping.price?` | `number` | - | -| `custom` | `Object` | contains relevant custom information. This object may include no_notification which will disable sending notification when creating swap. If set, it overrules the attribute inherited from the order | -| `custom.allow_backorder?` | `boolean` | - | -| `custom.idempotency_key?` | `string` | - | -| `custom.location_id?` | `string` | - | -| `custom.no_notification?` | `boolean` | - | +| `returnShipping?` | `object` | an optional shipping method for returning the returnItems | +| `returnShipping.option_id` | `string` | +| `returnShipping.price?` | `number` | +| `custom` | `object` | contains relevant custom information. This object may include no_notification which will disable sending notification when creating swap. If set, it overrules the attribute inherited from the order | +| `custom.allow_backorder?` | `boolean` | +| `custom.idempotency_key?` | `string` | +| `custom.location_id?` | `string` | +| `custom.no_notification?` | `boolean` | #### Returns `Promise`<`Swap`\> -the newly created swap +-`Promise`: the newly created swap + -`Swap`: #### Defined in -[medusa/src/services/swap.ts:321](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L321) +[medusa/src/services/swap.ts:321](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L321) ___ ### createCart -▸ **createCart**(`swapId`, `customShippingOptions?`, `context?`): `Promise`<`Swap`\> +**createCart**(`swapId`, `customShippingOptions?`, `context?`): `Promise`<`Swap`\> Creates a cart from the given swap. The cart can be used to pay for differences associated with the swap. The swap represented by the @@ -427,36 +433,37 @@ swap. #### Parameters -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `swapId` | `string` | `undefined` | the id of the swap to create the cart from | +| Name | Default value | Description | +| :------ | :------ | :------ | +| `swapId` | `string` | the id of the swap to create the cart from | | `customShippingOptions` | { `option_id`: `string` ; `price`: `number` }[] | `[]` | the shipping options | -| `context` | `Object` | `{}` | - | -| `context.sales_channel_id?` | `string` | `undefined` | - | +| `context` | `object` | +| `context.sales_channel_id?` | `string` | #### Returns `Promise`<`Swap`\> -the swap with its cart_id prop set to the id of the new cart. +-`Promise`: the swap with its cart_id prop set to the id of the new cart. + -`Swap`: #### Defined in -[medusa/src/services/swap.ts:577](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L577) +[medusa/src/services/swap.ts:577](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L577) ___ ### createFulfillment -▸ **createFulfillment**(`swapId`, `config?`): `Promise`<`Swap`\> +**createFulfillment**(`swapId`, `config?`): `Promise`<`Swap`\> Fulfills the additional items associated with the swap. Will call the fulfillment providers associated with the shipping methods. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `swapId` | `string` | the id of the swap to fulfill, | | `config` | `CreateShipmentConfig` | optional configurations, includes optional metadata to attach to the shipment, and a no_notification flag. | @@ -464,24 +471,25 @@ fulfillment providers associated with the shipping methods. `Promise`<`Swap`\> -the updated swap with new status and fulfillments. +-`Promise`: the updated swap with new status and fulfillments. + -`Swap`: #### Defined in -[medusa/src/services/swap.ts:919](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L919) +[medusa/src/services/swap.ts:919](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L919) ___ ### createShipment -▸ **createShipment**(`swapId`, `fulfillmentId`, `trackingLinks?`, `config?`): `Promise`<`Swap`\> +**createShipment**(`swapId`, `fulfillmentId`, `trackingLinks?`, `config?`): `Promise`<`Swap`\> Marks a fulfillment as shipped and attaches tracking numbers. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `swapId` | `string` | the id of the swap that has been shipped. | | `fulfillmentId` | `string` | the id of the specific fulfillment that has been shipped | | `trackingLinks?` | { `tracking_number`: `string` }[] | the tracking numbers associated with the shipment | @@ -491,24 +499,25 @@ Marks a fulfillment as shipped and attaches tracking numbers. `Promise`<`Swap`\> -the updated swap with new fulfillments and status. +-`Promise`: the updated swap with new fulfillments and status. + -`Swap`: #### Defined in -[medusa/src/services/swap.ts:1090](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L1090) +[medusa/src/services/swap.ts:1090](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L1090) ___ ### deleteMetadata -▸ **deleteMetadata**(`swapId`, `key`): `Promise`<`Swap`\> +**deleteMetadata**(`swapId`, `key`): `Promise`<`Swap`\> Dedicated method to delete metadata for a swap. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `swapId` | `string` | the order to delete metadata from. | | `key` | `string` | key for metadata field | @@ -516,24 +525,25 @@ Dedicated method to delete metadata for a swap. `Promise`<`Swap`\> -resolves to the updated result. +-`Promise`: resolves to the updated result. + -`Swap`: #### Defined in -[medusa/src/services/swap.ts:1168](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L1168) +[medusa/src/services/swap.ts:1168](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L1168) ___ ### list -▸ **list**(`selector`, `config?`): `Promise`<`Swap`[]\> +**list**(`selector`, `config?`): `Promise`<`Swap`[]\> List swaps. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`Swap`\> | the query object for find | | `config` | `FindConfig`<`Swap`\> | the configuration used to find the objects. contains relations, skip, and take. | @@ -541,24 +551,26 @@ List swaps. `Promise`<`Swap`[]\> -the result of the find operation +-`Promise`: the result of the find operation + -`Swap[]`: + -`Swap`: #### Defined in -[medusa/src/services/swap.ts:273](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L273) +[medusa/src/services/swap.ts:273](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L273) ___ ### listAndCount -▸ **listAndCount**(`selector`, `config?`): `Promise`<[`Swap`[], `number`]\> +**listAndCount**(`selector`, `config?`): `Promise`<[`Swap`[], `number`]\> List swaps. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `Selector`<`Swap`\> | the query object for find | | `config` | `FindConfig`<`Swap`\> | the configuration used to find the objects. contains relations, skip, and take. | @@ -566,97 +578,102 @@ List swaps. `Promise`<[`Swap`[], `number`]\> -the result of the find operation +-`Promise`: the result of the find operation + -`Swap[]`: + -`number`: (optional) #### Defined in -[medusa/src/services/swap.ts:293](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L293) +[medusa/src/services/swap.ts:293](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L293) ___ ### processDifference -▸ **processDifference**(`swapId`): `Promise`<`Swap`\> +**processDifference**(`swapId`): `Promise`<`Swap`\> Process difference for the requested swap. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `swapId` | `string` | id of a swap being processed | #### Returns `Promise`<`Swap`\> -processed swap +-`Promise`: processed swap + -`Swap`: #### Defined in -[medusa/src/services/swap.ts:421](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L421) +[medusa/src/services/swap.ts:421](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L421) ___ ### registerCartCompletion -▸ **registerCartCompletion**(`swapId`): `Promise`<`Swap`\> +**registerCartCompletion**(`swapId`): `Promise`<`Swap`\> Register a cart completion #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `swapId` | `string` | The id of the swap | #### Returns `Promise`<`Swap`\> -swap related to the cart +-`Promise`: swap related to the cart + -`Swap`: #### Defined in -[medusa/src/services/swap.ts:724](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L724) +[medusa/src/services/swap.ts:724](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L724) ___ ### registerReceived -▸ **registerReceived**(`id`): `Promise`<`Swap`\> +**registerReceived**(`id`): `Promise`<`Swap`\> Registers the swap return items as received so that they cannot be used as a part of other swaps/returns. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `id` | `any` | the id of the order with the swap. | #### Returns `Promise`<`Swap`\> -the resulting order +-`Promise`: the resulting order + -`Swap`: #### Defined in -[medusa/src/services/swap.ts:1206](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L1206) +[medusa/src/services/swap.ts:1206](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L1206) ___ ### retrieve -▸ **retrieve**(`swapId`, `config?`): `Promise`<`Swap`\> +**retrieve**(`swapId`, `config?`): `Promise`<`Swap`\> Retrieves a swap with the given id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `swapId` | `string` | the id of the swap to retrieve | | `config` | `Omit`<`FindConfig`<`Swap`\>, ``"select"``\> & { `select?`: `string`[] } | the configuration to retrieve the swap | @@ -664,97 +681,101 @@ Retrieves a swap with the given id. `Promise`<`Swap`\> -the swap +-`Promise`: the swap + -`Swap`: #### Defined in -[medusa/src/services/swap.ts:203](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L203) +[medusa/src/services/swap.ts:203](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L203) ___ ### retrieveByCartId -▸ **retrieveByCartId**(`cartId`, `relations?`): `Promise`<`Swap`\> +**retrieveByCartId**(`cartId`, `relations?`): `Promise`<`Swap`\> Retrieves a swap based on its associated cart id #### Parameters -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `cartId` | `string` | `undefined` | the cart id that the swap's cart has | +| Name | Default value | Description | +| :------ | :------ | :------ | +| `cartId` | `string` | the cart id that the swap's cart has | | `relations` | `undefined` \| `string`[] | `[]` | the relations to retrieve swap | #### Returns `Promise`<`Swap`\> -the swap +-`Promise`: the swap + -`Swap`: #### Defined in -[medusa/src/services/swap.ts:246](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L246) +[medusa/src/services/swap.ts:246](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L246) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### transformQueryForCart -▸ `Protected` **transformQueryForCart**(`config`): `Omit`<`FindConfig`<`Swap`\>, ``"select"``\> & { `select?`: `string`[] } & { `cartRelations`: `undefined` \| `string`[] ; `cartSelects`: `undefined` \| keyof `Cart`[] } +`Protected` **transformQueryForCart**(`config`): `Omit`<`FindConfig`<`Swap`\>, ``"select"``\> & { `select?`: `string`[] } & { `cartRelations`: `undefined` \| `string`[] ; `cartSelects`: `undefined` \| keyof `Cart`[] } Transform find config object for retrieval. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `config` | `Omit`<`FindConfig`<`Swap`\>, ``"select"``\> & { `select?`: `string`[] } | parsed swap find config | #### Returns `Omit`<`FindConfig`<`Swap`\>, ``"select"``\> & { `select?`: `string`[] } & { `cartRelations`: `undefined` \| `string`[] ; `cartSelects`: `undefined` \| keyof `Cart`[] } -transformed find swap config +-``Omit`<`FindConfig`<`Swap`\>, ``"select"``\> & { `select?`: `string`[] } & { `cartRelations`: `undefined` \| `string`[] ; `cartSelects`: `undefined` \| keyof `Cart`[] }`: (optional) transformed find swap config #### Defined in -[medusa/src/services/swap.ts:130](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L130) +[medusa/src/services/swap.ts:130](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L130) ___ ### update -▸ **update**(`swapId`, `update`): `Promise`<`Swap`\> +**update**(`swapId`, `update`): `Promise`<`Swap`\> Update the swap record. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `swapId` | `string` | id of a swap to update | | `update` | `Partial`<`Swap`\> | new data | @@ -762,32 +783,35 @@ Update the swap record. `Promise`<`Swap`\> -updated swap record +-`Promise`: updated swap record + -`Swap`: #### Defined in -[medusa/src/services/swap.ts:544](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/swap.ts#L544) +[medusa/src/services/swap.ts:544](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/swap.ts#L544) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`SwapService`](SwapService.md) +**withTransaction**(`transactionManager?`): [`SwapService`](SwapService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`SwapService`](SwapService.md) +-`SwapService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/SystemPaymentProviderService.md b/www/apps/docs/content/references/services/classes/SystemPaymentProviderService.md index e6257d36ab60c..deef96448657c 100644 --- a/www/apps/docs/content/references/services/classes/SystemPaymentProviderService.md +++ b/www/apps/docs/content/references/services/classes/SystemPaymentProviderService.md @@ -1,4 +1,4 @@ -# Class: SystemPaymentProviderService +# SystemPaymentProviderService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new SystemPaymentProviderService**(`_`) +**new SystemPaymentProviderService**(`_`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `_` | `any` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/system-payment-provider.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L6) +[medusa/src/services/system-payment-provider.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L6) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,13 +66,13 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -80,13 +80,13 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -94,57 +94,57 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### identifier -▪ `Static` **identifier**: `string` = `"system"` + `Static` **identifier**: `string` = `"system"` #### Defined in -[medusa/src/services/system-payment-provider.ts:4](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L4) +[medusa/src/services/system-payment-provider.ts:4](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L4) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -153,7 +153,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -161,252 +161,304 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### authorizePayment -▸ **authorizePayment**(`_`): `Promise`<`Record`<`string`, `unknown`\>\> +**authorizePayment**(`_`): `Promise`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `_` | `any` | #### Returns -`Promise`<`Record`<`string`, `unknown`\>\> +`Promise`\> + +-`Promise`: + -`Record`: + -`string`: (optional) + -`unknown`: (optional) #### Defined in -[medusa/src/services/system-payment-provider.ts:22](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L22) +[medusa/src/services/system-payment-provider.ts:22](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L22) ___ ### cancelPayment -▸ **cancelPayment**(`_`): `Promise`<`Record`<`string`, `unknown`\>\> +**cancelPayment**(`_`): `Promise`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `_` | `any` | #### Returns -`Promise`<`Record`<`string`, `unknown`\>\> +`Promise`\> + +-`Promise`: + -`Record`: + -`string`: (optional) + -`unknown`: (optional) #### Defined in -[medusa/src/services/system-payment-provider.ts:46](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L46) +[medusa/src/services/system-payment-provider.ts:46](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L46) ___ ### capturePayment -▸ **capturePayment**(`_`): `Promise`<`Record`<`string`, `unknown`\>\> +**capturePayment**(`_`): `Promise`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `_` | `any` | #### Returns -`Promise`<`Record`<`string`, `unknown`\>\> +`Promise`\> + +-`Promise`: + -`Record`: + -`string`: (optional) + -`unknown`: (optional) #### Defined in -[medusa/src/services/system-payment-provider.ts:38](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L38) +[medusa/src/services/system-payment-provider.ts:38](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L38) ___ ### createPayment -▸ **createPayment**(`_`): `Promise`<`Record`<`string`, `unknown`\>\> +**createPayment**(`_`): `Promise`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `_` | `any` | #### Returns -`Promise`<`Record`<`string`, `unknown`\>\> +`Promise`\> + +-`Promise`: + -`Record`: + -`string`: (optional) + -`unknown`: (optional) #### Defined in -[medusa/src/services/system-payment-provider.ts:10](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L10) +[medusa/src/services/system-payment-provider.ts:10](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L10) ___ ### deletePayment -▸ **deletePayment**(`_`): `Promise`<`Record`<`string`, `unknown`\>\> +**deletePayment**(`_`): `Promise`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `_` | `any` | #### Returns -`Promise`<`Record`<`string`, `unknown`\>\> +`Promise`\> + +-`Promise`: + -`Record`: + -`string`: (optional) + -`unknown`: (optional) #### Defined in -[medusa/src/services/system-payment-provider.ts:34](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L34) +[medusa/src/services/system-payment-provider.ts:34](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L34) ___ ### getPaymentData -▸ **getPaymentData**(`_`): `Promise`<`Record`<`string`, `unknown`\>\> +**getPaymentData**(`_`): `Promise`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `_` | `any` | #### Returns -`Promise`<`Record`<`string`, `unknown`\>\> +`Promise`\> + +-`Promise`: + -`Record`: + -`string`: (optional) + -`unknown`: (optional) #### Defined in -[medusa/src/services/system-payment-provider.ts:18](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L18) +[medusa/src/services/system-payment-provider.ts:18](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L18) ___ ### getStatus -▸ **getStatus**(`_`): `Promise`<`string`\> +**getStatus**(`_`): `Promise`<`string`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `_` | `any` | #### Returns `Promise`<`string`\> +-`Promise`: + -`string`: (optional) + #### Defined in -[medusa/src/services/system-payment-provider.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L14) +[medusa/src/services/system-payment-provider.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L14) ___ ### refundPayment -▸ **refundPayment**(`_`): `Promise`<`Record`<`string`, `unknown`\>\> +**refundPayment**(`_`): `Promise`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `_` | `any` | #### Returns -`Promise`<`Record`<`string`, `unknown`\>\> +`Promise`\> + +-`Promise`: + -`Record`: + -`string`: (optional) + -`unknown`: (optional) #### Defined in -[medusa/src/services/system-payment-provider.ts:42](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L42) +[medusa/src/services/system-payment-provider.ts:42](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L42) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### updatePayment -▸ **updatePayment**(`_`): `Promise`<`Record`<`string`, `unknown`\>\> +**updatePayment**(`_`): `Promise`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `_` | `any` | #### Returns -`Promise`<`Record`<`string`, `unknown`\>\> +`Promise`\> + +-`Promise`: + -`Record`: + -`string`: (optional) + -`unknown`: (optional) #### Defined in -[medusa/src/services/system-payment-provider.ts:30](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L30) +[medusa/src/services/system-payment-provider.ts:30](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L30) ___ ### updatePaymentData -▸ **updatePaymentData**(`_`): `Promise`<`Record`<`string`, `unknown`\>\> +**updatePaymentData**(`_`): `Promise`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `_` | `any` | #### Returns -`Promise`<`Record`<`string`, `unknown`\>\> +`Promise`\> + +-`Promise`: + -`Record`: + -`string`: (optional) + -`unknown`: (optional) #### Defined in -[medusa/src/services/system-payment-provider.ts:26](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/system-payment-provider.ts#L26) +[medusa/src/services/system-payment-provider.ts:26](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/system-payment-provider.ts#L26) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`SystemPaymentProviderService`](SystemPaymentProviderService.md) +**withTransaction**(`transactionManager?`): [`SystemPaymentProviderService`](SystemPaymentProviderService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`SystemPaymentProviderService`](SystemPaymentProviderService.md) +-`SystemProviderService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/TaxProviderService.md b/www/apps/docs/content/references/services/classes/TaxProviderService.md index 5eef8ea5d8bec..8268150597732 100644 --- a/www/apps/docs/content/references/services/classes/TaxProviderService.md +++ b/www/apps/docs/content/references/services/classes/TaxProviderService.md @@ -1,4 +1,4 @@ -# Class: TaxProviderService +# TaxProviderService Finds tax providers and assists in tax related operations. @@ -12,12 +12,12 @@ Finds tax providers and assists in tax related operations. ### constructor -• **new TaxProviderService**(`container`) +**new TaxProviderService**(`container`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `container` | `AwilixContainer`<`any`\> | #### Overrides @@ -26,13 +26,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/tax-provider.ts:45](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L45) +[medusa/src/services/tax-provider.ts:45](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L45) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -68,43 +68,43 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### cacheService\_ -• `Protected` `Readonly` **cacheService\_**: `ICacheService` + `Protected` `Readonly` **cacheService\_**: `ICacheService` #### Defined in -[medusa/src/services/tax-provider.ts:38](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L38) +[medusa/src/services/tax-provider.ts:38](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L38) ___ ### container\_ -• `Protected` `Readonly` **container\_**: `AwilixContainer`<`any`\> + `Protected` `Readonly` **container\_**: `AwilixContainer`<`any`\> #### Defined in -[medusa/src/services/tax-provider.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L37) +[medusa/src/services/tax-provider.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L37) ___ ### eventBus\_ -• `Protected` `Readonly` **eventBus\_**: `IEventBusService` + `Protected` `Readonly` **eventBus\_**: `IEventBusService` #### Defined in -[medusa/src/services/tax-provider.ts:43](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L43) +[medusa/src/services/tax-provider.ts:43](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L43) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -112,53 +112,53 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### smTaxLineRepo\_ -• `Protected` `Readonly` **smTaxLineRepo\_**: `Repository`<`ShippingMethodTaxLine`\> & { `deleteForCart`: (`cartId`: `string`) => `Promise`<`void`\> ; `upsertLines`: (`lines`: `ShippingMethodTaxLine`[]) => `Promise`<`ShippingMethodTaxLine`[]\> } + `Protected` `Readonly` **smTaxLineRepo\_**: `Repository`<`ShippingMethodTaxLine`\> & { `deleteForCart`: Method deleteForCart ; `upsertLines`: Method upsertLines } #### Defined in -[medusa/src/services/tax-provider.ts:41](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L41) +[medusa/src/services/tax-provider.ts:41](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L41) ___ ### taxLineRepo\_ -• `Protected` `Readonly` **taxLineRepo\_**: `Repository`<`LineItemTaxLine`\> & { `deleteForCart`: (`cartId`: `string`) => `Promise`<`void`\> ; `upsertLines`: (`lines`: `LineItemTaxLine`[]) => `Promise`<`LineItemTaxLine`[]\> } + `Protected` `Readonly` **taxLineRepo\_**: `Repository`<`LineItemTaxLine`\> & { `deleteForCart`: Method deleteForCart ; `upsertLines`: Method upsertLines } #### Defined in -[medusa/src/services/tax-provider.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L40) +[medusa/src/services/tax-provider.ts:40](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L40) ___ ### taxProviderRepo\_ -• `Protected` `Readonly` **taxProviderRepo\_**: `Repository`<`TaxProvider`\> + `Protected` `Readonly` **taxProviderRepo\_**: `Repository`<`TaxProvider`\> #### Defined in -[medusa/src/services/tax-provider.ts:42](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L42) +[medusa/src/services/tax-provider.ts:42](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L42) ___ ### taxRateService\_ -• `Protected` `Readonly` **taxRateService\_**: [`TaxRateService`](TaxRateService.md) + `Protected` `Readonly` **taxRateService\_**: [`TaxRateService`](TaxRateService.md) #### Defined in -[medusa/src/services/tax-provider.ts:39](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L39) +[medusa/src/services/tax-provider.ts:39](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L39) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -166,47 +166,47 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -215,7 +215,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -223,61 +223,65 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### clearLineItemsTaxLines -▸ **clearLineItemsTaxLines**(`itemIds`): `Promise`<`void`\> +**clearLineItemsTaxLines**(`itemIds`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `itemIds` | `string`[] | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/tax-provider.ts:89](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L89) +[medusa/src/services/tax-provider.ts:89](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L89) ___ ### clearTaxLines -▸ **clearTaxLines**(`cartId`): `Promise`<`void`\> +**clearTaxLines**(`cartId`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `cartId` | `string` | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/tax-provider.ts:97](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L97) +[medusa/src/services/tax-provider.ts:97](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L97) ___ ### createShippingTaxLines -▸ **createShippingTaxLines**(`shippingMethod`, `calculationContext`): `Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\> +**createShippingTaxLines**(`shippingMethod`, `calculationContext`): `Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\> Persists the tax lines relevant for a shipping method to the database. Used for return shipping methods. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `shippingMethod` | `ShippingMethod` | the shipping method to create tax lines for | | `calculationContext` | `TaxCalculationContext` | the calculation context to get tax lines by | @@ -285,24 +289,26 @@ for return shipping methods. `Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\> -the newly created tax lines +-`Promise`: the newly created tax lines + -`(LineItemTaxLine \| ShippingMethodTaxLine)[]`: + -`LineItemTaxLine \| ShippingMethodTaxLine`: (optional) #### Defined in -[medusa/src/services/tax-provider.ts:171](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L171) +[medusa/src/services/tax-provider.ts:171](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L171) ___ ### createTaxLines -▸ **createTaxLines**(`cartOrLineItems`, `calculationContext`): `Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\> +**createTaxLines**(`cartOrLineItems`, `calculationContext`): `Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\> Persists the tax lines relevant for an order to the database. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartOrLineItems` | `LineItem`[] \| `Cart` | the cart or line items to create tax lines for | | `calculationContext` | `TaxCalculationContext` | the calculation context to get tax lines by | @@ -310,24 +316,26 @@ Persists the tax lines relevant for an order to the database. `Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\> -the newly created tax lines +-`Promise`: the newly created tax lines + -`(LineItemTaxLine \| ShippingMethodTaxLine)[]`: + -`LineItemTaxLine \| ShippingMethodTaxLine`: (optional) #### Defined in -[medusa/src/services/tax-provider.ts:117](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L117) +[medusa/src/services/tax-provider.ts:117](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L117) ___ ### getCacheKey -▸ `Private` **getCacheKey**(`id`, `regionId`): `string` +`Private` **getCacheKey**(`id`, `regionId`): `string` The cache key to get cache hits by. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `id` | `string` | the entity id to cache | | `regionId` | `string` | the region id to cache | @@ -335,51 +343,54 @@ The cache key to get cache hits by. `string` -the cache key to use for the id set +-`string`: (optional) the cache key to use for the id set #### Defined in -[medusa/src/services/tax-provider.ts:492](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L492) +[medusa/src/services/tax-provider.ts:492](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L492) ___ ### getRegionRatesForProduct -▸ **getRegionRatesForProduct**(`productIds`, `region`): `Promise`<`Map`<`string`, `TaxServiceRate`[]\>\> +**getRegionRatesForProduct**(`productIds`, `region`): `Promise`<`Map`<`string`, `TaxServiceRate`[]\>\> Gets the tax rates configured for a product. The rates are cached between calls. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `productIds` | `string` \| `string`[] | | +| Name | Description | +| :------ | :------ | +| `productIds` | `string` \| `string`[] | | `region` | `RegionDetails` | the region to get configured rates for. | #### Returns `Promise`<`Map`<`string`, `TaxServiceRate`[]\>\> -the tax rates configured for the shipping option. A map by product id +-`Promise`: the tax rates configured for the shipping option. A map by product id + -`Map`: + -`string`: (optional) + -`TaxServiceRate[]`: #### Defined in -[medusa/src/services/tax-provider.ts:427](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L427) +[medusa/src/services/tax-provider.ts:427](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L427) ___ ### getRegionRatesForShipping -▸ **getRegionRatesForShipping**(`optionId`, `regionDetails`): `Promise`<`TaxServiceRate`[]\> +**getRegionRatesForShipping**(`optionId`, `regionDetails`): `Promise`<`TaxServiceRate`[]\> Gets the tax rates configured for a shipping option. The rates are cached between calls. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `optionId` | `string` | the option id of the shipping method. | | `regionDetails` | `RegionDetails` | the region to get configured rates for. | @@ -387,17 +398,18 @@ between calls. `Promise`<`TaxServiceRate`[]\> -the tax rates configured for the shipping option. +-`Promise`: the tax rates configured for the shipping option. + -`TaxServiceRate[]`: #### Defined in -[medusa/src/services/tax-provider.ts:380](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L380) +[medusa/src/services/tax-provider.ts:380](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L380) ___ ### getShippingTaxLines -▸ **getShippingTaxLines**(`shippingMethod`, `calculationContext`): `Promise`<`ShippingMethodTaxLine`[]\> +**getShippingTaxLines**(`shippingMethod`, `calculationContext`): `Promise`<`ShippingMethodTaxLine`[]\> Gets the relevant tax lines for a shipping method. Note: this method doesn't persist the tax lines. Use createShippingTaxLines if you wish to @@ -405,8 +417,8 @@ persist the tax lines to the DB layer. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `shippingMethod` | `ShippingMethod` | the shipping method to get tax lines for | | `calculationContext` | `TaxCalculationContext` | the calculation context to get tax lines by | @@ -414,17 +426,19 @@ persist the tax lines to the DB layer. `Promise`<`ShippingMethodTaxLine`[]\> -the computed tax lines +-`Promise`: the computed tax lines + -`ShippingMethodTaxLine[]`: + -`ShippingMethodTaxLine`: #### Defined in -[medusa/src/services/tax-provider.ts:192](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L192) +[medusa/src/services/tax-provider.ts:192](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L192) ___ ### getTaxLines -▸ **getTaxLines**(`lineItems`, `calculationContext`): `Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\> +**getTaxLines**(`lineItems`, `calculationContext`): `Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\> Gets the relevant tax lines for an order or cart. If an order is provided the order's tax lines will be returned. If a cart is provided the tax lines @@ -434,8 +448,8 @@ wish to persist the tax lines to the DB layer. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `lineItems` | `LineItem`[] | the cart or order to get tax lines for | | `calculationContext` | `TaxCalculationContext` | the calculation context to get tax lines by | @@ -443,24 +457,26 @@ wish to persist the tax lines to the DB layer. `Promise`<(`LineItemTaxLine` \| `ShippingMethodTaxLine`)[]\> -the computed tax lines +-`Promise`: the computed tax lines + -`(LineItemTaxLine \| ShippingMethodTaxLine)[]`: + -`LineItemTaxLine \| ShippingMethodTaxLine`: (optional) #### Defined in -[medusa/src/services/tax-provider.ts:246](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L246) +[medusa/src/services/tax-provider.ts:246](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L246) ___ ### getTaxLinesMap -▸ `Protected` **getTaxLinesMap**(`items`, `calculationContext`): `Promise`<`TaxLinesMaps`\> +`Protected` **getTaxLinesMap**(`items`, `calculationContext`): `Promise`<`TaxLinesMaps`\> Return a map of tax lines for line items and shipping methods #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `items` | `LineItem`[] | | `calculationContext` | `TaxCalculationContext` | @@ -468,112 +484,122 @@ Return a map of tax lines for line items and shipping methods `Promise`<`TaxLinesMaps`\> +-`Promise`: + #### Defined in -[medusa/src/services/tax-provider.ts:343](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L343) +[medusa/src/services/tax-provider.ts:343](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L343) ___ ### list -▸ **list**(): `Promise`<`TaxProvider`[]\> +**list**(): `Promise`<`TaxProvider`[]\> #### Returns `Promise`<`TaxProvider`[]\> +-`Promise`: + -`TaxProvider[]`: + -`TaxProvider`: + #### Defined in -[medusa/src/services/tax-provider.ts:57](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L57) +[medusa/src/services/tax-provider.ts:57](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L57) ___ ### registerInstalledProviders -▸ **registerInstalledProviders**(`providers`): `Promise`<`void`\> +**registerInstalledProviders**(`providers`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `providers` | `string`[] | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/tax-provider.ts:496](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L496) +[medusa/src/services/tax-provider.ts:496](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L496) ___ ### retrieveProvider -▸ **retrieveProvider**(`region`): `ITaxService` +**retrieveProvider**(`region`): `ITaxService` Retrieves the relevant tax provider for the given region. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `region` | `Region` | the region to get tax provider for. | #### Returns `ITaxService` -the region specific tax provider - #### Defined in -[medusa/src/services/tax-provider.ts:67](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-provider.ts#L67) +[medusa/src/services/tax-provider.ts:67](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-provider.ts#L67) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`TaxProviderService`](TaxProviderService.md) +**withTransaction**(`transactionManager?`): [`TaxProviderService`](TaxProviderService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`TaxProviderService`](TaxProviderService.md) +-`TaxProviderService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/TaxRateService.md b/www/apps/docs/content/references/services/classes/TaxRateService.md index 42eb4d270a4eb..87f776e5e2bdc 100644 --- a/www/apps/docs/content/references/services/classes/TaxRateService.md +++ b/www/apps/docs/content/references/services/classes/TaxRateService.md @@ -1,4 +1,4 @@ -# Class: TaxRateService +# TaxRateService ## Hierarchy @@ -10,12 +10,12 @@ ### constructor -• **new TaxRateService**(`«destructured»`) +**new TaxRateService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `Object` | #### Overrides @@ -24,13 +24,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/tax-rate.ts:29](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L29) +[medusa/src/services/tax-rate.ts:29](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L29) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -38,13 +38,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -52,13 +52,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -66,13 +66,13 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -80,53 +80,53 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### productService\_ -• `Protected` `Readonly` **productService\_**: [`ProductService`](ProductService.md) + `Protected` `Readonly` **productService\_**: [`ProductService`](ProductService.md) #### Defined in -[medusa/src/services/tax-rate.ts:24](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L24) +[medusa/src/services/tax-rate.ts:24](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L24) ___ ### productTypeService\_ -• `Protected` `Readonly` **productTypeService\_**: [`ProductTypeService`](ProductTypeService.md) + `Protected` `Readonly` **productTypeService\_**: [`ProductTypeService`](ProductTypeService.md) #### Defined in -[medusa/src/services/tax-rate.ts:25](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L25) +[medusa/src/services/tax-rate.ts:25](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L25) ___ ### shippingOptionService\_ -• `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md) + `Protected` `Readonly` **shippingOptionService\_**: [`ShippingOptionService`](ShippingOptionService.md) #### Defined in -[medusa/src/services/tax-rate.ts:26](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L26) +[medusa/src/services/tax-rate.ts:26](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L26) ___ ### taxRateRepository\_ -• `Protected` `Readonly` **taxRateRepository\_**: `Repository`<`TaxRate`\> & { `addToProduct`: (`id`: `string`, `productIds`: `string`[], `overrideExisting`: `boolean`) => `Promise`<`ProductTaxRate`[]\> ; `addToProductType`: (`id`: `string`, `productTypeIds`: `string`[], `overrideExisting`: `boolean`) => `Promise`<`ProductTypeTaxRate`[]\> ; `addToShippingOption`: (`id`: `string`, `optionIds`: `string`[], `overrideExisting`: `boolean`) => `Promise`<`ShippingTaxRate`[]\> ; `applyResolutionsToQueryBuilder`: (`qb`: `SelectQueryBuilder`<`TaxRate`\>, `resolverFields`: `string`[]) => `SelectQueryBuilder`<`TaxRate`\> ; `findAndCountWithResolution`: (`findOptions`: `FindManyOptions`<`TaxRate`\>) => `Promise`<[`TaxRate`[], `number`]\> ; `findOneWithResolution`: (`findOptions`: `FindManyOptions`<`TaxRate`\>) => `Promise`<``null`` \| `TaxRate`\> ; `findWithResolution`: (`findOptions`: `FindManyOptions`<`TaxRate`\>) => `Promise`<`TaxRate`[]\> ; `getFindQueryBuilder`: (`findOptions`: `FindManyOptions`<`TaxRate`\>) => `SelectQueryBuilder`<`TaxRate`\> ; `listByProduct`: (`productId`: `string`, `config`: `TaxRateListByConfig`) => `Promise`<`TaxRate`[]\> ; `listByShippingOption`: (`optionId`: `string`) => `Promise`<`TaxRate`[]\> ; `removeFromProduct`: (`id`: `string`, `productIds`: `string`[]) => `Promise`<`DeleteResult`\> ; `removeFromProductType`: (`id`: `string`, `productTypeIds`: `string`[]) => `Promise`<`DeleteResult`\> ; `removeFromShippingOption`: (`id`: `string`, `optionIds`: `string`[]) => `Promise`<`DeleteResult`\> } + `Protected` `Readonly` **taxRateRepository\_**: `Repository`<`TaxRate`\> & { `addToProduct`: Method addToProduct ; `addToProductType`: Method addToProductType ; `addToShippingOption`: Method addToShippingOption ; `applyResolutionsToQueryBuilder`: Method applyResolutionsToQueryBuilder ; `findAndCountWithResolution`: Method findAndCountWithResolution ; `findOneWithResolution`: Method findOneWithResolution ; `findWithResolution`: Method findWithResolution ; `getFindQueryBuilder`: Method getFindQueryBuilder ; `listByProduct`: Method listByProduct ; `listByShippingOption`: Method listByShippingOption ; `removeFromProduct`: Method removeFromProduct ; `removeFromProductType`: Method removeFromProductType ; `removeFromShippingOption`: Method removeFromShippingOption } #### Defined in -[medusa/src/services/tax-rate.ts:27](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L27) +[medusa/src/services/tax-rate.ts:27](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L27) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -134,113 +134,124 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### addToProduct -▸ **addToProduct**(`id`, `productIds`, `replace?`): `Promise`<`ProductTaxRate` \| `ProductTaxRate`[]\> +**addToProduct**(`id`, `productIds`, `replace?`): `Promise`<`ProductTaxRate` \| `ProductTaxRate`[]\> #### Parameters -| Name | Type | Default value | -| :------ | :------ | :------ | -| `id` | `string` | `undefined` | -| `productIds` | `string` \| `string`[] | `undefined` | +| Name | Default value | +| :------ | :------ | +| `id` | `string` | +| `productIds` | `string` \| `string`[] | | `replace` | `boolean` | `false` | #### Returns `Promise`<`ProductTaxRate` \| `ProductTaxRate`[]\> +-`Promise`: + -`ProductTaxRate \| ProductTaxRate[]`: (optional) + #### Defined in -[medusa/src/services/tax-rate.ts:190](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L190) +[medusa/src/services/tax-rate.ts:190](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L190) ___ ### addToProductType -▸ **addToProductType**(`id`, `productTypeIds`, `replace?`): `Promise`<`ProductTypeTaxRate`[]\> +**addToProductType**(`id`, `productTypeIds`, `replace?`): `Promise`<`ProductTypeTaxRate`[]\> #### Parameters -| Name | Type | Default value | -| :------ | :------ | :------ | -| `id` | `string` | `undefined` | -| `productTypeIds` | `string` \| `string`[] | `undefined` | +| Name | Default value | +| :------ | :------ | +| `id` | `string` | +| `productTypeIds` | `string` \| `string`[] | | `replace` | `boolean` | `false` | #### Returns `Promise`<`ProductTypeTaxRate`[]\> +-`Promise`: + -`ProductTypeTaxRate[]`: + -`ProductTypeTaxRate`: + #### Defined in -[medusa/src/services/tax-rate.ts:226](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L226) +[medusa/src/services/tax-rate.ts:226](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L226) ___ ### addToShippingOption -▸ **addToShippingOption**(`id`, `optionIds`, `replace?`): `Promise`<`ShippingTaxRate`[]\> +**addToShippingOption**(`id`, `optionIds`, `replace?`): `Promise`<`ShippingTaxRate`[]\> #### Parameters -| Name | Type | Default value | -| :------ | :------ | :------ | -| `id` | `string` | `undefined` | -| `optionIds` | `string` \| `string`[] | `undefined` | +| Name | Default value | +| :------ | :------ | +| `id` | `string` | +| `optionIds` | `string` \| `string`[] | | `replace` | `boolean` | `false` | #### Returns `Promise`<`ShippingTaxRate`[]\> +-`Promise`: + -`ShippingTaxRate[]`: + -`ShippingTaxRate`: + #### Defined in -[medusa/src/services/tax-rate.ts:266](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L266) +[medusa/src/services/tax-rate.ts:266](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L266) ___ ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -249,7 +260,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -257,58 +268,63 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**(`data`): `Promise`<`TaxRate`\> +**create**(`data`): `Promise`<`TaxRate`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `data` | `CreateTaxRateInput` | #### Returns `Promise`<`TaxRate`\> +-`Promise`: + -`TaxRate`: + #### Defined in -[medusa/src/services/tax-rate.ts:93](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L93) +[medusa/src/services/tax-rate.ts:93](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L93) ___ ### delete -▸ **delete**(`id`): `Promise`<`void`\> +**delete**(`id`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `id` | `string` \| `string`[] | #### Returns `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/tax-rate.ts:124](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L124) +[medusa/src/services/tax-rate.ts:124](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L124) ___ ### list -▸ **list**(`selector`, `config?`): `Promise`<`TaxRate`[]\> +**list**(`selector`, `config?`): `Promise`<`TaxRate`[]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `selector` | `FilterableTaxRateProps` | | `config` | `FindConfig`<`TaxRate`\> | @@ -316,20 +332,24 @@ ___ `Promise`<`TaxRate`[]\> +-`Promise`: + -`TaxRate[]`: + -`TaxRate`: + #### Defined in -[medusa/src/services/tax-rate.ts:44](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L44) +[medusa/src/services/tax-rate.ts:44](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L44) ___ ### listAndCount -▸ **listAndCount**(`selector`, `config?`): `Promise`<[`TaxRate`[], `number`]\> +**listAndCount**(`selector`, `config?`): `Promise`<[`TaxRate`[], `number`]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `selector` | `FilterableTaxRateProps` | | `config` | `FindConfig`<`TaxRate`\> | @@ -337,20 +357,24 @@ ___ `Promise`<[`TaxRate`[], `number`]\> +-`Promise`: + -`TaxRate[]`: + -`number`: (optional) + #### Defined in -[medusa/src/services/tax-rate.ts:55](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L55) +[medusa/src/services/tax-rate.ts:55](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L55) ___ ### listByProduct -▸ **listByProduct**(`productId`, `config`): `Promise`<`TaxRate`[]\> +**listByProduct**(`productId`, `config`): `Promise`<`TaxRate`[]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `productId` | `string` | | `config` | `TaxRateListByConfig` | @@ -358,40 +382,48 @@ ___ `Promise`<`TaxRate`[]\> +-`Promise`: + -`TaxRate[]`: + -`TaxRate`: + #### Defined in -[medusa/src/services/tax-rate.ts:314](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L314) +[medusa/src/services/tax-rate.ts:314](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L314) ___ ### listByShippingOption -▸ **listByShippingOption**(`shippingOptionId`): `Promise`<`TaxRate`[]\> +**listByShippingOption**(`shippingOptionId`): `Promise`<`TaxRate`[]\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `shippingOptionId` | `string` | #### Returns `Promise`<`TaxRate`[]\> +-`Promise`: + -`TaxRate[]`: + -`TaxRate`: + #### Defined in -[medusa/src/services/tax-rate.ts:325](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L325) +[medusa/src/services/tax-rate.ts:325](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L325) ___ ### removeFromProduct -▸ **removeFromProduct**(`id`, `productIds`): `Promise`<`void`\> +**removeFromProduct**(`id`, `productIds`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `id` | `string` | | `productIds` | `string` \| `string`[] | @@ -399,20 +431,22 @@ ___ `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/tax-rate.ts:136](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L136) +[medusa/src/services/tax-rate.ts:136](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L136) ___ ### removeFromProductType -▸ **removeFromProductType**(`id`, `typeIds`): `Promise`<`void`\> +**removeFromProductType**(`id`, `typeIds`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `id` | `string` | | `typeIds` | `string` \| `string`[] | @@ -420,20 +454,22 @@ ___ `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/tax-rate.ts:154](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L154) +[medusa/src/services/tax-rate.ts:154](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L154) ___ ### removeFromShippingOption -▸ **removeFromShippingOption**(`id`, `optionIds`): `Promise`<`void`\> +**removeFromShippingOption**(`id`, `optionIds`): `Promise`<`void`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `id` | `string` | | `optionIds` | `string` \| `string`[] | @@ -441,20 +477,22 @@ ___ `Promise`<`void`\> +-`Promise`: + #### Defined in -[medusa/src/services/tax-rate.ts:172](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L172) +[medusa/src/services/tax-rate.ts:172](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L172) ___ ### retrieve -▸ **retrieve**(`taxRateId`, `config?`): `Promise`<`TaxRate`\> +**retrieve**(`taxRateId`, `config?`): `Promise`<`TaxRate`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `taxRateId` | `string` | | `config` | `FindConfig`<`TaxRate`\> | @@ -462,44 +500,49 @@ ___ `Promise`<`TaxRate`\> +-`Promise`: + -`TaxRate`: + #### Defined in -[medusa/src/services/tax-rate.ts:66](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L66) +[medusa/src/services/tax-rate.ts:66](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L66) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`id`, `data`): `Promise`<`TaxRate`\> +**update**(`id`, `data`): `Promise`<`TaxRate`\> #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `id` | `string` | | `data` | `UpdateTaxRateInput` | @@ -507,30 +550,35 @@ ___ `Promise`<`TaxRate`\> +-`Promise`: + -`TaxRate`: + #### Defined in -[medusa/src/services/tax-rate.ts:109](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/tax-rate.ts#L109) +[medusa/src/services/tax-rate.ts:109](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/tax-rate.ts#L109) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`TaxRateService`](TaxRateService.md) +**withTransaction**(`transactionManager?`): [`TaxRateService`](TaxRateService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`TaxRateService`](TaxRateService.md) +-`TaxRateService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/TokenService.md b/www/apps/docs/content/references/services/classes/TokenService.md index 92d2a00d89e34..45b9d3088b212 100644 --- a/www/apps/docs/content/references/services/classes/TokenService.md +++ b/www/apps/docs/content/references/services/classes/TokenService.md @@ -1,51 +1,51 @@ -# Class: TokenService +# TokenService ## Constructors ### constructor -• **new TokenService**(`«destructured»`) +**new TokenService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `InjectedDependencies` | #### Defined in -[medusa/src/services/token.ts:16](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/token.ts#L16) +[medusa/src/services/token.ts:16](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/token.ts#L16) ## Properties ### configModule\_ -• `Protected` `Readonly` **configModule\_**: `ConfigModule` + `Protected` `Readonly` **configModule\_**: `ConfigModule` #### Defined in -[medusa/src/services/token.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/token.ts#L14) +[medusa/src/services/token.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/token.ts#L14) ___ ### RESOLUTION\_KEY -▪ `Static` **RESOLUTION\_KEY**: `string` + `Static` **RESOLUTION\_KEY**: `string` #### Defined in -[medusa/src/services/token.ts:12](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/token.ts#L12) +[medusa/src/services/token.ts:12](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/token.ts#L12) ## Methods ### signToken -▸ **signToken**(`data`, `options?`): `string` +**signToken**(`data`, `options?`): `string` #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `data` | `string` \| `object` \| `Buffer` | | `options?` | `SignOptions` | @@ -53,20 +53,22 @@ ___ `string` +-`string`: (optional) + #### Defined in -[medusa/src/services/token.ts:34](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/token.ts#L34) +[medusa/src/services/token.ts:34](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/token.ts#L34) ___ ### verifyToken -▸ **verifyToken**(`token`, `options?`): `string` \| `Jwt` \| `JwtPayload` +**verifyToken**(`token`, `options?`): `string` \| `Jwt` \| `JwtPayload` #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `token` | `string` | | `options?` | `VerifyOptions` | @@ -74,6 +76,8 @@ ___ `string` \| `Jwt` \| `JwtPayload` +-`string \| Jwt \| JwtPayload`: (optional) + #### Defined in -[medusa/src/services/token.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/token.ts#L20) +[medusa/src/services/token.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/token.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/TotalsService.md b/www/apps/docs/content/references/services/classes/TotalsService.md index 45a9c55ead3cc..3e367545afa24 100644 --- a/www/apps/docs/content/references/services/classes/TotalsService.md +++ b/www/apps/docs/content/references/services/classes/TotalsService.md @@ -1,8 +1,8 @@ -# Class: TotalsService +# TotalsService A service that calculates total and subtotals for orders, carts etc.. -**`Implements`** +**Implements** ## Hierarchy @@ -14,12 +14,12 @@ A service that calculates total and subtotals for orders, carts etc.. ### constructor -• **new TotalsService**(`«destructured»`) +**new TotalsService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `TotalsServiceProps` | #### Overrides @@ -28,13 +28,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/totals.ts:112](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L112) +[medusa/src/services/totals.ts:112](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L112) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -42,13 +42,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -56,13 +56,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -70,23 +70,23 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### featureFlagRouter\_ -• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` + `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` #### Defined in -[medusa/src/services/totals.ts:110](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L110) +[medusa/src/services/totals.ts:110](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L110) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -94,43 +94,43 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### newTotalsService\_ -• `Protected` `Readonly` **newTotalsService\_**: [`NewTotalsService`](NewTotalsService.md) + `Protected` `Readonly` **newTotalsService\_**: [`NewTotalsService`](NewTotalsService.md) #### Defined in -[medusa/src/services/totals.ts:108](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L108) +[medusa/src/services/totals.ts:108](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L108) ___ ### taxCalculationStrategy\_ -• `Protected` `Readonly` **taxCalculationStrategy\_**: `ITaxCalculationStrategy` + `Protected` `Readonly` **taxCalculationStrategy\_**: `ITaxCalculationStrategy` #### Defined in -[medusa/src/services/totals.ts:109](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L109) +[medusa/src/services/totals.ts:109](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L109) ___ ### taxProviderService\_ -• `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md) + `Protected` `Readonly` **taxProviderService\_**: [`TaxProviderService`](TaxProviderService.md) #### Defined in -[medusa/src/services/totals.ts:107](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L107) +[medusa/src/services/totals.ts:107](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L107) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -138,47 +138,47 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -187,7 +187,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -195,20 +195,20 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### calculateDiscount\_ -▸ **calculateDiscount_**(`lineItem`, `variant`, `variantPrice`, `value`, `discountType`): `LineDiscount` +**calculateDiscount_**(`lineItem`, `variant`, `variantPrice`, `value`, `discountType`): `LineDiscount` Calculates either fixed or percentage discount of a variant #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `lineItem` | `LineItem` | id of line item | | `variant` | `string` | id of variant in line item | | `variantPrice` | `number` | price of the variant based on region | @@ -219,21 +219,19 @@ Calculates either fixed or percentage discount of a variant `LineDiscount` -triples of lineitem, variant and applied discount - -**`Deprecated`** +**Deprecated** - in favour of DiscountService.calculateDiscountForLineItem #### Defined in -[medusa/src/services/totals.ts:627](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L627) +[medusa/src/services/totals.ts:627](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L627) ___ ### getAllocationItemDiscounts -▸ **getAllocationItemDiscounts**(`discount`, `cart`): `LineDiscount`[] +**getAllocationItemDiscounts**(`discount`, `cart`): `LineDiscount`[] If the rule of a discount has allocation="item", then we need to calculate discount on each item in the cart. Furthermore, we need to @@ -243,8 +241,8 @@ alongside the variant on which the discount was applied. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `discount` | `Discount` | the discount to which we do the calculation | | `cart` | `Order` \| `Cart` | the cart to calculate discounts for | @@ -252,17 +250,17 @@ alongside the variant on which the discount was applied. `LineDiscount`[] -array of triples of lineitem, variant and applied discount +-`LineDiscount[]`: array of triples of lineitem, variant and applied discount #### Defined in -[medusa/src/services/totals.ts:669](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L669) +[medusa/src/services/totals.ts:669](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L669) ___ ### getAllocationMap -▸ **getAllocationMap**(`orderOrCart`, `options?`): `Promise`<`LineAllocationsMap`\> +**getAllocationMap**(`orderOrCart`, `options?`): `Promise`<`LineAllocationsMap`\> Gets a map of discounts and gift cards that apply to line items in an order. The function calculates the amount of a discount or gift card that @@ -270,37 +268,37 @@ applies to a specific line item. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `orderOrCart` | `Object` | the order or cart to get an allocation map for | -| `orderOrCart.claims?` | `ClaimOrder`[] | - | -| `orderOrCart.discounts?` | `Discount`[] | - | -| `orderOrCart.items` | `LineItem`[] | - | -| `orderOrCart.swaps?` | `Swap`[] | - | +| Name | Description | +| :------ | :------ | +| `orderOrCart` | `object` | the order or cart to get an allocation map for | +| `orderOrCart.claims?` | `ClaimOrder`[] | +| `orderOrCart.discounts?` | `Discount`[] | +| `orderOrCart.items` | `LineItem`[] | +| `orderOrCart.swaps?` | `Swap`[] | | `options` | `AllocationMapOptions` | controls what should be included in allocation map | #### Returns `Promise`<`LineAllocationsMap`\> -the allocation map for the line items in the cart or order. +-`Promise`: the allocation map for the line items in the cart or order. #### Defined in -[medusa/src/services/totals.ts:435](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L435) +[medusa/src/services/totals.ts:435](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L435) ___ ### getCalculationContext -▸ **getCalculationContext**(`calculationContextData`, `options?`): `Promise`<`TaxCalculationContext`\> +**getCalculationContext**(`calculationContextData`, `options?`): `Promise`<`TaxCalculationContext`\> Prepares the calculation context for a tax total calculation. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `calculationContextData` | `CalculationContextData` | the calculationContextData to get the calculation context for | | `options` | `CalculationContextOptions` | options to gather context by | @@ -308,147 +306,152 @@ Prepares the calculation context for a tax total calculation. `Promise`<`TaxCalculationContext`\> -the tax calculation context +-`Promise`: the tax calculation context #### Defined in -[medusa/src/services/totals.ts:1028](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L1028) +[medusa/src/services/totals.ts:1028](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L1028) ___ ### getDiscountTotal -▸ **getDiscountTotal**(`cartOrOrder`): `Promise`<`number`\> +**getDiscountTotal**(`cartOrOrder`): `Promise`<`number`\> Calculates the total discount amount for each of the different supported discount types. If discounts aren't present or invalid returns 0. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartOrOrder` | `Order` \| `Cart` | the cart or order to calculate discounts for | #### Returns `Promise`<`number`\> -the total discounts amount +-`Promise`: the total discounts amount + -`number`: (optional) #### Defined in -[medusa/src/services/totals.ts:1006](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L1006) +[medusa/src/services/totals.ts:1006](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L1006) ___ ### getGiftCardTotal -▸ **getGiftCardTotal**(`cartOrOrder`, `opts?`): `Promise`<{ `tax_total`: `number` ; `total`: `number` }\> +**getGiftCardTotal**(`cartOrOrder`, `opts?`): `Promise`<{ `tax_total`: `number` ; `total`: `number` }\> Gets the gift card amount on a cart or order. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartOrOrder` | `Order` \| `Cart` | the cart or order to get gift card amount for | -| `opts` | `Object` | - | -| `opts.gift_cardable?` | `number` | - | +| `opts` | `object` | +| `opts.gift_cardable?` | `number` | #### Returns `Promise`<{ `tax_total`: `number` ; `total`: `number` }\> -the gift card amount applied to the cart or order +-`Promise`: the gift card amount applied to the cart or order + -``object``: (optional) #### Defined in -[medusa/src/services/totals.ts:975](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L975) +[medusa/src/services/totals.ts:975](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L975) ___ ### getGiftCardableAmount -▸ **getGiftCardableAmount**(`cartOrOrder`): `Promise`<`number`\> +**getGiftCardableAmount**(`cartOrOrder`): `Promise`<`number`\> Gets the amount that can be gift carded on a cart. In regions where gift cards are taxable this amount should exclude taxes. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartOrOrder` | `Order` \| `Cart` | the cart or order to get gift card amount for | #### Returns `Promise`<`number`\> -the gift card amount applied to the cart or order +-`Promise`: the gift card amount applied to the cart or order + -`number`: (optional) #### Defined in -[medusa/src/services/totals.ts:958](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L958) +[medusa/src/services/totals.ts:958](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L958) ___ ### getLineDiscounts -▸ **getLineDiscounts**(`cartOrOrder`, `discount?`): `LineDiscountAmount`[] +**getLineDiscounts**(`cartOrOrder`, `discount?`): `LineDiscountAmount`[] Returns the discount amount allocated to the line items of an order. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `cartOrOrder` | `Object` | the cart or order to get line discount allocations for | -| `cartOrOrder.claims?` | `ClaimOrder`[] | - | -| `cartOrOrder.items` | `LineItem`[] | - | -| `cartOrOrder.swaps?` | `Swap`[] | - | +| Name | Description | +| :------ | :------ | +| `cartOrOrder` | `object` | the cart or order to get line discount allocations for | +| `cartOrOrder.claims?` | `ClaimOrder`[] | +| `cartOrOrder.items` | `LineItem`[] | +| `cartOrOrder.swaps?` | `Swap`[] | | `discount?` | `Discount` | the discount to use as context for the calculation | #### Returns `LineDiscountAmount`[] -the allocations that the discount has on the items in the cart or +-`LineDiscountAmount[]`: the allocations that the discount has on the items in the cart or order #### Defined in -[medusa/src/services/totals.ts:720](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L720) +[medusa/src/services/totals.ts:720](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L720) ___ ### getLineItemAdjustmentsTotal -▸ **getLineItemAdjustmentsTotal**(`cartOrOrder`): `number` +**getLineItemAdjustmentsTotal**(`cartOrOrder`): `number` #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `cartOrOrder` | `Order` \| `Cart` | #### Returns `number` +-`number`: (optional) + #### Defined in -[medusa/src/services/totals.ts:697](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L697) +[medusa/src/services/totals.ts:697](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L697) ___ ### getLineItemDiscountAdjustment -▸ **getLineItemDiscountAdjustment**(`lineItem`, `discount`): `number` +**getLineItemDiscountAdjustment**(`lineItem`, `discount`): `number` #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `lineItem` | `LineItem` | | `discount` | `Discount` | @@ -456,22 +459,24 @@ ___ `number` +-`number`: (optional) + #### Defined in -[medusa/src/services/totals.ts:682](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L682) +[medusa/src/services/totals.ts:682](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L682) ___ ### getLineItemRefund -▸ **getLineItemRefund**(`order`, `lineItem`): `Promise`<`number`\> +**getLineItemRefund**(`order`, `lineItem`): `Promise`<`number`\> The amount that can be refunded for a given line item. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `order` | `Order` | order to use as context for the calculation | | `lineItem` | `LineItem` | the line item to calculate the refund amount for. | @@ -479,25 +484,26 @@ The amount that can be refunded for a given line item. `Promise`<`number`\> -the line item refund amount. +-`Promise`: the line item refund amount. + -`number`: (optional) #### Defined in -[medusa/src/services/totals.ts:504](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L504) +[medusa/src/services/totals.ts:504](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L504) ___ ### getLineItemTotal -▸ **getLineItemTotal**(`lineItem`, `cartOrOrder`, `options?`): `Promise`<`number`\> +**getLineItemTotal**(`lineItem`, `cartOrOrder`, `options?`): `Promise`<`number`\> Gets a total for a line item. The total can take gift cards, discounts and taxes into account. This can be controlled through the options. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `lineItem` | `LineItem` | the line item to calculate a total for | | `cartOrOrder` | `Order` \| `Cart` | the cart or order to use as context for the calculation | | `options` | `GetLineItemTotalOptions` | the options to use for the calculation | @@ -506,17 +512,18 @@ taxes into account. This can be controlled through the options. `Promise`<`number`\> -the line item total +-`Promise`: the line item total + -`number`: (optional) #### Defined in -[medusa/src/services/totals.ts:931](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L931) +[medusa/src/services/totals.ts:931](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L931) ___ ### getLineItemTotals -▸ **getLineItemTotals**(`lineItem`, `cartOrOrder`, `options?`): `Promise`<`LineItemTotals`\> +**getLineItemTotals**(`lineItem`, `cartOrOrder`, `options?`): `Promise`<`LineItemTotals`\> Breaks down the totals related to a line item; these are the subtotal, the amount of discount applied to the line item, the amount of a gift card @@ -524,8 +531,8 @@ applied to a line item and the amount of tax applied to a line item. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `lineItem` | `LineItem` | the line item to calculate totals for | | `cartOrOrder` | `Order` \| `Cart` | the cart or order to use as context for the calculation | | `options` | `LineItemTotalsOptions` | the options to evaluate the line item totals for | @@ -534,41 +541,41 @@ applied to a line item and the amount of tax applied to a line item. `Promise`<`LineItemTotals`\> -the breakdown of the line item totals +-`Promise`: the breakdown of the line item totals #### Defined in -[medusa/src/services/totals.ts:776](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L776) +[medusa/src/services/totals.ts:776](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L776) ___ ### getPaidTotal -▸ **getPaidTotal**(`order`): `number` +**getPaidTotal**(`order`): `number` Gets the total payments made on an order #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `order` | `Order` | the order to calculate paid amount for | #### Returns `number` -the total paid amount +-`number`: (optional) the total paid amount #### Defined in -[medusa/src/services/totals.ts:157](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L157) +[medusa/src/services/totals.ts:157](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L157) ___ ### getRefundTotal -▸ **getRefundTotal**(`order`, `lineItems`): `Promise`<`number`\> +**getRefundTotal**(`order`, `lineItems`): `Promise`<`number`\> Calculates refund total of line items. If any of the items to return have been discounted, we need to @@ -576,8 +583,8 @@ apply the discount again before refunding them. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `order` | `Order` | cart or order to calculate subtotal for | | `lineItems` | `LineItem`[] | the line items to calculate refund total for | @@ -585,49 +592,50 @@ apply the discount again before refunding them. `Promise`<`number`\> -the calculated subtotal +-`Promise`: the calculated subtotal + -`number`: (optional) #### Defined in -[medusa/src/services/totals.ts:583](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L583) +[medusa/src/services/totals.ts:583](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L583) ___ ### getRefundedTotal -▸ **getRefundedTotal**(`order`): `number` +**getRefundedTotal**(`order`): `number` Gets the total refund amount for an order. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `order` | `Order` | the order to get total refund amount for. | #### Returns `number` -the total refunded amount for an order. +-`number`: (optional) the total refunded amount for an order. #### Defined in -[medusa/src/services/totals.ts:489](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L489) +[medusa/src/services/totals.ts:489](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L489) ___ ### getShippingMethodTotals -▸ **getShippingMethodTotals**(`shippingMethod`, `cartOrOrder`, `opts?`): `Promise`<`ShippingMethodTotals`\> +**getShippingMethodTotals**(`shippingMethod`, `cartOrOrder`, `opts?`): `Promise`<`ShippingMethodTotals`\> Gets the totals breakdown for a shipping method. Fetches tax lines if not already provided. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `shippingMethod` | `ShippingMethod` | the shipping method to get totals breakdown for. | | `cartOrOrder` | `Order` \| `Cart` | the cart or order to use as context for the breakdown | | `opts` | `GetShippingMethodTotalsOptions` | options for what should be included | @@ -636,48 +644,49 @@ already provided. `Promise`<`ShippingMethodTotals`\> -An object that breaks down the totals for the shipping method +-`Promise`: An object that breaks down the totals for the shipping method #### Defined in -[medusa/src/services/totals.ts:191](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L191) +[medusa/src/services/totals.ts:191](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L191) ___ ### getShippingTotal -▸ **getShippingTotal**(`cartOrOrder`): `Promise`<`number`\> +**getShippingTotal**(`cartOrOrder`): `Promise`<`number`\> Calculates shipping total #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartOrOrder` | `Order` \| `Cart` | cart or order to calculate subtotal for | #### Returns `Promise`<`number`\> -shipping total +-`Promise`: shipping total + -`number`: (optional) #### Defined in -[medusa/src/services/totals.ts:319](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L319) +[medusa/src/services/totals.ts:319](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L319) ___ ### getSubtotal -▸ **getSubtotal**(`cartOrOrder`, `opts?`): `Promise`<`number`\> +**getSubtotal**(`cartOrOrder`, `opts?`): `Promise`<`number`\> Calculates subtotal of a given cart or order. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartOrOrder` | `Order` \| `Cart` | cart or order to calculate subtotal for | | `opts` | `SubtotalOptions` | options | @@ -685,75 +694,77 @@ Calculates subtotal of a given cart or order. `Promise`<`number`\> -the calculated subtotal +-`Promise`: the calculated subtotal + -`number`: (optional) #### Defined in -[medusa/src/services/totals.ts:283](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L283) +[medusa/src/services/totals.ts:283](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L283) ___ ### getSwapTotal -▸ **getSwapTotal**(`order`): `number` +**getSwapTotal**(`order`): `number` The total paid for swaps. May be negative in case of negative swap difference. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `order` | `Order` | the order to calculate swap total for | #### Returns `number` -the swap total +-`number`: (optional) the swap total #### Defined in -[medusa/src/services/totals.ts:172](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L172) +[medusa/src/services/totals.ts:172](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L172) ___ ### getTaxTotal -▸ **getTaxTotal**(`cartOrOrder`, `forceTaxes?`): `Promise`<``null`` \| `number`\> +**getTaxTotal**(`cartOrOrder`, `forceTaxes?`): `Promise`<``null`` \| `number`\> Calculates tax total Currently based on the Danish tax system #### Parameters -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `cartOrOrder` | `Order` \| `Cart` | `undefined` | cart or order to calculate tax total for | +| Name | Default value | Description | +| :------ | :------ | :------ | +| `cartOrOrder` | `Order` \| `Cart` | cart or order to calculate tax total for | | `forceTaxes` | `boolean` | `false` | whether taxes should be calculated regardless of region settings | #### Returns `Promise`<``null`` \| `number`\> -tax total +-`Promise`: tax total + -```null`` \| number`: (optional) #### Defined in -[medusa/src/services/totals.ts:346](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L346) +[medusa/src/services/totals.ts:346](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L346) ___ ### getTotal -▸ **getTotal**(`cartOrOrder`, `options?`): `Promise`<`number`\> +**getTotal**(`cartOrOrder`, `options?`): `Promise`<`number`\> Calculates total of a given cart or order. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `cartOrOrder` | `Order` \| `Cart` | object to calculate total for | | `options` | `GetTotalsOptions` | options to calculate by | @@ -761,80 +772,85 @@ Calculates total of a given cart or order. `Promise`<`number`\> -the calculated subtotal +-`Promise`: the calculated subtotal + -`number`: (optional) #### Defined in -[medusa/src/services/totals.ts:134](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L134) +[medusa/src/services/totals.ts:134](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L134) ___ ### rounded -▸ **rounded**(`value`): `number` +**rounded**(`value`): `number` Rounds a number using Math.round. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `value` | `number` | the value to round | #### Returns `number` -the rounded value +-`number`: (optional) the rounded value #### Defined in -[medusa/src/services/totals.ts:1058](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/totals.ts#L1058) +[medusa/src/services/totals.ts:1058](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/totals.ts#L1058) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`TotalsService`](TotalsService.md) +**withTransaction**(`transactionManager?`): [`TotalsService`](TotalsService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`TotalsService`](TotalsService.md) +-`TotalsService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20) diff --git a/www/apps/docs/content/references/services/classes/UserService.md b/www/apps/docs/content/references/services/classes/UserService.md index 6724ccd7a314d..356b19ba0bd7a 100644 --- a/www/apps/docs/content/references/services/classes/UserService.md +++ b/www/apps/docs/content/references/services/classes/UserService.md @@ -1,4 +1,4 @@ -# Class: UserService +# UserService Provides layer to manipulate users. @@ -12,12 +12,12 @@ Provides layer to manipulate users. ### constructor -• **new UserService**(`«destructured»`) +**new UserService**(`«destructured»`) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `«destructured»` | `UserServiceProps` | #### Overrides @@ -26,13 +26,13 @@ TransactionBaseService.constructor #### Defined in -[medusa/src/services/user.ts:45](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L45) +[medusa/src/services/user.ts:45](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L45) ## Properties ### \_\_configModule\_\_ -• `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_configModule\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -40,13 +40,13 @@ TransactionBaseService.\_\_configModule\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L14) +[medusa/src/interfaces/transaction-base-service.ts:14](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L14) ___ ### \_\_container\_\_ -• `Protected` `Readonly` **\_\_container\_\_**: `any` + `Protected` `Readonly` **\_\_container\_\_**: `any` #### Inherited from @@ -54,13 +54,13 @@ TransactionBaseService.\_\_container\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L13) +[medusa/src/interfaces/transaction-base-service.ts:13](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L13) ___ ### \_\_moduleDeclaration\_\_ -• `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: `Record`<`string`, `unknown`\> + `Protected` `Optional` `Readonly` **\_\_moduleDeclaration\_\_**: Record<`string`, `unknown`\> #### Inherited from @@ -68,43 +68,43 @@ TransactionBaseService.\_\_moduleDeclaration\_\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L15) +[medusa/src/interfaces/transaction-base-service.ts:15](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L15) ___ ### analyticsConfigService\_ -• `Protected` `Readonly` **analyticsConfigService\_**: [`AnalyticsConfigService`](AnalyticsConfigService.md) + `Protected` `Readonly` **analyticsConfigService\_**: [`AnalyticsConfigService`](AnalyticsConfigService.md) #### Defined in -[medusa/src/services/user.ts:40](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L40) +[medusa/src/services/user.ts:40](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L40) ___ ### eventBus\_ -• `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) + `Protected` `Readonly` **eventBus\_**: [`EventBusService`](EventBusService.md) #### Defined in -[medusa/src/services/user.ts:42](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L42) +[medusa/src/services/user.ts:42](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L42) ___ ### featureFlagRouter\_ -• `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` + `Protected` `Readonly` **featureFlagRouter\_**: `FlagRouter` #### Defined in -[medusa/src/services/user.ts:43](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L43) +[medusa/src/services/user.ts:43](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L43) ___ ### manager\_ -• `Protected` **manager\_**: `EntityManager` + `Protected` **manager\_**: `EntityManager` #### Inherited from @@ -112,13 +112,13 @@ TransactionBaseService.manager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L5) +[medusa/src/interfaces/transaction-base-service.ts:5](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L5) ___ ### transactionManager\_ -• `Protected` **transactionManager\_**: `undefined` \| `EntityManager` + `Protected` **transactionManager\_**: `undefined` \| `EntityManager` #### Inherited from @@ -126,23 +126,23 @@ TransactionBaseService.transactionManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L6) +[medusa/src/interfaces/transaction-base-service.ts:6](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L6) ___ ### userRepository\_ -• `Protected` `Readonly` **userRepository\_**: `Repository`<`User`\> + `Protected` `Readonly` **userRepository\_**: `Repository`<`User`\> #### Defined in -[medusa/src/services/user.ts:41](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L41) +[medusa/src/services/user.ts:41](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L41) ___ ### Events -▪ `Static` **Events**: `Object` + `Static` **Events**: `Object` #### Type declaration @@ -155,47 +155,47 @@ ___ #### Defined in -[medusa/src/services/user.ts:33](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L33) +[medusa/src/services/user.ts:33](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L33) ## Accessors ### activeManager\_ -• `Protected` `get` **activeManager_**(): `EntityManager` +`Protected` `get` **activeManager_**(): `EntityManager` #### Returns `EntityManager` +-`EntityManager`: + #### Inherited from TransactionBaseService.activeManager\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L8) +[medusa/src/interfaces/transaction-base-service.ts:8](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L8) ## Methods ### atomicPhase\_ -▸ `Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> +`Protected` **atomicPhase_**<`TResult`, `TError`\>(`work`, `isolationOrErrorHandler?`, `maybeErrorHandlerOrDontFail?`): `Promise`<`TResult`\> Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. -#### Type parameters - | Name | | :------ | -| `TResult` | -| `TError` | +| `TResult` | `object` | +| `TError` | `object` | #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `work` | (`transactionManager`: `EntityManager`) => `Promise`<`TResult`\> | the transactional work to be done | | `isolationOrErrorHandler?` | `IsolationLevel` \| (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | the isolation level to be used for the work. | | `maybeErrorHandlerOrDontFail?` | (`error`: `TError`) => `Promise`<`void` \| `TResult`\> | Potential error handler | @@ -204,7 +204,7 @@ transaction manager is created. `Promise`<`TResult`\> -the result of the transactional work +-`Promise`: the result of the transactional work #### Inherited from @@ -212,21 +212,21 @@ TransactionBaseService.atomicPhase\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L56) +[medusa/src/interfaces/transaction-base-service.ts:56](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L56) ___ ### create -▸ **create**(`user`, `password`): `Promise`<`User`\> +**create**(`user`, `password`): `Promise`<`User`\> Creates a user with username being validated. Fails if email is not a valid format. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `user` | `CreateUserInput` | the user to create | | `password` | `string` | user's password to hash | @@ -234,41 +234,42 @@ Fails if email is not a valid format. `Promise`<`User`\> -the result of create +-`Promise`: the result of create + -`User`: #### Defined in -[medusa/src/services/user.ts:171](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L171) +[medusa/src/services/user.ts:171](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L171) ___ ### delete -▸ **delete**(`userId`): `Promise`<`void`\> +**delete**(`userId`): `Promise`<`void`\> Deletes a user from a given user id. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `userId` | `string` | the id of the user to delete. Must be castable as an ObjectId | #### Returns `Promise`<`void`\> -the result of the delete operation. +-`Promise`: the result of the delete operation. #### Defined in -[medusa/src/services/user.ts:263](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L263) +[medusa/src/services/user.ts:263](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L263) ___ ### generateResetPasswordToken -▸ **generateResetPasswordToken**(`userId`): `Promise`<`string`\> +**generateResetPasswordToken**(`userId`): `Promise`<`string`\> Generate a JSON Web token, that will be sent to a user, that wishes to reset password. @@ -278,80 +279,84 @@ is always 15 minutes. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `userId` | `string` | the id of the user to reset password for | #### Returns `Promise`<`string`\> -the generated JSON web token +-`Promise`: the generated JSON web token + -`string`: (optional) #### Defined in -[medusa/src/services/user.ts:327](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L327) +[medusa/src/services/user.ts:327](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L327) ___ ### hashPassword\_ -▸ **hashPassword_**(`password`): `Promise`<`string`\> +**hashPassword_**(`password`): `Promise`<`string`\> Hashes a password #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `password` | `string` | the value to hash | #### Returns `Promise`<`string`\> -hashed password +-`Promise`: hashed password + -`string`: (optional) #### Defined in -[medusa/src/services/user.ts:159](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L159) +[medusa/src/services/user.ts:159](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L159) ___ ### list -▸ **list**(`selector`, `config?`): `Promise`<`User`[]\> +**list**(`selector`, `config?`): `Promise`<`User`[]\> #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `selector` | `FilterableUserProps` | the query object for find | -| `config` | `Object` | the configuration object for the query | +| `config` | `object` | the configuration object for the query | #### Returns `Promise`<`User`[]\> -the result of the find operation +-`Promise`: the result of the find operation + -`User[]`: + -`User`: #### Defined in -[medusa/src/services/user.ts:65](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L65) +[medusa/src/services/user.ts:65](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L65) ___ ### retrieve -▸ **retrieve**(`userId`, `config?`): `Promise`<`User`\> +**retrieve**(`userId`, `config?`): `Promise`<`User`\> Gets a user by id. Throws in case of DB Error and if user was not found. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `userId` | `string` | the id of the user to get. | | `config` | `FindConfig`<`User`\> | query configs | @@ -359,51 +364,53 @@ Throws in case of DB Error and if user was not found. `Promise`<`User`\> -the user document. +-`Promise`: the user document. + -`User`: #### Defined in -[medusa/src/services/user.ts:77](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L77) +[medusa/src/services/user.ts:77](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L77) ___ ### retrieveByApiToken -▸ **retrieveByApiToken**(`apiToken`, `relations?`): `Promise`<`User`\> +**retrieveByApiToken**(`apiToken`, `relations?`): `Promise`<`User`\> Gets a user by api token. Throws in case of DB Error and if user was not found. #### Parameters -| Name | Type | Default value | Description | -| :------ | :------ | :------ | :------ | -| `apiToken` | `string` | `undefined` | the token of the user to get. | +| Name | Default value | Description | +| :------ | :------ | :------ | +| `apiToken` | `string` | the token of the user to get. | | `relations` | `string`[] | `[]` | relations to include with the user. | #### Returns `Promise`<`User`\> -the user document. +-`Promise`: the user document. + -`User`: #### Defined in -[medusa/src/services/user.ts:107](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L107) +[medusa/src/services/user.ts:107](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L107) ___ ### retrieveByEmail -▸ **retrieveByEmail**(`email`, `config?`): `Promise`<`User`\> +**retrieveByEmail**(`email`, `config?`): `Promise`<`User`\> Gets a user by email. Throws in case of DB Error and if user was not found. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `email` | `string` | the email of the user to get. | | `config` | `FindConfig`<`User`\> | query config | @@ -411,17 +418,18 @@ Throws in case of DB Error and if user was not found. `Promise`<`User`\> -the user document. +-`Promise`: the user document. + -`User`: #### Defined in -[medusa/src/services/user.ts:135](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L135) +[medusa/src/services/user.ts:135](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L135) ___ ### setPassword\_ -▸ **setPassword_**(`userId`, `password`): `Promise`<`User`\> +**setPassword_**(`userId`, `password`): `Promise`<`User`\> Sets a password for a user Fails if no user exists with userId and if the hashing of the new @@ -429,8 +437,8 @@ password does not work. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `userId` | `string` | the userId to set password for | | `password` | `string` | the old password to set | @@ -438,48 +446,51 @@ password does not work. `Promise`<`User`\> -the result of the update operation +-`Promise`: the result of the update operation + -`User`: #### Defined in -[medusa/src/services/user.ts:298](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L298) +[medusa/src/services/user.ts:298](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L298) ___ ### shouldRetryTransaction\_ -▸ `Protected` **shouldRetryTransaction_**(`err`): `boolean` +`Protected` **shouldRetryTransaction_**(`err`): `boolean` #### Parameters -| Name | Type | -| :------ | :------ | -| `err` | `Record`<`string`, `unknown`\> \| { `code`: `string` } | +| Name | +| :------ | +| `err` | Record<`string`, `unknown`\> \| { `code`: `string` } | #### Returns `boolean` +-`boolean`: (optional) + #### Inherited from TransactionBaseService.shouldRetryTransaction\_ #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L37) +[medusa/src/interfaces/transaction-base-service.ts:37](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L37) ___ ### update -▸ **update**(`userId`, `update`): `Promise`<`User`\> +**update**(`userId`, `update`): `Promise`<`User`\> Updates a user. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | +| Name | Description | +| :------ | :------ | | `userId` | `string` | id of the user to update | | `update` | `UpdateUserInput` | the values to be updated on the user | @@ -487,32 +498,35 @@ Updates a user. `Promise`<`User`\> -the result of create +-`Promise`: the result of create + -`User`: #### Defined in -[medusa/src/services/user.ts:217](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/services/user.ts#L217) +[medusa/src/services/user.ts:217](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/services/user.ts#L217) ___ ### withTransaction -▸ **withTransaction**(`transactionManager?`): [`UserService`](UserService.md) +**withTransaction**(`transactionManager?`): [`UserService`](UserService.md) #### Parameters -| Name | Type | -| :------ | :------ | +| Name | +| :------ | | `transactionManager?` | `EntityManager` | #### Returns [`UserService`](UserService.md) +-`UserService`: + #### Inherited from TransactionBaseService.withTransaction #### Defined in -[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/b38f73726/packages/medusa/src/interfaces/transaction-base-service.ts#L20) +[medusa/src/interfaces/transaction-base-service.ts:20](https://github.com/medusajs/medusa/blob/0af6e5534/packages/medusa/src/interfaces/transaction-base-service.ts#L20)