@kasuvia/sdk 0.0.6 → 0.0.8
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/hooks/index.d.mts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/{index-ac_Jx9NI.d.mts → index-C5YO9gTl.d.mts} +16 -1
- package/dist/{index-ac_Jx9NI.d.ts → index-C5YO9gTl.d.ts} +16 -1
- package/dist/{index-hgK4j47a.d.ts → index-CefG7_xq.d.mts} +9 -2
- package/dist/{index-D9ojrziq.d.mts → index-DeHCf3zI.d.ts} +9 -2
- package/dist/index.d.mts +9 -5
- package/dist/index.d.ts +9 -5
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -0
- package/dist/index.mjs.map +1 -1
- package/dist/services/index.d.mts +2 -2
- package/dist/services/index.d.ts +2 -2
- package/dist/services/index.js.map +1 -1
- package/dist/services/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/constants.ts +5 -0
- package/src/index.ts +1 -1
- package/src/services/auth.service.ts +0 -1
- package/src/services/logistics.service.ts +4 -1
- package/src/types/store/shipping.ts +11 -0
package/package.json
CHANGED
package/src/constants.ts
CHANGED
|
@@ -11,3 +11,8 @@ export const STORAGE_KEYS = {
|
|
|
11
11
|
ORDERS_LINKED: 'kasuvia_orders_linked',
|
|
12
12
|
STOREFRONT_STATE: 'storefront_state_v3',
|
|
13
13
|
} as const;
|
|
14
|
+
|
|
15
|
+
export const PAYMENT_URLS = {
|
|
16
|
+
MONNIFY: 'https://sdk.monnify.com/plugin/monnify.js',
|
|
17
|
+
FLUTTERWAVE: 'https://checkout.flutterwave.com/v3.js',
|
|
18
|
+
} as const;
|
package/src/index.ts
CHANGED
|
@@ -96,7 +96,10 @@ export async function validateShippingAddress(
|
|
|
96
96
|
): Promise<{
|
|
97
97
|
valid: boolean
|
|
98
98
|
message?: string
|
|
99
|
-
|
|
99
|
+
errorType?: 'state' | 'city' | 'general'
|
|
100
|
+
data?: unknown
|
|
101
|
+
cities?: Array<{ name: string; city_id: string; stateCode: string; countryCode: string }>
|
|
102
|
+
states?: Array<{ name: string; code: string; countryCode: string }>
|
|
100
103
|
}> {
|
|
101
104
|
const response = await fetch(`${config.backendUrls.store}/logistics/shipping-address/validate`, {
|
|
102
105
|
method: 'POST',
|
|
@@ -36,3 +36,14 @@ export interface DeliveryAddress {
|
|
|
36
36
|
country: string;
|
|
37
37
|
postal: string;
|
|
38
38
|
}
|
|
39
|
+
|
|
40
|
+
// ============================================================================
|
|
41
|
+
// ADDRESS VALIDATION TYPES
|
|
42
|
+
// ============================================================================
|
|
43
|
+
|
|
44
|
+
export interface AddressValidationErrorData {
|
|
45
|
+
message: string;
|
|
46
|
+
errorType?: 'state' | 'city' | 'general';
|
|
47
|
+
cities?: Array<{ name: string; city_id: string; stateCode: string; countryCode: string }>;
|
|
48
|
+
states?: Array<{ name: string; code: string; countryCode: string }>;
|
|
49
|
+
}
|