@billgangcom/theme-lib 1.68.0 → 1.69.1
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/App.d.ts +2 -3
- package/dist/abstractions/IBlock.d.ts +1 -1
- package/dist/abstractions/PageContext.d.ts +73 -69
- package/dist/{builder/constants/api.d.ts → api/constants.d.ts} +2 -0
- package/dist/api/index.d.ts +1 -6
- package/dist/api/request.d.ts +8 -4
- package/dist/assets/storefront-icons/index.d.ts +73 -0
- package/dist/builder/api/index.d.ts +4 -0
- package/dist/builder/components/BlockColors/index.d.ts +1 -1
- package/dist/builder/components/BlockSettings/settings.d.ts +1 -1
- package/dist/builder/components/HeaderSaveButton/api/index.d.ts +1 -4
- package/dist/builder/components/HeaderSaveButton/utils/index.d.ts +1 -1
- package/dist/builder/components/HeaderSettingsPages/api/index.d.ts +1 -4
- package/dist/builder/components/ThemeSettingsColors/utils/getDuplicateColors.d.ts +1 -1
- package/dist/builder/constants/index.d.ts +0 -2
- package/dist/builder/constants/notification.d.ts +1 -0
- package/dist/builder/store/useGeneralStore.d.ts +3 -3
- package/dist/builder/store/useNotificationStore.d.ts +2 -2
- package/dist/builder/ui/ChooseImage/api/index.d.ts +2 -8
- package/dist/builder/ui/Notification/index.d.ts +11 -0
- package/dist/builder/ui/index.d.ts +0 -1
- package/dist/builder.cjs.js +123 -49
- package/dist/builder.es.js +18334 -2840
- package/dist/index-C1GpRLwI.js +15866 -0
- package/dist/index-CtyrP2GR.cjs +80 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +8 -8
- package/dist/lib/createTicket.d.ts +1 -4
- package/dist/lib/generateDynamicStyles.d.ts +1 -1
- package/dist/lib/setupDynamicFonts.d.ts +1 -1
- package/dist/pages/balance/balance-modal.d.ts +7 -0
- package/dist/pages/balance/index.d.ts +1 -0
- package/dist/pages/balance/model.d.ts +6 -0
- package/dist/pages/charge/index.d.ts +1 -0
- package/dist/pages/checkout/index.d.ts +1 -0
- package/dist/pages/checkout/model.d.ts +1 -0
- package/dist/pages/dynamic-page/api/index.d.ts +1 -4
- package/dist/pages/error-page/api/index.d.ts +1 -4
- package/dist/pages/home/index.d.ts +1 -0
- package/dist/pages/home/model.d.ts +26 -0
- package/dist/pages/order/index.d.ts +1 -0
- package/dist/pages/order/model.d.ts +91 -0
- package/dist/pages/orders/index.d.ts +1 -0
- package/dist/pages/orders/model.d.ts +4 -0
- package/dist/pages/rewards/index.d.ts +1 -0
- package/dist/pages/rewards/model.d.ts +71 -0
- package/dist/pages/subscription/index.d.ts +1 -0
- package/dist/pages/subscription/model.d.ts +1 -0
- package/dist/pages/subscriptions/index.d.ts +1 -0
- package/dist/pages/subscriptions/model.d.ts +6 -0
- package/dist/pages/ticket/index.d.ts +1 -0
- package/dist/pages/ticket/model.d.ts +24 -0
- package/dist/pages/tickets/index.d.ts +1 -0
- package/dist/pages/tickets/model.d.ts +21 -0
- package/dist/pages/top-up-balance/index.d.ts +1 -0
- package/dist/storefront/api/auth.d.ts +20 -0
- package/dist/storefront/api/charge.d.ts +1 -0
- package/dist/storefront/api/coupon.d.ts +2 -0
- package/dist/storefront/api/customer.d.ts +6 -0
- package/dist/storefront/api/discord.d.ts +7 -0
- package/dist/storefront/api/fetchGatewaysDetail.d.ts +1 -0
- package/dist/storefront/api/fetchThemeAndSettings.d.ts +1 -0
- package/dist/storefront/api/fetchWithPages.d.ts +11 -0
- package/dist/storefront/api/index.d.ts +18 -0
- package/dist/storefront/api/order.d.ts +14 -0
- package/dist/storefront/api/postBalanceTopUp.d.ts +2 -0
- package/dist/storefront/api/postCashappLink.d.ts +3 -0
- package/dist/storefront/api/referral.d.ts +3 -0
- package/dist/storefront/api/reviews.d.ts +2 -0
- package/dist/storefront/api/signUpReferral.d.ts +2 -0
- package/dist/storefront/api/store.d.ts +6 -0
- package/dist/storefront/api/subscription.d.ts +22 -0
- package/dist/storefront/api/ticket.d.ts +7 -0
- package/dist/storefront/api/transactions.d.ts +5 -0
- package/dist/storefront/components/ActivePaymentMethod/index.d.ts +2 -0
- package/dist/storefront/components/ActiveSubscriptionProduct/index.d.ts +9 -0
- package/dist/storefront/components/Auth/index.d.ts +11 -0
- package/dist/storefront/components/Auth/otp-input.d.ts +7 -0
- package/dist/storefront/components/AuthModal/index.d.ts +6 -0
- package/dist/storefront/components/CancelSubscription/index.d.ts +8 -0
- package/dist/storefront/components/CashAppVerify/index.d.ts +7 -0
- package/dist/storefront/components/ChangePaymentMethod/index.d.ts +7 -0
- package/dist/storefront/components/ChangeSubscriptionPlan/index.d.ts +10 -0
- package/dist/storefront/components/ChargeBlocksRenderer/index.d.ts +6 -0
- package/dist/storefront/components/ChargeItems/index.d.ts +7 -0
- package/dist/storefront/components/ChargeStatusBlock/index.d.ts +10 -0
- package/dist/storefront/components/CheckoutFooter/index.d.ts +6 -0
- package/dist/storefront/components/CheckoutHeader/index.d.ts +7 -0
- package/dist/storefront/components/CheckoutItems/index.d.ts +18 -0
- package/dist/storefront/components/CheckoutOperational/index.d.ts +24 -0
- package/dist/storefront/components/CheckoutOrderMainData/index.d.ts +9 -0
- package/dist/storefront/components/CheckoutPrices/index.d.ts +12 -0
- package/dist/storefront/components/CheckoutProduct/index.d.ts +8 -0
- package/dist/storefront/components/CheckoutProduct/model.d.ts +1 -0
- package/dist/storefront/components/ChoosePlanUpgradeMethod/index.d.ts +9 -0
- package/dist/storefront/components/ConnectDiscord/index.d.ts +6 -0
- package/dist/storefront/components/ConnectDiscord/model.d.ts +22 -0
- package/dist/storefront/components/Coupon/index.d.ts +12 -0
- package/dist/storefront/components/CustomFields/index.d.ts +13 -0
- package/dist/storefront/components/CustomerDashboard/index.d.ts +2 -0
- package/dist/storefront/components/DeliveryItem/index.d.ts +7 -0
- package/dist/storefront/components/InsufficientBalance/index.d.ts +8 -0
- package/dist/storefront/components/LeaveAReview/index.d.ts +9 -0
- package/dist/storefront/components/NoItemsBlock/index.d.ts +7 -0
- package/dist/storefront/components/OpenDelivery/index.d.ts +8 -0
- package/dist/storefront/components/OrderStatusBlock/index.d.ts +9 -0
- package/dist/storefront/components/OrdersTable/index.d.ts +15 -0
- package/dist/storefront/components/PageLoading/index.d.ts +7 -0
- package/dist/storefront/components/PageTitle/index.d.ts +6 -0
- package/dist/storefront/components/Pagination/index.d.ts +15 -0
- package/dist/storefront/components/PayPalF&FNote/index.d.ts +8 -0
- package/dist/storefront/components/PaymentMethod/checkout-balance-payment-method.d.ts +13 -0
- package/dist/storefront/components/PaymentMethod/index.d.ts +15 -0
- package/dist/storefront/components/PaymentMethod/model.d.ts +16 -0
- package/dist/storefront/components/PaymentMethods/index.d.ts +18 -0
- package/dist/storefront/components/ProcessingPayment/index.d.ts +1 -0
- package/dist/storefront/components/ReferralBlock/index.d.ts +13 -0
- package/dist/storefront/components/ReferralBlock/mask.d.ts +1 -0
- package/dist/storefront/components/ReferralBlock/referral-modal.d.ts +7 -0
- package/dist/storefront/components/ReferralBlock/step-item.d.ts +8 -0
- package/dist/storefront/components/SecuredBySsl/index.d.ts +1 -0
- package/dist/storefront/components/Sidebar/card.d.ts +6 -0
- package/dist/storefront/components/Sidebar/index.d.ts +1 -0
- package/dist/storefront/components/Sidebar/nav-list.d.ts +2 -0
- package/dist/storefront/components/StatItem/index.d.ts +14 -0
- package/dist/storefront/components/StatusIndicator/index.d.ts +7 -0
- package/dist/storefront/components/SubmitReview/index.d.ts +7 -0
- package/dist/storefront/components/SubscriptionCoupon/index.d.ts +7 -0
- package/dist/storefront/components/SubscriptionExpiration/index.d.ts +6 -0
- package/dist/storefront/components/SubscriptionExpirationDate/index.d.ts +2 -0
- package/dist/storefront/components/SubscriptionProduct/index.d.ts +7 -0
- package/dist/storefront/components/SubscriptionProduct/model.d.ts +9 -0
- package/dist/storefront/components/SubscriptionStatusBadge/index.d.ts +5 -0
- package/dist/storefront/components/SubscriptionsTable/index.d.ts +11 -0
- package/dist/storefront/components/Table/index.d.ts +17 -0
- package/dist/storefront/components/TermsOfService/index.d.ts +1 -0
- package/dist/storefront/components/TicketRow/index.d.ts +5 -0
- package/dist/storefront/components/TrackPayment/index.d.ts +8 -0
- package/dist/storefront/components/index.d.ts +53 -0
- package/dist/storefront/constants/api.d.ts +3 -0
- package/dist/storefront/constants/index.d.ts +3 -0
- package/dist/storefront/constants/referralSteps.d.ts +6 -0
- package/dist/storefront/constants/routes.d.ts +8 -0
- package/dist/storefront/hooks/index.d.ts +2 -0
- package/dist/storefront/hooks/useCart.d.ts +186 -0
- package/dist/storefront/hooks/useCopy.d.ts +1 -0
- package/dist/storefront/index.d.ts +9 -0
- package/dist/storefront/models/balance.d.ts +46 -0
- package/dist/storefront/models/charge.d.ts +73 -0
- package/dist/storefront/models/checkout.d.ts +16 -0
- package/dist/storefront/models/coupon.d.ts +5 -0
- package/dist/storefront/models/discord.d.ts +22 -0
- package/dist/storefront/models/gateway.d.ts +8 -0
- package/dist/storefront/models/index.d.ts +15 -0
- package/dist/storefront/models/order.d.ts +125 -0
- package/dist/storefront/models/payment.d.ts +15 -0
- package/dist/storefront/models/post.d.ts +5 -0
- package/dist/storefront/models/price.d.ts +5 -0
- package/dist/storefront/models/referral.d.ts +12 -0
- package/dist/storefront/models/referralCode.d.ts +3 -0
- package/dist/{builder/constants/general.d.ts → storefront/models/shop.d.ts} +19 -6
- package/dist/storefront/models/subscription.d.ts +129 -0
- package/dist/storefront/models/transaction.d.ts +12 -0
- package/dist/storefront/store/index.d.ts +6 -0
- package/dist/storefront/store/useCartStore.d.ts +24 -0
- package/dist/storefront/store/useCustomerDashboardStore.d.ts +34 -0
- package/dist/storefront/store/useDiscordStore.d.ts +7 -0
- package/dist/storefront/store/usePaginationPagesStore.d.ts +6 -0
- package/dist/storefront/store/useStorefrontStore.d.ts +21 -0
- package/dist/storefront/store/useSubscriptionStore.d.ts +7 -0
- package/dist/storefront/ui/ActiveBadge/index.d.ts +5 -0
- package/dist/storefront/ui/InputRange/index.d.ts +9 -0
- package/dist/storefront/ui/ProgressBar/index.d.ts +8 -0
- package/dist/storefront/ui/Rating/index.d.ts +8 -0
- package/dist/storefront/ui/Timer/index.d.ts +6 -0
- package/dist/storefront/ui/index.d.ts +5 -0
- package/dist/storefront/utils/index.d.ts +16 -0
- package/dist/storefront/utils/recapcha.d.ts +12 -0
- package/dist/ui/Button/index.d.ts +1 -1
- package/dist/ui/CategorySettings/index.d.ts +1 -1
- package/dist/ui/Input/index.d.ts +2 -0
- package/dist/ui/ItemsSettings/index.d.ts +1 -1
- package/dist/ui/ListingSelector/index.d.ts +1 -1
- package/dist/ui/Loader/index.d.ts +4 -0
- package/dist/ui/Radio/index.d.ts +14 -0
- package/dist/ui/Select/index.d.ts +20 -0
- package/dist/ui/Select/utils/index.d.ts +2 -0
- package/dist/ui/index.d.ts +3 -0
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1105 -1208
- package/package.json +7 -3
- package/dist/api/fetchThemeAndSettings.d.ts +0 -4
- package/dist/index-BaU8m6yb.cjs +0 -194
- package/dist/index-zSoKRTpK.js +0 -34420
- /package/dist/{api → builder/api}/fetchAll.d.ts +0 -0
- /package/dist/{api → builder/api}/fetchData.d.ts +0 -0
- /package/dist/{api → builder/api}/fetchFontsData.d.ts +0 -0
- /package/dist/{api → builder/api}/fetchPagesData.d.ts +0 -0
- /package/dist/{api → storefront/api}/fetchGeneral.d.ts +0 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { PaymentMethod, type OrderRequest, type PartOrder } from '@storefront/models';
|
|
2
|
+
import { ValidateCouponApiData } from '@storefront/store';
|
|
3
|
+
import { Product } from '../../abstractions';
|
|
4
|
+
export type Image = {
|
|
5
|
+
id: number;
|
|
6
|
+
cfId: string;
|
|
7
|
+
};
|
|
8
|
+
type Price = {
|
|
9
|
+
amount: number;
|
|
10
|
+
currency: string;
|
|
11
|
+
};
|
|
12
|
+
type Gateway = {
|
|
13
|
+
name: string;
|
|
14
|
+
};
|
|
15
|
+
type Quantity = {
|
|
16
|
+
available?: number;
|
|
17
|
+
restrictions?: Record<string, unknown>;
|
|
18
|
+
};
|
|
19
|
+
export type DiscordSettings = {
|
|
20
|
+
isEnabled: boolean;
|
|
21
|
+
isRequired: boolean;
|
|
22
|
+
};
|
|
23
|
+
type BaseProductVariantExtraField = {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
required: boolean;
|
|
27
|
+
regex?: string;
|
|
28
|
+
placeholder: string;
|
|
29
|
+
value: string;
|
|
30
|
+
};
|
|
31
|
+
export declare const PRODUCT_VARIANT_EXTRA_FIELD_TYPE: {
|
|
32
|
+
readonly Number: "NUMBER";
|
|
33
|
+
readonly Text: "TEXT";
|
|
34
|
+
readonly Textarea: "LARGE_TEXT";
|
|
35
|
+
readonly Checkbox: "CHECK_BOX";
|
|
36
|
+
readonly Hidden: "HIDDEN";
|
|
37
|
+
readonly Select: "SELECT";
|
|
38
|
+
};
|
|
39
|
+
export type PRODUCT_VARIANT_EXTRA_FIELD_TYPE = typeof PRODUCT_VARIANT_EXTRA_FIELD_TYPE;
|
|
40
|
+
export type ProductVariantTextExtraField = BaseProductVariantExtraField & {
|
|
41
|
+
type: PRODUCT_VARIANT_EXTRA_FIELD_TYPE['Text'];
|
|
42
|
+
placeholder?: string;
|
|
43
|
+
defaultValue?: string;
|
|
44
|
+
};
|
|
45
|
+
export type ProductVariantNumberExtraField = BaseProductVariantExtraField & {
|
|
46
|
+
type: PRODUCT_VARIANT_EXTRA_FIELD_TYPE['Number'];
|
|
47
|
+
placeholder?: string;
|
|
48
|
+
defaultValue?: number;
|
|
49
|
+
};
|
|
50
|
+
export type ProductVariantCheckboxExtraField = BaseProductVariantExtraField & {
|
|
51
|
+
type: PRODUCT_VARIANT_EXTRA_FIELD_TYPE['Checkbox'];
|
|
52
|
+
placeholder?: string;
|
|
53
|
+
defaultValue?: boolean;
|
|
54
|
+
};
|
|
55
|
+
export type ProductVariantTextareaExtraField = BaseProductVariantExtraField & {
|
|
56
|
+
type: PRODUCT_VARIANT_EXTRA_FIELD_TYPE['Textarea'];
|
|
57
|
+
placeholder?: string;
|
|
58
|
+
defaultValue?: string;
|
|
59
|
+
};
|
|
60
|
+
export type ProductVariantExtraField = ProductVariantTextExtraField | ProductVariantNumberExtraField | ProductVariantCheckboxExtraField | ProductVariantTextareaExtraField;
|
|
61
|
+
export declare enum ChargeType {
|
|
62
|
+
ONE_TIME = "ONE_TIME",
|
|
63
|
+
RECURRING = "RECURRING"
|
|
64
|
+
}
|
|
65
|
+
export type Variant = {
|
|
66
|
+
id: number;
|
|
67
|
+
name: string;
|
|
68
|
+
price: Price;
|
|
69
|
+
quantity: Quantity;
|
|
70
|
+
deliveryTime?: number;
|
|
71
|
+
gateways: Gateway[];
|
|
72
|
+
customFields?: ProductVariantExtraField[] | undefined;
|
|
73
|
+
discordSettings: DiscordSettings;
|
|
74
|
+
description?: string;
|
|
75
|
+
compareAtPrice?: Price;
|
|
76
|
+
chargeTypes?: ChargeType[];
|
|
77
|
+
subscriptionSettings?: {
|
|
78
|
+
price: Price;
|
|
79
|
+
compareAtPrice?: Price;
|
|
80
|
+
recurringIntervalDays?: number;
|
|
81
|
+
entryFee?: Price;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
export type Listing = {
|
|
85
|
+
id: number;
|
|
86
|
+
link: {
|
|
87
|
+
to: string;
|
|
88
|
+
};
|
|
89
|
+
to: string;
|
|
90
|
+
productData: {
|
|
91
|
+
name: string;
|
|
92
|
+
uniquePath: string;
|
|
93
|
+
shortDescription: string;
|
|
94
|
+
images: Image[];
|
|
95
|
+
};
|
|
96
|
+
images: Image[];
|
|
97
|
+
isInStock: true;
|
|
98
|
+
minPrice: Price;
|
|
99
|
+
name: string;
|
|
100
|
+
shortDescription: string;
|
|
101
|
+
stats: {
|
|
102
|
+
averageRating: number;
|
|
103
|
+
totalReviews: number;
|
|
104
|
+
totalSold: number;
|
|
105
|
+
};
|
|
106
|
+
uniquePath: string;
|
|
107
|
+
type: string;
|
|
108
|
+
};
|
|
109
|
+
export type CreateOrderResponseBody = {
|
|
110
|
+
id: string;
|
|
111
|
+
fullAccessToken: string;
|
|
112
|
+
};
|
|
113
|
+
export type CreateSubscriptionOrderResponseBody = {
|
|
114
|
+
id: string;
|
|
115
|
+
order: {
|
|
116
|
+
id: string;
|
|
117
|
+
fullAccessToken: string;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
export declare const getCommonCustomFields: (cartItems: PartOrder[], products: Product[]) => ({
|
|
121
|
+
value: string;
|
|
122
|
+
id: string;
|
|
123
|
+
name: string;
|
|
124
|
+
required: boolean;
|
|
125
|
+
regex?: string;
|
|
126
|
+
placeholder: string;
|
|
127
|
+
type: PRODUCT_VARIANT_EXTRA_FIELD_TYPE["Text"];
|
|
128
|
+
defaultValue?: string;
|
|
129
|
+
} | {
|
|
130
|
+
value: string;
|
|
131
|
+
id: string;
|
|
132
|
+
name: string;
|
|
133
|
+
required: boolean;
|
|
134
|
+
regex?: string;
|
|
135
|
+
placeholder: string;
|
|
136
|
+
type: PRODUCT_VARIANT_EXTRA_FIELD_TYPE["Number"];
|
|
137
|
+
defaultValue?: number;
|
|
138
|
+
} | {
|
|
139
|
+
value: string;
|
|
140
|
+
id: string;
|
|
141
|
+
name: string;
|
|
142
|
+
required: boolean;
|
|
143
|
+
regex?: string;
|
|
144
|
+
placeholder: string;
|
|
145
|
+
type: PRODUCT_VARIANT_EXTRA_FIELD_TYPE["Checkbox"];
|
|
146
|
+
defaultValue?: boolean;
|
|
147
|
+
} | {
|
|
148
|
+
value: string;
|
|
149
|
+
id: string;
|
|
150
|
+
name: string;
|
|
151
|
+
required: boolean;
|
|
152
|
+
regex?: string;
|
|
153
|
+
placeholder: string;
|
|
154
|
+
type: PRODUCT_VARIANT_EXTRA_FIELD_TYPE["Textarea"];
|
|
155
|
+
defaultValue?: string;
|
|
156
|
+
})[];
|
|
157
|
+
export declare const useCart: () => {
|
|
158
|
+
reset(): void;
|
|
159
|
+
addProducts: (newProducts: Product[]) => Promise<void>;
|
|
160
|
+
addProductToCart: (cartItem: PartOrder) => Promise<void>;
|
|
161
|
+
removeProduct({ productId, productVariantId }: PartOrder): void;
|
|
162
|
+
getPossibleGateways(): {
|
|
163
|
+
availableGateways: string[];
|
|
164
|
+
requiresSignInGateways: string[];
|
|
165
|
+
};
|
|
166
|
+
removeCoupon(): void;
|
|
167
|
+
getDiscordSettings(): DiscordSettings;
|
|
168
|
+
updateQuantityOfProduct(cartItem: PartOrder): void;
|
|
169
|
+
getTotalAndDiscount(): {
|
|
170
|
+
total: number;
|
|
171
|
+
totalWithDiscount: number | undefined;
|
|
172
|
+
};
|
|
173
|
+
setGateway(gateway: string): void;
|
|
174
|
+
setPaymentMethod(paymentMethod: PaymentMethod): void;
|
|
175
|
+
submitCart(recaptcha: string): Promise<CreateOrderResponseBody | CreateSubscriptionOrderResponseBody>;
|
|
176
|
+
setDiscordSocialConnectId(discordSocialConnectId: string): void;
|
|
177
|
+
setCustomFields(customFields: Record<string, string>): void;
|
|
178
|
+
cart: OrderRequest;
|
|
179
|
+
products: Product[];
|
|
180
|
+
coupon: ValidateCouponApiData | null;
|
|
181
|
+
pending: boolean;
|
|
182
|
+
applyCouponPending: boolean;
|
|
183
|
+
applyCoupon: (couponName: string) => Promise<ValidateCouponApiData | null>;
|
|
184
|
+
getPages: (path: string) => Promise<any>;
|
|
185
|
+
};
|
|
186
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useCopy: () => (value: string) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
type CustomerDashboardType = {
|
|
3
|
+
shopDomain: string;
|
|
4
|
+
shopId: string;
|
|
5
|
+
shopPassword?: string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export declare const BillgangProvider: ({ children, shopDomain, shopId, shopPassword, }: CustomerDashboardType) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { PaymentMethod } from './payment';
|
|
2
|
+
export interface GatewayDetail {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
logoCfImageId: string;
|
|
6
|
+
poweredByImageCfImageId?: string;
|
|
7
|
+
paymentMethods: PaymentMethod[];
|
|
8
|
+
}
|
|
9
|
+
export declare const getGatewaysDetail: (gateways: string[]) => Promise<GatewayDetail[]>;
|
|
10
|
+
interface BaseTopUpSettings {
|
|
11
|
+
gateways: string[];
|
|
12
|
+
currency: string;
|
|
13
|
+
}
|
|
14
|
+
interface TopUpBonusEnabled {
|
|
15
|
+
topUpBonusEnabled: true;
|
|
16
|
+
minimumTopUpForBonus: number;
|
|
17
|
+
bonusPercent: number;
|
|
18
|
+
}
|
|
19
|
+
interface TopUpBonusDisabled {
|
|
20
|
+
topUpBonusEnabled: false;
|
|
21
|
+
minimumTopUpForBonus?: number;
|
|
22
|
+
bonusPercent?: number;
|
|
23
|
+
}
|
|
24
|
+
interface CashbackEnabled {
|
|
25
|
+
cashbackEnabled: true;
|
|
26
|
+
cashbackPercent: number;
|
|
27
|
+
}
|
|
28
|
+
interface CashbackDisabled {
|
|
29
|
+
cashbackEnabled: false;
|
|
30
|
+
cashbackPercent?: number;
|
|
31
|
+
}
|
|
32
|
+
type TopUpSettings = BaseTopUpSettings & (TopUpBonusEnabled | TopUpBonusDisabled) & (CashbackEnabled | CashbackDisabled);
|
|
33
|
+
interface BalanceTopUpSettingsDisabled {
|
|
34
|
+
isEnabled: false;
|
|
35
|
+
}
|
|
36
|
+
interface BalanceTopUpSettingsEnabled {
|
|
37
|
+
isEnabled: true;
|
|
38
|
+
topUpSettings: TopUpSettings;
|
|
39
|
+
}
|
|
40
|
+
export type BalanceTopUpSettings = BalanceTopUpSettingsEnabled | BalanceTopUpSettingsDisabled;
|
|
41
|
+
export declare const getBalanceSettings: () => Promise<BalanceTopUpSettings>;
|
|
42
|
+
export declare const getBalance: () => Promise<{
|
|
43
|
+
amount: number;
|
|
44
|
+
currency: string;
|
|
45
|
+
}>;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { PublicOrderPart } from './order';
|
|
2
|
+
import { Price } from './price';
|
|
3
|
+
export type Children = Block[];
|
|
4
|
+
export type Section = {
|
|
5
|
+
type: 'Section';
|
|
6
|
+
props: {
|
|
7
|
+
title: string;
|
|
8
|
+
subTitle: string;
|
|
9
|
+
children?: Children;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export type ImageCharge = {
|
|
13
|
+
type: 'Image';
|
|
14
|
+
props: {
|
|
15
|
+
src: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export type ReadOnlyTextInput = {
|
|
19
|
+
type: 'ReadOnlyTextInput';
|
|
20
|
+
props: {
|
|
21
|
+
text: string;
|
|
22
|
+
shownCopyButton?: boolean;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export type Notify = {
|
|
26
|
+
type: 'Notify';
|
|
27
|
+
props: {
|
|
28
|
+
heading: string;
|
|
29
|
+
content: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export type Btn = {
|
|
33
|
+
type: 'Button';
|
|
34
|
+
props: {
|
|
35
|
+
text: string;
|
|
36
|
+
url: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export type Block = Section | ReadOnlyTextInput | Notify | Btn | ImageCharge;
|
|
40
|
+
export type GetChargeApiData = {
|
|
41
|
+
id: string;
|
|
42
|
+
customerForCharge: {
|
|
43
|
+
id: number;
|
|
44
|
+
email: string;
|
|
45
|
+
};
|
|
46
|
+
name?: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
gateway: string;
|
|
49
|
+
customCharge?: {
|
|
50
|
+
id: number;
|
|
51
|
+
lifetimeStorage: {};
|
|
52
|
+
updatedAt?: Date;
|
|
53
|
+
};
|
|
54
|
+
redirectUrl?: string;
|
|
55
|
+
price: Price;
|
|
56
|
+
status: ChargeStatus;
|
|
57
|
+
timeline: Partial<Record<ChargeStatus, Date>>;
|
|
58
|
+
expiresAt: Date;
|
|
59
|
+
displayPaymentInfo: Block[];
|
|
60
|
+
order?: {
|
|
61
|
+
id: string;
|
|
62
|
+
endPrice: Price;
|
|
63
|
+
endPriceUSD: number;
|
|
64
|
+
partOrders: PublicOrderPart[];
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
export declare const enum ChargeStatus {
|
|
68
|
+
NotPaid = "NOT_PAID",
|
|
69
|
+
Pending = "PENDING",
|
|
70
|
+
Paid = "PAID",
|
|
71
|
+
Expired = "EXPIRED",
|
|
72
|
+
Cancelled = "CANCELLED"
|
|
73
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DeliveryConfiguration, Image, Price } from '@storefront/models';
|
|
2
|
+
export interface CheckoutProductT {
|
|
3
|
+
id: number;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
image?: Image;
|
|
7
|
+
price: Price;
|
|
8
|
+
deliveryCategories?: DeliveryConfiguration[];
|
|
9
|
+
customerNote?: string;
|
|
10
|
+
subscriptionSettings?: {
|
|
11
|
+
price: Price;
|
|
12
|
+
compareAtPrice?: Price;
|
|
13
|
+
recurringIntervalDays?: number;
|
|
14
|
+
entryFee?: Price;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type PostDiscordAuthorization = {
|
|
2
|
+
customerEmail: string;
|
|
3
|
+
};
|
|
4
|
+
export type GetDiscordAuthorizationStatus = {
|
|
5
|
+
id: string;
|
|
6
|
+
customerEmail: string;
|
|
7
|
+
};
|
|
8
|
+
type UnauthorizedDiscordUser = {
|
|
9
|
+
authorized: false;
|
|
10
|
+
};
|
|
11
|
+
type AuthorizedDiscordUser = {
|
|
12
|
+
authorized: true;
|
|
13
|
+
id: string;
|
|
14
|
+
username: string;
|
|
15
|
+
avatar?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
export type DiscordUser = UnauthorizedDiscordUser | AuthorizedDiscordUser;
|
|
18
|
+
export type CustomerDiscordConnection = {
|
|
19
|
+
id: string;
|
|
20
|
+
email: string;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './shop';
|
|
2
|
+
export * from './post';
|
|
3
|
+
export * from './price';
|
|
4
|
+
export * from './referralCode';
|
|
5
|
+
export * from './payment';
|
|
6
|
+
export * from './coupon';
|
|
7
|
+
export * from './order';
|
|
8
|
+
export * from './subscription';
|
|
9
|
+
export * from './balance';
|
|
10
|
+
export * from './gateway';
|
|
11
|
+
export * from './referral';
|
|
12
|
+
export * from './transaction';
|
|
13
|
+
export * from './discord';
|
|
14
|
+
export * from './charge';
|
|
15
|
+
export * from './checkout';
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { Price } from './price';
|
|
2
|
+
import { Image } from './shop';
|
|
3
|
+
import { GetChargeApiData } from './charge';
|
|
4
|
+
export type PartOrder = {
|
|
5
|
+
productId: number;
|
|
6
|
+
productVariantId: number;
|
|
7
|
+
quantity: number;
|
|
8
|
+
};
|
|
9
|
+
export type OrderRequest = {
|
|
10
|
+
gateway: string;
|
|
11
|
+
paymentMethod: string;
|
|
12
|
+
parts: PartOrder[];
|
|
13
|
+
recaptcha: string;
|
|
14
|
+
coupon?: string | null;
|
|
15
|
+
customFields: Record<string, string>;
|
|
16
|
+
discordSocialConnectId?: string | null;
|
|
17
|
+
referralCode?: string | null;
|
|
18
|
+
};
|
|
19
|
+
export declare enum OrderStatus {
|
|
20
|
+
New = "NEW",
|
|
21
|
+
Pending = "PENDING",
|
|
22
|
+
Completed = "COMPLETED",
|
|
23
|
+
Cancelled = "CANCELLED",
|
|
24
|
+
Expired = "EXPIRED",
|
|
25
|
+
FullDeliveryFailure = "FULL_DELIVERY_FAILURE",
|
|
26
|
+
PartiallyDelivered = "PARTIALLY_DELIVERED",
|
|
27
|
+
Refunded = "REFUNDED",
|
|
28
|
+
Failed = "FAILED"
|
|
29
|
+
}
|
|
30
|
+
export interface OrderItem {
|
|
31
|
+
id: string;
|
|
32
|
+
status: OrderStatus;
|
|
33
|
+
price: Price;
|
|
34
|
+
gatewayName: string;
|
|
35
|
+
time: string;
|
|
36
|
+
review?: {
|
|
37
|
+
rating: number;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export type PublicOrderPart = {
|
|
41
|
+
id: number;
|
|
42
|
+
productWithVariant: {
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
shortDescription?: string;
|
|
46
|
+
description?: string;
|
|
47
|
+
image?: Image;
|
|
48
|
+
variantId: string;
|
|
49
|
+
variantName: string;
|
|
50
|
+
price: Price;
|
|
51
|
+
};
|
|
52
|
+
quantity: number;
|
|
53
|
+
endPrice: Price;
|
|
54
|
+
endPriceUSD: Price['amount'];
|
|
55
|
+
customerNote?: string;
|
|
56
|
+
};
|
|
57
|
+
type BaseOrder = {
|
|
58
|
+
id: string;
|
|
59
|
+
status: OrderStatus;
|
|
60
|
+
rawPrice: Price;
|
|
61
|
+
endPrice: Price;
|
|
62
|
+
endPriceUSD: Price['amount'];
|
|
63
|
+
createdAt: Date;
|
|
64
|
+
expiresAt: Date;
|
|
65
|
+
charge: GetChargeApiData;
|
|
66
|
+
timeline: Partial<Record<OrderStatus, Date>>;
|
|
67
|
+
};
|
|
68
|
+
export type PublicOrderReview = {
|
|
69
|
+
rating?: number;
|
|
70
|
+
comment?: string;
|
|
71
|
+
sellerReply?: string;
|
|
72
|
+
createdAt?: Date;
|
|
73
|
+
updatedAt?: Date;
|
|
74
|
+
};
|
|
75
|
+
export type AuthenticatedOrderReview = PublicOrderReview & {
|
|
76
|
+
accessToken: string;
|
|
77
|
+
};
|
|
78
|
+
export type PublicOrder = BaseOrder & {
|
|
79
|
+
partOrders: PublicOrderPart[];
|
|
80
|
+
review: PublicOrderReview;
|
|
81
|
+
};
|
|
82
|
+
export type AuthenticatedOrder = BaseOrder & {
|
|
83
|
+
partOrders: AuthenticatedOrderPart[];
|
|
84
|
+
review: AuthenticatedOrderReview;
|
|
85
|
+
};
|
|
86
|
+
export type AuthenticatedOrderPart = PublicOrderPart & {
|
|
87
|
+
deliveryCategories: DeliveryConfiguration[];
|
|
88
|
+
};
|
|
89
|
+
type BaseDeliveryConfiguration = {
|
|
90
|
+
id: number;
|
|
91
|
+
customName?: string;
|
|
92
|
+
};
|
|
93
|
+
export type ExternalDeliveryConfiguration = BaseDeliveryConfiguration & {
|
|
94
|
+
type: DeliveryConfigurationType.Ebook | DeliveryConfigurationType.Link | DeliveryConfigurationType.Download;
|
|
95
|
+
deliveryItems: [TextDeliveryItem];
|
|
96
|
+
};
|
|
97
|
+
export type InternalDeliveryConfiguration = BaseDeliveryConfiguration & ({
|
|
98
|
+
type: DeliveryConfigurationType.Custom | DeliveryConfigurationType.Text | DeliveryConfigurationType.Discord;
|
|
99
|
+
deliveryItems: [TextDeliveryItem];
|
|
100
|
+
} | {
|
|
101
|
+
type: DeliveryConfigurationType.Serial;
|
|
102
|
+
deliveryItems: SerialDeliveryItem[];
|
|
103
|
+
});
|
|
104
|
+
export type DeliveryConfiguration = ExternalDeliveryConfiguration | InternalDeliveryConfiguration;
|
|
105
|
+
export declare const enum DeliveryConfigurationType {
|
|
106
|
+
Text = "TEXT",
|
|
107
|
+
Serial = "SERIALS",
|
|
108
|
+
Ebook = "EBOOK",
|
|
109
|
+
Link = "LINK",
|
|
110
|
+
Download = "DOWNLOAD",
|
|
111
|
+
Discord = "DISCORD",
|
|
112
|
+
Custom = "CUSTOM"
|
|
113
|
+
}
|
|
114
|
+
export type BaseDeliveryItem = {
|
|
115
|
+
id: string;
|
|
116
|
+
deliveredAt: Date;
|
|
117
|
+
};
|
|
118
|
+
export type TextDeliveryItem = BaseDeliveryItem & {
|
|
119
|
+
textData: string;
|
|
120
|
+
};
|
|
121
|
+
export type SerialDeliveryItem = BaseDeliveryItem & {
|
|
122
|
+
serialKey: string;
|
|
123
|
+
};
|
|
124
|
+
export type GetOrderApiData = PublicOrder | AuthenticatedOrder;
|
|
125
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Price } from './price';
|
|
2
|
+
export type Payment = {
|
|
3
|
+
customerEmail: string;
|
|
4
|
+
price: Price;
|
|
5
|
+
gateway: string;
|
|
6
|
+
};
|
|
7
|
+
export declare enum PaymentMethod {
|
|
8
|
+
BankCard = "BANK_CARD",
|
|
9
|
+
BankTransfer = "BANK_TRANSFER",
|
|
10
|
+
PayPal = "PAYPAL",
|
|
11
|
+
CashApp = "CASHAPP",
|
|
12
|
+
Crypto = "CRYPTO",
|
|
13
|
+
AppleGooglePay = "APPLE_AND_GOOGLE_PAY",
|
|
14
|
+
Custom = "CUSTOM"
|
|
15
|
+
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type Image = {
|
|
2
|
+
id: number;
|
|
3
|
+
cfId: string;
|
|
4
|
+
};
|
|
5
|
+
export interface ShopInfo {
|
|
2
6
|
statistics: {
|
|
3
7
|
totalProductsSold: number;
|
|
4
8
|
totalCustomers: number;
|
|
@@ -9,12 +13,8 @@ export interface ShopGeneralInfo {
|
|
|
9
13
|
permissions: {
|
|
10
14
|
disableBranding: boolean;
|
|
11
15
|
};
|
|
12
|
-
isPasswordValid: boolean;
|
|
13
16
|
info: {
|
|
14
|
-
logo?:
|
|
15
|
-
id: number;
|
|
16
|
-
cfId: string;
|
|
17
|
-
};
|
|
17
|
+
logo?: Image;
|
|
18
18
|
id: string;
|
|
19
19
|
name: string;
|
|
20
20
|
domain: string;
|
|
@@ -22,4 +22,17 @@ export interface ShopGeneralInfo {
|
|
|
22
22
|
onHold: boolean;
|
|
23
23
|
isBanned: boolean;
|
|
24
24
|
};
|
|
25
|
+
isPasswordValid: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface ShopRefundPolicy {
|
|
28
|
+
refundPolicy: string;
|
|
29
|
+
showRefundPolicyOnProduct: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface ShopPrivacyPolicy {
|
|
32
|
+
privacyPolicy: string;
|
|
33
|
+
showPrivacyPolicyOnProduct: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface ShopTerms {
|
|
36
|
+
termsOfService: string;
|
|
37
|
+
showTermsOfServiceOnProduct: boolean;
|
|
25
38
|
}
|