arky-sdk 0.3.0 → 0.3.1

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/types/index.ts"],"names":["PaymentMethod"],"mappings":";;;AAuBO,IAAK,aAAA,qBAAAA,cAAAA,KAAL;AACN,EAAAA,eAAA,MAAA,CAAA,GAAO,MAAA;AACP,EAAAA,eAAA,YAAA,CAAA,GAAa,aAAA;AACb,EAAAA,eAAA,MAAA,CAAA,GAAO,MAAA;AAHI,EAAA,OAAAA,cAAAA;AAAA,CAAA,EAAA,aAAA,IAAA,EAAA","file":"types.cjs","sourcesContent":["// Core type definitions\n// All types are exported individually for better tree-shaking\n\n// NEW: Payment structure (matches backend)\nexport interface Payment {\n\tcurrency: string;\n\tmarket: string;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttax: number;\n\ttotal: number;\n\tpromoCodeId?: string;\n\tpromoCode?: string;\n\tpromoType?: string;\n\tpromoValue?: number;\n\tmethod: PaymentMethod;\n\tcustomerId?: string;\n\tpaymentIntentId?: string;\n\tsubscriptionId?: string;\n\tpriceId?: string;\n}\n\nexport enum PaymentMethod {\n\tCash = \"CASH\",\n\tCreditCard = \"CREDIT_CARD\",\n\tFree = \"FREE\",\n}\n\n// Quote line item (from quote engine)\nexport interface QuoteLineItem {\n\titemType: string;\n\tid: string;\n\tname: string;\n\tquantity: number;\n\tunitPrice: number;\n\ttotal: number;\n}\n\n// Promo code validation result\nexport interface PromoCodeValidation {\n\tid: string;\n\tcode: string;\n\tdiscountType: any;\n\tdiscountValue: number;\n\tconditions: any[];\n}\n\n// Quote response from backend (full pricing breakdown)\nexport interface Quote {\n\tcurrency: string;\n\tmarket: string;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttax: number;\n\ttotal: number;\n\tlineItems: QuoteLineItem[];\n\tshippingMethod: ShippingMethod | null;\n\tpromoCode: PromoCodeValidation | null;\n\tpayment: Payment;\n\tchargeAmount: number;\n}\n\n// Market-based price structure (for product variants)\nexport interface Price {\n\tmarket: string;\n\tamount: number;\n\tcompareAt?: number;\n}\n\n// Location structure (for shipping addresses, pickup points, etc.)\nexport interface Location {\n\tcountry?: string | null;\n\taddress?: string | null;\n\tcity?: string | null;\n\tpostalCode?: string | null;\n\tcountryCode?: string | null;\n\tcoordinates?: { lat: number; lon: number } | null;\n}\n\n// Zone structure (logistics grouping - countries, tax rates, shipping methods)\nexport interface Zone {\n\tid: string;\n\tname: string;\n\tcountries: string[]; // Empty array = \"All Countries\"\n\ttaxBps: number;\n\tshippingMethods: ShippingMethod[];\n}\n\n// Cart types\nexport interface EshopCartItem {\n\tid: string;\n\tproductId: string;\n\tvariantId: string;\n\tproductName: string;\n\tproductSlug: string;\n\tvariantAttributes: Record<string, any>;\n\tprice: Price; // Minor units (backend format)\n\tquantity: number;\n\taddedAt: number;\n}\n\nexport interface ReservationCartPart {\n\tid: string;\n\tserviceId: string;\n\tserviceName: string;\n\tdate: string;\n\tfrom: number;\n\tto: number;\n\ttimeText: string;\n\tisMultiDay: boolean;\n\treservationMethod: string;\n\tproviderId?: string;\n\tblocks: any[];\n}\n\n// Payment provider types\nexport interface PaymentProviderConfig {\n\ttype: \"STRIPE\";\n\tpublicKey: string;\n\tsecretKey: string;\n\twebhookSecret: string;\n}\n\n// Market types (business-owned) - camelCase for frontend\nexport interface Market {\n\tid: string;\n\tname: string;\n\tcurrency: string;\n\ttaxMode: \"INCLUSIVE\" | \"EXCLUSIVE\";\n\ttaxBps: number;\n\tpaymentMethods: BusinessPaymentMethod[];\n}\n\nexport interface ShippingMethod {\n id: string;\n type: 'SHIPPING' | 'PICKUP';\n prices: Price[]; // Market-based pricing with free thresholds\n taxable: boolean;\n etaText: string; // e.g., \"3-5 business days\"\n location?: Location; // Pickup address (only for PICKUP type)\n}\n\nexport interface BusinessPaymentMethod {\n\tmethod: PaymentMethod;\n}\n\n// Business types\nexport interface BusinessConfig {\n\torderBlocks?: any[];\n\treservationBlocks?: any[];\n\tmarkets?: Market[];\n\tzones?: Zone[];\n\tpaymentProvider?: PaymentProviderConfig;\n\taiProvider?: any;\n}\n\nexport interface Business {\n\tid: string;\n\tname: string;\n\tconfigs?: BusinessConfig;\n}\n\n// Store state types - Simplified (business data moved to business store)\nexport interface EshopStoreState {\n\tbusinessId: string;\n\tselectedShippingMethodId: string | null;\n\tuserToken: string | null;\n\tprocessingCheckout: boolean;\n\tloading: boolean;\n\terror: string | null;\n\tphoneNumber: string;\n\tphoneError: string | null;\n\tverificationCode: string;\n\tverifyError: string | null;\n}\n\nexport interface Block {\n\tid: string;\n\tkey: string;\n\ttype: string;\n\tproperties?: any;\n\tvalue?: any;\n}\n\n// API Response types\nexport interface ApiResponse<T> {\n success: boolean;\n data?: T;\n error?: string;\n code?: string;\n cursor?: string;\n total?: number;\n}\n\nexport interface PaginatedResponse<T> {\n\tdata: T[];\n\tmeta?: {\n\t\ttotal: number;\n\t\tpage: number;\n\t\tper_page: number;\n\t};\n}\n\n// Newsletter types\nexport interface Newsletter {\n\tid: string;\n\tbusinessId: string;\n\tname: string;\n\tdescription: string;\n\tnewsletterType: \"FREE\" | \"PAID\";\n\tstatuses: any[];\n\tprices: Price[]; // NEW: Market-based pricing\n\tpaymentProduct?: {\n\t\tpriceId: string;\n\t};\n\tunsubscribeRedirectUrl: string;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\n// Legacy types - kept for compatibility\nexport interface MarketConfigClient {\n\tcurrency: string;\n\ttaxMode: string;\n\tdefaultTaxRate: number;\n\tpaymentMethods: string[];\n\tshowTaxIncluded: boolean;\n\tshippingMethods?: ShippingMethod[];\n}\n\nexport interface ReservationStoreState {\n\tcurrentStep: number;\n\ttotalSteps: number;\n\tsteps: Record<number, { name: string; labelKey: string }>;\n\n\t// Calendar data\n\tweekdays: string[];\n\tmonthYear: string;\n\tdays: any[];\n\tcurrent: Date;\n\n\t// Selection state\n\tselectedDate: string | null;\n\tslots: any[];\n\tselectedSlot: any | null;\n\tselectedMethod: string | null;\n\tselectedProvider: any | null;\n\tproviders: any[];\n\n\t// Status flags\n\tloading: boolean;\n\tstartDate: string | null;\n\tendDate: string | null;\n\tisMultiDay: boolean;\n\n\t// Phone verification\n\tphoneNumber: string;\n\tphoneError: string | null;\n\tphoneSuccess: string | null;\n\tverificationCode: string;\n\tverifyError: string | null;\n\tisPhoneVerified: boolean;\n\tisSendingCode: boolean;\n\tisVerifying: boolean;\n\tcodeSentAt: number | null;\n\tcanResendAt: number | null;\n\n\t// Service & config\n\tguestToken: string | null;\n\tservice: any | null;\n\tbusiness: Business | null;\n\tcurrency: string;\n\treservationBlocks: Block[];\n\tapiUrl: string;\n\tbusinessId: string;\n\tstorageUrl: string;\n\ttimezone: string;\n\ttzGroups: any;\n\tparts: ReservationCartPart[];\n\n\t// Payment configuration\n\tallowedPaymentMethods: string[];\n\tpaymentConfig: {\n\t\tprovider: PaymentProviderConfig | null;\n\t\tenabled: boolean;\n\t};\n}\n"]}
1
+ {"version":3,"sources":["../src/types/index.ts"],"names":["PaymentMethod"],"mappings":";;;AAyBO,IAAK,aAAA,qBAAAA,cAAAA,KAAL;AACN,EAAAA,eAAA,MAAA,CAAA,GAAO,MAAA;AACP,EAAAA,eAAA,YAAA,CAAA,GAAa,aAAA;AACb,EAAAA,eAAA,MAAA,CAAA,GAAO,MAAA;AAHI,EAAA,OAAAA,cAAAA;AAAA,CAAA,EAAA,aAAA,IAAA,EAAA","file":"types.cjs","sourcesContent":["// Core type definitions\n// All types are exported individually for better tree-shaking\n\nexport * from './api';\n\n// NEW: Payment structure (matches backend)\nexport interface Payment {\n\tcurrency: string;\n\tmarket: string;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttax: number;\n\ttotal: number;\n\tpromoCodeId?: string;\n\tpromoCode?: string;\n\tpromoType?: string;\n\tpromoValue?: number;\n\tmethod: PaymentMethod;\n\tcustomerId?: string;\n\tpaymentIntentId?: string;\n\tsubscriptionId?: string;\n\tpriceId?: string;\n}\n\nexport enum PaymentMethod {\n\tCash = \"CASH\",\n\tCreditCard = \"CREDIT_CARD\",\n\tFree = \"FREE\",\n}\n\n// Quote line item (from quote engine)\nexport interface QuoteLineItem {\n\titemType: string;\n\tid: string;\n\tname: string;\n\tquantity: number;\n\tunitPrice: number;\n\ttotal: number;\n}\n\n// Promo code validation result\nexport interface PromoCodeValidation {\n\tid: string;\n\tcode: string;\n\tdiscountType: any;\n\tdiscountValue: number;\n\tconditions: any[];\n}\n\n// Quote response from backend (full pricing breakdown)\nexport interface Quote {\n\tcurrency: string;\n\tmarket: string;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttax: number;\n\ttotal: number;\n\tlineItems: QuoteLineItem[];\n\tshippingMethod: ShippingMethod | null;\n\tpromoCode: PromoCodeValidation | null;\n\tpayment: Payment;\n\tchargeAmount: number;\n}\n\n// Market-based price structure (for product variants)\nexport interface Price {\n\tmarket: string;\n\tamount: number;\n\tcompareAt?: number;\n}\n\n// Location structure (for shipping addresses, pickup points, etc.)\nexport interface Location {\n\tcountry?: string | null;\n\taddress?: string | null;\n\tcity?: string | null;\n\tpostalCode?: string | null;\n\tcountryCode?: string | null;\n\tcoordinates?: { lat: number; lon: number } | null;\n}\n\n// Zone structure (logistics grouping - countries, tax rates, shipping methods)\nexport interface Zone {\n\tid: string;\n\tname: string;\n\tcountries: string[]; // Empty array = \"All Countries\"\n\ttaxBps: number;\n\tshippingMethods: ShippingMethod[];\n}\n\n// Cart types\nexport interface EshopCartItem {\n\tid: string;\n\tproductId: string;\n\tvariantId: string;\n\tproductName: string;\n\tproductSlug: string;\n\tvariantAttributes: Record<string, any>;\n\tprice: Price; // Minor units (backend format)\n\tquantity: number;\n\taddedAt: number;\n}\n\nexport interface ReservationCartPart {\n\tid: string;\n\tserviceId: string;\n\tserviceName: string;\n\tdate: string;\n\tfrom: number;\n\tto: number;\n\ttimeText: string;\n\tisMultiDay: boolean;\n\treservationMethod: string;\n\tproviderId?: string;\n\tblocks: any[];\n}\n\n// Payment provider types\nexport interface PaymentProviderConfig {\n\ttype: \"STRIPE\";\n\tpublicKey: string;\n\tsecretKey: string;\n\twebhookSecret: string;\n}\n\n// Market types (business-owned) - camelCase for frontend\nexport interface Market {\n\tid: string;\n\tname: string;\n\tcurrency: string;\n\ttaxMode: \"INCLUSIVE\" | \"EXCLUSIVE\";\n\ttaxBps: number;\n\tpaymentMethods: BusinessPaymentMethod[];\n}\n\nexport interface ShippingMethod {\n id: string;\n type: 'SHIPPING' | 'PICKUP';\n prices: Price[]; // Market-based pricing with free thresholds\n taxable: boolean;\n etaText: string; // e.g., \"3-5 business days\"\n location?: Location; // Pickup address (only for PICKUP type)\n}\n\nexport interface BusinessPaymentMethod {\n\tmethod: PaymentMethod;\n}\n\n// Business types\nexport interface BusinessConfig {\n\torderBlocks?: any[];\n\treservationBlocks?: any[];\n\tmarkets?: Market[];\n\tzones?: Zone[];\n\tpaymentProvider?: PaymentProviderConfig;\n\taiProvider?: any;\n}\n\nexport interface Business {\n\tid: string;\n\tname: string;\n\tconfigs?: BusinessConfig;\n}\n\n// Store state types - Simplified (business data moved to business store)\nexport interface EshopStoreState {\n\tbusinessId: string;\n\tselectedShippingMethodId: string | null;\n\tuserToken: string | null;\n\tprocessingCheckout: boolean;\n\tloading: boolean;\n\terror: string | null;\n\tphoneNumber: string;\n\tphoneError: string | null;\n\tverificationCode: string;\n\tverifyError: string | null;\n}\n\nexport interface Block {\n\tid: string;\n\tkey: string;\n\ttype: string;\n\tproperties?: any;\n\tvalue?: any;\n}\n\n// API Response types\nexport interface ApiResponse<T> {\n success: boolean;\n data?: T;\n error?: string;\n cursor?: string;\n total?: number;\n}\n\nexport interface PaginatedResponse<T> {\n\tdata: T[];\n\tmeta?: {\n\t\ttotal: number;\n\t\tpage: number;\n\t\tper_page: number;\n\t};\n}\n\n// Newsletter types\nexport interface Newsletter {\n\tid: string;\n\tbusinessId: string;\n\tname: string;\n\tdescription: string;\n\tnewsletterType: \"FREE\" | \"PAID\";\n\tstatuses: any[];\n\tprices: Price[]; // NEW: Market-based pricing\n\tpaymentProduct?: {\n\t\tpriceId: string;\n\t};\n\tunsubscribeRedirectUrl: string;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\n// Legacy types - kept for compatibility\nexport interface MarketConfigClient {\n\tcurrency: string;\n\ttaxMode: string;\n\tdefaultTaxRate: number;\n\tpaymentMethods: string[];\n\tshowTaxIncluded: boolean;\n\tshippingMethods?: ShippingMethod[];\n}\n\nexport interface ReservationStoreState {\n\tcurrentStep: number;\n\ttotalSteps: number;\n\tsteps: Record<number, { name: string; labelKey: string }>;\n\n\t// Calendar data\n\tweekdays: string[];\n\tmonthYear: string;\n\tdays: any[];\n\tcurrent: Date;\n\n\t// Selection state\n\tselectedDate: string | null;\n\tslots: any[];\n\tselectedSlot: any | null;\n\tselectedMethod: string | null;\n\tselectedProvider: any | null;\n\tproviders: any[];\n\n\t// Status flags\n\tloading: boolean;\n\tstartDate: string | null;\n\tendDate: string | null;\n\tisMultiDay: boolean;\n\n\t// Phone verification\n\tphoneNumber: string;\n\tphoneError: string | null;\n\tphoneSuccess: string | null;\n\tverificationCode: string;\n\tverifyError: string | null;\n\tisPhoneVerified: boolean;\n\tisSendingCode: boolean;\n\tisVerifying: boolean;\n\tcodeSentAt: number | null;\n\tcanResendAt: number | null;\n\n\t// Service & config\n\tguestToken: string | null;\n\tservice: any | null;\n\tbusiness: Business | null;\n\tcurrency: string;\n\treservationBlocks: Block[];\n\tapiUrl: string;\n\tbusinessId: string;\n\tstorageUrl: string;\n\ttimezone: string;\n\ttzGroups: any;\n\tparts: ReservationCartPart[];\n\n\t// Payment configuration\n\tallowedPaymentMethods: string[];\n\tpaymentConfig: {\n\t\tprovider: PaymentProviderConfig | null;\n\t\tenabled: boolean;\n\t};\n}\n"]}