@tryghost/content-api 1.11.28 → 1.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@
3
3
  var axios = require('axios');
4
4
 
5
5
  var name$1 = "@tryghost/content-api";
6
- var version = "1.11.28";
6
+ var version = "1.12.1";
7
7
  var repository = {
8
8
  type: "git",
9
9
  url: "git+https://github.com/TryGhost/SDK.git",
@@ -36,14 +36,14 @@ var publishConfig = {
36
36
  access: "public"
37
37
  };
38
38
  var devDependencies = {
39
- "@babel/core": "7.27.7",
39
+ "@babel/core": "7.28.5",
40
40
  "@babel/polyfill": "7.12.1",
41
- "@babel/preset-env": "7.27.2",
41
+ "@babel/preset-env": "7.28.5",
42
42
  "@rollup/plugin-json": "6.1.0",
43
43
  c8: "10.1.3",
44
- "core-js": "3.43.0",
44
+ "core-js": "3.47.0",
45
45
  "eslint-plugin-ghost": "3.4.3",
46
- mocha: "11.2.2",
46
+ mocha: "11.7.5",
47
47
  rollup: "2.79.2",
48
48
  "rollup-plugin-babel": "4.4.0",
49
49
  "rollup-plugin-commonjs": "10.1.0",
@@ -57,7 +57,6 @@ var devDependencies = {
57
57
  var dependencies = {
58
58
  axios: "^1.0.0"
59
59
  };
60
- var gitHead = "abcb7f69994ec865f1c51184744b2401242713ba";
61
60
  var packageInfo = {
62
61
  name: name$1,
63
62
  version: version,
@@ -73,8 +72,7 @@ var packageInfo = {
73
72
  scripts: scripts,
74
73
  publishConfig: publishConfig,
75
74
  devDependencies: devDependencies,
76
- dependencies: dependencies,
77
- gitHead: gitHead
75
+ dependencies: dependencies
78
76
  };
79
77
 
80
78
  // @NOTE: this value is dynamically replaced based on browser/node environment
@@ -82,8 +80,8 @@ const USER_AGENT_DEFAULT = true;
82
80
 
83
81
  const packageVersion = packageInfo.version;
84
82
 
85
- const defaultAcceptVersionHeader = 'v5.0';
86
- const supportedVersions = ['v2', 'v3', 'v4', 'v5', 'canary'];
83
+ const defaultAcceptVersionHeader = 'v6.0';
84
+ const supportedVersions = ['v2', 'v3', 'v4', 'v5', 'v6', 'canary'];
87
85
  const name = '@tryghost/content-api';
88
86
 
89
87
  /**
@@ -96,14 +94,15 @@ const name = '@tryghost/content-api';
96
94
  const resolveAPIPrefix = (version) => {
97
95
  let prefix;
98
96
 
99
- // NOTE: the "version.match(/^v5\.\d+/)" expression should be changed to "version.match(/^v\d+\.\d+/)" once Ghost v5 is out
100
- if (version === 'v5' || version === undefined || version.match(/^v5\.\d+/)) {
101
- prefix = `/content/`;
102
- } else if (version.match(/^v\d+\.\d+/)) {
103
- const versionPrefix = /^(v\d+)\.\d+/.exec(version)[1];
97
+ // Only v2, v3, v4, and canary need version prefixes in the URL
98
+ if (version === 'v2' || version === 'v3' || version === 'v4' || version === 'canary') {
99
+ prefix = `/${version}/content/`;
100
+ } else if (version && version.match(/^v[2-4]\.\d+/)) {
101
+ const versionPrefix = /^(v[2-4])\.\d+/.exec(version)[1];
104
102
  prefix = `/${versionPrefix}/content/`;
105
103
  } else {
106
- prefix = `/${version}/content/`;
104
+ // Default for v5, v6, undefined, etc. - no version prefix
105
+ prefix = `/content/`;
107
106
  }
108
107
 
109
108
  return prefix;