@malevich-studio/strapi-sdk-typescript 1.2.5 → 1.2.7
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 +5 -13
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +5 -13
- package/dist/cli.mjs.map +1 -1
- package/dist/index.cjs +5 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +5 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -20126,7 +20126,7 @@ class Strapi {
|
|
|
20126
20126
|
return this.token;
|
|
20127
20127
|
}
|
|
20128
20128
|
async baseLogin(identifier, password) {
|
|
20129
|
-
const response = await this.fetchData('
|
|
20129
|
+
const response = await this.fetchData('auth/local', {
|
|
20130
20130
|
identifier,
|
|
20131
20131
|
password
|
|
20132
20132
|
}, {
|
|
@@ -20138,7 +20138,7 @@ class Strapi {
|
|
|
20138
20138
|
return response;
|
|
20139
20139
|
}
|
|
20140
20140
|
async baseRegister(data) {
|
|
20141
|
-
const response = await this.fetchData('
|
|
20141
|
+
const response = await this.fetchData('auth/local/register', data, {
|
|
20142
20142
|
method: 'POST',
|
|
20143
20143
|
});
|
|
20144
20144
|
if (!response.error) {
|
|
@@ -20147,7 +20147,7 @@ class Strapi {
|
|
|
20147
20147
|
return response;
|
|
20148
20148
|
}
|
|
20149
20149
|
async forgotPassword(email) {
|
|
20150
|
-
return await this.fetchData('
|
|
20150
|
+
return await this.fetchData('auth/forgot-password', { email }, {
|
|
20151
20151
|
method: 'POST',
|
|
20152
20152
|
});
|
|
20153
20153
|
}
|
|
@@ -20157,7 +20157,7 @@ class Strapi {
|
|
|
20157
20157
|
});
|
|
20158
20158
|
}
|
|
20159
20159
|
async baseResetPassword(password, code) {
|
|
20160
|
-
const response = await this.fetchData('
|
|
20160
|
+
const response = await this.fetchData('auth/reset-password', {
|
|
20161
20161
|
password,
|
|
20162
20162
|
passwordConfirmation: password,
|
|
20163
20163
|
code,
|
|
@@ -20170,7 +20170,7 @@ class Strapi {
|
|
|
20170
20170
|
return response;
|
|
20171
20171
|
}
|
|
20172
20172
|
async baseChangePassword(password, currentPassword) {
|
|
20173
|
-
const response = await this.fetchData('
|
|
20173
|
+
const response = await this.fetchData('auth/change-password', {
|
|
20174
20174
|
password,
|
|
20175
20175
|
passwordConfirmation: password,
|
|
20176
20176
|
currentPassword,
|
|
@@ -20234,14 +20234,6 @@ class Strapi {
|
|
|
20234
20234
|
}
|
|
20235
20235
|
} : {}),
|
|
20236
20236
|
}, params));
|
|
20237
|
-
if (!response.ok) {
|
|
20238
|
-
console.log(`${this.url}/api/${endpoint}`);
|
|
20239
|
-
console.log(response);
|
|
20240
|
-
const data = await response.json();
|
|
20241
|
-
console.log(data);
|
|
20242
|
-
console.log(data?.error?.details?.errors);
|
|
20243
|
-
throw new Error(`Помилка запиту до Strapi: ${response.status} ${response.statusText}`);
|
|
20244
|
-
}
|
|
20245
20237
|
return (await response.json());
|
|
20246
20238
|
}
|
|
20247
20239
|
}
|