Skip to content

Commit

Permalink
dev(package) rename api-client to sdk and data-item to data (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
liorMar authored Sep 21, 2023
1 parent c464069 commit 5812dfb
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 36 deletions.
4 changes: 2 additions & 2 deletions app/components/Image/WixMediaImage.tsx
Original file line number Diff line number Diff line change
@@ -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')) {
Expand Down
6 changes: 3 additions & 3 deletions app/hooks/useWixClientServer.ts
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
2 changes: 1 addition & 1 deletion app/news/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
})
Expand Down
2 changes: 1 addition & 1 deletion app/news/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
})
Expand Down
2 changes: 1 addition & 1 deletion app/projects/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
})
Expand Down
2 changes: 1 addition & 1 deletion app/projects/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
})
Expand Down
4 changes: 2 additions & 2 deletions app/team/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
})
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
57 changes: 34 additions & 23 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

1 comment on commit 5812dfb

@vercel
Copy link

@vercel vercel bot commented on 5812dfb Sep 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.