@szymonpiatek/nextwordpress 0.0.15 → 0.0.17
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/client/index.cjs +182 -118
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +3 -3
- package/dist/client/index.d.ts +3 -3
- package/dist/client/index.js +180 -118
- package/dist/client/index.js.map +1 -1
- package/dist/hooks/index.cjs +182 -118
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.cts +15 -3
- package/dist/hooks/index.d.ts +15 -3
- package/dist/hooks/index.js +180 -118
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.cjs +44 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -10
- package/dist/index.d.ts +12 -10
- package/dist/index.js +44 -1
- package/dist/index.js.map +1 -1
- package/dist/server/index.cjs +44 -1
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +44 -1
- package/dist/server/index.js.map +1 -1
- package/dist/{types-D6rih4G8.d.cts → types-DVzJO3P-.d.cts} +49 -28
- package/dist/{types-D6rih4G8.d.ts → types-DVzJO3P-.d.ts} +49 -28
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -39,6 +39,8 @@ var ErrorCode = {
|
|
|
39
39
|
AUTH_JWT_FAILED: "AUTH_JWT_FAILED",
|
|
40
40
|
AUTH_CREDENTIALS_INVALID: "AUTH_CREDENTIALS_INVALID",
|
|
41
41
|
AUTH_TOKEN_INVALID: "AUTH_TOKEN_INVALID",
|
|
42
|
+
AUTH_PASSWORD_RESET_REQUESTED: "AUTH_PASSWORD_RESET_REQUESTED",
|
|
43
|
+
AUTH_PASSWORD_RESET_FAILED: "AUTH_PASSWORD_RESET_FAILED",
|
|
42
44
|
// Contact Form 7
|
|
43
45
|
CF7_MAIL_SENT: "CF7_MAIL_SENT",
|
|
44
46
|
CF7_MAIL_FAILED: "CF7_MAIL_FAILED",
|
|
@@ -70,6 +72,8 @@ var defaultMessages = {
|
|
|
70
72
|
AUTH_JWT_FAILED: "JWT authentication failed",
|
|
71
73
|
AUTH_CREDENTIALS_INVALID: "Invalid credentials",
|
|
72
74
|
AUTH_TOKEN_INVALID: "JWT token is invalid or expired",
|
|
75
|
+
AUTH_PASSWORD_RESET_REQUESTED: "Password reset email sent. Check your inbox.",
|
|
76
|
+
AUTH_PASSWORD_RESET_FAILED: "Password reset failed. The link may be invalid or expired.",
|
|
73
77
|
CF7_MAIL_SENT: "Thank you for your message.",
|
|
74
78
|
CF7_MAIL_FAILED: "There was an error trying to send your message.",
|
|
75
79
|
CF7_VALIDATION_FAILED: "One or more fields have an error. Please check and try again.",
|
|
@@ -100,6 +104,8 @@ var defaultMessagesPl = {
|
|
|
100
104
|
AUTH_JWT_FAILED: "B\u0142\u0105d uwierzytelnienia JWT",
|
|
101
105
|
AUTH_CREDENTIALS_INVALID: "Nieprawid\u0142owe dane logowania",
|
|
102
106
|
AUTH_TOKEN_INVALID: "Token JWT jest nieprawid\u0142owy lub wygas\u0142",
|
|
107
|
+
AUTH_PASSWORD_RESET_REQUESTED: "E-mail z resetowaniem has\u0142a zosta\u0142 wys\u0142any. Sprawd\u017A skrzynk\u0119.",
|
|
108
|
+
AUTH_PASSWORD_RESET_FAILED: "Resetowanie has\u0142a nie powiod\u0142o si\u0119. Link mo\u017Ce by\u0107 nieprawid\u0142owy lub wygas\u0142.",
|
|
103
109
|
CF7_MAIL_SENT: "Dzi\u0119kujemy za wiadomo\u015B\u0107.",
|
|
104
110
|
CF7_MAIL_FAILED: "Wyst\u0105pi\u0142 b\u0142\u0105d podczas wysy\u0142ania wiadomo\u015Bci.",
|
|
105
111
|
CF7_VALIDATION_FAILED: "Jedno lub wi\u0119cej p\xF3l zawiera b\u0142\u0105d. Sprawd\u017A i spr\xF3buj ponownie.",
|
|
@@ -3388,6 +3394,42 @@ function createMediaMutations2(fetcher) {
|
|
|
3388
3394
|
return { createMediaItem, updateMediaItem, deleteMediaItem };
|
|
3389
3395
|
}
|
|
3390
3396
|
|
|
3397
|
+
// src/integrations/wpGraphQL/core/mutations/passwordReset/mutations.ts
|
|
3398
|
+
var GQL_SEND_PASSWORD_RESET_EMAIL = `
|
|
3399
|
+
mutation SendPasswordResetEmail($input: SendPasswordResetEmailInput!) {
|
|
3400
|
+
sendPasswordResetEmail(input: $input) {
|
|
3401
|
+
success
|
|
3402
|
+
}
|
|
3403
|
+
}
|
|
3404
|
+
`;
|
|
3405
|
+
var GQL_RESET_USER_PASSWORD = `
|
|
3406
|
+
mutation ResetUserPassword($input: ResetUserPasswordInput!) {
|
|
3407
|
+
resetUserPassword(input: $input) {
|
|
3408
|
+
user {
|
|
3409
|
+
id
|
|
3410
|
+
databaseId
|
|
3411
|
+
email
|
|
3412
|
+
}
|
|
3413
|
+
}
|
|
3414
|
+
}
|
|
3415
|
+
`;
|
|
3416
|
+
function createPasswordResetMutations(fetcher) {
|
|
3417
|
+
const { gqlMutate } = fetcher;
|
|
3418
|
+
async function sendPasswordResetEmail(input) {
|
|
3419
|
+
const data = await gqlMutate(GQL_SEND_PASSWORD_RESET_EMAIL, { input });
|
|
3420
|
+
const result = data.sendPasswordResetEmail;
|
|
3421
|
+
if (!result.success) {
|
|
3422
|
+
throw new WPGraphQLError(ErrorCode.GQL_ERRORS_IN_RESPONSE, 200, "sendPasswordResetEmail", "User not found");
|
|
3423
|
+
}
|
|
3424
|
+
return result;
|
|
3425
|
+
}
|
|
3426
|
+
async function resetUserPassword(input) {
|
|
3427
|
+
const data = await gqlMutate(GQL_RESET_USER_PASSWORD, { input });
|
|
3428
|
+
return data.resetUserPassword;
|
|
3429
|
+
}
|
|
3430
|
+
return { sendPasswordResetEmail, resetUserPassword };
|
|
3431
|
+
}
|
|
3432
|
+
|
|
3391
3433
|
// src/integrations/wpGraphQL/core/mutations/index.ts
|
|
3392
3434
|
function createWPGraphQLMutationsClient(config) {
|
|
3393
3435
|
const fetcher = createWPGraphQLFetcher(config);
|
|
@@ -3398,7 +3440,8 @@ function createWPGraphQLMutationsClient(config) {
|
|
|
3398
3440
|
...createCategoriesMutations3(fetcher),
|
|
3399
3441
|
...createTagsMutations3(fetcher),
|
|
3400
3442
|
...createAuthorsMutations2(fetcher),
|
|
3401
|
-
...createMediaMutations2(fetcher)
|
|
3443
|
+
...createMediaMutations2(fetcher),
|
|
3444
|
+
...createPasswordResetMutations(fetcher)
|
|
3402
3445
|
};
|
|
3403
3446
|
}
|
|
3404
3447
|
|