Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: TS SDK migration to client v3 #327

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"@commercetools/sdk-client": "^2.1.1",
"@commercetools/ts-client": "latest",
"@commercetools/sdk-middleware-auth": "^6.0.0",
"@commercetools/sdk-middleware-http": "^6.0.0",
"joi": "^14.3.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createAuthMiddlewareForClientCredentialsFlow } from "@commercetools/sdk-middleware-auth"
import { createHttpMiddleware } from "@commercetools/sdk-middleware-http"
import { createClient } from "@commercetools/sdk-client"
import { ClientBuilder } from "@commercetools/ts-client"

import fetch from "node-fetch"
import { createApiBuilderFromCtpClient } from "./ctp/ctp-client"
Expand All @@ -17,12 +17,12 @@ const authMiddleware = createAuthMiddlewareForClientCredentialsFlow({

},
scopes: [`manage_project:${projectKey}`],
fetch
httpClient: fetch,
})

const httpMiddleware = createHttpMiddleware({
host: "https://api.sphere.io",
fetch
httpClient: fetch,
})

const ctpClient = createClient({
Expand Down
Loading