arky-sdk 0.5.67 → 0.5.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +2 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/types.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/api.ts","../src/types/index.ts"],"names":["SubscriptionSource","PaymentMethodType"],"mappings":";;;AAk+BO,IAAK,kBAAA,qBAAAA,mBAAAA,KAAL;AACL,EAAAA,oBAAA,QAAA,CAAA,GAAS,QAAA;AACT,EAAAA,oBAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,oBAAA,QAAA,CAAA,GAAS,QAAA;AAHC,EAAA,OAAAA,mBAAAA;AAAA,CAAA,EAAA,kBAAA,IAAA,EAAA;;;ACt7BL,IAAK,iBAAA,qBAAAC,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":["import type { Block, ZoneLocation, WorkflowNode, Status, Address, SubscriptionStatus, AudienceType, IntegrationProvider, WebhookEventSubscription, Parcel, CustomsDeclaration, ShipmentLine } from \"./index\";\n\nexport interface RequestOptions<T = any> {\n headers?: Record<string, string>;\n params?: Record<string, any>;\n transformRequest?: (data: any) => any;\n onSuccess?: (ctx: {\n data: T;\n method: string;\n url: string;\n status: number;\n request?: any;\n durationMs?: number;\n requestId?: string | null;\n }) => void | Promise<void>;\n onError?: (ctx: {\n error: any;\n method: string;\n url: string;\n status?: number;\n request?: any;\n response?: any;\n durationMs?: number;\n requestId?: string | null;\n aborted?: boolean;\n }) => void | Promise<void>;\n}\n\nexport interface EshopItem {\n productId: string;\n variantId: string;\n quantity: number;\n}\n\nexport interface GetQuoteParams {\n items: EshopItem[];\n paymentMethodId?: string;\n shippingMethodId?: string;\n promoCode?: string;\n blocks?: any[];\n /** Zone location for zone/market resolution */\n location?: ZoneLocation;\n}\n\nexport interface OrderCheckoutParams {\n items: EshopItem[];\n paymentMethodId?: string;\n blocks?: any[];\n shippingMethodId: string;\n promoCodeId?: string;\n /** Shipping address for the order */\n shippingAddress?: Address;\n /** Billing address (defaults to shipping address if not provided) */\n billingAddress?: Address;\n}\n\nexport interface GetProductsParams {\n ids?: string[];\n filters?: { taxonomyId: string; blocks?: any[] }[];\n status?: string;\n limit?: number;\n cursor?: string;\n query?: string;\n statuses?: string[];\n sortField?: string;\n sortDirection?: string;\n createdAtFrom?: number | null;\n createdAtTo?: number | null;\n}\n\nexport interface GetNodesParams {\n businessId?: string;\n parentId?: string;\n limit?: number;\n cursor?: string;\n ids?: string[];\n query?: string;\n type?: string;\n key?: string;\n statuses?: string[];\n sortField?: string;\n sortDirection?: string;\n createdAtFrom?: string;\n createdAtTo?: string;\n}\n\nexport interface CreateNodeParams {\n businessId?: string;\n key: string;\n parentId?: string | null;\n blocks?: any[];\n filters?: any[];\n slug?: Record<string, string>;\n audienceIds?: string[];\n status?: string;\n}\n\nexport interface UpdateNodeParams {\n id: string;\n businessId?: string;\n key?: string;\n parentId?: string | null;\n blocks?: any[];\n filters?: any[];\n slug?: Record<string, string>;\n audienceIds?: string[];\n status?: string;\n}\n\nexport interface GetNodeParams {\n id?: string;\n slug?: string;\n key?: string;\n businessId?: string;\n}\n\nexport interface DeleteNodeParams {\n id: string;\n businessId?: string;\n}\n\nexport interface GetNodeChildrenParams {\n id: string;\n businessId?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface UploadBusinessMediaParams {\n businessId?: string;\n files?: File[];\n urls?: string[];\n}\n\nexport interface DeleteBusinessMediaParams {\n id: string;\n mediaId: string;\n}\n\nexport interface GetMediaParams {\n mediaId: string;\n businessId?: string;\n}\n\nexport interface UpdateMediaParams {\n mediaId: string;\n businessId?: string;\n slug?: Record<string, string>;\n}\n\nexport interface GetBusinessMediaParams {\n businessId?: string;\n cursor?: string | null;\n limit: number;\n ids?: string[];\n query?: string;\n mimeType?: string;\n sortField?: string;\n sortDirection?: 'asc' | 'desc';\n}\n\nexport interface LoginAccountParams {\n email?: string;\n provider: string;\n token?: string;\n}\n\nexport interface MagicLinkRequestParams {\n email: string;\n businessId?: string;\n}\n\nexport interface MagicLinkVerifyParams {\n email: string;\n code: string;\n}\n\n\nexport interface GetServicesParams {\n businessId?: string;\n providerId?: string;\n filters?: { taxonomyId: string; blocks?: any[] }[];\n limit?: number;\n cursor?: string;\n query?: string;\n ids?: string[];\n statuses?: string[];\n sortField?: string;\n sortDirection?: string;\n}\n\nexport interface BookingCheckoutParams {\n businessId?: string;\n items: any[];\n paymentMethodId?: string;\n blocks?: any[];\n promoCodeId?: string;\n /** Zone location for zone/market resolution */\n location?: ZoneLocation;\n}\n\nexport interface BookingQuoteItem {\n serviceId: string;\n from: number;\n to: number;\n providerId: string;\n}\n\nexport interface GetBookingQuoteParams {\n businessId?: string;\n items: BookingQuoteItem[];\n paymentMethodId?: string;\n promoCode?: string;\n /** Zone location for zone/market resolution */\n location?: ZoneLocation;\n}\n\nexport interface TimelinePoint {\n timestamp: number;\n concurrent: number;\n}\n\nexport interface WorkingHour {\n from: number;\n to: number;\n}\n\nexport interface WorkingDay {\n day: string;\n workingHours: WorkingHour[];\n}\n\nexport interface SpecificDate {\n date: number;\n workingHours: WorkingHour[];\n}\n\nexport interface ServiceProvider {\n id: string;\n serviceId: string;\n providerId: string;\n businessId: string;\n workingDays: WorkingDay[];\n specificDates: SpecificDate[];\n prices?: any[];\n durations?: any[];\n isApprovalRequired?: boolean;\n capacity: number;\n timeline: TimelinePoint[];\n createdAt?: number;\n updatedAt?: number;\n service?: any;\n provider?: any;\n}\n\nexport interface ProviderWithTimeline {\n id: string;\n key: string;\n businessId: string;\n seo: any;\n status: Status;\n capacity: number;\n audienceIds: string[];\n blocks: Block[];\n createdAt: number;\n updatedAt: number;\n workingDays?: WorkingDay[];\n specificDates?: SpecificDate[];\n timeline: TimelinePoint[];\n}\n\nexport interface GetAnalyticsParams {\n metrics?: string[];\n period?: string;\n startDate?: string;\n endDate?: string;\n interval?: string;\n}\n\nexport interface GetAnalyticsHealthParams {\n \n}\n\nexport interface TrackEmailOpenParams {\n trackingPixelId: string;\n}\n\nexport interface GetDeliveryStatsParams {}\n\nexport type BusinessRole = 'admin' | 'owner' | 'super';\n\nexport interface Discount {\n type: \"items_percentage\" | \"items_fixed\" | \"shipping_percentage\";\n marketId: string;\n bps?: number;\n amount?: number;\n}\n\nexport interface Condition {\n type:\n | \"products\"\n | \"services\"\n | \"min_order_amount\"\n | \"date_range\"\n | \"max_uses\"\n | \"max_uses_per_user\";\n value: string[] | number | { start?: number; end?: number };\n}\n\nexport interface CreatePromoCodeParams {\n code: string;\n discounts: Discount[];\n conditions: Condition[];\n}\n\nexport interface UpdatePromoCodeParams {\n id: string;\n code: string;\n discounts: Discount[];\n conditions: Condition[];\n status?: Status;\n}\n\nexport interface DeletePromoCodeParams {\n id: string;\n}\n\nexport interface GetPromoCodeParams {\n id: string;\n}\n\nexport interface GetPromoCodesParams {\n statuses?: string[];\n query?: string;\n limit?: number;\n cursor?: string;\n sortField?: string;\n sortDirection?: string;\n createdAtFrom?: string;\n createdAtTo?: string;\n startsAtFrom?: string;\n startsAtTo?: string;\n expiresAtFrom?: string;\n expiresAtTo?: string;\n}\n\nexport interface CreateBusinessParams {\n key: string;\n slug?: string;\n description?: string;\n email?: string;\n phone?: string;\n website?: string;\n address?: any;\n settings?: any;\n [key: string]: any;\n}\n\nexport interface UpdateBusinessParams {\n id: string;\n key: string;\n timezone: string;\n configs: any;\n}\n\nexport interface DeleteBusinessParams {\n id: string;\n}\n\nexport interface GetBusinessParams {}\n\n\nexport interface SubscribeParams {\n planId: string;\n successUrl: string;\n cancelUrl: string;\n}\n\nexport interface CreatePortalSessionParams {\n returnUrl: string;\n}\n\nexport interface InviteUserParams {\n email: string;\n role?: BusinessRole;\n}\n\nexport interface RemoveMemberParams {\n accountId: string;\n}\n\nexport interface HandleInvitationParams {\n token: string;\n action: string;\n}\n\nexport interface TestWebhookParams {\n webhook: any;\n}\n\n\nexport interface CreateProductParams {\n key: string;\n description?: string;\n audienceIds?: string[];\n blocks?: any[];\n filters?: any[];\n variants?: any[];\n status?: string;\n [key: string]: any;\n}\n\nexport interface UpdateProductParams {\n id: string;\n key?: string;\n description?: string;\n audienceIds?: string[];\n blocks?: any[];\n filters?: any[];\n variants?: any[];\n status?: string;\n [key: string]: any;\n}\n\nexport interface DeleteProductParams {\n id: string;\n}\n\nexport interface GetProductParams {\n id?: string;\n slug?: string;\n}\n\nexport interface GetOrderParams {\n id: string;\n}\n\nexport interface GetOrdersParams {\n accountId?: string | null;\n statuses?: string[] | null;\n productIds?: string[];\n query?: string | null;\n limit?: number | null;\n cursor?: string | null;\n sortField?: string | null;\n sortDirection?: string | null;\n createdAtFrom?: string | null;\n createdAtTo?: string | null;\n}\n\nexport interface UpdateOrderParams {\n id: string;\n status: string;\n blocks: any[];\n items: any[];\n address?: any | null;\n billingAddress?: any | null;\n payment?: any | null;\n}\n\nexport interface CreateOrderParams {\n [key: string]: any;\n}\n\nexport interface CreateBookingParams {\n businessId?: string;\n [key: string]: any;\n}\n\nexport interface UpdateBookingParams {\n id: string;\n status?: string;\n blocks?: any;\n parts?: any;\n payment?: any | null;\n [key: string]: any;\n}\n\nexport interface CreateProviderParams {\n businessId?: string;\n key: string;\n audienceIds?: string[];\n blocks?: any[];\n filters?: any[];\n status?: Status;\n [key: string]: any;\n}\n\nexport interface UpdateProviderParams {\n id: string;\n businessId?: string;\n key?: string;\n audienceIds?: string[];\n blocks?: any[];\n filters?: any[];\n status?: Status;\n [key: string]: any;\n}\n\nexport interface DeleteProviderParams {\n id: string;\n businessId?: string;\n}\n\nexport interface ServiceProviderInput {\n providerId: string;\n businessId?: string;\n prices?: any[];\n durations?: any[];\n isApprovalRequired?: boolean;\n capacity?: number;\n workingDays: WorkingDay[];\n specificDates: SpecificDate[];\n}\n\nexport interface CreateServiceParams {\n businessId?: string;\n key: string;\n blocks?: any[];\n filters?: any[];\n status?: Status;\n [key: string]: any;\n}\n\nexport interface UpdateServiceParams {\n id: string;\n businessId?: string;\n key?: string;\n blocks?: any[];\n filters?: any[];\n status?: Status;\n [key: string]: any;\n}\n\nexport interface CreateServiceProviderParams {\n businessId?: string;\n serviceId: string;\n providerId: string;\n workingDays: WorkingDay[];\n specificDates: SpecificDate[];\n prices?: any[];\n durations?: any[];\n isApprovalRequired?: boolean;\n}\n\nexport interface UpdateServiceProviderParams {\n businessId?: string;\n id: string;\n workingDays: WorkingDay[];\n specificDates: SpecificDate[];\n prices?: any[];\n durations?: any[];\n isApprovalRequired?: boolean;\n}\n\nexport interface DeleteServiceProviderParams {\n businessId?: string;\n id: string;\n}\n\nexport interface FindServiceProvidersParams {\n businessId?: string;\n serviceId?: string;\n providerId?: string;\n}\n\nexport interface DeleteServiceParams {\n id: string;\n businessId?: string;\n}\n\nexport interface GetServiceParams {\n id?: string;\n slug?: string;\n businessId?: string;\n}\n\nexport interface GetProvidersParams {\n businessId?: string;\n serviceId?: string;\n filters?: { taxonomyId: string; blocks?: any[] }[];\n ids?: string[];\n query?: string | null;\n statuses?: string[] | null;\n limit?: number;\n cursor?: string;\n sortField?: string | null;\n sortDirection?: string | null;\n createdAtFrom?: string | null;\n createdAtTo?: string | null;\n}\n\nexport interface GetProviderParams {\n id?: string;\n slug?: string;\n businessId?: string;\n}\n\nexport interface GetBookingParams {\n id: string;\n businessId?: string;\n}\n\nexport interface SearchBookingsParams {\n businessId?: string;\n query?: string;\n serviceIds?: string[];\n providerIds?: string[];\n accountId?: string;\n from?: number;\n to?: number;\n status?: string;\n limit?: number;\n cursor?: string;\n sortField?: string;\n sortOrder?: string;\n}\n\nexport interface UpdateAccountProfileParams {\n phoneNumbers?: string[];\n addresses?: any[];\n apiTokens?: any[] | null;\n}\n\nexport interface SearchAccountsParams {\n limit?: number;\n cursor?: string | null;\n query?: string;\n owner?: string;\n}\n\nexport interface DeleteAccountParams {}\n\nexport interface TrackEmailOpenParams {\n trackingPixelId: string;\n}\n\n\nexport interface TriggerNotificationParams {\n channel: string;\n businessId: string;\n emailTemplateId?: string;\n recipients?: string[];\n audienceId?: string;\n vars?: Record<string, any>;\n}\n\n// ── EmailTemplate params ──────────────────────────────────────\n\nexport interface GetEmailTemplatesParams {\n businessId?: string;\n limit?: number;\n cursor?: string;\n ids?: string[];\n query?: string;\n key?: string;\n status?: string;\n sortField?: string;\n sortDirection?: \"asc\" | \"desc\";\n createdAtFrom?: number;\n createdAtTo?: number;\n}\n\nexport interface CreateEmailTemplateParams {\n businessId?: string;\n key: string;\n subject?: Record<string, string>;\n body?: string;\n fromName: string;\n fromEmail: string;\n replyTo?: string;\n preheader?: string;\n}\n\nexport interface UpdateEmailTemplateParams {\n id: string;\n businessId?: string;\n key?: string;\n subject?: Record<string, string>;\n body?: string;\n fromName?: string;\n fromEmail?: string;\n replyTo?: string;\n preheader?: string;\n status?: string;\n}\n\nexport interface GetEmailTemplateParams {\n id?: string;\n key?: string;\n businessId?: string;\n}\n\nexport interface DeleteEmailTemplateParams {\n id: string;\n businessId?: string;\n}\n\n// ── Form params ───────────────────────────────────────────────\n\nexport interface GetFormsParams {\n businessId?: string;\n limit?: number;\n cursor?: string;\n ids?: string[];\n query?: string;\n key?: string;\n status?: string;\n sortField?: string;\n sortDirection?: \"asc\" | \"desc\";\n createdAtFrom?: number;\n createdAtTo?: number;\n}\n\nexport interface CreateFormParams {\n businessId?: string;\n key: string;\n blocks?: any[];\n}\n\nexport interface UpdateFormParams {\n id: string;\n businessId?: string;\n key?: string;\n blocks?: any[];\n status?: string;\n}\n\nexport interface GetFormParams {\n id?: string;\n key?: string;\n businessId?: string;\n}\n\nexport interface DeleteFormParams {\n id: string;\n businessId?: string;\n}\n\nexport interface SubmitFormParams {\n formId: string;\n businessId?: string;\n blocks: any[];\n}\n\nexport interface GetFormSubmissionsParams {\n formId: string;\n businessId?: string;\n query?: string;\n limit?: number;\n cursor?: string;\n sortField?: string;\n sortDirection?: \"asc\" | \"desc\";\n createdAtFrom?: number;\n createdAtTo?: number;\n}\n\nexport interface GetFormSubmissionParams {\n id: string;\n formId: string;\n businessId?: string;\n}\n\n// ── Taxonomy params ───────────────────────────────────────────\n\nexport interface GetTaxonomiesParams {\n businessId?: string;\n parentId?: string;\n limit?: number;\n cursor?: string;\n ids?: string[];\n query?: string;\n key?: string;\n status?: string;\n sortField?: string;\n sortDirection?: \"asc\" | \"desc\";\n createdAtFrom?: number;\n createdAtTo?: number;\n}\n\nexport interface CreateTaxonomyParams {\n businessId?: string;\n key: string;\n parentId?: string | null;\n blocks?: any[];\n}\n\nexport interface UpdateTaxonomyParams {\n id: string;\n businessId?: string;\n key?: string;\n parentId?: string | null;\n blocks?: any[];\n status?: string;\n}\n\nexport interface GetTaxonomyParams {\n id?: string;\n key?: string;\n businessId?: string;\n}\n\nexport interface DeleteTaxonomyParams {\n id: string;\n businessId?: string;\n}\n\nexport interface GetTaxonomyChildrenParams {\n id: string;\n businessId?: string;\n}\n\nexport interface GetMeParams {}\n\nexport interface LogoutParams {}\n\nexport interface GetBusinessesParams {\n query?: string;\n limit?: number;\n cursor?: string;\n sortField?: string;\n sortDirection?: \"asc\" | \"desc\";\n}\n\nexport interface GetSubscriptionPlansParams {}\n\nexport interface SetupAnalyticsParams {\n [key: string]: any;\n}\n\nexport interface GetBusinessMediaParams2 {\n id: string;\n cursor?: string | null;\n limit: number;\n ids?: string[];\n query?: string;\n mimeType?: string;\n sortField?: string;\n sortDirection?: 'asc' | 'desc';\n}\n\nexport interface DeleteProductParams {\n id: string;\n}\n\nexport interface ProcessRefundParams {\n id: string;\n entity: string;\n amount: number;\n}\n\nexport type SystemTemplateKey =\n | \"system:booking-business-update\"\n | \"system:booking-customer-update\"\n | \"system:user-invitation\"\n | \"system:order-status-update\"\n | \"system:user-confirmation\"\n | \"system:forgot-password\";\n\nexport interface GetSlotsForDateParams {\n serviceId: string;\n date: Date;\n timezone: string;\n providerId?: string;\n}\n\nexport interface GetAvailabilityParams {\n serviceId: string;\n from: Date;\n to: Date;\n timezone: string;\n}\n\nexport interface DayAvailability {\n date: Date;\n available: boolean;\n}\n\nexport interface Slot {\n id: string;\n serviceId: string;\n providerId: string;\n from: number;\n to: number;\n timeText: string;\n dateText: string;\n}\n\nexport interface CreateWorkflowParams {\n businessId?: string;\n key: string;\n status?: Status;\n nodes: Record<string, WorkflowNode>;\n\n schedule?: string;\n}\n\nexport interface UpdateWorkflowParams {\n id: string;\n key: string;\n status?: Status;\n nodes: Record<string, WorkflowNode>;\n\n schedule?: string;\n}\n\nexport interface DeleteWorkflowParams {\n id: string;\n}\n\nexport interface GetWorkflowParams {\n id: string;\n}\n\nexport interface GetWorkflowsParams {\n businessId?: string;\n ids?: string[];\n query?: string;\n statuses?: string[];\n limit?: number;\n cursor?: string;\n sortField?: string;\n sortDirection?: 'asc' | 'desc';\n createdAtFrom?: number;\n createdAtTo?: number;\n}\n\nexport interface TriggerWorkflowParams {\n\n secret: string;\n\n [key: string]: any;\n}\n\nexport interface GetWorkflowExecutionsParams {\n workflowId: string;\n businessId?: string;\n status?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface GetWorkflowExecutionParams {\n workflowId: string;\n executionId: string;\n businessId?: string;\n}\n\nexport interface CreateAudienceParams {\n key: string;\n name: string;\n type?: AudienceType;\n}\n\nexport interface UpdateAudienceParams {\n id: string;\n key?: string;\n name?: string;\n type?: AudienceType;\n status?: Status;\n}\n\nexport interface GetAudienceParams {\n id?: string;\n key?: string;\n}\n\nexport interface GetAudiencesParams {\n ids?: string[];\n statuses?: string[];\n query?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface SubscribeAudienceParams {\n id: string;\n email: string;\n priceId?: string;\n successUrl?: string;\n cancelUrl?: string;\n confirmUrl?: string;\n}\n\nexport interface DeleteAudienceParams {\n id: string;\n}\n\nexport interface GetAudienceSubscribersParams {\n id: string;\n limit?: number;\n cursor?: string;\n}\n\nexport enum SubscriptionSource {\n Signup = 'signup',\n Admin = 'admin',\n Import = 'import'\n}\n\nexport interface AudienceSubscriber {\n accountId: string;\n email: string;\n subscribedAt?: number;\n source?: SubscriptionSource;\n status?: SubscriptionStatus;\n}\n\nexport interface RemoveAudienceSubscriberParams {\n id: string;\n accountId: string;\n}\n\nexport interface AddAudienceSubscriberParams {\n id: string;\n email: string;\n}\n\nexport interface AddAudienceSubscriberResponse {\n subscriber: AudienceSubscriber | null;\n skipped: boolean;\n}\n\n\nexport interface OAuthConnectParams {\n businessId: string;\n provider: string;\n code: string;\n redirectUri: string;\n}\n\nexport interface OAuthDisconnectParams {\n businessId: string;\n provider: string;\n}\n\n// Integration API Parameters\n\nexport interface ListIntegrationsParams {\n businessId: string;\n}\n\nexport interface GetIntegrationParams {\n businessId: string;\n id: string;\n}\n\nexport interface CreateIntegrationParams {\n businessId: string;\n key: string;\n provider: IntegrationProvider;\n}\n\nexport interface UpdateIntegrationParams {\n businessId: string;\n id: string;\n key?: string;\n provider?: IntegrationProvider;\n}\n\nexport interface DeleteIntegrationParams {\n businessId: string;\n id: string;\n}\n\n// Webhook CRUD Parameters\n\nexport interface ListWebhooksParams {\n businessId: string;\n}\n\nexport interface CreateWebhookParams {\n businessId: string;\n key: string;\n url: string;\n events: WebhookEventSubscription[];\n headers: Record<string, string>;\n secret: string;\n enabled: boolean;\n}\n\nexport interface UpdateWebhookParams {\n businessId: string;\n id: string;\n key: string;\n url: string;\n events: WebhookEventSubscription[];\n headers: Record<string, string>;\n secret: string;\n enabled: boolean;\n}\n\nexport interface DeleteWebhookParams {\n businessId: string;\n id: string;\n}\n\n// Shipping API Parameters\n\n/** Get shipping rates for a shipment */\nexport interface GetShippingRatesParams {\n orderId: string;\n shippingProviderId: string;\n fromAddress: Address;\n toAddress: Address;\n parcel: Parcel;\n customsDeclaration?: CustomsDeclaration;\n}\n\n/** Ship items: creates shipment + purchases label atomically */\nexport interface ShipParams {\n orderId: string;\n rateId: string;\n carrier: string;\n service: string;\n locationId: string;\n lines: ShipmentLine[];\n}\n\n// ===== Agent API Parameters =====\n\nexport type AgentStatus = 'active' | 'disabled';\n\nexport interface CreateAgentParams {\n businessId?: string;\n key: string;\n prompt: string;\n status?: AgentStatus;\n modelId: string;\n channelIds?: string[];\n}\n\nexport interface UpdateAgentParams {\n id: string;\n key: string;\n prompt: string;\n status: AgentStatus;\n modelId: string;\n channelIds?: string[];\n}\n\nexport interface DeleteAgentParams {\n id: string;\n}\n\nexport interface GetAgentParams {\n id: string;\n}\n\nexport interface GetAgentsParams {\n businessId?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface RunAgentParams {\n id: string;\n message: string;\n chatId?: string;\n direct?: boolean;\n}\n\nexport interface GetAgentChatsParams {\n id: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface GetBusinessChatsParams {\n businessId?: string;\n agentId?: string;\n status?: string;\n query?: string;\n sortField?: string;\n sortDirection?: 'asc' | 'desc';\n limit?: number;\n cursor?: string;\n}\n\nexport interface GetAgentChatParams {\n id: string;\n chatId: string;\n}\n\nexport interface UpdateAgentChatParams {\n id: string;\n chatId: string;\n status: 'active' | 'archived';\n}\n\nexport interface RateAgentChatParams {\n id: string;\n chatId: string;\n rating: number;\n comment?: string;\n}\n\n// ===== Network API Parameters =====\n\nexport interface NetworkNode {\n id?: string;\n key: string;\n blocks?: any[];\n}\n\nexport interface Network {\n id: string;\n key: string;\n nodes: NetworkNode[];\n createdAt: number;\n updatedAt: number;\n}\n\nexport interface CreateNetworkParams {\n key: string;\n nodes?: NetworkNode[];\n}\n\nexport interface UpdateNetworkParams {\n id: string;\n key: string;\n nodes: NetworkNode[];\n}\n\nexport interface GetNetworkParams {\n id: string;\n}\n\nexport interface FindNetworksParams {\n query?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface DeleteNetworkParams {\n id: string;\n}\n\n","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\taudienceId?: string;\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 locations.\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/**\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 BookingCartItem {\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/** Integration provider — typed data per service */\nexport type IntegrationProvider =\n\t| { type: 'stripe'; secretKey?: string; publishableKey: string; webhookSecret?: string; currency: string; activeForCardPayments?: boolean }\n\t| { type: 'shippo'; apiToken?: string; activeForFulfillment?: boolean }\n\t| { type: 'google'; clientId?: string; clientSecret?: string; accessToken?: string; refreshToken?: string;\n\t\ttokenExpiresAt?: number; scopes: string[]; accountEmail?: string | null; connectedAt: number }\n\t| { type: 'google_analytics4'; measurementId: string; activeForTracking?: boolean }\n\t| { type: 'telegram_bot'; botToken?: string; action: ChannelAction }\n\t| { type: 'deep_seek'; apiKey?: string; model?: string }\n\t// Bearer token providers\n\t| { type: 'open_ai'; apiKey?: string; model?: string }\n\t| { type: 'slack'; apiKey?: string }\n\t| { type: 'discord'; apiKey?: string }\n\t| { type: 'whats_app'; apiKey?: string }\n\t| { type: 'resend'; apiKey?: string }\n\t| { type: 'send_grid'; apiKey?: string }\n\t| { type: 'airtable'; apiKey?: string }\n\t| { type: 'linear'; apiKey?: string }\n\t| { type: 'git_hub'; apiKey?: string }\n\t| { type: 'git_lab'; apiKey?: string }\n\t| { type: 'dropbox'; apiKey?: string }\n\t| { type: 'hub_spot'; apiKey?: string }\n\t| { type: 'monday'; apiKey?: string }\n\t| { type: 'click_up'; apiKey?: string }\n\t| { type: 'pipedrive'; apiKey?: string }\n\t| { type: 'calendly'; apiKey?: string }\n\t| { type: 'typeform'; apiKey?: string }\n\t| { type: 'webflow'; apiKey?: string }\n\t| { type: 'trello'; apiKey?: string }\n\t| { type: 'perplexity'; apiKey?: string; model?: string }\n\t| { type: 'replicate'; apiKey?: string }\n\t| { type: 'asana'; apiKey?: string }\n\t| { type: 'brevo'; apiKey?: string }\n\t| { type: 'intercom'; apiKey?: string }\n\t| { type: 'google_gemini'; apiKey?: string; model?: string }\n\t// Custom header auth\n\t| { type: 'anthropic'; apiKey?: string; model?: string }\n\t| { type: 'notion'; apiKey?: string }\n\t| { type: 'eleven_labs'; apiKey?: string }\n\t| { type: 'active_campaign'; apiKey?: string; accountUrl: string }\n\t| { type: 'shopify'; apiKey?: string; storeDomain: string }\n\t| { type: 'supabase'; apiKey?: string; projectUrl: string }\n\t| { type: 'mailchimp'; apiKey?: string }\n\t// Basic auth\n\t| { type: 'twilio'; accountSid?: string; authToken?: string }\n\t| { type: 'jira'; email?: string; apiToken?: string; domain: string }\n\t| { type: 'woo_commerce'; consumerKey?: string; consumerSecret?: string; storeUrl: string }\n\t| { type: 'freshdesk'; apiKey?: string; domain: string }\n\t| { type: 'zendesk'; apiToken?: string; email?: string; subdomain: string }\n\t// OAuth / token + instance\n\t| { type: 'salesforce'; accessToken?: string; instanceUrl: string }\n\t| { type: 'zoom'; apiKey?: string }\n\t| { type: 'microsoft_teams'; apiKey?: string }\n\t| { type: 'firebase'; apiKey?: string }\n\t| { type: 'arky'; apiKey?: string }\n\t// Deploy hooks\n\t| { type: 'vercel_deploy_hook'; url?: string }\n\t| { type: 'netlify_deploy_hook'; url?: string }\n\t| { type: 'cloudflare_deploy_hook'; url?: string }\n\t| { type: 'custom_deploy_hook'; url?: string };\n\n/** Business integration — standalone sub-resource with its own CRUD */\nexport interface Integration {\n\tid: string;\n\tbusinessId: string;\n\tkey: string;\n\tprovider: IntegrationProvider;\n\tcreatedAt: number;\n\tupdatedAt: number;\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\tlocationId?: string;\n\tamount: number;\n\tfreeAbove?: number;\n\tweightTiers?: ShippingWeightTier[];\n}\n\nexport interface Location {\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\tlocationId: string;\n\tavailable: number;\n\treserved: number;\n}\n\nexport type ZoneScope = \"all\" | \"order\" | \"booking\";\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 type WebhookEventSubscription =\n\t| { event: 'node.created'; parentId?: string }\n\t| { event: 'node.updated'; key?: string }\n\t| { event: 'node.deleted'; key?: string }\n\t| { event: 'order.created' }\n\t| { event: 'order.updated' }\n\t| { event: 'order.status_changed' }\n\t| { event: 'order.payment_received' }\n\t| { event: 'order.payment_failed' }\n\t| { event: 'order.refunded' }\n\t| { event: 'order.completed' }\n\t| { event: 'order.cancelled' }\n\t| { event: 'order.shipment_created' }\n\t| { event: 'order.shipment_in_transit' }\n\t| { event: 'order.shipment_out_for_delivery' }\n\t| { event: 'order.shipment_delivered' }\n\t| { event: 'order.shipment_failed' }\n\t| { event: 'order.shipment_returned' }\n\t| { event: 'order.shipment_status_changed' }\n\t| { event: 'booking.created' }\n\t| { event: 'booking.updated' }\n\t| { event: 'booking.status_changed' }\n\t| { event: 'booking.payment_received' }\n\t| { event: 'booking.payment_failed' }\n\t| { event: 'booking.refunded' }\n\t| { event: 'booking.completed' }\n\t| { event: 'booking.cancelled' }\n\t| { event: 'product.created' }\n\t| { event: 'product.updated' }\n\t| { event: 'product.deleted' }\n\t| { event: 'provider.created' }\n\t| { event: 'provider.updated' }\n\t| { event: 'provider.deleted' }\n\t| { event: 'service.created' }\n\t| { event: 'service.updated' }\n\t| { event: 'service.deleted' }\n\t| { event: 'media.created' }\n\t| { event: 'media.deleted' }\n\t| { event: 'business.created' }\n\t| { event: 'business.updated' }\n\t| { event: 'business.deleted' }\n\t| { event: 'audience.created' }\n\t| { event: 'audience.updated' }\n\t| { event: 'audience.deleted' };\n\nexport interface Webhook {\n\tid: string;\n\tbusinessId: string;\n\tkey: string;\n\turl: string;\n\tevents: WebhookEventSubscription[];\n\theaders: Record<string, string>;\n\tsecret: string;\n\tenabled: boolean;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport type ChannelAction =\n\t| { type: 'agent'; agentId: string }\n\t| { type: 'workflow'; workflowId: string };\n\nexport interface BusinessConfig {\n\tlanguages: Language[];\n\tmarkets: Market[];\n\tzones: Zone[];\n\tlocations: Location[];\n\taiId?: string | null;\n\temails: BusinessEmails;\n}\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\ttoken: string;\n}\n\nexport interface Business {\n\tid: string;\n\tkey: string;\n\ttimezone: string;\n\tconfigs?: BusinessConfig;\n\tsubscription?: Subscription;\n\tcounts?: Record<string, number>;\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 BlockFilterType = \"text\" | \"number\" | \"boolean\";\n\nexport interface BlockFilter {\n\tid: string;\n\tkey: string;\n\ttype: BlockFilterType;\n\tproperties?: any;\n\tvalue?: any;\n}\n\nexport interface Filter {\n\ttaxonomyId: string;\n\tnetworkId?: string;\n\tblocks: BlockFilter[];\n}\n\nexport type BlockType =\n\t| \"text\"\n\t| \"localized_text\"\n\t| \"number\"\n\t| \"boolean\"\n\t| \"list\"\n\t| \"map\"\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 BookingStoreState {\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\tbookingBlocks: Block[];\n\tapiUrl: string;\n\tbusinessId: string;\n\ttimezone: string;\n\ttzGroups: any;\n\titems: BookingCartItem[];\n\tallowedPaymentMethods: string[];\n\tpaymentConfig: {\n\t\tprovider: { publishableKey: string; currency: string } | null;\n\t\tenabled: boolean;\n\t};\n}\n\nexport type Status = 'active' | 'archived';\n\nexport type OrderStatus = 'created' | 'pending' | 'authorized' | 'confirmed' | 'shipped' | 'completed' | 'cancelled' | 'failed';\n\nexport type BookingStatus = 'created' | 'pending' | 'authorized' | 'confirmed' | 'completed' | 'cancelled' | 'failed';\n\nexport type SubscriptionStatus = 'pending' | 'active' | 'cancellation_scheduled' | 'cancelled' | 'expired';\n\nexport interface BookingItem {\n\tid: string;\n\tserviceId: string;\n\tproviderId: string;\n\tbusinessId: string;\n\tbookingId: string;\n\taccountId: string;\n\tfrom: number;\n\tto: number;\n\tblocks: Block[];\n\tprice: Price;\n}\n\nexport interface Booking {\n\tid: string;\n\tnumber: string;\n\taccountId: string;\n\tblocks: Block[];\n\tbusinessId: string;\n\tstatus: BookingStatus;\n\tserviceIds: string[];\n\tproviderIds: string[];\n\tpayment: Payment;\n\tbusiness?: Business;\n\taccount?: any;\n\titems: BookingItem[];\n\taudienceId?: string;\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\tfilters: Filter[];\n\tstatus: Status;\n\tslug: Record<string, string>;\n\tchildren: Node[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface EmailTemplate {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tsubject: Record<string, string>;\n\tbody: string;\n\tfromName: string;\n\tfromEmail: string;\n\treplyTo?: string;\n\tpreheader?: string;\n\tstatus: Status;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface Form {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tblocks: Block[];\n\tstatus: Status;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface FormSubmission {\n\tid: string;\n\tformId: string;\n\tbusinessId: string;\n\tblocks: Block[];\n\tcreatedAt: number;\n}\n\nexport interface Taxonomy {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tparentId?: string | null;\n\tblocks: Block[];\n\tstatus: Status;\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\tprices: Price[];\n\tdurations: ServiceDuration[];\n\tisApprovalRequired: boolean;\n\taudienceIds: string[];\n\tworkingDays: Array<{ day: string; workingHours: Array<{ from: number; to: number }> }>;\n\tspecificDates: Array<{ date: number; workingHours: Array<{ from: number; to: number }> }>;\n\tcapacity: number;\n\ttimeline: ProviderTimelinePoint[];\n\tprovider?: Provider;\n}\n\nexport interface Service {\n\tid: string;\n\tkey: string;\n\tslug: Record<string, string>;\n\tbusinessId: string;\n\tblocks: Block[];\n\tfilters: Filter[];\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\tbusinessId: string;\n\tstatus: Status;\n\taudienceIds: string[];\n\tblocks: Block[];\n\tfilters: Filter[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface WorkflowConnection {\n\tnode: string;\n\toutput: string;\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\n\tschedule?: string;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport type WorkflowNode =\n\t| WorkflowTriggerNode\n\t| WorkflowHttpNode\n\t| WorkflowSwitchNode\n\t| WorkflowTransformNode\n\t| WorkflowLoopNode;\n\nexport interface WorkflowTriggerNode {\n\ttype: 'trigger';\n\tevent?: string;\n\tdelayMs?: number;\n\tschema?: Block[];\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\tintegrationId?: string;\n\tintegrationProviderId?: string;\n\tdelayMs?: number;\n\tretries?: number;\n\tretryDelayMs?: number;\n\tedges?: WorkflowConnection[];\n}\n\nexport interface WorkflowSwitchRule {\n\tcondition: string;\n}\n\nexport interface WorkflowSwitchNode {\n\ttype: 'switch';\n\trules: WorkflowSwitchRule[];\n\tdelayMs?: number;\n\tedges?: WorkflowConnection[];\n}\n\nexport interface WorkflowTransformNode {\n\ttype: 'transform';\n\tcode: string;\n\tdelayMs?: number;\n\tedges?: WorkflowConnection[];\n}\n\nexport interface WorkflowLoopNode {\n\ttype: 'loop';\n\texpression: string;\n\tdelayMs?: number;\n\tedges?: WorkflowConnection[];\n\tbackEdges?: WorkflowConnection[];\n}\n\nexport type WorkflowHttpMethod = 'get' | 'post' | 'put' | 'patch' | 'delete';\n\nexport type ExecutionStatus = 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';\n\nexport interface NodeResult {\n\toutput: any;\n\troute: string;\n\tstartedAt: number;\n\tcompletedAt: number;\n\tdurationMs: number;\n\terror?: string;\n}\n\nexport interface WorkflowExecution {\n\tid: string;\n\tworkflowId: string;\n\tbusinessId: string;\n\tstatus: ExecutionStatus;\n\tinput: Record<string, any>;\n\tresults: Record<string, NodeResult>;\n\terror?: string;\n\tscheduledAt: number;\n\tstartedAt: number;\n\tcompletedAt?: number;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport type AudienceType =\n\t| { type: 'standard' }\n\t| { type: 'paid'; prices: SubscriptionPrice[] }\n\t| { type: 'confirmation'; confirmationNodeId: string };\n\nexport interface Audience {\n\tid: string;\n\tbusinessId: string;\n\tkey: string;\n\tstatus: Status;\n\ttype: AudienceType;\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_completed' }\n\t| { action: 'order_cancelled'; data: { reason?: string } }\n\t// Order shipment events\n\t| { action: 'order_shipment_created'; data: { shipment_id: string } }\n\t| { action: 'order_shipment_in_transit'; data: { shipment_id: string } }\n\t| { action: 'order_shipment_out_for_delivery'; data: { shipment_id: string } }\n\t| { action: 'order_shipment_delivered'; data: { shipment_id: string } }\n\t| { action: 'order_shipment_failed'; data: { shipment_id: string; reason?: string } }\n\t| { action: 'order_shipment_returned'; data: { shipment_id: string } }\n\t| { action: 'order_shipment_status_changed'; data: { shipment_id: string; from: string; to: string } }\n\t// Booking events\n\t| { action: 'booking_created' }\n\t| { action: 'booking_updated' }\n\t| { action: 'booking_status_changed'; data: { from: string; to: string } }\n\t| { action: 'booking_payment_received'; data: { amount: number; currency: string } }\n\t| { action: 'booking_payment_failed'; data: { reason?: string } }\n\t| { action: 'booking_refunded'; data: { amount: number; currency: string; reason?: string } }\n\t| { action: 'booking_completed' }\n\t| { action: 'booking_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\t| { action: 'audience_deleted' };\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 location) */\nexport interface Shipment {\n\tid: string;\n\tlocationId: 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"]}
|
|
1
|
+
{"version":3,"sources":["../src/types/api.ts","../src/types/index.ts"],"names":["SubscriptionSource","PaymentMethodType"],"mappings":";;;AAo+BO,IAAK,kBAAA,qBAAAA,mBAAAA,KAAL;AACL,EAAAA,oBAAA,QAAA,CAAA,GAAS,QAAA;AACT,EAAAA,oBAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,oBAAA,QAAA,CAAA,GAAS,QAAA;AAHC,EAAA,OAAAA,mBAAAA;AAAA,CAAA,EAAA,kBAAA,IAAA,EAAA;;;ACx7BL,IAAK,iBAAA,qBAAAC,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":["import type { Block, ZoneLocation, WorkflowNode, Status, Address, SubscriptionStatus, AudienceType, IntegrationProvider, WebhookEventSubscription, Parcel, CustomsDeclaration, ShipmentLine } from \"./index\";\n\nexport interface RequestOptions<T = any> {\n headers?: Record<string, string>;\n params?: Record<string, any>;\n transformRequest?: (data: any) => any;\n onSuccess?: (ctx: {\n data: T;\n method: string;\n url: string;\n status: number;\n request?: any;\n durationMs?: number;\n requestId?: string | null;\n }) => void | Promise<void>;\n onError?: (ctx: {\n error: any;\n method: string;\n url: string;\n status?: number;\n request?: any;\n response?: any;\n durationMs?: number;\n requestId?: string | null;\n aborted?: boolean;\n }) => void | Promise<void>;\n}\n\nexport interface EshopItem {\n productId: string;\n variantId: string;\n quantity: number;\n}\n\nexport interface GetQuoteParams {\n items: EshopItem[];\n paymentMethodId?: string;\n shippingMethodId?: string;\n promoCode?: string;\n blocks?: any[];\n /** Zone location for zone/market resolution */\n location?: ZoneLocation;\n}\n\nexport interface OrderCheckoutParams {\n items: EshopItem[];\n paymentMethodId?: string;\n blocks?: any[];\n shippingMethodId: string;\n promoCodeId?: string;\n /** Shipping address for the order */\n shippingAddress?: Address;\n /** Billing address (defaults to shipping address if not provided) */\n billingAddress?: Address;\n}\n\nexport interface GetProductsParams {\n ids?: string[];\n filters?: { taxonomyId: string; blocks?: any[] }[];\n status?: string;\n limit?: number;\n cursor?: string;\n query?: string;\n statuses?: string[];\n sortField?: string;\n sortDirection?: string;\n createdAtFrom?: number | null;\n createdAtTo?: number | null;\n}\n\nexport interface GetNodesParams {\n businessId?: string;\n parentId?: string;\n limit?: number;\n cursor?: string;\n ids?: string[];\n query?: string;\n type?: string;\n key?: string;\n statuses?: string[];\n sortField?: string;\n sortDirection?: string;\n createdAtFrom?: string;\n createdAtTo?: string;\n}\n\nexport interface CreateNodeParams {\n businessId?: string;\n key: string;\n parentId?: string | null;\n blocks?: any[];\n filters?: any[];\n slug?: Record<string, string>;\n audienceIds?: string[];\n status?: string;\n}\n\nexport interface UpdateNodeParams {\n id: string;\n businessId?: string;\n key?: string;\n parentId?: string | null;\n blocks?: any[];\n filters?: any[];\n slug?: Record<string, string>;\n audienceIds?: string[];\n status?: string;\n}\n\nexport interface GetNodeParams {\n id?: string;\n slug?: string;\n key?: string;\n businessId?: string;\n}\n\nexport interface DeleteNodeParams {\n id: string;\n businessId?: string;\n}\n\nexport interface GetNodeChildrenParams {\n id: string;\n businessId?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface UploadBusinessMediaParams {\n businessId?: string;\n files?: File[];\n urls?: string[];\n}\n\nexport interface DeleteBusinessMediaParams {\n id: string;\n mediaId: string;\n}\n\nexport interface GetMediaParams {\n mediaId: string;\n businessId?: string;\n}\n\nexport interface UpdateMediaParams {\n mediaId: string;\n businessId?: string;\n slug?: Record<string, string>;\n}\n\nexport interface GetBusinessMediaParams {\n businessId?: string;\n cursor?: string | null;\n limit: number;\n ids?: string[];\n query?: string;\n mimeType?: string;\n sortField?: string;\n sortDirection?: 'asc' | 'desc';\n}\n\nexport interface LoginAccountParams {\n email?: string;\n provider: string;\n token?: string;\n}\n\nexport interface MagicLinkRequestParams {\n email: string;\n businessId?: string;\n}\n\nexport interface MagicLinkVerifyParams {\n email: string;\n code: string;\n}\n\n\nexport interface GetServicesParams {\n businessId?: string;\n providerId?: string;\n filters?: { taxonomyId: string; blocks?: any[] }[];\n limit?: number;\n cursor?: string;\n query?: string;\n ids?: string[];\n statuses?: string[];\n sortField?: string;\n sortDirection?: string;\n}\n\nexport interface BookingCheckoutParams {\n businessId?: string;\n items: any[];\n paymentMethodId?: string;\n blocks?: any[];\n promoCodeId?: string;\n /** Zone location for zone/market resolution */\n location?: ZoneLocation;\n}\n\nexport interface BookingQuoteItem {\n serviceId: string;\n from: number;\n to: number;\n providerId: string;\n}\n\nexport interface GetBookingQuoteParams {\n businessId?: string;\n items: BookingQuoteItem[];\n paymentMethodId?: string;\n promoCode?: string;\n /** Zone location for zone/market resolution */\n location?: ZoneLocation;\n}\n\nexport interface TimelinePoint {\n timestamp: number;\n concurrent: number;\n}\n\nexport interface WorkingHour {\n from: number;\n to: number;\n}\n\nexport interface WorkingDay {\n day: string;\n workingHours: WorkingHour[];\n}\n\nexport interface SpecificDate {\n date: number;\n workingHours: WorkingHour[];\n}\n\nexport interface ServiceProvider {\n id: string;\n serviceId: string;\n providerId: string;\n businessId: string;\n workingDays: WorkingDay[];\n specificDates: SpecificDate[];\n prices?: any[];\n durations?: any[];\n isApprovalRequired?: boolean;\n capacity: number;\n timeline: TimelinePoint[];\n createdAt?: number;\n updatedAt?: number;\n service?: any;\n provider?: any;\n}\n\nexport interface ProviderWithTimeline {\n id: string;\n key: string;\n businessId: string;\n seo: any;\n status: Status;\n capacity: number;\n audienceIds: string[];\n blocks: Block[];\n createdAt: number;\n updatedAt: number;\n workingDays?: WorkingDay[];\n specificDates?: SpecificDate[];\n timeline: TimelinePoint[];\n}\n\nexport interface GetAnalyticsParams {\n metrics?: string[];\n period?: string;\n startDate?: string;\n endDate?: string;\n interval?: string;\n}\n\nexport interface GetAnalyticsHealthParams {\n \n}\n\nexport interface TrackEmailOpenParams {\n trackingPixelId: string;\n}\n\nexport interface GetDeliveryStatsParams {}\n\nexport type BusinessRole = 'admin' | 'owner' | 'super';\n\nexport interface Discount {\n type: \"items_percentage\" | \"items_fixed\" | \"shipping_percentage\";\n marketId: string;\n bps?: number;\n amount?: number;\n}\n\nexport interface Condition {\n type:\n | \"products\"\n | \"services\"\n | \"min_order_amount\"\n | \"date_range\"\n | \"max_uses\"\n | \"max_uses_per_user\";\n value: string[] | number | { start?: number; end?: number };\n}\n\nexport interface CreatePromoCodeParams {\n code: string;\n discounts: Discount[];\n conditions: Condition[];\n}\n\nexport interface UpdatePromoCodeParams {\n id: string;\n code: string;\n discounts: Discount[];\n conditions: Condition[];\n status?: Status;\n}\n\nexport interface DeletePromoCodeParams {\n id: string;\n}\n\nexport interface GetPromoCodeParams {\n id: string;\n}\n\nexport interface GetPromoCodesParams {\n statuses?: string[];\n query?: string;\n limit?: number;\n cursor?: string;\n sortField?: string;\n sortDirection?: string;\n createdAtFrom?: string;\n createdAtTo?: string;\n startsAtFrom?: string;\n startsAtTo?: string;\n expiresAtFrom?: string;\n expiresAtTo?: string;\n}\n\nexport interface CreateBusinessParams {\n key: string;\n slug?: string;\n description?: string;\n email?: string;\n phone?: string;\n website?: string;\n address?: any;\n settings?: any;\n [key: string]: any;\n}\n\nexport interface UpdateBusinessParams {\n id: string;\n key: string;\n timezone: string;\n configs: any;\n}\n\nexport interface DeleteBusinessParams {\n id: string;\n}\n\nexport interface GetBusinessParams {}\n\n\nexport interface SubscribeParams {\n planId: string;\n successUrl: string;\n cancelUrl: string;\n}\n\nexport interface CreatePortalSessionParams {\n returnUrl: string;\n}\n\nexport interface InviteUserParams {\n email: string;\n role?: BusinessRole;\n}\n\nexport interface RemoveMemberParams {\n accountId: string;\n}\n\nexport interface HandleInvitationParams {\n token: string;\n action: string;\n}\n\nexport interface TestWebhookParams {\n webhook: any;\n}\n\n\nexport interface CreateProductParams {\n key: string;\n description?: string;\n audienceIds?: string[];\n blocks?: any[];\n filters?: any[];\n variants?: any[];\n status?: string;\n [key: string]: any;\n}\n\nexport interface UpdateProductParams {\n id: string;\n key?: string;\n description?: string;\n audienceIds?: string[];\n blocks?: any[];\n filters?: any[];\n variants?: any[];\n status?: string;\n [key: string]: any;\n}\n\nexport interface DeleteProductParams {\n id: string;\n}\n\nexport interface GetProductParams {\n id?: string;\n slug?: string;\n}\n\nexport interface GetOrderParams {\n id: string;\n}\n\nexport interface GetOrdersParams {\n accountId?: string | null;\n statuses?: string[] | null;\n productIds?: string[];\n query?: string | null;\n limit?: number | null;\n cursor?: string | null;\n sortField?: string | null;\n sortDirection?: string | null;\n createdAtFrom?: string | null;\n createdAtTo?: string | null;\n}\n\nexport interface UpdateOrderParams {\n id: string;\n status: string;\n blocks: any[];\n items: any[];\n address?: any | null;\n billingAddress?: any | null;\n payment?: any | null;\n}\n\nexport interface CreateOrderParams {\n [key: string]: any;\n}\n\nexport interface CreateBookingParams {\n businessId?: string;\n [key: string]: any;\n}\n\nexport interface UpdateBookingParams {\n id: string;\n status?: string;\n blocks?: any;\n parts?: any;\n payment?: any | null;\n [key: string]: any;\n}\n\nexport interface CreateProviderParams {\n businessId?: string;\n key: string;\n audienceIds?: string[];\n blocks?: any[];\n filters?: any[];\n status?: Status;\n [key: string]: any;\n}\n\nexport interface UpdateProviderParams {\n id: string;\n businessId?: string;\n key?: string;\n audienceIds?: string[];\n blocks?: any[];\n filters?: any[];\n status?: Status;\n [key: string]: any;\n}\n\nexport interface DeleteProviderParams {\n id: string;\n businessId?: string;\n}\n\nexport interface ServiceProviderInput {\n providerId: string;\n businessId?: string;\n prices?: any[];\n durations?: any[];\n isApprovalRequired?: boolean;\n capacity?: number;\n workingDays: WorkingDay[];\n specificDates: SpecificDate[];\n}\n\nexport interface CreateServiceParams {\n businessId?: string;\n key: string;\n blocks?: any[];\n filters?: any[];\n status?: Status;\n [key: string]: any;\n}\n\nexport interface UpdateServiceParams {\n id: string;\n businessId?: string;\n key?: string;\n blocks?: any[];\n filters?: any[];\n status?: Status;\n [key: string]: any;\n}\n\nexport interface CreateServiceProviderParams {\n businessId?: string;\n serviceId: string;\n providerId: string;\n workingDays: WorkingDay[];\n specificDates: SpecificDate[];\n prices?: any[];\n durations?: any[];\n isApprovalRequired?: boolean;\n}\n\nexport interface UpdateServiceProviderParams {\n businessId?: string;\n id: string;\n workingDays: WorkingDay[];\n specificDates: SpecificDate[];\n prices?: any[];\n durations?: any[];\n isApprovalRequired?: boolean;\n}\n\nexport interface DeleteServiceProviderParams {\n businessId?: string;\n id: string;\n}\n\nexport interface FindServiceProvidersParams {\n businessId?: string;\n serviceId?: string;\n providerId?: string;\n}\n\nexport interface DeleteServiceParams {\n id: string;\n businessId?: string;\n}\n\nexport interface GetServiceParams {\n id?: string;\n slug?: string;\n businessId?: string;\n}\n\nexport interface GetProvidersParams {\n businessId?: string;\n serviceId?: string;\n filters?: { taxonomyId: string; blocks?: any[] }[];\n ids?: string[];\n query?: string | null;\n statuses?: string[] | null;\n limit?: number;\n cursor?: string;\n sortField?: string | null;\n sortDirection?: string | null;\n createdAtFrom?: string | null;\n createdAtTo?: string | null;\n}\n\nexport interface GetProviderParams {\n id?: string;\n slug?: string;\n businessId?: string;\n}\n\nexport interface GetBookingParams {\n id: string;\n businessId?: string;\n}\n\nexport interface SearchBookingsParams {\n businessId?: string;\n query?: string;\n serviceIds?: string[];\n providerIds?: string[];\n accountId?: string;\n from?: number;\n to?: number;\n status?: string;\n limit?: number;\n cursor?: string;\n sortField?: string;\n sortOrder?: string;\n}\n\nexport interface UpdateAccountProfileParams {\n phoneNumbers?: string[];\n addresses?: any[];\n apiTokens?: any[] | null;\n}\n\nexport interface SearchAccountsParams {\n limit?: number;\n cursor?: string | null;\n query?: string;\n owner?: string;\n}\n\nexport interface DeleteAccountParams {}\n\nexport interface TrackEmailOpenParams {\n trackingPixelId: string;\n}\n\n\nexport interface TriggerNotificationParams {\n channel: string;\n businessId: string;\n emailTemplateId?: string;\n recipients?: string[];\n audienceId?: string;\n vars?: Record<string, any>;\n}\n\n// ── EmailTemplate params ──────────────────────────────────────\n\nexport interface GetEmailTemplatesParams {\n businessId?: string;\n limit?: number;\n cursor?: string;\n ids?: string[];\n query?: string;\n key?: string;\n status?: string;\n sortField?: string;\n sortDirection?: \"asc\" | \"desc\";\n createdAtFrom?: number;\n createdAtTo?: number;\n}\n\nexport interface CreateEmailTemplateParams {\n businessId?: string;\n key: string;\n subject?: Record<string, string>;\n body?: string;\n fromName: string;\n fromEmail: string;\n replyTo?: string;\n preheader?: string;\n}\n\nexport interface UpdateEmailTemplateParams {\n id: string;\n businessId?: string;\n key?: string;\n subject?: Record<string, string>;\n body?: string;\n fromName?: string;\n fromEmail?: string;\n replyTo?: string;\n preheader?: string;\n status?: string;\n}\n\nexport interface GetEmailTemplateParams {\n id?: string;\n key?: string;\n businessId?: string;\n}\n\nexport interface DeleteEmailTemplateParams {\n id: string;\n businessId?: string;\n}\n\n// ── Form params ───────────────────────────────────────────────\n\nexport interface GetFormsParams {\n businessId?: string;\n limit?: number;\n cursor?: string;\n ids?: string[];\n query?: string;\n key?: string;\n status?: string;\n sortField?: string;\n sortDirection?: \"asc\" | \"desc\";\n createdAtFrom?: number;\n createdAtTo?: number;\n}\n\nexport interface CreateFormParams {\n businessId?: string;\n key: string;\n blocks?: any[];\n}\n\nexport interface UpdateFormParams {\n id: string;\n businessId?: string;\n key?: string;\n blocks?: any[];\n status?: string;\n}\n\nexport interface GetFormParams {\n id?: string;\n key?: string;\n businessId?: string;\n}\n\nexport interface DeleteFormParams {\n id: string;\n businessId?: string;\n}\n\nexport interface SubmitFormParams {\n formId: string;\n businessId?: string;\n blocks: any[];\n}\n\nexport interface GetFormSubmissionsParams {\n formId: string;\n businessId?: string;\n query?: string;\n limit?: number;\n cursor?: string;\n sortField?: string;\n sortDirection?: \"asc\" | \"desc\";\n createdAtFrom?: number;\n createdAtTo?: number;\n}\n\nexport interface GetFormSubmissionParams {\n id: string;\n formId: string;\n businessId?: string;\n}\n\n// ── Taxonomy params ───────────────────────────────────────────\n\nexport interface GetTaxonomiesParams {\n businessId?: string;\n parentId?: string;\n limit?: number;\n cursor?: string;\n ids?: string[];\n query?: string;\n key?: string;\n status?: string;\n sortField?: string;\n sortDirection?: \"asc\" | \"desc\";\n createdAtFrom?: number;\n createdAtTo?: number;\n}\n\nexport interface CreateTaxonomyParams {\n businessId?: string;\n key: string;\n parentId?: string | null;\n blocks?: any[];\n filters?: any[];\n}\n\nexport interface UpdateTaxonomyParams {\n id: string;\n businessId?: string;\n key?: string;\n parentId?: string | null;\n blocks?: any[];\n filters?: any[];\n status?: string;\n}\n\nexport interface GetTaxonomyParams {\n id?: string;\n key?: string;\n businessId?: string;\n}\n\nexport interface DeleteTaxonomyParams {\n id: string;\n businessId?: string;\n}\n\nexport interface GetTaxonomyChildrenParams {\n id: string;\n businessId?: string;\n}\n\nexport interface GetMeParams {}\n\nexport interface LogoutParams {}\n\nexport interface GetBusinessesParams {\n query?: string;\n limit?: number;\n cursor?: string;\n sortField?: string;\n sortDirection?: \"asc\" | \"desc\";\n}\n\nexport interface GetSubscriptionPlansParams {}\n\nexport interface SetupAnalyticsParams {\n [key: string]: any;\n}\n\nexport interface GetBusinessMediaParams2 {\n id: string;\n cursor?: string | null;\n limit: number;\n ids?: string[];\n query?: string;\n mimeType?: string;\n sortField?: string;\n sortDirection?: 'asc' | 'desc';\n}\n\nexport interface DeleteProductParams {\n id: string;\n}\n\nexport interface ProcessRefundParams {\n id: string;\n entity: string;\n amount: number;\n}\n\nexport type SystemTemplateKey =\n | \"system:booking-business-update\"\n | \"system:booking-customer-update\"\n | \"system:user-invitation\"\n | \"system:order-status-update\"\n | \"system:user-confirmation\"\n | \"system:forgot-password\";\n\nexport interface GetSlotsForDateParams {\n serviceId: string;\n date: Date;\n timezone: string;\n providerId?: string;\n}\n\nexport interface GetAvailabilityParams {\n serviceId: string;\n from: Date;\n to: Date;\n timezone: string;\n}\n\nexport interface DayAvailability {\n date: Date;\n available: boolean;\n}\n\nexport interface Slot {\n id: string;\n serviceId: string;\n providerId: string;\n from: number;\n to: number;\n timeText: string;\n dateText: string;\n}\n\nexport interface CreateWorkflowParams {\n businessId?: string;\n key: string;\n status?: Status;\n nodes: Record<string, WorkflowNode>;\n\n schedule?: string;\n}\n\nexport interface UpdateWorkflowParams {\n id: string;\n key: string;\n status?: Status;\n nodes: Record<string, WorkflowNode>;\n\n schedule?: string;\n}\n\nexport interface DeleteWorkflowParams {\n id: string;\n}\n\nexport interface GetWorkflowParams {\n id: string;\n}\n\nexport interface GetWorkflowsParams {\n businessId?: string;\n ids?: string[];\n query?: string;\n statuses?: string[];\n limit?: number;\n cursor?: string;\n sortField?: string;\n sortDirection?: 'asc' | 'desc';\n createdAtFrom?: number;\n createdAtTo?: number;\n}\n\nexport interface TriggerWorkflowParams {\n\n secret: string;\n\n [key: string]: any;\n}\n\nexport interface GetWorkflowExecutionsParams {\n workflowId: string;\n businessId?: string;\n status?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface GetWorkflowExecutionParams {\n workflowId: string;\n executionId: string;\n businessId?: string;\n}\n\nexport interface CreateAudienceParams {\n key: string;\n name: string;\n type?: AudienceType;\n}\n\nexport interface UpdateAudienceParams {\n id: string;\n key?: string;\n name?: string;\n type?: AudienceType;\n status?: Status;\n}\n\nexport interface GetAudienceParams {\n id?: string;\n key?: string;\n}\n\nexport interface GetAudiencesParams {\n ids?: string[];\n statuses?: string[];\n query?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface SubscribeAudienceParams {\n id: string;\n email: string;\n priceId?: string;\n successUrl?: string;\n cancelUrl?: string;\n confirmUrl?: string;\n}\n\nexport interface DeleteAudienceParams {\n id: string;\n}\n\nexport interface GetAudienceSubscribersParams {\n id: string;\n limit?: number;\n cursor?: string;\n}\n\nexport enum SubscriptionSource {\n Signup = 'signup',\n Admin = 'admin',\n Import = 'import'\n}\n\nexport interface AudienceSubscriber {\n accountId: string;\n email: string;\n subscribedAt?: number;\n source?: SubscriptionSource;\n status?: SubscriptionStatus;\n}\n\nexport interface RemoveAudienceSubscriberParams {\n id: string;\n accountId: string;\n}\n\nexport interface AddAudienceSubscriberParams {\n id: string;\n email: string;\n}\n\nexport interface AddAudienceSubscriberResponse {\n subscriber: AudienceSubscriber | null;\n skipped: boolean;\n}\n\n\nexport interface OAuthConnectParams {\n businessId: string;\n provider: string;\n code: string;\n redirectUri: string;\n}\n\nexport interface OAuthDisconnectParams {\n businessId: string;\n provider: string;\n}\n\n// Integration API Parameters\n\nexport interface ListIntegrationsParams {\n businessId: string;\n}\n\nexport interface GetIntegrationParams {\n businessId: string;\n id: string;\n}\n\nexport interface CreateIntegrationParams {\n businessId: string;\n key: string;\n provider: IntegrationProvider;\n}\n\nexport interface UpdateIntegrationParams {\n businessId: string;\n id: string;\n key?: string;\n provider?: IntegrationProvider;\n}\n\nexport interface DeleteIntegrationParams {\n businessId: string;\n id: string;\n}\n\n// Webhook CRUD Parameters\n\nexport interface ListWebhooksParams {\n businessId: string;\n}\n\nexport interface CreateWebhookParams {\n businessId: string;\n key: string;\n url: string;\n events: WebhookEventSubscription[];\n headers: Record<string, string>;\n secret: string;\n enabled: boolean;\n}\n\nexport interface UpdateWebhookParams {\n businessId: string;\n id: string;\n key: string;\n url: string;\n events: WebhookEventSubscription[];\n headers: Record<string, string>;\n secret: string;\n enabled: boolean;\n}\n\nexport interface DeleteWebhookParams {\n businessId: string;\n id: string;\n}\n\n// Shipping API Parameters\n\n/** Get shipping rates for a shipment */\nexport interface GetShippingRatesParams {\n orderId: string;\n shippingProviderId: string;\n fromAddress: Address;\n toAddress: Address;\n parcel: Parcel;\n customsDeclaration?: CustomsDeclaration;\n}\n\n/** Ship items: creates shipment + purchases label atomically */\nexport interface ShipParams {\n orderId: string;\n rateId: string;\n carrier: string;\n service: string;\n locationId: string;\n lines: ShipmentLine[];\n}\n\n// ===== Agent API Parameters =====\n\nexport type AgentStatus = 'active' | 'disabled';\n\nexport interface CreateAgentParams {\n businessId?: string;\n key: string;\n prompt: string;\n status?: AgentStatus;\n modelId: string;\n channelIds?: string[];\n}\n\nexport interface UpdateAgentParams {\n id: string;\n key: string;\n prompt: string;\n status: AgentStatus;\n modelId: string;\n channelIds?: string[];\n}\n\nexport interface DeleteAgentParams {\n id: string;\n}\n\nexport interface GetAgentParams {\n id: string;\n}\n\nexport interface GetAgentsParams {\n businessId?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface RunAgentParams {\n id: string;\n message: string;\n chatId?: string;\n direct?: boolean;\n}\n\nexport interface GetAgentChatsParams {\n id: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface GetBusinessChatsParams {\n businessId?: string;\n agentId?: string;\n status?: string;\n query?: string;\n sortField?: string;\n sortDirection?: 'asc' | 'desc';\n limit?: number;\n cursor?: string;\n}\n\nexport interface GetAgentChatParams {\n id: string;\n chatId: string;\n}\n\nexport interface UpdateAgentChatParams {\n id: string;\n chatId: string;\n status: 'active' | 'archived';\n}\n\nexport interface RateAgentChatParams {\n id: string;\n chatId: string;\n rating: number;\n comment?: string;\n}\n\n// ===== Network API Parameters =====\n\nexport interface NetworkNode {\n id?: string;\n key: string;\n blocks?: any[];\n}\n\nexport interface Network {\n id: string;\n key: string;\n nodes: NetworkNode[];\n createdAt: number;\n updatedAt: number;\n}\n\nexport interface CreateNetworkParams {\n key: string;\n nodes?: NetworkNode[];\n}\n\nexport interface UpdateNetworkParams {\n id: string;\n key: string;\n nodes: NetworkNode[];\n}\n\nexport interface GetNetworkParams {\n id: string;\n}\n\nexport interface FindNetworksParams {\n query?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface DeleteNetworkParams {\n id: string;\n}\n\n","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\taudienceId?: string;\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 locations.\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/**\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 BookingCartItem {\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/** Integration provider — typed data per service */\nexport type IntegrationProvider =\n\t| { type: 'stripe'; secretKey?: string; publishableKey: string; webhookSecret?: string; currency: string; activeForCardPayments?: boolean }\n\t| { type: 'shippo'; apiToken?: string; activeForFulfillment?: boolean }\n\t| { type: 'google'; clientId?: string; clientSecret?: string; accessToken?: string; refreshToken?: string;\n\t\ttokenExpiresAt?: number; scopes: string[]; accountEmail?: string | null; connectedAt: number }\n\t| { type: 'google_analytics4'; measurementId: string; activeForTracking?: boolean }\n\t| { type: 'telegram_bot'; botToken?: string; action: ChannelAction }\n\t| { type: 'deep_seek'; apiKey?: string; model?: string }\n\t// Bearer token providers\n\t| { type: 'open_ai'; apiKey?: string; model?: string }\n\t| { type: 'slack'; apiKey?: string }\n\t| { type: 'discord'; apiKey?: string }\n\t| { type: 'whats_app'; apiKey?: string }\n\t| { type: 'resend'; apiKey?: string }\n\t| { type: 'send_grid'; apiKey?: string }\n\t| { type: 'airtable'; apiKey?: string }\n\t| { type: 'linear'; apiKey?: string }\n\t| { type: 'git_hub'; apiKey?: string }\n\t| { type: 'git_lab'; apiKey?: string }\n\t| { type: 'dropbox'; apiKey?: string }\n\t| { type: 'hub_spot'; apiKey?: string }\n\t| { type: 'monday'; apiKey?: string }\n\t| { type: 'click_up'; apiKey?: string }\n\t| { type: 'pipedrive'; apiKey?: string }\n\t| { type: 'calendly'; apiKey?: string }\n\t| { type: 'typeform'; apiKey?: string }\n\t| { type: 'webflow'; apiKey?: string }\n\t| { type: 'trello'; apiKey?: string }\n\t| { type: 'perplexity'; apiKey?: string; model?: string }\n\t| { type: 'replicate'; apiKey?: string }\n\t| { type: 'asana'; apiKey?: string }\n\t| { type: 'brevo'; apiKey?: string }\n\t| { type: 'intercom'; apiKey?: string }\n\t| { type: 'google_gemini'; apiKey?: string; model?: string }\n\t// Custom header auth\n\t| { type: 'anthropic'; apiKey?: string; model?: string }\n\t| { type: 'notion'; apiKey?: string }\n\t| { type: 'eleven_labs'; apiKey?: string }\n\t| { type: 'active_campaign'; apiKey?: string; accountUrl: string }\n\t| { type: 'shopify'; apiKey?: string; storeDomain: string }\n\t| { type: 'supabase'; apiKey?: string; projectUrl: string }\n\t| { type: 'mailchimp'; apiKey?: string }\n\t// Basic auth\n\t| { type: 'twilio'; accountSid?: string; authToken?: string }\n\t| { type: 'jira'; email?: string; apiToken?: string; domain: string }\n\t| { type: 'woo_commerce'; consumerKey?: string; consumerSecret?: string; storeUrl: string }\n\t| { type: 'freshdesk'; apiKey?: string; domain: string }\n\t| { type: 'zendesk'; apiToken?: string; email?: string; subdomain: string }\n\t// OAuth / token + instance\n\t| { type: 'salesforce'; accessToken?: string; instanceUrl: string }\n\t| { type: 'zoom'; apiKey?: string }\n\t| { type: 'microsoft_teams'; apiKey?: string }\n\t| { type: 'firebase'; apiKey?: string }\n\t| { type: 'arky'; apiKey?: string }\n\t// Deploy hooks\n\t| { type: 'vercel_deploy_hook'; url?: string }\n\t| { type: 'netlify_deploy_hook'; url?: string }\n\t| { type: 'cloudflare_deploy_hook'; url?: string }\n\t| { type: 'custom_deploy_hook'; url?: string };\n\n/** Business integration — standalone sub-resource with its own CRUD */\nexport interface Integration {\n\tid: string;\n\tbusinessId: string;\n\tkey: string;\n\tprovider: IntegrationProvider;\n\tcreatedAt: number;\n\tupdatedAt: number;\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\tlocationId?: string;\n\tamount: number;\n\tfreeAbove?: number;\n\tweightTiers?: ShippingWeightTier[];\n}\n\nexport interface Location {\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\tlocationId: string;\n\tavailable: number;\n\treserved: number;\n}\n\nexport type ZoneScope = \"all\" | \"order\" | \"booking\";\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 type WebhookEventSubscription =\n\t| { event: 'node.created'; parentId?: string }\n\t| { event: 'node.updated'; key?: string }\n\t| { event: 'node.deleted'; key?: string }\n\t| { event: 'order.created' }\n\t| { event: 'order.updated' }\n\t| { event: 'order.status_changed' }\n\t| { event: 'order.payment_received' }\n\t| { event: 'order.payment_failed' }\n\t| { event: 'order.refunded' }\n\t| { event: 'order.completed' }\n\t| { event: 'order.cancelled' }\n\t| { event: 'order.shipment_created' }\n\t| { event: 'order.shipment_in_transit' }\n\t| { event: 'order.shipment_out_for_delivery' }\n\t| { event: 'order.shipment_delivered' }\n\t| { event: 'order.shipment_failed' }\n\t| { event: 'order.shipment_returned' }\n\t| { event: 'order.shipment_status_changed' }\n\t| { event: 'booking.created' }\n\t| { event: 'booking.updated' }\n\t| { event: 'booking.status_changed' }\n\t| { event: 'booking.payment_received' }\n\t| { event: 'booking.payment_failed' }\n\t| { event: 'booking.refunded' }\n\t| { event: 'booking.completed' }\n\t| { event: 'booking.cancelled' }\n\t| { event: 'product.created' }\n\t| { event: 'product.updated' }\n\t| { event: 'product.deleted' }\n\t| { event: 'provider.created' }\n\t| { event: 'provider.updated' }\n\t| { event: 'provider.deleted' }\n\t| { event: 'service.created' }\n\t| { event: 'service.updated' }\n\t| { event: 'service.deleted' }\n\t| { event: 'media.created' }\n\t| { event: 'media.deleted' }\n\t| { event: 'business.created' }\n\t| { event: 'business.updated' }\n\t| { event: 'business.deleted' }\n\t| { event: 'audience.created' }\n\t| { event: 'audience.updated' }\n\t| { event: 'audience.deleted' };\n\nexport interface Webhook {\n\tid: string;\n\tbusinessId: string;\n\tkey: string;\n\turl: string;\n\tevents: WebhookEventSubscription[];\n\theaders: Record<string, string>;\n\tsecret: string;\n\tenabled: boolean;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport type ChannelAction =\n\t| { type: 'agent'; agentId: string }\n\t| { type: 'workflow'; workflowId: string };\n\nexport interface BusinessConfig {\n\tlanguages: Language[];\n\tmarkets: Market[];\n\tzones: Zone[];\n\tlocations: Location[];\n\taiId?: string | null;\n\temails: BusinessEmails;\n}\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\ttoken: string;\n}\n\nexport interface Business {\n\tid: string;\n\tkey: string;\n\ttimezone: string;\n\tconfigs?: BusinessConfig;\n\tsubscription?: Subscription;\n\tcounts?: Record<string, number>;\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 BlockFilterType = \"text\" | \"number\" | \"boolean\";\n\nexport interface BlockFilter {\n\tid: string;\n\tkey: string;\n\ttype: BlockFilterType;\n\tproperties?: any;\n\tvalue?: any;\n}\n\nexport interface Filter {\n\ttaxonomyId: string;\n\tnetworkId?: string;\n\tblocks: BlockFilter[];\n}\n\nexport type BlockType =\n\t| \"text\"\n\t| \"localized_text\"\n\t| \"number\"\n\t| \"boolean\"\n\t| \"list\"\n\t| \"map\"\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 BookingStoreState {\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\tbookingBlocks: Block[];\n\tapiUrl: string;\n\tbusinessId: string;\n\ttimezone: string;\n\ttzGroups: any;\n\titems: BookingCartItem[];\n\tallowedPaymentMethods: string[];\n\tpaymentConfig: {\n\t\tprovider: { publishableKey: string; currency: string } | null;\n\t\tenabled: boolean;\n\t};\n}\n\nexport type Status = 'active' | 'archived';\n\nexport type OrderStatus = 'created' | 'pending' | 'authorized' | 'confirmed' | 'shipped' | 'completed' | 'cancelled' | 'failed';\n\nexport type BookingStatus = 'created' | 'pending' | 'authorized' | 'confirmed' | 'completed' | 'cancelled' | 'failed';\n\nexport type SubscriptionStatus = 'pending' | 'active' | 'cancellation_scheduled' | 'cancelled' | 'expired';\n\nexport interface BookingItem {\n\tid: string;\n\tserviceId: string;\n\tproviderId: string;\n\tbusinessId: string;\n\tbookingId: string;\n\taccountId: string;\n\tfrom: number;\n\tto: number;\n\tblocks: Block[];\n\tprice: Price;\n}\n\nexport interface Booking {\n\tid: string;\n\tnumber: string;\n\taccountId: string;\n\tblocks: Block[];\n\tbusinessId: string;\n\tstatus: BookingStatus;\n\tserviceIds: string[];\n\tproviderIds: string[];\n\tpayment: Payment;\n\tbusiness?: Business;\n\taccount?: any;\n\titems: BookingItem[];\n\taudienceId?: string;\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\tfilters: Filter[];\n\tstatus: Status;\n\tslug: Record<string, string>;\n\tchildren: Node[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface EmailTemplate {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tsubject: Record<string, string>;\n\tbody: string;\n\tfromName: string;\n\tfromEmail: string;\n\treplyTo?: string;\n\tpreheader?: string;\n\tstatus: Status;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface Form {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tblocks: Block[];\n\tstatus: Status;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface FormSubmission {\n\tid: string;\n\tformId: string;\n\tbusinessId: string;\n\tblocks: Block[];\n\tcreatedAt: number;\n}\n\nexport interface Taxonomy {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tparentId?: string | null;\n\tblocks: Block[];\n\tstatus: Status;\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\tprices: Price[];\n\tdurations: ServiceDuration[];\n\tisApprovalRequired: boolean;\n\taudienceIds: string[];\n\tworkingDays: Array<{ day: string; workingHours: Array<{ from: number; to: number }> }>;\n\tspecificDates: Array<{ date: number; workingHours: Array<{ from: number; to: number }> }>;\n\tcapacity: number;\n\ttimeline: ProviderTimelinePoint[];\n\tprovider?: Provider;\n}\n\nexport interface Service {\n\tid: string;\n\tkey: string;\n\tslug: Record<string, string>;\n\tbusinessId: string;\n\tblocks: Block[];\n\tfilters: Filter[];\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\tbusinessId: string;\n\tstatus: Status;\n\taudienceIds: string[];\n\tblocks: Block[];\n\tfilters: Filter[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface WorkflowConnection {\n\tnode: string;\n\toutput: string;\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\n\tschedule?: string;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport type WorkflowNode =\n\t| WorkflowTriggerNode\n\t| WorkflowHttpNode\n\t| WorkflowSwitchNode\n\t| WorkflowTransformNode\n\t| WorkflowLoopNode;\n\nexport interface WorkflowTriggerNode {\n\ttype: 'trigger';\n\tevent?: string;\n\tdelayMs?: number;\n\tschema?: Block[];\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\tintegrationId?: string;\n\tintegrationProviderId?: string;\n\tdelayMs?: number;\n\tretries?: number;\n\tretryDelayMs?: number;\n\tedges?: WorkflowConnection[];\n}\n\nexport interface WorkflowSwitchRule {\n\tcondition: string;\n}\n\nexport interface WorkflowSwitchNode {\n\ttype: 'switch';\n\trules: WorkflowSwitchRule[];\n\tdelayMs?: number;\n\tedges?: WorkflowConnection[];\n}\n\nexport interface WorkflowTransformNode {\n\ttype: 'transform';\n\tcode: string;\n\tdelayMs?: number;\n\tedges?: WorkflowConnection[];\n}\n\nexport interface WorkflowLoopNode {\n\ttype: 'loop';\n\texpression: string;\n\tdelayMs?: number;\n\tedges?: WorkflowConnection[];\n\tbackEdges?: WorkflowConnection[];\n}\n\nexport type WorkflowHttpMethod = 'get' | 'post' | 'put' | 'patch' | 'delete';\n\nexport type ExecutionStatus = 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';\n\nexport interface NodeResult {\n\toutput: any;\n\troute: string;\n\tstartedAt: number;\n\tcompletedAt: number;\n\tdurationMs: number;\n\terror?: string;\n}\n\nexport interface WorkflowExecution {\n\tid: string;\n\tworkflowId: string;\n\tbusinessId: string;\n\tstatus: ExecutionStatus;\n\tinput: Record<string, any>;\n\tresults: Record<string, NodeResult>;\n\terror?: string;\n\tscheduledAt: number;\n\tstartedAt: number;\n\tcompletedAt?: number;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport type AudienceType =\n\t| { type: 'standard' }\n\t| { type: 'paid'; prices: SubscriptionPrice[] }\n\t| { type: 'confirmation'; confirmationNodeId: string };\n\nexport interface Audience {\n\tid: string;\n\tbusinessId: string;\n\tkey: string;\n\tstatus: Status;\n\ttype: AudienceType;\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_completed' }\n\t| { action: 'order_cancelled'; data: { reason?: string } }\n\t// Order shipment events\n\t| { action: 'order_shipment_created'; data: { shipment_id: string } }\n\t| { action: 'order_shipment_in_transit'; data: { shipment_id: string } }\n\t| { action: 'order_shipment_out_for_delivery'; data: { shipment_id: string } }\n\t| { action: 'order_shipment_delivered'; data: { shipment_id: string } }\n\t| { action: 'order_shipment_failed'; data: { shipment_id: string; reason?: string } }\n\t| { action: 'order_shipment_returned'; data: { shipment_id: string } }\n\t| { action: 'order_shipment_status_changed'; data: { shipment_id: string; from: string; to: string } }\n\t// Booking events\n\t| { action: 'booking_created' }\n\t| { action: 'booking_updated' }\n\t| { action: 'booking_status_changed'; data: { from: string; to: string } }\n\t| { action: 'booking_payment_received'; data: { amount: number; currency: string } }\n\t| { action: 'booking_payment_failed'; data: { reason?: string } }\n\t| { action: 'booking_refunded'; data: { amount: number; currency: string; reason?: string } }\n\t| { action: 'booking_completed' }\n\t| { action: 'booking_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\t| { action: 'audience_deleted' };\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 location) */\nexport interface Shipment {\n\tid: string;\n\tlocationId: 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"]}
|
package/dist/types.d.cts
CHANGED
|
@@ -1821,6 +1821,7 @@ interface CreateTaxonomyParams {
|
|
|
1821
1821
|
key: string;
|
|
1822
1822
|
parentId?: string | null;
|
|
1823
1823
|
blocks?: any[];
|
|
1824
|
+
filters?: any[];
|
|
1824
1825
|
}
|
|
1825
1826
|
interface UpdateTaxonomyParams {
|
|
1826
1827
|
id: string;
|
|
@@ -1828,6 +1829,7 @@ interface UpdateTaxonomyParams {
|
|
|
1828
1829
|
key?: string;
|
|
1829
1830
|
parentId?: string | null;
|
|
1830
1831
|
blocks?: any[];
|
|
1832
|
+
filters?: any[];
|
|
1831
1833
|
status?: string;
|
|
1832
1834
|
}
|
|
1833
1835
|
interface GetTaxonomyParams {
|
package/dist/types.d.ts
CHANGED
|
@@ -1821,6 +1821,7 @@ interface CreateTaxonomyParams {
|
|
|
1821
1821
|
key: string;
|
|
1822
1822
|
parentId?: string | null;
|
|
1823
1823
|
blocks?: any[];
|
|
1824
|
+
filters?: any[];
|
|
1824
1825
|
}
|
|
1825
1826
|
interface UpdateTaxonomyParams {
|
|
1826
1827
|
id: string;
|
|
@@ -1828,6 +1829,7 @@ interface UpdateTaxonomyParams {
|
|
|
1828
1829
|
key?: string;
|
|
1829
1830
|
parentId?: string | null;
|
|
1830
1831
|
blocks?: any[];
|
|
1832
|
+
filters?: any[];
|
|
1831
1833
|
status?: string;
|
|
1832
1834
|
}
|
|
1833
1835
|
interface GetTaxonomyParams {
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/api.ts","../src/types/index.ts"],"names":["SubscriptionSource","PaymentMethodType"],"mappings":";AAk+BO,IAAK,kBAAA,qBAAAA,mBAAAA,KAAL;AACL,EAAAA,oBAAA,QAAA,CAAA,GAAS,QAAA;AACT,EAAAA,oBAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,oBAAA,QAAA,CAAA,GAAS,QAAA;AAHC,EAAA,OAAAA,mBAAAA;AAAA,CAAA,EAAA,kBAAA,IAAA,EAAA;;;ACt7BL,IAAK,iBAAA,qBAAAC,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":["import type { Block, ZoneLocation, WorkflowNode, Status, Address, SubscriptionStatus, AudienceType, IntegrationProvider, WebhookEventSubscription, Parcel, CustomsDeclaration, ShipmentLine } from \"./index\";\n\nexport interface RequestOptions<T = any> {\n headers?: Record<string, string>;\n params?: Record<string, any>;\n transformRequest?: (data: any) => any;\n onSuccess?: (ctx: {\n data: T;\n method: string;\n url: string;\n status: number;\n request?: any;\n durationMs?: number;\n requestId?: string | null;\n }) => void | Promise<void>;\n onError?: (ctx: {\n error: any;\n method: string;\n url: string;\n status?: number;\n request?: any;\n response?: any;\n durationMs?: number;\n requestId?: string | null;\n aborted?: boolean;\n }) => void | Promise<void>;\n}\n\nexport interface EshopItem {\n productId: string;\n variantId: string;\n quantity: number;\n}\n\nexport interface GetQuoteParams {\n items: EshopItem[];\n paymentMethodId?: string;\n shippingMethodId?: string;\n promoCode?: string;\n blocks?: any[];\n /** Zone location for zone/market resolution */\n location?: ZoneLocation;\n}\n\nexport interface OrderCheckoutParams {\n items: EshopItem[];\n paymentMethodId?: string;\n blocks?: any[];\n shippingMethodId: string;\n promoCodeId?: string;\n /** Shipping address for the order */\n shippingAddress?: Address;\n /** Billing address (defaults to shipping address if not provided) */\n billingAddress?: Address;\n}\n\nexport interface GetProductsParams {\n ids?: string[];\n filters?: { taxonomyId: string; blocks?: any[] }[];\n status?: string;\n limit?: number;\n cursor?: string;\n query?: string;\n statuses?: string[];\n sortField?: string;\n sortDirection?: string;\n createdAtFrom?: number | null;\n createdAtTo?: number | null;\n}\n\nexport interface GetNodesParams {\n businessId?: string;\n parentId?: string;\n limit?: number;\n cursor?: string;\n ids?: string[];\n query?: string;\n type?: string;\n key?: string;\n statuses?: string[];\n sortField?: string;\n sortDirection?: string;\n createdAtFrom?: string;\n createdAtTo?: string;\n}\n\nexport interface CreateNodeParams {\n businessId?: string;\n key: string;\n parentId?: string | null;\n blocks?: any[];\n filters?: any[];\n slug?: Record<string, string>;\n audienceIds?: string[];\n status?: string;\n}\n\nexport interface UpdateNodeParams {\n id: string;\n businessId?: string;\n key?: string;\n parentId?: string | null;\n blocks?: any[];\n filters?: any[];\n slug?: Record<string, string>;\n audienceIds?: string[];\n status?: string;\n}\n\nexport interface GetNodeParams {\n id?: string;\n slug?: string;\n key?: string;\n businessId?: string;\n}\n\nexport interface DeleteNodeParams {\n id: string;\n businessId?: string;\n}\n\nexport interface GetNodeChildrenParams {\n id: string;\n businessId?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface UploadBusinessMediaParams {\n businessId?: string;\n files?: File[];\n urls?: string[];\n}\n\nexport interface DeleteBusinessMediaParams {\n id: string;\n mediaId: string;\n}\n\nexport interface GetMediaParams {\n mediaId: string;\n businessId?: string;\n}\n\nexport interface UpdateMediaParams {\n mediaId: string;\n businessId?: string;\n slug?: Record<string, string>;\n}\n\nexport interface GetBusinessMediaParams {\n businessId?: string;\n cursor?: string | null;\n limit: number;\n ids?: string[];\n query?: string;\n mimeType?: string;\n sortField?: string;\n sortDirection?: 'asc' | 'desc';\n}\n\nexport interface LoginAccountParams {\n email?: string;\n provider: string;\n token?: string;\n}\n\nexport interface MagicLinkRequestParams {\n email: string;\n businessId?: string;\n}\n\nexport interface MagicLinkVerifyParams {\n email: string;\n code: string;\n}\n\n\nexport interface GetServicesParams {\n businessId?: string;\n providerId?: string;\n filters?: { taxonomyId: string; blocks?: any[] }[];\n limit?: number;\n cursor?: string;\n query?: string;\n ids?: string[];\n statuses?: string[];\n sortField?: string;\n sortDirection?: string;\n}\n\nexport interface BookingCheckoutParams {\n businessId?: string;\n items: any[];\n paymentMethodId?: string;\n blocks?: any[];\n promoCodeId?: string;\n /** Zone location for zone/market resolution */\n location?: ZoneLocation;\n}\n\nexport interface BookingQuoteItem {\n serviceId: string;\n from: number;\n to: number;\n providerId: string;\n}\n\nexport interface GetBookingQuoteParams {\n businessId?: string;\n items: BookingQuoteItem[];\n paymentMethodId?: string;\n promoCode?: string;\n /** Zone location for zone/market resolution */\n location?: ZoneLocation;\n}\n\nexport interface TimelinePoint {\n timestamp: number;\n concurrent: number;\n}\n\nexport interface WorkingHour {\n from: number;\n to: number;\n}\n\nexport interface WorkingDay {\n day: string;\n workingHours: WorkingHour[];\n}\n\nexport interface SpecificDate {\n date: number;\n workingHours: WorkingHour[];\n}\n\nexport interface ServiceProvider {\n id: string;\n serviceId: string;\n providerId: string;\n businessId: string;\n workingDays: WorkingDay[];\n specificDates: SpecificDate[];\n prices?: any[];\n durations?: any[];\n isApprovalRequired?: boolean;\n capacity: number;\n timeline: TimelinePoint[];\n createdAt?: number;\n updatedAt?: number;\n service?: any;\n provider?: any;\n}\n\nexport interface ProviderWithTimeline {\n id: string;\n key: string;\n businessId: string;\n seo: any;\n status: Status;\n capacity: number;\n audienceIds: string[];\n blocks: Block[];\n createdAt: number;\n updatedAt: number;\n workingDays?: WorkingDay[];\n specificDates?: SpecificDate[];\n timeline: TimelinePoint[];\n}\n\nexport interface GetAnalyticsParams {\n metrics?: string[];\n period?: string;\n startDate?: string;\n endDate?: string;\n interval?: string;\n}\n\nexport interface GetAnalyticsHealthParams {\n \n}\n\nexport interface TrackEmailOpenParams {\n trackingPixelId: string;\n}\n\nexport interface GetDeliveryStatsParams {}\n\nexport type BusinessRole = 'admin' | 'owner' | 'super';\n\nexport interface Discount {\n type: \"items_percentage\" | \"items_fixed\" | \"shipping_percentage\";\n marketId: string;\n bps?: number;\n amount?: number;\n}\n\nexport interface Condition {\n type:\n | \"products\"\n | \"services\"\n | \"min_order_amount\"\n | \"date_range\"\n | \"max_uses\"\n | \"max_uses_per_user\";\n value: string[] | number | { start?: number; end?: number };\n}\n\nexport interface CreatePromoCodeParams {\n code: string;\n discounts: Discount[];\n conditions: Condition[];\n}\n\nexport interface UpdatePromoCodeParams {\n id: string;\n code: string;\n discounts: Discount[];\n conditions: Condition[];\n status?: Status;\n}\n\nexport interface DeletePromoCodeParams {\n id: string;\n}\n\nexport interface GetPromoCodeParams {\n id: string;\n}\n\nexport interface GetPromoCodesParams {\n statuses?: string[];\n query?: string;\n limit?: number;\n cursor?: string;\n sortField?: string;\n sortDirection?: string;\n createdAtFrom?: string;\n createdAtTo?: string;\n startsAtFrom?: string;\n startsAtTo?: string;\n expiresAtFrom?: string;\n expiresAtTo?: string;\n}\n\nexport interface CreateBusinessParams {\n key: string;\n slug?: string;\n description?: string;\n email?: string;\n phone?: string;\n website?: string;\n address?: any;\n settings?: any;\n [key: string]: any;\n}\n\nexport interface UpdateBusinessParams {\n id: string;\n key: string;\n timezone: string;\n configs: any;\n}\n\nexport interface DeleteBusinessParams {\n id: string;\n}\n\nexport interface GetBusinessParams {}\n\n\nexport interface SubscribeParams {\n planId: string;\n successUrl: string;\n cancelUrl: string;\n}\n\nexport interface CreatePortalSessionParams {\n returnUrl: string;\n}\n\nexport interface InviteUserParams {\n email: string;\n role?: BusinessRole;\n}\n\nexport interface RemoveMemberParams {\n accountId: string;\n}\n\nexport interface HandleInvitationParams {\n token: string;\n action: string;\n}\n\nexport interface TestWebhookParams {\n webhook: any;\n}\n\n\nexport interface CreateProductParams {\n key: string;\n description?: string;\n audienceIds?: string[];\n blocks?: any[];\n filters?: any[];\n variants?: any[];\n status?: string;\n [key: string]: any;\n}\n\nexport interface UpdateProductParams {\n id: string;\n key?: string;\n description?: string;\n audienceIds?: string[];\n blocks?: any[];\n filters?: any[];\n variants?: any[];\n status?: string;\n [key: string]: any;\n}\n\nexport interface DeleteProductParams {\n id: string;\n}\n\nexport interface GetProductParams {\n id?: string;\n slug?: string;\n}\n\nexport interface GetOrderParams {\n id: string;\n}\n\nexport interface GetOrdersParams {\n accountId?: string | null;\n statuses?: string[] | null;\n productIds?: string[];\n query?: string | null;\n limit?: number | null;\n cursor?: string | null;\n sortField?: string | null;\n sortDirection?: string | null;\n createdAtFrom?: string | null;\n createdAtTo?: string | null;\n}\n\nexport interface UpdateOrderParams {\n id: string;\n status: string;\n blocks: any[];\n items: any[];\n address?: any | null;\n billingAddress?: any | null;\n payment?: any | null;\n}\n\nexport interface CreateOrderParams {\n [key: string]: any;\n}\n\nexport interface CreateBookingParams {\n businessId?: string;\n [key: string]: any;\n}\n\nexport interface UpdateBookingParams {\n id: string;\n status?: string;\n blocks?: any;\n parts?: any;\n payment?: any | null;\n [key: string]: any;\n}\n\nexport interface CreateProviderParams {\n businessId?: string;\n key: string;\n audienceIds?: string[];\n blocks?: any[];\n filters?: any[];\n status?: Status;\n [key: string]: any;\n}\n\nexport interface UpdateProviderParams {\n id: string;\n businessId?: string;\n key?: string;\n audienceIds?: string[];\n blocks?: any[];\n filters?: any[];\n status?: Status;\n [key: string]: any;\n}\n\nexport interface DeleteProviderParams {\n id: string;\n businessId?: string;\n}\n\nexport interface ServiceProviderInput {\n providerId: string;\n businessId?: string;\n prices?: any[];\n durations?: any[];\n isApprovalRequired?: boolean;\n capacity?: number;\n workingDays: WorkingDay[];\n specificDates: SpecificDate[];\n}\n\nexport interface CreateServiceParams {\n businessId?: string;\n key: string;\n blocks?: any[];\n filters?: any[];\n status?: Status;\n [key: string]: any;\n}\n\nexport interface UpdateServiceParams {\n id: string;\n businessId?: string;\n key?: string;\n blocks?: any[];\n filters?: any[];\n status?: Status;\n [key: string]: any;\n}\n\nexport interface CreateServiceProviderParams {\n businessId?: string;\n serviceId: string;\n providerId: string;\n workingDays: WorkingDay[];\n specificDates: SpecificDate[];\n prices?: any[];\n durations?: any[];\n isApprovalRequired?: boolean;\n}\n\nexport interface UpdateServiceProviderParams {\n businessId?: string;\n id: string;\n workingDays: WorkingDay[];\n specificDates: SpecificDate[];\n prices?: any[];\n durations?: any[];\n isApprovalRequired?: boolean;\n}\n\nexport interface DeleteServiceProviderParams {\n businessId?: string;\n id: string;\n}\n\nexport interface FindServiceProvidersParams {\n businessId?: string;\n serviceId?: string;\n providerId?: string;\n}\n\nexport interface DeleteServiceParams {\n id: string;\n businessId?: string;\n}\n\nexport interface GetServiceParams {\n id?: string;\n slug?: string;\n businessId?: string;\n}\n\nexport interface GetProvidersParams {\n businessId?: string;\n serviceId?: string;\n filters?: { taxonomyId: string; blocks?: any[] }[];\n ids?: string[];\n query?: string | null;\n statuses?: string[] | null;\n limit?: number;\n cursor?: string;\n sortField?: string | null;\n sortDirection?: string | null;\n createdAtFrom?: string | null;\n createdAtTo?: string | null;\n}\n\nexport interface GetProviderParams {\n id?: string;\n slug?: string;\n businessId?: string;\n}\n\nexport interface GetBookingParams {\n id: string;\n businessId?: string;\n}\n\nexport interface SearchBookingsParams {\n businessId?: string;\n query?: string;\n serviceIds?: string[];\n providerIds?: string[];\n accountId?: string;\n from?: number;\n to?: number;\n status?: string;\n limit?: number;\n cursor?: string;\n sortField?: string;\n sortOrder?: string;\n}\n\nexport interface UpdateAccountProfileParams {\n phoneNumbers?: string[];\n addresses?: any[];\n apiTokens?: any[] | null;\n}\n\nexport interface SearchAccountsParams {\n limit?: number;\n cursor?: string | null;\n query?: string;\n owner?: string;\n}\n\nexport interface DeleteAccountParams {}\n\nexport interface TrackEmailOpenParams {\n trackingPixelId: string;\n}\n\n\nexport interface TriggerNotificationParams {\n channel: string;\n businessId: string;\n emailTemplateId?: string;\n recipients?: string[];\n audienceId?: string;\n vars?: Record<string, any>;\n}\n\n// ── EmailTemplate params ──────────────────────────────────────\n\nexport interface GetEmailTemplatesParams {\n businessId?: string;\n limit?: number;\n cursor?: string;\n ids?: string[];\n query?: string;\n key?: string;\n status?: string;\n sortField?: string;\n sortDirection?: \"asc\" | \"desc\";\n createdAtFrom?: number;\n createdAtTo?: number;\n}\n\nexport interface CreateEmailTemplateParams {\n businessId?: string;\n key: string;\n subject?: Record<string, string>;\n body?: string;\n fromName: string;\n fromEmail: string;\n replyTo?: string;\n preheader?: string;\n}\n\nexport interface UpdateEmailTemplateParams {\n id: string;\n businessId?: string;\n key?: string;\n subject?: Record<string, string>;\n body?: string;\n fromName?: string;\n fromEmail?: string;\n replyTo?: string;\n preheader?: string;\n status?: string;\n}\n\nexport interface GetEmailTemplateParams {\n id?: string;\n key?: string;\n businessId?: string;\n}\n\nexport interface DeleteEmailTemplateParams {\n id: string;\n businessId?: string;\n}\n\n// ── Form params ───────────────────────────────────────────────\n\nexport interface GetFormsParams {\n businessId?: string;\n limit?: number;\n cursor?: string;\n ids?: string[];\n query?: string;\n key?: string;\n status?: string;\n sortField?: string;\n sortDirection?: \"asc\" | \"desc\";\n createdAtFrom?: number;\n createdAtTo?: number;\n}\n\nexport interface CreateFormParams {\n businessId?: string;\n key: string;\n blocks?: any[];\n}\n\nexport interface UpdateFormParams {\n id: string;\n businessId?: string;\n key?: string;\n blocks?: any[];\n status?: string;\n}\n\nexport interface GetFormParams {\n id?: string;\n key?: string;\n businessId?: string;\n}\n\nexport interface DeleteFormParams {\n id: string;\n businessId?: string;\n}\n\nexport interface SubmitFormParams {\n formId: string;\n businessId?: string;\n blocks: any[];\n}\n\nexport interface GetFormSubmissionsParams {\n formId: string;\n businessId?: string;\n query?: string;\n limit?: number;\n cursor?: string;\n sortField?: string;\n sortDirection?: \"asc\" | \"desc\";\n createdAtFrom?: number;\n createdAtTo?: number;\n}\n\nexport interface GetFormSubmissionParams {\n id: string;\n formId: string;\n businessId?: string;\n}\n\n// ── Taxonomy params ───────────────────────────────────────────\n\nexport interface GetTaxonomiesParams {\n businessId?: string;\n parentId?: string;\n limit?: number;\n cursor?: string;\n ids?: string[];\n query?: string;\n key?: string;\n status?: string;\n sortField?: string;\n sortDirection?: \"asc\" | \"desc\";\n createdAtFrom?: number;\n createdAtTo?: number;\n}\n\nexport interface CreateTaxonomyParams {\n businessId?: string;\n key: string;\n parentId?: string | null;\n blocks?: any[];\n}\n\nexport interface UpdateTaxonomyParams {\n id: string;\n businessId?: string;\n key?: string;\n parentId?: string | null;\n blocks?: any[];\n status?: string;\n}\n\nexport interface GetTaxonomyParams {\n id?: string;\n key?: string;\n businessId?: string;\n}\n\nexport interface DeleteTaxonomyParams {\n id: string;\n businessId?: string;\n}\n\nexport interface GetTaxonomyChildrenParams {\n id: string;\n businessId?: string;\n}\n\nexport interface GetMeParams {}\n\nexport interface LogoutParams {}\n\nexport interface GetBusinessesParams {\n query?: string;\n limit?: number;\n cursor?: string;\n sortField?: string;\n sortDirection?: \"asc\" | \"desc\";\n}\n\nexport interface GetSubscriptionPlansParams {}\n\nexport interface SetupAnalyticsParams {\n [key: string]: any;\n}\n\nexport interface GetBusinessMediaParams2 {\n id: string;\n cursor?: string | null;\n limit: number;\n ids?: string[];\n query?: string;\n mimeType?: string;\n sortField?: string;\n sortDirection?: 'asc' | 'desc';\n}\n\nexport interface DeleteProductParams {\n id: string;\n}\n\nexport interface ProcessRefundParams {\n id: string;\n entity: string;\n amount: number;\n}\n\nexport type SystemTemplateKey =\n | \"system:booking-business-update\"\n | \"system:booking-customer-update\"\n | \"system:user-invitation\"\n | \"system:order-status-update\"\n | \"system:user-confirmation\"\n | \"system:forgot-password\";\n\nexport interface GetSlotsForDateParams {\n serviceId: string;\n date: Date;\n timezone: string;\n providerId?: string;\n}\n\nexport interface GetAvailabilityParams {\n serviceId: string;\n from: Date;\n to: Date;\n timezone: string;\n}\n\nexport interface DayAvailability {\n date: Date;\n available: boolean;\n}\n\nexport interface Slot {\n id: string;\n serviceId: string;\n providerId: string;\n from: number;\n to: number;\n timeText: string;\n dateText: string;\n}\n\nexport interface CreateWorkflowParams {\n businessId?: string;\n key: string;\n status?: Status;\n nodes: Record<string, WorkflowNode>;\n\n schedule?: string;\n}\n\nexport interface UpdateWorkflowParams {\n id: string;\n key: string;\n status?: Status;\n nodes: Record<string, WorkflowNode>;\n\n schedule?: string;\n}\n\nexport interface DeleteWorkflowParams {\n id: string;\n}\n\nexport interface GetWorkflowParams {\n id: string;\n}\n\nexport interface GetWorkflowsParams {\n businessId?: string;\n ids?: string[];\n query?: string;\n statuses?: string[];\n limit?: number;\n cursor?: string;\n sortField?: string;\n sortDirection?: 'asc' | 'desc';\n createdAtFrom?: number;\n createdAtTo?: number;\n}\n\nexport interface TriggerWorkflowParams {\n\n secret: string;\n\n [key: string]: any;\n}\n\nexport interface GetWorkflowExecutionsParams {\n workflowId: string;\n businessId?: string;\n status?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface GetWorkflowExecutionParams {\n workflowId: string;\n executionId: string;\n businessId?: string;\n}\n\nexport interface CreateAudienceParams {\n key: string;\n name: string;\n type?: AudienceType;\n}\n\nexport interface UpdateAudienceParams {\n id: string;\n key?: string;\n name?: string;\n type?: AudienceType;\n status?: Status;\n}\n\nexport interface GetAudienceParams {\n id?: string;\n key?: string;\n}\n\nexport interface GetAudiencesParams {\n ids?: string[];\n statuses?: string[];\n query?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface SubscribeAudienceParams {\n id: string;\n email: string;\n priceId?: string;\n successUrl?: string;\n cancelUrl?: string;\n confirmUrl?: string;\n}\n\nexport interface DeleteAudienceParams {\n id: string;\n}\n\nexport interface GetAudienceSubscribersParams {\n id: string;\n limit?: number;\n cursor?: string;\n}\n\nexport enum SubscriptionSource {\n Signup = 'signup',\n Admin = 'admin',\n Import = 'import'\n}\n\nexport interface AudienceSubscriber {\n accountId: string;\n email: string;\n subscribedAt?: number;\n source?: SubscriptionSource;\n status?: SubscriptionStatus;\n}\n\nexport interface RemoveAudienceSubscriberParams {\n id: string;\n accountId: string;\n}\n\nexport interface AddAudienceSubscriberParams {\n id: string;\n email: string;\n}\n\nexport interface AddAudienceSubscriberResponse {\n subscriber: AudienceSubscriber | null;\n skipped: boolean;\n}\n\n\nexport interface OAuthConnectParams {\n businessId: string;\n provider: string;\n code: string;\n redirectUri: string;\n}\n\nexport interface OAuthDisconnectParams {\n businessId: string;\n provider: string;\n}\n\n// Integration API Parameters\n\nexport interface ListIntegrationsParams {\n businessId: string;\n}\n\nexport interface GetIntegrationParams {\n businessId: string;\n id: string;\n}\n\nexport interface CreateIntegrationParams {\n businessId: string;\n key: string;\n provider: IntegrationProvider;\n}\n\nexport interface UpdateIntegrationParams {\n businessId: string;\n id: string;\n key?: string;\n provider?: IntegrationProvider;\n}\n\nexport interface DeleteIntegrationParams {\n businessId: string;\n id: string;\n}\n\n// Webhook CRUD Parameters\n\nexport interface ListWebhooksParams {\n businessId: string;\n}\n\nexport interface CreateWebhookParams {\n businessId: string;\n key: string;\n url: string;\n events: WebhookEventSubscription[];\n headers: Record<string, string>;\n secret: string;\n enabled: boolean;\n}\n\nexport interface UpdateWebhookParams {\n businessId: string;\n id: string;\n key: string;\n url: string;\n events: WebhookEventSubscription[];\n headers: Record<string, string>;\n secret: string;\n enabled: boolean;\n}\n\nexport interface DeleteWebhookParams {\n businessId: string;\n id: string;\n}\n\n// Shipping API Parameters\n\n/** Get shipping rates for a shipment */\nexport interface GetShippingRatesParams {\n orderId: string;\n shippingProviderId: string;\n fromAddress: Address;\n toAddress: Address;\n parcel: Parcel;\n customsDeclaration?: CustomsDeclaration;\n}\n\n/** Ship items: creates shipment + purchases label atomically */\nexport interface ShipParams {\n orderId: string;\n rateId: string;\n carrier: string;\n service: string;\n locationId: string;\n lines: ShipmentLine[];\n}\n\n// ===== Agent API Parameters =====\n\nexport type AgentStatus = 'active' | 'disabled';\n\nexport interface CreateAgentParams {\n businessId?: string;\n key: string;\n prompt: string;\n status?: AgentStatus;\n modelId: string;\n channelIds?: string[];\n}\n\nexport interface UpdateAgentParams {\n id: string;\n key: string;\n prompt: string;\n status: AgentStatus;\n modelId: string;\n channelIds?: string[];\n}\n\nexport interface DeleteAgentParams {\n id: string;\n}\n\nexport interface GetAgentParams {\n id: string;\n}\n\nexport interface GetAgentsParams {\n businessId?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface RunAgentParams {\n id: string;\n message: string;\n chatId?: string;\n direct?: boolean;\n}\n\nexport interface GetAgentChatsParams {\n id: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface GetBusinessChatsParams {\n businessId?: string;\n agentId?: string;\n status?: string;\n query?: string;\n sortField?: string;\n sortDirection?: 'asc' | 'desc';\n limit?: number;\n cursor?: string;\n}\n\nexport interface GetAgentChatParams {\n id: string;\n chatId: string;\n}\n\nexport interface UpdateAgentChatParams {\n id: string;\n chatId: string;\n status: 'active' | 'archived';\n}\n\nexport interface RateAgentChatParams {\n id: string;\n chatId: string;\n rating: number;\n comment?: string;\n}\n\n// ===== Network API Parameters =====\n\nexport interface NetworkNode {\n id?: string;\n key: string;\n blocks?: any[];\n}\n\nexport interface Network {\n id: string;\n key: string;\n nodes: NetworkNode[];\n createdAt: number;\n updatedAt: number;\n}\n\nexport interface CreateNetworkParams {\n key: string;\n nodes?: NetworkNode[];\n}\n\nexport interface UpdateNetworkParams {\n id: string;\n key: string;\n nodes: NetworkNode[];\n}\n\nexport interface GetNetworkParams {\n id: string;\n}\n\nexport interface FindNetworksParams {\n query?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface DeleteNetworkParams {\n id: string;\n}\n\n","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\taudienceId?: string;\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 locations.\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/**\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 BookingCartItem {\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/** Integration provider — typed data per service */\nexport type IntegrationProvider =\n\t| { type: 'stripe'; secretKey?: string; publishableKey: string; webhookSecret?: string; currency: string; activeForCardPayments?: boolean }\n\t| { type: 'shippo'; apiToken?: string; activeForFulfillment?: boolean }\n\t| { type: 'google'; clientId?: string; clientSecret?: string; accessToken?: string; refreshToken?: string;\n\t\ttokenExpiresAt?: number; scopes: string[]; accountEmail?: string | null; connectedAt: number }\n\t| { type: 'google_analytics4'; measurementId: string; activeForTracking?: boolean }\n\t| { type: 'telegram_bot'; botToken?: string; action: ChannelAction }\n\t| { type: 'deep_seek'; apiKey?: string; model?: string }\n\t// Bearer token providers\n\t| { type: 'open_ai'; apiKey?: string; model?: string }\n\t| { type: 'slack'; apiKey?: string }\n\t| { type: 'discord'; apiKey?: string }\n\t| { type: 'whats_app'; apiKey?: string }\n\t| { type: 'resend'; apiKey?: string }\n\t| { type: 'send_grid'; apiKey?: string }\n\t| { type: 'airtable'; apiKey?: string }\n\t| { type: 'linear'; apiKey?: string }\n\t| { type: 'git_hub'; apiKey?: string }\n\t| { type: 'git_lab'; apiKey?: string }\n\t| { type: 'dropbox'; apiKey?: string }\n\t| { type: 'hub_spot'; apiKey?: string }\n\t| { type: 'monday'; apiKey?: string }\n\t| { type: 'click_up'; apiKey?: string }\n\t| { type: 'pipedrive'; apiKey?: string }\n\t| { type: 'calendly'; apiKey?: string }\n\t| { type: 'typeform'; apiKey?: string }\n\t| { type: 'webflow'; apiKey?: string }\n\t| { type: 'trello'; apiKey?: string }\n\t| { type: 'perplexity'; apiKey?: string; model?: string }\n\t| { type: 'replicate'; apiKey?: string }\n\t| { type: 'asana'; apiKey?: string }\n\t| { type: 'brevo'; apiKey?: string }\n\t| { type: 'intercom'; apiKey?: string }\n\t| { type: 'google_gemini'; apiKey?: string; model?: string }\n\t// Custom header auth\n\t| { type: 'anthropic'; apiKey?: string; model?: string }\n\t| { type: 'notion'; apiKey?: string }\n\t| { type: 'eleven_labs'; apiKey?: string }\n\t| { type: 'active_campaign'; apiKey?: string; accountUrl: string }\n\t| { type: 'shopify'; apiKey?: string; storeDomain: string }\n\t| { type: 'supabase'; apiKey?: string; projectUrl: string }\n\t| { type: 'mailchimp'; apiKey?: string }\n\t// Basic auth\n\t| { type: 'twilio'; accountSid?: string; authToken?: string }\n\t| { type: 'jira'; email?: string; apiToken?: string; domain: string }\n\t| { type: 'woo_commerce'; consumerKey?: string; consumerSecret?: string; storeUrl: string }\n\t| { type: 'freshdesk'; apiKey?: string; domain: string }\n\t| { type: 'zendesk'; apiToken?: string; email?: string; subdomain: string }\n\t// OAuth / token + instance\n\t| { type: 'salesforce'; accessToken?: string; instanceUrl: string }\n\t| { type: 'zoom'; apiKey?: string }\n\t| { type: 'microsoft_teams'; apiKey?: string }\n\t| { type: 'firebase'; apiKey?: string }\n\t| { type: 'arky'; apiKey?: string }\n\t// Deploy hooks\n\t| { type: 'vercel_deploy_hook'; url?: string }\n\t| { type: 'netlify_deploy_hook'; url?: string }\n\t| { type: 'cloudflare_deploy_hook'; url?: string }\n\t| { type: 'custom_deploy_hook'; url?: string };\n\n/** Business integration — standalone sub-resource with its own CRUD */\nexport interface Integration {\n\tid: string;\n\tbusinessId: string;\n\tkey: string;\n\tprovider: IntegrationProvider;\n\tcreatedAt: number;\n\tupdatedAt: number;\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\tlocationId?: string;\n\tamount: number;\n\tfreeAbove?: number;\n\tweightTiers?: ShippingWeightTier[];\n}\n\nexport interface Location {\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\tlocationId: string;\n\tavailable: number;\n\treserved: number;\n}\n\nexport type ZoneScope = \"all\" | \"order\" | \"booking\";\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 type WebhookEventSubscription =\n\t| { event: 'node.created'; parentId?: string }\n\t| { event: 'node.updated'; key?: string }\n\t| { event: 'node.deleted'; key?: string }\n\t| { event: 'order.created' }\n\t| { event: 'order.updated' }\n\t| { event: 'order.status_changed' }\n\t| { event: 'order.payment_received' }\n\t| { event: 'order.payment_failed' }\n\t| { event: 'order.refunded' }\n\t| { event: 'order.completed' }\n\t| { event: 'order.cancelled' }\n\t| { event: 'order.shipment_created' }\n\t| { event: 'order.shipment_in_transit' }\n\t| { event: 'order.shipment_out_for_delivery' }\n\t| { event: 'order.shipment_delivered' }\n\t| { event: 'order.shipment_failed' }\n\t| { event: 'order.shipment_returned' }\n\t| { event: 'order.shipment_status_changed' }\n\t| { event: 'booking.created' }\n\t| { event: 'booking.updated' }\n\t| { event: 'booking.status_changed' }\n\t| { event: 'booking.payment_received' }\n\t| { event: 'booking.payment_failed' }\n\t| { event: 'booking.refunded' }\n\t| { event: 'booking.completed' }\n\t| { event: 'booking.cancelled' }\n\t| { event: 'product.created' }\n\t| { event: 'product.updated' }\n\t| { event: 'product.deleted' }\n\t| { event: 'provider.created' }\n\t| { event: 'provider.updated' }\n\t| { event: 'provider.deleted' }\n\t| { event: 'service.created' }\n\t| { event: 'service.updated' }\n\t| { event: 'service.deleted' }\n\t| { event: 'media.created' }\n\t| { event: 'media.deleted' }\n\t| { event: 'business.created' }\n\t| { event: 'business.updated' }\n\t| { event: 'business.deleted' }\n\t| { event: 'audience.created' }\n\t| { event: 'audience.updated' }\n\t| { event: 'audience.deleted' };\n\nexport interface Webhook {\n\tid: string;\n\tbusinessId: string;\n\tkey: string;\n\turl: string;\n\tevents: WebhookEventSubscription[];\n\theaders: Record<string, string>;\n\tsecret: string;\n\tenabled: boolean;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport type ChannelAction =\n\t| { type: 'agent'; agentId: string }\n\t| { type: 'workflow'; workflowId: string };\n\nexport interface BusinessConfig {\n\tlanguages: Language[];\n\tmarkets: Market[];\n\tzones: Zone[];\n\tlocations: Location[];\n\taiId?: string | null;\n\temails: BusinessEmails;\n}\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\ttoken: string;\n}\n\nexport interface Business {\n\tid: string;\n\tkey: string;\n\ttimezone: string;\n\tconfigs?: BusinessConfig;\n\tsubscription?: Subscription;\n\tcounts?: Record<string, number>;\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 BlockFilterType = \"text\" | \"number\" | \"boolean\";\n\nexport interface BlockFilter {\n\tid: string;\n\tkey: string;\n\ttype: BlockFilterType;\n\tproperties?: any;\n\tvalue?: any;\n}\n\nexport interface Filter {\n\ttaxonomyId: string;\n\tnetworkId?: string;\n\tblocks: BlockFilter[];\n}\n\nexport type BlockType =\n\t| \"text\"\n\t| \"localized_text\"\n\t| \"number\"\n\t| \"boolean\"\n\t| \"list\"\n\t| \"map\"\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 BookingStoreState {\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\tbookingBlocks: Block[];\n\tapiUrl: string;\n\tbusinessId: string;\n\ttimezone: string;\n\ttzGroups: any;\n\titems: BookingCartItem[];\n\tallowedPaymentMethods: string[];\n\tpaymentConfig: {\n\t\tprovider: { publishableKey: string; currency: string } | null;\n\t\tenabled: boolean;\n\t};\n}\n\nexport type Status = 'active' | 'archived';\n\nexport type OrderStatus = 'created' | 'pending' | 'authorized' | 'confirmed' | 'shipped' | 'completed' | 'cancelled' | 'failed';\n\nexport type BookingStatus = 'created' | 'pending' | 'authorized' | 'confirmed' | 'completed' | 'cancelled' | 'failed';\n\nexport type SubscriptionStatus = 'pending' | 'active' | 'cancellation_scheduled' | 'cancelled' | 'expired';\n\nexport interface BookingItem {\n\tid: string;\n\tserviceId: string;\n\tproviderId: string;\n\tbusinessId: string;\n\tbookingId: string;\n\taccountId: string;\n\tfrom: number;\n\tto: number;\n\tblocks: Block[];\n\tprice: Price;\n}\n\nexport interface Booking {\n\tid: string;\n\tnumber: string;\n\taccountId: string;\n\tblocks: Block[];\n\tbusinessId: string;\n\tstatus: BookingStatus;\n\tserviceIds: string[];\n\tproviderIds: string[];\n\tpayment: Payment;\n\tbusiness?: Business;\n\taccount?: any;\n\titems: BookingItem[];\n\taudienceId?: string;\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\tfilters: Filter[];\n\tstatus: Status;\n\tslug: Record<string, string>;\n\tchildren: Node[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface EmailTemplate {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tsubject: Record<string, string>;\n\tbody: string;\n\tfromName: string;\n\tfromEmail: string;\n\treplyTo?: string;\n\tpreheader?: string;\n\tstatus: Status;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface Form {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tblocks: Block[];\n\tstatus: Status;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface FormSubmission {\n\tid: string;\n\tformId: string;\n\tbusinessId: string;\n\tblocks: Block[];\n\tcreatedAt: number;\n}\n\nexport interface Taxonomy {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tparentId?: string | null;\n\tblocks: Block[];\n\tstatus: Status;\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\tprices: Price[];\n\tdurations: ServiceDuration[];\n\tisApprovalRequired: boolean;\n\taudienceIds: string[];\n\tworkingDays: Array<{ day: string; workingHours: Array<{ from: number; to: number }> }>;\n\tspecificDates: Array<{ date: number; workingHours: Array<{ from: number; to: number }> }>;\n\tcapacity: number;\n\ttimeline: ProviderTimelinePoint[];\n\tprovider?: Provider;\n}\n\nexport interface Service {\n\tid: string;\n\tkey: string;\n\tslug: Record<string, string>;\n\tbusinessId: string;\n\tblocks: Block[];\n\tfilters: Filter[];\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\tbusinessId: string;\n\tstatus: Status;\n\taudienceIds: string[];\n\tblocks: Block[];\n\tfilters: Filter[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface WorkflowConnection {\n\tnode: string;\n\toutput: string;\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\n\tschedule?: string;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport type WorkflowNode =\n\t| WorkflowTriggerNode\n\t| WorkflowHttpNode\n\t| WorkflowSwitchNode\n\t| WorkflowTransformNode\n\t| WorkflowLoopNode;\n\nexport interface WorkflowTriggerNode {\n\ttype: 'trigger';\n\tevent?: string;\n\tdelayMs?: number;\n\tschema?: Block[];\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\tintegrationId?: string;\n\tintegrationProviderId?: string;\n\tdelayMs?: number;\n\tretries?: number;\n\tretryDelayMs?: number;\n\tedges?: WorkflowConnection[];\n}\n\nexport interface WorkflowSwitchRule {\n\tcondition: string;\n}\n\nexport interface WorkflowSwitchNode {\n\ttype: 'switch';\n\trules: WorkflowSwitchRule[];\n\tdelayMs?: number;\n\tedges?: WorkflowConnection[];\n}\n\nexport interface WorkflowTransformNode {\n\ttype: 'transform';\n\tcode: string;\n\tdelayMs?: number;\n\tedges?: WorkflowConnection[];\n}\n\nexport interface WorkflowLoopNode {\n\ttype: 'loop';\n\texpression: string;\n\tdelayMs?: number;\n\tedges?: WorkflowConnection[];\n\tbackEdges?: WorkflowConnection[];\n}\n\nexport type WorkflowHttpMethod = 'get' | 'post' | 'put' | 'patch' | 'delete';\n\nexport type ExecutionStatus = 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';\n\nexport interface NodeResult {\n\toutput: any;\n\troute: string;\n\tstartedAt: number;\n\tcompletedAt: number;\n\tdurationMs: number;\n\terror?: string;\n}\n\nexport interface WorkflowExecution {\n\tid: string;\n\tworkflowId: string;\n\tbusinessId: string;\n\tstatus: ExecutionStatus;\n\tinput: Record<string, any>;\n\tresults: Record<string, NodeResult>;\n\terror?: string;\n\tscheduledAt: number;\n\tstartedAt: number;\n\tcompletedAt?: number;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport type AudienceType =\n\t| { type: 'standard' }\n\t| { type: 'paid'; prices: SubscriptionPrice[] }\n\t| { type: 'confirmation'; confirmationNodeId: string };\n\nexport interface Audience {\n\tid: string;\n\tbusinessId: string;\n\tkey: string;\n\tstatus: Status;\n\ttype: AudienceType;\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_completed' }\n\t| { action: 'order_cancelled'; data: { reason?: string } }\n\t// Order shipment events\n\t| { action: 'order_shipment_created'; data: { shipment_id: string } }\n\t| { action: 'order_shipment_in_transit'; data: { shipment_id: string } }\n\t| { action: 'order_shipment_out_for_delivery'; data: { shipment_id: string } }\n\t| { action: 'order_shipment_delivered'; data: { shipment_id: string } }\n\t| { action: 'order_shipment_failed'; data: { shipment_id: string; reason?: string } }\n\t| { action: 'order_shipment_returned'; data: { shipment_id: string } }\n\t| { action: 'order_shipment_status_changed'; data: { shipment_id: string; from: string; to: string } }\n\t// Booking events\n\t| { action: 'booking_created' }\n\t| { action: 'booking_updated' }\n\t| { action: 'booking_status_changed'; data: { from: string; to: string } }\n\t| { action: 'booking_payment_received'; data: { amount: number; currency: string } }\n\t| { action: 'booking_payment_failed'; data: { reason?: string } }\n\t| { action: 'booking_refunded'; data: { amount: number; currency: string; reason?: string } }\n\t| { action: 'booking_completed' }\n\t| { action: 'booking_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\t| { action: 'audience_deleted' };\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 location) */\nexport interface Shipment {\n\tid: string;\n\tlocationId: 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"]}
|
|
1
|
+
{"version":3,"sources":["../src/types/api.ts","../src/types/index.ts"],"names":["SubscriptionSource","PaymentMethodType"],"mappings":";AAo+BO,IAAK,kBAAA,qBAAAA,mBAAAA,KAAL;AACL,EAAAA,oBAAA,QAAA,CAAA,GAAS,QAAA;AACT,EAAAA,oBAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,oBAAA,QAAA,CAAA,GAAS,QAAA;AAHC,EAAA,OAAAA,mBAAAA;AAAA,CAAA,EAAA,kBAAA,IAAA,EAAA;;;ACx7BL,IAAK,iBAAA,qBAAAC,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":["import type { Block, ZoneLocation, WorkflowNode, Status, Address, SubscriptionStatus, AudienceType, IntegrationProvider, WebhookEventSubscription, Parcel, CustomsDeclaration, ShipmentLine } from \"./index\";\n\nexport interface RequestOptions<T = any> {\n headers?: Record<string, string>;\n params?: Record<string, any>;\n transformRequest?: (data: any) => any;\n onSuccess?: (ctx: {\n data: T;\n method: string;\n url: string;\n status: number;\n request?: any;\n durationMs?: number;\n requestId?: string | null;\n }) => void | Promise<void>;\n onError?: (ctx: {\n error: any;\n method: string;\n url: string;\n status?: number;\n request?: any;\n response?: any;\n durationMs?: number;\n requestId?: string | null;\n aborted?: boolean;\n }) => void | Promise<void>;\n}\n\nexport interface EshopItem {\n productId: string;\n variantId: string;\n quantity: number;\n}\n\nexport interface GetQuoteParams {\n items: EshopItem[];\n paymentMethodId?: string;\n shippingMethodId?: string;\n promoCode?: string;\n blocks?: any[];\n /** Zone location for zone/market resolution */\n location?: ZoneLocation;\n}\n\nexport interface OrderCheckoutParams {\n items: EshopItem[];\n paymentMethodId?: string;\n blocks?: any[];\n shippingMethodId: string;\n promoCodeId?: string;\n /** Shipping address for the order */\n shippingAddress?: Address;\n /** Billing address (defaults to shipping address if not provided) */\n billingAddress?: Address;\n}\n\nexport interface GetProductsParams {\n ids?: string[];\n filters?: { taxonomyId: string; blocks?: any[] }[];\n status?: string;\n limit?: number;\n cursor?: string;\n query?: string;\n statuses?: string[];\n sortField?: string;\n sortDirection?: string;\n createdAtFrom?: number | null;\n createdAtTo?: number | null;\n}\n\nexport interface GetNodesParams {\n businessId?: string;\n parentId?: string;\n limit?: number;\n cursor?: string;\n ids?: string[];\n query?: string;\n type?: string;\n key?: string;\n statuses?: string[];\n sortField?: string;\n sortDirection?: string;\n createdAtFrom?: string;\n createdAtTo?: string;\n}\n\nexport interface CreateNodeParams {\n businessId?: string;\n key: string;\n parentId?: string | null;\n blocks?: any[];\n filters?: any[];\n slug?: Record<string, string>;\n audienceIds?: string[];\n status?: string;\n}\n\nexport interface UpdateNodeParams {\n id: string;\n businessId?: string;\n key?: string;\n parentId?: string | null;\n blocks?: any[];\n filters?: any[];\n slug?: Record<string, string>;\n audienceIds?: string[];\n status?: string;\n}\n\nexport interface GetNodeParams {\n id?: string;\n slug?: string;\n key?: string;\n businessId?: string;\n}\n\nexport interface DeleteNodeParams {\n id: string;\n businessId?: string;\n}\n\nexport interface GetNodeChildrenParams {\n id: string;\n businessId?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface UploadBusinessMediaParams {\n businessId?: string;\n files?: File[];\n urls?: string[];\n}\n\nexport interface DeleteBusinessMediaParams {\n id: string;\n mediaId: string;\n}\n\nexport interface GetMediaParams {\n mediaId: string;\n businessId?: string;\n}\n\nexport interface UpdateMediaParams {\n mediaId: string;\n businessId?: string;\n slug?: Record<string, string>;\n}\n\nexport interface GetBusinessMediaParams {\n businessId?: string;\n cursor?: string | null;\n limit: number;\n ids?: string[];\n query?: string;\n mimeType?: string;\n sortField?: string;\n sortDirection?: 'asc' | 'desc';\n}\n\nexport interface LoginAccountParams {\n email?: string;\n provider: string;\n token?: string;\n}\n\nexport interface MagicLinkRequestParams {\n email: string;\n businessId?: string;\n}\n\nexport interface MagicLinkVerifyParams {\n email: string;\n code: string;\n}\n\n\nexport interface GetServicesParams {\n businessId?: string;\n providerId?: string;\n filters?: { taxonomyId: string; blocks?: any[] }[];\n limit?: number;\n cursor?: string;\n query?: string;\n ids?: string[];\n statuses?: string[];\n sortField?: string;\n sortDirection?: string;\n}\n\nexport interface BookingCheckoutParams {\n businessId?: string;\n items: any[];\n paymentMethodId?: string;\n blocks?: any[];\n promoCodeId?: string;\n /** Zone location for zone/market resolution */\n location?: ZoneLocation;\n}\n\nexport interface BookingQuoteItem {\n serviceId: string;\n from: number;\n to: number;\n providerId: string;\n}\n\nexport interface GetBookingQuoteParams {\n businessId?: string;\n items: BookingQuoteItem[];\n paymentMethodId?: string;\n promoCode?: string;\n /** Zone location for zone/market resolution */\n location?: ZoneLocation;\n}\n\nexport interface TimelinePoint {\n timestamp: number;\n concurrent: number;\n}\n\nexport interface WorkingHour {\n from: number;\n to: number;\n}\n\nexport interface WorkingDay {\n day: string;\n workingHours: WorkingHour[];\n}\n\nexport interface SpecificDate {\n date: number;\n workingHours: WorkingHour[];\n}\n\nexport interface ServiceProvider {\n id: string;\n serviceId: string;\n providerId: string;\n businessId: string;\n workingDays: WorkingDay[];\n specificDates: SpecificDate[];\n prices?: any[];\n durations?: any[];\n isApprovalRequired?: boolean;\n capacity: number;\n timeline: TimelinePoint[];\n createdAt?: number;\n updatedAt?: number;\n service?: any;\n provider?: any;\n}\n\nexport interface ProviderWithTimeline {\n id: string;\n key: string;\n businessId: string;\n seo: any;\n status: Status;\n capacity: number;\n audienceIds: string[];\n blocks: Block[];\n createdAt: number;\n updatedAt: number;\n workingDays?: WorkingDay[];\n specificDates?: SpecificDate[];\n timeline: TimelinePoint[];\n}\n\nexport interface GetAnalyticsParams {\n metrics?: string[];\n period?: string;\n startDate?: string;\n endDate?: string;\n interval?: string;\n}\n\nexport interface GetAnalyticsHealthParams {\n \n}\n\nexport interface TrackEmailOpenParams {\n trackingPixelId: string;\n}\n\nexport interface GetDeliveryStatsParams {}\n\nexport type BusinessRole = 'admin' | 'owner' | 'super';\n\nexport interface Discount {\n type: \"items_percentage\" | \"items_fixed\" | \"shipping_percentage\";\n marketId: string;\n bps?: number;\n amount?: number;\n}\n\nexport interface Condition {\n type:\n | \"products\"\n | \"services\"\n | \"min_order_amount\"\n | \"date_range\"\n | \"max_uses\"\n | \"max_uses_per_user\";\n value: string[] | number | { start?: number; end?: number };\n}\n\nexport interface CreatePromoCodeParams {\n code: string;\n discounts: Discount[];\n conditions: Condition[];\n}\n\nexport interface UpdatePromoCodeParams {\n id: string;\n code: string;\n discounts: Discount[];\n conditions: Condition[];\n status?: Status;\n}\n\nexport interface DeletePromoCodeParams {\n id: string;\n}\n\nexport interface GetPromoCodeParams {\n id: string;\n}\n\nexport interface GetPromoCodesParams {\n statuses?: string[];\n query?: string;\n limit?: number;\n cursor?: string;\n sortField?: string;\n sortDirection?: string;\n createdAtFrom?: string;\n createdAtTo?: string;\n startsAtFrom?: string;\n startsAtTo?: string;\n expiresAtFrom?: string;\n expiresAtTo?: string;\n}\n\nexport interface CreateBusinessParams {\n key: string;\n slug?: string;\n description?: string;\n email?: string;\n phone?: string;\n website?: string;\n address?: any;\n settings?: any;\n [key: string]: any;\n}\n\nexport interface UpdateBusinessParams {\n id: string;\n key: string;\n timezone: string;\n configs: any;\n}\n\nexport interface DeleteBusinessParams {\n id: string;\n}\n\nexport interface GetBusinessParams {}\n\n\nexport interface SubscribeParams {\n planId: string;\n successUrl: string;\n cancelUrl: string;\n}\n\nexport interface CreatePortalSessionParams {\n returnUrl: string;\n}\n\nexport interface InviteUserParams {\n email: string;\n role?: BusinessRole;\n}\n\nexport interface RemoveMemberParams {\n accountId: string;\n}\n\nexport interface HandleInvitationParams {\n token: string;\n action: string;\n}\n\nexport interface TestWebhookParams {\n webhook: any;\n}\n\n\nexport interface CreateProductParams {\n key: string;\n description?: string;\n audienceIds?: string[];\n blocks?: any[];\n filters?: any[];\n variants?: any[];\n status?: string;\n [key: string]: any;\n}\n\nexport interface UpdateProductParams {\n id: string;\n key?: string;\n description?: string;\n audienceIds?: string[];\n blocks?: any[];\n filters?: any[];\n variants?: any[];\n status?: string;\n [key: string]: any;\n}\n\nexport interface DeleteProductParams {\n id: string;\n}\n\nexport interface GetProductParams {\n id?: string;\n slug?: string;\n}\n\nexport interface GetOrderParams {\n id: string;\n}\n\nexport interface GetOrdersParams {\n accountId?: string | null;\n statuses?: string[] | null;\n productIds?: string[];\n query?: string | null;\n limit?: number | null;\n cursor?: string | null;\n sortField?: string | null;\n sortDirection?: string | null;\n createdAtFrom?: string | null;\n createdAtTo?: string | null;\n}\n\nexport interface UpdateOrderParams {\n id: string;\n status: string;\n blocks: any[];\n items: any[];\n address?: any | null;\n billingAddress?: any | null;\n payment?: any | null;\n}\n\nexport interface CreateOrderParams {\n [key: string]: any;\n}\n\nexport interface CreateBookingParams {\n businessId?: string;\n [key: string]: any;\n}\n\nexport interface UpdateBookingParams {\n id: string;\n status?: string;\n blocks?: any;\n parts?: any;\n payment?: any | null;\n [key: string]: any;\n}\n\nexport interface CreateProviderParams {\n businessId?: string;\n key: string;\n audienceIds?: string[];\n blocks?: any[];\n filters?: any[];\n status?: Status;\n [key: string]: any;\n}\n\nexport interface UpdateProviderParams {\n id: string;\n businessId?: string;\n key?: string;\n audienceIds?: string[];\n blocks?: any[];\n filters?: any[];\n status?: Status;\n [key: string]: any;\n}\n\nexport interface DeleteProviderParams {\n id: string;\n businessId?: string;\n}\n\nexport interface ServiceProviderInput {\n providerId: string;\n businessId?: string;\n prices?: any[];\n durations?: any[];\n isApprovalRequired?: boolean;\n capacity?: number;\n workingDays: WorkingDay[];\n specificDates: SpecificDate[];\n}\n\nexport interface CreateServiceParams {\n businessId?: string;\n key: string;\n blocks?: any[];\n filters?: any[];\n status?: Status;\n [key: string]: any;\n}\n\nexport interface UpdateServiceParams {\n id: string;\n businessId?: string;\n key?: string;\n blocks?: any[];\n filters?: any[];\n status?: Status;\n [key: string]: any;\n}\n\nexport interface CreateServiceProviderParams {\n businessId?: string;\n serviceId: string;\n providerId: string;\n workingDays: WorkingDay[];\n specificDates: SpecificDate[];\n prices?: any[];\n durations?: any[];\n isApprovalRequired?: boolean;\n}\n\nexport interface UpdateServiceProviderParams {\n businessId?: string;\n id: string;\n workingDays: WorkingDay[];\n specificDates: SpecificDate[];\n prices?: any[];\n durations?: any[];\n isApprovalRequired?: boolean;\n}\n\nexport interface DeleteServiceProviderParams {\n businessId?: string;\n id: string;\n}\n\nexport interface FindServiceProvidersParams {\n businessId?: string;\n serviceId?: string;\n providerId?: string;\n}\n\nexport interface DeleteServiceParams {\n id: string;\n businessId?: string;\n}\n\nexport interface GetServiceParams {\n id?: string;\n slug?: string;\n businessId?: string;\n}\n\nexport interface GetProvidersParams {\n businessId?: string;\n serviceId?: string;\n filters?: { taxonomyId: string; blocks?: any[] }[];\n ids?: string[];\n query?: string | null;\n statuses?: string[] | null;\n limit?: number;\n cursor?: string;\n sortField?: string | null;\n sortDirection?: string | null;\n createdAtFrom?: string | null;\n createdAtTo?: string | null;\n}\n\nexport interface GetProviderParams {\n id?: string;\n slug?: string;\n businessId?: string;\n}\n\nexport interface GetBookingParams {\n id: string;\n businessId?: string;\n}\n\nexport interface SearchBookingsParams {\n businessId?: string;\n query?: string;\n serviceIds?: string[];\n providerIds?: string[];\n accountId?: string;\n from?: number;\n to?: number;\n status?: string;\n limit?: number;\n cursor?: string;\n sortField?: string;\n sortOrder?: string;\n}\n\nexport interface UpdateAccountProfileParams {\n phoneNumbers?: string[];\n addresses?: any[];\n apiTokens?: any[] | null;\n}\n\nexport interface SearchAccountsParams {\n limit?: number;\n cursor?: string | null;\n query?: string;\n owner?: string;\n}\n\nexport interface DeleteAccountParams {}\n\nexport interface TrackEmailOpenParams {\n trackingPixelId: string;\n}\n\n\nexport interface TriggerNotificationParams {\n channel: string;\n businessId: string;\n emailTemplateId?: string;\n recipients?: string[];\n audienceId?: string;\n vars?: Record<string, any>;\n}\n\n// ── EmailTemplate params ──────────────────────────────────────\n\nexport interface GetEmailTemplatesParams {\n businessId?: string;\n limit?: number;\n cursor?: string;\n ids?: string[];\n query?: string;\n key?: string;\n status?: string;\n sortField?: string;\n sortDirection?: \"asc\" | \"desc\";\n createdAtFrom?: number;\n createdAtTo?: number;\n}\n\nexport interface CreateEmailTemplateParams {\n businessId?: string;\n key: string;\n subject?: Record<string, string>;\n body?: string;\n fromName: string;\n fromEmail: string;\n replyTo?: string;\n preheader?: string;\n}\n\nexport interface UpdateEmailTemplateParams {\n id: string;\n businessId?: string;\n key?: string;\n subject?: Record<string, string>;\n body?: string;\n fromName?: string;\n fromEmail?: string;\n replyTo?: string;\n preheader?: string;\n status?: string;\n}\n\nexport interface GetEmailTemplateParams {\n id?: string;\n key?: string;\n businessId?: string;\n}\n\nexport interface DeleteEmailTemplateParams {\n id: string;\n businessId?: string;\n}\n\n// ── Form params ───────────────────────────────────────────────\n\nexport interface GetFormsParams {\n businessId?: string;\n limit?: number;\n cursor?: string;\n ids?: string[];\n query?: string;\n key?: string;\n status?: string;\n sortField?: string;\n sortDirection?: \"asc\" | \"desc\";\n createdAtFrom?: number;\n createdAtTo?: number;\n}\n\nexport interface CreateFormParams {\n businessId?: string;\n key: string;\n blocks?: any[];\n}\n\nexport interface UpdateFormParams {\n id: string;\n businessId?: string;\n key?: string;\n blocks?: any[];\n status?: string;\n}\n\nexport interface GetFormParams {\n id?: string;\n key?: string;\n businessId?: string;\n}\n\nexport interface DeleteFormParams {\n id: string;\n businessId?: string;\n}\n\nexport interface SubmitFormParams {\n formId: string;\n businessId?: string;\n blocks: any[];\n}\n\nexport interface GetFormSubmissionsParams {\n formId: string;\n businessId?: string;\n query?: string;\n limit?: number;\n cursor?: string;\n sortField?: string;\n sortDirection?: \"asc\" | \"desc\";\n createdAtFrom?: number;\n createdAtTo?: number;\n}\n\nexport interface GetFormSubmissionParams {\n id: string;\n formId: string;\n businessId?: string;\n}\n\n// ── Taxonomy params ───────────────────────────────────────────\n\nexport interface GetTaxonomiesParams {\n businessId?: string;\n parentId?: string;\n limit?: number;\n cursor?: string;\n ids?: string[];\n query?: string;\n key?: string;\n status?: string;\n sortField?: string;\n sortDirection?: \"asc\" | \"desc\";\n createdAtFrom?: number;\n createdAtTo?: number;\n}\n\nexport interface CreateTaxonomyParams {\n businessId?: string;\n key: string;\n parentId?: string | null;\n blocks?: any[];\n filters?: any[];\n}\n\nexport interface UpdateTaxonomyParams {\n id: string;\n businessId?: string;\n key?: string;\n parentId?: string | null;\n blocks?: any[];\n filters?: any[];\n status?: string;\n}\n\nexport interface GetTaxonomyParams {\n id?: string;\n key?: string;\n businessId?: string;\n}\n\nexport interface DeleteTaxonomyParams {\n id: string;\n businessId?: string;\n}\n\nexport interface GetTaxonomyChildrenParams {\n id: string;\n businessId?: string;\n}\n\nexport interface GetMeParams {}\n\nexport interface LogoutParams {}\n\nexport interface GetBusinessesParams {\n query?: string;\n limit?: number;\n cursor?: string;\n sortField?: string;\n sortDirection?: \"asc\" | \"desc\";\n}\n\nexport interface GetSubscriptionPlansParams {}\n\nexport interface SetupAnalyticsParams {\n [key: string]: any;\n}\n\nexport interface GetBusinessMediaParams2 {\n id: string;\n cursor?: string | null;\n limit: number;\n ids?: string[];\n query?: string;\n mimeType?: string;\n sortField?: string;\n sortDirection?: 'asc' | 'desc';\n}\n\nexport interface DeleteProductParams {\n id: string;\n}\n\nexport interface ProcessRefundParams {\n id: string;\n entity: string;\n amount: number;\n}\n\nexport type SystemTemplateKey =\n | \"system:booking-business-update\"\n | \"system:booking-customer-update\"\n | \"system:user-invitation\"\n | \"system:order-status-update\"\n | \"system:user-confirmation\"\n | \"system:forgot-password\";\n\nexport interface GetSlotsForDateParams {\n serviceId: string;\n date: Date;\n timezone: string;\n providerId?: string;\n}\n\nexport interface GetAvailabilityParams {\n serviceId: string;\n from: Date;\n to: Date;\n timezone: string;\n}\n\nexport interface DayAvailability {\n date: Date;\n available: boolean;\n}\n\nexport interface Slot {\n id: string;\n serviceId: string;\n providerId: string;\n from: number;\n to: number;\n timeText: string;\n dateText: string;\n}\n\nexport interface CreateWorkflowParams {\n businessId?: string;\n key: string;\n status?: Status;\n nodes: Record<string, WorkflowNode>;\n\n schedule?: string;\n}\n\nexport interface UpdateWorkflowParams {\n id: string;\n key: string;\n status?: Status;\n nodes: Record<string, WorkflowNode>;\n\n schedule?: string;\n}\n\nexport interface DeleteWorkflowParams {\n id: string;\n}\n\nexport interface GetWorkflowParams {\n id: string;\n}\n\nexport interface GetWorkflowsParams {\n businessId?: string;\n ids?: string[];\n query?: string;\n statuses?: string[];\n limit?: number;\n cursor?: string;\n sortField?: string;\n sortDirection?: 'asc' | 'desc';\n createdAtFrom?: number;\n createdAtTo?: number;\n}\n\nexport interface TriggerWorkflowParams {\n\n secret: string;\n\n [key: string]: any;\n}\n\nexport interface GetWorkflowExecutionsParams {\n workflowId: string;\n businessId?: string;\n status?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface GetWorkflowExecutionParams {\n workflowId: string;\n executionId: string;\n businessId?: string;\n}\n\nexport interface CreateAudienceParams {\n key: string;\n name: string;\n type?: AudienceType;\n}\n\nexport interface UpdateAudienceParams {\n id: string;\n key?: string;\n name?: string;\n type?: AudienceType;\n status?: Status;\n}\n\nexport interface GetAudienceParams {\n id?: string;\n key?: string;\n}\n\nexport interface GetAudiencesParams {\n ids?: string[];\n statuses?: string[];\n query?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface SubscribeAudienceParams {\n id: string;\n email: string;\n priceId?: string;\n successUrl?: string;\n cancelUrl?: string;\n confirmUrl?: string;\n}\n\nexport interface DeleteAudienceParams {\n id: string;\n}\n\nexport interface GetAudienceSubscribersParams {\n id: string;\n limit?: number;\n cursor?: string;\n}\n\nexport enum SubscriptionSource {\n Signup = 'signup',\n Admin = 'admin',\n Import = 'import'\n}\n\nexport interface AudienceSubscriber {\n accountId: string;\n email: string;\n subscribedAt?: number;\n source?: SubscriptionSource;\n status?: SubscriptionStatus;\n}\n\nexport interface RemoveAudienceSubscriberParams {\n id: string;\n accountId: string;\n}\n\nexport interface AddAudienceSubscriberParams {\n id: string;\n email: string;\n}\n\nexport interface AddAudienceSubscriberResponse {\n subscriber: AudienceSubscriber | null;\n skipped: boolean;\n}\n\n\nexport interface OAuthConnectParams {\n businessId: string;\n provider: string;\n code: string;\n redirectUri: string;\n}\n\nexport interface OAuthDisconnectParams {\n businessId: string;\n provider: string;\n}\n\n// Integration API Parameters\n\nexport interface ListIntegrationsParams {\n businessId: string;\n}\n\nexport interface GetIntegrationParams {\n businessId: string;\n id: string;\n}\n\nexport interface CreateIntegrationParams {\n businessId: string;\n key: string;\n provider: IntegrationProvider;\n}\n\nexport interface UpdateIntegrationParams {\n businessId: string;\n id: string;\n key?: string;\n provider?: IntegrationProvider;\n}\n\nexport interface DeleteIntegrationParams {\n businessId: string;\n id: string;\n}\n\n// Webhook CRUD Parameters\n\nexport interface ListWebhooksParams {\n businessId: string;\n}\n\nexport interface CreateWebhookParams {\n businessId: string;\n key: string;\n url: string;\n events: WebhookEventSubscription[];\n headers: Record<string, string>;\n secret: string;\n enabled: boolean;\n}\n\nexport interface UpdateWebhookParams {\n businessId: string;\n id: string;\n key: string;\n url: string;\n events: WebhookEventSubscription[];\n headers: Record<string, string>;\n secret: string;\n enabled: boolean;\n}\n\nexport interface DeleteWebhookParams {\n businessId: string;\n id: string;\n}\n\n// Shipping API Parameters\n\n/** Get shipping rates for a shipment */\nexport interface GetShippingRatesParams {\n orderId: string;\n shippingProviderId: string;\n fromAddress: Address;\n toAddress: Address;\n parcel: Parcel;\n customsDeclaration?: CustomsDeclaration;\n}\n\n/** Ship items: creates shipment + purchases label atomically */\nexport interface ShipParams {\n orderId: string;\n rateId: string;\n carrier: string;\n service: string;\n locationId: string;\n lines: ShipmentLine[];\n}\n\n// ===== Agent API Parameters =====\n\nexport type AgentStatus = 'active' | 'disabled';\n\nexport interface CreateAgentParams {\n businessId?: string;\n key: string;\n prompt: string;\n status?: AgentStatus;\n modelId: string;\n channelIds?: string[];\n}\n\nexport interface UpdateAgentParams {\n id: string;\n key: string;\n prompt: string;\n status: AgentStatus;\n modelId: string;\n channelIds?: string[];\n}\n\nexport interface DeleteAgentParams {\n id: string;\n}\n\nexport interface GetAgentParams {\n id: string;\n}\n\nexport interface GetAgentsParams {\n businessId?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface RunAgentParams {\n id: string;\n message: string;\n chatId?: string;\n direct?: boolean;\n}\n\nexport interface GetAgentChatsParams {\n id: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface GetBusinessChatsParams {\n businessId?: string;\n agentId?: string;\n status?: string;\n query?: string;\n sortField?: string;\n sortDirection?: 'asc' | 'desc';\n limit?: number;\n cursor?: string;\n}\n\nexport interface GetAgentChatParams {\n id: string;\n chatId: string;\n}\n\nexport interface UpdateAgentChatParams {\n id: string;\n chatId: string;\n status: 'active' | 'archived';\n}\n\nexport interface RateAgentChatParams {\n id: string;\n chatId: string;\n rating: number;\n comment?: string;\n}\n\n// ===== Network API Parameters =====\n\nexport interface NetworkNode {\n id?: string;\n key: string;\n blocks?: any[];\n}\n\nexport interface Network {\n id: string;\n key: string;\n nodes: NetworkNode[];\n createdAt: number;\n updatedAt: number;\n}\n\nexport interface CreateNetworkParams {\n key: string;\n nodes?: NetworkNode[];\n}\n\nexport interface UpdateNetworkParams {\n id: string;\n key: string;\n nodes: NetworkNode[];\n}\n\nexport interface GetNetworkParams {\n id: string;\n}\n\nexport interface FindNetworksParams {\n query?: string;\n limit?: number;\n cursor?: string;\n}\n\nexport interface DeleteNetworkParams {\n id: string;\n}\n\n","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\taudienceId?: string;\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 locations.\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/**\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 BookingCartItem {\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/** Integration provider — typed data per service */\nexport type IntegrationProvider =\n\t| { type: 'stripe'; secretKey?: string; publishableKey: string; webhookSecret?: string; currency: string; activeForCardPayments?: boolean }\n\t| { type: 'shippo'; apiToken?: string; activeForFulfillment?: boolean }\n\t| { type: 'google'; clientId?: string; clientSecret?: string; accessToken?: string; refreshToken?: string;\n\t\ttokenExpiresAt?: number; scopes: string[]; accountEmail?: string | null; connectedAt: number }\n\t| { type: 'google_analytics4'; measurementId: string; activeForTracking?: boolean }\n\t| { type: 'telegram_bot'; botToken?: string; action: ChannelAction }\n\t| { type: 'deep_seek'; apiKey?: string; model?: string }\n\t// Bearer token providers\n\t| { type: 'open_ai'; apiKey?: string; model?: string }\n\t| { type: 'slack'; apiKey?: string }\n\t| { type: 'discord'; apiKey?: string }\n\t| { type: 'whats_app'; apiKey?: string }\n\t| { type: 'resend'; apiKey?: string }\n\t| { type: 'send_grid'; apiKey?: string }\n\t| { type: 'airtable'; apiKey?: string }\n\t| { type: 'linear'; apiKey?: string }\n\t| { type: 'git_hub'; apiKey?: string }\n\t| { type: 'git_lab'; apiKey?: string }\n\t| { type: 'dropbox'; apiKey?: string }\n\t| { type: 'hub_spot'; apiKey?: string }\n\t| { type: 'monday'; apiKey?: string }\n\t| { type: 'click_up'; apiKey?: string }\n\t| { type: 'pipedrive'; apiKey?: string }\n\t| { type: 'calendly'; apiKey?: string }\n\t| { type: 'typeform'; apiKey?: string }\n\t| { type: 'webflow'; apiKey?: string }\n\t| { type: 'trello'; apiKey?: string }\n\t| { type: 'perplexity'; apiKey?: string; model?: string }\n\t| { type: 'replicate'; apiKey?: string }\n\t| { type: 'asana'; apiKey?: string }\n\t| { type: 'brevo'; apiKey?: string }\n\t| { type: 'intercom'; apiKey?: string }\n\t| { type: 'google_gemini'; apiKey?: string; model?: string }\n\t// Custom header auth\n\t| { type: 'anthropic'; apiKey?: string; model?: string }\n\t| { type: 'notion'; apiKey?: string }\n\t| { type: 'eleven_labs'; apiKey?: string }\n\t| { type: 'active_campaign'; apiKey?: string; accountUrl: string }\n\t| { type: 'shopify'; apiKey?: string; storeDomain: string }\n\t| { type: 'supabase'; apiKey?: string; projectUrl: string }\n\t| { type: 'mailchimp'; apiKey?: string }\n\t// Basic auth\n\t| { type: 'twilio'; accountSid?: string; authToken?: string }\n\t| { type: 'jira'; email?: string; apiToken?: string; domain: string }\n\t| { type: 'woo_commerce'; consumerKey?: string; consumerSecret?: string; storeUrl: string }\n\t| { type: 'freshdesk'; apiKey?: string; domain: string }\n\t| { type: 'zendesk'; apiToken?: string; email?: string; subdomain: string }\n\t// OAuth / token + instance\n\t| { type: 'salesforce'; accessToken?: string; instanceUrl: string }\n\t| { type: 'zoom'; apiKey?: string }\n\t| { type: 'microsoft_teams'; apiKey?: string }\n\t| { type: 'firebase'; apiKey?: string }\n\t| { type: 'arky'; apiKey?: string }\n\t// Deploy hooks\n\t| { type: 'vercel_deploy_hook'; url?: string }\n\t| { type: 'netlify_deploy_hook'; url?: string }\n\t| { type: 'cloudflare_deploy_hook'; url?: string }\n\t| { type: 'custom_deploy_hook'; url?: string };\n\n/** Business integration — standalone sub-resource with its own CRUD */\nexport interface Integration {\n\tid: string;\n\tbusinessId: string;\n\tkey: string;\n\tprovider: IntegrationProvider;\n\tcreatedAt: number;\n\tupdatedAt: number;\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\tlocationId?: string;\n\tamount: number;\n\tfreeAbove?: number;\n\tweightTiers?: ShippingWeightTier[];\n}\n\nexport interface Location {\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\tlocationId: string;\n\tavailable: number;\n\treserved: number;\n}\n\nexport type ZoneScope = \"all\" | \"order\" | \"booking\";\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 type WebhookEventSubscription =\n\t| { event: 'node.created'; parentId?: string }\n\t| { event: 'node.updated'; key?: string }\n\t| { event: 'node.deleted'; key?: string }\n\t| { event: 'order.created' }\n\t| { event: 'order.updated' }\n\t| { event: 'order.status_changed' }\n\t| { event: 'order.payment_received' }\n\t| { event: 'order.payment_failed' }\n\t| { event: 'order.refunded' }\n\t| { event: 'order.completed' }\n\t| { event: 'order.cancelled' }\n\t| { event: 'order.shipment_created' }\n\t| { event: 'order.shipment_in_transit' }\n\t| { event: 'order.shipment_out_for_delivery' }\n\t| { event: 'order.shipment_delivered' }\n\t| { event: 'order.shipment_failed' }\n\t| { event: 'order.shipment_returned' }\n\t| { event: 'order.shipment_status_changed' }\n\t| { event: 'booking.created' }\n\t| { event: 'booking.updated' }\n\t| { event: 'booking.status_changed' }\n\t| { event: 'booking.payment_received' }\n\t| { event: 'booking.payment_failed' }\n\t| { event: 'booking.refunded' }\n\t| { event: 'booking.completed' }\n\t| { event: 'booking.cancelled' }\n\t| { event: 'product.created' }\n\t| { event: 'product.updated' }\n\t| { event: 'product.deleted' }\n\t| { event: 'provider.created' }\n\t| { event: 'provider.updated' }\n\t| { event: 'provider.deleted' }\n\t| { event: 'service.created' }\n\t| { event: 'service.updated' }\n\t| { event: 'service.deleted' }\n\t| { event: 'media.created' }\n\t| { event: 'media.deleted' }\n\t| { event: 'business.created' }\n\t| { event: 'business.updated' }\n\t| { event: 'business.deleted' }\n\t| { event: 'audience.created' }\n\t| { event: 'audience.updated' }\n\t| { event: 'audience.deleted' };\n\nexport interface Webhook {\n\tid: string;\n\tbusinessId: string;\n\tkey: string;\n\turl: string;\n\tevents: WebhookEventSubscription[];\n\theaders: Record<string, string>;\n\tsecret: string;\n\tenabled: boolean;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport type ChannelAction =\n\t| { type: 'agent'; agentId: string }\n\t| { type: 'workflow'; workflowId: string };\n\nexport interface BusinessConfig {\n\tlanguages: Language[];\n\tmarkets: Market[];\n\tzones: Zone[];\n\tlocations: Location[];\n\taiId?: string | null;\n\temails: BusinessEmails;\n}\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\ttoken: string;\n}\n\nexport interface Business {\n\tid: string;\n\tkey: string;\n\ttimezone: string;\n\tconfigs?: BusinessConfig;\n\tsubscription?: Subscription;\n\tcounts?: Record<string, number>;\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 BlockFilterType = \"text\" | \"number\" | \"boolean\";\n\nexport interface BlockFilter {\n\tid: string;\n\tkey: string;\n\ttype: BlockFilterType;\n\tproperties?: any;\n\tvalue?: any;\n}\n\nexport interface Filter {\n\ttaxonomyId: string;\n\tnetworkId?: string;\n\tblocks: BlockFilter[];\n}\n\nexport type BlockType =\n\t| \"text\"\n\t| \"localized_text\"\n\t| \"number\"\n\t| \"boolean\"\n\t| \"list\"\n\t| \"map\"\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 BookingStoreState {\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\tbookingBlocks: Block[];\n\tapiUrl: string;\n\tbusinessId: string;\n\ttimezone: string;\n\ttzGroups: any;\n\titems: BookingCartItem[];\n\tallowedPaymentMethods: string[];\n\tpaymentConfig: {\n\t\tprovider: { publishableKey: string; currency: string } | null;\n\t\tenabled: boolean;\n\t};\n}\n\nexport type Status = 'active' | 'archived';\n\nexport type OrderStatus = 'created' | 'pending' | 'authorized' | 'confirmed' | 'shipped' | 'completed' | 'cancelled' | 'failed';\n\nexport type BookingStatus = 'created' | 'pending' | 'authorized' | 'confirmed' | 'completed' | 'cancelled' | 'failed';\n\nexport type SubscriptionStatus = 'pending' | 'active' | 'cancellation_scheduled' | 'cancelled' | 'expired';\n\nexport interface BookingItem {\n\tid: string;\n\tserviceId: string;\n\tproviderId: string;\n\tbusinessId: string;\n\tbookingId: string;\n\taccountId: string;\n\tfrom: number;\n\tto: number;\n\tblocks: Block[];\n\tprice: Price;\n}\n\nexport interface Booking {\n\tid: string;\n\tnumber: string;\n\taccountId: string;\n\tblocks: Block[];\n\tbusinessId: string;\n\tstatus: BookingStatus;\n\tserviceIds: string[];\n\tproviderIds: string[];\n\tpayment: Payment;\n\tbusiness?: Business;\n\taccount?: any;\n\titems: BookingItem[];\n\taudienceId?: string;\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\tfilters: Filter[];\n\tstatus: Status;\n\tslug: Record<string, string>;\n\tchildren: Node[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface EmailTemplate {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tsubject: Record<string, string>;\n\tbody: string;\n\tfromName: string;\n\tfromEmail: string;\n\treplyTo?: string;\n\tpreheader?: string;\n\tstatus: Status;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface Form {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tblocks: Block[];\n\tstatus: Status;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface FormSubmission {\n\tid: string;\n\tformId: string;\n\tbusinessId: string;\n\tblocks: Block[];\n\tcreatedAt: number;\n}\n\nexport interface Taxonomy {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tparentId?: string | null;\n\tblocks: Block[];\n\tstatus: Status;\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\tprices: Price[];\n\tdurations: ServiceDuration[];\n\tisApprovalRequired: boolean;\n\taudienceIds: string[];\n\tworkingDays: Array<{ day: string; workingHours: Array<{ from: number; to: number }> }>;\n\tspecificDates: Array<{ date: number; workingHours: Array<{ from: number; to: number }> }>;\n\tcapacity: number;\n\ttimeline: ProviderTimelinePoint[];\n\tprovider?: Provider;\n}\n\nexport interface Service {\n\tid: string;\n\tkey: string;\n\tslug: Record<string, string>;\n\tbusinessId: string;\n\tblocks: Block[];\n\tfilters: Filter[];\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\tbusinessId: string;\n\tstatus: Status;\n\taudienceIds: string[];\n\tblocks: Block[];\n\tfilters: Filter[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface WorkflowConnection {\n\tnode: string;\n\toutput: string;\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\n\tschedule?: string;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport type WorkflowNode =\n\t| WorkflowTriggerNode\n\t| WorkflowHttpNode\n\t| WorkflowSwitchNode\n\t| WorkflowTransformNode\n\t| WorkflowLoopNode;\n\nexport interface WorkflowTriggerNode {\n\ttype: 'trigger';\n\tevent?: string;\n\tdelayMs?: number;\n\tschema?: Block[];\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\tintegrationId?: string;\n\tintegrationProviderId?: string;\n\tdelayMs?: number;\n\tretries?: number;\n\tretryDelayMs?: number;\n\tedges?: WorkflowConnection[];\n}\n\nexport interface WorkflowSwitchRule {\n\tcondition: string;\n}\n\nexport interface WorkflowSwitchNode {\n\ttype: 'switch';\n\trules: WorkflowSwitchRule[];\n\tdelayMs?: number;\n\tedges?: WorkflowConnection[];\n}\n\nexport interface WorkflowTransformNode {\n\ttype: 'transform';\n\tcode: string;\n\tdelayMs?: number;\n\tedges?: WorkflowConnection[];\n}\n\nexport interface WorkflowLoopNode {\n\ttype: 'loop';\n\texpression: string;\n\tdelayMs?: number;\n\tedges?: WorkflowConnection[];\n\tbackEdges?: WorkflowConnection[];\n}\n\nexport type WorkflowHttpMethod = 'get' | 'post' | 'put' | 'patch' | 'delete';\n\nexport type ExecutionStatus = 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';\n\nexport interface NodeResult {\n\toutput: any;\n\troute: string;\n\tstartedAt: number;\n\tcompletedAt: number;\n\tdurationMs: number;\n\terror?: string;\n}\n\nexport interface WorkflowExecution {\n\tid: string;\n\tworkflowId: string;\n\tbusinessId: string;\n\tstatus: ExecutionStatus;\n\tinput: Record<string, any>;\n\tresults: Record<string, NodeResult>;\n\terror?: string;\n\tscheduledAt: number;\n\tstartedAt: number;\n\tcompletedAt?: number;\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport type AudienceType =\n\t| { type: 'standard' }\n\t| { type: 'paid'; prices: SubscriptionPrice[] }\n\t| { type: 'confirmation'; confirmationNodeId: string };\n\nexport interface Audience {\n\tid: string;\n\tbusinessId: string;\n\tkey: string;\n\tstatus: Status;\n\ttype: AudienceType;\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_completed' }\n\t| { action: 'order_cancelled'; data: { reason?: string } }\n\t// Order shipment events\n\t| { action: 'order_shipment_created'; data: { shipment_id: string } }\n\t| { action: 'order_shipment_in_transit'; data: { shipment_id: string } }\n\t| { action: 'order_shipment_out_for_delivery'; data: { shipment_id: string } }\n\t| { action: 'order_shipment_delivered'; data: { shipment_id: string } }\n\t| { action: 'order_shipment_failed'; data: { shipment_id: string; reason?: string } }\n\t| { action: 'order_shipment_returned'; data: { shipment_id: string } }\n\t| { action: 'order_shipment_status_changed'; data: { shipment_id: string; from: string; to: string } }\n\t// Booking events\n\t| { action: 'booking_created' }\n\t| { action: 'booking_updated' }\n\t| { action: 'booking_status_changed'; data: { from: string; to: string } }\n\t| { action: 'booking_payment_received'; data: { amount: number; currency: string } }\n\t| { action: 'booking_payment_failed'; data: { reason?: string } }\n\t| { action: 'booking_refunded'; data: { amount: number; currency: string; reason?: string } }\n\t| { action: 'booking_completed' }\n\t| { action: 'booking_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\t| { action: 'audience_deleted' };\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 location) */\nexport interface Shipment {\n\tid: string;\n\tlocationId: 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"]}
|