Skip to content
Merged
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
2 changes: 1 addition & 1 deletion application-templates/javascript/event/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion application-templates/javascript/job/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion application-templates/javascript/service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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<UpdateAction>} updateActions The update actions that were made in the process
* @param {Array<CartUpdateAction>} 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) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

/**
Expand Down
2 changes: 1 addition & 1 deletion application-templates/typescript/event/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

/**
Expand Down
2 changes: 1 addition & 1 deletion application-templates/typescript/job/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
/**
Expand Down
2 changes: 1 addition & 1 deletion application-templates/typescript/service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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<UpdateAction>} updateActions The update actions that were made in the process
* @param {Array<CartUpdateAction>} 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<UpdateAction>,
updateActions: Array<CartUpdateAction>,
response: Response
) => {
const responseBody = {} as ResponseInterfaceSuccess;
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -14,7 +14,7 @@ const create = async (resource: Resource) => {
let productId = undefined;

try {
const updateActions: Array<UpdateAction> = [];
const updateActions: Array<CartUpdateAction> = [];

// Deserialize the resource to a CartDraft
const cartDraft = JSON.parse(JSON.stringify(resource));
Expand All @@ -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,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { UpdateAction } from '@commercetools/sdk-client-v2';
import { CartUpdateAction } from '@commercetools/platform-sdk';

export interface ResponseInterfaceSuccess {
actions: Array<UpdateAction>;
actions: Array<CartUpdateAction>;
}

export interface ResponseInterfaceError {
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

/**
Expand Down
Loading