@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.d.ts
CHANGED
|
@@ -165,6 +165,7 @@ declare class Strapi {
|
|
|
165
165
|
}>;
|
|
166
166
|
protected baseResetPassword<T>(password: string, code: string): Promise<AuthResponse<T>>;
|
|
167
167
|
protected baseChangePassword<T>(password: string, currentPassword: string): Promise<AuthResponse<T>>;
|
|
168
|
+
protected baseMe<T, Q>(data: Q): Promise<T>;
|
|
168
169
|
getLocales(params: RequestInit): Promise<Locale[]>;
|
|
169
170
|
getDocuments<T, Q extends object>(endpoint: string, data?: Q, params?: RequestInit): Promise<Response<T[]>>;
|
|
170
171
|
getDocument<T, Q extends object>(endpoint: string, data?: Q, params?: RequestInit): Promise<Response<T>>;
|
package/dist/index.mjs
CHANGED
|
@@ -21294,11 +21294,11 @@ class Strapi {
|
|
|
21294
21294
|
this.token = token;
|
|
21295
21295
|
}
|
|
21296
21296
|
async fetch(endpoint, data = {}, params = {}) {
|
|
21297
|
-
|
|
21298
|
-
return await this.fetchData(queryString ? `${endpoint}?${queryString}` : endpoint, { data }, params);
|
|
21297
|
+
return await this.fetchData(endpoint, { data }, params);
|
|
21299
21298
|
}
|
|
21300
21299
|
async fetchData(endpoint, data = {}, params = {}) {
|
|
21301
|
-
|
|
21300
|
+
const queryString = params.method === 'GET' ? qs.stringify(data) : '';
|
|
21301
|
+
return await this.baseFetch(queryString ? `${endpoint}?${queryString}` : endpoint, _.merge({
|
|
21302
21302
|
headers: {
|
|
21303
21303
|
'Content-Type': 'application/json',
|
|
21304
21304
|
},
|
|
@@ -21370,6 +21370,11 @@ class Strapi {
|
|
|
21370
21370
|
}
|
|
21371
21371
|
return response;
|
|
21372
21372
|
}
|
|
21373
|
+
async baseMe(data) {
|
|
21374
|
+
return await this.fetchData('users/me', data, {
|
|
21375
|
+
method: 'GET',
|
|
21376
|
+
});
|
|
21377
|
+
}
|
|
21373
21378
|
async getLocales(params) {
|
|
21374
21379
|
return await this.baseFetch('i18n/locales', _.merge({
|
|
21375
21380
|
headers: {
|