diff --git a/app/components/Image/WixMediaImage.tsx b/app/components/Image/WixMediaImage.tsx index 6da9e2f..7d95c81 100644 --- a/app/components/Image/WixMediaImage.tsx +++ b/app/components/Image/WixMediaImage.tsx @@ -1,6 +1,6 @@ -import { media as wixMedia } from '@wix/api-client'; +import { media as wixMedia } from '@wix/sdk'; import Image, { ImageProps } from 'next/image'; -import { PLACEHOLDER_IMAGE } from '../../constants'; +import { PLACEHOLDER_IMAGE } from '@app/constants'; function getImageUrlForMedia(media: string, width: number, height: number) { if (media.startsWith('wix:image')) { diff --git a/app/hooks/useWixClientServer.ts b/app/hooks/useWixClientServer.ts index e45d929..bcf4e0e 100644 --- a/app/hooks/useWixClientServer.ts +++ b/app/hooks/useWixClientServer.ts @@ -1,8 +1,8 @@ -import { createClient, OAuthStrategy } from '@wix/api-client'; -import { dataItems } from '@wix/data-items'; +import { createClient, OAuthStrategy } from '@wix/sdk'; +import { items } from '@wix/data'; export const getWixClient = async () => { const wixClient = createClient({ - modules: { dataItems }, + modules: { items }, auth: OAuthStrategy({ clientId: process.env.NEXT_PUBLIC_WIX_CLIENT_ID! }), }); const tokens = await wixClient.auth.generateVisitorTokens(); diff --git a/app/news/[slug]/page.tsx b/app/news/[slug]/page.tsx index 1911bcb..04c0598 100644 --- a/app/news/[slug]/page.tsx +++ b/app/news/[slug]/page.tsx @@ -4,7 +4,7 @@ import testIds from '@app/utils/test-ids'; export default async function New({ params }: any) { const wixClient = await getWixClient(); - const { items } = await wixClient.dataItems + const { items } = await wixClient.items .queryDataItems({ dataCollectionId: 'News', }) diff --git a/app/news/page.tsx b/app/news/page.tsx index 9e1e355..97d2dc0 100644 --- a/app/news/page.tsx +++ b/app/news/page.tsx @@ -4,7 +4,7 @@ import { WixMediaImage } from '@app/components/Image/WixMediaImage'; import testIds from '@app/utils/test-ids'; export default async function News() { const wixClient = await getWixClient(); - const { items } = await wixClient.dataItems + const { items } = await wixClient.items .queryDataItems({ dataCollectionId: 'News', }) diff --git a/app/projects/[slug]/page.tsx b/app/projects/[slug]/page.tsx index 9599561..81ece6c 100644 --- a/app/projects/[slug]/page.tsx +++ b/app/projects/[slug]/page.tsx @@ -4,7 +4,7 @@ import testIds from '@app/utils/test-ids'; export default async function Project({ params }: any) { const wixClient = await getWixClient(); - const { items } = await wixClient.dataItems + const { items } = await wixClient.items .queryDataItems({ dataCollectionId: 'Our-Projects', }) diff --git a/app/projects/page.tsx b/app/projects/page.tsx index fe74651..c249956 100644 --- a/app/projects/page.tsx +++ b/app/projects/page.tsx @@ -3,7 +3,7 @@ import { WixMediaImage } from '@app/components/Image/WixMediaImage'; import testIds from '@app/utils/test-ids'; export default async function Projects() { const wixClient = await getWixClient(); - const { items } = await wixClient.dataItems + const { items } = await wixClient.items .queryDataItems({ dataCollectionId: 'Our-Projects', }) diff --git a/app/team/page.tsx b/app/team/page.tsx index 88090e7..a3f983f 100644 --- a/app/team/page.tsx +++ b/app/team/page.tsx @@ -3,12 +3,12 @@ import { WixMediaImage } from '@app/components/Image/WixMediaImage'; import testIds from '@app/utils/test-ids'; export default async function Team() { const wixClient = await getWixClient(); - const { items: team } = await wixClient.dataItems + const { items: team } = await wixClient.items .queryDataItems({ dataCollectionId: 'Our-Team', }) .find(); - const { items: volunteers } = await wixClient.dataItems + const { items: volunteers } = await wixClient.items .queryDataItems({ dataCollectionId: 'Volunteers', }) diff --git a/package.json b/package.json index 1c637a6..9139855 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ }, "dependencies": { "@netlify/plugin-nextjs": "^4.36.0", - "@wix/api-client": "^1.1.67", - "@wix/data-items": "^1.0.3", + "@wix/data": "^1.0.47", + "@wix/sdk": "^1.5.0", "flowbite": "^1.5.4", "flowbite-react": "^0.4.4", "next": "^13.4.9", diff --git a/yarn.lock b/yarn.lock index 462a1ee..4ebf2f7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -795,31 +795,14 @@ __metadata: languageName: node linkType: hard -"@wix/api-client@npm:^1.1.67": - version: 1.5.0 - resolution: "@wix/api-client@npm:1.5.0" - dependencies: - "@babel/runtime": ^7.22.15 - "@wix/identity": ^1.0.57 - "@wix/image-kit": ^1.37.0 - "@wix/metro-runtime": ^1.1529.0 - "@wix/redirects": ^1.0.24 - "@wix/sdk-types": 1.5.0 - pkce-challenge: ^3.1.0 - querystring: ^0.2.1 - type-fest: ^3.13.1 - checksum: 64b64114dcc55a14c2a2e48bfdbc4d61c83638326f6f5b8f9585a96b0c67a72df91da91746a3f96d60531e5229dfe845b2553d838b8ffad232e4c735af1a3494 - languageName: node - linkType: hard - -"@wix/data-items@npm:^1.0.3": - version: 1.0.4 - resolution: "@wix/data-items@npm:1.0.4" +"@wix/data@npm:^1.0.47": + version: 1.0.47 + resolution: "@wix/data@npm:1.0.47" dependencies: "@wix/metro-runtime": ^1.0.0 "@wix/motion-edm-autogen-query-wrapper": ^1.0.0 "@wix/sdk-types": ^1.0.0 - checksum: 26b1fd31027480a5c67444c5bd78ba70b09ece6cdd70ebb14399f9b75f41300e443b633ffe19f6d0b3b5ce251d439d23f444b68dd9038a8484c10768f035fe8e + checksum: c586259b941b3a2d3954e4e4bf01aa2e05d3992ebcd70e07d172dd0a17824b1f323628558cc622c7fe8ec070d7a8923f936d288358b6d795c8a9865be585c4c5 languageName: node linkType: hard @@ -1072,6 +1055,27 @@ __metadata: languageName: node linkType: hard +"@wix/sdk@npm:^1.5.0": + version: 1.5.0 + resolution: "@wix/sdk@npm:1.5.0" + dependencies: + "@babel/runtime": ^7.22.15 + "@wix/identity": ^1.0.57 + "@wix/image-kit": ^1.37.0 + "@wix/metro-runtime": ^1.1529.0 + "@wix/redirects": ^1.0.24 + "@wix/sdk-types": 1.5.0 + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + pkce-challenge: ^3.1.0 + querystring: ^0.2.1 + type-fest: ^3.13.1 + dependenciesMeta: + graphql: + optional: true + checksum: ecd32f9c5b2a79b4697281b7bda89ef6bff1b5476437107d994c0782257628cced433b74379f515f26e68cc872e099d0b6292bae0d1028b6cfdbd4f140b142a1 + languageName: node + linkType: hard + "abbrev@npm:^1.0.0": version: 1.1.1 resolution: "abbrev@npm:1.1.1" @@ -2963,6 +2967,13 @@ __metadata: languageName: node linkType: hard +"graphql@npm:^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0": + version: 16.8.1 + resolution: "graphql@npm:16.8.1" + checksum: 8d304b7b6f708c8c5cc164b06e92467dfe36aff6d4f2cf31dd19c4c2905a0e7b89edac4b7e225871131fd24e21460836b369de0c06532644d15b461d55b1ccc0 + languageName: node + linkType: hard + "h3@npm:^1.6.4": version: 1.6.5 resolution: "h3@npm:1.6.5" @@ -5985,8 +5996,8 @@ __metadata: "@types/node": 18.11.8 "@types/react": 18.0.24 "@types/react-dom": 18.0.8 - "@wix/api-client": ^1.1.67 - "@wix/data-items": ^1.0.3 + "@wix/data": ^1.0.47 + "@wix/sdk": ^1.5.0 autoprefixer: ^10.4.13 eslint: ^8.28.0 eslint-config-next: ^13.4.9