@tryghost/content-api 1.8.0 → 1.9.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.
- package/cjs/content-api.js +73 -0
- package/es/content-api.js +421 -310
- package/es/content-api.js.map +1 -1
- package/lib/index.js +4 -0
- package/package.json +5 -4
- package/umd/content-api.min.js +1 -1
- package/umd/content-api.min.js.map +1 -1
package/cjs/content-api.js
CHANGED
|
@@ -2,6 +2,78 @@
|
|
|
2
2
|
|
|
3
3
|
var axios = require('axios');
|
|
4
4
|
|
|
5
|
+
var name$1 = "@tryghost/content-api";
|
|
6
|
+
var version = "1.9.0";
|
|
7
|
+
var repository = "https://github.com/TryGhost/SDK/tree/master/packages/content-api";
|
|
8
|
+
var author = "Ghost Foundation";
|
|
9
|
+
var license = "MIT";
|
|
10
|
+
var main = "cjs/content-api.js";
|
|
11
|
+
var unpkg = "umd/content-api.min.js";
|
|
12
|
+
var module$1 = "es/content-api.js";
|
|
13
|
+
var source = "lib/index.js";
|
|
14
|
+
var files = [
|
|
15
|
+
"LICENSE",
|
|
16
|
+
"README.md",
|
|
17
|
+
"cjs/",
|
|
18
|
+
"lib/",
|
|
19
|
+
"umd/",
|
|
20
|
+
"es/"
|
|
21
|
+
];
|
|
22
|
+
var scripts = {
|
|
23
|
+
dev: "echo \"Implement me!\"",
|
|
24
|
+
pretest: "yarn build",
|
|
25
|
+
test: "NODE_ENV=testing c8 --all --reporter text --reporter cobertura mocha './test/**/*.test.js'",
|
|
26
|
+
build: "rollup -c",
|
|
27
|
+
lint: "eslint . --ext .js --cache",
|
|
28
|
+
prepare: "NODE_ENV=production yarn build",
|
|
29
|
+
posttest: "yarn lint"
|
|
30
|
+
};
|
|
31
|
+
var publishConfig = {
|
|
32
|
+
access: "public"
|
|
33
|
+
};
|
|
34
|
+
var devDependencies = {
|
|
35
|
+
"@babel/core": "7.17.9",
|
|
36
|
+
"@babel/polyfill": "7.12.1",
|
|
37
|
+
"@babel/preset-env": "7.16.11",
|
|
38
|
+
"@rollup/plugin-json": "^4.1.0",
|
|
39
|
+
c8: "7.11.0",
|
|
40
|
+
"core-js": "3.22.0",
|
|
41
|
+
"eslint-plugin-ghost": "1.5.0",
|
|
42
|
+
mocha: "7.2.0",
|
|
43
|
+
rollup: "2.70.2",
|
|
44
|
+
"rollup-plugin-babel": "4.4.0",
|
|
45
|
+
"rollup-plugin-commonjs": "10.1.0",
|
|
46
|
+
"rollup-plugin-node-resolve": "5.2.0",
|
|
47
|
+
"rollup-plugin-replace": "2.2.0",
|
|
48
|
+
"rollup-plugin-terser": "7.0.2",
|
|
49
|
+
should: "13.2.3",
|
|
50
|
+
sinon: "9.2.4"
|
|
51
|
+
};
|
|
52
|
+
var dependencies = {
|
|
53
|
+
axios: "^0.21.1"
|
|
54
|
+
};
|
|
55
|
+
var gitHead = "f699f18279c596be384760adccbbf90a659bd4bc";
|
|
56
|
+
var packageInfo = {
|
|
57
|
+
name: name$1,
|
|
58
|
+
version: version,
|
|
59
|
+
repository: repository,
|
|
60
|
+
author: author,
|
|
61
|
+
license: license,
|
|
62
|
+
main: main,
|
|
63
|
+
"umd:main": "umd/content-api.min.js",
|
|
64
|
+
unpkg: unpkg,
|
|
65
|
+
module: module$1,
|
|
66
|
+
source: source,
|
|
67
|
+
files: files,
|
|
68
|
+
scripts: scripts,
|
|
69
|
+
publishConfig: publishConfig,
|
|
70
|
+
devDependencies: devDependencies,
|
|
71
|
+
dependencies: dependencies,
|
|
72
|
+
gitHead: gitHead
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const packageVersion = packageInfo.version;
|
|
76
|
+
|
|
5
77
|
// NOTE: bump this default when Ghost v5 is released
|
|
6
78
|
const defaultAcceptVersionHeader = 'v4.0';
|
|
7
79
|
const supportedVersions = ['v2', 'v3', 'v4', 'v5', 'canary'];
|
|
@@ -128,6 +200,7 @@ function GhostContentAPI({url, key, host, version, ghostPath = 'ghost', makeRequ
|
|
|
128
200
|
Authorization: `GhostMembers ${membersToken}`
|
|
129
201
|
} : {};
|
|
130
202
|
|
|
203
|
+
headers['User-Agent'] = `GhostContentSDK/${packageVersion}`;
|
|
131
204
|
if (acceptVersionHeader) {
|
|
132
205
|
headers['Accept-Version'] = acceptVersionHeader;
|
|
133
206
|
}
|