@tryghost/content-api 1.11.27 → 1.12.0

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.27";
6
+ var version = "1.12.0";
7
7
  var repository = {
8
8
  type: "git",
9
9
  url: "git+https://github.com/TryGhost/SDK.git",
@@ -36,7 +36,7 @@ var publishConfig = {
36
36
  access: "public"
37
37
  };
38
38
  var devDependencies = {
39
- "@babel/core": "7.27.4",
39
+ "@babel/core": "7.27.7",
40
40
  "@babel/polyfill": "7.12.1",
41
41
  "@babel/preset-env": "7.27.2",
42
42
  "@rollup/plugin-json": "6.1.0",
@@ -57,7 +57,7 @@ var devDependencies = {
57
57
  var dependencies = {
58
58
  axios: "^1.0.0"
59
59
  };
60
- var gitHead = "b10773947244536b8829fec0540819990c901987";
60
+ var gitHead = "860707f032864400017b0f176cbabf181f99b764";
61
61
  var packageInfo = {
62
62
  name: name$1,
63
63
  version: version,
@@ -82,8 +82,8 @@ const USER_AGENT_DEFAULT = true;
82
82
 
83
83
  const packageVersion = packageInfo.version;
84
84
 
85
- const defaultAcceptVersionHeader = 'v5.0';
86
- const supportedVersions = ['v2', 'v3', 'v4', 'v5', 'canary'];
85
+ const defaultAcceptVersionHeader = 'v6.0';
86
+ const supportedVersions = ['v2', 'v3', 'v4', 'v5', 'v6', 'canary'];
87
87
  const name = '@tryghost/content-api';
88
88
 
89
89
  /**
@@ -96,14 +96,15 @@ const name = '@tryghost/content-api';
96
96
  const resolveAPIPrefix = (version) => {
97
97
  let prefix;
98
98
 
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];
99
+ // Only v2, v3, v4, and canary need version prefixes in the URL
100
+ if (version === 'v2' || version === 'v3' || version === 'v4' || version === 'canary') {
101
+ prefix = `/${version}/content/`;
102
+ } else if (version && version.match(/^v[2-4]\.\d+/)) {
103
+ const versionPrefix = /^(v[2-4])\.\d+/.exec(version)[1];
104
104
  prefix = `/${versionPrefix}/content/`;
105
105
  } else {
106
- prefix = `/${version}/content/`;
106
+ // Default for v5, v6, undefined, etc. - no version prefix
107
+ prefix = `/content/`;
107
108
  }
108
109
 
109
110
  return prefix;
package/es/content-api.js CHANGED
@@ -3727,7 +3727,7 @@ axios.default = axios;
3727
3727
  var axios$1 = axios;
3728
3728
 
3729
3729
  var name$1 = "@tryghost/content-api";
3730
- var version = "1.11.27";
3730
+ var version = "1.12.0";
3731
3731
  var repository = {
3732
3732
  type: "git",
3733
3733
  url: "git+https://github.com/TryGhost/SDK.git",
@@ -3760,7 +3760,7 @@ var publishConfig = {
3760
3760
  access: "public"
3761
3761
  };
3762
3762
  var devDependencies = {
3763
- "@babel/core": "7.27.4",
3763
+ "@babel/core": "7.27.7",
3764
3764
  "@babel/polyfill": "7.12.1",
3765
3765
  "@babel/preset-env": "7.27.2",
3766
3766
  "@rollup/plugin-json": "6.1.0",
@@ -3781,7 +3781,7 @@ var devDependencies = {
3781
3781
  var dependencies = {
3782
3782
  axios: "^1.0.0"
3783
3783
  };
3784
- var gitHead = "b10773947244536b8829fec0540819990c901987";
3784
+ var gitHead = "860707f032864400017b0f176cbabf181f99b764";
3785
3785
  var packageInfo = {
3786
3786
  name: name$1,
3787
3787
  version: version,
@@ -3804,8 +3804,8 @@ var packageInfo = {
3804
3804
  // @NOTE: this value is dynamically replaced based on browser/node environment
3805
3805
  const USER_AGENT_DEFAULT = false;
3806
3806
  const packageVersion = packageInfo.version;
3807
- const defaultAcceptVersionHeader = 'v5.0';
3808
- const supportedVersions = ['v2', 'v3', 'v4', 'v5', 'canary'];
3807
+ const defaultAcceptVersionHeader = 'v6.0';
3808
+ const supportedVersions = ['v2', 'v3', 'v4', 'v5', 'v6', 'canary'];
3809
3809
  const name = '@tryghost/content-api';
3810
3810
 
3811
3811
  /**
@@ -3818,14 +3818,15 @@ const name = '@tryghost/content-api';
3818
3818
  const resolveAPIPrefix = version => {
3819
3819
  let prefix;
3820
3820
 
3821
- // NOTE: the "version.match(/^v5\.\d+/)" expression should be changed to "version.match(/^v\d+\.\d+/)" once Ghost v5 is out
3822
- if (version === 'v5' || version === undefined || version.match(/^v5\.\d+/)) {
3823
- prefix = `/content/`;
3824
- } else if (version.match(/^v\d+\.\d+/)) {
3825
- const versionPrefix = /^(v\d+)\.\d+/.exec(version)[1];
3821
+ // Only v2, v3, v4, and canary need version prefixes in the URL
3822
+ if (version === 'v2' || version === 'v3' || version === 'v4' || version === 'canary') {
3823
+ prefix = `/${version}/content/`;
3824
+ } else if (version && version.match(/^v[2-4]\.\d+/)) {
3825
+ const versionPrefix = /^(v[2-4])\.\d+/.exec(version)[1];
3826
3826
  prefix = `/${versionPrefix}/content/`;
3827
3827
  } else {
3828
- prefix = `/${version}/content/`;
3828
+ // Default for v5, v6, undefined, etc. - no version prefix
3829
+ prefix = `/content/`;
3829
3830
  }
3830
3831
  return prefix;
3831
3832
  };