@tagadapay/plugin-sdk 2.6.0 → 2.6.4
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/README.md +1090 -623
- package/dist/react/hooks/useCustomerInfos.d.ts +15 -0
- package/dist/react/hooks/useCustomerInfos.js +54 -0
- package/dist/react/hooks/useCustomerOrders.d.ts +14 -0
- package/dist/react/hooks/useCustomerOrders.js +51 -0
- package/dist/react/hooks/useCustomerSubscriptions.d.ts +56 -0
- package/dist/react/hooks/useCustomerSubscriptions.js +77 -0
- package/dist/react/hooks/{useExpressPayment.d.ts → useExpressPaymentMethods.d.ts} +13 -10
- package/dist/react/hooks/{useExpressPayment.js → useExpressPaymentMethods.js} +17 -8
- package/dist/react/hooks/useLogin.js +1 -1
- package/dist/react/index.d.ts +11 -7
- package/dist/react/index.js +8 -4
- package/dist/react/providers/TagadaProvider.js +69 -57
- package/dist/react/types.d.ts +109 -0
- package/dist/react/utils/tokenStorage.js +1 -0
- package/dist/v2/core/googleAutocomplete.js +10 -4
- package/dist/v2/core/resources/checkout.d.ts +1 -0
- package/dist/v2/core/resources/checkout.js +1 -0
- package/dist/v2/react/hooks/useCheckoutQuery.d.ts +1 -0
- package/dist/v2/react/hooks/useCheckoutQuery.js +79 -4
- package/dist/v2/react/hooks/useOrderBumpQuery.d.ts +0 -1
- package/dist/v2/react/hooks/useOrderBumpQuery.js +6 -5
- package/dist/v2/react/providers/TagadaProvider.js +5 -5
- package/package.json +90 -90
package/dist/react/types.d.ts
CHANGED
|
@@ -150,3 +150,112 @@ export interface Order {
|
|
|
150
150
|
};
|
|
151
151
|
relatedOrders?: Order[];
|
|
152
152
|
}
|
|
153
|
+
export interface PaymentSummary {
|
|
154
|
+
id: string;
|
|
155
|
+
status: string;
|
|
156
|
+
amount: number;
|
|
157
|
+
currency: string;
|
|
158
|
+
createdAt: string;
|
|
159
|
+
updatedAt?: string;
|
|
160
|
+
provider?: string;
|
|
161
|
+
metadata?: Record<string, any>;
|
|
162
|
+
}
|
|
163
|
+
export interface PromotionSummary {
|
|
164
|
+
id: string;
|
|
165
|
+
code?: string | null;
|
|
166
|
+
type?: string;
|
|
167
|
+
amount?: number;
|
|
168
|
+
description?: string | null;
|
|
169
|
+
}
|
|
170
|
+
export interface OrderAdjustmentSummary {
|
|
171
|
+
type: string;
|
|
172
|
+
amount: number;
|
|
173
|
+
description: string;
|
|
174
|
+
}
|
|
175
|
+
export interface OrderWithRelations extends Order {
|
|
176
|
+
customer?: Customer;
|
|
177
|
+
store?: Store;
|
|
178
|
+
account?: {
|
|
179
|
+
id: string;
|
|
180
|
+
name?: string;
|
|
181
|
+
} | undefined;
|
|
182
|
+
items: OrderItem[];
|
|
183
|
+
payments?: PaymentSummary[];
|
|
184
|
+
summaries: OrderSummary[];
|
|
185
|
+
checkoutSession?: {
|
|
186
|
+
id?: string;
|
|
187
|
+
returnUrl?: string;
|
|
188
|
+
[key: string]: any;
|
|
189
|
+
};
|
|
190
|
+
promotions?: PromotionSummary[];
|
|
191
|
+
subscriptions?: any[];
|
|
192
|
+
adjustments: OrderAdjustmentSummary[];
|
|
193
|
+
}
|
|
194
|
+
export interface CustomerAddress {
|
|
195
|
+
company?: string;
|
|
196
|
+
firstName: string;
|
|
197
|
+
lastName: string;
|
|
198
|
+
address1: string;
|
|
199
|
+
city: string;
|
|
200
|
+
country: string;
|
|
201
|
+
state: string;
|
|
202
|
+
postal: string;
|
|
203
|
+
phone?: string;
|
|
204
|
+
email?: string;
|
|
205
|
+
}
|
|
206
|
+
export interface CustomerOrderSummary {
|
|
207
|
+
id: string;
|
|
208
|
+
storeId: string;
|
|
209
|
+
accountId: string;
|
|
210
|
+
createdAt: string;
|
|
211
|
+
updatedAt: string;
|
|
212
|
+
status: string;
|
|
213
|
+
cancelledAt: string | null;
|
|
214
|
+
cancelledReason: string | null;
|
|
215
|
+
paidAt: string | null;
|
|
216
|
+
paidAmount: number | null;
|
|
217
|
+
openAt: string | null;
|
|
218
|
+
abandonedAt: string | null;
|
|
219
|
+
currency: string;
|
|
220
|
+
externalCustomerType: string | null;
|
|
221
|
+
externalCustomerId: string | null;
|
|
222
|
+
externalOrderId: string | null;
|
|
223
|
+
billingAddress: CustomerAddress;
|
|
224
|
+
shippingAddress: Omit<CustomerAddress, 'email'>;
|
|
225
|
+
pickupAddress: any | null;
|
|
226
|
+
taxesIncluded: boolean;
|
|
227
|
+
draft: boolean;
|
|
228
|
+
checkoutSessionId: string | null;
|
|
229
|
+
sessionHash: string | null;
|
|
230
|
+
customerId: string;
|
|
231
|
+
createdFrom: string | null;
|
|
232
|
+
paymentInstrumentId: string | null;
|
|
233
|
+
refundedAt: string | null;
|
|
234
|
+
refundedAmount: number | null;
|
|
235
|
+
metadata?: Record<string, any>;
|
|
236
|
+
}
|
|
237
|
+
export interface CustomerInfos {
|
|
238
|
+
customer: {
|
|
239
|
+
id: string;
|
|
240
|
+
email: string | null;
|
|
241
|
+
firstName: string | null;
|
|
242
|
+
lastName: string | null;
|
|
243
|
+
externalCustomerId: string | null;
|
|
244
|
+
lastOrderId: string | null;
|
|
245
|
+
accountId: string;
|
|
246
|
+
storeId: string;
|
|
247
|
+
billingAddress: CustomerAddress | null;
|
|
248
|
+
shippingAddress: Omit<CustomerAddress, 'email'> | null;
|
|
249
|
+
currency: string | null;
|
|
250
|
+
locale: string | null;
|
|
251
|
+
draft: boolean;
|
|
252
|
+
acceptsMarketing: boolean;
|
|
253
|
+
createdAt: string;
|
|
254
|
+
updatedAt: string;
|
|
255
|
+
metadata: Record<string, any>;
|
|
256
|
+
device: any | null;
|
|
257
|
+
orders: CustomerOrderSummary[];
|
|
258
|
+
subscriptions: any[];
|
|
259
|
+
};
|
|
260
|
+
promotionCodes: any[];
|
|
261
|
+
}
|
|
@@ -10,6 +10,7 @@ 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'));
|
|
13
14
|
}
|
|
14
15
|
catch (error) {
|
|
15
16
|
console.error('Failed to save token to localStorage:', error);
|
|
@@ -8,7 +8,7 @@ export class GoogleAutocompleteCore {
|
|
|
8
8
|
*/
|
|
9
9
|
static initialize(apiKey) {
|
|
10
10
|
this.apiKey = apiKey;
|
|
11
|
-
if (typeof window !== 'undefined' && window.google) {
|
|
11
|
+
if (typeof window !== 'undefined' && window.google?.maps?.places) {
|
|
12
12
|
this.service = new window.google.maps.places.AutocompleteService();
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -25,7 +25,10 @@ export class GoogleAutocompleteCore {
|
|
|
25
25
|
types: options.types || ['address'],
|
|
26
26
|
componentRestrictions: options.componentRestrictions,
|
|
27
27
|
}, (predictions, status) => {
|
|
28
|
-
if (
|
|
28
|
+
if (typeof window !== 'undefined' &&
|
|
29
|
+
window.google?.maps?.places &&
|
|
30
|
+
status === window.google.maps.places.PlacesServiceStatus.OK &&
|
|
31
|
+
predictions) {
|
|
29
32
|
resolve(predictions);
|
|
30
33
|
}
|
|
31
34
|
else {
|
|
@@ -38,7 +41,7 @@ export class GoogleAutocompleteCore {
|
|
|
38
41
|
* Get place details
|
|
39
42
|
*/
|
|
40
43
|
static async getPlaceDetails(placeId) {
|
|
41
|
-
if (typeof window === 'undefined' || !window.google) {
|
|
44
|
+
if (typeof window === 'undefined' || !window.google?.maps?.places) {
|
|
42
45
|
return null;
|
|
43
46
|
}
|
|
44
47
|
return new Promise((resolve, reject) => {
|
|
@@ -47,7 +50,10 @@ export class GoogleAutocompleteCore {
|
|
|
47
50
|
placeId,
|
|
48
51
|
fields: ['place_id', 'formatted_address', 'address_components', 'geometry'],
|
|
49
52
|
}, (place, status) => {
|
|
50
|
-
if (
|
|
53
|
+
if (typeof window !== 'undefined' &&
|
|
54
|
+
window.google?.maps?.places &&
|
|
55
|
+
status === window.google.maps.places.PlacesServiceStatus.OK &&
|
|
56
|
+
place) {
|
|
51
57
|
resolve(place);
|
|
52
58
|
}
|
|
53
59
|
else {
|
|
@@ -10,6 +10,7 @@ export class CheckoutResource {
|
|
|
10
10
|
* Initialize a new checkout session
|
|
11
11
|
*/
|
|
12
12
|
async initCheckout(params) {
|
|
13
|
+
// Pass all params including customerId to prevent duplicate customer creation
|
|
13
14
|
return this.apiClient.post('/api/v1/checkout/session/init', params);
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
@@ -19,6 +19,7 @@ export interface UseCheckoutQueryResult {
|
|
|
19
19
|
}>;
|
|
20
20
|
refresh: () => Promise<void>;
|
|
21
21
|
updateLineItems: (lineItems: CheckoutLineItem[]) => Promise<any>;
|
|
22
|
+
updateLineItemsOptimistic: (lineItems: CheckoutLineItem[]) => void;
|
|
22
23
|
setItemQuantity: (variantId: string, quantity: number, priceId?: string) => Promise<any>;
|
|
23
24
|
updateCustomer: (data: {
|
|
24
25
|
email: string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Checkout Hook using TanStack Query
|
|
3
3
|
* Replaces the coordinator pattern with automatic cache invalidation
|
|
4
4
|
*/
|
|
5
|
-
import { useCallback, useState, useEffect, useMemo } from 'react';
|
|
5
|
+
import { useCallback, useState, useEffect, useMemo, useRef } from 'react';
|
|
6
6
|
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
7
7
|
import { CheckoutResource } from '../../core/resources/checkout';
|
|
8
8
|
import { useTagadaContext } from '../providers/TagadaProvider';
|
|
@@ -14,7 +14,46 @@ export function useCheckoutQuery(options = {}) {
|
|
|
14
14
|
const { storeId } = usePluginConfig();
|
|
15
15
|
const currency = useCurrency();
|
|
16
16
|
const queryClient = useQueryClient();
|
|
17
|
-
const { isSessionInitialized } = useTagadaContext();
|
|
17
|
+
const { isSessionInitialized, session } = useTagadaContext();
|
|
18
|
+
// Track pending session promises to avoid creating multiple promises
|
|
19
|
+
const pendingSessionPromise = useRef(null);
|
|
20
|
+
const sessionResolvers = useRef(new Set());
|
|
21
|
+
// Resolve all pending promises when session becomes ready
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (isSessionInitialized && sessionResolvers.current.size > 0) {
|
|
24
|
+
console.log('✅ [useCheckout] CMS session ready, resolving pending promises');
|
|
25
|
+
sessionResolvers.current.forEach(resolve => resolve());
|
|
26
|
+
sessionResolvers.current.clear();
|
|
27
|
+
pendingSessionPromise.current = null;
|
|
28
|
+
}
|
|
29
|
+
}, [isSessionInitialized]);
|
|
30
|
+
// Clean, event-driven session waiting - no polling needed
|
|
31
|
+
const waitForSession = useCallback(async () => {
|
|
32
|
+
if (isSessionInitialized) {
|
|
33
|
+
return Promise.resolve();
|
|
34
|
+
}
|
|
35
|
+
// Reuse existing promise if one is pending
|
|
36
|
+
if (pendingSessionPromise.current) {
|
|
37
|
+
return pendingSessionPromise.current;
|
|
38
|
+
}
|
|
39
|
+
console.log('⏳ [useCheckout] Waiting for CMS session to be initialized...');
|
|
40
|
+
// Create new promise that will be resolved by useEffect above
|
|
41
|
+
pendingSessionPromise.current = new Promise((resolve, reject) => {
|
|
42
|
+
// Add resolver to set for useEffect to call
|
|
43
|
+
sessionResolvers.current.add(resolve);
|
|
44
|
+
// Safety timeout
|
|
45
|
+
setTimeout(() => {
|
|
46
|
+
if (sessionResolvers.current.has(resolve)) {
|
|
47
|
+
sessionResolvers.current.delete(resolve);
|
|
48
|
+
if (sessionResolvers.current.size === 0) {
|
|
49
|
+
pendingSessionPromise.current = null;
|
|
50
|
+
}
|
|
51
|
+
reject(new Error('Session initialization timeout. Please refresh the page and try again.'));
|
|
52
|
+
}
|
|
53
|
+
}, 10000);
|
|
54
|
+
});
|
|
55
|
+
return pendingSessionPromise.current;
|
|
56
|
+
}, [isSessionInitialized]);
|
|
18
57
|
// Create checkout resource client
|
|
19
58
|
const checkoutResource = useMemo(() => {
|
|
20
59
|
try {
|
|
@@ -55,6 +94,8 @@ export function useCheckoutQuery(options = {}) {
|
|
|
55
94
|
...params,
|
|
56
95
|
storeId: params.storeId || storeId,
|
|
57
96
|
returnUrl: params.returnUrl || window.location.origin,
|
|
97
|
+
// Include customerId from session to prevent duplicate customer creation
|
|
98
|
+
customerId: params.customerId || session?.customerId,
|
|
58
99
|
customer: {
|
|
59
100
|
...params.customer,
|
|
60
101
|
currency: params.customer?.currency ?? currency.code,
|
|
@@ -75,7 +116,7 @@ export function useCheckoutQuery(options = {}) {
|
|
|
75
116
|
},
|
|
76
117
|
});
|
|
77
118
|
// Order bump functionality removed - use useOrderBumpQuery instead
|
|
78
|
-
// Line items mutation
|
|
119
|
+
// Line items mutation with optimistic updates
|
|
79
120
|
const lineItemsMutation = useMutation({
|
|
80
121
|
mutationFn: ({ lineItems }) => {
|
|
81
122
|
if (!checkout?.checkoutSession?.id) {
|
|
@@ -83,7 +124,38 @@ export function useCheckoutQuery(options = {}) {
|
|
|
83
124
|
}
|
|
84
125
|
return checkoutResource.updateLineItems(checkout.checkoutSession.id, lineItems);
|
|
85
126
|
},
|
|
86
|
-
|
|
127
|
+
onMutate: async ({ lineItems }) => {
|
|
128
|
+
// Cancel any outgoing refetches (so they don't overwrite our optimistic update)
|
|
129
|
+
await queryClient.cancelQueries({ queryKey: ['checkout', checkoutToken] });
|
|
130
|
+
// Snapshot the previous value
|
|
131
|
+
const previousCheckout = queryClient.getQueryData(['checkout', checkoutToken]);
|
|
132
|
+
// Optimistically update the checkout data
|
|
133
|
+
if (previousCheckout && checkout?.checkoutSession?.id) {
|
|
134
|
+
const optimisticCheckout = {
|
|
135
|
+
...previousCheckout,
|
|
136
|
+
checkoutSession: {
|
|
137
|
+
...previousCheckout.checkoutSession,
|
|
138
|
+
sessionLineItems: lineItems.map(item => ({
|
|
139
|
+
variantId: item.variantId,
|
|
140
|
+
quantity: item.quantity,
|
|
141
|
+
priceId: item.priceId,
|
|
142
|
+
isOrderBump: false, // Default for line items
|
|
143
|
+
})),
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
queryClient.setQueryData(['checkout', checkoutToken], optimisticCheckout);
|
|
147
|
+
}
|
|
148
|
+
// Return a context object with the snapshotted value
|
|
149
|
+
return { previousCheckout };
|
|
150
|
+
},
|
|
151
|
+
onError: (err, _variables, context) => {
|
|
152
|
+
// If the mutation fails, use the context returned from onMutate to roll back
|
|
153
|
+
if (context && typeof context === 'object' && 'previousCheckout' in context) {
|
|
154
|
+
queryClient.setQueryData(['checkout', checkoutToken], context.previousCheckout);
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
onSettled: () => {
|
|
158
|
+
// Always refetch after error or success to ensure we have the latest data
|
|
87
159
|
if (checkoutToken) {
|
|
88
160
|
void queryClient.invalidateQueries({ queryKey: ['checkout', checkoutToken] });
|
|
89
161
|
}
|
|
@@ -173,6 +245,8 @@ export function useCheckoutQuery(options = {}) {
|
|
|
173
245
|
isSuccess,
|
|
174
246
|
// Actions
|
|
175
247
|
init: async (params) => {
|
|
248
|
+
// Wait for session to be initialized to ensure we have customerId
|
|
249
|
+
await waitForSession();
|
|
176
250
|
const result = await initMutation.mutateAsync(params);
|
|
177
251
|
// Update internal token state so the query can fetch the checkout data
|
|
178
252
|
setInternalToken(result.checkoutToken);
|
|
@@ -185,6 +259,7 @@ export function useCheckoutQuery(options = {}) {
|
|
|
185
259
|
refresh,
|
|
186
260
|
// Checkout operations
|
|
187
261
|
updateLineItems: (lineItems) => lineItemsMutation.mutateAsync({ lineItems }),
|
|
262
|
+
updateLineItemsOptimistic: (lineItems) => lineItemsMutation.mutate({ lineItems }),
|
|
188
263
|
setItemQuantity: (variantId, quantity, priceId) => quantityMutation.mutateAsync({ variantId, quantity, priceId }),
|
|
189
264
|
updateCustomer: (data) => customerMutation.mutateAsync(data),
|
|
190
265
|
updateCustomerAndSessionInfo: (data) => customerAndSessionMutation.mutateAsync(data),
|
|
@@ -6,7 +6,7 @@ import { useState, useCallback, useEffect } from 'react';
|
|
|
6
6
|
import { useApiMutation, useInvalidateQuery, getGlobalApiClient } from './useApiQuery';
|
|
7
7
|
import { useCheckoutQuery } from './useCheckoutQuery';
|
|
8
8
|
export function useOrderBumpQuery(options) {
|
|
9
|
-
const { checkoutToken, offerId,
|
|
9
|
+
const { checkoutToken, offerId, checkout: providedCheckout } = options;
|
|
10
10
|
const { invalidateCheckout, invalidatePromotions } = useInvalidateQuery();
|
|
11
11
|
const client = getGlobalApiClient();
|
|
12
12
|
// Use checkout query only if no checkout is provided
|
|
@@ -23,11 +23,12 @@ export function useOrderBumpQuery(options) {
|
|
|
23
23
|
if (!checkout?.checkoutSession?.sessionLineItems) {
|
|
24
24
|
return false;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
// Check if any order bump items exist in sessionLineItems
|
|
27
|
+
// The offerId is the upsell offer ID, but we check for isOrderBump === true
|
|
27
28
|
return checkout.checkoutSession.sessionLineItems.some((item) => {
|
|
28
|
-
return item.isOrderBump === true
|
|
29
|
+
return item.isOrderBump === true;
|
|
29
30
|
});
|
|
30
|
-
}, [checkout?.checkoutSession?.sessionLineItems
|
|
31
|
+
}, [checkout?.checkoutSession?.sessionLineItems]);
|
|
31
32
|
// State management
|
|
32
33
|
const [isSelected, setIsSelected] = useState(() => checkOrderBumpSelection());
|
|
33
34
|
const [error, setError] = useState(null);
|
|
@@ -82,7 +83,7 @@ export function useOrderBumpQuery(options) {
|
|
|
82
83
|
const error = err instanceof Error ? err : new Error('Failed to toggle order bump');
|
|
83
84
|
return { success: false, error: error.message };
|
|
84
85
|
}
|
|
85
|
-
}, [checkout?.checkoutSession?.id, isSelected, toggleMutation, offerId,
|
|
86
|
+
}, [checkout?.checkoutSession?.id, isSelected, toggleMutation, offerId, checkoutToken, actualCheckoutToken]);
|
|
86
87
|
return {
|
|
87
88
|
isSelected,
|
|
88
89
|
isToggling: toggleMutation.isPending,
|
|
@@ -41,11 +41,11 @@ const InitializationLoader = () => (_jsxs("div", { style: {
|
|
|
41
41
|
borderTop: '1.5px solid #9ca3af',
|
|
42
42
|
borderRadius: '50%',
|
|
43
43
|
animation: 'tagada-spin 1s linear infinite',
|
|
44
|
-
} }), _jsx("span", { children: "Loading..." }), _jsx("style", { children: `
|
|
45
|
-
@keyframes tagada-spin {
|
|
46
|
-
0% { transform: rotate(0deg); }
|
|
47
|
-
100% { transform: rotate(360deg); }
|
|
48
|
-
}
|
|
44
|
+
} }), _jsx("span", { children: "Loading..." }), _jsx("style", { children: `
|
|
45
|
+
@keyframes tagada-spin {
|
|
46
|
+
0% { transform: rotate(0deg); }
|
|
47
|
+
100% { transform: rotate(360deg); }
|
|
48
|
+
}
|
|
49
49
|
` })] }));
|
|
50
50
|
const TagadaContext = createContext(null);
|
|
51
51
|
// Global instance tracking for TagadaProvider
|
package/package.json
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tagadapay/plugin-sdk",
|
|
3
|
-
"version": "2.6.
|
|
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
|
-
"./v2": {
|
|
19
|
-
"types": "./dist/v2/index.d.ts",
|
|
20
|
-
"import": "./dist/v2/index.js",
|
|
21
|
-
"require": "./dist/v2/index.js"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"scripts": {
|
|
25
|
-
"build": "tsc",
|
|
26
|
-
"clean": "rm -rf dist",
|
|
27
|
-
"lint": "echo \"No linting configured\"",
|
|
28
|
-
"test": "echo \"No tests yet\" && exit 0",
|
|
29
|
-
"dev": "tsc --watch",
|
|
30
|
-
"prepublishOnly": "npm run clean && npm run build",
|
|
31
|
-
"publish:patch": "npm version patch && npm publish",
|
|
32
|
-
"publish:minor": "npm version minor && npm publish",
|
|
33
|
-
"publish:major": "npm version major && npm publish",
|
|
34
|
-
"publish:beta": "npm version prerelease --preid=beta && npm publish --tag beta",
|
|
35
|
-
"publish:alpha": "npm version prerelease --preid=alpha && npm publish --tag alpha",
|
|
36
|
-
"version:patch": "npm version patch",
|
|
37
|
-
"version:minor": "npm version minor",
|
|
38
|
-
"version:major": "npm version major",
|
|
39
|
-
"version:beta": "npm version prerelease --preid=beta",
|
|
40
|
-
"version:alpha": "npm version prerelease --preid=alpha",
|
|
41
|
-
"version:check": "node version-sync.js check",
|
|
42
|
-
"version:sync": "node version-sync.js sync",
|
|
43
|
-
"version:list": "node version-sync.js list",
|
|
44
|
-
"version:next": "node version-sync.js next",
|
|
45
|
-
"postversion": "echo \"✅ Version updated to $(node -p 'require(\"./package.json\").version')\" && git push && git push --tags"
|
|
46
|
-
},
|
|
47
|
-
"keywords": [
|
|
48
|
-
"tagadapay",
|
|
49
|
-
"cms",
|
|
50
|
-
"plugin",
|
|
51
|
-
"sdk",
|
|
52
|
-
"react",
|
|
53
|
-
"typescript"
|
|
54
|
-
],
|
|
55
|
-
"author": "Tagada Pay",
|
|
56
|
-
"license": "MIT",
|
|
57
|
-
"dependencies": {
|
|
58
|
-
"@basis-theory/apple-pay-js": "^2.0.2",
|
|
59
|
-
"@basis-theory/basis-theory-js": "^4.30.0",
|
|
60
|
-
"@basis-theory/basis-theory-react": "^1.32.5",
|
|
61
|
-
"@basis-theory/web-threeds": "^1.0.1",
|
|
62
|
-
"@tanstack/react-query": "^5.90.2",
|
|
63
|
-
"axios": "^1.10.0",
|
|
64
|
-
"iso3166-2-db": "^2.3.11",
|
|
65
|
-
"react-intl": "^7.1.11",
|
|
66
|
-
"swr": "^2.3.6"
|
|
67
|
-
},
|
|
68
|
-
"devDependencies": {
|
|
69
|
-
"@types/node": "^18.0.0",
|
|
70
|
-
"@types/react": "^19",
|
|
71
|
-
"@types/react-dom": "^19",
|
|
72
|
-
"typescript": "^5.0.0"
|
|
73
|
-
},
|
|
74
|
-
"peerDependencies": {
|
|
75
|
-
"react": "^18.0.0 || ^19.0.0",
|
|
76
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
|
77
|
-
},
|
|
78
|
-
"files": [
|
|
79
|
-
"dist/**/*",
|
|
80
|
-
"README.md"
|
|
81
|
-
],
|
|
82
|
-
"repository": {
|
|
83
|
-
"type": "git",
|
|
84
|
-
"url": "git+https://github.com/tagadapay/plugin-sdk.git"
|
|
85
|
-
},
|
|
86
|
-
"bugs": {
|
|
87
|
-
"url": "https://github.com/tagadapay/plugin-sdk/issues"
|
|
88
|
-
},
|
|
89
|
-
"homepage": "https://github.com/tagadapay/plugin-sdk#readme"
|
|
90
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@tagadapay/plugin-sdk",
|
|
3
|
+
"version": "2.6.4",
|
|
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
|
+
"./v2": {
|
|
19
|
+
"types": "./dist/v2/index.d.ts",
|
|
20
|
+
"import": "./dist/v2/index.js",
|
|
21
|
+
"require": "./dist/v2/index.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc",
|
|
26
|
+
"clean": "rm -rf dist",
|
|
27
|
+
"lint": "echo \"No linting configured\"",
|
|
28
|
+
"test": "echo \"No tests yet\" && exit 0",
|
|
29
|
+
"dev": "tsc --watch",
|
|
30
|
+
"prepublishOnly": "npm run clean && npm run build",
|
|
31
|
+
"publish:patch": "npm version patch && npm publish",
|
|
32
|
+
"publish:minor": "npm version minor && npm publish",
|
|
33
|
+
"publish:major": "npm version major && npm publish",
|
|
34
|
+
"publish:beta": "npm version prerelease --preid=beta && npm publish --tag beta",
|
|
35
|
+
"publish:alpha": "npm version prerelease --preid=alpha && npm publish --tag alpha",
|
|
36
|
+
"version:patch": "npm version patch",
|
|
37
|
+
"version:minor": "npm version minor",
|
|
38
|
+
"version:major": "npm version major",
|
|
39
|
+
"version:beta": "npm version prerelease --preid=beta",
|
|
40
|
+
"version:alpha": "npm version prerelease --preid=alpha",
|
|
41
|
+
"version:check": "node version-sync.js check",
|
|
42
|
+
"version:sync": "node version-sync.js sync",
|
|
43
|
+
"version:list": "node version-sync.js list",
|
|
44
|
+
"version:next": "node version-sync.js next",
|
|
45
|
+
"postversion": "echo \"✅ Version updated to $(node -p 'require(\"./package.json\").version')\" && (git push && git push --tags || echo \"⚠️ Git push failed - you may need to pull and push manually\")"
|
|
46
|
+
},
|
|
47
|
+
"keywords": [
|
|
48
|
+
"tagadapay",
|
|
49
|
+
"cms",
|
|
50
|
+
"plugin",
|
|
51
|
+
"sdk",
|
|
52
|
+
"react",
|
|
53
|
+
"typescript"
|
|
54
|
+
],
|
|
55
|
+
"author": "Tagada Pay",
|
|
56
|
+
"license": "MIT",
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@basis-theory/apple-pay-js": "^2.0.2",
|
|
59
|
+
"@basis-theory/basis-theory-js": "^4.30.0",
|
|
60
|
+
"@basis-theory/basis-theory-react": "^1.32.5",
|
|
61
|
+
"@basis-theory/web-threeds": "^1.0.1",
|
|
62
|
+
"@tanstack/react-query": "^5.90.2",
|
|
63
|
+
"axios": "^1.10.0",
|
|
64
|
+
"iso3166-2-db": "^2.3.11",
|
|
65
|
+
"react-intl": "^7.1.11",
|
|
66
|
+
"swr": "^2.3.6"
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"@types/node": "^18.0.0",
|
|
70
|
+
"@types/react": "^19",
|
|
71
|
+
"@types/react-dom": "^19",
|
|
72
|
+
"typescript": "^5.0.0"
|
|
73
|
+
},
|
|
74
|
+
"peerDependencies": {
|
|
75
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
76
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
77
|
+
},
|
|
78
|
+
"files": [
|
|
79
|
+
"dist/**/*",
|
|
80
|
+
"README.md"
|
|
81
|
+
],
|
|
82
|
+
"repository": {
|
|
83
|
+
"type": "git",
|
|
84
|
+
"url": "git+https://github.com/tagadapay/plugin-sdk.git"
|
|
85
|
+
},
|
|
86
|
+
"bugs": {
|
|
87
|
+
"url": "https://github.com/tagadapay/plugin-sdk/issues"
|
|
88
|
+
},
|
|
89
|
+
"homepage": "https://github.com/tagadapay/plugin-sdk#readme"
|
|
90
|
+
}
|