@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kasuvia/sdk",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "Kasuvia SDK - Core data fetching, authentication, and API client layer",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
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
@@ -36,7 +36,7 @@
36
36
  export type { SdkConfig } from './config'
37
37
 
38
38
  // Constants
39
- export { STORAGE_KEYS } from './constants'
39
+ export { STORAGE_KEYS, PAYMENT_URLS } from './constants'
40
40
 
41
41
  // Types
42
42
  export * from './types'
@@ -3,7 +3,6 @@
3
3
  * Stateless - all configuration passed as parameters.
4
4
  */
5
5
  import type { SdkConfig } from '../config'
6
- import { logger } from '../utils/logger'
7
6
  import { STORAGE_KEYS } from '../constants'
8
7
  import type {
9
8
  CustomerAuthResponse,
@@ -96,7 +96,10 @@ export async function validateShippingAddress(
96
96
  ): Promise<{
97
97
  valid: boolean
98
98
  message?: string
99
- data?: Array<{ name: string; city_id: string; stateCode: string; countryCode: string }>
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
+ }