arky-sdk 0.3.32 → 0.3.34
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 +13 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +13 -12
- package/dist/index.js.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +42 -11
- package/dist/types.d.ts +42 -11
- 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":["PaymentMethod"],"mappings":";;;AAyBO,IAAK,aAAA,qBAAAA,cAAAA,KAAL;AACN,EAAAA,eAAA,MAAA,CAAA,GAAO,MAAA;AACP,EAAAA,eAAA,YAAA,CAAA,GAAa,aAAA;AACb,EAAAA,eAAA,MAAA,CAAA,GAAO,MAAA;AAHI,EAAA,OAAAA,cAAAA;AAAA,CAAA,EAAA,aAAA,IAAA,EAAA","file":"types.cjs","sourcesContent":["// Core type definitions\n// All types are exported individually for better tree-shaking\n\nexport * from './api';\n\n// NEW: Payment structure (matches backend)\nexport interface Payment {\n\tcurrency: string;\n\tmarket: string;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttax: number;\n\ttotal: number;\n\tpromoCodeId?: string;\n\tpromoCode?: string;\n\tpromoType?: string;\n\tpromoValue?: number;\n\tmethod: PaymentMethod;\n\tcustomerId?: string;\n\tpaymentIntentId?: string;\n\tsubscriptionId?: string;\n\tpriceId?: string;\n}\n\nexport enum PaymentMethod {\n\tCash = \"CASH\",\n\tCreditCard = \"CREDIT_CARD\",\n\tFree = \"FREE\",\n}\n\n// Quote line item (from quote engine)\nexport interface QuoteLineItem {\n\titemType: string;\n\tid: string;\n\tname: string;\n\tquantity: number;\n\tunitPrice: number;\n\ttotal: number;\n}\n\n// Promo code validation result\nexport interface PromoCodeValidation {\n\tid: string;\n\tcode: string;\n\tdiscountType: any;\n\tdiscountValue: number;\n\tconditions: any[];\n}\n\n// Quote response from backend (full pricing breakdown)\nexport interface Quote {\n\tcurrency: string;\n\tmarket: string;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttax: number;\n\ttotal: number;\n\tlineItems: QuoteLineItem[];\n\tshippingMethod: ShippingMethod | null;\n\tpromoCode: PromoCodeValidation | null;\n\tpayment: Payment;\n\tchargeAmount: number;\n}\n\n// Market-based price structure (for product variants)\nexport interface Price {\n\tmarket: string;\n\tamount: number;\n\tcompareAt?: number;\n}\n\n// Location structure (for shipping addresses, pickup points, etc.)\nexport interface Location {\n\tcountry?: string | null;\n\taddress?: string | null;\n\tcity?: string | null;\n\tpostalCode?: string | null;\n\tcountryCode?: string | null;\n\tcoordinates?: { lat: number; lon: number } | null;\n}\n\n//
|
|
1
|
+
{"version":3,"sources":["../src/types/index.ts"],"names":["PaymentMethod"],"mappings":";;;AAyBO,IAAK,aAAA,qBAAAA,cAAAA,KAAL;AACN,EAAAA,eAAA,MAAA,CAAA,GAAO,MAAA;AACP,EAAAA,eAAA,YAAA,CAAA,GAAa,aAAA;AACb,EAAAA,eAAA,MAAA,CAAA,GAAO,MAAA;AAHI,EAAA,OAAAA,cAAAA;AAAA,CAAA,EAAA,aAAA,IAAA,EAAA","file":"types.cjs","sourcesContent":["// Core type definitions\n// All types are exported individually for better tree-shaking\n\nexport * from './api';\n\n// NEW: Payment structure (matches backend)\nexport interface Payment {\n\tcurrency: string;\n\tmarket: string;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttax: number;\n\ttotal: number;\n\tpromoCodeId?: string;\n\tpromoCode?: string;\n\tpromoType?: string;\n\tpromoValue?: number;\n\tmethod: PaymentMethod;\n\tcustomerId?: string;\n\tpaymentIntentId?: string;\n\tsubscriptionId?: string;\n\tpriceId?: string;\n}\n\nexport enum PaymentMethod {\n\tCash = \"CASH\",\n\tCreditCard = \"CREDIT_CARD\",\n\tFree = \"FREE\",\n}\n\n// Quote line item (from quote engine)\nexport interface QuoteLineItem {\n\titemType: string;\n\tid: string;\n\tname: string;\n\tquantity: number;\n\tunitPrice: number;\n\ttotal: number;\n}\n\n// Promo code validation result\nexport interface PromoCodeValidation {\n\tid: string;\n\tcode: string;\n\tdiscountType: any;\n\tdiscountValue: number;\n\tconditions: any[];\n}\n\n// Quote response from backend (full pricing breakdown)\nexport interface Quote {\n\tcurrency: string;\n\tmarket: string;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttax: number;\n\ttotal: number;\n\tlineItems: QuoteLineItem[];\n\tshippingMethod: ShippingMethod | null;\n\tpromoCode: PromoCodeValidation | null;\n\tpayment: Payment;\n\tchargeAmount: number;\n}\n\n// Market-based price structure (for product variants)\nexport interface Price {\n\tmarket: string;\n\tamount: number;\n\tcompareAt?: number;\n}\n\n// Location structure (for shipping addresses, pickup points, etc.)\nexport interface Location {\n\tcountry?: string | null;\n\taddress?: string | null;\n\tcity?: string | null;\n\tpostalCode?: string | null;\n\tcountryCode?: string | null;\n\tcoordinates?: { lat: number; lon: number } | null;\n}\n\n// Cart types\nexport interface EshopCartItem {\n\tid: string;\n\tproductId: string;\n\tvariantId: string;\n\tproductName: string;\n\tproductSlug: string;\n\tvariantAttributes: Record<string, any>;\n\tprice: Price; // Minor units (backend format)\n\tquantity: number;\n\taddedAt: number;\n}\n\nexport interface ReservationCartPart {\n\tid: string;\n\tserviceId: string;\n\tserviceName: string;\n\tdate: string;\n\tfrom: number;\n\tto: number;\n\ttimeText: string;\n\tisMultiDay: boolean;\n\treservationMethod: string;\n\tproviderId?: string;\n\tblocks: any[];\n}\n\n// Payment provider types\nexport interface PaymentProviderConfig {\n\ttype: \"STRIPE\";\n\tpublicKey: string;\n\tsecretKey: string;\n\twebhookSecret: string;\n}\n\n// Zone types - Country-specific configuration within a market\nexport interface Zone {\n\tcode: string; // ISO country code or \"*\" for global wildcard\n\ttaxBps: number;\n\tpaymentMethods: BusinessPaymentMethod[];\n\tshippingMethods: ShippingMethod[];\n}\n\n// Market types (business-owned) - camelCase for frontend\nexport interface Market {\n\tid: string;\n\tname: string;\n\tcurrency: string;\n\ttaxMode: \"INCLUSIVE\" | \"EXCLUSIVE\";\n\tzones: Zone[]; // Country-specific configs\n}\n\nexport interface ShippingMethod {\n id: string;\n type: 'SHIPPING' | 'PICKUP';\n prices: Price[]; // Market-based pricing with free thresholds\n taxable: boolean;\n etaText: string; // e.g., \"3-5 business days\"\n location?: Location; // Pickup address (only for PICKUP type)\n}\n\nexport interface BusinessPaymentMethod {\n\tmethod: PaymentMethod;\n}\n\n// Business types\nexport interface BusinessConfig {\n\torderBlocks?: any[];\n\treservationBlocks?: any[];\n\tmarkets?: Market[];\n\tpaymentProvider?: PaymentProviderConfig;\n\taiProvider?: any;\n}\n\nexport interface Business {\n\tid: string;\n\tname: string;\n\tconfigs?: BusinessConfig;\n}\n\n// Store state types - Simplified (business data moved to business store)\nexport interface EshopStoreState {\n\tbusinessId: string;\n\tselectedShippingMethodId: string | null;\n\tuserToken: string | null;\n\tprocessingCheckout: boolean;\n\tloading: boolean;\n\terror: string | null;\n\tphoneNumber: string;\n\tphoneError: string | null;\n\tverificationCode: string;\n\tverifyError: string | null;\n}\n\nexport interface Block {\n\tid: string;\n\tkey: string;\n\ttype: string;\n\tproperties?: any;\n\tvalue?: any;\n}\n\n// SEO types\nexport interface Seo {\n\tslug: Record<string, string>;\n\tmetaTitle: Record<string, string>;\n\tmetaDescription: Record<string, string>;\n\tcanonicalUrl: Record<string, string>;\n\togImage: string;\n}\n\n// Media types\nexport interface MediaResolution {\n\tid: string;\n\tsize: string;\n\turl: string;\n}\n\nexport interface Media {\n\tid: string;\n\tresolutions: { [key: string]: MediaResolution };\n\tmimeType: string;\n\ttitle?: string | null;\n\tdescription?: string | null;\n\talt?: string | null;\n\towner: string;\n\tmetadata?: string | null;\n\tuploadedAt: string;\n\tseo: Seo;\n}\n\n// API Response types\nexport interface ApiResponse<T> {\n success: boolean;\n data?: T;\n error?: string;\n cursor?: string;\n total?: number;\n}\n\nexport interface PaginatedResponse<T> {\n\tdata: T[];\n\tmeta?: {\n\t\ttotal: number;\n\t\tpage: number;\n\t\tper_page: number;\n\t};\n}\n\n// Legacy types - kept for compatibility\nexport interface MarketConfigClient {\n\tcurrency: string;\n\ttaxMode: string;\n\tdefaultTaxRate: number;\n\tpaymentMethods: string[];\n\tshowTaxIncluded: boolean;\n\tshippingMethods?: ShippingMethod[];\n}\n\nexport interface ReservationStoreState {\n\tcurrentStep: number;\n\ttotalSteps: number;\n\tsteps: Record<number, { name: string; labelKey: string }>;\n\n\t// Calendar data\n\tweekdays: string[];\n\tmonthYear: string;\n\tdays: any[];\n\tcurrent: Date;\n\n\t// Selection state\n\tselectedDate: string | null;\n\tslots: any[];\n\tselectedSlot: any | null;\n\tselectedMethod: string | null;\n\tselectedProvider: any | null;\n\tproviders: any[];\n\n\t// Status flags\n\tloading: boolean;\n\tstartDate: string | null;\n\tendDate: string | null;\n\tisMultiDay: boolean;\n\n\t// Phone verification\n\tphoneNumber: string;\n\tphoneError: string | null;\n\tphoneSuccess: string | null;\n\tverificationCode: string;\n\tverifyError: string | null;\n\tisPhoneVerified: boolean;\n\tisSendingCode: boolean;\n\tisVerifying: boolean;\n\tcodeSentAt: number | null;\n\tcanResendAt: number | null;\n\n\t// Service & config\n\tguestToken: string | null;\n\tservice: any | null;\n\tbusiness: Business | null;\n\tcurrency: string;\n\treservationBlocks: Block[];\n\tapiUrl: string;\n\tbusinessId: string;\n\tstorageUrl: string;\n\ttimezone: string;\n\ttzGroups: any;\n\tparts: ReservationCartPart[];\n\n\t// Payment configuration\n\tallowedPaymentMethods: string[];\n\tpaymentConfig: {\n\t\tprovider: PaymentProviderConfig | null;\n\t\tenabled: boolean;\n\t};\n}\n"]}
|
package/dist/types.d.cts
CHANGED
|
@@ -34,6 +34,7 @@ interface GetQuoteParams {
|
|
|
34
34
|
paymentMethod: string;
|
|
35
35
|
shippingMethodId?: string;
|
|
36
36
|
promoCode?: string;
|
|
37
|
+
location?: any;
|
|
37
38
|
}
|
|
38
39
|
interface CheckoutParams {
|
|
39
40
|
items: EshopItem[];
|
|
@@ -73,6 +74,13 @@ interface DeleteBusinessMediaParams {
|
|
|
73
74
|
id: string;
|
|
74
75
|
mediaId: string;
|
|
75
76
|
}
|
|
77
|
+
interface UpdateMediaParams {
|
|
78
|
+
mediaId: string;
|
|
79
|
+
seo?: any;
|
|
80
|
+
title?: string;
|
|
81
|
+
description?: string;
|
|
82
|
+
alt?: string;
|
|
83
|
+
}
|
|
76
84
|
interface GetBusinessMediaParams {
|
|
77
85
|
cursor?: string | null;
|
|
78
86
|
limit?: number;
|
|
@@ -647,13 +655,6 @@ interface Location {
|
|
|
647
655
|
lon: number;
|
|
648
656
|
} | null;
|
|
649
657
|
}
|
|
650
|
-
interface Zone {
|
|
651
|
-
id: string;
|
|
652
|
-
name: string;
|
|
653
|
-
countries: string[];
|
|
654
|
-
taxBps: number;
|
|
655
|
-
shippingMethods: ShippingMethod[];
|
|
656
|
-
}
|
|
657
658
|
interface EshopCartItem {
|
|
658
659
|
id: string;
|
|
659
660
|
productId: string;
|
|
@@ -684,13 +685,18 @@ interface PaymentProviderConfig {
|
|
|
684
685
|
secretKey: string;
|
|
685
686
|
webhookSecret: string;
|
|
686
687
|
}
|
|
688
|
+
interface Zone {
|
|
689
|
+
code: string;
|
|
690
|
+
taxBps: number;
|
|
691
|
+
paymentMethods: BusinessPaymentMethod[];
|
|
692
|
+
shippingMethods: ShippingMethod[];
|
|
693
|
+
}
|
|
687
694
|
interface Market {
|
|
688
695
|
id: string;
|
|
689
696
|
name: string;
|
|
690
697
|
currency: string;
|
|
691
698
|
taxMode: "INCLUSIVE" | "EXCLUSIVE";
|
|
692
|
-
|
|
693
|
-
paymentMethods: BusinessPaymentMethod[];
|
|
699
|
+
zones: Zone[];
|
|
694
700
|
}
|
|
695
701
|
interface ShippingMethod {
|
|
696
702
|
id: string;
|
|
@@ -707,7 +713,6 @@ interface BusinessConfig {
|
|
|
707
713
|
orderBlocks?: any[];
|
|
708
714
|
reservationBlocks?: any[];
|
|
709
715
|
markets?: Market[];
|
|
710
|
-
zones?: Zone[];
|
|
711
716
|
paymentProvider?: PaymentProviderConfig;
|
|
712
717
|
aiProvider?: any;
|
|
713
718
|
}
|
|
@@ -735,6 +740,32 @@ interface Block {
|
|
|
735
740
|
properties?: any;
|
|
736
741
|
value?: any;
|
|
737
742
|
}
|
|
743
|
+
interface Seo {
|
|
744
|
+
slug: Record<string, string>;
|
|
745
|
+
metaTitle: Record<string, string>;
|
|
746
|
+
metaDescription: Record<string, string>;
|
|
747
|
+
canonicalUrl: Record<string, string>;
|
|
748
|
+
ogImage: string;
|
|
749
|
+
}
|
|
750
|
+
interface MediaResolution {
|
|
751
|
+
id: string;
|
|
752
|
+
size: string;
|
|
753
|
+
url: string;
|
|
754
|
+
}
|
|
755
|
+
interface Media {
|
|
756
|
+
id: string;
|
|
757
|
+
resolutions: {
|
|
758
|
+
[key: string]: MediaResolution;
|
|
759
|
+
};
|
|
760
|
+
mimeType: string;
|
|
761
|
+
title?: string | null;
|
|
762
|
+
description?: string | null;
|
|
763
|
+
alt?: string | null;
|
|
764
|
+
owner: string;
|
|
765
|
+
metadata?: string | null;
|
|
766
|
+
uploadedAt: string;
|
|
767
|
+
seo: Seo;
|
|
768
|
+
}
|
|
738
769
|
interface ApiResponse<T> {
|
|
739
770
|
success: boolean;
|
|
740
771
|
data?: T;
|
|
@@ -807,4 +838,4 @@ interface ReservationStoreState {
|
|
|
807
838
|
};
|
|
808
839
|
}
|
|
809
840
|
|
|
810
|
-
export { type AddPhoneNumberParams, type ApiResponse, type Block, type Business, type BusinessConfig, type BusinessPaymentMethod, type CancelSubscriptionParams, type CheckoutParams, type Condition, type ConfirmUserParams, type CreateBusinessParams, type CreateCollectionEntryParams, type CreateCollectionParams, type CreateEntryParams, type CreateOrderParams, type CreatePortalSessionParams, type CreateProductParams, type CreatePromoCodeParams, type CreateProviderParams, type CreateReservationParams, type CreateRoleParams, type CreateServiceParams, type DeleteBusinessMediaParams, type DeleteBusinessParams, type DeleteCollectionEntryParams, type DeleteCollectionParams, type DeleteProductParams, type DeletePromoCodeParams, type DeleteProviderParams, type DeleteRoleParams, type DeleteServiceParams, type Discount, type EshopCartItem, type EshopItem, type EshopStoreState, type ForgotPasswordParams, type GenerateBlocksParams, type GetAnalyticsHealthParams, type GetAnalyticsParams, type GetAvailableSlotsParams, type GetBusinessMarketParams, type GetBusinessMarketsParams, type GetBusinessMediaParams, type GetBusinessMediaParams2, type GetBusinessParams, type GetBusinessParentsParams, type GetBusinessServiceWorkingTimeParams, type GetBusinessesParams, type GetCollectionEntriesParams, type GetCollectionEntryParams, type GetCollectionParams, type GetCollectionSubscribersParams, type GetCollectionsParams, type GetDeliveryStatsParams, type GetEntriesParams, type GetLoginUrlParams, type GetMeParams, type GetOrderParams, type GetOrdersParams, type GetProductParams, type GetProductsParams, type GetPromoCodeParams, type GetPromoCodesParams, type GetProviderParams, type GetProvidersParams, type GetQuoteParams, type GetReservationParams, type GetReservationPartsParams, type GetReservationQuoteParams, type GetRoleParams, type GetRolesParams, type GetServiceParams, type GetServicesParams, type GetSubscriptionParams, type GetSubscriptionPlansParams, type GetVariableMetadataParams, type HandleInvitationParams, type HandleStripeWebhookParams, type InviteUserParams, type Location, type LoginUserParams, type LogoutParams, type Market, type MarketConfigClient, type PaginatedResponse, type Payment, PaymentMethod, type PaymentProviderConfig, type PhoneNumberConfirmParams, type Price, type PromoCodeValidation, type Quote, type QuoteLineItem, type ReactivateSubscriptionParams, type RegisterUserParams, type RequestOptions, type ReservationCartPart, type ReservationCheckoutParams, type ReservationStoreState, type ResetForgotPasswordParams, type ResetPasswordParams, type SearchMyReservationsParams, type SearchReservationsParams, type SearchUsersParams, type SendEntryParams, type SetProviderScheduleParams, type SetRoleParams, type SetupAnalyticsParams, type ShippingMethod, type SubscribeToCollectionParams, type TestWebhookParams, type TrackEmailOpenParams, type TriggerBuildsParams, type UnsubscribeFromCollectionParams, type UpdateBusinessParams, type UpdateCollectionParams, type UpdateEntryParams, type UpdateNotificationsParams, type UpdateOrderParams, type UpdateOrderPaymentStatusParams, type UpdateOrderStatusParams, type UpdateProductParams, type UpdatePromoCodeParams, type UpdateProviderParams, type UpdateReservationParams, type UpdateRoleParams, type UpdateServiceParams, type UpdateSubscriptionParams, type UpdateUserProfileParams, type UploadBusinessMediaParams, type Zone };
|
|
841
|
+
export { type AddPhoneNumberParams, type ApiResponse, type Block, type Business, type BusinessConfig, type BusinessPaymentMethod, type CancelSubscriptionParams, type CheckoutParams, type Condition, type ConfirmUserParams, type CreateBusinessParams, type CreateCollectionEntryParams, type CreateCollectionParams, type CreateEntryParams, type CreateOrderParams, type CreatePortalSessionParams, type CreateProductParams, type CreatePromoCodeParams, type CreateProviderParams, type CreateReservationParams, type CreateRoleParams, type CreateServiceParams, type DeleteBusinessMediaParams, type DeleteBusinessParams, type DeleteCollectionEntryParams, type DeleteCollectionParams, type DeleteProductParams, type DeletePromoCodeParams, type DeleteProviderParams, type DeleteRoleParams, type DeleteServiceParams, type Discount, type EshopCartItem, type EshopItem, type EshopStoreState, type ForgotPasswordParams, type GenerateBlocksParams, type GetAnalyticsHealthParams, type GetAnalyticsParams, type GetAvailableSlotsParams, type GetBusinessMarketParams, type GetBusinessMarketsParams, type GetBusinessMediaParams, type GetBusinessMediaParams2, type GetBusinessParams, type GetBusinessParentsParams, type GetBusinessServiceWorkingTimeParams, type GetBusinessesParams, type GetCollectionEntriesParams, type GetCollectionEntryParams, type GetCollectionParams, type GetCollectionSubscribersParams, type GetCollectionsParams, type GetDeliveryStatsParams, type GetEntriesParams, type GetLoginUrlParams, type GetMeParams, type GetOrderParams, type GetOrdersParams, type GetProductParams, type GetProductsParams, type GetPromoCodeParams, type GetPromoCodesParams, type GetProviderParams, type GetProvidersParams, type GetQuoteParams, type GetReservationParams, type GetReservationPartsParams, type GetReservationQuoteParams, type GetRoleParams, type GetRolesParams, type GetServiceParams, type GetServicesParams, type GetSubscriptionParams, type GetSubscriptionPlansParams, type GetVariableMetadataParams, type HandleInvitationParams, type HandleStripeWebhookParams, type InviteUserParams, type Location, type LoginUserParams, type LogoutParams, type Market, type MarketConfigClient, type Media, type MediaResolution, type PaginatedResponse, type Payment, PaymentMethod, type PaymentProviderConfig, type PhoneNumberConfirmParams, type Price, type PromoCodeValidation, type Quote, type QuoteLineItem, type ReactivateSubscriptionParams, type RegisterUserParams, type RequestOptions, type ReservationCartPart, type ReservationCheckoutParams, type ReservationStoreState, type ResetForgotPasswordParams, type ResetPasswordParams, type SearchMyReservationsParams, type SearchReservationsParams, type SearchUsersParams, type SendEntryParams, type Seo, type SetProviderScheduleParams, type SetRoleParams, type SetupAnalyticsParams, type ShippingMethod, type SubscribeToCollectionParams, type TestWebhookParams, type TrackEmailOpenParams, type TriggerBuildsParams, type UnsubscribeFromCollectionParams, type UpdateBusinessParams, type UpdateCollectionParams, type UpdateEntryParams, type UpdateMediaParams, type UpdateNotificationsParams, type UpdateOrderParams, type UpdateOrderPaymentStatusParams, type UpdateOrderStatusParams, type UpdateProductParams, type UpdatePromoCodeParams, type UpdateProviderParams, type UpdateReservationParams, type UpdateRoleParams, type UpdateServiceParams, type UpdateSubscriptionParams, type UpdateUserProfileParams, type UploadBusinessMediaParams, type Zone };
|
package/dist/types.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ interface GetQuoteParams {
|
|
|
34
34
|
paymentMethod: string;
|
|
35
35
|
shippingMethodId?: string;
|
|
36
36
|
promoCode?: string;
|
|
37
|
+
location?: any;
|
|
37
38
|
}
|
|
38
39
|
interface CheckoutParams {
|
|
39
40
|
items: EshopItem[];
|
|
@@ -73,6 +74,13 @@ interface DeleteBusinessMediaParams {
|
|
|
73
74
|
id: string;
|
|
74
75
|
mediaId: string;
|
|
75
76
|
}
|
|
77
|
+
interface UpdateMediaParams {
|
|
78
|
+
mediaId: string;
|
|
79
|
+
seo?: any;
|
|
80
|
+
title?: string;
|
|
81
|
+
description?: string;
|
|
82
|
+
alt?: string;
|
|
83
|
+
}
|
|
76
84
|
interface GetBusinessMediaParams {
|
|
77
85
|
cursor?: string | null;
|
|
78
86
|
limit?: number;
|
|
@@ -647,13 +655,6 @@ interface Location {
|
|
|
647
655
|
lon: number;
|
|
648
656
|
} | null;
|
|
649
657
|
}
|
|
650
|
-
interface Zone {
|
|
651
|
-
id: string;
|
|
652
|
-
name: string;
|
|
653
|
-
countries: string[];
|
|
654
|
-
taxBps: number;
|
|
655
|
-
shippingMethods: ShippingMethod[];
|
|
656
|
-
}
|
|
657
658
|
interface EshopCartItem {
|
|
658
659
|
id: string;
|
|
659
660
|
productId: string;
|
|
@@ -684,13 +685,18 @@ interface PaymentProviderConfig {
|
|
|
684
685
|
secretKey: string;
|
|
685
686
|
webhookSecret: string;
|
|
686
687
|
}
|
|
688
|
+
interface Zone {
|
|
689
|
+
code: string;
|
|
690
|
+
taxBps: number;
|
|
691
|
+
paymentMethods: BusinessPaymentMethod[];
|
|
692
|
+
shippingMethods: ShippingMethod[];
|
|
693
|
+
}
|
|
687
694
|
interface Market {
|
|
688
695
|
id: string;
|
|
689
696
|
name: string;
|
|
690
697
|
currency: string;
|
|
691
698
|
taxMode: "INCLUSIVE" | "EXCLUSIVE";
|
|
692
|
-
|
|
693
|
-
paymentMethods: BusinessPaymentMethod[];
|
|
699
|
+
zones: Zone[];
|
|
694
700
|
}
|
|
695
701
|
interface ShippingMethod {
|
|
696
702
|
id: string;
|
|
@@ -707,7 +713,6 @@ interface BusinessConfig {
|
|
|
707
713
|
orderBlocks?: any[];
|
|
708
714
|
reservationBlocks?: any[];
|
|
709
715
|
markets?: Market[];
|
|
710
|
-
zones?: Zone[];
|
|
711
716
|
paymentProvider?: PaymentProviderConfig;
|
|
712
717
|
aiProvider?: any;
|
|
713
718
|
}
|
|
@@ -735,6 +740,32 @@ interface Block {
|
|
|
735
740
|
properties?: any;
|
|
736
741
|
value?: any;
|
|
737
742
|
}
|
|
743
|
+
interface Seo {
|
|
744
|
+
slug: Record<string, string>;
|
|
745
|
+
metaTitle: Record<string, string>;
|
|
746
|
+
metaDescription: Record<string, string>;
|
|
747
|
+
canonicalUrl: Record<string, string>;
|
|
748
|
+
ogImage: string;
|
|
749
|
+
}
|
|
750
|
+
interface MediaResolution {
|
|
751
|
+
id: string;
|
|
752
|
+
size: string;
|
|
753
|
+
url: string;
|
|
754
|
+
}
|
|
755
|
+
interface Media {
|
|
756
|
+
id: string;
|
|
757
|
+
resolutions: {
|
|
758
|
+
[key: string]: MediaResolution;
|
|
759
|
+
};
|
|
760
|
+
mimeType: string;
|
|
761
|
+
title?: string | null;
|
|
762
|
+
description?: string | null;
|
|
763
|
+
alt?: string | null;
|
|
764
|
+
owner: string;
|
|
765
|
+
metadata?: string | null;
|
|
766
|
+
uploadedAt: string;
|
|
767
|
+
seo: Seo;
|
|
768
|
+
}
|
|
738
769
|
interface ApiResponse<T> {
|
|
739
770
|
success: boolean;
|
|
740
771
|
data?: T;
|
|
@@ -807,4 +838,4 @@ interface ReservationStoreState {
|
|
|
807
838
|
};
|
|
808
839
|
}
|
|
809
840
|
|
|
810
|
-
export { type AddPhoneNumberParams, type ApiResponse, type Block, type Business, type BusinessConfig, type BusinessPaymentMethod, type CancelSubscriptionParams, type CheckoutParams, type Condition, type ConfirmUserParams, type CreateBusinessParams, type CreateCollectionEntryParams, type CreateCollectionParams, type CreateEntryParams, type CreateOrderParams, type CreatePortalSessionParams, type CreateProductParams, type CreatePromoCodeParams, type CreateProviderParams, type CreateReservationParams, type CreateRoleParams, type CreateServiceParams, type DeleteBusinessMediaParams, type DeleteBusinessParams, type DeleteCollectionEntryParams, type DeleteCollectionParams, type DeleteProductParams, type DeletePromoCodeParams, type DeleteProviderParams, type DeleteRoleParams, type DeleteServiceParams, type Discount, type EshopCartItem, type EshopItem, type EshopStoreState, type ForgotPasswordParams, type GenerateBlocksParams, type GetAnalyticsHealthParams, type GetAnalyticsParams, type GetAvailableSlotsParams, type GetBusinessMarketParams, type GetBusinessMarketsParams, type GetBusinessMediaParams, type GetBusinessMediaParams2, type GetBusinessParams, type GetBusinessParentsParams, type GetBusinessServiceWorkingTimeParams, type GetBusinessesParams, type GetCollectionEntriesParams, type GetCollectionEntryParams, type GetCollectionParams, type GetCollectionSubscribersParams, type GetCollectionsParams, type GetDeliveryStatsParams, type GetEntriesParams, type GetLoginUrlParams, type GetMeParams, type GetOrderParams, type GetOrdersParams, type GetProductParams, type GetProductsParams, type GetPromoCodeParams, type GetPromoCodesParams, type GetProviderParams, type GetProvidersParams, type GetQuoteParams, type GetReservationParams, type GetReservationPartsParams, type GetReservationQuoteParams, type GetRoleParams, type GetRolesParams, type GetServiceParams, type GetServicesParams, type GetSubscriptionParams, type GetSubscriptionPlansParams, type GetVariableMetadataParams, type HandleInvitationParams, type HandleStripeWebhookParams, type InviteUserParams, type Location, type LoginUserParams, type LogoutParams, type Market, type MarketConfigClient, type PaginatedResponse, type Payment, PaymentMethod, type PaymentProviderConfig, type PhoneNumberConfirmParams, type Price, type PromoCodeValidation, type Quote, type QuoteLineItem, type ReactivateSubscriptionParams, type RegisterUserParams, type RequestOptions, type ReservationCartPart, type ReservationCheckoutParams, type ReservationStoreState, type ResetForgotPasswordParams, type ResetPasswordParams, type SearchMyReservationsParams, type SearchReservationsParams, type SearchUsersParams, type SendEntryParams, type SetProviderScheduleParams, type SetRoleParams, type SetupAnalyticsParams, type ShippingMethod, type SubscribeToCollectionParams, type TestWebhookParams, type TrackEmailOpenParams, type TriggerBuildsParams, type UnsubscribeFromCollectionParams, type UpdateBusinessParams, type UpdateCollectionParams, type UpdateEntryParams, type UpdateNotificationsParams, type UpdateOrderParams, type UpdateOrderPaymentStatusParams, type UpdateOrderStatusParams, type UpdateProductParams, type UpdatePromoCodeParams, type UpdateProviderParams, type UpdateReservationParams, type UpdateRoleParams, type UpdateServiceParams, type UpdateSubscriptionParams, type UpdateUserProfileParams, type UploadBusinessMediaParams, type Zone };
|
|
841
|
+
export { type AddPhoneNumberParams, type ApiResponse, type Block, type Business, type BusinessConfig, type BusinessPaymentMethod, type CancelSubscriptionParams, type CheckoutParams, type Condition, type ConfirmUserParams, type CreateBusinessParams, type CreateCollectionEntryParams, type CreateCollectionParams, type CreateEntryParams, type CreateOrderParams, type CreatePortalSessionParams, type CreateProductParams, type CreatePromoCodeParams, type CreateProviderParams, type CreateReservationParams, type CreateRoleParams, type CreateServiceParams, type DeleteBusinessMediaParams, type DeleteBusinessParams, type DeleteCollectionEntryParams, type DeleteCollectionParams, type DeleteProductParams, type DeletePromoCodeParams, type DeleteProviderParams, type DeleteRoleParams, type DeleteServiceParams, type Discount, type EshopCartItem, type EshopItem, type EshopStoreState, type ForgotPasswordParams, type GenerateBlocksParams, type GetAnalyticsHealthParams, type GetAnalyticsParams, type GetAvailableSlotsParams, type GetBusinessMarketParams, type GetBusinessMarketsParams, type GetBusinessMediaParams, type GetBusinessMediaParams2, type GetBusinessParams, type GetBusinessParentsParams, type GetBusinessServiceWorkingTimeParams, type GetBusinessesParams, type GetCollectionEntriesParams, type GetCollectionEntryParams, type GetCollectionParams, type GetCollectionSubscribersParams, type GetCollectionsParams, type GetDeliveryStatsParams, type GetEntriesParams, type GetLoginUrlParams, type GetMeParams, type GetOrderParams, type GetOrdersParams, type GetProductParams, type GetProductsParams, type GetPromoCodeParams, type GetPromoCodesParams, type GetProviderParams, type GetProvidersParams, type GetQuoteParams, type GetReservationParams, type GetReservationPartsParams, type GetReservationQuoteParams, type GetRoleParams, type GetRolesParams, type GetServiceParams, type GetServicesParams, type GetSubscriptionParams, type GetSubscriptionPlansParams, type GetVariableMetadataParams, type HandleInvitationParams, type HandleStripeWebhookParams, type InviteUserParams, type Location, type LoginUserParams, type LogoutParams, type Market, type MarketConfigClient, type Media, type MediaResolution, type PaginatedResponse, type Payment, PaymentMethod, type PaymentProviderConfig, type PhoneNumberConfirmParams, type Price, type PromoCodeValidation, type Quote, type QuoteLineItem, type ReactivateSubscriptionParams, type RegisterUserParams, type RequestOptions, type ReservationCartPart, type ReservationCheckoutParams, type ReservationStoreState, type ResetForgotPasswordParams, type ResetPasswordParams, type SearchMyReservationsParams, type SearchReservationsParams, type SearchUsersParams, type SendEntryParams, type Seo, type SetProviderScheduleParams, type SetRoleParams, type SetupAnalyticsParams, type ShippingMethod, type SubscribeToCollectionParams, type TestWebhookParams, type TrackEmailOpenParams, type TriggerBuildsParams, type UnsubscribeFromCollectionParams, type UpdateBusinessParams, type UpdateCollectionParams, type UpdateEntryParams, type UpdateMediaParams, type UpdateNotificationsParams, type UpdateOrderParams, type UpdateOrderPaymentStatusParams, type UpdateOrderStatusParams, type UpdateProductParams, type UpdatePromoCodeParams, type UpdateProviderParams, type UpdateReservationParams, type UpdateRoleParams, type UpdateServiceParams, type UpdateSubscriptionParams, type UpdateUserProfileParams, type UploadBusinessMediaParams, type Zone };
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/index.ts"],"names":["PaymentMethod"],"mappings":";AAyBO,IAAK,aAAA,qBAAAA,cAAAA,KAAL;AACN,EAAAA,eAAA,MAAA,CAAA,GAAO,MAAA;AACP,EAAAA,eAAA,YAAA,CAAA,GAAa,aAAA;AACb,EAAAA,eAAA,MAAA,CAAA,GAAO,MAAA;AAHI,EAAA,OAAAA,cAAAA;AAAA,CAAA,EAAA,aAAA,IAAA,EAAA","file":"types.js","sourcesContent":["// Core type definitions\n// All types are exported individually for better tree-shaking\n\nexport * from './api';\n\n// NEW: Payment structure (matches backend)\nexport interface Payment {\n\tcurrency: string;\n\tmarket: string;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttax: number;\n\ttotal: number;\n\tpromoCodeId?: string;\n\tpromoCode?: string;\n\tpromoType?: string;\n\tpromoValue?: number;\n\tmethod: PaymentMethod;\n\tcustomerId?: string;\n\tpaymentIntentId?: string;\n\tsubscriptionId?: string;\n\tpriceId?: string;\n}\n\nexport enum PaymentMethod {\n\tCash = \"CASH\",\n\tCreditCard = \"CREDIT_CARD\",\n\tFree = \"FREE\",\n}\n\n// Quote line item (from quote engine)\nexport interface QuoteLineItem {\n\titemType: string;\n\tid: string;\n\tname: string;\n\tquantity: number;\n\tunitPrice: number;\n\ttotal: number;\n}\n\n// Promo code validation result\nexport interface PromoCodeValidation {\n\tid: string;\n\tcode: string;\n\tdiscountType: any;\n\tdiscountValue: number;\n\tconditions: any[];\n}\n\n// Quote response from backend (full pricing breakdown)\nexport interface Quote {\n\tcurrency: string;\n\tmarket: string;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttax: number;\n\ttotal: number;\n\tlineItems: QuoteLineItem[];\n\tshippingMethod: ShippingMethod | null;\n\tpromoCode: PromoCodeValidation | null;\n\tpayment: Payment;\n\tchargeAmount: number;\n}\n\n// Market-based price structure (for product variants)\nexport interface Price {\n\tmarket: string;\n\tamount: number;\n\tcompareAt?: number;\n}\n\n// Location structure (for shipping addresses, pickup points, etc.)\nexport interface Location {\n\tcountry?: string | null;\n\taddress?: string | null;\n\tcity?: string | null;\n\tpostalCode?: string | null;\n\tcountryCode?: string | null;\n\tcoordinates?: { lat: number; lon: number } | null;\n}\n\n//
|
|
1
|
+
{"version":3,"sources":["../src/types/index.ts"],"names":["PaymentMethod"],"mappings":";AAyBO,IAAK,aAAA,qBAAAA,cAAAA,KAAL;AACN,EAAAA,eAAA,MAAA,CAAA,GAAO,MAAA;AACP,EAAAA,eAAA,YAAA,CAAA,GAAa,aAAA;AACb,EAAAA,eAAA,MAAA,CAAA,GAAO,MAAA;AAHI,EAAA,OAAAA,cAAAA;AAAA,CAAA,EAAA,aAAA,IAAA,EAAA","file":"types.js","sourcesContent":["// Core type definitions\n// All types are exported individually for better tree-shaking\n\nexport * from './api';\n\n// NEW: Payment structure (matches backend)\nexport interface Payment {\n\tcurrency: string;\n\tmarket: string;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttax: number;\n\ttotal: number;\n\tpromoCodeId?: string;\n\tpromoCode?: string;\n\tpromoType?: string;\n\tpromoValue?: number;\n\tmethod: PaymentMethod;\n\tcustomerId?: string;\n\tpaymentIntentId?: string;\n\tsubscriptionId?: string;\n\tpriceId?: string;\n}\n\nexport enum PaymentMethod {\n\tCash = \"CASH\",\n\tCreditCard = \"CREDIT_CARD\",\n\tFree = \"FREE\",\n}\n\n// Quote line item (from quote engine)\nexport interface QuoteLineItem {\n\titemType: string;\n\tid: string;\n\tname: string;\n\tquantity: number;\n\tunitPrice: number;\n\ttotal: number;\n}\n\n// Promo code validation result\nexport interface PromoCodeValidation {\n\tid: string;\n\tcode: string;\n\tdiscountType: any;\n\tdiscountValue: number;\n\tconditions: any[];\n}\n\n// Quote response from backend (full pricing breakdown)\nexport interface Quote {\n\tcurrency: string;\n\tmarket: string;\n\tsubtotal: number;\n\tshipping: number;\n\tdiscount: number;\n\ttax: number;\n\ttotal: number;\n\tlineItems: QuoteLineItem[];\n\tshippingMethod: ShippingMethod | null;\n\tpromoCode: PromoCodeValidation | null;\n\tpayment: Payment;\n\tchargeAmount: number;\n}\n\n// Market-based price structure (for product variants)\nexport interface Price {\n\tmarket: string;\n\tamount: number;\n\tcompareAt?: number;\n}\n\n// Location structure (for shipping addresses, pickup points, etc.)\nexport interface Location {\n\tcountry?: string | null;\n\taddress?: string | null;\n\tcity?: string | null;\n\tpostalCode?: string | null;\n\tcountryCode?: string | null;\n\tcoordinates?: { lat: number; lon: number } | null;\n}\n\n// Cart types\nexport interface EshopCartItem {\n\tid: string;\n\tproductId: string;\n\tvariantId: string;\n\tproductName: string;\n\tproductSlug: string;\n\tvariantAttributes: Record<string, any>;\n\tprice: Price; // Minor units (backend format)\n\tquantity: number;\n\taddedAt: number;\n}\n\nexport interface ReservationCartPart {\n\tid: string;\n\tserviceId: string;\n\tserviceName: string;\n\tdate: string;\n\tfrom: number;\n\tto: number;\n\ttimeText: string;\n\tisMultiDay: boolean;\n\treservationMethod: string;\n\tproviderId?: string;\n\tblocks: any[];\n}\n\n// Payment provider types\nexport interface PaymentProviderConfig {\n\ttype: \"STRIPE\";\n\tpublicKey: string;\n\tsecretKey: string;\n\twebhookSecret: string;\n}\n\n// Zone types - Country-specific configuration within a market\nexport interface Zone {\n\tcode: string; // ISO country code or \"*\" for global wildcard\n\ttaxBps: number;\n\tpaymentMethods: BusinessPaymentMethod[];\n\tshippingMethods: ShippingMethod[];\n}\n\n// Market types (business-owned) - camelCase for frontend\nexport interface Market {\n\tid: string;\n\tname: string;\n\tcurrency: string;\n\ttaxMode: \"INCLUSIVE\" | \"EXCLUSIVE\";\n\tzones: Zone[]; // Country-specific configs\n}\n\nexport interface ShippingMethod {\n id: string;\n type: 'SHIPPING' | 'PICKUP';\n prices: Price[]; // Market-based pricing with free thresholds\n taxable: boolean;\n etaText: string; // e.g., \"3-5 business days\"\n location?: Location; // Pickup address (only for PICKUP type)\n}\n\nexport interface BusinessPaymentMethod {\n\tmethod: PaymentMethod;\n}\n\n// Business types\nexport interface BusinessConfig {\n\torderBlocks?: any[];\n\treservationBlocks?: any[];\n\tmarkets?: Market[];\n\tpaymentProvider?: PaymentProviderConfig;\n\taiProvider?: any;\n}\n\nexport interface Business {\n\tid: string;\n\tname: string;\n\tconfigs?: BusinessConfig;\n}\n\n// Store state types - Simplified (business data moved to business store)\nexport interface EshopStoreState {\n\tbusinessId: string;\n\tselectedShippingMethodId: string | null;\n\tuserToken: string | null;\n\tprocessingCheckout: boolean;\n\tloading: boolean;\n\terror: string | null;\n\tphoneNumber: string;\n\tphoneError: string | null;\n\tverificationCode: string;\n\tverifyError: string | null;\n}\n\nexport interface Block {\n\tid: string;\n\tkey: string;\n\ttype: string;\n\tproperties?: any;\n\tvalue?: any;\n}\n\n// SEO types\nexport interface Seo {\n\tslug: Record<string, string>;\n\tmetaTitle: Record<string, string>;\n\tmetaDescription: Record<string, string>;\n\tcanonicalUrl: Record<string, string>;\n\togImage: string;\n}\n\n// Media types\nexport interface MediaResolution {\n\tid: string;\n\tsize: string;\n\turl: string;\n}\n\nexport interface Media {\n\tid: string;\n\tresolutions: { [key: string]: MediaResolution };\n\tmimeType: string;\n\ttitle?: string | null;\n\tdescription?: string | null;\n\talt?: string | null;\n\towner: string;\n\tmetadata?: string | null;\n\tuploadedAt: string;\n\tseo: Seo;\n}\n\n// API Response types\nexport interface ApiResponse<T> {\n success: boolean;\n data?: T;\n error?: string;\n cursor?: string;\n total?: number;\n}\n\nexport interface PaginatedResponse<T> {\n\tdata: T[];\n\tmeta?: {\n\t\ttotal: number;\n\t\tpage: number;\n\t\tper_page: number;\n\t};\n}\n\n// Legacy types - kept for compatibility\nexport interface MarketConfigClient {\n\tcurrency: string;\n\ttaxMode: string;\n\tdefaultTaxRate: number;\n\tpaymentMethods: string[];\n\tshowTaxIncluded: boolean;\n\tshippingMethods?: ShippingMethod[];\n}\n\nexport interface ReservationStoreState {\n\tcurrentStep: number;\n\ttotalSteps: number;\n\tsteps: Record<number, { name: string; labelKey: string }>;\n\n\t// Calendar data\n\tweekdays: string[];\n\tmonthYear: string;\n\tdays: any[];\n\tcurrent: Date;\n\n\t// Selection state\n\tselectedDate: string | null;\n\tslots: any[];\n\tselectedSlot: any | null;\n\tselectedMethod: string | null;\n\tselectedProvider: any | null;\n\tproviders: any[];\n\n\t// Status flags\n\tloading: boolean;\n\tstartDate: string | null;\n\tendDate: string | null;\n\tisMultiDay: boolean;\n\n\t// Phone verification\n\tphoneNumber: string;\n\tphoneError: string | null;\n\tphoneSuccess: string | null;\n\tverificationCode: string;\n\tverifyError: string | null;\n\tisPhoneVerified: boolean;\n\tisSendingCode: boolean;\n\tisVerifying: boolean;\n\tcodeSentAt: number | null;\n\tcanResendAt: number | null;\n\n\t// Service & config\n\tguestToken: string | null;\n\tservice: any | null;\n\tbusiness: Business | null;\n\tcurrency: string;\n\treservationBlocks: Block[];\n\tapiUrl: string;\n\tbusinessId: string;\n\tstorageUrl: string;\n\ttimezone: string;\n\ttzGroups: any;\n\tparts: ReservationCartPart[];\n\n\t// Payment configuration\n\tallowedPaymentMethods: string[];\n\tpaymentConfig: {\n\t\tprovider: PaymentProviderConfig | null;\n\t\tenabled: boolean;\n\t};\n}\n"]}
|