@reactionary/core 0.1.13 → 0.2.2
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/cache/memory-cache.js +1 -1
- package/decorators/reactionary.decorator.js +50 -16
- package/package.json +1 -1
- package/providers/base.provider.js +0 -15
- package/providers/cart.provider.js +0 -39
- package/providers/inventory.provider.js +1 -8
- package/providers/order.provider.js +0 -1
- package/providers/price.provider.js +0 -7
- package/providers/product.provider.js +0 -7
- package/schemas/errors/generic.error.js +8 -0
- package/schemas/errors/index.js +4 -0
- package/schemas/errors/invalid-input.error.js +8 -0
- package/schemas/errors/invalid-output.error.js +8 -0
- package/schemas/errors/not-found.error.js +8 -0
- package/schemas/index.js +2 -0
- package/schemas/models/base.model.js +1 -14
- package/schemas/models/profile.model.js +1 -1
- package/schemas/mutations/cart.mutation.js +1 -1
- package/schemas/mutations/checkout.mutation.js +4 -4
- package/schemas/mutations/profile.mutation.js +31 -3
- package/schemas/queries/profile.query.js +5 -2
- package/schemas/result.js +51 -0
- package/src/cache/memory-cache.d.ts +2 -1
- package/src/decorators/reactionary.decorator.d.ts +3 -2
- package/src/providers/base.provider.d.ts +0 -3
- package/src/providers/cart.provider.d.ts +11 -10
- package/src/providers/category.provider.d.ts +6 -6
- package/src/providers/checkout.provider.d.ts +11 -9
- package/src/providers/identity.provider.d.ts +5 -4
- package/src/providers/inventory.provider.d.ts +3 -1
- package/src/providers/order.provider.d.ts +3 -1
- package/src/providers/price.provider.d.ts +3 -3
- package/src/providers/product-search.provider.d.ts +3 -3
- package/src/providers/product.provider.d.ts +5 -3
- package/src/providers/profile.provider.d.ts +66 -4
- package/src/providers/store.provider.d.ts +2 -1
- package/src/schemas/errors/generic.error.d.ts +7 -0
- package/src/schemas/errors/index.d.ts +4 -0
- package/src/schemas/errors/invalid-input.error.d.ts +7 -0
- package/src/schemas/errors/invalid-output.error.d.ts +7 -0
- package/src/schemas/errors/not-found.error.d.ts +7 -0
- package/src/schemas/index.d.ts +2 -0
- package/src/schemas/models/analytics.model.d.ts +1 -9
- package/src/schemas/models/base.model.d.ts +1 -29
- package/src/schemas/models/cart.model.d.ts +0 -7
- package/src/schemas/models/category.model.d.ts +0 -21
- package/src/schemas/models/checkout.model.d.ts +0 -35
- package/src/schemas/models/identity.model.d.ts +0 -42
- package/src/schemas/models/inventory.model.d.ts +0 -7
- package/src/schemas/models/order.model.d.ts +0 -28
- package/src/schemas/models/payment.model.d.ts +0 -14
- package/src/schemas/models/price.model.d.ts +0 -7
- package/src/schemas/models/product-search.model.d.ts +0 -21
- package/src/schemas/models/product.model.d.ts +0 -7
- package/src/schemas/models/profile.model.d.ts +2 -37
- package/src/schemas/models/shipping-method.model.d.ts +0 -14
- package/src/schemas/models/store.model.d.ts +0 -7
- package/src/schemas/mutations/cart.mutation.d.ts +2 -16
- package/src/schemas/mutations/checkout.mutation.d.ts +1 -8
- package/src/schemas/mutations/profile.mutation.d.ts +78 -0
- package/src/schemas/queries/product-search.query.d.ts +0 -7
- package/src/schemas/queries/profile.query.d.ts +6 -2
- package/src/schemas/result.d.ts +55 -0
|
@@ -1,70 +1,28 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { InferType } from '../../zod-utils.js';
|
|
3
3
|
export declare const AnonymousIdentitySchema: z.ZodObject<{
|
|
4
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
5
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
6
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
7
|
-
key: z.ZodDefault<z.ZodString>;
|
|
8
|
-
}, z.core.$loose>>;
|
|
9
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
10
|
-
}, z.core.$loose>>;
|
|
11
4
|
type: z.ZodLiteral<"Anonymous">;
|
|
12
5
|
}, z.core.$loose>;
|
|
13
6
|
export declare const GuestIdentitySchema: z.ZodObject<{
|
|
14
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
15
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
16
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
17
|
-
key: z.ZodDefault<z.ZodString>;
|
|
18
|
-
}, z.core.$loose>>;
|
|
19
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
20
|
-
}, z.core.$loose>>;
|
|
21
7
|
id: z.ZodObject<{
|
|
22
8
|
userId: z.ZodString;
|
|
23
9
|
}, z.core.$loose>;
|
|
24
10
|
type: z.ZodLiteral<"Guest">;
|
|
25
11
|
}, z.core.$loose>;
|
|
26
12
|
export declare const RegisteredIdentitySchema: z.ZodObject<{
|
|
27
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
28
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
29
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
30
|
-
key: z.ZodDefault<z.ZodString>;
|
|
31
|
-
}, z.core.$loose>>;
|
|
32
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
33
|
-
}, z.core.$loose>>;
|
|
34
13
|
id: z.ZodObject<{
|
|
35
14
|
userId: z.ZodString;
|
|
36
15
|
}, z.core.$loose>;
|
|
37
16
|
type: z.ZodLiteral<"Registered">;
|
|
38
17
|
}, z.core.$loose>;
|
|
39
18
|
export declare const IdentitySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
40
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
41
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
42
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
43
|
-
key: z.ZodDefault<z.ZodString>;
|
|
44
|
-
}, z.core.$loose>>;
|
|
45
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
46
|
-
}, z.core.$loose>>;
|
|
47
19
|
type: z.ZodLiteral<"Anonymous">;
|
|
48
20
|
}, z.core.$loose>, z.ZodObject<{
|
|
49
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
50
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
51
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
52
|
-
key: z.ZodDefault<z.ZodString>;
|
|
53
|
-
}, z.core.$loose>>;
|
|
54
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
55
|
-
}, z.core.$loose>>;
|
|
56
21
|
id: z.ZodObject<{
|
|
57
22
|
userId: z.ZodString;
|
|
58
23
|
}, z.core.$loose>;
|
|
59
24
|
type: z.ZodLiteral<"Guest">;
|
|
60
25
|
}, z.core.$loose>, z.ZodObject<{
|
|
61
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
62
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
63
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
64
|
-
key: z.ZodDefault<z.ZodString>;
|
|
65
|
-
}, z.core.$loose>>;
|
|
66
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
67
|
-
}, z.core.$loose>>;
|
|
68
26
|
id: z.ZodObject<{
|
|
69
27
|
userId: z.ZodString;
|
|
70
28
|
}, z.core.$loose>;
|
|
@@ -8,13 +8,6 @@ export declare const InventoryStatusSchema: z.ZodEnum<{
|
|
|
8
8
|
discontinued: "discontinued";
|
|
9
9
|
}>;
|
|
10
10
|
export declare const InventorySchema: z.ZodObject<{
|
|
11
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
12
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
13
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
14
|
-
key: z.ZodDefault<z.ZodString>;
|
|
15
|
-
}, z.core.$loose>>;
|
|
16
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
17
|
-
}, z.core.$loose>>;
|
|
18
11
|
identifier: z.ZodObject<{
|
|
19
12
|
variant: z.ZodObject<{
|
|
20
13
|
sku: z.ZodString;
|
|
@@ -774,13 +774,6 @@ export declare const OrderItemSchema: z.ZodObject<{
|
|
|
774
774
|
}>;
|
|
775
775
|
}, z.core.$loose>;
|
|
776
776
|
export declare const OrderSchema: z.ZodObject<{
|
|
777
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
778
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
779
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
780
|
-
key: z.ZodDefault<z.ZodString>;
|
|
781
|
-
}, z.core.$loose>>;
|
|
782
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
783
|
-
}, z.core.$loose>>;
|
|
784
777
|
identifier: z.ZodObject<{
|
|
785
778
|
key: z.ZodString;
|
|
786
779
|
}, z.core.$loose>;
|
|
@@ -2669,13 +2662,6 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
2669
2662
|
name: z.ZodOptional<z.ZodString>;
|
|
2670
2663
|
description: z.ZodOptional<z.ZodString>;
|
|
2671
2664
|
shippingAddress: z.ZodOptional<z.ZodObject<{
|
|
2672
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
2673
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
2674
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
2675
|
-
key: z.ZodDefault<z.ZodString>;
|
|
2676
|
-
}, z.core.$loose>>;
|
|
2677
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
2678
|
-
}, z.core.$loose>>;
|
|
2679
2665
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
2680
2666
|
nickName: z.ZodString;
|
|
2681
2667
|
}, z.core.$loose>>;
|
|
@@ -2689,13 +2675,6 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
2689
2675
|
countryCode: z.ZodString;
|
|
2690
2676
|
}, z.core.$loose>>;
|
|
2691
2677
|
billingAddress: z.ZodOptional<z.ZodObject<{
|
|
2692
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
2693
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
2694
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
2695
|
-
key: z.ZodDefault<z.ZodString>;
|
|
2696
|
-
}, z.core.$loose>>;
|
|
2697
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
2698
|
-
}, z.core.$loose>>;
|
|
2699
2678
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
2700
2679
|
nickName: z.ZodString;
|
|
2701
2680
|
}, z.core.$loose>>;
|
|
@@ -2922,13 +2901,6 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
2922
2901
|
Preordered: "Preordered";
|
|
2923
2902
|
}>;
|
|
2924
2903
|
paymentInstructions: z.ZodArray<z.ZodObject<{
|
|
2925
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
2926
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
2927
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
2928
|
-
key: z.ZodDefault<z.ZodString>;
|
|
2929
|
-
}, z.core.$loose>>;
|
|
2930
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
2931
|
-
}, z.core.$loose>>;
|
|
2932
2904
|
identifier: z.ZodObject<{
|
|
2933
2905
|
key: z.ZodString;
|
|
2934
2906
|
}, z.core.$loose>;
|
|
@@ -14,13 +14,6 @@ export declare const PaymentProtocolDataSchema: z.ZodObject<{
|
|
|
14
14
|
value: z.ZodString;
|
|
15
15
|
}, z.core.$loose>;
|
|
16
16
|
export declare const PaymentMethodSchema: z.ZodObject<{
|
|
17
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
18
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
19
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
20
|
-
key: z.ZodDefault<z.ZodString>;
|
|
21
|
-
}, z.core.$loose>>;
|
|
22
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
23
|
-
}, z.core.$loose>>;
|
|
24
17
|
identifier: z.ZodObject<{
|
|
25
18
|
method: z.ZodString;
|
|
26
19
|
name: z.ZodString;
|
|
@@ -36,13 +29,6 @@ export declare const PaymentMethodSchema: z.ZodObject<{
|
|
|
36
29
|
isPunchOut: z.ZodBoolean;
|
|
37
30
|
}, z.core.$loose>;
|
|
38
31
|
export declare const PaymentInstructionSchema: z.ZodObject<{
|
|
39
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
40
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
41
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
42
|
-
key: z.ZodDefault<z.ZodString>;
|
|
43
|
-
}, z.core.$loose>>;
|
|
44
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
45
|
-
}, z.core.$loose>>;
|
|
46
32
|
identifier: z.ZodObject<{
|
|
47
33
|
key: z.ZodString;
|
|
48
34
|
}, z.core.$loose>;
|
|
@@ -376,13 +376,6 @@ export declare const TieredPriceSchema: z.ZodObject<{
|
|
|
376
376
|
}, z.core.$loose>;
|
|
377
377
|
}, z.core.$loose>;
|
|
378
378
|
export declare const PriceSchema: z.ZodObject<{
|
|
379
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
380
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
381
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
382
|
-
key: z.ZodDefault<z.ZodString>;
|
|
383
|
-
}, z.core.$loose>>;
|
|
384
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
385
|
-
}, z.core.$loose>>;
|
|
386
379
|
identifier: z.ZodObject<{
|
|
387
380
|
variant: z.ZodObject<{
|
|
388
381
|
sku: z.ZodString;
|
|
@@ -27,13 +27,6 @@ export declare const ProductSearchResultItemVariantSchema: z.ZodObject<{
|
|
|
27
27
|
}, z.core.$loose>>;
|
|
28
28
|
}, z.core.$loose>;
|
|
29
29
|
export declare const ProductSearchResultItemSchema: z.ZodObject<{
|
|
30
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
31
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
32
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
33
|
-
key: z.ZodDefault<z.ZodString>;
|
|
34
|
-
}, z.core.$loose>>;
|
|
35
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
36
|
-
}, z.core.$loose>>;
|
|
37
30
|
identifier: z.ZodObject<{
|
|
38
31
|
key: z.ZodString;
|
|
39
32
|
}, z.core.$loose>;
|
|
@@ -95,25 +88,11 @@ export declare const ProductSearchResultFacetSchema: z.ZodObject<{
|
|
|
95
88
|
}, z.core.$loose>>;
|
|
96
89
|
}, z.core.$loose>;
|
|
97
90
|
export declare const ProductSearchResultSchema: z.ZodObject<{
|
|
98
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
99
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
100
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
101
|
-
key: z.ZodDefault<z.ZodString>;
|
|
102
|
-
}, z.core.$loose>>;
|
|
103
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
104
|
-
}, z.core.$loose>>;
|
|
105
91
|
pageNumber: z.ZodNumber;
|
|
106
92
|
pageSize: z.ZodNumber;
|
|
107
93
|
totalCount: z.ZodNumber;
|
|
108
94
|
totalPages: z.ZodNumber;
|
|
109
95
|
items: z.ZodArray<z.ZodObject<{
|
|
110
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
111
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
112
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
113
|
-
key: z.ZodDefault<z.ZodString>;
|
|
114
|
-
}, z.core.$loose>>;
|
|
115
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
116
|
-
}, z.core.$loose>>;
|
|
117
96
|
identifier: z.ZodObject<{
|
|
118
97
|
key: z.ZodString;
|
|
119
98
|
}, z.core.$loose>;
|
|
@@ -92,13 +92,6 @@ export declare const ProductAttributeSchema: z.ZodObject<{
|
|
|
92
92
|
}, z.core.$loose>>;
|
|
93
93
|
}, z.core.$loose>;
|
|
94
94
|
export declare const ProductSchema: z.ZodObject<{
|
|
95
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
96
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
97
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
98
|
-
key: z.ZodDefault<z.ZodString>;
|
|
99
|
-
}, z.core.$loose>>;
|
|
100
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
101
|
-
}, z.core.$loose>>;
|
|
102
95
|
identifier: z.ZodObject<{
|
|
103
96
|
key: z.ZodString;
|
|
104
97
|
}, z.core.$loose>;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { InferType } from '../../zod-utils.js';
|
|
3
3
|
export declare const AddressSchema: z.ZodObject<{
|
|
4
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
5
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
6
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
7
|
-
key: z.ZodDefault<z.ZodString>;
|
|
8
|
-
}, z.core.$loose>>;
|
|
9
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
10
|
-
}, z.core.$loose>>;
|
|
11
4
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
12
5
|
nickName: z.ZodString;
|
|
13
6
|
}, z.core.$loose>>;
|
|
@@ -21,13 +14,6 @@ export declare const AddressSchema: z.ZodObject<{
|
|
|
21
14
|
countryCode: z.ZodString;
|
|
22
15
|
}, z.core.$loose>;
|
|
23
16
|
export declare const ProfileSchema: z.ZodObject<{
|
|
24
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
25
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
26
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
27
|
-
key: z.ZodDefault<z.ZodString>;
|
|
28
|
-
}, z.core.$loose>>;
|
|
29
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
30
|
-
}, z.core.$loose>>;
|
|
31
17
|
identifier: z.ZodObject<{
|
|
32
18
|
userId: z.ZodString;
|
|
33
19
|
}, z.core.$loose>;
|
|
@@ -38,13 +24,6 @@ export declare const ProfileSchema: z.ZodObject<{
|
|
|
38
24
|
createdAt: z.ZodString;
|
|
39
25
|
updatedAt: z.ZodString;
|
|
40
26
|
shippingAddress: z.ZodOptional<z.ZodObject<{
|
|
41
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
42
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
43
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
44
|
-
key: z.ZodDefault<z.ZodString>;
|
|
45
|
-
}, z.core.$loose>>;
|
|
46
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
47
|
-
}, z.core.$loose>>;
|
|
48
27
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
49
28
|
nickName: z.ZodString;
|
|
50
29
|
}, z.core.$loose>>;
|
|
@@ -58,13 +37,6 @@ export declare const ProfileSchema: z.ZodObject<{
|
|
|
58
37
|
countryCode: z.ZodString;
|
|
59
38
|
}, z.core.$loose>>;
|
|
60
39
|
billingAddress: z.ZodOptional<z.ZodObject<{
|
|
61
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
62
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
63
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
64
|
-
key: z.ZodDefault<z.ZodString>;
|
|
65
|
-
}, z.core.$loose>>;
|
|
66
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
67
|
-
}, z.core.$loose>>;
|
|
68
40
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
69
41
|
nickName: z.ZodString;
|
|
70
42
|
}, z.core.$loose>>;
|
|
@@ -77,14 +49,7 @@ export declare const ProfileSchema: z.ZodObject<{
|
|
|
77
49
|
postalCode: z.ZodString;
|
|
78
50
|
countryCode: z.ZodString;
|
|
79
51
|
}, z.core.$loose>>;
|
|
80
|
-
alternateShippingAddresses: z.ZodArray<z.ZodObject<{
|
|
81
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
82
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
83
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
84
|
-
key: z.ZodDefault<z.ZodString>;
|
|
85
|
-
}, z.core.$loose>>;
|
|
86
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
87
|
-
}, z.core.$loose>>;
|
|
52
|
+
alternateShippingAddresses: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
88
53
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
89
54
|
nickName: z.ZodString;
|
|
90
55
|
}, z.core.$loose>>;
|
|
@@ -96,7 +61,7 @@ export declare const ProfileSchema: z.ZodObject<{
|
|
|
96
61
|
region: z.ZodString;
|
|
97
62
|
postalCode: z.ZodString;
|
|
98
63
|
countryCode: z.ZodString;
|
|
99
|
-
}, z.core.$loose
|
|
64
|
+
}, z.core.$loose>>>;
|
|
100
65
|
}, z.core.$loose>;
|
|
101
66
|
export type Address = InferType<typeof AddressSchema>;
|
|
102
67
|
export type Profile = InferType<typeof ProfileSchema>;
|
|
@@ -7,13 +7,6 @@ export declare const PickupPointSchema: z.ZodObject<{
|
|
|
7
7
|
name: z.ZodString;
|
|
8
8
|
description: z.ZodString;
|
|
9
9
|
address: z.ZodObject<{
|
|
10
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
11
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
12
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
13
|
-
key: z.ZodDefault<z.ZodString>;
|
|
14
|
-
}, z.core.$loose>>;
|
|
15
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
16
|
-
}, z.core.$loose>>;
|
|
17
10
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
18
11
|
nickName: z.ZodString;
|
|
19
12
|
}, z.core.$loose>>;
|
|
@@ -233,13 +226,6 @@ export declare const ShippingMethodSchema: z.ZodObject<{
|
|
|
233
226
|
carrier: z.ZodOptional<z.ZodString>;
|
|
234
227
|
}, z.core.$loose>;
|
|
235
228
|
export declare const ShippingInstructionSchema: z.ZodObject<{
|
|
236
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
237
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
238
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
239
|
-
key: z.ZodDefault<z.ZodString>;
|
|
240
|
-
}, z.core.$loose>>;
|
|
241
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
242
|
-
}, z.core.$loose>>;
|
|
243
229
|
shippingMethod: z.ZodObject<{
|
|
244
230
|
key: z.ZodString;
|
|
245
231
|
}, z.core.$loose>;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { InferType } from '../../zod-utils.js';
|
|
3
3
|
export declare const StoreSchema: z.ZodObject<{
|
|
4
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
5
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
6
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
7
|
-
key: z.ZodDefault<z.ZodString>;
|
|
8
|
-
}, z.core.$loose>>;
|
|
9
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
10
|
-
}, z.core.$loose>>;
|
|
11
4
|
identifier: z.ZodObject<{
|
|
12
5
|
key: z.ZodString;
|
|
13
6
|
}, z.core.$loose>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { InferType } from '../../zod-utils.js';
|
|
3
3
|
export declare const CartMutationItemAddSchema: z.ZodObject<{
|
|
4
|
-
cart: z.ZodObject<{
|
|
4
|
+
cart: z.ZodOptional<z.ZodObject<{
|
|
5
5
|
key: z.ZodString;
|
|
6
|
-
}, z.core.$loose
|
|
6
|
+
}, z.core.$loose>>;
|
|
7
7
|
variant: z.ZodObject<{
|
|
8
8
|
sku: z.ZodString;
|
|
9
9
|
}, z.core.$loose>;
|
|
@@ -39,13 +39,6 @@ export declare const CartMutationSetShippingInfoSchema: z.ZodObject<{
|
|
|
39
39
|
key: z.ZodString;
|
|
40
40
|
}, z.core.$loose>>;
|
|
41
41
|
shippingAddress: z.ZodOptional<z.ZodObject<{
|
|
42
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
43
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
44
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
45
|
-
key: z.ZodDefault<z.ZodString>;
|
|
46
|
-
}, z.core.$loose>>;
|
|
47
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
48
|
-
}, z.core.$loose>>;
|
|
49
42
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
50
43
|
nickName: z.ZodString;
|
|
51
44
|
}, z.core.$loose>>;
|
|
@@ -64,13 +57,6 @@ export declare const CartMutationSetBillingAddressSchema: z.ZodObject<{
|
|
|
64
57
|
key: z.ZodString;
|
|
65
58
|
}, z.core.$loose>;
|
|
66
59
|
billingAddress: z.ZodObject<{
|
|
67
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
68
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
69
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
70
|
-
key: z.ZodDefault<z.ZodString>;
|
|
71
|
-
}, z.core.$loose>>;
|
|
72
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
73
|
-
}, z.core.$loose>>;
|
|
74
60
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
75
61
|
nickName: z.ZodString;
|
|
76
62
|
}, z.core.$loose>>;
|
|
@@ -2,13 +2,6 @@ import { z } from "zod";
|
|
|
2
2
|
import type { InferType } from '../../zod-utils.js';
|
|
3
3
|
export declare const CheckoutMutationInitiateCheckoutSchema: z.ZodObject<{
|
|
4
4
|
cart: z.ZodObject<{
|
|
5
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
6
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
7
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
8
|
-
key: z.ZodDefault<z.ZodString>;
|
|
9
|
-
}, z.core.$loose>>;
|
|
10
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
11
|
-
}, z.core.$loose>>;
|
|
12
5
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
13
6
|
key: z.ZodString;
|
|
14
7
|
}, z.core.$loose>>;
|
|
@@ -2139,11 +2132,11 @@ export declare const CheckoutMutationRemovePaymentInstructionSchema: z.ZodObject
|
|
|
2139
2132
|
}, z.core.$loose>;
|
|
2140
2133
|
export declare const CheckoutMutationSetShippingInstructionSchema: z.ZodObject<{
|
|
2141
2134
|
shippingInstruction: z.ZodObject<{
|
|
2142
|
-
instructions: z.ZodString;
|
|
2143
2135
|
shippingMethod: z.ZodObject<{
|
|
2144
2136
|
key: z.ZodString;
|
|
2145
2137
|
}, z.core.$loose>;
|
|
2146
2138
|
pickupPoint: z.ZodString;
|
|
2139
|
+
instructions: z.ZodString;
|
|
2147
2140
|
consentForUnattendedDelivery: z.ZodBoolean;
|
|
2148
2141
|
}, z.core.$loose>;
|
|
2149
2142
|
checkout: z.ZodObject<{
|
|
@@ -1,7 +1,85 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { InferType } from '../../zod-utils.js';
|
|
3
3
|
export declare const ProfileMutationUpdateSchema: z.ZodObject<{
|
|
4
|
+
identifier: z.ZodObject<{
|
|
5
|
+
userId: z.ZodString;
|
|
6
|
+
}, z.core.$loose>;
|
|
4
7
|
email: z.ZodEmail;
|
|
5
8
|
phone: z.ZodString;
|
|
6
9
|
}, z.core.$loose>;
|
|
10
|
+
export declare const ProfileMutationAddShippingAddressSchema: z.ZodObject<{
|
|
11
|
+
identifier: z.ZodObject<{
|
|
12
|
+
userId: z.ZodString;
|
|
13
|
+
}, z.core.$loose>;
|
|
14
|
+
address: z.ZodObject<{
|
|
15
|
+
identifier: z.ZodDefault<z.ZodObject<{
|
|
16
|
+
nickName: z.ZodString;
|
|
17
|
+
}, z.core.$loose>>;
|
|
18
|
+
firstName: z.ZodString;
|
|
19
|
+
lastName: z.ZodString;
|
|
20
|
+
streetAddress: z.ZodString;
|
|
21
|
+
streetNumber: z.ZodString;
|
|
22
|
+
city: z.ZodString;
|
|
23
|
+
region: z.ZodString;
|
|
24
|
+
postalCode: z.ZodString;
|
|
25
|
+
countryCode: z.ZodString;
|
|
26
|
+
}, z.core.$loose>;
|
|
27
|
+
}, z.core.$loose>;
|
|
28
|
+
export declare const ProfileMutationRemoveShippingAddressSchema: z.ZodObject<{
|
|
29
|
+
identifier: z.ZodObject<{
|
|
30
|
+
userId: z.ZodString;
|
|
31
|
+
}, z.core.$loose>;
|
|
32
|
+
addressIdentifier: z.ZodObject<{
|
|
33
|
+
nickName: z.ZodString;
|
|
34
|
+
}, z.core.$loose>;
|
|
35
|
+
}, z.core.$loose>;
|
|
36
|
+
export declare const ProfileMutationUpdateShippingAddressSchema: z.ZodObject<{
|
|
37
|
+
identifier: z.ZodObject<{
|
|
38
|
+
userId: z.ZodString;
|
|
39
|
+
}, z.core.$loose>;
|
|
40
|
+
address: z.ZodObject<{
|
|
41
|
+
identifier: z.ZodDefault<z.ZodObject<{
|
|
42
|
+
nickName: z.ZodString;
|
|
43
|
+
}, z.core.$loose>>;
|
|
44
|
+
firstName: z.ZodString;
|
|
45
|
+
lastName: z.ZodString;
|
|
46
|
+
streetAddress: z.ZodString;
|
|
47
|
+
streetNumber: z.ZodString;
|
|
48
|
+
city: z.ZodString;
|
|
49
|
+
region: z.ZodString;
|
|
50
|
+
postalCode: z.ZodString;
|
|
51
|
+
countryCode: z.ZodString;
|
|
52
|
+
}, z.core.$loose>;
|
|
53
|
+
}, z.core.$loose>;
|
|
54
|
+
export declare const ProfileMutationMakeShippingAddressDefaultSchema: z.ZodObject<{
|
|
55
|
+
identifier: z.ZodObject<{
|
|
56
|
+
userId: z.ZodString;
|
|
57
|
+
}, z.core.$loose>;
|
|
58
|
+
addressIdentifier: z.ZodObject<{
|
|
59
|
+
nickName: z.ZodString;
|
|
60
|
+
}, z.core.$loose>;
|
|
61
|
+
}, z.core.$loose>;
|
|
62
|
+
export declare const ProfileMutationSetBillingAddressSchema: z.ZodObject<{
|
|
63
|
+
identifier: z.ZodObject<{
|
|
64
|
+
userId: z.ZodString;
|
|
65
|
+
}, z.core.$loose>;
|
|
66
|
+
address: z.ZodObject<{
|
|
67
|
+
identifier: z.ZodDefault<z.ZodObject<{
|
|
68
|
+
nickName: z.ZodString;
|
|
69
|
+
}, z.core.$loose>>;
|
|
70
|
+
firstName: z.ZodString;
|
|
71
|
+
lastName: z.ZodString;
|
|
72
|
+
streetAddress: z.ZodString;
|
|
73
|
+
streetNumber: z.ZodString;
|
|
74
|
+
city: z.ZodString;
|
|
75
|
+
region: z.ZodString;
|
|
76
|
+
postalCode: z.ZodString;
|
|
77
|
+
countryCode: z.ZodString;
|
|
78
|
+
}, z.core.$loose>;
|
|
79
|
+
}, z.core.$loose>;
|
|
7
80
|
export type ProfileMutationUpdate = InferType<typeof ProfileMutationUpdateSchema>;
|
|
81
|
+
export type ProfileMutationAddShippingAddress = InferType<typeof ProfileMutationAddShippingAddressSchema>;
|
|
82
|
+
export type ProfileMutationRemoveShippingAddress = InferType<typeof ProfileMutationRemoveShippingAddressSchema>;
|
|
83
|
+
export type ProfileMutationMakeShippingAddressDefault = InferType<typeof ProfileMutationMakeShippingAddressDefaultSchema>;
|
|
84
|
+
export type ProfileMutationSetBillingAddress = InferType<typeof ProfileMutationSetBillingAddressSchema>;
|
|
85
|
+
export type ProfileMutationUpdateShippingAddress = InferType<typeof ProfileMutationUpdateShippingAddressSchema>;
|
|
@@ -24,13 +24,6 @@ export declare const ProductSearchQueryByTermSchema: z.ZodObject<{
|
|
|
24
24
|
}, z.core.$loose>;
|
|
25
25
|
export declare const ProductSearchQueryCreateNavigationFilterSchema: z.ZodObject<{
|
|
26
26
|
categoryPath: z.ZodArray<z.ZodObject<{
|
|
27
|
-
meta: z.ZodDefault<z.ZodObject<{
|
|
28
|
-
cache: z.ZodDefault<z.ZodObject<{
|
|
29
|
-
hit: z.ZodDefault<z.ZodBoolean>;
|
|
30
|
-
key: z.ZodDefault<z.ZodString>;
|
|
31
|
-
}, z.core.$loose>>;
|
|
32
|
-
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
33
|
-
}, z.core.$loose>>;
|
|
34
27
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
35
28
|
key: z.ZodString;
|
|
36
29
|
}, z.core.$loose>>;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
2
|
import type { InferType } from '../../zod-utils.js';
|
|
3
|
-
export declare const
|
|
4
|
-
|
|
3
|
+
export declare const ProfileQueryByIdSchema: z.ZodObject<{
|
|
4
|
+
identifier: z.ZodObject<{
|
|
5
|
+
userId: z.ZodString;
|
|
6
|
+
}, z.core.$loose>;
|
|
7
|
+
}, z.core.$loose>;
|
|
8
|
+
export type ProfileQuerySelf = InferType<typeof ProfileQueryByIdSchema>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { GenericError } from "./errors/generic.error.js";
|
|
2
|
+
import type { InvalidInputError } from "./errors/invalid-input.error.js";
|
|
3
|
+
import type { InvalidOutputError } from "./errors/invalid-output.error.js";
|
|
4
|
+
export type Ok<T> = {
|
|
5
|
+
success: true;
|
|
6
|
+
value: T;
|
|
7
|
+
meta: {
|
|
8
|
+
trace: string;
|
|
9
|
+
cache: {
|
|
10
|
+
hit: boolean;
|
|
11
|
+
key: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type Fail<E> = {
|
|
16
|
+
success: false;
|
|
17
|
+
error: E | GenericError | InvalidInputError | InvalidOutputError;
|
|
18
|
+
meta: {
|
|
19
|
+
trace: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export type Result<T, E = Error> = Ok<T> | Fail<E>;
|
|
23
|
+
/**
|
|
24
|
+
* Utility function for asserting and unwrapping the value of a success.
|
|
25
|
+
* It is an assert, so treat it as such (similar to any unwrap, assert or similar function).
|
|
26
|
+
* You are guaranteeing that this will ALWAYS succeed, and can expect a runtime error if
|
|
27
|
+
* that assertion ever fails.
|
|
28
|
+
*
|
|
29
|
+
* This is primarily useful for cases where you KNOW that it shouldn't fail, or where failure
|
|
30
|
+
* has no known mechanism of recovery besides simply crashing.
|
|
31
|
+
*/
|
|
32
|
+
export declare function assertSuccess<T, E = Error>(result: Result<T, E>): asserts result is Ok<T>;
|
|
33
|
+
/**
|
|
34
|
+
* Utility function for asserting an error. This is primarily useful for testing scenarios
|
|
35
|
+
* that trigger errors as part of their validation.
|
|
36
|
+
*/
|
|
37
|
+
export declare function assertError<T, E = Error>(result: Result<T, E>): asserts result is Fail<E>;
|
|
38
|
+
/**
|
|
39
|
+
* Utility function for unwrapping a value from a result. Internally this
|
|
40
|
+
* WILL assert success, so the caller needs to guarantee that this will
|
|
41
|
+
* always be a valid operation, or expect a thrown exception.
|
|
42
|
+
*/
|
|
43
|
+
export declare function unwrapValue<T, E = Error>(result: Result<T, E>): T;
|
|
44
|
+
/**
|
|
45
|
+
* Utility function for unwrapping an error. Primarily useful for testing.
|
|
46
|
+
*/
|
|
47
|
+
export declare function unwrapError<T, E>(result: Result<T, E>): Fail<E>['error'];
|
|
48
|
+
/**
|
|
49
|
+
* Helper function for wrapping a success as an Ok<T> type
|
|
50
|
+
*/
|
|
51
|
+
export declare function success<T>(value: T): Ok<T>;
|
|
52
|
+
/**
|
|
53
|
+
* Helper function for wrapping an error as a Fail<E> type
|
|
54
|
+
*/
|
|
55
|
+
export declare function error<E>(error: E): Fail<E>;
|