@szymonpiatek/nextwordpress 0.0.5 → 0.0.6
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/hooks/index.cjs +371 -11
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.cts +92 -2
- package/dist/hooks/index.d.ts +92 -2
- package/dist/hooks/index.js +365 -12
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -172
- package/dist/index.d.ts +17 -172
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/{types-EjYH-eZp.d.cts → types-soq-mA1E.d.cts} +158 -1
- package/dist/{types-EjYH-eZp.d.ts → types-soq-mA1E.d.ts} +158 -1
- package/package.json +1 -1
|
@@ -3,6 +3,8 @@ interface NextWordpressConfig {
|
|
|
3
3
|
serverURL: string;
|
|
4
4
|
/** Used in browser / client components (e.g., public domain). */
|
|
5
5
|
clientURL: string;
|
|
6
|
+
/** Cache TTL in seconds for Next.js ISR revalidation (default: 300). */
|
|
7
|
+
cacheTTL?: number;
|
|
6
8
|
}
|
|
7
9
|
interface WPEntity {
|
|
8
10
|
id: number;
|
|
@@ -34,6 +36,21 @@ interface Taxonomy {
|
|
|
34
36
|
meta: Record<string, unknown>;
|
|
35
37
|
}
|
|
36
38
|
|
|
39
|
+
interface JwtAuthCredentials {
|
|
40
|
+
username: string;
|
|
41
|
+
password: string;
|
|
42
|
+
}
|
|
43
|
+
interface JwtAuthResponse {
|
|
44
|
+
token: string;
|
|
45
|
+
user_email: string;
|
|
46
|
+
user_nicename: string;
|
|
47
|
+
user_display_name: string;
|
|
48
|
+
}
|
|
49
|
+
declare class AuthenticationError extends Error {
|
|
50
|
+
status: number;
|
|
51
|
+
constructor(message: string, status: number);
|
|
52
|
+
}
|
|
53
|
+
|
|
37
54
|
interface MediaSize {
|
|
38
55
|
file: string;
|
|
39
56
|
width: number;
|
|
@@ -363,6 +380,146 @@ interface WCProductFilterParams {
|
|
|
363
380
|
type?: WCProduct['type'];
|
|
364
381
|
}
|
|
365
382
|
|
|
383
|
+
interface WCOrderLineItem {
|
|
384
|
+
id: number;
|
|
385
|
+
name: string;
|
|
386
|
+
product_id: number;
|
|
387
|
+
variation_id: number;
|
|
388
|
+
quantity: number;
|
|
389
|
+
sku: string;
|
|
390
|
+
price: number;
|
|
391
|
+
subtotal: string;
|
|
392
|
+
subtotal_tax: string;
|
|
393
|
+
total: string;
|
|
394
|
+
total_tax: string;
|
|
395
|
+
taxes: Array<{
|
|
396
|
+
id: number;
|
|
397
|
+
total: string;
|
|
398
|
+
subtotal: string;
|
|
399
|
+
}>;
|
|
400
|
+
meta_data: Array<{
|
|
401
|
+
id: number;
|
|
402
|
+
key: string;
|
|
403
|
+
value: unknown;
|
|
404
|
+
display_key: string;
|
|
405
|
+
display_value: string;
|
|
406
|
+
}>;
|
|
407
|
+
image: {
|
|
408
|
+
id: string;
|
|
409
|
+
src: string;
|
|
410
|
+
} | null;
|
|
411
|
+
}
|
|
412
|
+
interface WCShippingLine {
|
|
413
|
+
id: number;
|
|
414
|
+
method_title: string;
|
|
415
|
+
method_id: string;
|
|
416
|
+
instance_id: string;
|
|
417
|
+
total: string;
|
|
418
|
+
total_tax: string;
|
|
419
|
+
taxes: Array<{
|
|
420
|
+
id: number;
|
|
421
|
+
total: string;
|
|
422
|
+
}>;
|
|
423
|
+
meta_data: Array<{
|
|
424
|
+
id: number;
|
|
425
|
+
key: string;
|
|
426
|
+
value: unknown;
|
|
427
|
+
}>;
|
|
428
|
+
}
|
|
429
|
+
interface WCOrder {
|
|
430
|
+
id: number;
|
|
431
|
+
parent_id: number;
|
|
432
|
+
status: 'pending' | 'processing' | 'on-hold' | 'completed' | 'cancelled' | 'refunded' | 'failed' | 'trash';
|
|
433
|
+
currency: string;
|
|
434
|
+
date_created: string;
|
|
435
|
+
date_modified: string;
|
|
436
|
+
discount_total: string;
|
|
437
|
+
discount_tax: string;
|
|
438
|
+
shipping_total: string;
|
|
439
|
+
shipping_tax: string;
|
|
440
|
+
cart_tax: string;
|
|
441
|
+
total: string;
|
|
442
|
+
total_tax: string;
|
|
443
|
+
customer_id: number;
|
|
444
|
+
order_key: string;
|
|
445
|
+
billing: WCAddress;
|
|
446
|
+
shipping: WCAddress;
|
|
447
|
+
payment_method: string;
|
|
448
|
+
payment_method_title: string;
|
|
449
|
+
transaction_id: string;
|
|
450
|
+
customer_note: string;
|
|
451
|
+
line_items: WCOrderLineItem[];
|
|
452
|
+
shipping_lines: WCShippingLine[];
|
|
453
|
+
meta_data: Array<{
|
|
454
|
+
id: number;
|
|
455
|
+
key: string;
|
|
456
|
+
value: unknown;
|
|
457
|
+
}>;
|
|
458
|
+
}
|
|
459
|
+
interface WCCreateOrderInput {
|
|
460
|
+
status?: WCOrder['status'];
|
|
461
|
+
payment_method?: string;
|
|
462
|
+
payment_method_title?: string;
|
|
463
|
+
customer_id?: number;
|
|
464
|
+
customer_note?: string;
|
|
465
|
+
billing?: Partial<WCAddress>;
|
|
466
|
+
shipping?: Partial<WCAddress>;
|
|
467
|
+
line_items: Array<{
|
|
468
|
+
product_id: number;
|
|
469
|
+
variation_id?: number;
|
|
470
|
+
quantity: number;
|
|
471
|
+
}>;
|
|
472
|
+
coupon_lines?: Array<{
|
|
473
|
+
code: string;
|
|
474
|
+
}>;
|
|
475
|
+
shipping_lines?: Array<{
|
|
476
|
+
method_id: string;
|
|
477
|
+
method_title: string;
|
|
478
|
+
total: string;
|
|
479
|
+
}>;
|
|
480
|
+
meta_data?: Array<{
|
|
481
|
+
key: string;
|
|
482
|
+
value: unknown;
|
|
483
|
+
}>;
|
|
484
|
+
set_paid?: boolean;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
interface WCCustomer {
|
|
488
|
+
id: number;
|
|
489
|
+
date_created: string;
|
|
490
|
+
date_modified: string;
|
|
491
|
+
email: string;
|
|
492
|
+
first_name: string;
|
|
493
|
+
last_name: string;
|
|
494
|
+
role: string;
|
|
495
|
+
username: string;
|
|
496
|
+
billing: WCAddress;
|
|
497
|
+
shipping: Omit<WCAddress, 'email' | 'phone'>;
|
|
498
|
+
is_paying_customer: boolean;
|
|
499
|
+
avatar_url: string;
|
|
500
|
+
orders_count: number;
|
|
501
|
+
total_spent: string;
|
|
502
|
+
meta_data: Array<{
|
|
503
|
+
id: number;
|
|
504
|
+
key: string;
|
|
505
|
+
value: unknown;
|
|
506
|
+
}>;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
interface UpdateCustomerInput {
|
|
510
|
+
email?: string;
|
|
511
|
+
first_name?: string;
|
|
512
|
+
last_name?: string;
|
|
513
|
+
username?: string;
|
|
514
|
+
password?: string;
|
|
515
|
+
billing?: Partial<WCAddress>;
|
|
516
|
+
shipping?: Partial<Omit<WCAddress, 'email' | 'phone'>>;
|
|
517
|
+
meta_data?: {
|
|
518
|
+
key: string;
|
|
519
|
+
value: unknown;
|
|
520
|
+
}[];
|
|
521
|
+
}
|
|
522
|
+
|
|
366
523
|
type WPGraphQLConfig = NextWordpressConfig;
|
|
367
524
|
interface GQLPageInfo {
|
|
368
525
|
hasNextPage: boolean;
|
|
@@ -443,4 +600,4 @@ interface GQLPost {
|
|
|
443
600
|
};
|
|
444
601
|
}
|
|
445
602
|
|
|
446
|
-
export { type Author as A, type BlockType as B, type EditorBlock as E, type FeaturedMedia as F, type GQLPost as G, type MediaDetails as M, type NextWordpressConfig as N, type Post as P, type RenderedTitle as R, type SearchResult as S, type Taxonomy as T, type WordPressResponse as W, type WooCommerceConfig as a, type WCProduct as b, type WCProductFilterParams as c, type WooCommerceResponse as d, type
|
|
603
|
+
export { type Author as A, type BlockType as B, type WCProductAttribute as C, type WCProductDefaultAttribute as D, type EditorBlock as E, type FeaturedMedia as F, type GQLPost as G, type WCShippingLine as H, WPGraphQLError as I, type JwtAuthCredentials as J, type WooCommercePaginationHeaders as K, type MediaDetails as M, type NextWordpressConfig as N, type Post as P, type RenderedTitle as R, type SearchResult as S, type Taxonomy as T, type UpdateCustomerInput as U, type WordPressResponse as W, type WooCommerceConfig as a, type WCProduct as b, type WCProductFilterParams as c, type WooCommerceResponse as d, type WCCreateOrderInput as e, type WCOrder as f, type WCCustomer as g, type WPGraphQLConfig as h, type GQLPostFilter as i, type GQLConnection as j, type JwtAuthResponse as k, type WPEntity as l, type RenderedContent as m, type WCImage as n, type WCProductVariation as o, type WCAddress as p, AuthenticationError as q, type EmbeddedAuthor as r, type EmbeddedTerm as s, type GQLError as t, type GQLPageInfo as u, type MediaSize as v, type PostEmbedded as w, type TemplatePart as x, type WCDimensions as y, type WCOrderLineItem as z };
|
|
@@ -3,6 +3,8 @@ interface NextWordpressConfig {
|
|
|
3
3
|
serverURL: string;
|
|
4
4
|
/** Used in browser / client components (e.g., public domain). */
|
|
5
5
|
clientURL: string;
|
|
6
|
+
/** Cache TTL in seconds for Next.js ISR revalidation (default: 300). */
|
|
7
|
+
cacheTTL?: number;
|
|
6
8
|
}
|
|
7
9
|
interface WPEntity {
|
|
8
10
|
id: number;
|
|
@@ -34,6 +36,21 @@ interface Taxonomy {
|
|
|
34
36
|
meta: Record<string, unknown>;
|
|
35
37
|
}
|
|
36
38
|
|
|
39
|
+
interface JwtAuthCredentials {
|
|
40
|
+
username: string;
|
|
41
|
+
password: string;
|
|
42
|
+
}
|
|
43
|
+
interface JwtAuthResponse {
|
|
44
|
+
token: string;
|
|
45
|
+
user_email: string;
|
|
46
|
+
user_nicename: string;
|
|
47
|
+
user_display_name: string;
|
|
48
|
+
}
|
|
49
|
+
declare class AuthenticationError extends Error {
|
|
50
|
+
status: number;
|
|
51
|
+
constructor(message: string, status: number);
|
|
52
|
+
}
|
|
53
|
+
|
|
37
54
|
interface MediaSize {
|
|
38
55
|
file: string;
|
|
39
56
|
width: number;
|
|
@@ -363,6 +380,146 @@ interface WCProductFilterParams {
|
|
|
363
380
|
type?: WCProduct['type'];
|
|
364
381
|
}
|
|
365
382
|
|
|
383
|
+
interface WCOrderLineItem {
|
|
384
|
+
id: number;
|
|
385
|
+
name: string;
|
|
386
|
+
product_id: number;
|
|
387
|
+
variation_id: number;
|
|
388
|
+
quantity: number;
|
|
389
|
+
sku: string;
|
|
390
|
+
price: number;
|
|
391
|
+
subtotal: string;
|
|
392
|
+
subtotal_tax: string;
|
|
393
|
+
total: string;
|
|
394
|
+
total_tax: string;
|
|
395
|
+
taxes: Array<{
|
|
396
|
+
id: number;
|
|
397
|
+
total: string;
|
|
398
|
+
subtotal: string;
|
|
399
|
+
}>;
|
|
400
|
+
meta_data: Array<{
|
|
401
|
+
id: number;
|
|
402
|
+
key: string;
|
|
403
|
+
value: unknown;
|
|
404
|
+
display_key: string;
|
|
405
|
+
display_value: string;
|
|
406
|
+
}>;
|
|
407
|
+
image: {
|
|
408
|
+
id: string;
|
|
409
|
+
src: string;
|
|
410
|
+
} | null;
|
|
411
|
+
}
|
|
412
|
+
interface WCShippingLine {
|
|
413
|
+
id: number;
|
|
414
|
+
method_title: string;
|
|
415
|
+
method_id: string;
|
|
416
|
+
instance_id: string;
|
|
417
|
+
total: string;
|
|
418
|
+
total_tax: string;
|
|
419
|
+
taxes: Array<{
|
|
420
|
+
id: number;
|
|
421
|
+
total: string;
|
|
422
|
+
}>;
|
|
423
|
+
meta_data: Array<{
|
|
424
|
+
id: number;
|
|
425
|
+
key: string;
|
|
426
|
+
value: unknown;
|
|
427
|
+
}>;
|
|
428
|
+
}
|
|
429
|
+
interface WCOrder {
|
|
430
|
+
id: number;
|
|
431
|
+
parent_id: number;
|
|
432
|
+
status: 'pending' | 'processing' | 'on-hold' | 'completed' | 'cancelled' | 'refunded' | 'failed' | 'trash';
|
|
433
|
+
currency: string;
|
|
434
|
+
date_created: string;
|
|
435
|
+
date_modified: string;
|
|
436
|
+
discount_total: string;
|
|
437
|
+
discount_tax: string;
|
|
438
|
+
shipping_total: string;
|
|
439
|
+
shipping_tax: string;
|
|
440
|
+
cart_tax: string;
|
|
441
|
+
total: string;
|
|
442
|
+
total_tax: string;
|
|
443
|
+
customer_id: number;
|
|
444
|
+
order_key: string;
|
|
445
|
+
billing: WCAddress;
|
|
446
|
+
shipping: WCAddress;
|
|
447
|
+
payment_method: string;
|
|
448
|
+
payment_method_title: string;
|
|
449
|
+
transaction_id: string;
|
|
450
|
+
customer_note: string;
|
|
451
|
+
line_items: WCOrderLineItem[];
|
|
452
|
+
shipping_lines: WCShippingLine[];
|
|
453
|
+
meta_data: Array<{
|
|
454
|
+
id: number;
|
|
455
|
+
key: string;
|
|
456
|
+
value: unknown;
|
|
457
|
+
}>;
|
|
458
|
+
}
|
|
459
|
+
interface WCCreateOrderInput {
|
|
460
|
+
status?: WCOrder['status'];
|
|
461
|
+
payment_method?: string;
|
|
462
|
+
payment_method_title?: string;
|
|
463
|
+
customer_id?: number;
|
|
464
|
+
customer_note?: string;
|
|
465
|
+
billing?: Partial<WCAddress>;
|
|
466
|
+
shipping?: Partial<WCAddress>;
|
|
467
|
+
line_items: Array<{
|
|
468
|
+
product_id: number;
|
|
469
|
+
variation_id?: number;
|
|
470
|
+
quantity: number;
|
|
471
|
+
}>;
|
|
472
|
+
coupon_lines?: Array<{
|
|
473
|
+
code: string;
|
|
474
|
+
}>;
|
|
475
|
+
shipping_lines?: Array<{
|
|
476
|
+
method_id: string;
|
|
477
|
+
method_title: string;
|
|
478
|
+
total: string;
|
|
479
|
+
}>;
|
|
480
|
+
meta_data?: Array<{
|
|
481
|
+
key: string;
|
|
482
|
+
value: unknown;
|
|
483
|
+
}>;
|
|
484
|
+
set_paid?: boolean;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
interface WCCustomer {
|
|
488
|
+
id: number;
|
|
489
|
+
date_created: string;
|
|
490
|
+
date_modified: string;
|
|
491
|
+
email: string;
|
|
492
|
+
first_name: string;
|
|
493
|
+
last_name: string;
|
|
494
|
+
role: string;
|
|
495
|
+
username: string;
|
|
496
|
+
billing: WCAddress;
|
|
497
|
+
shipping: Omit<WCAddress, 'email' | 'phone'>;
|
|
498
|
+
is_paying_customer: boolean;
|
|
499
|
+
avatar_url: string;
|
|
500
|
+
orders_count: number;
|
|
501
|
+
total_spent: string;
|
|
502
|
+
meta_data: Array<{
|
|
503
|
+
id: number;
|
|
504
|
+
key: string;
|
|
505
|
+
value: unknown;
|
|
506
|
+
}>;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
interface UpdateCustomerInput {
|
|
510
|
+
email?: string;
|
|
511
|
+
first_name?: string;
|
|
512
|
+
last_name?: string;
|
|
513
|
+
username?: string;
|
|
514
|
+
password?: string;
|
|
515
|
+
billing?: Partial<WCAddress>;
|
|
516
|
+
shipping?: Partial<Omit<WCAddress, 'email' | 'phone'>>;
|
|
517
|
+
meta_data?: {
|
|
518
|
+
key: string;
|
|
519
|
+
value: unknown;
|
|
520
|
+
}[];
|
|
521
|
+
}
|
|
522
|
+
|
|
366
523
|
type WPGraphQLConfig = NextWordpressConfig;
|
|
367
524
|
interface GQLPageInfo {
|
|
368
525
|
hasNextPage: boolean;
|
|
@@ -443,4 +600,4 @@ interface GQLPost {
|
|
|
443
600
|
};
|
|
444
601
|
}
|
|
445
602
|
|
|
446
|
-
export { type Author as A, type BlockType as B, type EditorBlock as E, type FeaturedMedia as F, type GQLPost as G, type MediaDetails as M, type NextWordpressConfig as N, type Post as P, type RenderedTitle as R, type SearchResult as S, type Taxonomy as T, type WordPressResponse as W, type WooCommerceConfig as a, type WCProduct as b, type WCProductFilterParams as c, type WooCommerceResponse as d, type
|
|
603
|
+
export { type Author as A, type BlockType as B, type WCProductAttribute as C, type WCProductDefaultAttribute as D, type EditorBlock as E, type FeaturedMedia as F, type GQLPost as G, type WCShippingLine as H, WPGraphQLError as I, type JwtAuthCredentials as J, type WooCommercePaginationHeaders as K, type MediaDetails as M, type NextWordpressConfig as N, type Post as P, type RenderedTitle as R, type SearchResult as S, type Taxonomy as T, type UpdateCustomerInput as U, type WordPressResponse as W, type WooCommerceConfig as a, type WCProduct as b, type WCProductFilterParams as c, type WooCommerceResponse as d, type WCCreateOrderInput as e, type WCOrder as f, type WCCustomer as g, type WPGraphQLConfig as h, type GQLPostFilter as i, type GQLConnection as j, type JwtAuthResponse as k, type WPEntity as l, type RenderedContent as m, type WCImage as n, type WCProductVariation as o, type WCAddress as p, AuthenticationError as q, type EmbeddedAuthor as r, type EmbeddedTerm as s, type GQLError as t, type GQLPageInfo as u, type MediaSize as v, type PostEmbedded as w, type TemplatePart as x, type WCDimensions as y, type WCOrderLineItem as z };
|