@atomic-solutions/woocommerce-api-client 0.3.1 → 0.5.0

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/errors/classes/BaseError.ts","../../src/errors/mapping/mapWooCommerceCode.ts","../../src/errors/mapping/constants.ts","../../src/errors/classes/WooCommerceApiError.ts","../../src/errors/classes/WooCommerceDataValidationError.ts","../../src/http/handleApiResponse.ts","../../src/utils/calculatePagination.ts","../../src/utils/getPaginationMeta.ts","../../src/http/handlePaginatedApiResponse.ts","../../src/logging/logger.ts","../../src/http/interceptors/request.ts","../../src/http/interceptors/response.ts","../../src/utils/initializeCartSession.ts","../../src/http/interceptors/error.ts"],"names":["error"],"mappings":";;;AASO,IAAM,SAAA,GAAN,cAGG,KAAA,CAAM;AAAA,EACd,YAA4B,OAAA,EAAmB;AAC7C,IAAA,KAAA,CAAM,QAAQ,OAAO,CAAA;AADK,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAI1B,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,GAAA,CAAA,MAAA,CAAW,SAAS,CAAA;AAGhD,IAAA,IAAA,CAAK,IAAA,GAAO,KAAK,WAAA,CAAY,IAAA;AAG7B,IAAA,IAAI,MAAM,iBAAA,EAAmB;AAC3B,MAAA,KAAA,CAAM,iBAAA,CAAkB,IAAA,EAAM,IAAA,CAAK,WAAW,CAAA;AAAA,IAChD;AAGA,IAAA,IAAI,KAAK,OAAA,CAAQ,KAAA,YAAiB,SAAS,IAAA,CAAK,OAAA,CAAQ,MAAM,KAAA,EAAO;AACnE,MAAA,IAAA,CAAK,KAAA,GAAQ,CAAA,EAAG,IAAA,CAAK,KAAK;AAAA,WAAA,EAAgB,IAAA,CAAK,OAAA,CAAQ,KAAA,CAAM,KAAK,CAAA,CAAA;AAAA,IACpE;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,iBAAA,GA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O,CAAA;AAAA,QAC/B;AAAA,MACF;AAGA,MAAA,MAAA,CAAO,aAAA,EAAe,OAAO,OAAO,CAAA;AAEpC,MAAA,OAAO,OAAA,CAAQ,OAAO,OAAO,CAAA;AAAA,IAC/B;AAAA,GACF;AACF","file":"index.mjs","sourcesContent":["/**\n * Base error class for all package errors\n *\n * Generic over:\n * - TOptions: The options type for this error class\n * - TReportable: The reportable data structure for error tracking\n */\nimport type { BaseErrorOptions, BaseReportableData } from './types';\n\nexport class BaseError<\n TOptions extends BaseErrorOptions = BaseErrorOptions,\n TReportable extends BaseReportableData = BaseReportableData,\n> extends Error {\n constructor(public readonly options: TOptions) {\n super(options.message);\n\n // Maintain proper prototype chain\n Object.setPrototypeOf(this, new.target.prototype);\n\n // Set error name\n this.name = this.constructor.name;\n\n // Capture stack trace (excluding constructor call)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n // If there's a cause with a stack, preserve it\n if (this.options.cause instanceof Error && this.options.cause.stack) {\n this.stack = `${this.stack}\\nCaused by: ${this.options.cause.stack}`;\n }\n }\n\n /**\n * Get reportable data for error tracking/logging\n * Subclasses should override this to add their own reportable fields\n */\n getReportableData(): TReportable {\n const { code, operation, userMessage, retryable } = this.options;\n return {\n code,\n operation,\n userMessage,\n retryable,\n } as TReportable;\n }\n\n /**\n * Custom JSON serialization\n * Makes the error properly serializable for logging/reporting\n */\n toJSON(): Record<string, unknown> {\n return {\n ...this.getReportableData(),\n name: this.name,\n message: this.message,\n stack: this.stack,\n } as unknown as Record<string, unknown>;\n }\n}\n","import type { WooCommerceApiErrorCode } from './types';\n\nexport const mapWooCommerceCode = (apiCode?: string): WooCommerceApiErrorCode => {\n if (!apiCode) return 'unknown_error';\n\n // Direct matches\n const directMatches: Record<string, WooCommerceApiErrorCode> = {\n woocommerce_rest_cart_empty: 'cart_empty',\n woocommerce_rest_cart_coupon_error: 'invalid_coupon',\n woocommerce_rest_missing_nonce: 'missing_nonce',\n woocommerce_rest_invalid_nonce: 'invalid_nonce',\n rest_invalid_param: 'invalid_params',\n woocommerce_rest_product_invalid_id: 'product_not_found',\n woocommerce_rest_product_out_of_stock: 'out_of_stock',\n woocommerce_rest_product_not_enough_stock: 'insufficient_stock',\n woocommerce_rest_checkout_invalid_payment_method: 'invalid_payment_method',\n };\n\n if (directMatches[apiCode]) {\n return directMatches[apiCode];\n }\n\n // Pattern matches\n if (apiCode.includes('nonce')) return 'invalid_nonce';\n if (apiCode.includes('coupon')) return 'invalid_coupon';\n if (apiCode.includes('stock')) return 'insufficient_stock';\n if (apiCode.includes('checkout')) return 'checkout_error';\n if (apiCode.includes('payment')) return 'invalid_payment_method';\n\n return 'unknown_error';\n};\n","import type { WooCommerceApiErrorCode, WooCommerceApiErrorMetaData } from './types';\n\nexport const WOOCOMMERCE_ERROR_METADATA: Record<\n WooCommerceApiErrorCode,\n WooCommerceApiErrorMetaData\n> = {\n cart_empty: {\n operation: 'get_cart',\n retryable: false,\n userMessage: 'Your cart is empty',\n },\n invalid_coupon: {\n operation: 'apply_coupon',\n retryable: false,\n userMessage: 'Invalid coupon code',\n },\n missing_nonce: {\n operation: 'cart_request',\n retryable: true, // Auto-retry with new nonce\n },\n invalid_nonce: {\n operation: 'cart_request',\n retryable: true, // Auto-retry with new nonce\n },\n invalid_params: {\n operation: 'api_request',\n retryable: false,\n userMessage: 'Invalid request parameters',\n },\n product_not_found: {\n operation: 'get_product',\n retryable: false,\n userMessage: 'Product not found',\n },\n out_of_stock: {\n operation: 'add_to_cart',\n retryable: false,\n userMessage: 'This product is out of stock',\n },\n insufficient_stock: {\n operation: 'add_to_cart',\n retryable: false,\n userMessage: 'Not enough stock available',\n },\n invalid_payment_method: {\n operation: 'process_checkout',\n retryable: false,\n userMessage: 'Invalid payment method',\n },\n checkout_error: {\n operation: 'process_checkout',\n retryable: false,\n },\n network_error: {\n operation: 'network_request',\n retryable: true,\n },\n unknown_error: {\n operation: 'unknown',\n retryable: false,\n },\n};\n","/**\n * WooCommerce API Error\n */\n\nimport { WOOCOMMERCE_ERROR_METADATA, type WooCommerceApiErrorCode } from '../mapping';\nimport { BaseError } from './BaseError';\nimport type { ApiReportableData, WooCommerceApiErrorOptions } from './types';\n\n/**\n * WooCommerce-specific error class\n *\n * Extends BaseError to provide:\n * - Code transformation (WooCommerce API codes → clean app codes)\n * - WooCommerce-specific error categorization\n * - HTTP context (status, URL, method)\n */\nexport class WooCommerceApiError extends BaseError<WooCommerceApiErrorOptions, ApiReportableData> {\n constructor(options: WooCommerceApiErrorOptions) {\n const metadata = WOOCOMMERCE_ERROR_METADATA[options.code] ?? {\n operation: 'woocommerce_api_request',\n retryable: false,\n };\n\n // Enrich options with metadata defaults\n const enrichedOptions: WooCommerceApiErrorOptions = {\n ...options,\n operation: options.operation || metadata.operation,\n userMessage: options.userMessage || metadata.userMessage,\n retryable: options.retryable ?? metadata.retryable,\n };\n\n super(enrichedOptions);\n }\n\n // Convenient getters for frequently accessed fields (no duplication)\n get wooCode(): WooCommerceApiErrorCode {\n return this.options.code;\n }\n\n get originalCode(): string {\n return this.options.originalCode;\n }\n\n get statusCode(): number {\n return this.options.statusCode;\n }\n\n get url(): string {\n return this.options.url;\n }\n\n get method(): string {\n return this.options.method;\n }\n\n get requestBody(): unknown | undefined {\n return this.options.requestBody;\n }\n\n get responseBody(): unknown | undefined {\n return this.options.responseBody;\n }\n\n get data(): Record<string, unknown> | undefined {\n return this.options.data;\n }\n\n /**\n * Get reportable data for error tracking/logging\n * Includes HTTP context and WooCommerce-specific fields\n */\n override getReportableData(): ApiReportableData {\n return {\n code: this.options.code,\n operation: this.options.operation,\n userMessage: this.options.userMessage,\n retryable: this.options.retryable,\n statusCode: this.options.statusCode,\n url: this.options.url,\n method: this.options.method,\n wooCode: this.options.code,\n originalCode: this.options.originalCode,\n };\n }\n}\n","/**\n * WooCommerce validation error class\n * Thrown when API response validation fails\n */\n\nimport type { ZodError } from 'zod';\n\nimport { BaseError } from './BaseError';\nimport type {\n BaseErrorOptions,\n ValidationReportableData,\n WooCommerceDataValidationErrorOptions,\n} from './types';\n\n/**\n * Internal options type that combines user options with computed fields\n */\ninterface WooCommerceDataValidationErrorInternalOptions extends BaseErrorOptions {\n url?: string;\n zodError?: ZodError;\n value?: unknown;\n fieldErrors?: Record<string, string[]>;\n}\n\n/**\n * WooCommerce validation error\n *\n * Thrown when API response validation fails using Zod schemas\n */\nexport class WooCommerceDataValidationError extends BaseError<\n WooCommerceDataValidationErrorInternalOptions,\n ValidationReportableData\n> {\n constructor(options: WooCommerceDataValidationErrorOptions) {\n // Extract field errors from Zod error if provided\n const fieldErrors = options.zodError\n ? WooCommerceDataValidationError.extractFieldErrorsFromZod(options.zodError)\n : undefined;\n\n super({\n code: 'validation_error',\n message: options.message,\n operation: options.operation,\n userMessage: options.userMessage || 'Received unexpected data from WooCommerce',\n retryable: false,\n cause: options.cause,\n url: options.url,\n zodError: options.zodError,\n value: options.value,\n fieldErrors,\n });\n }\n\n // Convenient getters for validation-specific fields (no duplication)\n get url(): string | undefined {\n return this.options.url;\n }\n\n get zodError(): ZodError | undefined {\n return this.options.zodError;\n }\n\n get invalidValue(): unknown | undefined {\n return this.options.value;\n }\n\n get fieldErrors(): Record<string, string[]> | undefined {\n return this.options.fieldErrors;\n }\n\n /**\n * Get reportable data for error tracking/logging\n * Includes validation-specific fields\n */\n override getReportableData(): ValidationReportableData {\n return {\n code: this.options.code,\n operation: this.options.operation,\n userMessage: this.options.userMessage,\n retryable: false,\n fieldErrors: this.options.fieldErrors,\n url: this.options.url,\n };\n }\n\n /**\n * Extract field errors from Zod error\n */\n private static extractFieldErrorsFromZod(\n zodError: ZodError\n ): Record<string, string[]> | undefined {\n if (!zodError?.errors) {\n return undefined;\n }\n\n const fieldErrors: Record<string, string[]> = {};\n\n for (const issue of zodError.errors) {\n const path = issue.path.join('.');\n if (!fieldErrors[path]) {\n fieldErrors[path] = [];\n }\n fieldErrors[path].push(issue.message);\n }\n\n return fieldErrors;\n }\n\n /**\n * Get all error messages as a flat array\n */\n getMessages(): string[] {\n if (!this.fieldErrors) {\n return [this.message];\n }\n\n const messages: string[] = [];\n for (const fieldMessages of Object.values(this.fieldErrors)) {\n messages.push(...fieldMessages);\n }\n\n return messages;\n }\n\n /**\n * Check if a specific field has errors\n */\n hasFieldError(field: string): boolean {\n return this.fieldErrors ? field in this.fieldErrors : false;\n }\n\n /**\n * Get error messages for a specific field\n */\n getFieldError(field: string): string[] | undefined {\n return this.fieldErrors?.[field];\n }\n}\n","/**\n * Response validation utilities\n */\n\nimport type { AxiosResponse } from 'axios';\nimport type { ZodError, ZodSchema } from 'zod';\n\nimport { WooCommerceDataValidationError } from '@/errors';\n\n/**\n * Validation mode for API responses\n * - 'strict': Throw error on validation failure (default)\n * - 'warn': Log warning and continue on validation failure\n */\nexport type ValidationMode = 'strict' | 'warn';\n\n/**\n * Options for response handling\n */\nexport interface ResponseOptions {\n /** Validation mode */\n validationMode?: ValidationMode;\n\n /** Error reporter for validation errors */\n errorReporter?: (error: Error) => void;\n\n /** Optional validation error handler (called before errorReporter) */\n onValidationError?: (error: Error) => void;\n}\n\n/**\n * Handle and validate API response\n *\n * @param response - Axios response\n * @param schema - Zod schema for validation\n * @param options - Response handling options\n * @returns Validated data\n * @throws ValidationError if validation fails in strict mode\n */\nexport const handleApiResponse = <T>(\n response: AxiosResponse,\n schema: ZodSchema<T>,\n options?: ResponseOptions\n): T => {\n const validationMode = options?.validationMode ?? 'strict';\n\n // Warn mode - use safeParse and continue on validation failure\n if (validationMode === 'warn') {\n const result = schema.safeParse(response.data);\n\n if (!result.success) {\n const validationError = new WooCommerceDataValidationError({\n message: `WooCommerce API response validation failed for ${response.config.url || 'unknown endpoint'}`,\n url: response.config.url,\n zodError: result.error,\n value: response.data,\n userMessage: 'Received unexpected data from WooCommerce',\n });\n\n // Call optional validation error handler\n options?.onValidationError?.(validationError);\n\n // Report to error tracker (if provided)\n options?.errorReporter?.(validationError);\n\n // Log warning to console in warn mode\n console.warn('[woocommerce-utils] Validation warning:', validationError.message);\n\n // Return raw data to allow app to continue\n return response.data as T;\n }\n\n return result.data;\n }\n\n // Strict mode - throw on validation failure\n try {\n return schema.parse(response.data);\n } catch (error) {\n if (error && typeof error === 'object' && 'issues' in error) {\n const validationError = new WooCommerceDataValidationError({\n message: `WooCommerce API response validation failed for ${response.config.url || 'unknown endpoint'}`,\n url: response.config.url,\n zodError: error as ZodError,\n value: response.data,\n userMessage: 'Received unexpected data from WooCommerce',\n });\n\n // Call optional validation error handler\n options?.onValidationError?.(validationError);\n\n // Report to error tracker (if provided)\n options?.errorReporter?.(validationError);\n\n throw validationError;\n }\n throw error;\n }\n};\n\n/**\n * Check if error is a Zod validation error\n */\nexport const isZodError = (error: unknown): error is ZodError => {\n return error instanceof Error && error.name === 'ZodError';\n};\n","/**\n * Calculate pagination navigation\n */\n\nexport interface Pagination {\n page: number;\n perPage: number;\n total: number;\n totalPages: number;\n hasNextPage: boolean;\n hasPrevPage: boolean;\n nextPage: number | null;\n prevPage: number | null;\n}\n\nexport interface CalculatePaginationInput {\n page: number;\n perPage: number;\n total: number;\n totalPages: number;\n}\n\n/**\n * Calculate pagination navigation from WooCommerce pagination metadata\n *\n * @param input - Current pagination state\n * @returns Full pagination object with navigation helpers\n */\nexport const calculatePagination = (input: CalculatePaginationInput): Pagination => {\n const { page, perPage, total, totalPages } = input;\n\n const hasNextPage = page < totalPages;\n const hasPrevPage = page > 1;\n\n return {\n page,\n perPage,\n total,\n totalPages,\n hasNextPage,\n hasPrevPage,\n nextPage: hasNextPage ? page + 1 : null,\n prevPage: hasPrevPage ? page - 1 : null,\n };\n};\n","/**\n * Extract pagination metadata from WooCommerce response headers\n */\n\nimport type { AxiosResponse } from 'axios';\n\nexport interface PaginationMeta {\n total: number;\n totalPages: number;\n}\n\nexport const getPaginationMeta = (headers: AxiosResponse['headers']): PaginationMeta => {\n // Handle undefined/null headers\n if (!headers) {\n return {\n total: 0,\n totalPages: 0,\n };\n }\n\n const wpTotal = headers['x-wp-total'];\n const wpTotalPages = headers['x-wp-totalpages'];\n\n if (!wpTotal || !wpTotalPages) {\n return {\n total: 0,\n totalPages: 0,\n };\n }\n\n const total = parseInt(wpTotal, 10);\n const totalPages = parseInt(wpTotalPages, 10);\n\n return {\n total,\n totalPages,\n };\n};\n","/**\n * Pagination utilities for WooCommerce API responses\n */\n\nimport type { AxiosResponse } from 'axios';\nimport type { ZodError, ZodSchema } from 'zod';\n\nimport { WooCommerceDataValidationError } from '../errors';\nimport { calculatePagination, type Pagination } from '../utils/calculatePagination';\nimport { getPaginationMeta } from '../utils/getPaginationMeta';\nimport type { ResponseOptions } from './handleApiResponse';\n\n/**\n * Paginated response wrapper\n */\nexport interface PaginatedResponse<T> {\n data: T[];\n pagination: Pagination;\n}\n\n/**\n * Handle paginated API response\n *\n * @param response - Axios response\n * @param schema - Zod schema for validating array items\n * @param params - Request parameters (page, per_page)\n * @param options - Response handling options\n * @returns Paginated response with validated data\n * @throws ValidationError if validation fails in strict mode\n */\nexport const handlePaginatedApiResponse = <T>(\n response: AxiosResponse,\n schema: ZodSchema<T[]>,\n params: { page?: number; per_page?: number } = {},\n options?: ResponseOptions\n): PaginatedResponse<T> => {\n const validationMode = options?.validationMode ?? 'strict';\n let data: T[];\n\n // Warn mode - use safeParse and continue on validation failure\n if (validationMode === 'warn') {\n const result = schema.safeParse(response.data);\n\n if (!result.success) {\n const validationError = new WooCommerceDataValidationError({\n message: `WooCommerce API response validation failed for ${response.config.url || 'unknown endpoint'}`,\n url: response.config.url,\n zodError: result.error,\n value: response.data,\n userMessage: 'Received unexpected data from WooCommerce',\n });\n\n // Call optional validation error handler\n options?.onValidationError?.(validationError);\n\n // Report to error tracker (if provided)\n options?.errorReporter?.(validationError);\n\n // Log warning to console in warn mode\n console.warn('[woocommerce-utils] Validation warning:', validationError.message);\n\n // Return raw data as array (best effort)\n data = Array.isArray(response.data) ? response.data : [];\n } else {\n data = result.data;\n }\n } else {\n // Strict mode - throw on validation failure\n try {\n data = schema.parse(response.data);\n } catch (error) {\n if (error && typeof error === 'object' && 'issues' in error) {\n const validationError = new WooCommerceDataValidationError({\n message: `WooCommerce API response validation failed for ${response.config.url || 'unknown endpoint'}`,\n url: response.config.url,\n zodError: error as ZodError,\n value: response.data,\n userMessage: 'Received unexpected data from WooCommerce',\n });\n\n // Call optional validation error handler\n options?.onValidationError?.(validationError);\n\n // Report to error tracker (if provided)\n options?.errorReporter?.(validationError);\n\n throw validationError;\n }\n throw error;\n }\n }\n\n const { total, totalPages } = getPaginationMeta(response.headers);\n const page = params.page || 1;\n const perPage = params.per_page || 10;\n\n const pagination = calculatePagination({\n page,\n perPage,\n total,\n totalPages,\n });\n\n return {\n data,\n pagination,\n };\n};\n","/**\n * Debug logger for WooCommerce utils\n */\n\nconst DEBUG_PREFIX = '[woocommerce-utils]';\n\n/**\n * Check if debug mode is enabled\n */\nexport const isDebugEnabled = (): boolean => {\n if (typeof process !== 'undefined' && process.env) {\n return process.env.DEBUG === 'true' || process.env.DEBUG === '1';\n }\n return false;\n};\n\n/**\n * Log debug message (only if DEBUG is enabled)\n */\nexport const debug = (...args: unknown[]): void => {\n if (isDebugEnabled()) {\n console.log(DEBUG_PREFIX, ...args);\n }\n};\n\n/**\n * Log warning message\n */\nexport const warn = (...args: unknown[]): void => {\n console.warn(DEBUG_PREFIX, ...args);\n};\n\n/**\n * Log error message\n */\nexport const error = (...args: unknown[]): void => {\n console.error(DEBUG_PREFIX, ...args);\n};\n","/**\n * Request interceptor\n *\n * Handles:\n * - JWT authentication for protected endpoints\n * - Nonce/Cart-Token injection for cart/checkout endpoints\n * - Cache-Control headers for cart/checkout to prevent Android caching bugs\n * - Debug logging\n */\n\nimport type { AxiosInstance, InternalAxiosRequestConfig } from 'axios';\n\nimport type { WooCommerceClient, WooCommerceConfig } from '../../client/types';\nimport { debug } from '../../logging/logger';\n\n/**\n * Check if endpoint requires JWT authentication\n */\nconst requiresAuth = (url?: string): boolean => {\n if (!url) return false;\n\n const authEndpoints = [\n '/jwt-auth/',\n '/customers/me',\n '/wp/v2/users/me',\n // Store API non-cart endpoints: inject JWT when available so authenticated\n // users can access their own resources (e.g. orders, personalised product data)\n '/wc/store/v1/order',\n ];\n\n return authEndpoints.some((endpoint) => url.includes(endpoint));\n};\n\n/**\n * Check if endpoint requires cart authentication (nonce/cart-token)\n *\n * Matches both versioned (/wc/store/v1/cart) and non-versioned (/wc/store/cart) endpoints\n */\nconst requiresCartAuth = (url?: string): boolean => {\n if (!url) return false;\n\n // Match /wc/store/cart or /wc/store/v1/cart (and similar for checkout)\n return /\\/wc\\/store\\/(v\\d+\\/)?cart/.test(url) || /\\/wc\\/store\\/(v\\d+\\/)?checkout/.test(url);\n};\n\n/**\n * Setup request interceptor\n *\n * - Injects JWT Bearer token for authenticated requests\n * - Injects Nonce/Cart-Token headers for cart/checkout requests\n * - Adds Cache-Control headers to prevent Android caching bugs\n * - Calls optional onRequest hook\n * - Passes client instance to callbacks\n */\nexport const setupRequestInterceptor = (\n axiosInstance: AxiosInstance,\n config: WooCommerceConfig,\n client: WooCommerceClient\n): void => {\n axiosInstance.interceptors.request.use(\n async (requestConfig: InternalAxiosRequestConfig) => {\n const url = requestConfig.url;\n\n // Inject JWT token for authenticated endpoints\n if (config.jwtToken) {\n const token = await config.jwtToken.get();\n if (token && (requiresAuth(url) || requiresCartAuth(url))) {\n requestConfig.headers.Authorization = `Bearer ${token}`;\n if (config.debug) {\n debug('Injected JWT token for', url);\n }\n }\n }\n\n // Inject nonce/cart-token for cart endpoints\n // When JWT is present, skip Cart-Token: WooCommerce prioritizes Cart-Token over JWT\n // for session identification, which would route requests to a separate API session\n // instead of the user's persistent cart.\n if (requiresCartAuth(url)) {\n const headers = await config.cartHeaders.get();\n const isAuthenticated = !!(await config.jwtToken?.get());\n\n if (headers.nonce) {\n requestConfig.headers.Nonce = headers.nonce;\n }\n if (headers.cartToken && !isAuthenticated) {\n requestConfig.headers['Cart-Token'] = headers.cartToken;\n }\n\n // CRITICAL: Disable HTTP caching for cart/checkout endpoints\n // WooCommerce sends aggressive cache headers (max-age=2419200, 28 days) which\n // can cause Android HTTP clients to serve stale cart data from cache.\n // This was causing empty carts to be returned after successful add-item operations\n // because the cached GET /cart response (from before items were added) was being\n // served instead of fetching fresh data from the server.\n // iOS URLSession happened to work because it handles expired cache differently.\n requestConfig.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate';\n requestConfig.headers.Pragma = 'no-cache';\n requestConfig.headers.Expires = '0';\n\n if (config.debug) {\n debug('Injected cart headers for', url, {\n hasNonce: !!headers.nonce,\n hasCartToken: !!headers.cartToken,\n });\n }\n }\n\n // Debug logging\n if (config.debug) {\n debug(\n `${requestConfig.method?.toUpperCase()} ${requestConfig.url}`,\n requestConfig.params || requestConfig.data\n );\n }\n\n // Call optional onRequest hook\n if (config.onRequest) {\n return config.onRequest(requestConfig, client);\n }\n\n return requestConfig;\n },\n (error) => {\n return Promise.reject(error);\n }\n );\n};\n","/**\n * Axios response interceptor for WooCommerce API\n */\n\nimport type { AxiosInstance, AxiosResponse } from 'axios';\n\nimport type { WooCommerceClient, WooCommerceConfig } from '../../client/types';\nimport { debug } from '../../logging/logger';\n\n/**\n * Check if response is from cart/checkout endpoint\n *\n * Matches both versioned (/wc/store/v1/cart) and non-versioned (/wc/store/cart) endpoints\n */\nconst isCartResponse = (url?: string): boolean => {\n if (!url) return false;\n\n // Match /wc/store/cart or /wc/store/v1/cart (and similar for checkout)\n return /\\/wc\\/store\\/(v\\d+\\/)?cart/.test(url) || /\\/wc\\/store\\/(v\\d+\\/)?checkout/.test(url);\n};\n\n/**\n * Setup response interceptor\n *\n * - Extracts and saves cart headers (nonce rotation)\n * - Logs responses in debug mode\n * - Calls optional onResponse hook\n * - Passes client instance to callbacks\n */\nexport const setupResponseInterceptor = (\n axiosInstance: AxiosInstance,\n config: WooCommerceConfig,\n client: WooCommerceClient\n): void => {\n axiosInstance.interceptors.response.use(\n async (response: AxiosResponse) => {\n // Extract and save cart headers (nonce rotation)\n if (isCartResponse(response.config.url)) {\n const nonce = response.headers['nonce'] || response.headers['Nonce'];\n const cartToken = response.headers['cart-token'] || response.headers['Cart-Token'];\n\n if (nonce || cartToken) {\n await config.cartHeaders.save({\n nonce: nonce || undefined,\n cartToken: cartToken || undefined,\n });\n\n if (config.debug) {\n debug(\n 'Saved updated cart headers:',\n response.config.url,\n 'nonce:',\n !!nonce,\n 'cartToken:',\n !!cartToken\n );\n }\n }\n }\n\n if (config.debug) {\n debug('Response:', response.config.url, response.status);\n }\n\n // Call optional onResponse hook\n if (config.onResponse) {\n return config.onResponse(response, client);\n }\n\n return response;\n },\n (error) => {\n return Promise.reject(error);\n }\n );\n};\n","/**\n * Cart session initialization utility\n */\n\nimport type { AxiosInstance } from 'axios';\n\nimport type { CartHeadersAdapter } from '../client/types';\nimport { debug } from '../logging/logger';\n\n/**\n * Initialize cart session by fetching cart and saving headers\n *\n * This is called when nonce errors occur to get a fresh nonce/cart-token\n *\n * @param client - Axios instance\n * @param cartHeaders - Cart headers adapter\n */\nexport const initializeCartSession = async (\n client: AxiosInstance,\n cartHeaders: CartHeadersAdapter\n): Promise<void> => {\n try {\n debug('session', 'Initializing cart session');\n\n // Make GET request to cart endpoint\n const response = await client.get('/wc/store/v1/cart');\n\n // Extract headers\n const nonce = response.headers['nonce'] || response.headers['Nonce'];\n const cartToken = response.headers['cart-token'] || response.headers['Cart-Token'];\n\n // Save headers\n if (nonce || cartToken) {\n await cartHeaders.save({\n nonce: nonce || undefined,\n cartToken: cartToken || undefined,\n });\n\n debug('session', 'Cart session initialized', {\n hasNonce: !!nonce,\n hasCartToken: !!cartToken,\n });\n }\n } catch (error) {\n debug('session', 'Failed to initialize cart session', error);\n throw error;\n }\n};\n","/**\n * Axios error interceptor for WooCommerce API\n */\n\nimport { isAxiosError, type AxiosError, type AxiosInstance } from 'axios';\n\nimport type { WooCommerceClient, WooCommerceConfig } from '../../client/types';\nimport { WooCommerceApiError } from '../../errors/classes/WooCommerceApiError';\nimport { mapWooCommerceCode, WOOCOMMERCE_ERROR_METADATA } from '../../errors/mapping';\nimport { debug, error as logError } from '../../logging/logger';\nimport { initializeCartSession } from '../../utils/initializeCartSession';\n\ninterface WooCommerceErrorData {\n code?: string;\n message?: string;\n data?: {\n status?: number;\n };\n}\n\n/**\n * Setup error interceptor\n *\n * - Transforms WooCommerce errors into WooCommerceApiError instances\n * - Calls optional onError hook\n * - Passes client instance to callbacks\n */\nexport const setupErrorInterceptor = (\n axiosInstance: AxiosInstance,\n config: WooCommerceConfig,\n client: WooCommerceClient\n): void => {\n axiosInstance.interceptors.response.use(\n (response) => response,\n async (axiosError: AxiosError<WooCommerceErrorData>) => {\n const status = axiosError.response?.status || 500;\n const errorData = axiosError.response?.data;\n\n // Extract WooCommerce error details\n const apiCode = errorData?.code || 'unknown_error';\n const wpMessage = errorData?.message || axiosError.message || 'Unknown error';\n\n // Transform WooCommerce API code to application-level code\n // e.g., \"woocommerce_rest_cart_empty\" → \"cart_empty\"\n const errorCode = mapWooCommerceCode(apiCode);\n const errorMetadata = WOOCOMMERCE_ERROR_METADATA[errorCode];\n\n // Create WooCommerceError with full context\n const wcError = new WooCommerceApiError({\n message: wpMessage,\n statusCode: status,\n code: errorCode, // Transformed app-level code\n originalCode: apiCode, // Original WooCommerce API code\n retryable: errorMetadata.retryable,\n userMessage: errorMetadata.userMessage,\n operation: errorMetadata.operation,\n url: axiosError.config?.url || '',\n method: axiosError.config?.method?.toUpperCase() || 'GET',\n requestBody: axiosError.config?.data,\n responseBody: errorData,\n data: errorData?.data as Record<string, unknown> | undefined,\n cause: axiosError,\n });\n\n if (config.debug) {\n debug('WooCommerce error:', apiCode, status, wpMessage);\n logError(wcError);\n }\n\n // Handle authentication errors (401/403)\n if (\n (status === 401 || status === 403) &&\n config.onAuthError &&\n isAxiosError(axiosError) &&\n !axiosError.config?._retry\n ) {\n if (config.debug) {\n debug('Auth error detected, calling onAuthError handler');\n }\n\n try {\n const shouldRetry = await config.onAuthError(wcError, client);\n\n if (shouldRetry) {\n if (config.debug) {\n debug('Retrying request after auth error');\n }\n\n // Mark as retry to prevent infinite loops\n axiosError.config!._retry = true;\n\n // Retry the request\n return axiosInstance.request(axiosError.config!);\n }\n } catch (authErrorHandlerError) {\n // If onAuthError handler throws, fall through to error reporting\n if (config.debug) {\n debug('onAuthError handler threw error', authErrorHandlerError);\n }\n }\n }\n\n // Call optional onError hook first (even for retryable errors)\n if (config.onError) {\n config.onError(wcError, client);\n }\n\n // Auto-retry nonce errors\n const isNonceError = errorCode === 'missing_nonce' || errorCode === 'invalid_nonce';\n if (isNonceError && isAxiosError(axiosError) && !axiosError.config?._retry) {\n if (config.debug) {\n debug('Nonce error detected, retrying with new session');\n }\n\n try {\n // Initialize new cart session\n await initializeCartSession(axiosInstance, config.cartHeaders);\n\n // Mark as retry to prevent infinite loops\n axiosError.config!._retry = true;\n\n // Retry the request\n return axiosInstance.request(axiosError.config!);\n } catch (_retryError) {\n // If retry fails, report and throw original error\n config.errorReporter?.report(wcError);\n return Promise.reject(wcError);\n }\n }\n\n // Report error to configured error reporter (Sentry, etc.)\n config.errorReporter?.report(wcError);\n\n return Promise.reject(wcError);\n }\n );\n};\n\n// Augment AxiosRequestConfig to include _retry flag\ndeclare module 'axios' {\n export interface AxiosRequestConfig {\n _retry?: boolean;\n }\n}\n"]}
1
+ {"version":3,"sources":["../../src/errors/classes/BaseError.ts","../../src/errors/mapping/mapWooCommerceCode.ts","../../src/errors/mapping/constants.ts","../../src/errors/classes/WooCommerceApiError.ts","../../src/errors/classes/WooCommerceDataValidationError.ts","../../src/http/handleApiResponse.ts","../../src/utils/calculatePagination.ts","../../src/utils/getPaginationMeta.ts","../../src/http/handlePaginatedApiResponse.ts","../../src/logging/logger.ts","../../src/http/storeRoutes.ts","../../src/http/interceptors/request.ts","../../src/http/interceptors/response.ts","../../src/utils/initializeCartSession.ts","../../src/http/interceptors/error.ts"],"names":["error"],"mappings":";;;AASO,IAAM,SAAA,GAAN,cAGG,KAAA,CAAM;AAAA,EACd,YAA4B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A,GAAS,IAAA;AAG5B,UAAA,OAAO,aAAA,CAAc,OAAA,CAAQ,UAAA,CAAW,MAAO,CAAA;AAAA,QACjD,SAAS,WAAA,EAAa;AAEpB,UAAA,MAAA,CAAO,aAAA,EAAe,OAAO,OAAO,CAAA;AACpC,UAAA,OAAO,OAAA,CAAQ,OAAO,OAAO,CAAA;AAAA,QAC/B;AAAA,MACF;AAGA,MAAA,MAAA,CAAO,aAAA,EAAe,OAAO,OAAO,CAAA;AAEpC,MAAA,OAAO,OAAA,CAAQ,OAAO,OAAO,CAAA;AAAA,IAC/B;AAAA,GACF;AACF","file":"index.mjs","sourcesContent":["/**\n * Base error class for all package errors\n *\n * Generic over:\n * - TOptions: The options type for this error class\n * - TReportable: The reportable data structure for error tracking\n */\nimport type { BaseErrorOptions, BaseReportableData } from './types';\n\nexport class BaseError<\n TOptions extends BaseErrorOptions = BaseErrorOptions,\n TReportable extends BaseReportableData = BaseReportableData,\n> extends Error {\n constructor(public readonly options: TOptions) {\n super(options.message);\n\n // Maintain proper prototype chain\n Object.setPrototypeOf(this, new.target.prototype);\n\n // Set error name\n this.name = this.constructor.name;\n\n // Capture stack trace (excluding constructor call)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n // If there's a cause with a stack, preserve it\n if (this.options.cause instanceof Error && this.options.cause.stack) {\n this.stack = `${this.stack}\\nCaused by: ${this.options.cause.stack}`;\n }\n }\n\n /**\n * Get reportable data for error tracking/logging\n * Subclasses should override this to add their own reportable fields\n */\n getReportableData(): TReportable {\n const { code, operation, userMessage, retryable } = this.options;\n return {\n code,\n operation,\n userMessage,\n retryable,\n } as TReportable;\n }\n\n /**\n * Custom JSON serialization\n * Makes the error properly serializable for logging/reporting\n */\n toJSON(): Record<string, unknown> {\n return {\n ...this.getReportableData(),\n name: this.name,\n message: this.message,\n stack: this.stack,\n } as unknown as Record<string, unknown>;\n }\n}\n","import type { WooCommerceApiErrorCode } from './types';\n\nexport const mapWooCommerceCode = (apiCode?: string): WooCommerceApiErrorCode => {\n if (!apiCode) return 'unknown_error';\n\n // Direct matches\n const directMatches: Record<string, WooCommerceApiErrorCode> = {\n woocommerce_rest_cart_empty: 'cart_empty',\n woocommerce_rest_cart_coupon_error: 'invalid_coupon',\n woocommerce_rest_missing_nonce: 'missing_nonce',\n woocommerce_rest_invalid_nonce: 'invalid_nonce',\n rest_invalid_param: 'invalid_params',\n woocommerce_rest_product_invalid_id: 'product_not_found',\n woocommerce_rest_product_out_of_stock: 'out_of_stock',\n woocommerce_rest_product_not_enough_stock: 'insufficient_stock',\n woocommerce_rest_checkout_invalid_payment_method: 'invalid_payment_method',\n };\n\n if (directMatches[apiCode]) {\n return directMatches[apiCode];\n }\n\n // Pattern matches\n if (apiCode.includes('nonce')) return 'invalid_nonce';\n if (apiCode.includes('coupon')) return 'invalid_coupon';\n if (apiCode.includes('stock')) return 'insufficient_stock';\n if (apiCode.includes('checkout')) return 'checkout_error';\n if (apiCode.includes('payment')) return 'invalid_payment_method';\n\n return 'unknown_error';\n};\n","import type { WooCommerceApiErrorCode, WooCommerceApiErrorMetaData } from './types';\n\nexport const WOOCOMMERCE_ERROR_METADATA: Record<\n WooCommerceApiErrorCode,\n WooCommerceApiErrorMetaData\n> = {\n cart_empty: {\n operation: 'get_cart',\n retryable: false,\n userMessage: 'Your cart is empty',\n },\n invalid_coupon: {\n operation: 'apply_coupon',\n retryable: false,\n userMessage: 'Invalid coupon code',\n },\n missing_nonce: {\n operation: 'cart_request',\n retryable: true, // Auto-retry with new nonce\n },\n invalid_nonce: {\n operation: 'cart_request',\n retryable: true, // Auto-retry with new nonce\n },\n invalid_params: {\n operation: 'api_request',\n retryable: false,\n userMessage: 'Invalid request parameters',\n },\n product_not_found: {\n operation: 'get_product',\n retryable: false,\n userMessage: 'Product not found',\n },\n out_of_stock: {\n operation: 'add_to_cart',\n retryable: false,\n userMessage: 'This product is out of stock',\n },\n insufficient_stock: {\n operation: 'add_to_cart',\n retryable: false,\n userMessage: 'Not enough stock available',\n },\n invalid_payment_method: {\n operation: 'process_checkout',\n retryable: false,\n userMessage: 'Invalid payment method',\n },\n checkout_error: {\n operation: 'process_checkout',\n retryable: false,\n },\n network_error: {\n operation: 'network_request',\n retryable: true,\n },\n unknown_error: {\n operation: 'unknown',\n retryable: false,\n },\n};\n","/**\n * WooCommerce API Error\n */\n\nimport { WOOCOMMERCE_ERROR_METADATA, type WooCommerceApiErrorCode } from '../mapping';\nimport { BaseError } from './BaseError';\nimport type { ApiReportableData, WooCommerceApiErrorOptions } from './types';\n\n/**\n * WooCommerce-specific error class\n *\n * Extends BaseError to provide:\n * - Code transformation (WooCommerce API codes → clean app codes)\n * - WooCommerce-specific error categorization\n * - HTTP context (status, URL, method)\n */\nexport class WooCommerceApiError extends BaseError<WooCommerceApiErrorOptions, ApiReportableData> {\n constructor(options: WooCommerceApiErrorOptions) {\n const metadata = WOOCOMMERCE_ERROR_METADATA[options.code] ?? {\n operation: 'woocommerce_api_request',\n retryable: false,\n };\n\n // Enrich options with metadata defaults\n const enrichedOptions: WooCommerceApiErrorOptions = {\n ...options,\n operation: options.operation || metadata.operation,\n userMessage: options.userMessage || metadata.userMessage,\n retryable: options.retryable ?? metadata.retryable,\n };\n\n super(enrichedOptions);\n }\n\n // Convenient getters for frequently accessed fields (no duplication)\n get wooCode(): WooCommerceApiErrorCode {\n return this.options.code;\n }\n\n get originalCode(): string {\n return this.options.originalCode;\n }\n\n get statusCode(): number {\n return this.options.statusCode;\n }\n\n get url(): string {\n return this.options.url;\n }\n\n get method(): string {\n return this.options.method;\n }\n\n get requestBody(): unknown | undefined {\n return this.options.requestBody;\n }\n\n get responseBody(): unknown | undefined {\n return this.options.responseBody;\n }\n\n get data(): Record<string, unknown> | undefined {\n return this.options.data;\n }\n\n /**\n * Get reportable data for error tracking/logging\n * Includes HTTP context and WooCommerce-specific fields\n */\n override getReportableData(): ApiReportableData {\n return {\n code: this.options.code,\n operation: this.options.operation,\n userMessage: this.options.userMessage,\n retryable: this.options.retryable,\n statusCode: this.options.statusCode,\n url: this.options.url,\n method: this.options.method,\n wooCode: this.options.code,\n originalCode: this.options.originalCode,\n };\n }\n}\n","/**\n * WooCommerce validation error class\n * Thrown when API response validation fails\n */\n\nimport type { ZodError } from 'zod';\n\nimport { BaseError } from './BaseError';\nimport type {\n BaseErrorOptions,\n ValidationReportableData,\n WooCommerceDataValidationErrorOptions,\n} from './types';\n\n/**\n * Internal options type that combines user options with computed fields\n */\ninterface WooCommerceDataValidationErrorInternalOptions extends BaseErrorOptions {\n url?: string;\n zodError?: ZodError;\n value?: unknown;\n fieldErrors?: Record<string, string[]>;\n}\n\n/**\n * WooCommerce validation error\n *\n * Thrown when API response validation fails using Zod schemas\n */\nexport class WooCommerceDataValidationError extends BaseError<\n WooCommerceDataValidationErrorInternalOptions,\n ValidationReportableData\n> {\n constructor(options: WooCommerceDataValidationErrorOptions) {\n // Extract field errors from Zod error if provided\n const fieldErrors = options.zodError\n ? WooCommerceDataValidationError.extractFieldErrorsFromZod(options.zodError)\n : undefined;\n\n super({\n code: 'validation_error',\n message: options.message,\n operation: options.operation,\n userMessage: options.userMessage || 'Received unexpected data from WooCommerce',\n retryable: false,\n cause: options.cause,\n url: options.url,\n zodError: options.zodError,\n value: options.value,\n fieldErrors,\n });\n }\n\n // Convenient getters for validation-specific fields (no duplication)\n get url(): string | undefined {\n return this.options.url;\n }\n\n get zodError(): ZodError | undefined {\n return this.options.zodError;\n }\n\n get invalidValue(): unknown | undefined {\n return this.options.value;\n }\n\n get fieldErrors(): Record<string, string[]> | undefined {\n return this.options.fieldErrors;\n }\n\n /**\n * Get reportable data for error tracking/logging\n * Includes validation-specific fields\n */\n override getReportableData(): ValidationReportableData {\n return {\n code: this.options.code,\n operation: this.options.operation,\n userMessage: this.options.userMessage,\n retryable: false,\n fieldErrors: this.options.fieldErrors,\n url: this.options.url,\n };\n }\n\n /**\n * Extract field errors from Zod error\n */\n private static extractFieldErrorsFromZod(\n zodError: ZodError\n ): Record<string, string[]> | undefined {\n if (!zodError?.errors) {\n return undefined;\n }\n\n const fieldErrors: Record<string, string[]> = {};\n\n for (const issue of zodError.errors) {\n const path = issue.path.join('.');\n if (!fieldErrors[path]) {\n fieldErrors[path] = [];\n }\n fieldErrors[path].push(issue.message);\n }\n\n return fieldErrors;\n }\n\n /**\n * Get all error messages as a flat array\n */\n getMessages(): string[] {\n if (!this.fieldErrors) {\n return [this.message];\n }\n\n const messages: string[] = [];\n for (const fieldMessages of Object.values(this.fieldErrors)) {\n messages.push(...fieldMessages);\n }\n\n return messages;\n }\n\n /**\n * Check if a specific field has errors\n */\n hasFieldError(field: string): boolean {\n return this.fieldErrors ? field in this.fieldErrors : false;\n }\n\n /**\n * Get error messages for a specific field\n */\n getFieldError(field: string): string[] | undefined {\n return this.fieldErrors?.[field];\n }\n}\n","/**\n * Response validation utilities\n */\n\nimport type { AxiosResponse } from 'axios';\nimport type { ZodError, ZodSchema } from 'zod';\n\nimport { WooCommerceDataValidationError } from '@/errors';\n\n/**\n * Validation mode for API responses\n * - 'strict': Throw error on validation failure (default)\n * - 'warn': Log warning and continue on validation failure\n */\nexport type ValidationMode = 'strict' | 'warn';\n\n/**\n * Options for response handling\n */\nexport interface ResponseOptions {\n /** Validation mode */\n validationMode?: ValidationMode;\n\n /** Error reporter for validation errors */\n errorReporter?: (error: Error) => void;\n\n /** Optional validation error handler (called before errorReporter) */\n onValidationError?: (error: Error) => void;\n}\n\n/**\n * Handle and validate API response\n *\n * @param response - Axios response\n * @param schema - Zod schema for validation\n * @param options - Response handling options\n * @returns Validated data\n * @throws ValidationError if validation fails in strict mode\n */\nexport const handleApiData = <T>(\n data: unknown,\n schema: ZodSchema<T>,\n options?: ResponseOptions,\n url?: string\n): T => {\n const validationMode = options?.validationMode ?? 'strict';\n\n // Warn mode - use safeParse and continue on validation failure\n if (validationMode === 'warn') {\n const result = schema.safeParse(data);\n\n if (!result.success) {\n const validationError = new WooCommerceDataValidationError({\n message: `WooCommerce API response validation failed for ${url || 'unknown endpoint'}`,\n url,\n zodError: result.error,\n value: data,\n userMessage: 'Received unexpected data from WooCommerce',\n });\n\n // Call optional validation error handler\n options?.onValidationError?.(validationError);\n\n // Report to error tracker (if provided)\n options?.errorReporter?.(validationError);\n\n // Log warning to console in warn mode\n console.warn('[woocommerce-utils] Validation warning:', validationError.message);\n\n // Return raw data to allow app to continue\n return data as T;\n }\n\n return result.data;\n }\n\n // Strict mode - throw on validation failure\n try {\n return schema.parse(data);\n } catch (error) {\n if (error && typeof error === 'object' && 'issues' in error) {\n const validationError = new WooCommerceDataValidationError({\n message: `WooCommerce API response validation failed for ${url || 'unknown endpoint'}`,\n url,\n zodError: error as ZodError,\n value: data,\n userMessage: 'Received unexpected data from WooCommerce',\n });\n\n // Call optional validation error handler\n options?.onValidationError?.(validationError);\n\n // Report to error tracker (if provided)\n options?.errorReporter?.(validationError);\n\n throw validationError;\n }\n throw error;\n }\n};\n\nexport const handleApiResponse = <T>(\n response: AxiosResponse,\n schema: ZodSchema<T>,\n options?: ResponseOptions\n): T => handleApiData(response.data, schema, options, response.config.url);\n\n/**\n * Check if error is a Zod validation error\n */\nexport const isZodError = (error: unknown): error is ZodError => {\n return error instanceof Error && error.name === 'ZodError';\n};\n","/**\n * Calculate pagination navigation\n */\n\nexport interface Pagination {\n page: number;\n perPage: number;\n total: number;\n totalPages: number;\n hasNextPage: boolean;\n hasPrevPage: boolean;\n nextPage: number | null;\n prevPage: number | null;\n}\n\nexport interface CalculatePaginationInput {\n page: number;\n perPage: number;\n total: number;\n totalPages: number;\n}\n\n/**\n * Calculate pagination navigation from WooCommerce pagination metadata\n *\n * @param input - Current pagination state\n * @returns Full pagination object with navigation helpers\n */\nexport const calculatePagination = (input: CalculatePaginationInput): Pagination => {\n const { page, perPage, total, totalPages } = input;\n\n const hasNextPage = page < totalPages;\n const hasPrevPage = page > 1;\n\n return {\n page,\n perPage,\n total,\n totalPages,\n hasNextPage,\n hasPrevPage,\n nextPage: hasNextPage ? page + 1 : null,\n prevPage: hasPrevPage ? page - 1 : null,\n };\n};\n","/**\n * Extract pagination metadata from WooCommerce response headers\n */\n\nimport type { AxiosResponse } from 'axios';\n\nexport interface PaginationMeta {\n total: number;\n totalPages: number;\n}\n\nexport const getPaginationMeta = (headers: AxiosResponse['headers']): PaginationMeta => {\n // Handle undefined/null headers\n if (!headers) {\n return {\n total: 0,\n totalPages: 0,\n };\n }\n\n const wpTotal = headers['x-wp-total'];\n const wpTotalPages = headers['x-wp-totalpages'];\n\n if (!wpTotal || !wpTotalPages) {\n return {\n total: 0,\n totalPages: 0,\n };\n }\n\n const total = parseInt(wpTotal, 10);\n const totalPages = parseInt(wpTotalPages, 10);\n\n return {\n total,\n totalPages,\n };\n};\n","/**\n * Pagination utilities for WooCommerce API responses\n */\n\nimport type { AxiosResponse } from 'axios';\nimport type { ZodError, ZodSchema } from 'zod';\n\nimport { WooCommerceDataValidationError } from '../errors';\nimport { calculatePagination, type Pagination } from '../utils/calculatePagination';\nimport { getPaginationMeta } from '../utils/getPaginationMeta';\nimport type { ResponseOptions } from './handleApiResponse';\n\n/**\n * Paginated response wrapper\n */\nexport interface PaginatedResponse<T> {\n data: T[];\n pagination: Pagination;\n}\n\n/**\n * Handle paginated API response\n *\n * @param response - Axios response\n * @param schema - Zod schema for validating array items\n * @param params - Request parameters (page, per_page)\n * @param options - Response handling options\n * @returns Paginated response with validated data\n * @throws ValidationError if validation fails in strict mode\n */\nexport const handlePaginatedApiResponse = <T>(\n response: AxiosResponse,\n schema: ZodSchema<T[]>,\n params: { page?: number; per_page?: number } = {},\n options?: ResponseOptions\n): PaginatedResponse<T> => {\n const validationMode = options?.validationMode ?? 'strict';\n let data: T[];\n\n // Warn mode - use safeParse and continue on validation failure\n if (validationMode === 'warn') {\n const result = schema.safeParse(response.data);\n\n if (!result.success) {\n const validationError = new WooCommerceDataValidationError({\n message: `WooCommerce API response validation failed for ${response.config.url || 'unknown endpoint'}`,\n url: response.config.url,\n zodError: result.error,\n value: response.data,\n userMessage: 'Received unexpected data from WooCommerce',\n });\n\n // Call optional validation error handler\n options?.onValidationError?.(validationError);\n\n // Report to error tracker (if provided)\n options?.errorReporter?.(validationError);\n\n // Log warning to console in warn mode\n console.warn('[woocommerce-utils] Validation warning:', validationError.message);\n\n // Return raw data as array (best effort)\n data = Array.isArray(response.data) ? response.data : [];\n } else {\n data = result.data;\n }\n } else {\n // Strict mode - throw on validation failure\n try {\n data = schema.parse(response.data);\n } catch (error) {\n if (error && typeof error === 'object' && 'issues' in error) {\n const validationError = new WooCommerceDataValidationError({\n message: `WooCommerce API response validation failed for ${response.config.url || 'unknown endpoint'}`,\n url: response.config.url,\n zodError: error as ZodError,\n value: response.data,\n userMessage: 'Received unexpected data from WooCommerce',\n });\n\n // Call optional validation error handler\n options?.onValidationError?.(validationError);\n\n // Report to error tracker (if provided)\n options?.errorReporter?.(validationError);\n\n throw validationError;\n }\n throw error;\n }\n }\n\n const { total, totalPages } = getPaginationMeta(response.headers);\n const page = params.page || 1;\n const perPage = params.per_page || 10;\n\n const pagination = calculatePagination({\n page,\n perPage,\n total,\n totalPages,\n });\n\n return {\n data,\n pagination,\n };\n};\n","/**\n * Debug logger for WooCommerce utils\n */\n\nconst DEBUG_PREFIX = '[woocommerce-utils]';\n\n/**\n * Check if debug mode is enabled\n */\nexport const isDebugEnabled = (): boolean => {\n if (typeof process !== 'undefined' && process.env) {\n return process.env.DEBUG === 'true' || process.env.DEBUG === '1';\n }\n return false;\n};\n\n/**\n * Log debug message (only if DEBUG is enabled)\n */\nexport const debug = (...args: unknown[]): void => {\n if (isDebugEnabled()) {\n console.log(DEBUG_PREFIX, ...args);\n }\n};\n\n/**\n * Log warning message\n */\nexport const warn = (...args: unknown[]): void => {\n console.warn(DEBUG_PREFIX, ...args);\n};\n\n/**\n * Log error message\n */\nexport const error = (...args: unknown[]): void => {\n console.error(DEBUG_PREFIX, ...args);\n};\n","const CART_ROUTE = /\\/wc\\/store\\/(v\\d+\\/)?(cart|checkout|batch)/;\nconst BATCH_ROUTE = /\\/wc\\/store\\/(v\\d+\\/)?batch/;\n\nexport const isCartRoute = (url?: string): boolean => !!url && CART_ROUTE.test(url);\n\nexport const isBatchRoute = (url?: string): boolean => !!url && BATCH_ROUTE.test(url);\n","/**\n * Request interceptor\n *\n * Handles:\n * - JWT authentication for protected endpoints\n * - Nonce/Cart-Token injection for cart/checkout endpoints\n * - Cache-Control headers for cart/checkout to prevent Android caching bugs\n * - Debug logging\n */\n\nimport type { AxiosInstance, InternalAxiosRequestConfig } from 'axios';\n\nimport type { WooCommerceClient, WooCommerceConfig } from '../../client/types';\nimport { debug } from '../../logging/logger';\nimport { isBatchRoute, isCartRoute } from '../storeRoutes';\n\n/**\n * Check if endpoint requires JWT authentication\n */\nconst requiresAuth = (url?: string): boolean => {\n if (!url) return false;\n\n const authEndpoints = [\n '/jwt-auth/',\n '/customers/me',\n '/wp/v2/users/me',\n // Store API non-cart endpoints: inject JWT when available so authenticated\n // users can access their own resources (e.g. orders, personalised product data)\n '/wc/store/v1/order',\n ];\n\n return authEndpoints.some((endpoint) => url.includes(endpoint));\n};\n\n/**\n * Setup request interceptor\n *\n * - Injects JWT Bearer token for authenticated requests\n * - Injects Nonce/Cart-Token headers for cart/checkout requests\n * - Adds Cache-Control headers to prevent Android caching bugs\n * - Calls optional onRequest hook\n * - Passes client instance to callbacks\n */\nexport const setupRequestInterceptor = (\n axiosInstance: AxiosInstance,\n config: WooCommerceConfig,\n client: WooCommerceClient\n): void => {\n axiosInstance.interceptors.request.use(\n async (requestConfig: InternalAxiosRequestConfig) => {\n const url = requestConfig.url;\n\n // Inject JWT token for authenticated endpoints\n if (config.jwtToken) {\n const token = await config.jwtToken.get();\n if (token && (requiresAuth(url) || isCartRoute(url))) {\n requestConfig.headers.Authorization = `Bearer ${token}`;\n if (config.debug) {\n debug('Injected JWT token for', url);\n }\n }\n }\n\n // Inject nonce/cart-token for cart endpoints\n // When JWT is present, skip Cart-Token: WooCommerce prioritizes Cart-Token over JWT\n // for session identification, which would route requests to a separate API session\n // instead of the user's persistent cart.\n //\n // /batch is the exception. WP core rebuilds every sub-request as a fresh\n // WP_REST_Request, so none of them inherit the Nonce header and each one fails\n // AbstractCartRoute::check_nonce(). WooCommerce waives the nonce when\n // has_cart_token() is set, and that helper reads the outer HTTP header precisely\n // so it survives batch dispatch — so Cart-Token is the only credential a batch\n // sub-request can present.\n if (isCartRoute(url)) {\n const headers = await config.cartHeaders.get();\n const isAuthenticated = !!(await config.jwtToken?.get());\n\n if (headers.nonce) {\n requestConfig.headers.Nonce = headers.nonce;\n }\n if (headers.cartToken && (!isAuthenticated || isBatchRoute(url))) {\n requestConfig.headers['Cart-Token'] = headers.cartToken;\n }\n\n // CRITICAL: Disable HTTP caching for cart/checkout endpoints\n // WooCommerce sends aggressive cache headers (max-age=2419200, 28 days) which\n // can cause Android HTTP clients to serve stale cart data from cache.\n // This was causing empty carts to be returned after successful add-item operations\n // because the cached GET /cart response (from before items were added) was being\n // served instead of fetching fresh data from the server.\n // iOS URLSession happened to work because it handles expired cache differently.\n requestConfig.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate';\n requestConfig.headers.Pragma = 'no-cache';\n requestConfig.headers.Expires = '0';\n\n if (config.debug) {\n debug('Injected cart headers for', url, {\n hasNonce: !!headers.nonce,\n hasCartToken: !!headers.cartToken,\n });\n }\n }\n\n // Debug logging\n if (config.debug) {\n debug(\n `${requestConfig.method?.toUpperCase()} ${requestConfig.url}`,\n requestConfig.params || requestConfig.data\n );\n }\n\n // Call optional onRequest hook\n if (config.onRequest) {\n return config.onRequest(requestConfig, client);\n }\n\n return requestConfig;\n },\n (error) => {\n return Promise.reject(error);\n }\n );\n};\n","/**\n * Axios response interceptor for WooCommerce API\n */\n\nimport { AxiosError, type AxiosInstance, type AxiosResponse } from 'axios';\n\nimport type { WooCommerceClient, WooCommerceConfig } from '../../client/types';\nimport { debug } from '../../logging/logger';\nimport { isBatchRoute, isCartRoute } from '../storeRoutes';\n\nconst NONCE_ERROR_CODES = ['woocommerce_rest_missing_nonce', 'woocommerce_rest_invalid_nonce'];\n\nconst isNonceRejectedBatch = (data: unknown): boolean => {\n const responses = (data as { responses?: unknown } | null | undefined)?.responses;\n\n if (!Array.isArray(responses) || responses.length === 0) return false;\n\n return responses.every((response) => {\n const code = (response as { body?: { code?: unknown } } | null)?.body?.code;\n return typeof code === 'string' && NONCE_ERROR_CODES.includes(code);\n });\n};\n\n/**\n * Setup response interceptor\n *\n * - Extracts and saves cart headers (nonce rotation)\n * - Logs responses in debug mode\n * - Calls optional onResponse hook\n * - Passes client instance to callbacks\n */\nexport const setupResponseInterceptor = (\n axiosInstance: AxiosInstance,\n config: WooCommerceConfig,\n client: WooCommerceClient\n): void => {\n axiosInstance.interceptors.response.use(\n async (response: AxiosResponse) => {\n // Extract and save cart headers (nonce rotation)\n if (isCartRoute(response.config.url)) {\n const nonce = response.headers['nonce'] || response.headers['Nonce'];\n const cartToken = response.headers['cart-token'] || response.headers['Cart-Token'];\n\n if (nonce || cartToken) {\n await config.cartHeaders.save({\n nonce: nonce || undefined,\n cartToken: cartToken || undefined,\n });\n\n if (config.debug) {\n debug(\n 'Saved updated cart headers:',\n response.config.url,\n 'nonce:',\n !!nonce,\n 'cartToken:',\n !!cartToken\n );\n }\n }\n }\n\n if (isBatchRoute(response.config.url) && isNonceRejectedBatch(response.data)) {\n throw new AxiosError(\n 'Batch rejected for a nonce error',\n AxiosError.ERR_BAD_REQUEST,\n response.config,\n response.request,\n { ...response, status: 401, data: { code: 'woocommerce_rest_missing_nonce' } }\n );\n }\n\n if (config.debug) {\n debug('Response:', response.config.url, response.status);\n }\n\n // Call optional onResponse hook\n if (config.onResponse) {\n return config.onResponse(response, client);\n }\n\n return response;\n },\n (error) => {\n return Promise.reject(error);\n }\n );\n};\n","/**\n * Cart session initialization utility\n */\n\nimport type { AxiosInstance } from 'axios';\n\nimport type { CartHeadersAdapter } from '../client/types';\nimport { debug } from '../logging/logger';\n\n/**\n * Initialize cart session by fetching cart and saving headers\n *\n * This is called when nonce errors occur to get a fresh nonce/cart-token\n *\n * @param client - Axios instance\n * @param cartHeaders - Cart headers adapter\n */\nexport const initializeCartSession = async (\n client: AxiosInstance,\n cartHeaders: CartHeadersAdapter\n): Promise<void> => {\n try {\n debug('session', 'Initializing cart session');\n\n // Make GET request to cart endpoint\n const response = await client.get('/wc/store/v1/cart');\n\n // Extract headers\n const nonce = response.headers['nonce'] || response.headers['Nonce'];\n const cartToken = response.headers['cart-token'] || response.headers['Cart-Token'];\n\n // Save headers\n if (nonce || cartToken) {\n await cartHeaders.save({\n nonce: nonce || undefined,\n cartToken: cartToken || undefined,\n });\n\n debug('session', 'Cart session initialized', {\n hasNonce: !!nonce,\n hasCartToken: !!cartToken,\n });\n }\n } catch (error) {\n debug('session', 'Failed to initialize cart session', error);\n throw error;\n }\n};\n","/**\n * Axios error interceptor for WooCommerce API\n */\n\nimport { isAxiosError, type AxiosError, type AxiosInstance } from 'axios';\n\nimport type { WooCommerceClient, WooCommerceConfig } from '../../client/types';\nimport { WooCommerceApiError } from '../../errors/classes/WooCommerceApiError';\nimport { mapWooCommerceCode, WOOCOMMERCE_ERROR_METADATA } from '../../errors/mapping';\nimport { debug, error as logError } from '../../logging/logger';\nimport { initializeCartSession } from '../../utils/initializeCartSession';\n\ninterface WooCommerceErrorData {\n code?: string;\n message?: string;\n data?: {\n status?: number;\n };\n}\n\n/**\n * Setup error interceptor\n *\n * - Transforms WooCommerce errors into WooCommerceApiError instances\n * - Calls optional onError hook\n * - Passes client instance to callbacks\n */\nexport const setupErrorInterceptor = (\n axiosInstance: AxiosInstance,\n config: WooCommerceConfig,\n client: WooCommerceClient\n): void => {\n axiosInstance.interceptors.response.use(\n (response) => response,\n async (axiosError: AxiosError<WooCommerceErrorData>) => {\n const status = axiosError.response?.status || 500;\n const errorData = axiosError.response?.data;\n\n // Extract WooCommerce error details\n const apiCode = errorData?.code || 'unknown_error';\n const wpMessage = errorData?.message || axiosError.message || 'Unknown error';\n\n // Transform WooCommerce API code to application-level code\n // e.g., \"woocommerce_rest_cart_empty\" → \"cart_empty\"\n const errorCode = mapWooCommerceCode(apiCode);\n const errorMetadata = WOOCOMMERCE_ERROR_METADATA[errorCode];\n\n // Create WooCommerceError with full context\n const wcError = new WooCommerceApiError({\n message: wpMessage,\n statusCode: status,\n code: errorCode, // Transformed app-level code\n originalCode: apiCode, // Original WooCommerce API code\n retryable: errorMetadata.retryable,\n userMessage: errorMetadata.userMessage,\n operation: errorMetadata.operation,\n url: axiosError.config?.url || '',\n method: axiosError.config?.method?.toUpperCase() || 'GET',\n requestBody: axiosError.config?.data,\n responseBody: errorData,\n data: errorData?.data as Record<string, unknown> | undefined,\n cause: axiosError,\n });\n\n if (config.debug) {\n debug('WooCommerce error:', apiCode, status, wpMessage);\n logError(wcError);\n }\n\n // Handle authentication errors (401/403)\n if (\n (status === 401 || status === 403) &&\n config.onAuthError &&\n isAxiosError(axiosError) &&\n !axiosError.config?._retry\n ) {\n if (config.debug) {\n debug('Auth error detected, calling onAuthError handler');\n }\n\n try {\n const shouldRetry = await config.onAuthError(wcError, client);\n\n if (shouldRetry) {\n if (config.debug) {\n debug('Retrying request after auth error');\n }\n\n // Mark as retry to prevent infinite loops\n axiosError.config!._retry = true;\n\n // Retry the request\n return axiosInstance.request(axiosError.config!);\n }\n } catch (authErrorHandlerError) {\n // If onAuthError handler throws, fall through to error reporting\n if (config.debug) {\n debug('onAuthError handler threw error', authErrorHandlerError);\n }\n }\n }\n\n // Call optional onError hook first (even for retryable errors)\n if (config.onError) {\n config.onError(wcError, client);\n }\n\n // Auto-retry nonce errors\n const isNonceError = errorCode === 'missing_nonce' || errorCode === 'invalid_nonce';\n if (isNonceError && isAxiosError(axiosError) && !axiosError.config?._retry) {\n if (config.debug) {\n debug('Nonce error detected, retrying with new session');\n }\n\n try {\n // Initialize new cart session\n await initializeCartSession(axiosInstance, config.cartHeaders);\n\n // Mark as retry to prevent infinite loops\n axiosError.config!._retry = true;\n\n // Retry the request\n return axiosInstance.request(axiosError.config!);\n } catch (_retryError) {\n // If retry fails, report and throw original error\n config.errorReporter?.report(wcError);\n return Promise.reject(wcError);\n }\n }\n\n // Report error to configured error reporter (Sentry, etc.)\n config.errorReporter?.report(wcError);\n\n return Promise.reject(wcError);\n }\n );\n};\n\n// Augment AxiosRequestConfig to include _retry flag\ndeclare module 'axios' {\n export interface AxiosRequestConfig {\n _retry?: boolean;\n }\n}\n"]}
package/dist/index.d.mts CHANGED
@@ -1,10 +1,12 @@
1
1
  export { createClient } from './client/index.mjs';
2
- import { B as BaseError, e as BaseErrorOptions, f as ValidationReportableData, g as WooCommerceDataValidationErrorOptions } from './types-BF4_UUqp.mjs';
3
- export { A as AddToCartInput, j as Cart, k as CartAPI, C as CartHeadersAdapter, l as CartItem, m as CartItemImage, n as Checkout, o as CheckoutAPI, p as CheckoutInput, q as CouponInput, G as GetOrderInput, J as JwtTokenAdapter, O as OrderStatus, r as OrdersAPI, P as PaginatedResponse, t as Product, u as ProductCategory, v as ProductImage, w as ProductParams, x as ProductsAPI, y as RemoveCartItemInput, z as SelectShippingRateInput, D as StoreApiOrder, U as UpdateCartItemInput, E as UpdateCustomerInput, F as WooCommerceApiError, H as WooCommerceApiErrorOptions, a as WooCommerceClient, W as WooCommerceConfig, I as addToCartInputSchema, K as cartItemImageSchema, L as cartSchema, M as checkoutInputSchema, N as checkoutSchema, Q as couponInputSchema, T as productCategorySchema, X as productImageSchema, Y as productSchema, Z as removeCartItemInputSchema, _ as searchParamsSchema, $ as selectShippingRateInputSchema, a0 as storeApiOrderSchema, a1 as updateCartItemInputSchema, a2 as updateCustomerInputSchema } from './types-BF4_UUqp.mjs';
2
+ import { f as WooCommerceApiErrorCode, B as BaseError, g as BaseErrorOptions, j as ValidationReportableData, k as WooCommerceDataValidationErrorOptions } from './types-aYzN4O5x.mjs';
3
+ export { A as AddItemsInput, l as AddItemsResult, m as AddToCartInput, n as BatchResponse, o as Cart, p as CartAPI, C as CartHeadersAdapter, q as CartItem, r as CartItemImage, t as Checkout, u as CheckoutAPI, v as CheckoutInput, w as CouponInput, G as GetOrderInput, J as JwtTokenAdapter, O as OrderStatus, x as OrdersAPI, P as PaginatedResponse, y as Product, z as ProductCategory, D as ProductImage, E as ProductParams, F as ProductsAPI, H as RemoveCartItemInput, I as SelectShippingRateInput, K as StoreApiOrder, U as UpdateCartItemInput, L as UpdateCustomerInput, M as WooCommerceApiError, N as WooCommerceApiErrorOptions, a as WooCommerceClient, W as WooCommerceConfig, Q as addItemsInputSchema, T as addToCartInputSchema, X as batchResponseSchema, Y as cartItemImageSchema, Z as cartSchema, _ as checkoutInputSchema, $ as checkoutSchema, a0 as couponInputSchema, a1 as productCategorySchema, a2 as productImageSchema, a3 as productSchema, a4 as removeCartItemInputSchema, a5 as searchParamsSchema, a6 as selectShippingRateInputSchema, a7 as storeApiOrderSchema, a8 as updateCartItemInputSchema, a9 as updateCustomerInputSchema } from './types-aYzN4O5x.mjs';
4
4
  import * as zod from 'zod';
5
5
  import { ZodError, z } from 'zod';
6
6
  import 'axios';
7
7
 
8
+ declare const mapWooCommerceCode: (apiCode?: string) => WooCommerceApiErrorCode;
9
+
8
10
  interface WooCommerceDataValidationErrorInternalOptions extends BaseErrorOptions {
9
11
  url?: string;
10
12
  zodError?: ZodError;
@@ -1119,8 +1121,8 @@ declare const orderFilterSchema: z.ZodObject<{
1119
1121
  product?: number | undefined;
1120
1122
  dp?: number | undefined;
1121
1123
  }, {
1122
- page?: number | undefined;
1123
1124
  status?: ("pending" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed" | "auto-draft" | "trash" | "checkout-draft")[] | undefined;
1125
+ page?: number | undefined;
1124
1126
  per_page?: number | undefined;
1125
1127
  offset?: number | undefined;
1126
1128
  order?: "asc" | "desc" | undefined;
@@ -1352,8 +1354,8 @@ declare const orderSchema: z.ZodObject<{
1352
1354
  monri_transaction_id: z.ZodOptional<z.ZodString>;
1353
1355
  monri_status: z.ZodOptional<z.ZodString>;
1354
1356
  }, "strip", z.ZodTypeAny, {
1355
- total: string;
1356
1357
  status: "pending" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed" | "auto-draft" | "trash" | "checkout-draft";
1358
+ total: string;
1357
1359
  id: number;
1358
1360
  payment_method: "cod" | "monri" | "pikpay" | "bacs" | "cheque";
1359
1361
  payment_method_title: string;
@@ -1434,8 +1436,8 @@ declare const orderSchema: z.ZodObject<{
1434
1436
  monri_transaction_id?: string | undefined;
1435
1437
  monri_status?: string | undefined;
1436
1438
  }, {
1437
- total: string;
1438
1439
  status: "pending" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed" | "auto-draft" | "trash" | "checkout-draft";
1440
+ total: string;
1439
1441
  id: number;
1440
1442
  payment_method: "cod" | "monri" | "pikpay" | "bacs" | "cheque";
1441
1443
  payment_method_title: string;
@@ -1947,8 +1949,8 @@ declare const productFilterSchema: z.ZodObject<{
1947
1949
  modified_before: z.ZodOptional<z.ZodString>;
1948
1950
  dates_are_gmt: z.ZodDefault<z.ZodBoolean>;
1949
1951
  }, "strip", z.ZodTypeAny, {
1950
- page: number;
1951
1952
  status: "pending" | "any" | "draft" | "private" | "publish" | "trash" | "future";
1953
+ page: number;
1952
1954
  per_page: number;
1953
1955
  order: "asc" | "desc";
1954
1956
  orderby: "id" | "price" | "date" | "slug" | "menu_order" | "include" | "title" | "popularity" | "rating" | "modified";
@@ -1974,9 +1976,9 @@ declare const productFilterSchema: z.ZodObject<{
1974
1976
  shipping_class?: string | undefined;
1975
1977
  attribute_term?: string | undefined;
1976
1978
  }, {
1977
- page?: number | undefined;
1978
1979
  type?: "simple" | "variable" | "grouped" | "external" | undefined;
1979
1980
  status?: "pending" | "any" | "draft" | "private" | "publish" | "trash" | "future" | undefined;
1981
+ page?: number | undefined;
1980
1982
  per_page?: number | undefined;
1981
1983
  offset?: number | undefined;
1982
1984
  order?: "asc" | "desc" | undefined;
@@ -2855,8 +2857,8 @@ declare const schemas: {
2855
2857
  modified_before: zod.ZodOptional<zod.ZodString>;
2856
2858
  dates_are_gmt: zod.ZodDefault<zod.ZodBoolean>;
2857
2859
  }, "strip", zod.ZodTypeAny, {
2858
- page: number;
2859
2860
  status: "pending" | "any" | "draft" | "private" | "publish" | "trash" | "future";
2861
+ page: number;
2860
2862
  per_page: number;
2861
2863
  order: "asc" | "desc";
2862
2864
  orderby: "id" | "price" | "date" | "slug" | "menu_order" | "include" | "title" | "popularity" | "rating" | "modified";
@@ -2882,9 +2884,9 @@ declare const schemas: {
2882
2884
  shipping_class?: string | undefined;
2883
2885
  attribute_term?: string | undefined;
2884
2886
  }, {
2885
- page?: number | undefined;
2886
2887
  type?: "simple" | "variable" | "grouped" | "external" | undefined;
2887
2888
  status?: "pending" | "any" | "draft" | "private" | "publish" | "trash" | "future" | undefined;
2889
+ page?: number | undefined;
2888
2890
  per_page?: number | undefined;
2889
2891
  offset?: number | undefined;
2890
2892
  order?: "asc" | "desc" | undefined;
@@ -3449,8 +3451,8 @@ declare const schemas: {
3449
3451
  product?: number | undefined;
3450
3452
  dp?: number | undefined;
3451
3453
  }, {
3452
- page?: number | undefined;
3453
3454
  status?: ("pending" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed" | "auto-draft" | "trash" | "checkout-draft")[] | undefined;
3455
+ page?: number | undefined;
3454
3456
  per_page?: number | undefined;
3455
3457
  offset?: number | undefined;
3456
3458
  order?: "asc" | "desc" | undefined;
@@ -3680,8 +3682,8 @@ declare const schemas: {
3680
3682
  monri_transaction_id: zod.ZodOptional<zod.ZodString>;
3681
3683
  monri_status: zod.ZodOptional<zod.ZodString>;
3682
3684
  }, "strip", zod.ZodTypeAny, {
3683
- total: string;
3684
3685
  status: "pending" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed" | "auto-draft" | "trash" | "checkout-draft";
3686
+ total: string;
3685
3687
  id: number;
3686
3688
  payment_method: "cod" | "monri" | "pikpay" | "bacs" | "cheque";
3687
3689
  payment_method_title: string;
@@ -3762,8 +3764,8 @@ declare const schemas: {
3762
3764
  monri_transaction_id?: string | undefined;
3763
3765
  monri_status?: string | undefined;
3764
3766
  }, {
3765
- total: string;
3766
3767
  status: "pending" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed" | "auto-draft" | "trash" | "checkout-draft";
3768
+ total: string;
3767
3769
  id: number;
3768
3770
  payment_method: "cod" | "monri" | "pikpay" | "bacs" | "cheque";
3769
3771
  payment_method_title: string;
@@ -5107,4 +5109,4 @@ declare const schemas: {
5107
5109
  };
5108
5110
  };
5109
5111
 
5110
- export { type Address, type AddressFormMessages, type AddressFormValues, type CategoryFilterParams as AdminCategoryFilterParams, type Product as AdminProduct, type ProductCategory as AdminProductCategory, type ProductFilterParams as AdminProductFilterParams, type BillingAddress, type BillingAddressFormValues, type Coupon, type CouponFilterParams, type Customer, type CustomerFilterParams, type Order, type OrderFilterParams, type PaginationMeta, type PaginationParams, type PaymentMethod, type PaymentMethodFilterParams, type TAppEnumsKeys, type WCBaseParams, type WCErrorResponse, type WCPaginationMeta, WooCommerceDataValidationError, WooCommerceDataValidationErrorOptions, addressSchema, categoryFilterSchema as adminCategoryFilterSchema, couponFilterSchema as adminCouponFilterSchema, couponSchema as adminCouponSchema, orderFilterSchema as adminOrderFilterSchema, orderSchema as adminOrderSchema, productCategorySchema as adminProductCategorySchema, productFilterSchema as adminProductFilterSchema, productSchema as adminProductSchema, billingAddressSchemaMandatory as billingAddressSchema, createCategorySchema, createCouponSchema, createCustomerSchema, createPaginatedSchema, customerFilterSchema, customerSchema, getAppEnumRaw, getAppEnumZod, makeAddressFormSchema, makeBillingAddressFormSchema, paginationMetaSchema, paginationParamsSchema, paymentMethodFilterSchema, paymentMethodSchema, schemas, updateCustomerSchema, wcBaseParamsSchema, wcErrorResponseSchema, wcPaginationMetaSchema };
5112
+ export { type Address, type AddressFormMessages, type AddressFormValues, type CategoryFilterParams as AdminCategoryFilterParams, type Product as AdminProduct, type ProductCategory as AdminProductCategory, type ProductFilterParams as AdminProductFilterParams, type BillingAddress, type BillingAddressFormValues, type Coupon, type CouponFilterParams, type Customer, type CustomerFilterParams, type Order, type OrderFilterParams, type PaginationMeta, type PaginationParams, type PaymentMethod, type PaymentMethodFilterParams, type TAppEnumsKeys, type WCBaseParams, type WCErrorResponse, type WCPaginationMeta, WooCommerceDataValidationError, WooCommerceDataValidationErrorOptions, addressSchema, categoryFilterSchema as adminCategoryFilterSchema, couponFilterSchema as adminCouponFilterSchema, couponSchema as adminCouponSchema, orderFilterSchema as adminOrderFilterSchema, orderSchema as adminOrderSchema, productCategorySchema as adminProductCategorySchema, productFilterSchema as adminProductFilterSchema, productSchema as adminProductSchema, billingAddressSchemaMandatory as billingAddressSchema, createCategorySchema, createCouponSchema, createCustomerSchema, createPaginatedSchema, customerFilterSchema, customerSchema, getAppEnumRaw, getAppEnumZod, makeAddressFormSchema, makeBillingAddressFormSchema, mapWooCommerceCode, paginationMetaSchema, paginationParamsSchema, paymentMethodFilterSchema, paymentMethodSchema, schemas, updateCustomerSchema, wcBaseParamsSchema, wcErrorResponseSchema, wcPaginationMetaSchema };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,12 @@
1
1
  export { createClient } from './client/index.js';
2
- import { B as BaseError, e as BaseErrorOptions, f as ValidationReportableData, g as WooCommerceDataValidationErrorOptions } from './types-BF4_UUqp.js';
3
- export { A as AddToCartInput, j as Cart, k as CartAPI, C as CartHeadersAdapter, l as CartItem, m as CartItemImage, n as Checkout, o as CheckoutAPI, p as CheckoutInput, q as CouponInput, G as GetOrderInput, J as JwtTokenAdapter, O as OrderStatus, r as OrdersAPI, P as PaginatedResponse, t as Product, u as ProductCategory, v as ProductImage, w as ProductParams, x as ProductsAPI, y as RemoveCartItemInput, z as SelectShippingRateInput, D as StoreApiOrder, U as UpdateCartItemInput, E as UpdateCustomerInput, F as WooCommerceApiError, H as WooCommerceApiErrorOptions, a as WooCommerceClient, W as WooCommerceConfig, I as addToCartInputSchema, K as cartItemImageSchema, L as cartSchema, M as checkoutInputSchema, N as checkoutSchema, Q as couponInputSchema, T as productCategorySchema, X as productImageSchema, Y as productSchema, Z as removeCartItemInputSchema, _ as searchParamsSchema, $ as selectShippingRateInputSchema, a0 as storeApiOrderSchema, a1 as updateCartItemInputSchema, a2 as updateCustomerInputSchema } from './types-BF4_UUqp.js';
2
+ import { f as WooCommerceApiErrorCode, B as BaseError, g as BaseErrorOptions, j as ValidationReportableData, k as WooCommerceDataValidationErrorOptions } from './types-aYzN4O5x.js';
3
+ export { A as AddItemsInput, l as AddItemsResult, m as AddToCartInput, n as BatchResponse, o as Cart, p as CartAPI, C as CartHeadersAdapter, q as CartItem, r as CartItemImage, t as Checkout, u as CheckoutAPI, v as CheckoutInput, w as CouponInput, G as GetOrderInput, J as JwtTokenAdapter, O as OrderStatus, x as OrdersAPI, P as PaginatedResponse, y as Product, z as ProductCategory, D as ProductImage, E as ProductParams, F as ProductsAPI, H as RemoveCartItemInput, I as SelectShippingRateInput, K as StoreApiOrder, U as UpdateCartItemInput, L as UpdateCustomerInput, M as WooCommerceApiError, N as WooCommerceApiErrorOptions, a as WooCommerceClient, W as WooCommerceConfig, Q as addItemsInputSchema, T as addToCartInputSchema, X as batchResponseSchema, Y as cartItemImageSchema, Z as cartSchema, _ as checkoutInputSchema, $ as checkoutSchema, a0 as couponInputSchema, a1 as productCategorySchema, a2 as productImageSchema, a3 as productSchema, a4 as removeCartItemInputSchema, a5 as searchParamsSchema, a6 as selectShippingRateInputSchema, a7 as storeApiOrderSchema, a8 as updateCartItemInputSchema, a9 as updateCustomerInputSchema } from './types-aYzN4O5x.js';
4
4
  import * as zod from 'zod';
5
5
  import { ZodError, z } from 'zod';
6
6
  import 'axios';
7
7
 
8
+ declare const mapWooCommerceCode: (apiCode?: string) => WooCommerceApiErrorCode;
9
+
8
10
  interface WooCommerceDataValidationErrorInternalOptions extends BaseErrorOptions {
9
11
  url?: string;
10
12
  zodError?: ZodError;
@@ -1119,8 +1121,8 @@ declare const orderFilterSchema: z.ZodObject<{
1119
1121
  product?: number | undefined;
1120
1122
  dp?: number | undefined;
1121
1123
  }, {
1122
- page?: number | undefined;
1123
1124
  status?: ("pending" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed" | "auto-draft" | "trash" | "checkout-draft")[] | undefined;
1125
+ page?: number | undefined;
1124
1126
  per_page?: number | undefined;
1125
1127
  offset?: number | undefined;
1126
1128
  order?: "asc" | "desc" | undefined;
@@ -1352,8 +1354,8 @@ declare const orderSchema: z.ZodObject<{
1352
1354
  monri_transaction_id: z.ZodOptional<z.ZodString>;
1353
1355
  monri_status: z.ZodOptional<z.ZodString>;
1354
1356
  }, "strip", z.ZodTypeAny, {
1355
- total: string;
1356
1357
  status: "pending" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed" | "auto-draft" | "trash" | "checkout-draft";
1358
+ total: string;
1357
1359
  id: number;
1358
1360
  payment_method: "cod" | "monri" | "pikpay" | "bacs" | "cheque";
1359
1361
  payment_method_title: string;
@@ -1434,8 +1436,8 @@ declare const orderSchema: z.ZodObject<{
1434
1436
  monri_transaction_id?: string | undefined;
1435
1437
  monri_status?: string | undefined;
1436
1438
  }, {
1437
- total: string;
1438
1439
  status: "pending" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed" | "auto-draft" | "trash" | "checkout-draft";
1440
+ total: string;
1439
1441
  id: number;
1440
1442
  payment_method: "cod" | "monri" | "pikpay" | "bacs" | "cheque";
1441
1443
  payment_method_title: string;
@@ -1947,8 +1949,8 @@ declare const productFilterSchema: z.ZodObject<{
1947
1949
  modified_before: z.ZodOptional<z.ZodString>;
1948
1950
  dates_are_gmt: z.ZodDefault<z.ZodBoolean>;
1949
1951
  }, "strip", z.ZodTypeAny, {
1950
- page: number;
1951
1952
  status: "pending" | "any" | "draft" | "private" | "publish" | "trash" | "future";
1953
+ page: number;
1952
1954
  per_page: number;
1953
1955
  order: "asc" | "desc";
1954
1956
  orderby: "id" | "price" | "date" | "slug" | "menu_order" | "include" | "title" | "popularity" | "rating" | "modified";
@@ -1974,9 +1976,9 @@ declare const productFilterSchema: z.ZodObject<{
1974
1976
  shipping_class?: string | undefined;
1975
1977
  attribute_term?: string | undefined;
1976
1978
  }, {
1977
- page?: number | undefined;
1978
1979
  type?: "simple" | "variable" | "grouped" | "external" | undefined;
1979
1980
  status?: "pending" | "any" | "draft" | "private" | "publish" | "trash" | "future" | undefined;
1981
+ page?: number | undefined;
1980
1982
  per_page?: number | undefined;
1981
1983
  offset?: number | undefined;
1982
1984
  order?: "asc" | "desc" | undefined;
@@ -2855,8 +2857,8 @@ declare const schemas: {
2855
2857
  modified_before: zod.ZodOptional<zod.ZodString>;
2856
2858
  dates_are_gmt: zod.ZodDefault<zod.ZodBoolean>;
2857
2859
  }, "strip", zod.ZodTypeAny, {
2858
- page: number;
2859
2860
  status: "pending" | "any" | "draft" | "private" | "publish" | "trash" | "future";
2861
+ page: number;
2860
2862
  per_page: number;
2861
2863
  order: "asc" | "desc";
2862
2864
  orderby: "id" | "price" | "date" | "slug" | "menu_order" | "include" | "title" | "popularity" | "rating" | "modified";
@@ -2882,9 +2884,9 @@ declare const schemas: {
2882
2884
  shipping_class?: string | undefined;
2883
2885
  attribute_term?: string | undefined;
2884
2886
  }, {
2885
- page?: number | undefined;
2886
2887
  type?: "simple" | "variable" | "grouped" | "external" | undefined;
2887
2888
  status?: "pending" | "any" | "draft" | "private" | "publish" | "trash" | "future" | undefined;
2889
+ page?: number | undefined;
2888
2890
  per_page?: number | undefined;
2889
2891
  offset?: number | undefined;
2890
2892
  order?: "asc" | "desc" | undefined;
@@ -3449,8 +3451,8 @@ declare const schemas: {
3449
3451
  product?: number | undefined;
3450
3452
  dp?: number | undefined;
3451
3453
  }, {
3452
- page?: number | undefined;
3453
3454
  status?: ("pending" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed" | "auto-draft" | "trash" | "checkout-draft")[] | undefined;
3455
+ page?: number | undefined;
3454
3456
  per_page?: number | undefined;
3455
3457
  offset?: number | undefined;
3456
3458
  order?: "asc" | "desc" | undefined;
@@ -3680,8 +3682,8 @@ declare const schemas: {
3680
3682
  monri_transaction_id: zod.ZodOptional<zod.ZodString>;
3681
3683
  monri_status: zod.ZodOptional<zod.ZodString>;
3682
3684
  }, "strip", zod.ZodTypeAny, {
3683
- total: string;
3684
3685
  status: "pending" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed" | "auto-draft" | "trash" | "checkout-draft";
3686
+ total: string;
3685
3687
  id: number;
3686
3688
  payment_method: "cod" | "monri" | "pikpay" | "bacs" | "cheque";
3687
3689
  payment_method_title: string;
@@ -3762,8 +3764,8 @@ declare const schemas: {
3762
3764
  monri_transaction_id?: string | undefined;
3763
3765
  monri_status?: string | undefined;
3764
3766
  }, {
3765
- total: string;
3766
3767
  status: "pending" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed" | "auto-draft" | "trash" | "checkout-draft";
3768
+ total: string;
3767
3769
  id: number;
3768
3770
  payment_method: "cod" | "monri" | "pikpay" | "bacs" | "cheque";
3769
3771
  payment_method_title: string;
@@ -5107,4 +5109,4 @@ declare const schemas: {
5107
5109
  };
5108
5110
  };
5109
5111
 
5110
- export { type Address, type AddressFormMessages, type AddressFormValues, type CategoryFilterParams as AdminCategoryFilterParams, type Product as AdminProduct, type ProductCategory as AdminProductCategory, type ProductFilterParams as AdminProductFilterParams, type BillingAddress, type BillingAddressFormValues, type Coupon, type CouponFilterParams, type Customer, type CustomerFilterParams, type Order, type OrderFilterParams, type PaginationMeta, type PaginationParams, type PaymentMethod, type PaymentMethodFilterParams, type TAppEnumsKeys, type WCBaseParams, type WCErrorResponse, type WCPaginationMeta, WooCommerceDataValidationError, WooCommerceDataValidationErrorOptions, addressSchema, categoryFilterSchema as adminCategoryFilterSchema, couponFilterSchema as adminCouponFilterSchema, couponSchema as adminCouponSchema, orderFilterSchema as adminOrderFilterSchema, orderSchema as adminOrderSchema, productCategorySchema as adminProductCategorySchema, productFilterSchema as adminProductFilterSchema, productSchema as adminProductSchema, billingAddressSchemaMandatory as billingAddressSchema, createCategorySchema, createCouponSchema, createCustomerSchema, createPaginatedSchema, customerFilterSchema, customerSchema, getAppEnumRaw, getAppEnumZod, makeAddressFormSchema, makeBillingAddressFormSchema, paginationMetaSchema, paginationParamsSchema, paymentMethodFilterSchema, paymentMethodSchema, schemas, updateCustomerSchema, wcBaseParamsSchema, wcErrorResponseSchema, wcPaginationMetaSchema };
5112
+ export { type Address, type AddressFormMessages, type AddressFormValues, type CategoryFilterParams as AdminCategoryFilterParams, type Product as AdminProduct, type ProductCategory as AdminProductCategory, type ProductFilterParams as AdminProductFilterParams, type BillingAddress, type BillingAddressFormValues, type Coupon, type CouponFilterParams, type Customer, type CustomerFilterParams, type Order, type OrderFilterParams, type PaginationMeta, type PaginationParams, type PaymentMethod, type PaymentMethodFilterParams, type TAppEnumsKeys, type WCBaseParams, type WCErrorResponse, type WCPaginationMeta, WooCommerceDataValidationError, WooCommerceDataValidationErrorOptions, addressSchema, categoryFilterSchema as adminCategoryFilterSchema, couponFilterSchema as adminCouponFilterSchema, couponSchema as adminCouponSchema, orderFilterSchema as adminOrderFilterSchema, orderSchema as adminOrderSchema, productCategorySchema as adminProductCategorySchema, productFilterSchema as adminProductFilterSchema, productSchema as adminProductSchema, billingAddressSchemaMandatory as billingAddressSchema, createCategorySchema, createCouponSchema, createCustomerSchema, createPaginatedSchema, customerFilterSchema, customerSchema, getAppEnumRaw, getAppEnumZod, makeAddressFormSchema, makeBillingAddressFormSchema, mapWooCommerceCode, paginationMetaSchema, paginationParamsSchema, paymentMethodFilterSchema, paymentMethodSchema, schemas, updateCustomerSchema, wcBaseParamsSchema, wcErrorResponseSchema, wcPaginationMetaSchema };