@billgangcom/theme-lib 1.67.1 → 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.
Files changed (203) hide show
  1. package/dist/App.d.ts +2 -3
  2. package/dist/abstractions/IBlock.d.ts +1 -1
  3. package/dist/abstractions/PageContext.d.ts +73 -69
  4. package/dist/{builder/constants/api.d.ts → api/constants.d.ts} +2 -0
  5. package/dist/api/index.d.ts +1 -6
  6. package/dist/api/request.d.ts +8 -4
  7. package/dist/assets/storefront-icons/index.d.ts +73 -0
  8. package/dist/builder/api/index.d.ts +4 -0
  9. package/dist/builder/components/BlockColors/index.d.ts +1 -1
  10. package/dist/builder/components/BlockSettings/settings.d.ts +1 -1
  11. package/dist/builder/components/HeaderSaveButton/api/index.d.ts +1 -4
  12. package/dist/builder/components/HeaderSaveButton/utils/index.d.ts +1 -1
  13. package/dist/builder/components/HeaderSettingsPages/api/index.d.ts +1 -4
  14. package/dist/builder/components/ThemeSettingsColors/utils/getDuplicateColors.d.ts +1 -1
  15. package/dist/builder/constants/index.d.ts +0 -2
  16. package/dist/builder/constants/notification.d.ts +1 -0
  17. package/dist/builder/index.d.ts +1 -2
  18. package/dist/builder/store/useBlocksStore.d.ts +4 -0
  19. package/dist/builder/store/useGeneralStore.d.ts +3 -3
  20. package/dist/builder/store/useHistoryState.d.ts +2 -0
  21. package/dist/builder/store/useLayersStore.d.ts +3 -3
  22. package/dist/builder/store/useNotificationStore.d.ts +2 -2
  23. package/dist/builder/ui/ChooseImage/api/index.d.ts +2 -8
  24. package/dist/builder/ui/Notification/index.d.ts +11 -0
  25. package/dist/builder/ui/index.d.ts +0 -1
  26. package/dist/builder.cjs.js +124 -50
  27. package/dist/builder.es.js +18341 -2844
  28. package/dist/index-C1GpRLwI.js +15866 -0
  29. package/dist/index-CtyrP2GR.cjs +80 -0
  30. package/dist/index.cjs.js +1 -1
  31. package/dist/index.es.js +8 -8
  32. package/dist/lib/createTicket.d.ts +1 -4
  33. package/dist/lib/generateDynamicStyles.d.ts +1 -1
  34. package/dist/lib/setupDynamicFonts.d.ts +1 -1
  35. package/dist/pages/balance/balance-modal.d.ts +7 -0
  36. package/dist/pages/balance/index.d.ts +1 -0
  37. package/dist/pages/balance/model.d.ts +6 -0
  38. package/dist/pages/charge/index.d.ts +1 -0
  39. package/dist/pages/checkout/index.d.ts +1 -0
  40. package/dist/pages/checkout/model.d.ts +1 -0
  41. package/dist/pages/dynamic-page/api/index.d.ts +1 -4
  42. package/dist/pages/error-page/api/index.d.ts +1 -4
  43. package/dist/pages/home/index.d.ts +1 -0
  44. package/dist/pages/home/model.d.ts +26 -0
  45. package/dist/pages/order/index.d.ts +1 -0
  46. package/dist/pages/order/model.d.ts +91 -0
  47. package/dist/pages/orders/index.d.ts +1 -0
  48. package/dist/pages/orders/model.d.ts +4 -0
  49. package/dist/pages/rewards/index.d.ts +1 -0
  50. package/dist/pages/rewards/model.d.ts +71 -0
  51. package/dist/pages/subscription/index.d.ts +1 -0
  52. package/dist/pages/subscription/model.d.ts +1 -0
  53. package/dist/pages/subscriptions/index.d.ts +1 -0
  54. package/dist/pages/subscriptions/model.d.ts +6 -0
  55. package/dist/pages/ticket/index.d.ts +1 -0
  56. package/dist/pages/ticket/model.d.ts +24 -0
  57. package/dist/pages/tickets/index.d.ts +1 -0
  58. package/dist/pages/tickets/model.d.ts +21 -0
  59. package/dist/pages/top-up-balance/index.d.ts +1 -0
  60. package/dist/storefront/api/auth.d.ts +20 -0
  61. package/dist/storefront/api/charge.d.ts +1 -0
  62. package/dist/storefront/api/coupon.d.ts +2 -0
  63. package/dist/storefront/api/customer.d.ts +6 -0
  64. package/dist/storefront/api/discord.d.ts +7 -0
  65. package/dist/storefront/api/fetchGatewaysDetail.d.ts +1 -0
  66. package/dist/storefront/api/fetchThemeAndSettings.d.ts +1 -0
  67. package/dist/storefront/api/fetchWithPages.d.ts +11 -0
  68. package/dist/storefront/api/index.d.ts +18 -0
  69. package/dist/storefront/api/order.d.ts +14 -0
  70. package/dist/storefront/api/postBalanceTopUp.d.ts +2 -0
  71. package/dist/storefront/api/postCashappLink.d.ts +3 -0
  72. package/dist/storefront/api/referral.d.ts +3 -0
  73. package/dist/storefront/api/reviews.d.ts +2 -0
  74. package/dist/storefront/api/signUpReferral.d.ts +2 -0
  75. package/dist/storefront/api/store.d.ts +6 -0
  76. package/dist/storefront/api/subscription.d.ts +22 -0
  77. package/dist/storefront/api/ticket.d.ts +7 -0
  78. package/dist/storefront/api/transactions.d.ts +5 -0
  79. package/dist/storefront/components/ActivePaymentMethod/index.d.ts +2 -0
  80. package/dist/storefront/components/ActiveSubscriptionProduct/index.d.ts +9 -0
  81. package/dist/storefront/components/Auth/index.d.ts +11 -0
  82. package/dist/storefront/components/Auth/otp-input.d.ts +7 -0
  83. package/dist/storefront/components/AuthModal/index.d.ts +6 -0
  84. package/dist/storefront/components/CancelSubscription/index.d.ts +8 -0
  85. package/dist/storefront/components/CashAppVerify/index.d.ts +7 -0
  86. package/dist/storefront/components/ChangePaymentMethod/index.d.ts +7 -0
  87. package/dist/storefront/components/ChangeSubscriptionPlan/index.d.ts +10 -0
  88. package/dist/storefront/components/ChargeBlocksRenderer/index.d.ts +6 -0
  89. package/dist/storefront/components/ChargeItems/index.d.ts +7 -0
  90. package/dist/storefront/components/ChargeStatusBlock/index.d.ts +10 -0
  91. package/dist/storefront/components/CheckoutFooter/index.d.ts +6 -0
  92. package/dist/storefront/components/CheckoutHeader/index.d.ts +7 -0
  93. package/dist/storefront/components/CheckoutItems/index.d.ts +18 -0
  94. package/dist/storefront/components/CheckoutOperational/index.d.ts +24 -0
  95. package/dist/storefront/components/CheckoutOrderMainData/index.d.ts +9 -0
  96. package/dist/storefront/components/CheckoutPrices/index.d.ts +12 -0
  97. package/dist/storefront/components/CheckoutProduct/index.d.ts +8 -0
  98. package/dist/storefront/components/CheckoutProduct/model.d.ts +1 -0
  99. package/dist/storefront/components/ChoosePlanUpgradeMethod/index.d.ts +9 -0
  100. package/dist/storefront/components/ConnectDiscord/index.d.ts +6 -0
  101. package/dist/storefront/components/ConnectDiscord/model.d.ts +22 -0
  102. package/dist/storefront/components/Coupon/index.d.ts +12 -0
  103. package/dist/storefront/components/CustomFields/index.d.ts +13 -0
  104. package/dist/storefront/components/CustomerDashboard/index.d.ts +2 -0
  105. package/dist/storefront/components/DeliveryItem/index.d.ts +7 -0
  106. package/dist/storefront/components/InsufficientBalance/index.d.ts +8 -0
  107. package/dist/storefront/components/LeaveAReview/index.d.ts +9 -0
  108. package/dist/storefront/components/NoItemsBlock/index.d.ts +7 -0
  109. package/dist/storefront/components/OpenDelivery/index.d.ts +8 -0
  110. package/dist/storefront/components/OrderStatusBlock/index.d.ts +9 -0
  111. package/dist/storefront/components/OrdersTable/index.d.ts +15 -0
  112. package/dist/storefront/components/PageLoading/index.d.ts +7 -0
  113. package/dist/storefront/components/PageTitle/index.d.ts +6 -0
  114. package/dist/storefront/components/Pagination/index.d.ts +15 -0
  115. package/dist/storefront/components/PayPalF&FNote/index.d.ts +8 -0
  116. package/dist/storefront/components/PaymentMethod/checkout-balance-payment-method.d.ts +13 -0
  117. package/dist/storefront/components/PaymentMethod/index.d.ts +15 -0
  118. package/dist/storefront/components/PaymentMethod/model.d.ts +16 -0
  119. package/dist/storefront/components/PaymentMethods/index.d.ts +18 -0
  120. package/dist/storefront/components/ProcessingPayment/index.d.ts +1 -0
  121. package/dist/storefront/components/ReferralBlock/index.d.ts +13 -0
  122. package/dist/storefront/components/ReferralBlock/mask.d.ts +1 -0
  123. package/dist/storefront/components/ReferralBlock/referral-modal.d.ts +7 -0
  124. package/dist/storefront/components/ReferralBlock/step-item.d.ts +8 -0
  125. package/dist/storefront/components/SecuredBySsl/index.d.ts +1 -0
  126. package/dist/storefront/components/Sidebar/card.d.ts +6 -0
  127. package/dist/storefront/components/Sidebar/index.d.ts +1 -0
  128. package/dist/storefront/components/Sidebar/nav-list.d.ts +2 -0
  129. package/dist/storefront/components/StatItem/index.d.ts +14 -0
  130. package/dist/storefront/components/StatusIndicator/index.d.ts +7 -0
  131. package/dist/storefront/components/SubmitReview/index.d.ts +7 -0
  132. package/dist/storefront/components/SubscriptionCoupon/index.d.ts +7 -0
  133. package/dist/storefront/components/SubscriptionExpiration/index.d.ts +6 -0
  134. package/dist/storefront/components/SubscriptionExpirationDate/index.d.ts +2 -0
  135. package/dist/storefront/components/SubscriptionProduct/index.d.ts +7 -0
  136. package/dist/storefront/components/SubscriptionProduct/model.d.ts +9 -0
  137. package/dist/storefront/components/SubscriptionStatusBadge/index.d.ts +5 -0
  138. package/dist/storefront/components/SubscriptionsTable/index.d.ts +11 -0
  139. package/dist/storefront/components/Table/index.d.ts +17 -0
  140. package/dist/storefront/components/TermsOfService/index.d.ts +1 -0
  141. package/dist/storefront/components/TicketRow/index.d.ts +5 -0
  142. package/dist/storefront/components/TrackPayment/index.d.ts +8 -0
  143. package/dist/storefront/components/index.d.ts +53 -0
  144. package/dist/storefront/constants/api.d.ts +3 -0
  145. package/dist/storefront/constants/index.d.ts +3 -0
  146. package/dist/storefront/constants/referralSteps.d.ts +6 -0
  147. package/dist/storefront/constants/routes.d.ts +8 -0
  148. package/dist/storefront/hooks/index.d.ts +2 -0
  149. package/dist/storefront/hooks/useCart.d.ts +186 -0
  150. package/dist/storefront/hooks/useCopy.d.ts +1 -0
  151. package/dist/storefront/index.d.ts +9 -0
  152. package/dist/storefront/models/balance.d.ts +46 -0
  153. package/dist/storefront/models/charge.d.ts +73 -0
  154. package/dist/storefront/models/checkout.d.ts +16 -0
  155. package/dist/storefront/models/coupon.d.ts +5 -0
  156. package/dist/storefront/models/discord.d.ts +22 -0
  157. package/dist/storefront/models/gateway.d.ts +8 -0
  158. package/dist/storefront/models/index.d.ts +15 -0
  159. package/dist/storefront/models/order.d.ts +125 -0
  160. package/dist/storefront/models/payment.d.ts +15 -0
  161. package/dist/storefront/models/post.d.ts +5 -0
  162. package/dist/storefront/models/price.d.ts +5 -0
  163. package/dist/storefront/models/referral.d.ts +12 -0
  164. package/dist/storefront/models/referralCode.d.ts +3 -0
  165. package/dist/{builder/constants/general.d.ts → storefront/models/shop.d.ts} +19 -6
  166. package/dist/storefront/models/subscription.d.ts +129 -0
  167. package/dist/storefront/models/transaction.d.ts +12 -0
  168. package/dist/storefront/store/index.d.ts +6 -0
  169. package/dist/storefront/store/useCartStore.d.ts +24 -0
  170. package/dist/storefront/store/useCustomerDashboardStore.d.ts +34 -0
  171. package/dist/storefront/store/useDiscordStore.d.ts +7 -0
  172. package/dist/storefront/store/usePaginationPagesStore.d.ts +6 -0
  173. package/dist/storefront/store/useStorefrontStore.d.ts +21 -0
  174. package/dist/storefront/store/useSubscriptionStore.d.ts +7 -0
  175. package/dist/storefront/ui/ActiveBadge/index.d.ts +5 -0
  176. package/dist/storefront/ui/InputRange/index.d.ts +9 -0
  177. package/dist/storefront/ui/ProgressBar/index.d.ts +8 -0
  178. package/dist/storefront/ui/Rating/index.d.ts +8 -0
  179. package/dist/storefront/ui/Timer/index.d.ts +6 -0
  180. package/dist/storefront/ui/index.d.ts +5 -0
  181. package/dist/storefront/utils/index.d.ts +16 -0
  182. package/dist/storefront/utils/recapcha.d.ts +12 -0
  183. package/dist/ui/Button/index.d.ts +1 -1
  184. package/dist/ui/CategorySettings/index.d.ts +1 -1
  185. package/dist/ui/Input/index.d.ts +2 -0
  186. package/dist/ui/ItemsSettings/index.d.ts +1 -1
  187. package/dist/ui/ListingSelector/index.d.ts +1 -1
  188. package/dist/ui/Loader/index.d.ts +4 -0
  189. package/dist/ui/Radio/index.d.ts +14 -0
  190. package/dist/ui/Select/index.d.ts +20 -0
  191. package/dist/ui/Select/utils/index.d.ts +2 -0
  192. package/dist/ui/index.d.ts +3 -0
  193. package/dist/ui.cjs.js +1 -1
  194. package/dist/ui.es.js +1105 -1208
  195. package/package.json +7 -3
  196. package/dist/api/fetchThemeAndSettings.d.ts +0 -4
  197. package/dist/index-D2oguEHB.cjs +0 -194
  198. package/dist/index-DRmJgjTF.js +0 -34385
  199. /package/dist/{api → builder/api}/fetchAll.d.ts +0 -0
  200. /package/dist/{api → builder/api}/fetchData.d.ts +0 -0
  201. /package/dist/{api → builder/api}/fetchFontsData.d.ts +0 -0
  202. /package/dist/{api → builder/api}/fetchPagesData.d.ts +0 -0
  203. /package/dist/{api → storefront/api}/fetchGeneral.d.ts +0 -0
@@ -0,0 +1,3 @@
1
+ export * from './api';
2
+ export * from './routes';
3
+ export * from './referralSteps';
@@ -0,0 +1,6 @@
1
+ interface ReferralStep {
2
+ caption: string;
3
+ description: string;
4
+ }
5
+ export declare const referralSteps: ReferralStep[];
6
+ export {};
@@ -0,0 +1,8 @@
1
+ export declare enum Routes {
2
+ Home = "Home",
3
+ Orders = "Orders",
4
+ Rewards = "Rewards",
5
+ Balance = "Balance",
6
+ Subscriptions = "Subscriptions",
7
+ Tickets = "Tickets"
8
+ }
@@ -0,0 +1,2 @@
1
+ export * from './useCart';
2
+ export * from './useCopy';
@@ -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,5 @@
1
+ export interface Coupon {
2
+ productIds: number[];
3
+ couponName: string;
4
+ gateway: string;
5
+ }
@@ -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,8 @@
1
+ import { PaymentMethod } from './payment';
2
+ export type GatewayInfo = {
3
+ name: string;
4
+ displayName: string;
5
+ logoCfImageId: string;
6
+ poweredByImageCfImageId?: string;
7
+ paymentMethods: PaymentMethod[];
8
+ };
@@ -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
+ }
@@ -0,0 +1,5 @@
1
+ export interface PostReview {
2
+ rating: number;
3
+ comment: string;
4
+ tsId?: string;
5
+ }
@@ -0,0 +1,5 @@
1
+ export interface Price {
2
+ amount: number;
3
+ currency?: string;
4
+ quantity?: number;
5
+ }
@@ -0,0 +1,12 @@
1
+ export interface Referral {
2
+ data: {
3
+ isAvailable: boolean;
4
+ isActivated: boolean;
5
+ earnPercent?: number;
6
+ info?: {
7
+ referralCode: string;
8
+ totalReferrals: number;
9
+ totalRevenueUsd: number;
10
+ };
11
+ };
12
+ }
@@ -0,0 +1,3 @@
1
+ export interface ReferralCode {
2
+ referralCode: string;
3
+ }
@@ -1,4 +1,8 @@
1
- export interface ShopGeneralInfo {
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
  }