arky-sdk 0.3.105 → 0.3.109
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 +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +25 -43
- package/dist/types.d.ts +25 -43
- package/dist/types.js.map +1 -1
- package/dist/utils.cjs +2 -0
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.js +2 -0
- package/dist/utils.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":";;;
|
|
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\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\n\nexport interface Language {\n\tid: string;\n}\n\nexport interface BusinessEmails {\n\tbilling: string;\n\tsupport: string;\n}\n\nexport interface OrderConfigs {\n\tisEmailRequired: boolean;\n\tisPhoneRequired: boolean;\n}\n\nexport interface BusinessReservationConfigs {\n\tisEmailRequired: boolean;\n\tisPhoneRequired: boolean;\n}\n\nexport interface BusinessConfig {\n\tlanguages: Language[];\n\tmarkets: Market[];\n\tzones: Zone[];\n\tbuildHooks: string[];\n\twebhooks: any[];\n\torderBlocks: any[];\n\treservationBlocks: any[];\n\torderConfigs: OrderConfigs;\n\treservationConfigs: BusinessReservationConfigs;\n\tpaymentProvider?: PaymentProviderConfig;\n\taiProvider?: any;\n\temails: BusinessEmails;\n}\n\nexport interface Business {\n\tid: string;\n\tname: string;\n\tconfigs?: BusinessConfig;\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\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\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\towner: 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\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\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"]}
|
package/dist/types.d.cts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
interface PaymentRefund {
|
|
2
|
+
id: string;
|
|
3
|
+
entity: string;
|
|
4
|
+
total: number;
|
|
5
|
+
providerRefundId?: string;
|
|
6
|
+
status: string;
|
|
7
|
+
createdAt: number;
|
|
8
|
+
}
|
|
1
9
|
interface Payment {
|
|
2
10
|
currency: string;
|
|
3
11
|
market: string;
|
|
@@ -5,6 +13,7 @@ interface Payment {
|
|
|
5
13
|
shipping: number;
|
|
6
14
|
discount: number;
|
|
7
15
|
total: number;
|
|
16
|
+
paid: number;
|
|
8
17
|
tax?: {
|
|
9
18
|
amount: number;
|
|
10
19
|
modeSnapshot?: string;
|
|
@@ -29,6 +38,10 @@ interface Payment {
|
|
|
29
38
|
subscriptionId?: string;
|
|
30
39
|
priceId?: string;
|
|
31
40
|
};
|
|
41
|
+
refunds: PaymentRefund[];
|
|
42
|
+
zoneId?: string;
|
|
43
|
+
paymentMethodId?: string;
|
|
44
|
+
shippingMethodId?: string;
|
|
32
45
|
}
|
|
33
46
|
declare enum PaymentMethodType {
|
|
34
47
|
Cash = "CASH",
|
|
@@ -41,46 +54,16 @@ interface PromoCodeValidation {
|
|
|
41
54
|
discounts: any[];
|
|
42
55
|
conditions: any[];
|
|
43
56
|
}
|
|
44
|
-
interface
|
|
45
|
-
productId: string;
|
|
46
|
-
variantId: string;
|
|
47
|
-
name: string;
|
|
48
|
-
quantity: number;
|
|
49
|
-
unitPrice: number;
|
|
50
|
-
total: number;
|
|
51
|
-
}
|
|
52
|
-
interface EshopQuote {
|
|
57
|
+
interface Quote {
|
|
53
58
|
market: string;
|
|
59
|
+
zone: Zone;
|
|
54
60
|
subtotal: number;
|
|
55
61
|
shipping: number;
|
|
56
62
|
discount: number;
|
|
57
63
|
tax: number;
|
|
58
64
|
total: number;
|
|
59
|
-
lineItems: EshopQuoteLineItem[];
|
|
60
65
|
shippingMethod: ShippingMethod | null;
|
|
61
|
-
|
|
62
|
-
shippingMethods: ShippingMethod[];
|
|
63
|
-
paymentMethods: PaymentMethod[];
|
|
64
|
-
payment: Payment;
|
|
65
|
-
chargeAmount: number;
|
|
66
|
-
id?: string;
|
|
67
|
-
expiresAt?: number;
|
|
68
|
-
}
|
|
69
|
-
interface ReservationQuoteLineItem {
|
|
70
|
-
serviceId: string;
|
|
71
|
-
name: string;
|
|
72
|
-
quantity: number;
|
|
73
|
-
unitPrice: number;
|
|
74
|
-
total: number;
|
|
75
|
-
}
|
|
76
|
-
interface ReservationQuote {
|
|
77
|
-
market: string;
|
|
78
|
-
subtotal: number;
|
|
79
|
-
discount: number;
|
|
80
|
-
tax: number;
|
|
81
|
-
total: number;
|
|
82
|
-
lineItems: ReservationQuoteLineItem[];
|
|
83
|
-
paymentMethods: PaymentMethod[];
|
|
66
|
+
paymentMethod: PaymentMethod | null;
|
|
84
67
|
promoCode: PromoCodeValidation | null;
|
|
85
68
|
payment: Payment;
|
|
86
69
|
chargeAmount: number;
|
|
@@ -137,12 +120,10 @@ interface ShippingWeightTier {
|
|
|
137
120
|
}
|
|
138
121
|
interface PaymentMethod {
|
|
139
122
|
id: string;
|
|
140
|
-
name: Record<string, string>;
|
|
141
123
|
type: PaymentMethodType;
|
|
142
124
|
}
|
|
143
125
|
interface ShippingMethod {
|
|
144
126
|
id: string;
|
|
145
|
-
name: Record<string, string>;
|
|
146
127
|
taxable: boolean;
|
|
147
128
|
etaText: string;
|
|
148
129
|
pickupLocation?: Location;
|
|
@@ -150,10 +131,11 @@ interface ShippingMethod {
|
|
|
150
131
|
freeAbove?: number;
|
|
151
132
|
weightTiers?: ShippingWeightTier[];
|
|
152
133
|
}
|
|
134
|
+
type ZoneScope = "ORDER" | "RESERVATION";
|
|
153
135
|
interface Zone {
|
|
154
136
|
id: string;
|
|
155
|
-
name: string;
|
|
156
137
|
marketId: string;
|
|
138
|
+
scope: ZoneScope;
|
|
157
139
|
countries: string[];
|
|
158
140
|
states: string[];
|
|
159
141
|
postalCodes: string[];
|
|
@@ -165,8 +147,6 @@ interface Market {
|
|
|
165
147
|
id: string;
|
|
166
148
|
currency: string;
|
|
167
149
|
taxMode: "EXCLUSIVE" | "INCLUSIVE";
|
|
168
|
-
reservationTaxBps: number;
|
|
169
|
-
reservationPaymentMethods: PaymentMethod[];
|
|
170
150
|
}
|
|
171
151
|
interface Language {
|
|
172
152
|
id: string;
|
|
@@ -378,14 +358,14 @@ interface EshopItem {
|
|
|
378
358
|
}
|
|
379
359
|
interface GetQuoteParams {
|
|
380
360
|
items: EshopItem[];
|
|
381
|
-
|
|
361
|
+
paymentMethodId?: string;
|
|
382
362
|
shippingMethodId?: string;
|
|
383
363
|
promoCode?: string;
|
|
384
364
|
location?: Location;
|
|
385
365
|
}
|
|
386
366
|
interface CheckoutParams {
|
|
387
367
|
items: EshopItem[];
|
|
388
|
-
|
|
368
|
+
paymentMethodId?: string;
|
|
389
369
|
blocks?: any[];
|
|
390
370
|
shippingMethodId: string;
|
|
391
371
|
promoCodeId?: string;
|
|
@@ -464,7 +444,7 @@ interface GetServicesParams {
|
|
|
464
444
|
}
|
|
465
445
|
interface ReservationCheckoutParams {
|
|
466
446
|
items: any[];
|
|
467
|
-
|
|
447
|
+
paymentMethodId?: string;
|
|
468
448
|
blocks?: any[];
|
|
469
449
|
promoCodeId?: string;
|
|
470
450
|
email?: string;
|
|
@@ -478,7 +458,7 @@ interface ReservationQuoteItem {
|
|
|
478
458
|
}
|
|
479
459
|
interface GetReservationQuoteParams {
|
|
480
460
|
items: ReservationQuoteItem[];
|
|
481
|
-
|
|
461
|
+
paymentMethodId?: string;
|
|
482
462
|
promoCode?: string;
|
|
483
463
|
}
|
|
484
464
|
interface GetServiceProvidersParams {
|
|
@@ -778,6 +758,7 @@ interface UpdateOrderParams {
|
|
|
778
758
|
address?: any | null;
|
|
779
759
|
email?: string | null;
|
|
780
760
|
phone?: string | null;
|
|
761
|
+
payment?: any | null;
|
|
781
762
|
}
|
|
782
763
|
interface CreateOrderParams {
|
|
783
764
|
[key: string]: any;
|
|
@@ -790,6 +771,7 @@ interface UpdateReservationParams {
|
|
|
790
771
|
statuses?: any;
|
|
791
772
|
blocks?: any;
|
|
792
773
|
parts?: any;
|
|
774
|
+
payment?: any | null;
|
|
793
775
|
[key: string]: any;
|
|
794
776
|
}
|
|
795
777
|
interface CreateProviderParams {
|
|
@@ -1080,4 +1062,4 @@ interface Slot {
|
|
|
1080
1062
|
dateText: string;
|
|
1081
1063
|
}
|
|
1082
1064
|
|
|
1083
|
-
export { type AddPhoneNumberParams, type ApiResponse, type Block, type Business, type BusinessConfig, type BusinessEmails, type BusinessReservationConfigs, type CheckoutParams, type Condition, type ConfirmUserParams, type CreateBusinessParams, type CreateCollectionEntryParams, type CreateCollectionParams, type CreateEntryParams, type CreateFeatureFlagParams, type CreateOrderParams, type CreatePortalSessionParams, type CreateProductParams, type CreatePromoCodeParams, type CreateProviderParams, type CreateReservationParams, type CreateRoleParams, type CreateServiceParams, type DayAvailability, type DeleteBusinessMediaParams, type DeleteBusinessParams, type DeleteCollectionEntryParams, type DeleteCollectionParams, type DeleteFeatureFlagParams, type DeleteProductParams, type DeletePromoCodeParams, type DeleteProviderParams, type DeleteRoleParams, type DeleteServiceParams, type DeleteUserParams, type Discount, type EshopCartItem, type EshopItem, type
|
|
1065
|
+
export { type AddPhoneNumberParams, type ApiResponse, type Block, type Business, type BusinessConfig, type BusinessEmails, type BusinessReservationConfigs, type CheckoutParams, type Condition, type ConfirmUserParams, type CreateBusinessParams, type CreateCollectionEntryParams, type CreateCollectionParams, type CreateEntryParams, type CreateFeatureFlagParams, type CreateOrderParams, type CreatePortalSessionParams, type CreateProductParams, type CreatePromoCodeParams, type CreateProviderParams, type CreateReservationParams, type CreateRoleParams, type CreateServiceParams, type DayAvailability, type DeleteBusinessMediaParams, type DeleteBusinessParams, type DeleteCollectionEntryParams, type DeleteCollectionParams, type DeleteFeatureFlagParams, type DeleteProductParams, type DeletePromoCodeParams, type DeleteProviderParams, type DeleteRoleParams, type DeleteServiceParams, type DeleteUserParams, type Discount, type EshopCartItem, type EshopItem, type EshopStoreState, type FeatureFlag, type FeatureFlagStatus, type FlagResults, type ForgotPasswordParams, type GenerateBlocksParams, type GetAnalyticsHealthParams, type GetAnalyticsParams, type GetAvailabilityParams, 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 GetFeatureFlagParams, type GetFeatureFlagResultsParams, type GetFeatureFlagsParams, 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 GetReservationQuoteParams, type GetRoleParams, type GetRolesParams, type GetServiceParams, type GetServiceProvidersParams, type GetServicesParams, type GetSlotsForDateParams, 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 OrderConfigs, type OutcastDate, type PaginatedResponse, type Payment, type PaymentMethod, PaymentMethodType, type PaymentProviderConfig, type PaymentRefund, type PhoneNumberConfirmParams, type Price, type ProcessRefundParams, type PromoCodeValidation, 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 SearchMyReservationsParams, type SearchReservationsParams, type SearchUsersParams, type SendEntryParams, type Seo, type SetProviderScheduleParams, type SetRoleParams, type SetupAnalyticsParams, type ShippingMethod, type ShippingWeightTier, type Slot, type SpecificDate, type StatusEvent, type SubscribeParams, type TestWebhookParams, type TimelinePoint, type TrackEmailOpenParams, type TrackEventParams, type TrackEventResponse, type TriggerBuildsParams, type UpdateBusinessParams, type UpdateCollectionParams, type UpdateEntryParams, type UpdateFeatureFlagParams, type UpdateMediaParams, type UpdateNotificationsParams, type UpdateOrderParams, type UpdateProductParams, type UpdatePromoCodeParams, type UpdateProviderParams, type UpdateReservationParams, type UpdateRoleParams, type UpdateServiceParams, type UpdateUserProfileParams, type UploadBusinessMediaParams, type UserSubscribeParams, type Variant, type VariantInput, type VariantResult, type WorkingDay, type WorkingHour, type WorkingTime, type Zone, type ZoneScope };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
interface PaymentRefund {
|
|
2
|
+
id: string;
|
|
3
|
+
entity: string;
|
|
4
|
+
total: number;
|
|
5
|
+
providerRefundId?: string;
|
|
6
|
+
status: string;
|
|
7
|
+
createdAt: number;
|
|
8
|
+
}
|
|
1
9
|
interface Payment {
|
|
2
10
|
currency: string;
|
|
3
11
|
market: string;
|
|
@@ -5,6 +13,7 @@ interface Payment {
|
|
|
5
13
|
shipping: number;
|
|
6
14
|
discount: number;
|
|
7
15
|
total: number;
|
|
16
|
+
paid: number;
|
|
8
17
|
tax?: {
|
|
9
18
|
amount: number;
|
|
10
19
|
modeSnapshot?: string;
|
|
@@ -29,6 +38,10 @@ interface Payment {
|
|
|
29
38
|
subscriptionId?: string;
|
|
30
39
|
priceId?: string;
|
|
31
40
|
};
|
|
41
|
+
refunds: PaymentRefund[];
|
|
42
|
+
zoneId?: string;
|
|
43
|
+
paymentMethodId?: string;
|
|
44
|
+
shippingMethodId?: string;
|
|
32
45
|
}
|
|
33
46
|
declare enum PaymentMethodType {
|
|
34
47
|
Cash = "CASH",
|
|
@@ -41,46 +54,16 @@ interface PromoCodeValidation {
|
|
|
41
54
|
discounts: any[];
|
|
42
55
|
conditions: any[];
|
|
43
56
|
}
|
|
44
|
-
interface
|
|
45
|
-
productId: string;
|
|
46
|
-
variantId: string;
|
|
47
|
-
name: string;
|
|
48
|
-
quantity: number;
|
|
49
|
-
unitPrice: number;
|
|
50
|
-
total: number;
|
|
51
|
-
}
|
|
52
|
-
interface EshopQuote {
|
|
57
|
+
interface Quote {
|
|
53
58
|
market: string;
|
|
59
|
+
zone: Zone;
|
|
54
60
|
subtotal: number;
|
|
55
61
|
shipping: number;
|
|
56
62
|
discount: number;
|
|
57
63
|
tax: number;
|
|
58
64
|
total: number;
|
|
59
|
-
lineItems: EshopQuoteLineItem[];
|
|
60
65
|
shippingMethod: ShippingMethod | null;
|
|
61
|
-
|
|
62
|
-
shippingMethods: ShippingMethod[];
|
|
63
|
-
paymentMethods: PaymentMethod[];
|
|
64
|
-
payment: Payment;
|
|
65
|
-
chargeAmount: number;
|
|
66
|
-
id?: string;
|
|
67
|
-
expiresAt?: number;
|
|
68
|
-
}
|
|
69
|
-
interface ReservationQuoteLineItem {
|
|
70
|
-
serviceId: string;
|
|
71
|
-
name: string;
|
|
72
|
-
quantity: number;
|
|
73
|
-
unitPrice: number;
|
|
74
|
-
total: number;
|
|
75
|
-
}
|
|
76
|
-
interface ReservationQuote {
|
|
77
|
-
market: string;
|
|
78
|
-
subtotal: number;
|
|
79
|
-
discount: number;
|
|
80
|
-
tax: number;
|
|
81
|
-
total: number;
|
|
82
|
-
lineItems: ReservationQuoteLineItem[];
|
|
83
|
-
paymentMethods: PaymentMethod[];
|
|
66
|
+
paymentMethod: PaymentMethod | null;
|
|
84
67
|
promoCode: PromoCodeValidation | null;
|
|
85
68
|
payment: Payment;
|
|
86
69
|
chargeAmount: number;
|
|
@@ -137,12 +120,10 @@ interface ShippingWeightTier {
|
|
|
137
120
|
}
|
|
138
121
|
interface PaymentMethod {
|
|
139
122
|
id: string;
|
|
140
|
-
name: Record<string, string>;
|
|
141
123
|
type: PaymentMethodType;
|
|
142
124
|
}
|
|
143
125
|
interface ShippingMethod {
|
|
144
126
|
id: string;
|
|
145
|
-
name: Record<string, string>;
|
|
146
127
|
taxable: boolean;
|
|
147
128
|
etaText: string;
|
|
148
129
|
pickupLocation?: Location;
|
|
@@ -150,10 +131,11 @@ interface ShippingMethod {
|
|
|
150
131
|
freeAbove?: number;
|
|
151
132
|
weightTiers?: ShippingWeightTier[];
|
|
152
133
|
}
|
|
134
|
+
type ZoneScope = "ORDER" | "RESERVATION";
|
|
153
135
|
interface Zone {
|
|
154
136
|
id: string;
|
|
155
|
-
name: string;
|
|
156
137
|
marketId: string;
|
|
138
|
+
scope: ZoneScope;
|
|
157
139
|
countries: string[];
|
|
158
140
|
states: string[];
|
|
159
141
|
postalCodes: string[];
|
|
@@ -165,8 +147,6 @@ interface Market {
|
|
|
165
147
|
id: string;
|
|
166
148
|
currency: string;
|
|
167
149
|
taxMode: "EXCLUSIVE" | "INCLUSIVE";
|
|
168
|
-
reservationTaxBps: number;
|
|
169
|
-
reservationPaymentMethods: PaymentMethod[];
|
|
170
150
|
}
|
|
171
151
|
interface Language {
|
|
172
152
|
id: string;
|
|
@@ -378,14 +358,14 @@ interface EshopItem {
|
|
|
378
358
|
}
|
|
379
359
|
interface GetQuoteParams {
|
|
380
360
|
items: EshopItem[];
|
|
381
|
-
|
|
361
|
+
paymentMethodId?: string;
|
|
382
362
|
shippingMethodId?: string;
|
|
383
363
|
promoCode?: string;
|
|
384
364
|
location?: Location;
|
|
385
365
|
}
|
|
386
366
|
interface CheckoutParams {
|
|
387
367
|
items: EshopItem[];
|
|
388
|
-
|
|
368
|
+
paymentMethodId?: string;
|
|
389
369
|
blocks?: any[];
|
|
390
370
|
shippingMethodId: string;
|
|
391
371
|
promoCodeId?: string;
|
|
@@ -464,7 +444,7 @@ interface GetServicesParams {
|
|
|
464
444
|
}
|
|
465
445
|
interface ReservationCheckoutParams {
|
|
466
446
|
items: any[];
|
|
467
|
-
|
|
447
|
+
paymentMethodId?: string;
|
|
468
448
|
blocks?: any[];
|
|
469
449
|
promoCodeId?: string;
|
|
470
450
|
email?: string;
|
|
@@ -478,7 +458,7 @@ interface ReservationQuoteItem {
|
|
|
478
458
|
}
|
|
479
459
|
interface GetReservationQuoteParams {
|
|
480
460
|
items: ReservationQuoteItem[];
|
|
481
|
-
|
|
461
|
+
paymentMethodId?: string;
|
|
482
462
|
promoCode?: string;
|
|
483
463
|
}
|
|
484
464
|
interface GetServiceProvidersParams {
|
|
@@ -778,6 +758,7 @@ interface UpdateOrderParams {
|
|
|
778
758
|
address?: any | null;
|
|
779
759
|
email?: string | null;
|
|
780
760
|
phone?: string | null;
|
|
761
|
+
payment?: any | null;
|
|
781
762
|
}
|
|
782
763
|
interface CreateOrderParams {
|
|
783
764
|
[key: string]: any;
|
|
@@ -790,6 +771,7 @@ interface UpdateReservationParams {
|
|
|
790
771
|
statuses?: any;
|
|
791
772
|
blocks?: any;
|
|
792
773
|
parts?: any;
|
|
774
|
+
payment?: any | null;
|
|
793
775
|
[key: string]: any;
|
|
794
776
|
}
|
|
795
777
|
interface CreateProviderParams {
|
|
@@ -1080,4 +1062,4 @@ interface Slot {
|
|
|
1080
1062
|
dateText: string;
|
|
1081
1063
|
}
|
|
1082
1064
|
|
|
1083
|
-
export { type AddPhoneNumberParams, type ApiResponse, type Block, type Business, type BusinessConfig, type BusinessEmails, type BusinessReservationConfigs, type CheckoutParams, type Condition, type ConfirmUserParams, type CreateBusinessParams, type CreateCollectionEntryParams, type CreateCollectionParams, type CreateEntryParams, type CreateFeatureFlagParams, type CreateOrderParams, type CreatePortalSessionParams, type CreateProductParams, type CreatePromoCodeParams, type CreateProviderParams, type CreateReservationParams, type CreateRoleParams, type CreateServiceParams, type DayAvailability, type DeleteBusinessMediaParams, type DeleteBusinessParams, type DeleteCollectionEntryParams, type DeleteCollectionParams, type DeleteFeatureFlagParams, type DeleteProductParams, type DeletePromoCodeParams, type DeleteProviderParams, type DeleteRoleParams, type DeleteServiceParams, type DeleteUserParams, type Discount, type EshopCartItem, type EshopItem, type
|
|
1065
|
+
export { type AddPhoneNumberParams, type ApiResponse, type Block, type Business, type BusinessConfig, type BusinessEmails, type BusinessReservationConfigs, type CheckoutParams, type Condition, type ConfirmUserParams, type CreateBusinessParams, type CreateCollectionEntryParams, type CreateCollectionParams, type CreateEntryParams, type CreateFeatureFlagParams, type CreateOrderParams, type CreatePortalSessionParams, type CreateProductParams, type CreatePromoCodeParams, type CreateProviderParams, type CreateReservationParams, type CreateRoleParams, type CreateServiceParams, type DayAvailability, type DeleteBusinessMediaParams, type DeleteBusinessParams, type DeleteCollectionEntryParams, type DeleteCollectionParams, type DeleteFeatureFlagParams, type DeleteProductParams, type DeletePromoCodeParams, type DeleteProviderParams, type DeleteRoleParams, type DeleteServiceParams, type DeleteUserParams, type Discount, type EshopCartItem, type EshopItem, type EshopStoreState, type FeatureFlag, type FeatureFlagStatus, type FlagResults, type ForgotPasswordParams, type GenerateBlocksParams, type GetAnalyticsHealthParams, type GetAnalyticsParams, type GetAvailabilityParams, 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 GetFeatureFlagParams, type GetFeatureFlagResultsParams, type GetFeatureFlagsParams, 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 GetReservationQuoteParams, type GetRoleParams, type GetRolesParams, type GetServiceParams, type GetServiceProvidersParams, type GetServicesParams, type GetSlotsForDateParams, 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 OrderConfigs, type OutcastDate, type PaginatedResponse, type Payment, type PaymentMethod, PaymentMethodType, type PaymentProviderConfig, type PaymentRefund, type PhoneNumberConfirmParams, type Price, type ProcessRefundParams, type PromoCodeValidation, 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 SearchMyReservationsParams, type SearchReservationsParams, type SearchUsersParams, type SendEntryParams, type Seo, type SetProviderScheduleParams, type SetRoleParams, type SetupAnalyticsParams, type ShippingMethod, type ShippingWeightTier, type Slot, type SpecificDate, type StatusEvent, type SubscribeParams, type TestWebhookParams, type TimelinePoint, type TrackEmailOpenParams, type TrackEventParams, type TrackEventResponse, type TriggerBuildsParams, type UpdateBusinessParams, type UpdateCollectionParams, type UpdateEntryParams, type UpdateFeatureFlagParams, type UpdateMediaParams, type UpdateNotificationsParams, type UpdateOrderParams, type UpdateProductParams, type UpdatePromoCodeParams, type UpdateProviderParams, type UpdateReservationParams, type UpdateRoleParams, type UpdateServiceParams, type UpdateUserProfileParams, type UploadBusinessMediaParams, type UserSubscribeParams, type Variant, type VariantInput, type VariantResult, 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":";
|
|
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\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\n\nexport interface Language {\n\tid: string;\n}\n\nexport interface BusinessEmails {\n\tbilling: string;\n\tsupport: string;\n}\n\nexport interface OrderConfigs {\n\tisEmailRequired: boolean;\n\tisPhoneRequired: boolean;\n}\n\nexport interface BusinessReservationConfigs {\n\tisEmailRequired: boolean;\n\tisPhoneRequired: boolean;\n}\n\nexport interface BusinessConfig {\n\tlanguages: Language[];\n\tmarkets: Market[];\n\tzones: Zone[];\n\tbuildHooks: string[];\n\twebhooks: any[];\n\torderBlocks: any[];\n\treservationBlocks: any[];\n\torderConfigs: OrderConfigs;\n\treservationConfigs: BusinessReservationConfigs;\n\tpaymentProvider?: PaymentProviderConfig;\n\taiProvider?: any;\n\temails: BusinessEmails;\n}\n\nexport interface Business {\n\tid: string;\n\tname: string;\n\tconfigs?: BusinessConfig;\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\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\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\towner: 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\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\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"]}
|