@tryghost/content-api 1.9.7 → 1.10.1
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.
- package/cjs/content-api.js +14 -10
- package/es/content-api.js +1266 -96
- package/es/content-api.js.map +1 -1
- package/lib/content-api.js +6 -3
- package/package.json +8 -7
- package/umd/content-api.min.js +1 -1
- package/umd/content-api.min.js.map +1 -1
package/cjs/content-api.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var axios = require('axios');
|
|
4
4
|
|
|
5
5
|
var name$1 = "@tryghost/content-api";
|
|
6
|
-
var version = "1.
|
|
6
|
+
var version = "1.10.1";
|
|
7
7
|
var repository = "https://github.com/TryGhost/SDK/tree/master/packages/content-api";
|
|
8
8
|
var author = "Ghost Foundation";
|
|
9
9
|
var license = "MIT";
|
|
@@ -32,18 +32,19 @@ var publishConfig = {
|
|
|
32
32
|
access: "public"
|
|
33
33
|
};
|
|
34
34
|
var devDependencies = {
|
|
35
|
-
"@babel/core": "7.
|
|
35
|
+
"@babel/core": "7.18.2",
|
|
36
36
|
"@babel/polyfill": "7.12.1",
|
|
37
|
-
"@babel/preset-env": "7.
|
|
37
|
+
"@babel/preset-env": "7.18.2",
|
|
38
38
|
"@rollup/plugin-json": "4.1.0",
|
|
39
|
-
c8: "7.11.
|
|
40
|
-
"core-js": "3.22.
|
|
39
|
+
c8: "7.11.3",
|
|
40
|
+
"core-js": "3.22.7",
|
|
41
41
|
"eslint-plugin-ghost": "2.14.0",
|
|
42
42
|
mocha: "10.0.0",
|
|
43
|
-
rollup: "2.
|
|
43
|
+
rollup: "2.74.1",
|
|
44
44
|
"rollup-plugin-babel": "4.4.0",
|
|
45
45
|
"rollup-plugin-commonjs": "10.1.0",
|
|
46
46
|
"rollup-plugin-node-resolve": "5.2.0",
|
|
47
|
+
"rollup-plugin-polyfill-node": "^0.9.0",
|
|
47
48
|
"rollup-plugin-replace": "2.2.0",
|
|
48
49
|
"rollup-plugin-terser": "7.0.2",
|
|
49
50
|
should: "13.2.3",
|
|
@@ -52,7 +53,7 @@ var devDependencies = {
|
|
|
52
53
|
var dependencies = {
|
|
53
54
|
axios: "^0.27.0"
|
|
54
55
|
};
|
|
55
|
-
var gitHead = "
|
|
56
|
+
var gitHead = "ce790579ad1f191b24c05733d8a0a56f0b9f96d2";
|
|
56
57
|
var packageInfo = {
|
|
57
58
|
name: name$1,
|
|
58
59
|
version: version,
|
|
@@ -74,8 +75,7 @@ var packageInfo = {
|
|
|
74
75
|
|
|
75
76
|
const packageVersion = packageInfo.version;
|
|
76
77
|
|
|
77
|
-
|
|
78
|
-
const defaultAcceptVersionHeader = 'v4.0';
|
|
78
|
+
const defaultAcceptVersionHeader = 'v5.0';
|
|
79
79
|
const supportedVersions = ['v2', 'v3', 'v4', 'v5', 'canary'];
|
|
80
80
|
const name = '@tryghost/content-api';
|
|
81
81
|
|
|
@@ -185,7 +185,7 @@ function GhostContentAPI({url, key, host, version, ghostPath = 'ghost', makeRequ
|
|
|
185
185
|
if (key && !/[0-9a-f]{26}/.test(key)) {
|
|
186
186
|
throw new Error(`${name} Config Invalid: 'key' ${key} must have 26 hex characters`);
|
|
187
187
|
}
|
|
188
|
-
const api = ['posts', 'authors', 'tags', 'pages', 'settings'].reduce((apiObject, resourceType) => {
|
|
188
|
+
const api = ['posts', 'authors', 'tags', 'pages', 'settings', 'tiers', 'newsletters', 'offers'].reduce((apiObject, resourceType) => {
|
|
189
189
|
function browse(options = {}, memberToken) {
|
|
190
190
|
return makeApiRequest(resourceType, options, null, memberToken);
|
|
191
191
|
}
|
|
@@ -207,7 +207,11 @@ function GhostContentAPI({url, key, host, version, ghostPath = 'ghost', makeRequ
|
|
|
207
207
|
});
|
|
208
208
|
}, {});
|
|
209
209
|
|
|
210
|
+
// Settings, tiers & newsletters only have browse methods, offers only has read
|
|
210
211
|
delete api.settings.read;
|
|
212
|
+
delete api.tiers.read;
|
|
213
|
+
delete api.newsletters.read;
|
|
214
|
+
delete api.offers.browse;
|
|
211
215
|
|
|
212
216
|
return api;
|
|
213
217
|
|