storyblok 3.24.2 → 3.25.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storyblok",
3
- "version": "3.24.2",
3
+ "version": "3.25.0",
4
4
  "description": "A simple CLI to start Storyblok from your command line.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -42,7 +42,7 @@
42
42
  "p-series": "^2.1.0",
43
43
  "path": "^0.12.7",
44
44
  "simple-uuid": "^0.0.1",
45
- "storyblok-js-client": "^4.5.6",
45
+ "storyblok-js-client": "^5.12.0",
46
46
  "update-notifier": "^5.1.0",
47
47
  "xml-js": "^1.6.11"
48
48
  },
package/src/constants.js CHANGED
@@ -28,6 +28,11 @@ const COMMANDS = {
28
28
  SYNC: 'sync'
29
29
  }
30
30
 
31
+ const DEFAULT_AGENT = {
32
+ SB_Agent: 'SB-CLI',
33
+ SB_Agent_Version: process.env.npm_package_version || '3.0.0'
34
+ }
35
+
31
36
  module.exports = {
32
37
  LOGIN_URL,
33
38
  SIGNUP_URL,
@@ -35,5 +40,6 @@ module.exports = {
35
40
  SYNC_TYPES,
36
41
  US_API_URL,
37
42
  CN_API_URL,
38
- COMMANDS
43
+ COMMANDS,
44
+ DEFAULT_AGENT
39
45
  }
package/src/utils/api.js CHANGED
@@ -5,7 +5,7 @@ const inquirer = require('inquirer')
5
5
 
6
6
  const creds = require('./creds')
7
7
  const getQuestions = require('./get-questions')
8
- const { SIGNUP_URL, API_URL, US_API_URL, CN_API_URL } = require('../constants')
8
+ const { SIGNUP_URL, API_URL, US_API_URL, CN_API_URL, DEFAULT_AGENT } = require('../constants')
9
9
 
10
10
  module.exports = {
11
11
  accessToken: '',
@@ -20,7 +20,10 @@ module.exports = {
20
20
  return new Storyblok({
21
21
  accessToken: this.accessToken,
22
22
  oauthToken: this.oauthToken,
23
- region: this.region
23
+ region: this.region,
24
+ headers: {
25
+ ...DEFAULT_AGENT
26
+ }
24
27
  }, this.apiSwitcher(region))
25
28
  } catch (error) {
26
29
  throw new Error(error)
@@ -277,7 +280,10 @@ module.exports = {
277
280
  const customClient = new Storyblok({
278
281
  accessToken: this.accessToken,
279
282
  oauthToken: this.oauthToken,
280
- region
283
+ region,
284
+ headers: {
285
+ ...DEFAULT_AGENT
286
+ }
281
287
  }, this.apiSwitcher(region))
282
288
  return await customClient
283
289
  .get('spaces/', {})