@tagadapay/plugin-sdk 2.4.32 → 2.4.35

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.
@@ -2,8 +2,21 @@
2
2
  * Plugin Configuration Hook
3
3
  *
4
4
  * Professional SDK approach to access plugin configuration:
5
+ * - Raw Config: Direct configuration passed via TagadaProvider (highest priority)
5
6
  * - Store ID, Account ID, Base Path: from .local.json (dev) or headers (production)
6
7
  * - Deployment Config: from config/*.json (dev) or meta tags (production)
8
+ *
9
+ * Usage:
10
+ * 1. Raw config (recommended for programmatic usage):
11
+ * <TagadaProvider rawPluginConfig={{ storeId: 'store_123', config: {...} }}>
12
+ *
13
+ * 2. File-based config (for development):
14
+ * - .local.json for store/account info
15
+ * - config/default.tgd.json for deployment config
16
+ *
17
+ * 3. Production config:
18
+ * - Headers for store/account info
19
+ * - Meta tags for deployment config
7
20
  */
8
21
  import { useTagadaContext } from '../providers/TagadaProvider';
9
22
  // Simple cache for plugin configuration
@@ -122,10 +135,20 @@ const loadProductionConfig = async () => {
122
135
  };
123
136
  /**
124
137
  * Load plugin configuration (cached)
125
- * Tries local dev config first, then production config
138
+ * Tries raw config first, then local dev config, then production config
126
139
  */
127
- export const loadPluginConfig = async (configVariant = 'default') => {
128
- // Try local development config first
140
+ export const loadPluginConfig = async (configVariant = 'default', rawConfig) => {
141
+ // If raw config is provided, use it directly
142
+ if (rawConfig) {
143
+ console.log('🛠️ Using raw plugin config:', rawConfig);
144
+ return {
145
+ storeId: rawConfig.storeId,
146
+ accountId: rawConfig.accountId,
147
+ basePath: rawConfig.basePath ?? '/',
148
+ config: rawConfig.config ?? {},
149
+ };
150
+ }
151
+ // Try local development config
129
152
  const localConfig = await loadLocalDevConfig(configVariant);
130
153
  if (localConfig) {
131
154
  return localConfig;
@@ -158,14 +181,14 @@ export const useBasePath = () => {
158
181
  /**
159
182
  * Get cached config directly (for non-React usage)
160
183
  */
161
- export const getPluginConfig = async (configVariant = 'default') => {
184
+ export const getPluginConfig = async (configVariant = 'default', rawConfig) => {
162
185
  if (cachedConfig) {
163
186
  return cachedConfig;
164
187
  }
165
188
  if (configPromise) {
166
189
  return configPromise;
167
190
  }
168
- configPromise = loadPluginConfig(configVariant);
191
+ configPromise = loadPluginConfig(configVariant, rawConfig);
169
192
  const result = await configPromise;
170
193
  cachedConfig = result;
171
194
  configPromise = null;
@@ -181,7 +204,7 @@ export const clearPluginConfigCache = () => {
181
204
  /**
182
205
  * Development helper to log current configuration
183
206
  */
184
- export const debugPluginConfig = async (configVariant = 'default') => {
207
+ export const debugPluginConfig = async (configVariant = 'default', rawConfig) => {
185
208
  // Use hostname-based detection for better Vite compatibility
186
209
  const isLocalDev = typeof window !== 'undefined' &&
187
210
  (window.location.hostname === 'localhost' ||
@@ -191,7 +214,7 @@ export const debugPluginConfig = async (configVariant = 'default') => {
191
214
  if (!isLocalDev) {
192
215
  return;
193
216
  }
194
- const config = await getPluginConfig(configVariant);
217
+ const config = await getPluginConfig(configVariant, rawConfig);
195
218
  console.group('🔧 Plugin Configuration Debug');
196
219
  console.log('Store ID:', config.storeId || 'Not available');
197
220
  console.log('Account ID:', config.accountId || 'Not available');
@@ -7,8 +7,6 @@ export { useCheckout } from './hooks/useCheckout';
7
7
  export { useClubOffers } from './hooks/useClubOffers';
8
8
  export { useCurrency } from './hooks/useCurrency';
9
9
  export { useCustomer } from './hooks/useCustomer';
10
- export { useCustomerInfos } from './hooks/useCustomerInfos';
11
- export { useCustomerSubscriptions } from './hooks/useCustomerSubscriptions';
12
10
  export { useDiscounts } from './hooks/useDiscounts';
13
11
  export { useEnvironment } from './hooks/useEnvironment';
14
12
  export { useGeoLocation } from './hooks/useGeoLocation';
@@ -27,7 +25,7 @@ export { useVipOffers } from './hooks/useVipOffers';
27
25
  export { useTagadaContext } from './providers/TagadaProvider';
28
26
  export { clearPluginConfigCache, debugPluginConfig, getPluginConfig, useBasePath, usePluginConfig } from './hooks/usePluginConfig';
29
27
  export type { PluginConfig } from './hooks/usePluginConfig';
30
- export { getAvailableLanguages, useCountryOptions, useISOData, useRegionOptions } from './hooks/useISOData';
28
+ export { getAvailableLanguages, useCountryOptions, useISOData, useRegionOptions, useLanguageImport } from './hooks/useISOData';
31
29
  export type { ISOCountry, ISORegion, UseISODataResult } from './hooks/useISOData';
32
30
  export type { GeoLocationData, UseGeoLocationOptions, UseGeoLocationReturn } from './hooks/useGeoLocation';
33
31
  export type { ExtractedAddress, GoogleAddressComponent, GooglePlaceDetails, GooglePrediction, UseGoogleAutocompleteOptions, UseGoogleAutocompleteResult } from './hooks/useGoogleAutocomplete';
@@ -39,7 +37,7 @@ export { useThreeds } from './hooks/useThreeds';
39
37
  export { useThreedsModal } from './hooks/useThreedsModal';
40
38
  export { useApplePay } from './hooks/useApplePay';
41
39
  export { ExpressPaymentProvider, useExpressPayment } from './hooks/useExpressPayment';
42
- export type { AuthState, Currency, Customer, CustomerInfos, Environment, EnvironmentConfig, Locale, Order, OrderAddress, OrderItem, OrderSummary, PickupPoint, Session, Store } from './types';
40
+ export type { AuthState, Currency, Customer, Environment, EnvironmentConfig, Locale, Order, OrderAddress, OrderItem, OrderSummary, PickupPoint, Session, Store } from './types';
43
41
  export type { CheckoutData, CheckoutInitParams, CheckoutLineItem, CheckoutSession, CheckoutSessionPreview, Promotion, UseCheckoutOptions, UseCheckoutResult } from './hooks/useCheckout';
44
42
  export type { Discount, DiscountCodeValidation, UseDiscountsOptions, UseDiscountsResult } from './hooks/useDiscounts';
45
43
  export type { OrderBumpPreview, UseOrderBumpOptions, UseOrderBumpResult } from './hooks/useOrderBump';
@@ -10,8 +10,6 @@ export { useCheckout } from './hooks/useCheckout';
10
10
  export { useClubOffers } from './hooks/useClubOffers';
11
11
  export { useCurrency } from './hooks/useCurrency';
12
12
  export { useCustomer } from './hooks/useCustomer';
13
- export { useCustomerInfos } from './hooks/useCustomerInfos';
14
- export { useCustomerSubscriptions } from './hooks/useCustomerSubscriptions';
15
13
  export { useDiscounts } from './hooks/useDiscounts';
16
14
  export { useEnvironment } from './hooks/useEnvironment';
17
15
  export { useGeoLocation } from './hooks/useGeoLocation';
@@ -30,7 +28,7 @@ export { useTagadaContext } from './providers/TagadaProvider';
30
28
  // Plugin configuration hooks
31
29
  export { clearPluginConfigCache, debugPluginConfig, getPluginConfig, useBasePath, usePluginConfig } from './hooks/usePluginConfig';
32
30
  // ISO Data hooks
33
- export { getAvailableLanguages, useCountryOptions, useISOData, useRegionOptions } from './hooks/useISOData';
31
+ export { getAvailableLanguages, useCountryOptions, useISOData, useRegionOptions, useLanguageImport } from './hooks/useISOData';
34
32
  // Order hook exports
35
33
  export { useOrder } from './hooks/useOrder';
36
34
  // Payment hooks exports
@@ -2,7 +2,7 @@
2
2
  * TagadaProvider - Main provider component for the Tagada Pay React SDK
3
3
  */
4
4
  import { ReactNode } from 'react';
5
- import { PluginConfig } from '../hooks/usePluginConfig';
5
+ import { PluginConfig, RawPluginConfig } from '../hooks/usePluginConfig';
6
6
  import { ApiService } from '../services/apiService';
7
7
  import { AuthState, Currency, Customer, Environment, EnvironmentConfig, Locale, Session, Store } from '../types';
8
8
  import { convertCurrency, formatMoney, formatMoneyWithoutSymbol, formatSimpleMoney, getCurrencyInfo, minorUnitsToMajorUnits, moneyStringOrNumberToMinorUnits } from '../utils/money';
@@ -54,8 +54,10 @@ interface TagadaProviderProps {
54
54
  debugMode?: boolean;
55
55
  localConfig?: string;
56
56
  blockUntilSessionReady?: boolean;
57
+ rawPluginConfig?: RawPluginConfig;
57
58
  }
58
59
  export declare function TagadaProvider({ children, environment, customApiConfig, debugMode, // Remove default, will be set based on environment
59
- localConfig, blockUntilSessionReady, }: TagadaProviderProps): import("react/jsx-runtime").JSX.Element;
60
+ localConfig, blockUntilSessionReady, // Default to new non-blocking behavior
61
+ rawPluginConfig, }: TagadaProviderProps): import("react/jsx-runtime").JSX.Element;
60
62
  export declare function useTagadaContext(): TagadaContextValue;
61
63
  export {};
@@ -38,16 +38,16 @@ const InitializationLoader = () => (_jsxs("div", { style: {
38
38
  borderTop: '1.5px solid #9ca3af',
39
39
  borderRadius: '50%',
40
40
  animation: 'tagada-spin 1s linear infinite',
41
- } }), _jsx("span", { children: "Loading..." }), _jsx("style", { children: `
42
- @keyframes tagada-spin {
43
- 0% { transform: rotate(0deg); }
44
- 100% { transform: rotate(360deg); }
45
- }
41
+ } }), _jsx("span", { children: "Loading..." }), _jsx("style", { children: `
42
+ @keyframes tagada-spin {
43
+ 0% { transform: rotate(0deg); }
44
+ 100% { transform: rotate(360deg); }
45
+ }
46
46
  ` })] }));
47
47
  const TagadaContext = createContext(null);
48
48
  export function TagadaProvider({ children, environment, customApiConfig, debugMode, // Remove default, will be set based on environment
49
49
  localConfig, blockUntilSessionReady = false, // Default to new non-blocking behavior
50
- }) {
50
+ rawPluginConfig, }) {
51
51
  // LOCAL DEV ONLY: Use localConfig override if in local development, otherwise use default
52
52
  const isLocalDev = typeof window !== 'undefined' &&
53
53
  (window.location.hostname === 'localhost' ||
@@ -72,7 +72,7 @@ localConfig, blockUntilSessionReady = false, // Default to new non-blocking beha
72
72
  useEffect(() => {
73
73
  const loadConfig = async () => {
74
74
  try {
75
- const config = await loadPluginConfig(configVariant);
75
+ const config = await loadPluginConfig(configVariant, rawPluginConfig);
76
76
  // Ensure we have required store ID before proceeding
77
77
  if (!config.storeId) {
78
78
  console.warn('⚠️ No store ID found in plugin config. This may cause hooks to fail.');
@@ -83,6 +83,7 @@ localConfig, blockUntilSessionReady = false, // Default to new non-blocking beha
83
83
  accountId: config.accountId,
84
84
  basePath: config.basePath,
85
85
  hasConfig: !!config.config,
86
+ source: rawPluginConfig ? 'raw' : 'file',
86
87
  });
87
88
  if (blockUntilSessionReady) {
88
89
  console.log('⏳ Blocking mode: Children will render after Phase 3 (session init) completes');
@@ -100,7 +101,7 @@ localConfig, blockUntilSessionReady = false, // Default to new non-blocking beha
100
101
  }
101
102
  };
102
103
  void loadConfig();
103
- }, [configVariant]);
104
+ }, [configVariant, rawPluginConfig]);
104
105
  // Extract store/account IDs from plugin config (only source now)
105
106
  const storeId = pluginConfig.storeId;
106
107
  const accountId = pluginConfig.accountId;
@@ -350,58 +351,6 @@ localConfig, blockUntilSessionReady = false, // Default to new non-blocking beha
350
351
  setIsLoading(false);
351
352
  }
352
353
  }, [apiService, hasAttemptedAnonymousToken, initializeSession, finalDebugMode]);
353
- // Initialize token from storage or create anonymous token (extracted to stable callback)
354
- const initializeToken = useCallback(async () => {
355
- try {
356
- console.debug('[SDK] Initializing token...');
357
- setIsLoading(true);
358
- // Check for existing token
359
- const existingToken = getClientToken();
360
- let tokenToUse = null;
361
- // Check URL params for token
362
- const urlParams = new URLSearchParams(window.location.search);
363
- const queryToken = urlParams.get('token');
364
- if (queryToken) {
365
- console.debug('[SDK] Found token in URL params');
366
- tokenToUse = queryToken;
367
- setClientToken(queryToken);
368
- }
369
- else if (existingToken && !isTokenExpired(existingToken)) {
370
- console.debug('[SDK] Using existing token from storage');
371
- tokenToUse = existingToken;
372
- }
373
- else {
374
- console.debug('[SDK] No valid token found');
375
- // Determine storeId for anonymous token
376
- const targetStoreId = storeId || 'default-store';
377
- await createAnonymousToken(targetStoreId);
378
- return;
379
- }
380
- if (tokenToUse) {
381
- setToken(tokenToUse);
382
- // Update the API service with the token
383
- apiService.updateToken(tokenToUse);
384
- // Decode token to get session data
385
- const decodedSession = decodeJWTClient(tokenToUse);
386
- if (decodedSession) {
387
- setSession(decodedSession);
388
- // Initialize session with API call
389
- await initializeSession(decodedSession);
390
- }
391
- else {
392
- console.error('[SDK] Failed to decode token');
393
- setIsInitialized(true);
394
- setIsSessionInitialized(false); // Session failed to initialize
395
- setIsLoading(false);
396
- }
397
- }
398
- }
399
- catch (error) {
400
- console.error('[SDK] Error initializing token:', error);
401
- setIsInitialized(true);
402
- setIsLoading(false);
403
- }
404
- }, [apiService, storeId, createAnonymousToken, initializeSession]);
405
354
  // Initialize token from storage or create anonymous token
406
355
  // This runs in the background after phases 1 & 2 complete, but doesn't block rendering
407
356
  useEffect(() => {
@@ -413,19 +362,59 @@ localConfig, blockUntilSessionReady = false, // Default to new non-blocking beha
413
362
  return;
414
363
  }
415
364
  isInitializing.current = true;
416
- void initializeToken();
417
- }, [storeId, configLoading, initializeToken]);
418
- useEffect(() => {
419
- function onStorage() {
420
- // Re-run initialization when token may have changed in another tab
421
- isInitializing.current = false;
422
- void initializeToken();
423
- }
424
- window.addEventListener('storage', onStorage);
425
- return () => {
426
- window.removeEventListener('storage', onStorage);
365
+ const initializeToken = async () => {
366
+ try {
367
+ console.debug('[SDK] Initializing token...');
368
+ setIsLoading(true);
369
+ // Check for existing token
370
+ const existingToken = getClientToken();
371
+ let tokenToUse = null;
372
+ // Check URL params for token
373
+ const urlParams = new URLSearchParams(window.location.search);
374
+ const queryToken = urlParams.get('token');
375
+ if (queryToken) {
376
+ console.debug('[SDK] Found token in URL params');
377
+ tokenToUse = queryToken;
378
+ setClientToken(queryToken);
379
+ }
380
+ else if (existingToken && !isTokenExpired(existingToken)) {
381
+ console.debug('[SDK] Using existing token from storage');
382
+ tokenToUse = existingToken;
383
+ }
384
+ else {
385
+ console.debug('[SDK] No valid token found');
386
+ // Determine storeId for anonymous token
387
+ const targetStoreId = storeId || 'default-store';
388
+ await createAnonymousToken(targetStoreId);
389
+ return;
390
+ }
391
+ if (tokenToUse) {
392
+ setToken(tokenToUse);
393
+ // Update the API service with the token
394
+ apiService.updateToken(tokenToUse);
395
+ // Decode token to get session data
396
+ const decodedSession = decodeJWTClient(tokenToUse);
397
+ if (decodedSession) {
398
+ setSession(decodedSession);
399
+ // Initialize session with API call
400
+ await initializeSession(decodedSession);
401
+ }
402
+ else {
403
+ console.error('[SDK] Failed to decode token');
404
+ setIsInitialized(true);
405
+ setIsSessionInitialized(false); // Session failed to initialize
406
+ setIsLoading(false);
407
+ }
408
+ }
409
+ }
410
+ catch (error) {
411
+ console.error('[SDK] Error initializing token:', error);
412
+ setIsInitialized(true);
413
+ setIsLoading(false);
414
+ }
427
415
  };
428
- }, [initializeToken]);
416
+ void initializeToken();
417
+ }, [storeId, createAnonymousToken, initializeSession, configLoading]);
429
418
  // Update auth state when customer/session changes
430
419
  useEffect(() => {
431
420
  setAuth({
@@ -150,71 +150,3 @@ export interface Order {
150
150
  };
151
151
  relatedOrders?: Order[];
152
152
  }
153
- export interface CustomerAddress {
154
- company?: string;
155
- firstName: string;
156
- lastName: string;
157
- address1: string;
158
- city: string;
159
- country: string;
160
- state: string;
161
- postal: string;
162
- phone?: string;
163
- email?: string;
164
- }
165
- export interface CustomerOrderSummary {
166
- id: string;
167
- storeId: string;
168
- accountId: string;
169
- createdAt: string;
170
- updatedAt: string;
171
- status: string;
172
- cancelledAt: string | null;
173
- cancelledReason: string | null;
174
- paidAt: string | null;
175
- paidAmount: number | null;
176
- openAt: string | null;
177
- abandonedAt: string | null;
178
- currency: string;
179
- externalCustomerType: string | null;
180
- externalCustomerId: string | null;
181
- externalOrderId: string | null;
182
- billingAddress: CustomerAddress;
183
- shippingAddress: Omit<CustomerAddress, 'email'>;
184
- pickupAddress: any | null;
185
- taxesIncluded: boolean;
186
- draft: boolean;
187
- checkoutSessionId: string | null;
188
- sessionHash: string | null;
189
- customerId: string;
190
- createdFrom: string | null;
191
- paymentInstrumentId: string | null;
192
- refundedAt: string | null;
193
- refundedAmount: number | null;
194
- metadata?: Record<string, any>;
195
- }
196
- export interface CustomerInfos {
197
- customer: {
198
- id: string;
199
- email: string | null;
200
- firstName: string | null;
201
- lastName: string | null;
202
- externalCustomerId: string | null;
203
- lastOrderId: string | null;
204
- accountId: string;
205
- storeId: string;
206
- billingAddress: CustomerAddress | null;
207
- shippingAddress: Omit<CustomerAddress, 'email'> | null;
208
- currency: string | null;
209
- locale: string | null;
210
- draft: boolean;
211
- acceptsMarketing: boolean;
212
- createdAt: string;
213
- updatedAt: string;
214
- metadata: Record<string, any>;
215
- device: any | null;
216
- orders: CustomerOrderSummary[];
217
- subscriptions: any[];
218
- };
219
- promotionCodes: any[];
220
- }
@@ -10,7 +10,6 @@ export function setClientToken(token) {
10
10
  if (typeof window !== 'undefined') {
11
11
  try {
12
12
  localStorage.setItem(TOKEN_KEY, token);
13
- window.dispatchEvent(new Event('storage'));
14
13
  }
15
14
  catch (error) {
16
15
  console.error('Failed to save token to localStorage:', error);
package/package.json CHANGED
@@ -1,83 +1,83 @@
1
- {
2
- "name": "@tagadapay/plugin-sdk",
3
- "version": "2.4.32",
4
- "description": "Modern React SDK for building Tagada Pay plugins",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "exports": {
8
- ".": {
9
- "types": "./dist/index.d.ts",
10
- "import": "./dist/index.js",
11
- "require": "./dist/index.js"
12
- },
13
- "./react": {
14
- "types": "./dist/react/index.d.ts",
15
- "import": "./dist/react/index.js",
16
- "require": "./dist/react/index.js"
17
- }
18
- },
19
- "scripts": {
20
- "build": "tsc",
21
- "clean": "rm -rf dist",
22
- "lint": "echo \"No linting configured\"",
23
- "test": "echo \"No tests yet\" && exit 0",
24
- "dev": "tsc --watch",
25
- "prepublishOnly": "npm run clean && npm run build",
26
- "publish:patch": "npm version patch && npm publish",
27
- "publish:minor": "npm version minor && npm publish",
28
- "publish:major": "npm version major && npm publish",
29
- "publish:beta": "npm version prerelease --preid=beta && npm publish --tag beta",
30
- "publish:alpha": "npm version prerelease --preid=alpha && npm publish --tag alpha",
31
- "version:patch": "npm version patch",
32
- "version:minor": "npm version minor",
33
- "version:major": "npm version major",
34
- "version:beta": "npm version prerelease --preid=beta",
35
- "version:alpha": "npm version prerelease --preid=alpha",
36
- "version:check": "node version-sync.js check",
37
- "version:sync": "node version-sync.js sync",
38
- "version:list": "node version-sync.js list",
39
- "version:next": "node version-sync.js next",
40
- "postversion": "echo \"✅ Version updated to $(node -p 'require(\"./package.json\").version')\" && git push && git push --tags"
41
- },
42
- "keywords": [
43
- "tagadapay",
44
- "cms",
45
- "plugin",
46
- "sdk",
47
- "react",
48
- "typescript"
49
- ],
50
- "author": "Tagada Pay",
51
- "license": "MIT",
52
- "dependencies": {
53
- "@basis-theory/apple-pay-js": "^2.0.2",
54
- "@basis-theory/basis-theory-js": "^4.30.0",
55
- "@basis-theory/basis-theory-react": "^1.32.5",
56
- "@basis-theory/web-threeds": "^1.0.1",
57
- "axios": "^1.6.0",
58
- "iso3166-2-db": "^2.3.11",
59
- "react-intl": "^7.1.11"
60
- },
61
- "devDependencies": {
62
- "@types/node": "^18.0.0",
63
- "@types/react": "^19",
64
- "@types/react-dom": "^19",
65
- "typescript": "^5.0.0"
66
- },
67
- "peerDependencies": {
68
- "react": "^18.0.0 || ^19.0.0",
69
- "react-dom": "^18.0.0 || ^19.0.0"
70
- },
71
- "files": [
72
- "dist/**/*",
73
- "README.md"
74
- ],
75
- "repository": {
76
- "type": "git",
77
- "url": "git+https://github.com/tagadapay/plugin-sdk.git"
78
- },
79
- "bugs": {
80
- "url": "https://github.com/tagadapay/plugin-sdk/issues"
81
- },
82
- "homepage": "https://github.com/tagadapay/plugin-sdk#readme"
83
- }
1
+ {
2
+ "name": "@tagadapay/plugin-sdk",
3
+ "version": "2.4.35",
4
+ "description": "Modern React SDK for building Tagada Pay plugins",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js",
11
+ "require": "./dist/index.js"
12
+ },
13
+ "./react": {
14
+ "types": "./dist/react/index.d.ts",
15
+ "import": "./dist/react/index.js",
16
+ "require": "./dist/react/index.js"
17
+ }
18
+ },
19
+ "scripts": {
20
+ "build": "tsc",
21
+ "clean": "rm -rf dist",
22
+ "lint": "echo \"No linting configured\"",
23
+ "test": "echo \"No tests yet\" && exit 0",
24
+ "dev": "tsc --watch",
25
+ "prepublishOnly": "npm run clean && npm run build",
26
+ "publish:patch": "npm version patch && npm publish",
27
+ "publish:minor": "npm version minor && npm publish",
28
+ "publish:major": "npm version major && npm publish",
29
+ "publish:beta": "npm version prerelease --preid=beta && npm publish --tag beta",
30
+ "publish:alpha": "npm version prerelease --preid=alpha && npm publish --tag alpha",
31
+ "version:patch": "npm version patch",
32
+ "version:minor": "npm version minor",
33
+ "version:major": "npm version major",
34
+ "version:beta": "npm version prerelease --preid=beta",
35
+ "version:alpha": "npm version prerelease --preid=alpha",
36
+ "version:check": "node version-sync.js check",
37
+ "version:sync": "node version-sync.js sync",
38
+ "version:list": "node version-sync.js list",
39
+ "version:next": "node version-sync.js next",
40
+ "postversion": "echo \"✅ Version updated to $(node -p 'require(\"./package.json\").version')\" && git push && git push --tags"
41
+ },
42
+ "keywords": [
43
+ "tagadapay",
44
+ "cms",
45
+ "plugin",
46
+ "sdk",
47
+ "react",
48
+ "typescript"
49
+ ],
50
+ "author": "Tagada Pay",
51
+ "license": "MIT",
52
+ "dependencies": {
53
+ "@basis-theory/apple-pay-js": "^2.0.2",
54
+ "@basis-theory/basis-theory-js": "^4.30.0",
55
+ "@basis-theory/basis-theory-react": "^1.32.5",
56
+ "@basis-theory/web-threeds": "^1.0.1",
57
+ "axios": "^1.6.0",
58
+ "iso3166-2-db": "^2.3.11",
59
+ "react-intl": "^7.1.11"
60
+ },
61
+ "devDependencies": {
62
+ "@types/node": "^18.0.0",
63
+ "@types/react": "^19",
64
+ "@types/react-dom": "^19",
65
+ "typescript": "^5.0.0"
66
+ },
67
+ "peerDependencies": {
68
+ "react": "^18.0.0 || ^19.0.0",
69
+ "react-dom": "^18.0.0 || ^19.0.0"
70
+ },
71
+ "files": [
72
+ "dist/**/*",
73
+ "README.md"
74
+ ],
75
+ "repository": {
76
+ "type": "git",
77
+ "url": "git+https://github.com/tagadapay/plugin-sdk.git"
78
+ },
79
+ "bugs": {
80
+ "url": "https://github.com/tagadapay/plugin-sdk/issues"
81
+ },
82
+ "homepage": "https://github.com/tagadapay/plugin-sdk#readme"
83
+ }
@@ -1,50 +0,0 @@
1
- export declare const countries: ({
2
- name: string;
3
- 'alpha-2': string;
4
- 'alpha-3': string;
5
- 'country-code': string;
6
- 'iso_3166-2': string;
7
- region: string;
8
- 'sub-region': string;
9
- 'intermediate-region': string;
10
- 'region-code': string;
11
- 'sub-region-code': string;
12
- 'intermediate-region-code': string;
13
- } | {
14
- name: string;
15
- 'alpha-2': string;
16
- 'alpha-3': string;
17
- 'country-code': string;
18
- 'iso_3166-2': string;
19
- region: null;
20
- 'sub-region': null;
21
- 'intermediate-region': null;
22
- 'region-code': null;
23
- 'sub-region-code': null;
24
- 'intermediate-region-code': null;
25
- })[];
26
- export declare const states: ({
27
- state_name: string;
28
- country_id: number;
29
- country_code: string;
30
- state_code: string;
31
- type: null;
32
- } | {
33
- state_name: string;
34
- country_id: number;
35
- country_code: string;
36
- state_code: string;
37
- type: string;
38
- } | {
39
- state_name: string;
40
- country_id: null;
41
- country_code?: undefined;
42
- state_code?: undefined;
43
- type?: undefined;
44
- } | {
45
- state_name: string;
46
- country_id: null;
47
- country_code: string;
48
- state_code: string;
49
- type: string;
50
- })[];