Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"packages/*"
],
"devDependencies": {
"@biomejs/biome": "^2.4.12",
"@biomejs/biome": "^2.5.2",
"husky": "^9.1.7",
"lerna": "^9.0.7",
"lint-staged": "^16.4.0"
Expand Down
33 changes: 16 additions & 17 deletions packages/app-elements/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
"generate:schema.price_rules": "curl -s https://core.commercelayer.io/api/public/schemas/price_rules | pnpx json-schema-to-typescript > ./src/ui/forms/RuleEngine/schema.price_rules.ts"
},
"dependencies": {
"@commercelayer/js-auth": "^7.4.1",
"@commercelayer/sdk": "^6.57.0",
"@date-fns/tz": "^1.4.1",
"@commercelayer/js-auth": "^7.4.2",
"@commercelayer/sdk": "v8.0.0-beta.8",
"@date-fns/tz": "^1.5.0",
"@monaco-editor/react": "~4.7.0",
"@types/lodash-es": "^4.17.12",
"@types/react": "19.2.13",
Expand All @@ -58,12 +58,12 @@
"classnames": "^2.5.1",
"i18next": "^25.10.10",
"i18next-resources-to-backend": "^1.2.1",
"js-cookie": "^3.0.5",
"js-cookie": "^3.0.8",
"jwt-decode": "^4.0.0",
"lodash-es": "^4.18.1",
"monaco-editor": "~0.53.0",
"pluralize": "^8.0.0",
"query-string": "^9.3.1",
"query-string": "^9.4.1",
"react": "19.2.4",
"react-currency-input-field": "^3.10.0",
"react-datepicker": "^8.10.0",
Expand All @@ -73,39 +73,38 @@
"react-select": "^5.10.2",
"react-toastify": "^11.1.0",
"react-tooltip": "^5.30.1",
"swr": "^2.4.1",
"swr": "^2.4.2",
"ts-invariant": "^0.10.3",
"type-fest": "^5.6.0",
"type-fest": "^5.7.0",
"zod": "^3.25.76"
},
"devDependencies": {
"@hookform/resolvers": "^3.10.0",
"@phosphor-icons/react": "^2.1.10",
"@tailwindcss/forms": "^0.5.11",
"@tailwindcss/postcss": "^4.2.2",
"@tailwindcss/postcss": "^4.3.2",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@types/js-cookie": "^3.0.6",
"@types/node": "^22.19.17",
"@types/node": "^22.20.0",
"@types/pluralize": "^0.0.33",
"@types/react-gtm-module": "^2.0.4",
"@vitejs/plugin-react": "^5.2.0",
"cross-fetch": "^4.1.0",
"date-fns": "^4.1.0",
"date-fns": "^4.4.0",
"date-fns-tz": "^3.2.0",
"jsdom": "^27.4.0",
"msw": "^2.14.5",
"postcss": "^8.5.10",
"msw": "^2.14.6",
"postcss": "^8.5.16",
"react-gtm-module": "^2.0.11",
"tailwindcss": "^4.2.2",
"tailwindcss": "^4.3.2",
"typescript": "^5.9.3",
"vite": "^7.3.2",
"vite": "^7.3.6",
"vite-plugin-dts": "^4.5.4",
"vitest": "^3.2.4",
"wouter": "^3.9.0"
"vitest": "^3.2.6",
"wouter": "^3.10.0"
},
"peerDependencies": {
"@commercelayer/sdk": "^6.x",
"query-string": "^9.x",
"react": "^19.1.x",
"react-dom": "^19.1.x",
Expand Down
8 changes: 6 additions & 2 deletions packages/app-elements/src/helpers/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const singularLowercase: Record<ListableResourceType, string> = {
axerve_gateways: "axerve gateway",
axerve_payments: "axerve payment",
bing_geocoders: "bing geocoder",
billing_info_validation_rules: "billing info validation rule",
braintree_gateways: "braintree gateway",
braintree_payments: "braintree payment",
bundles: "bundle",
Expand Down Expand Up @@ -75,6 +76,7 @@ const singularLowercase: Record<ListableResourceType, string> = {
order_factories: "order factory",
order_subscription_items: "order subscription item",
order_subscriptions: "order subscription",
order_validation_rules: "order validation rule",
orders: "order",
packages: "package",
parcel_line_items: "parcel line item",
Expand Down Expand Up @@ -102,6 +104,7 @@ const singularLowercase: Record<ListableResourceType, string> = {
returns: "return",
satispay_gateways: "satispay gateway",
satispay_payments: "satispay payment",
shipment_line_items: "shipment line item",
shipments: "shipment",
shipping_categories: "shipping category",
shipping_method_tiers: "shipping method tier",
Expand Down Expand Up @@ -130,7 +133,6 @@ const singularLowercase: Record<ListableResourceType, string> = {
tax_rules: "tax rule",
taxjar_accounts: "taxjar account",
transactions: "transaction",
versions: "version",
vertex_accounts: "vertex account",
voids: "void",
webhooks: "webhook",
Expand All @@ -142,6 +144,7 @@ const pluralLowercase: Record<ListableResourceType, string> = {
adjustments: "adjustments",
adyen_gateways: "adyen gateways",
adyen_payments: "adyen payments",
billing_info_validation_rules: "billing info validation rules",
attachments: "attachments",
authorizations: "authorizations",
avalara_accounts: "avalara accounts",
Expand Down Expand Up @@ -208,6 +211,7 @@ const pluralLowercase: Record<ListableResourceType, string> = {
order_factories: "order factories",
order_subscription_items: "order subscription items",
order_subscriptions: "order subscriptions",
order_validation_rules: "order validation rules",
orders: "orders",
packages: "packages",
parcel_line_items: "parcel line items",
Expand Down Expand Up @@ -235,6 +239,7 @@ const pluralLowercase: Record<ListableResourceType, string> = {
returns: "returns",
satispay_gateways: "satispay gateways",
satispay_payments: "satispay payments",
shipment_line_items: "shipment line items",
shipments: "shipments",
shipping_categories: "shipping categories",
shipping_method_tiers: "shipping method tiers",
Expand Down Expand Up @@ -263,7 +268,6 @@ const pluralLowercase: Record<ListableResourceType, string> = {
tax_rules: "tax rules",
taxjar_accounts: "taxjar accounts",
transactions: "transactions",
versions: "versions",
vertex_accounts: "vertex accounts",
voids: "voids",
webhooks: "webhooks",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CommerceLayerClient } from "@commercelayer/sdk"
import type { CommerceLayerBundle } from "@commercelayer/sdk"
import {
createContext,
type JSX,
Expand All @@ -15,7 +15,7 @@ interface CoreSdkProviderValue {
/**
* Valid SDK client
*/
sdkClient: CommerceLayerClient
sdkClient: CommerceLayerBundle
}

interface CoreSdkProviderProps {
Expand All @@ -42,7 +42,7 @@ export function CoreSdkProvider({
settings: { accessToken, domain, organizationSlug },
} = useTokenProvider()

const [sdkClient, setSdkClient] = useState<CommerceLayerClient | undefined>(
const [sdkClient, setSdkClient] = useState<CommerceLayerBundle | undefined>(
undefined,
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import CommerceLayer, {
type CommerceLayerClient,
type ErrorObj,
} from "@commercelayer/sdk"
import type { ErrorObj } from "@commercelayer/sdk"
import { CommerceLayer, type CommerceLayerBundle } from "@commercelayer/sdk"
import isEmpty from "lodash-es/isEmpty"

interface ApiReasonError {
Expand All @@ -28,7 +26,7 @@ export function makeSdkClient({
organization: string
domain?: string
onInvalidToken: () => void
}): CommerceLayerClient {
}): CommerceLayerBundle {
const client = CommerceLayer({
accessToken,
organization,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CommerceLayerClient } from "@commercelayer/sdk"
import type { CommerceLayerBundle } from "@commercelayer/sdk"
import { useCallback } from "react"
import useSWR, {
type Fetcher,
Expand Down Expand Up @@ -44,8 +44,8 @@ type MethodKeys<T> = {
*/
export function useCoreApi<
Resource extends ResourceEndpoint,
Action extends MethodKeys<CommerceLayerClient[Resource]>,
Method extends ForceToBeMethod<CommerceLayerClient[Resource][Action]>,
Action extends MethodKeys<CommerceLayerBundle[Resource]>,
Method extends ForceToBeMethod<CommerceLayerBundle[Resource][Action]>,
Args extends Parameters<Method>,
Output extends Awaited<ReturnType<Method>>,
SWROptions extends SWRConfiguration<Output, any, Fetcher<Output>>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {
CommerceLayerClient,
CommerceLayerBundle,
ListableResourceType,
} from "@commercelayer/sdk"
import { useState } from "react"
Expand Down Expand Up @@ -55,7 +55,7 @@ export function computeLabelWithSelected({
}

type Resource = Awaited<
ReturnType<CommerceLayerClient[ListableResourceType]["list"]>
ReturnType<CommerceLayerBundle[ListableResourceType]["list"]>
>[number]

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Address } from "@commercelayer/sdk"
import { zodResolver } from "@hookform/resolvers/zod"
import { useState } from "react"
import { useForm } from "react-hook-form"
Expand Down Expand Up @@ -32,7 +33,7 @@ export const ResourceAddressForm =
onUpdate,
onCreate,
}) => {
const methods = useForm({
const methods = useForm<Omit<Address, "geocoder">>({
defaultValues: address ?? undefined,
resolver: zodResolver(
getResourceAddressFormFieldsSchema({ requiresBillingInfo }),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {
CommerceLayerClient,
CommerceLayerBundle,
ListResponse,
PriceList,
} from "@commercelayer/sdk"
Expand Down Expand Up @@ -74,7 +74,7 @@ interface FullList {
async function fetchAllCurrencies({
sdkClient,
}: {
sdkClient: CommerceLayerClient
sdkClient: CommerceLayerBundle
}): Promise<InputCurrencyRangeProps["currencyList"]> {
const allCurrencies: FullList = {
currencies: [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {
CommerceLayerClient,
CommerceLayerBundle,
ListableResourceType,
QueryParamsList,
ResourceFields,
Expand All @@ -12,7 +12,7 @@ import {
} from "./metricsApiClient"

type ListResource<TResource extends ListableResourceType> = Awaited<
ReturnType<CommerceLayerClient[TResource]["list"]>
ReturnType<CommerceLayerBundle[TResource]["list"]>
>

export type Resource<TResource extends ListableResourceType> =
Expand Down Expand Up @@ -44,7 +44,7 @@ export async function listFetcher<TResource extends ListableResourceType>({
pageNumber?: number
} & (
| {
client: CommerceLayerClient
client: CommerceLayerBundle
clientType: "coreSdkClient"
query?: Omit<QueryParamsList<ResourceFields[TResource]>, "pageNumber">
}
Expand Down
20 changes: 10 additions & 10 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
"node": ">=22.22"
},
"dependencies": {
"prettier": "^3.8.3",
"prettier": "^3.9.4",
"react": "19.2.4",
"react-dom": "19.2.4"
},
"devDependencies": {
"@babel/core": "^7.29.0",
"@babel/preset-env": "^7.29.2",
"@babel/core": "^7.29.7",
"@babel/preset-env": "^7.29.7",
"@hookform/resolvers": "^3.10.0",
"@mdx-js/react": "^3.1.1",
"@storybook/addon-docs": "^9.1.20",
Expand All @@ -32,23 +32,23 @@
"@storybook/icons": "^1.6.0",
"@storybook/react-vite": "^9.1.20",
"@tailwindcss/forms": "^0.5.11",
"@tailwindcss/postcss": "^4.2.2",
"@tailwindcss/postcss": "^4.3.2",
"@types/js-yaml": "^4.0.9",
"@types/node": "^22.19.17",
"@types/node": "^22.20.0",
"@types/react": "19.2.13",
"@types/react-dom": "19.2.3",
"@vitejs/plugin-react": "^5.2.0",
"babel-loader": "^10.1.1",
"date-fns": "^4.1.0",
"js-yaml": "^4.1.1",
"msw": "^2.14.5",
"date-fns": "^4.4.0",
"js-yaml": "^4.3.0",
"msw": "^2.14.6",
"react-hook-form": "7.62.0",
"react-select": "^5.10.2",
"remark-gfm": "^4.0.1",
"storybook": "^9.1.20",
"tailwindcss": "^4.2.2",
"tailwindcss": "^4.3.2",
"typescript": "^5.9.3",
"vite": "^7.3.2",
"vite": "^7.3.6",
"vite-tsconfig-paths": "^5.1.4",
"zod": "^3.25.76"
},
Expand Down
8 changes: 0 additions & 8 deletions packages/docs/src/mocks/data/adjustments.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,6 @@ const adjustment = {
reference_origin: "app-orders--manual-adjustment",
metadata: {},
},
relationships: {
versions: {
links: {
self: "https://mock.localhost/api/adjustments/QWOaGhpKbd/relationships/versions",
related: "https://mock.localhost/api/adjustments/QWOaGhpKbd/versions",
},
},
},
meta: {
mode: "test",
organization_id: "WXlEOFrjnr",
Expand Down
9 changes: 0 additions & 9 deletions packages/docs/src/mocks/data/line_items.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,6 @@ const restGet = http.get(
reference_origin: "app-orders--manual-adjustment",
metadata: {},
},
relationships: {
versions: {
links: {
self: "https://mock.localhost/api/adjustments/QWOaGhpKbd/relationships/versions",
related:
"https://mock.localhost/api/adjustments/QWOaGhpKbd/versions",
},
},
},
meta: {
mode: "test",
organization_id: "WXlEOFrjnr",
Expand Down
Loading
Loading