@tagadapay/plugin-sdk 3.1.12 → 3.1.22

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 (106) hide show
  1. package/build-cdn.js +129 -11
  2. package/dist/data/iso3166.d.ts +23 -33
  3. package/dist/data/iso3166.js +134 -198
  4. package/dist/data/languages.d.ts +5 -64
  5. package/dist/data/languages.js +23 -143
  6. package/dist/external-tracker.js +968 -101
  7. package/dist/external-tracker.min.js +2 -2
  8. package/dist/external-tracker.min.js.map +4 -4
  9. package/dist/react/hooks/useISOData.js +1 -1
  10. package/dist/react/hooks/usePaymentPolling.d.ts +3 -3
  11. package/dist/tagada-sdk.js +12066 -0
  12. package/dist/tagada-sdk.min.js +50 -0
  13. package/dist/tagada-sdk.min.js.map +7 -0
  14. package/dist/v2/core/client.d.ts +4 -2
  15. package/dist/v2/core/client.js +4 -3
  16. package/dist/v2/core/errors.d.ts +75 -0
  17. package/dist/v2/core/errors.js +104 -0
  18. package/dist/v2/core/funnelClient.d.ts +2 -0
  19. package/dist/v2/core/index.d.ts +1 -0
  20. package/dist/v2/core/index.js +2 -0
  21. package/dist/v2/core/pixelMapping.d.ts +49 -0
  22. package/dist/v2/core/pixelMapping.js +325 -0
  23. package/dist/v2/core/resources/apiClient.d.ts +2 -0
  24. package/dist/v2/core/resources/apiClient.js +52 -9
  25. package/dist/v2/core/resources/checkout.d.ts +89 -30
  26. package/dist/v2/core/resources/checkout.js +8 -0
  27. package/dist/v2/core/resources/customer.d.ts +20 -19
  28. package/dist/v2/core/resources/funnel.d.ts +17 -17
  29. package/dist/v2/core/resources/payments.d.ts +84 -13
  30. package/dist/v2/core/resources/payments.js +26 -9
  31. package/dist/v2/core/types.d.ts +50 -12
  32. package/dist/v2/core/types.js +0 -3
  33. package/dist/v2/core/utils/checkout.d.ts +2 -2
  34. package/dist/v2/core/utils/checkout.js +7 -2
  35. package/dist/v2/core/utils/currency.d.ts +14 -0
  36. package/dist/v2/core/utils/currency.js +40 -0
  37. package/dist/v2/core/utils/index.d.ts +1 -0
  38. package/dist/v2/core/utils/index.js +2 -0
  39. package/dist/v2/core/utils/order.d.ts +11 -9
  40. package/dist/v2/core/utils/pluginConfig.d.ts +8 -0
  41. package/dist/v2/core/utils/pluginConfig.js +28 -0
  42. package/dist/v2/index.d.ts +3 -1
  43. package/dist/v2/index.js +1 -1
  44. package/dist/v2/react/components/FunnelScriptInjector.js +21 -0
  45. package/dist/v2/react/components/WhopCheckout.d.ts +24 -0
  46. package/dist/v2/react/components/WhopCheckout.js +231 -0
  47. package/dist/v2/react/hooks/__examples__/FunnelContextExample.js +1 -1
  48. package/dist/v2/react/hooks/payment-actions/useAirwallexRadarAction.d.ts +14 -0
  49. package/dist/v2/react/hooks/payment-actions/useAirwallexRadarAction.js +181 -0
  50. package/dist/v2/react/hooks/payment-actions/useErrorAction.d.ts +9 -0
  51. package/dist/v2/react/hooks/payment-actions/useErrorAction.js +21 -0
  52. package/dist/v2/react/hooks/payment-actions/useFinixRadarAction.d.ts +14 -0
  53. package/dist/v2/react/hooks/payment-actions/useFinixRadarAction.js +187 -0
  54. package/dist/v2/react/hooks/payment-actions/useKessPayAction.d.ts +11 -0
  55. package/dist/v2/react/hooks/payment-actions/useKessPayAction.js +91 -0
  56. package/dist/v2/react/hooks/payment-actions/useMasterCardAction.d.ts +24 -0
  57. package/dist/v2/react/hooks/payment-actions/useMasterCardAction.js +221 -0
  58. package/dist/v2/react/hooks/payment-actions/usePaymentActionHandler.d.ts +15 -0
  59. package/dist/v2/react/hooks/payment-actions/usePaymentActionHandler.js +142 -0
  60. package/dist/v2/react/hooks/payment-actions/useProcessorAuthAction.d.ts +3 -0
  61. package/dist/v2/react/hooks/payment-actions/useProcessorAuthAction.js +13 -0
  62. package/dist/v2/react/hooks/payment-actions/useRedirectAction.d.ts +10 -0
  63. package/dist/v2/react/hooks/payment-actions/useRedirectAction.js +35 -0
  64. package/dist/v2/react/hooks/payment-actions/useStripeRadarAction.d.ts +14 -0
  65. package/dist/v2/react/hooks/payment-actions/useStripeRadarAction.js +192 -0
  66. package/dist/v2/react/hooks/payment-actions/useThreedsAuthAction.d.ts +14 -0
  67. package/dist/v2/react/hooks/payment-actions/useThreedsAuthAction.js +81 -0
  68. package/dist/v2/react/hooks/payment-actions/useTrustFlowAction.d.ts +11 -0
  69. package/dist/v2/react/hooks/payment-actions/useTrustFlowAction.js +84 -0
  70. package/dist/v2/react/hooks/payment-processing/usePaymentInstruments.d.ts +14 -0
  71. package/dist/v2/react/hooks/payment-processing/usePaymentInstruments.js +36 -0
  72. package/dist/v2/react/hooks/payment-processing/usePaymentProcessors.d.ts +31 -0
  73. package/dist/v2/react/hooks/payment-processing/usePaymentProcessors.js +212 -0
  74. package/dist/v2/react/hooks/payment-redirect/useAirwallex3dsReturn.d.ts +14 -0
  75. package/dist/v2/react/hooks/payment-redirect/useAirwallex3dsReturn.js +207 -0
  76. package/dist/v2/react/hooks/payment-redirect/useGenericPaymentReturn.d.ts +12 -0
  77. package/dist/v2/react/hooks/payment-redirect/useGenericPaymentReturn.js +101 -0
  78. package/dist/v2/react/hooks/useCheckoutQuery.d.ts +6 -0
  79. package/dist/v2/react/hooks/useCheckoutQuery.js +45 -0
  80. package/dist/v2/react/hooks/useGeoLocation.d.ts +2 -1
  81. package/dist/v2/react/hooks/useGeoLocation.js +4 -2
  82. package/dist/v2/react/hooks/useISOData.js +1 -1
  83. package/dist/v2/react/hooks/usePaymentPolling.d.ts +3 -3
  84. package/dist/v2/react/hooks/usePaymentQuery.d.ts +18 -5
  85. package/dist/v2/react/hooks/usePaymentQuery.js +63 -1015
  86. package/dist/v2/react/hooks/usePaymentRetrieve.d.ts +3 -2
  87. package/dist/v2/react/hooks/usePaymentRetrieve.js +3 -1
  88. package/dist/v2/react/hooks/usePixelTracking.d.ts +5 -48
  89. package/dist/v2/react/hooks/usePixelTracking.js +212 -514
  90. package/dist/v2/react/hooks/useShippingRatesQuery.js +13 -5
  91. package/dist/v2/react/hooks/useWhopPaymentPolling.d.ts +30 -0
  92. package/dist/v2/react/hooks/useWhopPaymentPolling.js +61 -0
  93. package/dist/v2/react/index.d.ts +7 -0
  94. package/dist/v2/react/index.js +4 -0
  95. package/dist/v2/react/providers/ExpressPaymentMethodsProvider.d.ts +2 -1
  96. package/dist/v2/react/providers/ExpressPaymentMethodsProvider.js +3 -1
  97. package/dist/v2/react/providers/TagadaProvider.js +71 -2
  98. package/dist/v2/standalone/external-tracker.d.ts +52 -46
  99. package/dist/v2/standalone/external-tracker.js +205 -98
  100. package/dist/v2/standalone/index.d.ts +22 -0
  101. package/dist/v2/standalone/index.js +126 -1
  102. package/package.json +3 -3
  103. package/dist/react/utils/__tests__/urlUtils.test.d.ts +0 -1
  104. package/dist/react/utils/__tests__/urlUtils.test.js +0 -189
  105. package/dist/v2/core/__tests__/pathRemapping.test.d.ts +0 -11
  106. package/dist/v2/core/__tests__/pathRemapping.test.js +0 -776
@@ -3,6 +3,7 @@
3
3
  * Shared between all resource clients
4
4
  */
5
5
  import axios from 'axios';
6
+ import { TagadaApiError, TagadaAuthError, TagadaNetworkError, TagadaCircuitBreakerError, TagadaError, TagadaErrorCode, } from '../errors';
6
7
  export class ApiClient {
7
8
  constructor(config) {
8
9
  this.currentToken = null;
@@ -61,12 +62,15 @@ export class ApiClient {
61
62
  console.error('[SDK] Request error:', error);
62
63
  return Promise.reject(error instanceof Error ? error : new Error(String(error)));
63
64
  });
64
- // Response interceptor for logging
65
- this.axios.interceptors.response.use((response) => {
66
- // console.log('[SDK] Response status:', response.status);
67
- return response;
68
- }, (error) => {
65
+ // Response interceptor maps Axios errors to structured TagadaError subtypes
66
+ this.axios.interceptors.response.use((response) => response, (error) => {
69
67
  console.error('[SDK] Response error:', error.message);
68
+ if (error instanceof TagadaError) {
69
+ return Promise.reject(error);
70
+ }
71
+ if (axios.isAxiosError(error)) {
72
+ return Promise.reject(this.toTagadaError(error));
73
+ }
70
74
  return Promise.reject(error instanceof Error ? error : new Error(String(error)));
71
75
  });
72
76
  }
@@ -146,10 +150,7 @@ export class ApiClient {
146
150
  }
147
151
  history.count++;
148
152
  if (history.count > this.MAX_REQUESTS) {
149
- const error = new Error(`Circuit Breaker: Too many requests to ${key} (${history.count} in ${this.WINDOW_MS}ms)`);
150
- // Add a property to identify this as a circuit breaker error
151
- error.isCircuitBreaker = true;
152
- throw error;
153
+ throw new TagadaCircuitBreakerError(`Circuit Breaker: Too many requests to ${key} (${history.count} in ${this.WINDOW_MS}ms)`);
153
154
  }
154
155
  }
155
156
  cleanupHistory() {
@@ -160,4 +161,46 @@ export class ApiClient {
160
161
  }
161
162
  }
162
163
  }
164
+ /** Convert an AxiosError into the appropriate TagadaError subclass. */
165
+ toTagadaError(error) {
166
+ const status = error.response?.status;
167
+ const data = error.response?.data;
168
+ const serverMessage = data?.message ??
169
+ data?.error ??
170
+ error.message;
171
+ // No response at all → network-level failure
172
+ if (!error.response) {
173
+ if (error.code === 'ECONNABORTED') {
174
+ return new TagadaApiError('Request timed out', 0, {
175
+ code: TagadaErrorCode.TIMEOUT,
176
+ retryable: true,
177
+ });
178
+ }
179
+ return new TagadaNetworkError(serverMessage);
180
+ }
181
+ // Auth failures
182
+ if (status === 401 || status === 403) {
183
+ return new TagadaAuthError(serverMessage, status);
184
+ }
185
+ // Rate-limited
186
+ if (status === 429) {
187
+ return new TagadaApiError(serverMessage, 429, {
188
+ code: TagadaErrorCode.RATE_LIMITED,
189
+ retryable: true,
190
+ });
191
+ }
192
+ // Not found
193
+ if (status === 404) {
194
+ return new TagadaApiError(serverMessage, 404, {
195
+ code: TagadaErrorCode.NOT_FOUND,
196
+ retryable: false,
197
+ });
198
+ }
199
+ // Generic API error
200
+ return new TagadaApiError(serverMessage, status ?? 0, {
201
+ code: data?.code ?? TagadaErrorCode.API_ERROR,
202
+ details: data,
203
+ retryable: (status ?? 0) >= 500,
204
+ });
205
+ }
163
206
  }
@@ -2,6 +2,7 @@
2
2
  * Checkout Resource Client
3
3
  * Axios-based API client for checkout endpoints
4
4
  */
5
+ import type { OrderAddress } from '../types';
5
6
  import { ApiClient } from './apiClient';
6
7
  export interface CheckoutLineItem {
7
8
  externalProductId?: string | null;
@@ -91,7 +92,7 @@ export interface Store {
91
92
  chargeCurrencies: string[];
92
93
  upsells: Upsell[];
93
94
  emailDomains: string[];
94
- integrations: any[];
95
+ integrations: unknown[];
95
96
  }
96
97
  export interface CheckoutSession {
97
98
  id: string;
@@ -106,7 +107,56 @@ export interface CheckoutSession {
106
107
  updatedAt: string;
107
108
  lastActiveDate: string;
108
109
  selectedPresentmentCurrency: string;
109
- [key: string]: any;
110
+ shippingRate?: {
111
+ id: string;
112
+ [key: string]: unknown;
113
+ } | null;
114
+ shippingRateId?: string;
115
+ sessionLineItems?: Array<{
116
+ isOrderBump?: boolean;
117
+ [key: string]: unknown;
118
+ }>;
119
+ customer?: {
120
+ email?: string;
121
+ firstName?: string;
122
+ lastName?: string;
123
+ currency?: string;
124
+ [key: string]: unknown;
125
+ };
126
+ shippingAddress?: {
127
+ firstName?: string;
128
+ lastName?: string;
129
+ address1?: string;
130
+ address2?: string;
131
+ city?: string;
132
+ state?: string;
133
+ postal?: string;
134
+ country?: string;
135
+ phone?: string;
136
+ [key: string]: unknown;
137
+ };
138
+ billingAddress?: {
139
+ firstName?: string;
140
+ lastName?: string;
141
+ address1?: string;
142
+ address2?: string;
143
+ city?: string;
144
+ state?: string;
145
+ postal?: string;
146
+ country?: string;
147
+ phone?: string;
148
+ [key: string]: unknown;
149
+ };
150
+ metadata?: {
151
+ cartCustomAttributes?: Array<{
152
+ name?: string;
153
+ value?: string;
154
+ [key: string]: unknown;
155
+ }>;
156
+ clubProductId?: string;
157
+ [key: string]: unknown;
158
+ };
159
+ [key: string]: unknown;
110
160
  }
111
161
  export interface CheckoutSummaryItem {
112
162
  id: string;
@@ -129,7 +179,7 @@ export interface CheckoutSummaryItem {
129
179
  amount: number;
130
180
  adjustedAmount: number;
131
181
  currency: string;
132
- adjustments: any[];
182
+ adjustments: CheckoutSessionPreviewAdjustment[];
133
183
  recurring: boolean;
134
184
  interval?: 'day' | 'week' | 'month' | 'year';
135
185
  intervalCount?: number;
@@ -169,6 +219,7 @@ export interface CheckoutSummary {
169
219
  }[];
170
220
  }
171
221
  export interface CheckoutSessionPreviewAdjustment {
222
+ id?: string;
172
223
  type: 'Promotion' | 'Tax' | 'Shipping';
173
224
  description: string;
174
225
  level: 'Order' | 'LineItem';
@@ -205,7 +256,7 @@ export interface CheckoutSessionPreviewItem {
205
256
  intervalCount?: number;
206
257
  totalBillingCycles?: number;
207
258
  unitAmountAfterFirstCycle?: number;
208
- subscriptionSettings?: any;
259
+ subscriptionSettings?: Record<string, unknown>;
209
260
  orderLineItemProduct: {
210
261
  name: string | null;
211
262
  } | null;
@@ -221,13 +272,22 @@ export interface CheckoutSessionPreview {
221
272
  totalAdjustedAmount: number;
222
273
  totalPromotionAmount: number;
223
274
  }
275
+ export interface PromotionAction {
276
+ id: string;
277
+ adjustmentAmount?: Record<string, {
278
+ amount: number;
279
+ [key: string]: unknown;
280
+ }>;
281
+ adjustmentPercentage?: number;
282
+ [key: string]: unknown;
283
+ }
224
284
  export interface Promotion {
225
285
  id: string;
226
286
  name: string;
227
287
  description: string | null;
228
288
  type: string;
229
- rules: any[];
230
- actions: any[];
289
+ rules: Record<string, unknown>[];
290
+ actions: PromotionAction[];
231
291
  }
232
292
  export interface CheckoutData {
233
293
  checkoutSession: CheckoutSession;
@@ -236,14 +296,6 @@ export interface CheckoutData {
236
296
  summary: CheckoutSummary;
237
297
  availablePromotions: Promotion[];
238
298
  }
239
- export interface Promotion {
240
- id: string;
241
- name: string;
242
- description: string | null;
243
- type: string;
244
- rules: any[];
245
- actions: any[];
246
- }
247
299
  export declare class CheckoutResource {
248
300
  private apiClient;
249
301
  constructor(apiClient: ApiClient);
@@ -300,9 +352,9 @@ export declare class CheckoutResource {
300
352
  funnelVariantId?: string;
301
353
  navigationEvent?: string | {
302
354
  type: string;
303
- data?: any;
355
+ data?: Record<string, unknown>;
304
356
  };
305
- navigationOptions?: any;
357
+ navigationOptions?: Record<string, unknown>;
306
358
  }, getFunnelSessionId?: () => string | null | undefined): Promise<{
307
359
  checkoutToken: string;
308
360
  customerId: string;
@@ -338,8 +390,8 @@ export declare class CheckoutResource {
338
390
  * Update checkout address
339
391
  */
340
392
  updateAddress(checkoutSessionId: string, data: {
341
- shippingAddress: any;
342
- billingAddress?: any;
393
+ shippingAddress: Partial<OrderAddress>;
394
+ billingAddress?: Partial<OrderAddress>;
343
395
  }): Promise<{
344
396
  success: boolean;
345
397
  errors?: Record<string, {
@@ -353,8 +405,8 @@ export declare class CheckoutResource {
353
405
  * Set checkout info
354
406
  */
355
407
  setCheckoutInfo(checkoutSessionId: string, data: {
356
- shippingAddress: any;
357
- billingAddress?: any;
408
+ shippingAddress: Partial<OrderAddress>;
409
+ billingAddress?: Partial<OrderAddress>;
358
410
  differentBillingAddress?: boolean;
359
411
  }): Promise<{
360
412
  success: boolean;
@@ -370,32 +422,39 @@ export declare class CheckoutResource {
370
422
  */
371
423
  applyPromotionCode(checkoutSessionId: string, code: string): Promise<{
372
424
  success: boolean;
373
- error?: any;
425
+ error?: string;
374
426
  }>;
375
427
  /**
376
428
  * Remove promotion
377
429
  */
378
430
  removePromotion(checkoutSessionId: string, promotionId: string): Promise<{
379
431
  success: boolean;
380
- error?: any;
432
+ error?: string;
381
433
  }>;
382
434
  /**
383
435
  * Get applied promotions
384
436
  */
385
437
  getAppliedPromotions(checkoutSessionId: string): Promise<Promotion[]>;
438
+ /**
439
+ * Replace all session line items (full rewrite)
440
+ */
441
+ replaceSessionLineItems(checkoutSessionId: string, lineItems: CheckoutLineItem[]): Promise<{
442
+ success: boolean;
443
+ error?: string;
444
+ }>;
386
445
  /**
387
446
  * Update line items
388
447
  */
389
448
  updateLineItems(checkoutSessionId: string, lineItems: CheckoutLineItem[]): Promise<{
390
449
  success: boolean;
391
- error?: any;
450
+ error?: string;
392
451
  }>;
393
452
  /**
394
453
  * Add line items
395
454
  */
396
455
  addLineItems(checkoutSessionId: string, lineItems: CheckoutLineItem[]): Promise<{
397
456
  success: boolean;
398
- error?: any;
457
+ error?: string;
399
458
  }>;
400
459
  /**
401
460
  * Remove line items
@@ -405,21 +464,21 @@ export declare class CheckoutResource {
405
464
  quantity?: number;
406
465
  }[]): Promise<{
407
466
  success: boolean;
408
- error?: any;
467
+ error?: string;
409
468
  }>;
410
469
  /**
411
470
  * Set item quantity
412
471
  */
413
472
  setItemQuantity(checkoutSessionId: string, variantId: string, quantity: number, priceId?: string): Promise<{
414
473
  success: boolean;
415
- error?: any;
474
+ error?: string;
416
475
  }>;
417
476
  /**
418
477
  * Toggle order bump
419
478
  */
420
479
  toggleOrderBump(checkoutSessionId: string, orderBumpOfferId: string, selected: boolean): Promise<{
421
480
  success: boolean;
422
- error?: any;
481
+ error?: string;
423
482
  }>;
424
483
  /**
425
484
  * Update customer
@@ -429,7 +488,7 @@ export declare class CheckoutResource {
429
488
  acceptsMarketing?: boolean;
430
489
  }): Promise<{
431
490
  success: boolean;
432
- error?: any;
491
+ error?: string;
433
492
  }>;
434
493
  /**
435
494
  * Update customer and session info
@@ -439,8 +498,8 @@ export declare class CheckoutResource {
439
498
  email: string;
440
499
  acceptsMarketing?: boolean;
441
500
  };
442
- shippingAddress: any;
443
- billingAddress?: any;
501
+ shippingAddress: Partial<OrderAddress>;
502
+ billingAddress?: Partial<OrderAddress>;
444
503
  differentBillingAddress?: boolean;
445
504
  }): Promise<{
446
505
  success: boolean;
@@ -147,6 +147,14 @@ export class CheckoutResource {
147
147
  async getAppliedPromotions(checkoutSessionId) {
148
148
  return this.apiClient.get(`/api/v1/checkout-sessions/${checkoutSessionId}/promotions`);
149
149
  }
150
+ /**
151
+ * Replace all session line items (full rewrite)
152
+ */
153
+ async replaceSessionLineItems(checkoutSessionId, lineItems) {
154
+ return this.apiClient.post(`/api/v1/checkout-sessions/${checkoutSessionId}/line-items`, {
155
+ lineItems,
156
+ });
157
+ }
150
158
  /**
151
159
  * Update line items
152
160
  */
@@ -3,6 +3,7 @@
3
3
  * Handles customer-related API operations
4
4
  */
5
5
  import { ApiClient } from './apiClient';
6
+ import type { Subscription as CoreSubscription, DeviceInfo, PromotionCode, OrderAddress, OrderSummary, PromotionSummary, PaymentSummary, OrderAdjustmentSummary } from '../types';
6
7
  export interface CustomerAddress {
7
8
  firstName: string | null;
8
9
  lastName: string | null;
@@ -40,12 +41,12 @@ export interface CustomerInfos {
40
41
  acceptsMarketing: boolean;
41
42
  createdAt: string;
42
43
  updatedAt: string;
43
- metadata: Record<string, any>;
44
- device: any | null;
44
+ metadata: Record<string, unknown>;
45
+ device: DeviceInfo | null;
45
46
  orders: CustomerOrderSummary[];
46
- subscriptions: any[];
47
+ subscriptions: CoreSubscription[];
47
48
  };
48
- promotionCodes: any[];
49
+ promotionCodes: PromotionCode[];
49
50
  }
50
51
  export interface OrderWithRelations {
51
52
  id: string;
@@ -53,27 +54,27 @@ export interface OrderWithRelations {
53
54
  paidAmount: number;
54
55
  status: string;
55
56
  createdAt: string;
56
- metadata?: Record<string, any>;
57
- items: any[];
58
- summaries?: any[];
59
- shippingAddress?: any;
60
- billingAddress?: any;
61
- pickupAddress?: any;
57
+ metadata?: Record<string, unknown>;
58
+ items: Record<string, unknown>[];
59
+ summaries?: OrderSummary[];
60
+ shippingAddress?: OrderAddress | null;
61
+ billingAddress?: OrderAddress | null;
62
+ pickupAddress?: Record<string, unknown> | null;
62
63
  checkoutSession?: {
63
64
  returnUrl?: string;
64
- [key: string]: any;
65
+ [key: string]: unknown;
65
66
  };
66
- relatedOrders?: any[];
67
- customer?: any;
68
- store?: any;
67
+ relatedOrders?: OrderWithRelations[];
68
+ customer?: Record<string, unknown>;
69
+ store?: Record<string, unknown>;
69
70
  account?: {
70
71
  id: string;
71
72
  name?: string;
72
73
  };
73
- payments?: any[];
74
- promotions?: any[];
75
- subscriptions?: any[];
76
- adjustments: any[];
74
+ payments?: PaymentSummary[];
75
+ promotions?: PromotionSummary[];
76
+ subscriptions?: CoreSubscription[];
77
+ adjustments: OrderAdjustmentSummary[];
77
78
  }
78
79
  export interface Subscription {
79
80
  id: string;
@@ -127,7 +128,7 @@ export declare class CustomerResource {
127
128
  firstName?: string;
128
129
  lastName?: string;
129
130
  acceptsMarketing?: boolean;
130
- metadata?: Record<string, any>;
131
+ metadata?: Record<string, unknown>;
131
132
  }): Promise<CustomerInfos>;
132
133
  /**
133
134
  * Get customer orders
@@ -31,14 +31,14 @@ export declare enum FunnelActionType {
31
31
  * Data structures for specific action types
32
32
  */
33
33
  export type NextAction<T> = T & {
34
- [key: string]: any;
34
+ [key: string]: unknown;
35
35
  };
36
36
  /**
37
37
  * Base resource data type - all resources must have an id and optional metadata
38
38
  */
39
39
  export interface FunnelResourceData {
40
40
  id: string;
41
- [key: string]: any;
41
+ [key: string]: unknown;
42
42
  }
43
43
  /**
44
44
  * Resource metadata for tracking, versioning, and relationships
@@ -57,7 +57,7 @@ export interface ResourceMetadata {
57
57
  /** Related resource IDs (for relationships) */
58
58
  relatedTo?: string[];
59
59
  /** Custom metadata */
60
- [key: string]: any;
60
+ [key: string]: unknown;
61
61
  }
62
62
  /**
63
63
  * Wrapped resource with metadata
@@ -220,7 +220,7 @@ export interface FunnelActionResources<TCustom = {}> {
220
220
  * Legacy top-level data (backward compatible)
221
221
  * Will be automatically migrated to resources by orchestrator
222
222
  */
223
- [key: string]: any;
223
+ [key: string]: unknown;
224
224
  }
225
225
  export interface DirectNavigationActionData extends FunnelActionResources {
226
226
  targetStepId: string;
@@ -234,13 +234,13 @@ export interface PaymentSuccessActionData extends FunnelActionResources {
234
234
  status: string;
235
235
  transactionId?: string;
236
236
  timestamp?: string;
237
- [key: string]: any;
237
+ [key: string]: unknown;
238
238
  };
239
239
  order: {
240
240
  id: string;
241
241
  amount: number;
242
242
  currency: string;
243
- [key: string]: any;
243
+ [key: string]: unknown;
244
244
  };
245
245
  }
246
246
  export interface PaymentFailedActionData extends FunnelActionResources {
@@ -248,21 +248,21 @@ export interface PaymentFailedActionData extends FunnelActionResources {
248
248
  id: string;
249
249
  status: string;
250
250
  error?: string;
251
- [key: string]: any;
251
+ [key: string]: unknown;
252
252
  };
253
253
  }
254
254
  export interface OfferAcceptedActionData extends FunnelActionResources {
255
255
  offer: {
256
256
  accepted: boolean;
257
257
  offerId?: string;
258
- [key: string]: any;
258
+ [key: string]: unknown;
259
259
  };
260
260
  }
261
261
  export interface OfferDeclinedActionData extends FunnelActionResources {
262
262
  offer: {
263
263
  declined: boolean;
264
264
  offerId?: string;
265
- [key: string]: any;
265
+ [key: string]: unknown;
266
266
  };
267
267
  }
268
268
  export interface CartUpdatedActionData extends FunnelActionResources {
@@ -271,12 +271,12 @@ export interface CartUpdatedActionData extends FunnelActionResources {
271
271
  itemIds?: string[];
272
272
  variantIds?: string[];
273
273
  total?: number;
274
- [key: string]: any;
274
+ [key: string]: unknown;
275
275
  };
276
276
  }
277
277
  export interface FormSubmitActionData extends FunnelActionResources {
278
278
  form?: {
279
- [key: string]: any;
279
+ [key: string]: unknown;
280
280
  };
281
281
  }
282
282
  /**
@@ -305,10 +305,10 @@ export type FunnelAction = BaseFunnelAction & (({
305
305
  data: NextAction<BackNavigationActionData>;
306
306
  }) | ({
307
307
  type: FunnelActionType.CONTINUE_CLICKED;
308
- data: NextAction<any>;
308
+ data: NextAction<FunnelActionResources>;
309
309
  }) | ({
310
310
  type: FunnelActionType.BUTTON_CLICK;
311
- data: NextAction<any>;
311
+ data: NextAction<FunnelActionResources>;
312
312
  }) | ({
313
313
  type: FunnelActionType.FORM_SUBMIT;
314
314
  data: NextAction<FormSubmitActionData>;
@@ -340,7 +340,7 @@ export type FunnelAction = BaseFunnelAction & (({
340
340
  export interface FunnelNavigationAction {
341
341
  type: 'redirect' | 'replace' | 'push' | 'external' | 'none';
342
342
  url?: string;
343
- data?: any;
343
+ data?: Record<string, unknown>;
344
344
  }
345
345
  export interface FunnelNavigationResult {
346
346
  stepId?: string;
@@ -424,12 +424,12 @@ export interface SimpleFunnelContext<TCustom = {}> {
424
424
  * - Available at runtime as context.static
425
425
  * - Example: context.static.offer.id for statically configured offers
426
426
  */
427
- static?: Record<string, any>;
427
+ static?: Record<string, unknown>;
428
428
  /**
429
429
  * Legacy/Custom metadata
430
430
  * For backward compatibility and flexible unstructured data
431
431
  */
432
- metadata?: Record<string, any>;
432
+ metadata?: Record<string, unknown>;
433
433
  script?: string;
434
434
  }
435
435
  export interface FunnelInitializeRequest {
@@ -603,7 +603,7 @@ export declare class FunnelResource {
603
603
  getSession(sessionId: string, currentUrl?: string, includeDebugData?: boolean): Promise<{
604
604
  success: boolean;
605
605
  context?: SimpleFunnelContext;
606
- debugData?: any;
606
+ debugData?: Record<string, unknown>;
607
607
  error?: string;
608
608
  }>;
609
609
  }