@tryghost/admin-api 1.11.0 → 1.11.3

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/index.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./lib/admin-api');
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-restricted-syntax */
1
2
  const axios = require('axios');
2
3
  const FormData = require('form-data');
3
4
  const fs = require('fs');
@@ -24,6 +25,9 @@ const resolveAPIPrefix = (version) => {
24
25
  // NOTE: the "version.match(/^v5\.\d+/)" expression should be changed to "version.match(/^v\d+\.\d+/)" once Ghost v5 is out
25
26
  if (version === 'v5' || version === undefined || version.match(/^v5\.\d+/)) {
26
27
  prefix = `/admin/`;
28
+ } else if (version.match(/^v\d+\.\d+/)) {
29
+ const versionPrefix = /^(v\d+)\.\d+/.exec(version)[1];
30
+ prefix = `/${versionPrefix}/admin/`;
27
31
  } else {
28
32
  prefix = `/${version}/admin/`;
29
33
  }
@@ -57,6 +61,7 @@ module.exports = function GhostAdminAPI(options) {
57
61
  data,
58
62
  headers,
59
63
  maxContentLength: Infinity,
64
+ maxBodyLength: Infinity,
60
65
  paramsSerializer(parameters) {
61
66
  return Object.keys(parameters).reduce((parts, key) => {
62
67
  const val = encodeURIComponent([].concat(parameters[key]).join(','));
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "@tryghost/admin-api",
3
- "version": "1.11.0",
3
+ "version": "1.11.3",
4
4
  "repository": "https://github.com/TryGhost/SDK/tree/master/packages/admin-api",
5
5
  "author": "Ghost Foundation",
6
6
  "license": "MIT",
7
- "main": "lib/index.js",
7
+ "main": "index.js",
8
8
  "files": [
9
9
  "LICENSE",
10
10
  "README.md",
11
11
  "cjs/",
12
- "lib/"
12
+ "lib/",
13
+ "index.js"
13
14
  ],
14
15
  "scripts": {
15
16
  "dev": "echo \"Implement me!\"",
@@ -21,15 +22,15 @@
21
22
  "access": "public"
22
23
  },
23
24
  "devDependencies": {
24
- "c8": "7.11.0",
25
- "mocha": "7.2.0",
25
+ "c8": "7.11.2",
26
+ "mocha": "10.0.0",
26
27
  "should": "13.2.3",
27
- "sinon": "9.2.4"
28
+ "sinon": "13.0.2"
28
29
  },
29
30
  "dependencies": {
30
- "axios": "^0.21.1",
31
+ "axios": "^0.27.0",
31
32
  "form-data": "^4.0.0",
32
33
  "jsonwebtoken": "^8.4.0"
33
34
  },
34
- "gitHead": "db46574e3958a2487e8ccdcfb735fbe5de2a2731"
35
+ "gitHead": "0a30384f3d568a43bfe0cee5fcf7e21c17a17842"
35
36
  }