@opexa/portal-components 0.0.281 → 0.0.282
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/client/hooks/index.d.ts +65 -0
- package/dist/client/hooks/index.js +65 -0
- package/dist/client/services/index.d.ts +4 -0
- package/dist/client/services/index.js +4 -0
- package/dist/client/utils/index.d.ts +3 -0
- package/dist/client/utils/index.js +3 -0
- package/dist/components/Bonus/Bonus.client.js +1 -1
- package/dist/components/Cashback/Cashback.client.js +1 -1
- package/dist/components/CashbackBonus/CashbackBonus.client.d.ts +2 -0
- package/dist/components/CashbackBonus/CashbackBonus.client.js +9 -0
- package/dist/components/CashbackBonus/CashbackBonus.d.ts +10 -0
- package/dist/components/CashbackBonus/CashbackBonus.js +5 -0
- package/dist/components/CashbackBonus/index.d.ts +1 -0
- package/dist/components/CashbackBonus/index.js +1 -0
- package/dist/components/CustomPromo/CustomPromo.js +1 -1
- package/dist/components/Disclaimer/DisclaimerV2.d.ts +1 -0
- package/dist/components/Disclaimer/DisclaimerV2.js +10 -3
- package/dist/components/Empty.d.ts +9 -0
- package/dist/components/Empty.js +7 -0
- package/dist/components/FeatureFlag/FeatureFlag.d.ts +1 -0
- package/dist/components/FeatureFlag/FeatureFlag.js +29 -0
- package/dist/components/FeatureFlag/index.d.ts +1 -0
- package/dist/components/FeatureFlag/index.js +1 -0
- package/dist/components/GameLaunch/GameLaunch.lazy.js +1 -1
- package/dist/components/Games/GameContext.d.ts +2 -0
- package/dist/components/Games/GameContext.js +2 -0
- package/dist/components/GamesSearch/GamesSearch.js +1 -1
- package/dist/components/InfiniteScroll.d.ts +10 -0
- package/dist/components/InfiniteScroll.js +25 -0
- package/dist/components/JackpotCounter/JackpotCounter.client.d.ts +2 -0
- package/dist/components/JackpotCounter/JackpotCounter.client.js +66 -0
- package/dist/components/JackpotCounter/JackpotCounter.d.ts +17 -0
- package/dist/components/JackpotCounter/JackpotCounter.js +21 -0
- package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +18 -0
- package/dist/components/JackpotCounter/JackpotCounterItem.js +109 -0
- package/dist/components/JackpotCounter/JackpotCounterItem.module.css +184 -0
- package/dist/components/JackpotCounter/index.d.ts +1 -0
- package/dist/components/JackpotCounter/index.js +1 -0
- package/dist/components/Jackpots/JackpotDesktop.d.ts +1 -0
- package/dist/components/Jackpots/JackpotDesktop.js +45 -0
- package/dist/components/Jackpots/JackpotGameProviders.d.ts +5 -0
- package/dist/components/Jackpots/JackpotGameProviders.js +41 -0
- package/dist/components/Jackpots/JackpotItemDesktop.d.ts +9 -0
- package/dist/components/Jackpots/JackpotItemDesktop.js +43 -0
- package/dist/components/Jackpots/JackpotItemMobile.d.ts +9 -0
- package/dist/components/Jackpots/JackpotItemMobile.js +44 -0
- package/dist/components/Jackpots/JackpotMobile.d.ts +1 -0
- package/dist/components/Jackpots/JackpotMobile.js +46 -0
- package/dist/components/Jackpots/JackpotRules.d.ts +5 -0
- package/dist/components/Jackpots/JackpotRules.js +11 -0
- package/dist/components/Jackpots/Jackpots.client.d.ts +2 -0
- package/dist/components/Jackpots/Jackpots.client.js +29 -0
- package/dist/components/Jackpots/JackpotsContext.d.ts +4 -0
- package/dist/components/Jackpots/JackpotsContext.js +3 -0
- package/dist/components/Jackpots/useJackpotData.d.ts +14 -0
- package/dist/components/Jackpots/useJackpotData.js +93 -0
- package/dist/components/Jackpots/useJackpotItemData.d.ts +20 -0
- package/dist/components/Jackpots/useJackpotItemData.js +87 -0
- package/dist/components/KYC/AutoOpen.d.ts +1 -0
- package/dist/components/KYC/AutoOpen.js +45 -0
- package/dist/components/KYC/Header.d.ts +1 -0
- package/dist/components/KYC/Header.js +8 -0
- package/dist/components/KYC/Step1.d.ts +1 -0
- package/dist/components/KYC/Step1.js +13 -0
- package/dist/components/KYC/Step2.d.ts +1 -0
- package/dist/components/KYC/Step2.js +13 -0
- package/dist/components/KYC/Step3.d.ts +1 -0
- package/dist/components/KYC/Step3.js +13 -0
- package/dist/components/KYC/Step4.d.ts +1 -0
- package/dist/components/KYC/Step4.js +7 -0
- package/dist/components/KYC/backup/Header.d.ts +1 -0
- package/dist/components/KYC/backup/Header.js +8 -0
- package/dist/components/KYC/backup/Indicator.d.ts +1 -0
- package/dist/components/KYC/backup/Indicator.js +9 -0
- package/dist/components/KYC/backup/KYC.d.ts +1 -0
- package/dist/components/KYC/backup/KYC.js +14 -0
- package/dist/components/KYC/backup/KYC.lazy.d.ts +1 -0
- package/dist/components/KYC/backup/KYC.lazy.js +26 -0
- package/dist/components/KYC/backup/KYCContext.d.ts +6 -0
- package/dist/components/KYC/backup/KYCContext.js +2 -0
- package/dist/components/KYC/backup/Step1.d.ts +1 -0
- package/dist/components/KYC/backup/Step1.js +13 -0
- package/dist/components/KYC/backup/Step2.d.ts +1 -0
- package/dist/components/KYC/backup/Step2.js +13 -0
- package/dist/components/KYC/backup/Step3.d.ts +1 -0
- package/dist/components/KYC/backup/Step3.js +13 -0
- package/dist/components/KYC/backup/Step4.d.ts +1 -0
- package/dist/components/KYC/backup/Step4.js +7 -0
- package/dist/components/KYC/backup/useKYC.d.ts +10 -0
- package/dist/components/KYC/backup/useKYC.js +8 -0
- package/dist/components/KYC/loadModels.d.ts +1 -0
- package/dist/components/KYC/loadModels.js +9 -0
- package/dist/components/Messages/Message.d.ts +1 -0
- package/dist/components/Messages/Message.js +34 -0
- package/dist/components/Messages/MessageContext.d.ts +6 -0
- package/dist/components/Messages/MessageContext.js +2 -0
- package/dist/components/Messages/MessageItem.d.ts +4 -0
- package/dist/components/Messages/MessageItem.js +34 -0
- package/dist/components/Messages/MessagePopup.d.ts +1 -0
- package/dist/components/Messages/MessagePopup.js +19 -0
- package/dist/components/Messages/MessageTrigger.d.ts +8 -0
- package/dist/components/Messages/MessageTrigger.js +19 -0
- package/dist/components/News/News.js +1 -1
- package/dist/components/PortalProvider/FeatureFlag.js +1 -1
- package/dist/components/Promo/Promo.client.js +1 -1
- package/dist/components/Promo/PromoContent.d.ts +2 -0
- package/dist/components/Promo/PromoContent.js +9 -0
- package/dist/components/Promos/PromoCarousel.d.ts +2 -0
- package/dist/components/Promos/PromoCarousel.js +41 -0
- package/dist/components/Promos/PromoGrid.d.ts +2 -0
- package/dist/components/Promos/PromoGrid.js +12 -0
- package/dist/components/Promos/PromoItem.d.ts +7 -0
- package/dist/components/Promos/PromoItem.js +10 -0
- package/dist/components/Quests/CountdownTimer.d.ts +15 -0
- package/dist/components/Quests/CountdownTimer.js +33 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.d.ts +4 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuest.js +78 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.d.ts +8 -0
- package/dist/components/Quests/DailyCheckInQuest/DailyCheckInQuestModal.js +9 -0
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.d.ts +4 -0
- package/dist/components/Quests/OnboardingQuest/OnboardingQuest.js +4 -0
- package/dist/components/Quests/WageringQuest/WageringQuest.d.ts +4 -0
- package/dist/components/Quests/WageringQuest/WageringQuest.js +20 -0
- package/dist/components/Quests/WageringQuest/WageringQuestModal.d.ts +9 -0
- package/dist/components/Quests/WageringQuest/WageringQuestModal.js +9 -0
- package/dist/components/Search/Search.lazy.js +1 -1
- package/dist/components/SignUp/SignUp.lazy.d.ts +12 -0
- package/dist/components/SignUp/SignUp.lazy.js +18 -0
- package/dist/components/SignUp/SignUpContext.d.ts +6 -0
- package/dist/components/SignUp/SignUpContext.js +2 -0
- package/dist/components/SignUp/SignUpDefault/SignUpForm.js +27 -6
- package/dist/components/SignUp/SignUpForm.d.ts +1 -0
- package/dist/components/SignUp/SignUpForm.js +288 -0
- package/dist/components/SignUp/SignUpKYC/CaptureIdDocument.js +2 -2
- package/dist/components/SignUp/SignUpKYC/CaptureSelfie.js +3 -3
- package/dist/components/SignUp/SignUpKYC/ImageUploader.js +1 -1
- package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.d.ts +7 -0
- package/dist/components/SignUp/SignUpKYC/PersonOverlayDesktop.js +9 -0
- package/dist/components/SignUp/SignUpKYC/SignUpFormKYC.js +19 -2
- package/dist/components/SignUp/SignUpKYC/useImageUploader.js +1 -1
- package/dist/components/SignUp/SignUpKYC/utils.d.ts +9 -0
- package/dist/components/SignUp/SignUpKYC/utils.js +79 -0
- package/dist/components/TournamentCounter/TournamentCounter.client.d.ts +2 -0
- package/dist/components/TournamentCounter/TournamentCounter.client.js +50 -0
- package/dist/components/TournamentCounter/TournamentCounter.d.ts +8 -0
- package/dist/components/TournamentCounter/TournamentCounter.js +21 -0
- package/dist/components/TournamentCounter/TournamentCounterItem.d.ts +8 -0
- package/dist/components/TournamentCounter/TournamentCounterItem.js +106 -0
- package/dist/components/TournamentCounter/index.d.ts +1 -0
- package/dist/components/TournamentCounter/index.js +1 -0
- package/dist/components/Tournaments/TournamentDesktop.d.ts +1 -0
- package/dist/components/Tournaments/TournamentDesktop.js +57 -0
- package/dist/components/Tournaments/TournamentGameProviders.d.ts +5 -0
- package/dist/components/Tournaments/TournamentGameProviders.js +38 -0
- package/dist/components/Tournaments/TournamentItemDesktop.d.ts +7 -0
- package/dist/components/Tournaments/TournamentItemDesktop.js +56 -0
- package/dist/components/Tournaments/TournamentItemMobile.d.ts +7 -0
- package/dist/components/Tournaments/TournamentItemMobile.js +54 -0
- package/dist/components/Tournaments/TournamentMobile.d.ts +1 -0
- package/dist/components/Tournaments/TournamentMobile.js +55 -0
- package/dist/components/Tournaments/TournamentRules.d.ts +5 -0
- package/dist/components/Tournaments/TournamentRules.js +11 -0
- package/dist/components/Tournaments/Tournaments.client.d.ts +2 -0
- package/dist/components/Tournaments/Tournaments.client.js +20 -0
- package/dist/components/Tournaments/TournamentsContext.d.ts +4 -0
- package/dist/components/Tournaments/TournamentsContext.js +3 -0
- package/dist/components/Tournaments/useTournamentData.d.ts +10 -0
- package/dist/components/Tournaments/useTournamentData.js +72 -0
- package/dist/components/Tournaments/useTournamentItemData.d.ts +16 -0
- package/dist/components/Tournaments/useTournamentItemData.js +64 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.js +33 -0
- package/dist/constants/BranchCode.d.ts +4 -0
- package/dist/constants/BranchCode.js +42 -0
- package/dist/constants/endpoints.d.ts +10 -0
- package/dist/constants/endpoints.js +41 -0
- package/dist/constants/envVars.d.ts +5 -0
- package/dist/constants/envVars.js +28 -0
- package/dist/constants/gameProviders.d.ts +76 -0
- package/dist/constants/gameProviders.js +361 -0
- package/dist/constants/gameTypes.d.ts +3 -0
- package/dist/constants/gameTypes.js +64 -0
- package/dist/constants/headerKeys.d.ts +2 -0
- package/dist/constants/headerKeys.js +2 -0
- package/dist/constants/secretQuestions.d.ts +3 -0
- package/dist/constants/secretQuestions.js +24 -0
- package/dist/constants/storageKeys.d.ts +2 -0
- package/dist/constants/storageKeys.js +2 -0
- package/dist/handlers/index.d.ts +7 -7
- package/dist/icons/BellRingIcon.d.ts +2 -0
- package/dist/icons/BellRingIcon.js +4 -0
- package/dist/icons/index.d.ts +65 -0
- package/dist/icons/index.js +65 -0
- package/dist/images/hacksaw-gaming.png +0 -0
- package/dist/server/services/index.d.ts +4 -0
- package/dist/server/services/index.js +4 -0
- package/dist/server/utils/index.d.ts +29 -0
- package/dist/server/utils/index.js +29 -0
- package/dist/ui/AlertDialog/AlertDialog.d.ts +121 -121
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +11 -11
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/badge.anatomy.d.ts +1 -1
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Carousel/Carousel.d.ts +99 -99
- package/dist/ui/Carousel/carousel.recipe.d.ts +11 -11
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Dialog/Dialog.d.ts +121 -121
- package/dist/ui/Dialog/dialog.recipe.d.ts +11 -11
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Menu/Menu.d.ts +144 -144
- package/dist/ui/Menu/menu.recipe.d.ts +8 -8
- package/dist/ui/Popover/Popover.d.ts +88 -88
- package/dist/ui/Popover/popover.recipe.d.ts +8 -8
- package/dist/ui/Presence.d.ts +2 -0
- package/dist/ui/Presence.js +7 -0
- package/dist/ui/Progress/Progress.d.ts +27 -27
- package/dist/ui/Progress/progress.recipe.d.ts +3 -3
- package/dist/ui/Prose.d.ts +2 -0
- package/dist/ui/Prose.js +5 -0
- package/dist/ui/SegmentGroup/SegmentGroup.d.ts +18 -18
- package/dist/ui/SegmentGroup/segmentGroup.recipe.d.ts +3 -3
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/dist/ui/index.d.ts +26 -0
- package/dist/ui/index.js +26 -0
- package/dist/utils/createErrorFromCode.d.ts +2 -0
- package/dist/utils/createErrorFromCode.js +11 -0
- package/dist/utils/dataUrlToBlob.d.ts +1 -0
- package/dist/utils/dataUrlToBlob.js +11 -0
- package/dist/utils/index.d.ts +17 -0
- package/dist/utils/index.js +17 -0
- package/dist/utils/isMobile.d.ts +5 -0
- package/dist/utils/isMobile.js +9 -0
- package/dist/utils/resizeImageSize.d.ts +1 -0
- package/dist/utils/resizeImageSize.js +6 -0
- package/package.json +1 -1
- package/dist/handlers/postTransformIdFrontImage.d.ts +0 -3
- package/dist/handlers/postTransformIdFrontImage.js +0 -67
- package/dist/handlers/postTransformSelfieImage.d.ts +0 -3
- package/dist/handlers/postTransformSelfieImage.js +0 -71
|
@@ -10,7 +10,7 @@ export declare const tabsRecipe: import("tailwind-variants").TVReturnType<{
|
|
|
10
10
|
trigger: string;
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
-
}, Record<"content" | "
|
|
13
|
+
}, Record<"content" | "trigger" | "list" | "root" | "indicator", string | string[]>, undefined, {
|
|
14
14
|
size: {
|
|
15
15
|
md: {};
|
|
16
16
|
};
|
|
@@ -22,7 +22,7 @@ export declare const tabsRecipe: import("tailwind-variants").TVReturnType<{
|
|
|
22
22
|
trigger: string;
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
|
-
}, Record<"content" | "
|
|
25
|
+
}, Record<"content" | "trigger" | "list" | "root" | "indicator", string | string[]>, import("tailwind-variants").TVReturnType<{
|
|
26
26
|
size: {
|
|
27
27
|
md: {};
|
|
28
28
|
};
|
|
@@ -34,4 +34,4 @@ export declare const tabsRecipe: import("tailwind-variants").TVReturnType<{
|
|
|
34
34
|
trigger: string;
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
-
}, Record<"content" | "
|
|
37
|
+
}, Record<"content" | "trigger" | "list" | "root" | "indicator", string | string[]>, undefined, unknown, unknown, undefined>>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export * from './AlertDialog';
|
|
2
|
+
export * from './Avatar';
|
|
3
|
+
export * from './Badge';
|
|
4
|
+
export * from './Button';
|
|
5
|
+
export * from './Checkbox';
|
|
6
|
+
export * from './Clipboard';
|
|
7
|
+
export * from './Collapsible';
|
|
8
|
+
export * from './Combobox';
|
|
9
|
+
export * from './DatePicker';
|
|
10
|
+
export * from './Dialog';
|
|
11
|
+
export * from './Drawer';
|
|
12
|
+
export * from './Field';
|
|
13
|
+
export * from './IconButton';
|
|
14
|
+
export * from './Menu';
|
|
15
|
+
export * from './NumberInput';
|
|
16
|
+
export * from './PasswordInput';
|
|
17
|
+
export * from './PinInput';
|
|
18
|
+
export * from './Popover';
|
|
19
|
+
export * from './Presence';
|
|
20
|
+
export * from './Progress';
|
|
21
|
+
export * from './Prose';
|
|
22
|
+
export * from './SegmentGroup';
|
|
23
|
+
export * from './Select';
|
|
24
|
+
export * from './Table';
|
|
25
|
+
export * from './Tabs';
|
|
26
|
+
export * from './Tooltip';
|
package/dist/ui/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export * from './AlertDialog/index.js';
|
|
2
|
+
export * from './Avatar/index.js';
|
|
3
|
+
export * from './Badge/index.js';
|
|
4
|
+
export * from './Button/index.js';
|
|
5
|
+
export * from './Checkbox/index.js';
|
|
6
|
+
export * from './Clipboard/index.js';
|
|
7
|
+
export * from './Collapsible/index.js';
|
|
8
|
+
export * from './Combobox/index.js';
|
|
9
|
+
export * from './DatePicker/index.js';
|
|
10
|
+
export * from './Dialog/index.js';
|
|
11
|
+
export * from './Drawer/index.js';
|
|
12
|
+
export * from './Field/index.js';
|
|
13
|
+
export * from './IconButton/index.js';
|
|
14
|
+
export * from './Menu/index.js';
|
|
15
|
+
export * from './NumberInput/index.js';
|
|
16
|
+
export * from './PasswordInput/index.js';
|
|
17
|
+
export * from './PinInput/index.js';
|
|
18
|
+
export * from './Popover/index.js';
|
|
19
|
+
export * from './Presence.js';
|
|
20
|
+
export * from './Progress/index.js';
|
|
21
|
+
export * from './Prose.js';
|
|
22
|
+
export * from './SegmentGroup/index.js';
|
|
23
|
+
export * from './Select/index.js';
|
|
24
|
+
export * from './Table/index.js';
|
|
25
|
+
export * from './Tabs/index.js';
|
|
26
|
+
export * from './Tooltip/index.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// ✏️ TODO
|
|
2
|
+
const ERROR_CODES_MAP = {
|
|
3
|
+
'': '',
|
|
4
|
+
};
|
|
5
|
+
export function createErrorFromCode(name, message) {
|
|
6
|
+
const error = new Error();
|
|
7
|
+
error.name = name;
|
|
8
|
+
error.message = ERROR_CODES_MAP[name] ?? message ?? 'Something went wrong';
|
|
9
|
+
Error.captureStackTrace?.(error, createErrorFromCode);
|
|
10
|
+
return error;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dataURLtoBlob(dataURL: string): Blob;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function dataURLtoBlob(dataURL) {
|
|
2
|
+
const parts = dataURL.split(';base64,');
|
|
3
|
+
const contentType = parts[0].split(':')[1];
|
|
4
|
+
const raw = window.atob(parts[1]);
|
|
5
|
+
const rawLength = raw.length;
|
|
6
|
+
const uInt8Array = new Uint8Array(rawLength);
|
|
7
|
+
for (let i = 0; i < rawLength; ++i) {
|
|
8
|
+
uInt8Array[i] = raw.charCodeAt(i);
|
|
9
|
+
}
|
|
10
|
+
return new Blob([uInt8Array], { type: contentType });
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './anatomyToRecipeSlots';
|
|
2
|
+
export * from './callIfFn';
|
|
3
|
+
export * from './capitalize';
|
|
4
|
+
export * from './createPoll';
|
|
5
|
+
export * from './createSplitProps';
|
|
6
|
+
export * from './dataAttr';
|
|
7
|
+
export * from './formatNumber';
|
|
8
|
+
export * from './getGameImageUrl';
|
|
9
|
+
export * from './getGameProviderData';
|
|
10
|
+
export * from './getGameTypeData';
|
|
11
|
+
export * from './getLocaleInfo';
|
|
12
|
+
export * from './getPercentage';
|
|
13
|
+
export * from './getQueryClient';
|
|
14
|
+
export * from './isMobile';
|
|
15
|
+
export * from './mask';
|
|
16
|
+
export * from './parseDecimal';
|
|
17
|
+
export * from './queryKeys';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './anatomyToRecipeSlots.js';
|
|
2
|
+
export * from './callIfFn.js';
|
|
3
|
+
export * from './capitalize.js';
|
|
4
|
+
export * from './createPoll.js';
|
|
5
|
+
export * from './createSplitProps.js';
|
|
6
|
+
export * from './dataAttr.js';
|
|
7
|
+
export * from './formatNumber.js';
|
|
8
|
+
export * from './getGameImageUrl.js';
|
|
9
|
+
export * from './getGameProviderData.js';
|
|
10
|
+
export * from './getGameTypeData.js';
|
|
11
|
+
export * from './getLocaleInfo.js';
|
|
12
|
+
export * from './getPercentage.js';
|
|
13
|
+
export * from './getQueryClient.js';
|
|
14
|
+
export * from './isMobile.js';
|
|
15
|
+
export * from './mask.js';
|
|
16
|
+
export * from './parseDecimal.js';
|
|
17
|
+
export * from './queryKeys.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const resizeFile: (file: File) => Promise<unknown>;
|
package/package.json
CHANGED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { NextResponse } from 'next/server';
|
|
2
|
-
import sharp from 'sharp';
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
import { validateFile } from '../utils/validateFile.js';
|
|
5
|
-
const TransformIdFrontImageDefinition = z.object({
|
|
6
|
-
image: z.instanceof(File).superRefine((file, context) => {
|
|
7
|
-
const error = validateFile(file);
|
|
8
|
-
if (error) {
|
|
9
|
-
context.addIssue({
|
|
10
|
-
code: z.ZodIssueCode.custom,
|
|
11
|
-
message: error.message,
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
}),
|
|
15
|
-
cropTop: z.number().or(z.string().transform((v) => Math.round(Number(v)))),
|
|
16
|
-
cropLeft: z.number().or(z.string().transform((v) => Math.round(Number(v)))),
|
|
17
|
-
cropWidth: z.number().or(z.string().transform((v) => Math.round(Number(v)))),
|
|
18
|
-
cropHeight: z.number().or(z.string().transform((v) => Math.round(Number(v)))),
|
|
19
|
-
});
|
|
20
|
-
export async function postTransformIdFrontImage(request) {
|
|
21
|
-
const form = await request.formData();
|
|
22
|
-
const parsed = TransformIdFrontImageDefinition.safeParse({
|
|
23
|
-
image: form.get('image'),
|
|
24
|
-
cropTop: form.get('cropTop'),
|
|
25
|
-
cropLeft: form.get('cropLeft'),
|
|
26
|
-
cropWidth: form.get('cropWidth'),
|
|
27
|
-
cropHeight: form.get('cropHeight'),
|
|
28
|
-
});
|
|
29
|
-
if (!parsed.success) {
|
|
30
|
-
return NextResponse.json({
|
|
31
|
-
ok: false,
|
|
32
|
-
message: parsed.error.issues[0].message,
|
|
33
|
-
__error: parsed.error,
|
|
34
|
-
}, { status: 400 });
|
|
35
|
-
}
|
|
36
|
-
const file = parsed.data.image;
|
|
37
|
-
const arrayBuffer = await file.arrayBuffer();
|
|
38
|
-
const buffer = Buffer.from(arrayBuffer);
|
|
39
|
-
const cropped = await sharp(buffer)
|
|
40
|
-
.extract({
|
|
41
|
-
top: parsed.data.cropTop,
|
|
42
|
-
left: parsed.data.cropLeft,
|
|
43
|
-
width: parsed.data.cropWidth,
|
|
44
|
-
height: parsed.data.cropHeight,
|
|
45
|
-
})
|
|
46
|
-
.resize({
|
|
47
|
-
width: 1200,
|
|
48
|
-
height: 757,
|
|
49
|
-
kernel: sharp.kernel.lanczos3,
|
|
50
|
-
withoutEnlargement: true,
|
|
51
|
-
})
|
|
52
|
-
.modulate({
|
|
53
|
-
brightness: 1.025,
|
|
54
|
-
saturation: 1.025,
|
|
55
|
-
})
|
|
56
|
-
.median(3)
|
|
57
|
-
.blur()
|
|
58
|
-
.sharpen()
|
|
59
|
-
.webp()
|
|
60
|
-
.toBuffer();
|
|
61
|
-
return new NextResponse(cropped, {
|
|
62
|
-
headers: {
|
|
63
|
-
'Content-Type': 'image/webp',
|
|
64
|
-
'Content-Disposition': `inline; filename="id-front-${Date.now()}.webp"`,
|
|
65
|
-
},
|
|
66
|
-
});
|
|
67
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { NextResponse } from 'next/server';
|
|
2
|
-
import sharp from 'sharp';
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
import { validateFile } from '../utils/validateFile.js';
|
|
5
|
-
const TransformSelfieImageDefinition = z.object({
|
|
6
|
-
image: z.instanceof(File).superRefine((file, context) => {
|
|
7
|
-
const error = validateFile(file);
|
|
8
|
-
if (error) {
|
|
9
|
-
context.addIssue({
|
|
10
|
-
code: z.ZodIssueCode.custom,
|
|
11
|
-
message: error.message,
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
}),
|
|
15
|
-
cropTop: z.number().or(z.string().transform((v) => Math.round(Number(v)))),
|
|
16
|
-
cropLeft: z.number().or(z.string().transform((v) => Math.round(Number(v)))),
|
|
17
|
-
cropWidth: z.number().or(z.string().transform((v) => Math.round(Number(v)))),
|
|
18
|
-
cropHeight: z.number().or(z.string().transform((v) => Math.round(Number(v)))),
|
|
19
|
-
});
|
|
20
|
-
export async function postTransformSelfieImage(request) {
|
|
21
|
-
const form = await request.formData();
|
|
22
|
-
const parsed = TransformSelfieImageDefinition.safeParse({
|
|
23
|
-
image: form.get('image'),
|
|
24
|
-
cropTop: form.get('cropTop'),
|
|
25
|
-
cropLeft: form.get('cropLeft'),
|
|
26
|
-
cropWidth: form.get('cropWidth'),
|
|
27
|
-
cropHeight: form.get('cropHeight'),
|
|
28
|
-
});
|
|
29
|
-
if (!parsed.success) {
|
|
30
|
-
return NextResponse.json({
|
|
31
|
-
ok: false,
|
|
32
|
-
message: parsed.error.issues[0].message,
|
|
33
|
-
__error: parsed.error,
|
|
34
|
-
}, { status: 400 });
|
|
35
|
-
}
|
|
36
|
-
const file = parsed.data.image;
|
|
37
|
-
const arrayBuffer = await file.arrayBuffer();
|
|
38
|
-
const buffer = Buffer.from(arrayBuffer);
|
|
39
|
-
const cropped = await sharp(buffer)
|
|
40
|
-
.extract({
|
|
41
|
-
top: parsed.data.cropTop,
|
|
42
|
-
left: parsed.data.cropLeft,
|
|
43
|
-
width: parsed.data.cropWidth,
|
|
44
|
-
height: parsed.data.cropHeight,
|
|
45
|
-
})
|
|
46
|
-
.resize({
|
|
47
|
-
width: 1200,
|
|
48
|
-
height: 1200,
|
|
49
|
-
kernel: sharp.kernel.lanczos3,
|
|
50
|
-
withoutEnlargement: true,
|
|
51
|
-
})
|
|
52
|
-
.sharpen({
|
|
53
|
-
sigma: 1.15,
|
|
54
|
-
m1: 2.0,
|
|
55
|
-
m2: 5.0,
|
|
56
|
-
})
|
|
57
|
-
.modulate({
|
|
58
|
-
brightness: 1.025,
|
|
59
|
-
saturation: 1.025,
|
|
60
|
-
})
|
|
61
|
-
.median(3)
|
|
62
|
-
.blur()
|
|
63
|
-
.webp()
|
|
64
|
-
.toBuffer();
|
|
65
|
-
return new NextResponse(cropped, {
|
|
66
|
-
headers: {
|
|
67
|
-
'Content-Type': 'image/webp',
|
|
68
|
-
'Content-Disposition': `inline; filename="selfie-${Date.now()}.webp"`,
|
|
69
|
-
},
|
|
70
|
-
});
|
|
71
|
-
}
|