@reactionary/core 0.0.41 → 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 +5 -27
- package/initialization.js +43 -0
- package/package.json +4 -2
- package/providers/base.provider.js +29 -12
- package/providers/cart-payment.provider.js +9 -0
- package/providers/cart.provider.js +6 -0
- package/providers/index.js +12 -0
- package/providers/price.provider.js +1 -1
- package/providers/product.provider.js +10 -0
- package/providers/profile.provider.js +9 -0
- package/providers/store.provider.js +9 -0
- package/schemas/capabilities.schema.js +3 -1
- package/schemas/models/cart.model.js +9 -2
- package/schemas/models/identifiers.model.js +40 -4
- package/schemas/models/identity.model.js +20 -6
- package/schemas/models/index.js +15 -0
- package/schemas/models/payment.model.js +37 -0
- package/schemas/models/profile.model.js +30 -0
- package/schemas/models/shipping-method.model.js +15 -0
- package/schemas/models/store.model.js +11 -0
- package/schemas/mutations/cart-payment.mutation.js +15 -0
- package/schemas/mutations/cart.mutation.js +52 -3
- package/schemas/mutations/identity.mutation.js +6 -1
- package/schemas/mutations/index.js +10 -0
- package/schemas/mutations/profile.mutation.js +9 -0
- package/schemas/queries/cart-payment.query.js +11 -0
- package/schemas/queries/index.js +3 -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 +11 -9
- package/src/decorators/reactionary.decorator.d.ts +34 -1
- package/src/index.d.ts +5 -27
- 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 +42 -0
- package/src/providers/cart.provider.d.ts +107 -8
- package/src/providers/category.provider.d.ts +9 -9
- package/src/providers/identity.provider.d.ts +8 -7
- package/src/providers/index.d.ts +12 -0
- package/src/providers/inventory.provider.d.ts +4 -4
- package/src/providers/price.provider.d.ts +7 -7
- package/src/providers/product.provider.d.ts +10 -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 +2 -0
- package/src/schemas/models/analytics.model.d.ts +1 -1
- package/src/schemas/models/cart.model.d.ts +251 -2
- package/src/schemas/models/identifiers.model.d.ts +38 -4
- package/src/schemas/models/identity.model.d.ts +77 -14
- package/src/schemas/models/index.d.ts +15 -0
- package/src/schemas/models/inventory.model.d.ts +1 -1
- package/src/schemas/models/payment.model.d.ts +692 -0
- package/src/schemas/models/profile.model.d.ts +101 -0
- package/src/schemas/models/shipping-method.model.d.ts +201 -0
- package/src/schemas/models/store.model.d.ts +18 -0
- package/src/schemas/mutations/cart-payment.mutation.d.ts +213 -0
- package/src/schemas/mutations/cart.mutation.d.ts +477 -2
- package/src/schemas/mutations/identity.mutation.d.ts +5 -0
- package/src/schemas/mutations/index.d.ts +10 -0
- package/src/schemas/mutations/profile.mutation.d.ts +6 -0
- package/src/schemas/queries/cart-payment.query.d.ts +16 -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 +3 -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 +57 -13
- package/cache/cache-evaluation.interface.js +0 -0
- package/src/cache/cache-evaluation.interface.d.ts +0 -17
|
@@ -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,16 @@ 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<{
|
|
192
200
|
meta: z.ZodDefault<z.ZodObject<{
|
|
193
201
|
cache: z.ZodDefault<z.ZodObject<{
|
|
194
202
|
hit: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -196,16 +204,40 @@ export declare const SessionSchema: z.ZodObject<{
|
|
|
196
204
|
}, z.core.$loose>>;
|
|
197
205
|
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
198
206
|
}, z.core.$loose>>;
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
207
|
+
type: z.ZodLiteral<"Anonymous">;
|
|
208
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
209
|
+
meta: z.ZodDefault<z.ZodObject<{
|
|
210
|
+
cache: z.ZodDefault<z.ZodObject<{
|
|
211
|
+
hit: z.ZodDefault<z.ZodBoolean>;
|
|
212
|
+
key: z.ZodDefault<z.ZodString>;
|
|
213
|
+
}, z.core.$loose>>;
|
|
214
|
+
placeholder: z.ZodDefault<z.ZodBoolean>;
|
|
215
|
+
}, z.core.$loose>>;
|
|
216
|
+
id: z.ZodDefault<z.ZodObject<{
|
|
217
|
+
userId: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
218
|
+
}, z.core.$loose>>;
|
|
219
|
+
type: z.ZodLiteral<"Guest">;
|
|
205
220
|
token: z.ZodOptional<z.ZodString>;
|
|
206
|
-
|
|
221
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
207
222
|
expiry: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
208
|
-
}, z.core.$loose
|
|
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">;
|
|
235
|
+
logonId: z.ZodDefault<z.ZodString>;
|
|
236
|
+
token: z.ZodOptional<z.ZodString>;
|
|
237
|
+
refresh_token: z.ZodOptional<z.ZodString>;
|
|
238
|
+
expiry: z.ZodDefault<z.ZodCoercedDate<unknown>>;
|
|
239
|
+
}, z.core.$loose>], "type">>;
|
|
240
|
+
session: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
209
241
|
languageContext: z.ZodDefault<z.ZodObject<{
|
|
210
242
|
locale: z.ZodDefault<z.ZodString>;
|
|
211
243
|
currencyCode: z.ZodDefault<z.ZodEnum<{
|
|
@@ -391,11 +423,23 @@ export declare const SessionSchema: z.ZodObject<{
|
|
|
391
423
|
ZMW: "ZMW";
|
|
392
424
|
ZWL: "ZWL";
|
|
393
425
|
}>>;
|
|
394
|
-
countryCode: z.ZodDefault<z.ZodString>;
|
|
395
426
|
}, z.core.$loose>>;
|
|
396
427
|
storeIdentifier: z.ZodDefault<z.ZodObject<{
|
|
397
428
|
key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
|
|
398
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>;
|
|
399
441
|
}, z.core.$loose>;
|
|
400
442
|
export type Session = z.infer<typeof SessionSchema>;
|
|
401
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
|
-
}
|