@kizlo/woocommerce 0.8.0 → 0.10.0
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/README.md +13 -1
- package/dist/index.d.ts +57 -7
- package/dist/index.js +41 -22
- package/dist/test.d.ts +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,6 +42,18 @@ pnpm add @kizlo/woocommerce
|
|
|
42
42
|
|
|
43
43
|
See the [docs](https://kizlo.io/docs) for setup and usage.
|
|
44
44
|
|
|
45
|
+
## Billing Tax IDs
|
|
46
|
+
|
|
47
|
+
Billing addresses expose `taxId` on customers, carts, checkout responses, and orders. The field is always a string on output and defaults to `""` when it has not been set. Billing address inputs accept an optional `taxId`; shipping addresses never expose or persist one.
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
await kizlo.woocommerce.cart.update.call({
|
|
51
|
+
body: { billingAddress: { taxId: "GB123456789" } },
|
|
52
|
+
})
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Store administrators can make the field mandatory from **WooCommerce → Settings → Accounts & Privacy → Checkout → Require Tax ID at checkout**. It remains optional by default.
|
|
56
|
+
|
|
45
57
|
## License
|
|
46
58
|
|
|
47
|
-
[Apache 2.0](./LICENSE) © Kizlo
|
|
59
|
+
[Apache 2.0](./LICENSE) © Kizlo
|
package/dist/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ declare const CartShippingAddress: z$1.ZodObject<{
|
|
|
29
29
|
type CartShippingAddress = z$1.infer<typeof CartShippingAddress>;
|
|
30
30
|
declare const CartBillingAddress: z$1.ZodObject<{
|
|
31
31
|
email: z$1.ZodString;
|
|
32
|
+
taxId: z$1.ZodDefault<z$1.ZodString>;
|
|
32
33
|
firstName: z$1.ZodString;
|
|
33
34
|
lastName: z$1.ZodString;
|
|
34
35
|
company: z$1.ZodString;
|
|
@@ -344,6 +345,7 @@ declare const Cart: z$1.ZodObject<{
|
|
|
344
345
|
itemsWeight: z$1.ZodNumber;
|
|
345
346
|
billingAddress: z$1.ZodObject<{
|
|
346
347
|
email: z$1.ZodString;
|
|
348
|
+
taxId: z$1.ZodDefault<z$1.ZodString>;
|
|
347
349
|
firstName: z$1.ZodString;
|
|
348
350
|
lastName: z$1.ZodString;
|
|
349
351
|
company: z$1.ZodString;
|
|
@@ -619,6 +621,7 @@ declare const UpdateCartInput: z$1.ZodObject<{
|
|
|
619
621
|
}, z$1.core.$strip>>;
|
|
620
622
|
billingAddress: z$1.ZodOptional<z$1.ZodObject<{
|
|
621
623
|
email: z$1.ZodOptional<z$1.ZodString>;
|
|
624
|
+
taxId: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodString>>;
|
|
622
625
|
firstName: z$1.ZodOptional<z$1.ZodString>;
|
|
623
626
|
lastName: z$1.ZodOptional<z$1.ZodString>;
|
|
624
627
|
company: z$1.ZodOptional<z$1.ZodString>;
|
|
@@ -658,10 +661,12 @@ declare const Checkout: z$2.ZodObject<{
|
|
|
658
661
|
orderNumber: z$2.ZodNullable<z$2.ZodString>;
|
|
659
662
|
orderKey: z$2.ZodNullable<z$2.ZodString>;
|
|
660
663
|
status: z$2.ZodString;
|
|
664
|
+
isPaid: z$2.ZodBoolean;
|
|
661
665
|
customerId: z$2.ZodNullable<z$2.ZodNumber>;
|
|
662
666
|
customerNote: z$2.ZodString;
|
|
663
667
|
billingAddress: z$2.ZodObject<{
|
|
664
668
|
email: z$2.ZodString;
|
|
669
|
+
taxId: z$2.ZodDefault<z$2.ZodString>;
|
|
665
670
|
firstName: z$2.ZodString;
|
|
666
671
|
lastName: z$2.ZodString;
|
|
667
672
|
company: z$2.ZodString;
|
|
@@ -769,6 +774,7 @@ declare const Checkout: z$2.ZodObject<{
|
|
|
769
774
|
itemsWeight: z$2.ZodNumber;
|
|
770
775
|
billingAddress: z$2.ZodObject<{
|
|
771
776
|
email: z$2.ZodString;
|
|
777
|
+
taxId: z$2.ZodDefault<z$2.ZodString>;
|
|
772
778
|
firstName: z$2.ZodString;
|
|
773
779
|
lastName: z$2.ZodString;
|
|
774
780
|
company: z$2.ZodString;
|
|
@@ -1007,6 +1013,7 @@ type UpdateCheckoutInput = z$2.input<typeof UpdateCheckoutInput>;
|
|
|
1007
1013
|
declare const ConfirmCheckoutInput: z$2.ZodObject<{
|
|
1008
1014
|
billingAddress: z$2.ZodObject<{
|
|
1009
1015
|
email: z$2.ZodString;
|
|
1016
|
+
taxId: z$2.ZodDefault<z$2.ZodString>;
|
|
1010
1017
|
firstName: z$2.ZodString;
|
|
1011
1018
|
lastName: z$2.ZodString;
|
|
1012
1019
|
company: z$2.ZodString;
|
|
@@ -1053,6 +1060,7 @@ declare const RetryCheckoutInput: z$2.ZodObject<{
|
|
|
1053
1060
|
billingEmail: z$2.ZodOptional<z$2.ZodEmail>;
|
|
1054
1061
|
billingAddress: z$2.ZodObject<{
|
|
1055
1062
|
email: z$2.ZodString;
|
|
1063
|
+
taxId: z$2.ZodDefault<z$2.ZodString>;
|
|
1056
1064
|
firstName: z$2.ZodString;
|
|
1057
1065
|
lastName: z$2.ZodString;
|
|
1058
1066
|
company: z$2.ZodString;
|
|
@@ -1131,6 +1139,7 @@ declare const OrderItem: z.ZodObject<{
|
|
|
1131
1139
|
id: z.ZodNumber;
|
|
1132
1140
|
productId: z.ZodNullable<z.ZodNumber>;
|
|
1133
1141
|
variationId: z.ZodNullable<z.ZodNumber>;
|
|
1142
|
+
hsCode: z.ZodNullable<z.ZodString>;
|
|
1134
1143
|
name: z.ZodString;
|
|
1135
1144
|
quantity: z.ZodNumber;
|
|
1136
1145
|
selectedAttributes: z.ZodArray<z.ZodObject<{
|
|
@@ -1219,10 +1228,12 @@ type OrderTotals = z.infer<typeof OrderTotals>;
|
|
|
1219
1228
|
declare const Order: z.ZodObject<{
|
|
1220
1229
|
id: z.ZodNumber;
|
|
1221
1230
|
status: z.ZodString;
|
|
1231
|
+
isPaid: z.ZodBoolean;
|
|
1222
1232
|
items: z.ZodArray<z.ZodObject<{
|
|
1223
1233
|
id: z.ZodNumber;
|
|
1224
1234
|
productId: z.ZodNullable<z.ZodNumber>;
|
|
1225
1235
|
variationId: z.ZodNullable<z.ZodNumber>;
|
|
1236
|
+
hsCode: z.ZodNullable<z.ZodString>;
|
|
1226
1237
|
name: z.ZodString;
|
|
1227
1238
|
quantity: z.ZodNumber;
|
|
1228
1239
|
selectedAttributes: z.ZodArray<z.ZodObject<{
|
|
@@ -1294,6 +1305,7 @@ declare const Order: z.ZodObject<{
|
|
|
1294
1305
|
}, z.core.$strip>>;
|
|
1295
1306
|
billingAddress: z.ZodObject<{
|
|
1296
1307
|
email: z.ZodString;
|
|
1308
|
+
taxId: z.ZodDefault<z.ZodString>;
|
|
1297
1309
|
firstName: z.ZodString;
|
|
1298
1310
|
lastName: z.ZodString;
|
|
1299
1311
|
company: z.ZodString;
|
|
@@ -2033,6 +2045,7 @@ declare const Product: z.ZodObject<{
|
|
|
2033
2045
|
formattedWeight: z.ZodString;
|
|
2034
2046
|
formattedDimensions: z.ZodString;
|
|
2035
2047
|
stockQuantity: z.ZodNullable<z.ZodNumber>;
|
|
2048
|
+
hsCode: z.ZodNullable<z.ZodString>;
|
|
2036
2049
|
saleStartsAt: z.ZodNullable<z.ZodNumber>;
|
|
2037
2050
|
saleEndsAt: z.ZodNullable<z.ZodNumber>;
|
|
2038
2051
|
seo: z.ZodNullable<z.ZodObject<{
|
|
@@ -2535,6 +2548,7 @@ declare const ProductList: z.ZodObject<{
|
|
|
2535
2548
|
formattedWeight: z.ZodString;
|
|
2536
2549
|
formattedDimensions: z.ZodString;
|
|
2537
2550
|
stockQuantity: z.ZodNullable<z.ZodNumber>;
|
|
2551
|
+
hsCode: z.ZodNullable<z.ZodString>;
|
|
2538
2552
|
saleStartsAt: z.ZodNullable<z.ZodNumber>;
|
|
2539
2553
|
saleEndsAt: z.ZodNullable<z.ZodNumber>;
|
|
2540
2554
|
seo: z.ZodNullable<z.ZodObject<{
|
|
@@ -2979,8 +2993,8 @@ declare const ProductStockStatus: z.ZodEnum<{
|
|
|
2979
2993
|
type ProductStockStatus = z.infer<typeof ProductStockStatus>;
|
|
2980
2994
|
declare const PRODUCT_CATALOG_VISIBILITIES: readonly ["any", "visible", "catalog", "search", "hidden"];
|
|
2981
2995
|
declare const ProductCatalogVisibility: z.ZodEnum<{
|
|
2982
|
-
search: "search";
|
|
2983
2996
|
any: "any";
|
|
2997
|
+
search: "search";
|
|
2984
2998
|
visible: "visible";
|
|
2985
2999
|
catalog: "catalog";
|
|
2986
3000
|
hidden: "hidden";
|
|
@@ -3095,8 +3109,8 @@ declare const ListProductInput: z.ZodObject<{
|
|
|
3095
3109
|
and: "and";
|
|
3096
3110
|
}>>;
|
|
3097
3111
|
catalogVisibility: z.ZodOptional<z.ZodEnum<{
|
|
3098
|
-
search: "search";
|
|
3099
3112
|
any: "any";
|
|
3113
|
+
search: "search";
|
|
3100
3114
|
visible: "visible";
|
|
3101
3115
|
catalog: "catalog";
|
|
3102
3116
|
hidden: "hidden";
|
|
@@ -3264,13 +3278,12 @@ declare const ProductAttributeCount: z.ZodObject<{
|
|
|
3264
3278
|
}, z.core.$strip>;
|
|
3265
3279
|
type ProductAttributeCount = z.input<typeof ProductAttributeCount>;
|
|
3266
3280
|
declare const RetrieveProductFiltersInput: z.ZodObject<{
|
|
3267
|
-
search: z.ZodOptional<z.ZodString>;
|
|
3268
3281
|
type: z.ZodOptional<z.ZodString>;
|
|
3269
3282
|
sku: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
3270
3283
|
slug: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
3271
3284
|
catalogVisibility: z.ZodOptional<z.ZodEnum<{
|
|
3272
|
-
search: "search";
|
|
3273
3285
|
any: "any";
|
|
3286
|
+
search: "search";
|
|
3274
3287
|
visible: "visible";
|
|
3275
3288
|
catalog: "catalog";
|
|
3276
3289
|
hidden: "hidden";
|
|
@@ -3289,6 +3302,7 @@ declare const RetrieveProductFiltersInput: z.ZodObject<{
|
|
|
3289
3302
|
asc: "asc";
|
|
3290
3303
|
desc: "desc";
|
|
3291
3304
|
}>>;
|
|
3305
|
+
search: z.ZodOptional<z.ZodString>;
|
|
3292
3306
|
related: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>>;
|
|
3293
3307
|
parent: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>, z.ZodArray<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>>]>>;
|
|
3294
3308
|
page: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>>;
|
|
@@ -3457,6 +3471,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
3457
3471
|
itemsWeight: number;
|
|
3458
3472
|
billingAddress: {
|
|
3459
3473
|
email: string;
|
|
3474
|
+
taxId: string;
|
|
3460
3475
|
firstName: string;
|
|
3461
3476
|
lastName: string;
|
|
3462
3477
|
company: string;
|
|
@@ -3706,6 +3721,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
3706
3721
|
} | undefined;
|
|
3707
3722
|
billingAddress?: {
|
|
3708
3723
|
email?: string | undefined;
|
|
3724
|
+
taxId?: string | undefined;
|
|
3709
3725
|
firstName?: string | undefined;
|
|
3710
3726
|
lastName?: string | undefined;
|
|
3711
3727
|
company?: string | undefined;
|
|
@@ -3795,6 +3811,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
3795
3811
|
itemsWeight: number;
|
|
3796
3812
|
billingAddress: {
|
|
3797
3813
|
email: string;
|
|
3814
|
+
taxId: string;
|
|
3798
3815
|
firstName: string;
|
|
3799
3816
|
lastName: string;
|
|
3800
3817
|
company: string;
|
|
@@ -4113,6 +4130,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
4113
4130
|
itemsWeight: number;
|
|
4114
4131
|
billingAddress: {
|
|
4115
4132
|
email: string;
|
|
4133
|
+
taxId: string;
|
|
4116
4134
|
firstName: string;
|
|
4117
4135
|
lastName: string;
|
|
4118
4136
|
company: string;
|
|
@@ -4441,6 +4459,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
4441
4459
|
itemsWeight: number;
|
|
4442
4460
|
billingAddress: {
|
|
4443
4461
|
email: string;
|
|
4462
|
+
taxId: string;
|
|
4444
4463
|
firstName: string;
|
|
4445
4464
|
lastName: string;
|
|
4446
4465
|
company: string;
|
|
@@ -4785,6 +4804,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
4785
4804
|
itemsWeight: number;
|
|
4786
4805
|
billingAddress: {
|
|
4787
4806
|
email: string;
|
|
4807
|
+
taxId: string;
|
|
4788
4808
|
firstName: string;
|
|
4789
4809
|
lastName: string;
|
|
4790
4810
|
company: string;
|
|
@@ -5118,6 +5138,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
5118
5138
|
itemsWeight: number;
|
|
5119
5139
|
billingAddress: {
|
|
5120
5140
|
email: string;
|
|
5141
|
+
taxId: string;
|
|
5121
5142
|
firstName: string;
|
|
5122
5143
|
lastName: string;
|
|
5123
5144
|
company: string;
|
|
@@ -5437,6 +5458,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
5437
5458
|
itemsWeight: number;
|
|
5438
5459
|
billingAddress: {
|
|
5439
5460
|
email: string;
|
|
5461
|
+
taxId: string;
|
|
5440
5462
|
firstName: string;
|
|
5441
5463
|
lastName: string;
|
|
5442
5464
|
company: string;
|
|
@@ -5758,6 +5780,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
5758
5780
|
itemsWeight: number;
|
|
5759
5781
|
billingAddress: {
|
|
5760
5782
|
email: string;
|
|
5783
|
+
taxId: string;
|
|
5761
5784
|
firstName: string;
|
|
5762
5785
|
lastName: string;
|
|
5763
5786
|
company: string;
|
|
@@ -6057,7 +6080,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
6057
6080
|
operator?: "in" | "not_in" | "and" | undefined;
|
|
6058
6081
|
}[] | undefined;
|
|
6059
6082
|
attributeRelation?: "in" | "and" | undefined;
|
|
6060
|
-
catalogVisibility?: "
|
|
6083
|
+
catalogVisibility?: "any" | "search" | "visible" | "catalog" | "hidden" | undefined;
|
|
6061
6084
|
rating?: string | number | (string | number)[] | undefined;
|
|
6062
6085
|
related?: string | number | undefined;
|
|
6063
6086
|
taxonomies?: {
|
|
@@ -6070,11 +6093,10 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
6070
6093
|
}, ProductList, {}>;
|
|
6071
6094
|
filters: kizlo0.Procedure<"api", {
|
|
6072
6095
|
query?: {
|
|
6073
|
-
search?: string | undefined;
|
|
6074
6096
|
type?: string | undefined;
|
|
6075
6097
|
sku?: string | string[] | undefined;
|
|
6076
6098
|
slug?: string | string[] | undefined;
|
|
6077
|
-
catalogVisibility?: "
|
|
6099
|
+
catalogVisibility?: "any" | "search" | "visible" | "catalog" | "hidden" | undefined;
|
|
6078
6100
|
attributes?: {
|
|
6079
6101
|
taxonomy: string;
|
|
6080
6102
|
slug?: string | string[] | undefined;
|
|
@@ -6082,6 +6104,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
6082
6104
|
operator?: "in" | "not_in" | "and" | undefined;
|
|
6083
6105
|
}[] | undefined;
|
|
6084
6106
|
order?: "asc" | "desc" | undefined;
|
|
6107
|
+
search?: string | undefined;
|
|
6085
6108
|
related?: string | number | undefined;
|
|
6086
6109
|
parent?: string | number | (string | number)[] | undefined;
|
|
6087
6110
|
page?: string | number | undefined;
|
|
@@ -6187,10 +6210,12 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
6187
6210
|
orderNumber: string | null;
|
|
6188
6211
|
orderKey: string | null;
|
|
6189
6212
|
status: string;
|
|
6213
|
+
isPaid: boolean;
|
|
6190
6214
|
customerId: number | null;
|
|
6191
6215
|
customerNote: string;
|
|
6192
6216
|
billingAddress: {
|
|
6193
6217
|
email: string;
|
|
6218
|
+
taxId: string;
|
|
6194
6219
|
firstName: string;
|
|
6195
6220
|
lastName: string;
|
|
6196
6221
|
company: string;
|
|
@@ -6308,6 +6333,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
6308
6333
|
itemsWeight: number;
|
|
6309
6334
|
billingAddress: {
|
|
6310
6335
|
email: string;
|
|
6336
|
+
taxId: string;
|
|
6311
6337
|
firstName: string;
|
|
6312
6338
|
lastName: string;
|
|
6313
6339
|
company: string;
|
|
@@ -6562,10 +6588,12 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
6562
6588
|
orderNumber: string | null;
|
|
6563
6589
|
orderKey: string | null;
|
|
6564
6590
|
status: string;
|
|
6591
|
+
isPaid: boolean;
|
|
6565
6592
|
customerId: number | null;
|
|
6566
6593
|
customerNote: string;
|
|
6567
6594
|
billingAddress: {
|
|
6568
6595
|
email: string;
|
|
6596
|
+
taxId: string;
|
|
6569
6597
|
firstName: string;
|
|
6570
6598
|
lastName: string;
|
|
6571
6599
|
company: string;
|
|
@@ -6683,6 +6711,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
6683
6711
|
itemsWeight: number;
|
|
6684
6712
|
billingAddress: {
|
|
6685
6713
|
email: string;
|
|
6714
|
+
taxId: string;
|
|
6686
6715
|
firstName: string;
|
|
6687
6716
|
lastName: string;
|
|
6688
6717
|
company: string;
|
|
@@ -7014,6 +7043,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
7014
7043
|
itemsWeight: zod0.ZodNumber;
|
|
7015
7044
|
billingAddress: zod0.ZodObject<{
|
|
7016
7045
|
email: zod0.ZodString;
|
|
7046
|
+
taxId: zod0.ZodDefault<zod0.ZodString>;
|
|
7017
7047
|
firstName: zod0.ZodString;
|
|
7018
7048
|
lastName: zod0.ZodString;
|
|
7019
7049
|
company: zod0.ZodString;
|
|
@@ -7316,6 +7346,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
7316
7346
|
itemsWeight: zod0.ZodNumber;
|
|
7317
7347
|
billingAddress: zod0.ZodObject<{
|
|
7318
7348
|
email: zod0.ZodString;
|
|
7349
|
+
taxId: zod0.ZodDefault<zod0.ZodString>;
|
|
7319
7350
|
firstName: zod0.ZodString;
|
|
7320
7351
|
lastName: zod0.ZodString;
|
|
7321
7352
|
company: zod0.ZodString;
|
|
@@ -7618,6 +7649,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
7618
7649
|
itemsWeight: zod0.ZodNumber;
|
|
7619
7650
|
billingAddress: zod0.ZodObject<{
|
|
7620
7651
|
email: zod0.ZodString;
|
|
7652
|
+
taxId: zod0.ZodDefault<zod0.ZodString>;
|
|
7621
7653
|
firstName: zod0.ZodString;
|
|
7622
7654
|
lastName: zod0.ZodString;
|
|
7623
7655
|
company: zod0.ZodString;
|
|
@@ -7920,6 +7952,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
7920
7952
|
itemsWeight: zod0.ZodNumber;
|
|
7921
7953
|
billingAddress: zod0.ZodObject<{
|
|
7922
7954
|
email: zod0.ZodString;
|
|
7955
|
+
taxId: zod0.ZodDefault<zod0.ZodString>;
|
|
7923
7956
|
firstName: zod0.ZodString;
|
|
7924
7957
|
lastName: zod0.ZodString;
|
|
7925
7958
|
company: zod0.ZodString;
|
|
@@ -8222,6 +8255,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
8222
8255
|
itemsWeight: zod0.ZodNumber;
|
|
8223
8256
|
billingAddress: zod0.ZodObject<{
|
|
8224
8257
|
email: zod0.ZodString;
|
|
8258
|
+
taxId: zod0.ZodDefault<zod0.ZodString>;
|
|
8225
8259
|
firstName: zod0.ZodString;
|
|
8226
8260
|
lastName: zod0.ZodString;
|
|
8227
8261
|
company: zod0.ZodString;
|
|
@@ -8466,6 +8500,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
8466
8500
|
additionalFields: {
|
|
8467
8501
|
[x: string]: string | boolean;
|
|
8468
8502
|
};
|
|
8503
|
+
taxId?: string | undefined;
|
|
8469
8504
|
};
|
|
8470
8505
|
paymentMethod: string;
|
|
8471
8506
|
shippingAddress?: {
|
|
@@ -8498,10 +8533,12 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
8498
8533
|
orderNumber: string | null;
|
|
8499
8534
|
orderKey: string | null;
|
|
8500
8535
|
status: string;
|
|
8536
|
+
isPaid: boolean;
|
|
8501
8537
|
customerId: number | null;
|
|
8502
8538
|
customerNote: string;
|
|
8503
8539
|
billingAddress: {
|
|
8504
8540
|
email: string;
|
|
8541
|
+
taxId: string;
|
|
8505
8542
|
firstName: string;
|
|
8506
8543
|
lastName: string;
|
|
8507
8544
|
company: string;
|
|
@@ -8619,6 +8656,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
8619
8656
|
itemsWeight: number;
|
|
8620
8657
|
billingAddress: {
|
|
8621
8658
|
email: string;
|
|
8659
|
+
taxId: string;
|
|
8622
8660
|
firstName: string;
|
|
8623
8661
|
lastName: string;
|
|
8624
8662
|
company: string;
|
|
@@ -8994,6 +9032,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
8994
9032
|
itemsWeight: zod0.ZodNumber;
|
|
8995
9033
|
billingAddress: zod0.ZodObject<{
|
|
8996
9034
|
email: zod0.ZodString;
|
|
9035
|
+
taxId: zod0.ZodDefault<zod0.ZodString>;
|
|
8997
9036
|
firstName: zod0.ZodString;
|
|
8998
9037
|
lastName: zod0.ZodString;
|
|
8999
9038
|
company: zod0.ZodString;
|
|
@@ -9296,6 +9335,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
9296
9335
|
itemsWeight: zod0.ZodNumber;
|
|
9297
9336
|
billingAddress: zod0.ZodObject<{
|
|
9298
9337
|
email: zod0.ZodString;
|
|
9338
|
+
taxId: zod0.ZodDefault<zod0.ZodString>;
|
|
9299
9339
|
firstName: zod0.ZodString;
|
|
9300
9340
|
lastName: zod0.ZodString;
|
|
9301
9341
|
company: zod0.ZodString;
|
|
@@ -9598,6 +9638,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
9598
9638
|
itemsWeight: zod0.ZodNumber;
|
|
9599
9639
|
billingAddress: zod0.ZodObject<{
|
|
9600
9640
|
email: zod0.ZodString;
|
|
9641
|
+
taxId: zod0.ZodDefault<zod0.ZodString>;
|
|
9601
9642
|
firstName: zod0.ZodString;
|
|
9602
9643
|
lastName: zod0.ZodString;
|
|
9603
9644
|
company: zod0.ZodString;
|
|
@@ -9900,6 +9941,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
9900
9941
|
itemsWeight: zod0.ZodNumber;
|
|
9901
9942
|
billingAddress: zod0.ZodObject<{
|
|
9902
9943
|
email: zod0.ZodString;
|
|
9944
|
+
taxId: zod0.ZodDefault<zod0.ZodString>;
|
|
9903
9945
|
firstName: zod0.ZodString;
|
|
9904
9946
|
lastName: zod0.ZodString;
|
|
9905
9947
|
company: zod0.ZodString;
|
|
@@ -10202,6 +10244,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
10202
10244
|
itemsWeight: zod0.ZodNumber;
|
|
10203
10245
|
billingAddress: zod0.ZodObject<{
|
|
10204
10246
|
email: zod0.ZodString;
|
|
10247
|
+
taxId: zod0.ZodDefault<zod0.ZodString>;
|
|
10205
10248
|
firstName: zod0.ZodString;
|
|
10206
10249
|
lastName: zod0.ZodString;
|
|
10207
10250
|
company: zod0.ZodString;
|
|
@@ -10504,6 +10547,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
10504
10547
|
itemsWeight: zod0.ZodNumber;
|
|
10505
10548
|
billingAddress: zod0.ZodObject<{
|
|
10506
10549
|
email: zod0.ZodString;
|
|
10550
|
+
taxId: zod0.ZodDefault<zod0.ZodString>;
|
|
10507
10551
|
firstName: zod0.ZodString;
|
|
10508
10552
|
lastName: zod0.ZodString;
|
|
10509
10553
|
company: zod0.ZodString;
|
|
@@ -10806,6 +10850,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
10806
10850
|
itemsWeight: zod0.ZodNumber;
|
|
10807
10851
|
billingAddress: zod0.ZodObject<{
|
|
10808
10852
|
email: zod0.ZodString;
|
|
10853
|
+
taxId: zod0.ZodDefault<zod0.ZodString>;
|
|
10809
10854
|
firstName: zod0.ZodString;
|
|
10810
10855
|
lastName: zod0.ZodString;
|
|
10811
10856
|
company: zod0.ZodString;
|
|
@@ -11050,6 +11095,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
11050
11095
|
additionalFields: {
|
|
11051
11096
|
[x: string]: string | boolean;
|
|
11052
11097
|
};
|
|
11098
|
+
taxId?: string | undefined;
|
|
11053
11099
|
};
|
|
11054
11100
|
key: string;
|
|
11055
11101
|
paymentMethod: string;
|
|
@@ -11085,10 +11131,12 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
11085
11131
|
orderNumber: string | null;
|
|
11086
11132
|
orderKey: string | null;
|
|
11087
11133
|
status: string;
|
|
11134
|
+
isPaid: boolean;
|
|
11088
11135
|
customerId: number | null;
|
|
11089
11136
|
customerNote: string;
|
|
11090
11137
|
billingAddress: {
|
|
11091
11138
|
email: string;
|
|
11139
|
+
taxId: string;
|
|
11092
11140
|
firstName: string;
|
|
11093
11141
|
lastName: string;
|
|
11094
11142
|
company: string;
|
|
@@ -11206,6 +11254,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
11206
11254
|
itemsWeight: number;
|
|
11207
11255
|
billingAddress: {
|
|
11208
11256
|
email: string;
|
|
11257
|
+
taxId: string;
|
|
11209
11258
|
firstName: string;
|
|
11210
11259
|
lastName: string;
|
|
11211
11260
|
company: string;
|
|
@@ -11501,6 +11550,7 @@ declare function woocommerce(): kizlo0.Integration<"woocommerce", {
|
|
|
11501
11550
|
state: string;
|
|
11502
11551
|
country: string;
|
|
11503
11552
|
email: string;
|
|
11553
|
+
taxId: string;
|
|
11504
11554
|
company?: string | undefined;
|
|
11505
11555
|
address2?: string | undefined;
|
|
11506
11556
|
};
|
package/dist/index.js
CHANGED
|
@@ -314,6 +314,7 @@ const Product = ProductSummary.extend({
|
|
|
314
314
|
formattedWeight: z.string(),
|
|
315
315
|
formattedDimensions: z.string(),
|
|
316
316
|
stockQuantity: z.number().nullable(),
|
|
317
|
+
hsCode: z.string().nullable(),
|
|
317
318
|
saleStartsAt: z.number().nullable(),
|
|
318
319
|
saleEndsAt: z.number().nullable(),
|
|
319
320
|
seo: Seo.nullable(),
|
|
@@ -501,7 +502,8 @@ const CartAddressFields = {
|
|
|
501
502
|
const CartShippingAddress = z$1.object(CartAddressFields);
|
|
502
503
|
const CartBillingAddress = z$1.object({
|
|
503
504
|
...CartAddressFields,
|
|
504
|
-
email: z$1.string()
|
|
505
|
+
email: z$1.string(),
|
|
506
|
+
taxId: z$1.string().default("")
|
|
505
507
|
});
|
|
506
508
|
const CartShippingDestination = z$1.object({
|
|
507
509
|
address1: z$1.string(),
|
|
@@ -675,10 +677,7 @@ const SelectCartShippingRateInput = z$1.object({
|
|
|
675
677
|
packageId: z$1.union([z$1.number(), z$1.string()]).nullable().optional()
|
|
676
678
|
});
|
|
677
679
|
const CartShippingAddressInput = z$1.object(CartAddressFields).partial();
|
|
678
|
-
const CartBillingAddressInput =
|
|
679
|
-
...CartAddressFields,
|
|
680
|
-
email: z$1.string()
|
|
681
|
-
}).partial();
|
|
680
|
+
const CartBillingAddressInput = CartBillingAddress.partial();
|
|
682
681
|
const UpdateCartInput = z$1.object({
|
|
683
682
|
shippingAddress: CartShippingAddressInput.optional(),
|
|
684
683
|
billingAddress: CartBillingAddressInput.optional()
|
|
@@ -701,6 +700,7 @@ function deserializeStoreProduct(data, recommendations) {
|
|
|
701
700
|
formattedWeight: data.formatted_weight,
|
|
702
701
|
formattedDimensions: data.formatted_dimensions,
|
|
703
702
|
stockQuantity: nullableNumber(kizlo.stock),
|
|
703
|
+
hsCode: typeof kizlo.hs_code === "string" && kizlo.hs_code !== "" ? kizlo.hs_code : null,
|
|
704
704
|
saleStartsAt: timestampFromIso(typeof kizlo.on_sale_from === "string" ? kizlo.on_sale_from : null),
|
|
705
705
|
saleEndsAt: timestampFromIso(typeof kizlo.on_sale_to === "string" ? kizlo.on_sale_to : null),
|
|
706
706
|
seo: isRecord$1(kizlo.seo) ? deserializeSeo(kizlo.seo) : null,
|
|
@@ -931,6 +931,7 @@ function nullableNumber(value) {
|
|
|
931
931
|
|
|
932
932
|
//#endregion
|
|
933
933
|
//#region src/cart/utils.ts
|
|
934
|
+
const TAX_ID_KEY = "kizlo/tax-id";
|
|
934
935
|
function assertNoMissing$2() {}
|
|
935
936
|
assertNoMissing$2();
|
|
936
937
|
assertNoMissing$2();
|
|
@@ -1139,6 +1140,7 @@ function deserializeCartBillingAddress(address) {
|
|
|
1139
1140
|
return {
|
|
1140
1141
|
...deserializeCartShippingAddress(address),
|
|
1141
1142
|
email: address.email,
|
|
1143
|
+
taxId: taxId(address),
|
|
1142
1144
|
additionalFields: additionalAddressFields(address, BILLING_ADDRESS_KEYS)
|
|
1143
1145
|
};
|
|
1144
1146
|
}
|
|
@@ -1152,12 +1154,16 @@ const SHIPPING_ADDRESS_KEYS = new Set([
|
|
|
1152
1154
|
"state",
|
|
1153
1155
|
"postcode",
|
|
1154
1156
|
"country",
|
|
1155
|
-
"phone"
|
|
1157
|
+
"phone",
|
|
1158
|
+
TAX_ID_KEY
|
|
1156
1159
|
]);
|
|
1157
1160
|
const BILLING_ADDRESS_KEYS = new Set([...SHIPPING_ADDRESS_KEYS, "email"]);
|
|
1158
1161
|
function additionalAddressFields(address, standardKeys) {
|
|
1159
1162
|
return Object.fromEntries(Object.entries(address).filter((entry) => !standardKeys.has(entry[0]) && (typeof entry[1] === "string" || typeof entry[1] === "boolean")));
|
|
1160
1163
|
}
|
|
1164
|
+
function taxId(address) {
|
|
1165
|
+
return typeof address[TAX_ID_KEY] === "string" ? address[TAX_ID_KEY] : "";
|
|
1166
|
+
}
|
|
1161
1167
|
function serializeCartUpdateInput(input) {
|
|
1162
1168
|
return {
|
|
1163
1169
|
...input.billingAddress !== void 0 && { billing_address: serializeCartBillingAddress(input.billingAddress) },
|
|
@@ -1166,7 +1172,7 @@ function serializeCartUpdateInput(input) {
|
|
|
1166
1172
|
}
|
|
1167
1173
|
function serializeCartShippingAddress(address) {
|
|
1168
1174
|
return compactAddress({
|
|
1169
|
-
...address.additionalFields,
|
|
1175
|
+
...Object.fromEntries(Object.entries(address.additionalFields ?? {}).filter(([key]) => key !== TAX_ID_KEY)),
|
|
1170
1176
|
first_name: address.firstName,
|
|
1171
1177
|
last_name: address.lastName,
|
|
1172
1178
|
company: address.company,
|
|
@@ -1182,7 +1188,8 @@ function serializeCartShippingAddress(address) {
|
|
|
1182
1188
|
function serializeCartBillingAddress(address) {
|
|
1183
1189
|
return compactAddress({
|
|
1184
1190
|
...serializeCartShippingAddress(address),
|
|
1185
|
-
email: address.email
|
|
1191
|
+
email: address.email,
|
|
1192
|
+
[TAX_ID_KEY]: address.taxId
|
|
1186
1193
|
});
|
|
1187
1194
|
}
|
|
1188
1195
|
function compactAddress(address) {
|
|
@@ -1588,6 +1595,7 @@ const Checkout = z$2.object({
|
|
|
1588
1595
|
orderNumber: z$2.string().nullable(),
|
|
1589
1596
|
orderKey: z$2.string().nullable(),
|
|
1590
1597
|
status: z$2.string(),
|
|
1598
|
+
isPaid: z$2.boolean(),
|
|
1591
1599
|
customerId: z$2.number().nullable(),
|
|
1592
1600
|
customerNote: z$2.string(),
|
|
1593
1601
|
billingAddress: CartBillingAddress,
|
|
@@ -1644,13 +1652,14 @@ function gateway(method) {
|
|
|
1644
1652
|
return method;
|
|
1645
1653
|
}
|
|
1646
1654
|
function deserializeCheckout(data) {
|
|
1647
|
-
const { extensions } = deserializeExtensions(data.extensions);
|
|
1655
|
+
const { extensions, kizlo } = deserializeExtensions(data.extensions);
|
|
1648
1656
|
const paymentResult = data.payment_result;
|
|
1649
1657
|
return {
|
|
1650
1658
|
orderId: data.order_id === 0 ? null : data.order_id,
|
|
1651
1659
|
orderNumber: data.order_number === "" || data.order_number === "0" ? null : data.order_number,
|
|
1652
1660
|
orderKey: data.order_key === "" ? null : data.order_key,
|
|
1653
1661
|
status: data.status,
|
|
1662
|
+
isPaid: kizlo.is_paid === true,
|
|
1654
1663
|
customerId: data.customer_id === 0 ? null : data.customer_id,
|
|
1655
1664
|
customerNote: data.customer_note,
|
|
1656
1665
|
billingAddress: deserializeCartBillingAddress(data.billing_address),
|
|
@@ -1958,7 +1967,10 @@ const ShippingAddress = z$1.object({
|
|
|
1958
1967
|
state: z$1.string(),
|
|
1959
1968
|
country: z$1.string()
|
|
1960
1969
|
});
|
|
1961
|
-
const BillingAddress = ShippingAddress.extend({
|
|
1970
|
+
const BillingAddress = ShippingAddress.extend({
|
|
1971
|
+
email: z$1.string(),
|
|
1972
|
+
taxId: z$1.string().default("")
|
|
1973
|
+
});
|
|
1962
1974
|
|
|
1963
1975
|
//#endregion
|
|
1964
1976
|
//#region src/customer/schema.ts
|
|
@@ -1980,21 +1992,23 @@ const Customer = z$2.object({
|
|
|
1980
1992
|
//#endregion
|
|
1981
1993
|
//#region src/customer/utils.ts
|
|
1982
1994
|
function deserializeCustomer(data) {
|
|
1995
|
+
const billing = data.billing;
|
|
1983
1996
|
return {
|
|
1984
1997
|
id: data.id,
|
|
1985
1998
|
avatarUrl: data.avatar_url.length ? data.avatar_url : null,
|
|
1986
1999
|
billing: {
|
|
1987
|
-
firstName:
|
|
1988
|
-
lastName:
|
|
1989
|
-
address1:
|
|
1990
|
-
city:
|
|
1991
|
-
country:
|
|
1992
|
-
email:
|
|
1993
|
-
phone:
|
|
1994
|
-
postcode:
|
|
1995
|
-
state:
|
|
1996
|
-
address2:
|
|
1997
|
-
company:
|
|
2000
|
+
firstName: billing.first_name,
|
|
2001
|
+
lastName: billing.last_name,
|
|
2002
|
+
address1: billing.address_1,
|
|
2003
|
+
city: billing.city,
|
|
2004
|
+
country: billing.country,
|
|
2005
|
+
email: billing.email,
|
|
2006
|
+
phone: billing.phone,
|
|
2007
|
+
postcode: billing.postcode,
|
|
2008
|
+
state: billing.state,
|
|
2009
|
+
address2: billing.address_2,
|
|
2010
|
+
company: billing.company,
|
|
2011
|
+
taxId: typeof billing.tax_id === "string" ? billing.tax_id : ""
|
|
1998
2012
|
},
|
|
1999
2013
|
shipping: {
|
|
2000
2014
|
firstName: data.shipping.first_name,
|
|
@@ -2076,6 +2090,7 @@ const OrderItem = z.object({
|
|
|
2076
2090
|
id: z.number(),
|
|
2077
2091
|
productId: z.number().nullable(),
|
|
2078
2092
|
variationId: z.number().nullable(),
|
|
2093
|
+
hsCode: z.string().nullable(),
|
|
2079
2094
|
name: z.string(),
|
|
2080
2095
|
quantity: z.number(),
|
|
2081
2096
|
selectedAttributes: z.array(CartSelectedAttribute),
|
|
@@ -2110,6 +2125,7 @@ const OrderTotals = z.object({
|
|
|
2110
2125
|
const Order = z.object({
|
|
2111
2126
|
id: z.number(),
|
|
2112
2127
|
status: z.string(),
|
|
2128
|
+
isPaid: z.boolean(),
|
|
2113
2129
|
items: z.array(OrderItem),
|
|
2114
2130
|
coupons: z.array(CartCoupon),
|
|
2115
2131
|
fees: z.array(OrderFee),
|
|
@@ -2148,9 +2164,11 @@ assertNoMissing();
|
|
|
2148
2164
|
assertNoMissing();
|
|
2149
2165
|
assertNoMissing();
|
|
2150
2166
|
function deserializeOrder(data) {
|
|
2167
|
+
const { kizlo } = deserializeExtensions(data.extensions);
|
|
2151
2168
|
return {
|
|
2152
2169
|
id: data.id,
|
|
2153
2170
|
status: data.status,
|
|
2171
|
+
isPaid: kizlo.is_paid === true,
|
|
2154
2172
|
items: data.items.map(deserializeOrderItem),
|
|
2155
2173
|
coupons: data.coupons.map((coupon) => ({
|
|
2156
2174
|
code: coupon.code,
|
|
@@ -2204,6 +2222,7 @@ function deserializeOrderItem(item) {
|
|
|
2204
2222
|
id: item.id,
|
|
2205
2223
|
productId,
|
|
2206
2224
|
variationId,
|
|
2225
|
+
hsCode: typeof kizlo.hs_code === "string" && kizlo.hs_code !== "" ? kizlo.hs_code : null,
|
|
2207
2226
|
name: item.name,
|
|
2208
2227
|
quantity: item.quantity,
|
|
2209
2228
|
selectedAttributes: item.variation.map((attribute) => ({
|
|
@@ -2416,7 +2435,7 @@ function woocommerce() {
|
|
|
2416
2435
|
requires: {
|
|
2417
2436
|
plugins: [{
|
|
2418
2437
|
name: "kizlo-woocommerce",
|
|
2419
|
-
version: "0.
|
|
2438
|
+
version: "0.10.0"
|
|
2420
2439
|
}],
|
|
2421
2440
|
endpoints: [
|
|
2422
2441
|
"woocommerce.customers",
|
package/dist/test.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as kizlo19 from "kizlo";
|
|
2
2
|
import { DevPluginSource } from "kizlo/test";
|
|
3
3
|
|
|
4
4
|
//#region src/test/index.d.ts
|
|
@@ -20,6 +20,6 @@ declare const BANK_TRANSFER_DESCRIPTION = "Pay by transferring to our test bank
|
|
|
20
20
|
*/
|
|
21
21
|
declare function woocommerce(opts?: {
|
|
22
22
|
plugins?: DevPluginSource[];
|
|
23
|
-
}):
|
|
23
|
+
}): kizlo19.Fixture;
|
|
24
24
|
//#endregion
|
|
25
25
|
export { BANK_TRANSFER_DESCRIPTION, BANK_TRANSFER_TITLE, woocommerce };
|