@reactionary/core 0.0.42 → 0.0.51
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/checkout.provider.js +6 -0
- package/providers/index.js +4 -1
- package/providers/order.provider.js +15 -0
- package/providers/profile.provider.js +9 -0
- package/providers/store.provider.js +9 -0
- package/schemas/capabilities.schema.js +4 -2
- package/schemas/models/cart.model.js +3 -24
- package/schemas/models/checkout.model.js +44 -0
- package/schemas/models/cost.model.js +20 -0
- package/schemas/models/identifiers.model.js +24 -6
- package/schemas/models/identity.model.js +18 -16
- package/schemas/models/index.js +5 -0
- package/schemas/models/order.model.js +37 -0
- package/schemas/models/payment.model.js +1 -10
- package/schemas/models/product.model.js +5 -2
- package/schemas/models/profile.model.js +3 -2
- package/schemas/models/shipping-method.model.js +26 -4
- package/schemas/models/store.model.js +11 -0
- package/schemas/mutations/cart.mutation.js +2 -2
- package/schemas/mutations/checkout.mutation.js +36 -0
- package/schemas/mutations/identity.mutation.js +6 -1
- package/schemas/mutations/index.js +2 -1
- package/schemas/mutations/profile.mutation.js +9 -0
- package/schemas/queries/checkout.query.js +16 -0
- package/schemas/queries/index.js +4 -1
- package/schemas/queries/inventory.query.js +3 -5
- package/schemas/queries/order.query.js +8 -0
- package/schemas/queries/product.query.js +5 -0
- 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 +11 -11
- 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.provider.d.ts +17 -17
- package/src/providers/category.provider.d.ts +9 -9
- package/src/providers/checkout.provider.d.ts +135 -0
- package/src/providers/identity.provider.d.ts +8 -7
- package/src/providers/index.d.ts +4 -1
- package/src/providers/inventory.provider.d.ts +4 -4
- package/src/providers/order.provider.d.ts +16 -0
- package/src/providers/price.provider.d.ts +6 -6
- package/src/providers/product.provider.d.ts +6 -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 +3 -1
- package/src/schemas/models/analytics.model.d.ts +1 -1
- package/src/schemas/models/cart.model.d.ts +0 -2092
- package/src/schemas/models/checkout.model.d.ts +2930 -0
- package/src/schemas/models/cost.model.d.ts +1867 -0
- package/src/schemas/models/identifiers.model.d.ts +22 -6
- package/src/schemas/models/identity.model.d.ts +78 -27
- package/src/schemas/models/index.d.ts +5 -0
- package/src/schemas/models/inventory.model.d.ts +1 -1
- package/src/schemas/models/order.model.d.ts +3144 -0
- package/src/schemas/models/payment.model.d.ts +1 -438
- package/src/schemas/models/product.model.d.ts +2 -2
- package/src/schemas/models/profile.model.d.ts +35 -0
- package/src/schemas/models/shipping-method.model.d.ts +50 -0
- package/src/schemas/models/store.model.d.ts +18 -0
- package/src/schemas/mutations/cart.mutation.d.ts +14 -0
- package/src/schemas/mutations/{cart-payment.mutation.d.ts → checkout.mutation.d.ts} +74 -6
- package/src/schemas/mutations/identity.mutation.d.ts +5 -0
- package/src/schemas/mutations/index.d.ts +2 -1
- package/src/schemas/mutations/profile.mutation.d.ts +6 -0
- package/src/schemas/queries/cart.query.d.ts +1 -1
- package/src/schemas/queries/checkout.query.d.ts +19 -0
- package/src/schemas/queries/identity.query.d.ts +1 -1
- package/src/schemas/queries/index.d.ts +4 -1
- package/src/schemas/queries/inventory.query.d.ts +6 -15
- package/src/schemas/queries/order.query.d.ts +7 -0
- package/src/schemas/queries/price.query.d.ts +1 -1
- package/src/schemas/queries/product.query.d.ts +6 -0
- 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 +56 -21
- package/cache/cache-evaluation.interface.js +0 -0
- package/providers/cart-payment.provider.js +0 -9
- package/schemas/mutations/cart-payment.mutation.js +0 -15
- package/schemas/queries/cart-payment.query.js +0 -11
- package/src/cache/cache-evaluation.interface.d.ts +0 -17
- package/src/providers/cart-payment.provider.d.ts +0 -42
- package/src/schemas/queries/cart-payment.query.d.ts +0 -16
|
@@ -39,33 +39,42 @@ 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>;
|
|
45
48
|
export declare const OrderItemIdentifierSchema: z.ZodObject<{
|
|
46
49
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
47
50
|
}, z.core.$loose>;
|
|
51
|
+
export declare const CheckoutIdentifierSchema: z.ZodObject<{
|
|
52
|
+
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
53
|
+
}, z.core.$loose>;
|
|
54
|
+
export declare const CheckoutItemIdentifierSchema: z.ZodObject<{
|
|
55
|
+
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
56
|
+
}, z.core.$loose>;
|
|
48
57
|
/**
|
|
49
58
|
* The target store the user is interacting with. Can change over time, and is not necessarily the same as the default store.
|
|
50
59
|
*/
|
|
51
60
|
export declare const WebStoreIdentifierSchema: z.ZodObject<{
|
|
52
61
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
53
62
|
}, z.core.$loose>;
|
|
54
|
-
export declare const
|
|
63
|
+
export declare const FulfillmentCenterIdentifierSchema: z.ZodObject<{
|
|
55
64
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
56
65
|
}, z.core.$loose>;
|
|
57
66
|
export declare const InventoryIdentifierSchema: z.ZodObject<{
|
|
58
67
|
sku: z.ZodDefault<z.ZodObject<{
|
|
59
68
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
60
69
|
}, z.core.$loose>>;
|
|
61
|
-
|
|
70
|
+
fulfillmentCenter: z.ZodDefault<z.ZodObject<{
|
|
62
71
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
63
72
|
}, z.core.$loose>>;
|
|
64
73
|
}, z.core.$loose>;
|
|
65
74
|
export declare const IdentityIdentifierSchema: z.ZodObject<{
|
|
66
75
|
userId: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
67
76
|
}, z.core.$loose>;
|
|
68
|
-
export declare const
|
|
77
|
+
export declare const ShippingMethodIdentifierSchema: z.ZodObject<{
|
|
69
78
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
70
79
|
}, z.core.$loose>;
|
|
71
80
|
export declare const PaymentMethodIdentifierSchema: z.ZodObject<{
|
|
@@ -79,6 +88,9 @@ export declare const AddressIdentifierSchema: z.ZodObject<{
|
|
|
79
88
|
export declare const PaymentInstructionIdentifierSchema: z.ZodObject<{
|
|
80
89
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
81
90
|
}, z.core.$loose>;
|
|
91
|
+
export declare const PickupPointIdentifierSchema: z.ZodObject<{
|
|
92
|
+
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
93
|
+
}, z.core.$loose>;
|
|
82
94
|
export type ProductIdentifier = z.infer<typeof ProductIdentifierSchema>;
|
|
83
95
|
export type SearchIdentifier = z.infer<typeof SearchIdentifierSchema>;
|
|
84
96
|
export type FacetIdentifier = z.infer<typeof FacetIdentifierSchema>;
|
|
@@ -89,12 +101,16 @@ export type PriceIdentifier = z.infer<typeof PriceIdentifierSchema>;
|
|
|
89
101
|
export type CategoryIdentifier = z.infer<typeof CategoryIdentifierSchema>;
|
|
90
102
|
export type WebStoreIdentifier = z.infer<typeof WebStoreIdentifierSchema>;
|
|
91
103
|
export type InventoryIdentifier = z.infer<typeof InventoryIdentifierSchema>;
|
|
92
|
-
export type
|
|
104
|
+
export type FulfillmentCenterIdentifier = z.infer<typeof FulfillmentCenterIdentifierSchema>;
|
|
93
105
|
export type IdentityIdentifier = z.infer<typeof IdentityIdentifierSchema>;
|
|
94
|
-
export type ShippingMethodIdentifier = z.infer<typeof
|
|
106
|
+
export type ShippingMethodIdentifier = z.infer<typeof ShippingMethodIdentifierSchema>;
|
|
95
107
|
export type PaymentMethodIdentifier = z.infer<typeof PaymentMethodIdentifierSchema>;
|
|
96
108
|
export type AddressIdentifier = z.infer<typeof AddressIdentifierSchema>;
|
|
97
109
|
export type PaymentInstructionIdentifier = z.infer<typeof PaymentInstructionIdentifierSchema>;
|
|
98
110
|
export type OrderIdentifier = z.infer<typeof OrderIdentifierSchema>;
|
|
99
111
|
export type OrderItemIdentifier = z.infer<typeof OrderItemIdentifierSchema>;
|
|
100
|
-
export type
|
|
112
|
+
export type CheckoutIdentifier = z.infer<typeof CheckoutIdentifierSchema>;
|
|
113
|
+
export type CheckoutItemIdentifier = z.infer<typeof CheckoutItemIdentifierSchema>;
|
|
114
|
+
export type PickupPointIdentifier = z.infer<typeof PickupPointIdentifierSchema>;
|
|
115
|
+
export type StoreIdentifier = z.infer<typeof StoreIdentifierSchema>;
|
|
116
|
+
export type IdentifierType = ProductIdentifier | SearchIdentifier | FacetIdentifier | FacetValueIdentifier | CartIdentifier | CartItemIdentifier | PriceIdentifier | CategoryIdentifier | WebStoreIdentifier | InventoryIdentifier | FulfillmentCenterIdentifier | IdentityIdentifier | ShippingMethodIdentifier | PaymentMethodIdentifier | AddressIdentifier | PaymentInstructionIdentifier | OrderIdentifier | OrderItemIdentifier | CheckoutIdentifier | CheckoutItemIdentifier | StoreIdentifier | PickupPointIdentifier;
|
|
@@ -1,16 +1,34 @@
|
|
|
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.ZodDefault<z.ZodLiteral<"Anonymous">>;
|
|
11
|
+
token: z.ZodOptional<z.ZodString>;
|
|
12
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
13
|
+
expiry: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
14
|
+
}, z.core.$loose>;
|
|
15
|
+
export declare const GuestIdentitySchema: z.ZodObject<{
|
|
16
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
17
|
+
cache: z.ZodDefault<z.ZodObject<{
|
|
18
|
+
hit: z.ZodDefault<z.ZodBoolean>;
|
|
19
|
+
key: z.ZodDefault<z.ZodString>;
|
|
20
|
+
}, z.core.$loose>>;
|
|
21
|
+
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
22
|
+
}, z.core.$loose>>;
|
|
23
|
+
id: z.ZodDefault<z.ZodObject<{
|
|
24
|
+
userId: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
25
|
+
}, z.core.$loose>>;
|
|
26
|
+
type: z.ZodDefault<z.ZodLiteral<"Guest">>;
|
|
27
|
+
token: z.ZodOptional<z.ZodString>;
|
|
28
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
11
29
|
expiry: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
12
|
-
}, z.core.$
|
|
13
|
-
export declare const
|
|
30
|
+
}, z.core.$loose>;
|
|
31
|
+
export declare const RegisteredIdentitySchema: z.ZodObject<{
|
|
14
32
|
meta: z.ZodDefault<z.ZodObject<{
|
|
15
33
|
cache: z.ZodDefault<z.ZodObject<{
|
|
16
34
|
hit: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -21,24 +39,57 @@ export declare const IdentitySchema: z.ZodObject<{
|
|
|
21
39
|
id: z.ZodDefault<z.ZodObject<{
|
|
22
40
|
userId: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
23
41
|
}, z.core.$loose>>;
|
|
24
|
-
type: z.ZodDefault<z.
|
|
25
|
-
Anonymous: "Anonymous";
|
|
26
|
-
Guest: "Guest";
|
|
27
|
-
Registered: "Registered";
|
|
28
|
-
}>>;
|
|
42
|
+
type: z.ZodDefault<z.ZodLiteral<"Registered">>;
|
|
29
43
|
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
44
|
token: z.ZodOptional<z.ZodString>;
|
|
40
|
-
|
|
45
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
41
46
|
expiry: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
42
47
|
}, z.core.$loose>;
|
|
43
|
-
export
|
|
48
|
+
export declare const IdentitySchema: z.ZodDiscriminatedUnion<[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
|
+
type: z.ZodDefault<z.ZodLiteral<"Anonymous">>;
|
|
57
|
+
token: z.ZodOptional<z.ZodString>;
|
|
58
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
59
|
+
expiry: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
60
|
+
}, 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
|
+
id: z.ZodDefault<z.ZodObject<{
|
|
69
|
+
userId: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
70
|
+
}, z.core.$loose>>;
|
|
71
|
+
type: z.ZodDefault<z.ZodLiteral<"Guest">>;
|
|
72
|
+
token: z.ZodOptional<z.ZodString>;
|
|
73
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
74
|
+
expiry: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
75
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
76
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
77
|
+
cache: z.ZodDefault<z.ZodObject<{
|
|
78
|
+
hit: z.ZodDefault<z.ZodBoolean>;
|
|
79
|
+
key: z.ZodDefault<z.ZodString>;
|
|
80
|
+
}, z.core.$loose>>;
|
|
81
|
+
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
82
|
+
}, z.core.$loose>>;
|
|
83
|
+
id: z.ZodDefault<z.ZodObject<{
|
|
84
|
+
userId: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
85
|
+
}, z.core.$loose>>;
|
|
86
|
+
type: z.ZodDefault<z.ZodLiteral<"Registered">>;
|
|
87
|
+
logonId: z.ZodDefault<z.ZodString>;
|
|
88
|
+
token: z.ZodOptional<z.ZodString>;
|
|
89
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
90
|
+
expiry: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
91
|
+
}, z.core.$loose>], "type">;
|
|
92
|
+
export type AnonymousIdentity = z.infer<typeof AnonymousIdentitySchema>;
|
|
93
|
+
export type GuestIdentity = z.infer<typeof GuestIdentitySchema>;
|
|
94
|
+
export type RegisteredIdentity = z.infer<typeof RegisteredIdentitySchema>;
|
|
44
95
|
export type Identity = z.infer<typeof IdentitySchema>;
|
|
@@ -12,3 +12,8 @@ export * from './product.model';
|
|
|
12
12
|
export * from './profile.model';
|
|
13
13
|
export * from './search.model';
|
|
14
14
|
export * from './shipping-method.model';
|
|
15
|
+
export * from './store.model';
|
|
16
|
+
export * from './order.model';
|
|
17
|
+
export * from './cost.model';
|
|
18
|
+
export * from './checkout.model';
|
|
19
|
+
export * from './payment.model';
|
|
@@ -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>>;
|