@szymonpiatek/nextwordpress 0.0.15 → 0.0.16

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.
@@ -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,41 @@ 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
+ user {
3403
+ email
3404
+ }
3405
+ }
3406
+ }
3407
+ `;
3408
+ var GQL_RESET_USER_PASSWORD = `
3409
+ mutation ResetUserPassword($input: ResetUserPasswordInput!) {
3410
+ resetUserPassword(input: $input) {
3411
+ user {
3412
+ id
3413
+ databaseId
3414
+ email
3415
+ }
3416
+ }
3417
+ }
3418
+ `;
3419
+ function createPasswordResetMutations(fetcher) {
3420
+ const { gqlMutate } = fetcher;
3421
+ async function sendPasswordResetEmail(input) {
3422
+ const data = await gqlMutate(GQL_SEND_PASSWORD_RESET_EMAIL, { input });
3423
+ return data.sendPasswordResetEmail;
3424
+ }
3425
+ async function resetUserPassword(input) {
3426
+ const data = await gqlMutate(GQL_RESET_USER_PASSWORD, { input });
3427
+ return data.resetUserPassword;
3428
+ }
3429
+ return { sendPasswordResetEmail, resetUserPassword };
3430
+ }
3431
+
3391
3432
  // src/integrations/wpGraphQL/core/mutations/index.ts
3392
3433
  function createWPGraphQLMutationsClient(config) {
3393
3434
  const fetcher = createWPGraphQLFetcher(config);
@@ -3398,7 +3439,8 @@ function createWPGraphQLMutationsClient(config) {
3398
3439
  ...createCategoriesMutations3(fetcher),
3399
3440
  ...createTagsMutations3(fetcher),
3400
3441
  ...createAuthorsMutations2(fetcher),
3401
- ...createMediaMutations2(fetcher)
3442
+ ...createMediaMutations2(fetcher),
3443
+ ...createPasswordResetMutations(fetcher)
3402
3444
  };
3403
3445
  }
3404
3446