UNPKG

node-maw

Version:

TypeScript Axios client for fetching app versions from App Store and Play Store

86 lines 4.05 kB
import { AppStoreClient, AppStoreConfig } from './app-store-client.js'; import { PlayStoreClient, PlayStoreConfig } from './play-store-client.js'; import { AppVersion, NodeMawConfig, UpdateCheckResult } from './types.js'; export type { AppVersion, AppStoreResponse, AppStoreApp, PlayStoreApp, NodeMawConfig, UpdateCheckResult } from './types.js'; export type { AppStoreConfig } from './app-store-client.js'; export type { PlayStoreConfig } from './play-store-client.js'; export { AppStoreClient } from './app-store-client.js'; export { PlayStoreClient } from './play-store-client.js'; export { AppStoreError, PlayStoreError, NetworkError } from './types.js'; /** * Unified client configuration that combines both store configs */ export interface UnifiedNodeMawConfig extends NodeMawConfig { /** App Store specific configuration */ appStore?: Partial<AppStoreConfig>; /** Play Store specific configuration */ playStore?: Partial<PlayStoreConfig>; } /** * Unified client that provides access to both App Store and Play Store functionality * This class wraps the individual store clients and provides the original API for backward compatibility */ export declare class NodeMaw { private appStoreClient; private playStoreClient; private config; constructor(config?: UnifiedNodeMawConfig); /** * Fetch app version from Apple App Store * @param bundleId - iOS app bundle identifier (e.g., 'com.example.app') * @returns Promise<AppVersion> - App version information * @throws {AppStoreError} When app is not found or API request fails * @throws {NetworkError} When network request fails */ getAppStoreVersion(bundleId: string): Promise<AppVersion>; /** * Fetch app version from Google Play Store * @param packageName - Android app package name (e.g., 'com.example.app') * @returns Promise<AppVersion> - App version information * @throws {PlayStoreError} When app is not found or API request fails * @throws {NetworkError} When network request fails */ getPlayStoreVersion(packageName: string): Promise<AppVersion>; /** * Check for updates on the App Store by comparing current version with latest version * @param bundleId - iOS app bundle identifier * @param currentVersion - Current version of the app to compare against * @returns Promise<UpdateCheckResult> - Update check result with details * @throws {AppStoreError} When app is not found or API request fails * @throws {NetworkError} When network request fails */ checkAppStoreForUpdates(bundleId: string, currentVersion: string): Promise<UpdateCheckResult>; /** * Check for updates on the Play Store by comparing current version with latest version * @param packageName - Android app package name * @param currentVersion - Current version of the app to compare against * @returns Promise<UpdateCheckResult> - Update check result with details * @throws {PlayStoreError} When app is not found or API request fails * @throws {NetworkError} When network request fails */ checkPlayStoreForUpdates(packageName: string, currentVersion: string): Promise<UpdateCheckResult>; /** * Get the App Store client instance * @returns AppStoreClient - Direct access to App Store functionality */ get appStore(): AppStoreClient; /** * Get the Play Store client instance * @returns PlayStoreClient - Direct access to Play Store functionality */ get playStore(): PlayStoreClient; /** * Get the current configuration */ getConfig(): Readonly<Required<NodeMawConfig>>; /** * Update the client configuration * @param newConfig - Partial configuration to merge with existing config */ updateConfig(newConfig: Partial<UnifiedNodeMawConfig>): void; } declare const _default: NodeMaw; export default _default; export declare const AppStore: AppStoreClient; export declare const PlayStore: PlayStoreClient; //# sourceMappingURL=index.d.ts.map