2022-04-06 16:12:20 +08:00
// Jest Snapshot v1, https://goo.gl/fbAQLP
2022-04-13 12:53:49 +08:00
exports[`API Versioning Admin API responds with 404 error when the resource cannot be found 1: [body] 1`] = `
Object {
"errors": Array [
Object {
"code": null,
"context": "Member not found.",
"details": null,
"help": null,
"id": StringMatching /\\[a-f0-9\\]\\{8\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{4\\}-\\[a-f0-9\\]\\{12\\}/,
"message": "Resource not found error, cannot read member.",
"property": null,
"type": "NotFoundError",
},
],
}
`;
exports[`API Versioning Admin API responds with 404 error when the resource cannot be found 2: [headers] 1`] = `
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": "224",
"content-type": "application/json; charset=utf-8",
"etag": Any<String>,
"vary": "Origin, Accept-Encoding",
"x-powered-by": "Express",
}
`;
2022-04-12 17:03:16 +08:00
exports[`API Versioning Admin API responds with current content version header when requested version is AHEAD and CAN respond 1: [body] 1`] = `
Object {
"site": Object {
"accent_color": "#FF1A75",
"description": "Thoughts, stories and ideas",
"icon": null,
"logo": null,
"title": "Ghost",
"url": "http://127.0.0.1:2369/",
"version": StringMatching /\\\\d\\+\\\\\\.\\\\d\\+/,
},
}
`;
exports[`API Versioning Admin API responds with current content version header when requested version is AHEAD and CAN respond 2: [headers] 1`] = `
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": "167",
"content-type": "application/json; charset=utf-8",
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/,
"etag": Any<String>,
"vary": "Origin, Accept-Encoding",
"x-powered-by": "Express",
}
`;
exports[`API Versioning Admin API responds with current content version header when requested version is BEHIND current version and CAN respond 1: [body] 1`] = `
Object {
"site": Object {
"accent_color": "#FF1A75",
"description": "Thoughts, stories and ideas",
"icon": null,
"logo": null,
"title": "Ghost",
"url": "http://127.0.0.1:2369/",
"version": StringMatching /\\\\d\\+\\\\\\.\\\\d\\+/,
},
}
`;
exports[`API Versioning Admin API responds with current content version header when requested version is BEHIND current version and CAN respond 2: [headers] 1`] = `
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": "167",
"content-type": "application/json; charset=utf-8",
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/,
"etag": Any<String>,
"vary": "Origin, Accept-Encoding",
"x-powered-by": "Express",
}
`;
2022-04-22 10:38:22 +08:00
exports[`API Versioning Admin API responds with error and sends email ONCE when requested version is BEHIND and CANNOT respond multiple times 1: [body] 1`] = `
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\\+/,
"details": null,
"help": "Upgrade 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.",
"property": null,
"type": "RequestNotAcceptableError",
},
],
}
`;
exports[`API Versioning Admin API responds with error and sends email ONCE when requested version is BEHIND and CANNOT respond multiple times 2: [headers] 1`] = `
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-type": "application/json; charset=utf-8",
"etag": Any<String>,
"vary": "Origin, Accept-Encoding",
"x-powered-by": "Express",
}
`;
exports[`API Versioning Admin API responds with error and sends email ONCE when requested version is BEHIND and CANNOT respond multiple times 3: [body] 1`] = `
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\\+/,
"details": null,
"help": "Upgrade 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.",
"property": null,
"type": "RequestNotAcceptableError",
},
],
}
`;
exports[`API Versioning Admin API responds with error and sends email ONCE when requested version is BEHIND and CANNOT respond multiple times 4: [headers] 1`] = `
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-type": "application/json; charset=utf-8",
"etag": Any<String>,
"vary": "Origin, Accept-Encoding",
"x-powered-by": "Express",
}
`;
2022-04-12 17:03:16 +08:00
exports[`API Versioning Admin API responds with error requested version is AHEAD and CANNOT respond 1: [body] 1`] = `
Object {
"errors": Array [
Object {
2022-04-22 10:38:22 +08:00
"code": "UPDATE_GHOST",
2022-04-18 10:35:29 +08:00
"context": StringMatching /Provided client version v999\\\\\\.1 is ahead of current Ghost instance version v\\\\d\\+\\\\\\.\\\\d\\+/,
2022-04-12 17:03:16 +08:00
"details": null,
"help": "Upgrade your Ghost instance.",
"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.",
"property": null,
"type": "RequestNotAcceptableError",
},
],
}
`;
exports[`API Versioning Admin API responds with error requested version is AHEAD and CANNOT respond 2: [headers] 1`] = `
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",
2022-04-22 10:38:22 +08:00
"content-length": "348",
2022-04-12 17:03:16 +08:00
"content-type": "application/json; charset=utf-8",
"etag": Any<String>,
"vary": "Origin, Accept-Encoding",
"x-powered-by": "Express",
}
`;
exports[`API Versioning Admin API responds with error when requested version is BEHIND and CANNOT respond 1: [body] 1`] = `
Object {
"errors": Array [
Object {
2022-04-22 10:38:22 +08:00
"code": "UPDATE_CLIENT",
2022-04-18 10:35:29 +08:00
"context": StringMatching /Provided client version v3\\.1 is outdated and is behind current Ghost version v\\\\d\\+\\\\\\.\\\\d\\+/,
2022-04-12 17:03:16 +08:00
"details": null,
"help": "Upgrade 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.",
"property": null,
"type": "RequestNotAcceptableError",
},
],
}
`;
exports[`API Versioning Admin API responds with error when requested version is BEHIND and CANNOT respond 2: [headers] 1`] = `
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",
2022-04-22 10:38:22 +08:00
"content-length": "354",
2022-04-12 17:03:16 +08:00
"content-type": "application/json; charset=utf-8",
"etag": Any<String>,
"vary": "Origin, Accept-Encoding",
"x-powered-by": "Express",
}
`;
exports[`API Versioning Admin API responds with no content version header when accept version header is NOT PRESENT 1: [body] 1`] = `
Object {
"site": Object {
"accent_color": "#FF1A75",
"description": "Thoughts, stories and ideas",
"icon": null,
"logo": null,
"title": "Ghost",
"url": "http://127.0.0.1:2369/",
"version": StringMatching /\\\\d\\+\\\\\\.\\\\d\\+/,
},
}
`;
exports[`API Versioning Admin API responds with no content version header when accept version header is NOT PRESENT 2: [headers] 1`] = `
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": "167",
"content-type": "application/json; charset=utf-8",
"etag": Any<String>,
"vary": "Origin, Accept-Encoding",
"x-powered-by": "Express",
}
`;
2022-04-08 17:30:10 +08:00
exports[`API Versioning Content API responds with current content version header when requested version is BEHIND current version and CAN respond 1: [body] 1`] = `
Object {
"meta": Object {},
"settings": Object {
"accent_color": "#FF1A75",
"codeinjection_foot": null,
"codeinjection_head": null,
"cover_image": "https://static.ghost.org/v4.0.0/images/publication-cover.jpg",
"description": "Thoughts, stories and ideas",
"facebook": "ghost",
"icon": null,
"lang": "en",
"locale": "en",
"logo": null,
"members_support_address": "noreply",
"meta_description": null,
"meta_title": null,
"navigation": Array [
Object {
"label": "Home",
"url": "/",
},
Object {
"label": "About",
"url": "/about/",
},
Object {
"label": "Collection",
"url": "/tag/getting-started/",
},
Object {
"label": "Author",
"url": "/author/ghost/",
},
Object {
"label": "Portal",
"url": "/portal/",
},
],
"og_description": null,
"og_image": null,
"og_title": null,
"secondary_navigation": Array [
Object {
"label": "Data & privacy",
"url": "/privacy/",
},
Object {
"label": "Contact",
"url": "/contact/",
},
Object {
"label": "Contribute →",
"url": "/contribute/",
},
],
"timezone": "Etc/UTC",
"title": "Ghost",
"twitter": "@ghost",
"twitter_description": null,
"twitter_image": null,
"twitter_title": null,
"url": "http://127.0.0.1:2369/",
},
}
`;
exports[`API Versioning Content API responds with current content version header when requested version is BEHIND current version and CAN respond 2: [headers] 1`] = `
Object {
"access-control-allow-origin": "*",
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
"content-length": "942",
"content-type": "application/json; charset=utf-8",
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/,
"etag": "W/\\"3ae-FBGPtlUjSvGtTGLOj2sW5Rbn33s\\"",
"vary": "Accept-Encoding",
"x-powered-by": "Express",
}
`;
exports[`API Versioning Content API responds with no content version header when accept version header is NOT PRESENT 1: [body] 1`] = `
Object {
"meta": Object {},
"settings": Object {
"accent_color": "#FF1A75",
"codeinjection_foot": null,
"codeinjection_head": null,
"cover_image": "https://static.ghost.org/v4.0.0/images/publication-cover.jpg",
"description": "Thoughts, stories and ideas",
"facebook": "ghost",
"icon": null,
"lang": "en",
"locale": "en",
"logo": null,
"members_support_address": "noreply",
"meta_description": null,
"meta_title": null,
"navigation": Array [
Object {
"label": "Home",
"url": "/",
},
Object {
"label": "About",
"url": "/about/",
},
Object {
"label": "Collection",
"url": "/tag/getting-started/",
},
Object {
"label": "Author",
"url": "/author/ghost/",
},
Object {
"label": "Portal",
"url": "/portal/",
},
],
"og_description": null,
"og_image": null,
"og_title": null,
"secondary_navigation": Array [
Object {
"label": "Data & privacy",
"url": "/privacy/",
},
Object {
"label": "Contact",
"url": "/contact/",
},
Object {
"label": "Contribute →",
"url": "/contribute/",
},
],
"timezone": "Etc/UTC",
"title": "Ghost",
"twitter": "@ghost",
"twitter_description": null,
"twitter_image": null,
"twitter_title": null,
"url": "http://127.0.0.1:2369/",
},
}
`;
exports[`API Versioning Content API responds with no content version header when accept version header is NOT PRESENT 2: [headers] 1`] = `
Object {
"access-control-allow-origin": "*",
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
"content-length": "942",
"content-type": "application/json; charset=utf-8",
"etag": "W/\\"3ae-FBGPtlUjSvGtTGLOj2sW5Rbn33s\\"",
"vary": "Accept-Encoding",
"x-powered-by": "Express",
}
`;
2022-04-08 14:56:53 +08:00
exports[`API Versioning responds with current content version header when requested version is AHEAD and CAN respond 1: [body] 1`] = `
Object {
"site": Object {
"accent_color": "#FF1A75",
"description": "Thoughts, stories and ideas",
"icon": null,
"logo": null,
"title": "Ghost",
"url": "http://127.0.0.1:2369/",
"version": StringMatching /\\\\d\\+\\\\\\.\\\\d\\+/,
},
}
`;
exports[`API Versioning responds with current content version header when requested version is AHEAD and CAN respond 2: [headers] 1`] = `
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": "167",
"content-type": "application/json; charset=utf-8",
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/,
"etag": Any<String>,
"vary": "Origin, Accept-Encoding",
"x-powered-by": "Express",
}
`;
exports[`API Versioning responds with current content version header when requested version is BEHIND current version and CAN respond 1: [body] 1`] = `
Object {
"site": Object {
"accent_color": "#FF1A75",
"description": "Thoughts, stories and ideas",
"icon": null,
"logo": null,
"title": "Ghost",
"url": "http://127.0.0.1:2369/",
"version": StringMatching /\\\\d\\+\\\\\\.\\\\d\\+/,
},
}
`;
exports[`API Versioning responds with current content version header when requested version is BEHIND current version and CAN respond 2: [headers] 1`] = `
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": "167",
"content-type": "application/json; charset=utf-8",
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/,
"etag": Any<String>,
"vary": "Origin, Accept-Encoding",
"x-powered-by": "Express",
}
`;
2022-04-06 16:12:20 +08:00
exports[`API Versioning responds with current content version header when requested version is behind current version with no known changes 1: [headers] 1`] = `
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": "167",
"content-type": "application/json; charset=utf-8",
"content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/,
"etag": Any<String>,
"vary": "Origin, Accept-Encoding",
"x-powered-by": "Express",
}
`;
2022-04-08 14:56:53 +08:00
exports[`API Versioning responds with error current content version header when requested version is AHEAD and CANNOT respond 1: [body] 1`] = `
Object {
"errors": Array [
Object {
"code": null,
"context": "Provided client version v999.1 is ahead of current Ghost instance version v4.42.",
"details": null,
"help": "Upgrade your Ghost instance.",
"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.",
"property": null,
"type": "RequestNotAcceptableError",
},
],
}
`;
exports[`API Versioning responds with error current content version header when requested version is AHEAD and CANNOT respond 2: [headers] 1`] = `
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": "338",
"content-type": "application/json; charset=utf-8",
"etag": Any<String>,
"vary": "Origin, Accept-Encoding",
"x-powered-by": "Express",
}
`;
exports[`API Versioning responds with error current content version header when requested version is BEHIND and CANNOT respond 1: [body] 1`] = `
Object {
"errors": Array [
Object {
"code": null,
"context": "Provided client version v3.1 is outdated and is behind current Ghost version v4.42.",
"details": null,
"help": "Upgrade 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.",
"property": null,
"type": "RequestNotAcceptableError",
},
],
}
`;
exports[`API Versioning responds with error current content version header when requested version is BEHIND and CANNOT respond 2: [headers] 1`] = `
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": "343",
"content-type": "application/json; charset=utf-8",
"etag": Any<String>,
"vary": "Origin, Accept-Encoding",
"x-powered-by": "Express",
}
`;
exports[`API Versioning responds with no content version header when accept version header is NOT PRESENT 1: [body] 1`] = `
Object {
"site": Object {
"accent_color": "#FF1A75",
"description": "Thoughts, stories and ideas",
"icon": null,
"logo": null,
"title": "Ghost",
"url": "http://127.0.0.1:2369/",
"version": StringMatching /\\\\d\\+\\\\\\.\\\\d\\+/,
},
}
`;
exports[`API Versioning responds with no content version header when accept version header is NOT PRESENT 2: [headers] 1`] = `
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": "167",
"content-type": "application/json; charset=utf-8",
"etag": Any<String>,
"vary": "Origin, Accept-Encoding",
"x-powered-by": "Express",
}
`;
2022-04-06 16:12:20 +08:00
exports[`API Versioning responds with no content version header when accept version header is not present 1: [headers] 1`] = `
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": "167",
"content-type": "application/json; charset=utf-8",
"etag": Any<String>,
"vary": "Origin, Accept-Encoding",
"x-powered-by": "Express",
}
`;