@reactionary/core 0.0.32 → 0.0.34

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 (45) hide show
  1. package/cache/cache-evaluation.interface.js +0 -0
  2. package/cache/cache.interface.js +0 -0
  3. package/cache/noop-cache.js +27 -0
  4. package/cache/redis-cache.js +60 -0
  5. package/client/client-builder.js +44 -0
  6. package/client/client.js +29 -0
  7. package/decorators/trpc.decorators.js +66 -0
  8. package/index.js +40 -764
  9. package/package.json +1 -1
  10. package/providers/analytics.provider.js +6 -0
  11. package/providers/base.provider.js +30 -0
  12. package/providers/cart.provider.js +6 -0
  13. package/providers/identity.provider.js +6 -0
  14. package/providers/inventory.provider.js +6 -0
  15. package/providers/price.provider.js +6 -0
  16. package/providers/product.provider.js +6 -0
  17. package/providers/search.provider.js +6 -0
  18. package/schemas/capabilities.schema.js +13 -0
  19. package/schemas/models/analytics.model.js +5 -0
  20. package/schemas/models/base.model.js +17 -0
  21. package/schemas/models/cart.model.js +16 -0
  22. package/schemas/models/currency.model.js +187 -0
  23. package/schemas/models/identifiers.model.js +39 -0
  24. package/schemas/models/identity.model.js +14 -0
  25. package/schemas/models/inventory.model.js +8 -0
  26. package/schemas/models/price.model.js +16 -0
  27. package/schemas/models/product.model.js +26 -0
  28. package/schemas/models/search.model.js +32 -0
  29. package/schemas/mutations/analytics.mutation.js +20 -0
  30. package/schemas/mutations/base.mutation.js +5 -0
  31. package/schemas/mutations/cart.mutation.js +22 -0
  32. package/schemas/mutations/identity.mutation.js +11 -0
  33. package/schemas/mutations/inventory.mutation.js +5 -0
  34. package/schemas/mutations/price.mutation.js +5 -0
  35. package/schemas/mutations/product.mutation.js +5 -0
  36. package/schemas/mutations/search.mutation.js +5 -0
  37. package/schemas/queries/analytics.query.js +5 -0
  38. package/schemas/queries/base.query.js +5 -0
  39. package/schemas/queries/cart.query.js +11 -0
  40. package/schemas/queries/identity.query.js +5 -0
  41. package/schemas/queries/inventory.query.js +8 -0
  42. package/schemas/queries/price.query.js +8 -0
  43. package/schemas/queries/product.query.js +12 -0
  44. package/schemas/queries/search.query.js +8 -0
  45. package/schemas/session.schema.js +9 -0
package/index.js CHANGED
@@ -1,764 +1,40 @@
1
- // core/src/cache/redis-cache.ts
2
- import { Redis } from "@upstash/redis";
3
- var RedisCache = class {
4
- constructor() {
5
- this.redis = Redis.fromEnv();
6
- }
7
- async get(key, schema) {
8
- if (!key) {
9
- return null;
10
- }
11
- const unvalidated = await this.redis.get(key);
12
- const parsed = schema.safeParse(unvalidated);
13
- if (parsed.success) {
14
- return parsed.data;
15
- }
16
- return null;
17
- }
18
- async put(key, value, ttlSeconds) {
19
- if (!key) {
20
- return;
21
- }
22
- const options = ttlSeconds ? { ex: ttlSeconds } : void 0;
23
- await this.redis.set(key, value, options);
24
- }
25
- async del(keys) {
26
- const keyArray = Array.isArray(keys) ? keys : [keys];
27
- for (const key of keyArray) {
28
- if (key.includes("*")) {
29
- const matchingKeys = await this.redis.keys(key);
30
- if (matchingKeys.length > 0) {
31
- await this.redis.del(...matchingKeys);
32
- }
33
- } else {
34
- await this.redis.del(key);
35
- }
36
- }
37
- }
38
- async keys(pattern) {
39
- return await this.redis.keys(pattern);
40
- }
41
- async clear(pattern) {
42
- const searchPattern = pattern || "*";
43
- const keys = await this.redis.keys(searchPattern);
44
- if (keys.length > 0) {
45
- await this.redis.del(...keys);
46
- }
47
- }
48
- async getStats() {
49
- const keys = await this.redis.keys("*");
50
- return {
51
- hits: 0,
52
- // Would need to track this separately
53
- misses: 0,
54
- // Would need to track this separately
55
- size: keys.length
56
- };
57
- }
58
- };
59
-
60
- // core/src/cache/noop-cache.ts
61
- var NoOpCache = class {
62
- async get(_key, _schema) {
63
- return null;
64
- }
65
- async put(_key, _value, _ttlSeconds) {
66
- return;
67
- }
68
- async del(_keys) {
69
- return;
70
- }
71
- async keys(_pattern) {
72
- return [];
73
- }
74
- async clear(_pattern) {
75
- return;
76
- }
77
- async getStats() {
78
- return {
79
- hits: 0,
80
- misses: 0,
81
- size: 0
82
- };
83
- }
84
- };
85
-
86
- // core/src/client/client.ts
87
- function buildClient(providerFactories, options = {}) {
88
- let client = {};
89
- const sharedCache = options.cache || new RedisCache();
90
- const mergedAnalytics = [];
91
- for (const factory of providerFactories) {
92
- const provider = factory(sharedCache);
93
- client = {
94
- ...client,
95
- ...provider
96
- };
97
- if (provider.analytics) {
98
- mergedAnalytics.push(...provider.analytics);
99
- }
100
- }
101
- client.analytics = mergedAnalytics;
102
- const completeClient = {
103
- ...client,
104
- cache: sharedCache
105
- };
106
- return completeClient;
107
- }
108
- function createCache() {
109
- return new RedisCache();
110
- }
111
-
112
- // core/src/client/client-builder.ts
113
- var ClientBuilder = class _ClientBuilder {
114
- constructor() {
115
- this.factories = [];
116
- }
117
- withCapability(factory) {
118
- const newBuilder = new _ClientBuilder();
119
- newBuilder.factories = [...this.factories, factory];
120
- newBuilder.cache = this.cache;
121
- return newBuilder;
122
- }
123
- withCache(cache) {
124
- const newBuilder = new _ClientBuilder();
125
- newBuilder.factories = [...this.factories];
126
- newBuilder.cache = cache;
127
- return newBuilder;
128
- }
129
- build() {
130
- let client = {};
131
- const sharedCache = this.cache || new NoOpCache();
132
- const mergedAnalytics = [];
133
- for (const factory of this.factories) {
134
- const provider = factory(sharedCache);
135
- client = {
136
- ...client,
137
- ...provider
138
- };
139
- if (provider.analytics) {
140
- mergedAnalytics.push(...provider.analytics);
141
- }
142
- }
143
- if (mergedAnalytics.length > 0) {
144
- client["analytics"] = mergedAnalytics;
145
- }
146
- const completeClient = {
147
- ...client,
148
- cache: sharedCache
149
- };
150
- return completeClient;
151
- }
152
- };
153
-
154
- // core/src/decorators/trpc.decorators.ts
155
- import "reflect-metadata";
156
- var TRPC_QUERY_METADATA_KEY = Symbol("trpc:query");
157
- var TRPC_MUTATION_METADATA_KEY = Symbol("trpc:mutation");
158
- function trpcQuery(options = {}) {
159
- return function(target, propertyKey, descriptor) {
160
- const metadata = {
161
- methodName: String(propertyKey),
162
- isQuery: true,
163
- isMutation: false,
164
- options
165
- };
166
- Reflect.defineMetadata(TRPC_QUERY_METADATA_KEY, metadata, target, propertyKey);
167
- const existingMethods = Reflect.getMetadata(TRPC_QUERY_METADATA_KEY, target.constructor) || [];
168
- existingMethods.push({ propertyKey, metadata });
169
- Reflect.defineMetadata(TRPC_QUERY_METADATA_KEY, existingMethods, target.constructor);
170
- };
171
- }
172
- function trpcMutation(options = {}) {
173
- return function(target, propertyKey, descriptor) {
174
- const metadata = {
175
- methodName: String(propertyKey),
176
- isQuery: false,
177
- isMutation: true,
178
- options
179
- };
180
- Reflect.defineMetadata(TRPC_MUTATION_METADATA_KEY, metadata, target, propertyKey);
181
- const existingMethods = Reflect.getMetadata(TRPC_MUTATION_METADATA_KEY, target.constructor) || [];
182
- existingMethods.push({ propertyKey, metadata });
183
- Reflect.defineMetadata(TRPC_MUTATION_METADATA_KEY, existingMethods, target.constructor);
184
- };
185
- }
186
- function getTRPCQueryMethods(target) {
187
- const constructor = typeof target === "function" ? target : target.constructor;
188
- return Reflect.getMetadata(TRPC_QUERY_METADATA_KEY, constructor) || [];
189
- }
190
- function getTRPCMutationMethods(target) {
191
- const constructor = typeof target === "function" ? target : target.constructor;
192
- return Reflect.getMetadata(TRPC_MUTATION_METADATA_KEY, constructor) || [];
193
- }
194
- function getAllTRPCMethods(target) {
195
- return [
196
- ...getTRPCQueryMethods(target),
197
- ...getTRPCMutationMethods(target)
198
- ];
199
- }
200
- function isTRPCQuery(target, methodName) {
201
- return !!Reflect.getMetadata(TRPC_QUERY_METADATA_KEY, target, methodName);
202
- }
203
- function isTRPCMutation(target, methodName) {
204
- return !!Reflect.getMetadata(TRPC_MUTATION_METADATA_KEY, target, methodName);
205
- }
206
- function isTRPCMethod(target, methodName) {
207
- return isTRPCQuery(target, methodName) || isTRPCMutation(target, methodName);
208
- }
209
-
210
- // core/src/providers/base.provider.ts
211
- var BaseProvider = class {
212
- constructor(schema, cache) {
213
- this.schema = schema;
214
- this.cache = cache;
215
- }
216
- /**
217
- * Validates that the final domain model constructed by the provider
218
- * fulfills the schema as defined. This will throw an exception.
219
- */
220
- assert(value) {
221
- return this.schema.parse(value);
222
- }
223
- /**
224
- * Creates a new model entity based on the schema defaults.
225
- */
226
- newModel() {
227
- return this.schema.parse({});
228
- }
229
- /**
230
- * Handler for parsing a response from a remote provider and converting it
231
- * into the typed domain model.
232
- */
233
- parseSingle(_body) {
234
- const model = this.newModel();
235
- return this.assert(model);
236
- }
237
- };
238
-
239
- // core/src/providers/analytics.provider.ts
240
- var AnalyticsProvider = class extends BaseProvider {
241
- };
242
-
243
- // core/src/providers/cart.provider.ts
244
- var CartProvider = class extends BaseProvider {
245
- };
246
-
247
- // core/src/providers/identity.provider.ts
248
- var IdentityProvider = class extends BaseProvider {
249
- };
250
-
251
- // core/src/providers/inventory.provider.ts
252
- var InventoryProvider = class extends BaseProvider {
253
- };
254
-
255
- // core/src/providers/price.provider.ts
256
- var PriceProvider = class extends BaseProvider {
257
- };
258
-
259
- // core/src/providers/product.provider.ts
260
- var ProductProvider = class extends BaseProvider {
261
- };
262
-
263
- // core/src/providers/search.provider.ts
264
- var SearchProvider = class extends BaseProvider {
265
- };
266
-
267
- // core/src/schemas/capabilities.schema.ts
268
- import { z } from "zod";
269
- var CapabilitiesSchema = z.looseInterface({
270
- product: z.boolean(),
271
- search: z.boolean(),
272
- analytics: z.boolean(),
273
- identity: z.boolean(),
274
- cart: z.boolean(),
275
- inventory: z.boolean(),
276
- price: z.boolean()
277
- });
278
-
279
- // core/src/schemas/session.schema.ts
280
- import { z as z4 } from "zod";
281
-
282
- // core/src/schemas/models/identity.model.ts
283
- import { z as z3 } from "zod";
284
-
285
- // core/src/schemas/models/base.model.ts
286
- import { z as z2 } from "zod";
287
- var CacheInformationSchema = z2.looseInterface({
288
- hit: z2.boolean().default(false),
289
- key: z2.string().default("")
290
- });
291
- var MetaSchema = z2.looseInterface({
292
- cache: CacheInformationSchema.default(() => CacheInformationSchema.parse({})),
293
- placeholder: z2.boolean().default(false).describe("Whether or not the entity exists in a remote system, or is a default placeholder.")
294
- });
295
- var BaseModelSchema = z2.looseInterface({
296
- meta: MetaSchema.default(() => MetaSchema.parse({}))
297
- });
298
-
299
- // core/src/schemas/models/identity.model.ts
300
- var IdentityTypeSchema = z3.enum(["Anonymous", "Guest", "Registered"]);
301
- var IdentitySchema = BaseModelSchema.extend({
302
- id: z3.string().default(""),
303
- type: IdentityTypeSchema.default("Anonymous"),
304
- token: z3.string().optional(),
305
- issued: z3.coerce.date().default(/* @__PURE__ */ new Date()),
306
- expiry: z3.coerce.date().default(/* @__PURE__ */ new Date())
307
- });
308
-
309
- // core/src/schemas/session.schema.ts
310
- var SessionSchema = z4.looseObject({
311
- id: z4.string(),
312
- identity: IdentitySchema.default(() => IdentitySchema.parse({}))
313
- });
314
-
315
- // core/src/schemas/models/cart.model.ts
316
- import { z as z6 } from "zod";
317
-
318
- // core/src/schemas/models/identifiers.model.ts
319
- import { z as z5 } from "zod";
320
- var FacetIdentifierSchema = z5.looseInterface({
321
- key: z5.string().default("").nonoptional()
322
- });
323
- var FacetValueIdentifierSchema = z5.looseInterface({
324
- facet: FacetIdentifierSchema.default(() => FacetIdentifierSchema.parse({})),
325
- key: z5.string().default("")
326
- });
327
- var SKUIdentifierSchema = z5.looseInterface({
328
- key: z5.string().default("").nonoptional()
329
- });
330
- var ProductIdentifierSchema = z5.looseInterface({
331
- key: z5.string().default("")
332
- });
333
- var SearchIdentifierSchema = z5.looseInterface({
334
- term: z5.string().default(""),
335
- page: z5.number().default(0),
336
- pageSize: z5.number().default(20),
337
- facets: z5.array(FacetValueIdentifierSchema.required()).default(() => [])
338
- });
339
- var CartIdentifierSchema = z5.looseInterface({
340
- key: z5.string().default("")
341
- });
342
- var CartItemIdentifierSchema = z5.looseInterface({
343
- key: z5.string().default("")
344
- });
345
- var PriceIdentifierSchema = z5.looseInterface({
346
- sku: SKUIdentifierSchema.default(() => SKUIdentifierSchema.parse({}))
347
- });
348
-
349
- // core/src/schemas/models/cart.model.ts
350
- var CartItemSchema = z6.looseInterface({
351
- identifier: CartItemIdentifierSchema.default(() => CartItemIdentifierSchema.parse({})),
352
- product: ProductIdentifierSchema.default(() => ProductIdentifierSchema.parse({})),
353
- quantity: z6.number().default(0)
354
- });
355
- var CartSchema = BaseModelSchema.extend({
356
- identifier: CartIdentifierSchema.default(() => CartIdentifierSchema.parse({})),
357
- items: z6.array(CartItemSchema).default(() => [])
358
- });
359
-
360
- // core/src/schemas/models/currency.model.ts
361
- import { z as z7 } from "zod";
362
- var CurrencySchema = z7.enum([
363
- "AED",
364
- "AFN",
365
- "ALL",
366
- "AMD",
367
- "ANG",
368
- "AOA",
369
- "ARS",
370
- "AUD",
371
- "AWG",
372
- "AZN",
373
- "BAM",
374
- "BBD",
375
- "BDT",
376
- "BGN",
377
- "BHD",
378
- "BIF",
379
- "BMD",
380
- "BND",
381
- "BOB",
382
- "BOV",
383
- "BRL",
384
- "BSD",
385
- "BTN",
386
- "BWP",
387
- "BYN",
388
- "BZD",
389
- "CAD",
390
- "CDF",
391
- "CHE",
392
- "CHF",
393
- "CHW",
394
- "CLF",
395
- "CLP",
396
- "CNY",
397
- "COP",
398
- "COU",
399
- "CRC",
400
- "CUC",
401
- "CUP",
402
- "CVE",
403
- "CZK",
404
- "DJF",
405
- "DKK",
406
- "DOP",
407
- "DZD",
408
- "EGP",
409
- "ERN",
410
- "ETB",
411
- "EUR",
412
- "FJD",
413
- "FKP",
414
- "GBP",
415
- "GEL",
416
- "GHS",
417
- "GIP",
418
- "GMD",
419
- "GNF",
420
- "GTQ",
421
- "GYD",
422
- "HKD",
423
- "HNL",
424
- "HRK",
425
- "HTG",
426
- "HUF",
427
- "IDR",
428
- "ILS",
429
- "INR",
430
- "IQD",
431
- "IRR",
432
- "ISK",
433
- "JMD",
434
- "JOD",
435
- "JPY",
436
- "KES",
437
- "KGS",
438
- "KHR",
439
- "KMF",
440
- "KPW",
441
- "KRW",
442
- "KWD",
443
- "KYD",
444
- "KZT",
445
- "LAK",
446
- "LBP",
447
- "LKR",
448
- "LRD",
449
- "LSL",
450
- "LYD",
451
- "MAD",
452
- "MDL",
453
- "MGA",
454
- "MKD",
455
- "MMK",
456
- "MNT",
457
- "MOP",
458
- "MRU",
459
- "MUR",
460
- "MVR",
461
- "MWK",
462
- "MXN",
463
- "MXV",
464
- "MYR",
465
- "MZN",
466
- "NAD",
467
- "NGN",
468
- "NIO",
469
- "NOK",
470
- "NPR",
471
- "NZD",
472
- "OMR",
473
- "PAB",
474
- "PEN",
475
- "PGK",
476
- "PHP",
477
- "PKR",
478
- "PLN",
479
- "PYG",
480
- "QAR",
481
- "RON",
482
- "RSD",
483
- "RUB",
484
- "RWF",
485
- "SAR",
486
- "SBD",
487
- "SCR",
488
- "SDG",
489
- "SEK",
490
- "SGD",
491
- "SHP",
492
- "SLE",
493
- "SLL",
494
- "SOS",
495
- "SRD",
496
- "SSP",
497
- "STN",
498
- "SYP",
499
- "SZL",
500
- "THB",
501
- "TJS",
502
- "TMT",
503
- "TND",
504
- "TOP",
505
- "TRY",
506
- "TTD",
507
- "TVD",
508
- "TWD",
509
- "TZS",
510
- "UAH",
511
- "UGX",
512
- "USD",
513
- "USN",
514
- "UYI",
515
- "UYU",
516
- "UYW",
517
- "UZS",
518
- "VED",
519
- "VES",
520
- "VND",
521
- "VUV",
522
- "WST",
523
- "XAF",
524
- "XAG",
525
- "XAU",
526
- "XBA",
527
- "XBB",
528
- "XBC",
529
- "XBD",
530
- "XCD",
531
- "XDR",
532
- "XOF",
533
- "XPD",
534
- "XPF",
535
- "XPT",
536
- "XSU",
537
- "XTS",
538
- "XUA",
539
- "XXX",
540
- "YER",
541
- "ZAR",
542
- "ZMW",
543
- "ZWL"
544
- ]);
545
-
546
- // core/src/schemas/models/inventory.model.ts
547
- import { z as z8 } from "zod";
548
- var InventorySchema = BaseModelSchema.extend({
549
- quantity: z8.number().default(0)
550
- });
551
-
552
- // core/src/schemas/models/price.model.ts
553
- import { z as z9 } from "zod";
554
- var MonetaryAmountSchema = z9.looseInterface({
555
- cents: z9.number().default(0).describe("The monetary amount in cent-precision."),
556
- currency: CurrencySchema.default("XXX").describe("The currency associated with the amount, as a ISO 4217 standardized code.")
557
- });
558
- var PriceSchema = BaseModelSchema.extend({
559
- identifier: PriceIdentifierSchema.default(() => PriceIdentifierSchema.parse({})),
560
- value: MonetaryAmountSchema.default(() => MonetaryAmountSchema.parse({}))
561
- });
562
-
563
- // core/src/schemas/models/product.model.ts
564
- import { z as z10 } from "zod";
565
- var SKUSchema = z10.looseInterface({
566
- identifier: ProductIdentifierSchema.default(() => ProductIdentifierSchema.parse({}))
567
- });
568
- var ProductAttributeSchema = z10.looseInterface({
569
- id: z10.string(),
570
- name: z10.string(),
571
- value: z10.string()
572
- });
573
- var ProductSchema = BaseModelSchema.extend({
574
- identifier: ProductIdentifierSchema.default(() => ProductIdentifierSchema.parse({})),
575
- name: z10.string().default(""),
576
- slug: z10.string().default(""),
577
- description: z10.string().default(""),
578
- image: z10.string().url().default("https://placehold.co/400"),
579
- images: z10.string().url().array().default(() => []),
580
- attributes: z10.array(ProductAttributeSchema).default(() => []),
581
- skus: z10.array(SKUSchema).default(() => [])
582
- });
583
-
584
- // core/src/schemas/models/search.model.ts
585
- import { z as z11 } from "zod";
586
- var SearchResultProductSchema = z11.looseInterface({
587
- identifier: ProductIdentifierSchema.default(ProductIdentifierSchema.parse({})),
588
- name: z11.string().default(""),
589
- image: z11.string().url().default("https://placehold.co/400"),
590
- slug: z11.string().default("")
591
- });
592
- var SearchResultFacetValueSchema = z11.looseInterface({
593
- identifier: FacetValueIdentifierSchema.default(() => FacetValueIdentifierSchema.parse({})),
594
- name: z11.string().default(""),
595
- count: z11.number().default(0),
596
- active: z11.boolean().default(false)
597
- });
598
- var SearchResultFacetSchema = z11.looseInterface({
599
- identifier: FacetIdentifierSchema.default(() => FacetIdentifierSchema.parse({})),
600
- name: z11.string().default(""),
601
- values: z11.array(SearchResultFacetValueSchema).default(() => [])
602
- });
603
- var SearchResultSchema = BaseModelSchema.extend({
604
- identifier: SearchIdentifierSchema.default(() => SearchIdentifierSchema.parse({})),
605
- products: z11.array(SearchResultProductSchema).default(() => []),
606
- pages: z11.number().default(0),
607
- facets: z11.array(SearchResultFacetSchema).default(() => [])
608
- });
609
-
610
- // core/src/schemas/mutations/base.mutation.ts
611
- import { z as z12 } from "zod";
612
- var BaseMutationSchema = z12.looseInterface({});
613
-
614
- // core/src/schemas/mutations/cart.mutation.ts
615
- import { z as z13 } from "zod";
616
- var CartMutationItemAddSchema = BaseMutationSchema.extend({
617
- cart: CartIdentifierSchema.required(),
618
- product: ProductIdentifierSchema.required(),
619
- quantity: z13.number()
620
- });
621
- var CartMutationItemRemoveSchema = BaseMutationSchema.extend({
622
- cart: CartIdentifierSchema.required(),
623
- item: CartItemIdentifierSchema.required()
624
- });
625
- var CartMutationItemQuantityChangeSchema = BaseMutationSchema.extend({
626
- cart: CartIdentifierSchema.required(),
627
- item: CartItemIdentifierSchema.required(),
628
- quantity: z13.number()
629
- });
630
-
631
- // core/src/schemas/mutations/identity.mutation.ts
632
- import { z as z14 } from "zod";
633
- var IdentityMutationLoginSchema = BaseMutationSchema.extend({
634
- username: z14.string(),
635
- password: z14.string()
636
- });
637
- var IdentityMutationLogoutSchema = BaseMutationSchema.extend({});
638
-
639
- // core/src/schemas/mutations/inventory.mutation.ts
640
- import { z as z15 } from "zod";
641
- var InventoryMutationSchema = z15.union([]);
642
-
643
- // core/src/schemas/mutations/price.mutation.ts
644
- import { z as z16 } from "zod";
645
- var PriceMutationSchema = z16.union([]);
646
-
647
- // core/src/schemas/mutations/product.mutation.ts
648
- import { z as z17 } from "zod";
649
- var ProductMutationSchema = z17.union([]);
650
-
651
- // core/src/schemas/mutations/search.mutation.ts
652
- import { z as z18 } from "zod";
653
- var SearchMutationSchema = z18.union([]);
654
-
655
- // core/src/schemas/queries/base.query.ts
656
- import { z as z19 } from "zod";
657
- var BaseQuerySchema = z19.looseInterface({});
658
-
659
- // core/src/schemas/queries/cart.query.ts
660
- import { z as z20 } from "zod";
661
- var CartQueryByIdSchema = BaseQuerySchema.extend({
662
- cart: CartIdentifierSchema.required()
663
- });
664
- var CartQuerySchema = z20.union([CartQueryByIdSchema]);
665
-
666
- // core/src/schemas/queries/identity.query.ts
667
- var IdentityQuerySelfSchema = BaseQuerySchema.extend({});
668
-
669
- // core/src/schemas/queries/inventory.query.ts
670
- import { z as z21 } from "zod";
671
- var InventoryQuerySchema = BaseQuerySchema.extend({
672
- sku: z21.string()
673
- });
674
-
675
- // core/src/schemas/queries/price.query.ts
676
- var PriceQueryBySkuSchema = BaseQuerySchema.extend({
677
- sku: SKUIdentifierSchema.required()
678
- });
679
-
680
- // core/src/schemas/queries/product.query.ts
681
- import { z as z22 } from "zod";
682
- var ProductQueryBySlugSchema = BaseQuerySchema.extend({
683
- slug: z22.string()
684
- });
685
- var ProductQueryByIdSchema = BaseQuerySchema.extend({
686
- id: z22.string()
687
- });
688
-
689
- // core/src/schemas/queries/search.query.ts
690
- var SearchQueryByTermSchema = BaseQuerySchema.extend({
691
- search: SearchIdentifierSchema.required()
692
- });
693
- export {
694
- AnalyticsProvider,
695
- BaseModelSchema,
696
- BaseMutationSchema,
697
- BaseProvider,
698
- BaseQuerySchema,
699
- CacheInformationSchema,
700
- CapabilitiesSchema,
701
- CartIdentifierSchema,
702
- CartItemIdentifierSchema,
703
- CartItemSchema,
704
- CartMutationItemAddSchema,
705
- CartMutationItemQuantityChangeSchema,
706
- CartMutationItemRemoveSchema,
707
- CartProvider,
708
- CartQueryByIdSchema,
709
- CartQuerySchema,
710
- CartSchema,
711
- ClientBuilder,
712
- CurrencySchema,
713
- FacetIdentifierSchema,
714
- FacetValueIdentifierSchema,
715
- IdentityMutationLoginSchema,
716
- IdentityMutationLogoutSchema,
717
- IdentityProvider,
718
- IdentityQuerySelfSchema,
719
- IdentitySchema,
720
- IdentityTypeSchema,
721
- InventoryMutationSchema,
722
- InventoryProvider,
723
- InventoryQuerySchema,
724
- InventorySchema,
725
- MetaSchema,
726
- MonetaryAmountSchema,
727
- NoOpCache,
728
- PriceIdentifierSchema,
729
- PriceMutationSchema,
730
- PriceProvider,
731
- PriceQueryBySkuSchema,
732
- PriceSchema,
733
- ProductAttributeSchema,
734
- ProductIdentifierSchema,
735
- ProductMutationSchema,
736
- ProductProvider,
737
- ProductQueryByIdSchema,
738
- ProductQueryBySlugSchema,
739
- ProductSchema,
740
- RedisCache,
741
- SKUIdentifierSchema,
742
- SKUSchema,
743
- SearchIdentifierSchema,
744
- SearchMutationSchema,
745
- SearchProvider,
746
- SearchQueryByTermSchema,
747
- SearchResultFacetSchema,
748
- SearchResultFacetValueSchema,
749
- SearchResultProductSchema,
750
- SearchResultSchema,
751
- SessionSchema,
752
- TRPC_MUTATION_METADATA_KEY,
753
- TRPC_QUERY_METADATA_KEY,
754
- buildClient,
755
- createCache,
756
- getAllTRPCMethods,
757
- getTRPCMutationMethods,
758
- getTRPCQueryMethods,
759
- isTRPCMethod,
760
- isTRPCMutation,
761
- isTRPCQuery,
762
- trpcMutation,
763
- trpcQuery
764
- };
1
+ export * from "./cache/cache.interface";
2
+ export * from "./cache/cache-evaluation.interface";
3
+ export * from "./cache/redis-cache";
4
+ export * from "./cache/noop-cache";
5
+ export * from "./client/client";
6
+ export * from "./client/client-builder";
7
+ export * from "./decorators/trpc.decorators";
8
+ export * from "./providers/analytics.provider";
9
+ export * from "./providers/base.provider";
10
+ export * from "./providers/cart.provider";
11
+ export * from "./providers/identity.provider";
12
+ export * from "./providers/inventory.provider";
13
+ export * from "./providers/price.provider";
14
+ export * from "./providers/product.provider";
15
+ export * from "./providers/search.provider";
16
+ export * from "./schemas/capabilities.schema";
17
+ export * from "./schemas/session.schema";
18
+ export * from "./schemas/models/base.model";
19
+ export * from "./schemas/models/cart.model";
20
+ export * from "./schemas/models/currency.model";
21
+ export * from "./schemas/models/identifiers.model";
22
+ export * from "./schemas/models/identity.model";
23
+ export * from "./schemas/models/inventory.model";
24
+ export * from "./schemas/models/price.model";
25
+ export * from "./schemas/models/product.model";
26
+ export * from "./schemas/models/search.model";
27
+ export * from "./schemas/mutations/base.mutation";
28
+ export * from "./schemas/mutations/cart.mutation";
29
+ export * from "./schemas/mutations/identity.mutation";
30
+ export * from "./schemas/mutations/inventory.mutation";
31
+ export * from "./schemas/mutations/price.mutation";
32
+ export * from "./schemas/mutations/product.mutation";
33
+ export * from "./schemas/mutations/search.mutation";
34
+ export * from "./schemas/queries/base.query";
35
+ export * from "./schemas/queries/cart.query";
36
+ export * from "./schemas/queries/identity.query";
37
+ export * from "./schemas/queries/inventory.query";
38
+ export * from "./schemas/queries/price.query";
39
+ export * from "./schemas/queries/product.query";
40
+ export * from "./schemas/queries/search.query";