@reactionary/core 0.0.40 → 0.0.42

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/decorators/reactionary.decorator.js +13 -0
  2. package/index.js +4 -26
  3. package/package.json +1 -1
  4. package/providers/cart-payment.provider.js +9 -0
  5. package/providers/cart.provider.js +6 -0
  6. package/providers/index.js +10 -0
  7. package/providers/price.provider.js +1 -1
  8. package/providers/product.provider.js +10 -0
  9. package/schemas/capabilities.schema.js +1 -0
  10. package/schemas/models/cart.model.js +9 -2
  11. package/schemas/models/identifiers.model.js +30 -0
  12. package/schemas/models/identity.model.js +17 -2
  13. package/schemas/models/index.js +14 -0
  14. package/schemas/models/payment.model.js +37 -0
  15. package/schemas/models/profile.model.js +29 -0
  16. package/schemas/models/shipping-method.model.js +15 -0
  17. package/schemas/mutations/cart-payment.mutation.js +15 -0
  18. package/schemas/mutations/cart.mutation.js +57 -8
  19. package/schemas/mutations/index.js +9 -0
  20. package/schemas/queries/cart-payment.query.js +11 -0
  21. package/schemas/queries/index.js +1 -0
  22. package/src/client/client.d.ts +2 -0
  23. package/src/decorators/reactionary.decorator.d.ts +1 -0
  24. package/src/index.d.ts +4 -26
  25. package/src/providers/cart-payment.provider.d.ts +42 -0
  26. package/src/providers/cart.provider.d.ts +100 -1
  27. package/src/providers/index.d.ts +10 -0
  28. package/src/providers/price.provider.d.ts +1 -1
  29. package/src/providers/product.provider.d.ts +6 -1
  30. package/src/schemas/capabilities.schema.d.ts +1 -0
  31. package/src/schemas/models/cart.model.d.ts +237 -2
  32. package/src/schemas/models/identifiers.model.d.ts +31 -1
  33. package/src/schemas/models/identity.model.d.ts +19 -1
  34. package/src/schemas/models/index.d.ts +14 -0
  35. package/src/schemas/models/payment.model.d.ts +692 -0
  36. package/src/schemas/models/profile.model.d.ts +66 -0
  37. package/src/schemas/models/shipping-method.model.d.ts +201 -0
  38. package/src/schemas/mutations/cart-payment.mutation.d.ts +213 -0
  39. package/src/schemas/mutations/cart.mutation.d.ts +468 -7
  40. package/src/schemas/mutations/index.d.ts +9 -0
  41. package/src/schemas/queries/cart-payment.query.d.ts +16 -0
  42. package/src/schemas/queries/index.d.ts +1 -0
  43. package/src/schemas/session.schema.d.ts +13 -1
@@ -2,11 +2,110 @@ import { BaseProvider } from "./base.provider";
2
2
  import { Cart } from "../schemas/models/cart.model";
3
3
  import { CartQueryById } from "../schemas/queries/cart.query";
4
4
  import { Session } from "../schemas/session.schema";
5
- import { CartMutationItemAdd, CartMutationItemQuantityChange, CartMutationItemRemove } from "../schemas/mutations/cart.mutation";
5
+ import { CartMutationApplyCoupon, CartMutationChangeCurrency, CartMutationCheckout, CartMutationDeleteCart, CartMutationItemAdd, CartMutationItemQuantityChange, CartMutationItemRemove, CartMutationRemoveCoupon, CartMutationSetBillingAddress, CartMutationSetShippingInfo } from "../schemas/mutations/cart.mutation";
6
+ import { CartIdentifier, OrderIdentifier } from "../schemas/models/identifiers.model";
6
7
  export declare abstract class CartProvider<T extends Cart = Cart> extends BaseProvider<T> {
8
+ /**
9
+ * Get cart by ID.
10
+ *
11
+ * Usecase: Unclear, until we support multiple carts per user.
12
+ * @param payload
13
+ * @param session
14
+ */
7
15
  abstract getById(payload: CartQueryById, session: Session): Promise<T>;
16
+ /**
17
+ * Get the active cart id for the user.
18
+ *
19
+ * Usecase: Most common usecase during site load, or after login. You want to get the active cart for the user, so you can display it in the minicart.
20
+ * @param session
21
+ */
22
+ abstract getActiveCartId(session: Session): Promise<CartIdentifier>;
23
+ /**
24
+ * Add item to cart. If no cart exists, create a new one. Returns the updated and recalculated cart.
25
+ * Does not automatically consolidate items, so if you want to have second add of same item to increase quantity,
26
+ * you need to handle that in your logic or on the server.
27
+ *
28
+ * Usecase: Add item to cart, create cart if none exists.
29
+ * @param payload
30
+ * @param session
31
+ */
8
32
  abstract add(payload: CartMutationItemAdd, session: Session): Promise<T>;
33
+ /**
34
+ * Remove item from cart. If the cart is empty after removal, delete the cart. Returns the updated and recalculated cart.
35
+ *
36
+ * Usecase: Remove item from cart, delete cart if empty.
37
+ * @param payload
38
+ * @param session
39
+ */
9
40
  abstract remove(payload: CartMutationItemRemove, session: Session): Promise<T>;
41
+ /**
42
+ * Change quantity of item in cart. If the cart is empty after change, delete the cart. Returns the updated and recalculated cart.
43
+ * Changing quantity to 0 is not allowed. Use the remove call instead. This is done to avoid accidental removal of item.
44
+ * Calls with quantity 0 will just be ignored.
45
+ *
46
+ * Usecase: Change quantity of item in cart, like in a minicart, or in the full cart view.
47
+ * @param payload
48
+ * @param session
49
+ */
10
50
  abstract changeQuantity(payload: CartMutationItemQuantityChange, session: Session): Promise<T>;
51
+ /**
52
+ * Deletes the entire cart.
53
+ *
54
+ * Usecase: User wants to empty the cart or something is wrong with the current cart, and you want to clear it out and start fresh.
55
+ * @param payload
56
+ * @param session
57
+ */
58
+ abstract deleteCart(payload: CartMutationDeleteCart, session: Session): Promise<T>;
59
+ /**
60
+ * Sets shipping method and address on the cart. Returns the updated and recalculated cart.
61
+ *
62
+ * Usecase: User selects shipping method during checkout.
63
+ * @param payload
64
+ * @param session
65
+ */
66
+ abstract setShippingInfo(payload: CartMutationSetShippingInfo, session: Session): Promise<T>;
67
+ /**
68
+ * Sets billing address on the cart. Returns the updated and recalculated cart.
69
+ *
70
+ * Usecase: User enters billing address during checkout.
71
+ *
72
+ * @param payload
73
+ * @param session
74
+ */
75
+ abstract setBillingAddress(payload: CartMutationSetBillingAddress, session: Session): Promise<T>;
76
+ /**
77
+ * Applies a coupon code to the cart. Returns the updated and recalculated cart.
78
+ *
79
+ * Usecase: User applies a coupon code during checkout.
80
+ * @param payload
81
+ * @param session
82
+ */
83
+ abstract applyCouponCode(payload: CartMutationApplyCoupon, session: Session): Promise<T>;
84
+ /**
85
+ * Removes a coupon code from the cart. Returns the updated and recalculated cart.
86
+ *
87
+ * Usecase: User removes a coupon code during checkout.
88
+ * @param payload
89
+ * @param session
90
+ */
91
+ abstract removeCouponCode(payload: CartMutationRemoveCoupon, session: Session): Promise<T>;
92
+ /**
93
+ * Checks out the cart. Returns the order identifier of the newly created order.
94
+ *
95
+ * Usecase: User proceeds to checkout.
96
+ *
97
+ * @param payload
98
+ * @param session
99
+ */
100
+ abstract checkout(payload: CartMutationCheckout, session: Session): Promise<OrderIdentifier>;
101
+ /**
102
+ * Changes the currency of the cart.
103
+ *
104
+ * Usecase: User wants to change the currency for his session. This will change the currency of the cart, and recalculate prices.
105
+ * @param newCurrency
106
+ * @param session
107
+ */
108
+ abstract changeCurrency(payload: CartMutationChangeCurrency, session: Session): Promise<T>;
109
+ protected createEmptyCart(): T;
11
110
  protected getResourceName(): string;
12
111
  }
@@ -0,0 +1,10 @@
1
+ export * from './analytics.provider';
2
+ export * from './base.provider';
3
+ export * from './cart-payment.provider';
4
+ export * from './cart.provider';
5
+ export * from './category.provider';
6
+ export * from './identity.provider';
7
+ export * from './inventory.provider';
8
+ export * from './price.provider';
9
+ export * from './product.provider';
10
+ export * from './search.provider';
@@ -31,6 +31,6 @@ export declare abstract class PriceProvider<T extends Price = Price> extends Bas
31
31
  * @param currency
32
32
  * @returns
33
33
  */
34
- protected getEmptyPriceResult(sku: string, currency: Currency): T;
34
+ protected createEmptyPriceResult(sku: string, currency: Currency): T;
35
35
  protected getResourceName(): string;
36
36
  }
@@ -4,6 +4,11 @@ import { Session } from '../schemas/session.schema';
4
4
  import { ProductQueryById, ProductQueryBySlug } from '../schemas/queries/product.query';
5
5
  export declare abstract class ProductProvider<T extends Product = Product> extends BaseProvider<T> {
6
6
  abstract getById(payload: ProductQueryById, session: Session): Promise<T>;
7
- abstract getBySlug(payload: ProductQueryBySlug, session: Session): Promise<T>;
7
+ abstract getBySlug(payload: ProductQueryBySlug, session: Session): Promise<T | null>;
8
+ protected createEmptyProduct(id: string): T;
9
+ /**
10
+ * The resource name, used for caching and logging.
11
+ * @returns
12
+ */
8
13
  protected getResourceName(): string;
9
14
  }
@@ -5,6 +5,7 @@ export declare const CapabilitiesSchema: z.ZodObject<{
5
5
  analytics: z.ZodBoolean;
6
6
  identity: z.ZodBoolean;
7
7
  cart: z.ZodBoolean;
8
+ cartPayment: z.ZodBoolean;
8
9
  inventory: z.ZodBoolean;
9
10
  price: z.ZodBoolean;
10
11
  category: z.ZodBoolean;
@@ -1117,7 +1117,6 @@ export declare const CostBreakDownSchema: z.ZodObject<{
1117
1117
  }>>;
1118
1118
  }, z.core.$loose>>;
1119
1119
  }, z.core.$loose>;
1120
- export type CostBreakDown = z.infer<typeof CostBreakDownSchema>;
1121
1120
  export declare const ItemCostBreakdownSchema: z.ZodObject<{
1122
1121
  unitPrice: z.ZodDefault<z.ZodObject<{
1123
1122
  value: z.ZodDefault<z.ZodNumber>;
@@ -1864,7 +1863,6 @@ export declare const ItemCostBreakdownSchema: z.ZodObject<{
1864
1863
  }>>;
1865
1864
  }, z.core.$loose>>;
1866
1865
  }, z.core.$loose>;
1867
- export type ItemCostBreakdown = z.infer<typeof ItemCostBreakdownSchema>;
1868
1866
  export declare const CartItemSchema: z.ZodObject<{
1869
1867
  identifier: z.ZodDefault<z.ZodObject<{
1870
1868
  key: z.ZodDefault<z.ZodString>;
@@ -1872,6 +1870,9 @@ export declare const CartItemSchema: z.ZodObject<{
1872
1870
  product: z.ZodDefault<z.ZodObject<{
1873
1871
  key: z.ZodDefault<z.ZodString>;
1874
1872
  }, z.core.$loose>>;
1873
+ sku: z.ZodDefault<z.ZodObject<{
1874
+ key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
1875
+ }, z.core.$loose>>;
1875
1876
  quantity: z.ZodDefault<z.ZodNumber>;
1876
1877
  price: z.ZodDefault<z.ZodObject<{
1877
1878
  unitPrice: z.ZodDefault<z.ZodObject<{
@@ -2631,6 +2632,9 @@ export declare const CartSchema: z.ZodObject<{
2631
2632
  identifier: z.ZodDefault<z.ZodObject<{
2632
2633
  key: z.ZodDefault<z.ZodString>;
2633
2634
  }, z.core.$loose>>;
2635
+ userId: z.ZodDefault<z.ZodObject<{
2636
+ userId: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
2637
+ }, z.core.$loose>>;
2634
2638
  items: z.ZodDefault<z.ZodArray<z.ZodObject<{
2635
2639
  identifier: z.ZodDefault<z.ZodObject<{
2636
2640
  key: z.ZodDefault<z.ZodString>;
@@ -2638,6 +2642,9 @@ export declare const CartSchema: z.ZodObject<{
2638
2642
  product: z.ZodDefault<z.ZodObject<{
2639
2643
  key: z.ZodDefault<z.ZodString>;
2640
2644
  }, z.core.$loose>>;
2645
+ sku: z.ZodDefault<z.ZodObject<{
2646
+ key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
2647
+ }, z.core.$loose>>;
2641
2648
  quantity: z.ZodDefault<z.ZodNumber>;
2642
2649
  price: z.ZodDefault<z.ZodObject<{
2643
2650
  unitPrice: z.ZodDefault<z.ZodObject<{
@@ -4506,6 +4513,234 @@ export declare const CartSchema: z.ZodObject<{
4506
4513
  }, z.core.$loose>>;
4507
4514
  name: z.ZodDefault<z.ZodString>;
4508
4515
  description: z.ZodDefault<z.ZodString>;
4516
+ shippingAddress: z.ZodOptional<z.ZodObject<{
4517
+ identifier: z.ZodDefault<z.ZodObject<{
4518
+ nickName: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
4519
+ }, z.core.$loose>>;
4520
+ firstName: z.ZodDefault<z.ZodString>;
4521
+ lastName: z.ZodDefault<z.ZodString>;
4522
+ streetAddress: z.ZodDefault<z.ZodString>;
4523
+ streetNumber: z.ZodDefault<z.ZodString>;
4524
+ city: z.ZodDefault<z.ZodString>;
4525
+ region: z.ZodDefault<z.ZodString>;
4526
+ postalCode: z.ZodDefault<z.ZodString>;
4527
+ countryCode: z.ZodDefault<z.ZodString>;
4528
+ }, z.core.$loose>>;
4529
+ billingAddress: z.ZodOptional<z.ZodObject<{
4530
+ identifier: z.ZodDefault<z.ZodObject<{
4531
+ nickName: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
4532
+ }, z.core.$loose>>;
4533
+ firstName: z.ZodDefault<z.ZodString>;
4534
+ lastName: z.ZodDefault<z.ZodString>;
4535
+ streetAddress: z.ZodDefault<z.ZodString>;
4536
+ streetNumber: z.ZodDefault<z.ZodString>;
4537
+ city: z.ZodDefault<z.ZodString>;
4538
+ region: z.ZodDefault<z.ZodString>;
4539
+ postalCode: z.ZodDefault<z.ZodString>;
4540
+ countryCode: z.ZodDefault<z.ZodString>;
4541
+ }, z.core.$loose>>;
4542
+ shippingMethod: z.ZodOptional<z.ZodObject<{
4543
+ identifier: z.ZodDefault<z.ZodObject<{
4544
+ key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
4545
+ }, z.core.$loose>>;
4546
+ name: z.ZodDefault<z.ZodString>;
4547
+ description: z.ZodDefault<z.ZodString>;
4548
+ logo: z.ZodOptional<z.ZodObject<{
4549
+ sourceUrl: z.ZodDefault<z.ZodString>;
4550
+ altText: z.ZodDefault<z.ZodString>;
4551
+ width: z.ZodOptional<z.ZodNumber>;
4552
+ height: z.ZodOptional<z.ZodNumber>;
4553
+ }, z.core.$loose>>;
4554
+ price: z.ZodDefault<z.ZodObject<{
4555
+ value: z.ZodDefault<z.ZodNumber>;
4556
+ currency: z.ZodDefault<z.ZodEnum<{
4557
+ AED: "AED";
4558
+ AFN: "AFN";
4559
+ ALL: "ALL";
4560
+ AMD: "AMD";
4561
+ ANG: "ANG";
4562
+ AOA: "AOA";
4563
+ ARS: "ARS";
4564
+ AUD: "AUD";
4565
+ AWG: "AWG";
4566
+ AZN: "AZN";
4567
+ BAM: "BAM";
4568
+ BBD: "BBD";
4569
+ BDT: "BDT";
4570
+ BGN: "BGN";
4571
+ BHD: "BHD";
4572
+ BIF: "BIF";
4573
+ BMD: "BMD";
4574
+ BND: "BND";
4575
+ BOB: "BOB";
4576
+ BOV: "BOV";
4577
+ BRL: "BRL";
4578
+ BSD: "BSD";
4579
+ BTN: "BTN";
4580
+ BWP: "BWP";
4581
+ BYN: "BYN";
4582
+ BZD: "BZD";
4583
+ CAD: "CAD";
4584
+ CDF: "CDF";
4585
+ CHE: "CHE";
4586
+ CHF: "CHF";
4587
+ CHW: "CHW";
4588
+ CLF: "CLF";
4589
+ CLP: "CLP";
4590
+ CNY: "CNY";
4591
+ COP: "COP";
4592
+ COU: "COU";
4593
+ CRC: "CRC";
4594
+ CUC: "CUC";
4595
+ CUP: "CUP";
4596
+ CVE: "CVE";
4597
+ CZK: "CZK";
4598
+ DJF: "DJF";
4599
+ DKK: "DKK";
4600
+ DOP: "DOP";
4601
+ DZD: "DZD";
4602
+ EGP: "EGP";
4603
+ ERN: "ERN";
4604
+ ETB: "ETB";
4605
+ EUR: "EUR";
4606
+ FJD: "FJD";
4607
+ FKP: "FKP";
4608
+ GBP: "GBP";
4609
+ GEL: "GEL";
4610
+ GHS: "GHS";
4611
+ GIP: "GIP";
4612
+ GMD: "GMD";
4613
+ GNF: "GNF";
4614
+ GTQ: "GTQ";
4615
+ GYD: "GYD";
4616
+ HKD: "HKD";
4617
+ HNL: "HNL";
4618
+ HRK: "HRK";
4619
+ HTG: "HTG";
4620
+ HUF: "HUF";
4621
+ IDR: "IDR";
4622
+ ILS: "ILS";
4623
+ INR: "INR";
4624
+ IQD: "IQD";
4625
+ IRR: "IRR";
4626
+ ISK: "ISK";
4627
+ JMD: "JMD";
4628
+ JOD: "JOD";
4629
+ JPY: "JPY";
4630
+ KES: "KES";
4631
+ KGS: "KGS";
4632
+ KHR: "KHR";
4633
+ KMF: "KMF";
4634
+ KPW: "KPW";
4635
+ KRW: "KRW";
4636
+ KWD: "KWD";
4637
+ KYD: "KYD";
4638
+ KZT: "KZT";
4639
+ LAK: "LAK";
4640
+ LBP: "LBP";
4641
+ LKR: "LKR";
4642
+ LRD: "LRD";
4643
+ LSL: "LSL";
4644
+ LYD: "LYD";
4645
+ MAD: "MAD";
4646
+ MDL: "MDL";
4647
+ MGA: "MGA";
4648
+ MKD: "MKD";
4649
+ MMK: "MMK";
4650
+ MNT: "MNT";
4651
+ MOP: "MOP";
4652
+ MRU: "MRU";
4653
+ MUR: "MUR";
4654
+ MVR: "MVR";
4655
+ MWK: "MWK";
4656
+ MXN: "MXN";
4657
+ MXV: "MXV";
4658
+ MYR: "MYR";
4659
+ MZN: "MZN";
4660
+ NAD: "NAD";
4661
+ NGN: "NGN";
4662
+ NIO: "NIO";
4663
+ NOK: "NOK";
4664
+ NPR: "NPR";
4665
+ NZD: "NZD";
4666
+ OMR: "OMR";
4667
+ PAB: "PAB";
4668
+ PEN: "PEN";
4669
+ PGK: "PGK";
4670
+ PHP: "PHP";
4671
+ PKR: "PKR";
4672
+ PLN: "PLN";
4673
+ PYG: "PYG";
4674
+ QAR: "QAR";
4675
+ RON: "RON";
4676
+ RSD: "RSD";
4677
+ RUB: "RUB";
4678
+ RWF: "RWF";
4679
+ SAR: "SAR";
4680
+ SBD: "SBD";
4681
+ SCR: "SCR";
4682
+ SDG: "SDG";
4683
+ SEK: "SEK";
4684
+ SGD: "SGD";
4685
+ SHP: "SHP";
4686
+ SLE: "SLE";
4687
+ SLL: "SLL";
4688
+ SOS: "SOS";
4689
+ SRD: "SRD";
4690
+ SSP: "SSP";
4691
+ STN: "STN";
4692
+ SYP: "SYP";
4693
+ SZL: "SZL";
4694
+ THB: "THB";
4695
+ TJS: "TJS";
4696
+ TMT: "TMT";
4697
+ TND: "TND";
4698
+ TOP: "TOP";
4699
+ TRY: "TRY";
4700
+ TTD: "TTD";
4701
+ TVD: "TVD";
4702
+ TWD: "TWD";
4703
+ TZS: "TZS";
4704
+ UAH: "UAH";
4705
+ UGX: "UGX";
4706
+ USD: "USD";
4707
+ USN: "USN";
4708
+ UYI: "UYI";
4709
+ UYU: "UYU";
4710
+ UYW: "UYW";
4711
+ UZS: "UZS";
4712
+ VED: "VED";
4713
+ VES: "VES";
4714
+ VND: "VND";
4715
+ VUV: "VUV";
4716
+ WST: "WST";
4717
+ XAF: "XAF";
4718
+ XAG: "XAG";
4719
+ XAU: "XAU";
4720
+ XBA: "XBA";
4721
+ XBB: "XBB";
4722
+ XBC: "XBC";
4723
+ XBD: "XBD";
4724
+ XCD: "XCD";
4725
+ XDR: "XDR";
4726
+ XOF: "XOF";
4727
+ XPD: "XPD";
4728
+ XPF: "XPF";
4729
+ XPT: "XPT";
4730
+ XSU: "XSU";
4731
+ XTS: "XTS";
4732
+ XUA: "XUA";
4733
+ XXX: "XXX";
4734
+ YER: "YER";
4735
+ ZAR: "ZAR";
4736
+ ZMW: "ZMW";
4737
+ ZWL: "ZWL";
4738
+ }>>;
4739
+ }, z.core.$loose>>;
4740
+ deliveryTime: z.ZodDefault<z.ZodString>;
4741
+ }, z.core.$loose>>;
4509
4742
  }, z.core.$loose>;
4743
+ export type CostBreakDown = z.infer<typeof CostBreakDownSchema>;
4744
+ export type ItemCostBreakdown = z.infer<typeof ItemCostBreakdownSchema>;
4510
4745
  export type CartItem = z.infer<typeof CartItemSchema>;
4511
4746
  export type Cart = z.infer<typeof CartSchema>;
@@ -39,6 +39,12 @@ 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 OrderIdentifierSchema: z.ZodObject<{
43
+ key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
44
+ }, z.core.$loose>;
45
+ export declare const OrderItemIdentifierSchema: z.ZodObject<{
46
+ key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
47
+ }, z.core.$loose>;
42
48
  /**
43
49
  * The target store the user is interacting with. Can change over time, and is not necessarily the same as the default store.
44
50
  */
@@ -56,6 +62,23 @@ export declare const InventoryIdentifierSchema: z.ZodObject<{
56
62
  key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
57
63
  }, z.core.$loose>>;
58
64
  }, z.core.$loose>;
65
+ export declare const IdentityIdentifierSchema: z.ZodObject<{
66
+ userId: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
67
+ }, z.core.$loose>;
68
+ export declare const ShippingMethodIdentifier: z.ZodObject<{
69
+ key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
70
+ }, z.core.$loose>;
71
+ export declare const PaymentMethodIdentifierSchema: z.ZodObject<{
72
+ method: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
73
+ name: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
74
+ paymentProcessor: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
75
+ }, z.core.$loose>;
76
+ export declare const AddressIdentifierSchema: z.ZodObject<{
77
+ nickName: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
78
+ }, z.core.$loose>;
79
+ export declare const PaymentInstructionIdentifierSchema: z.ZodObject<{
80
+ key: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
81
+ }, z.core.$loose>;
59
82
  export type ProductIdentifier = z.infer<typeof ProductIdentifierSchema>;
60
83
  export type SearchIdentifier = z.infer<typeof SearchIdentifierSchema>;
61
84
  export type FacetIdentifier = z.infer<typeof FacetIdentifierSchema>;
@@ -67,4 +90,11 @@ export type CategoryIdentifier = z.infer<typeof CategoryIdentifierSchema>;
67
90
  export type WebStoreIdentifier = z.infer<typeof WebStoreIdentifierSchema>;
68
91
  export type InventoryIdentifier = z.infer<typeof InventoryIdentifierSchema>;
69
92
  export type InventoryChannelIdentifier = z.infer<typeof InventoryChannelIdentifierSchema>;
70
- export type IdentifierType = ProductIdentifier | SearchIdentifier | FacetIdentifier | FacetValueIdentifier | CartIdentifier | CartItemIdentifier | PriceIdentifier | CategoryIdentifier | WebStoreIdentifier | InventoryIdentifier;
93
+ export type IdentityIdentifier = z.infer<typeof IdentityIdentifierSchema>;
94
+ export type ShippingMethodIdentifier = z.infer<typeof ShippingMethodIdentifier>;
95
+ export type PaymentMethodIdentifier = z.infer<typeof PaymentMethodIdentifierSchema>;
96
+ export type AddressIdentifier = z.infer<typeof AddressIdentifierSchema>;
97
+ export type PaymentInstructionIdentifier = z.infer<typeof PaymentInstructionIdentifierSchema>;
98
+ export type OrderIdentifier = z.infer<typeof OrderIdentifierSchema>;
99
+ export type OrderItemIdentifier = z.infer<typeof OrderItemIdentifierSchema>;
100
+ export type IdentifierType = ProductIdentifier | SearchIdentifier | FacetIdentifier | FacetValueIdentifier | CartIdentifier | CartItemIdentifier | PriceIdentifier | CategoryIdentifier | WebStoreIdentifier | InventoryIdentifier | InventoryChannelIdentifier | IdentityIdentifier | ShippingMethodIdentifier | PaymentMethodIdentifier | AddressIdentifier | PaymentInstructionIdentifier | OrderIdentifier | OrderItemIdentifier;
@@ -4,6 +4,12 @@ export declare const IdentityTypeSchema: z.ZodEnum<{
4
4
  Guest: "Guest";
5
5
  Registered: "Registered";
6
6
  }>;
7
+ export declare const ServiceTokenSchema: z.ZodObject<{
8
+ service: z.ZodDefault<z.ZodString>;
9
+ token: z.ZodDefault<z.ZodString>;
10
+ issued: z.ZodDefault<z.ZodCoercedDate<unknown>>;
11
+ expiry: z.ZodDefault<z.ZodCoercedDate<unknown>>;
12
+ }, z.core.$strip>;
7
13
  export declare const IdentitySchema: z.ZodObject<{
8
14
  meta: z.ZodDefault<z.ZodObject<{
9
15
  cache: z.ZodDefault<z.ZodObject<{
@@ -12,12 +18,24 @@ export declare const IdentitySchema: z.ZodObject<{
12
18
  }, z.core.$loose>>;
13
19
  placeholder: z.ZodDefault<z.ZodBoolean>;
14
20
  }, z.core.$loose>>;
15
- id: z.ZodDefault<z.ZodString>;
21
+ id: z.ZodDefault<z.ZodObject<{
22
+ userId: z.ZodNonOptional<z.ZodDefault<z.ZodString>>;
23
+ }, z.core.$loose>>;
16
24
  type: z.ZodDefault<z.ZodEnum<{
17
25
  Anonymous: "Anonymous";
18
26
  Guest: "Guest";
19
27
  Registered: "Registered";
20
28
  }>>;
29
+ 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>;
21
39
  token: z.ZodOptional<z.ZodString>;
22
40
  issued: z.ZodDefault<z.ZodCoercedDate<unknown>>;
23
41
  expiry: z.ZodDefault<z.ZodCoercedDate<unknown>>;
@@ -0,0 +1,14 @@
1
+ export * from './analytics.model';
2
+ export * from './base.model';
3
+ export * from './cart.model';
4
+ export * from './category.model';
5
+ export * from './currency.model';
6
+ export * from './identifiers.model';
7
+ export * from './identity.model';
8
+ export * from './inventory.model';
9
+ export * from './payment.model';
10
+ export * from './price.model';
11
+ export * from './product.model';
12
+ export * from './profile.model';
13
+ export * from './search.model';
14
+ export * from './shipping-method.model';