@reactionary/core 0.0.27

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.
Files changed (43) hide show
  1. package/README.md +11 -0
  2. package/index.js +647 -0
  3. package/package.json +8 -0
  4. package/src/cache/caching-strategy.d.ts +13 -0
  5. package/src/cache/redis-cache.d.ts +13 -0
  6. package/src/client/client.d.ts +18 -0
  7. package/src/index.d.ts +36 -0
  8. package/src/providers/analytics.provider.d.ts +6 -0
  9. package/src/providers/base.provider.d.ts +46 -0
  10. package/src/providers/cart.provider.d.ts +6 -0
  11. package/src/providers/identity.provider.d.ts +6 -0
  12. package/src/providers/inventory.provider.d.ts +6 -0
  13. package/src/providers/price.provider.d.ts +6 -0
  14. package/src/providers/product.provider.d.ts +6 -0
  15. package/src/providers/search.provider.d.ts +6 -0
  16. package/src/schemas/capabilities.schema.d.ts +15 -0
  17. package/src/schemas/models/analytics.model.d.ts +27 -0
  18. package/src/schemas/models/base.model.d.ts +48 -0
  19. package/src/schemas/models/cart.model.d.ts +78 -0
  20. package/src/schemas/models/currency.model.d.ts +185 -0
  21. package/src/schemas/models/identifiers.model.d.ts +93 -0
  22. package/src/schemas/models/identity.model.d.ts +43 -0
  23. package/src/schemas/models/inventory.model.d.ts +29 -0
  24. package/src/schemas/models/price.model.d.ts +422 -0
  25. package/src/schemas/models/product.model.d.ts +86 -0
  26. package/src/schemas/models/search.model.d.ts +184 -0
  27. package/src/schemas/mutations/analytics.mutation.d.ts +177 -0
  28. package/src/schemas/mutations/base.mutation.d.ts +9 -0
  29. package/src/schemas/mutations/cart.mutation.d.ts +169 -0
  30. package/src/schemas/mutations/identity.mutation.d.ts +59 -0
  31. package/src/schemas/mutations/inventory.mutation.d.ts +3 -0
  32. package/src/schemas/mutations/price.mutation.d.ts +3 -0
  33. package/src/schemas/mutations/product.mutation.d.ts +3 -0
  34. package/src/schemas/mutations/search.mutation.d.ts +3 -0
  35. package/src/schemas/queries/analytics.query.d.ts +3 -0
  36. package/src/schemas/queries/base.query.d.ts +9 -0
  37. package/src/schemas/queries/cart.query.d.ts +43 -0
  38. package/src/schemas/queries/identity.query.d.ts +29 -0
  39. package/src/schemas/queries/inventory.query.d.ts +16 -0
  40. package/src/schemas/queries/price.query.d.ts +43 -0
  41. package/src/schemas/queries/product.query.d.ts +59 -0
  42. package/src/schemas/queries/search.query.d.ts +75 -0
  43. package/src/schemas/session.schema.d.ts +42 -0
package/src/index.d.ts ADDED
@@ -0,0 +1,36 @@
1
+ export * from './cache/caching-strategy';
2
+ export * from './cache/redis-cache';
3
+ export * from './client/client';
4
+ export * from './providers/analytics.provider';
5
+ export * from './providers/base.provider';
6
+ export * from './providers/cart.provider';
7
+ export * from './providers/identity.provider';
8
+ export * from './providers/inventory.provider';
9
+ export * from './providers/price.provider';
10
+ export * from './providers/product.provider';
11
+ export * from './providers/search.provider';
12
+ export * from './schemas/capabilities.schema';
13
+ export * from './schemas/session.schema';
14
+ export * from './schemas/models/base.model';
15
+ export * from './schemas/models/cart.model';
16
+ export * from './schemas/models/currency.model';
17
+ export * from './schemas/models/identifiers.model';
18
+ export * from './schemas/models/identity.model';
19
+ export * from './schemas/models/inventory.model';
20
+ export * from './schemas/models/price.model';
21
+ export * from './schemas/models/product.model';
22
+ export * from './schemas/models/search.model';
23
+ export * from './schemas/mutations/base.mutation';
24
+ export * from './schemas/mutations/cart.mutation';
25
+ export * from './schemas/mutations/identity.mutation';
26
+ export * from './schemas/mutations/inventory.mutation';
27
+ export * from './schemas/mutations/price.mutation';
28
+ export * from './schemas/mutations/product.mutation';
29
+ export * from './schemas/mutations/search.mutation';
30
+ export * from './schemas/queries/base.query';
31
+ export * from './schemas/queries/cart.query';
32
+ export * from './schemas/queries/identity.query';
33
+ export * from './schemas/queries/inventory.query';
34
+ export * from './schemas/queries/price.query';
35
+ export * from './schemas/queries/product.query';
36
+ export * from './schemas/queries/search.query';
@@ -0,0 +1,6 @@
1
+ import { AnalyticsEvent } from '../schemas/models/analytics.model';
2
+ import { AnalyticsMutation } from '../schemas/mutations/analytics.mutation';
3
+ import { AnalyticsQuery } from '../schemas/queries/analytics.query';
4
+ import { BaseProvider } from './base.provider';
5
+ export declare abstract class AnalyticsProvider<T extends AnalyticsEvent = AnalyticsEvent, Q extends AnalyticsQuery = AnalyticsQuery, M extends AnalyticsMutation = AnalyticsMutation> extends BaseProvider<T, Q, M> {
6
+ }
@@ -0,0 +1,46 @@
1
+ import { z } from 'zod';
2
+ import { Session } from '../schemas/session.schema';
3
+ import { BaseQuery } from '../schemas/queries/base.query';
4
+ import { BaseMutation } from '../schemas/mutations/base.mutation';
5
+ import { BaseModel } from '../schemas/models/base.model';
6
+ /**
7
+ * Base capability provider, responsible for mutations (changes) and queries (fetches)
8
+ * for a given business object domain.
9
+ */
10
+ export declare abstract class BaseProvider<T extends BaseModel = BaseModel, Q extends BaseQuery = BaseQuery, M extends BaseMutation = BaseMutation> {
11
+ readonly schema: z.ZodType<T>;
12
+ readonly querySchema: z.ZodType<Q, Q>;
13
+ readonly mutationSchema: z.ZodType<M, M>;
14
+ constructor(schema: z.ZodType<T>, querySchema: z.ZodType<Q, Q>, mutationSchema: z.ZodType<M, M>);
15
+ /**
16
+ * Validates that the final domain model constructed by the provider
17
+ * fulfills the schema as defined. This will throw an exception.
18
+ */
19
+ protected assert(value: T): T;
20
+ /**
21
+ * Creates a new model entity based on the schema defaults.
22
+ */
23
+ protected newModel(): T;
24
+ /**
25
+ * Retrieves a set of entities matching the list of queries. The size of
26
+ * the resulting list WILL always match the size of the query list. The
27
+ * result list will never contain nulls or undefined. The order
28
+ * of the results will match the order of the queries.
29
+ */
30
+ query(queries: Q[], session: Session): Promise<T[]>;
31
+ /**
32
+ * Executes the listed mutations in order and returns the final state
33
+ * resulting from that set of operations.
34
+ */
35
+ mutate(mutations: M[], session: Session): Promise<T>;
36
+ /**
37
+ * The internal extension point for providers implementating query
38
+ * capabilities.
39
+ */
40
+ protected abstract fetch(queries: Q[], session: Session): Promise<T[]>;
41
+ /**
42
+ * The internal extension point for providers implementing mutation
43
+ * capabilities.
44
+ */
45
+ protected abstract process(mutations: M[], session: Session): Promise<T>;
46
+ }
@@ -0,0 +1,6 @@
1
+ import { CartQuery } from "../schemas/queries/cart.query";
2
+ import { CartMutation } from "../schemas/mutations/cart.mutation";
3
+ import { BaseProvider } from "./base.provider";
4
+ import { Cart } from "../schemas/models/cart.model";
5
+ export declare abstract class CartProvider<T extends Cart = Cart, Q extends CartQuery = CartQuery, M extends CartMutation = CartMutation> extends BaseProvider<T, Q, M> {
6
+ }
@@ -0,0 +1,6 @@
1
+ import { Identity } from "../schemas/models/identity.model";
2
+ import { IdentityQuery } from "../schemas/queries/identity.query";
3
+ import { IdentityMutation } from "../schemas/mutations/identity.mutation";
4
+ import { BaseProvider } from "./base.provider";
5
+ export declare abstract class IdentityProvider<T extends Identity = Identity, Q extends IdentityQuery = IdentityQuery, M extends IdentityMutation = IdentityMutation> extends BaseProvider<T, Q, M> {
6
+ }
@@ -0,0 +1,6 @@
1
+ import { Inventory } from '../schemas/models/inventory.model';
2
+ import { InventoryQuery } from '../schemas/queries/inventory.query';
3
+ import { InventoryMutation } from '../schemas/mutations/inventory.mutation';
4
+ import { BaseProvider } from './base.provider';
5
+ export declare abstract class InventoryProvider<T extends Inventory = Inventory, Q extends InventoryQuery = InventoryQuery, M extends InventoryMutation = InventoryMutation> extends BaseProvider<T, Q, M> {
6
+ }
@@ -0,0 +1,6 @@
1
+ import { Price } from '../schemas/models/price.model';
2
+ import { PriceMutation } from '../schemas/mutations/price.mutation';
3
+ import { PriceQuery } from '../schemas/queries/price.query';
4
+ import { BaseProvider } from './base.provider';
5
+ export declare abstract class PriceProvider<T extends Price = Price, Q extends PriceQuery = PriceQuery, M extends PriceMutation = PriceMutation> extends BaseProvider<T, Q, M> {
6
+ }
@@ -0,0 +1,6 @@
1
+ import { Product } from '../schemas/models/product.model';
2
+ import { ProductMutation } from '../schemas/mutations/product.mutation';
3
+ import { ProductQuery } from '../schemas/queries/product.query';
4
+ import { BaseProvider } from './base.provider';
5
+ export declare abstract class ProductProvider<T extends Product = Product, Q extends ProductQuery = ProductQuery, M extends ProductMutation = ProductMutation> extends BaseProvider<T, Q, M> {
6
+ }
@@ -0,0 +1,6 @@
1
+ import { SearchResult } from '../schemas/models/search.model';
2
+ import { SearchQuery } from '../schemas/queries/search.query';
3
+ import { SearchMutation } from '../schemas/mutations/search.mutation';
4
+ import { BaseProvider } from './base.provider';
5
+ export declare abstract class SearchProvider<T extends SearchResult = SearchResult, Q extends SearchQuery = SearchQuery, M extends SearchMutation = SearchMutation> extends BaseProvider<T, Q, M> {
6
+ }
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ export declare const CapabilitiesSchema: z.ZodInterface<{
3
+ product: z.ZodBoolean;
4
+ search: z.ZodBoolean;
5
+ analytics: z.ZodBoolean;
6
+ identity: z.ZodBoolean;
7
+ cart: z.ZodBoolean;
8
+ inventory: z.ZodBoolean;
9
+ price: z.ZodBoolean;
10
+ }, {
11
+ optional: never;
12
+ defaulted: never;
13
+ extra: Record<string, unknown>;
14
+ }>;
15
+ export type Capabilities = z.infer<typeof CapabilitiesSchema>;
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ export declare const AnalyticsEventSchema: z.MergeInterfaces<z.ZodInterface<{
3
+ meta: z.ZodDefault<z.ZodInterface<{
4
+ cache: z.ZodDefault<z.ZodInterface<{
5
+ hit: z.ZodDefault<z.ZodBoolean>;
6
+ key: z.ZodDefault<z.ZodString>;
7
+ }, {
8
+ optional: never;
9
+ defaulted: never;
10
+ extra: Record<string, unknown>;
11
+ }>>;
12
+ placeholder: z.ZodDefault<z.ZodBoolean>;
13
+ }, {
14
+ optional: never;
15
+ defaulted: never;
16
+ extra: Record<string, unknown>;
17
+ }>>;
18
+ }, {
19
+ optional: never;
20
+ defaulted: never;
21
+ extra: Record<string, unknown>;
22
+ }>, z.ZodInterface<{}, {
23
+ optional: never;
24
+ defaulted: never;
25
+ extra: {};
26
+ }>>;
27
+ export type AnalyticsEvent = z.infer<typeof AnalyticsEventSchema>;
@@ -0,0 +1,48 @@
1
+ import { z } from 'zod';
2
+ export declare const CacheInformationSchema: z.ZodInterface<{
3
+ hit: z.ZodDefault<z.ZodBoolean>;
4
+ key: z.ZodDefault<z.ZodString>;
5
+ }, {
6
+ optional: never;
7
+ defaulted: never;
8
+ extra: Record<string, unknown>;
9
+ }>;
10
+ export declare const MetaSchema: z.ZodInterface<{
11
+ cache: z.ZodDefault<z.ZodInterface<{
12
+ hit: z.ZodDefault<z.ZodBoolean>;
13
+ key: z.ZodDefault<z.ZodString>;
14
+ }, {
15
+ optional: never;
16
+ defaulted: never;
17
+ extra: Record<string, unknown>;
18
+ }>>;
19
+ placeholder: z.ZodDefault<z.ZodBoolean>;
20
+ }, {
21
+ optional: never;
22
+ defaulted: never;
23
+ extra: Record<string, unknown>;
24
+ }>;
25
+ export declare const BaseModelSchema: z.ZodInterface<{
26
+ meta: z.ZodDefault<z.ZodInterface<{
27
+ cache: z.ZodDefault<z.ZodInterface<{
28
+ hit: z.ZodDefault<z.ZodBoolean>;
29
+ key: z.ZodDefault<z.ZodString>;
30
+ }, {
31
+ optional: never;
32
+ defaulted: never;
33
+ extra: Record<string, unknown>;
34
+ }>>;
35
+ placeholder: z.ZodDefault<z.ZodBoolean>;
36
+ }, {
37
+ optional: never;
38
+ defaulted: never;
39
+ extra: Record<string, unknown>;
40
+ }>>;
41
+ }, {
42
+ optional: never;
43
+ defaulted: never;
44
+ extra: Record<string, unknown>;
45
+ }>;
46
+ export type CacheInformation = z.infer<typeof CacheInformationSchema>;
47
+ export type Meta = z.infer<typeof MetaSchema>;
48
+ export type BaseModel = z.infer<typeof BaseModelSchema>;
@@ -0,0 +1,78 @@
1
+ import { z } from 'zod';
2
+ export declare const CartItemSchema: z.ZodInterface<{
3
+ identifier: z.ZodDefault<z.ZodInterface<{
4
+ key: z.ZodDefault<z.ZodString>;
5
+ }, {
6
+ optional: never;
7
+ defaulted: never;
8
+ extra: Record<string, unknown>;
9
+ }>>;
10
+ product: z.ZodDefault<z.ZodInterface<{
11
+ key: z.ZodDefault<z.ZodString>;
12
+ }, {
13
+ optional: never;
14
+ defaulted: never;
15
+ extra: Record<string, unknown>;
16
+ }>>;
17
+ quantity: z.ZodDefault<z.ZodNumber>;
18
+ }, {
19
+ optional: never;
20
+ defaulted: never;
21
+ extra: Record<string, unknown>;
22
+ }>;
23
+ export declare const CartSchema: z.MergeInterfaces<z.ZodInterface<{
24
+ meta: z.ZodDefault<z.ZodInterface<{
25
+ cache: z.ZodDefault<z.ZodInterface<{
26
+ hit: z.ZodDefault<z.ZodBoolean>;
27
+ key: z.ZodDefault<z.ZodString>;
28
+ }, {
29
+ optional: never;
30
+ defaulted: never;
31
+ extra: Record<string, unknown>;
32
+ }>>;
33
+ placeholder: z.ZodDefault<z.ZodBoolean>;
34
+ }, {
35
+ optional: never;
36
+ defaulted: never;
37
+ extra: Record<string, unknown>;
38
+ }>>;
39
+ }, {
40
+ optional: never;
41
+ defaulted: never;
42
+ extra: Record<string, unknown>;
43
+ }>, z.ZodInterface<{
44
+ identifier: z.ZodDefault<z.ZodInterface<{
45
+ key: z.ZodDefault<z.ZodString>;
46
+ }, {
47
+ optional: never;
48
+ defaulted: never;
49
+ extra: Record<string, unknown>;
50
+ }>>;
51
+ items: z.ZodDefault<z.ZodArray<z.ZodInterface<{
52
+ identifier: z.ZodDefault<z.ZodInterface<{
53
+ key: z.ZodDefault<z.ZodString>;
54
+ }, {
55
+ optional: never;
56
+ defaulted: never;
57
+ extra: Record<string, unknown>;
58
+ }>>;
59
+ product: z.ZodDefault<z.ZodInterface<{
60
+ key: z.ZodDefault<z.ZodString>;
61
+ }, {
62
+ optional: never;
63
+ defaulted: never;
64
+ extra: Record<string, unknown>;
65
+ }>>;
66
+ quantity: z.ZodDefault<z.ZodNumber>;
67
+ }, {
68
+ optional: never;
69
+ defaulted: never;
70
+ extra: Record<string, unknown>;
71
+ }>>>;
72
+ }, {
73
+ optional: never;
74
+ defaulted: never;
75
+ extra: {};
76
+ }>>;
77
+ export type CartItem = z.infer<typeof CartItemSchema>;
78
+ export type Cart = z.infer<typeof CartSchema>;
@@ -0,0 +1,185 @@
1
+ import { z } from 'zod';
2
+ export declare const CurrencySchema: z.ZodEnum<{
3
+ AED: "AED";
4
+ AFN: "AFN";
5
+ ALL: "ALL";
6
+ AMD: "AMD";
7
+ ANG: "ANG";
8
+ AOA: "AOA";
9
+ ARS: "ARS";
10
+ AUD: "AUD";
11
+ AWG: "AWG";
12
+ AZN: "AZN";
13
+ BAM: "BAM";
14
+ BBD: "BBD";
15
+ BDT: "BDT";
16
+ BGN: "BGN";
17
+ BHD: "BHD";
18
+ BIF: "BIF";
19
+ BMD: "BMD";
20
+ BND: "BND";
21
+ BOB: "BOB";
22
+ BOV: "BOV";
23
+ BRL: "BRL";
24
+ BSD: "BSD";
25
+ BTN: "BTN";
26
+ BWP: "BWP";
27
+ BYN: "BYN";
28
+ BZD: "BZD";
29
+ CAD: "CAD";
30
+ CDF: "CDF";
31
+ CHE: "CHE";
32
+ CHF: "CHF";
33
+ CHW: "CHW";
34
+ CLF: "CLF";
35
+ CLP: "CLP";
36
+ CNY: "CNY";
37
+ COP: "COP";
38
+ COU: "COU";
39
+ CRC: "CRC";
40
+ CUC: "CUC";
41
+ CUP: "CUP";
42
+ CVE: "CVE";
43
+ CZK: "CZK";
44
+ DJF: "DJF";
45
+ DKK: "DKK";
46
+ DOP: "DOP";
47
+ DZD: "DZD";
48
+ EGP: "EGP";
49
+ ERN: "ERN";
50
+ ETB: "ETB";
51
+ EUR: "EUR";
52
+ FJD: "FJD";
53
+ FKP: "FKP";
54
+ GBP: "GBP";
55
+ GEL: "GEL";
56
+ GHS: "GHS";
57
+ GIP: "GIP";
58
+ GMD: "GMD";
59
+ GNF: "GNF";
60
+ GTQ: "GTQ";
61
+ GYD: "GYD";
62
+ HKD: "HKD";
63
+ HNL: "HNL";
64
+ HRK: "HRK";
65
+ HTG: "HTG";
66
+ HUF: "HUF";
67
+ IDR: "IDR";
68
+ ILS: "ILS";
69
+ INR: "INR";
70
+ IQD: "IQD";
71
+ IRR: "IRR";
72
+ ISK: "ISK";
73
+ JMD: "JMD";
74
+ JOD: "JOD";
75
+ JPY: "JPY";
76
+ KES: "KES";
77
+ KGS: "KGS";
78
+ KHR: "KHR";
79
+ KMF: "KMF";
80
+ KPW: "KPW";
81
+ KRW: "KRW";
82
+ KWD: "KWD";
83
+ KYD: "KYD";
84
+ KZT: "KZT";
85
+ LAK: "LAK";
86
+ LBP: "LBP";
87
+ LKR: "LKR";
88
+ LRD: "LRD";
89
+ LSL: "LSL";
90
+ LYD: "LYD";
91
+ MAD: "MAD";
92
+ MDL: "MDL";
93
+ MGA: "MGA";
94
+ MKD: "MKD";
95
+ MMK: "MMK";
96
+ MNT: "MNT";
97
+ MOP: "MOP";
98
+ MRU: "MRU";
99
+ MUR: "MUR";
100
+ MVR: "MVR";
101
+ MWK: "MWK";
102
+ MXN: "MXN";
103
+ MXV: "MXV";
104
+ MYR: "MYR";
105
+ MZN: "MZN";
106
+ NAD: "NAD";
107
+ NGN: "NGN";
108
+ NIO: "NIO";
109
+ NOK: "NOK";
110
+ NPR: "NPR";
111
+ NZD: "NZD";
112
+ OMR: "OMR";
113
+ PAB: "PAB";
114
+ PEN: "PEN";
115
+ PGK: "PGK";
116
+ PHP: "PHP";
117
+ PKR: "PKR";
118
+ PLN: "PLN";
119
+ PYG: "PYG";
120
+ QAR: "QAR";
121
+ RON: "RON";
122
+ RSD: "RSD";
123
+ RUB: "RUB";
124
+ RWF: "RWF";
125
+ SAR: "SAR";
126
+ SBD: "SBD";
127
+ SCR: "SCR";
128
+ SDG: "SDG";
129
+ SEK: "SEK";
130
+ SGD: "SGD";
131
+ SHP: "SHP";
132
+ SLE: "SLE";
133
+ SLL: "SLL";
134
+ SOS: "SOS";
135
+ SRD: "SRD";
136
+ SSP: "SSP";
137
+ STN: "STN";
138
+ SYP: "SYP";
139
+ SZL: "SZL";
140
+ THB: "THB";
141
+ TJS: "TJS";
142
+ TMT: "TMT";
143
+ TND: "TND";
144
+ TOP: "TOP";
145
+ TRY: "TRY";
146
+ TTD: "TTD";
147
+ TVD: "TVD";
148
+ TWD: "TWD";
149
+ TZS: "TZS";
150
+ UAH: "UAH";
151
+ UGX: "UGX";
152
+ USD: "USD";
153
+ USN: "USN";
154
+ UYI: "UYI";
155
+ UYU: "UYU";
156
+ UYW: "UYW";
157
+ UZS: "UZS";
158
+ VED: "VED";
159
+ VES: "VES";
160
+ VND: "VND";
161
+ VUV: "VUV";
162
+ WST: "WST";
163
+ XAF: "XAF";
164
+ XAG: "XAG";
165
+ XAU: "XAU";
166
+ XBA: "XBA";
167
+ XBB: "XBB";
168
+ XBC: "XBC";
169
+ XBD: "XBD";
170
+ XCD: "XCD";
171
+ XDR: "XDR";
172
+ XOF: "XOF";
173
+ XPD: "XPD";
174
+ XPF: "XPF";
175
+ XPT: "XPT";
176
+ XSU: "XSU";
177
+ XTS: "XTS";
178
+ XUA: "XUA";
179
+ XXX: "XXX";
180
+ YER: "YER";
181
+ ZAR: "ZAR";
182
+ ZMW: "ZMW";
183
+ ZWL: "ZWL";
184
+ }>;
185
+ export type Currency = z.infer<typeof CurrencySchema>;
@@ -0,0 +1,93 @@
1
+ import { z } from 'zod';
2
+ export declare const FacetIdentifierSchema: z.ZodInterface<{
3
+ key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
4
+ }, {
5
+ optional: never;
6
+ defaulted: never;
7
+ extra: Record<string, unknown>;
8
+ }>;
9
+ export declare const FacetValueIdentifierSchema: z.ZodInterface<{
10
+ facet: z.ZodDefault<z.ZodInterface<{
11
+ key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
12
+ }, {
13
+ optional: never;
14
+ defaulted: never;
15
+ extra: Record<string, unknown>;
16
+ }>>;
17
+ key: z.ZodDefault<z.ZodString>;
18
+ }, {
19
+ optional: never;
20
+ defaulted: never;
21
+ extra: Record<string, unknown>;
22
+ }>;
23
+ export declare const SKUIdentifierSchema: z.ZodInterface<{
24
+ key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
25
+ }, {
26
+ optional: never;
27
+ defaulted: never;
28
+ extra: Record<string, unknown>;
29
+ }>;
30
+ export declare const ProductIdentifierSchema: z.ZodInterface<{
31
+ key: z.ZodDefault<z.ZodString>;
32
+ }, {
33
+ optional: never;
34
+ defaulted: never;
35
+ extra: Record<string, unknown>;
36
+ }>;
37
+ export declare const SearchIdentifierSchema: z.ZodInterface<{
38
+ term: z.ZodDefault<z.ZodString>;
39
+ page: z.ZodDefault<z.ZodNumber>;
40
+ pageSize: z.ZodDefault<z.ZodNumber>;
41
+ facets: z.ZodDefault<z.ZodArray<z.ZodInterface<{
42
+ key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
43
+ facet: z.ZodNonOptional<z.ZodDefault<z.ZodInterface<{
44
+ key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
45
+ }, {
46
+ optional: never;
47
+ defaulted: never;
48
+ extra: Record<string, unknown>;
49
+ }>>>;
50
+ }, {
51
+ optional: never;
52
+ defaulted: never;
53
+ extra: Record<string, unknown>;
54
+ }>>>;
55
+ }, {
56
+ optional: never;
57
+ defaulted: never;
58
+ extra: Record<string, unknown>;
59
+ }>;
60
+ export declare const CartIdentifierSchema: z.ZodInterface<{
61
+ key: z.ZodDefault<z.ZodString>;
62
+ }, {
63
+ optional: never;
64
+ defaulted: never;
65
+ extra: Record<string, unknown>;
66
+ }>;
67
+ export declare const CartItemIdentifierSchema: z.ZodInterface<{
68
+ key: z.ZodDefault<z.ZodString>;
69
+ }, {
70
+ optional: never;
71
+ defaulted: never;
72
+ extra: Record<string, unknown>;
73
+ }>;
74
+ export declare const PriceIdentifierSchema: z.ZodInterface<{
75
+ sku: z.ZodDefault<z.ZodInterface<{
76
+ key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
77
+ }, {
78
+ optional: never;
79
+ defaulted: never;
80
+ extra: Record<string, unknown>;
81
+ }>>;
82
+ }, {
83
+ optional: never;
84
+ defaulted: never;
85
+ extra: Record<string, unknown>;
86
+ }>;
87
+ export type ProductIdentifier = z.infer<typeof ProductIdentifierSchema>;
88
+ export type SearchIdentifier = z.infer<typeof SearchIdentifierSchema>;
89
+ export type FacetIdentifier = z.infer<typeof FacetIdentifierSchema>;
90
+ export type FacetValueIdentifier = z.infer<typeof FacetValueIdentifierSchema>;
91
+ export type CartIdentifier = z.infer<typeof CartIdentifierSchema>;
92
+ export type CartItemIdentifier = z.infer<typeof CartItemIdentifierSchema>;
93
+ export type PriceIdentifier = z.infer<typeof PriceIdentifierSchema>;
@@ -0,0 +1,43 @@
1
+ import { z } from 'zod';
2
+ export declare const IdentityTypeSchema: z.ZodEnum<{
3
+ Anonymous: "Anonymous";
4
+ Guest: "Guest";
5
+ Registered: "Registered";
6
+ }>;
7
+ export declare const IdentitySchema: z.MergeInterfaces<z.ZodInterface<{
8
+ meta: z.ZodDefault<z.ZodInterface<{
9
+ cache: z.ZodDefault<z.ZodInterface<{
10
+ hit: z.ZodDefault<z.ZodBoolean>;
11
+ key: z.ZodDefault<z.ZodString>;
12
+ }, {
13
+ optional: never;
14
+ defaulted: never;
15
+ extra: Record<string, unknown>;
16
+ }>>;
17
+ placeholder: z.ZodDefault<z.ZodBoolean>;
18
+ }, {
19
+ optional: never;
20
+ defaulted: never;
21
+ extra: Record<string, unknown>;
22
+ }>>;
23
+ }, {
24
+ optional: never;
25
+ defaulted: never;
26
+ extra: Record<string, unknown>;
27
+ }>, z.ZodInterface<{
28
+ id: z.ZodDefault<z.ZodString>;
29
+ type: z.ZodDefault<z.ZodEnum<{
30
+ Anonymous: "Anonymous";
31
+ Guest: "Guest";
32
+ Registered: "Registered";
33
+ }>>;
34
+ token: z.ZodOptional<z.ZodString>;
35
+ issued: z.ZodDefault<z.coerce.ZodCoercedDate>;
36
+ expiry: z.ZodDefault<z.coerce.ZodCoercedDate>;
37
+ }, {
38
+ optional: never;
39
+ defaulted: never;
40
+ extra: {};
41
+ }>>;
42
+ export type IdentityType = z.infer<typeof IdentityTypeSchema>;
43
+ export type Identity = z.infer<typeof IdentitySchema>;
@@ -0,0 +1,29 @@
1
+ import { z } from 'zod';
2
+ export declare const InventorySchema: z.MergeInterfaces<z.ZodInterface<{
3
+ meta: z.ZodDefault<z.ZodInterface<{
4
+ cache: z.ZodDefault<z.ZodInterface<{
5
+ hit: z.ZodDefault<z.ZodBoolean>;
6
+ key: z.ZodDefault<z.ZodString>;
7
+ }, {
8
+ optional: never;
9
+ defaulted: never;
10
+ extra: Record<string, unknown>;
11
+ }>>;
12
+ placeholder: z.ZodDefault<z.ZodBoolean>;
13
+ }, {
14
+ optional: never;
15
+ defaulted: never;
16
+ extra: Record<string, unknown>;
17
+ }>>;
18
+ }, {
19
+ optional: never;
20
+ defaulted: never;
21
+ extra: Record<string, unknown>;
22
+ }>, z.ZodInterface<{
23
+ quantity: z.ZodDefault<z.ZodNumber>;
24
+ }, {
25
+ optional: never;
26
+ defaulted: never;
27
+ extra: {};
28
+ }>>;
29
+ export type Inventory = z.infer<typeof InventorySchema>;