Skip to content

Commit 2033456

Browse files
committed
Bumped default accept-content version to v5.0
refs https://github.com/TryGhost/Toolbox/issues/348 - With the release of Ghost v5 the default content version should be sent as "v5.0"
1 parent f5a8a2c commit 2033456

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

packages/admin-api/lib/admin-api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const packageInfo = require('../package.json');
88
const packageVersion = packageInfo.version;
99

1010
// NOTE: bump this default when Ghost v5 is released
11-
const defaultAcceptVersionHeader = 'v4.0';
11+
const defaultAcceptVersionHeader = 'v5.0';
1212
const supportedVersions = ['v2', 'v3', 'v4', 'v5', 'canary'];
1313
const packageName = '@tryghost/admin-api';
1414

packages/content-api/lib/content-api.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import packageInfo from '../package.json';
33

44
const packageVersion = packageInfo.version;
55

6-
// NOTE: bump this default when Ghost v5 is released
7-
const defaultAcceptVersionHeader = 'v4.0';
6+
const defaultAcceptVersionHeader = 'v5.0';
87
const supportedVersions = ['v2', 'v3', 'v4', 'v5', 'canary'];
98
const name = '@tryghost/content-api';
109

packages/content-api/test/content-api-test/content-api.test.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const packageVersion = packageJSON.version;
1111
describe('GhostContentApi', function () {
1212
const config = {
1313
url: 'https://ghost.local',
14-
version: 'v2',
14+
version: 'v5.0',
1515
key: '0123456789abcdef0123456789'
1616
};
1717

@@ -50,7 +50,6 @@ describe('GhostContentApi', function () {
5050
});
5151

5252
it('Returns an "api" object with posts, tags, authors, pages, settings, and tiers properties', function () {
53-
config.version = 'v5.0';
5453
const api = new GhostContentApi(config);
5554

5655
should.exist(api.posts);
@@ -106,7 +105,7 @@ describe('GhostContentApi', function () {
106105

107106
makeRequestStub.calledOnce.should.be.true();
108107
should.equal(makeRequestStub.args[0][0].url, 'http://ghost.local/ghost/api/canary/content/settings/');
109-
should.equal(makeRequestStub.args[0][0].headers['Accept-Version'], 'v4.0');
108+
should.equal(makeRequestStub.args[0][0].headers['Accept-Version'], 'v5.0');
110109
should.equal(makeRequestStub.args[0][0].headers['User-Agent'], `GhostContentSDK/${packageVersion}`);
111110
});
112111

@@ -215,7 +214,7 @@ describe('GhostContentApi', function () {
215214
await api.settings.browse();
216215

217216
makeRequestStub.calledOnce.should.be.true();
218-
should.equal(makeRequestStub.args[0][0].headers['Accept-Version'], 'v4.0');
217+
should.equal(makeRequestStub.args[0][0].headers['Accept-Version'], 'v5.0');
219218
should.equal(makeRequestStub.args[0][0].headers['User-Agent'], `GhostContentSDK/${packageVersion}`);
220219
});
221220
});

0 commit comments

Comments
 (0)