strapi-sdk-js 2.3.2-rc.0 → 2.3.2-rc.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/dist/index.cjs +5 -4
- package/dist/index.mjs +5 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -35,6 +35,7 @@ var __publicField = (obj, key, value) => {
|
|
|
35
35
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
36
36
|
return value;
|
|
37
37
|
};
|
|
38
|
+
const { cleanDoubleSlashes, joinURL } = ufo__namespace;
|
|
38
39
|
const defaults = {
|
|
39
40
|
url: "http://localhost:1337",
|
|
40
41
|
prefix: "/api",
|
|
@@ -62,11 +63,11 @@ class Strapi {
|
|
|
62
63
|
const _options = defu(options || {}, defaults);
|
|
63
64
|
this.options = {
|
|
64
65
|
..._options,
|
|
65
|
-
url:
|
|
66
|
-
prefix:
|
|
66
|
+
url: cleanDoubleSlashes(_options == null ? void 0 : _options.url),
|
|
67
|
+
prefix: cleanDoubleSlashes(_options == null ? void 0 : _options.prefix)
|
|
67
68
|
};
|
|
68
69
|
this.axios = axios.create({
|
|
69
|
-
baseURL:
|
|
70
|
+
baseURL: joinURL(this.options.url, this.options.prefix),
|
|
70
71
|
paramsSerializer: qs.stringify,
|
|
71
72
|
...this.options.axiosOptions
|
|
72
73
|
});
|
|
@@ -227,7 +228,7 @@ class Strapi {
|
|
|
227
228
|
* @returns string
|
|
228
229
|
*/
|
|
229
230
|
getProviderAuthenticationUrl(provider) {
|
|
230
|
-
return
|
|
231
|
+
return joinURL(this.options.url, this.options.prefix, "connect", provider);
|
|
231
232
|
}
|
|
232
233
|
/**
|
|
233
234
|
* Authenticate user with the token present on the URL or in `params`
|
package/dist/index.mjs
CHANGED
|
@@ -14,6 +14,7 @@ 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;
|
|
17
18
|
const defaults = {
|
|
18
19
|
url: "http://localhost:1337",
|
|
19
20
|
prefix: "/api",
|
|
@@ -41,11 +42,11 @@ class Strapi {
|
|
|
41
42
|
const _options = defu(options || {}, defaults);
|
|
42
43
|
this.options = {
|
|
43
44
|
..._options,
|
|
44
|
-
url:
|
|
45
|
-
prefix:
|
|
45
|
+
url: cleanDoubleSlashes(_options == null ? void 0 : _options.url),
|
|
46
|
+
prefix: cleanDoubleSlashes(_options == null ? void 0 : _options.prefix)
|
|
46
47
|
};
|
|
47
48
|
this.axios = axios.create({
|
|
48
|
-
baseURL:
|
|
49
|
+
baseURL: joinURL(this.options.url, this.options.prefix),
|
|
49
50
|
paramsSerializer: qs.stringify,
|
|
50
51
|
...this.options.axiosOptions
|
|
51
52
|
});
|
|
@@ -206,7 +207,7 @@ class Strapi {
|
|
|
206
207
|
* @returns string
|
|
207
208
|
*/
|
|
208
209
|
getProviderAuthenticationUrl(provider) {
|
|
209
|
-
return
|
|
210
|
+
return joinURL(this.options.url, this.options.prefix, "connect", provider);
|
|
210
211
|
}
|
|
211
212
|
/**
|
|
212
213
|
* Authenticate user with the token present on the URL or in `params`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "strapi-sdk-js",
|
|
3
|
-
"version": "2.3.2-rc.
|
|
3
|
+
"version": "2.3.2-rc.1",
|
|
4
4
|
"description": "📦 Javascript SDK for your Strapi API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
],
|
|
52
52
|
"scripts": {
|
|
53
53
|
"start": "rollup -c --watch",
|
|
54
|
-
"build": "rollup -c",
|
|
54
|
+
"build": "rm -rf dist && rollup -c",
|
|
55
55
|
"clean": "rm -rf bin dist coverage",
|
|
56
56
|
"lint": "eslint . --ext .ts,.js",
|
|
57
57
|
"lint:fix": "eslint . --ext .ts,.js --fix",
|