@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.mjs
CHANGED
|
@@ -20106,7 +20106,7 @@ class Strapi {
|
|
|
20106
20106
|
return this.token;
|
|
20107
20107
|
}
|
|
20108
20108
|
async baseLogin(identifier, password) {
|
|
20109
|
-
const response = await this.fetchData('
|
|
20109
|
+
const response = await this.fetchData('auth/local', {
|
|
20110
20110
|
identifier,
|
|
20111
20111
|
password
|
|
20112
20112
|
}, {
|
|
@@ -20118,7 +20118,7 @@ class Strapi {
|
|
|
20118
20118
|
return response;
|
|
20119
20119
|
}
|
|
20120
20120
|
async baseRegister(data) {
|
|
20121
|
-
const response = await this.fetchData('
|
|
20121
|
+
const response = await this.fetchData('auth/local/register', data, {
|
|
20122
20122
|
method: 'POST',
|
|
20123
20123
|
});
|
|
20124
20124
|
if (!response.error) {
|
|
@@ -20127,7 +20127,7 @@ class Strapi {
|
|
|
20127
20127
|
return response;
|
|
20128
20128
|
}
|
|
20129
20129
|
async forgotPassword(email) {
|
|
20130
|
-
return await this.fetchData('
|
|
20130
|
+
return await this.fetchData('auth/forgot-password', { email }, {
|
|
20131
20131
|
method: 'POST',
|
|
20132
20132
|
});
|
|
20133
20133
|
}
|
|
@@ -20137,7 +20137,7 @@ class Strapi {
|
|
|
20137
20137
|
});
|
|
20138
20138
|
}
|
|
20139
20139
|
async baseResetPassword(password, code) {
|
|
20140
|
-
const response = await this.fetchData('
|
|
20140
|
+
const response = await this.fetchData('auth/reset-password', {
|
|
20141
20141
|
password,
|
|
20142
20142
|
passwordConfirmation: password,
|
|
20143
20143
|
code,
|
|
@@ -20150,7 +20150,7 @@ class Strapi {
|
|
|
20150
20150
|
return response;
|
|
20151
20151
|
}
|
|
20152
20152
|
async baseChangePassword(password, currentPassword) {
|
|
20153
|
-
const response = await this.fetchData('
|
|
20153
|
+
const response = await this.fetchData('auth/change-password', {
|
|
20154
20154
|
password,
|
|
20155
20155
|
passwordConfirmation: password,
|
|
20156
20156
|
currentPassword,
|
|
@@ -20214,14 +20214,6 @@ class Strapi {
|
|
|
20214
20214
|
}
|
|
20215
20215
|
} : {}),
|
|
20216
20216
|
}, params));
|
|
20217
|
-
if (!response.ok) {
|
|
20218
|
-
console.log(`${this.url}/api/${endpoint}`);
|
|
20219
|
-
console.log(response);
|
|
20220
|
-
const data = await response.json();
|
|
20221
|
-
console.log(data);
|
|
20222
|
-
console.log(data?.error?.details?.errors);
|
|
20223
|
-
throw new Error(`Помилка запиту до Strapi: ${response.status} ${response.statusText}`);
|
|
20224
|
-
}
|
|
20225
20217
|
return (await response.json());
|
|
20226
20218
|
}
|
|
20227
20219
|
}
|