diff --git a/lib/shopware/api.ts b/lib/shopware/api.ts index 82855dd35..39fb9a479 100644 --- a/lib/shopware/api.ts +++ b/lib/shopware/api.ts @@ -1,5 +1,6 @@ -import { createAPIClient } from '@shopware/api-client'; -import { operations, operationPaths } from './api-types/apiTypes-6.5.2.0'; +import { createAPIClient, RequestReturnType, RequestParameters } from '@shopware/api-client'; +//import { operations, operationPaths } from './api-types/apiTypes-6.5.2.0'; +import { operations, operationPaths } from '@shopware/api-client/api-types'; import { ApiSchemas, CategoryListingResultSW, @@ -17,6 +18,20 @@ const apiInstance = createAPIClient({ apiType: 'store-api' }); +export type ExtendedOperations = {}; + +// reimport operations request parameters to use it in application +export type ApiRequestParams = RequestParameters< + ExtendedOperations, + operations +>; + +// reimport operations return types to use it in application +export type ApiReturnType = RequestReturnType< + OPERATION_NAME, + operations +>; + export async function requestNavigation( type: StoreNavigationTypeSW, depth: number diff --git a/lib/shopware/types.ts b/lib/shopware/types.ts index a561ba948..8f0a1ae7a 100644 --- a/lib/shopware/types.ts +++ b/lib/shopware/types.ts @@ -1,4 +1,4 @@ -import { components } from './api-types/apiTypes-6.5.2.0'; +import { components } from '@shopware/api-client/api-types'; /** Shopware Types */ @@ -7,7 +7,11 @@ export type ApiSchemas = components['schemas']; export type StoreNavigationTypeSW = 'main-navigation' | 'footer-navigation' | 'service-navigation'; export type ProductListingCriteria = ApiSchemas['ProductListingCriteria'] & { query: string; -}; +} & Omit & { Criteria: { filter?: { + field: string; + type: string; + value: string | null | boolean; +}[]}}; /** Return Types */ export type CategoryListingResultSW = { diff --git a/package.json b/package.json index 94b4051e3..f749df541 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "eslint-plugin-unicorn": "^47.0.0", "lint-staged": "^13.2.3", "postcss": "^8.4.25", - "prettier": "^3.0", + "prettier": "^2.8.8", "prettier-plugin-tailwindcss": "^0.3.0", "tailwindcss": "^3.3.2", "typescript": "5.1.6" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 80b4929f7..1be262caa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -70,11 +70,11 @@ devDependencies: specifier: ^8.4.25 version: 8.4.25 prettier: - specifier: ^3.0 - version: 3.0.0 + specifier: ^2.8.8 + version: 2.8.8 prettier-plugin-tailwindcss: specifier: ^0.3.0 - version: 0.3.0(prettier@3.0.0) + version: 0.3.0(prettier@2.8.8) tailwindcss: specifier: ^3.3.2 version: 3.3.2 @@ -2744,7 +2744,7 @@ packages: engines: {node: '>= 0.8.0'} dev: true - /prettier-plugin-tailwindcss@0.3.0(prettier@3.0.0): + /prettier-plugin-tailwindcss@0.3.0(prettier@2.8.8): resolution: {integrity: sha512-009/Xqdy7UmkcTBpwlq7jsViDqXAYSOMLDrHAdTMlVZOrKfM2o9Ci7EMWTMZ7SkKBFTG04UM9F9iM2+4i6boDA==} engines: {node: '>=12.17.0'} peerDependencies: @@ -2796,12 +2796,12 @@ packages: prettier-plugin-twig-melody: optional: true dependencies: - prettier: 3.0.0 + prettier: 2.8.8 dev: true - /prettier@3.0.0: - resolution: {integrity: sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==} - engines: {node: '>=14'} + /prettier@2.8.8: + resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} + engines: {node: '>=10.13.0'} hasBin: true dev: true