@opexa/portal-components 0.0.259 → 0.0.261
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/useCamera.d.ts +11 -16
- package/dist/client/hooks/useCamera.js +29 -57
- package/dist/client/hooks/useUploadFileMutation.d.ts +4 -0
- package/dist/client/hooks/useUploadFileMutation.js +24 -0
- package/dist/client/hooks/useUploadImageFileMutation.d.ts +2 -2
- package/dist/client/hooks/useUploadImageFileMutation.js +2 -2
- package/dist/client/hooks/useUploadPrivateImageFileMutation.d.ts +4 -0
- package/dist/client/hooks/useUploadPrivateImageFileMutation.js +24 -0
- package/dist/components/Bonus/Bonus.client.js +1 -1
- package/dist/components/Cashback/Cashback.client.js +1 -1
- package/dist/components/CustomPromo/CustomPromo.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
- package/dist/components/Disclaimer/Disclaimer.d.ts +1 -1
- package/dist/components/Disclaimer/DisclaimerV2.d.ts +1 -1
- package/dist/components/Disclaimer/DisclaimerV2.js +7 -5
- package/dist/components/GameLaunch/GameLaunch.lazy.js +1 -1
- package/dist/components/GamesSearch/GamesSearch.js +1 -1
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
- package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
- package/dist/components/KYC/AutoOpen.js +3 -8
- package/dist/components/KYC/utils.js +18 -18
- package/dist/components/Messages/Message.js +3 -2
- package/dist/components/Messages/MessagePopup.js +3 -2
- 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/Search/Search.lazy.js +1 -1
- package/dist/components/SignUp/SignUpForm.js +0 -4
- package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.d.ts +1 -0
- package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.js +198 -0
- package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.d.ts +1 -0
- package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.js +251 -0
- package/dist/components/SignUp/SignUpPagcor/ImageUploader.d.ts +10 -0
- package/dist/components/SignUp/SignUpPagcor/ImageUploader.js +41 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.d.ts +1 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.js +429 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.d.ts +13 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.js +26 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.d.ts +7 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.js +2 -0
- package/dist/components/SignUp/SignUpPagcor/useImageUploader.d.ts +11 -0
- package/dist/components/SignUp/SignUpPagcor/useImageUploader.js +20 -0
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
- package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
- package/dist/components/shared/IdFrontImageField/IdFrontImageField.client.d.ts +15 -0
- package/dist/components/shared/IdFrontImageField/IdFrontImageField.client.js +140 -0
- package/dist/components/shared/IdFrontImageField/IdFrontImageField.d.ts +2 -0
- package/dist/components/shared/IdFrontImageField/IdFrontImageField.js +11 -0
- package/dist/components/shared/IdFrontImageField/IdFrontImageFieldContext.d.ts +6 -0
- package/dist/components/shared/IdFrontImageField/IdFrontImageFieldContext.js +2 -0
- package/dist/components/shared/IdFrontImageField/index.d.ts +1 -0
- package/dist/components/shared/IdFrontImageField/index.js +1 -0
- package/dist/components/shared/IdFrontImageField/useIdFrontImageField.d.ts +22 -0
- package/dist/components/shared/IdFrontImageField/useIdFrontImageField.js +111 -0
- package/dist/components/shared/SelfieImageField/SelfieImageField.client.d.ts +15 -0
- package/dist/components/shared/SelfieImageField/SelfieImageField.client.js +170 -0
- package/dist/components/shared/SelfieImageField/SelfieImageField.d.ts +2 -0
- package/dist/components/shared/SelfieImageField/SelfieImageField.js +11 -0
- package/dist/components/shared/SelfieImageField/SelfieImageFieldContext.d.ts +6 -0
- package/dist/components/shared/SelfieImageField/SelfieImageFieldContext.js +2 -0
- package/dist/components/shared/SelfieImageField/index.d.ts +1 -0
- package/dist/components/shared/SelfieImageField/index.js +1 -0
- package/dist/components/shared/SelfieImageField/useSelfieImageField.d.ts +23 -0
- package/dist/components/shared/SelfieImageField/useSelfieImageField.js +208 -0
- package/dist/handlers/deleteSession.d.ts +9 -0
- package/dist/handlers/deleteSession.js +19 -0
- package/dist/handlers/getHealthCheck.d.ts +9 -0
- package/dist/handlers/getHealthCheck.js +16 -0
- package/dist/handlers/getSession.d.ts +10 -0
- package/dist/handlers/getSession.js +63 -0
- package/dist/handlers/index.d.ts +40 -0
- package/dist/handlers/index.js +56 -0
- package/dist/handlers/patchSession.d.ts +10 -0
- package/dist/handlers/patchSession.js +26 -0
- package/dist/handlers/postAuthenticate.d.ts +10 -0
- package/dist/handlers/postAuthenticate.js +51 -0
- package/dist/handlers/postSession.d.ts +17 -0
- package/dist/handlers/postSession.js +78 -0
- package/dist/handlers/postTransformIdFrontImage.d.ts +3 -0
- package/dist/handlers/postTransformIdFrontImage.js +67 -0
- package/dist/handlers/postTransformSelfieImage.d.ts +3 -0
- package/dist/handlers/postTransformSelfieImage.js +71 -0
- package/dist/services/file.d.ts +17 -12
- package/dist/services/file.js +21 -1
- package/dist/services/queries.d.ts +3 -1
- package/dist/services/queries.js +2568 -2532
- package/dist/styles/theme.css +694 -694
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/utils/mutationKeys.d.ts +2 -0
- package/dist/utils/mutationKeys.js +8 -0
- package/dist/utils/resizeImageSize.d.ts +1 -0
- package/dist/utils/resizeImageSize.js +5 -0
- package/package.json +166 -165
- package/dist/client/hooks/index.d.ts +0 -65
- package/dist/client/hooks/index.js +0 -65
- package/dist/client/services/index.d.ts +0 -4
- package/dist/client/services/index.js +0 -4
- package/dist/client/utils/index.d.ts +0 -3
- package/dist/client/utils/index.js +0 -3
- package/dist/components/CashbackBonus/CashbackBonus.client.d.ts +0 -2
- package/dist/components/CashbackBonus/CashbackBonus.client.js +0 -9
- package/dist/components/CashbackBonus/CashbackBonus.d.ts +0 -10
- package/dist/components/CashbackBonus/CashbackBonus.js +0 -5
- package/dist/components/CashbackBonus/index.d.ts +0 -1
- package/dist/components/CashbackBonus/index.js +0 -1
- package/dist/components/Empty.d.ts +0 -9
- package/dist/components/Empty.js +0 -7
- package/dist/components/Games/GameContext.d.ts +0 -2
- package/dist/components/Games/GameContext.js +0 -2
- package/dist/components/InfiniteScroll.d.ts +0 -10
- package/dist/components/InfiniteScroll.js +0 -25
- package/dist/components/JackpotCounter/JackpotCounter.client.d.ts +0 -2
- package/dist/components/JackpotCounter/JackpotCounter.client.js +0 -66
- package/dist/components/JackpotCounter/JackpotCounter.d.ts +0 -17
- package/dist/components/JackpotCounter/JackpotCounter.js +0 -21
- package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +0 -18
- package/dist/components/JackpotCounter/JackpotCounterItem.js +0 -109
- package/dist/components/JackpotCounter/JackpotCounterItem.module.css +0 -184
- package/dist/components/JackpotCounter/index.d.ts +0 -1
- package/dist/components/JackpotCounter/index.js +0 -1
- package/dist/components/Jackpots/JackpotDesktop.d.ts +0 -1
- package/dist/components/Jackpots/JackpotDesktop.js +0 -45
- package/dist/components/Jackpots/JackpotGameProviders.d.ts +0 -5
- package/dist/components/Jackpots/JackpotGameProviders.js +0 -41
- package/dist/components/Jackpots/JackpotItemDesktop.d.ts +0 -9
- package/dist/components/Jackpots/JackpotItemDesktop.js +0 -43
- package/dist/components/Jackpots/JackpotItemMobile.d.ts +0 -9
- package/dist/components/Jackpots/JackpotItemMobile.js +0 -44
- package/dist/components/Jackpots/JackpotMobile.d.ts +0 -1
- package/dist/components/Jackpots/JackpotMobile.js +0 -46
- package/dist/components/Jackpots/JackpotRules.d.ts +0 -5
- package/dist/components/Jackpots/JackpotRules.js +0 -11
- package/dist/components/Jackpots/Jackpots.client.d.ts +0 -2
- package/dist/components/Jackpots/Jackpots.client.js +0 -29
- package/dist/components/Jackpots/JackpotsContext.d.ts +0 -4
- package/dist/components/Jackpots/JackpotsContext.js +0 -3
- package/dist/components/Jackpots/useJackpotData.d.ts +0 -14
- package/dist/components/Jackpots/useJackpotData.js +0 -93
- package/dist/components/Jackpots/useJackpotItemData.d.ts +0 -20
- package/dist/components/Jackpots/useJackpotItemData.js +0 -87
- package/dist/components/KYC/Header.d.ts +0 -1
- package/dist/components/KYC/Header.js +0 -8
- package/dist/components/KYC/Step1.d.ts +0 -1
- package/dist/components/KYC/Step1.js +0 -13
- package/dist/components/KYC/Step2.d.ts +0 -1
- package/dist/components/KYC/Step2.js +0 -13
- package/dist/components/KYC/Step3.d.ts +0 -1
- package/dist/components/KYC/Step3.js +0 -13
- package/dist/components/KYC/Step4.d.ts +0 -1
- package/dist/components/KYC/Step4.js +0 -7
- package/dist/components/Messages/MessageItem.d.ts +0 -4
- package/dist/components/Messages/MessageItem.js +0 -34
- package/dist/components/Promo/PromoContent.d.ts +0 -2
- package/dist/components/Promo/PromoContent.js +0 -9
- package/dist/components/Promos/PromoCarousel.d.ts +0 -2
- package/dist/components/Promos/PromoCarousel.js +0 -41
- package/dist/components/Promos/PromoGrid.d.ts +0 -2
- package/dist/components/Promos/PromoGrid.js +0 -12
- package/dist/components/Promos/PromoItem.d.ts +0 -7
- package/dist/components/Promos/PromoItem.js +0 -10
- package/dist/components/TournamentCounter/TournamentCounter.client.d.ts +0 -2
- package/dist/components/TournamentCounter/TournamentCounter.client.js +0 -50
- package/dist/components/TournamentCounter/TournamentCounter.d.ts +0 -8
- package/dist/components/TournamentCounter/TournamentCounter.js +0 -21
- package/dist/components/TournamentCounter/TournamentCounterItem.d.ts +0 -8
- package/dist/components/TournamentCounter/TournamentCounterItem.js +0 -106
- package/dist/components/TournamentCounter/index.d.ts +0 -1
- package/dist/components/TournamentCounter/index.js +0 -1
- package/dist/components/Tournaments/TournamentDesktop.d.ts +0 -1
- package/dist/components/Tournaments/TournamentDesktop.js +0 -57
- package/dist/components/Tournaments/TournamentGameProviders.d.ts +0 -5
- package/dist/components/Tournaments/TournamentGameProviders.js +0 -38
- package/dist/components/Tournaments/TournamentItemDesktop.d.ts +0 -7
- package/dist/components/Tournaments/TournamentItemDesktop.js +0 -56
- package/dist/components/Tournaments/TournamentItemMobile.d.ts +0 -7
- package/dist/components/Tournaments/TournamentItemMobile.js +0 -54
- package/dist/components/Tournaments/TournamentMobile.d.ts +0 -1
- package/dist/components/Tournaments/TournamentMobile.js +0 -55
- package/dist/components/Tournaments/TournamentRules.d.ts +0 -5
- package/dist/components/Tournaments/TournamentRules.js +0 -11
- package/dist/components/Tournaments/Tournaments.client.d.ts +0 -2
- package/dist/components/Tournaments/Tournaments.client.js +0 -20
- package/dist/components/Tournaments/TournamentsContext.d.ts +0 -4
- package/dist/components/Tournaments/TournamentsContext.js +0 -3
- package/dist/components/Tournaments/useTournamentData.d.ts +0 -10
- package/dist/components/Tournaments/useTournamentData.js +0 -72
- package/dist/components/Tournaments/useTournamentItemData.d.ts +0 -16
- package/dist/components/Tournaments/useTournamentItemData.js +0 -64
- package/dist/components/index.d.ts +0 -33
- package/dist/components/index.js +0 -33
- package/dist/constants/endpoints.d.ts +0 -10
- package/dist/constants/endpoints.js +0 -41
- package/dist/constants/envVars.d.ts +0 -5
- package/dist/constants/envVars.js +0 -28
- package/dist/constants/gameProviders.d.ts +0 -76
- package/dist/constants/gameProviders.js +0 -361
- package/dist/constants/gameTypes.d.ts +0 -3
- package/dist/constants/gameTypes.js +0 -64
- package/dist/constants/headerKeys.d.ts +0 -2
- package/dist/constants/headerKeys.js +0 -2
- package/dist/constants/secretQuestions.d.ts +0 -3
- package/dist/constants/secretQuestions.js +0 -24
- package/dist/constants/storageKeys.d.ts +0 -2
- package/dist/constants/storageKeys.js +0 -2
- package/dist/icons/index.d.ts +0 -65
- package/dist/icons/index.js +0 -65
- package/dist/images/hacksaw-gaming.png +0 -0
- package/dist/server/services/index.d.ts +0 -4
- package/dist/server/services/index.js +0 -4
- package/dist/server/utils/index.d.ts +0 -29
- package/dist/server/utils/index.js +0 -29
- package/dist/ui/Presence.d.ts +0 -2
- package/dist/ui/Presence.js +0 -7
- package/dist/ui/Prose.d.ts +0 -2
- package/dist/ui/Prose.js +0 -5
- package/dist/ui/index.d.ts +0 -26
- package/dist/ui/index.js +0 -26
- package/dist/utils/createErrorFromCode.d.ts +0 -2
- package/dist/utils/createErrorFromCode.js +0 -11
- package/dist/utils/index.d.ts +0 -17
- package/dist/utils/index.js +0 -17
- package/dist/utils/isMobile.d.ts +0 -5
- package/dist/utils/isMobile.js +0 -9
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { addMinutes } from 'date-fns';
|
|
2
|
+
import { NextResponse } from 'next/server';
|
|
3
|
+
import { ACCESS_TOKEN_COOKIE_NAME, DOMAIN_COOKIE_NAME, REFRESH_TOKEN_COOKIE_NAME, } from '../constants/index.js';
|
|
4
|
+
import { refreshSession } from '../services/auth.js';
|
|
5
|
+
export async function getSession(request) {
|
|
6
|
+
const accessToken = request.cookies.get(ACCESS_TOKEN_COOKIE_NAME)?.value;
|
|
7
|
+
const refreshToken = request.cookies.get(REFRESH_TOKEN_COOKIE_NAME)?.value;
|
|
8
|
+
const domain = request.cookies.get(DOMAIN_COOKIE_NAME)?.value;
|
|
9
|
+
if (!refreshToken) {
|
|
10
|
+
const response = NextResponse.json({
|
|
11
|
+
ok: true,
|
|
12
|
+
data: {
|
|
13
|
+
domain,
|
|
14
|
+
status: 'unauthenticated',
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
response.cookies.delete(ACCESS_TOKEN_COOKIE_NAME);
|
|
18
|
+
response.cookies.delete(REFRESH_TOKEN_COOKIE_NAME);
|
|
19
|
+
return response;
|
|
20
|
+
}
|
|
21
|
+
if (!accessToken) {
|
|
22
|
+
try {
|
|
23
|
+
const data = await refreshSession({
|
|
24
|
+
headers: {
|
|
25
|
+
Authorization: `Bearer ${refreshToken}`,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
const response = NextResponse.json({
|
|
29
|
+
ok: true,
|
|
30
|
+
data: {
|
|
31
|
+
status: 'authenticated',
|
|
32
|
+
domain,
|
|
33
|
+
token: data.accessToken,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
response.cookies.set(ACCESS_TOKEN_COOKIE_NAME, data.accessToken, {
|
|
37
|
+
expires: addMinutes(new Date(), 9),
|
|
38
|
+
httpOnly: true,
|
|
39
|
+
sameSite: 'strict',
|
|
40
|
+
});
|
|
41
|
+
return response;
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
const response = NextResponse.json({
|
|
45
|
+
ok: true,
|
|
46
|
+
data: {
|
|
47
|
+
status: 'unauthenticated',
|
|
48
|
+
domain,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
response.cookies.delete(REFRESH_TOKEN_COOKIE_NAME);
|
|
52
|
+
return response;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return NextResponse.json({
|
|
56
|
+
ok: true,
|
|
57
|
+
data: {
|
|
58
|
+
status: 'authenticated',
|
|
59
|
+
domain,
|
|
60
|
+
token: accessToken,
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { NextResponse, type NextRequest } from 'next/server';
|
|
2
|
+
interface Params {
|
|
3
|
+
auth: string[];
|
|
4
|
+
}
|
|
5
|
+
interface Context {
|
|
6
|
+
params: Promise<Params>;
|
|
7
|
+
}
|
|
8
|
+
export declare const GET: (req: NextRequest, { params }: Context) => Promise<NextResponse<{
|
|
9
|
+
ok: true;
|
|
10
|
+
data?: never;
|
|
11
|
+
} | {
|
|
12
|
+
ok: false;
|
|
13
|
+
message: string;
|
|
14
|
+
__error?: unknown;
|
|
15
|
+
}> | NextResponse<{
|
|
16
|
+
ok: false;
|
|
17
|
+
message: string;
|
|
18
|
+
__error?: unknown;
|
|
19
|
+
} | {
|
|
20
|
+
ok: true;
|
|
21
|
+
data: Record<string, unknown>;
|
|
22
|
+
}> | NextResponse<{
|
|
23
|
+
ok: false;
|
|
24
|
+
message: string;
|
|
25
|
+
__error?: unknown;
|
|
26
|
+
} | {
|
|
27
|
+
ok: true;
|
|
28
|
+
data: import("../types").Session;
|
|
29
|
+
}>>;
|
|
30
|
+
export declare const DELETE: (req: NextRequest, { params }: Context) => Promise<NextResponse<{
|
|
31
|
+
ok: true;
|
|
32
|
+
data?: never;
|
|
33
|
+
} | {
|
|
34
|
+
ok: false;
|
|
35
|
+
message: string;
|
|
36
|
+
__error?: unknown;
|
|
37
|
+
}>>;
|
|
38
|
+
export declare const POST: (req: NextRequest, { params }: Context) => Promise<NextResponse>;
|
|
39
|
+
export declare const PATCH: (req: NextRequest, { params }: Context) => Promise<NextResponse>;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { NextResponse } from 'next/server';
|
|
2
|
+
import { deleteSession } from './deleteSession.js';
|
|
3
|
+
import { getHealthCheck } from './getHealthCheck.js';
|
|
4
|
+
import { getSession } from './getSession.js';
|
|
5
|
+
import { patchSession } from './patchSession.js';
|
|
6
|
+
import { postAuthenticate } from './postAuthenticate.js';
|
|
7
|
+
import { postSession } from './postSession.js';
|
|
8
|
+
import { postTransformIdFrontImage } from './postTransformIdFrontImage.js';
|
|
9
|
+
import { postTransformSelfieImage } from './postTransformSelfieImage.js';
|
|
10
|
+
export const GET = async (req, { params }) => {
|
|
11
|
+
const { auth } = await params;
|
|
12
|
+
const path = auth[0];
|
|
13
|
+
if (path === 'health-check') {
|
|
14
|
+
return await getHealthCheck(req);
|
|
15
|
+
}
|
|
16
|
+
if (path === 'sessions') {
|
|
17
|
+
return await getSession(req);
|
|
18
|
+
}
|
|
19
|
+
return NextResponse.json({ ok: false, message: 'Not found' }, { status: 404 });
|
|
20
|
+
};
|
|
21
|
+
export const DELETE = async (req, { params }) => {
|
|
22
|
+
const { auth } = await params;
|
|
23
|
+
const path = auth[0];
|
|
24
|
+
if (path === 'sessions') {
|
|
25
|
+
return await deleteSession(req);
|
|
26
|
+
}
|
|
27
|
+
return NextResponse.json({ ok: false, message: 'Not found' }, { status: 404 });
|
|
28
|
+
};
|
|
29
|
+
export const POST = async (req, { params }) => {
|
|
30
|
+
const { auth } = await params;
|
|
31
|
+
const path = auth[0];
|
|
32
|
+
const subpath = auth[1];
|
|
33
|
+
if (path === 'sessions') {
|
|
34
|
+
return await postSession(req);
|
|
35
|
+
}
|
|
36
|
+
if (path === 'authenticate') {
|
|
37
|
+
return await postAuthenticate(req);
|
|
38
|
+
}
|
|
39
|
+
if (path === 'transformers') {
|
|
40
|
+
if (subpath === 'selfie-image') {
|
|
41
|
+
return await postTransformSelfieImage(req);
|
|
42
|
+
}
|
|
43
|
+
if (subpath === 'id-front-image') {
|
|
44
|
+
return await postTransformIdFrontImage(req);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return NextResponse.json({ ok: false, message: 'Not found' }, { status: 404 });
|
|
48
|
+
};
|
|
49
|
+
export const PATCH = async (req, { params }) => {
|
|
50
|
+
const { auth } = await params;
|
|
51
|
+
const path = auth[0];
|
|
52
|
+
if (path === 'sessions') {
|
|
53
|
+
return await patchSession(req);
|
|
54
|
+
}
|
|
55
|
+
return NextResponse.json({ ok: false, message: 'Not found' }, { status: 404 });
|
|
56
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NextRequest } from 'next/server';
|
|
2
|
+
import { NextResponse } from 'next/server';
|
|
3
|
+
export declare function patchSession(request: NextRequest): Promise<NextResponse<{
|
|
4
|
+
ok: true;
|
|
5
|
+
data?: never;
|
|
6
|
+
} | {
|
|
7
|
+
ok: false;
|
|
8
|
+
message: string;
|
|
9
|
+
__error?: unknown;
|
|
10
|
+
}>>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { addDays } from 'date-fns';
|
|
2
|
+
import { NextResponse } from 'next/server';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { DOMAIN_COOKIE_NAME } from '../constants/index.js';
|
|
5
|
+
const UpdateSessionDefinition = z.object({
|
|
6
|
+
domain: z.string().optional().nullable(),
|
|
7
|
+
});
|
|
8
|
+
export async function patchSession(request) {
|
|
9
|
+
const body = await request.json();
|
|
10
|
+
const parsed = UpdateSessionDefinition.safeParse(body);
|
|
11
|
+
if (!parsed.success) {
|
|
12
|
+
return NextResponse.json({
|
|
13
|
+
ok: false,
|
|
14
|
+
message: parsed.error.issues[0].message,
|
|
15
|
+
}, { status: 400 });
|
|
16
|
+
}
|
|
17
|
+
const response = NextResponse.json({ ok: true });
|
|
18
|
+
if (parsed.data.domain) {
|
|
19
|
+
response.cookies.set(DOMAIN_COOKIE_NAME, parsed.data.domain, {
|
|
20
|
+
expires: addDays(new Date(), 30),
|
|
21
|
+
httpOnly: true,
|
|
22
|
+
sameSite: 'strict',
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return response;
|
|
26
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NextRequest } from 'next/server';
|
|
2
|
+
import { NextResponse } from 'next/server';
|
|
3
|
+
export declare function postAuthenticate(request: NextRequest): Promise<NextResponse<{
|
|
4
|
+
ok: true;
|
|
5
|
+
data?: never;
|
|
6
|
+
} | {
|
|
7
|
+
ok: false;
|
|
8
|
+
message: string;
|
|
9
|
+
__error?: unknown;
|
|
10
|
+
}>>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { addDays, addMinutes, subMinutes } from 'date-fns';
|
|
2
|
+
import { NextResponse } from 'next/server';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { ACCESS_TOKEN_COOKIE_NAME, DOMAIN_HEADER_KEY, RECAPTCHA_HEADER_KEY, REFRESH_TOKEN_COOKIE_NAME, } from '../constants/index.js';
|
|
5
|
+
import { authenticate } from '../services/auth.js';
|
|
6
|
+
const AuthenticateDefinition = z.object({
|
|
7
|
+
type: z.literal('SECURITY_QUESTION'),
|
|
8
|
+
token: z.string(),
|
|
9
|
+
secretAnswer: z.string(),
|
|
10
|
+
});
|
|
11
|
+
export async function postAuthenticate(request) {
|
|
12
|
+
const body = await request.json();
|
|
13
|
+
const parsed = AuthenticateDefinition.safeParse(body);
|
|
14
|
+
if (!parsed.success) {
|
|
15
|
+
return NextResponse.json({
|
|
16
|
+
ok: false,
|
|
17
|
+
message: parsed.error.issues[0].message,
|
|
18
|
+
}, { status: 400 });
|
|
19
|
+
}
|
|
20
|
+
const recaptcha = request.headers.get(RECAPTCHA_HEADER_KEY);
|
|
21
|
+
const domain = request.headers.get(DOMAIN_HEADER_KEY);
|
|
22
|
+
try {
|
|
23
|
+
const res = await authenticate(parsed.data, {
|
|
24
|
+
headers: {
|
|
25
|
+
...(recaptcha && {
|
|
26
|
+
[RECAPTCHA_HEADER_KEY]: recaptcha,
|
|
27
|
+
}),
|
|
28
|
+
...(domain && {
|
|
29
|
+
[DOMAIN_HEADER_KEY]: domain,
|
|
30
|
+
}),
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
const response = NextResponse.json({ ok: true }, { status: 201 });
|
|
34
|
+
response.cookies.set(ACCESS_TOKEN_COOKIE_NAME, res.accessToken, {
|
|
35
|
+
expires: addMinutes(new Date(), 9),
|
|
36
|
+
httpOnly: true,
|
|
37
|
+
});
|
|
38
|
+
response.cookies.set(REFRESH_TOKEN_COOKIE_NAME, res.refreshToken, {
|
|
39
|
+
expires: subMinutes(addDays(new Date(), 30), 1),
|
|
40
|
+
httpOnly: true,
|
|
41
|
+
});
|
|
42
|
+
return response;
|
|
43
|
+
}
|
|
44
|
+
catch (e) {
|
|
45
|
+
return NextResponse.json({
|
|
46
|
+
ok: false,
|
|
47
|
+
message: 'Unauthorized',
|
|
48
|
+
__error: e,
|
|
49
|
+
}, { status: 401 });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { NextRequest } from 'next/server';
|
|
2
|
+
import { NextResponse } from 'next/server';
|
|
3
|
+
export declare function postSession(request: NextRequest): Promise<NextResponse<{
|
|
4
|
+
ok: true;
|
|
5
|
+
data?: never;
|
|
6
|
+
} | {
|
|
7
|
+
ok: false;
|
|
8
|
+
message: string;
|
|
9
|
+
__error?: unknown;
|
|
10
|
+
}> | NextResponse<{
|
|
11
|
+
ok: false;
|
|
12
|
+
message: string;
|
|
13
|
+
__error?: unknown;
|
|
14
|
+
} | {
|
|
15
|
+
ok: true;
|
|
16
|
+
data: import("../types").SecurityQuestionAuthenticator | null;
|
|
17
|
+
}>>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { addDays, addMinutes, subMinutes } from 'date-fns';
|
|
2
|
+
import { NextResponse } from 'next/server';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { ACCESS_TOKEN_COOKIE_NAME, DOMAIN_HEADER_KEY, RECAPTCHA_HEADER_KEY, REFRESH_TOKEN_COOKIE_NAME, } from '../constants/index.js';
|
|
5
|
+
import { createSession } from '../services/auth.js';
|
|
6
|
+
const CreateSessionDefinition = z.union([
|
|
7
|
+
z.object({
|
|
8
|
+
type: z.literal('NAME_AND_PASSWORD'),
|
|
9
|
+
name: z.string(),
|
|
10
|
+
password: z.string(),
|
|
11
|
+
}),
|
|
12
|
+
z.object({
|
|
13
|
+
type: z.literal('MOBILE_NUMBER'),
|
|
14
|
+
mobileNumber: z.string(),
|
|
15
|
+
verificationCode: z.string(),
|
|
16
|
+
}),
|
|
17
|
+
z.object({
|
|
18
|
+
type: z.literal('MAYA'),
|
|
19
|
+
session: z.string(),
|
|
20
|
+
}),
|
|
21
|
+
z.object({
|
|
22
|
+
type: z.union([
|
|
23
|
+
z.literal('SOCIALS'),
|
|
24
|
+
z.literal('CABINET'),
|
|
25
|
+
z.literal('SINGLE_USE_TOKEN'),
|
|
26
|
+
]),
|
|
27
|
+
token: z.string(),
|
|
28
|
+
}),
|
|
29
|
+
]);
|
|
30
|
+
export async function postSession(request) {
|
|
31
|
+
const body = await request.json();
|
|
32
|
+
const parsed = CreateSessionDefinition.safeParse(body);
|
|
33
|
+
if (!parsed.success) {
|
|
34
|
+
return NextResponse.json({
|
|
35
|
+
ok: false,
|
|
36
|
+
message: parsed.error.issues[0].message,
|
|
37
|
+
}, { status: 400 });
|
|
38
|
+
}
|
|
39
|
+
const recaptcha = request.headers.get(RECAPTCHA_HEADER_KEY);
|
|
40
|
+
const domain = request.headers.get(DOMAIN_HEADER_KEY);
|
|
41
|
+
try {
|
|
42
|
+
const res = await createSession(parsed.data, {
|
|
43
|
+
headers: {
|
|
44
|
+
...(recaptcha && {
|
|
45
|
+
[RECAPTCHA_HEADER_KEY]: recaptcha,
|
|
46
|
+
}),
|
|
47
|
+
...(domain && {
|
|
48
|
+
[DOMAIN_HEADER_KEY]: domain,
|
|
49
|
+
}),
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
if (res.authenticator) {
|
|
53
|
+
return NextResponse.json({
|
|
54
|
+
ok: true,
|
|
55
|
+
data: res.authenticator,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
const response = NextResponse.json({ ok: true, data: null }, { status: 201 });
|
|
59
|
+
response.cookies.set(ACCESS_TOKEN_COOKIE_NAME, res.accessToken, {
|
|
60
|
+
expires: addMinutes(new Date(), 9),
|
|
61
|
+
httpOnly: true,
|
|
62
|
+
sameSite: 'strict',
|
|
63
|
+
});
|
|
64
|
+
response.cookies.set(REFRESH_TOKEN_COOKIE_NAME, res.refreshToken, {
|
|
65
|
+
expires: subMinutes(addDays(new Date(), 30), 1),
|
|
66
|
+
httpOnly: true,
|
|
67
|
+
sameSite: 'strict',
|
|
68
|
+
});
|
|
69
|
+
return response;
|
|
70
|
+
}
|
|
71
|
+
catch (e) {
|
|
72
|
+
return NextResponse.json({
|
|
73
|
+
ok: false,
|
|
74
|
+
message: 'Unauthorized',
|
|
75
|
+
__error: e,
|
|
76
|
+
}, { status: 401 });
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
}
|
package/dist/services/file.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface FileQueryVariables {
|
|
|
7
7
|
id: string;
|
|
8
8
|
}
|
|
9
9
|
export declare const getFile: (id: string, options?: GraphQLRequestOptions) => Promise<File | null>;
|
|
10
|
-
export type
|
|
10
|
+
export type UploadFileError = {
|
|
11
11
|
name: 'FileFormatNotSupportedError';
|
|
12
12
|
message: string;
|
|
13
13
|
} | {
|
|
@@ -17,17 +17,22 @@ export type UploadPrivateImageFileError = {
|
|
|
17
17
|
name: 'FileSizeTooBigError';
|
|
18
18
|
message: string;
|
|
19
19
|
};
|
|
20
|
-
export interface
|
|
21
|
-
uploadPrivateImageFile?: null | UploadPrivateImageFileError;
|
|
22
|
-
}
|
|
23
|
-
export interface UploadPrivateImageFileMutationVariables {
|
|
24
|
-
input: {
|
|
25
|
-
id: string;
|
|
26
|
-
file: globalThis.File;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
export interface UploadPrivateImageFileInput {
|
|
20
|
+
export interface UploadFileInput {
|
|
30
21
|
id: string;
|
|
31
22
|
file: globalThis.File;
|
|
32
23
|
}
|
|
33
|
-
export
|
|
24
|
+
export interface UploadFileMutationVariables {
|
|
25
|
+
input: UploadFileInput;
|
|
26
|
+
}
|
|
27
|
+
export interface UploadFileMutation {
|
|
28
|
+
uploadFile?: null | UploadFileError;
|
|
29
|
+
}
|
|
30
|
+
export declare const uploadFile: (input: UploadFileInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
31
|
+
export interface UploadImageFileMutation {
|
|
32
|
+
uploadImageFile?: null | UploadFileError;
|
|
33
|
+
}
|
|
34
|
+
export declare const uploadImageFile: (input: UploadFileInput, options?: GraphQLRequestOptions) => Promise<void>;
|
|
35
|
+
export interface UploadPrivateImageFileMutation {
|
|
36
|
+
uploadPrivateImageFile?: null | UploadFileError;
|
|
37
|
+
}
|
|
38
|
+
export declare const uploadPrivateImageFile: (input: UploadFileInput, options?: GraphQLRequestOptions) => Promise<void>;
|
package/dist/services/file.js
CHANGED
|
@@ -1,11 +1,31 @@
|
|
|
1
1
|
import { cache } from 'react';
|
|
2
2
|
import { FILE_GRAPHQL_ENDPOINT } from '../constants/index.js';
|
|
3
3
|
import { graphqlRequest, graphqlUpload, } from './graphqlRequest.js';
|
|
4
|
-
import { FILE, UPLOAD_PRIVATE_IMAGE_FILE } from './queries.js';
|
|
4
|
+
import { FILE, UPLOAD_FILE, UPLOAD_IMAGE_FILE, UPLOAD_PRIVATE_IMAGE_FILE, } from './queries.js';
|
|
5
5
|
export const getFile = cache(async (id, options) => {
|
|
6
6
|
const res = await graphqlRequest(FILE_GRAPHQL_ENDPOINT, FILE, { id }, options);
|
|
7
7
|
return res.node ?? null;
|
|
8
8
|
});
|
|
9
|
+
export const uploadFile = async (input, options) => {
|
|
10
|
+
const res = await graphqlUpload(FILE_GRAPHQL_ENDPOINT, UPLOAD_FILE, { input }, options);
|
|
11
|
+
if (res.uploadFile) {
|
|
12
|
+
const error = new Error();
|
|
13
|
+
error.name = res.uploadFile.name;
|
|
14
|
+
error.message = ERROR_CODES_MESSAGE_MAP[res.uploadFile.name];
|
|
15
|
+
Error.captureStackTrace?.(error, uploadFile);
|
|
16
|
+
throw error;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
export const uploadImageFile = async (input, options) => {
|
|
20
|
+
const res = await graphqlUpload(FILE_GRAPHQL_ENDPOINT, UPLOAD_IMAGE_FILE, { input }, options);
|
|
21
|
+
if (res.uploadImageFile) {
|
|
22
|
+
const error = new Error();
|
|
23
|
+
error.name = res.uploadImageFile.name;
|
|
24
|
+
error.message = ERROR_CODES_MESSAGE_MAP[res.uploadImageFile.name];
|
|
25
|
+
Error.captureStackTrace?.(error, uploadImageFile);
|
|
26
|
+
throw error;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
9
29
|
export const uploadPrivateImageFile = async (input, options) => {
|
|
10
30
|
const res = await graphqlUpload(FILE_GRAPHQL_ENDPOINT, UPLOAD_PRIVATE_IMAGE_FILE, { input }, options);
|
|
11
31
|
if (res.uploadPrivateImageFile) {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export declare const FILE_FRAGMENT = "\n fragment FileFragment on File {\n id\n url\n status\n }\n";
|
|
2
2
|
export declare const FILE = "\n \n fragment FileFragment on File {\n id\n url\n status\n }\n\n\n query File($id: ObjectId!) {\n node(id: $id) {\n ... on File {\n ...FileFragment\n }\n }\n }\n";
|
|
3
|
+
export declare const UPLOAD_FILE = "\n mutation UploadFile($input: UploadFileInput!) {\n uploadFile(input: $input) {\n ... on FileFormatNotSupportedError {\n name: __typename\n message\n }\n ... on FileNameTooLongError {\n name: __typename\n message\n }\n ... on FileSizeTooBigError {\n name: __typename\n message\n }\n }\n }\n";
|
|
4
|
+
export declare const UPLOAD_IMAGE_FILE = "\n mutation UploadImageFile($input: UploadFileInput!) {\n uploadImageFile(input: $input) {\n ... on FileFormatNotSupportedError {\n name: __typename\n message\n }\n ... on FileNameTooLongError {\n name: __typename\n message\n }\n ... on FileSizeTooBigError {\n name: __typename\n message\n }\n }\n }\n";
|
|
3
5
|
export declare const UPLOAD_PRIVATE_IMAGE_FILE = "\n mutation UploadPrivateImageFile($input: UploadFileInput!) {\n uploadPrivateImageFile(input: $input) {\n ... on FileFormatNotSupportedError {\n name: __typename\n message\n }\n ... on FileNameTooLongError {\n name: __typename\n message\n }\n ... on FileSizeTooBigError {\n name: __typename\n message\n }\n }\n }\n";
|
|
4
6
|
export declare const WALLET = "\n query Wallet {\n wallet {\n balance\n }\n }\n";
|
|
5
7
|
export declare const POINTS_WALLET = "\n query PointsWallet {\n pointsWallet {\n id\n points\n account\n dateTimeCreated\n }\n }\n";
|
|
@@ -35,7 +37,7 @@ export declare const CREATE_AIO_QRPH_DEPOSIT = "\n mutation CreateAIOQRPHDeposi
|
|
|
35
37
|
export declare const CREATE_AIO_ONLINE_BANK_DEPOSIT = "\n mutation CreateAIOOnlineBankDeposit(\n $input: CreateAIOOnlineBankDepositInput!\n ) {\n createAIOOnlineBankDeposit(input: $input) {\n ... on DepositPromoMaximumAmountExceededError {\n name: __typename\n message\n }\n ... on DepositPromoMinimumAmountNotMetError {\n name: __typename\n message\n }\n ... on MaximumDepositAmountExceededError {\n name: __typename\n message\n }\n ... on MinimumDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on MinimumFirstDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on PromoNotEnabledError {\n name: __typename\n message\n }\n ... on WalletDoesNotExistError {\n name: __typename\n message\n }\n }\n }\n";
|
|
36
38
|
export declare const CREATE_MANUAL_BANK_DEPOSIT = "\n mutation CreateManualBankDeposit($input: CreateManualBankDepositInput!) {\n createManualBankDeposit(input: $input) {\n ... on WalletDoesNotExistError {\n name: __typename\n message\n }\n ... on MinimumFirstDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on MinimumDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on PromoNotEnabledError {\n name: __typename\n message\n }\n ... on DepositPromoMinimumAmountNotMetError {\n name: __typename\n message\n }\n ... on DepositPromoMaximumAmountExceededError {\n name: __typename\n message\n }\n ... on MaximumDepositAmountExceededError {\n name: __typename\n message\n }\n ... on FileDoesNotExistError {\n name: __typename\n message\n }\n ... on FileNotReadyError {\n name: __typename\n message\n }\n }\n }\n";
|
|
37
39
|
export declare const CREATE_MANUAL_UPI_DEPOSIT = "\n mutation CreateManualUPIDeposit($input: CreateManualUPIDepositInput!) {\n createManualUPIDeposit(input: $input) {\n ... on DepositPromoMaximumAmountExceededError {\n name: __typename\n message\n }\n ... on DepositPromoMinimumAmountNotMetError {\n name: __typename\n message\n }\n ... on MaximumDepositAmountExceededError {\n name: __typename\n message\n }\n ... on MinimumDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on MinimumFirstDepositAmountNotMetError {\n name: __typename\n message\n }\n ... on PromoNotEnabledError {\n name: __typename\n message\n }\n ... on WalletDoesNotExistError {\n name: __typename\n message\n }\n ... on UPIReferenceNotAvailableError {\n name: __typename\n message\n }\n }\n }\n";
|
|
38
|
-
export declare const DEPOSIT = "\n query Deposit($id: ObjectId!) {\n node(id: $id) {\n ... on GCashDeposit {\n id\n type\n status\n checkoutUrl\n error\n }\n ... on MayaDeposit {\n id\n type\n status\n checkoutUrl\n }\n ... on MayaAppDeposit {\n id\n type\n status\n error\n }\n ... on BankDeposit {\n id\n type\n status\n error\n }\n ... on ManualDeposit {\n id\n type\n status\n error\n }\n ... on QRPHDeposit {\n id\n type\n status\n qrCode\n error\n }\n ... on OnlineBankDeposit {\n id\n type\n status\n vca\n error\n }\n ... on GCashDirectWebpayDeposit {\n id\n type\n status\n checkoutUrl\n error\n }\n ... on
|
|
40
|
+
export declare const DEPOSIT = "\n query Deposit($id: ObjectId!) {\n node(id: $id) {\n ... on GCashDeposit {\n id\n type\n status\n checkoutUrl\n error\n }\n ... on MayaDeposit {\n id\n type\n status\n checkoutUrl\n }\n ... on MayaAppDeposit {\n id\n type\n status\n error\n }\n ... on BankDeposit {\n id\n type\n status\n error\n }\n ... on ManualDeposit {\n id\n type\n status\n error\n }\n ... on QRPHDeposit {\n id\n type\n status\n qrCode\n error\n }\n ... on OnlineBankDeposit {\n id\n type\n status\n vca\n error\n }\n ... on GCashDirectWebpayDeposit {\n id\n type\n status\n checkoutUrl\n error\n }\n ... on LibanganPayInDeposit {\n id\n type\n status\n checkoutUrl\n error\n }\n ... on PisoPayCheckoutDeposit {\n id\n type\n status\n checkoutUrl\n error\n }\n }\n }\n";
|
|
39
41
|
export declare const DEPOSITS_COUNT = "\n query DepositsCount {\n member {\n depositsCount\n }\n }\n";
|
|
40
42
|
export declare const TOUCH_GCASH_DEPOSIT = "\n mutation TouchGCashDeposit($input: TouchGCashDepositInput!) {\n touchGCashDeposit(input: $input)\n }\n";
|
|
41
43
|
export declare const TOUCH_QRPH_DEPOSIT = "\n mutation TouchQRPHDeposit($input: TouchQRPHDepositInput!) {\n touchQRPHDeposit(input: $input)\n }\n";
|