arky-sdk 0.3.142 → 0.3.144
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +48 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -4
- package/dist/index.d.ts +11 -4
- package/dist/index.js +48 -2
- package/dist/index.js.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +87 -13
- package/dist/types.d.ts +87 -13
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/types.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/index.ts"],"names":["PaymentMethodType"],"mappings":";;;AA4CO,IAAK,iBAAA,qBAAAA,kBAAAA,KAAL;AACN,EAAAA,mBAAA,MAAA,CAAA,GAAO,MAAA;AACP,EAAAA,mBAAA,YAAA,CAAA,GAAa,aAAA;AACb,EAAAA,mBAAA,MAAA,CAAA,GAAO,MAAA;AAHI,EAAA,OAAAA,kBAAAA;AAAA,CAAA,EAAA,iBAAA,IAAA,EAAA","file":"types.cjs","sourcesContent":["export * from './api';\n\nexport interface PaymentRefund {\n\tid: string;\n\tentity: string;\n\ttotal: number;\n\tproviderRefundId?: string;\n\tstatus: string;\n\tcreatedAt: number;\n}\n\nexport interface Payment {\n\tcurrency: string;\n\tmarket: string;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttotal: number;\n\tpaid: number;\n\ttax?: {\n\t\tamount: number;\n\t\tmodeSnapshot?: string;\n\t\trateBps: number;\n\t\tlines: Array<{ rateBps: number; amount: number; label?: string; scope?: string }>;\n\t};\n\tpromoCode?: {\n\t\tid: string;\n\t\tcode: string;\n\t\ttype: string;\n\t\tvalue: number;\n\t};\n\ttype: PaymentMethodType;\n\tprovider?: {\n\t\tcustomerId: string;\n\t\tpaymentIntentId?: string;\n\t\tsubscriptionId?: string;\n\t\tpriceId?: string;\n\t};\n\trefunds: PaymentRefund[];\n\tzoneId?: string;\n\tpaymentMethodId?: string;\n\tshippingMethodId?: string;\n}\n\nexport enum PaymentMethodType {\n\tCash = \"CASH\",\n\tCreditCard = \"CREDIT_CARD\",\n\tFree = \"FREE\",\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\nexport interface Price {\n\tmarket: string;\n\tamount: number;\n\tcompareAt?: number;\n}\n\nexport interface Location {\n\tcountry?: string | null;\n\taddress?: string | null;\n\tcity?: string | null;\n\tstate?: string | null;\n\tpostalCode?: string | null;\n\tcoordinates?: { lat: number; lon: number } | null;\n}\n\nexport interface EshopCartItem {\n\tid: string;\n\tproductId: string;\n\tvariantId: string;\n\tproductName: string;\n\tproductSlug: string;\n\tvariantAttributes: Record<string, any>;\n\tprice: Price;\n\tquantity: number;\n\taddedAt: number;\n}\n\nexport interface ReservationCartItem {\n\tid: string;\n\tserviceId: string;\n\tserviceName: string;\n\tdate: string;\n\tfrom: number;\n\tto: number;\n\ttimeText: string;\n\tproviderId?: string;\n\tblocks: any[];\n}\n\nexport interface PaymentProviderConfig {\n\ttype: \"STRIPE\";\n\tpublicKey: string;\n\tsecretKey: string;\n\twebhookSecret: string;\n}\n\nexport interface ShippingWeightTier {\n\tupToGrams: number;\n\tamount: number;\n}\n\nexport interface PaymentMethod {\n\tid: string;\n\ttype: PaymentMethodType;\n}\n\nexport interface ShippingMethod {\n\tid: string;\n\ttaxable: boolean;\n\tetaText: string;\n\tpickupLocation?: Location;\n\tamount: number;\n\tfreeAbove?: number;\n\tweightTiers?: ShippingWeightTier[];\n}\n\nexport type ZoneScope = \"ORDER\" | \"RESERVATION\";\n\nexport interface Zone {\n\tid: string;\n\tmarketId: string;\n\tscope: ZoneScope;\n\tcountries: string[];\n\tstates: string[];\n\tpostalCodes: string[];\n\ttaxBps: number;\n\tpaymentMethods: PaymentMethod[];\n\tshippingMethods: ShippingMethod[];\n}\n\nexport interface Market {\n\tid: string;\n\tcurrency: string;\n\ttaxMode: \"EXCLUSIVE\" | \"INCLUSIVE\";\n}\n\nexport interface Language {\n\tid: string;\n}\n\nexport interface BusinessEmails {\n\tbilling: string;\n\tsupport: string;\n}\n\nexport interface BusinessConfig {\n\tlanguages: Language[];\n\tmarkets: Market[];\n\tzones: Zone[];\n\tbuildHooks: string[];\n\twebhooks: any[];\n\tpaymentProvider?: PaymentProviderConfig;\n\taiProvider?: any;\n\temails: BusinessEmails;\n}\n\nexport interface Subscription {\n\tid: string;\n\ttarget: string;\n\tplanId: string;\n\tpendingPlanId: string | null;\n\tpayment: any;\n\tstatuses: StatusEvent[];\n\tendDate: number;\n\tusage: Record<string, any>;\n\ttoken: string;\n}\n\nexport interface Business {\n\tid: string;\n\tname: string;\n\tnetworkKey: string | null;\n\ttimezone: string;\n\tconfigs?: BusinessConfig;\n\tsubscriptions?: Subscription[];\n\tstatuses?: StatusEvent[];\n}\n\nexport interface EshopStoreState {\n\tbusinessId: string;\n\tselectedShippingMethodId: string | null;\n\tuserToken: string | null;\n\tprocessingCheckout: boolean;\n\tloading: boolean;\n\terror: string | null;\n}\n\nexport interface Block {\n\tid: string;\n\tkey: string;\n\ttype: string;\n\tproperties?: any;\n\tvalue?: any;\n}\n\nexport type BlockType =\n\t| \"TEXT\"\n\t| \"LOCALIZED_TEXT\"\n\t| \"NUMBER\"\n\t| \"BOOLEAN\"\n\t| \"BLOCK\"\n\t| \"RELATIONSHIP_ENTRY\"\n\t| \"RELATIONSHIP_MEDIA\"\n\t| \"MARKDOWN\"\n\t| \"EMAIL\"\n\t| \"PHONE\"\n\t| \"ADDRESS\";\n\nexport type AddressType = \"SHIPPING\" | \"BILLING\";\n\nexport interface EmailBlockProperties {\n\tminValues?: number;\n\tmaxValues?: number;\n\tisNotificationTarget?: boolean;\n}\n\nexport interface PhoneBlockProperties {\n\tminValues?: number;\n\tmaxValues?: number;\n\tisNotificationTarget?: boolean;\n}\n\nexport interface AddressBlockProperties {\n\tminValues?: number;\n\tmaxValues?: number;\n\taddressType: AddressType;\n}\n\nexport interface GeoLocationValue {\n\tcountry?: string | null;\n\taddress?: string | null;\n\tcity?: string | null;\n\tstate?: string | null;\n\tpostalCode?: string | null;\n\tcoordinates?: { lat: number; lon: number } | null;\n}\n\nexport interface EmailBlock extends Block {\n\ttype: \"EMAIL\";\n\tproperties: EmailBlockProperties;\n\tvalue: string[];\n}\n\nexport interface PhoneBlock extends Block {\n\ttype: \"PHONE\";\n\tproperties: PhoneBlockProperties;\n\tvalue: string[];\n}\n\nexport interface AddressBlock extends Block {\n\ttype: \"ADDRESS\";\n\tproperties: AddressBlockProperties;\n\tvalue: GeoLocationValue[];\n}\n\nexport interface Seo {\n\tslug: Record<string, string>;\n\tmetaTitle: Record<string, string>;\n\tmetaDescription: Record<string, string>;\n\tcanonicalUrl: Record<string, string>;\n\togImage: string;\n}\n\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\tseo: Seo;\n}\n\nexport interface ApiResponse<T> {\n\tsuccess: boolean;\n\tdata?: T;\n\terror?: string;\n\tcursor?: string;\n\ttotal?: number;\n}\n\nexport interface PaginatedResponse<T> {\n\tdata: T[];\n\tmeta?: {\n\t\ttotal: number;\n\t\tpage: number;\n\t\tper_page: number;\n\t};\n}\n\nexport interface ReservationStoreState {\n\tcurrentStep: number;\n\ttotalSteps: number;\n\tsteps: Record<number, { name: string; labelKey: string }>;\n\tweekdays: string[];\n\tmonthYear: string;\n\tdays: any[];\n\tcurrent: Date;\n\tselectedDate: string | null;\n\tslots: any[];\n\tselectedSlot: any | null;\n\tselectedProvider: any | null;\n\tproviders: any[];\n\tloading: boolean;\n\tstartDate: string | null;\n\tendDate: string | null;\n\tguestToken: string | null;\n\tservice: any | null;\n\tbusiness: Business | null;\n\tcurrency: string;\n\treservationBlocks: Block[];\n\tapiUrl: string;\n\tbusinessId: string;\n\ttimezone: string;\n\ttzGroups: any;\n\titems: ReservationCartItem[];\n\tallowedPaymentMethods: string[];\n\tpaymentConfig: {\n\t\tprovider: PaymentProviderConfig | null;\n\t\tenabled: boolean;\n\t};\n}\n\nexport interface StatusEvent {\n\tid: string;\n\tchangedBy: 'BUSINESS' | 'USER' | 'SYSTEM';\n\tuserId?: string;\n\tstatus: string;\n\tnote?: string;\n\ttimestamp: number;\n}\n\nexport interface ReservationItem {\n\tid: string;\n\tserviceId: string;\n\tproviderId: string;\n\tbusinessId: string;\n\treservationId: string;\n\tuserId: string;\n\tfrom: number;\n\tto: number;\n\tblocks: Block[];\n\tprice: Price;\n}\n\nexport interface Reservation {\n\tid: string;\n\tnumber: string;\n\tuserId: string;\n\tblocks: Block[];\n\tbusinessId: string;\n\tstatuses: StatusEvent[];\n\tserviceIds: string[];\n\tproviderIds: string[];\n\tpayment: Payment;\n\tbusiness?: Business;\n\tuser?: any;\n\titems: ReservationItem[];\n\temail?: string;\n\tphone?: string;\n\tcreatedAt: number;\n\tlastModified: number;\n}\n\n// ===== CMS Types =====\n\nexport interface NodeNotifications {\n\temails: string[];\n}\n\nexport interface NodeConfig {\n\tisPubliclyReadable: boolean;\n\tisPubliclyWritable: boolean;\n}\n\nexport interface SubscriptionPlan {\n\tid: string;\n\tproviderPriceId?: string;\n\tproviderProductId?: string;\n\tname: string;\n\ttier: number;\n\tamount: number;\n\tcurrency: string;\n\tinterval: string;\n\tintervalCount: number;\n\ttrialPeriodDays: number;\n\tfeatures: Record<string, any>;\n}\n\nexport type SendStatus = 'SCHEDULED' | 'SENDING' | 'SENT' | 'CANCELLED' | 'FAILED';\n\nexport interface NewsletterSend {\n\tid: string;\n\tscheduledAt: number;\n\tstatus: SendStatus;\n\tsentCount: number;\n\tfailedCount: number;\n\tcreatedAt: number;\n}\n\nexport interface Node {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tblocks: Block[];\n\tparentId?: string | null;\n\thasChildren: boolean;\n\tstatuses: StatusEvent[];\n\tseo: Seo;\n\tnotifications: NodeNotifications;\n\tconfig: NodeConfig;\n\temailSubject?: Record<string, string>;\n\tplans?: SubscriptionPlan[];\n\tsends?: NewsletterSend[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\n// ===== Reservation Domain Types =====\n\nexport interface ServiceDuration {\n\tduration: number;\n\tisPause?: boolean;\n}\n\nexport interface ServiceProvider {\n\tid: string;\n\tproviderId: string;\n\tworkingTime: {\n\t\tworkingDays: Array<{ day: string; workingHours: Array<{ from: number; to: number }> }>;\n\t\toutcastDates: Array<{ month: number; day: number; workingHours: Array<{ from: number; to: number }> }>;\n\t\tspecificDates: Array<{ date: number; workingHours: Array<{ from: number; to: number }> }>;\n\t};\n\tprovider?: Provider;\n}\n\nexport interface Service {\n\tid: string;\n\tkey: string;\n\tseo: Seo;\n\tbusinessId: string;\n\tprices: Price[];\n\tdurations: ServiceDuration[];\n\tblocks: Block[];\n\tnodeIds: string[];\n\tisApprovalRequired: boolean;\n\tproviders: ServiceProvider[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n\tstatuses: StatusEvent[];\n}\n\nexport interface ProviderTimelinePoint {\n\ttimestamp: number;\n\tconcurrent: number;\n}\n\nexport interface Provider {\n\tid: string;\n\tkey: string;\n\tseo: Seo;\n\tbusinessId: string;\n\tstatuses: StatusEvent[];\n\tconcurrentLimit: number;\n\tnodeIds: string[];\n\tblocks: Block[];\n\ttimeline: ProviderTimelinePoint[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/types/index.ts"],"names":["PaymentMethodType"],"mappings":";;;AA4CO,IAAK,iBAAA,qBAAAA,kBAAAA,KAAL;AACN,EAAAA,mBAAA,MAAA,CAAA,GAAO,MAAA;AACP,EAAAA,mBAAA,YAAA,CAAA,GAAa,aAAA;AACb,EAAAA,mBAAA,MAAA,CAAA,GAAO,MAAA;AAHI,EAAA,OAAAA,kBAAAA;AAAA,CAAA,EAAA,iBAAA,IAAA,EAAA","file":"types.cjs","sourcesContent":["export * from './api';\n\nexport interface PaymentRefund {\n\tid: string;\n\tentity: string;\n\ttotal: number;\n\tproviderRefundId?: string;\n\tstatus: string;\n\tcreatedAt: number;\n}\n\nexport interface Payment {\n\tcurrency: string;\n\tmarket: string;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttotal: number;\n\tpaid: number;\n\ttax?: {\n\t\tamount: number;\n\t\tmodeSnapshot?: string;\n\t\trateBps: number;\n\t\tlines: Array<{ rateBps: number; amount: number; label?: string; scope?: string }>;\n\t};\n\tpromoCode?: {\n\t\tid: string;\n\t\tcode: string;\n\t\ttype: string;\n\t\tvalue: number;\n\t};\n\ttype: PaymentMethodType;\n\tprovider?: {\n\t\tcustomerId: string;\n\t\tpaymentIntentId?: string;\n\t\tsubscriptionId?: string;\n\t\tpriceId?: string;\n\t};\n\trefunds: PaymentRefund[];\n\tzoneId?: string;\n\tpaymentMethodId?: string;\n\tshippingMethodId?: string;\n}\n\nexport enum PaymentMethodType {\n\tCash = \"CASH\",\n\tCreditCard = \"CREDIT_CARD\",\n\tFree = \"FREE\",\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\nexport interface Price {\n\tmarket: string;\n\tamount: number;\n\tcompareAt?: number;\n}\n\nexport interface Location {\n\tcountry?: string | null;\n\taddress?: string | null;\n\tcity?: string | null;\n\tstate?: string | null;\n\tpostalCode?: string | null;\n\tcoordinates?: { lat: number; lon: number } | null;\n}\n\nexport interface EshopCartItem {\n\tid: string;\n\tproductId: string;\n\tvariantId: string;\n\tproductName: string;\n\tproductSlug: string;\n\tvariantAttributes: Record<string, any>;\n\tprice: Price;\n\tquantity: number;\n\taddedAt: number;\n}\n\nexport interface ReservationCartItem {\n\tid: string;\n\tserviceId: string;\n\tserviceName: string;\n\tdate: string;\n\tfrom: number;\n\tto: number;\n\ttimeText: string;\n\tproviderId?: string;\n\tblocks: any[];\n}\n\nexport interface PaymentProviderConfig {\n\ttype: \"STRIPE\";\n\tpublicKey: string;\n\tsecretKey: string;\n\twebhookSecret: string;\n}\n\nexport interface ShippingWeightTier {\n\tupToGrams: number;\n\tamount: number;\n}\n\nexport interface PaymentMethod {\n\tid: string;\n\ttype: PaymentMethodType;\n}\n\nexport interface ShippingMethod {\n\tid: string;\n\ttaxable: boolean;\n\tetaText: string;\n\tpickupLocation?: Location;\n\tamount: number;\n\tfreeAbove?: number;\n\tweightTiers?: ShippingWeightTier[];\n}\n\nexport type ZoneScope = \"ORDER\" | \"RESERVATION\";\n\nexport interface Zone {\n\tid: string;\n\tmarketId: string;\n\tscope: ZoneScope;\n\tcountries: string[];\n\tstates: string[];\n\tpostalCodes: string[];\n\ttaxBps: number;\n\tpaymentMethods: PaymentMethod[];\n\tshippingMethods: ShippingMethod[];\n}\n\nexport interface Market {\n\tid: string;\n\tcurrency: string;\n\ttaxMode: \"EXCLUSIVE\" | \"INCLUSIVE\";\n}\n\nexport interface Language {\n\tid: string;\n}\n\nexport interface BusinessEmails {\n\tbilling: string;\n\tsupport: string;\n}\n\nexport interface BusinessConfig {\n\tlanguages: Language[];\n\tmarkets: Market[];\n\tzones: Zone[];\n\tbuildHooks: string[];\n\twebhooks: any[];\n\tpaymentProvider?: PaymentProviderConfig;\n\taiProvider?: any;\n\temails: BusinessEmails;\n}\n\nexport interface Subscription {\n\tid: string;\n\ttarget: string;\n\tplanId: string;\n\tpendingPlanId: string | null;\n\tpayment: any;\n\tstatuses: StatusEvent[];\n\tendDate: number;\n\tusage: Record<string, any>;\n\ttoken: string;\n}\n\nexport interface Business {\n\tid: string;\n\tkey: string;\n\tnetworkKey: string | null;\n\ttimezone: string;\n\tconfigs?: BusinessConfig;\n\tsubscriptions?: Subscription[];\n\tstatuses?: StatusEvent[];\n}\n\nexport interface EshopStoreState {\n\tbusinessId: string;\n\tselectedShippingMethodId: string | null;\n\tuserToken: string | null;\n\tprocessingCheckout: boolean;\n\tloading: boolean;\n\terror: string | null;\n}\n\nexport interface Block {\n\tid: string;\n\tkey: string;\n\ttype: string;\n\tproperties?: any;\n\tvalue?: any;\n}\n\nexport type BlockType =\n\t| \"TEXT\"\n\t| \"LOCALIZED_TEXT\"\n\t| \"NUMBER\"\n\t| \"BOOLEAN\"\n\t| \"BLOCK\"\n\t| \"RELATIONSHIP_ENTRY\"\n\t| \"RELATIONSHIP_MEDIA\"\n\t| \"MARKDOWN\"\n\t| \"EMAIL\"\n\t| \"PHONE\"\n\t| \"ADDRESS\";\n\nexport type AddressType = \"SHIPPING\" | \"BILLING\";\n\nexport interface EmailBlockProperties {\n\tminValues?: number;\n\tmaxValues?: number;\n\tisNotificationTarget?: boolean;\n}\n\nexport interface PhoneBlockProperties {\n\tminValues?: number;\n\tmaxValues?: number;\n\tisNotificationTarget?: boolean;\n}\n\nexport interface AddressBlockProperties {\n\tminValues?: number;\n\tmaxValues?: number;\n\taddressType: AddressType;\n}\n\nexport interface GeoLocationValue {\n\tcountry?: string | null;\n\taddress?: string | null;\n\tcity?: string | null;\n\tstate?: string | null;\n\tpostalCode?: string | null;\n\tcoordinates?: { lat: number; lon: number } | null;\n}\n\nexport interface EmailBlock extends Block {\n\ttype: \"EMAIL\";\n\tproperties: EmailBlockProperties;\n\tvalue: string[];\n}\n\nexport interface PhoneBlock extends Block {\n\ttype: \"PHONE\";\n\tproperties: PhoneBlockProperties;\n\tvalue: string[];\n}\n\nexport interface AddressBlock extends Block {\n\ttype: \"ADDRESS\";\n\tproperties: AddressBlockProperties;\n\tvalue: GeoLocationValue[];\n}\n\nexport interface Seo {\n\tslug: Record<string, string>;\n\tmetaTitle: Record<string, string>;\n\tmetaDescription: Record<string, string>;\n\tcanonicalUrl: Record<string, string>;\n\togImage: string;\n}\n\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\tseo: Seo;\n}\n\nexport interface ApiResponse<T> {\n\tsuccess: boolean;\n\tdata?: T;\n\terror?: string;\n\tcursor?: string;\n\ttotal?: number;\n}\n\nexport interface PaginatedResponse<T> {\n\tdata: T[];\n\tmeta?: {\n\t\ttotal: number;\n\t\tpage: number;\n\t\tper_page: number;\n\t};\n}\n\nexport interface ReservationStoreState {\n\tcurrentStep: number;\n\ttotalSteps: number;\n\tsteps: Record<number, { name: string; labelKey: string }>;\n\tweekdays: string[];\n\tmonthYear: string;\n\tdays: any[];\n\tcurrent: Date;\n\tselectedDate: string | null;\n\tslots: any[];\n\tselectedSlot: any | null;\n\tselectedProvider: any | null;\n\tproviders: any[];\n\tloading: boolean;\n\tstartDate: string | null;\n\tendDate: string | null;\n\tguestToken: string | null;\n\tservice: any | null;\n\tbusiness: Business | null;\n\tcurrency: string;\n\treservationBlocks: Block[];\n\tapiUrl: string;\n\tbusinessId: string;\n\ttimezone: string;\n\ttzGroups: any;\n\titems: ReservationCartItem[];\n\tallowedPaymentMethods: string[];\n\tpaymentConfig: {\n\t\tprovider: PaymentProviderConfig | null;\n\t\tenabled: boolean;\n\t};\n}\n\nexport interface StatusEvent {\n\tid: string;\n\tchangedBy: 'BUSINESS' | 'USER' | 'SYSTEM';\n\tuserId?: string;\n\tstatus: string;\n\tnote?: string;\n\ttimestamp: number;\n}\n\nexport interface ReservationItem {\n\tid: string;\n\tserviceId: string;\n\tproviderId: string;\n\tbusinessId: string;\n\treservationId: string;\n\tuserId: string;\n\tfrom: number;\n\tto: number;\n\tblocks: Block[];\n\tprice: Price;\n}\n\nexport interface Reservation {\n\tid: string;\n\tnumber: string;\n\tuserId: string;\n\tblocks: Block[];\n\tbusinessId: string;\n\tstatuses: StatusEvent[];\n\tserviceIds: string[];\n\tproviderIds: string[];\n\tpayment: Payment;\n\tbusiness?: Business;\n\tuser?: any;\n\titems: ReservationItem[];\n\temail?: string;\n\tphone?: string;\n\tcreatedAt: number;\n\tlastModified: number;\n}\n\n// ===== CMS Types =====\n\nexport interface NodeNotifications {\n\temails: string[];\n}\n\nexport interface NodeConfig {\n\tparentId?: string | null;\n\tisPubliclyReadable: boolean;\n\tisPubliclyWritable: boolean;\n}\n\nexport interface SubscriptionPlan {\n\tid: string;\n\tproviderPriceId?: string;\n\tproviderProductId?: string;\n\tname: string;\n\ttier: number;\n\tamount: number;\n\tcurrency: string;\n\tinterval: string;\n\tintervalCount: number;\n\ttrialPeriodDays: number;\n\tfeatures: Record<string, any>;\n}\n\nexport type SendStatus = 'SCHEDULED' | 'SENDING' | 'SENT' | 'CANCELLED' | 'FAILED';\n\nexport interface NodeSend {\n\tid: string;\n\tscheduledAt: number;\n\tstatus: SendStatus;\n\tsentCount: number;\n\tfailedCount: number;\n\tcreatedAt: number;\n}\n\nexport interface Node {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tblocks: Block[];\n\tstatuses: StatusEvent[];\n\tseo: Seo;\n\tnotifications: NodeNotifications;\n\tconfig: NodeConfig;\n\temailSubject?: Record<string, string>;\n\tplans: SubscriptionPlan[];\n\tsends: NodeSend[];\n\tchildren: Node[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\n// ===== Reservation Domain Types =====\n\nexport interface ServiceDuration {\n\tduration: number;\n\tisPause?: boolean;\n}\n\nexport interface ServiceProvider {\n\tid: string;\n\tproviderId: string;\n\tworkingTime: {\n\t\tworkingDays: Array<{ day: string; workingHours: Array<{ from: number; to: number }> }>;\n\t\toutcastDates: Array<{ month: number; day: number; workingHours: Array<{ from: number; to: number }> }>;\n\t\tspecificDates: Array<{ date: number; workingHours: Array<{ from: number; to: number }> }>;\n\t};\n\tprovider?: Provider;\n}\n\nexport interface Service {\n\tid: string;\n\tkey: string;\n\tseo: Seo;\n\tbusinessId: string;\n\tprices: Price[];\n\tdurations: ServiceDuration[];\n\tblocks: Block[];\n\tnodeIds: string[];\n\tisApprovalRequired: boolean;\n\tproviders: ServiceProvider[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n\tstatuses: StatusEvent[];\n}\n\nexport interface ProviderTimelinePoint {\n\ttimestamp: number;\n\tconcurrent: number;\n}\n\nexport interface Provider {\n\tid: string;\n\tkey: string;\n\tseo: Seo;\n\tbusinessId: string;\n\tstatuses: StatusEvent[];\n\tconcurrentLimit: number;\n\tnodeIds: string[];\n\tblocks: Block[];\n\ttimeline: ProviderTimelinePoint[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\n// ===== Workflow Types =====\n\nexport interface Workflow {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tsecret: string;\n\tstatuses: StatusEvent[];\n\tnodes: Record<string, WorkflowNode>;\n\tedges: WorkflowEdge[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface WorkflowEdge {\n\tid: string;\n\tsource: string;\n\tsourceOutput: string;\n\ttarget: string;\n}\n\nexport type WorkflowNode =\n\t| WorkflowTriggerNode\n\t| WorkflowHttpNode\n\t| WorkflowIfNode\n\t| WorkflowLoopNode\n\t| WorkflowWaitNode;\n\nexport interface WorkflowTriggerNode {\n\ttype: 'trigger';\n\tevent?: string;\n}\n\nexport interface WorkflowHttpNode {\n\ttype: 'http';\n\tmethod: WorkflowHttpMethod;\n\turl: string;\n\theaders?: Record<string, string>;\n\tbody?: any;\n\ttimeoutMs?: number;\n}\n\nexport interface WorkflowIfNode {\n\ttype: 'if';\n\tcondition: string;\n}\n\nexport interface WorkflowLoopNode {\n\ttype: 'loop';\n\tarray: string;\n}\n\nexport interface WorkflowWaitNode {\n\ttype: 'wait';\n\tduration: string;\n}\n\nexport type WorkflowHttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';\n"]}
|
package/dist/types.d.cts
CHANGED
|
@@ -178,7 +178,7 @@ interface Subscription {
|
|
|
178
178
|
}
|
|
179
179
|
interface Business {
|
|
180
180
|
id: string;
|
|
181
|
-
|
|
181
|
+
key: string;
|
|
182
182
|
networkKey: string | null;
|
|
183
183
|
timezone: string;
|
|
184
184
|
configs?: BusinessConfig;
|
|
@@ -361,6 +361,7 @@ interface NodeNotifications {
|
|
|
361
361
|
emails: string[];
|
|
362
362
|
}
|
|
363
363
|
interface NodeConfig {
|
|
364
|
+
parentId?: string | null;
|
|
364
365
|
isPubliclyReadable: boolean;
|
|
365
366
|
isPubliclyWritable: boolean;
|
|
366
367
|
}
|
|
@@ -378,7 +379,7 @@ interface SubscriptionPlan {
|
|
|
378
379
|
features: Record<string, any>;
|
|
379
380
|
}
|
|
380
381
|
type SendStatus = 'SCHEDULED' | 'SENDING' | 'SENT' | 'CANCELLED' | 'FAILED';
|
|
381
|
-
interface
|
|
382
|
+
interface NodeSend {
|
|
382
383
|
id: string;
|
|
383
384
|
scheduledAt: number;
|
|
384
385
|
status: SendStatus;
|
|
@@ -391,15 +392,14 @@ interface Node {
|
|
|
391
392
|
key: string;
|
|
392
393
|
businessId: string;
|
|
393
394
|
blocks: Block[];
|
|
394
|
-
parentId?: string | null;
|
|
395
|
-
hasChildren: boolean;
|
|
396
395
|
statuses: StatusEvent[];
|
|
397
396
|
seo: Seo;
|
|
398
397
|
notifications: NodeNotifications;
|
|
399
398
|
config: NodeConfig;
|
|
400
399
|
emailSubject?: Record<string, string>;
|
|
401
|
-
plans
|
|
402
|
-
sends
|
|
400
|
+
plans: SubscriptionPlan[];
|
|
401
|
+
sends: NodeSend[];
|
|
402
|
+
children: Node[];
|
|
403
403
|
createdAt: number;
|
|
404
404
|
updatedAt: number;
|
|
405
405
|
}
|
|
@@ -468,6 +468,49 @@ interface Provider {
|
|
|
468
468
|
createdAt: number;
|
|
469
469
|
updatedAt: number;
|
|
470
470
|
}
|
|
471
|
+
interface Workflow {
|
|
472
|
+
id: string;
|
|
473
|
+
key: string;
|
|
474
|
+
businessId: string;
|
|
475
|
+
secret: string;
|
|
476
|
+
statuses: StatusEvent[];
|
|
477
|
+
nodes: Record<string, WorkflowNode>;
|
|
478
|
+
edges: WorkflowEdge[];
|
|
479
|
+
createdAt: number;
|
|
480
|
+
updatedAt: number;
|
|
481
|
+
}
|
|
482
|
+
interface WorkflowEdge {
|
|
483
|
+
id: string;
|
|
484
|
+
source: string;
|
|
485
|
+
sourceOutput: string;
|
|
486
|
+
target: string;
|
|
487
|
+
}
|
|
488
|
+
type WorkflowNode = WorkflowTriggerNode | WorkflowHttpNode | WorkflowIfNode | WorkflowLoopNode | WorkflowWaitNode;
|
|
489
|
+
interface WorkflowTriggerNode {
|
|
490
|
+
type: 'trigger';
|
|
491
|
+
event?: string;
|
|
492
|
+
}
|
|
493
|
+
interface WorkflowHttpNode {
|
|
494
|
+
type: 'http';
|
|
495
|
+
method: WorkflowHttpMethod;
|
|
496
|
+
url: string;
|
|
497
|
+
headers?: Record<string, string>;
|
|
498
|
+
body?: any;
|
|
499
|
+
timeoutMs?: number;
|
|
500
|
+
}
|
|
501
|
+
interface WorkflowIfNode {
|
|
502
|
+
type: 'if';
|
|
503
|
+
condition: string;
|
|
504
|
+
}
|
|
505
|
+
interface WorkflowLoopNode {
|
|
506
|
+
type: 'loop';
|
|
507
|
+
array: string;
|
|
508
|
+
}
|
|
509
|
+
interface WorkflowWaitNode {
|
|
510
|
+
type: 'wait';
|
|
511
|
+
duration: string;
|
|
512
|
+
}
|
|
513
|
+
type WorkflowHttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
471
514
|
|
|
472
515
|
interface RequestOptions<T = any> {
|
|
473
516
|
headers?: Record<string, string>;
|
|
@@ -542,19 +585,19 @@ interface GetNodesParams {
|
|
|
542
585
|
sortDirection?: string;
|
|
543
586
|
createdAtFrom?: string;
|
|
544
587
|
createdAtTo?: string;
|
|
588
|
+
includeChildren?: boolean;
|
|
545
589
|
}
|
|
546
590
|
interface CreateNodeParams {
|
|
547
591
|
businessId?: string;
|
|
548
592
|
key: string;
|
|
549
593
|
blocks?: any[];
|
|
550
|
-
parentId?: string | null;
|
|
551
|
-
hasChildren?: boolean;
|
|
552
594
|
seo?: any;
|
|
553
595
|
status?: string;
|
|
554
596
|
notifications?: {
|
|
555
597
|
emails?: string[];
|
|
556
598
|
};
|
|
557
599
|
config?: {
|
|
600
|
+
parentId?: string | null;
|
|
558
601
|
isPubliclyReadable?: boolean;
|
|
559
602
|
isPubliclyWritable?: boolean;
|
|
560
603
|
};
|
|
@@ -566,14 +609,13 @@ interface UpdateNodeParams {
|
|
|
566
609
|
businessId?: string;
|
|
567
610
|
key?: string;
|
|
568
611
|
blocks?: any[];
|
|
569
|
-
parentId?: string | null;
|
|
570
|
-
hasChildren?: boolean;
|
|
571
612
|
seo?: any;
|
|
572
613
|
status?: string;
|
|
573
614
|
notifications?: {
|
|
574
615
|
emails?: string[];
|
|
575
616
|
};
|
|
576
617
|
config?: {
|
|
618
|
+
parentId?: string | null;
|
|
577
619
|
isPubliclyReadable?: boolean;
|
|
578
620
|
isPubliclyWritable?: boolean;
|
|
579
621
|
};
|
|
@@ -799,7 +841,7 @@ interface GetPromoCodesParams {
|
|
|
799
841
|
expiresAtTo?: string;
|
|
800
842
|
}
|
|
801
843
|
interface CreateBusinessParams {
|
|
802
|
-
|
|
844
|
+
key: string;
|
|
803
845
|
slug?: string;
|
|
804
846
|
description?: string;
|
|
805
847
|
email?: string;
|
|
@@ -811,7 +853,7 @@ interface CreateBusinessParams {
|
|
|
811
853
|
}
|
|
812
854
|
interface UpdateBusinessParams {
|
|
813
855
|
id: string;
|
|
814
|
-
|
|
856
|
+
key: string;
|
|
815
857
|
networkKey: string | null;
|
|
816
858
|
timezone: string;
|
|
817
859
|
statuses: any[];
|
|
@@ -1239,5 +1281,37 @@ interface Slot {
|
|
|
1239
1281
|
timeText: string;
|
|
1240
1282
|
dateText: string;
|
|
1241
1283
|
}
|
|
1284
|
+
interface CreateWorkflowParams {
|
|
1285
|
+
businessId: string;
|
|
1286
|
+
key: string;
|
|
1287
|
+
statuses?: StatusEvent[];
|
|
1288
|
+
nodes: Record<string, WorkflowNode>;
|
|
1289
|
+
edges: WorkflowEdge[];
|
|
1290
|
+
}
|
|
1291
|
+
interface UpdateWorkflowParams {
|
|
1292
|
+
id: string;
|
|
1293
|
+
key: string;
|
|
1294
|
+
statuses?: StatusEvent[];
|
|
1295
|
+
nodes: Record<string, WorkflowNode>;
|
|
1296
|
+
edges: WorkflowEdge[];
|
|
1297
|
+
}
|
|
1298
|
+
interface DeleteWorkflowParams {
|
|
1299
|
+
id: string;
|
|
1300
|
+
}
|
|
1301
|
+
interface GetWorkflowParams {
|
|
1302
|
+
id: string;
|
|
1303
|
+
}
|
|
1304
|
+
interface GetWorkflowsParams {
|
|
1305
|
+
businessId: string;
|
|
1306
|
+
ids?: string[];
|
|
1307
|
+
query?: string;
|
|
1308
|
+
statuses?: string[];
|
|
1309
|
+
limit?: number;
|
|
1310
|
+
cursor?: string;
|
|
1311
|
+
sortField?: string;
|
|
1312
|
+
sortDirection?: 'asc' | 'desc';
|
|
1313
|
+
createdAtFrom?: number;
|
|
1314
|
+
createdAtTo?: number;
|
|
1315
|
+
}
|
|
1242
1316
|
|
|
1243
|
-
export { type AddPhoneNumberParams, type AddressBlock, type AddressBlockProperties, type AddressType, type ApiResponse, type Block, type BlockType, type BulkScheduleParams, type Business, type BusinessConfig, type BusinessEmails, type CancelSendParams, type Condition, type ConfirmUserParams, type CreateBusinessParams, type CreateFeatureFlagParams, type CreateNodeParams, type CreateOrderParams, type CreatePortalSessionParams, type CreateProductParams, type CreatePromoCodeParams, type CreateProviderParams, type CreateReservationParams, type CreateRoleParams, type CreateServiceParams, type DayAvailability, type DeleteBusinessMediaParams, type DeleteBusinessParams, type DeleteFeatureFlagParams, type DeleteNodeParams, type DeleteProductParams, type DeletePromoCodeParams, type DeleteProviderParams, type DeleteRoleParams, type DeleteServiceParams, type DeleteUserParams, type Discount, type EmailBlock, type EmailBlockProperties, type EshopCartItem, type EshopItem, type EshopStoreState, type FeatureFlag, type FeatureFlagStatus, type FlagResults, type ForgotPasswordParams, type GenerateBlocksParams, type GeoLocationValue, type GetAnalyticsHealthParams, type GetAnalyticsParams, type GetAvailabilityParams, type GetBusinessMediaParams, type GetBusinessMediaParams2, type GetBusinessParams, type GetBusinessParentsParams, type GetBusinessServiceWorkingTimeParams, type GetBusinessesParams, type GetDeliveryStatsParams, type GetFeatureFlagParams, type GetFeatureFlagResultsParams, type GetFeatureFlagsParams, type GetLoginUrlParams, type GetMeParams, type GetNodeChildrenParams, type GetNodeParams, type GetNodesParams, type GetOrderParams, type GetOrdersParams, type GetProductParams, type GetProductsParams, type GetPromoCodeParams, type GetPromoCodesParams, type GetProviderParams, type GetProvidersParams, type GetQuoteParams, type GetReservationParams, type GetReservationQuoteParams, type GetRoleParams, type GetRolesParams, type GetServiceParams, type GetServicesParams, type GetSlotsForDateParams, type GetSubscribersParams, type GetSubscriptionParams, type GetSubscriptionPlansParams, type GetVariableMetadataParams, type GetVariantParams, type GetVariantResponse, type HandleInvitationParams, type InviteUserParams, type Language, type Location, type LoginUserParams, type LogoutParams, type Market, type Media, type MediaResolution, type
|
|
1317
|
+
export { type AddPhoneNumberParams, type AddressBlock, type AddressBlockProperties, type AddressType, type ApiResponse, type Block, type BlockType, type BulkScheduleParams, type Business, type BusinessConfig, type BusinessEmails, type CancelSendParams, type Condition, type ConfirmUserParams, type CreateBusinessParams, type CreateFeatureFlagParams, type CreateNodeParams, type CreateOrderParams, type CreatePortalSessionParams, type CreateProductParams, type CreatePromoCodeParams, type CreateProviderParams, type CreateReservationParams, type CreateRoleParams, type CreateServiceParams, type CreateWorkflowParams, type DayAvailability, type DeleteBusinessMediaParams, type DeleteBusinessParams, type DeleteFeatureFlagParams, type DeleteNodeParams, type DeleteProductParams, type DeletePromoCodeParams, type DeleteProviderParams, type DeleteRoleParams, type DeleteServiceParams, type DeleteUserParams, type DeleteWorkflowParams, type Discount, type EmailBlock, type EmailBlockProperties, type EshopCartItem, type EshopItem, type EshopStoreState, type FeatureFlag, type FeatureFlagStatus, type FlagResults, type ForgotPasswordParams, type GenerateBlocksParams, type GeoLocationValue, type GetAnalyticsHealthParams, type GetAnalyticsParams, type GetAvailabilityParams, type GetBusinessMediaParams, type GetBusinessMediaParams2, type GetBusinessParams, type GetBusinessParentsParams, type GetBusinessServiceWorkingTimeParams, type GetBusinessesParams, type GetDeliveryStatsParams, type GetFeatureFlagParams, type GetFeatureFlagResultsParams, type GetFeatureFlagsParams, type GetLoginUrlParams, type GetMeParams, type GetNodeChildrenParams, type GetNodeParams, type GetNodesParams, type GetOrderParams, type GetOrdersParams, type GetProductParams, type GetProductsParams, type GetPromoCodeParams, type GetPromoCodesParams, type GetProviderParams, type GetProvidersParams, type GetQuoteParams, type GetReservationParams, type GetReservationQuoteParams, type GetRoleParams, type GetRolesParams, type GetServiceParams, type GetServicesParams, type GetSlotsForDateParams, type GetSubscribersParams, type GetSubscriptionParams, type GetSubscriptionPlansParams, type GetVariableMetadataParams, type GetVariantParams, type GetVariantResponse, type GetWorkflowParams, type GetWorkflowsParams, type HandleInvitationParams, type InviteUserParams, type Language, type Location, type LoginUserParams, type LogoutParams, type Market, type Media, type MediaResolution, type Node, type NodeConfig, type NodeNotifications, type NodeSend, type OrderCheckoutParams, type OutcastDate, type Paginated, type PaginatedResponse, type Payment, type PaymentMethod, PaymentMethodType, type PaymentProviderConfig, type PaymentRefund, type PhoneBlock, type PhoneBlockProperties, type PhoneNumberConfirmParams, type Price, type ProcessRefundParams, type PromoCodeValidation, type Provider, type ProviderTimelinePoint, type ProviderWithTimeline, type Quote, type RegisterUserParams, type RequestOptions, type Reservation, type ReservationCartItem, type ReservationCheckoutParams, type ReservationItem, type ReservationQuoteItem, type ReservationStoreState, type ResetForgotPasswordParams, type ResetPasswordParams, type ScheduleSendParams, type SearchReservationsParams, type SearchUsersParams, type SendStatus, type Seo, type Service, type ServiceDuration, type ServiceProvider, type ServiceProviderInput, type SetRoleParams, type SetupAnalyticsParams, type ShippingMethod, type ShippingWeightTier, type Slot, type SpecificDate, type StatusEvent, type SubscribeParams, type Subscription, type SubscriptionPlan, type SystemTemplateKey, type TestWebhookParams, type TimelinePoint, type TrackEmailOpenParams, type TrackEventParams, type TrackEventResponse, type TriggerBuildsParams, type UpdateBusinessParams, type UpdateFeatureFlagParams, type UpdateMediaParams, type UpdateNodeParams, type UpdateNotificationsParams, type UpdateOrderParams, type UpdateProductParams, type UpdatePromoCodeParams, type UpdateProviderParams, type UpdateReservationParams, type UpdateRoleParams, type UpdateServiceParams, type UpdateUserProfileParams, type UpdateWorkflowParams, type UploadBusinessMediaParams, type UserSubscribeParams, type Variant, type VariantInput, type VariantResult, type Workflow, type WorkflowEdge, type WorkflowHttpMethod, type WorkflowHttpNode, type WorkflowIfNode, type WorkflowLoopNode, type WorkflowNode, type WorkflowTriggerNode, type WorkflowWaitNode, type WorkingDay, type WorkingHour, type WorkingTime, type Zone, type ZoneScope };
|
package/dist/types.d.ts
CHANGED
|
@@ -178,7 +178,7 @@ interface Subscription {
|
|
|
178
178
|
}
|
|
179
179
|
interface Business {
|
|
180
180
|
id: string;
|
|
181
|
-
|
|
181
|
+
key: string;
|
|
182
182
|
networkKey: string | null;
|
|
183
183
|
timezone: string;
|
|
184
184
|
configs?: BusinessConfig;
|
|
@@ -361,6 +361,7 @@ interface NodeNotifications {
|
|
|
361
361
|
emails: string[];
|
|
362
362
|
}
|
|
363
363
|
interface NodeConfig {
|
|
364
|
+
parentId?: string | null;
|
|
364
365
|
isPubliclyReadable: boolean;
|
|
365
366
|
isPubliclyWritable: boolean;
|
|
366
367
|
}
|
|
@@ -378,7 +379,7 @@ interface SubscriptionPlan {
|
|
|
378
379
|
features: Record<string, any>;
|
|
379
380
|
}
|
|
380
381
|
type SendStatus = 'SCHEDULED' | 'SENDING' | 'SENT' | 'CANCELLED' | 'FAILED';
|
|
381
|
-
interface
|
|
382
|
+
interface NodeSend {
|
|
382
383
|
id: string;
|
|
383
384
|
scheduledAt: number;
|
|
384
385
|
status: SendStatus;
|
|
@@ -391,15 +392,14 @@ interface Node {
|
|
|
391
392
|
key: string;
|
|
392
393
|
businessId: string;
|
|
393
394
|
blocks: Block[];
|
|
394
|
-
parentId?: string | null;
|
|
395
|
-
hasChildren: boolean;
|
|
396
395
|
statuses: StatusEvent[];
|
|
397
396
|
seo: Seo;
|
|
398
397
|
notifications: NodeNotifications;
|
|
399
398
|
config: NodeConfig;
|
|
400
399
|
emailSubject?: Record<string, string>;
|
|
401
|
-
plans
|
|
402
|
-
sends
|
|
400
|
+
plans: SubscriptionPlan[];
|
|
401
|
+
sends: NodeSend[];
|
|
402
|
+
children: Node[];
|
|
403
403
|
createdAt: number;
|
|
404
404
|
updatedAt: number;
|
|
405
405
|
}
|
|
@@ -468,6 +468,49 @@ interface Provider {
|
|
|
468
468
|
createdAt: number;
|
|
469
469
|
updatedAt: number;
|
|
470
470
|
}
|
|
471
|
+
interface Workflow {
|
|
472
|
+
id: string;
|
|
473
|
+
key: string;
|
|
474
|
+
businessId: string;
|
|
475
|
+
secret: string;
|
|
476
|
+
statuses: StatusEvent[];
|
|
477
|
+
nodes: Record<string, WorkflowNode>;
|
|
478
|
+
edges: WorkflowEdge[];
|
|
479
|
+
createdAt: number;
|
|
480
|
+
updatedAt: number;
|
|
481
|
+
}
|
|
482
|
+
interface WorkflowEdge {
|
|
483
|
+
id: string;
|
|
484
|
+
source: string;
|
|
485
|
+
sourceOutput: string;
|
|
486
|
+
target: string;
|
|
487
|
+
}
|
|
488
|
+
type WorkflowNode = WorkflowTriggerNode | WorkflowHttpNode | WorkflowIfNode | WorkflowLoopNode | WorkflowWaitNode;
|
|
489
|
+
interface WorkflowTriggerNode {
|
|
490
|
+
type: 'trigger';
|
|
491
|
+
event?: string;
|
|
492
|
+
}
|
|
493
|
+
interface WorkflowHttpNode {
|
|
494
|
+
type: 'http';
|
|
495
|
+
method: WorkflowHttpMethod;
|
|
496
|
+
url: string;
|
|
497
|
+
headers?: Record<string, string>;
|
|
498
|
+
body?: any;
|
|
499
|
+
timeoutMs?: number;
|
|
500
|
+
}
|
|
501
|
+
interface WorkflowIfNode {
|
|
502
|
+
type: 'if';
|
|
503
|
+
condition: string;
|
|
504
|
+
}
|
|
505
|
+
interface WorkflowLoopNode {
|
|
506
|
+
type: 'loop';
|
|
507
|
+
array: string;
|
|
508
|
+
}
|
|
509
|
+
interface WorkflowWaitNode {
|
|
510
|
+
type: 'wait';
|
|
511
|
+
duration: string;
|
|
512
|
+
}
|
|
513
|
+
type WorkflowHttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
471
514
|
|
|
472
515
|
interface RequestOptions<T = any> {
|
|
473
516
|
headers?: Record<string, string>;
|
|
@@ -542,19 +585,19 @@ interface GetNodesParams {
|
|
|
542
585
|
sortDirection?: string;
|
|
543
586
|
createdAtFrom?: string;
|
|
544
587
|
createdAtTo?: string;
|
|
588
|
+
includeChildren?: boolean;
|
|
545
589
|
}
|
|
546
590
|
interface CreateNodeParams {
|
|
547
591
|
businessId?: string;
|
|
548
592
|
key: string;
|
|
549
593
|
blocks?: any[];
|
|
550
|
-
parentId?: string | null;
|
|
551
|
-
hasChildren?: boolean;
|
|
552
594
|
seo?: any;
|
|
553
595
|
status?: string;
|
|
554
596
|
notifications?: {
|
|
555
597
|
emails?: string[];
|
|
556
598
|
};
|
|
557
599
|
config?: {
|
|
600
|
+
parentId?: string | null;
|
|
558
601
|
isPubliclyReadable?: boolean;
|
|
559
602
|
isPubliclyWritable?: boolean;
|
|
560
603
|
};
|
|
@@ -566,14 +609,13 @@ interface UpdateNodeParams {
|
|
|
566
609
|
businessId?: string;
|
|
567
610
|
key?: string;
|
|
568
611
|
blocks?: any[];
|
|
569
|
-
parentId?: string | null;
|
|
570
|
-
hasChildren?: boolean;
|
|
571
612
|
seo?: any;
|
|
572
613
|
status?: string;
|
|
573
614
|
notifications?: {
|
|
574
615
|
emails?: string[];
|
|
575
616
|
};
|
|
576
617
|
config?: {
|
|
618
|
+
parentId?: string | null;
|
|
577
619
|
isPubliclyReadable?: boolean;
|
|
578
620
|
isPubliclyWritable?: boolean;
|
|
579
621
|
};
|
|
@@ -799,7 +841,7 @@ interface GetPromoCodesParams {
|
|
|
799
841
|
expiresAtTo?: string;
|
|
800
842
|
}
|
|
801
843
|
interface CreateBusinessParams {
|
|
802
|
-
|
|
844
|
+
key: string;
|
|
803
845
|
slug?: string;
|
|
804
846
|
description?: string;
|
|
805
847
|
email?: string;
|
|
@@ -811,7 +853,7 @@ interface CreateBusinessParams {
|
|
|
811
853
|
}
|
|
812
854
|
interface UpdateBusinessParams {
|
|
813
855
|
id: string;
|
|
814
|
-
|
|
856
|
+
key: string;
|
|
815
857
|
networkKey: string | null;
|
|
816
858
|
timezone: string;
|
|
817
859
|
statuses: any[];
|
|
@@ -1239,5 +1281,37 @@ interface Slot {
|
|
|
1239
1281
|
timeText: string;
|
|
1240
1282
|
dateText: string;
|
|
1241
1283
|
}
|
|
1284
|
+
interface CreateWorkflowParams {
|
|
1285
|
+
businessId: string;
|
|
1286
|
+
key: string;
|
|
1287
|
+
statuses?: StatusEvent[];
|
|
1288
|
+
nodes: Record<string, WorkflowNode>;
|
|
1289
|
+
edges: WorkflowEdge[];
|
|
1290
|
+
}
|
|
1291
|
+
interface UpdateWorkflowParams {
|
|
1292
|
+
id: string;
|
|
1293
|
+
key: string;
|
|
1294
|
+
statuses?: StatusEvent[];
|
|
1295
|
+
nodes: Record<string, WorkflowNode>;
|
|
1296
|
+
edges: WorkflowEdge[];
|
|
1297
|
+
}
|
|
1298
|
+
interface DeleteWorkflowParams {
|
|
1299
|
+
id: string;
|
|
1300
|
+
}
|
|
1301
|
+
interface GetWorkflowParams {
|
|
1302
|
+
id: string;
|
|
1303
|
+
}
|
|
1304
|
+
interface GetWorkflowsParams {
|
|
1305
|
+
businessId: string;
|
|
1306
|
+
ids?: string[];
|
|
1307
|
+
query?: string;
|
|
1308
|
+
statuses?: string[];
|
|
1309
|
+
limit?: number;
|
|
1310
|
+
cursor?: string;
|
|
1311
|
+
sortField?: string;
|
|
1312
|
+
sortDirection?: 'asc' | 'desc';
|
|
1313
|
+
createdAtFrom?: number;
|
|
1314
|
+
createdAtTo?: number;
|
|
1315
|
+
}
|
|
1242
1316
|
|
|
1243
|
-
export { type AddPhoneNumberParams, type AddressBlock, type AddressBlockProperties, type AddressType, type ApiResponse, type Block, type BlockType, type BulkScheduleParams, type Business, type BusinessConfig, type BusinessEmails, type CancelSendParams, type Condition, type ConfirmUserParams, type CreateBusinessParams, type CreateFeatureFlagParams, type CreateNodeParams, type CreateOrderParams, type CreatePortalSessionParams, type CreateProductParams, type CreatePromoCodeParams, type CreateProviderParams, type CreateReservationParams, type CreateRoleParams, type CreateServiceParams, type DayAvailability, type DeleteBusinessMediaParams, type DeleteBusinessParams, type DeleteFeatureFlagParams, type DeleteNodeParams, type DeleteProductParams, type DeletePromoCodeParams, type DeleteProviderParams, type DeleteRoleParams, type DeleteServiceParams, type DeleteUserParams, type Discount, type EmailBlock, type EmailBlockProperties, type EshopCartItem, type EshopItem, type EshopStoreState, type FeatureFlag, type FeatureFlagStatus, type FlagResults, type ForgotPasswordParams, type GenerateBlocksParams, type GeoLocationValue, type GetAnalyticsHealthParams, type GetAnalyticsParams, type GetAvailabilityParams, type GetBusinessMediaParams, type GetBusinessMediaParams2, type GetBusinessParams, type GetBusinessParentsParams, type GetBusinessServiceWorkingTimeParams, type GetBusinessesParams, type GetDeliveryStatsParams, type GetFeatureFlagParams, type GetFeatureFlagResultsParams, type GetFeatureFlagsParams, type GetLoginUrlParams, type GetMeParams, type GetNodeChildrenParams, type GetNodeParams, type GetNodesParams, type GetOrderParams, type GetOrdersParams, type GetProductParams, type GetProductsParams, type GetPromoCodeParams, type GetPromoCodesParams, type GetProviderParams, type GetProvidersParams, type GetQuoteParams, type GetReservationParams, type GetReservationQuoteParams, type GetRoleParams, type GetRolesParams, type GetServiceParams, type GetServicesParams, type GetSlotsForDateParams, type GetSubscribersParams, type GetSubscriptionParams, type GetSubscriptionPlansParams, type GetVariableMetadataParams, type GetVariantParams, type GetVariantResponse, type HandleInvitationParams, type InviteUserParams, type Language, type Location, type LoginUserParams, type LogoutParams, type Market, type Media, type MediaResolution, type
|
|
1317
|
+
export { type AddPhoneNumberParams, type AddressBlock, type AddressBlockProperties, type AddressType, type ApiResponse, type Block, type BlockType, type BulkScheduleParams, type Business, type BusinessConfig, type BusinessEmails, type CancelSendParams, type Condition, type ConfirmUserParams, type CreateBusinessParams, type CreateFeatureFlagParams, type CreateNodeParams, type CreateOrderParams, type CreatePortalSessionParams, type CreateProductParams, type CreatePromoCodeParams, type CreateProviderParams, type CreateReservationParams, type CreateRoleParams, type CreateServiceParams, type CreateWorkflowParams, type DayAvailability, type DeleteBusinessMediaParams, type DeleteBusinessParams, type DeleteFeatureFlagParams, type DeleteNodeParams, type DeleteProductParams, type DeletePromoCodeParams, type DeleteProviderParams, type DeleteRoleParams, type DeleteServiceParams, type DeleteUserParams, type DeleteWorkflowParams, type Discount, type EmailBlock, type EmailBlockProperties, type EshopCartItem, type EshopItem, type EshopStoreState, type FeatureFlag, type FeatureFlagStatus, type FlagResults, type ForgotPasswordParams, type GenerateBlocksParams, type GeoLocationValue, type GetAnalyticsHealthParams, type GetAnalyticsParams, type GetAvailabilityParams, type GetBusinessMediaParams, type GetBusinessMediaParams2, type GetBusinessParams, type GetBusinessParentsParams, type GetBusinessServiceWorkingTimeParams, type GetBusinessesParams, type GetDeliveryStatsParams, type GetFeatureFlagParams, type GetFeatureFlagResultsParams, type GetFeatureFlagsParams, type GetLoginUrlParams, type GetMeParams, type GetNodeChildrenParams, type GetNodeParams, type GetNodesParams, type GetOrderParams, type GetOrdersParams, type GetProductParams, type GetProductsParams, type GetPromoCodeParams, type GetPromoCodesParams, type GetProviderParams, type GetProvidersParams, type GetQuoteParams, type GetReservationParams, type GetReservationQuoteParams, type GetRoleParams, type GetRolesParams, type GetServiceParams, type GetServicesParams, type GetSlotsForDateParams, type GetSubscribersParams, type GetSubscriptionParams, type GetSubscriptionPlansParams, type GetVariableMetadataParams, type GetVariantParams, type GetVariantResponse, type GetWorkflowParams, type GetWorkflowsParams, type HandleInvitationParams, type InviteUserParams, type Language, type Location, type LoginUserParams, type LogoutParams, type Market, type Media, type MediaResolution, type Node, type NodeConfig, type NodeNotifications, type NodeSend, type OrderCheckoutParams, type OutcastDate, type Paginated, type PaginatedResponse, type Payment, type PaymentMethod, PaymentMethodType, type PaymentProviderConfig, type PaymentRefund, type PhoneBlock, type PhoneBlockProperties, type PhoneNumberConfirmParams, type Price, type ProcessRefundParams, type PromoCodeValidation, type Provider, type ProviderTimelinePoint, type ProviderWithTimeline, type Quote, type RegisterUserParams, type RequestOptions, type Reservation, type ReservationCartItem, type ReservationCheckoutParams, type ReservationItem, type ReservationQuoteItem, type ReservationStoreState, type ResetForgotPasswordParams, type ResetPasswordParams, type ScheduleSendParams, type SearchReservationsParams, type SearchUsersParams, type SendStatus, type Seo, type Service, type ServiceDuration, type ServiceProvider, type ServiceProviderInput, type SetRoleParams, type SetupAnalyticsParams, type ShippingMethod, type ShippingWeightTier, type Slot, type SpecificDate, type StatusEvent, type SubscribeParams, type Subscription, type SubscriptionPlan, type SystemTemplateKey, type TestWebhookParams, type TimelinePoint, type TrackEmailOpenParams, type TrackEventParams, type TrackEventResponse, type TriggerBuildsParams, type UpdateBusinessParams, type UpdateFeatureFlagParams, type UpdateMediaParams, type UpdateNodeParams, type UpdateNotificationsParams, type UpdateOrderParams, type UpdateProductParams, type UpdatePromoCodeParams, type UpdateProviderParams, type UpdateReservationParams, type UpdateRoleParams, type UpdateServiceParams, type UpdateUserProfileParams, type UpdateWorkflowParams, type UploadBusinessMediaParams, type UserSubscribeParams, type Variant, type VariantInput, type VariantResult, type Workflow, type WorkflowEdge, type WorkflowHttpMethod, type WorkflowHttpNode, type WorkflowIfNode, type WorkflowLoopNode, type WorkflowNode, type WorkflowTriggerNode, type WorkflowWaitNode, type WorkingDay, type WorkingHour, type WorkingTime, type Zone, type ZoneScope };
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/index.ts"],"names":["PaymentMethodType"],"mappings":";AA4CO,IAAK,iBAAA,qBAAAA,kBAAAA,KAAL;AACN,EAAAA,mBAAA,MAAA,CAAA,GAAO,MAAA;AACP,EAAAA,mBAAA,YAAA,CAAA,GAAa,aAAA;AACb,EAAAA,mBAAA,MAAA,CAAA,GAAO,MAAA;AAHI,EAAA,OAAAA,kBAAAA;AAAA,CAAA,EAAA,iBAAA,IAAA,EAAA","file":"types.js","sourcesContent":["export * from './api';\n\nexport interface PaymentRefund {\n\tid: string;\n\tentity: string;\n\ttotal: number;\n\tproviderRefundId?: string;\n\tstatus: string;\n\tcreatedAt: number;\n}\n\nexport interface Payment {\n\tcurrency: string;\n\tmarket: string;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttotal: number;\n\tpaid: number;\n\ttax?: {\n\t\tamount: number;\n\t\tmodeSnapshot?: string;\n\t\trateBps: number;\n\t\tlines: Array<{ rateBps: number; amount: number; label?: string; scope?: string }>;\n\t};\n\tpromoCode?: {\n\t\tid: string;\n\t\tcode: string;\n\t\ttype: string;\n\t\tvalue: number;\n\t};\n\ttype: PaymentMethodType;\n\tprovider?: {\n\t\tcustomerId: string;\n\t\tpaymentIntentId?: string;\n\t\tsubscriptionId?: string;\n\t\tpriceId?: string;\n\t};\n\trefunds: PaymentRefund[];\n\tzoneId?: string;\n\tpaymentMethodId?: string;\n\tshippingMethodId?: string;\n}\n\nexport enum PaymentMethodType {\n\tCash = \"CASH\",\n\tCreditCard = \"CREDIT_CARD\",\n\tFree = \"FREE\",\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\nexport interface Price {\n\tmarket: string;\n\tamount: number;\n\tcompareAt?: number;\n}\n\nexport interface Location {\n\tcountry?: string | null;\n\taddress?: string | null;\n\tcity?: string | null;\n\tstate?: string | null;\n\tpostalCode?: string | null;\n\tcoordinates?: { lat: number; lon: number } | null;\n}\n\nexport interface EshopCartItem {\n\tid: string;\n\tproductId: string;\n\tvariantId: string;\n\tproductName: string;\n\tproductSlug: string;\n\tvariantAttributes: Record<string, any>;\n\tprice: Price;\n\tquantity: number;\n\taddedAt: number;\n}\n\nexport interface ReservationCartItem {\n\tid: string;\n\tserviceId: string;\n\tserviceName: string;\n\tdate: string;\n\tfrom: number;\n\tto: number;\n\ttimeText: string;\n\tproviderId?: string;\n\tblocks: any[];\n}\n\nexport interface PaymentProviderConfig {\n\ttype: \"STRIPE\";\n\tpublicKey: string;\n\tsecretKey: string;\n\twebhookSecret: string;\n}\n\nexport interface ShippingWeightTier {\n\tupToGrams: number;\n\tamount: number;\n}\n\nexport interface PaymentMethod {\n\tid: string;\n\ttype: PaymentMethodType;\n}\n\nexport interface ShippingMethod {\n\tid: string;\n\ttaxable: boolean;\n\tetaText: string;\n\tpickupLocation?: Location;\n\tamount: number;\n\tfreeAbove?: number;\n\tweightTiers?: ShippingWeightTier[];\n}\n\nexport type ZoneScope = \"ORDER\" | \"RESERVATION\";\n\nexport interface Zone {\n\tid: string;\n\tmarketId: string;\n\tscope: ZoneScope;\n\tcountries: string[];\n\tstates: string[];\n\tpostalCodes: string[];\n\ttaxBps: number;\n\tpaymentMethods: PaymentMethod[];\n\tshippingMethods: ShippingMethod[];\n}\n\nexport interface Market {\n\tid: string;\n\tcurrency: string;\n\ttaxMode: \"EXCLUSIVE\" | \"INCLUSIVE\";\n}\n\nexport interface Language {\n\tid: string;\n}\n\nexport interface BusinessEmails {\n\tbilling: string;\n\tsupport: string;\n}\n\nexport interface BusinessConfig {\n\tlanguages: Language[];\n\tmarkets: Market[];\n\tzones: Zone[];\n\tbuildHooks: string[];\n\twebhooks: any[];\n\tpaymentProvider?: PaymentProviderConfig;\n\taiProvider?: any;\n\temails: BusinessEmails;\n}\n\nexport interface Subscription {\n\tid: string;\n\ttarget: string;\n\tplanId: string;\n\tpendingPlanId: string | null;\n\tpayment: any;\n\tstatuses: StatusEvent[];\n\tendDate: number;\n\tusage: Record<string, any>;\n\ttoken: string;\n}\n\nexport interface Business {\n\tid: string;\n\tname: string;\n\tnetworkKey: string | null;\n\ttimezone: string;\n\tconfigs?: BusinessConfig;\n\tsubscriptions?: Subscription[];\n\tstatuses?: StatusEvent[];\n}\n\nexport interface EshopStoreState {\n\tbusinessId: string;\n\tselectedShippingMethodId: string | null;\n\tuserToken: string | null;\n\tprocessingCheckout: boolean;\n\tloading: boolean;\n\terror: string | null;\n}\n\nexport interface Block {\n\tid: string;\n\tkey: string;\n\ttype: string;\n\tproperties?: any;\n\tvalue?: any;\n}\n\nexport type BlockType =\n\t| \"TEXT\"\n\t| \"LOCALIZED_TEXT\"\n\t| \"NUMBER\"\n\t| \"BOOLEAN\"\n\t| \"BLOCK\"\n\t| \"RELATIONSHIP_ENTRY\"\n\t| \"RELATIONSHIP_MEDIA\"\n\t| \"MARKDOWN\"\n\t| \"EMAIL\"\n\t| \"PHONE\"\n\t| \"ADDRESS\";\n\nexport type AddressType = \"SHIPPING\" | \"BILLING\";\n\nexport interface EmailBlockProperties {\n\tminValues?: number;\n\tmaxValues?: number;\n\tisNotificationTarget?: boolean;\n}\n\nexport interface PhoneBlockProperties {\n\tminValues?: number;\n\tmaxValues?: number;\n\tisNotificationTarget?: boolean;\n}\n\nexport interface AddressBlockProperties {\n\tminValues?: number;\n\tmaxValues?: number;\n\taddressType: AddressType;\n}\n\nexport interface GeoLocationValue {\n\tcountry?: string | null;\n\taddress?: string | null;\n\tcity?: string | null;\n\tstate?: string | null;\n\tpostalCode?: string | null;\n\tcoordinates?: { lat: number; lon: number } | null;\n}\n\nexport interface EmailBlock extends Block {\n\ttype: \"EMAIL\";\n\tproperties: EmailBlockProperties;\n\tvalue: string[];\n}\n\nexport interface PhoneBlock extends Block {\n\ttype: \"PHONE\";\n\tproperties: PhoneBlockProperties;\n\tvalue: string[];\n}\n\nexport interface AddressBlock extends Block {\n\ttype: \"ADDRESS\";\n\tproperties: AddressBlockProperties;\n\tvalue: GeoLocationValue[];\n}\n\nexport interface Seo {\n\tslug: Record<string, string>;\n\tmetaTitle: Record<string, string>;\n\tmetaDescription: Record<string, string>;\n\tcanonicalUrl: Record<string, string>;\n\togImage: string;\n}\n\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\tseo: Seo;\n}\n\nexport interface ApiResponse<T> {\n\tsuccess: boolean;\n\tdata?: T;\n\terror?: string;\n\tcursor?: string;\n\ttotal?: number;\n}\n\nexport interface PaginatedResponse<T> {\n\tdata: T[];\n\tmeta?: {\n\t\ttotal: number;\n\t\tpage: number;\n\t\tper_page: number;\n\t};\n}\n\nexport interface ReservationStoreState {\n\tcurrentStep: number;\n\ttotalSteps: number;\n\tsteps: Record<number, { name: string; labelKey: string }>;\n\tweekdays: string[];\n\tmonthYear: string;\n\tdays: any[];\n\tcurrent: Date;\n\tselectedDate: string | null;\n\tslots: any[];\n\tselectedSlot: any | null;\n\tselectedProvider: any | null;\n\tproviders: any[];\n\tloading: boolean;\n\tstartDate: string | null;\n\tendDate: string | null;\n\tguestToken: string | null;\n\tservice: any | null;\n\tbusiness: Business | null;\n\tcurrency: string;\n\treservationBlocks: Block[];\n\tapiUrl: string;\n\tbusinessId: string;\n\ttimezone: string;\n\ttzGroups: any;\n\titems: ReservationCartItem[];\n\tallowedPaymentMethods: string[];\n\tpaymentConfig: {\n\t\tprovider: PaymentProviderConfig | null;\n\t\tenabled: boolean;\n\t};\n}\n\nexport interface StatusEvent {\n\tid: string;\n\tchangedBy: 'BUSINESS' | 'USER' | 'SYSTEM';\n\tuserId?: string;\n\tstatus: string;\n\tnote?: string;\n\ttimestamp: number;\n}\n\nexport interface ReservationItem {\n\tid: string;\n\tserviceId: string;\n\tproviderId: string;\n\tbusinessId: string;\n\treservationId: string;\n\tuserId: string;\n\tfrom: number;\n\tto: number;\n\tblocks: Block[];\n\tprice: Price;\n}\n\nexport interface Reservation {\n\tid: string;\n\tnumber: string;\n\tuserId: string;\n\tblocks: Block[];\n\tbusinessId: string;\n\tstatuses: StatusEvent[];\n\tserviceIds: string[];\n\tproviderIds: string[];\n\tpayment: Payment;\n\tbusiness?: Business;\n\tuser?: any;\n\titems: ReservationItem[];\n\temail?: string;\n\tphone?: string;\n\tcreatedAt: number;\n\tlastModified: number;\n}\n\n// ===== CMS Types =====\n\nexport interface NodeNotifications {\n\temails: string[];\n}\n\nexport interface NodeConfig {\n\tisPubliclyReadable: boolean;\n\tisPubliclyWritable: boolean;\n}\n\nexport interface SubscriptionPlan {\n\tid: string;\n\tproviderPriceId?: string;\n\tproviderProductId?: string;\n\tname: string;\n\ttier: number;\n\tamount: number;\n\tcurrency: string;\n\tinterval: string;\n\tintervalCount: number;\n\ttrialPeriodDays: number;\n\tfeatures: Record<string, any>;\n}\n\nexport type SendStatus = 'SCHEDULED' | 'SENDING' | 'SENT' | 'CANCELLED' | 'FAILED';\n\nexport interface NewsletterSend {\n\tid: string;\n\tscheduledAt: number;\n\tstatus: SendStatus;\n\tsentCount: number;\n\tfailedCount: number;\n\tcreatedAt: number;\n}\n\nexport interface Node {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tblocks: Block[];\n\tparentId?: string | null;\n\thasChildren: boolean;\n\tstatuses: StatusEvent[];\n\tseo: Seo;\n\tnotifications: NodeNotifications;\n\tconfig: NodeConfig;\n\temailSubject?: Record<string, string>;\n\tplans?: SubscriptionPlan[];\n\tsends?: NewsletterSend[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\n// ===== Reservation Domain Types =====\n\nexport interface ServiceDuration {\n\tduration: number;\n\tisPause?: boolean;\n}\n\nexport interface ServiceProvider {\n\tid: string;\n\tproviderId: string;\n\tworkingTime: {\n\t\tworkingDays: Array<{ day: string; workingHours: Array<{ from: number; to: number }> }>;\n\t\toutcastDates: Array<{ month: number; day: number; workingHours: Array<{ from: number; to: number }> }>;\n\t\tspecificDates: Array<{ date: number; workingHours: Array<{ from: number; to: number }> }>;\n\t};\n\tprovider?: Provider;\n}\n\nexport interface Service {\n\tid: string;\n\tkey: string;\n\tseo: Seo;\n\tbusinessId: string;\n\tprices: Price[];\n\tdurations: ServiceDuration[];\n\tblocks: Block[];\n\tnodeIds: string[];\n\tisApprovalRequired: boolean;\n\tproviders: ServiceProvider[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n\tstatuses: StatusEvent[];\n}\n\nexport interface ProviderTimelinePoint {\n\ttimestamp: number;\n\tconcurrent: number;\n}\n\nexport interface Provider {\n\tid: string;\n\tkey: string;\n\tseo: Seo;\n\tbusinessId: string;\n\tstatuses: StatusEvent[];\n\tconcurrentLimit: number;\n\tnodeIds: string[];\n\tblocks: Block[];\n\ttimeline: ProviderTimelinePoint[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/types/index.ts"],"names":["PaymentMethodType"],"mappings":";AA4CO,IAAK,iBAAA,qBAAAA,kBAAAA,KAAL;AACN,EAAAA,mBAAA,MAAA,CAAA,GAAO,MAAA;AACP,EAAAA,mBAAA,YAAA,CAAA,GAAa,aAAA;AACb,EAAAA,mBAAA,MAAA,CAAA,GAAO,MAAA;AAHI,EAAA,OAAAA,kBAAAA;AAAA,CAAA,EAAA,iBAAA,IAAA,EAAA","file":"types.js","sourcesContent":["export * from './api';\n\nexport interface PaymentRefund {\n\tid: string;\n\tentity: string;\n\ttotal: number;\n\tproviderRefundId?: string;\n\tstatus: string;\n\tcreatedAt: number;\n}\n\nexport interface Payment {\n\tcurrency: string;\n\tmarket: string;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttotal: number;\n\tpaid: number;\n\ttax?: {\n\t\tamount: number;\n\t\tmodeSnapshot?: string;\n\t\trateBps: number;\n\t\tlines: Array<{ rateBps: number; amount: number; label?: string; scope?: string }>;\n\t};\n\tpromoCode?: {\n\t\tid: string;\n\t\tcode: string;\n\t\ttype: string;\n\t\tvalue: number;\n\t};\n\ttype: PaymentMethodType;\n\tprovider?: {\n\t\tcustomerId: string;\n\t\tpaymentIntentId?: string;\n\t\tsubscriptionId?: string;\n\t\tpriceId?: string;\n\t};\n\trefunds: PaymentRefund[];\n\tzoneId?: string;\n\tpaymentMethodId?: string;\n\tshippingMethodId?: string;\n}\n\nexport enum PaymentMethodType {\n\tCash = \"CASH\",\n\tCreditCard = \"CREDIT_CARD\",\n\tFree = \"FREE\",\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\nexport interface Price {\n\tmarket: string;\n\tamount: number;\n\tcompareAt?: number;\n}\n\nexport interface Location {\n\tcountry?: string | null;\n\taddress?: string | null;\n\tcity?: string | null;\n\tstate?: string | null;\n\tpostalCode?: string | null;\n\tcoordinates?: { lat: number; lon: number } | null;\n}\n\nexport interface EshopCartItem {\n\tid: string;\n\tproductId: string;\n\tvariantId: string;\n\tproductName: string;\n\tproductSlug: string;\n\tvariantAttributes: Record<string, any>;\n\tprice: Price;\n\tquantity: number;\n\taddedAt: number;\n}\n\nexport interface ReservationCartItem {\n\tid: string;\n\tserviceId: string;\n\tserviceName: string;\n\tdate: string;\n\tfrom: number;\n\tto: number;\n\ttimeText: string;\n\tproviderId?: string;\n\tblocks: any[];\n}\n\nexport interface PaymentProviderConfig {\n\ttype: \"STRIPE\";\n\tpublicKey: string;\n\tsecretKey: string;\n\twebhookSecret: string;\n}\n\nexport interface ShippingWeightTier {\n\tupToGrams: number;\n\tamount: number;\n}\n\nexport interface PaymentMethod {\n\tid: string;\n\ttype: PaymentMethodType;\n}\n\nexport interface ShippingMethod {\n\tid: string;\n\ttaxable: boolean;\n\tetaText: string;\n\tpickupLocation?: Location;\n\tamount: number;\n\tfreeAbove?: number;\n\tweightTiers?: ShippingWeightTier[];\n}\n\nexport type ZoneScope = \"ORDER\" | \"RESERVATION\";\n\nexport interface Zone {\n\tid: string;\n\tmarketId: string;\n\tscope: ZoneScope;\n\tcountries: string[];\n\tstates: string[];\n\tpostalCodes: string[];\n\ttaxBps: number;\n\tpaymentMethods: PaymentMethod[];\n\tshippingMethods: ShippingMethod[];\n}\n\nexport interface Market {\n\tid: string;\n\tcurrency: string;\n\ttaxMode: \"EXCLUSIVE\" | \"INCLUSIVE\";\n}\n\nexport interface Language {\n\tid: string;\n}\n\nexport interface BusinessEmails {\n\tbilling: string;\n\tsupport: string;\n}\n\nexport interface BusinessConfig {\n\tlanguages: Language[];\n\tmarkets: Market[];\n\tzones: Zone[];\n\tbuildHooks: string[];\n\twebhooks: any[];\n\tpaymentProvider?: PaymentProviderConfig;\n\taiProvider?: any;\n\temails: BusinessEmails;\n}\n\nexport interface Subscription {\n\tid: string;\n\ttarget: string;\n\tplanId: string;\n\tpendingPlanId: string | null;\n\tpayment: any;\n\tstatuses: StatusEvent[];\n\tendDate: number;\n\tusage: Record<string, any>;\n\ttoken: string;\n}\n\nexport interface Business {\n\tid: string;\n\tkey: string;\n\tnetworkKey: string | null;\n\ttimezone: string;\n\tconfigs?: BusinessConfig;\n\tsubscriptions?: Subscription[];\n\tstatuses?: StatusEvent[];\n}\n\nexport interface EshopStoreState {\n\tbusinessId: string;\n\tselectedShippingMethodId: string | null;\n\tuserToken: string | null;\n\tprocessingCheckout: boolean;\n\tloading: boolean;\n\terror: string | null;\n}\n\nexport interface Block {\n\tid: string;\n\tkey: string;\n\ttype: string;\n\tproperties?: any;\n\tvalue?: any;\n}\n\nexport type BlockType =\n\t| \"TEXT\"\n\t| \"LOCALIZED_TEXT\"\n\t| \"NUMBER\"\n\t| \"BOOLEAN\"\n\t| \"BLOCK\"\n\t| \"RELATIONSHIP_ENTRY\"\n\t| \"RELATIONSHIP_MEDIA\"\n\t| \"MARKDOWN\"\n\t| \"EMAIL\"\n\t| \"PHONE\"\n\t| \"ADDRESS\";\n\nexport type AddressType = \"SHIPPING\" | \"BILLING\";\n\nexport interface EmailBlockProperties {\n\tminValues?: number;\n\tmaxValues?: number;\n\tisNotificationTarget?: boolean;\n}\n\nexport interface PhoneBlockProperties {\n\tminValues?: number;\n\tmaxValues?: number;\n\tisNotificationTarget?: boolean;\n}\n\nexport interface AddressBlockProperties {\n\tminValues?: number;\n\tmaxValues?: number;\n\taddressType: AddressType;\n}\n\nexport interface GeoLocationValue {\n\tcountry?: string | null;\n\taddress?: string | null;\n\tcity?: string | null;\n\tstate?: string | null;\n\tpostalCode?: string | null;\n\tcoordinates?: { lat: number; lon: number } | null;\n}\n\nexport interface EmailBlock extends Block {\n\ttype: \"EMAIL\";\n\tproperties: EmailBlockProperties;\n\tvalue: string[];\n}\n\nexport interface PhoneBlock extends Block {\n\ttype: \"PHONE\";\n\tproperties: PhoneBlockProperties;\n\tvalue: string[];\n}\n\nexport interface AddressBlock extends Block {\n\ttype: \"ADDRESS\";\n\tproperties: AddressBlockProperties;\n\tvalue: GeoLocationValue[];\n}\n\nexport interface Seo {\n\tslug: Record<string, string>;\n\tmetaTitle: Record<string, string>;\n\tmetaDescription: Record<string, string>;\n\tcanonicalUrl: Record<string, string>;\n\togImage: string;\n}\n\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\tseo: Seo;\n}\n\nexport interface ApiResponse<T> {\n\tsuccess: boolean;\n\tdata?: T;\n\terror?: string;\n\tcursor?: string;\n\ttotal?: number;\n}\n\nexport interface PaginatedResponse<T> {\n\tdata: T[];\n\tmeta?: {\n\t\ttotal: number;\n\t\tpage: number;\n\t\tper_page: number;\n\t};\n}\n\nexport interface ReservationStoreState {\n\tcurrentStep: number;\n\ttotalSteps: number;\n\tsteps: Record<number, { name: string; labelKey: string }>;\n\tweekdays: string[];\n\tmonthYear: string;\n\tdays: any[];\n\tcurrent: Date;\n\tselectedDate: string | null;\n\tslots: any[];\n\tselectedSlot: any | null;\n\tselectedProvider: any | null;\n\tproviders: any[];\n\tloading: boolean;\n\tstartDate: string | null;\n\tendDate: string | null;\n\tguestToken: string | null;\n\tservice: any | null;\n\tbusiness: Business | null;\n\tcurrency: string;\n\treservationBlocks: Block[];\n\tapiUrl: string;\n\tbusinessId: string;\n\ttimezone: string;\n\ttzGroups: any;\n\titems: ReservationCartItem[];\n\tallowedPaymentMethods: string[];\n\tpaymentConfig: {\n\t\tprovider: PaymentProviderConfig | null;\n\t\tenabled: boolean;\n\t};\n}\n\nexport interface StatusEvent {\n\tid: string;\n\tchangedBy: 'BUSINESS' | 'USER' | 'SYSTEM';\n\tuserId?: string;\n\tstatus: string;\n\tnote?: string;\n\ttimestamp: number;\n}\n\nexport interface ReservationItem {\n\tid: string;\n\tserviceId: string;\n\tproviderId: string;\n\tbusinessId: string;\n\treservationId: string;\n\tuserId: string;\n\tfrom: number;\n\tto: number;\n\tblocks: Block[];\n\tprice: Price;\n}\n\nexport interface Reservation {\n\tid: string;\n\tnumber: string;\n\tuserId: string;\n\tblocks: Block[];\n\tbusinessId: string;\n\tstatuses: StatusEvent[];\n\tserviceIds: string[];\n\tproviderIds: string[];\n\tpayment: Payment;\n\tbusiness?: Business;\n\tuser?: any;\n\titems: ReservationItem[];\n\temail?: string;\n\tphone?: string;\n\tcreatedAt: number;\n\tlastModified: number;\n}\n\n// ===== CMS Types =====\n\nexport interface NodeNotifications {\n\temails: string[];\n}\n\nexport interface NodeConfig {\n\tparentId?: string | null;\n\tisPubliclyReadable: boolean;\n\tisPubliclyWritable: boolean;\n}\n\nexport interface SubscriptionPlan {\n\tid: string;\n\tproviderPriceId?: string;\n\tproviderProductId?: string;\n\tname: string;\n\ttier: number;\n\tamount: number;\n\tcurrency: string;\n\tinterval: string;\n\tintervalCount: number;\n\ttrialPeriodDays: number;\n\tfeatures: Record<string, any>;\n}\n\nexport type SendStatus = 'SCHEDULED' | 'SENDING' | 'SENT' | 'CANCELLED' | 'FAILED';\n\nexport interface NodeSend {\n\tid: string;\n\tscheduledAt: number;\n\tstatus: SendStatus;\n\tsentCount: number;\n\tfailedCount: number;\n\tcreatedAt: number;\n}\n\nexport interface Node {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tblocks: Block[];\n\tstatuses: StatusEvent[];\n\tseo: Seo;\n\tnotifications: NodeNotifications;\n\tconfig: NodeConfig;\n\temailSubject?: Record<string, string>;\n\tplans: SubscriptionPlan[];\n\tsends: NodeSend[];\n\tchildren: Node[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\n// ===== Reservation Domain Types =====\n\nexport interface ServiceDuration {\n\tduration: number;\n\tisPause?: boolean;\n}\n\nexport interface ServiceProvider {\n\tid: string;\n\tproviderId: string;\n\tworkingTime: {\n\t\tworkingDays: Array<{ day: string; workingHours: Array<{ from: number; to: number }> }>;\n\t\toutcastDates: Array<{ month: number; day: number; workingHours: Array<{ from: number; to: number }> }>;\n\t\tspecificDates: Array<{ date: number; workingHours: Array<{ from: number; to: number }> }>;\n\t};\n\tprovider?: Provider;\n}\n\nexport interface Service {\n\tid: string;\n\tkey: string;\n\tseo: Seo;\n\tbusinessId: string;\n\tprices: Price[];\n\tdurations: ServiceDuration[];\n\tblocks: Block[];\n\tnodeIds: string[];\n\tisApprovalRequired: boolean;\n\tproviders: ServiceProvider[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n\tstatuses: StatusEvent[];\n}\n\nexport interface ProviderTimelinePoint {\n\ttimestamp: number;\n\tconcurrent: number;\n}\n\nexport interface Provider {\n\tid: string;\n\tkey: string;\n\tseo: Seo;\n\tbusinessId: string;\n\tstatuses: StatusEvent[];\n\tconcurrentLimit: number;\n\tnodeIds: string[];\n\tblocks: Block[];\n\ttimeline: ProviderTimelinePoint[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\n// ===== Workflow Types =====\n\nexport interface Workflow {\n\tid: string;\n\tkey: string;\n\tbusinessId: string;\n\tsecret: string;\n\tstatuses: StatusEvent[];\n\tnodes: Record<string, WorkflowNode>;\n\tedges: WorkflowEdge[];\n\tcreatedAt: number;\n\tupdatedAt: number;\n}\n\nexport interface WorkflowEdge {\n\tid: string;\n\tsource: string;\n\tsourceOutput: string;\n\ttarget: string;\n}\n\nexport type WorkflowNode =\n\t| WorkflowTriggerNode\n\t| WorkflowHttpNode\n\t| WorkflowIfNode\n\t| WorkflowLoopNode\n\t| WorkflowWaitNode;\n\nexport interface WorkflowTriggerNode {\n\ttype: 'trigger';\n\tevent?: string;\n}\n\nexport interface WorkflowHttpNode {\n\ttype: 'http';\n\tmethod: WorkflowHttpMethod;\n\turl: string;\n\theaders?: Record<string, string>;\n\tbody?: any;\n\ttimeoutMs?: number;\n}\n\nexport interface WorkflowIfNode {\n\ttype: 'if';\n\tcondition: string;\n}\n\nexport interface WorkflowLoopNode {\n\ttype: 'loop';\n\tarray: string;\n}\n\nexport interface WorkflowWaitNode {\n\ttype: 'wait';\n\tduration: string;\n}\n\nexport type WorkflowHttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';\n"]}
|