@tagadapay/plugin-sdk 2.8.1 → 2.8.2

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.
@@ -12,7 +12,7 @@ import { ApiClient } from './apiClient';
12
12
  * Common types (for logging/tracking):
13
13
  * - Any string value is accepted, but these are commonly used examples
14
14
  */
15
- export declare enum FunnelEventType {
15
+ export declare enum FunnelActionType {
16
16
  DIRECT_NAVIGATION = "direct_navigation",
17
17
  BACK_NAVIGATION = "back_navigation",
18
18
  PAYMENT_SUCCESS = "payment_success",
@@ -65,16 +65,16 @@ interface BaseFunnelEvent {
65
65
  * Discriminated union for FunnelEvent based on event type
66
66
  */
67
67
  export type FunnelAction = BaseFunnelEvent & (({
68
- type: FunnelEventType.DIRECT_NAVIGATION;
68
+ type: FunnelActionType.DIRECT_NAVIGATION;
69
69
  data: NextEvent<DirectNavigationEventData>;
70
70
  }) | ({
71
- type: FunnelEventType.BACK_NAVIGATION;
71
+ type: FunnelActionType.BACK_NAVIGATION;
72
72
  data: NextEvent<BackNavigationEventData>;
73
73
  }) | ({
74
- type: FunnelEventType.PAYMENT_SUCCESS;
74
+ type: FunnelActionType.PAYMENT_SUCCESS;
75
75
  data: NextEvent<PaymentSuccessEventData>;
76
76
  }) | ({
77
- type: FunnelEventType.CUSTOM;
77
+ type: FunnelActionType.CUSTOM;
78
78
  data?: NextEvent<any>;
79
79
  }));
80
80
  export interface FunnelNavigationAction {
@@ -11,14 +11,14 @@
11
11
  * Common types (for logging/tracking):
12
12
  * - Any string value is accepted, but these are commonly used examples
13
13
  */
14
- export var FunnelEventType;
15
- (function (FunnelEventType) {
14
+ export var FunnelActionType;
15
+ (function (FunnelActionType) {
16
16
  // Special navigation types
17
- FunnelEventType["DIRECT_NAVIGATION"] = "direct_navigation";
18
- FunnelEventType["BACK_NAVIGATION"] = "back_navigation";
19
- FunnelEventType["PAYMENT_SUCCESS"] = "payment_success";
20
- FunnelEventType["CUSTOM"] = "custom";
21
- })(FunnelEventType || (FunnelEventType = {}));
17
+ FunnelActionType["DIRECT_NAVIGATION"] = "direct_navigation";
18
+ FunnelActionType["BACK_NAVIGATION"] = "back_navigation";
19
+ FunnelActionType["PAYMENT_SUCCESS"] = "payment_success";
20
+ FunnelActionType["CUSTOM"] = "custom";
21
+ })(FunnelActionType || (FunnelActionType = {}));
22
22
  export class FunnelResource {
23
23
  constructor(apiClient) {
24
24
  this.apiClient = apiClient;
@@ -21,7 +21,7 @@ export type { ShippingRate, ShippingRatesResponse } from './core/resources/shipp
21
21
  export type { ApplyDiscountResponse, Discount, DiscountCodeValidation, RemoveDiscountResponse } from './core/resources/discounts';
22
22
  export type { ToggleOrderBumpResponse, VipOffer, VipPreviewResponse } from './core/resources/vipOffers';
23
23
  export type { StoreConfig } from './core/resources/storeConfig';
24
- export { FunnelEventType } from './core/resources/funnel';
24
+ export { FunnelActionType } from './core/resources/funnel';
25
25
  export type { BackNavigationEventData, DirectNavigationEventData, FunnelContextUpdateRequest, FunnelContextUpdateResponse, FunnelAction as FunnelEvent, FunnelInitializeRequest, FunnelInitializeResponse, FunnelNavigateRequest, FunnelNavigateResponse, FunnelNavigationAction, FunnelNavigationResult, NextEvent, PaymentSuccessEventData, SimpleFunnelContext } from './core/resources/funnel';
26
26
  export { ApplePayButton, ExpressPaymentMethodsProvider, formatMoney, getAvailableLanguages, GooglePayButton, queryKeys, TagadaProvider, useApiMutation, useApiQuery, useAuth, useCheckout, useCheckoutToken, useClubOffers, useCountryOptions, useCurrency, useCustomer, useCustomerInfos, useCustomerOrders, useCustomerSubscriptions, useDiscounts, useExpressPaymentMethods, useFunnel, useGeoLocation, useGoogleAutocomplete, useInvalidateQuery, useISOData, useLanguageImport, useLogin, useOffers, useOrder, useOrderBump, usePayment, usePluginConfig, usePostPurchases, usePreloadQuery, useProducts, usePromotions, useRegionOptions, useRemappableParams, useShippingRates, useSimpleFunnel, useStoreConfig, useTagadaContext, useThreeds, useThreedsModal, useTranslation, useVipOffers } from './react';
27
27
  export type { TranslateFunction, TranslationText, UseTranslationOptions, UseTranslationResult } from './react/hooks/useTranslation';
package/dist/v2/index.js CHANGED
@@ -13,6 +13,6 @@ export * from './core/utils/pluginConfig';
13
13
  export * from './core/utils/products';
14
14
  // Path remapping helpers (framework-agnostic)
15
15
  export * from './core/pathRemapping';
16
- export { FunnelEventType } from './core/resources/funnel';
16
+ export { FunnelActionType } from './core/resources/funnel';
17
17
  // React exports (hooks and components only, types are exported above)
18
18
  export { ApplePayButton, ExpressPaymentMethodsProvider, formatMoney, getAvailableLanguages, GooglePayButton, queryKeys, TagadaProvider, useApiMutation, useApiQuery, useAuth, useCheckout, useCheckoutToken, useClubOffers, useCountryOptions, useCurrency, useCustomer, useCustomerInfos, useCustomerOrders, useCustomerSubscriptions, useDiscounts, useExpressPaymentMethods, useFunnel, useGeoLocation, useGoogleAutocomplete, useInvalidateQuery, useISOData, useLanguageImport, useLogin, useOffers, useOrder, useOrderBump, usePayment, usePluginConfig, usePostPurchases, usePreloadQuery, useProducts, usePromotions, useRegionOptions, useRemappableParams, useShippingRates, useSimpleFunnel, useStoreConfig, useTagadaContext, useThreeds, useThreedsModal, useTranslation, useVipOffers } from './react';
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
8
8
  import { useCallback, useEffect, useMemo, useState } from 'react';
9
- import { FunnelEventType, FunnelResource } from '../../core/resources/funnel';
9
+ import { FunnelActionType, FunnelResource } from '../../core/resources/funnel';
10
10
  import { useTagadaContext } from '../providers/TagadaProvider';
11
11
  import { getGlobalApiClient } from './useApiQuery';
12
12
  // Query keys for funnel operations
@@ -405,7 +405,7 @@ export function useFunnel(options) {
405
405
  }, [navigateMutation]);
406
406
  const goToStep = useCallback(async (stepId) => {
407
407
  return next({
408
- type: FunnelEventType.DIRECT_NAVIGATION,
408
+ type: FunnelActionType.DIRECT_NAVIGATION,
409
409
  data: { targetStepId: stepId },
410
410
  timestamp: new Date().toISOString()
411
411
  });
@@ -8,7 +8,6 @@ import { PostPurchasesResource } from '../../core/resources/postPurchases';
8
8
  import { useTagadaContext } from '../providers/TagadaProvider';
9
9
  import { getGlobalApiClient, getGlobalApiClientOrNull } from './useApiQuery';
10
10
  export function usePostPurchasesQuery(options) {
11
- console.log('usePostPurchasesQuery');
12
11
  const { orderId, enabled = true, autoInitializeCheckout = false } = options;
13
12
  const queryClient = useQueryClient();
14
13
  const { session, isSessionInitialized, apiService } = useTagadaContext();
@@ -55,7 +55,7 @@ export type { ExtractedAddress, GooglePlaceDetails, GooglePrediction, UseGoogleA
55
55
  export type { ISOCountry, ISORegion, UseISODataResult } from './hooks/useISOData';
56
56
  export type { UsePluginConfigOptions, UsePluginConfigResult } from './hooks/usePluginConfig';
57
57
  export type { TranslateFunction, UseTranslationOptions, UseTranslationResult } from './hooks/useTranslation';
58
- export { FunnelEventType } from '../core/resources/funnel';
58
+ export { FunnelActionType } from '../core/resources/funnel';
59
59
  export type { UseCheckoutQueryOptions as UseCheckoutOptions, UseCheckoutQueryResult as UseCheckoutResult } from './hooks/useCheckoutQuery';
60
60
  export type { UseDiscountsQueryOptions as UseDiscountsOptions, UseDiscountsQueryResult as UseDiscountsResult } from './hooks/useDiscountsQuery';
61
61
  export type { FunnelEvent, FunnelNavigationAction, FunnelNavigationResult, SimpleFunnelContext, UseFunnelOptions, UseFunnelResult } from './hooks/useFunnel';
@@ -45,6 +45,6 @@ export { useVipOffersQuery as useVipOffers } from './hooks/useVipOffersQuery';
45
45
  // Funnel hooks
46
46
  export { useFunnel, useSimpleFunnel } from './hooks/useFunnel';
47
47
  // TanStack Query types
48
- export { FunnelEventType } from '../core/resources/funnel';
48
+ export { FunnelActionType } from '../core/resources/funnel';
49
49
  // Re-export utilities from main react
50
50
  export { formatMoney } from '../../react/utils/money';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagadapay/plugin-sdk",
3
- "version": "2.8.1",
3
+ "version": "2.8.2",
4
4
  "description": "Modern React SDK for building Tagada Pay plugins",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",