Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
171 commits
Select commit Hold shift + click to select a range
db6d59b
Create new core package
acasazza Apr 16, 2024
9ea9132
Add configuration and getPrices function
acasazza Apr 19, 2024
db82faa
Add getPrices tests, biomejs, and global vitest config
acasazza Feb 6, 2025
d815493
Add new documentation folder
acasazza Feb 11, 2025
066d180
Add new getAccessToken function. Resolve #617
acasazza Mar 27, 2025
bc93a9e
Fix vite types env
acasazza Mar 27, 2025
761fb87
Merge pull request #618 from commercelayer/breaking-change/v5
acasazza Mar 27, 2025
03971c4
Fix relative path for vitest
acasazza Apr 1, 2025
0de1a66
Remove ts comment
acasazza Apr 1, 2025
9d8019d
Merge pull request #620 from commercelayer/v5/core/getPrices
acasazza Apr 1, 2025
fe27e1c
Add retrievePrice function. Resolve #621
acasazza Apr 2, 2025
53ebff4
Merge pull request #622 from commercelayer/v5/core/retrievePrice
acasazza Apr 2, 2025
e29a3d5
Add updatePrice function, and tests, remove package jwt-decode
acasazza Apr 22, 2025
6392d9c
Merge pull request #627 from commercelayer/v5/core/updatePrice
acasazza Apr 22, 2025
10a582b
Create new core package
acasazza Apr 16, 2024
ee8f0c2
Add configuration and getPrices function
acasazza Apr 19, 2024
0e48a58
Add getPrices tests, biomejs, and global vitest config
acasazza Feb 6, 2025
00121da
Add new documentation folder
acasazza Feb 11, 2025
3cdae8c
Add new getAccessToken function. Resolve #617
acasazza Mar 27, 2025
bedfaee
Fix vite types env
acasazza Mar 27, 2025
8669e20
Fix relative path for vitest
acasazza Apr 1, 2025
48bc56b
Remove ts comment
acasazza Apr 1, 2025
6a7aacf
Add retrievePrice function. Resolve #621
acasazza Apr 2, 2025
10c1bd4
Add updatePrice function, and tests, remove package jwt-decode
acasazza Apr 22, 2025
08213a7
Add new hook usePrices and unit tests, update commercelayer/sdk to v7…
acasazza Dec 17, 2025
7007962
Expose Adyen dropin events (onReady, onSelect)
acasazza Apr 2, 2025
90f3811
v4.21.0
acasazza Apr 2, 2025
1ff895d
Add stripe connected account
acasazza Apr 9, 2025
142a4c7
v4.22.0-beta.0
acasazza Apr 10, 2025
e388bc3
v4.22.0
acasazza Apr 11, 2025
5ada98c
Add new CKO flow library
acasazza May 14, 2025
925e1f5
v4.23.0
acasazza May 14, 2025
b21cb89
Fix load CKO configuration
acasazza May 15, 2025
169bc0f
v4.23.1
acasazza May 15, 2025
f9f9383
Fix CKO config types
acasazza May 19, 2025
35d2c4a
v4.23.2
acasazza May 19, 2025
2ba429e
Fix show CKO payment error
acasazza May 22, 2025
9c635b0
v4.23.3-beta.0
acasazza May 22, 2025
221505c
Fix place draft order
acasazza May 23, 2025
98a9a78
v4.23.3-beta.1
acasazza May 23, 2025
2820bf8
v4.23.3
acasazza May 28, 2025
ecc2047
Fix avoid place order in draft
acasazza May 29, 2025
62213fa
v4.23.4-beta.0
acasazza May 29, 2025
06a7fea
v4.23.4
acasazza Jun 3, 2025
f048647
Add Adyen subscriptions
acasazza May 30, 2025
dbd286a
Hide customer payments when the order contains a subscription
acasazza Jun 4, 2025
7580749
v4.24.0-beta.0
acasazza Jun 4, 2025
a44e05a
Reset Adyen stored payments when the order has a subscription
acasazza Jun 5, 2025
02a11dd
v4.24.0-beta.1
acasazza Jun 5, 2025
dbb3ab9
Add subscriptionPaymentMethods prop to filter available payment metho…
acasazza Jun 5, 2025
d654632
v4.24.0-beta.2
acasazza Jun 5, 2025
0463c17
Fix types
acasazza Jun 6, 2025
0300469
v4.24.0
acasazza Jun 6, 2025
df90ce4
Show all payment methods available
acasazza Jun 6, 2025
5d23fcb
Fix avoid place order in draft, and express payments by CKO
acasazza Jun 12, 2025
0953a91
v4.24.1-beta.0
acasazza Jun 12, 2025
a549359
Fix loading card info
acasazza Jun 16, 2025
684330f
v4.24.1-beta.1
acasazza Jun 16, 2025
4927860
Fix loading card info
acasazza Jun 16, 2025
f1e9fa6
v4.24.1-beta.2
acasazza Jun 16, 2025
d596f29
Fix unused variable
acasazza Jun 16, 2025
5b61f4a
v4.24.1-beta.3
acasazza Jun 16, 2025
3c7ee3d
Fix autoselect payment method with CKO. Resolve #645
acasazza Jun 20, 2025
d49bf7a
Update deps
acasazza Jun 20, 2025
39279b5
Fix avoid place order in draft
acasazza Jun 20, 2025
4bee8ab
v4.24.1-beta.4
acasazza Jun 20, 2025
ead2d4c
Update biome configuration
acasazza Jun 20, 2025
68a125a
v4.24.1
acasazza Jun 20, 2025
554138f
Add new prop `showLoader` in `PaymentMethod` component
acasazza Jun 23, 2025
98cf220
v4.25.0-beta.0
acasazza Jun 23, 2025
e6c7afb
Fix `showLoader` flow
acasazza Jun 24, 2025
310c236
v4.25.0-beta.1
acasazza Jun 24, 2025
83f69ee
Remove unused code
acasazza Jun 25, 2025
6b3abeb
v4.25.0
acasazza Jun 25, 2025
7d7dff7
Fix draft order and showLoader flow
acasazza Jun 26, 2025
6f9c5a2
v4.25.1-beta.0
acasazza Jun 26, 2025
2c7d089
v4.25.1
acasazza Jun 27, 2025
9cd6bb3
Fix post requests when a customer edit an address
acasazza Jul 11, 2025
4ea327a
v4.25.2-beta.0
acasazza Jul 11, 2025
b9d7974
Fix place order with declined transaction by CKO
acasazza Jul 17, 2025
6a03a79
v4.25.2-beta.1
acasazza Jul 17, 2025
e254129
Fix place order with declined transaction by CKO
acasazza Jul 18, 2025
2aefcc7
v4.25.2-beta.2
acasazza Jul 18, 2025
43c6b11
Fix remove customer email
acasazza Jul 23, 2025
8b06607
v4.25.2-beta.3
acasazza Jul 23, 2025
ae17aaa
fix: update shipping, instead of billing address
malessani Jul 23, 2025
f278c33
v4.25.2-beta.4
malessani Jul 23, 2025
4cd5acd
fix: update address only if doesn't belong to a customer address
malessani Jul 23, 2025
4459537
v4.25.2-beta.5
malessani Jul 23, 2025
502a763
v4.25.2
malessani Jul 23, 2025
333a0dd
fix: remove ref.current from dependencies array
malessani Jul 23, 2025
165bec7
v4.25.3-beta.0
malessani Jul 24, 2025
8c7975e
v4.25.3
malessani Jul 24, 2025
72dec02
Fix place order flow with CKO using the auto-capture setting
acasazza Jul 29, 2025
263cc79
v4.25.4-beta.0
acasazza Jul 29, 2025
4940ced
v4.25.4
acasazza Jul 29, 2025
207ec68
Fix duplicate addresses
acasazza Jul 31, 2025
8837fec
v4.25.5-beta.0
acasazza Jul 31, 2025
787abaa
v4.25.5
acasazza Aug 1, 2025
bdd78a0
Fix duplicate save addresses
acasazza Aug 4, 2025
34f838d
v4.25.6-beta.0
acasazza Aug 4, 2025
353836c
v4.25.6
acasazza Aug 5, 2025
391c38b
Fix tax recalculations
acasazza Aug 7, 2025
5ffd652
v4.25.7-beta.0
acasazza Aug 7, 2025
8b2aab4
Fix tax recalculations
acasazza Aug 20, 2025
3a6df79
v4.25.7-beta.1
acasazza Aug 20, 2025
25613b3
Remove delete customer_email
acasazza Aug 20, 2025
9f16843
v4.25.7-beta.2
acasazza Aug 20, 2025
d6f512d
Fix place order behaviour
acasazza Aug 22, 2025
05278fd
v4.25.7-beta.3
acasazza Aug 22, 2025
7e6b3af
Enable save address button even if billing info is required
acasazza Aug 26, 2025
a843f68
v4.25.7-beta.4
acasazza Aug 26, 2025
a2bf248
v4.25.7
acasazza Aug 27, 2025
b38ec07
Update deps
acasazza Aug 29, 2025
23806a7
Fix cko express payment
acasazza Sep 10, 2025
219f174
v4.25.8-beta.0
acasazza Sep 10, 2025
14df169
v4.25.8
acasazza Sep 11, 2025
9ce86a1
feat: enable server side sorting for order list
pfferrari Sep 22, 2025
8bfc71c
v4.26.0
acasazza Sep 24, 2025
94848f2
Fix rebuilt shipments
acasazza Sep 29, 2025
68cc25a
v4.26.1-beta.0
acasazza Sep 29, 2025
7ca6f17
v4.26.1
acasazza Sep 30, 2025
0b6f6d7
feat: enable sorting on order subscriptions
pfferrari Oct 3, 2025
58bc028
v4.27.0
acasazza Oct 3, 2025
d95ed88
chore: avoid unused orders and subscriptions list requests on setup
pfferrari Sep 25, 2025
ad6af09
chore: update default sort of customer payment sources
pfferrari Sep 25, 2025
6ac54d4
Fix save address input behaviour
acasazza Oct 6, 2025
454b546
v4.28.0
acasazza Oct 7, 2025
54afaea
Fix ship to different address toggle
acasazza Oct 20, 2025
7668f12
v4.28.1-beta.0
acasazza Oct 20, 2025
63b0260
Fix ship to different address mode using customer address
acasazza Oct 21, 2025
bbd2190
v4.28.1-beta.1
acasazza Oct 21, 2025
d687d81
Fix shipToDifferentAddress toggle
acasazza Oct 23, 2025
8fd7fd7
v4.28.1-beta.2
acasazza Oct 23, 2025
ae49faa
v4.28.1
acasazza Oct 23, 2025
fb59c58
Fix vulnerabilities
acasazza Oct 24, 2025
fcea4ac
v4.28.2
acasazza Oct 25, 2025
a241e41
fix: refresh order when billing or shipping address is updated
malessani Oct 30, 2025
539c085
v4.28.3
malessani Oct 30, 2025
dca1969
Fix givex flow
acasazza Oct 22, 2025
95ed35c
Fix givex partially authorization flow
acasazza Nov 3, 2025
f3ed879
v4.28.3-beta.0
acasazza Nov 3, 2025
2b21b35
v4.28.4-beta.0
acasazza Nov 4, 2025
07f306b
Fix payment flow using givex card
acasazza Nov 4, 2025
d696275
v4.28.4-beta.1
acasazza Nov 4, 2025
d17dfee
Fix show giftcard into the summary, remove manageAdyenGiftCard prop
acasazza Nov 4, 2025
0bfdde5
v4.28.4
acasazza Nov 4, 2025
28212ef
Unused variable
acasazza Nov 4, 2025
0121d52
v4.28.4
acasazza Nov 4, 2025
118093d
Fix duplicate addresses when pay with Adyen
acasazza Nov 5, 2025
bfe75bb
Fix show givex card details in the summary
acasazza Nov 6, 2025
e88d545
Fix duplicate save address
acasazza Nov 6, 2025
955828e
Fix currencies format
acasazza Nov 11, 2025
e4415e3
v4.28.5-beta.0
acasazza Nov 11, 2025
3734cfc
v4.28.5
acasazza Nov 12, 2025
8b6d149
Fix place unpaid orders when payment source is declined
acasazza Nov 25, 2025
98a43c9
v4.28.6-beta.6
acasazza Nov 25, 2025
b628cab
Fix place order
acasazza Nov 26, 2025
a55635d
v4.28.6-beta.7
acasazza Nov 26, 2025
21c0059
Fix place order button
acasazza Nov 26, 2025
9d022ab
v4.28.6-beta.8
acasazza Nov 26, 2025
ee9bf88
v4.28.6
acasazza Dec 1, 2025
e8e895d
Create new core package
acasazza Apr 16, 2024
3873f38
Add configuration and getPrices function
acasazza Apr 19, 2024
983b4e4
Add getPrices tests, biomejs, and global vitest config
acasazza Feb 6, 2025
79d21d7
Add new documentation folder
acasazza Feb 11, 2025
8c5cdd0
Add new getAccessToken function. Resolve #617
acasazza Mar 27, 2025
93c204f
Fix relative path for vitest
acasazza Apr 1, 2025
374b141
Add updatePrice function, and tests, remove package jwt-decode
acasazza Apr 22, 2025
2cea33a
fix conflicts
acasazza Dec 23, 2025
58a7534
Merge pull request #695 from commercelayer/v5/hooks/usePrices
acasazza Dec 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm build && pnpm test
23 changes: 5 additions & 18 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"editor.formatOnSave": true,
"javascript.format.enable": true,
"eslint.workingDirectories": [
"packages/react-components",
"packages/docs",
],
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"css.validate": false,
"less.validate": false,
"scss.validate": false,
"editor.defaultFormatter": "biomejs.biome",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
}
}
"source.fixAll.biome": "explicit"
},
"biome.configurationPath": "./biome.json"
}
78 changes: 39 additions & 39 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
{
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"includes": ["**"]
},
"formatter": {
"enabled": true,
"indentStyle": "space"
},
"assist": { "actions": { "source": { "organizeImports": "on" } } },
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"noParameterAssign": "error",
"useAsConstAssertion": "error",
"useDefaultParameterLast": "error",
"useEnumInitializers": "error",
"useSelfClosingElements": "error",
"useSingleVarDeclarator": "error",
"noUnusedTemplateLiteral": "error",
"useNumberNamespace": "error",
"noInferrableTypes": "error",
"noUselessElse": "error"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "double",
"semicolons": "asNeeded"
}
}
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"includes": ["**"]
},
"formatter": {
"enabled": true,
"indentStyle": "space"
},
"assist": { "actions": { "source": { "organizeImports": "on" } } },
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"noParameterAssign": "error",
"useAsConstAssertion": "error",
"useDefaultParameterLast": "error",
"useEnumInitializers": "error",
"useSelfClosingElements": "error",
"useSingleVarDeclarator": "error",
"noUnusedTemplateLiteral": "error",
"useNumberNamespace": "error",
"noInferrableTypes": "error",
"noUselessElse": "error"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "double",
"semicolons": "asNeeded"
}
}
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
"dep:minor": "pnpm dep:major -t minor -i"
},
"devDependencies": {
"@biomejs/biome": "^2.2.4",
"@biomejs/biome": "^2.3.8",
"husky": "^9.1.7",
"lerna": "^8.2.3",
"typescript": "^5.9.2"
"lerna": "^9.0.3",
"typescript": "^5.9.3"
},
"pnpm": {
"overrides": {
Expand Down
69 changes: 69 additions & 0 deletions packages/core/extender.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import { test } from "vitest"
import { getAccessToken } from "./src/auth/getAccessToken.js"

const clientId = import.meta.env.VITE_SALES_CHANNEL_CLIENT_ID
const integrationClientId = import.meta.env.VITE_INTEGRATION_CLIENT_ID
const integrationClientSecret = import.meta.env.VITE_INTEGRATION_CLIENT_SECRET
const scope = import.meta.env.VITE_SALES_CHANNEL_SCOPE
const domain = import.meta.env.VITE_DOMAIN
let accessToken: Awaited<ReturnType<typeof getAccessToken>> | undefined

export interface CoreTestInterface {
accessToken: Awaited<ReturnType<typeof getAccessToken>>
config: {
clientId: string
scope?: string
domain: string
}
}

/**
* This test is used to run integration tests with the sales channel client.
*/
export const coreTest = test.extend<CoreTestInterface>({
// biome-ignore lint/correctness/noEmptyPattern: need to object destructure as the first argument
accessToken: async ({}, use) => {
if (accessToken == null) {
accessToken = await getAccessToken({
grantType: "client_credentials",
config: {
clientId,
scope,
domain,
},
})
}
use(accessToken)
accessToken = undefined
},
config: {
clientId,
scope,
domain,
},
})

/**
* This test is used to run integration tests with the integration client.
*/
export const coreIntegrationTest = test.extend<CoreTestInterface>({
// biome-ignore lint/correctness/noEmptyPattern: need to object destructure as the first argument
accessToken: async ({}, use) => {
if (accessToken == null) {
accessToken = await getAccessToken({
grantType: "client_credentials",
config: {
clientId: integrationClientId,
clientSecret: integrationClientSecret,
domain,
},
})
}
use(accessToken)
accessToken = undefined
},
config: {
clientId: integrationClientId,
domain,
},
})
51 changes: 51 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "@commercelayer/core",
"version": "1.0.0",
"description": "Commerce Layer Core",
"type": "module",
"main": "./dist/index.js",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./dist/index.js",
"default": "./dist/index.cjs"
}
},
"keywords": [
"jamstack",
"headless",
"ecommerce",
"api",
"components"
],
"scripts": {
"check-exports": "attw --pack .",
"lint": "biome lint --error-on-warnings ./src && tsc",
"lint:fix": "pnpm biome lint --write ./src",
"test": "pnpm run lint && vitest run --silent",
"test:watch": "vitest",
"coverage": "vitest run --coverage",
"build": "tsup",
"ci": "pnpm build && pnpm check-exports && pnpm lint"
},
"publishConfig": {
"access": "public"
},
"author": {
"name": "Alessandro Casazza",
"email": "alessandro@commercelayer.io"
},
"license": "MIT",
"devDependencies": {
"@arethetypeswrong/cli": "^0.18.2",
"@vitest/coverage-v8": "^4.0.15",
"tsup": "^8.5.1",
"typescript": "^5.9.3",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^4.0.15"
},
"dependencies": {
"@commercelayer/js-auth": "^7.1.0",
"@commercelayer/sdk": "7.4.1"
}
}
40 changes: 40 additions & 0 deletions packages/core/src/auth/getAccessToken.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { authenticate } from "@commercelayer/js-auth"
import { describe, expect, vi } from "vitest"
import { coreTest } from "#extender"
import { getAccessToken } from "./getAccessToken"

vi.mock("@commercelayer/js-auth", () => ({
authenticate: vi.fn(),
}))

describe("getAccessToken", () => {
coreTest(
"should call authenticate with the correct parameters",
async ({ accessToken, config }) => {
const token = accessToken?.accessToken
const grantType = "client_credentials"
const mockToken = { accessToken: token }
// @ts-expect-error No types for this function
authenticate.mockResolvedValue(mockToken)
const result = await getAccessToken({ grantType, config })
await expect(authenticate).toHaveBeenCalledWith(grantType, config)
expect(result).toEqual(mockToken)
expect(result).toHaveProperty("accessToken")
expect(result.accessToken).toBe(mockToken.accessToken)
},
)

coreTest("should throw an error if authenticate fails", async () => {
const grantType = "client_credentials"
const config = {
clientId: "test-client-id",
clientSecret: "test-client-secret",
}
const mockError = new Error("Authentication failed")
// @ts-expect-error No types for this function
authenticate.mockRejectedValue(mockError)
await expect(getAccessToken({ grantType, config })).rejects.toThrow(
"Authentication failed",
)
})
})
20 changes: 20 additions & 0 deletions packages/core/src/auth/getAccessToken.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { authenticate } from "@commercelayer/js-auth"

interface AuthenticateProps {
grantType: Parameters<typeof authenticate>[0]
config: Parameters<typeof authenticate>[1]
}

/**
* Retrieves an access token using the provided grant type and configuration.
*
* @param {AuthenticateProps['grantType']} grantType - The type of grant to use for authentication.
* @param {AuthenticateProps['config']} config - The configuration object for authentication.
* @returns {Promise<ReturnType<typeof authenticate>>} A promise that resolves to the access token.
*/
export async function getAccessToken({
grantType,
config,
}: AuthenticateProps): ReturnType<typeof authenticate> {
return await authenticate(grantType, config)
}
1 change: 1 addition & 0 deletions packages/core/src/auth/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { getAccessToken } from "./getAccessToken"
2 changes: 2 additions & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./auth"
export * from "./prices"
29 changes: 29 additions & 0 deletions packages/core/src/prices/getPrices.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { Price, QueryParamsList } from "@commercelayer/sdk"
import { describe, expect } from "vitest"
import { coreTest } from "#extender"
import { getPrices } from "./getPrices.js"

describe("getPrices", () => {
coreTest("should return a list of prices", async ({ accessToken }) => {
const token = accessToken?.accessToken
const result = await getPrices({ accessToken: token })
expect(result).toBeDefined()
})

coreTest("should return a single price", async ({ accessToken }) => {
const token = accessToken?.accessToken
const params = {
filters: {
sku_code_eq: "DIGITALPRODUCT",
},
} satisfies QueryParamsList<Price>
// Call the getPrices function
const result = await getPrices({ accessToken: token, params })
// Assert the expected result
expect(result).toBeDefined()
expect(result.getRecordCount()).toBe(1)
// Add more assertions based on the expected behavior of the getPrices function
})

// Add more test cases for different scenarios
})
33 changes: 33 additions & 0 deletions packages/core/src/prices/getPrices.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {
type ListResponse,
type Price,
prices,
type QueryParamsList,
type ResourcesConfig,
} from "@commercelayer/sdk"
import { getSdk } from "#sdk"
import type { RequestConfig } from "#types"

interface GetPrices extends RequestConfig {
params?: QueryParamsList<Price>
options?: ResourcesConfig
}

type GetPricesParams = GetPrices

/**
* Get a list of prices
*
* @param {string} accessToken - The access token to use for authentication.
* @param {QueryParamsList<Price>} params - Optional query parameters for the request.
* @param {ResourcesConfig} options - Optional request configuration.
* @returns {Promise<ListResponse<Price>>} - A promise that resolves to a list of price resources.
*/
export async function getPrices({
accessToken,
params,
options,
}: GetPricesParams): Promise<ListResponse<Price>> {
getSdk({ accessToken })
return await prices.list(params, options)
}
4 changes: 4 additions & 0 deletions packages/core/src/prices/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export type { Price } from "@commercelayer/sdk"
export { getPrices } from "./getPrices"
export { retrievePrice } from "./retrievePrice"
export { updatePrice } from "./updatePrice"
Loading
Loading