@reactionary/core 0.0.42 → 0.0.48
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 +39 -0
- package/cache/noop-cache.js +3 -13
- package/cache/redis-cache.js +16 -32
- package/decorators/reactionary.decorator.js +57 -4
- package/index.js +2 -1
- package/initialization.js +43 -0
- package/package.json +4 -2
- package/providers/base.provider.js +29 -12
- package/providers/index.js +2 -0
- package/providers/profile.provider.js +9 -0
- package/providers/store.provider.js +9 -0
- package/schemas/capabilities.schema.js +2 -1
- package/schemas/models/identifiers.model.js +12 -6
- package/schemas/models/identity.model.js +15 -16
- package/schemas/models/index.js +1 -0
- package/schemas/models/profile.model.js +3 -2
- package/schemas/models/shipping-method.model.js +2 -2
- package/schemas/models/store.model.js +11 -0
- package/schemas/mutations/cart.mutation.js +2 -2
- package/schemas/mutations/identity.mutation.js +6 -1
- package/schemas/mutations/index.js +1 -0
- package/schemas/mutations/profile.mutation.js +9 -0
- package/schemas/queries/index.js +2 -0
- package/schemas/queries/inventory.query.js +3 -5
- package/schemas/queries/profile.query.js +5 -0
- package/schemas/queries/store.query.js +11 -0
- package/schemas/session.schema.js +22 -8
- package/src/cache/cache.interface.d.ts +13 -20
- package/src/cache/memory-cache.d.ts +18 -0
- package/src/cache/noop-cache.d.ts +5 -11
- package/src/cache/redis-cache.d.ts +5 -11
- package/src/client/client-builder.d.ts +2 -2
- package/src/client/client.d.ts +10 -10
- package/src/decorators/reactionary.decorator.d.ts +34 -1
- package/src/index.d.ts +2 -1
- package/src/initialization.d.ts +2 -0
- package/src/providers/analytics.provider.d.ts +1 -1
- package/src/providers/base.provider.d.ts +12 -9
- package/src/providers/cart-payment.provider.d.ts +7 -7
- package/src/providers/cart.provider.d.ts +17 -17
- package/src/providers/category.provider.d.ts +9 -9
- package/src/providers/identity.provider.d.ts +8 -7
- package/src/providers/index.d.ts +2 -0
- package/src/providers/inventory.provider.d.ts +4 -4
- package/src/providers/price.provider.d.ts +6 -6
- package/src/providers/product.provider.d.ts +5 -5
- package/src/providers/profile.provider.d.ts +10 -0
- package/src/providers/search.provider.d.ts +4 -4
- package/src/providers/store.provider.d.ts +8 -0
- package/src/schemas/capabilities.schema.d.ts +1 -0
- package/src/schemas/models/analytics.model.d.ts +1 -1
- package/src/schemas/models/cart.model.d.ts +14 -0
- package/src/schemas/models/identifiers.model.d.ts +10 -6
- package/src/schemas/models/identity.model.d.ts +72 -27
- package/src/schemas/models/index.d.ts +1 -0
- package/src/schemas/models/inventory.model.d.ts +1 -1
- package/src/schemas/models/profile.model.d.ts +35 -0
- package/src/schemas/models/store.model.d.ts +18 -0
- package/src/schemas/mutations/cart-payment.mutation.d.ts +1 -1
- package/src/schemas/mutations/cart.mutation.d.ts +14 -0
- package/src/schemas/mutations/identity.mutation.d.ts +5 -0
- package/src/schemas/mutations/index.d.ts +1 -0
- package/src/schemas/mutations/profile.mutation.d.ts +6 -0
- package/src/schemas/queries/cart.query.d.ts +1 -1
- package/src/schemas/queries/identity.query.d.ts +1 -1
- package/src/schemas/queries/index.d.ts +2 -0
- package/src/schemas/queries/inventory.query.d.ts +6 -15
- package/src/schemas/queries/price.query.d.ts +1 -1
- package/src/schemas/queries/profile.query.d.ts +3 -0
- package/src/schemas/queries/search.query.d.ts +1 -1
- package/src/schemas/queries/store.query.d.ts +8 -0
- package/src/schemas/session.schema.d.ts +53 -21
- package/cache/cache-evaluation.interface.js +0 -0
- package/src/cache/cache-evaluation.interface.d.ts +0 -17
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Store } from '../schemas/models/store.model';
|
|
2
|
+
import type { StoreQueryByProximity } from '../schemas/queries';
|
|
3
|
+
import type { RequestContext } from '../schemas/session.schema';
|
|
4
|
+
import { BaseProvider } from './base.provider';
|
|
5
|
+
export declare abstract class StoreProvider<T extends Store = Store> extends BaseProvider<T> {
|
|
6
|
+
abstract queryByProximity(payload: StoreQueryByProximity, reqCtx: RequestContext): Promise<Array<T>>;
|
|
7
|
+
protected getResourceName(): string;
|
|
8
|
+
}
|
|
@@ -4514,6 +4514,13 @@ export declare const CartSchema: z.ZodObject<{
|
|
|
4514
4514
|
name: z.ZodDefault<z.ZodString>;
|
|
4515
4515
|
description: z.ZodDefault<z.ZodString>;
|
|
4516
4516
|
shippingAddress: z.ZodOptional<z.ZodObject<{
|
|
4517
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
4518
|
+
cache: z.ZodDefault<z.ZodObject<{
|
|
4519
|
+
hit: z.ZodDefault<z.ZodBoolean>;
|
|
4520
|
+
key: z.ZodDefault<z.ZodString>;
|
|
4521
|
+
}, z.core.$loose>>;
|
|
4522
|
+
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
4523
|
+
}, z.core.$loose>>;
|
|
4517
4524
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
4518
4525
|
nickName: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
4519
4526
|
}, z.core.$loose>>;
|
|
@@ -4527,6 +4534,13 @@ export declare const CartSchema: z.ZodObject<{
|
|
|
4527
4534
|
countryCode: z.ZodDefault<z.ZodString>;
|
|
4528
4535
|
}, z.core.$loose>>;
|
|
4529
4536
|
billingAddress: z.ZodOptional<z.ZodObject<{
|
|
4537
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
4538
|
+
cache: z.ZodDefault<z.ZodObject<{
|
|
4539
|
+
hit: z.ZodDefault<z.ZodBoolean>;
|
|
4540
|
+
key: z.ZodDefault<z.ZodString>;
|
|
4541
|
+
}, z.core.$loose>>;
|
|
4542
|
+
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
4543
|
+
}, z.core.$loose>>;
|
|
4530
4544
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
4531
4545
|
nickName: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
4532
4546
|
}, z.core.$loose>>;
|
|
@@ -39,6 +39,9 @@ export declare const PriceIdentifierSchema: z.ZodObject<{
|
|
|
39
39
|
export declare const CategoryIdentifierSchema: z.ZodObject<{
|
|
40
40
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
41
41
|
}, z.core.$loose>;
|
|
42
|
+
export declare const StoreIdentifierSchema: z.ZodObject<{
|
|
43
|
+
key: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
44
|
+
}, z.core.$loose>;
|
|
42
45
|
export declare const OrderIdentifierSchema: z.ZodObject<{
|
|
43
46
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
44
47
|
}, z.core.$loose>;
|
|
@@ -51,21 +54,21 @@ export declare const OrderItemIdentifierSchema: z.ZodObject<{
|
|
|
51
54
|
export declare const WebStoreIdentifierSchema: z.ZodObject<{
|
|
52
55
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
53
56
|
}, z.core.$loose>;
|
|
54
|
-
export declare const
|
|
57
|
+
export declare const FulfillmentCenterIdentifierSchema: z.ZodObject<{
|
|
55
58
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
56
59
|
}, z.core.$loose>;
|
|
57
60
|
export declare const InventoryIdentifierSchema: z.ZodObject<{
|
|
58
61
|
sku: z.ZodDefault<z.ZodObject<{
|
|
59
62
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
60
63
|
}, z.core.$loose>>;
|
|
61
|
-
|
|
64
|
+
fulfillmentCenter: z.ZodDefault<z.ZodObject<{
|
|
62
65
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
63
66
|
}, z.core.$loose>>;
|
|
64
67
|
}, z.core.$loose>;
|
|
65
68
|
export declare const IdentityIdentifierSchema: z.ZodObject<{
|
|
66
69
|
userId: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
67
70
|
}, z.core.$loose>;
|
|
68
|
-
export declare const
|
|
71
|
+
export declare const ShippingMethodIdentifierSchema: z.ZodObject<{
|
|
69
72
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
70
73
|
}, z.core.$loose>;
|
|
71
74
|
export declare const PaymentMethodIdentifierSchema: z.ZodObject<{
|
|
@@ -89,12 +92,13 @@ export type PriceIdentifier = z.infer<typeof PriceIdentifierSchema>;
|
|
|
89
92
|
export type CategoryIdentifier = z.infer<typeof CategoryIdentifierSchema>;
|
|
90
93
|
export type WebStoreIdentifier = z.infer<typeof WebStoreIdentifierSchema>;
|
|
91
94
|
export type InventoryIdentifier = z.infer<typeof InventoryIdentifierSchema>;
|
|
92
|
-
export type
|
|
95
|
+
export type FulfillmentCenterIdentifier = z.infer<typeof FulfillmentCenterIdentifierSchema>;
|
|
93
96
|
export type IdentityIdentifier = z.infer<typeof IdentityIdentifierSchema>;
|
|
94
|
-
export type ShippingMethodIdentifier = z.infer<typeof
|
|
97
|
+
export type ShippingMethodIdentifier = z.infer<typeof ShippingMethodIdentifierSchema>;
|
|
95
98
|
export type PaymentMethodIdentifier = z.infer<typeof PaymentMethodIdentifierSchema>;
|
|
96
99
|
export type AddressIdentifier = z.infer<typeof AddressIdentifierSchema>;
|
|
97
100
|
export type PaymentInstructionIdentifier = z.infer<typeof PaymentInstructionIdentifierSchema>;
|
|
98
101
|
export type OrderIdentifier = z.infer<typeof OrderIdentifierSchema>;
|
|
99
102
|
export type OrderItemIdentifier = z.infer<typeof OrderItemIdentifierSchema>;
|
|
100
|
-
export type
|
|
103
|
+
export type StoreIdentifier = z.infer<typeof StoreIdentifierSchema>;
|
|
104
|
+
export type IdentifierType = ProductIdentifier | SearchIdentifier | FacetIdentifier | FacetValueIdentifier | CartIdentifier | CartItemIdentifier | PriceIdentifier | CategoryIdentifier | WebStoreIdentifier | InventoryIdentifier | FulfillmentCenterIdentifier | IdentityIdentifier | ShippingMethodIdentifier | PaymentMethodIdentifier | AddressIdentifier | PaymentInstructionIdentifier | OrderIdentifier | OrderItemIdentifier;
|
|
@@ -1,16 +1,31 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
export declare const AnonymousIdentitySchema: z.ZodObject<{
|
|
3
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
4
|
+
cache: z.ZodDefault<z.ZodObject<{
|
|
5
|
+
hit: z.ZodDefault<z.ZodBoolean>;
|
|
6
|
+
key: z.ZodDefault<z.ZodString>;
|
|
7
|
+
}, z.core.$loose>>;
|
|
8
|
+
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
9
|
+
}, z.core.$loose>>;
|
|
10
|
+
type: z.ZodLiteral<"Anonymous">;
|
|
11
|
+
}, z.core.$loose>;
|
|
12
|
+
export declare const GuestIdentitySchema: z.ZodObject<{
|
|
13
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
14
|
+
cache: z.ZodDefault<z.ZodObject<{
|
|
15
|
+
hit: z.ZodDefault<z.ZodBoolean>;
|
|
16
|
+
key: z.ZodDefault<z.ZodString>;
|
|
17
|
+
}, z.core.$loose>>;
|
|
18
|
+
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
19
|
+
}, z.core.$loose>>;
|
|
20
|
+
id: z.ZodDefault<z.ZodObject<{
|
|
21
|
+
userId: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
22
|
+
}, z.core.$loose>>;
|
|
23
|
+
type: z.ZodLiteral<"Guest">;
|
|
24
|
+
token: z.ZodOptional<z.ZodString>;
|
|
25
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
11
26
|
expiry: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
12
|
-
}, z.core.$
|
|
13
|
-
export declare const
|
|
27
|
+
}, z.core.$loose>;
|
|
28
|
+
export declare const RegisteredIdentitySchema: z.ZodObject<{
|
|
14
29
|
meta: z.ZodDefault<z.ZodObject<{
|
|
15
30
|
cache: z.ZodDefault<z.ZodObject<{
|
|
16
31
|
hit: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -21,24 +36,54 @@ export declare const IdentitySchema: z.ZodObject<{
|
|
|
21
36
|
id: z.ZodDefault<z.ZodObject<{
|
|
22
37
|
userId: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
23
38
|
}, z.core.$loose>>;
|
|
24
|
-
type: z.
|
|
25
|
-
Anonymous: "Anonymous";
|
|
26
|
-
Guest: "Guest";
|
|
27
|
-
Registered: "Registered";
|
|
28
|
-
}>>;
|
|
39
|
+
type: z.ZodLiteral<"Registered">;
|
|
29
40
|
logonId: z.ZodDefault<z.ZodString>;
|
|
30
|
-
createdAt: z.ZodDefault<z.ZodString>;
|
|
31
|
-
updatedAt: z.ZodDefault<z.ZodString>;
|
|
32
|
-
keyring: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
33
|
-
service: z.ZodDefault<z.ZodString>;
|
|
34
|
-
token: z.ZodDefault<z.ZodString>;
|
|
35
|
-
issued: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
36
|
-
expiry: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
37
|
-
}, z.core.$strip>>>;
|
|
38
|
-
currentService: z.ZodOptional<z.ZodString>;
|
|
39
41
|
token: z.ZodOptional<z.ZodString>;
|
|
40
|
-
|
|
42
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
41
43
|
expiry: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
42
44
|
}, z.core.$loose>;
|
|
43
|
-
export
|
|
45
|
+
export declare const IdentitySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
46
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
47
|
+
cache: z.ZodDefault<z.ZodObject<{
|
|
48
|
+
hit: z.ZodDefault<z.ZodBoolean>;
|
|
49
|
+
key: z.ZodDefault<z.ZodString>;
|
|
50
|
+
}, z.core.$loose>>;
|
|
51
|
+
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
52
|
+
}, z.core.$loose>>;
|
|
53
|
+
type: z.ZodLiteral<"Anonymous">;
|
|
54
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
55
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
56
|
+
cache: z.ZodDefault<z.ZodObject<{
|
|
57
|
+
hit: z.ZodDefault<z.ZodBoolean>;
|
|
58
|
+
key: z.ZodDefault<z.ZodString>;
|
|
59
|
+
}, z.core.$loose>>;
|
|
60
|
+
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
61
|
+
}, z.core.$loose>>;
|
|
62
|
+
id: z.ZodDefault<z.ZodObject<{
|
|
63
|
+
userId: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
64
|
+
}, z.core.$loose>>;
|
|
65
|
+
type: z.ZodLiteral<"Guest">;
|
|
66
|
+
token: z.ZodOptional<z.ZodString>;
|
|
67
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
68
|
+
expiry: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
69
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
70
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
71
|
+
cache: z.ZodDefault<z.ZodObject<{
|
|
72
|
+
hit: z.ZodDefault<z.ZodBoolean>;
|
|
73
|
+
key: z.ZodDefault<z.ZodString>;
|
|
74
|
+
}, z.core.$loose>>;
|
|
75
|
+
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
76
|
+
}, z.core.$loose>>;
|
|
77
|
+
id: z.ZodDefault<z.ZodObject<{
|
|
78
|
+
userId: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
79
|
+
}, z.core.$loose>>;
|
|
80
|
+
type: z.ZodLiteral<"Registered">;
|
|
81
|
+
logonId: z.ZodDefault<z.ZodString>;
|
|
82
|
+
token: z.ZodOptional<z.ZodString>;
|
|
83
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
84
|
+
expiry: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
85
|
+
}, z.core.$loose>], "type">;
|
|
86
|
+
export type AnonymousIdentity = z.infer<typeof AnonymousIdentitySchema>;
|
|
87
|
+
export type GuestIdentity = z.infer<typeof GuestIdentitySchema>;
|
|
88
|
+
export type RegisteredIdentity = z.infer<typeof RegisteredIdentitySchema>;
|
|
44
89
|
export type Identity = z.infer<typeof IdentitySchema>;
|
|
@@ -11,7 +11,7 @@ export declare const InventorySchema: z.ZodObject<{
|
|
|
11
11
|
sku: z.ZodDefault<z.ZodObject<{
|
|
12
12
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
13
13
|
}, z.core.$loose>>;
|
|
14
|
-
|
|
14
|
+
fulfillmentCenter: z.ZodDefault<z.ZodObject<{
|
|
15
15
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
16
16
|
}, z.core.$loose>>;
|
|
17
17
|
}, z.core.$loose>>;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
2
|
export declare const AddressSchema: z.ZodObject<{
|
|
3
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
4
|
+
cache: z.ZodDefault<z.ZodObject<{
|
|
5
|
+
hit: z.ZodDefault<z.ZodBoolean>;
|
|
6
|
+
key: z.ZodDefault<z.ZodString>;
|
|
7
|
+
}, z.core.$loose>>;
|
|
8
|
+
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
9
|
+
}, z.core.$loose>>;
|
|
3
10
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
4
11
|
nickName: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
5
12
|
}, z.core.$loose>>;
|
|
@@ -13,6 +20,13 @@ export declare const AddressSchema: z.ZodObject<{
|
|
|
13
20
|
countryCode: z.ZodDefault<z.ZodString>;
|
|
14
21
|
}, z.core.$loose>;
|
|
15
22
|
export declare const ProfileSchema: z.ZodObject<{
|
|
23
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
24
|
+
cache: z.ZodDefault<z.ZodObject<{
|
|
25
|
+
hit: z.ZodDefault<z.ZodBoolean>;
|
|
26
|
+
key: z.ZodDefault<z.ZodString>;
|
|
27
|
+
}, z.core.$loose>>;
|
|
28
|
+
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
29
|
+
}, z.core.$loose>>;
|
|
16
30
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
17
31
|
userId: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
18
32
|
}, z.core.$loose>>;
|
|
@@ -23,6 +37,13 @@ export declare const ProfileSchema: z.ZodObject<{
|
|
|
23
37
|
createdAt: z.ZodDefault<z.ZodString>;
|
|
24
38
|
updatedAt: z.ZodDefault<z.ZodString>;
|
|
25
39
|
shippingAddress: z.ZodOptional<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>>;
|
|
26
47
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
27
48
|
nickName: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
28
49
|
}, z.core.$loose>>;
|
|
@@ -36,6 +57,13 @@ export declare const ProfileSchema: z.ZodObject<{
|
|
|
36
57
|
countryCode: z.ZodDefault<z.ZodString>;
|
|
37
58
|
}, z.core.$loose>>;
|
|
38
59
|
billingAddress: z.ZodOptional<z.ZodObject<{
|
|
60
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
61
|
+
cache: z.ZodDefault<z.ZodObject<{
|
|
62
|
+
hit: z.ZodDefault<z.ZodBoolean>;
|
|
63
|
+
key: z.ZodDefault<z.ZodString>;
|
|
64
|
+
}, z.core.$loose>>;
|
|
65
|
+
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
66
|
+
}, z.core.$loose>>;
|
|
39
67
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
40
68
|
nickName: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
41
69
|
}, z.core.$loose>>;
|
|
@@ -49,6 +77,13 @@ export declare const ProfileSchema: z.ZodObject<{
|
|
|
49
77
|
countryCode: z.ZodDefault<z.ZodString>;
|
|
50
78
|
}, z.core.$loose>>;
|
|
51
79
|
alternateShippingAddresses: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
80
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
81
|
+
cache: z.ZodDefault<z.ZodObject<{
|
|
82
|
+
hit: z.ZodDefault<z.ZodBoolean>;
|
|
83
|
+
key: z.ZodDefault<z.ZodString>;
|
|
84
|
+
}, z.core.$loose>>;
|
|
85
|
+
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
86
|
+
}, z.core.$loose>>;
|
|
52
87
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
53
88
|
nickName: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
54
89
|
}, z.core.$loose>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const StoreSchema: z.ZodObject<{
|
|
3
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
4
|
+
cache: z.ZodDefault<z.ZodObject<{
|
|
5
|
+
hit: z.ZodDefault<z.ZodBoolean>;
|
|
6
|
+
key: z.ZodDefault<z.ZodString>;
|
|
7
|
+
}, z.core.$loose>>;
|
|
8
|
+
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
9
|
+
}, z.core.$loose>>;
|
|
10
|
+
identifier: z.ZodDefault<z.ZodObject<{
|
|
11
|
+
key: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
12
|
+
}, z.core.$loose>>;
|
|
13
|
+
name: z.ZodDefault<z.ZodString>;
|
|
14
|
+
fulfillmentCenter: z.ZodDefault<z.ZodObject<{
|
|
15
|
+
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
16
|
+
}, z.core.$loose>>;
|
|
17
|
+
}, z.core.$loose>;
|
|
18
|
+
export type Store = z.infer<typeof StoreSchema>;
|
|
@@ -38,6 +38,13 @@ export declare const CartMutationSetShippingInfoSchema: z.ZodObject<{
|
|
|
38
38
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
39
39
|
}, z.core.$loose>>;
|
|
40
40
|
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>>;
|
|
41
48
|
identifier: z.ZodDefault<z.ZodObject<{
|
|
42
49
|
nickName: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
43
50
|
}, z.core.$loose>>;
|
|
@@ -56,6 +63,13 @@ export declare const CartMutationSetBillingAddressSchema: z.ZodObject<{
|
|
|
56
63
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
57
64
|
}, z.core.$loose>;
|
|
58
65
|
billingAddress: z.ZodObject<{
|
|
66
|
+
meta: z.ZodNonOptional<z.ZodDefault<z.ZodObject<{
|
|
67
|
+
cache: z.ZodDefault<z.ZodObject<{
|
|
68
|
+
hit: z.ZodDefault<z.ZodBoolean>;
|
|
69
|
+
key: z.ZodDefault<z.ZodString>;
|
|
70
|
+
}, z.core.$loose>>;
|
|
71
|
+
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
72
|
+
}, z.core.$loose>>>;
|
|
59
73
|
identifier: z.ZodNonOptional<z.ZodDefault<z.ZodObject<{
|
|
60
74
|
nickName: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
61
75
|
}, z.core.$loose>>>;
|
|
@@ -4,5 +4,10 @@ export declare const IdentityMutationLoginSchema: z.ZodObject<{
|
|
|
4
4
|
password: z.ZodString;
|
|
5
5
|
}, z.core.$loose>;
|
|
6
6
|
export declare const IdentityMutationLogoutSchema: z.ZodObject<{}, z.core.$loose>;
|
|
7
|
+
export declare const IdentityMutationRegisterSchema: z.ZodObject<{
|
|
8
|
+
username: z.ZodString;
|
|
9
|
+
password: z.ZodString;
|
|
10
|
+
}, z.core.$loose>;
|
|
7
11
|
export type IdentityMutationLogin = z.infer<typeof IdentityMutationLoginSchema>;
|
|
8
12
|
export type IdentityMutationLogout = z.infer<typeof IdentityMutationLogoutSchema>;
|
|
13
|
+
export type IdentityMutationRegister = z.infer<typeof IdentityMutationRegisterSchema>;
|
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { ProductIdentifier } from '../models/identifiers.model';
|
|
1
|
+
import type { z } from 'zod';
|
|
3
2
|
export declare const InventoryQueryBySKUSchema: z.ZodObject<{
|
|
4
|
-
|
|
5
|
-
sku: z.ZodDefault<z.ZodObject<{
|
|
3
|
+
sku: z.ZodNonOptional<z.ZodDefault<z.ZodObject<{
|
|
6
4
|
key: z.ZodDefault<z.ZodString>;
|
|
7
|
-
}, z.core.$loose
|
|
5
|
+
}, z.core.$loose>>>;
|
|
6
|
+
fulfilmentCenter: z.ZodNonOptional<z.ZodDefault<z.ZodObject<{
|
|
7
|
+
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
8
|
+
}, z.core.$loose>>>;
|
|
8
9
|
}, z.core.$loose>;
|
|
9
10
|
export type InventoryQueryBySKU = z.infer<typeof InventoryQueryBySKUSchema>;
|
|
10
|
-
export interface InventoryQueries {
|
|
11
|
-
"sku": {
|
|
12
|
-
sku: ProductIdentifier;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export type InventoryQuery = {
|
|
16
|
-
[K in keyof InventoryQueries]: {
|
|
17
|
-
type: K;
|
|
18
|
-
} & InventoryQueries[K];
|
|
19
|
-
}[keyof InventoryQueries];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const StoreQueryByProximitySchema: z.ZodObject<{
|
|
3
|
+
longitude: z.ZodDefault<z.ZodNumber>;
|
|
4
|
+
latitude: z.ZodDefault<z.ZodNumber>;
|
|
5
|
+
distance: z.ZodDefault<z.ZodNumber>;
|
|
6
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
7
|
+
}, z.core.$loose>;
|
|
8
|
+
export type StoreQueryByProximity = z.infer<typeof StoreQueryByProximitySchema>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The language and locale context for the current request.
|
|
4
|
+
*/
|
|
2
5
|
export declare const LanguageContextSchema: z.ZodObject<{
|
|
3
6
|
locale: z.ZodDefault<z.ZodString>;
|
|
4
7
|
currencyCode: z.ZodDefault<z.ZodEnum<{
|
|
@@ -184,11 +187,25 @@ export declare const LanguageContextSchema: z.ZodObject<{
|
|
|
184
187
|
ZMW: "ZMW";
|
|
185
188
|
ZWL: "ZWL";
|
|
186
189
|
}>>;
|
|
187
|
-
countryCode: z.ZodDefault<z.ZodString>;
|
|
188
190
|
}, z.core.$loose>;
|
|
189
|
-
export declare const SessionSchema: z.
|
|
190
|
-
|
|
191
|
-
|
|
191
|
+
export declare const SessionSchema: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
192
|
+
export declare const TaxJurisdictionSchema: z.ZodObject<{
|
|
193
|
+
countryCode: z.ZodDefault<z.ZodString>;
|
|
194
|
+
stateCode: z.ZodDefault<z.ZodString>;
|
|
195
|
+
countyCode: z.ZodDefault<z.ZodString>;
|
|
196
|
+
cityCode: z.ZodDefault<z.ZodString>;
|
|
197
|
+
}, z.core.$strip>;
|
|
198
|
+
export declare const RequestContextSchema: z.ZodObject<{
|
|
199
|
+
identity: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
200
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
201
|
+
cache: z.ZodDefault<z.ZodObject<{
|
|
202
|
+
hit: z.ZodDefault<z.ZodBoolean>;
|
|
203
|
+
key: z.ZodDefault<z.ZodString>;
|
|
204
|
+
}, z.core.$loose>>;
|
|
205
|
+
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
206
|
+
}, z.core.$loose>>;
|
|
207
|
+
type: z.ZodLiteral<"Anonymous">;
|
|
208
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
192
209
|
meta: z.ZodDefault<z.ZodObject<{
|
|
193
210
|
cache: z.ZodDefault<z.ZodObject<{
|
|
194
211
|
hit: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -199,25 +216,28 @@ export declare const SessionSchema: z.ZodObject<{
|
|
|
199
216
|
id: z.ZodDefault<z.ZodObject<{
|
|
200
217
|
userId: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
201
218
|
}, z.core.$loose>>;
|
|
202
|
-
type: z.
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
219
|
+
type: z.ZodLiteral<"Guest">;
|
|
220
|
+
token: z.ZodOptional<z.ZodString>;
|
|
221
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
222
|
+
expiry: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
223
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
224
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
225
|
+
cache: z.ZodDefault<z.ZodObject<{
|
|
226
|
+
hit: z.ZodDefault<z.ZodBoolean>;
|
|
227
|
+
key: z.ZodDefault<z.ZodString>;
|
|
228
|
+
}, z.core.$loose>>;
|
|
229
|
+
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
230
|
+
}, z.core.$loose>>;
|
|
231
|
+
id: z.ZodDefault<z.ZodObject<{
|
|
232
|
+
userId: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
233
|
+
}, z.core.$loose>>;
|
|
234
|
+
type: z.ZodLiteral<"Registered">;
|
|
207
235
|
logonId: z.ZodDefault<z.ZodString>;
|
|
208
|
-
createdAt: z.ZodDefault<z.ZodString>;
|
|
209
|
-
updatedAt: z.ZodDefault<z.ZodString>;
|
|
210
|
-
keyring: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
211
|
-
service: z.ZodDefault<z.ZodString>;
|
|
212
|
-
token: z.ZodDefault<z.ZodString>;
|
|
213
|
-
issued: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
214
|
-
expiry: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
215
|
-
}, z.core.$strip>>>;
|
|
216
|
-
currentService: z.ZodOptional<z.ZodString>;
|
|
217
236
|
token: z.ZodOptional<z.ZodString>;
|
|
218
|
-
|
|
237
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
219
238
|
expiry: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
220
|
-
}, z.core.$loose>>;
|
|
239
|
+
}, z.core.$loose>], "type">>;
|
|
240
|
+
session: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
221
241
|
languageContext: z.ZodDefault<z.ZodObject<{
|
|
222
242
|
locale: z.ZodDefault<z.ZodString>;
|
|
223
243
|
currencyCode: z.ZodDefault<z.ZodEnum<{
|
|
@@ -403,11 +423,23 @@ export declare const SessionSchema: z.ZodObject<{
|
|
|
403
423
|
ZMW: "ZMW";
|
|
404
424
|
ZWL: "ZWL";
|
|
405
425
|
}>>;
|
|
406
|
-
countryCode: z.ZodDefault<z.ZodString>;
|
|
407
426
|
}, z.core.$loose>>;
|
|
408
427
|
storeIdentifier: z.ZodDefault<z.ZodObject<{
|
|
409
428
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
410
429
|
}, z.core.$loose>>;
|
|
430
|
+
taxJurisdiction: z.ZodDefault<z.ZodObject<{
|
|
431
|
+
countryCode: z.ZodDefault<z.ZodString>;
|
|
432
|
+
stateCode: z.ZodDefault<z.ZodString>;
|
|
433
|
+
countyCode: z.ZodDefault<z.ZodString>;
|
|
434
|
+
cityCode: z.ZodDefault<z.ZodString>;
|
|
435
|
+
}, z.core.$strip>>;
|
|
436
|
+
correlationId: z.ZodDefault<z.ZodString>;
|
|
437
|
+
isBot: z.ZodDefault<z.ZodBoolean>;
|
|
438
|
+
clientIp: z.ZodDefault<z.ZodString>;
|
|
439
|
+
userAgent: z.ZodDefault<z.ZodString>;
|
|
440
|
+
referrer: z.ZodDefault<z.ZodString>;
|
|
411
441
|
}, z.core.$loose>;
|
|
412
442
|
export type Session = z.infer<typeof SessionSchema>;
|
|
413
443
|
export type LanguageContext = z.infer<typeof LanguageContextSchema>;
|
|
444
|
+
export type RequestContext = z.infer<typeof RequestContextSchema>;
|
|
445
|
+
export type TaxJurisdiction = z.infer<typeof TaxJurisdictionSchema>;
|
|
File without changes
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cache evaluation result that determines how and if a query should be cached
|
|
3
|
-
*/
|
|
4
|
-
export interface CacheEvaluation {
|
|
5
|
-
/**
|
|
6
|
-
* The cache key to use for storing/retrieving the value
|
|
7
|
-
*/
|
|
8
|
-
key: string;
|
|
9
|
-
/**
|
|
10
|
-
* How long to cache the value in seconds
|
|
11
|
-
*/
|
|
12
|
-
cacheDurationInSeconds: number;
|
|
13
|
-
/**
|
|
14
|
-
* Whether this query result can be cached
|
|
15
|
-
*/
|
|
16
|
-
canCache: boolean;
|
|
17
|
-
}
|