@szymonpiatek/nextwordpress 0.0.11 → 0.0.13
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 +118 -6
- 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 +115 -7
- package/dist/client/index.js.map +1 -1
- package/dist/hooks/index.cjs +118 -6
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.cts +18 -2
- package/dist/hooks/index.d.ts +18 -2
- package/dist/hooks/index.js +115 -7
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.cjs +89 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -3
- package/dist/index.d.ts +14 -3
- package/dist/index.js +86 -1
- package/dist/index.js.map +1 -1
- package/dist/server/index.cjs +89 -0
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +2 -2
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +86 -1
- package/dist/server/index.js.map +1 -1
- package/dist/{types-Dxb6tuW_.d.cts → types-BELSHjQr.d.cts} +45 -1
- package/dist/{types-Dxb6tuW_.d.ts → types-BELSHjQr.d.ts} +45 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as NextWordpressConfig, J as JwtAuthCredentials,
|
|
2
|
-
export {
|
|
1
|
+
import { N as NextWordpressConfig, J as JwtAuthCredentials, q as JwtAuthResponse, a as WooCommerceConfig, d as WooCommerceResponse, W as WordPressResponse, T as Taxonomy, r as WPEntity, R as RenderedTitle, s as RenderedContent, P as Post, A as Author, F as FeaturedMedia, t as WCImage, u as WCProductVariation, b as WCProduct, g as WCCustomer, v as WCAddress, U as UpdateCustomerInput, e as WCCreateOrderInput, f as WCOrder, c as WCProductFilterParams, k as WPULikeStatsParams, l as WPULikeStats, o as WPULikeCheckParams, p as WPULikeCheckResponse, w as WPULikeVoteParams, n as WPULikeVoteResponse, h as WPGraphQLConfig, j as GQLConnection, i as GQLPostFilter, G as GQLPost } from './types-BELSHjQr.cjs';
|
|
2
|
+
export { x as AuthenticationError, B as BlockType, C as CookieConsentCategories, y as CookieConsentConfig, E as EditorBlock, z as EmbeddedAuthor, D as EmbeddedTerm, H as ErrorCode, I as GQLError, K as GQLPageInfo, M as MediaDetails, L as MediaSize, O as PostEmbedded, S as SearchResult, Q as TemplatePart, V as WCDimensions, X as WCOrderLineItem, Y as WCProductAttribute, Z as WCProductDefaultAttribute, _ as WCShippingLine, $ as WPGraphQLError, a0 as WPULikeItemType, m as WPULikeStatus, a1 as WooCommerceError, a2 as WooCommercePaginationHeaders, a3 as WordPressAPIError, a4 as createCookieConsentHandler, a5 as defaultMessages, a6 as defaultMessagesPl, a7 as parseCookieConsent, a8 as resolveMessage } from './types-BELSHjQr.cjs';
|
|
3
3
|
|
|
4
4
|
declare function createApplicationPasswordToken(username: string, appPassword: string): string;
|
|
5
5
|
|
|
@@ -1253,6 +1253,17 @@ declare function createWooCommerceClient(config: WooCommerceConfig): {
|
|
|
1253
1253
|
getProductVariationById: (productId: number, variationId: number) => Promise<WCProductVariation>;
|
|
1254
1254
|
};
|
|
1255
1255
|
|
|
1256
|
+
declare function createWPULikeQueries(fetcher: WordPressFetcher): {
|
|
1257
|
+
getLikeStats: (params: WPULikeStatsParams, tags?: string[]) => Promise<WPULikeStats>;
|
|
1258
|
+
checkLikeStatus: (params: WPULikeCheckParams, tags?: string[]) => Promise<WPULikeCheckResponse>;
|
|
1259
|
+
vote: (params: WPULikeVoteParams, authToken?: string) => Promise<WPULikeVoteResponse>;
|
|
1260
|
+
};
|
|
1261
|
+
declare function createWPULikeClient(config: NextWordpressConfig): {
|
|
1262
|
+
getLikeStats: (params: WPULikeStatsParams, tags?: string[]) => Promise<WPULikeStats>;
|
|
1263
|
+
checkLikeStatus: (params: WPULikeCheckParams, tags?: string[]) => Promise<WPULikeCheckResponse>;
|
|
1264
|
+
vote: (params: WPULikeVoteParams, authToken?: string) => Promise<WPULikeVoteResponse>;
|
|
1265
|
+
};
|
|
1266
|
+
|
|
1256
1267
|
declare function createWPGraphQLFetcher(config: WPGraphQLConfig): {
|
|
1257
1268
|
gqlFetch: <TData>(document: string, variables?: Record<string, unknown>, tags?: string[]) => Promise<TData>;
|
|
1258
1269
|
gqlFetchGraceful: <TData>(document: string, fallback: TData, variables?: Record<string, unknown>, tags?: string[]) => Promise<TData>;
|
|
@@ -2007,4 +2018,4 @@ interface FaustPreviewDeps {
|
|
|
2007
2018
|
declare function createFaustAuthHandler(config: FaustConfig): (request: Request, routePath: string) => Promise<Response>;
|
|
2008
2019
|
declare function createPreviewHandler(config: FaustPreviewConfig, deps: FaustPreviewDeps): (request: Request) => Promise<Response>;
|
|
2009
2020
|
|
|
2010
|
-
export { Author, type CF7SubmissionResponse, type CF7SubmissionStatus, type CF7ValidationError, type Category, type Comment, type CommentAuthorAvatar, type CreateAttributeTermInput, type CreateAuthorInput, type CreateCategoryInput, type CreateCommentInput, type CreateCouponInput, type CreateMenuInput, type CreateMenuItemInput, type CreatePageInput, type CreatePostInput, type CreateProductAttributeInput, type CreateProductCategoryInput, type CreateProductInput, type CreateProductReviewInput, type CreateProductTagInput, type CreateShippingClassInput, type CreateShippingZoneInput, type CreateShippingZoneMethodInput, type CreateTagInput, type CreateTaxClassInput, type CreateTaxRateInput, type CreateWebhookInput, type FaustConfig, type FaustPreviewConfig, type FaustPreviewDeps, FeaturedMedia, type GQLACFFieldGroup, type GQLAuthor, type GQLCPTNode, type GQLCategory, GQLConnection, type GQLCreateCommentInput, type GQLCreateCommentResult, type GQLCreatePostInput, type GQLCustomer, type GQLDeletePostResult, type GQLLineItem, type GQLMutatedComment, type GQLMutatedPost, type GQLOrder, type GQLOrderAddress, type GQLPage, type GQLPageWithSEO, GQLPost, GQLPostFilter, type GQLPostStatus, type GQLPostWithSEO, type GQLProduct, type GQLProductFilter, type GQLProductVariation, type GQLTag, type GQLUpdatePostInput, type GQLYoastSEO, JwtAuthCredentials, JwtAuthResponse, type Menu, type MenuItem, type MenuLocation, type MenuWithItems, NextWordpressConfig, type OmnibusPriceEntry, type OmnibusProductData, type Page, Post, RenderedContent, RenderedTitle, type RestPageStatus, type RestPostStatus, type RevalidationConfig, type RevalidationPayload, type RevalidationResult, type Tag, Taxonomy, type UpdateAttributeTermInput, type UpdateAuthorInput, type UpdateCategoryInput, type UpdateCommentInput, type UpdateCouponInput, UpdateCustomerInput, type UpdateMediaInput, type UpdateMenuInput, type UpdateMenuItemInput, type UpdatePageInput, type UpdatePostInput, type UpdateProductAttributeInput, type UpdateProductCategoryInput, type UpdateProductInput, type UpdateProductReviewInput, type UpdateProductTagInput, type UpdateShippingClassInput, type UpdateShippingZoneInput, type UpdateShippingZoneMethodInput, type UpdateTagInput, type UpdateTaxRateInput, type UpdateWebhookInput, type UploadMediaInput, WCAddress, type WCAttributeTerm, type WCContinent, type WCCountry, type WCCoupon, WCCreateOrderInput, type WCCreateOrderNoteInput, type WCCreateOrderRefundInput, type WCCurrency, WCCustomer, type WCProductAttribute as WCGlobalProductAttribute, WCImage, WCOrder, type WCOrderNote, type WCOrderRefund, type WCPaymentGateway, type WCPaymentGatewaySetting, WCProduct, type WCProductCategory, WCProductFilterParams, type WCProductReview, type WCProductReviewFilterParams, type WCProductStatus, type WCProductTag, WCProductVariation, type WCProductVariationWithOmnibus, type WCProductWithOmnibus, type WCRefundLineItem, type WCReviewStatus, type WCSalesReport, type WCSalesReportParams, type WCSettingGroup, type WCSettingOption, type WCShippingClass, type WCShippingMethod, type WCShippingZone, type WCShippingZoneLocation, type WCShippingZoneMethod, type WCStatusCount, type WCSystemStatus, type WCSystemStatusTool, type WCTaxClass, type WCTaxRate, type WCTopSeller, type WCTopSellersParams, type WCWebhook, type WCWebhookStatus, type WCWebhookTopic, WPEntity, WPGraphQLConfig, type WPGraphQLFetcher, WooCommerceConfig, type WooCommerceFetcher, WooCommerceResponse, authenticateJwt, buildACFFragment, buildPageWithACFQuery, buildPostWithACFQuery, buildPostsWithACFQuery, createApplicationPasswordToken, createAuthorsMutations, createCF7Queries, createCPTQueries, createCategoriesMutations, createCommentsMutations, createFaustAuthHandler, createMediaMutations, createMenusMutations, createPagesMutations, createPostsMutations, createPreviewHandler, createRevalidationHandler, createTagsMutations, createWPGraphQLCoreClient as createWPGraphQLClient, createWPGraphQLCoreClient, createWPGraphQLFetcher, createWPGraphQLMutationsClient, createWPGraphQLWooCommerceClient, createWooCommerceClient, createWooCommerceFetcher, createWordPressClient, createWordPressMutationsClient, createYoastQueries, extractOmnibusData, resolveBaseUrl, validateJwtToken, withOmnibus, withOmnibusVariation };
|
|
2021
|
+
export { Author, type CF7SubmissionResponse, type CF7SubmissionStatus, type CF7ValidationError, type Category, type Comment, type CommentAuthorAvatar, type CreateAttributeTermInput, type CreateAuthorInput, type CreateCategoryInput, type CreateCommentInput, type CreateCouponInput, type CreateMenuInput, type CreateMenuItemInput, type CreatePageInput, type CreatePostInput, type CreateProductAttributeInput, type CreateProductCategoryInput, type CreateProductInput, type CreateProductReviewInput, type CreateProductTagInput, type CreateShippingClassInput, type CreateShippingZoneInput, type CreateShippingZoneMethodInput, type CreateTagInput, type CreateTaxClassInput, type CreateTaxRateInput, type CreateWebhookInput, type FaustConfig, type FaustPreviewConfig, type FaustPreviewDeps, FeaturedMedia, type GQLACFFieldGroup, type GQLAuthor, type GQLCPTNode, type GQLCategory, GQLConnection, type GQLCreateCommentInput, type GQLCreateCommentResult, type GQLCreatePostInput, type GQLCustomer, type GQLDeletePostResult, type GQLLineItem, type GQLMutatedComment, type GQLMutatedPost, type GQLOrder, type GQLOrderAddress, type GQLPage, type GQLPageWithSEO, GQLPost, GQLPostFilter, type GQLPostStatus, type GQLPostWithSEO, type GQLProduct, type GQLProductFilter, type GQLProductVariation, type GQLTag, type GQLUpdatePostInput, type GQLYoastSEO, JwtAuthCredentials, JwtAuthResponse, type Menu, type MenuItem, type MenuLocation, type MenuWithItems, NextWordpressConfig, type OmnibusPriceEntry, type OmnibusProductData, type Page, Post, RenderedContent, RenderedTitle, type RestPageStatus, type RestPostStatus, type RevalidationConfig, type RevalidationPayload, type RevalidationResult, type Tag, Taxonomy, type UpdateAttributeTermInput, type UpdateAuthorInput, type UpdateCategoryInput, type UpdateCommentInput, type UpdateCouponInput, UpdateCustomerInput, type UpdateMediaInput, type UpdateMenuInput, type UpdateMenuItemInput, type UpdatePageInput, type UpdatePostInput, type UpdateProductAttributeInput, type UpdateProductCategoryInput, type UpdateProductInput, type UpdateProductReviewInput, type UpdateProductTagInput, type UpdateShippingClassInput, type UpdateShippingZoneInput, type UpdateShippingZoneMethodInput, type UpdateTagInput, type UpdateTaxRateInput, type UpdateWebhookInput, type UploadMediaInput, WCAddress, type WCAttributeTerm, type WCContinent, type WCCountry, type WCCoupon, WCCreateOrderInput, type WCCreateOrderNoteInput, type WCCreateOrderRefundInput, type WCCurrency, WCCustomer, type WCProductAttribute as WCGlobalProductAttribute, WCImage, WCOrder, type WCOrderNote, type WCOrderRefund, type WCPaymentGateway, type WCPaymentGatewaySetting, WCProduct, type WCProductCategory, WCProductFilterParams, type WCProductReview, type WCProductReviewFilterParams, type WCProductStatus, type WCProductTag, WCProductVariation, type WCProductVariationWithOmnibus, type WCProductWithOmnibus, type WCRefundLineItem, type WCReviewStatus, type WCSalesReport, type WCSalesReportParams, type WCSettingGroup, type WCSettingOption, type WCShippingClass, type WCShippingMethod, type WCShippingZone, type WCShippingZoneLocation, type WCShippingZoneMethod, type WCStatusCount, type WCSystemStatus, type WCSystemStatusTool, type WCTaxClass, type WCTaxRate, type WCTopSeller, type WCTopSellersParams, type WCWebhook, type WCWebhookStatus, type WCWebhookTopic, WPEntity, WPGraphQLConfig, type WPGraphQLFetcher, WPULikeCheckParams, WPULikeCheckResponse, WPULikeStats, WPULikeStatsParams, WPULikeVoteParams, WPULikeVoteResponse, WooCommerceConfig, type WooCommerceFetcher, WooCommerceResponse, authenticateJwt, buildACFFragment, buildPageWithACFQuery, buildPostWithACFQuery, buildPostsWithACFQuery, createApplicationPasswordToken, createAuthorsMutations, createCF7Queries, createCPTQueries, createCategoriesMutations, createCommentsMutations, createFaustAuthHandler, createMediaMutations, createMenusMutations, createPagesMutations, createPostsMutations, createPreviewHandler, createRevalidationHandler, createTagsMutations, createWPGraphQLCoreClient as createWPGraphQLClient, createWPGraphQLCoreClient, createWPGraphQLFetcher, createWPGraphQLMutationsClient, createWPGraphQLWooCommerceClient, createWPULikeClient, createWPULikeQueries, createWooCommerceClient, createWooCommerceFetcher, createWordPressClient, createWordPressMutationsClient, createYoastQueries, extractOmnibusData, resolveBaseUrl, validateJwtToken, withOmnibus, withOmnibusVariation };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as NextWordpressConfig, J as JwtAuthCredentials,
|
|
2
|
-
export {
|
|
1
|
+
import { N as NextWordpressConfig, J as JwtAuthCredentials, q as JwtAuthResponse, a as WooCommerceConfig, d as WooCommerceResponse, W as WordPressResponse, T as Taxonomy, r as WPEntity, R as RenderedTitle, s as RenderedContent, P as Post, A as Author, F as FeaturedMedia, t as WCImage, u as WCProductVariation, b as WCProduct, g as WCCustomer, v as WCAddress, U as UpdateCustomerInput, e as WCCreateOrderInput, f as WCOrder, c as WCProductFilterParams, k as WPULikeStatsParams, l as WPULikeStats, o as WPULikeCheckParams, p as WPULikeCheckResponse, w as WPULikeVoteParams, n as WPULikeVoteResponse, h as WPGraphQLConfig, j as GQLConnection, i as GQLPostFilter, G as GQLPost } from './types-BELSHjQr.js';
|
|
2
|
+
export { x as AuthenticationError, B as BlockType, C as CookieConsentCategories, y as CookieConsentConfig, E as EditorBlock, z as EmbeddedAuthor, D as EmbeddedTerm, H as ErrorCode, I as GQLError, K as GQLPageInfo, M as MediaDetails, L as MediaSize, O as PostEmbedded, S as SearchResult, Q as TemplatePart, V as WCDimensions, X as WCOrderLineItem, Y as WCProductAttribute, Z as WCProductDefaultAttribute, _ as WCShippingLine, $ as WPGraphQLError, a0 as WPULikeItemType, m as WPULikeStatus, a1 as WooCommerceError, a2 as WooCommercePaginationHeaders, a3 as WordPressAPIError, a4 as createCookieConsentHandler, a5 as defaultMessages, a6 as defaultMessagesPl, a7 as parseCookieConsent, a8 as resolveMessage } from './types-BELSHjQr.js';
|
|
3
3
|
|
|
4
4
|
declare function createApplicationPasswordToken(username: string, appPassword: string): string;
|
|
5
5
|
|
|
@@ -1253,6 +1253,17 @@ declare function createWooCommerceClient(config: WooCommerceConfig): {
|
|
|
1253
1253
|
getProductVariationById: (productId: number, variationId: number) => Promise<WCProductVariation>;
|
|
1254
1254
|
};
|
|
1255
1255
|
|
|
1256
|
+
declare function createWPULikeQueries(fetcher: WordPressFetcher): {
|
|
1257
|
+
getLikeStats: (params: WPULikeStatsParams, tags?: string[]) => Promise<WPULikeStats>;
|
|
1258
|
+
checkLikeStatus: (params: WPULikeCheckParams, tags?: string[]) => Promise<WPULikeCheckResponse>;
|
|
1259
|
+
vote: (params: WPULikeVoteParams, authToken?: string) => Promise<WPULikeVoteResponse>;
|
|
1260
|
+
};
|
|
1261
|
+
declare function createWPULikeClient(config: NextWordpressConfig): {
|
|
1262
|
+
getLikeStats: (params: WPULikeStatsParams, tags?: string[]) => Promise<WPULikeStats>;
|
|
1263
|
+
checkLikeStatus: (params: WPULikeCheckParams, tags?: string[]) => Promise<WPULikeCheckResponse>;
|
|
1264
|
+
vote: (params: WPULikeVoteParams, authToken?: string) => Promise<WPULikeVoteResponse>;
|
|
1265
|
+
};
|
|
1266
|
+
|
|
1256
1267
|
declare function createWPGraphQLFetcher(config: WPGraphQLConfig): {
|
|
1257
1268
|
gqlFetch: <TData>(document: string, variables?: Record<string, unknown>, tags?: string[]) => Promise<TData>;
|
|
1258
1269
|
gqlFetchGraceful: <TData>(document: string, fallback: TData, variables?: Record<string, unknown>, tags?: string[]) => Promise<TData>;
|
|
@@ -2007,4 +2018,4 @@ interface FaustPreviewDeps {
|
|
|
2007
2018
|
declare function createFaustAuthHandler(config: FaustConfig): (request: Request, routePath: string) => Promise<Response>;
|
|
2008
2019
|
declare function createPreviewHandler(config: FaustPreviewConfig, deps: FaustPreviewDeps): (request: Request) => Promise<Response>;
|
|
2009
2020
|
|
|
2010
|
-
export { Author, type CF7SubmissionResponse, type CF7SubmissionStatus, type CF7ValidationError, type Category, type Comment, type CommentAuthorAvatar, type CreateAttributeTermInput, type CreateAuthorInput, type CreateCategoryInput, type CreateCommentInput, type CreateCouponInput, type CreateMenuInput, type CreateMenuItemInput, type CreatePageInput, type CreatePostInput, type CreateProductAttributeInput, type CreateProductCategoryInput, type CreateProductInput, type CreateProductReviewInput, type CreateProductTagInput, type CreateShippingClassInput, type CreateShippingZoneInput, type CreateShippingZoneMethodInput, type CreateTagInput, type CreateTaxClassInput, type CreateTaxRateInput, type CreateWebhookInput, type FaustConfig, type FaustPreviewConfig, type FaustPreviewDeps, FeaturedMedia, type GQLACFFieldGroup, type GQLAuthor, type GQLCPTNode, type GQLCategory, GQLConnection, type GQLCreateCommentInput, type GQLCreateCommentResult, type GQLCreatePostInput, type GQLCustomer, type GQLDeletePostResult, type GQLLineItem, type GQLMutatedComment, type GQLMutatedPost, type GQLOrder, type GQLOrderAddress, type GQLPage, type GQLPageWithSEO, GQLPost, GQLPostFilter, type GQLPostStatus, type GQLPostWithSEO, type GQLProduct, type GQLProductFilter, type GQLProductVariation, type GQLTag, type GQLUpdatePostInput, type GQLYoastSEO, JwtAuthCredentials, JwtAuthResponse, type Menu, type MenuItem, type MenuLocation, type MenuWithItems, NextWordpressConfig, type OmnibusPriceEntry, type OmnibusProductData, type Page, Post, RenderedContent, RenderedTitle, type RestPageStatus, type RestPostStatus, type RevalidationConfig, type RevalidationPayload, type RevalidationResult, type Tag, Taxonomy, type UpdateAttributeTermInput, type UpdateAuthorInput, type UpdateCategoryInput, type UpdateCommentInput, type UpdateCouponInput, UpdateCustomerInput, type UpdateMediaInput, type UpdateMenuInput, type UpdateMenuItemInput, type UpdatePageInput, type UpdatePostInput, type UpdateProductAttributeInput, type UpdateProductCategoryInput, type UpdateProductInput, type UpdateProductReviewInput, type UpdateProductTagInput, type UpdateShippingClassInput, type UpdateShippingZoneInput, type UpdateShippingZoneMethodInput, type UpdateTagInput, type UpdateTaxRateInput, type UpdateWebhookInput, type UploadMediaInput, WCAddress, type WCAttributeTerm, type WCContinent, type WCCountry, type WCCoupon, WCCreateOrderInput, type WCCreateOrderNoteInput, type WCCreateOrderRefundInput, type WCCurrency, WCCustomer, type WCProductAttribute as WCGlobalProductAttribute, WCImage, WCOrder, type WCOrderNote, type WCOrderRefund, type WCPaymentGateway, type WCPaymentGatewaySetting, WCProduct, type WCProductCategory, WCProductFilterParams, type WCProductReview, type WCProductReviewFilterParams, type WCProductStatus, type WCProductTag, WCProductVariation, type WCProductVariationWithOmnibus, type WCProductWithOmnibus, type WCRefundLineItem, type WCReviewStatus, type WCSalesReport, type WCSalesReportParams, type WCSettingGroup, type WCSettingOption, type WCShippingClass, type WCShippingMethod, type WCShippingZone, type WCShippingZoneLocation, type WCShippingZoneMethod, type WCStatusCount, type WCSystemStatus, type WCSystemStatusTool, type WCTaxClass, type WCTaxRate, type WCTopSeller, type WCTopSellersParams, type WCWebhook, type WCWebhookStatus, type WCWebhookTopic, WPEntity, WPGraphQLConfig, type WPGraphQLFetcher, WooCommerceConfig, type WooCommerceFetcher, WooCommerceResponse, authenticateJwt, buildACFFragment, buildPageWithACFQuery, buildPostWithACFQuery, buildPostsWithACFQuery, createApplicationPasswordToken, createAuthorsMutations, createCF7Queries, createCPTQueries, createCategoriesMutations, createCommentsMutations, createFaustAuthHandler, createMediaMutations, createMenusMutations, createPagesMutations, createPostsMutations, createPreviewHandler, createRevalidationHandler, createTagsMutations, createWPGraphQLCoreClient as createWPGraphQLClient, createWPGraphQLCoreClient, createWPGraphQLFetcher, createWPGraphQLMutationsClient, createWPGraphQLWooCommerceClient, createWooCommerceClient, createWooCommerceFetcher, createWordPressClient, createWordPressMutationsClient, createYoastQueries, extractOmnibusData, resolveBaseUrl, validateJwtToken, withOmnibus, withOmnibusVariation };
|
|
2021
|
+
export { Author, type CF7SubmissionResponse, type CF7SubmissionStatus, type CF7ValidationError, type Category, type Comment, type CommentAuthorAvatar, type CreateAttributeTermInput, type CreateAuthorInput, type CreateCategoryInput, type CreateCommentInput, type CreateCouponInput, type CreateMenuInput, type CreateMenuItemInput, type CreatePageInput, type CreatePostInput, type CreateProductAttributeInput, type CreateProductCategoryInput, type CreateProductInput, type CreateProductReviewInput, type CreateProductTagInput, type CreateShippingClassInput, type CreateShippingZoneInput, type CreateShippingZoneMethodInput, type CreateTagInput, type CreateTaxClassInput, type CreateTaxRateInput, type CreateWebhookInput, type FaustConfig, type FaustPreviewConfig, type FaustPreviewDeps, FeaturedMedia, type GQLACFFieldGroup, type GQLAuthor, type GQLCPTNode, type GQLCategory, GQLConnection, type GQLCreateCommentInput, type GQLCreateCommentResult, type GQLCreatePostInput, type GQLCustomer, type GQLDeletePostResult, type GQLLineItem, type GQLMutatedComment, type GQLMutatedPost, type GQLOrder, type GQLOrderAddress, type GQLPage, type GQLPageWithSEO, GQLPost, GQLPostFilter, type GQLPostStatus, type GQLPostWithSEO, type GQLProduct, type GQLProductFilter, type GQLProductVariation, type GQLTag, type GQLUpdatePostInput, type GQLYoastSEO, JwtAuthCredentials, JwtAuthResponse, type Menu, type MenuItem, type MenuLocation, type MenuWithItems, NextWordpressConfig, type OmnibusPriceEntry, type OmnibusProductData, type Page, Post, RenderedContent, RenderedTitle, type RestPageStatus, type RestPostStatus, type RevalidationConfig, type RevalidationPayload, type RevalidationResult, type Tag, Taxonomy, type UpdateAttributeTermInput, type UpdateAuthorInput, type UpdateCategoryInput, type UpdateCommentInput, type UpdateCouponInput, UpdateCustomerInput, type UpdateMediaInput, type UpdateMenuInput, type UpdateMenuItemInput, type UpdatePageInput, type UpdatePostInput, type UpdateProductAttributeInput, type UpdateProductCategoryInput, type UpdateProductInput, type UpdateProductReviewInput, type UpdateProductTagInput, type UpdateShippingClassInput, type UpdateShippingZoneInput, type UpdateShippingZoneMethodInput, type UpdateTagInput, type UpdateTaxRateInput, type UpdateWebhookInput, type UploadMediaInput, WCAddress, type WCAttributeTerm, type WCContinent, type WCCountry, type WCCoupon, WCCreateOrderInput, type WCCreateOrderNoteInput, type WCCreateOrderRefundInput, type WCCurrency, WCCustomer, type WCProductAttribute as WCGlobalProductAttribute, WCImage, WCOrder, type WCOrderNote, type WCOrderRefund, type WCPaymentGateway, type WCPaymentGatewaySetting, WCProduct, type WCProductCategory, WCProductFilterParams, type WCProductReview, type WCProductReviewFilterParams, type WCProductStatus, type WCProductTag, WCProductVariation, type WCProductVariationWithOmnibus, type WCProductWithOmnibus, type WCRefundLineItem, type WCReviewStatus, type WCSalesReport, type WCSalesReportParams, type WCSettingGroup, type WCSettingOption, type WCShippingClass, type WCShippingMethod, type WCShippingZone, type WCShippingZoneLocation, type WCShippingZoneMethod, type WCStatusCount, type WCSystemStatus, type WCSystemStatusTool, type WCTaxClass, type WCTaxRate, type WCTopSeller, type WCTopSellersParams, type WCWebhook, type WCWebhookStatus, type WCWebhookTopic, WPEntity, WPGraphQLConfig, type WPGraphQLFetcher, WPULikeCheckParams, WPULikeCheckResponse, WPULikeStats, WPULikeStatsParams, WPULikeVoteParams, WPULikeVoteResponse, WooCommerceConfig, type WooCommerceFetcher, WooCommerceResponse, authenticateJwt, buildACFFragment, buildPageWithACFQuery, buildPostWithACFQuery, buildPostsWithACFQuery, createApplicationPasswordToken, createAuthorsMutations, createCF7Queries, createCPTQueries, createCategoriesMutations, createCommentsMutations, createFaustAuthHandler, createMediaMutations, createMenusMutations, createPagesMutations, createPostsMutations, createPreviewHandler, createRevalidationHandler, createTagsMutations, createWPGraphQLCoreClient as createWPGraphQLClient, createWPGraphQLCoreClient, createWPGraphQLFetcher, createWPGraphQLMutationsClient, createWPGraphQLWooCommerceClient, createWPULikeClient, createWPULikeQueries, createWooCommerceClient, createWooCommerceFetcher, createWordPressClient, createWordPressMutationsClient, createYoastQueries, extractOmnibusData, resolveBaseUrl, validateJwtToken, withOmnibus, withOmnibusVariation };
|
package/dist/index.js
CHANGED
|
@@ -2099,6 +2099,38 @@ function createWooCommerceClient(config) {
|
|
|
2099
2099
|
};
|
|
2100
2100
|
}
|
|
2101
2101
|
|
|
2102
|
+
// src/integrations/restApi/wpulike/queries.ts
|
|
2103
|
+
function createWPULikeQueries(fetcher) {
|
|
2104
|
+
const { wpFetch, wpMutate } = fetcher;
|
|
2105
|
+
async function getLikeStats(params, tags) {
|
|
2106
|
+
return wpFetch(
|
|
2107
|
+
"/wp-json/wp-ulike/v1/stats",
|
|
2108
|
+
params,
|
|
2109
|
+
tags ?? ["wpulike", `wpulike-${params.id}`]
|
|
2110
|
+
);
|
|
2111
|
+
}
|
|
2112
|
+
async function checkLikeStatus(params, tags) {
|
|
2113
|
+
return wpFetch(
|
|
2114
|
+
"/wp-json/wp-ulike/v1/check",
|
|
2115
|
+
params,
|
|
2116
|
+
tags ?? ["wpulike", `wpulike-${params.id}`]
|
|
2117
|
+
);
|
|
2118
|
+
}
|
|
2119
|
+
async function vote(params, authToken) {
|
|
2120
|
+
return wpMutate(
|
|
2121
|
+
"/wp-json/wp-ulike/v1/vote",
|
|
2122
|
+
params,
|
|
2123
|
+
"POST",
|
|
2124
|
+
authToken
|
|
2125
|
+
);
|
|
2126
|
+
}
|
|
2127
|
+
return { getLikeStats, checkLikeStatus, vote };
|
|
2128
|
+
}
|
|
2129
|
+
function createWPULikeClient(config) {
|
|
2130
|
+
const fetcher = createFetcher(config);
|
|
2131
|
+
return createWPULikeQueries(fetcher);
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2102
2134
|
// src/integrations/wpGraphQL/client/types.ts
|
|
2103
2135
|
var WPGraphQLError = class extends Error {
|
|
2104
2136
|
constructor(code, status, endpoint, message, gqlErrors) {
|
|
@@ -4175,6 +4207,59 @@ async function resolvePreviewSlug(config, postId, previewPathname) {
|
|
|
4175
4207
|
return data.slug ?? `preview-${postId}`;
|
|
4176
4208
|
}
|
|
4177
4209
|
|
|
4210
|
+
// src/nextjs/cookieConsent.ts
|
|
4211
|
+
function createCookieConsentHandler(config) {
|
|
4212
|
+
const cookieName = config?.cookieName ?? "cookie_notice_accepted";
|
|
4213
|
+
const maxAge = config?.maxAge ?? 31536e3;
|
|
4214
|
+
return async function handler(request) {
|
|
4215
|
+
if (request.method === "GET") {
|
|
4216
|
+
const consent = parseCookieConsent(request, cookieName);
|
|
4217
|
+
return Response.json(consent ?? null);
|
|
4218
|
+
}
|
|
4219
|
+
if (request.method === "POST") {
|
|
4220
|
+
const body = await request.json();
|
|
4221
|
+
const categories = {
|
|
4222
|
+
necessary: true,
|
|
4223
|
+
analytics: body.analytics ?? false,
|
|
4224
|
+
marketing: body.marketing ?? false
|
|
4225
|
+
};
|
|
4226
|
+
return new Response(JSON.stringify(categories), {
|
|
4227
|
+
status: 200,
|
|
4228
|
+
headers: {
|
|
4229
|
+
"Content-Type": "application/json",
|
|
4230
|
+
"Set-Cookie": buildConsentCookie(cookieName, encodeURIComponent(JSON.stringify(categories)), maxAge)
|
|
4231
|
+
}
|
|
4232
|
+
});
|
|
4233
|
+
}
|
|
4234
|
+
if (request.method === "DELETE") {
|
|
4235
|
+
return new Response(null, {
|
|
4236
|
+
status: 204,
|
|
4237
|
+
headers: {
|
|
4238
|
+
"Set-Cookie": `${cookieName}=; Max-Age=0; Path=/; SameSite=Lax`
|
|
4239
|
+
}
|
|
4240
|
+
});
|
|
4241
|
+
}
|
|
4242
|
+
return Response.json({ error: "Method Not Allowed" }, { status: 405 });
|
|
4243
|
+
};
|
|
4244
|
+
}
|
|
4245
|
+
function parseCookieConsent(request, cookieName = "cookie_notice_accepted") {
|
|
4246
|
+
const header = request.headers.get("cookie") ?? "";
|
|
4247
|
+
const match = header.match(new RegExp(`(?:^|;\\s*)${cookieName}=([^;]*)`));
|
|
4248
|
+
if (!match) return null;
|
|
4249
|
+
if (match[1] === "1") return { necessary: true, analytics: true, marketing: true };
|
|
4250
|
+
try {
|
|
4251
|
+
const parsed = JSON.parse(decodeURIComponent(match[1]));
|
|
4252
|
+
if (typeof parsed !== "object" || parsed === null) return null;
|
|
4253
|
+
return { necessary: true, analytics: parsed.analytics ?? false, marketing: parsed.marketing ?? false };
|
|
4254
|
+
} catch {
|
|
4255
|
+
return null;
|
|
4256
|
+
}
|
|
4257
|
+
}
|
|
4258
|
+
function buildConsentCookie(name, value, maxAge) {
|
|
4259
|
+
const secure = process.env.NODE_ENV === "production" ? "; Secure" : "";
|
|
4260
|
+
return `${name}=${value}; Path=/; SameSite=Lax; Max-Age=${maxAge}${secure}`;
|
|
4261
|
+
}
|
|
4262
|
+
|
|
4178
4263
|
// src/auth/applicationPassword.ts
|
|
4179
4264
|
function createApplicationPasswordToken(username, appPassword) {
|
|
4180
4265
|
const encoded = Buffer.from(`${username}:${appPassword}`).toString("base64");
|
|
@@ -4226,6 +4311,6 @@ async function validateJwtToken(config, token) {
|
|
|
4226
4311
|
return response.ok;
|
|
4227
4312
|
}
|
|
4228
4313
|
|
|
4229
|
-
export { AuthenticationError, ErrorCode, WPGraphQLError, WooCommerceError, WordPressAPIError, authenticateJwt, buildACFFragment, buildPageWithACFQuery, buildPostWithACFQuery, buildPostsWithACFQuery, createApplicationPasswordToken, createAuthorsMutations, createCF7Queries, createCPTQueries, createCategoriesMutations, createCommentsMutations, createFaustAuthHandler, createMediaMutations, createMenusMutations, createPagesMutations, createPostsMutations, createPreviewHandler, createRevalidationHandler, createTagsMutations, createWPGraphQLCoreClient as createWPGraphQLClient, createWPGraphQLCoreClient, createWPGraphQLFetcher, createWPGraphQLMutationsClient, createWPGraphQLWooCommerceClient, createWooCommerceClient, createWooCommerceFetcher, createWordPressClient, createWordPressMutationsClient, createYoastQueries, defaultMessages, defaultMessagesPl, extractOmnibusData, resolveBaseUrl, resolveMessage, validateJwtToken, withOmnibus, withOmnibusVariation };
|
|
4314
|
+
export { AuthenticationError, ErrorCode, WPGraphQLError, WooCommerceError, WordPressAPIError, authenticateJwt, buildACFFragment, buildPageWithACFQuery, buildPostWithACFQuery, buildPostsWithACFQuery, createApplicationPasswordToken, createAuthorsMutations, createCF7Queries, createCPTQueries, createCategoriesMutations, createCommentsMutations, createCookieConsentHandler, createFaustAuthHandler, createMediaMutations, createMenusMutations, createPagesMutations, createPostsMutations, createPreviewHandler, createRevalidationHandler, createTagsMutations, createWPGraphQLCoreClient as createWPGraphQLClient, createWPGraphQLCoreClient, createWPGraphQLFetcher, createWPGraphQLMutationsClient, createWPGraphQLWooCommerceClient, createWPULikeClient, createWPULikeQueries, createWooCommerceClient, createWooCommerceFetcher, createWordPressClient, createWordPressMutationsClient, createYoastQueries, defaultMessages, defaultMessagesPl, extractOmnibusData, parseCookieConsent, resolveBaseUrl, resolveMessage, validateJwtToken, withOmnibus, withOmnibusVariation };
|
|
4230
4315
|
//# sourceMappingURL=index.js.map
|
|
4231
4316
|
//# sourceMappingURL=index.js.map
|