@microlink/mql 0.10.31 → 0.10.32
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/LICENSE.md +0 -0
- package/dist/mql.js +12 -83
- package/dist/mql.js.map +1 -1
- package/dist/mql.min.js +2 -2
- package/dist/mql.min.js.map +1 -1
- package/dist/mql.min.mjs +2 -2
- package/dist/mql.min.mjs.map +1 -1
- package/dist/mql.mjs +12 -83
- package/dist/mql.mjs.map +1 -1
- package/package.json +22 -23
- package/src/browser.js +0 -2
- package/src/factory.js +4 -4
- package/src/node.js +0 -1
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://nicedoc.io/microlinkhq/mql",
|
|
5
|
-
"version": "0.10.
|
|
5
|
+
"version": "0.10.32",
|
|
6
6
|
"browser": "src/browser.js",
|
|
7
7
|
"main": "src/node.js",
|
|
8
8
|
"author": {
|
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"flattie": "~1.1.0",
|
|
47
47
|
"got": "~11.8.5",
|
|
48
|
-
"qss": "~2.0.3",
|
|
49
48
|
"url-http": "~1.0.7",
|
|
50
49
|
"whoops": "~4.1.1"
|
|
51
50
|
},
|
|
@@ -93,25 +92,6 @@
|
|
|
93
92
|
"lightweight",
|
|
94
93
|
"src"
|
|
95
94
|
],
|
|
96
|
-
"scripts": {
|
|
97
|
-
"build": "rollup -c rollup.config.js --bundleConfigAsCjs",
|
|
98
|
-
"build:kys": "[ -f src/ky.js ] || rollup node_modules/ky/distribution/index.js --format=umd --name=ky --exports=named --file=src/ky.js",
|
|
99
|
-
"clean": "rm -rf node_modules",
|
|
100
|
-
"clean:build": "rm -rf dist",
|
|
101
|
-
"contributors": "(git-authors-cli && finepack --sort-ignore-object-at ava && git add package.json && git commit -m 'build: contributors' --no-verify) || true",
|
|
102
|
-
"dev": "npm run build -- -w",
|
|
103
|
-
"lint": "standard",
|
|
104
|
-
"postrelease": "npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)",
|
|
105
|
-
"prebuild": "npm run clean:build && npm run build:kys",
|
|
106
|
-
"prerelease": "npm run update:check && npm run contributors",
|
|
107
|
-
"pretest": "npm run lint && npm run build",
|
|
108
|
-
"release": "standard-version -a",
|
|
109
|
-
"release:github": "conventional-github-releaser -p angular",
|
|
110
|
-
"release:tags": "git push --follow-tags origin HEAD:master",
|
|
111
|
-
"test": "c8 ava --verbose",
|
|
112
|
-
"update": "ncu -u",
|
|
113
|
-
"update:check": "ncu -- --error-level 2"
|
|
114
|
-
},
|
|
115
95
|
"license": "MIT",
|
|
116
96
|
"ava": {
|
|
117
97
|
"files": [
|
|
@@ -157,5 +137,24 @@
|
|
|
157
137
|
},
|
|
158
138
|
"types": "index.d.ts",
|
|
159
139
|
"umd:main": "dist/mql.js",
|
|
160
|
-
"unpkg": "dist/mql.js"
|
|
161
|
-
|
|
140
|
+
"unpkg": "dist/mql.js",
|
|
141
|
+
"scripts": {
|
|
142
|
+
"build": "rollup -c rollup.config.js --bundleConfigAsCjs",
|
|
143
|
+
"build:kys": "[ -f src/ky.js ] || rollup node_modules/ky/distribution/index.js --format=umd --name=ky --exports=named --file=src/ky.js",
|
|
144
|
+
"clean": "rm -rf node_modules",
|
|
145
|
+
"clean:build": "rm -rf dist",
|
|
146
|
+
"contributors": "(npx git-authors-cli && npx finepack --sort-ignore-object-at ava && git add package.json && git commit -m 'build: contributors' --no-verify) || true",
|
|
147
|
+
"dev": "npm run build -- -w",
|
|
148
|
+
"lint": "standard",
|
|
149
|
+
"postrelease": "npm run release:tags && npm run release:github && (ci-publish || npm publish --access=public)",
|
|
150
|
+
"prebuild": "npm run clean:build && npm run build:kys",
|
|
151
|
+
"prerelease": "npm run update:check",
|
|
152
|
+
"pretest": "npm run lint && npm run build",
|
|
153
|
+
"release": "standard-version -a",
|
|
154
|
+
"release:github": "conventional-github-releaser -p angular",
|
|
155
|
+
"release:tags": "git push --follow-tags origin HEAD:master",
|
|
156
|
+
"test": "c8 ava --verbose",
|
|
157
|
+
"update": "ncu -u",
|
|
158
|
+
"update:check": "ncu -- --error-level 2"
|
|
159
|
+
}
|
|
160
|
+
}
|
package/src/browser.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
const urlHttp = require('url-http/lightweight')
|
|
4
4
|
const { flattie: flatten } = require('flattie')
|
|
5
|
-
const { encode: stringify } = require('qss')
|
|
6
5
|
|
|
7
6
|
const factory = require('./factory')
|
|
8
7
|
const { default: ky } = require('./ky')
|
|
@@ -49,7 +48,6 @@ const got = async (url, opts) => {
|
|
|
49
48
|
module.exports = factory({
|
|
50
49
|
MicrolinkError,
|
|
51
50
|
urlHttp,
|
|
52
|
-
stringify,
|
|
53
51
|
got,
|
|
54
52
|
flatten,
|
|
55
53
|
VERSION: '__MQL_VERSION__'
|
package/src/factory.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const ENDPOINT = {
|
|
2
|
-
FREE: 'https://api.microlink.io',
|
|
3
|
-
PRO: 'https://pro.microlink.io'
|
|
2
|
+
FREE: 'https://api.microlink.io/',
|
|
3
|
+
PRO: 'https://pro.microlink.io/'
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
const isObject = input => input !== null && typeof input === 'object'
|
|
@@ -102,11 +102,11 @@ const factory = ({
|
|
|
102
102
|
const isPro = !!apiKey
|
|
103
103
|
const apiEndpoint = endpoint || ENDPOINT[isPro ? 'PRO' : 'FREE']
|
|
104
104
|
|
|
105
|
-
const apiUrl = `${apiEndpoint}?${
|
|
105
|
+
const apiUrl = `${apiEndpoint}?${new URLSearchParams({
|
|
106
106
|
url,
|
|
107
107
|
...mapRules(data),
|
|
108
108
|
...flatten(opts)
|
|
109
|
-
})}`
|
|
109
|
+
}).toString()}`
|
|
110
110
|
|
|
111
111
|
const headers = isPro
|
|
112
112
|
? { ...gotHeaders, 'x-api-key': apiKey }
|
package/src/node.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
module.exports = require('./factory')({
|
|
2
2
|
MicrolinkError: require('whoops')('MicrolinkError'),
|
|
3
3
|
urlHttp: require('url-http/lightweight'),
|
|
4
|
-
stringify: require('querystring').stringify,
|
|
5
4
|
got: require('got'),
|
|
6
5
|
flatten: require('flattie').flattie,
|
|
7
6
|
VERSION: require('../package.json').version
|