arky-sdk 0.4.47 → 0.4.48

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":["PaymentMethodType"],"mappings":";;;AA4CO,IAAK,iBAAA,qBAAAA,kBAAAA,KAAL;AACN,EAAAA,mBAAA,MAAA,CAAA,GAAO,MAAA;AACP,EAAAA,mBAAA,YAAA,CAAA,GAAa,aAAA;AAFF,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\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 * Full address for shipping, billing, and fulfillment centers.\n * Used for order addresses and shipping labels.\n */\nexport interface Address {\n\tname: string;\n\tcompany?: string | null;\n\tstreet1: string;\n\tstreet2?: string | null;\n\tcity: string;\n\tstate: string;\n\tpostalCode: string;\n\tcountry: string;\n\tphone?: string | null;\n\temail?: string | null;\n}\n\n/**\n * Simple geo location for CMS map/location blocks.\n * Just coordinates and an optional label for display.\n */\nexport interface GeoLocation {\n\tcoordinates?: { lat: number; lon: number } | null;\n\tlabel?: string | null;\n}\n\n/**\n * @deprecated Use Address for shipping/billing addresses, GeoLocation for map coordinates\n */\nexport type Location = Address & { coordinates?: { lat: number; lon: number } | null };\n\n/**\n * Used for zone matching - simplified location with optional fields.\n */\nexport interface ZoneLocation {\n\tcountry?: string | null;\n\tstate?: string | null;\n\tcity?: string | null;\n\tpostalCode?: string | 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\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: \"google_analytics4\";\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\t/** Ship-from address for shipping labels */\n\taddress: Address;\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\taiProvider?: any;\n\tanalytics?: AnalyticsConfig;\n\temails: BusinessEmails;\n\t/** Configured shipping providers (e.g., Shippo) */\n\tshippingProviders?: BusinessShippingProvider[];\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| \"geo_location\";\n\nexport interface GeoLocationBlockProperties {}\n\n/** @deprecated Use GeoLocation instead */\nexport type GeoLocationValue = GeoLocation;\n\nexport interface GeoLocationBlock extends Block {\n\ttype: \"geo_location\";\n\tproperties: GeoLocationBlockProperties;\n\tvalue: GeoLocation | null;\n}\n\nexport type Access = 'public' | '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\n// Shipping Types\n\n/** Shipping status for order fulfillment tracking */\nexport type ShippingStatus =\n\t| 'pending'\n\t| 'label_created'\n\t| 'in_transit'\n\t| 'out_for_delivery'\n\t| 'delivered'\n\t| 'failed'\n\t| 'returned';\n\n/** Order shipping information (legacy - kept for backward compatibility) */\nexport interface OrderShipping {\n\tcarrier: string;\n\tservice: string;\n\ttrackingNumber?: string | null;\n\ttrackingUrl?: string | null;\n\tlabelUrl?: string | null;\n\tstatus: ShippingStatus;\n}\n\n/** Line item in a shipment with quantity (for partial fulfillment) */\nexport interface ShipmentLine {\n\torderItemId: string;\n\tquantity: number;\n}\n\n/** Individual shipment for an order (ships from one fulfillment center) */\nexport interface Shipment {\n\tid: string;\n\tfulfillmentCenterId: string;\n\tlines: ShipmentLine[]; // OrderItem IDs + quantities in this shipment\n\tcarrier?: string | null; // Set when label purchased\n\tservice?: string | null;\n\ttrackingNumber?: string | null;\n\ttrackingUrl?: string | null;\n\tlabelUrl?: string | null;\n\tstatus: ShippingStatus;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\n/** Shipping rate from provider */\nexport interface ShippingRate {\n\tid: string;\n\tprovider: string;\n\tcarrier: string;\n\tservice: string;\n\tdisplayName: string;\n\tamount: number;\n\tcurrency: string;\n\testimatedDays?: number | null;\n}\n\n/**\n * @deprecated Use Address instead\n * Shipping address for rate requests\n */\nexport type ShippingAddress = Address;\n\n/** Parcel dimensions for shipping */\nexport interface Parcel {\n\tlength: number;\n\twidth: number;\n\theight: number;\n\tweight: number;\n\tdistanceUnit: 'in' | 'cm';\n\tmassUnit: 'oz' | 'lb' | 'g' | 'kg';\n}\n\n/** Result from purchasing a shipping label */\nexport interface PurchaseLabelResult {\n\ttrackingNumber: string;\n\ttrackingUrl?: string | null;\n\tlabelUrl: string;\n\tcarrier: string;\n\tservice: string;\n}\n\n/** Result from ship operation */\nexport interface ShipResult {\n\tshipmentId: string;\n\ttrackingNumber: string;\n\ttrackingUrl?: string | null;\n\tlabelUrl: string;\n}\n\n/** Individual item in a customs declaration */\nexport interface CustomsItem {\n\tdescription: string;\n\tquantity: number;\n\tnetWeight: string;\n\tmassUnit: string;\n\tvalueAmount: string;\n\tvalueCurrency: string;\n\toriginCountry: string;\n\ttariffNumber?: string | null;\n}\n\n/** Customs declaration for international shipments */\nexport interface CustomsDeclaration {\n\tcontentsType: string; // \"MERCHANDISE\" | \"GIFT\" | \"SAMPLE\" | \"DOCUMENTS\" | \"RETURN\"\n\tcontentsExplanation?: string | null;\n\tnonDeliveryOption: string; // \"RETURN\" | \"ABANDON\"\n\tcertify: boolean;\n\tcertifySigner: string;\n\titems: CustomsItem[];\n}\n\n/** Shipping provider status */\nexport type ShippingProviderStatus = 'active' | 'inactive';\n\n/** Shippo shipping provider configuration */\nexport interface ShippingProviderShippo {\n\ttype: 'shippo';\n\tid: string;\n\tstatus: ShippingProviderStatus;\n\tapiToken: string;\n}\n\n/** Business shipping provider (union type for extensibility) */\nexport type BusinessShippingProvider = ShippingProviderShippo;\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;AAFF,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\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 * Full address for shipping, billing, and fulfillment centers.\n * Used for order addresses and shipping labels.\n */\nexport interface Address {\n\tname: string;\n\tcompany?: string | null;\n\tstreet1: string;\n\tstreet2?: string | null;\n\tcity: string;\n\tstate: string;\n\tpostalCode: string;\n\tcountry: string;\n\tphone?: string | null;\n\temail?: string | null;\n}\n\n/**\n * Simple geo location for CMS map/location blocks.\n * Just coordinates and an optional label for display.\n */\nexport interface GeoLocation {\n\tcoordinates?: { lat: number; lon: number } | null;\n\tlabel?: string | null;\n}\n\n/**\n * @deprecated Use Address for shipping/billing addresses, GeoLocation for map coordinates\n */\nexport type Location = Address & { coordinates?: { lat: number; lon: number } | null };\n\n/**\n * Used for zone matching - simplified location with optional fields.\n */\nexport interface ZoneLocation {\n\tcountry?: string | null;\n\tstate?: string | null;\n\tcity?: string | null;\n\tpostalCode?: string | 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\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: \"google_analytics4\";\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\t/** Ship-from address for shipping labels */\n\taddress: Address;\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\taiProvider?: any;\n\tanalytics?: AnalyticsConfig;\n\temails: BusinessEmails;\n\t/** Configured shipping providers (e.g., Shippo) */\n\tshippingProviders?: BusinessShippingProvider[];\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| \"geo_location\";\n\nexport interface GeoLocationBlockProperties {}\n\n/** @deprecated Use GeoLocation instead */\nexport type GeoLocationValue = GeoLocation;\n\nexport interface GeoLocationBlock extends Block {\n\ttype: \"geo_location\";\n\tproperties: GeoLocationBlockProperties;\n\tvalue: GeoLocation | null;\n}\n\nexport type Access = 'public' | '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 EventAction =\n\t// Order events\n\t| { action: 'order_created' }\n\t| { action: 'order_updated' }\n\t| { action: 'order_status_changed'; data: { from: string; to: string } }\n\t| { action: 'order_payment_received'; data: { amount: number; currency: string } }\n\t| { action: 'order_payment_failed'; data: { reason?: string } }\n\t| { action: 'order_refunded'; data: { amount: number; currency: string; 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// Reservation events\n\t| { action: 'reservation_created' }\n\t| { action: 'reservation_updated' }\n\t| { action: 'reservation_status_changed'; data: { from: string; to: string } }\n\t| { action: 'reservation_payment_received'; data: { amount: number; currency: string } }\n\t| { action: 'reservation_payment_failed'; data: { reason?: string } }\n\t| { action: 'reservation_refunded'; data: { amount: number; currency: string; reason?: string } }\n\t| { action: 'reservation_completed' }\n\t| { action: 'reservation_cancelled'; data: { reason?: string } }\n\t// Product events\n\t| { action: 'product_created' }\n\t| { action: 'product_updated' }\n\t| { action: 'product_deleted' }\n\t// Node events\n\t| { action: 'node_created' }\n\t| { action: 'node_updated' }\n\t| { action: 'node_deleted' }\n\t// Provider events\n\t| { action: 'provider_created' }\n\t| { action: 'provider_updated' }\n\t| { action: 'provider_deleted' }\n\t// Service events\n\t| { action: 'service_created' }\n\t| { action: 'service_updated' }\n\t| { action: 'service_deleted' }\n\t// Account events\n\t| { action: 'account_created' }\n\t| { action: 'account_updated' }\n\t| { action: 'account_deleted' }\n\t// Media events\n\t| { action: 'media_created' }\n\t| { action: 'media_deleted' }\n\t// Business events\n\t| { action: 'business_created' }\n\t| { action: 'business_updated' }\n\t| { action: 'business_deleted' }\n\t// Audience events\n\t| { action: 'audience_created' }\n\t| { action: 'audience_updated' };\n\nexport interface Event {\n\tid: string;\n\tentity: string;\n\tevent: EventAction;\n\tactor: string;\n\tcreatedAt: number;\n}\n\n// Shipping Types\n\n/** Shipping status for order fulfillment tracking */\nexport type ShippingStatus =\n\t| 'pending'\n\t| 'label_created'\n\t| 'in_transit'\n\t| 'out_for_delivery'\n\t| 'delivered'\n\t| 'failed'\n\t| 'returned';\n\n/** Order shipping information (legacy - kept for backward compatibility) */\nexport interface OrderShipping {\n\tcarrier: string;\n\tservice: string;\n\ttrackingNumber?: string | null;\n\ttrackingUrl?: string | null;\n\tlabelUrl?: string | null;\n\tstatus: ShippingStatus;\n}\n\n/** Line item in a shipment with quantity (for partial fulfillment) */\nexport interface ShipmentLine {\n\torderItemId: string;\n\tquantity: number;\n}\n\n/** Individual shipment for an order (ships from one fulfillment center) */\nexport interface Shipment {\n\tid: string;\n\tfulfillmentCenterId: string;\n\tlines: ShipmentLine[]; // OrderItem IDs + quantities in this shipment\n\tcarrier?: string | null; // Set when label purchased\n\tservice?: string | null;\n\ttrackingNumber?: string | null;\n\ttrackingUrl?: string | null;\n\tlabelUrl?: string | null;\n\tstatus: ShippingStatus;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\n/** Shipping rate from provider */\nexport interface ShippingRate {\n\tid: string;\n\tprovider: string;\n\tcarrier: string;\n\tservice: string;\n\tdisplayName: string;\n\tamount: number;\n\tcurrency: string;\n\testimatedDays?: number | null;\n}\n\n/**\n * @deprecated Use Address instead\n * Shipping address for rate requests\n */\nexport type ShippingAddress = Address;\n\n/** Parcel dimensions for shipping */\nexport interface Parcel {\n\tlength: number;\n\twidth: number;\n\theight: number;\n\tweight: number;\n\tdistanceUnit: 'in' | 'cm';\n\tmassUnit: 'oz' | 'lb' | 'g' | 'kg';\n}\n\n/** Result from purchasing a shipping label */\nexport interface PurchaseLabelResult {\n\ttrackingNumber: string;\n\ttrackingUrl?: string | null;\n\tlabelUrl: string;\n\tcarrier: string;\n\tservice: string;\n}\n\n/** Result from ship operation */\nexport interface ShipResult {\n\tshipmentId: string;\n\ttrackingNumber: string;\n\ttrackingUrl?: string | null;\n\tlabelUrl: string;\n}\n\n/** Individual item in a customs declaration */\nexport interface CustomsItem {\n\tdescription: string;\n\tquantity: number;\n\tnetWeight: string;\n\tmassUnit: string;\n\tvalueAmount: string;\n\tvalueCurrency: string;\n\toriginCountry: string;\n\ttariffNumber?: string | null;\n}\n\n/** Customs declaration for international shipments */\nexport interface CustomsDeclaration {\n\tcontentsType: string; // \"MERCHANDISE\" | \"GIFT\" | \"SAMPLE\" | \"DOCUMENTS\" | \"RETURN\"\n\tcontentsExplanation?: string | null;\n\tnonDeliveryOption: string; // \"RETURN\" | \"ABANDON\"\n\tcertify: boolean;\n\tcertifySigner: string;\n\titems: CustomsItem[];\n}\n\n/** Shipping provider status */\nexport type ShippingProviderStatus = 'active' | 'inactive';\n\n/** Shippo shipping provider configuration */\nexport interface ShippingProviderShippo {\n\ttype: 'shippo';\n\tid: string;\n\tstatus: ShippingProviderStatus;\n\tapiToken: string;\n}\n\n/** Business shipping provider (union type for extensibility) */\nexport type BusinessShippingProvider = ShippingProviderShippo;\n"]}
package/dist/types.d.cts CHANGED
@@ -560,8 +560,10 @@ interface AudienceSubscribeResponse {
560
560
  checkoutUrl?: string;
561
561
  subscription?: Subscription;
562
562
  }
563
- type BusinessEventAction = {
563
+ type EventAction = {
564
564
  action: 'order_created';
565
+ } | {
566
+ action: 'order_updated';
565
567
  } | {
566
568
  action: 'order_status_changed';
567
569
  data: {
@@ -572,6 +574,7 @@ type BusinessEventAction = {
572
574
  action: 'order_payment_received';
573
575
  data: {
574
576
  amount: number;
577
+ currency: string;
575
578
  };
576
579
  } | {
577
580
  action: 'order_payment_failed';
@@ -582,6 +585,7 @@ type BusinessEventAction = {
582
585
  action: 'order_refunded';
583
586
  data: {
584
587
  amount: number;
588
+ currency: string;
585
589
  reason?: string;
586
590
  };
587
591
  } | {
@@ -598,6 +602,8 @@ type BusinessEventAction = {
598
602
  };
599
603
  } | {
600
604
  action: 'reservation_created';
605
+ } | {
606
+ action: 'reservation_updated';
601
607
  } | {
602
608
  action: 'reservation_status_changed';
603
609
  data: {
@@ -608,6 +614,7 @@ type BusinessEventAction = {
608
614
  action: 'reservation_payment_received';
609
615
  data: {
610
616
  amount: number;
617
+ currency: string;
611
618
  };
612
619
  } | {
613
620
  action: 'reservation_payment_failed';
@@ -618,6 +625,7 @@ type BusinessEventAction = {
618
625
  action: 'reservation_refunded';
619
626
  data: {
620
627
  amount: number;
628
+ currency: string;
621
629
  reason?: string;
622
630
  };
623
631
  } | {
@@ -627,12 +635,55 @@ type BusinessEventAction = {
627
635
  data: {
628
636
  reason?: string;
629
637
  };
638
+ } | {
639
+ action: 'product_created';
640
+ } | {
641
+ action: 'product_updated';
642
+ } | {
643
+ action: 'product_deleted';
644
+ } | {
645
+ action: 'node_created';
646
+ } | {
647
+ action: 'node_updated';
648
+ } | {
649
+ action: 'node_deleted';
650
+ } | {
651
+ action: 'provider_created';
652
+ } | {
653
+ action: 'provider_updated';
654
+ } | {
655
+ action: 'provider_deleted';
656
+ } | {
657
+ action: 'service_created';
658
+ } | {
659
+ action: 'service_updated';
660
+ } | {
661
+ action: 'service_deleted';
662
+ } | {
663
+ action: 'account_created';
664
+ } | {
665
+ action: 'account_updated';
666
+ } | {
667
+ action: 'account_deleted';
668
+ } | {
669
+ action: 'media_created';
670
+ } | {
671
+ action: 'media_deleted';
672
+ } | {
673
+ action: 'business_created';
674
+ } | {
675
+ action: 'business_updated';
676
+ } | {
677
+ action: 'business_deleted';
678
+ } | {
679
+ action: 'audience_created';
680
+ } | {
681
+ action: 'audience_updated';
630
682
  };
631
- interface BusinessEvent {
683
+ interface Event {
632
684
  id: string;
633
- businessId: string;
634
685
  entity: string;
635
- payload: BusinessEventAction;
686
+ event: EventAction;
636
687
  actor: string;
637
688
  createdAt: number;
638
689
  }
@@ -1448,14 +1499,14 @@ interface RevokeAudienceSubscriptionParams {
1448
1499
  id: string;
1449
1500
  accountId: string;
1450
1501
  }
1451
- interface GetBusinessEventsParams {
1502
+ interface GetEventsParams {
1452
1503
  entity: string;
1453
1504
  limit?: number;
1454
1505
  cursor?: string;
1455
1506
  }
1456
- interface UpdateBusinessEventParams {
1507
+ interface UpdateEventParams {
1457
1508
  eventId: string;
1458
- payload: BusinessEventAction;
1509
+ event: EventAction;
1459
1510
  }
1460
1511
  interface ConnectStripeParams {
1461
1512
  businessId: string;
@@ -1483,4 +1534,4 @@ interface ShipParams {
1483
1534
  lines: ShipmentLine[];
1484
1535
  }
1485
1536
 
1486
- export { type Access, type AccountSubscribeParams, type AddPhoneNumberParams, type Address, type AnalyticsConfig, type ApiResponse, type Audience, type AudienceAccessResponse, type AudienceSubscribeResponse, type AudienceSubscriber, type Block, type BlockType, type BulkScheduleParams, type Business, type BusinessConfig, type BusinessEmails, type BusinessEvent, type BusinessEventAction, type BusinessRole, type BusinessShippingProvider, type CardProvider, type Condition, type ConnectStripeParams, type CreateAudienceParams, type CreateBusinessParams, type CreateNodeParams, type CreateOrderParams, type CreatePortalSessionParams, type CreateProductParams, type CreatePromoCodeParams, type CreateProviderParams, type CreateReservationParams, type CreateServiceParams, type CreateWorkflowParams, type CustomsDeclaration, type CustomsItem, type DayAvailability, type DeleteAccountParams, type DeleteAudienceParams, type DeleteBusinessMediaParams, type DeleteBusinessParams, type DeleteNodeParams, type DeleteProductParams, type DeletePromoCodeParams, type DeleteProviderParams, type DeleteServiceParams, type DeleteWorkflowParams, type DisconnectStripeParams, type Discount, type EshopCartItem, type EshopItem, type EshopStoreState, type ExecutionStatus, type FulfillmentCenter, type GenerateBlocksParams, type GeoLocation, type GeoLocationBlock, type GeoLocationBlockProperties, type GeoLocationValue, type GetAnalyticsHealthParams, type GetAnalyticsParams, type GetAudienceParams, type GetAudienceSubscribersParams, type GetAudiencesParams, type GetAvailabilityParams, type GetBusinessEventsParams, type GetBusinessMediaParams, type GetBusinessMediaParams2, type GetBusinessParams, type GetBusinessParentsParams, type GetBusinessServiceWorkingTimeParams, type GetBusinessesParams, type GetDeliveryStatsParams, type GetMeParams, type GetNodeChildrenParams, type GetNodeParams, type GetNodesParams, type GetOrderParams, type GetOrdersParams, type GetProductParams, type GetProductsParams, type GetPromoCodeParams, type GetPromoCodesParams, type GetProviderParams, type GetProvidersParams, type GetQuoteParams, type GetReservationParams, type GetReservationQuoteParams, type GetServiceParams, type GetServicesParams, type GetShippingRatesParams, type GetSlotsForDateParams, type GetSubscriptionParams, type GetSubscriptionPlansParams, type GetVariableMetadataParams, type GetWorkflowParams, type GetWorkflowsParams, type HandleInvitationParams, type IntervalPeriod, type InventoryLevel, type InviteUserParams, type Language, type Location, type LoginAccountParams, type LogoutParams, type MagicLinkRequestParams, type MagicLinkVerifyParams, type Market, type Media, type MediaResolution, type Node, type OrderCheckoutParams, type OrderShipping, type OrderStatus, type OutcastDate, type PaginatedResponse, type Parcel, type Payment, type PaymentMethod, PaymentMethodType, type PaymentProviderConfig, type PaymentRefund, type PhoneNumberConfirmParams, type Price, type PriceProvider, type ProcessRefundParams, type PromoCodeValidation, type Provider, type ProviderTimelinePoint, type ProviderWithTimeline, type PurchaseLabelResult, type Quote, type RequestOptions, type Reservation, type ReservationCartItem, type ReservationCheckoutParams, type ReservationItem, type ReservationQuoteItem, type ReservationStatus, type ReservationStoreState, type RevokeAudienceSubscriptionParams, type SearchAccountsParams, type SearchReservationsParams, type Service, type ServiceDuration, type ServiceProvider, type ServiceProviderInput, type SetupAnalyticsParams, type ShipParams, type ShipResult, type Shipment, type ShipmentLine, type ShippingAddress, type ShippingMethod, type ShippingProviderShippo, type ShippingProviderStatus, type ShippingRate, type ShippingStatus, type ShippingWeightTier, type Slot, type SpecificDate, type Status, type SubscribeAudienceParams, type SubscribeParams, type Subscription, type SubscriptionInterval, type SubscriptionPrice, type SubscriptionStatus, type SystemTemplateKey, type TestWebhookParams, type TimelinePoint, type TrackEmailOpenParams, type TriggerBuildsParams, type TriggerWorkflowParams, type UpdateAccountProfileParams, type UpdateAudienceParams, type UpdateBusinessEventParams, type UpdateBusinessParams, type UpdateMediaParams, type UpdateNodeParams, type UpdateNotificationsParams, type UpdateOrderParams, type UpdateProductParams, type UpdatePromoCodeParams, type UpdateProviderParams, type UpdateReservationParams, type UpdateServiceParams, type UpdateWorkflowParams, type UploadBusinessMediaParams, type Workflow, type WorkflowEdge, type WorkflowExecution, type WorkflowHttpMethod, type WorkflowHttpNode, type WorkflowIfNode, type WorkflowLoopNode, type WorkflowNode, type WorkflowTriggerNode, type WorkflowWaitNode, type WorkingDay, type WorkingHour, type WorkingTime, type Zone, type ZoneLocation, type ZoneScope };
1537
+ export { type Access, type AccountSubscribeParams, type AddPhoneNumberParams, type Address, type AnalyticsConfig, type ApiResponse, type Audience, type AudienceAccessResponse, type AudienceSubscribeResponse, type AudienceSubscriber, type Block, type BlockType, type BulkScheduleParams, type Business, type BusinessConfig, type BusinessEmails, type BusinessRole, type BusinessShippingProvider, type CardProvider, type Condition, type ConnectStripeParams, type CreateAudienceParams, type CreateBusinessParams, type CreateNodeParams, type CreateOrderParams, type CreatePortalSessionParams, type CreateProductParams, type CreatePromoCodeParams, type CreateProviderParams, type CreateReservationParams, type CreateServiceParams, type CreateWorkflowParams, type CustomsDeclaration, type CustomsItem, type DayAvailability, type DeleteAccountParams, type DeleteAudienceParams, type DeleteBusinessMediaParams, type DeleteBusinessParams, type DeleteNodeParams, type DeleteProductParams, type DeletePromoCodeParams, type DeleteProviderParams, type DeleteServiceParams, type DeleteWorkflowParams, type DisconnectStripeParams, type Discount, type EshopCartItem, type EshopItem, type EshopStoreState, type Event, type EventAction, type ExecutionStatus, type FulfillmentCenter, type GenerateBlocksParams, type GeoLocation, type GeoLocationBlock, type GeoLocationBlockProperties, type GeoLocationValue, type GetAnalyticsHealthParams, type GetAnalyticsParams, type GetAudienceParams, type GetAudienceSubscribersParams, type GetAudiencesParams, type GetAvailabilityParams, type GetBusinessMediaParams, type GetBusinessMediaParams2, type GetBusinessParams, type GetBusinessParentsParams, type GetBusinessServiceWorkingTimeParams, type GetBusinessesParams, type GetDeliveryStatsParams, type GetEventsParams, type GetMeParams, type GetNodeChildrenParams, type GetNodeParams, type GetNodesParams, type GetOrderParams, type GetOrdersParams, type GetProductParams, type GetProductsParams, type GetPromoCodeParams, type GetPromoCodesParams, type GetProviderParams, type GetProvidersParams, type GetQuoteParams, type GetReservationParams, type GetReservationQuoteParams, type GetServiceParams, type GetServicesParams, type GetShippingRatesParams, type GetSlotsForDateParams, type GetSubscriptionParams, type GetSubscriptionPlansParams, type GetVariableMetadataParams, type GetWorkflowParams, type GetWorkflowsParams, type HandleInvitationParams, type IntervalPeriod, type InventoryLevel, type InviteUserParams, type Language, type Location, type LoginAccountParams, type LogoutParams, type MagicLinkRequestParams, type MagicLinkVerifyParams, type Market, type Media, type MediaResolution, type Node, type OrderCheckoutParams, type OrderShipping, type OrderStatus, type OutcastDate, type PaginatedResponse, type Parcel, type Payment, type PaymentMethod, PaymentMethodType, type PaymentProviderConfig, type PaymentRefund, type PhoneNumberConfirmParams, type Price, type PriceProvider, type ProcessRefundParams, type PromoCodeValidation, type Provider, type ProviderTimelinePoint, type ProviderWithTimeline, type PurchaseLabelResult, type Quote, type RequestOptions, type Reservation, type ReservationCartItem, type ReservationCheckoutParams, type ReservationItem, type ReservationQuoteItem, type ReservationStatus, type ReservationStoreState, type RevokeAudienceSubscriptionParams, type SearchAccountsParams, type SearchReservationsParams, type Service, type ServiceDuration, type ServiceProvider, type ServiceProviderInput, type SetupAnalyticsParams, type ShipParams, type ShipResult, type Shipment, type ShipmentLine, type ShippingAddress, type ShippingMethod, type ShippingProviderShippo, type ShippingProviderStatus, type ShippingRate, type ShippingStatus, type ShippingWeightTier, type Slot, type SpecificDate, type Status, type SubscribeAudienceParams, type SubscribeParams, type Subscription, type SubscriptionInterval, type SubscriptionPrice, type SubscriptionStatus, type SystemTemplateKey, type TestWebhookParams, type TimelinePoint, type TrackEmailOpenParams, type TriggerBuildsParams, type TriggerWorkflowParams, type UpdateAccountProfileParams, type UpdateAudienceParams, type UpdateBusinessParams, type UpdateEventParams, type UpdateMediaParams, type UpdateNodeParams, type UpdateNotificationsParams, type UpdateOrderParams, type UpdateProductParams, type UpdatePromoCodeParams, type UpdateProviderParams, type UpdateReservationParams, type UpdateServiceParams, type UpdateWorkflowParams, type UploadBusinessMediaParams, type Workflow, type WorkflowEdge, type WorkflowExecution, type WorkflowHttpMethod, type WorkflowHttpNode, type WorkflowIfNode, type WorkflowLoopNode, type WorkflowNode, type WorkflowTriggerNode, type WorkflowWaitNode, type WorkingDay, type WorkingHour, type WorkingTime, type Zone, type ZoneLocation, type ZoneScope };
package/dist/types.d.ts CHANGED
@@ -560,8 +560,10 @@ interface AudienceSubscribeResponse {
560
560
  checkoutUrl?: string;
561
561
  subscription?: Subscription;
562
562
  }
563
- type BusinessEventAction = {
563
+ type EventAction = {
564
564
  action: 'order_created';
565
+ } | {
566
+ action: 'order_updated';
565
567
  } | {
566
568
  action: 'order_status_changed';
567
569
  data: {
@@ -572,6 +574,7 @@ type BusinessEventAction = {
572
574
  action: 'order_payment_received';
573
575
  data: {
574
576
  amount: number;
577
+ currency: string;
575
578
  };
576
579
  } | {
577
580
  action: 'order_payment_failed';
@@ -582,6 +585,7 @@ type BusinessEventAction = {
582
585
  action: 'order_refunded';
583
586
  data: {
584
587
  amount: number;
588
+ currency: string;
585
589
  reason?: string;
586
590
  };
587
591
  } | {
@@ -598,6 +602,8 @@ type BusinessEventAction = {
598
602
  };
599
603
  } | {
600
604
  action: 'reservation_created';
605
+ } | {
606
+ action: 'reservation_updated';
601
607
  } | {
602
608
  action: 'reservation_status_changed';
603
609
  data: {
@@ -608,6 +614,7 @@ type BusinessEventAction = {
608
614
  action: 'reservation_payment_received';
609
615
  data: {
610
616
  amount: number;
617
+ currency: string;
611
618
  };
612
619
  } | {
613
620
  action: 'reservation_payment_failed';
@@ -618,6 +625,7 @@ type BusinessEventAction = {
618
625
  action: 'reservation_refunded';
619
626
  data: {
620
627
  amount: number;
628
+ currency: string;
621
629
  reason?: string;
622
630
  };
623
631
  } | {
@@ -627,12 +635,55 @@ type BusinessEventAction = {
627
635
  data: {
628
636
  reason?: string;
629
637
  };
638
+ } | {
639
+ action: 'product_created';
640
+ } | {
641
+ action: 'product_updated';
642
+ } | {
643
+ action: 'product_deleted';
644
+ } | {
645
+ action: 'node_created';
646
+ } | {
647
+ action: 'node_updated';
648
+ } | {
649
+ action: 'node_deleted';
650
+ } | {
651
+ action: 'provider_created';
652
+ } | {
653
+ action: 'provider_updated';
654
+ } | {
655
+ action: 'provider_deleted';
656
+ } | {
657
+ action: 'service_created';
658
+ } | {
659
+ action: 'service_updated';
660
+ } | {
661
+ action: 'service_deleted';
662
+ } | {
663
+ action: 'account_created';
664
+ } | {
665
+ action: 'account_updated';
666
+ } | {
667
+ action: 'account_deleted';
668
+ } | {
669
+ action: 'media_created';
670
+ } | {
671
+ action: 'media_deleted';
672
+ } | {
673
+ action: 'business_created';
674
+ } | {
675
+ action: 'business_updated';
676
+ } | {
677
+ action: 'business_deleted';
678
+ } | {
679
+ action: 'audience_created';
680
+ } | {
681
+ action: 'audience_updated';
630
682
  };
631
- interface BusinessEvent {
683
+ interface Event {
632
684
  id: string;
633
- businessId: string;
634
685
  entity: string;
635
- payload: BusinessEventAction;
686
+ event: EventAction;
636
687
  actor: string;
637
688
  createdAt: number;
638
689
  }
@@ -1448,14 +1499,14 @@ interface RevokeAudienceSubscriptionParams {
1448
1499
  id: string;
1449
1500
  accountId: string;
1450
1501
  }
1451
- interface GetBusinessEventsParams {
1502
+ interface GetEventsParams {
1452
1503
  entity: string;
1453
1504
  limit?: number;
1454
1505
  cursor?: string;
1455
1506
  }
1456
- interface UpdateBusinessEventParams {
1507
+ interface UpdateEventParams {
1457
1508
  eventId: string;
1458
- payload: BusinessEventAction;
1509
+ event: EventAction;
1459
1510
  }
1460
1511
  interface ConnectStripeParams {
1461
1512
  businessId: string;
@@ -1483,4 +1534,4 @@ interface ShipParams {
1483
1534
  lines: ShipmentLine[];
1484
1535
  }
1485
1536
 
1486
- export { type Access, type AccountSubscribeParams, type AddPhoneNumberParams, type Address, type AnalyticsConfig, type ApiResponse, type Audience, type AudienceAccessResponse, type AudienceSubscribeResponse, type AudienceSubscriber, type Block, type BlockType, type BulkScheduleParams, type Business, type BusinessConfig, type BusinessEmails, type BusinessEvent, type BusinessEventAction, type BusinessRole, type BusinessShippingProvider, type CardProvider, type Condition, type ConnectStripeParams, type CreateAudienceParams, type CreateBusinessParams, type CreateNodeParams, type CreateOrderParams, type CreatePortalSessionParams, type CreateProductParams, type CreatePromoCodeParams, type CreateProviderParams, type CreateReservationParams, type CreateServiceParams, type CreateWorkflowParams, type CustomsDeclaration, type CustomsItem, type DayAvailability, type DeleteAccountParams, type DeleteAudienceParams, type DeleteBusinessMediaParams, type DeleteBusinessParams, type DeleteNodeParams, type DeleteProductParams, type DeletePromoCodeParams, type DeleteProviderParams, type DeleteServiceParams, type DeleteWorkflowParams, type DisconnectStripeParams, type Discount, type EshopCartItem, type EshopItem, type EshopStoreState, type ExecutionStatus, type FulfillmentCenter, type GenerateBlocksParams, type GeoLocation, type GeoLocationBlock, type GeoLocationBlockProperties, type GeoLocationValue, type GetAnalyticsHealthParams, type GetAnalyticsParams, type GetAudienceParams, type GetAudienceSubscribersParams, type GetAudiencesParams, type GetAvailabilityParams, type GetBusinessEventsParams, type GetBusinessMediaParams, type GetBusinessMediaParams2, type GetBusinessParams, type GetBusinessParentsParams, type GetBusinessServiceWorkingTimeParams, type GetBusinessesParams, type GetDeliveryStatsParams, type GetMeParams, type GetNodeChildrenParams, type GetNodeParams, type GetNodesParams, type GetOrderParams, type GetOrdersParams, type GetProductParams, type GetProductsParams, type GetPromoCodeParams, type GetPromoCodesParams, type GetProviderParams, type GetProvidersParams, type GetQuoteParams, type GetReservationParams, type GetReservationQuoteParams, type GetServiceParams, type GetServicesParams, type GetShippingRatesParams, type GetSlotsForDateParams, type GetSubscriptionParams, type GetSubscriptionPlansParams, type GetVariableMetadataParams, type GetWorkflowParams, type GetWorkflowsParams, type HandleInvitationParams, type IntervalPeriod, type InventoryLevel, type InviteUserParams, type Language, type Location, type LoginAccountParams, type LogoutParams, type MagicLinkRequestParams, type MagicLinkVerifyParams, type Market, type Media, type MediaResolution, type Node, type OrderCheckoutParams, type OrderShipping, type OrderStatus, type OutcastDate, type PaginatedResponse, type Parcel, type Payment, type PaymentMethod, PaymentMethodType, type PaymentProviderConfig, type PaymentRefund, type PhoneNumberConfirmParams, type Price, type PriceProvider, type ProcessRefundParams, type PromoCodeValidation, type Provider, type ProviderTimelinePoint, type ProviderWithTimeline, type PurchaseLabelResult, type Quote, type RequestOptions, type Reservation, type ReservationCartItem, type ReservationCheckoutParams, type ReservationItem, type ReservationQuoteItem, type ReservationStatus, type ReservationStoreState, type RevokeAudienceSubscriptionParams, type SearchAccountsParams, type SearchReservationsParams, type Service, type ServiceDuration, type ServiceProvider, type ServiceProviderInput, type SetupAnalyticsParams, type ShipParams, type ShipResult, type Shipment, type ShipmentLine, type ShippingAddress, type ShippingMethod, type ShippingProviderShippo, type ShippingProviderStatus, type ShippingRate, type ShippingStatus, type ShippingWeightTier, type Slot, type SpecificDate, type Status, type SubscribeAudienceParams, type SubscribeParams, type Subscription, type SubscriptionInterval, type SubscriptionPrice, type SubscriptionStatus, type SystemTemplateKey, type TestWebhookParams, type TimelinePoint, type TrackEmailOpenParams, type TriggerBuildsParams, type TriggerWorkflowParams, type UpdateAccountProfileParams, type UpdateAudienceParams, type UpdateBusinessEventParams, type UpdateBusinessParams, type UpdateMediaParams, type UpdateNodeParams, type UpdateNotificationsParams, type UpdateOrderParams, type UpdateProductParams, type UpdatePromoCodeParams, type UpdateProviderParams, type UpdateReservationParams, type UpdateServiceParams, type UpdateWorkflowParams, type UploadBusinessMediaParams, type Workflow, type WorkflowEdge, type WorkflowExecution, type WorkflowHttpMethod, type WorkflowHttpNode, type WorkflowIfNode, type WorkflowLoopNode, type WorkflowNode, type WorkflowTriggerNode, type WorkflowWaitNode, type WorkingDay, type WorkingHour, type WorkingTime, type Zone, type ZoneLocation, type ZoneScope };
1537
+ export { type Access, type AccountSubscribeParams, type AddPhoneNumberParams, type Address, type AnalyticsConfig, type ApiResponse, type Audience, type AudienceAccessResponse, type AudienceSubscribeResponse, type AudienceSubscriber, type Block, type BlockType, type BulkScheduleParams, type Business, type BusinessConfig, type BusinessEmails, type BusinessRole, type BusinessShippingProvider, type CardProvider, type Condition, type ConnectStripeParams, type CreateAudienceParams, type CreateBusinessParams, type CreateNodeParams, type CreateOrderParams, type CreatePortalSessionParams, type CreateProductParams, type CreatePromoCodeParams, type CreateProviderParams, type CreateReservationParams, type CreateServiceParams, type CreateWorkflowParams, type CustomsDeclaration, type CustomsItem, type DayAvailability, type DeleteAccountParams, type DeleteAudienceParams, type DeleteBusinessMediaParams, type DeleteBusinessParams, type DeleteNodeParams, type DeleteProductParams, type DeletePromoCodeParams, type DeleteProviderParams, type DeleteServiceParams, type DeleteWorkflowParams, type DisconnectStripeParams, type Discount, type EshopCartItem, type EshopItem, type EshopStoreState, type Event, type EventAction, type ExecutionStatus, type FulfillmentCenter, type GenerateBlocksParams, type GeoLocation, type GeoLocationBlock, type GeoLocationBlockProperties, type GeoLocationValue, type GetAnalyticsHealthParams, type GetAnalyticsParams, type GetAudienceParams, type GetAudienceSubscribersParams, type GetAudiencesParams, type GetAvailabilityParams, type GetBusinessMediaParams, type GetBusinessMediaParams2, type GetBusinessParams, type GetBusinessParentsParams, type GetBusinessServiceWorkingTimeParams, type GetBusinessesParams, type GetDeliveryStatsParams, type GetEventsParams, type GetMeParams, type GetNodeChildrenParams, type GetNodeParams, type GetNodesParams, type GetOrderParams, type GetOrdersParams, type GetProductParams, type GetProductsParams, type GetPromoCodeParams, type GetPromoCodesParams, type GetProviderParams, type GetProvidersParams, type GetQuoteParams, type GetReservationParams, type GetReservationQuoteParams, type GetServiceParams, type GetServicesParams, type GetShippingRatesParams, type GetSlotsForDateParams, type GetSubscriptionParams, type GetSubscriptionPlansParams, type GetVariableMetadataParams, type GetWorkflowParams, type GetWorkflowsParams, type HandleInvitationParams, type IntervalPeriod, type InventoryLevel, type InviteUserParams, type Language, type Location, type LoginAccountParams, type LogoutParams, type MagicLinkRequestParams, type MagicLinkVerifyParams, type Market, type Media, type MediaResolution, type Node, type OrderCheckoutParams, type OrderShipping, type OrderStatus, type OutcastDate, type PaginatedResponse, type Parcel, type Payment, type PaymentMethod, PaymentMethodType, type PaymentProviderConfig, type PaymentRefund, type PhoneNumberConfirmParams, type Price, type PriceProvider, type ProcessRefundParams, type PromoCodeValidation, type Provider, type ProviderTimelinePoint, type ProviderWithTimeline, type PurchaseLabelResult, type Quote, type RequestOptions, type Reservation, type ReservationCartItem, type ReservationCheckoutParams, type ReservationItem, type ReservationQuoteItem, type ReservationStatus, type ReservationStoreState, type RevokeAudienceSubscriptionParams, type SearchAccountsParams, type SearchReservationsParams, type Service, type ServiceDuration, type ServiceProvider, type ServiceProviderInput, type SetupAnalyticsParams, type ShipParams, type ShipResult, type Shipment, type ShipmentLine, type ShippingAddress, type ShippingMethod, type ShippingProviderShippo, type ShippingProviderStatus, type ShippingRate, type ShippingStatus, type ShippingWeightTier, type Slot, type SpecificDate, type Status, type SubscribeAudienceParams, type SubscribeParams, type Subscription, type SubscriptionInterval, type SubscriptionPrice, type SubscriptionStatus, type SystemTemplateKey, type TestWebhookParams, type TimelinePoint, type TrackEmailOpenParams, type TriggerBuildsParams, type TriggerWorkflowParams, type UpdateAccountProfileParams, type UpdateAudienceParams, type UpdateBusinessParams, type UpdateEventParams, type UpdateMediaParams, type UpdateNodeParams, type UpdateNotificationsParams, type UpdateOrderParams, type UpdateProductParams, type UpdatePromoCodeParams, type UpdateProviderParams, type UpdateReservationParams, type UpdateServiceParams, type UpdateWorkflowParams, type UploadBusinessMediaParams, type Workflow, type WorkflowEdge, type WorkflowExecution, type WorkflowHttpMethod, type WorkflowHttpNode, type WorkflowIfNode, type WorkflowLoopNode, type WorkflowNode, type WorkflowTriggerNode, type WorkflowWaitNode, type WorkingDay, type WorkingHour, type WorkingTime, type Zone, type ZoneLocation, type ZoneScope };
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;AAFF,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\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 * Full address for shipping, billing, and fulfillment centers.\n * Used for order addresses and shipping labels.\n */\nexport interface Address {\n\tname: string;\n\tcompany?: string | null;\n\tstreet1: string;\n\tstreet2?: string | null;\n\tcity: string;\n\tstate: string;\n\tpostalCode: string;\n\tcountry: string;\n\tphone?: string | null;\n\temail?: string | null;\n}\n\n/**\n * Simple geo location for CMS map/location blocks.\n * Just coordinates and an optional label for display.\n */\nexport interface GeoLocation {\n\tcoordinates?: { lat: number; lon: number } | null;\n\tlabel?: string | null;\n}\n\n/**\n * @deprecated Use Address for shipping/billing addresses, GeoLocation for map coordinates\n */\nexport type Location = Address & { coordinates?: { lat: number; lon: number } | null };\n\n/**\n * Used for zone matching - simplified location with optional fields.\n */\nexport interface ZoneLocation {\n\tcountry?: string | null;\n\tstate?: string | null;\n\tcity?: string | null;\n\tpostalCode?: string | 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\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: \"google_analytics4\";\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\t/** Ship-from address for shipping labels */\n\taddress: Address;\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\taiProvider?: any;\n\tanalytics?: AnalyticsConfig;\n\temails: BusinessEmails;\n\t/** Configured shipping providers (e.g., Shippo) */\n\tshippingProviders?: BusinessShippingProvider[];\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| \"geo_location\";\n\nexport interface GeoLocationBlockProperties {}\n\n/** @deprecated Use GeoLocation instead */\nexport type GeoLocationValue = GeoLocation;\n\nexport interface GeoLocationBlock extends Block {\n\ttype: \"geo_location\";\n\tproperties: GeoLocationBlockProperties;\n\tvalue: GeoLocation | null;\n}\n\nexport type Access = 'public' | '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\n// Shipping Types\n\n/** Shipping status for order fulfillment tracking */\nexport type ShippingStatus =\n\t| 'pending'\n\t| 'label_created'\n\t| 'in_transit'\n\t| 'out_for_delivery'\n\t| 'delivered'\n\t| 'failed'\n\t| 'returned';\n\n/** Order shipping information (legacy - kept for backward compatibility) */\nexport interface OrderShipping {\n\tcarrier: string;\n\tservice: string;\n\ttrackingNumber?: string | null;\n\ttrackingUrl?: string | null;\n\tlabelUrl?: string | null;\n\tstatus: ShippingStatus;\n}\n\n/** Line item in a shipment with quantity (for partial fulfillment) */\nexport interface ShipmentLine {\n\torderItemId: string;\n\tquantity: number;\n}\n\n/** Individual shipment for an order (ships from one fulfillment center) */\nexport interface Shipment {\n\tid: string;\n\tfulfillmentCenterId: string;\n\tlines: ShipmentLine[]; // OrderItem IDs + quantities in this shipment\n\tcarrier?: string | null; // Set when label purchased\n\tservice?: string | null;\n\ttrackingNumber?: string | null;\n\ttrackingUrl?: string | null;\n\tlabelUrl?: string | null;\n\tstatus: ShippingStatus;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\n/** Shipping rate from provider */\nexport interface ShippingRate {\n\tid: string;\n\tprovider: string;\n\tcarrier: string;\n\tservice: string;\n\tdisplayName: string;\n\tamount: number;\n\tcurrency: string;\n\testimatedDays?: number | null;\n}\n\n/**\n * @deprecated Use Address instead\n * Shipping address for rate requests\n */\nexport type ShippingAddress = Address;\n\n/** Parcel dimensions for shipping */\nexport interface Parcel {\n\tlength: number;\n\twidth: number;\n\theight: number;\n\tweight: number;\n\tdistanceUnit: 'in' | 'cm';\n\tmassUnit: 'oz' | 'lb' | 'g' | 'kg';\n}\n\n/** Result from purchasing a shipping label */\nexport interface PurchaseLabelResult {\n\ttrackingNumber: string;\n\ttrackingUrl?: string | null;\n\tlabelUrl: string;\n\tcarrier: string;\n\tservice: string;\n}\n\n/** Result from ship operation */\nexport interface ShipResult {\n\tshipmentId: string;\n\ttrackingNumber: string;\n\ttrackingUrl?: string | null;\n\tlabelUrl: string;\n}\n\n/** Individual item in a customs declaration */\nexport interface CustomsItem {\n\tdescription: string;\n\tquantity: number;\n\tnetWeight: string;\n\tmassUnit: string;\n\tvalueAmount: string;\n\tvalueCurrency: string;\n\toriginCountry: string;\n\ttariffNumber?: string | null;\n}\n\n/** Customs declaration for international shipments */\nexport interface CustomsDeclaration {\n\tcontentsType: string; // \"MERCHANDISE\" | \"GIFT\" | \"SAMPLE\" | \"DOCUMENTS\" | \"RETURN\"\n\tcontentsExplanation?: string | null;\n\tnonDeliveryOption: string; // \"RETURN\" | \"ABANDON\"\n\tcertify: boolean;\n\tcertifySigner: string;\n\titems: CustomsItem[];\n}\n\n/** Shipping provider status */\nexport type ShippingProviderStatus = 'active' | 'inactive';\n\n/** Shippo shipping provider configuration */\nexport interface ShippingProviderShippo {\n\ttype: 'shippo';\n\tid: string;\n\tstatus: ShippingProviderStatus;\n\tapiToken: string;\n}\n\n/** Business shipping provider (union type for extensibility) */\nexport type BusinessShippingProvider = ShippingProviderShippo;\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;AAFF,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\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 * Full address for shipping, billing, and fulfillment centers.\n * Used for order addresses and shipping labels.\n */\nexport interface Address {\n\tname: string;\n\tcompany?: string | null;\n\tstreet1: string;\n\tstreet2?: string | null;\n\tcity: string;\n\tstate: string;\n\tpostalCode: string;\n\tcountry: string;\n\tphone?: string | null;\n\temail?: string | null;\n}\n\n/**\n * Simple geo location for CMS map/location blocks.\n * Just coordinates and an optional label for display.\n */\nexport interface GeoLocation {\n\tcoordinates?: { lat: number; lon: number } | null;\n\tlabel?: string | null;\n}\n\n/**\n * @deprecated Use Address for shipping/billing addresses, GeoLocation for map coordinates\n */\nexport type Location = Address & { coordinates?: { lat: number; lon: number } | null };\n\n/**\n * Used for zone matching - simplified location with optional fields.\n */\nexport interface ZoneLocation {\n\tcountry?: string | null;\n\tstate?: string | null;\n\tcity?: string | null;\n\tpostalCode?: string | 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\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: \"google_analytics4\";\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\t/** Ship-from address for shipping labels */\n\taddress: Address;\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\taiProvider?: any;\n\tanalytics?: AnalyticsConfig;\n\temails: BusinessEmails;\n\t/** Configured shipping providers (e.g., Shippo) */\n\tshippingProviders?: BusinessShippingProvider[];\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| \"geo_location\";\n\nexport interface GeoLocationBlockProperties {}\n\n/** @deprecated Use GeoLocation instead */\nexport type GeoLocationValue = GeoLocation;\n\nexport interface GeoLocationBlock extends Block {\n\ttype: \"geo_location\";\n\tproperties: GeoLocationBlockProperties;\n\tvalue: GeoLocation | null;\n}\n\nexport type Access = 'public' | '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 EventAction =\n\t// Order events\n\t| { action: 'order_created' }\n\t| { action: 'order_updated' }\n\t| { action: 'order_status_changed'; data: { from: string; to: string } }\n\t| { action: 'order_payment_received'; data: { amount: number; currency: string } }\n\t| { action: 'order_payment_failed'; data: { reason?: string } }\n\t| { action: 'order_refunded'; data: { amount: number; currency: string; 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// Reservation events\n\t| { action: 'reservation_created' }\n\t| { action: 'reservation_updated' }\n\t| { action: 'reservation_status_changed'; data: { from: string; to: string } }\n\t| { action: 'reservation_payment_received'; data: { amount: number; currency: string } }\n\t| { action: 'reservation_payment_failed'; data: { reason?: string } }\n\t| { action: 'reservation_refunded'; data: { amount: number; currency: string; reason?: string } }\n\t| { action: 'reservation_completed' }\n\t| { action: 'reservation_cancelled'; data: { reason?: string } }\n\t// Product events\n\t| { action: 'product_created' }\n\t| { action: 'product_updated' }\n\t| { action: 'product_deleted' }\n\t// Node events\n\t| { action: 'node_created' }\n\t| { action: 'node_updated' }\n\t| { action: 'node_deleted' }\n\t// Provider events\n\t| { action: 'provider_created' }\n\t| { action: 'provider_updated' }\n\t| { action: 'provider_deleted' }\n\t// Service events\n\t| { action: 'service_created' }\n\t| { action: 'service_updated' }\n\t| { action: 'service_deleted' }\n\t// Account events\n\t| { action: 'account_created' }\n\t| { action: 'account_updated' }\n\t| { action: 'account_deleted' }\n\t// Media events\n\t| { action: 'media_created' }\n\t| { action: 'media_deleted' }\n\t// Business events\n\t| { action: 'business_created' }\n\t| { action: 'business_updated' }\n\t| { action: 'business_deleted' }\n\t// Audience events\n\t| { action: 'audience_created' }\n\t| { action: 'audience_updated' };\n\nexport interface Event {\n\tid: string;\n\tentity: string;\n\tevent: EventAction;\n\tactor: string;\n\tcreatedAt: number;\n}\n\n// Shipping Types\n\n/** Shipping status for order fulfillment tracking */\nexport type ShippingStatus =\n\t| 'pending'\n\t| 'label_created'\n\t| 'in_transit'\n\t| 'out_for_delivery'\n\t| 'delivered'\n\t| 'failed'\n\t| 'returned';\n\n/** Order shipping information (legacy - kept for backward compatibility) */\nexport interface OrderShipping {\n\tcarrier: string;\n\tservice: string;\n\ttrackingNumber?: string | null;\n\ttrackingUrl?: string | null;\n\tlabelUrl?: string | null;\n\tstatus: ShippingStatus;\n}\n\n/** Line item in a shipment with quantity (for partial fulfillment) */\nexport interface ShipmentLine {\n\torderItemId: string;\n\tquantity: number;\n}\n\n/** Individual shipment for an order (ships from one fulfillment center) */\nexport interface Shipment {\n\tid: string;\n\tfulfillmentCenterId: string;\n\tlines: ShipmentLine[]; // OrderItem IDs + quantities in this shipment\n\tcarrier?: string | null; // Set when label purchased\n\tservice?: string | null;\n\ttrackingNumber?: string | null;\n\ttrackingUrl?: string | null;\n\tlabelUrl?: string | null;\n\tstatus: ShippingStatus;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\n/** Shipping rate from provider */\nexport interface ShippingRate {\n\tid: string;\n\tprovider: string;\n\tcarrier: string;\n\tservice: string;\n\tdisplayName: string;\n\tamount: number;\n\tcurrency: string;\n\testimatedDays?: number | null;\n}\n\n/**\n * @deprecated Use Address instead\n * Shipping address for rate requests\n */\nexport type ShippingAddress = Address;\n\n/** Parcel dimensions for shipping */\nexport interface Parcel {\n\tlength: number;\n\twidth: number;\n\theight: number;\n\tweight: number;\n\tdistanceUnit: 'in' | 'cm';\n\tmassUnit: 'oz' | 'lb' | 'g' | 'kg';\n}\n\n/** Result from purchasing a shipping label */\nexport interface PurchaseLabelResult {\n\ttrackingNumber: string;\n\ttrackingUrl?: string | null;\n\tlabelUrl: string;\n\tcarrier: string;\n\tservice: string;\n}\n\n/** Result from ship operation */\nexport interface ShipResult {\n\tshipmentId: string;\n\ttrackingNumber: string;\n\ttrackingUrl?: string | null;\n\tlabelUrl: string;\n}\n\n/** Individual item in a customs declaration */\nexport interface CustomsItem {\n\tdescription: string;\n\tquantity: number;\n\tnetWeight: string;\n\tmassUnit: string;\n\tvalueAmount: string;\n\tvalueCurrency: string;\n\toriginCountry: string;\n\ttariffNumber?: string | null;\n}\n\n/** Customs declaration for international shipments */\nexport interface CustomsDeclaration {\n\tcontentsType: string; // \"MERCHANDISE\" | \"GIFT\" | \"SAMPLE\" | \"DOCUMENTS\" | \"RETURN\"\n\tcontentsExplanation?: string | null;\n\tnonDeliveryOption: string; // \"RETURN\" | \"ABANDON\"\n\tcertify: boolean;\n\tcertifySigner: string;\n\titems: CustomsItem[];\n}\n\n/** Shipping provider status */\nexport type ShippingProviderStatus = 'active' | 'inactive';\n\n/** Shippo shipping provider configuration */\nexport interface ShippingProviderShippo {\n\ttype: 'shippo';\n\tid: string;\n\tstatus: ShippingProviderStatus;\n\tapiToken: string;\n}\n\n/** Business shipping provider (union type for extensibility) */\nexport type BusinessShippingProvider = ShippingProviderShippo;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arky-sdk",
3
- "version": "0.4.47",
3
+ "version": "0.4.48",
4
4
  "description": "Official TypeScript SDK for Arky - All-in-one business platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",