arky-sdk 0.3.35 → 0.3.37

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":";;;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// 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// Zone types - Country-specific configuration within a market\nexport interface Zone {\n\tcode: string; // ISO country code or \"*\" for global wildcard\n\ttaxBps: number;\n\tpaymentMethods: BusinessPaymentMethod[];\n\tshippingMethods: ShippingMethod[];\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\tzones: Zone[]; // Country-specific configs\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\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// SEO types\nexport interface Seo {\n\tslug: Record<string, string>;\n\tmetaTitle: Record<string, string>;\n\tmetaDescription: Record<string, string>;\n\tcanonicalUrl: Record<string, string>;\n\togImage: string;\n}\n\n// Media types\nexport interface MediaResolution {\n\tid: string;\n\tsize: string;\n\turl: string;\n}\n\nexport interface Media {\n\tid: string;\n\tresolutions: { [key: string]: MediaResolution };\n\tmimeType: string;\n\ttitle?: string | null;\n\tdescription?: string | null;\n\talt?: string | null;\n\towner: string;\n\tmetadata?: string | null;\n\tuploadedAt: string;\n\tseo: Seo;\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// 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// 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\nexport interface ZoneDefinition {\n\tid: string;\n\tname: string;\n}\n\nexport interface ZonePaymentMethod {\n\tid: string;\n}\n\nexport interface ZoneShippingMethod {\n\tid: string;\n\tamount: number;\n}\n\nexport interface MarketZone {\n\ttaxBps: number;\n\tzoneId: string;\n\tpaymentMethods: ZonePaymentMethod[];\n\tshippingMethods: ZoneShippingMethod[];\n}\n\nexport interface Market {\n\tid: string;\n\tcurrency: string;\n\ttaxMode: \"EXCLUSIVE\" | \"INCLUSIVE\";\n\tzones: MarketZone[];\n}\n\nexport interface PaymentMethodConfig {\n\tid: string;\n\tmethod: PaymentMethod;\n}\n\nexport interface ShippingMethod {\n id: string;\n type: 'SHIPPING' | 'PICKUP';\n taxable: boolean;\n etaText: string;\n location?: Location;\n}\n\nexport interface ZoneResolvedShippingMethod extends ShippingMethod {\n\tzoneAmount: number;\n}\n\nexport interface Language {\n\tid: string;\n}\n\nexport interface BusinessEmails {\n\tbilling: string;\n\tsupport: string;\n}\n\nexport interface BusinessConfig {\n\tlanguages: Language[];\n\tzones: ZoneDefinition[];\n\tpaymentMethods: PaymentMethodConfig[];\n\tshippingMethods: ShippingMethod[];\n\tmarkets: Market[];\n\tbuildHooks: string[];\n\twebhooks: any[];\n\torderBlocks: any[];\n\treservationBlocks: any[];\n\tpaymentProvider?: PaymentProviderConfig;\n\taiProvider?: any;\n\temails: BusinessEmails;\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// SEO types\nexport interface Seo {\n\tslug: Record<string, string>;\n\tmetaTitle: Record<string, string>;\n\tmetaDescription: Record<string, string>;\n\tcanonicalUrl: Record<string, string>;\n\togImage: string;\n}\n\n// Media types\nexport interface MediaResolution {\n\tid: string;\n\tsize: string;\n\turl: string;\n}\n\nexport interface Media {\n\tid: string;\n\tresolutions: { [key: string]: MediaResolution };\n\tmimeType: string;\n\ttitle?: string | null;\n\tdescription?: string | null;\n\talt?: string | null;\n\towner: string;\n\tmetadata?: string | null;\n\tuploadedAt: string;\n\tseo: Seo;\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// 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"]}
package/dist/types.d.cts CHANGED
@@ -42,6 +42,7 @@ interface CheckoutParams {
42
42
  blocks?: any[];
43
43
  shippingMethodId: string;
44
44
  promoCode?: string;
45
+ zoneId?: string;
45
46
  }
46
47
  interface GetProductsParams {
47
48
  categoryIds?: string[] | null;
@@ -115,6 +116,7 @@ interface ReservationCheckoutParams {
115
116
  paymentMethod?: string;
116
117
  blocks?: any[];
117
118
  promoCode?: string;
119
+ zoneId?: string;
118
120
  }
119
121
  interface GetReservationQuoteParams {
120
122
  parts: any[];
@@ -122,6 +124,7 @@ interface GetReservationQuoteParams {
122
124
  paymentMethod: string;
123
125
  promoCode?: string;
124
126
  location?: any;
127
+ zoneId?: string;
125
128
  }
126
129
  interface GetAvailableSlotsParams {
127
130
  serviceId: string;
@@ -686,36 +689,63 @@ interface PaymentProviderConfig {
686
689
  secretKey: string;
687
690
  webhookSecret: string;
688
691
  }
689
- interface Zone {
690
- code: string;
692
+ interface ZoneDefinition {
693
+ id: string;
694
+ name: string;
695
+ }
696
+ interface ZonePaymentMethod {
697
+ id: string;
698
+ }
699
+ interface ZoneShippingMethod {
700
+ id: string;
701
+ amount: number;
702
+ }
703
+ interface MarketZone {
691
704
  taxBps: number;
692
- paymentMethods: BusinessPaymentMethod[];
693
- shippingMethods: ShippingMethod[];
705
+ zoneId: string;
706
+ paymentMethods: ZonePaymentMethod[];
707
+ shippingMethods: ZoneShippingMethod[];
694
708
  }
695
709
  interface Market {
696
710
  id: string;
697
- name: string;
698
711
  currency: string;
699
- taxMode: "INCLUSIVE" | "EXCLUSIVE";
700
- zones: Zone[];
712
+ taxMode: "EXCLUSIVE" | "INCLUSIVE";
713
+ zones: MarketZone[];
714
+ }
715
+ interface PaymentMethodConfig {
716
+ id: string;
717
+ method: PaymentMethod;
701
718
  }
702
719
  interface ShippingMethod {
703
720
  id: string;
704
721
  type: 'SHIPPING' | 'PICKUP';
705
- prices: Price[];
706
722
  taxable: boolean;
707
723
  etaText: string;
708
724
  location?: Location;
709
725
  }
710
- interface BusinessPaymentMethod {
711
- method: PaymentMethod;
726
+ interface ZoneResolvedShippingMethod extends ShippingMethod {
727
+ zoneAmount: number;
728
+ }
729
+ interface Language {
730
+ id: string;
731
+ }
732
+ interface BusinessEmails {
733
+ billing: string;
734
+ support: string;
712
735
  }
713
736
  interface BusinessConfig {
714
- orderBlocks?: any[];
715
- reservationBlocks?: any[];
716
- markets?: Market[];
737
+ languages: Language[];
738
+ zones: ZoneDefinition[];
739
+ paymentMethods: PaymentMethodConfig[];
740
+ shippingMethods: ShippingMethod[];
741
+ markets: Market[];
742
+ buildHooks: string[];
743
+ webhooks: any[];
744
+ orderBlocks: any[];
745
+ reservationBlocks: any[];
717
746
  paymentProvider?: PaymentProviderConfig;
718
747
  aiProvider?: any;
748
+ emails: BusinessEmails;
719
749
  }
720
750
  interface Business {
721
751
  id: string;
@@ -839,4 +869,4 @@ interface ReservationStoreState {
839
869
  };
840
870
  }
841
871
 
842
- export { type AddPhoneNumberParams, type ApiResponse, type Block, type Business, type BusinessConfig, type BusinessPaymentMethod, type CancelSubscriptionParams, type CheckoutParams, type Condition, type ConfirmUserParams, type CreateBusinessParams, type CreateCollectionEntryParams, type CreateCollectionParams, type CreateEntryParams, type CreateOrderParams, type CreatePortalSessionParams, type CreateProductParams, type CreatePromoCodeParams, type CreateProviderParams, type CreateReservationParams, type CreateRoleParams, type CreateServiceParams, type DeleteBusinessMediaParams, type DeleteBusinessParams, type DeleteCollectionEntryParams, type DeleteCollectionParams, type DeleteProductParams, type DeletePromoCodeParams, type DeleteProviderParams, type DeleteRoleParams, type DeleteServiceParams, type Discount, type EshopCartItem, type EshopItem, type EshopStoreState, type ForgotPasswordParams, type GenerateBlocksParams, type GetAnalyticsHealthParams, type GetAnalyticsParams, type GetAvailableSlotsParams, type GetBusinessMarketParams, type GetBusinessMarketsParams, type GetBusinessMediaParams, type GetBusinessMediaParams2, type GetBusinessParams, type GetBusinessParentsParams, type GetBusinessServiceWorkingTimeParams, type GetBusinessesParams, type GetCollectionEntriesParams, type GetCollectionEntryParams, type GetCollectionParams, type GetCollectionSubscribersParams, type GetCollectionsParams, type GetDeliveryStatsParams, type GetEntriesParams, type GetLoginUrlParams, type GetMeParams, type GetOrderParams, type GetOrdersParams, type GetProductParams, type GetProductsParams, type GetPromoCodeParams, type GetPromoCodesParams, type GetProviderParams, type GetProvidersParams, type GetQuoteParams, type GetReservationParams, type GetReservationPartsParams, type GetReservationQuoteParams, type GetRoleParams, type GetRolesParams, type GetServiceParams, type GetServicesParams, type GetSubscriptionParams, type GetSubscriptionPlansParams, type GetVariableMetadataParams, type HandleInvitationParams, type HandleStripeWebhookParams, type InviteUserParams, type Location, type LoginUserParams, type LogoutParams, type Market, type MarketConfigClient, type Media, type MediaResolution, type PaginatedResponse, type Payment, PaymentMethod, type PaymentProviderConfig, type PhoneNumberConfirmParams, type Price, type PromoCodeValidation, type Quote, type QuoteLineItem, type ReactivateSubscriptionParams, type RegisterUserParams, type RequestOptions, type ReservationCartPart, type ReservationCheckoutParams, type ReservationStoreState, type ResetForgotPasswordParams, type ResetPasswordParams, type SearchMyReservationsParams, type SearchReservationsParams, type SearchUsersParams, type SendEntryParams, type Seo, type SetProviderScheduleParams, type SetRoleParams, type SetupAnalyticsParams, type ShippingMethod, type SubscribeToCollectionParams, type TestWebhookParams, type TrackEmailOpenParams, type TriggerBuildsParams, type UnsubscribeFromCollectionParams, type UpdateBusinessParams, type UpdateCollectionParams, type UpdateEntryParams, type UpdateMediaParams, type UpdateNotificationsParams, type UpdateOrderParams, type UpdateOrderPaymentStatusParams, type UpdateOrderStatusParams, type UpdateProductParams, type UpdatePromoCodeParams, type UpdateProviderParams, type UpdateReservationParams, type UpdateRoleParams, type UpdateServiceParams, type UpdateSubscriptionParams, type UpdateUserProfileParams, type UploadBusinessMediaParams, type Zone };
872
+ export { type AddPhoneNumberParams, type ApiResponse, type Block, type Business, type BusinessConfig, type BusinessEmails, type CancelSubscriptionParams, type CheckoutParams, type Condition, type ConfirmUserParams, type CreateBusinessParams, type CreateCollectionEntryParams, type CreateCollectionParams, type CreateEntryParams, type CreateOrderParams, type CreatePortalSessionParams, type CreateProductParams, type CreatePromoCodeParams, type CreateProviderParams, type CreateReservationParams, type CreateRoleParams, type CreateServiceParams, type DeleteBusinessMediaParams, type DeleteBusinessParams, type DeleteCollectionEntryParams, type DeleteCollectionParams, type DeleteProductParams, type DeletePromoCodeParams, type DeleteProviderParams, type DeleteRoleParams, type DeleteServiceParams, type Discount, type EshopCartItem, type EshopItem, type EshopStoreState, type ForgotPasswordParams, type GenerateBlocksParams, type GetAnalyticsHealthParams, type GetAnalyticsParams, type GetAvailableSlotsParams, type GetBusinessMarketParams, type GetBusinessMarketsParams, type GetBusinessMediaParams, type GetBusinessMediaParams2, type GetBusinessParams, type GetBusinessParentsParams, type GetBusinessServiceWorkingTimeParams, type GetBusinessesParams, type GetCollectionEntriesParams, type GetCollectionEntryParams, type GetCollectionParams, type GetCollectionSubscribersParams, type GetCollectionsParams, type GetDeliveryStatsParams, type GetEntriesParams, type GetLoginUrlParams, type GetMeParams, type GetOrderParams, type GetOrdersParams, type GetProductParams, type GetProductsParams, type GetPromoCodeParams, type GetPromoCodesParams, type GetProviderParams, type GetProvidersParams, type GetQuoteParams, type GetReservationParams, type GetReservationPartsParams, type GetReservationQuoteParams, type GetRoleParams, type GetRolesParams, type GetServiceParams, type GetServicesParams, type GetSubscriptionParams, type GetSubscriptionPlansParams, type GetVariableMetadataParams, type HandleInvitationParams, type HandleStripeWebhookParams, type InviteUserParams, type Language, type Location, type LoginUserParams, type LogoutParams, type Market, type MarketConfigClient, type MarketZone, type Media, type MediaResolution, type PaginatedResponse, type Payment, PaymentMethod, type PaymentMethodConfig, type PaymentProviderConfig, type PhoneNumberConfirmParams, type Price, type PromoCodeValidation, type Quote, type QuoteLineItem, type ReactivateSubscriptionParams, type RegisterUserParams, type RequestOptions, type ReservationCartPart, type ReservationCheckoutParams, type ReservationStoreState, type ResetForgotPasswordParams, type ResetPasswordParams, type SearchMyReservationsParams, type SearchReservationsParams, type SearchUsersParams, type SendEntryParams, type Seo, type SetProviderScheduleParams, type SetRoleParams, type SetupAnalyticsParams, type ShippingMethod, type SubscribeToCollectionParams, type TestWebhookParams, type TrackEmailOpenParams, type TriggerBuildsParams, type UnsubscribeFromCollectionParams, type UpdateBusinessParams, type UpdateCollectionParams, type UpdateEntryParams, type UpdateMediaParams, type UpdateNotificationsParams, type UpdateOrderParams, type UpdateOrderPaymentStatusParams, type UpdateOrderStatusParams, type UpdateProductParams, type UpdatePromoCodeParams, type UpdateProviderParams, type UpdateReservationParams, type UpdateRoleParams, type UpdateServiceParams, type UpdateSubscriptionParams, type UpdateUserProfileParams, type UploadBusinessMediaParams, type ZoneDefinition, type ZonePaymentMethod, type ZoneResolvedShippingMethod, type ZoneShippingMethod };
package/dist/types.d.ts CHANGED
@@ -42,6 +42,7 @@ interface CheckoutParams {
42
42
  blocks?: any[];
43
43
  shippingMethodId: string;
44
44
  promoCode?: string;
45
+ zoneId?: string;
45
46
  }
46
47
  interface GetProductsParams {
47
48
  categoryIds?: string[] | null;
@@ -115,6 +116,7 @@ interface ReservationCheckoutParams {
115
116
  paymentMethod?: string;
116
117
  blocks?: any[];
117
118
  promoCode?: string;
119
+ zoneId?: string;
118
120
  }
119
121
  interface GetReservationQuoteParams {
120
122
  parts: any[];
@@ -122,6 +124,7 @@ interface GetReservationQuoteParams {
122
124
  paymentMethod: string;
123
125
  promoCode?: string;
124
126
  location?: any;
127
+ zoneId?: string;
125
128
  }
126
129
  interface GetAvailableSlotsParams {
127
130
  serviceId: string;
@@ -686,36 +689,63 @@ interface PaymentProviderConfig {
686
689
  secretKey: string;
687
690
  webhookSecret: string;
688
691
  }
689
- interface Zone {
690
- code: string;
692
+ interface ZoneDefinition {
693
+ id: string;
694
+ name: string;
695
+ }
696
+ interface ZonePaymentMethod {
697
+ id: string;
698
+ }
699
+ interface ZoneShippingMethod {
700
+ id: string;
701
+ amount: number;
702
+ }
703
+ interface MarketZone {
691
704
  taxBps: number;
692
- paymentMethods: BusinessPaymentMethod[];
693
- shippingMethods: ShippingMethod[];
705
+ zoneId: string;
706
+ paymentMethods: ZonePaymentMethod[];
707
+ shippingMethods: ZoneShippingMethod[];
694
708
  }
695
709
  interface Market {
696
710
  id: string;
697
- name: string;
698
711
  currency: string;
699
- taxMode: "INCLUSIVE" | "EXCLUSIVE";
700
- zones: Zone[];
712
+ taxMode: "EXCLUSIVE" | "INCLUSIVE";
713
+ zones: MarketZone[];
714
+ }
715
+ interface PaymentMethodConfig {
716
+ id: string;
717
+ method: PaymentMethod;
701
718
  }
702
719
  interface ShippingMethod {
703
720
  id: string;
704
721
  type: 'SHIPPING' | 'PICKUP';
705
- prices: Price[];
706
722
  taxable: boolean;
707
723
  etaText: string;
708
724
  location?: Location;
709
725
  }
710
- interface BusinessPaymentMethod {
711
- method: PaymentMethod;
726
+ interface ZoneResolvedShippingMethod extends ShippingMethod {
727
+ zoneAmount: number;
728
+ }
729
+ interface Language {
730
+ id: string;
731
+ }
732
+ interface BusinessEmails {
733
+ billing: string;
734
+ support: string;
712
735
  }
713
736
  interface BusinessConfig {
714
- orderBlocks?: any[];
715
- reservationBlocks?: any[];
716
- markets?: Market[];
737
+ languages: Language[];
738
+ zones: ZoneDefinition[];
739
+ paymentMethods: PaymentMethodConfig[];
740
+ shippingMethods: ShippingMethod[];
741
+ markets: Market[];
742
+ buildHooks: string[];
743
+ webhooks: any[];
744
+ orderBlocks: any[];
745
+ reservationBlocks: any[];
717
746
  paymentProvider?: PaymentProviderConfig;
718
747
  aiProvider?: any;
748
+ emails: BusinessEmails;
719
749
  }
720
750
  interface Business {
721
751
  id: string;
@@ -839,4 +869,4 @@ interface ReservationStoreState {
839
869
  };
840
870
  }
841
871
 
842
- export { type AddPhoneNumberParams, type ApiResponse, type Block, type Business, type BusinessConfig, type BusinessPaymentMethod, type CancelSubscriptionParams, type CheckoutParams, type Condition, type ConfirmUserParams, type CreateBusinessParams, type CreateCollectionEntryParams, type CreateCollectionParams, type CreateEntryParams, type CreateOrderParams, type CreatePortalSessionParams, type CreateProductParams, type CreatePromoCodeParams, type CreateProviderParams, type CreateReservationParams, type CreateRoleParams, type CreateServiceParams, type DeleteBusinessMediaParams, type DeleteBusinessParams, type DeleteCollectionEntryParams, type DeleteCollectionParams, type DeleteProductParams, type DeletePromoCodeParams, type DeleteProviderParams, type DeleteRoleParams, type DeleteServiceParams, type Discount, type EshopCartItem, type EshopItem, type EshopStoreState, type ForgotPasswordParams, type GenerateBlocksParams, type GetAnalyticsHealthParams, type GetAnalyticsParams, type GetAvailableSlotsParams, type GetBusinessMarketParams, type GetBusinessMarketsParams, type GetBusinessMediaParams, type GetBusinessMediaParams2, type GetBusinessParams, type GetBusinessParentsParams, type GetBusinessServiceWorkingTimeParams, type GetBusinessesParams, type GetCollectionEntriesParams, type GetCollectionEntryParams, type GetCollectionParams, type GetCollectionSubscribersParams, type GetCollectionsParams, type GetDeliveryStatsParams, type GetEntriesParams, type GetLoginUrlParams, type GetMeParams, type GetOrderParams, type GetOrdersParams, type GetProductParams, type GetProductsParams, type GetPromoCodeParams, type GetPromoCodesParams, type GetProviderParams, type GetProvidersParams, type GetQuoteParams, type GetReservationParams, type GetReservationPartsParams, type GetReservationQuoteParams, type GetRoleParams, type GetRolesParams, type GetServiceParams, type GetServicesParams, type GetSubscriptionParams, type GetSubscriptionPlansParams, type GetVariableMetadataParams, type HandleInvitationParams, type HandleStripeWebhookParams, type InviteUserParams, type Location, type LoginUserParams, type LogoutParams, type Market, type MarketConfigClient, type Media, type MediaResolution, type PaginatedResponse, type Payment, PaymentMethod, type PaymentProviderConfig, type PhoneNumberConfirmParams, type Price, type PromoCodeValidation, type Quote, type QuoteLineItem, type ReactivateSubscriptionParams, type RegisterUserParams, type RequestOptions, type ReservationCartPart, type ReservationCheckoutParams, type ReservationStoreState, type ResetForgotPasswordParams, type ResetPasswordParams, type SearchMyReservationsParams, type SearchReservationsParams, type SearchUsersParams, type SendEntryParams, type Seo, type SetProviderScheduleParams, type SetRoleParams, type SetupAnalyticsParams, type ShippingMethod, type SubscribeToCollectionParams, type TestWebhookParams, type TrackEmailOpenParams, type TriggerBuildsParams, type UnsubscribeFromCollectionParams, type UpdateBusinessParams, type UpdateCollectionParams, type UpdateEntryParams, type UpdateMediaParams, type UpdateNotificationsParams, type UpdateOrderParams, type UpdateOrderPaymentStatusParams, type UpdateOrderStatusParams, type UpdateProductParams, type UpdatePromoCodeParams, type UpdateProviderParams, type UpdateReservationParams, type UpdateRoleParams, type UpdateServiceParams, type UpdateSubscriptionParams, type UpdateUserProfileParams, type UploadBusinessMediaParams, type Zone };
872
+ export { type AddPhoneNumberParams, type ApiResponse, type Block, type Business, type BusinessConfig, type BusinessEmails, type CancelSubscriptionParams, type CheckoutParams, type Condition, type ConfirmUserParams, type CreateBusinessParams, type CreateCollectionEntryParams, type CreateCollectionParams, type CreateEntryParams, type CreateOrderParams, type CreatePortalSessionParams, type CreateProductParams, type CreatePromoCodeParams, type CreateProviderParams, type CreateReservationParams, type CreateRoleParams, type CreateServiceParams, type DeleteBusinessMediaParams, type DeleteBusinessParams, type DeleteCollectionEntryParams, type DeleteCollectionParams, type DeleteProductParams, type DeletePromoCodeParams, type DeleteProviderParams, type DeleteRoleParams, type DeleteServiceParams, type Discount, type EshopCartItem, type EshopItem, type EshopStoreState, type ForgotPasswordParams, type GenerateBlocksParams, type GetAnalyticsHealthParams, type GetAnalyticsParams, type GetAvailableSlotsParams, type GetBusinessMarketParams, type GetBusinessMarketsParams, type GetBusinessMediaParams, type GetBusinessMediaParams2, type GetBusinessParams, type GetBusinessParentsParams, type GetBusinessServiceWorkingTimeParams, type GetBusinessesParams, type GetCollectionEntriesParams, type GetCollectionEntryParams, type GetCollectionParams, type GetCollectionSubscribersParams, type GetCollectionsParams, type GetDeliveryStatsParams, type GetEntriesParams, type GetLoginUrlParams, type GetMeParams, type GetOrderParams, type GetOrdersParams, type GetProductParams, type GetProductsParams, type GetPromoCodeParams, type GetPromoCodesParams, type GetProviderParams, type GetProvidersParams, type GetQuoteParams, type GetReservationParams, type GetReservationPartsParams, type GetReservationQuoteParams, type GetRoleParams, type GetRolesParams, type GetServiceParams, type GetServicesParams, type GetSubscriptionParams, type GetSubscriptionPlansParams, type GetVariableMetadataParams, type HandleInvitationParams, type HandleStripeWebhookParams, type InviteUserParams, type Language, type Location, type LoginUserParams, type LogoutParams, type Market, type MarketConfigClient, type MarketZone, type Media, type MediaResolution, type PaginatedResponse, type Payment, PaymentMethod, type PaymentMethodConfig, type PaymentProviderConfig, type PhoneNumberConfirmParams, type Price, type PromoCodeValidation, type Quote, type QuoteLineItem, type ReactivateSubscriptionParams, type RegisterUserParams, type RequestOptions, type ReservationCartPart, type ReservationCheckoutParams, type ReservationStoreState, type ResetForgotPasswordParams, type ResetPasswordParams, type SearchMyReservationsParams, type SearchReservationsParams, type SearchUsersParams, type SendEntryParams, type Seo, type SetProviderScheduleParams, type SetRoleParams, type SetupAnalyticsParams, type ShippingMethod, type SubscribeToCollectionParams, type TestWebhookParams, type TrackEmailOpenParams, type TriggerBuildsParams, type UnsubscribeFromCollectionParams, type UpdateBusinessParams, type UpdateCollectionParams, type UpdateEntryParams, type UpdateMediaParams, type UpdateNotificationsParams, type UpdateOrderParams, type UpdateOrderPaymentStatusParams, type UpdateOrderStatusParams, type UpdateProductParams, type UpdatePromoCodeParams, type UpdateProviderParams, type UpdateReservationParams, type UpdateRoleParams, type UpdateServiceParams, type UpdateSubscriptionParams, type UpdateUserProfileParams, type UploadBusinessMediaParams, type ZoneDefinition, type ZonePaymentMethod, type ZoneResolvedShippingMethod, type ZoneShippingMethod };
package/dist/types.js.map CHANGED
@@ -1 +1 @@
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.js","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// 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// Zone types - Country-specific configuration within a market\nexport interface Zone {\n\tcode: string; // ISO country code or \"*\" for global wildcard\n\ttaxBps: number;\n\tpaymentMethods: BusinessPaymentMethod[];\n\tshippingMethods: ShippingMethod[];\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\tzones: Zone[]; // Country-specific configs\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\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// SEO types\nexport interface Seo {\n\tslug: Record<string, string>;\n\tmetaTitle: Record<string, string>;\n\tmetaDescription: Record<string, string>;\n\tcanonicalUrl: Record<string, string>;\n\togImage: string;\n}\n\n// Media types\nexport interface MediaResolution {\n\tid: string;\n\tsize: string;\n\turl: string;\n}\n\nexport interface Media {\n\tid: string;\n\tresolutions: { [key: string]: MediaResolution };\n\tmimeType: string;\n\ttitle?: string | null;\n\tdescription?: string | null;\n\talt?: string | null;\n\towner: string;\n\tmetadata?: string | null;\n\tuploadedAt: string;\n\tseo: Seo;\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// 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.js","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// 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\nexport interface ZoneDefinition {\n\tid: string;\n\tname: string;\n}\n\nexport interface ZonePaymentMethod {\n\tid: string;\n}\n\nexport interface ZoneShippingMethod {\n\tid: string;\n\tamount: number;\n}\n\nexport interface MarketZone {\n\ttaxBps: number;\n\tzoneId: string;\n\tpaymentMethods: ZonePaymentMethod[];\n\tshippingMethods: ZoneShippingMethod[];\n}\n\nexport interface Market {\n\tid: string;\n\tcurrency: string;\n\ttaxMode: \"EXCLUSIVE\" | \"INCLUSIVE\";\n\tzones: MarketZone[];\n}\n\nexport interface PaymentMethodConfig {\n\tid: string;\n\tmethod: PaymentMethod;\n}\n\nexport interface ShippingMethod {\n id: string;\n type: 'SHIPPING' | 'PICKUP';\n taxable: boolean;\n etaText: string;\n location?: Location;\n}\n\nexport interface ZoneResolvedShippingMethod extends ShippingMethod {\n\tzoneAmount: number;\n}\n\nexport interface Language {\n\tid: string;\n}\n\nexport interface BusinessEmails {\n\tbilling: string;\n\tsupport: string;\n}\n\nexport interface BusinessConfig {\n\tlanguages: Language[];\n\tzones: ZoneDefinition[];\n\tpaymentMethods: PaymentMethodConfig[];\n\tshippingMethods: ShippingMethod[];\n\tmarkets: Market[];\n\tbuildHooks: string[];\n\twebhooks: any[];\n\torderBlocks: any[];\n\treservationBlocks: any[];\n\tpaymentProvider?: PaymentProviderConfig;\n\taiProvider?: any;\n\temails: BusinessEmails;\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// SEO types\nexport interface Seo {\n\tslug: Record<string, string>;\n\tmetaTitle: Record<string, string>;\n\tmetaDescription: Record<string, string>;\n\tcanonicalUrl: Record<string, string>;\n\togImage: string;\n}\n\n// Media types\nexport interface MediaResolution {\n\tid: string;\n\tsize: string;\n\turl: string;\n}\n\nexport interface Media {\n\tid: string;\n\tresolutions: { [key: string]: MediaResolution };\n\tmimeType: string;\n\ttitle?: string | null;\n\tdescription?: string | null;\n\talt?: string | null;\n\towner: string;\n\tmetadata?: string | null;\n\tuploadedAt: string;\n\tseo: Seo;\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// 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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arky-sdk",
3
- "version": "0.3.35",
3
+ "version": "0.3.37",
4
4
  "description": "Official TypeScript SDK for Arky - All-in-one business platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",