diff --git a/application-templates/javascript/event/package.json b/application-templates/javascript/event/package.json index d4633d2..a6fff02 100644 --- a/application-templates/javascript/event/package.json +++ b/application-templates/javascript/event/package.json @@ -27,7 +27,7 @@ "dependencies": { "@commercetools-backend/loggers": "^21.19.0", "@commercetools/platform-sdk": "^4.1.0", - "@commercetools/sdk-client-v2": "^2.0.1", + "@commercetools/ts-client": "^4.1.0", "body-parser": "^1.20.2", "dotenv": "^16.3.1", "express": "^4.18.2", diff --git a/application-templates/javascript/event/src/client/build.client.js b/application-templates/javascript/event/src/client/build.client.js index 5192980..66f0933 100644 --- a/application-templates/javascript/event/src/client/build.client.js +++ b/application-templates/javascript/event/src/client/build.client.js @@ -1,4 +1,4 @@ -import { ClientBuilder } from '@commercetools/sdk-client-v2'; +import { ClientBuilder } from '@commercetools/ts-client'; import { authMiddlewareOptions } from '../middleware/auth.middleware.js'; import { httpMiddlewareOptions } from '../middleware/http.middleware.js'; import { readConfiguration } from '../utils/config.utils.js'; diff --git a/application-templates/javascript/job/package.json b/application-templates/javascript/job/package.json index 1c989b3..1eb28dc 100644 --- a/application-templates/javascript/job/package.json +++ b/application-templates/javascript/job/package.json @@ -17,7 +17,7 @@ "dependencies": { "@commercetools-backend/loggers": "^21.19.0", "@commercetools/platform-sdk": "^4.1.0", - "@commercetools/sdk-client-v2": "^2.0.2", + "@commercetools/ts-client": "^4.1.0", "dotenv": "^16.3.1", "express": "^4.18.2", "validator": "^13.11.0" diff --git a/application-templates/javascript/job/src/client/build.client.js b/application-templates/javascript/job/src/client/build.client.js index dea5ccc..87f5df7 100644 --- a/application-templates/javascript/job/src/client/build.client.js +++ b/application-templates/javascript/job/src/client/build.client.js @@ -1,4 +1,4 @@ -import { ClientBuilder } from '@commercetools/sdk-client-v2'; +import { ClientBuilder } from '@commercetools/ts-client'; import { createAuthMiddlewareOptions } from '../middleware/auth.middleware.js'; import { createHttpMiddlewareOptions } from '../middleware/http.middleware.js'; import { readConfiguration } from '../utils/config.utils.js'; diff --git a/application-templates/javascript/service/package.json b/application-templates/javascript/service/package.json index 8b1df20..8823b84 100644 --- a/application-templates/javascript/service/package.json +++ b/application-templates/javascript/service/package.json @@ -19,7 +19,7 @@ "dependencies": { "@commercetools-backend/loggers": "^21.19.0", "@commercetools/platform-sdk": "^4.0.0", - "@commercetools/sdk-client-v2": "^2.0.0", + "@commercetools/ts-client": "^4.1.0", "body-parser": "^1.20.2", "dotenv": "^16.3.1", "express": "^4.18.2", diff --git a/application-templates/javascript/service/src/api/success.api.js b/application-templates/javascript/service/src/api/success.api.js index 5e4203e..3f02a2f 100644 --- a/application-templates/javascript/service/src/api/success.api.js +++ b/application-templates/javascript/service/src/api/success.api.js @@ -1,12 +1,12 @@ /** * Send a success response to the client * - * @typedef {import("@commercetools/sdk-client-v2").UpdateAction} UpdateAction + * @typedef {import("@commercetools/platform-sdk").CartUpdateAction} CartUpdateAction * @typedef {import("express").Response} Response * * @param {Response} response Express response * @param {number} statusCode The status code of the operation - * @param {Array} updateActions The update actions that were made in the process + * @param {Array} updateActions The update actions that were made in the process * @returns Success response with 200 status code and the update actions array */ export const apiSuccess = (statusCode, updateActions, response) => { diff --git a/application-templates/javascript/service/src/client/build.client.js b/application-templates/javascript/service/src/client/build.client.js index 815634f..d6ddd67 100644 --- a/application-templates/javascript/service/src/client/build.client.js +++ b/application-templates/javascript/service/src/client/build.client.js @@ -1,6 +1,6 @@ import { readConfiguration } from '../utils/config.utils.js'; import { httpMiddlewareOptions } from '../middleware/http.middleware.js'; -import { ClientBuilder } from '@commercetools/sdk-client-v2'; +import { ClientBuilder } from '@commercetools/ts-client'; import { authMiddlewareOptions } from '../middleware/auth.middleware.js'; /** diff --git a/application-templates/typescript/event/package.json b/application-templates/typescript/event/package.json index 64499eb..e607c44 100644 --- a/application-templates/typescript/event/package.json +++ b/application-templates/typescript/event/package.json @@ -37,7 +37,7 @@ "dependencies": { "@commercetools-backend/loggers": "^21.19.0", "@commercetools/platform-sdk": "^4.1.0", - "@commercetools/sdk-client-v2": "^2.0.1", + "@commercetools/ts-client": "^4.1.0", "body-parser": "^1.20.2", "dotenv": "^16.3.1", "express": "^4.18.2", diff --git a/application-templates/typescript/event/src/client/build.client.ts b/application-templates/typescript/event/src/client/build.client.ts index 04f110a..ea8931c 100644 --- a/application-templates/typescript/event/src/client/build.client.ts +++ b/application-templates/typescript/event/src/client/build.client.ts @@ -1,4 +1,4 @@ -import { ClientBuilder } from '@commercetools/sdk-client-v2'; +import { ClientBuilder } from '@commercetools/ts-client'; import { authMiddlewareOptions } from '../middleware/auth.middleware'; import { httpMiddlewareOptions } from '../middleware/http.middleware'; import { readConfiguration } from '../utils/config.utils'; diff --git a/application-templates/typescript/event/src/middleware/auth.middleware.ts b/application-templates/typescript/event/src/middleware/auth.middleware.ts index b8f031f..ebba5ba 100644 --- a/application-templates/typescript/event/src/middleware/auth.middleware.ts +++ b/application-templates/typescript/event/src/middleware/auth.middleware.ts @@ -1,4 +1,4 @@ -import { type AuthMiddlewareOptions } from '@commercetools/sdk-client-v2'; // Required for auth +import { type AuthMiddlewareOptions } from '@commercetools/ts-client'; // Required for auth import { readConfiguration } from '../utils/config.utils'; /** diff --git a/application-templates/typescript/event/src/middleware/http.middleware.ts b/application-templates/typescript/event/src/middleware/http.middleware.ts index 5a49fdf..c26b947 100644 --- a/application-templates/typescript/event/src/middleware/http.middleware.ts +++ b/application-templates/typescript/event/src/middleware/http.middleware.ts @@ -1,4 +1,4 @@ -import { type HttpMiddlewareOptions } from '@commercetools/sdk-client-v2'; // Required for sending HTTP requests +import { type HttpMiddlewareOptions } from '@commercetools/ts-client'; // Required for sending HTTP requests import { readConfiguration } from '../utils/config.utils'; /** diff --git a/application-templates/typescript/job/package.json b/application-templates/typescript/job/package.json index 96a9290..823c47f 100644 --- a/application-templates/typescript/job/package.json +++ b/application-templates/typescript/job/package.json @@ -19,7 +19,7 @@ "dependencies": { "@commercetools-backend/loggers": "^21.19.0", "@commercetools/platform-sdk": "^4.1.0", - "@commercetools/sdk-client-v2": "^2.0.2", + "@commercetools/ts-client": "^4.1.0", "dotenv": "^16.3.1", "express": "^4.18.2", "validator": "^13.11.0" diff --git a/application-templates/typescript/job/src/client/build.client.ts b/application-templates/typescript/job/src/client/build.client.ts index 0b3f272..af70c81 100644 --- a/application-templates/typescript/job/src/client/build.client.ts +++ b/application-templates/typescript/job/src/client/build.client.ts @@ -1,4 +1,4 @@ -import { ClientBuilder } from '@commercetools/sdk-client-v2'; +import { ClientBuilder } from '@commercetools/ts-client'; import { createAuthMiddlewareOptions } from '../middleware/auth.middleware'; import { createHttpMiddlewareOptions } from '../middleware/http.middleware'; import { readConfiguration } from '../utils/config.utils'; diff --git a/application-templates/typescript/job/src/middleware/auth.middleware.ts b/application-templates/typescript/job/src/middleware/auth.middleware.ts index 3e1900d..4be3f48 100644 --- a/application-templates/typescript/job/src/middleware/auth.middleware.ts +++ b/application-templates/typescript/job/src/middleware/auth.middleware.ts @@ -1,4 +1,4 @@ -import { type AuthMiddlewareOptions } from '@commercetools/sdk-client-v2'; // Required for auth +import { type AuthMiddlewareOptions } from '@commercetools/ts-client'; // Required for auth import { readConfiguration } from '../utils/config.utils'; /** diff --git a/application-templates/typescript/job/src/middleware/http.middleware.ts b/application-templates/typescript/job/src/middleware/http.middleware.ts index 5d849d5..55fb74b 100644 --- a/application-templates/typescript/job/src/middleware/http.middleware.ts +++ b/application-templates/typescript/job/src/middleware/http.middleware.ts @@ -1,4 +1,4 @@ -import { type HttpMiddlewareOptions } from '@commercetools/sdk-client-v2'; // Required for sending HTTP requests +import { type HttpMiddlewareOptions } from '@commercetools/ts-client'; // Required for sending HTTP requests type HttpCreate = (region: string) => HttpMiddlewareOptions; /** diff --git a/application-templates/typescript/service/package.json b/application-templates/typescript/service/package.json index 04e7d10..c38a153 100644 --- a/application-templates/typescript/service/package.json +++ b/application-templates/typescript/service/package.json @@ -38,7 +38,7 @@ "dependencies": { "@commercetools-backend/loggers": "^21.19.0", "@commercetools/platform-sdk": "^4.0.0", - "@commercetools/sdk-client-v2": "^2.0.0", + "@commercetools/ts-client": "^4.1.0", "body-parser": "^1.20.2", "dotenv": "^16.3.1", "express": "^4.18.2", diff --git a/application-templates/typescript/service/src/api/success.api.ts b/application-templates/typescript/service/src/api/success.api.ts index 2946f5b..854ebca 100644 --- a/application-templates/typescript/service/src/api/success.api.ts +++ b/application-templates/typescript/service/src/api/success.api.ts @@ -1,4 +1,4 @@ -import { UpdateAction } from '@commercetools/sdk-client-v2'; +import { CartUpdateAction } from '@commercetools/platform-sdk'; import { Response } from 'express'; import { ResponseInterfaceSuccess } from '../interfaces/response.interface'; @@ -7,12 +7,12 @@ import { ResponseInterfaceSuccess } from '../interfaces/response.interface'; * * @param {Response} response Express response * @param {number} statusCode The status code of the operation - * @param {Array} updateActions The update actions that were made in the process + * @param {Array} CartUpdateAction The update actions that were made in the process * @returns Success response with 200 status code and the update actions array */ export const apiSuccess = ( statusCode: number, - updateActions: Array, + updateActions: Array, response: Response ) => { const responseBody = {} as ResponseInterfaceSuccess; diff --git a/application-templates/typescript/service/src/client/build.client.ts b/application-templates/typescript/service/src/client/build.client.ts index 04f110a..ea8931c 100644 --- a/application-templates/typescript/service/src/client/build.client.ts +++ b/application-templates/typescript/service/src/client/build.client.ts @@ -1,4 +1,4 @@ -import { ClientBuilder } from '@commercetools/sdk-client-v2'; +import { ClientBuilder } from '@commercetools/ts-client'; import { authMiddlewareOptions } from '../middleware/auth.middleware'; import { httpMiddlewareOptions } from '../middleware/http.middleware'; import { readConfiguration } from '../utils/config.utils'; diff --git a/application-templates/typescript/service/src/controllers/cart.controller.ts b/application-templates/typescript/service/src/controllers/cart.controller.ts index d812f1d..d6f6161 100644 --- a/application-templates/typescript/service/src/controllers/cart.controller.ts +++ b/application-templates/typescript/service/src/controllers/cart.controller.ts @@ -1,4 +1,4 @@ -import { UpdateAction } from '@commercetools/sdk-client-v2'; +import { CartUpdateAction } from '@commercetools/platform-sdk'; import { createApiRoot } from '../client/create.client'; import CustomError from '../errors/custom.error'; @@ -14,7 +14,7 @@ const create = async (resource: Resource) => { let productId = undefined; try { - const updateActions: Array = []; + const updateActions: Array = []; // Deserialize the resource to a CartDraft const cartDraft = JSON.parse(JSON.stringify(resource)); @@ -35,7 +35,7 @@ const create = async (resource: Resource) => { } // Create the UpdateActions Object to return it to the client - const updateAction: UpdateAction = { + const updateAction: CartUpdateAction = { action: 'recalculate', updateProductData: false, }; diff --git a/application-templates/typescript/service/src/interfaces/response.interface.ts b/application-templates/typescript/service/src/interfaces/response.interface.ts index 8bcaf4e..6855eda 100644 --- a/application-templates/typescript/service/src/interfaces/response.interface.ts +++ b/application-templates/typescript/service/src/interfaces/response.interface.ts @@ -1,7 +1,7 @@ -import { UpdateAction } from '@commercetools/sdk-client-v2'; +import { CartUpdateAction } from '@commercetools/platform-sdk'; export interface ResponseInterfaceSuccess { - actions: Array; + actions: Array; } export interface ResponseInterfaceError { diff --git a/application-templates/typescript/service/src/middleware/auth.middleware.ts b/application-templates/typescript/service/src/middleware/auth.middleware.ts index d2c3566..7ff4786 100644 --- a/application-templates/typescript/service/src/middleware/auth.middleware.ts +++ b/application-templates/typescript/service/src/middleware/auth.middleware.ts @@ -1,4 +1,4 @@ -import { type AuthMiddlewareOptions } from '@commercetools/sdk-client-v2'; // Required for auth +import { type AuthMiddlewareOptions } from '@commercetools/ts-client'; // Required for auth import { readConfiguration } from '../utils/config.utils'; /** diff --git a/application-templates/typescript/service/src/middleware/http.middleware.ts b/application-templates/typescript/service/src/middleware/http.middleware.ts index 5a49fdf..c26b947 100644 --- a/application-templates/typescript/service/src/middleware/http.middleware.ts +++ b/application-templates/typescript/service/src/middleware/http.middleware.ts @@ -1,4 +1,4 @@ -import { type HttpMiddlewareOptions } from '@commercetools/sdk-client-v2'; // Required for sending HTTP requests +import { type HttpMiddlewareOptions } from '@commercetools/ts-client'; // Required for sending HTTP requests import { readConfiguration } from '../utils/config.utils'; /**