@sanity/export 3.2.5 → 3.2.6-client-v5.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/export",
3
- "version": "3.2.5",
3
+ "version": "3.2.6-client-v5.17+f9f6245d43",
4
4
  "description": "Export Sanity documents and assets",
5
5
  "keywords": [
6
6
  "sanity",
@@ -32,7 +32,7 @@
32
32
  "dependencies": {
33
33
  "archiver": "^5.0.0",
34
34
  "debug": "^3.2.7",
35
- "get-it": "^5.2.1",
35
+ "get-it": "^8.0.9",
36
36
  "lodash": "^4.17.21",
37
37
  "mississippi": "^4.0.0",
38
38
  "p-queue": "^2.3.0",
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "45ccb1559f156c48c763014b96206a4cb0038d9f"
51
+ "gitHead": "f9f6245d43c2dc0d5443b36b4ef2a943b0a50a1d"
52
52
  }
@@ -2,10 +2,12 @@ const pkg = require('../package.json')
2
2
  const requestStream = require('./requestStream')
3
3
 
4
4
  module.exports = (client, dataset) => {
5
+ const {token, url: baseUrl} = client.config()
6
+ const apiUrl = baseUrl.replace(/\/+$/, '')
7
+
5
8
  // Sanity client doesn't handle streams natively since we want to support node/browser
6
9
  // with same API. We're just using it here to get hold of URLs and tokens.
7
- const url = client.getUrl(`/data/export/${dataset}`)
8
- const token = client.config().token
10
+ const url = `${apiUrl}/data/export/${dataset}`
9
11
  const headers = {
10
12
  'User-Agent': `${pkg.name}@${pkg.version}`,
11
13
  ...(token ? {Authorization: `Bearer ${token}`} : {}),
@@ -1,4 +1,4 @@
1
- const getIt = require('get-it')
1
+ const {getIt} = require('get-it')
2
2
  const {keepAlive, promise} = require('get-it/middleware')
3
3
  const debug = require('./debug')
4
4
 
@@ -1,6 +1,6 @@
1
1
  const defaults = require('lodash/defaults')
2
2
 
3
- const clientMethods = ['getUrl', 'config']
3
+ const clientMethods = ['config']
4
4
  const booleanFlags = ['assets', 'raw', 'compress', 'drafts']
5
5
  const exportDefaults = {
6
6
  compress: true,