@liquidcommerce/cloud-sdk 1.3.0 → 1.4.0

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 (36) hide show
  1. package/README.md +371 -119
  2. package/dist/index.cjs +1 -1
  3. package/dist/index.esm.js +1 -1
  4. package/dist/liquidcommerce-cloud-sdk.ssr.js +1 -1
  5. package/dist/types/constants/core.constant.d.ts +8 -0
  6. package/dist/types/core/cart-helper.service.d.ts +1 -1
  7. package/dist/types/core/catalog-helper.service.d.ts +24 -4
  8. package/dist/types/core/checkout-helper.service.d.ts +23 -8
  9. package/dist/types/core/location-helper.service.d.ts +4 -3
  10. package/dist/types/core/payment-provider.service.d.ts +16 -1
  11. package/dist/types/core/singleton.service.d.ts +9 -10
  12. package/dist/types/{enums.d.ts → enums/enums.d.ts} +62 -92
  13. package/dist/types/enums/index.d.ts +2 -0
  14. package/dist/types/enums/taxonomy.d.ts +285 -0
  15. package/dist/types/index.d.ts +2 -0
  16. package/dist/types/interfaces/address.interface.d.ts +86 -1
  17. package/dist/types/interfaces/cart.interface.d.ts +28 -10
  18. package/dist/types/interfaces/catalog.interface.d.ts +268 -8
  19. package/dist/types/interfaces/checkout.interface.d.ts +265 -50
  20. package/dist/types/interfaces/index.d.ts +8 -0
  21. package/dist/types/interfaces/liquid-commerce-client.interface.d.ts +34 -9
  22. package/dist/types/interfaces/payment.interface.d.ts +81 -2
  23. package/dist/types/interfaces/retailer.interface.d.ts +121 -0
  24. package/dist/types/interfaces/user.interface.d.ts +115 -8
  25. package/dist/types/liquid-commerce-client.d.ts +3 -192
  26. package/dist/types/services/address.service.d.ts +2 -18
  27. package/dist/types/services/cart.service.d.ts +1 -1
  28. package/dist/types/services/catalog.service.d.ts +1 -12
  29. package/dist/types/services/checkout.service.d.ts +1 -1
  30. package/dist/types/services/index.d.ts +5 -0
  31. package/dist/types/services/payment.service.d.ts +1 -1
  32. package/dist/types/services/user.service.d.ts +53 -1
  33. package/dist/types/types.d.ts +11 -5
  34. package/package.json +105 -105
  35. package/umd/liquidcommerce-cloud-sdk.min.js +1 -1
  36. package/dist/types/interfaces/catalog.service.interface.d.ts +0 -65
@@ -1,192 +1,5 @@
1
- import { LIQUID_COMMERCE_ENV } from './enums';
2
- import type { ICart, ICartUpdateParams } from './interfaces/cart.interface';
3
- import type { ICatalog, ICatalogParams } from './interfaces/catalog.service.interface';
4
- import type { ICheckoutCompleteParams, ICheckoutCompleteResponse, ICheckoutPrepareParams, ICheckoutPrepareResponse } from './interfaces/checkout.interface';
5
- import type { IAddressMethod, ICartMethod, ICatalogMethod, ICheckoutMethod, ILiquidCommerceClient, IPaymentMethod, IUserMethod } from './interfaces/liquid-commerce-client.interface';
6
- import type { ILiquidPaymentConfig, ILiquidPaymentToken, IPaymentElementEventMap } from './interfaces/payment.interface';
7
- import type { IPurgeResponse, IUser, IUserAddress, IUserAddressParams, IUserPayment, IUserPaymentAddParams, IUserPaymentUpdateParams, IUserSessionParams } from './interfaces/user.interface';
8
- import type { IAddressAutocompleteParams, IAddressAutocompleteResult, IAddressDetailsParams, IAddressDetailsResult } from './services/address.service';
9
- import type { IAvailabilityParams, IAvailabilityResponse } from './services/catalog.service';
10
- import type { IApiResponseWithData, IApiResponseWithoutData, ILiquidCommerceConfig } from './types';
11
- /**
12
- * The LiquidCommerceClient class is a client for interacting with the LiquidCommerce Cloud APIs.
13
- * This client encapsulates the logic for working with various services, including addresses, catalog products,
14
- * carts, users, payments, checkouts, and orders.
15
- *
16
- * The client handles authentication, service initialization, and ensures secure interaction with the
17
- * LiquidCommerce Cloud API by managing token expiration and re-authentication automatically.
18
- *
19
- * @class
20
- * @implements {ILiquidCommerceClient}
21
- */
22
- declare class LiquidCommerceClient implements ILiquidCommerceClient {
23
- private readonly authenticatedClient;
24
- private addressService;
25
- private catalogService;
26
- private cartService;
27
- private userService;
28
- private paymentService;
29
- private checkoutService;
30
- private config;
31
- private singletonManager;
32
- /**
33
- * Creates an instance of LiquidCommerceClient.
34
- *
35
- * @constructor
36
- * @param {string} apiKey - The API key used for authenticating with the LiquidCommerce Cloud API.
37
- * @param {ILiquidCommerceConfig} config - Configuration options including environment settings, base URLs, and other preferences.
38
- */
39
- constructor(apiKey: string, config: ILiquidCommerceConfig);
40
- /**
41
- * Determines the appropriate base URL for the API based on the environment.
42
- *
43
- * @private
44
- * @param {ILiquidCommerceConfig} config - Configuration options.
45
- * @return {string} - The base URL for the selected environment.
46
- */
47
- private determineBaseURL;
48
- /**
49
- * Initializes the client by authenticating with the LiquidCommerce API.
50
- * This method should be called before making any API requests.
51
- *
52
- * @public
53
- * @return {Promise<void>} - Resolves when initialization is successful.
54
- * @throws {Error} - Throws an error if authentication fails.
55
- */
56
- init(): Promise<void>;
57
- /**
58
- * Ensures that the client is authenticated before making API requests.
59
- * If the authentication token is expired, it will attempt to re-authenticate.
60
- *
61
- * @private
62
- * @return {Promise<void>} - Resolves when the client is authenticated.
63
- * @throws {Error} - Throws an error if re-authentication fails.
64
- */
65
- private ensureAuthenticated;
66
- /**
67
- * Address object that provides methods for performing address autocompletion and retrieving address details.
68
- *
69
- * @interface IAddressMethod address
70
- *
71
- * @property {function(Omit<IAddressAutocompleteParams, 'key'>): Promise<IApiResponseWithData<IAddressAutocompleteResult[]>>} autocomplete -
72
- * Method for performing address autocompletion based on the provided parameters.
73
- *
74
- * @property {function(Omit<IAddressDetailsParams, 'key'>): Promise<IApiResponseWithData<IAddressDetailsResult>>} details -
75
- * Method for retrieving address details based on the provided parameters.
76
- */
77
- address: IAddressMethod;
78
- /**
79
- * Catalog object that provides methods for availability and search operations.
80
- *
81
- * @interface ICatalogMethod catalog
82
- *
83
- * @property {function(params: IAvailabilityParams): Promise<IApiResponseWithoutData<IAvailabilityResponse>>} availability -
84
- * Method to check the availability of a specific item in the catalog.
85
- *
86
- * @property {function(params: ICatalogParams): Promise<IApiResponseWithoutData<ICatalog>>} search -
87
- * Method to perform a search in the catalog based on the provided parameters.
88
- *
89
- * @see {@link IApiResponseWithoutData} for the structure of the promise returned by both methods.
90
- */
91
- catalog: ICatalogMethod;
92
- /**
93
- * Represents a cart object with methods for updating and retrieving cart data.
94
- *
95
- * @interface ICartMethod cart
96
- *
97
- * @property {function(id: string): Promise<IApiResponseWithoutData<ICart>>} get -
98
- * Retrieves the cart by its ID, or returns a new cart if no ID is provided.
99
- * @property {function(params: ICartUpdateParams): Promise<IApiResponseWithoutData<ICart>>} update -
100
- * Method to update the cart with the provided parameters.
101
- *
102
- * @see {@link ICartUpdateParams} for the structure of the parameters required to update the cart.
103
- * @see {@link IApiResponseWithoutData} for the structure of the promise returned by both methods.
104
- * @see {@link ICart} for the structure of the cart data returned.
105
- */
106
- cart: ICartMethod;
107
- /**
108
- * User object that provides methods for user-related operations.
109
- *
110
- * @interface IUserMethod user
111
- *
112
- * @property {function(params: IUserSessionParams): Promise<IApiResponseWithData<IUser>>} session -
113
- * Method for creating or updating a user session.
114
- * @property {function(identifier: string): Promise<IApiResponseWithData<IPurgeResponse>>} purge -
115
- * Method for purging a user's data from the system.
116
- * @property {function(params: IUserAddressParams): Promise<IApiResponseWithData<IUserAddress>>} addAddress -
117
- * Method for adding a new address for a user.
118
- * @property {function(params: IUserAddressParams): Promise<IApiResponseWithData<IUserAddress>>} updateAddress -
119
- * Method for updating an existing user's address.
120
- * @property {function(addressId: string): Promise<IApiResponseWithData<IPurgeResponse>>} purgeAddress -
121
- * Method for purging a user's address.
122
- * @property {function(params: IUserPaymentAddParams): Promise<IApiResponseWithData<IUserPayment>>} addPayment -
123
- * Method for adding a new payment method for a user.
124
- * @property {function(params: IUserPaymentUpdateParams): Promise<IApiResponseWithData<IUserPayment>>} updatePayment -
125
- * Method for updating an existing payment method for a user.
126
- * @property {function(customerId: string, paymentId: string): Promise<IApiResponseWithData<IPurgeResponse>>} purgePayment -
127
- * Method for purging a user's payment method.
128
- *
129
- * @see {@link IUserSessionParams} for the structure of the session request parameters.
130
- * @see {@link IUserAddressParams} for the structure of the address add/update request parameters.
131
- * @see {@link IUserPaymentAddParams} for the structure of the payment add request parameters.
132
- * @see {@link IUserPaymentUpdateParams} for the structure of the payment update request parameters.
133
- * @see {@link IUser} for the structure of the user data returned.
134
- * @see {@link IUserAddress} for the structure of the user's address data returned.
135
- * @see {@link IUserPayment} for the structure of the user's payment method data returned.
136
- * @see {@link IPurgeResponse} for the structure of the purge response data.
137
- */
138
- user: IUserMethod;
139
- /**
140
- * Payment object that provides methods for payment-related operations.
141
- *
142
- * @interface IPaymentMethod payment
143
- *
144
- * @property {function(config: ILiquidPaymentConfig): Promise<void>} mount -
145
- * Method for mounting the payment element into the DOM.
146
- *
147
- * @property {function(): Promise<ILiquidPaymentToken>} generateToken -
148
- * Method for generating a payment token for the current payment information.
149
- *
150
- * @property {function(eventType: K, handler: function): void} subscribe -
151
- * Method for subscribing to payment element events.
152
- *
153
- * @property {function(eventType: K, handler?: function): void} unsubscribe -
154
- * Method for unsubscribing from payment element events.
155
- *
156
- * @property {function(): void} collapse -
157
- * Method for collapsing the payment element if it's expanded.
158
- *
159
- * @property {function(): void} unmount -
160
- * Method for removing the payment element from the DOM.
161
- *
162
- * @property {function(): void} destroy -
163
- * Method for completely removing the payment element and cleaning up associated resources.
164
- *
165
- * @see {@link ILiquidPaymentConfig} Represents the configuration for Liquid payment.
166
- * @see {@link ILiquidPaymentToken} Represents a payment token for liquid payments.
167
- * @see {@link ILiquidPaymentError} Represents an error that occurs during a liquid payment.
168
- * @see {@link ILiquidPaymentElementOptions} The options for the payment element.
169
- * @see {@link IPaymentElementEventMap} The map of payment element event types to their corresponding event objects.
170
- */
171
- payment: IPaymentMethod;
172
- /**
173
- * Checkout object that provides methods for checkout-related operations.
174
- *
175
- * @interface ICheckoutMethod checkout
176
- *
177
- * @property {function(params: ICheckoutPrepareParams): Promise<IApiResponseWithoutData<ICheckoutPrepareResponse>>} prepare -
178
- * Method to prepare a checkout based on the provided parameters.
179
- * @property {function(params: ICheckoutCompleteParams): Promise<IApiResponseWithoutData<ICheckoutCompleteResponse>>} complete -
180
- * Method completes a checkout process with the provided token and payment information.
181
- *
182
- * @see {@link ICheckoutPrepareParams} for the structure of the prepare request parameters.
183
- * @see {@link IApiResponseWithoutData} for the structure of the promise returned by the prepare method.
184
- * @see {@link ICheckoutPrepareResponse} for the structure of the prepared checkout data returned.
185
- * @see {@link ICheckoutCompleteParams} for the structure of the complete request parameters.
186
- * @see {@link ICheckoutCompleteResponse} for the structure of the complete checkout data returned.
187
- */
188
- checkout: ICheckoutMethod;
189
- }
1
+ import type { ILiquidCommerceClient } from './interfaces';
2
+ import type { ILiquidCommerceConfig } from './types';
190
3
  /**
191
4
  * Factory function to create and initialize a LiquidCommerceClient instance.
192
5
  *
@@ -203,6 +16,4 @@ declare class LiquidCommerceClient implements ILiquidCommerceClient {
203
16
  *
204
17
  * @throws {Error} - Throws an error if the client initialization fails.
205
18
  */
206
- export declare function LiquidCommerce(apiKey: string, config: ILiquidCommerceConfig): Promise<LiquidCommerceClient>;
207
- export { LIQUID_COMMERCE_ENV };
208
- export type { IAddressAutocompleteParams, IAddressAutocompleteResult, IAddressDetailsParams, IAddressDetailsResult, IAddressMethod, IApiResponseWithData, IApiResponseWithoutData, IAvailabilityParams, IAvailabilityResponse, ICart, ICartMethod, ICartUpdateParams, ICatalog, ICatalogMethod, ICatalogParams, ICheckoutCompleteParams, ICheckoutCompleteResponse, ICheckoutMethod, ICheckoutPrepareParams, ICheckoutPrepareResponse, ILiquidCommerceClient, ILiquidCommerceConfig, ILiquidPaymentConfig, ILiquidPaymentToken, IPaymentElementEventMap, IPaymentMethod, IPurgeResponse, IUser, IUserAddress, IUserAddressParams, IUserMethod, IUserPayment, IUserPaymentAddParams, IUserPaymentUpdateParams, IUserSessionParams, };
19
+ export declare function LiquidCommerce(apiKey: string, config: ILiquidCommerceConfig): Promise<ILiquidCommerceClient>;
@@ -1,21 +1,6 @@
1
1
  import type { AuthenticatedService } from '../core';
2
- import type { ICoords } from '../interfaces/address.interface';
3
- import type { IApiResponseWithData, ICoreParams } from '../types';
4
- export interface IAddressAutocompleteParams extends ICoreParams {
5
- input: string;
6
- }
7
- export interface IAddressAutocompleteResult {
8
- id: string;
9
- description: string;
10
- }
11
- export interface IAddressDetailsParams extends ICoreParams {
12
- id: string;
13
- }
14
- export interface IAddressDetailsResult {
15
- formattedAddress: string;
16
- coords: ICoords;
17
- }
18
- type AddressServiceResponse<T> = IApiResponseWithData<T>;
2
+ import type { IAddressAutocompleteParams, IAddressAutocompleteResult, IAddressDetailsParams, IAddressDetailsResult } from '../interfaces';
3
+ import type { AddressServiceResponse } from '../types';
19
4
  /**
20
5
  * Represents a service for interacting with address-related functionality.
21
6
  */
@@ -41,4 +26,3 @@ export declare class AddressService {
41
26
  */
42
27
  details(params: IAddressDetailsParams, googlePlacesApiKey: string): Promise<AddressServiceResponse<IAddressDetailsResult>>;
43
28
  }
44
- export {};
@@ -1,5 +1,5 @@
1
1
  import type { AuthenticatedService, CartHelperService } from '../core';
2
- import type { ICart, ICartUpdateParams } from '../interfaces/cart.interface';
2
+ import type { ICart, ICartUpdateParams } from '../interfaces';
3
3
  import type { IApiResponseWithoutData } from '../types';
4
4
  /**
5
5
  * The CartService class is responsible for fetching and updating cart data from the server.
@@ -1,17 +1,6 @@
1
1
  import type { AuthenticatedService, CatalogHelperService } from '../core';
2
- import type { ILocBase } from '../interfaces/address.interface';
3
- import type { IProduct } from '../interfaces/catalog.interface';
4
- import type { ICatalog, ICatalogParams } from '../interfaces/catalog.service.interface';
5
- import type { IRetailer } from '../interfaces/retailer.interface';
2
+ import type { IAvailabilityParams, IAvailabilityResponse, ICatalog, ICatalogParams } from '../interfaces';
6
3
  import type { IApiResponseWithoutData } from '../types';
7
- export interface IAvailabilityParams extends ILocBase {
8
- upcs: string[];
9
- shouldShowOffHours?: boolean;
10
- }
11
- export interface IAvailabilityResponse {
12
- products: IProduct[];
13
- retailers: IRetailer[];
14
- }
15
4
  /**
16
5
  * The CatalogService class provides methods for interacting with the catalog API.
17
6
  */
@@ -1,5 +1,5 @@
1
1
  import type { AuthenticatedService, CheckoutHelperService } from '../core';
2
- import type { ICheckoutCompleteParams, ICheckoutCompleteResponse, ICheckoutPrepareParams, ICheckoutPrepareResponse } from '../interfaces/checkout.interface';
2
+ import type { ICheckoutCompleteParams, ICheckoutCompleteResponse, ICheckoutPrepareParams, ICheckoutPrepareResponse } from '../interfaces';
3
3
  import type { IApiResponseWithoutData } from '../types';
4
4
  /**
5
5
  * A service for managing the checkout process.
@@ -0,0 +1,5 @@
1
+ export * from './address.service';
2
+ export * from './catalog.service';
3
+ export * from './checkout.service';
4
+ export * from './payment.service';
5
+ export * from './user.service';
@@ -1,5 +1,5 @@
1
1
  import type { PaymentProviderService } from '../core';
2
- import type { ILiquidPaymentConfig, ILiquidPaymentError, ILiquidPaymentToken, IPaymentElementEventMap } from '../interfaces/payment.interface';
2
+ import type { ILiquidPaymentConfig, ILiquidPaymentError, ILiquidPaymentToken, IPaymentElementEventMap } from '../interfaces';
3
3
  /**
4
4
  * The PaymentService class provides methods for interacting with payment functionality.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import type { AuthenticatedService } from '../core';
2
- import type { IPurgeResponse, IUser, IUserAddress, IUserAddressParams, IUserPayment, IUserPaymentAddParams, IUserPaymentUpdateParams, IUserSessionParams } from '../interfaces/user.interface';
2
+ import type { BaseUser, IPurgeResponse, IUser, IUserAddress, IUserAddressParams, IUserPayment, IUserPaymentAddParams, IUserPaymentUpdateParams, IUserSessionParams } from '../interfaces';
3
3
  import type { IApiResponseWithData } from '../types';
4
4
  /**
5
5
  * A class representing a user service.
@@ -16,6 +16,14 @@ export declare class UserService {
16
16
  * @throws {Error} If the session creation/update request fails or if neither id nor email is provided.
17
17
  */
18
18
  createOrUpdateSession(params: IUserSessionParams): Promise<IApiResponseWithData<IUser>>;
19
+ /**
20
+ * Fetches user data from the API using the provided identifier.
21
+ *
22
+ * @param {string} identifier - The unique identifier for the user.
23
+ * @return {Promise<IApiResponseWithData<BaseUser>>} The API response containing
24
+ * user data omitting the session field.
25
+ */
26
+ fetchUser(identifier: string): Promise<IApiResponseWithData<BaseUser>>;
19
27
  /**
20
28
  * Purges a user's data from the system.
21
29
  *
@@ -24,6 +32,13 @@ export declare class UserService {
24
32
  * @throws {Error} If the purge request fails or if the identifier is not provided.
25
33
  */
26
34
  purge(identifier: string): Promise<IApiResponseWithData<IPurgeResponse>>;
35
+ /**
36
+ * Adds a new address for a user.
37
+ *
38
+ * @param {IUserAddressParams} params - The parameters containing the user's address details.
39
+ * @return {Promise<IApiResponseWithData<IUserAddress>>} - A promise that resolves with the API response containing the added user address.
40
+ * @throws {Error} If the addAddress request fails or if the required parameters are not provided.
41
+ */
27
42
  addAddress(params: IUserAddressParams): Promise<IApiResponseWithData<IUserAddress>>;
28
43
  /**
29
44
  * Updates or creates a new address for a user.
@@ -33,6 +48,43 @@ export declare class UserService {
33
48
  * @throws {Error} If the address update request fails or if required parameters are missing.
34
49
  */
35
50
  updateAddress(params: IUserAddressParams): Promise<IApiResponseWithData<IUserAddress>>;
51
+ /**
52
+ * Validates the parameters required for updating a user address.
53
+ *
54
+ * @param {IUserAddressParams} params - The parameters to be validated for the address update. This should include
55
+ * at least the user ID and one of the following: address object, latitude and longitude, or a Google places ID.
56
+ * @return {IUserAddressParams} Throws an error if the required parameters are not provided.
57
+ */
58
+ private validateAddressParams;
59
+ /**
60
+ * Checks if the given user address parameters contain valid customer ID and user ID.
61
+ *
62
+ * @param {IUserAddressParams} params - The user address parameters object containing customerId and userId.
63
+ * @return {boolean} - Returns true if the customerId or userId is missing or not a string, otherwise returns false.
64
+ */
65
+ private hasUser;
66
+ /**
67
+ * Checks if the given user address object has a valid address.
68
+ *
69
+ * @param {IUserAddressParams} params - The user address parameters object containing address details.
70
+ *
71
+ * @return {boolean} Returns true if the user address object is valid; otherwise, returns false.
72
+ */
73
+ private hasUserAddressObj;
74
+ /**
75
+ * Checks if the user address coordinates (latitude and longitude) are not present or not of type 'number'.
76
+ *
77
+ * @param {IUserAddressParams} params - The user address parameters containing latitude and longitude.
78
+ * @return {boolean} Returns true if latitude or longitude are not provided or are not numbers, otherwise returns false.
79
+ */
80
+ private hasUserAddressCoords;
81
+ /**
82
+ * Checks whether the user address parameters contain a valid placesId.
83
+ *
84
+ * @param {IUserAddressParams} params - The user address parameters containing placesId.
85
+ * @return {boolean} Returns true if placesId is missing or not a string, false otherwise.
86
+ */
87
+ private hasUserAddressPlacesId;
36
88
  /**
37
89
  * Purges an address for a user.
38
90
  *
@@ -1,9 +1,16 @@
1
- import type { ENUM_BEER, ENUM_FOOD, ENUM_MERCHANDISE, ENUM_NON_ALCOHOLIC, ENUM_READY_TO_DRINK, ENUM_SPIRITS, ENUM_WINE, LIQUID_COMMERCE_ENV } from './enums';
1
+ import type { ENUM_BEER, ENUM_FOOD, ENUM_MERCHANDISE, ENUM_MISCELLANEOUS, ENUM_NON_ALCOHOLIC, ENUM_READY_TO_DRINK, ENUM_SPIRITS, ENUM_WINE, LIQUID_COMMERCE_ENV } from './enums';
2
2
  export interface ICoreParams {
3
3
  refresh?: boolean;
4
+ isLean?: boolean;
5
+ isLegacy?: boolean;
6
+ }
7
+ export interface IAuth {
8
+ token: string;
9
+ exp: number;
10
+ type: 'ACCESS_TOKEN';
4
11
  }
5
12
  export interface IAuthResponse {
6
- auth?: IAuthResponse;
13
+ auth?: IAuth;
7
14
  }
8
15
  export interface IResponseMetadata {
9
16
  languages: string[];
@@ -24,8 +31,6 @@ export type IApiResponseWithData<T> = IApiResponseBase & {
24
31
  export type IApiResponseWithoutData<T> = IApiResponseBase & {
25
32
  [K in keyof T]: T[K];
26
33
  };
27
- export type IApiResponse<T> = IApiResponseWithData<T> | IApiResponseWithoutData<T>;
28
- export declare function isApiResponseWithData<T>(response: IApiResponse<T>): response is IApiResponseWithData<T>;
29
34
  export interface ILiquidCommerceConfig {
30
35
  googlePlacesApiKey: string;
31
36
  env: LIQUID_COMMERCE_ENV;
@@ -33,4 +38,5 @@ export interface ILiquidCommerceConfig {
33
38
  stage?: string;
34
39
  };
35
40
  }
36
- export type LiquidTaxonomy = ENUM_BEER | ENUM_FOOD | ENUM_MERCHANDISE | ENUM_NON_ALCOHOLIC | ENUM_READY_TO_DRINK | ENUM_SPIRITS | ENUM_WINE;
41
+ export type LiquidTaxonomy = ENUM_BEER | ENUM_FOOD | ENUM_MERCHANDISE | ENUM_MISCELLANEOUS | ENUM_NON_ALCOHOLIC | ENUM_READY_TO_DRINK | ENUM_SPIRITS | ENUM_WINE;
42
+ export type AddressServiceResponse<T> = IApiResponseWithData<T>;
package/package.json CHANGED
@@ -1,108 +1,108 @@
1
1
  {
2
- "name": "@liquidcommerce/cloud-sdk",
3
- "version": "1.3.0",
4
- "description": "LiquidCommerce Cloud SDK",
5
- "main": "./dist/index.cjs",
6
- "module": "./dist/index.esm.js",
7
- "browser": "./umd/liquidcommerce-cloud-sdk.js",
8
- "types": "./dist/types/index.d.ts",
9
- "packageManager": "pnpm@9.5.0",
10
- "exports": {
11
- ".": {
12
- "import": {
13
- "types": "./dist/types/index.d.ts",
14
- "default": "./dist/index.esm.js"
15
- },
16
- "require": {
17
- "types": "./dist/types/index.d.ts",
18
- "default": "./dist/index.cjs"
19
- },
20
- "node": {
21
- "types": "./dist/types/index.d.ts",
22
- "default": "./dist/liquidcommerce-cloud-sdk.ssr.js"
23
- },
24
- "browser": {
25
- "types": "./dist/types/index.d.ts",
26
- "default": "./umd/liquidcommerce-cloud-sdk.js"
27
- }
28
- }
29
- },
30
- "files": [
31
- "dist",
32
- "umd"
33
- ],
34
- "type": "module",
35
- "sideEffects": false,
36
- "scripts": {
37
- "build": "rollup -c --environment NODE_ENV:production",
38
- "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
39
- "dev": "rollup -c --environment NODE_ENV:development -w",
40
- "test": "vitest run",
41
- "test:watch": "vitest",
42
- "test:coverage": "vitest run --coverage",
43
- "lint": "eslint \"src/**/*.ts\"",
44
- "format": "prettier --write \"src/**/*.ts\"",
45
- "docs": "typedoc --out docs src",
46
- "prepublishOnly": "pnpm run build"
47
- },
48
- "keywords": [
49
- "liquidcommerce",
50
- "ecommerce",
51
- "alcohol",
52
- "beverage",
53
- "cloud-sdk"
54
- ],
55
- "author": "ReserveBar Tech",
56
- "license": "",
57
- "dependencies": {
58
- "@stripe/stripe-js": "^4.4.0"
59
- },
60
- "devDependencies": {
61
- "@eslint/eslintrc": "^3.1.0",
62
- "@eslint/js": "^9.9.1",
63
- "@rollup/plugin-commonjs": "^26.0.1",
64
- "@rollup/plugin-node-resolve": "^15.2.3",
65
- "@rollup/plugin-replace": "^5.0.7",
66
- "@semantic-release/changelog": "^6.0.3",
67
- "@semantic-release/git": "^10.0.1",
68
- "@semantic-release/github": "^10.1.7",
69
- "@semantic-release/npm": "^12.0.1",
70
- "@types/eslint__js": "^8.42.3",
71
- "@types/node": "^20.0.0",
72
- "@typescript-eslint/eslint-plugin": "^8.2.0",
73
- "@typescript-eslint/parser": "^8.2.0",
74
- "@vitest/coverage-v8": "^1.0.0",
75
- "conventional-changelog-cli": "^5.0.0",
76
- "dotenv": "^16.4.5",
77
- "eslint": "^9.9.1",
78
- "eslint-config-prettier": "^9.1.0",
79
- "eslint-import-resolver-typescript": "^3.6.1",
80
- "eslint-plugin-import": "^2.29.1",
81
- "eslint-plugin-simple-import-sort": "^12.1.1",
82
- "eslint-plugin-sonarjs": "^2.0.1",
83
- "eslint-plugin-unicorn": "^55.0.0",
84
- "husky": "^9.1.5",
85
- "jest": "^29.7.0",
86
- "prettier": "^3.3.3",
87
- "rollup": "^4.21.0",
88
- "rollup-plugin-livereload": "^2.0.5",
89
- "rollup-plugin-serve": "^1.1.1",
90
- "rollup-plugin-terser": "^7.0.2",
91
- "rollup-plugin-typescript2": "^0.36.0",
92
- "semantic-release": "^24.1.0",
93
- "ts-jest": "^29.2.5",
94
- "typedoc": "^0.26.6",
95
- "typescript": "^5.5.4",
96
- "typescript-eslint": "^8.2.0",
97
- "vite": "^5.0.0",
98
- "vitest": "^1.0.0"
99
- },
100
- "engines": {
101
- "node": ">=20"
102
- },
103
- "pnpm": {
104
- "peerDependencyRules": {
105
- "ignoreMissing": []
106
- }
2
+ "name": "@liquidcommerce/cloud-sdk",
3
+ "version": "1.4.0",
4
+ "description": "LiquidCommerce Cloud SDK",
5
+ "main": "./dist/index.cjs",
6
+ "module": "./dist/index.esm.js",
7
+ "browser": "./umd/liquidcommerce-cloud-sdk.js",
8
+ "types": "./dist/types/index.d.ts",
9
+ "packageManager": "pnpm@9.5.0",
10
+ "exports": {
11
+ ".": {
12
+ "import": {
13
+ "types": "./dist/types/index.d.ts",
14
+ "default": "./dist/index.esm.js"
15
+ },
16
+ "require": {
17
+ "types": "./dist/types/index.d.ts",
18
+ "default": "./dist/index.cjs"
19
+ },
20
+ "node": {
21
+ "types": "./dist/types/index.d.ts",
22
+ "default": "./dist/liquidcommerce-cloud-sdk.ssr.js"
23
+ },
24
+ "browser": {
25
+ "types": "./dist/types/index.d.ts",
26
+ "default": "./umd/liquidcommerce-cloud-sdk.js"
27
+ }
107
28
  }
29
+ },
30
+ "files": [
31
+ "dist",
32
+ "umd"
33
+ ],
34
+ "type": "module",
35
+ "sideEffects": false,
36
+ "scripts": {
37
+ "build": "rollup -c --environment NODE_ENV:production",
38
+ "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
39
+ "dev": "rollup -c --environment NODE_ENV:development -w",
40
+ "test": "vitest run",
41
+ "test:watch": "vitest",
42
+ "test:coverage": "vitest run --coverage",
43
+ "lint": "eslint \"src/**/*.ts\"",
44
+ "format": "prettier --write \"src/**/*.ts\"",
45
+ "docs": "typedoc --out docs src",
46
+ "prepublishOnly": "pnpm run build"
47
+ },
48
+ "keywords": [
49
+ "liquidcommerce",
50
+ "ecommerce",
51
+ "alcohol",
52
+ "beverage",
53
+ "cloud-sdk"
54
+ ],
55
+ "author": "ReserveBar Tech",
56
+ "license": "",
57
+ "dependencies": {
58
+ "@stripe/stripe-js": "^4.4.0"
59
+ },
60
+ "devDependencies": {
61
+ "@eslint/eslintrc": "^3.1.0",
62
+ "@eslint/js": "^9.9.1",
63
+ "@rollup/plugin-commonjs": "^26.0.1",
64
+ "@rollup/plugin-node-resolve": "^15.2.3",
65
+ "@rollup/plugin-replace": "^5.0.7",
66
+ "@semantic-release/changelog": "^6.0.3",
67
+ "@semantic-release/git": "^10.0.1",
68
+ "@semantic-release/github": "^10.1.7",
69
+ "@semantic-release/npm": "^12.0.1",
70
+ "@types/eslint__js": "^8.42.3",
71
+ "@types/node": "^20.0.0",
72
+ "@typescript-eslint/eslint-plugin": "^8.2.0",
73
+ "@typescript-eslint/parser": "^8.2.0",
74
+ "@vitest/coverage-v8": "^1.0.0",
75
+ "conventional-changelog-cli": "^5.0.0",
76
+ "dotenv": "^16.4.5",
77
+ "eslint": "^9.9.1",
78
+ "eslint-config-prettier": "^9.1.0",
79
+ "eslint-import-resolver-typescript": "^3.6.1",
80
+ "eslint-plugin-import": "^2.29.1",
81
+ "eslint-plugin-simple-import-sort": "^12.1.1",
82
+ "eslint-plugin-sonarjs": "^2.0.1",
83
+ "eslint-plugin-unicorn": "^55.0.0",
84
+ "husky": "^9.1.5",
85
+ "jest": "^29.7.0",
86
+ "prettier": "^3.3.3",
87
+ "rollup": "^4.21.0",
88
+ "rollup-plugin-livereload": "^2.0.5",
89
+ "rollup-plugin-serve": "^1.1.1",
90
+ "rollup-plugin-terser": "^7.0.2",
91
+ "rollup-plugin-typescript2": "^0.36.0",
92
+ "semantic-release": "^24.1.0",
93
+ "ts-jest": "^29.2.5",
94
+ "typedoc": "^0.26.6",
95
+ "typescript": "^5.5.4",
96
+ "typescript-eslint": "^8.2.0",
97
+ "vite": "^5.0.0",
98
+ "vitest": "^1.0.0"
99
+ },
100
+ "engines": {
101
+ "node": ">=20"
102
+ },
103
+ "pnpm": {
104
+ "peerDependencyRules": {
105
+ "ignoreMissing": []
106
+ }
107
+ }
108
108
  }