@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.
- package/dist/client/index.cjs +89 -42
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +2 -2
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +88 -43
- package/dist/client/index.js.map +1 -1
- package/dist/hooks/index.cjs +89 -42
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.cts +16 -4
- package/dist/hooks/index.d.ts +16 -4
- package/dist/hooks/index.js +88 -43
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.cjs +29 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -11
- package/dist/index.d.ts +13 -11
- package/dist/index.js +29 -7
- package/dist/index.js.map +1 -1
- package/dist/server/index.cjs +29 -7
- 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 +29 -7
- package/dist/server/index.js.map +1 -1
- package/dist/{types-CvO7Ijbs.d.cts → types-CM3v08Fh.d.cts} +31 -19
- package/dist/{types-CvO7Ijbs.d.ts → types-CM3v08Fh.d.ts} +31 -19
- package/package.json +1 -1
package/dist/server/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
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';
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
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';
|
package/dist/server/index.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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
|
-
...
|
|
3463
|
+
...createPasswordResetMutations2(fetcher)
|
|
3442
3464
|
};
|
|
3443
3465
|
}
|
|
3444
3466
|
|