@szymonpiatek/nextwordpress 0.0.14 → 0.0.15
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 +30 -11
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +30 -11
- package/dist/client/index.js.map +1 -1
- package/dist/hooks/index.cjs +30 -11
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.cts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +30 -11
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.cjs +30 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +30 -2
- package/dist/index.js.map +1 -1
- package/dist/server/index.cjs +30 -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 +30 -2
- package/dist/server/index.js.map +1 -1
- package/dist/{types-COJWPg77.d.cts → types-D6rih4G8.d.cts} +7 -1
- package/dist/{types-COJWPg77.d.ts → types-D6rih4G8.d.ts} +7 -1
- package/package.json +1 -1
package/dist/server/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { y as AuthenticationError, A as Author, B as BlockType, q as CF7SubmissionResponse,
|
|
1
|
+
export { y as AuthenticationError, A as Author, B as BlockType, z as CF7Error, q as CF7SubmissionResponse, D as CF7SubmissionStatus, E as CF7ValidationError, C as CookieConsentCategories, H as CookieConsentConfig, I as EditorBlock, K as EmbeddedAuthor, L as EmbeddedTerm, M as ErrorCode, F as FeaturedMedia, j as GQLConnection, O as GQLError, Q as GQLPageInfo, G as GQLPost, i as GQLPostFilter, J as JwtAuthCredentials, r as JwtAuthResponse, S as MediaDetails, V as MediaSize, N as NextWordpressConfig, P as Post, X as PostEmbedded, t as RenderedContent, R as RenderedTitle, Y as SearchResult, T as Taxonomy, Z as TemplatePart, U as UpdateCustomerInput, w as WCAddress, e as WCCreateOrderInput, g as WCCustomer, _ as WCDimensions, u as WCImage, f as WCOrder, $ as WCOrderLineItem, b as WCProduct, a0 as WCProductAttribute, a1 as WCProductDefaultAttribute, c as WCProductFilterParams, v as WCProductVariation, a2 as WCShippingLine, s as WPEntity, h as WPGraphQLConfig, a3 as WPGraphQLError, o as WPULikeCheckParams, p as WPULikeCheckResponse, a4 as WPULikeItemType, l as WPULikeStats, k as WPULikeStatsParams, m as WPULikeStatus, x as WPULikeVoteParams, n as WPULikeVoteResponse, a as WooCommerceConfig, a5 as WooCommerceError, a6 as WooCommercePaginationHeaders, d as WooCommerceResponse, a7 as WordPressAPIError, a8 as createCookieConsentHandler, a9 as defaultMessages, aa as defaultMessagesPl, ab as parseCookieConsent, ac as resolveMessage } from '../types-D6rih4G8.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 { y as AuthenticationError, A as Author, B as BlockType, q as CF7SubmissionResponse,
|
|
1
|
+
export { y as AuthenticationError, A as Author, B as BlockType, z as CF7Error, q as CF7SubmissionResponse, D as CF7SubmissionStatus, E as CF7ValidationError, C as CookieConsentCategories, H as CookieConsentConfig, I as EditorBlock, K as EmbeddedAuthor, L as EmbeddedTerm, M as ErrorCode, F as FeaturedMedia, j as GQLConnection, O as GQLError, Q as GQLPageInfo, G as GQLPost, i as GQLPostFilter, J as JwtAuthCredentials, r as JwtAuthResponse, S as MediaDetails, V as MediaSize, N as NextWordpressConfig, P as Post, X as PostEmbedded, t as RenderedContent, R as RenderedTitle, Y as SearchResult, T as Taxonomy, Z as TemplatePart, U as UpdateCustomerInput, w as WCAddress, e as WCCreateOrderInput, g as WCCustomer, _ as WCDimensions, u as WCImage, f as WCOrder, $ as WCOrderLineItem, b as WCProduct, a0 as WCProductAttribute, a1 as WCProductDefaultAttribute, c as WCProductFilterParams, v as WCProductVariation, a2 as WCShippingLine, s as WPEntity, h as WPGraphQLConfig, a3 as WPGraphQLError, o as WPULikeCheckParams, p as WPULikeCheckResponse, a4 as WPULikeItemType, l as WPULikeStats, k as WPULikeStatsParams, m as WPULikeStatus, x as WPULikeVoteParams, n as WPULikeVoteResponse, a as WooCommerceConfig, a5 as WooCommerceError, a6 as WooCommercePaginationHeaders, d as WooCommerceResponse, a7 as WordPressAPIError, a8 as createCookieConsentHandler, a9 as defaultMessages, aa as defaultMessagesPl, ab as parseCookieConsent, ac as resolveMessage } from '../types-D6rih4G8.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
|
@@ -2133,7 +2133,25 @@ function createWPULikeClient(config) {
|
|
|
2133
2133
|
return createWPULikeQueries(fetcher);
|
|
2134
2134
|
}
|
|
2135
2135
|
|
|
2136
|
+
// src/integrations/restApi/contactForm7/types.ts
|
|
2137
|
+
var CF7Error = class extends Error {
|
|
2138
|
+
constructor(code, status, endpoint, message) {
|
|
2139
|
+
super(message);
|
|
2140
|
+
__publicField(this, "code", code);
|
|
2141
|
+
__publicField(this, "status", status);
|
|
2142
|
+
__publicField(this, "endpoint", endpoint);
|
|
2143
|
+
this.name = "CF7Error";
|
|
2144
|
+
}
|
|
2145
|
+
};
|
|
2146
|
+
|
|
2136
2147
|
// src/integrations/restApi/contactForm7/queries.ts
|
|
2148
|
+
var statusToCode = {
|
|
2149
|
+
mail_sent: ErrorCode.CF7_MAIL_SENT,
|
|
2150
|
+
mail_failed: ErrorCode.CF7_MAIL_FAILED,
|
|
2151
|
+
validation_failed: ErrorCode.CF7_VALIDATION_FAILED,
|
|
2152
|
+
spam: ErrorCode.CF7_SPAM,
|
|
2153
|
+
aborted: ErrorCode.CF7_ABORTED
|
|
2154
|
+
};
|
|
2137
2155
|
function createCF7Queries(config) {
|
|
2138
2156
|
async function submitForm(formId, data) {
|
|
2139
2157
|
const url = buildUrl(config, `/wp-json/contact-form-7/v1/contact-forms/${formId}/feedback`);
|
|
@@ -2142,7 +2160,17 @@ function createCF7Queries(config) {
|
|
|
2142
2160
|
body.append(key, value);
|
|
2143
2161
|
}
|
|
2144
2162
|
const res = await fetch(url, { method: "POST", body, cache: "no-store" });
|
|
2145
|
-
|
|
2163
|
+
if (!res.ok) {
|
|
2164
|
+
throw new CF7Error(
|
|
2165
|
+
ErrorCode.CF7_MAIL_FAILED,
|
|
2166
|
+
res.status,
|
|
2167
|
+
url,
|
|
2168
|
+
resolveMessage(ErrorCode.CF7_MAIL_FAILED, config.errorMessages)
|
|
2169
|
+
);
|
|
2170
|
+
}
|
|
2171
|
+
const result = await res.json();
|
|
2172
|
+
const code = statusToCode[result.status];
|
|
2173
|
+
return { ...result, message: resolveMessage(code, config.errorMessages) };
|
|
2146
2174
|
}
|
|
2147
2175
|
return { submitForm };
|
|
2148
2176
|
}
|
|
@@ -4327,6 +4355,6 @@ async function validateJwtToken(config, token) {
|
|
|
4327
4355
|
return response.ok;
|
|
4328
4356
|
}
|
|
4329
4357
|
|
|
4330
|
-
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 };
|
|
4358
|
+
export { AuthenticationError, CF7Error, 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 };
|
|
4331
4359
|
//# sourceMappingURL=index.js.map
|
|
4332
4360
|
//# sourceMappingURL=index.js.map
|