@szymonpiatek/nextwordpress 0.0.16 → 0.0.18

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.
@@ -1,2 +1,2 @@
1
- export { E as AuthenticationError, A as Author, H as BlockType, I as CF7Error, s as CF7SubmissionResponse, K as CF7SubmissionStatus, L as CF7ValidationError, C as CookieConsentCategories, M as CookieConsentConfig, O as EditorBlock, Q as EmbeddedAuthor, S as EmbeddedTerm, V as ErrorCode, F as FeaturedMedia, l as GQLConnection, X as GQLError, Y as GQLPageInfo, j as GQLPost, k as GQLPostFilter, D as GQLResetUserPasswordInput, a as GQLResetUserPasswordResult, B as GQLSendPasswordResetEmailInput, G as GQLSendPasswordResetEmailResult, J as JwtAuthCredentials, t as JwtAuthResponse, Z as MediaDetails, _ as MediaSize, N as NextWordpressConfig, P as Post, $ as PostEmbedded, v as RenderedContent, R as RenderedTitle, a0 as SearchResult, T as Taxonomy, a1 as TemplatePart, U as UpdateCustomerInput, y as WCAddress, g as WCCreateOrderInput, i as WCCustomer, a2 as WCDimensions, w as WCImage, h as WCOrder, a3 as WCOrderLineItem, d as WCProduct, a4 as WCProductAttribute, a5 as WCProductDefaultAttribute, e as WCProductFilterParams, x as WCProductVariation, a6 as WCShippingLine, u as WPEntity, W as WPGraphQLConfig, a7 as WPGraphQLError, q as WPULikeCheckParams, r as WPULikeCheckResponse, a8 as WPULikeItemType, n as WPULikeStats, m as WPULikeStatsParams, o as WPULikeStatus, z as WPULikeVoteParams, p as WPULikeVoteResponse, c as WooCommerceConfig, a9 as WooCommerceError, aa as WooCommercePaginationHeaders, f as WooCommerceResponse, ab as WordPressAPIError, ac as createCookieConsentHandler, ad as defaultMessages, ae as defaultMessagesPl, af as parseCookieConsent, ag as resolveMessage } from '../types-CvO7Ijbs.cjs';
1
+ export { L as AuthenticationError, A as Author, M as BlockType, O as CF7Error, t as CF7SubmissionResponse, Q as CF7SubmissionStatus, S as CF7ValidationError, C as CookieConsentCategories, V as CookieConsentConfig, X as EditorBlock, Y as EmbeddedAuthor, Z as EmbeddedTerm, _ as ErrorCode, F as FeaturedMedia, m as GQLConnection, $ as GQLError, a0 as GQLPageInfo, k as GQLPost, l as GQLPostFilter, K as GQLResetUserPasswordInput, a as GQLResetUserPasswordResult, I as GQLSendPasswordResetEmailInput, G as GQLSendPasswordResetEmailResult, J as JwtAuthCredentials, u as JwtAuthResponse, a1 as MediaDetails, a2 as MediaSize, N as NextWordpressConfig, P as Post, a3 as PostEmbedded, x as RenderedContent, w as RenderedTitle, a4 as SearchResult, T as Taxonomy, a5 as TemplatePart, U as UpdateCustomerInput, E as WCAddress, h as WCCreateOrderInput, j as WCCustomer, a6 as WCDimensions, B as WCImage, i as WCOrder, a7 as WCOrderLineItem, e as WCProduct, a8 as WCProductAttribute, a9 as WCProductDefaultAttribute, f as WCProductFilterParams, D as WCProductVariation, aa as WCShippingLine, v as WPEntity, W as WPGraphQLConfig, ab as WPGraphQLError, r as WPULikeCheckParams, s as WPULikeCheckResponse, ac as WPULikeItemType, o as WPULikeStats, n as WPULikeStatsParams, p as WPULikeStatus, H as WPULikeVoteParams, q as WPULikeVoteResponse, d as WooCommerceConfig, ad as WooCommerceError, ae as WooCommercePaginationHeaders, g as WooCommerceResponse, af as WordPressAPIError, ag as createCookieConsentHandler, ah as defaultMessages, ai as defaultMessagesPl, aj as parseCookieConsent, ak as resolveMessage } from '../types-CM3v08Fh.cjs';
2
2
  export { Category, Comment, CommentAuthorAvatar, CreateAttributeTermInput, CreateAuthorInput, CreateCategoryInput, CreateCommentInput, CreateCouponInput, CreateMenuInput, CreateMenuItemInput, CreatePageInput, CreatePostInput, CreateProductAttributeInput, CreateProductCategoryInput, CreateProductInput, CreateProductReviewInput, CreateProductTagInput, CreateShippingClassInput, CreateShippingZoneInput, CreateShippingZoneMethodInput, CreateTagInput, CreateTaxClassInput, CreateTaxRateInput, CreateWebhookInput, FaustConfig, FaustPreviewConfig, FaustPreviewDeps, GQLACFFieldGroup, GQLAuthor, GQLCPTNode, GQLCategory, GQLCreateCommentInput, GQLCreateCommentResult, GQLCreatePostInput, GQLCustomer, GQLDeletePostResult, GQLLineItem, GQLMutatedComment, GQLMutatedPost, GQLOrder, GQLOrderAddress, GQLPage, GQLPageWithSEO, GQLPostStatus, GQLPostWithSEO, GQLProduct, GQLProductFilter, GQLProductVariation, GQLTag, GQLUpdatePostInput, GQLYoastSEO, Menu, MenuItem, MenuLocation, MenuWithItems, OmnibusPriceEntry, OmnibusProductData, Page, RestPageStatus, RestPostStatus, RevalidationConfig, RevalidationPayload, RevalidationResult, Tag, UpdateAttributeTermInput, UpdateAuthorInput, UpdateCategoryInput, UpdateCommentInput, UpdateCouponInput, UpdateMediaInput, UpdateMenuInput, UpdateMenuItemInput, UpdatePageInput, UpdatePostInput, UpdateProductAttributeInput, UpdateProductCategoryInput, UpdateProductInput, UpdateProductReviewInput, UpdateProductTagInput, UpdateShippingClassInput, UpdateShippingZoneInput, UpdateShippingZoneMethodInput, UpdateTagInput, UpdateTaxRateInput, UpdateWebhookInput, UploadMediaInput, WCAttributeTerm, WCContinent, WCCountry, WCCoupon, WCCreateOrderNoteInput, WCCreateOrderRefundInput, WCCurrency, WCGlobalProductAttribute, WCOrderNote, WCOrderRefund, WCPaymentGateway, WCPaymentGatewaySetting, WCProductCategory, WCProductReview, WCProductReviewFilterParams, WCProductStatus, WCProductTag, WCProductVariationWithOmnibus, WCProductWithOmnibus, WCRefundLineItem, WCReviewStatus, WCSalesReport, WCSalesReportParams, WCSettingGroup, WCSettingOption, WCShippingClass, WCShippingMethod, WCShippingZone, WCShippingZoneLocation, WCShippingZoneMethod, WCStatusCount, WCSystemStatus, WCSystemStatusTool, WCTaxClass, WCTaxRate, WCTopSeller, WCTopSellersParams, WCWebhook, WCWebhookStatus, WCWebhookTopic, WPGraphQLFetcher, WooCommerceFetcher, authenticateJwt, buildACFFragment, buildPageWithACFQuery, buildPostWithACFQuery, buildPostsWithACFQuery, createApplicationPasswordToken, createAuthorsMutations, createCF7Queries, createCPTQueries, createCategoriesMutations, createCommentsMutations, createFaustAuthHandler, createMediaMutations, createMenusMutations, createPagesMutations, createPostsMutations, createPreviewHandler, createRevalidationHandler, createTagsMutations, createWPGraphQLClient, createWPGraphQLClient as createWPGraphQLCoreClient, createWPGraphQLFetcher, createWPGraphQLMutationsClient, createWPGraphQLWooCommerceClient, createWPULikeClient, createWPULikeQueries, createWooCommerceClient, createWooCommerceFetcher, createWordPressClient, createWordPressMutationsClient, createYoastQueries, extractOmnibusData, resolveBaseUrl, validateJwtToken, withOmnibus, withOmnibusVariation } from '../index.cjs';
@@ -1,2 +1,2 @@
1
- export { E as AuthenticationError, A as Author, H as BlockType, I as CF7Error, s as CF7SubmissionResponse, K as CF7SubmissionStatus, L as CF7ValidationError, C as CookieConsentCategories, M as CookieConsentConfig, O as EditorBlock, Q as EmbeddedAuthor, S as EmbeddedTerm, V as ErrorCode, F as FeaturedMedia, l as GQLConnection, X as GQLError, Y as GQLPageInfo, j as GQLPost, k as GQLPostFilter, D as GQLResetUserPasswordInput, a as GQLResetUserPasswordResult, B as GQLSendPasswordResetEmailInput, G as GQLSendPasswordResetEmailResult, J as JwtAuthCredentials, t as JwtAuthResponse, Z as MediaDetails, _ as MediaSize, N as NextWordpressConfig, P as Post, $ as PostEmbedded, v as RenderedContent, R as RenderedTitle, a0 as SearchResult, T as Taxonomy, a1 as TemplatePart, U as UpdateCustomerInput, y as WCAddress, g as WCCreateOrderInput, i as WCCustomer, a2 as WCDimensions, w as WCImage, h as WCOrder, a3 as WCOrderLineItem, d as WCProduct, a4 as WCProductAttribute, a5 as WCProductDefaultAttribute, e as WCProductFilterParams, x as WCProductVariation, a6 as WCShippingLine, u as WPEntity, W as WPGraphQLConfig, a7 as WPGraphQLError, q as WPULikeCheckParams, r as WPULikeCheckResponse, a8 as WPULikeItemType, n as WPULikeStats, m as WPULikeStatsParams, o as WPULikeStatus, z as WPULikeVoteParams, p as WPULikeVoteResponse, c as WooCommerceConfig, a9 as WooCommerceError, aa as WooCommercePaginationHeaders, f as WooCommerceResponse, ab as WordPressAPIError, ac as createCookieConsentHandler, ad as defaultMessages, ae as defaultMessagesPl, af as parseCookieConsent, ag as resolveMessage } from '../types-CvO7Ijbs.js';
1
+ export { L as AuthenticationError, A as Author, M as BlockType, O as CF7Error, t as CF7SubmissionResponse, Q as CF7SubmissionStatus, S as CF7ValidationError, C as CookieConsentCategories, V as CookieConsentConfig, X as EditorBlock, Y as EmbeddedAuthor, Z as EmbeddedTerm, _ as ErrorCode, F as FeaturedMedia, m as GQLConnection, $ as GQLError, a0 as GQLPageInfo, k as GQLPost, l as GQLPostFilter, K as GQLResetUserPasswordInput, a as GQLResetUserPasswordResult, I as GQLSendPasswordResetEmailInput, G as GQLSendPasswordResetEmailResult, J as JwtAuthCredentials, u as JwtAuthResponse, a1 as MediaDetails, a2 as MediaSize, N as NextWordpressConfig, P as Post, a3 as PostEmbedded, x as RenderedContent, w as RenderedTitle, a4 as SearchResult, T as Taxonomy, a5 as TemplatePart, U as UpdateCustomerInput, E as WCAddress, h as WCCreateOrderInput, j as WCCustomer, a6 as WCDimensions, B as WCImage, i as WCOrder, a7 as WCOrderLineItem, e as WCProduct, a8 as WCProductAttribute, a9 as WCProductDefaultAttribute, f as WCProductFilterParams, D as WCProductVariation, aa as WCShippingLine, v as WPEntity, W as WPGraphQLConfig, ab as WPGraphQLError, r as WPULikeCheckParams, s as WPULikeCheckResponse, ac as WPULikeItemType, o as WPULikeStats, n as WPULikeStatsParams, p as WPULikeStatus, H as WPULikeVoteParams, q as WPULikeVoteResponse, d as WooCommerceConfig, ad as WooCommerceError, ae as WooCommercePaginationHeaders, g as WooCommerceResponse, af as WordPressAPIError, ag as createCookieConsentHandler, ah as defaultMessages, ai as defaultMessagesPl, aj as parseCookieConsent, ak as resolveMessage } from '../types-CM3v08Fh.js';
2
2
  export { Category, Comment, CommentAuthorAvatar, CreateAttributeTermInput, CreateAuthorInput, CreateCategoryInput, CreateCommentInput, CreateCouponInput, CreateMenuInput, CreateMenuItemInput, CreatePageInput, CreatePostInput, CreateProductAttributeInput, CreateProductCategoryInput, CreateProductInput, CreateProductReviewInput, CreateProductTagInput, CreateShippingClassInput, CreateShippingZoneInput, CreateShippingZoneMethodInput, CreateTagInput, CreateTaxClassInput, CreateTaxRateInput, CreateWebhookInput, FaustConfig, FaustPreviewConfig, FaustPreviewDeps, GQLACFFieldGroup, GQLAuthor, GQLCPTNode, GQLCategory, GQLCreateCommentInput, GQLCreateCommentResult, GQLCreatePostInput, GQLCustomer, GQLDeletePostResult, GQLLineItem, GQLMutatedComment, GQLMutatedPost, GQLOrder, GQLOrderAddress, GQLPage, GQLPageWithSEO, GQLPostStatus, GQLPostWithSEO, GQLProduct, GQLProductFilter, GQLProductVariation, GQLTag, GQLUpdatePostInput, GQLYoastSEO, Menu, MenuItem, MenuLocation, MenuWithItems, OmnibusPriceEntry, OmnibusProductData, Page, RestPageStatus, RestPostStatus, RevalidationConfig, RevalidationPayload, RevalidationResult, Tag, UpdateAttributeTermInput, UpdateAuthorInput, UpdateCategoryInput, UpdateCommentInput, UpdateCouponInput, UpdateMediaInput, UpdateMenuInput, UpdateMenuItemInput, UpdatePageInput, UpdatePostInput, UpdateProductAttributeInput, UpdateProductCategoryInput, UpdateProductInput, UpdateProductReviewInput, UpdateProductTagInput, UpdateShippingClassInput, UpdateShippingZoneInput, UpdateShippingZoneMethodInput, UpdateTagInput, UpdateTaxRateInput, UpdateWebhookInput, UploadMediaInput, WCAttributeTerm, WCContinent, WCCountry, WCCoupon, WCCreateOrderNoteInput, WCCreateOrderRefundInput, WCCurrency, WCGlobalProductAttribute, WCOrderNote, WCOrderRefund, WCPaymentGateway, WCPaymentGatewaySetting, WCProductCategory, WCProductReview, WCProductReviewFilterParams, WCProductStatus, WCProductTag, WCProductVariationWithOmnibus, WCProductWithOmnibus, WCRefundLineItem, WCReviewStatus, WCSalesReport, WCSalesReportParams, WCSettingGroup, WCSettingOption, WCShippingClass, WCShippingMethod, WCShippingZone, WCShippingZoneLocation, WCShippingZoneMethod, WCStatusCount, WCSystemStatus, WCSystemStatusTool, WCTaxClass, WCTaxRate, WCTopSeller, WCTopSellersParams, WCWebhook, WCWebhookStatus, WCWebhookTopic, WPGraphQLFetcher, WooCommerceFetcher, authenticateJwt, buildACFFragment, buildPageWithACFQuery, buildPostWithACFQuery, buildPostsWithACFQuery, createApplicationPasswordToken, createAuthorsMutations, createCF7Queries, createCPTQueries, createCategoriesMutations, createCommentsMutations, createFaustAuthHandler, createMediaMutations, createMenusMutations, createPagesMutations, createPostsMutations, createPreviewHandler, createRevalidationHandler, createTagsMutations, createWPGraphQLClient, createWPGraphQLClient as createWPGraphQLCoreClient, createWPGraphQLFetcher, createWPGraphQLMutationsClient, createWPGraphQLWooCommerceClient, createWPULikeClient, createWPULikeQueries, createWooCommerceClient, createWooCommerceFetcher, createWordPressClient, createWordPressMutationsClient, createYoastQueries, extractOmnibusData, resolveBaseUrl, validateJwtToken, withOmnibus, withOmnibusVariation } from '../index.js';
@@ -307,6 +307,26 @@ function createMediaMutations(fetcher) {
307
307
  return { uploadMedia, updateMedia, deleteMedia };
308
308
  }
309
309
 
310
+ // src/integrations/restApi/core/mutations/passwordReset/mutations.ts
311
+ function createPasswordResetMutations(fetcher) {
312
+ const { wpMutate } = fetcher;
313
+ async function sendPasswordResetEmail(input) {
314
+ return wpMutate(
315
+ "/wp-json/wp/v2/users/lost-password",
316
+ input,
317
+ "POST"
318
+ );
319
+ }
320
+ async function resetUserPassword(input) {
321
+ return wpMutate(
322
+ "/wp-json/wp/v2/users/reset-password",
323
+ input,
324
+ "POST"
325
+ );
326
+ }
327
+ return { sendPasswordResetEmail, resetUserPassword };
328
+ }
329
+
310
330
  // src/integrations/restApi/core/client/types.ts
311
331
  var WordPressAPIError = class extends Error {
312
332
  constructor(code, status, endpoint, message, detail) {
@@ -441,7 +461,8 @@ function createWordPressMutationsClient(config) {
441
461
  ...createTagsMutations(fetcher),
442
462
  ...createAuthorsMutations(fetcher),
443
463
  ...createMenusMutations(fetcher),
444
- ...createMediaMutations(fetcher)
464
+ ...createMediaMutations(fetcher),
465
+ ...createPasswordResetMutations(fetcher)
445
466
  };
446
467
  }
447
468
 
@@ -3397,9 +3418,6 @@ var GQL_SEND_PASSWORD_RESET_EMAIL = `
3397
3418
  mutation SendPasswordResetEmail($input: SendPasswordResetEmailInput!) {
3398
3419
  sendPasswordResetEmail(input: $input) {
3399
3420
  success
3400
- user {
3401
- email
3402
- }
3403
3421
  }
3404
3422
  }
3405
3423
  `;
@@ -3414,11 +3432,15 @@ var GQL_RESET_USER_PASSWORD = `
3414
3432
  }
3415
3433
  }
3416
3434
  `;
3417
- function createPasswordResetMutations(fetcher) {
3435
+ function createPasswordResetMutations2(fetcher) {
3418
3436
  const { gqlMutate } = fetcher;
3419
3437
  async function sendPasswordResetEmail(input) {
3420
3438
  const data = await gqlMutate(GQL_SEND_PASSWORD_RESET_EMAIL, { input });
3421
- return data.sendPasswordResetEmail;
3439
+ const result = data.sendPasswordResetEmail;
3440
+ if (!result.success) {
3441
+ throw new WPGraphQLError(ErrorCode.GQL_ERRORS_IN_RESPONSE, 200, "sendPasswordResetEmail", "User not found");
3442
+ }
3443
+ return result;
3422
3444
  }
3423
3445
  async function resetUserPassword(input) {
3424
3446
  const data = await gqlMutate(GQL_RESET_USER_PASSWORD, { input });
@@ -3438,7 +3460,7 @@ function createWPGraphQLMutationsClient(config) {
3438
3460
  ...createTagsMutations3(fetcher),
3439
3461
  ...createAuthorsMutations2(fetcher),
3440
3462
  ...createMediaMutations2(fetcher),
3441
- ...createPasswordResetMutations(fetcher)
3463
+ ...createPasswordResetMutations2(fetcher)
3442
3464
  };
3443
3465
  }
3444
3466