strapi-sdk-js 2.3.3 → 2.3.5
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 +7 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +7 -3
- package/package.json +12 -6
package/dist/index.cjs
CHANGED
|
@@ -48,7 +48,9 @@ class Strapi {
|
|
|
48
48
|
};
|
|
49
49
|
this.axios = axios.create({
|
|
50
50
|
baseURL: ufo.joinURL(this.options.url, this.options.prefix),
|
|
51
|
-
paramsSerializer:
|
|
51
|
+
paramsSerializer: {
|
|
52
|
+
serialize: (params) => qs.stringify(params)
|
|
53
|
+
},
|
|
52
54
|
...this.options.axiosOptions
|
|
53
55
|
});
|
|
54
56
|
this.axios.interceptors.request.use((config) => {
|
|
@@ -318,9 +320,11 @@ class Strapi {
|
|
|
318
320
|
*
|
|
319
321
|
* @returns Promise<StrapiUser>
|
|
320
322
|
*/
|
|
321
|
-
async fetchUser() {
|
|
323
|
+
async fetchUser(params) {
|
|
322
324
|
try {
|
|
323
|
-
const user = await this.request("get", "/users/me"
|
|
325
|
+
const user = await this.request("get", "/users/me", {
|
|
326
|
+
params
|
|
327
|
+
});
|
|
324
328
|
this.user = user;
|
|
325
329
|
} catch (e) {
|
|
326
330
|
this.logout();
|
package/dist/index.d.ts
CHANGED
|
@@ -67,6 +67,7 @@ interface StrapiRegistrationData {
|
|
|
67
67
|
username: string;
|
|
68
68
|
email: string;
|
|
69
69
|
password: string;
|
|
70
|
+
[k: string]: unknown;
|
|
70
71
|
}
|
|
71
72
|
interface StrapiForgotPasswordData {
|
|
72
73
|
email: string;
|
|
@@ -235,7 +236,7 @@ declare class Strapi {
|
|
|
235
236
|
*
|
|
236
237
|
* @returns Promise<StrapiUser>
|
|
237
238
|
*/
|
|
238
|
-
fetchUser(): Promise<StrapiUser>;
|
|
239
|
+
fetchUser(params?: StrapiBaseRequestParams): Promise<StrapiUser>;
|
|
239
240
|
/**
|
|
240
241
|
* Retrieve token from chosen storage
|
|
241
242
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -46,7 +46,9 @@ class Strapi {
|
|
|
46
46
|
};
|
|
47
47
|
this.axios = axios.create({
|
|
48
48
|
baseURL: joinURL(this.options.url, this.options.prefix),
|
|
49
|
-
paramsSerializer:
|
|
49
|
+
paramsSerializer: {
|
|
50
|
+
serialize: (params) => qs.stringify(params)
|
|
51
|
+
},
|
|
50
52
|
...this.options.axiosOptions
|
|
51
53
|
});
|
|
52
54
|
this.axios.interceptors.request.use((config) => {
|
|
@@ -316,9 +318,11 @@ class Strapi {
|
|
|
316
318
|
*
|
|
317
319
|
* @returns Promise<StrapiUser>
|
|
318
320
|
*/
|
|
319
|
-
async fetchUser() {
|
|
321
|
+
async fetchUser(params) {
|
|
320
322
|
try {
|
|
321
|
-
const user = await this.request("get", "/users/me"
|
|
323
|
+
const user = await this.request("get", "/users/me", {
|
|
324
|
+
params
|
|
325
|
+
});
|
|
322
326
|
this.user = user;
|
|
323
327
|
} catch (e) {
|
|
324
328
|
this.logout();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "strapi-sdk-js",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.5",
|
|
4
4
|
"description": "📦 Javascript SDK for your Strapi API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi",
|
|
@@ -49,6 +49,9 @@
|
|
|
49
49
|
"files": [
|
|
50
50
|
"dist/"
|
|
51
51
|
],
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">=16"
|
|
54
|
+
},
|
|
52
55
|
"scripts": {
|
|
53
56
|
"start": "rollup -c --watch",
|
|
54
57
|
"build": "rm -rf dist && rollup -c",
|
|
@@ -58,7 +61,7 @@
|
|
|
58
61
|
"test": "run-s build lint test:unit",
|
|
59
62
|
"test:unit": "jest",
|
|
60
63
|
"commit": "git-cz",
|
|
61
|
-
"docs:release": "
|
|
64
|
+
"docs:release": "node ./scripts/beforeRelease.js",
|
|
62
65
|
"release": "dotenv release-it --",
|
|
63
66
|
"prepare": "rollup -c"
|
|
64
67
|
},
|
|
@@ -70,13 +73,16 @@
|
|
|
70
73
|
"path": "./node_modules/cz-conventional-changelog"
|
|
71
74
|
}
|
|
72
75
|
},
|
|
76
|
+
"publishConfig": {
|
|
77
|
+
"registry": "https://registry.npmjs.org"
|
|
78
|
+
},
|
|
73
79
|
"dependencies": {
|
|
74
80
|
"@types/js-cookie": "^3.0.0",
|
|
75
81
|
"@types/qs": "^6.9.6",
|
|
76
|
-
"axios": "^0.
|
|
77
|
-
"defu": "^
|
|
78
|
-
"js-cookie": "^3.0.
|
|
79
|
-
"qs": "^6.
|
|
82
|
+
"axios": "^0.32.0",
|
|
83
|
+
"defu": "^6.1.5",
|
|
84
|
+
"js-cookie": "^3.0.7",
|
|
85
|
+
"qs": "^6.15.2",
|
|
80
86
|
"ufo": "^1.2.0"
|
|
81
87
|
},
|
|
82
88
|
"devDependencies": {
|