@cimplify/sdk 0.6.7 → 0.6.9

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/dist/react.d.mts CHANGED
@@ -1,8 +1,8 @@
1
- import { C as CimplifyClient, _ as ProcessCheckoutResult, a0 as CheckoutStatus, a1 as CheckoutStatusContext, cT as Location, cQ as Business, aL as Product, aM as ProductWithDetails, a_ as Category, bH as BundleSelectionInput, bi as ComponentSelectionInput, cj as Order, u as CimplifyElements, y as ElementsOptions, eh as AuthenticatedData, ed as AddressInfo, ee as PaymentMethodInfo, ej as ElementsCheckoutResult, Z as ProcessCheckoutOptions } from './client-B4etj3AD.mjs';
1
+ import { C as CimplifyClient, _ as ProcessCheckoutResult, a0 as CheckoutStatus, a1 as CheckoutStatusContext, cT as Location, cQ as Business, aL as Product, aM as ProductWithDetails, a_ as Category, bH as BundleSelectionInput, bi as ComponentSelectionInput, cj as Order, b0 as Collection, b7 as BundleWithDetails, be as CompositeWithDetails, bj as CompositePriceResult, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, u as CimplifyElements, y as ElementsOptions, eh as AuthenticatedData, ed as AddressInfo, ee as PaymentMethodInfo, ej as ElementsCheckoutResult, Z as ProcessCheckoutOptions } from './client-vmXPt1j0.mjs';
2
2
  import React, { ReactNode } from 'react';
3
+ import { h as CimplifyError, C as CurrencyCode } from './payment-Cu75tmUc.mjs';
3
4
  import { A as AdSlot, a as AdPosition, e as AdContextValue } from './ads-t3FBTU8p.mjs';
4
5
  export { c as AdConfig } from './ads-t3FBTU8p.mjs';
5
- import { e as CimplifyError } from './payment-pjpfIKX8.mjs';
6
6
 
7
7
  interface UserIdentity {
8
8
  uid: string;
@@ -221,6 +221,101 @@ interface UseLocationsResult {
221
221
  }
222
222
  declare function useLocations(options?: UseLocationsOptions): UseLocationsResult;
223
223
 
224
+ interface UseCollectionsOptions {
225
+ client?: CimplifyClient;
226
+ enabled?: boolean;
227
+ }
228
+ interface UseCollectionsResult {
229
+ collections: Collection[];
230
+ isLoading: boolean;
231
+ error: CimplifyError | null;
232
+ refetch: () => Promise<void>;
233
+ }
234
+ declare function useCollections(options?: UseCollectionsOptions): UseCollectionsResult;
235
+
236
+ interface UseCollectionOptions {
237
+ client?: CimplifyClient;
238
+ enabled?: boolean;
239
+ }
240
+ interface UseCollectionResult {
241
+ collection: Collection | null;
242
+ products: Product[];
243
+ isLoading: boolean;
244
+ error: CimplifyError | null;
245
+ refetch: () => Promise<void>;
246
+ }
247
+ declare function useCollection(idOrSlug: string | null | undefined, options?: UseCollectionOptions): UseCollectionResult;
248
+
249
+ interface UseBundleOptions {
250
+ client?: CimplifyClient;
251
+ enabled?: boolean;
252
+ }
253
+ interface UseBundleResult {
254
+ bundle: BundleWithDetails | null;
255
+ isLoading: boolean;
256
+ error: CimplifyError | null;
257
+ refetch: () => Promise<void>;
258
+ }
259
+ declare function useBundle(idOrSlug: string | null | undefined, options?: UseBundleOptions): UseBundleResult;
260
+
261
+ interface UseCompositeOptions {
262
+ client?: CimplifyClient;
263
+ enabled?: boolean;
264
+ byProductId?: boolean;
265
+ }
266
+ interface UseCompositeResult {
267
+ composite: CompositeWithDetails | null;
268
+ isLoading: boolean;
269
+ error: CimplifyError | null;
270
+ refetch: () => Promise<void>;
271
+ calculatePrice: (selections: ComponentSelectionInput[], locationId?: string) => Promise<CompositePriceResult | null>;
272
+ priceResult: CompositePriceResult | null;
273
+ isPriceLoading: boolean;
274
+ }
275
+ declare function useComposite(idOrProductId: string | null | undefined, options?: UseCompositeOptions): UseCompositeResult;
276
+
277
+ interface UseSearchOptions {
278
+ client?: CimplifyClient;
279
+ minLength?: number;
280
+ debounceMs?: number;
281
+ limit?: number;
282
+ category?: string;
283
+ }
284
+ interface UseSearchResult {
285
+ results: Product[];
286
+ isLoading: boolean;
287
+ error: CimplifyError | null;
288
+ query: string;
289
+ setQuery: (query: string) => void;
290
+ clear: () => void;
291
+ }
292
+ declare function useSearch(options?: UseSearchOptions): UseSearchResult;
293
+
294
+ interface UseQuoteOptions {
295
+ client?: CimplifyClient;
296
+ enabled?: boolean;
297
+ autoRefresh?: boolean;
298
+ refreshBeforeExpiryMs?: number;
299
+ }
300
+ interface UseQuoteInput {
301
+ productId: string;
302
+ variantId?: string;
303
+ locationId?: string;
304
+ quantity?: number;
305
+ addOnOptionIds?: string[];
306
+ bundleSelections?: QuoteBundleSelectionInput[];
307
+ compositeSelections?: QuoteCompositeSelectionInput[];
308
+ }
309
+ interface UseQuoteResult {
310
+ quote: PriceQuote | null;
311
+ isLoading: boolean;
312
+ error: CimplifyError | null;
313
+ refresh: () => Promise<void>;
314
+ isExpired: boolean;
315
+ messages: QuoteUiMessage[];
316
+ }
317
+ declare function useQuote(input: UseQuoteInput | null | undefined, options?: UseQuoteOptions): UseQuoteResult;
318
+
224
319
  declare function useElements(): CimplifyElements | null;
225
320
  declare function useElementsReady(): boolean;
226
321
  interface ElementsProviderProps {
@@ -257,7 +352,7 @@ interface AddressElementProps extends BaseElementProps {
257
352
  declare function AddressElement({ className, style, mode, onReady, onChange, onError, }: AddressElementProps): React.ReactElement | null;
258
353
  interface PaymentElementProps extends BaseElementProps {
259
354
  amount?: number;
260
- currency?: string;
355
+ currency?: CurrencyCode;
261
356
  onChange?: (data: {
262
357
  paymentMethod: PaymentMethodInfo;
263
358
  saveToLink: boolean;
@@ -277,4 +372,4 @@ declare function useCheckout(): {
277
372
  isLoading: boolean;
278
373
  };
279
374
 
280
- export { Ad, AdPosition, type AdProps, AdProvider, AdSlot, type AddToCartOptions, AddressElement, AuthElement, CimplifyCheckout, type CimplifyCheckoutProps, type CimplifyContextValue, CimplifyProvider, type CimplifyProviderProps, ElementsProvider, PaymentElement, type UseCartItem, type UseCartOptions, type UseCartResult, type UseCategoriesOptions, type UseCategoriesResult, type UseLocationsOptions, type UseLocationsResult, type UseOrderOptions, type UseOrderResult, type UseProductOptions, type UseProductResult, type UseProductsOptions, type UseProductsResult, useAds, useCart, useCategories, useCheckout, useCimplify, useElements, useElementsReady, useLocations, useOptionalCimplify, useOrder, useProduct, useProducts };
375
+ export { Ad, AdPosition, type AdProps, AdProvider, AdSlot, type AddToCartOptions, AddressElement, AuthElement, CimplifyCheckout, type CimplifyCheckoutProps, type CimplifyContextValue, CimplifyProvider, type CimplifyProviderProps, ElementsProvider, PaymentElement, type UseBundleOptions, type UseBundleResult, type UseCartItem, type UseCartOptions, type UseCartResult, type UseCategoriesOptions, type UseCategoriesResult, type UseCollectionOptions, type UseCollectionResult, type UseCollectionsOptions, type UseCollectionsResult, type UseCompositeOptions, type UseCompositeResult, type UseLocationsOptions, type UseLocationsResult, type UseOrderOptions, type UseOrderResult, type UseProductOptions, type UseProductResult, type UseProductsOptions, type UseProductsResult, type UseQuoteInput, type UseQuoteOptions, type UseQuoteResult, type UseSearchOptions, type UseSearchResult, useAds, useBundle, useCart, useCategories, useCheckout, useCimplify, useCollection, useCollections, useComposite, useElements, useElementsReady, useLocations, useOptionalCimplify, useOrder, useProduct, useProducts, useQuote, useSearch };
package/dist/react.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { C as CimplifyClient, _ as ProcessCheckoutResult, a0 as CheckoutStatus, a1 as CheckoutStatusContext, cT as Location, cQ as Business, aL as Product, aM as ProductWithDetails, a_ as Category, bH as BundleSelectionInput, bi as ComponentSelectionInput, cj as Order, u as CimplifyElements, y as ElementsOptions, eh as AuthenticatedData, ed as AddressInfo, ee as PaymentMethodInfo, ej as ElementsCheckoutResult, Z as ProcessCheckoutOptions } from './client-CYVVuP5J.js';
1
+ import { C as CimplifyClient, _ as ProcessCheckoutResult, a0 as CheckoutStatus, a1 as CheckoutStatusContext, cT as Location, cQ as Business, aL as Product, aM as ProductWithDetails, a_ as Category, bH as BundleSelectionInput, bi as ComponentSelectionInput, cj as Order, b0 as Collection, b7 as BundleWithDetails, be as CompositeWithDetails, bj as CompositePriceResult, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, u as CimplifyElements, y as ElementsOptions, eh as AuthenticatedData, ed as AddressInfo, ee as PaymentMethodInfo, ej as ElementsCheckoutResult, Z as ProcessCheckoutOptions } from './client-COpV6Yuu.js';
2
2
  import React, { ReactNode } from 'react';
3
+ import { h as CimplifyError, C as CurrencyCode } from './payment-Cu75tmUc.js';
3
4
  import { A as AdSlot, a as AdPosition, e as AdContextValue } from './ads-t3FBTU8p.js';
4
5
  export { c as AdConfig } from './ads-t3FBTU8p.js';
5
- import { e as CimplifyError } from './payment-pjpfIKX8.js';
6
6
 
7
7
  interface UserIdentity {
8
8
  uid: string;
@@ -221,6 +221,101 @@ interface UseLocationsResult {
221
221
  }
222
222
  declare function useLocations(options?: UseLocationsOptions): UseLocationsResult;
223
223
 
224
+ interface UseCollectionsOptions {
225
+ client?: CimplifyClient;
226
+ enabled?: boolean;
227
+ }
228
+ interface UseCollectionsResult {
229
+ collections: Collection[];
230
+ isLoading: boolean;
231
+ error: CimplifyError | null;
232
+ refetch: () => Promise<void>;
233
+ }
234
+ declare function useCollections(options?: UseCollectionsOptions): UseCollectionsResult;
235
+
236
+ interface UseCollectionOptions {
237
+ client?: CimplifyClient;
238
+ enabled?: boolean;
239
+ }
240
+ interface UseCollectionResult {
241
+ collection: Collection | null;
242
+ products: Product[];
243
+ isLoading: boolean;
244
+ error: CimplifyError | null;
245
+ refetch: () => Promise<void>;
246
+ }
247
+ declare function useCollection(idOrSlug: string | null | undefined, options?: UseCollectionOptions): UseCollectionResult;
248
+
249
+ interface UseBundleOptions {
250
+ client?: CimplifyClient;
251
+ enabled?: boolean;
252
+ }
253
+ interface UseBundleResult {
254
+ bundle: BundleWithDetails | null;
255
+ isLoading: boolean;
256
+ error: CimplifyError | null;
257
+ refetch: () => Promise<void>;
258
+ }
259
+ declare function useBundle(idOrSlug: string | null | undefined, options?: UseBundleOptions): UseBundleResult;
260
+
261
+ interface UseCompositeOptions {
262
+ client?: CimplifyClient;
263
+ enabled?: boolean;
264
+ byProductId?: boolean;
265
+ }
266
+ interface UseCompositeResult {
267
+ composite: CompositeWithDetails | null;
268
+ isLoading: boolean;
269
+ error: CimplifyError | null;
270
+ refetch: () => Promise<void>;
271
+ calculatePrice: (selections: ComponentSelectionInput[], locationId?: string) => Promise<CompositePriceResult | null>;
272
+ priceResult: CompositePriceResult | null;
273
+ isPriceLoading: boolean;
274
+ }
275
+ declare function useComposite(idOrProductId: string | null | undefined, options?: UseCompositeOptions): UseCompositeResult;
276
+
277
+ interface UseSearchOptions {
278
+ client?: CimplifyClient;
279
+ minLength?: number;
280
+ debounceMs?: number;
281
+ limit?: number;
282
+ category?: string;
283
+ }
284
+ interface UseSearchResult {
285
+ results: Product[];
286
+ isLoading: boolean;
287
+ error: CimplifyError | null;
288
+ query: string;
289
+ setQuery: (query: string) => void;
290
+ clear: () => void;
291
+ }
292
+ declare function useSearch(options?: UseSearchOptions): UseSearchResult;
293
+
294
+ interface UseQuoteOptions {
295
+ client?: CimplifyClient;
296
+ enabled?: boolean;
297
+ autoRefresh?: boolean;
298
+ refreshBeforeExpiryMs?: number;
299
+ }
300
+ interface UseQuoteInput {
301
+ productId: string;
302
+ variantId?: string;
303
+ locationId?: string;
304
+ quantity?: number;
305
+ addOnOptionIds?: string[];
306
+ bundleSelections?: QuoteBundleSelectionInput[];
307
+ compositeSelections?: QuoteCompositeSelectionInput[];
308
+ }
309
+ interface UseQuoteResult {
310
+ quote: PriceQuote | null;
311
+ isLoading: boolean;
312
+ error: CimplifyError | null;
313
+ refresh: () => Promise<void>;
314
+ isExpired: boolean;
315
+ messages: QuoteUiMessage[];
316
+ }
317
+ declare function useQuote(input: UseQuoteInput | null | undefined, options?: UseQuoteOptions): UseQuoteResult;
318
+
224
319
  declare function useElements(): CimplifyElements | null;
225
320
  declare function useElementsReady(): boolean;
226
321
  interface ElementsProviderProps {
@@ -257,7 +352,7 @@ interface AddressElementProps extends BaseElementProps {
257
352
  declare function AddressElement({ className, style, mode, onReady, onChange, onError, }: AddressElementProps): React.ReactElement | null;
258
353
  interface PaymentElementProps extends BaseElementProps {
259
354
  amount?: number;
260
- currency?: string;
355
+ currency?: CurrencyCode;
261
356
  onChange?: (data: {
262
357
  paymentMethod: PaymentMethodInfo;
263
358
  saveToLink: boolean;
@@ -277,4 +372,4 @@ declare function useCheckout(): {
277
372
  isLoading: boolean;
278
373
  };
279
374
 
280
- export { Ad, AdPosition, type AdProps, AdProvider, AdSlot, type AddToCartOptions, AddressElement, AuthElement, CimplifyCheckout, type CimplifyCheckoutProps, type CimplifyContextValue, CimplifyProvider, type CimplifyProviderProps, ElementsProvider, PaymentElement, type UseCartItem, type UseCartOptions, type UseCartResult, type UseCategoriesOptions, type UseCategoriesResult, type UseLocationsOptions, type UseLocationsResult, type UseOrderOptions, type UseOrderResult, type UseProductOptions, type UseProductResult, type UseProductsOptions, type UseProductsResult, useAds, useCart, useCategories, useCheckout, useCimplify, useElements, useElementsReady, useLocations, useOptionalCimplify, useOrder, useProduct, useProducts };
375
+ export { Ad, AdPosition, type AdProps, AdProvider, AdSlot, type AddToCartOptions, AddressElement, AuthElement, CimplifyCheckout, type CimplifyCheckoutProps, type CimplifyContextValue, CimplifyProvider, type CimplifyProviderProps, ElementsProvider, PaymentElement, type UseBundleOptions, type UseBundleResult, type UseCartItem, type UseCartOptions, type UseCartResult, type UseCategoriesOptions, type UseCategoriesResult, type UseCollectionOptions, type UseCollectionResult, type UseCollectionsOptions, type UseCollectionsResult, type UseCompositeOptions, type UseCompositeResult, type UseLocationsOptions, type UseLocationsResult, type UseOrderOptions, type UseOrderResult, type UseProductOptions, type UseProductResult, type UseProductsOptions, type UseProductsResult, type UseQuoteInput, type UseQuoteOptions, type UseQuoteResult, type UseSearchOptions, type UseSearchResult, useAds, useBundle, useCart, useCategories, useCheckout, useCimplify, useCollection, useCollections, useComposite, useElements, useElementsReady, useLocations, useOptionalCimplify, useOrder, useProduct, useProducts, useQuote, useSearch };