arky-sdk 0.4.37 → 0.4.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +1 -4
- package/dist/types.d.ts +1 -4
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/types.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/index.ts"],"names":["PaymentMethodType"],"mappings":";;;AA4CO,IAAK,iBAAA,qBAAAA,kBAAAA,KAAL;AACN,EAAAA,mBAAA,MAAA,CAAA,GAAO,MAAA;AACP,EAAAA,mBAAA,YAAA,CAAA,GAAa,aAAA;AACb,EAAAA,mBAAA,QAAA,CAAA,GAAS,QAAA;AAHE,EAAA,OAAAA,kBAAAA;AAAA,CAAA,EAAA,iBAAA,IAAA,EAAA","file":"types.cjs","sourcesContent":["export * from './api';\n\nexport interface PaymentRefund {\n\tid: string;\n\tentity: string;\n\ttotal: number;\n\tproviderRefundId?: string;\n\tstatus: string;\n\tcreatedAt: number;\n}\n\nexport interface Payment {\n\tcurrency: string;\n\tmarket: string;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttotal: number;\n\tpaid: number;\n\ttax?: {\n\t\tamount: number;\n\t\tmodeSnapshot?: string;\n\t\trateBps: number;\n\t\tlines: Array<{ rateBps: number; amount: number; label?: string; scope?: string }>;\n\t};\n\tpromoCode?: {\n\t\tid: string;\n\t\tcode: string;\n\t\ttype: string;\n\t\tvalue: number;\n\t};\n\ttype: PaymentMethodType;\n\tprovider?: {\n\t\tcustomerId: string;\n\t\tpaymentIntentId?: string;\n\t\tsubscriptionId?: string;\n\t\tpriceId?: string;\n\t};\n\trefunds: PaymentRefund[];\n\tzoneId?: string;\n\tpaymentMethodId?: string;\n\tshippingMethodId?: string;\n}\n\nexport enum PaymentMethodType {\n\tCash = \"CASH\",\n\tCreditCard = \"CREDIT_CARD\",\n\tPayPal = \"PAYPAL\",\n\t// Free REMOVED - handled with logic: if total == 0, skip payment\n\t// NOTE: Apple Pay and Google Pay are NOT separate PaymentMethodTypes\n\t// They are UI options controlled by flags on CardProvider\n}\n\nexport interface PromoCodeValidation {\n\tpromoCodeId: string;\n\tcode: string;\n\tdiscounts: any[];\n\tconditions: any[];\n}\n\nexport interface Quote {\n\tmarket: string;\n\tzone: Zone;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttax: number;\n\ttotal: number;\n\tshippingMethod: ShippingMethod | null;\n\tpaymentMethod: PaymentMethod | null;\n\tpromoCode: PromoCodeValidation | null;\n\tpayment: Payment;\n\tchargeAmount: number;\n\tid?: string;\n\texpiresAt?: number;\n}\n\n/** Price for products and services (market-based, no provider fields) */\nexport interface Price {\n\tcurrency: string;\n\tmarket: string;\n\tamount: number;\n\tcompareAt?: number;\n}\n\n/** Interval period for subscription pricing */\nexport type IntervalPeriod = 'MONTH' | 'YEAR';\n\n/** Subscription interval configuration */\nexport interface SubscriptionInterval {\n\tperiod: IntervalPeriod;\n\tcount: number;\n}\n\n/** Price provider configuration (e.g., Stripe) */\nexport interface PriceProvider {\n\ttype: string;\n\tid: string;\n}\n\n/** Price for audiences/subscriptions (provider-based with interval) */\nexport interface SubscriptionPrice {\n\tcurrency: string;\n\tamount: number;\n\tcompareAt?: number;\n\tinterval?: SubscriptionInterval;\n\tproviders: PriceProvider[];\n}\n\n/**\n * Unified Location type used for addresses, shipping, and geo locations.\n * All fields are optional to support various use cases.\n */\nexport interface Location {\n\t// Identity/Contact\n\tname?: string | null;\n\tcompany?: string | null;\n\temail?: string | null;\n\tphone?: string | null;\n\n\t// Address\n\tstreet1?: string | null;\n\tstreet2?: string | null;\n\tcity?: string | null;\n\tstate?: string | null;\n\tpostalCode?: string | null;\n\tcountry?: string | null;\n\n\t// Geo\n\tcoordinates?: { lat: number; lon: number } | null;\n}\n\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;\n\tquantity: number;\n\taddedAt: number;\n}\n\nexport interface ReservationCartItem {\n\tid: string;\n\tserviceId: string;\n\tserviceName: string;\n\tdate: string;\n\tfrom: number;\n\tto: number;\n\ttimeText: string;\n\tproviderId?: string;\n\tblocks: any[];\n}\n\n/** Card payment processor - business picks ONE\n * Handles: Credit/Debit Cards, Apple Pay, Google Pay\n */\nexport interface CardProvider {\n\ttype: \"STRIPE\";\n\taccountId: string;\n\tcurrency: string;\n\t/** Enable Apple Pay (requires domain registration in Stripe Dashboard) */\n\tapplePayEnabled: boolean;\n\t/** Enable Google Pay */\n\tgooglePayEnabled: boolean;\n}\n\n/** Alternative payment providers - multiple allowed */\nexport interface AlternativeProvider {\n\ttype: \"PAYPAL\";\n\tmerchantId: string;\n\tclientId: string;\n\tcurrency: string;\n}\n\n/** @deprecated Use CardProvider instead */\nexport interface PaymentProviderConfig {\n\ttype: \"STRIPE\";\n\tpublicKey: string;\n\tsecretKey: string;\n\twebhookSecret: string;\n}\n\nexport interface AnalyticsConfig {\n\ttype: \"GA4\";\n\tmeasurementId: string;\n}\n\nexport interface ShippingWeightTier {\n\tupToGrams: number;\n\tamount: number;\n}\n\nexport interface PaymentMethod {\n\tid: string;\n\tname: Record<string, string>;\n\ttype: PaymentMethodType;\n}\n\nexport interface ShippingMethod {\n\tid: string;\n\tname: Record<string, string>;\n\ttaxable: boolean;\n\tetaText: string;\n\tfulfillmentCenterId?: string;\n\tamount: number;\n\tfreeAbove?: number;\n\tweightTiers?: ShippingWeightTier[];\n}\n\nexport interface FulfillmentCenter {\n\tid: string;\n\tkey: string;\n\tname: Record<string, string>;\n\tlocation: Location;\n\tisPickupLocation: boolean;\n}\n\nexport interface InventoryLevel {\n\tfulfillmentCenterId: string;\n\tavailable: number;\n\treserved: number;\n}\n\nexport type ZoneScope = \"ALL\" | \"ORDER\" | \"RESERVATION\";\n\nexport interface Zone {\n\tid: string;\n\tname: string;\n\tmarketId: string;\n\tscope: ZoneScope;\n\tcountries: string[];\n\tstates: string[];\n\tpostalCodes: string[];\n\ttaxBps: number;\n\tpaymentMethods: PaymentMethod[];\n\tshippingMethods: ShippingMethod[];\n}\n\nexport interface Market {\n\tid: string;\n\tcurrency: string;\n\ttaxMode: \"EXCLUSIVE\" | \"INCLUSIVE\";\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\tmarkets: Market[];\n\tzones: Zone[];\n\tfulfillmentCenters: FulfillmentCenter[];\n\tbuildHooks: string[];\n\twebhooks: any[];\n\t/** Card payment processor (handles cards + Apple Pay + Google Pay) */\n\tcardProvider?: CardProvider;\n\t/** Alternative payment providers (extensible for future) */\n\talternativeProviders?: AlternativeProvider[];\n\taiProvider?: any;\n\tanalytics?: AnalyticsConfig;\n\temails: BusinessEmails;\n}\n\nexport interface Subscription {\n\tid: string;\n\ttarget: string;\n\tplanId: string;\n\tpendingPlanId: string | null;\n\tpayment: any;\n\tstatus: SubscriptionStatus;\n\tendDate: number;\n\tusage: Record<string, any>;\n\ttoken: string;\n}\n\nexport interface Business {\n\tid: string;\n\tkey: string;\n\tnetworkKey: string | null;\n\ttimezone: string;\n\tconfigs?: BusinessConfig;\n\tsubscriptions?: Subscription[];\n\tstatus: Status;\n}\n\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}\n\nexport interface Block {\n\tid: string;\n\tkey: string;\n\ttype: string;\n\tproperties?: any;\n\tvalue?: any;\n}\n\nexport type BlockType =\n\t| \"TEXT\"\n\t| \"LOCALIZED_TEXT\"\n\t| \"NUMBER\"\n\t| \"BOOLEAN\"\n\t| \"BLOCK\"\n\t| \"RELATIONSHIP_ENTRY\"\n\t| \"RELATIONSHIP_MEDIA\"\n\t| \"MARKDOWN\"\n\t| \"EMAIL\"\n\t| \"PHONE\"\n\t| \"ADDRESS\";\n\nexport type AddressType = \"SHIPPING\" | \"BILLING\";\n\nexport interface EmailBlockProperties {}\n\nexport interface PhoneBlockProperties {}\n\nexport interface AddressBlockProperties {\n\taddressType: AddressType;\n}\n\n/** @deprecated Use Location instead */\nexport type GeoLocationValue = Location;\n\nexport interface EmailBlock extends Block {\n\ttype: \"EMAIL\";\n\tproperties: EmailBlockProperties;\n\tvalue: string | null;\n}\n\nexport interface PhoneBlock extends Block {\n\ttype: \"PHONE\";\n\tproperties: PhoneBlockProperties;\n\tvalue: string | null;\n}\n\nexport interface AddressBlock extends Block {\n\ttype: \"ADDRESS\";\n\tproperties: AddressBlockProperties;\n\tvalue: Location | null;\n}\n\nexport type Access = 'PUBLIC' | 'AUTHENTICATED' | 'PRIVATE';\n\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\tentity: string;\n\tmetadata?: string | null;\n\tuploadedAt: string;\n\tslug: Record<string, string>;\n}\n\nexport interface ApiResponse<T> {\n\tsuccess: boolean;\n\tdata?: T;\n\terror?: string;\n\tcursor?: string;\n\ttotal?: 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\nexport interface ReservationStoreState {\n\tcurrentStep: number;\n\ttotalSteps: number;\n\tsteps: Record<number, { name: string; labelKey: string }>;\n\tweekdays: string[];\n\tmonthYear: string;\n\tdays: any[];\n\tcurrent: Date;\n\tselectedDate: string | null;\n\tslots: any[];\n\tselectedSlot: any | null;\n\tselectedProvider: any | null;\n\tproviders: any[];\n\tloading: boolean;\n\tstartDate: string | null;\n\tendDate: string | null;\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\ttimezone: string;\n\ttzGroups: any;\n\titems: ReservationCartItem[];\n\tallowedPaymentMethods: string[];\n\tpaymentConfig: {\n\t\tprovider: CardProvider | null;\n\t\tenabled: boolean;\n\t};\n}\n\nexport type Status = 'DRAFT' | 'ACTIVE' | 'ARCHIVED';\n\nexport type OrderStatus = 'CREATED' | 'PENDING' | 'AUTHORIZED' | 'CONFIRMED' | 'SHIPPED' | 'COMPLETED' | 'CANCELLED' | 'FAILED';\n\nexport type ReservationStatus = 'CREATED' | 'PENDING' | 'AUTHORIZED' | 'CONFIRMED' | 'COMPLETED' | 'CANCELLED' | 'FAILED';\n\nexport type SubscriptionStatus = 'PENDING' | 'ACTIVE' | 'CANCELLATION_SCHEDULED' | 'CANCELLED' | 'EXPIRED';\n\nexport interface ReservationItem {\n\tid: string;\n\tserviceId: string;\n\tproviderId: string;\n\tbusinessId: string;\n\treservationId: string;\n\tuserId: string;\n\tfrom: number;\n\tto: number;\n\tblocks: Block[];\n\tprice: Price;\n}\n\nexport interface Reservation {\n\tid: string;\n\tnumber: string;\n\tuserId: string;\n\tblocks: Block[];\n\tbusinessId: string;\n\tstatus: ReservationStatus;\n\tserviceIds: string[];\n\tproviderIds: string[];\n\tpayment: Payment;\n\tbusiness?: Business;\n\tuser?: any;\n\titems: ReservationItem[];\n\tcreatedAt: number;\n\tlastModified: number;\n}\n\nexport interface Node {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tparentId?: string | null;\n\tblocks: Block[];\n\tstatus: Status;\n\tslug: Record<string, string>;\n\taccess: Access;\n\twriteAccess: Access;\n\temailSubject?: Record<string, string>;\n\tchildren: Node[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface ServiceDuration {\n\tduration: number;\n\tisPause?: boolean;\n}\n\nexport interface ServiceProvider {\n\tid: string;\n\tproviderId: string;\n\tworkingTime: {\n\t\tworkingDays: Array<{ day: string; workingHours: Array<{ from: number; to: number }> }>;\n\t\toutcastDates: Array<{ month: number; day: number; workingHours: Array<{ from: number; to: number }> }>;\n\t\tspecificDates: Array<{ date: number; workingHours: Array<{ from: number; to: number }> }>;\n\t};\n\tprovider?: Provider;\n}\n\nexport interface Service {\n\tid: string;\n\tkey: string;\n\tslug: Record<string, string>;\n\taccess: Access;\n\tbusinessId: string;\n\tprices: Price[];\n\tdurations: ServiceDuration[];\n\tblocks: Block[];\n\tnodeIds: string[];\n\tisApprovalRequired: boolean;\n\tproviders: ServiceProvider[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n\tstatus: Status;\n}\n\nexport interface ProviderTimelinePoint {\n\ttimestamp: number;\n\tconcurrent: number;\n}\n\nexport interface Provider {\n\tid: string;\n\tkey: string;\n\tslug: Record<string, string>;\n\taccess: Access;\n\tbusinessId: string;\n\tstatus: Status;\n\tconcurrentLimit: number;\n\tnodeIds: string[];\n\tblocks: Block[];\n\ttimeline: ProviderTimelinePoint[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface Workflow {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tsecret: string;\n\tstatus: Status;\n\tnodes: Record<string, WorkflowNode>;\n\tedges: WorkflowEdge[];\n\t\n\tschedule?: string;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface WorkflowEdge {\n\tid: string;\n\tsource: string;\n\tsourceOutput: string;\n\ttarget: string;\n}\n\nexport type WorkflowNode =\n\t| WorkflowTriggerNode\n\t| WorkflowHttpNode\n\t| WorkflowIfNode\n\t| WorkflowLoopNode\n\t| WorkflowWaitNode;\n\nexport interface WorkflowTriggerNode {\n\ttype: 'trigger';\n\tevent?: string;\n}\n\nexport interface WorkflowHttpNode {\n\ttype: 'http';\n\tmethod: WorkflowHttpMethod;\n\turl: string;\n\theaders?: Record<string, string>;\n\tbody?: any;\n\ttimeoutMs?: number;\n}\n\nexport interface WorkflowIfNode {\n\ttype: 'if';\n\tcondition: string;\n}\n\nexport interface WorkflowLoopNode {\n\ttype: 'loop';\n\tarray: string;\n}\n\nexport interface WorkflowWaitNode {\n\ttype: 'wait';\n\tduration: string;\n}\n\nexport type WorkflowHttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';\n\nexport type ExecutionStatus = 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'WAITING';\n\nexport interface WorkflowExecution {\n\tid: string;\n\tworkflowId: string;\n\tbusinessId: string;\n\tstatus: ExecutionStatus;\n\tinput: Record<string, any>;\n\tnodeOutputs: Record<string, any>;\n\tcurrentNode?: string;\n\terror?: string;\n\tscheduledAt: number;\n\tstartedAt: number;\n\tcompletedAt?: number;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface Audience {\n\tid: string;\n\tbusinessId: string;\n\tkey: string;\n\taccess: Access;\n\tnodeIds: string[];\n\tprices: SubscriptionPrice[];\n\tstatus: Status;\n}\n\nexport interface AudienceAccessResponse {\n\thasAccess: boolean;\n\tsubscription?: Subscription;\n}\n\nexport interface AudienceSubscribeResponse {\n\tcheckoutUrl?: string;\n\tsubscription?: Subscription;\n}\n\nexport type BusinessEventAction =\n\t\n\t| { action: 'order_created' }\n\t| { action: 'order_status_changed'; data: { from: string; to: string } }\n\t| { action: 'order_payment_received'; data: { amount: number } }\n\t| { action: 'order_payment_failed'; data: { reason?: string } }\n\t| { action: 'order_refunded'; data: { amount: number; reason?: string } }\n\t| { action: 'order_shipped'; data: { tracking_url?: string } }\n\t| { action: 'order_completed' }\n\t| { action: 'order_cancelled'; data: { reason?: string } }\n\t\n\t| { action: 'reservation_created' }\n\t| { action: 'reservation_status_changed'; data: { from: string; to: string } }\n\t| { action: 'reservation_payment_received'; data: { amount: number } }\n\t| { action: 'reservation_payment_failed'; data: { reason?: string } }\n\t| { action: 'reservation_refunded'; data: { amount: number; reason?: string } }\n\t| { action: 'reservation_completed' }\n\t| { action: 'reservation_cancelled'; data: { reason?: string } };\n\nexport interface BusinessEvent {\n\tid: string;\n\tbusinessId: string;\n\tentity: string;\n\tpayload: BusinessEventAction;\n\tactor: string;\n\tcreatedAt: number;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/types/index.ts"],"names":["PaymentMethodType"],"mappings":";;;AA4CO,IAAK,iBAAA,qBAAAA,kBAAAA,KAAL;AACN,EAAAA,mBAAA,MAAA,CAAA,GAAO,MAAA;AACP,EAAAA,mBAAA,YAAA,CAAA,GAAa,aAAA;AACb,EAAAA,mBAAA,QAAA,CAAA,GAAS,QAAA;AAHE,EAAA,OAAAA,kBAAAA;AAAA,CAAA,EAAA,iBAAA,IAAA,EAAA","file":"types.cjs","sourcesContent":["export * from './api';\n\nexport interface PaymentRefund {\n\tid: string;\n\tentity: string;\n\ttotal: number;\n\tproviderRefundId?: string;\n\tstatus: string;\n\tcreatedAt: number;\n}\n\nexport interface Payment {\n\tcurrency: string;\n\tmarket: string;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttotal: number;\n\tpaid: number;\n\ttax?: {\n\t\tamount: number;\n\t\tmodeSnapshot?: string;\n\t\trateBps: number;\n\t\tlines: Array<{ rateBps: number; amount: number; label?: string; scope?: string }>;\n\t};\n\tpromoCode?: {\n\t\tid: string;\n\t\tcode: string;\n\t\ttype: string;\n\t\tvalue: number;\n\t};\n\ttype: PaymentMethodType;\n\tprovider?: {\n\t\tcustomerId: string;\n\t\tpaymentIntentId?: string;\n\t\tsubscriptionId?: string;\n\t\tpriceId?: string;\n\t};\n\trefunds: PaymentRefund[];\n\tzoneId?: string;\n\tpaymentMethodId?: string;\n\tshippingMethodId?: string;\n}\n\nexport enum PaymentMethodType {\n\tCash = \"CASH\",\n\tCreditCard = \"CREDIT_CARD\",\n\tPayPal = \"PAYPAL\",\n\t// Free REMOVED - handled with logic: if total == 0, skip payment\n\t// NOTE: Apple Pay and Google Pay are NOT separate PaymentMethodTypes\n\t// They are handled automatically by Stripe's Payment Element\n}\n\nexport interface PromoCodeValidation {\n\tpromoCodeId: string;\n\tcode: string;\n\tdiscounts: any[];\n\tconditions: any[];\n}\n\nexport interface Quote {\n\tmarket: string;\n\tzone: Zone;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttax: number;\n\ttotal: number;\n\tshippingMethod: ShippingMethod | null;\n\tpaymentMethod: PaymentMethod | null;\n\tpromoCode: PromoCodeValidation | null;\n\tpayment: Payment;\n\tchargeAmount: number;\n\tid?: string;\n\texpiresAt?: number;\n}\n\n/** Price for products and services (market-based, no provider fields) */\nexport interface Price {\n\tcurrency: string;\n\tmarket: string;\n\tamount: number;\n\tcompareAt?: number;\n}\n\n/** Interval period for subscription pricing */\nexport type IntervalPeriod = 'MONTH' | 'YEAR';\n\n/** Subscription interval configuration */\nexport interface SubscriptionInterval {\n\tperiod: IntervalPeriod;\n\tcount: number;\n}\n\n/** Price provider configuration (e.g., Stripe) */\nexport interface PriceProvider {\n\ttype: string;\n\tid: string;\n}\n\n/** Price for audiences/subscriptions (provider-based with interval) */\nexport interface SubscriptionPrice {\n\tcurrency: string;\n\tamount: number;\n\tcompareAt?: number;\n\tinterval?: SubscriptionInterval;\n\tproviders: PriceProvider[];\n}\n\n/**\n * Unified Location type used for addresses, shipping, and geo locations.\n * All fields are optional to support various use cases.\n */\nexport interface Location {\n\t// Identity/Contact\n\tname?: string | null;\n\tcompany?: string | null;\n\temail?: string | null;\n\tphone?: string | null;\n\n\t// Address\n\tstreet1?: string | null;\n\tstreet2?: string | null;\n\tcity?: string | null;\n\tstate?: string | null;\n\tpostalCode?: string | null;\n\tcountry?: string | null;\n\n\t// Geo\n\tcoordinates?: { lat: number; lon: number } | null;\n}\n\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;\n\tquantity: number;\n\taddedAt: number;\n}\n\nexport interface ReservationCartItem {\n\tid: string;\n\tserviceId: string;\n\tserviceName: string;\n\tdate: string;\n\tfrom: number;\n\tto: number;\n\ttimeText: string;\n\tproviderId?: string;\n\tblocks: any[];\n}\n\n/** Card payment processor - business picks ONE\n * Handles: Credit/Debit Cards, Apple Pay, Google Pay\n * Note: Wallet payments are controlled via Stripe Dashboard and detected automatically\n */\nexport interface CardProvider {\n\ttype: \"STRIPE\";\n\taccountId: string;\n\tcurrency: string;\n}\n\n/** Alternative payment providers - multiple allowed */\nexport interface AlternativeProvider {\n\ttype: \"PAYPAL\";\n\tmerchantId: string;\n\tclientId: string;\n\tcurrency: string;\n}\n\n/** @deprecated Use CardProvider instead */\nexport interface PaymentProviderConfig {\n\ttype: \"STRIPE\";\n\tpublicKey: string;\n\tsecretKey: string;\n\twebhookSecret: string;\n}\n\nexport interface AnalyticsConfig {\n\ttype: \"GA4\";\n\tmeasurementId: string;\n}\n\nexport interface ShippingWeightTier {\n\tupToGrams: number;\n\tamount: number;\n}\n\nexport interface PaymentMethod {\n\tid: string;\n\tname: Record<string, string>;\n\ttype: PaymentMethodType;\n}\n\nexport interface ShippingMethod {\n\tid: string;\n\tname: Record<string, string>;\n\ttaxable: boolean;\n\tetaText: string;\n\tfulfillmentCenterId?: string;\n\tamount: number;\n\tfreeAbove?: number;\n\tweightTiers?: ShippingWeightTier[];\n}\n\nexport interface FulfillmentCenter {\n\tid: string;\n\tkey: string;\n\tname: Record<string, string>;\n\tlocation: Location;\n\tisPickupLocation: boolean;\n}\n\nexport interface InventoryLevel {\n\tfulfillmentCenterId: string;\n\tavailable: number;\n\treserved: number;\n}\n\nexport type ZoneScope = \"ALL\" | \"ORDER\" | \"RESERVATION\";\n\nexport interface Zone {\n\tid: string;\n\tname: string;\n\tmarketId: string;\n\tscope: ZoneScope;\n\tcountries: string[];\n\tstates: string[];\n\tpostalCodes: string[];\n\ttaxBps: number;\n\tpaymentMethods: PaymentMethod[];\n\tshippingMethods: ShippingMethod[];\n}\n\nexport interface Market {\n\tid: string;\n\tcurrency: string;\n\ttaxMode: \"EXCLUSIVE\" | \"INCLUSIVE\";\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\tmarkets: Market[];\n\tzones: Zone[];\n\tfulfillmentCenters: FulfillmentCenter[];\n\tbuildHooks: string[];\n\twebhooks: any[];\n\t/** Card payment processor (handles cards + Apple Pay + Google Pay) */\n\tcardProvider?: CardProvider;\n\t/** Alternative payment providers (extensible for future) */\n\talternativeProviders?: AlternativeProvider[];\n\taiProvider?: any;\n\tanalytics?: AnalyticsConfig;\n\temails: BusinessEmails;\n}\n\nexport interface Subscription {\n\tid: string;\n\ttarget: string;\n\tplanId: string;\n\tpendingPlanId: string | null;\n\tpayment: any;\n\tstatus: SubscriptionStatus;\n\tendDate: number;\n\tusage: Record<string, any>;\n\ttoken: string;\n}\n\nexport interface Business {\n\tid: string;\n\tkey: string;\n\tnetworkKey: string | null;\n\ttimezone: string;\n\tconfigs?: BusinessConfig;\n\tsubscriptions?: Subscription[];\n\tstatus: Status;\n}\n\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}\n\nexport interface Block {\n\tid: string;\n\tkey: string;\n\ttype: string;\n\tproperties?: any;\n\tvalue?: any;\n}\n\nexport type BlockType =\n\t| \"TEXT\"\n\t| \"LOCALIZED_TEXT\"\n\t| \"NUMBER\"\n\t| \"BOOLEAN\"\n\t| \"BLOCK\"\n\t| \"RELATIONSHIP_ENTRY\"\n\t| \"RELATIONSHIP_MEDIA\"\n\t| \"MARKDOWN\"\n\t| \"EMAIL\"\n\t| \"PHONE\"\n\t| \"ADDRESS\";\n\nexport type AddressType = \"SHIPPING\" | \"BILLING\";\n\nexport interface EmailBlockProperties {}\n\nexport interface PhoneBlockProperties {}\n\nexport interface AddressBlockProperties {\n\taddressType: AddressType;\n}\n\n/** @deprecated Use Location instead */\nexport type GeoLocationValue = Location;\n\nexport interface EmailBlock extends Block {\n\ttype: \"EMAIL\";\n\tproperties: EmailBlockProperties;\n\tvalue: string | null;\n}\n\nexport interface PhoneBlock extends Block {\n\ttype: \"PHONE\";\n\tproperties: PhoneBlockProperties;\n\tvalue: string | null;\n}\n\nexport interface AddressBlock extends Block {\n\ttype: \"ADDRESS\";\n\tproperties: AddressBlockProperties;\n\tvalue: Location | null;\n}\n\nexport type Access = 'PUBLIC' | 'AUTHENTICATED' | 'PRIVATE';\n\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\tentity: string;\n\tmetadata?: string | null;\n\tuploadedAt: string;\n\tslug: Record<string, string>;\n}\n\nexport interface ApiResponse<T> {\n\tsuccess: boolean;\n\tdata?: T;\n\terror?: string;\n\tcursor?: string;\n\ttotal?: 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\nexport interface ReservationStoreState {\n\tcurrentStep: number;\n\ttotalSteps: number;\n\tsteps: Record<number, { name: string; labelKey: string }>;\n\tweekdays: string[];\n\tmonthYear: string;\n\tdays: any[];\n\tcurrent: Date;\n\tselectedDate: string | null;\n\tslots: any[];\n\tselectedSlot: any | null;\n\tselectedProvider: any | null;\n\tproviders: any[];\n\tloading: boolean;\n\tstartDate: string | null;\n\tendDate: string | null;\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\ttimezone: string;\n\ttzGroups: any;\n\titems: ReservationCartItem[];\n\tallowedPaymentMethods: string[];\n\tpaymentConfig: {\n\t\tprovider: CardProvider | null;\n\t\tenabled: boolean;\n\t};\n}\n\nexport type Status = 'DRAFT' | 'ACTIVE' | 'ARCHIVED';\n\nexport type OrderStatus = 'CREATED' | 'PENDING' | 'AUTHORIZED' | 'CONFIRMED' | 'SHIPPED' | 'COMPLETED' | 'CANCELLED' | 'FAILED';\n\nexport type ReservationStatus = 'CREATED' | 'PENDING' | 'AUTHORIZED' | 'CONFIRMED' | 'COMPLETED' | 'CANCELLED' | 'FAILED';\n\nexport type SubscriptionStatus = 'PENDING' | 'ACTIVE' | 'CANCELLATION_SCHEDULED' | 'CANCELLED' | 'EXPIRED';\n\nexport interface ReservationItem {\n\tid: string;\n\tserviceId: string;\n\tproviderId: string;\n\tbusinessId: string;\n\treservationId: string;\n\tuserId: string;\n\tfrom: number;\n\tto: number;\n\tblocks: Block[];\n\tprice: Price;\n}\n\nexport interface Reservation {\n\tid: string;\n\tnumber: string;\n\tuserId: string;\n\tblocks: Block[];\n\tbusinessId: string;\n\tstatus: ReservationStatus;\n\tserviceIds: string[];\n\tproviderIds: string[];\n\tpayment: Payment;\n\tbusiness?: Business;\n\tuser?: any;\n\titems: ReservationItem[];\n\tcreatedAt: number;\n\tlastModified: number;\n}\n\nexport interface Node {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tparentId?: string | null;\n\tblocks: Block[];\n\tstatus: Status;\n\tslug: Record<string, string>;\n\taccess: Access;\n\twriteAccess: Access;\n\temailSubject?: Record<string, string>;\n\tchildren: Node[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface ServiceDuration {\n\tduration: number;\n\tisPause?: boolean;\n}\n\nexport interface ServiceProvider {\n\tid: string;\n\tproviderId: string;\n\tworkingTime: {\n\t\tworkingDays: Array<{ day: string; workingHours: Array<{ from: number; to: number }> }>;\n\t\toutcastDates: Array<{ month: number; day: number; workingHours: Array<{ from: number; to: number }> }>;\n\t\tspecificDates: Array<{ date: number; workingHours: Array<{ from: number; to: number }> }>;\n\t};\n\tprovider?: Provider;\n}\n\nexport interface Service {\n\tid: string;\n\tkey: string;\n\tslug: Record<string, string>;\n\taccess: Access;\n\tbusinessId: string;\n\tprices: Price[];\n\tdurations: ServiceDuration[];\n\tblocks: Block[];\n\tnodeIds: string[];\n\tisApprovalRequired: boolean;\n\tproviders: ServiceProvider[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n\tstatus: Status;\n}\n\nexport interface ProviderTimelinePoint {\n\ttimestamp: number;\n\tconcurrent: number;\n}\n\nexport interface Provider {\n\tid: string;\n\tkey: string;\n\tslug: Record<string, string>;\n\taccess: Access;\n\tbusinessId: string;\n\tstatus: Status;\n\tconcurrentLimit: number;\n\tnodeIds: string[];\n\tblocks: Block[];\n\ttimeline: ProviderTimelinePoint[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface Workflow {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tsecret: string;\n\tstatus: Status;\n\tnodes: Record<string, WorkflowNode>;\n\tedges: WorkflowEdge[];\n\t\n\tschedule?: string;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface WorkflowEdge {\n\tid: string;\n\tsource: string;\n\tsourceOutput: string;\n\ttarget: string;\n}\n\nexport type WorkflowNode =\n\t| WorkflowTriggerNode\n\t| WorkflowHttpNode\n\t| WorkflowIfNode\n\t| WorkflowLoopNode\n\t| WorkflowWaitNode;\n\nexport interface WorkflowTriggerNode {\n\ttype: 'trigger';\n\tevent?: string;\n}\n\nexport interface WorkflowHttpNode {\n\ttype: 'http';\n\tmethod: WorkflowHttpMethod;\n\turl: string;\n\theaders?: Record<string, string>;\n\tbody?: any;\n\ttimeoutMs?: number;\n}\n\nexport interface WorkflowIfNode {\n\ttype: 'if';\n\tcondition: string;\n}\n\nexport interface WorkflowLoopNode {\n\ttype: 'loop';\n\tarray: string;\n}\n\nexport interface WorkflowWaitNode {\n\ttype: 'wait';\n\tduration: string;\n}\n\nexport type WorkflowHttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';\n\nexport type ExecutionStatus = 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'WAITING';\n\nexport interface WorkflowExecution {\n\tid: string;\n\tworkflowId: string;\n\tbusinessId: string;\n\tstatus: ExecutionStatus;\n\tinput: Record<string, any>;\n\tnodeOutputs: Record<string, any>;\n\tcurrentNode?: string;\n\terror?: string;\n\tscheduledAt: number;\n\tstartedAt: number;\n\tcompletedAt?: number;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface Audience {\n\tid: string;\n\tbusinessId: string;\n\tkey: string;\n\taccess: Access;\n\tnodeIds: string[];\n\tprices: SubscriptionPrice[];\n\tstatus: Status;\n}\n\nexport interface AudienceAccessResponse {\n\thasAccess: boolean;\n\tsubscription?: Subscription;\n}\n\nexport interface AudienceSubscribeResponse {\n\tcheckoutUrl?: string;\n\tsubscription?: Subscription;\n}\n\nexport type BusinessEventAction =\n\t\n\t| { action: 'order_created' }\n\t| { action: 'order_status_changed'; data: { from: string; to: string } }\n\t| { action: 'order_payment_received'; data: { amount: number } }\n\t| { action: 'order_payment_failed'; data: { reason?: string } }\n\t| { action: 'order_refunded'; data: { amount: number; reason?: string } }\n\t| { action: 'order_shipped'; data: { tracking_url?: string } }\n\t| { action: 'order_completed' }\n\t| { action: 'order_cancelled'; data: { reason?: string } }\n\t\n\t| { action: 'reservation_created' }\n\t| { action: 'reservation_status_changed'; data: { from: string; to: string } }\n\t| { action: 'reservation_payment_received'; data: { amount: number } }\n\t| { action: 'reservation_payment_failed'; data: { reason?: string } }\n\t| { action: 'reservation_refunded'; data: { amount: number; reason?: string } }\n\t| { action: 'reservation_completed' }\n\t| { action: 'reservation_cancelled'; data: { reason?: string } };\n\nexport interface BusinessEvent {\n\tid: string;\n\tbusinessId: string;\n\tentity: string;\n\tpayload: BusinessEventAction;\n\tactor: string;\n\tcreatedAt: number;\n}\n"]}
|
package/dist/types.d.cts
CHANGED
|
@@ -141,15 +141,12 @@ interface ReservationCartItem {
|
|
|
141
141
|
}
|
|
142
142
|
/** Card payment processor - business picks ONE
|
|
143
143
|
* Handles: Credit/Debit Cards, Apple Pay, Google Pay
|
|
144
|
+
* Note: Wallet payments are controlled via Stripe Dashboard and detected automatically
|
|
144
145
|
*/
|
|
145
146
|
interface CardProvider {
|
|
146
147
|
type: "STRIPE";
|
|
147
148
|
accountId: string;
|
|
148
149
|
currency: string;
|
|
149
|
-
/** Enable Apple Pay (requires domain registration in Stripe Dashboard) */
|
|
150
|
-
applePayEnabled: boolean;
|
|
151
|
-
/** Enable Google Pay */
|
|
152
|
-
googlePayEnabled: boolean;
|
|
153
150
|
}
|
|
154
151
|
/** Alternative payment providers - multiple allowed */
|
|
155
152
|
interface AlternativeProvider {
|
package/dist/types.d.ts
CHANGED
|
@@ -141,15 +141,12 @@ interface ReservationCartItem {
|
|
|
141
141
|
}
|
|
142
142
|
/** Card payment processor - business picks ONE
|
|
143
143
|
* Handles: Credit/Debit Cards, Apple Pay, Google Pay
|
|
144
|
+
* Note: Wallet payments are controlled via Stripe Dashboard and detected automatically
|
|
144
145
|
*/
|
|
145
146
|
interface CardProvider {
|
|
146
147
|
type: "STRIPE";
|
|
147
148
|
accountId: string;
|
|
148
149
|
currency: string;
|
|
149
|
-
/** Enable Apple Pay (requires domain registration in Stripe Dashboard) */
|
|
150
|
-
applePayEnabled: boolean;
|
|
151
|
-
/** Enable Google Pay */
|
|
152
|
-
googlePayEnabled: boolean;
|
|
153
150
|
}
|
|
154
151
|
/** Alternative payment providers - multiple allowed */
|
|
155
152
|
interface AlternativeProvider {
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/index.ts"],"names":["PaymentMethodType"],"mappings":";AA4CO,IAAK,iBAAA,qBAAAA,kBAAAA,KAAL;AACN,EAAAA,mBAAA,MAAA,CAAA,GAAO,MAAA;AACP,EAAAA,mBAAA,YAAA,CAAA,GAAa,aAAA;AACb,EAAAA,mBAAA,QAAA,CAAA,GAAS,QAAA;AAHE,EAAA,OAAAA,kBAAAA;AAAA,CAAA,EAAA,iBAAA,IAAA,EAAA","file":"types.js","sourcesContent":["export * from './api';\n\nexport interface PaymentRefund {\n\tid: string;\n\tentity: string;\n\ttotal: number;\n\tproviderRefundId?: string;\n\tstatus: string;\n\tcreatedAt: number;\n}\n\nexport interface Payment {\n\tcurrency: string;\n\tmarket: string;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttotal: number;\n\tpaid: number;\n\ttax?: {\n\t\tamount: number;\n\t\tmodeSnapshot?: string;\n\t\trateBps: number;\n\t\tlines: Array<{ rateBps: number; amount: number; label?: string; scope?: string }>;\n\t};\n\tpromoCode?: {\n\t\tid: string;\n\t\tcode: string;\n\t\ttype: string;\n\t\tvalue: number;\n\t};\n\ttype: PaymentMethodType;\n\tprovider?: {\n\t\tcustomerId: string;\n\t\tpaymentIntentId?: string;\n\t\tsubscriptionId?: string;\n\t\tpriceId?: string;\n\t};\n\trefunds: PaymentRefund[];\n\tzoneId?: string;\n\tpaymentMethodId?: string;\n\tshippingMethodId?: string;\n}\n\nexport enum PaymentMethodType {\n\tCash = \"CASH\",\n\tCreditCard = \"CREDIT_CARD\",\n\tPayPal = \"PAYPAL\",\n\t// Free REMOVED - handled with logic: if total == 0, skip payment\n\t// NOTE: Apple Pay and Google Pay are NOT separate PaymentMethodTypes\n\t// They are UI options controlled by flags on CardProvider\n}\n\nexport interface PromoCodeValidation {\n\tpromoCodeId: string;\n\tcode: string;\n\tdiscounts: any[];\n\tconditions: any[];\n}\n\nexport interface Quote {\n\tmarket: string;\n\tzone: Zone;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttax: number;\n\ttotal: number;\n\tshippingMethod: ShippingMethod | null;\n\tpaymentMethod: PaymentMethod | null;\n\tpromoCode: PromoCodeValidation | null;\n\tpayment: Payment;\n\tchargeAmount: number;\n\tid?: string;\n\texpiresAt?: number;\n}\n\n/** Price for products and services (market-based, no provider fields) */\nexport interface Price {\n\tcurrency: string;\n\tmarket: string;\n\tamount: number;\n\tcompareAt?: number;\n}\n\n/** Interval period for subscription pricing */\nexport type IntervalPeriod = 'MONTH' | 'YEAR';\n\n/** Subscription interval configuration */\nexport interface SubscriptionInterval {\n\tperiod: IntervalPeriod;\n\tcount: number;\n}\n\n/** Price provider configuration (e.g., Stripe) */\nexport interface PriceProvider {\n\ttype: string;\n\tid: string;\n}\n\n/** Price for audiences/subscriptions (provider-based with interval) */\nexport interface SubscriptionPrice {\n\tcurrency: string;\n\tamount: number;\n\tcompareAt?: number;\n\tinterval?: SubscriptionInterval;\n\tproviders: PriceProvider[];\n}\n\n/**\n * Unified Location type used for addresses, shipping, and geo locations.\n * All fields are optional to support various use cases.\n */\nexport interface Location {\n\t// Identity/Contact\n\tname?: string | null;\n\tcompany?: string | null;\n\temail?: string | null;\n\tphone?: string | null;\n\n\t// Address\n\tstreet1?: string | null;\n\tstreet2?: string | null;\n\tcity?: string | null;\n\tstate?: string | null;\n\tpostalCode?: string | null;\n\tcountry?: string | null;\n\n\t// Geo\n\tcoordinates?: { lat: number; lon: number } | null;\n}\n\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;\n\tquantity: number;\n\taddedAt: number;\n}\n\nexport interface ReservationCartItem {\n\tid: string;\n\tserviceId: string;\n\tserviceName: string;\n\tdate: string;\n\tfrom: number;\n\tto: number;\n\ttimeText: string;\n\tproviderId?: string;\n\tblocks: any[];\n}\n\n/** Card payment processor - business picks ONE\n * Handles: Credit/Debit Cards, Apple Pay, Google Pay\n */\nexport interface CardProvider {\n\ttype: \"STRIPE\";\n\taccountId: string;\n\tcurrency: string;\n\t/** Enable Apple Pay (requires domain registration in Stripe Dashboard) */\n\tapplePayEnabled: boolean;\n\t/** Enable Google Pay */\n\tgooglePayEnabled: boolean;\n}\n\n/** Alternative payment providers - multiple allowed */\nexport interface AlternativeProvider {\n\ttype: \"PAYPAL\";\n\tmerchantId: string;\n\tclientId: string;\n\tcurrency: string;\n}\n\n/** @deprecated Use CardProvider instead */\nexport interface PaymentProviderConfig {\n\ttype: \"STRIPE\";\n\tpublicKey: string;\n\tsecretKey: string;\n\twebhookSecret: string;\n}\n\nexport interface AnalyticsConfig {\n\ttype: \"GA4\";\n\tmeasurementId: string;\n}\n\nexport interface ShippingWeightTier {\n\tupToGrams: number;\n\tamount: number;\n}\n\nexport interface PaymentMethod {\n\tid: string;\n\tname: Record<string, string>;\n\ttype: PaymentMethodType;\n}\n\nexport interface ShippingMethod {\n\tid: string;\n\tname: Record<string, string>;\n\ttaxable: boolean;\n\tetaText: string;\n\tfulfillmentCenterId?: string;\n\tamount: number;\n\tfreeAbove?: number;\n\tweightTiers?: ShippingWeightTier[];\n}\n\nexport interface FulfillmentCenter {\n\tid: string;\n\tkey: string;\n\tname: Record<string, string>;\n\tlocation: Location;\n\tisPickupLocation: boolean;\n}\n\nexport interface InventoryLevel {\n\tfulfillmentCenterId: string;\n\tavailable: number;\n\treserved: number;\n}\n\nexport type ZoneScope = \"ALL\" | \"ORDER\" | \"RESERVATION\";\n\nexport interface Zone {\n\tid: string;\n\tname: string;\n\tmarketId: string;\n\tscope: ZoneScope;\n\tcountries: string[];\n\tstates: string[];\n\tpostalCodes: string[];\n\ttaxBps: number;\n\tpaymentMethods: PaymentMethod[];\n\tshippingMethods: ShippingMethod[];\n}\n\nexport interface Market {\n\tid: string;\n\tcurrency: string;\n\ttaxMode: \"EXCLUSIVE\" | \"INCLUSIVE\";\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\tmarkets: Market[];\n\tzones: Zone[];\n\tfulfillmentCenters: FulfillmentCenter[];\n\tbuildHooks: string[];\n\twebhooks: any[];\n\t/** Card payment processor (handles cards + Apple Pay + Google Pay) */\n\tcardProvider?: CardProvider;\n\t/** Alternative payment providers (extensible for future) */\n\talternativeProviders?: AlternativeProvider[];\n\taiProvider?: any;\n\tanalytics?: AnalyticsConfig;\n\temails: BusinessEmails;\n}\n\nexport interface Subscription {\n\tid: string;\n\ttarget: string;\n\tplanId: string;\n\tpendingPlanId: string | null;\n\tpayment: any;\n\tstatus: SubscriptionStatus;\n\tendDate: number;\n\tusage: Record<string, any>;\n\ttoken: string;\n}\n\nexport interface Business {\n\tid: string;\n\tkey: string;\n\tnetworkKey: string | null;\n\ttimezone: string;\n\tconfigs?: BusinessConfig;\n\tsubscriptions?: Subscription[];\n\tstatus: Status;\n}\n\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}\n\nexport interface Block {\n\tid: string;\n\tkey: string;\n\ttype: string;\n\tproperties?: any;\n\tvalue?: any;\n}\n\nexport type BlockType =\n\t| \"TEXT\"\n\t| \"LOCALIZED_TEXT\"\n\t| \"NUMBER\"\n\t| \"BOOLEAN\"\n\t| \"BLOCK\"\n\t| \"RELATIONSHIP_ENTRY\"\n\t| \"RELATIONSHIP_MEDIA\"\n\t| \"MARKDOWN\"\n\t| \"EMAIL\"\n\t| \"PHONE\"\n\t| \"ADDRESS\";\n\nexport type AddressType = \"SHIPPING\" | \"BILLING\";\n\nexport interface EmailBlockProperties {}\n\nexport interface PhoneBlockProperties {}\n\nexport interface AddressBlockProperties {\n\taddressType: AddressType;\n}\n\n/** @deprecated Use Location instead */\nexport type GeoLocationValue = Location;\n\nexport interface EmailBlock extends Block {\n\ttype: \"EMAIL\";\n\tproperties: EmailBlockProperties;\n\tvalue: string | null;\n}\n\nexport interface PhoneBlock extends Block {\n\ttype: \"PHONE\";\n\tproperties: PhoneBlockProperties;\n\tvalue: string | null;\n}\n\nexport interface AddressBlock extends Block {\n\ttype: \"ADDRESS\";\n\tproperties: AddressBlockProperties;\n\tvalue: Location | null;\n}\n\nexport type Access = 'PUBLIC' | 'AUTHENTICATED' | 'PRIVATE';\n\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\tentity: string;\n\tmetadata?: string | null;\n\tuploadedAt: string;\n\tslug: Record<string, string>;\n}\n\nexport interface ApiResponse<T> {\n\tsuccess: boolean;\n\tdata?: T;\n\terror?: string;\n\tcursor?: string;\n\ttotal?: 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\nexport interface ReservationStoreState {\n\tcurrentStep: number;\n\ttotalSteps: number;\n\tsteps: Record<number, { name: string; labelKey: string }>;\n\tweekdays: string[];\n\tmonthYear: string;\n\tdays: any[];\n\tcurrent: Date;\n\tselectedDate: string | null;\n\tslots: any[];\n\tselectedSlot: any | null;\n\tselectedProvider: any | null;\n\tproviders: any[];\n\tloading: boolean;\n\tstartDate: string | null;\n\tendDate: string | null;\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\ttimezone: string;\n\ttzGroups: any;\n\titems: ReservationCartItem[];\n\tallowedPaymentMethods: string[];\n\tpaymentConfig: {\n\t\tprovider: CardProvider | null;\n\t\tenabled: boolean;\n\t};\n}\n\nexport type Status = 'DRAFT' | 'ACTIVE' | 'ARCHIVED';\n\nexport type OrderStatus = 'CREATED' | 'PENDING' | 'AUTHORIZED' | 'CONFIRMED' | 'SHIPPED' | 'COMPLETED' | 'CANCELLED' | 'FAILED';\n\nexport type ReservationStatus = 'CREATED' | 'PENDING' | 'AUTHORIZED' | 'CONFIRMED' | 'COMPLETED' | 'CANCELLED' | 'FAILED';\n\nexport type SubscriptionStatus = 'PENDING' | 'ACTIVE' | 'CANCELLATION_SCHEDULED' | 'CANCELLED' | 'EXPIRED';\n\nexport interface ReservationItem {\n\tid: string;\n\tserviceId: string;\n\tproviderId: string;\n\tbusinessId: string;\n\treservationId: string;\n\tuserId: string;\n\tfrom: number;\n\tto: number;\n\tblocks: Block[];\n\tprice: Price;\n}\n\nexport interface Reservation {\n\tid: string;\n\tnumber: string;\n\tuserId: string;\n\tblocks: Block[];\n\tbusinessId: string;\n\tstatus: ReservationStatus;\n\tserviceIds: string[];\n\tproviderIds: string[];\n\tpayment: Payment;\n\tbusiness?: Business;\n\tuser?: any;\n\titems: ReservationItem[];\n\tcreatedAt: number;\n\tlastModified: number;\n}\n\nexport interface Node {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tparentId?: string | null;\n\tblocks: Block[];\n\tstatus: Status;\n\tslug: Record<string, string>;\n\taccess: Access;\n\twriteAccess: Access;\n\temailSubject?: Record<string, string>;\n\tchildren: Node[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface ServiceDuration {\n\tduration: number;\n\tisPause?: boolean;\n}\n\nexport interface ServiceProvider {\n\tid: string;\n\tproviderId: string;\n\tworkingTime: {\n\t\tworkingDays: Array<{ day: string; workingHours: Array<{ from: number; to: number }> }>;\n\t\toutcastDates: Array<{ month: number; day: number; workingHours: Array<{ from: number; to: number }> }>;\n\t\tspecificDates: Array<{ date: number; workingHours: Array<{ from: number; to: number }> }>;\n\t};\n\tprovider?: Provider;\n}\n\nexport interface Service {\n\tid: string;\n\tkey: string;\n\tslug: Record<string, string>;\n\taccess: Access;\n\tbusinessId: string;\n\tprices: Price[];\n\tdurations: ServiceDuration[];\n\tblocks: Block[];\n\tnodeIds: string[];\n\tisApprovalRequired: boolean;\n\tproviders: ServiceProvider[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n\tstatus: Status;\n}\n\nexport interface ProviderTimelinePoint {\n\ttimestamp: number;\n\tconcurrent: number;\n}\n\nexport interface Provider {\n\tid: string;\n\tkey: string;\n\tslug: Record<string, string>;\n\taccess: Access;\n\tbusinessId: string;\n\tstatus: Status;\n\tconcurrentLimit: number;\n\tnodeIds: string[];\n\tblocks: Block[];\n\ttimeline: ProviderTimelinePoint[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface Workflow {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tsecret: string;\n\tstatus: Status;\n\tnodes: Record<string, WorkflowNode>;\n\tedges: WorkflowEdge[];\n\t\n\tschedule?: string;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface WorkflowEdge {\n\tid: string;\n\tsource: string;\n\tsourceOutput: string;\n\ttarget: string;\n}\n\nexport type WorkflowNode =\n\t| WorkflowTriggerNode\n\t| WorkflowHttpNode\n\t| WorkflowIfNode\n\t| WorkflowLoopNode\n\t| WorkflowWaitNode;\n\nexport interface WorkflowTriggerNode {\n\ttype: 'trigger';\n\tevent?: string;\n}\n\nexport interface WorkflowHttpNode {\n\ttype: 'http';\n\tmethod: WorkflowHttpMethod;\n\turl: string;\n\theaders?: Record<string, string>;\n\tbody?: any;\n\ttimeoutMs?: number;\n}\n\nexport interface WorkflowIfNode {\n\ttype: 'if';\n\tcondition: string;\n}\n\nexport interface WorkflowLoopNode {\n\ttype: 'loop';\n\tarray: string;\n}\n\nexport interface WorkflowWaitNode {\n\ttype: 'wait';\n\tduration: string;\n}\n\nexport type WorkflowHttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';\n\nexport type ExecutionStatus = 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'WAITING';\n\nexport interface WorkflowExecution {\n\tid: string;\n\tworkflowId: string;\n\tbusinessId: string;\n\tstatus: ExecutionStatus;\n\tinput: Record<string, any>;\n\tnodeOutputs: Record<string, any>;\n\tcurrentNode?: string;\n\terror?: string;\n\tscheduledAt: number;\n\tstartedAt: number;\n\tcompletedAt?: number;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface Audience {\n\tid: string;\n\tbusinessId: string;\n\tkey: string;\n\taccess: Access;\n\tnodeIds: string[];\n\tprices: SubscriptionPrice[];\n\tstatus: Status;\n}\n\nexport interface AudienceAccessResponse {\n\thasAccess: boolean;\n\tsubscription?: Subscription;\n}\n\nexport interface AudienceSubscribeResponse {\n\tcheckoutUrl?: string;\n\tsubscription?: Subscription;\n}\n\nexport type BusinessEventAction =\n\t\n\t| { action: 'order_created' }\n\t| { action: 'order_status_changed'; data: { from: string; to: string } }\n\t| { action: 'order_payment_received'; data: { amount: number } }\n\t| { action: 'order_payment_failed'; data: { reason?: string } }\n\t| { action: 'order_refunded'; data: { amount: number; reason?: string } }\n\t| { action: 'order_shipped'; data: { tracking_url?: string } }\n\t| { action: 'order_completed' }\n\t| { action: 'order_cancelled'; data: { reason?: string } }\n\t\n\t| { action: 'reservation_created' }\n\t| { action: 'reservation_status_changed'; data: { from: string; to: string } }\n\t| { action: 'reservation_payment_received'; data: { amount: number } }\n\t| { action: 'reservation_payment_failed'; data: { reason?: string } }\n\t| { action: 'reservation_refunded'; data: { amount: number; reason?: string } }\n\t| { action: 'reservation_completed' }\n\t| { action: 'reservation_cancelled'; data: { reason?: string } };\n\nexport interface BusinessEvent {\n\tid: string;\n\tbusinessId: string;\n\tentity: string;\n\tpayload: BusinessEventAction;\n\tactor: string;\n\tcreatedAt: number;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/types/index.ts"],"names":["PaymentMethodType"],"mappings":";AA4CO,IAAK,iBAAA,qBAAAA,kBAAAA,KAAL;AACN,EAAAA,mBAAA,MAAA,CAAA,GAAO,MAAA;AACP,EAAAA,mBAAA,YAAA,CAAA,GAAa,aAAA;AACb,EAAAA,mBAAA,QAAA,CAAA,GAAS,QAAA;AAHE,EAAA,OAAAA,kBAAAA;AAAA,CAAA,EAAA,iBAAA,IAAA,EAAA","file":"types.js","sourcesContent":["export * from './api';\n\nexport interface PaymentRefund {\n\tid: string;\n\tentity: string;\n\ttotal: number;\n\tproviderRefundId?: string;\n\tstatus: string;\n\tcreatedAt: number;\n}\n\nexport interface Payment {\n\tcurrency: string;\n\tmarket: string;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttotal: number;\n\tpaid: number;\n\ttax?: {\n\t\tamount: number;\n\t\tmodeSnapshot?: string;\n\t\trateBps: number;\n\t\tlines: Array<{ rateBps: number; amount: number; label?: string; scope?: string }>;\n\t};\n\tpromoCode?: {\n\t\tid: string;\n\t\tcode: string;\n\t\ttype: string;\n\t\tvalue: number;\n\t};\n\ttype: PaymentMethodType;\n\tprovider?: {\n\t\tcustomerId: string;\n\t\tpaymentIntentId?: string;\n\t\tsubscriptionId?: string;\n\t\tpriceId?: string;\n\t};\n\trefunds: PaymentRefund[];\n\tzoneId?: string;\n\tpaymentMethodId?: string;\n\tshippingMethodId?: string;\n}\n\nexport enum PaymentMethodType {\n\tCash = \"CASH\",\n\tCreditCard = \"CREDIT_CARD\",\n\tPayPal = \"PAYPAL\",\n\t// Free REMOVED - handled with logic: if total == 0, skip payment\n\t// NOTE: Apple Pay and Google Pay are NOT separate PaymentMethodTypes\n\t// They are handled automatically by Stripe's Payment Element\n}\n\nexport interface PromoCodeValidation {\n\tpromoCodeId: string;\n\tcode: string;\n\tdiscounts: any[];\n\tconditions: any[];\n}\n\nexport interface Quote {\n\tmarket: string;\n\tzone: Zone;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttax: number;\n\ttotal: number;\n\tshippingMethod: ShippingMethod | null;\n\tpaymentMethod: PaymentMethod | null;\n\tpromoCode: PromoCodeValidation | null;\n\tpayment: Payment;\n\tchargeAmount: number;\n\tid?: string;\n\texpiresAt?: number;\n}\n\n/** Price for products and services (market-based, no provider fields) */\nexport interface Price {\n\tcurrency: string;\n\tmarket: string;\n\tamount: number;\n\tcompareAt?: number;\n}\n\n/** Interval period for subscription pricing */\nexport type IntervalPeriod = 'MONTH' | 'YEAR';\n\n/** Subscription interval configuration */\nexport interface SubscriptionInterval {\n\tperiod: IntervalPeriod;\n\tcount: number;\n}\n\n/** Price provider configuration (e.g., Stripe) */\nexport interface PriceProvider {\n\ttype: string;\n\tid: string;\n}\n\n/** Price for audiences/subscriptions (provider-based with interval) */\nexport interface SubscriptionPrice {\n\tcurrency: string;\n\tamount: number;\n\tcompareAt?: number;\n\tinterval?: SubscriptionInterval;\n\tproviders: PriceProvider[];\n}\n\n/**\n * Unified Location type used for addresses, shipping, and geo locations.\n * All fields are optional to support various use cases.\n */\nexport interface Location {\n\t// Identity/Contact\n\tname?: string | null;\n\tcompany?: string | null;\n\temail?: string | null;\n\tphone?: string | null;\n\n\t// Address\n\tstreet1?: string | null;\n\tstreet2?: string | null;\n\tcity?: string | null;\n\tstate?: string | null;\n\tpostalCode?: string | null;\n\tcountry?: string | null;\n\n\t// Geo\n\tcoordinates?: { lat: number; lon: number } | null;\n}\n\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;\n\tquantity: number;\n\taddedAt: number;\n}\n\nexport interface ReservationCartItem {\n\tid: string;\n\tserviceId: string;\n\tserviceName: string;\n\tdate: string;\n\tfrom: number;\n\tto: number;\n\ttimeText: string;\n\tproviderId?: string;\n\tblocks: any[];\n}\n\n/** Card payment processor - business picks ONE\n * Handles: Credit/Debit Cards, Apple Pay, Google Pay\n * Note: Wallet payments are controlled via Stripe Dashboard and detected automatically\n */\nexport interface CardProvider {\n\ttype: \"STRIPE\";\n\taccountId: string;\n\tcurrency: string;\n}\n\n/** Alternative payment providers - multiple allowed */\nexport interface AlternativeProvider {\n\ttype: \"PAYPAL\";\n\tmerchantId: string;\n\tclientId: string;\n\tcurrency: string;\n}\n\n/** @deprecated Use CardProvider instead */\nexport interface PaymentProviderConfig {\n\ttype: \"STRIPE\";\n\tpublicKey: string;\n\tsecretKey: string;\n\twebhookSecret: string;\n}\n\nexport interface AnalyticsConfig {\n\ttype: \"GA4\";\n\tmeasurementId: string;\n}\n\nexport interface ShippingWeightTier {\n\tupToGrams: number;\n\tamount: number;\n}\n\nexport interface PaymentMethod {\n\tid: string;\n\tname: Record<string, string>;\n\ttype: PaymentMethodType;\n}\n\nexport interface ShippingMethod {\n\tid: string;\n\tname: Record<string, string>;\n\ttaxable: boolean;\n\tetaText: string;\n\tfulfillmentCenterId?: string;\n\tamount: number;\n\tfreeAbove?: number;\n\tweightTiers?: ShippingWeightTier[];\n}\n\nexport interface FulfillmentCenter {\n\tid: string;\n\tkey: string;\n\tname: Record<string, string>;\n\tlocation: Location;\n\tisPickupLocation: boolean;\n}\n\nexport interface InventoryLevel {\n\tfulfillmentCenterId: string;\n\tavailable: number;\n\treserved: number;\n}\n\nexport type ZoneScope = \"ALL\" | \"ORDER\" | \"RESERVATION\";\n\nexport interface Zone {\n\tid: string;\n\tname: string;\n\tmarketId: string;\n\tscope: ZoneScope;\n\tcountries: string[];\n\tstates: string[];\n\tpostalCodes: string[];\n\ttaxBps: number;\n\tpaymentMethods: PaymentMethod[];\n\tshippingMethods: ShippingMethod[];\n}\n\nexport interface Market {\n\tid: string;\n\tcurrency: string;\n\ttaxMode: \"EXCLUSIVE\" | \"INCLUSIVE\";\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\tmarkets: Market[];\n\tzones: Zone[];\n\tfulfillmentCenters: FulfillmentCenter[];\n\tbuildHooks: string[];\n\twebhooks: any[];\n\t/** Card payment processor (handles cards + Apple Pay + Google Pay) */\n\tcardProvider?: CardProvider;\n\t/** Alternative payment providers (extensible for future) */\n\talternativeProviders?: AlternativeProvider[];\n\taiProvider?: any;\n\tanalytics?: AnalyticsConfig;\n\temails: BusinessEmails;\n}\n\nexport interface Subscription {\n\tid: string;\n\ttarget: string;\n\tplanId: string;\n\tpendingPlanId: string | null;\n\tpayment: any;\n\tstatus: SubscriptionStatus;\n\tendDate: number;\n\tusage: Record<string, any>;\n\ttoken: string;\n}\n\nexport interface Business {\n\tid: string;\n\tkey: string;\n\tnetworkKey: string | null;\n\ttimezone: string;\n\tconfigs?: BusinessConfig;\n\tsubscriptions?: Subscription[];\n\tstatus: Status;\n}\n\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}\n\nexport interface Block {\n\tid: string;\n\tkey: string;\n\ttype: string;\n\tproperties?: any;\n\tvalue?: any;\n}\n\nexport type BlockType =\n\t| \"TEXT\"\n\t| \"LOCALIZED_TEXT\"\n\t| \"NUMBER\"\n\t| \"BOOLEAN\"\n\t| \"BLOCK\"\n\t| \"RELATIONSHIP_ENTRY\"\n\t| \"RELATIONSHIP_MEDIA\"\n\t| \"MARKDOWN\"\n\t| \"EMAIL\"\n\t| \"PHONE\"\n\t| \"ADDRESS\";\n\nexport type AddressType = \"SHIPPING\" | \"BILLING\";\n\nexport interface EmailBlockProperties {}\n\nexport interface PhoneBlockProperties {}\n\nexport interface AddressBlockProperties {\n\taddressType: AddressType;\n}\n\n/** @deprecated Use Location instead */\nexport type GeoLocationValue = Location;\n\nexport interface EmailBlock extends Block {\n\ttype: \"EMAIL\";\n\tproperties: EmailBlockProperties;\n\tvalue: string | null;\n}\n\nexport interface PhoneBlock extends Block {\n\ttype: \"PHONE\";\n\tproperties: PhoneBlockProperties;\n\tvalue: string | null;\n}\n\nexport interface AddressBlock extends Block {\n\ttype: \"ADDRESS\";\n\tproperties: AddressBlockProperties;\n\tvalue: Location | null;\n}\n\nexport type Access = 'PUBLIC' | 'AUTHENTICATED' | 'PRIVATE';\n\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\tentity: string;\n\tmetadata?: string | null;\n\tuploadedAt: string;\n\tslug: Record<string, string>;\n}\n\nexport interface ApiResponse<T> {\n\tsuccess: boolean;\n\tdata?: T;\n\terror?: string;\n\tcursor?: string;\n\ttotal?: 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\nexport interface ReservationStoreState {\n\tcurrentStep: number;\n\ttotalSteps: number;\n\tsteps: Record<number, { name: string; labelKey: string }>;\n\tweekdays: string[];\n\tmonthYear: string;\n\tdays: any[];\n\tcurrent: Date;\n\tselectedDate: string | null;\n\tslots: any[];\n\tselectedSlot: any | null;\n\tselectedProvider: any | null;\n\tproviders: any[];\n\tloading: boolean;\n\tstartDate: string | null;\n\tendDate: string | null;\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\ttimezone: string;\n\ttzGroups: any;\n\titems: ReservationCartItem[];\n\tallowedPaymentMethods: string[];\n\tpaymentConfig: {\n\t\tprovider: CardProvider | null;\n\t\tenabled: boolean;\n\t};\n}\n\nexport type Status = 'DRAFT' | 'ACTIVE' | 'ARCHIVED';\n\nexport type OrderStatus = 'CREATED' | 'PENDING' | 'AUTHORIZED' | 'CONFIRMED' | 'SHIPPED' | 'COMPLETED' | 'CANCELLED' | 'FAILED';\n\nexport type ReservationStatus = 'CREATED' | 'PENDING' | 'AUTHORIZED' | 'CONFIRMED' | 'COMPLETED' | 'CANCELLED' | 'FAILED';\n\nexport type SubscriptionStatus = 'PENDING' | 'ACTIVE' | 'CANCELLATION_SCHEDULED' | 'CANCELLED' | 'EXPIRED';\n\nexport interface ReservationItem {\n\tid: string;\n\tserviceId: string;\n\tproviderId: string;\n\tbusinessId: string;\n\treservationId: string;\n\tuserId: string;\n\tfrom: number;\n\tto: number;\n\tblocks: Block[];\n\tprice: Price;\n}\n\nexport interface Reservation {\n\tid: string;\n\tnumber: string;\n\tuserId: string;\n\tblocks: Block[];\n\tbusinessId: string;\n\tstatus: ReservationStatus;\n\tserviceIds: string[];\n\tproviderIds: string[];\n\tpayment: Payment;\n\tbusiness?: Business;\n\tuser?: any;\n\titems: ReservationItem[];\n\tcreatedAt: number;\n\tlastModified: number;\n}\n\nexport interface Node {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tparentId?: string | null;\n\tblocks: Block[];\n\tstatus: Status;\n\tslug: Record<string, string>;\n\taccess: Access;\n\twriteAccess: Access;\n\temailSubject?: Record<string, string>;\n\tchildren: Node[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface ServiceDuration {\n\tduration: number;\n\tisPause?: boolean;\n}\n\nexport interface ServiceProvider {\n\tid: string;\n\tproviderId: string;\n\tworkingTime: {\n\t\tworkingDays: Array<{ day: string; workingHours: Array<{ from: number; to: number }> }>;\n\t\toutcastDates: Array<{ month: number; day: number; workingHours: Array<{ from: number; to: number }> }>;\n\t\tspecificDates: Array<{ date: number; workingHours: Array<{ from: number; to: number }> }>;\n\t};\n\tprovider?: Provider;\n}\n\nexport interface Service {\n\tid: string;\n\tkey: string;\n\tslug: Record<string, string>;\n\taccess: Access;\n\tbusinessId: string;\n\tprices: Price[];\n\tdurations: ServiceDuration[];\n\tblocks: Block[];\n\tnodeIds: string[];\n\tisApprovalRequired: boolean;\n\tproviders: ServiceProvider[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n\tstatus: Status;\n}\n\nexport interface ProviderTimelinePoint {\n\ttimestamp: number;\n\tconcurrent: number;\n}\n\nexport interface Provider {\n\tid: string;\n\tkey: string;\n\tslug: Record<string, string>;\n\taccess: Access;\n\tbusinessId: string;\n\tstatus: Status;\n\tconcurrentLimit: number;\n\tnodeIds: string[];\n\tblocks: Block[];\n\ttimeline: ProviderTimelinePoint[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface Workflow {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tsecret: string;\n\tstatus: Status;\n\tnodes: Record<string, WorkflowNode>;\n\tedges: WorkflowEdge[];\n\t\n\tschedule?: string;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface WorkflowEdge {\n\tid: string;\n\tsource: string;\n\tsourceOutput: string;\n\ttarget: string;\n}\n\nexport type WorkflowNode =\n\t| WorkflowTriggerNode\n\t| WorkflowHttpNode\n\t| WorkflowIfNode\n\t| WorkflowLoopNode\n\t| WorkflowWaitNode;\n\nexport interface WorkflowTriggerNode {\n\ttype: 'trigger';\n\tevent?: string;\n}\n\nexport interface WorkflowHttpNode {\n\ttype: 'http';\n\tmethod: WorkflowHttpMethod;\n\turl: string;\n\theaders?: Record<string, string>;\n\tbody?: any;\n\ttimeoutMs?: number;\n}\n\nexport interface WorkflowIfNode {\n\ttype: 'if';\n\tcondition: string;\n}\n\nexport interface WorkflowLoopNode {\n\ttype: 'loop';\n\tarray: string;\n}\n\nexport interface WorkflowWaitNode {\n\ttype: 'wait';\n\tduration: string;\n}\n\nexport type WorkflowHttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';\n\nexport type ExecutionStatus = 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'WAITING';\n\nexport interface WorkflowExecution {\n\tid: string;\n\tworkflowId: string;\n\tbusinessId: string;\n\tstatus: ExecutionStatus;\n\tinput: Record<string, any>;\n\tnodeOutputs: Record<string, any>;\n\tcurrentNode?: string;\n\terror?: string;\n\tscheduledAt: number;\n\tstartedAt: number;\n\tcompletedAt?: number;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface Audience {\n\tid: string;\n\tbusinessId: string;\n\tkey: string;\n\taccess: Access;\n\tnodeIds: string[];\n\tprices: SubscriptionPrice[];\n\tstatus: Status;\n}\n\nexport interface AudienceAccessResponse {\n\thasAccess: boolean;\n\tsubscription?: Subscription;\n}\n\nexport interface AudienceSubscribeResponse {\n\tcheckoutUrl?: string;\n\tsubscription?: Subscription;\n}\n\nexport type BusinessEventAction =\n\t\n\t| { action: 'order_created' }\n\t| { action: 'order_status_changed'; data: { from: string; to: string } }\n\t| { action: 'order_payment_received'; data: { amount: number } }\n\t| { action: 'order_payment_failed'; data: { reason?: string } }\n\t| { action: 'order_refunded'; data: { amount: number; reason?: string } }\n\t| { action: 'order_shipped'; data: { tracking_url?: string } }\n\t| { action: 'order_completed' }\n\t| { action: 'order_cancelled'; data: { reason?: string } }\n\t\n\t| { action: 'reservation_created' }\n\t| { action: 'reservation_status_changed'; data: { from: string; to: string } }\n\t| { action: 'reservation_payment_received'; data: { amount: number } }\n\t| { action: 'reservation_payment_failed'; data: { reason?: string } }\n\t| { action: 'reservation_refunded'; data: { amount: number; reason?: string } }\n\t| { action: 'reservation_completed' }\n\t| { action: 'reservation_cancelled'; data: { reason?: string } };\n\nexport interface BusinessEvent {\n\tid: string;\n\tbusinessId: string;\n\tentity: string;\n\tpayload: BusinessEventAction;\n\tactor: string;\n\tcreatedAt: number;\n}\n"]}
|