@liquidcommerce/cloud-sdk 1.0.1

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 (35) hide show
  1. package/README.md +256 -0
  2. package/dist/index.cjs +1 -0
  3. package/dist/index.esm.js +1 -0
  4. package/dist/liquidcommerce-cloud-sdk.ssr.js +1 -0
  5. package/dist/types/constants/core.constant.d.ts +4 -0
  6. package/dist/types/core/authenticated.service.d.ts +125 -0
  7. package/dist/types/core/cart-helper.service.d.ts +48 -0
  8. package/dist/types/core/catalog-helper.service.d.ts +113 -0
  9. package/dist/types/core/checkout-helper.service.d.ts +76 -0
  10. package/dist/types/core/index.d.ts +7 -0
  11. package/dist/types/core/location-helper.service.d.ts +47 -0
  12. package/dist/types/core/payment-provider.service.d.ts +91 -0
  13. package/dist/types/core/singleton.service.d.ts +138 -0
  14. package/dist/types/enums.d.ts +265 -0
  15. package/dist/types/index.d.ts +1 -0
  16. package/dist/types/index.umd.d.ts +2 -0
  17. package/dist/types/interfaces/address.interface.d.ts +21 -0
  18. package/dist/types/interfaces/cart.interface.d.ts +188 -0
  19. package/dist/types/interfaces/catalog.interface.d.ts +69 -0
  20. package/dist/types/interfaces/catalog.service.interface.d.ts +65 -0
  21. package/dist/types/interfaces/checkout.interface.d.ts +118 -0
  22. package/dist/types/interfaces/liquid-commerce-client.interface.d.ts +597 -0
  23. package/dist/types/interfaces/payment.interface.d.ts +88 -0
  24. package/dist/types/interfaces/retailer.interface.d.ts +63 -0
  25. package/dist/types/interfaces/user.interface.d.ts +53 -0
  26. package/dist/types/liquid-commerce-client.d.ts +189 -0
  27. package/dist/types/services/address.service.d.ts +44 -0
  28. package/dist/types/services/cart.service.d.ts +31 -0
  29. package/dist/types/services/catalog.service.d.ts +38 -0
  30. package/dist/types/services/checkout.service.d.ts +28 -0
  31. package/dist/types/services/payment.service.d.ts +39 -0
  32. package/dist/types/services/user.service.d.ts +43 -0
  33. package/dist/types/types.d.ts +36 -0
  34. package/package.json +108 -0
  35. package/umd/liquidcommerce-cloud-sdk.min.js +1 -0
@@ -0,0 +1,118 @@
1
+ import type { ICoreParams } from '../types';
2
+ import type { ILoc } from './address.interface';
3
+ import type { ICartAttributesAmounts, ICartItem, ICartRetailer } from './cart.interface';
4
+ /**
5
+ * Represents a recipient of a checkout process.
6
+ *
7
+ * An instance of the ICheckoutRecipient interface contains
8
+ * information about the recipient, including their
9
+ * first name, last name, email address, phone number, birthdate,
10
+ * and an optional flag indicating if age verification is required.
11
+ *
12
+ * The ICheckoutRecipient interface is intended to be used in checkout
13
+ * processes where the recipient's information is required.
14
+ *
15
+ * @interface
16
+ * @public
17
+ */
18
+ export interface ICheckoutRecipient {
19
+ firstName: string;
20
+ lastName: string;
21
+ email: string;
22
+ phone: string;
23
+ birthDate: string;
24
+ hasAgeVerify?: boolean;
25
+ }
26
+ /**
27
+ * Represents the recipient information for gift options during checkout.
28
+ */
29
+ export interface ICheckoutGiftOptionsRecipient {
30
+ name: string;
31
+ email: string;
32
+ phone: string;
33
+ }
34
+ /**
35
+ * Interface representing the gift options for a checkout process.
36
+ */
37
+ export interface ICheckoutGiftOptions {
38
+ message: string;
39
+ recipient: ICheckoutGiftOptionsRecipient;
40
+ }
41
+ /**
42
+ * Represents the marketing preferences for a checkout.
43
+ *
44
+ * @interface ICheckoutMarketingPreferences
45
+ * @property {boolean} canEmail - Indicates whether the user allows email marketing.
46
+ * @property {boolean} canSms - Indicates whether the user allows SMS marketing.
47
+ */
48
+ export interface ICheckoutMarketingPreferences {
49
+ canEmail: boolean;
50
+ canSms: boolean;
51
+ }
52
+ /**
53
+ * Represents the delivery tip for a checkout.
54
+ *
55
+ * @interface ICheckoutDeliveryTip
56
+ * @property {string} fulfillmentId - The ID of the fulfillment.
57
+ * @property {number} tip - The amount of the tip.
58
+ */
59
+ export interface ICheckoutDeliveryTip {
60
+ fulfillmentId: string;
61
+ tip: number;
62
+ }
63
+ /**
64
+ * This interface defines the parameters required for preparing a checkout.
65
+ * It extends the ICoreParams interface.
66
+ *
67
+ * @interface ICheckoutPrepareParams
68
+ * @extends {ICoreParams}
69
+ */
70
+ export interface ICheckoutPrepareParams extends ICoreParams {
71
+ cartId: string;
72
+ recipient: ICheckoutRecipient;
73
+ billingAddress?: ILoc;
74
+ hasSubstitutionPolicy: boolean;
75
+ isGift: boolean;
76
+ billingSameAsShipping: boolean;
77
+ giftOptions: ICheckoutGiftOptions;
78
+ marketingPreferences: ICheckoutMarketingPreferences;
79
+ deliveryTips?: ICheckoutDeliveryTip[];
80
+ }
81
+ /**
82
+ * Represents a response object for preparing a checkout process.
83
+ *
84
+ * @interface ICheckoutPrepareResponse
85
+ */
86
+ export interface ICheckoutPrepareResponse {
87
+ token: string;
88
+ hasAgeVerify: boolean;
89
+ marketingPreferences: ICheckoutMarketingPreferences;
90
+ hasSubstitutionPolicy: boolean;
91
+ isGift: boolean;
92
+ createdAt: string;
93
+ updatedAt: string;
94
+ billingSameAsShipping: boolean;
95
+ giftOptions: ICheckoutGiftOptions;
96
+ shippingAddress: ILoc;
97
+ billingAddress: ILoc;
98
+ items: ICartItem[];
99
+ amounts: ICartAttributesAmounts;
100
+ retailers: ICartRetailer[];
101
+ cartId: string;
102
+ }
103
+ /**
104
+ * Represents the parameters required for completing a checkout process.
105
+ * @interface
106
+ * @extends ICoreParams
107
+ */
108
+ export interface ICheckoutCompleteParams extends ICoreParams {
109
+ token: string;
110
+ payment: string;
111
+ }
112
+ /**
113
+ * Interface representing the response object after completing the checkout process.
114
+ * @interface
115
+ */
116
+ export interface ICheckoutCompleteResponse {
117
+ order: string;
118
+ }