From 45695ef2d57cd2dc47fe8ac13aabecf2a0c924b6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 May 2022 08:57:32 +0100 Subject: [PATCH] Update dependency @tryghost/mw-error-handler to v0.2.4 (#14677) - Updated accept-version error message copy Co-authored-by: Renovate Bot Co-authored-by: Hannah Wolfe --- package.json | 2 +- .../shared/__snapshots__/version.test.js.snap | 48 +++++++++---------- test/e2e-api/shared/version.test.js | 12 ++--- yarn.lock | 8 ++-- 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index a4968b8822..177824e3e2 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "@tryghost/metrics": "1.0.11", "@tryghost/minifier": "0.1.13", "@tryghost/mw-api-version-mismatch": "0.1.1", - "@tryghost/mw-error-handler": "0.2.2", + "@tryghost/mw-error-handler": "0.2.4", "@tryghost/mw-session-from-token": "0.1.30", "@tryghost/nodemailer": "0.3.22", "@tryghost/nql": "0.9.2", diff --git a/test/e2e-api/shared/__snapshots__/version.test.js.snap b/test/e2e-api/shared/__snapshots__/version.test.js.snap index f71f2a33fa..579d452807 100644 --- a/test/e2e-api/shared/__snapshots__/version.test.js.snap +++ b/test/e2e-api/shared/__snapshots__/version.test.js.snap @@ -165,11 +165,11 @@ Object { "errors": Array [ Object { "code": "UPDATE_GHOST", - "context": StringMatching /Provided client version v99\\\\\\.0 is ahead of current Ghost instance version v\\\\d\\+\\\\\\.\\\\d\\+/, + "context": StringMatching /Provided client accept-version v99\\\\\\.0 is ahead of current Ghost version v\\\\d\\+\\\\\\.\\\\d\\+/, "details": null, - "help": "Upgrade your Ghost instance.", + "help": "Try upgrading your Ghost install.", "id": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - "message": "Request not acceptable for provided Accept-Version header.", + "message": "Request could not be served, the endpoint was not found.", "property": null, "type": "RequestNotAcceptableError", }, @@ -180,7 +180,7 @@ Object { exports[`API Versioning Admin API responds with 406 for an unknown version with accept-version set ahead 2: [headers] 1`] = ` Object { "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "347", + "content-length": "348", "content-type": "application/json; charset=utf-8", "content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, @@ -194,11 +194,11 @@ Object { "errors": Array [ Object { "code": "UPDATE_CLIENT", - "context": StringMatching /Provided client version v1\\\\\\.0 is outdated and is behind current Ghost version v\\\\d\\+\\\\\\.\\\\d\\+/, + "context": StringMatching /Provided client accept-version v1\\\\\\.0 is behind current Ghost version v\\\\d\\+\\\\\\.\\\\d\\+/, "details": null, - "help": "Upgrade your Ghost API client.", + "help": "Try upgrading your Ghost API client.", "id": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - "message": "Request not acceptable for provided Accept-Version header.", + "message": "Request could not be served, the endpoint was not found.", "property": null, "type": "RequestNotAcceptableError", }, @@ -209,7 +209,7 @@ Object { exports[`API Versioning Admin API responds with 406 for an unknown version with accept-version set behind 2: [headers] 1`] = ` Object { "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "354", + "content-length": "349", "content-type": "application/json; charset=utf-8", "content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, @@ -277,11 +277,11 @@ Object { "errors": Array [ Object { "code": "UPDATE_CLIENT", - "context": StringMatching /Provided client version v3\\.5 is outdated and is behind current Ghost version v\\\\d\\+\\\\\\.\\\\d\\+/, + "context": StringMatching /Provided client accept-version v3\\.5 is behind current Ghost version v\\\\d\\+\\\\\\.\\\\d\\+/, "details": null, - "help": "Upgrade your Ghost API client.", + "help": "Try upgrading your Ghost API client.", "id": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - "message": "Request not acceptable for provided Accept-Version header.", + "message": "Request could not be served, the endpoint was not found.", "property": null, "type": "RequestNotAcceptableError", }, @@ -293,7 +293,7 @@ exports[`API Versioning Admin API responds with error and sends email ONCE when Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "354", + "content-length": "349", "content-type": "application/json; charset=utf-8", "content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, @@ -307,11 +307,11 @@ Object { "errors": Array [ Object { "code": "UPDATE_CLIENT", - "context": StringMatching /Provided client version v3\\.5 is outdated and is behind current Ghost version v\\\\d\\+\\\\\\.\\\\d\\+/, + "context": StringMatching /Provided client accept-version v3\\.5 is behind current Ghost version v\\\\d\\+\\\\\\.\\\\d\\+/, "details": null, - "help": "Upgrade your Ghost API client.", + "help": "Try upgrading your Ghost API client.", "id": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - "message": "Request not acceptable for provided Accept-Version header.", + "message": "Request could not be served, the endpoint was not found.", "property": null, "type": "RequestNotAcceptableError", }, @@ -323,7 +323,7 @@ exports[`API Versioning Admin API responds with error and sends email ONCE when Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "354", + "content-length": "349", "content-type": "application/json; charset=utf-8", "content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, @@ -337,11 +337,11 @@ Object { "errors": Array [ Object { "code": "UPDATE_GHOST", - "context": StringMatching /Provided client version v999\\\\\\.1 is ahead of current Ghost instance version v\\\\d\\+\\\\\\.\\\\d\\+/, + "context": StringMatching /Provided client accept-version v999\\\\\\.1 is ahead of current Ghost version v\\\\d\\+\\\\\\.\\\\d\\+/, "details": null, - "help": "Upgrade your Ghost instance.", + "help": "Try upgrading your Ghost install.", "id": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - "message": "Request not acceptable for provided Accept-Version header.", + "message": "Request could not be served, the endpoint was not found.", "property": null, "type": "RequestNotAcceptableError", }, @@ -353,7 +353,7 @@ exports[`API Versioning Admin API responds with error requested version is AHEAD Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "348", + "content-length": "349", "content-type": "application/json; charset=utf-8", "content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, @@ -367,11 +367,11 @@ Object { "errors": Array [ Object { "code": "UPDATE_CLIENT", - "context": StringMatching /Provided client version v3\\.1 is outdated and is behind current Ghost version v\\\\d\\+\\\\\\.\\\\d\\+/, + "context": StringMatching /Provided client accept-version v3\\.1 is behind current Ghost version v\\\\d\\+\\\\\\.\\\\d\\+/, "details": null, - "help": "Upgrade your Ghost API client.", + "help": "Try upgrading your Ghost API client.", "id": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/, - "message": "Request not acceptable for provided Accept-Version header.", + "message": "Request could not be served, the endpoint was not found.", "property": null, "type": "RequestNotAcceptableError", }, @@ -383,7 +383,7 @@ exports[`API Versioning Admin API responds with error when requested version is Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "354", + "content-length": "349", "content-type": "application/json; charset=utf-8", "content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/, diff --git a/test/e2e-api/shared/version.test.js b/test/e2e-api/shared/version.test.js index a1ec1ce23d..d321470a34 100644 --- a/test/e2e-api/shared/version.test.js +++ b/test/e2e-api/shared/version.test.js @@ -93,7 +93,7 @@ describe('API Versioning', function () { }) .matchBodySnapshot({ errors: [{ - context: stringMatching(/Provided client version v999\.1 is ahead of current Ghost instance version v\d+\.\d+/), + context: stringMatching(/Provided client accept-version v999\.1 is ahead of current Ghost version v\d+\.\d+/), id: anyErrorId }] }); @@ -112,7 +112,7 @@ describe('API Versioning', function () { }) .matchBodySnapshot({ errors: [{ - context: stringMatching(/Provided client version v3.1 is outdated and is behind current Ghost version v\d+\.\d+/), + context: stringMatching(/Provided client accept-version v3.1 is behind current Ghost version v\d+\.\d+/), id: anyErrorId }] }); @@ -136,7 +136,7 @@ describe('API Versioning', function () { }) .matchBodySnapshot({ errors: [{ - context: stringMatching(/Provided client version v3.5 is outdated and is behind current Ghost version v\d+\.\d+/), + context: stringMatching(/Provided client accept-version v3.5 is behind current Ghost version v\d+\.\d+/), id: anyErrorId }] }); @@ -158,7 +158,7 @@ describe('API Versioning', function () { }) .matchBodySnapshot({ errors: [{ - context: stringMatching(/Provided client version v3.5 is outdated and is behind current Ghost version v\d+\.\d+/), + context: stringMatching(/Provided client accept-version v3.5 is behind current Ghost version v\d+\.\d+/), id: anyErrorId }] }); @@ -226,7 +226,7 @@ describe('API Versioning', function () { 'content-version': stringMatching(/v\d+\.\d+/) }) .matchBodySnapshot({errors: [{ - context: stringMatching(/Provided client version v99\.0 is ahead of current Ghost instance version v\d+\.\d+/), + context: stringMatching(/Provided client accept-version v99\.0 is ahead of current Ghost version v\d+\.\d+/), id: anyErrorId }]}); }); @@ -241,7 +241,7 @@ describe('API Versioning', function () { 'content-version': stringMatching(/v\d+\.\d+/) }) .matchBodySnapshot({errors: [{ - context: stringMatching(/Provided client version v1\.0 is outdated and is behind current Ghost version v\d+\.\d+/), + context: stringMatching(/Provided client accept-version v1\.0 is behind current Ghost version v\d+\.\d+/), id: anyErrorId }]}); }); diff --git a/yarn.lock b/yarn.lock index 02a6864c57..5bccc06eef 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2301,10 +2301,10 @@ resolved "https://registry.yarnpkg.com/@tryghost/mw-api-version-mismatch/-/mw-api-version-mismatch-0.1.1.tgz#913c8941ebe274eac4c3ac872fbe6268534f0003" integrity sha512-N1H3P/ua7MCJTQrhFd6RjBFL95pjB+y3Ih1ZyKToBzicU3RShLUsgVlBC7YNaJVGFG/RYCImzlm09QCV8qwgpg== -"@tryghost/mw-error-handler@0.2.2": - version "0.2.2" - resolved "https://registry.yarnpkg.com/@tryghost/mw-error-handler/-/mw-error-handler-0.2.2.tgz#ab507e8b9079b6cbcbef2ac3fee4266342188165" - integrity sha512-9J6d1gce+PzdLkSGxap5oWjG3INb3J9QLoC4NHXOqIGZ+7GERlao3q6AFVBo5xUBoUzkd+Q7+3ZQfeLarNEwUA== +"@tryghost/mw-error-handler@0.2.4": + version "0.2.4" + resolved "https://registry.yarnpkg.com/@tryghost/mw-error-handler/-/mw-error-handler-0.2.4.tgz#9384be3f880c502a93e019b711cebe7ddb7c4abb" + integrity sha512-KN6s2npnFXrFG6DnHpblrGHmwtV2soS2d7YQsEFoXksXQZZrwp60aoY5hFuBcjemchszHQA4C6efwjmE1BacKw== dependencies: "@tryghost/debug" "^0.1.9" "@tryghost/errors" "1.2.12"