strapi-sdk-js 2.3.2-rc.1 → 2.3.2
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/dist/index.cjs +4 -24
- package/dist/index.mjs +1 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -6,25 +6,6 @@ var qs = require('qs');
|
|
|
6
6
|
var Cookies = require('js-cookie');
|
|
7
7
|
var ufo = require('ufo');
|
|
8
8
|
|
|
9
|
-
function _interopNamespaceDefault(e) {
|
|
10
|
-
var n = Object.create(null);
|
|
11
|
-
if (e) {
|
|
12
|
-
Object.keys(e).forEach(function (k) {
|
|
13
|
-
if (k !== 'default') {
|
|
14
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function () { return e[k]; }
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
n.default = e;
|
|
23
|
-
return Object.freeze(n);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
var ufo__namespace = /*#__PURE__*/_interopNamespaceDefault(ufo);
|
|
27
|
-
|
|
28
9
|
function isBrowser() {
|
|
29
10
|
return typeof window !== "undefined";
|
|
30
11
|
}
|
|
@@ -35,7 +16,6 @@ var __publicField = (obj, key, value) => {
|
|
|
35
16
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
36
17
|
return value;
|
|
37
18
|
};
|
|
38
|
-
const { cleanDoubleSlashes, joinURL } = ufo__namespace;
|
|
39
19
|
const defaults = {
|
|
40
20
|
url: "http://localhost:1337",
|
|
41
21
|
prefix: "/api",
|
|
@@ -63,11 +43,11 @@ class Strapi {
|
|
|
63
43
|
const _options = defu(options || {}, defaults);
|
|
64
44
|
this.options = {
|
|
65
45
|
..._options,
|
|
66
|
-
url: cleanDoubleSlashes(_options == null ? void 0 : _options.url),
|
|
67
|
-
prefix: cleanDoubleSlashes(_options == null ? void 0 : _options.prefix)
|
|
46
|
+
url: ufo.cleanDoubleSlashes(_options == null ? void 0 : _options.url),
|
|
47
|
+
prefix: ufo.cleanDoubleSlashes(_options == null ? void 0 : _options.prefix)
|
|
68
48
|
};
|
|
69
49
|
this.axios = axios.create({
|
|
70
|
-
baseURL: joinURL(this.options.url, this.options.prefix),
|
|
50
|
+
baseURL: ufo.joinURL(this.options.url, this.options.prefix),
|
|
71
51
|
paramsSerializer: qs.stringify,
|
|
72
52
|
...this.options.axiosOptions
|
|
73
53
|
});
|
|
@@ -228,7 +208,7 @@ class Strapi {
|
|
|
228
208
|
* @returns string
|
|
229
209
|
*/
|
|
230
210
|
getProviderAuthenticationUrl(provider) {
|
|
231
|
-
return joinURL(this.options.url, this.options.prefix, "connect", provider);
|
|
211
|
+
return ufo.joinURL(this.options.url, this.options.prefix, "connect", provider);
|
|
232
212
|
}
|
|
233
213
|
/**
|
|
234
214
|
* Authenticate user with the token present on the URL or in `params`
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import axios from 'axios';
|
|
|
2
2
|
import defu from 'defu';
|
|
3
3
|
import qs from 'qs';
|
|
4
4
|
import Cookies from 'js-cookie';
|
|
5
|
-
import
|
|
5
|
+
import { cleanDoubleSlashes, joinURL } from 'ufo';
|
|
6
6
|
|
|
7
7
|
function isBrowser() {
|
|
8
8
|
return typeof window !== "undefined";
|
|
@@ -14,7 +14,6 @@ var __publicField = (obj, key, value) => {
|
|
|
14
14
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
15
15
|
return value;
|
|
16
16
|
};
|
|
17
|
-
const { cleanDoubleSlashes, joinURL } = ufo;
|
|
18
17
|
const defaults = {
|
|
19
18
|
url: "http://localhost:1337",
|
|
20
19
|
prefix: "/api",
|