@szymonpiatek/nextwordpress 0.0.17 → 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 +84 -38
- 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 +83 -39
- package/dist/client/index.js.map +1 -1
- package/dist/hooks/index.cjs +84 -38
- 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 +83 -39
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.cjs +24 -3
- 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 +24 -3
- package/dist/index.js.map +1 -1
- package/dist/server/index.cjs +24 -3
- 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 +24 -3
- package/dist/server/index.js.map +1 -1
- package/dist/{types-DVzJO3P-.d.cts → types-CM3v08Fh.d.cts} +31 -16
- package/dist/{types-DVzJO3P-.d.ts → types-CM3v08Fh.d.ts} +31 -16
- 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, u as JwtAuthResponse, W as WPGraphQLConfig, c as WordPressResponse, d as WooCommerceConfig, g as WooCommerceResponse, T as Taxonomy, v as WPEntity, w as RenderedTitle, x as RenderedContent, P as Post, A as Author, F as FeaturedMedia, y as RestSendPasswordResetEmailInput, R as RestSendPasswordResetEmailResult, z as RestResetUserPasswordInput, b as RestResetUserPasswordResult, B as WCImage, D as WCProductVariation, e as WCProduct, j as WCCustomer, E as WCAddress, U as UpdateCustomerInput, h as WCCreateOrderInput, i as WCOrder, f as WCProductFilterParams, n as WPULikeStatsParams, o as WPULikeStats, r as WPULikeCheckParams, s as WPULikeCheckResponse, H as WPULikeVoteParams, q as WPULikeVoteResponse, t as CF7SubmissionResponse, I as GQLSendPasswordResetEmailInput, G as GQLSendPasswordResetEmailResult, K as GQLResetUserPasswordInput, a as GQLResetUserPasswordResult, m as GQLConnection, l as GQLPostFilter, k as GQLPost } from './types-CM3v08Fh.cjs';
|
|
2
|
+
export { L as AuthenticationError, M as BlockType, O as CF7Error, Q as CF7SubmissionStatus, S as CF7ValidationError, C as CookieConsentCategories, V as CookieConsentConfig, X as EditorBlock, Y as EmbeddedAuthor, Z as EmbeddedTerm, _ as ErrorCode, $ as GQLError, a0 as GQLPageInfo, a1 as MediaDetails, a2 as MediaSize, a3 as PostEmbedded, a4 as SearchResult, a5 as TemplatePart, a6 as WCDimensions, a7 as WCOrderLineItem, a8 as WCProductAttribute, a9 as WCProductDefaultAttribute, aa as WCShippingLine, ab as WPGraphQLError, ac as WPULikeItemType, p as WPULikeStatus, ad as WooCommerceError, ae as WooCommercePaginationHeaders, af as WordPressAPIError, ag as createCookieConsentHandler, ah as defaultMessages, ai as defaultMessagesPl, aj as parseCookieConsent, ak as resolveMessage } from './types-CM3v08Fh.cjs';
|
|
3
3
|
|
|
4
4
|
declare function createApplicationPasswordToken(username: string, appPassword: string): string;
|
|
5
5
|
|
|
@@ -15,15 +15,6 @@ declare function createWPGraphQLFetcher(config: WPGraphQLConfig): {
|
|
|
15
15
|
};
|
|
16
16
|
type WPGraphQLFetcher = ReturnType<typeof createWPGraphQLFetcher>;
|
|
17
17
|
|
|
18
|
-
declare function createWooCommerceFetcher(config: WooCommerceConfig): {
|
|
19
|
-
wcFetch: <T>(path: string, query?: Record<string, unknown>, tags?: string[], options?: RequestInit) => Promise<T>;
|
|
20
|
-
wcFetchGraceful: <T>(path: string, fallback: T, query?: Record<string, unknown>, tags?: string[]) => Promise<T>;
|
|
21
|
-
wcFetchPaginated: <T>(path: string, query?: Record<string, unknown>, tags?: string[]) => Promise<WooCommerceResponse<T[]>>;
|
|
22
|
-
wcFetchPaginatedGraceful: <T>(path: string, query?: Record<string, unknown>, tags?: string[]) => Promise<WooCommerceResponse<T[]>>;
|
|
23
|
-
wcMutate: <T>(path: string, body: unknown, method?: "POST" | "PUT" | "PATCH" | "DELETE") => Promise<T>;
|
|
24
|
-
};
|
|
25
|
-
type WooCommerceFetcher = ReturnType<typeof createWooCommerceFetcher>;
|
|
26
|
-
|
|
27
18
|
declare function createFetcher(config: NextWordpressConfig): {
|
|
28
19
|
wpFetch: <T>(path: string, query?: Record<string, unknown>, tags?: string[]) => Promise<T>;
|
|
29
20
|
wpFetchGraceful: <T>(path: string, fallback: T, query?: Record<string, unknown>, tags?: string[]) => Promise<T>;
|
|
@@ -34,6 +25,15 @@ declare function createFetcher(config: NextWordpressConfig): {
|
|
|
34
25
|
};
|
|
35
26
|
type WordPressFetcher = ReturnType<typeof createFetcher>;
|
|
36
27
|
|
|
28
|
+
declare function createWooCommerceFetcher(config: WooCommerceConfig): {
|
|
29
|
+
wcFetch: <T>(path: string, query?: Record<string, unknown>, tags?: string[], options?: RequestInit) => Promise<T>;
|
|
30
|
+
wcFetchGraceful: <T>(path: string, fallback: T, query?: Record<string, unknown>, tags?: string[]) => Promise<T>;
|
|
31
|
+
wcFetchPaginated: <T>(path: string, query?: Record<string, unknown>, tags?: string[]) => Promise<WooCommerceResponse<T[]>>;
|
|
32
|
+
wcFetchPaginatedGraceful: <T>(path: string, query?: Record<string, unknown>, tags?: string[]) => Promise<WooCommerceResponse<T[]>>;
|
|
33
|
+
wcMutate: <T>(path: string, body: unknown, method?: "POST" | "PUT" | "PATCH" | "DELETE") => Promise<T>;
|
|
34
|
+
};
|
|
35
|
+
type WooCommerceFetcher = ReturnType<typeof createWooCommerceFetcher>;
|
|
36
|
+
|
|
37
37
|
interface Category extends Taxonomy {
|
|
38
38
|
taxonomy: 'category';
|
|
39
39
|
parent: number;
|
|
@@ -337,6 +337,8 @@ declare function createMediaMutations(fetcher: WordPressFetcher): {
|
|
|
337
337
|
};
|
|
338
338
|
|
|
339
339
|
declare function createWordPressMutationsClient(config: NextWordpressConfig): {
|
|
340
|
+
sendPasswordResetEmail: (input: RestSendPasswordResetEmailInput) => Promise<RestSendPasswordResetEmailResult>;
|
|
341
|
+
resetUserPassword: (input: RestResetUserPasswordInput) => Promise<RestResetUserPasswordResult>;
|
|
340
342
|
uploadMedia: (input: UploadMediaInput, authToken: string) => Promise<FeaturedMedia>;
|
|
341
343
|
updateMedia: (id: number, input: UpdateMediaInput, authToken: string) => Promise<FeaturedMedia>;
|
|
342
344
|
deleteMedia: (id: number, authToken: string, force?: boolean) => Promise<{
|
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, u as JwtAuthResponse, W as WPGraphQLConfig, c as WordPressResponse, d as WooCommerceConfig, g as WooCommerceResponse, T as Taxonomy, v as WPEntity, w as RenderedTitle, x as RenderedContent, P as Post, A as Author, F as FeaturedMedia, y as RestSendPasswordResetEmailInput, R as RestSendPasswordResetEmailResult, z as RestResetUserPasswordInput, b as RestResetUserPasswordResult, B as WCImage, D as WCProductVariation, e as WCProduct, j as WCCustomer, E as WCAddress, U as UpdateCustomerInput, h as WCCreateOrderInput, i as WCOrder, f as WCProductFilterParams, n as WPULikeStatsParams, o as WPULikeStats, r as WPULikeCheckParams, s as WPULikeCheckResponse, H as WPULikeVoteParams, q as WPULikeVoteResponse, t as CF7SubmissionResponse, I as GQLSendPasswordResetEmailInput, G as GQLSendPasswordResetEmailResult, K as GQLResetUserPasswordInput, a as GQLResetUserPasswordResult, m as GQLConnection, l as GQLPostFilter, k as GQLPost } from './types-CM3v08Fh.js';
|
|
2
|
+
export { L as AuthenticationError, M as BlockType, O as CF7Error, Q as CF7SubmissionStatus, S as CF7ValidationError, C as CookieConsentCategories, V as CookieConsentConfig, X as EditorBlock, Y as EmbeddedAuthor, Z as EmbeddedTerm, _ as ErrorCode, $ as GQLError, a0 as GQLPageInfo, a1 as MediaDetails, a2 as MediaSize, a3 as PostEmbedded, a4 as SearchResult, a5 as TemplatePart, a6 as WCDimensions, a7 as WCOrderLineItem, a8 as WCProductAttribute, a9 as WCProductDefaultAttribute, aa as WCShippingLine, ab as WPGraphQLError, ac as WPULikeItemType, p as WPULikeStatus, ad as WooCommerceError, ae as WooCommercePaginationHeaders, af as WordPressAPIError, ag as createCookieConsentHandler, ah as defaultMessages, ai as defaultMessagesPl, aj as parseCookieConsent, ak as resolveMessage } from './types-CM3v08Fh.js';
|
|
3
3
|
|
|
4
4
|
declare function createApplicationPasswordToken(username: string, appPassword: string): string;
|
|
5
5
|
|
|
@@ -15,15 +15,6 @@ declare function createWPGraphQLFetcher(config: WPGraphQLConfig): {
|
|
|
15
15
|
};
|
|
16
16
|
type WPGraphQLFetcher = ReturnType<typeof createWPGraphQLFetcher>;
|
|
17
17
|
|
|
18
|
-
declare function createWooCommerceFetcher(config: WooCommerceConfig): {
|
|
19
|
-
wcFetch: <T>(path: string, query?: Record<string, unknown>, tags?: string[], options?: RequestInit) => Promise<T>;
|
|
20
|
-
wcFetchGraceful: <T>(path: string, fallback: T, query?: Record<string, unknown>, tags?: string[]) => Promise<T>;
|
|
21
|
-
wcFetchPaginated: <T>(path: string, query?: Record<string, unknown>, tags?: string[]) => Promise<WooCommerceResponse<T[]>>;
|
|
22
|
-
wcFetchPaginatedGraceful: <T>(path: string, query?: Record<string, unknown>, tags?: string[]) => Promise<WooCommerceResponse<T[]>>;
|
|
23
|
-
wcMutate: <T>(path: string, body: unknown, method?: "POST" | "PUT" | "PATCH" | "DELETE") => Promise<T>;
|
|
24
|
-
};
|
|
25
|
-
type WooCommerceFetcher = ReturnType<typeof createWooCommerceFetcher>;
|
|
26
|
-
|
|
27
18
|
declare function createFetcher(config: NextWordpressConfig): {
|
|
28
19
|
wpFetch: <T>(path: string, query?: Record<string, unknown>, tags?: string[]) => Promise<T>;
|
|
29
20
|
wpFetchGraceful: <T>(path: string, fallback: T, query?: Record<string, unknown>, tags?: string[]) => Promise<T>;
|
|
@@ -34,6 +25,15 @@ declare function createFetcher(config: NextWordpressConfig): {
|
|
|
34
25
|
};
|
|
35
26
|
type WordPressFetcher = ReturnType<typeof createFetcher>;
|
|
36
27
|
|
|
28
|
+
declare function createWooCommerceFetcher(config: WooCommerceConfig): {
|
|
29
|
+
wcFetch: <T>(path: string, query?: Record<string, unknown>, tags?: string[], options?: RequestInit) => Promise<T>;
|
|
30
|
+
wcFetchGraceful: <T>(path: string, fallback: T, query?: Record<string, unknown>, tags?: string[]) => Promise<T>;
|
|
31
|
+
wcFetchPaginated: <T>(path: string, query?: Record<string, unknown>, tags?: string[]) => Promise<WooCommerceResponse<T[]>>;
|
|
32
|
+
wcFetchPaginatedGraceful: <T>(path: string, query?: Record<string, unknown>, tags?: string[]) => Promise<WooCommerceResponse<T[]>>;
|
|
33
|
+
wcMutate: <T>(path: string, body: unknown, method?: "POST" | "PUT" | "PATCH" | "DELETE") => Promise<T>;
|
|
34
|
+
};
|
|
35
|
+
type WooCommerceFetcher = ReturnType<typeof createWooCommerceFetcher>;
|
|
36
|
+
|
|
37
37
|
interface Category extends Taxonomy {
|
|
38
38
|
taxonomy: 'category';
|
|
39
39
|
parent: number;
|
|
@@ -337,6 +337,8 @@ declare function createMediaMutations(fetcher: WordPressFetcher): {
|
|
|
337
337
|
};
|
|
338
338
|
|
|
339
339
|
declare function createWordPressMutationsClient(config: NextWordpressConfig): {
|
|
340
|
+
sendPasswordResetEmail: (input: RestSendPasswordResetEmailInput) => Promise<RestSendPasswordResetEmailResult>;
|
|
341
|
+
resetUserPassword: (input: RestResetUserPasswordInput) => Promise<RestResetUserPasswordResult>;
|
|
340
342
|
uploadMedia: (input: UploadMediaInput, authToken: string) => Promise<FeaturedMedia>;
|
|
341
343
|
updateMedia: (id: number, input: UpdateMediaInput, authToken: string) => Promise<FeaturedMedia>;
|
|
342
344
|
deleteMedia: (id: number, authToken: string, force?: boolean) => Promise<{
|
package/dist/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
|
|
|
@@ -3411,7 +3432,7 @@ var GQL_RESET_USER_PASSWORD = `
|
|
|
3411
3432
|
}
|
|
3412
3433
|
}
|
|
3413
3434
|
`;
|
|
3414
|
-
function
|
|
3435
|
+
function createPasswordResetMutations2(fetcher) {
|
|
3415
3436
|
const { gqlMutate } = fetcher;
|
|
3416
3437
|
async function sendPasswordResetEmail(input) {
|
|
3417
3438
|
const data = await gqlMutate(GQL_SEND_PASSWORD_RESET_EMAIL, { input });
|
|
@@ -3439,7 +3460,7 @@ function createWPGraphQLMutationsClient(config) {
|
|
|
3439
3460
|
...createTagsMutations3(fetcher),
|
|
3440
3461
|
...createAuthorsMutations2(fetcher),
|
|
3441
3462
|
...createMediaMutations2(fetcher),
|
|
3442
|
-
...
|
|
3463
|
+
...createPasswordResetMutations2(fetcher)
|
|
3443
3464
|
};
|
|
3444
3465
|
}
|
|
3445
3466
|
|