@malevich-studio/strapi-sdk-typescript 1.2.10 → 1.2.12
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/cli.cjs +12 -3
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +12 -3
- package/dist/cli.mjs.map +1 -1
- package/dist/index.cjs +8 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +8 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -21296,11 +21296,11 @@ class Strapi {
|
|
|
21296
21296
|
this.token = token;
|
|
21297
21297
|
}
|
|
21298
21298
|
async fetch(endpoint, data = {}, params = {}) {
|
|
21299
|
-
|
|
21300
|
-
return await this.fetchData(queryString ? `${endpoint}?${queryString}` : endpoint, { data }, params);
|
|
21299
|
+
return await this.fetchData(endpoint, { data }, params);
|
|
21301
21300
|
}
|
|
21302
21301
|
async fetchData(endpoint, data = {}, params = {}) {
|
|
21303
|
-
|
|
21302
|
+
const queryString = params.method === 'GET' ? qs.stringify(data) : '';
|
|
21303
|
+
return await this.baseFetch(queryString ? `${endpoint}?${queryString}` : endpoint, _.merge({
|
|
21304
21304
|
headers: {
|
|
21305
21305
|
'Content-Type': 'application/json',
|
|
21306
21306
|
},
|
|
@@ -21372,6 +21372,11 @@ class Strapi {
|
|
|
21372
21372
|
}
|
|
21373
21373
|
return response;
|
|
21374
21374
|
}
|
|
21375
|
+
async baseMe(data) {
|
|
21376
|
+
return await this.fetchData('users/me', data, {
|
|
21377
|
+
method: 'GET',
|
|
21378
|
+
});
|
|
21379
|
+
}
|
|
21375
21380
|
async getLocales(params) {
|
|
21376
21381
|
return await this.baseFetch('i18n/locales', _.merge({
|
|
21377
21382
|
headers: {
|