From 54d01873900c2819c650678e247587f7058cdf6a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 14:29:52 +0100 Subject: [PATCH] ci: release (#7354) Co-authored-by: github-actions[bot] --- .changeset/great-moose-rhyme.md | 22 ------------- .../3.middleware/3.api/middleware.api.json | 2 +- .../3.middleware/4.reference/change-log.md | 31 ++++++++++++++----- .../4.reference/multistore/change-log.md | 4 +-- packages/middleware/CHANGELOG.md | 23 ++++++++++++++ packages/middleware/package.json | 2 +- packages/sdk/package.json | 2 +- 7 files changed, 52 insertions(+), 34 deletions(-) delete mode 100644 .changeset/great-moose-rhyme.md diff --git a/.changeset/great-moose-rhyme.md b/.changeset/great-moose-rhyme.md deleted file mode 100644 index 4af0e97ff6..0000000000 --- a/.changeset/great-moose-rhyme.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -"@vue-storefront/middleware": minor ---- - -**[ADDED]** `defaultErrorHandler` is now exported from the package. Example usage: - -```ts -import type { Integration } from "@vue-storefront/middleware"; -import type { MiddlewareConfig } from "@vsf-enterprise/sapcc-api"; -import { defaultErrorHandler } from "@vue-storefront/middleware"; - -export const config = { - integrations: { - commerce: { - errorHandler: (error, req, res) => { - // Perform custom actions before delegating to the default error handler - defaultErrorHandler(error, req, res); - } - } satisfies Integration, - }, -}; -``` \ No newline at end of file diff --git a/docs/content/3.middleware/3.api/middleware.api.json b/docs/content/3.middleware/3.api/middleware.api.json index d64a8b272f..9126ea19db 100644 --- a/docs/content/3.middleware/3.api/middleware.api.json +++ b/docs/content/3.middleware/3.api/middleware.api.json @@ -5152,7 +5152,7 @@ { "kind": "PropertySignature", "canonicalReference": "@vue-storefront/middleware!Integration#errorHandler:member", - "docComment": "", + "docComment": "/**\n * Custom error handler for middleware.\n *\n * This function is invoked whenever an error occurs during middleware execution. Alokai provides a default error handler, which will be used if this property is not set.\n *\n * @param error - The error object or value that triggered the handler.\n *\n * @param req - The HTTP request object associated with the error.\n *\n * @param res - The HTTP response object for sending a response.\n *\n * @example\n * ```ts\n * {\n * errorHandler: (error, req, res) => {\n * if (typeof error === \"object\" && error !== null && \"message\" in error) {\n * res.status(500).send({ message: (error as any).message });\n * } else {\n * res.status(500).send({ message: \"An unknown error occurred\" });\n * }\n * }\n * }\n * ```\n *\n * @example\n *\n * Using the default error handler with custom behavior\n * ```ts\n * import { defaultErrorHandler } from \"@vue-storefront/middleware\";\n *\n * {\n * errorHandler: (error, req, res) => {\n * // Perform custom actions before delegating to the default error handler\n * defaultErrorHandler(error, req, res);\n * }\n * };\n * ```\n *\n */\n", "excerptTokens": [ { "kind": "Content", diff --git a/docs/content/3.middleware/4.reference/change-log.md b/docs/content/3.middleware/4.reference/change-log.md index e3cb572acf..9425485924 100644 --- a/docs/content/3.middleware/4.reference/change-log.md +++ b/docs/content/3.middleware/4.reference/change-log.md @@ -1,5 +1,28 @@ # Change log +## 5.3.0 + +### Minor Changes + +**[ADDED]** `defaultErrorHandler` is now exported from the package. Example usage: + +```ts +import type { Integration } from "@vue-storefront/middleware"; +import type { MiddlewareConfig } from "@vsf-enterprise/sapcc-api"; +import { defaultErrorHandler } from "@vue-storefront/middleware"; + +export const config = { + integrations: { + commerce: { + errorHandler: (error, req, res) => { + // Perform custom actions before delegating to the default error handler + defaultErrorHandler(error, req, res); + }, + } satisfies Integration, + }, +}; +``` + ## 5.2.0 ### Minor Changes @@ -46,7 +69,7 @@ Please, read the [Getting Started guide](https://docs.alokai.com/middleware/guid ### Patch Changes -- **[FIXED]** Now parameters are properly sanitized and validated before being used in the middleware. +- **[FIXED]** a potential XSS (Cross-Site Scripting) vulnerability in the middleware. Now, each parameter is properly sanitized and validated before being used in the middleware. ## 5.0.0 @@ -170,12 +193,6 @@ const { createApiClient } = apiClientFactory({ export { createApiClient }; ``` -- **[CHANGED]** - Middleware `getApiClient` is now an asynchronous function. Please, read the [data federation](https://docs.alokai.com/middleware/guides/federation#using-getapiclient-method-to-access-different-api-client) guide to get more information. - -:::warning -This change may introduce breaking changes in some projects. Please ensure to update your project accordingly if necessary. -::: - ## 4.0.1 ### Patch Changes diff --git a/docs/content/3.middleware/4.reference/multistore/change-log.md b/docs/content/3.middleware/4.reference/multistore/change-log.md index 60fe9a2150..3dfbfb5399 100644 --- a/docs/content/3.middleware/4.reference/multistore/change-log.md +++ b/docs/content/3.middleware/4.reference/multistore/change-log.md @@ -5,14 +5,14 @@ ### Patch Changes - Updated dependencies: - - @vue-storefront/middleware@5.1.0 - Please refer to the [middleware changelog](https://docs.alokai.com/middleware/reference/change-log#_510) for more details. + - @vue-storefront/middleware@5.1.0 ## 4.1.1 ### Patch Changes - Updated dependencies: - - @vue-storefront/middleware@5.0.0 - Please refer to the [middleware changelog](https://docs.alokai.com/middleware/reference/change-log#_500) for more details. + - @vue-storefront/middleware@5.0.0 ## 4.1.0 diff --git a/packages/middleware/CHANGELOG.md b/packages/middleware/CHANGELOG.md index 1686c377c8..9425485924 100644 --- a/packages/middleware/CHANGELOG.md +++ b/packages/middleware/CHANGELOG.md @@ -1,5 +1,28 @@ # Change log +## 5.3.0 + +### Minor Changes + +**[ADDED]** `defaultErrorHandler` is now exported from the package. Example usage: + +```ts +import type { Integration } from "@vue-storefront/middleware"; +import type { MiddlewareConfig } from "@vsf-enterprise/sapcc-api"; +import { defaultErrorHandler } from "@vue-storefront/middleware"; + +export const config = { + integrations: { + commerce: { + errorHandler: (error, req, res) => { + // Perform custom actions before delegating to the default error handler + defaultErrorHandler(error, req, res); + }, + } satisfies Integration, + }, +}; +``` + ## 5.2.0 ### Minor Changes diff --git a/packages/middleware/package.json b/packages/middleware/package.json index 11aebfb102..f3cd783023 100644 --- a/packages/middleware/package.json +++ b/packages/middleware/package.json @@ -1,6 +1,6 @@ { "name": "@vue-storefront/middleware", - "version": "5.2.0", + "version": "5.3.0", "main": "lib/index.cjs.js", "module": "lib/index.es.js", "types": "lib/index.d.ts", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index d8455f7699..c8036f7909 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -25,7 +25,7 @@ "devDependencies": { "@types/jest": "^29.0.3", "@types/node": "^18.11.17", - "@vue-storefront/middleware": "5.2.0", + "@vue-storefront/middleware": "5.3.0", "axios": "^1.6.7", "babel-preset-node": "^5.1.1", "isomorphic-fetch": "^3.0.0",