@microlink/mql 0.13.20 → 0.14.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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@microlink/mql",
3
3
  "description": "Microlink Query Language. The official HTTP client to interact with Microlink API for Node.js, browsers & Deno.",
4
4
  "homepage": "https://microlink.io/mql",
5
- "version": "0.13.20",
5
+ "version": "0.14.1",
6
6
  "types": "lightweight/index.d.ts",
7
7
  "exports": {
8
8
  "require": "./src/node.js",
@@ -48,7 +48,7 @@
48
48
  "dependencies": {
49
49
  "flattie": "~1.1.1",
50
50
  "got": "~11.8.6",
51
- "whoops": "~5.0.1"
51
+ "whoops": "~5.1.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@commitlint/cli": "latest",
package/src/factory.js CHANGED
@@ -98,7 +98,7 @@ const factory = streamResponseType => ({
98
98
 
99
99
  const getApiUrl = (
100
100
  url,
101
- { data, apiKey, endpoint, retry, cache, ...opts } = {},
101
+ { data, apiKey, endpoint, ...opts } = {},
102
102
  { responseType = 'json', headers: gotHeaders, ...gotOpts } = {}
103
103
  ) => {
104
104
  const isPro = !!apiKey
@@ -117,7 +117,7 @@ const factory = streamResponseType => ({
117
117
  if (opts.stream) {
118
118
  responseType = streamResponseType
119
119
  }
120
- return [apiUrl, { ...gotOpts, responseType, cache, retry, headers }]
120
+ return [apiUrl, { ...gotOpts, responseType, headers }]
121
121
  }
122
122
 
123
123
  const createMql = defaultOpts => async (url, opts, gotOpts) => {
package/src/node.js CHANGED
@@ -1,8 +1,17 @@
1
+ 'use strict'
2
+
3
+ const got = require('got')
4
+
5
+ const { VERSION, USER_AGENT, RETRY_STATUS_CODES } = require('./constants')
6
+
1
7
  const mql = require('./factory')('buffer')({
2
8
  MicrolinkError: require('whoops')('MicrolinkError'),
3
- got: require('got').extend({ headers: { 'user-agent': undefined } }),
9
+ got: got.extend({
10
+ headers: { 'user-agent': USER_AGENT },
11
+ retry: { statusCodes: RETRY_STATUS_CODES }
12
+ }),
4
13
  flatten: require('flattie').flattie,
5
- VERSION: require('../package.json').version
14
+ VERSION
6
15
  })
7
16
 
8
17
  module.exports = mql