@opexa/portal-components 0.0.85 → 0.0.87
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/useCreateGCashDepositMutation.js +2 -1
- package/dist/client/hooks/useCreateGCashWithdrawalMutation.js +2 -1
- package/dist/client/hooks/useCreateGameSessionMutation.js +2 -1
- package/dist/client/hooks/useCreateInstapayWithdrawalMutation.js +2 -1
- package/dist/client/hooks/useCreateMayaAppDepositMutation.js +2 -1
- package/dist/client/hooks/useCreateMayaAppWithdrawalMutation.js +2 -1
- package/dist/client/hooks/useCreateMayaDepositMutation.js +2 -1
- package/dist/client/hooks/useCreateMayaWithdrawalMutation.js +2 -1
- package/dist/client/hooks/useCreateOnlineBankDepositMutation.js +2 -1
- package/dist/client/hooks/useCreateQRPHDepositMutation.js +2 -1
- package/dist/components/Account/Account.d.ts +0 -2
- package/dist/components/Account/Account.js +10 -8
- package/dist/components/Account/AccountTrigger.d.ts +1 -2
- package/dist/components/Account/AccountTrigger.js +18 -6
- package/dist/components/Bonuses/BonusesTrigger.d.ts +1 -1
- package/dist/components/Bonuses/BonusesTrigger.js +3 -3
- package/dist/components/DepositWithdrawal/DepositWithdrawal.d.ts +1 -6
- package/dist/components/DepositWithdrawal/DepositWithdrawal.js +8 -19
- package/dist/components/DepositWithdrawal/DepositWithdrawalTrigger.d.ts +1 -1
- package/dist/components/DepositWithdrawal/DepositWithdrawalTrigger.js +12 -4
- package/dist/components/Jackpots/Jackpots.d.ts +3 -9
- package/dist/components/Jackpots/Jackpots.js +8 -2
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarousel.d.ts +20 -0
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarousel.js +64 -0
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselContext.d.ts +2 -0
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselContext.js +2 -0
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.d.ts +9 -0
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.js +107 -0
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -0
- package/dist/components/Jackpots/JackpotsList/JackpotsList.d.ts +11 -0
- package/dist/components/Jackpots/JackpotsList/JackpotsList.js +29 -0
- package/dist/components/Jackpots/JackpotsList/JackpotsListContext.d.ts +4 -0
- package/dist/components/Jackpots/JackpotsList/JackpotsListContext.js +3 -0
- package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -0
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.d.ts +1 -0
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemDesktop.js +44 -0
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemGameProviders.d.ts +5 -0
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemGameProviders.js +40 -0
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.d.ts +1 -0
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemMobile.js +45 -0
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemRules.d.ts +2 -0
- package/dist/components/Jackpots/JackpotsList/JackpotsListItemRules.js +10 -0
- package/dist/components/Jackpots/JackpotsList/useJackpotsListItemData.d.ts +14 -0
- package/dist/components/Jackpots/JackpotsList/useJackpotsListItemData.js +92 -0
- package/dist/components/Messages/Message.d.ts +1 -4
- package/dist/components/Messages/Message.js +8 -9
- package/dist/components/Messages/MessageContext.d.ts +2 -0
- package/dist/components/Messages/MessageContext.js +2 -0
- package/dist/components/Messages/Messages.d.ts +0 -1
- package/dist/components/Messages/Messages.js +9 -8
- package/dist/components/Messages/MessagesTrigger.d.ts +1 -1
- package/dist/components/Messages/MessagesTrigger.js +8 -4
- package/dist/components/PortalProvider/Providers.js +1 -5
- package/dist/components/SignUp/SignUpForm.js +2 -1
- package/dist/components/Tournaments/Tournaments.d.ts +3 -7
- package/dist/components/Tournaments/Tournaments.js +8 -2
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarousel.d.ts +9 -0
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarousel.js +51 -0
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselContext.d.ts +2 -0
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselContext.js +2 -0
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.d.ts +6 -0
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.js +107 -0
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -0
- package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -0
- package/dist/components/Tournaments/TournamentsList/TournamentsList.d.ts +9 -0
- package/dist/components/Tournaments/TournamentsList/TournamentsList.js +20 -0
- package/dist/components/Tournaments/TournamentsList/TournamentsListContext.d.ts +4 -0
- package/dist/components/Tournaments/TournamentsList/TournamentsListContext.js +3 -0
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemDesktop.d.ts +1 -0
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemDesktop.js +55 -0
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemGameProviders.d.ts +5 -0
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemGameProviders.js +37 -0
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemMobile.d.ts +1 -0
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemMobile.js +55 -0
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemRules.d.ts +2 -0
- package/dist/components/Tournaments/TournamentsList/TournamentsListItemRules.js +9 -0
- package/dist/components/Tournaments/TournamentsList/useTournamentListItemData.d.ts +10 -0
- package/dist/components/Tournaments/TournamentsList/useTournamentListItemData.js +71 -0
- package/dist/components/index.d.ts +0 -2
- package/dist/components/index.js +0 -2
- package/dist/handlers.js +1 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +1 -0
- package/dist/services/ObjectId.d.ts +0 -14
- package/dist/services/ObjectId.js +62 -76
- package/dist/services/ObjectType.d.ts +10 -0
- package/dist/services/ObjectType.js +10 -0
- package/dist/services/index.d.ts +4 -3
- package/dist/services/index.js +4 -3
- package/dist/styles/theme.css +2 -2
- package/dist/ui/AlertDialog/AlertDialog.d.ts +89 -89
- package/dist/ui/AlertDialog/AlertDialog.js +2 -1
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +8 -8
- package/dist/ui/AlertDialog/alertDialog.recipe.js +1 -1
- package/dist/ui/Avatar/Avatar.d.ts +1 -1
- package/dist/ui/Avatar/Avatar.js +1 -1
- package/dist/ui/Avatar/avatar.recipe.js +1 -1
- package/dist/ui/Badge/Badge.js +1 -1
- package/dist/ui/Button/Button.js +1 -1
- package/dist/ui/Checkbox/Checkbox.d.ts +24 -24
- package/dist/ui/Checkbox/Checkbox.js +1 -1
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Checkbox/checkbox.recipe.js +1 -1
- package/dist/ui/Clipboard/Clipboard.d.ts +19 -19
- package/dist/ui/Clipboard/Clipboard.js +1 -1
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/clipboard.recipe.js +1 -1
- package/dist/ui/Collapsible/Collapsible.d.ts +21 -21
- package/dist/ui/Collapsible/Collapsible.js +1 -1
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
- package/dist/ui/Collapsible/collapsible.recipe.js +1 -1
- package/dist/ui/Combobox/Combobox.d.ts +43 -43
- package/dist/ui/Combobox/Combobox.js +1 -1
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/Combobox/combobox.recipe.js +1 -1
- package/dist/ui/DatePicker/DatePicker.d.ts +265 -265
- package/dist/ui/DatePicker/DatePicker.js +1 -1
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +11 -11
- package/dist/ui/DatePicker/datePicker.recipe.js +1 -1
- package/dist/ui/Dialog/Dialog.d.ts +89 -89
- package/dist/ui/Dialog/Dialog.js +2 -1
- package/dist/ui/Dialog/dialog.recipe.d.ts +8 -8
- package/dist/ui/Dialog/dialog.recipe.js +1 -1
- package/dist/ui/Drawer/Drawer.d.ts +34 -34
- package/dist/ui/Drawer/Drawer.js +2 -1
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Drawer/drawer.recipe.js +1 -1
- package/dist/ui/Field/Field.d.ts +1 -1
- package/dist/ui/Field/Field.js +1 -1
- package/dist/ui/Field/field.recipe.js +1 -1
- package/dist/ui/IconButton/IconButton.js +1 -1
- package/dist/ui/NumberInput/NumberInput.d.ts +1 -1
- package/dist/ui/NumberInput/NumberInput.js +1 -1
- package/dist/ui/NumberInput/numberInput.recipe.js +1 -1
- package/dist/ui/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/ui/PasswordInput/PasswordInput.js +1 -1
- package/dist/ui/PasswordInput/passwordInput.recipe.js +1 -1
- package/dist/ui/PinInput/PinInput.d.ts +1 -1
- package/dist/ui/PinInput/PinInput.js +1 -1
- package/dist/ui/PinInput/pinInput.recipe.js +1 -1
- package/dist/ui/Popover/Popover.d.ts +56 -56
- package/dist/ui/Popover/Popover.js +1 -1
- package/dist/ui/Popover/popover.recipe.d.ts +5 -5
- package/dist/ui/Popover/popover.recipe.js +1 -1
- package/dist/ui/Progress/Progress.d.ts +1 -1
- package/dist/ui/Progress/Progress.js +1 -1
- package/dist/ui/Progress/progress.recipe.js +1 -1
- package/dist/ui/SegmentGroup/SegmentGroup.d.ts +1 -1
- package/dist/ui/SegmentGroup/SegmentGroup.js +1 -1
- package/dist/ui/SegmentGroup/segmentGroup.recipe.js +1 -1
- package/dist/ui/Select/Select.d.ts +46 -46
- package/dist/ui/Select/Select.js +1 -1
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Select/select.recipe.js +1 -1
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/Table.js +1 -1
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/dist/ui/Tabs/Tabs.d.ts +16 -16
- package/dist/ui/Tabs/Tabs.js +1 -1
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/dist/ui/Tabs/tabs.recipe.js +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/isStyleEntries.d.ts +2 -0
- package/dist/utils/isStyleEntries.js +5 -0
- package/package.json +27 -30
- package/dist/utils/graphqlRequest.d.ts +0 -4
- package/dist/utils/graphqlRequest.js +0 -255
- package/dist/utils/httpRequest.d.ts +0 -6
- package/dist/utils/httpRequest.js +0 -87
- package/dist/utils/sha256.d.ts +0 -4
- package/dist/utils/sha256.js +0 -16
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { pick } from 'lodash-es';
|
|
2
|
+
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import { useLocaleInfo } from '../../../client/hooks/index.js';
|
|
4
|
+
import { GAME_PROVIDER_DATA } from '../../../constants/index.js';
|
|
5
|
+
import { useTournamentsListItemContext, useTournamentsListPropsContext, } from './TournamentsListContext.js';
|
|
6
|
+
export function useTournamentsListItemData() {
|
|
7
|
+
const tournamentsListProps = useTournamentsListPropsContext();
|
|
8
|
+
const tournament = useTournamentsListItemContext();
|
|
9
|
+
const gameProviders = tournamentsListProps.gameProviders.map((provider) => GAME_PROVIDER_DATA[provider]);
|
|
10
|
+
const localeInfo = useLocaleInfo();
|
|
11
|
+
const [timeRemaining, setTimeRemaining] = useState({
|
|
12
|
+
days: 0,
|
|
13
|
+
hours: 0,
|
|
14
|
+
minutes: 0,
|
|
15
|
+
seconds: 0,
|
|
16
|
+
isPast: false,
|
|
17
|
+
});
|
|
18
|
+
const activationEndDateTime = useMemo(() => new Date(tournament.activationEndDateTime), [tournament.activationEndDateTime]);
|
|
19
|
+
const calculateRemainingTime = useCallback(() => {
|
|
20
|
+
const now = new Date();
|
|
21
|
+
const diffMs = activationEndDateTime.getTime() - now.getTime();
|
|
22
|
+
if (diffMs <= 0) {
|
|
23
|
+
setTimeRemaining({
|
|
24
|
+
days: 0,
|
|
25
|
+
hours: 0,
|
|
26
|
+
minutes: 0,
|
|
27
|
+
seconds: 0,
|
|
28
|
+
isPast: true,
|
|
29
|
+
});
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const diffSeconds = Math.floor(diffMs / 1000);
|
|
33
|
+
const days = Math.floor(diffSeconds / (3600 * 24));
|
|
34
|
+
const hours = Math.floor((diffSeconds % (3600 * 24)) / 3600);
|
|
35
|
+
const minutes = Math.floor((diffSeconds % 3600) / 60);
|
|
36
|
+
const seconds = diffSeconds % 60;
|
|
37
|
+
const updated = pick({ days, hours, minutes, seconds, isPast: false }, [
|
|
38
|
+
'days',
|
|
39
|
+
'hours',
|
|
40
|
+
'minutes',
|
|
41
|
+
'seconds',
|
|
42
|
+
'isPast',
|
|
43
|
+
]);
|
|
44
|
+
setTimeRemaining(updated);
|
|
45
|
+
}, [activationEndDateTime]);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
calculateRemainingTime();
|
|
48
|
+
const interval = setInterval(calculateRemainingTime, 1000); // Update every second
|
|
49
|
+
return () => clearInterval(interval);
|
|
50
|
+
}, [activationEndDateTime, calculateRemainingTime]);
|
|
51
|
+
const timeParts = [
|
|
52
|
+
{ label: 'Day', value: timeRemaining.days },
|
|
53
|
+
{ label: 'Hour', value: timeRemaining.hours },
|
|
54
|
+
{ label: 'Min', value: timeRemaining.minutes },
|
|
55
|
+
{ label: 'Sec', value: timeRemaining.seconds },
|
|
56
|
+
];
|
|
57
|
+
const tournamentReward = Object.values(tournament.rewardSettings)
|
|
58
|
+
.map(Number)
|
|
59
|
+
.reduce((sum, val) => sum + val, 0);
|
|
60
|
+
const prizeAmountsByRank = Object.values(tournament.rewardSettings).map(Number);
|
|
61
|
+
const filteredGameProviders = gameProviders.filter((provider) => {
|
|
62
|
+
return tournament.enabledGameProviders.includes(provider.id);
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
timeParts,
|
|
66
|
+
tournamentReward,
|
|
67
|
+
prizeAmountsByRank,
|
|
68
|
+
filteredGameProviders,
|
|
69
|
+
localeInfo,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
@@ -14,7 +14,6 @@ export * from './GameLaunch';
|
|
|
14
14
|
export * from './GameProviders';
|
|
15
15
|
export * from './Games';
|
|
16
16
|
export * from './GamesSearch';
|
|
17
|
-
export * from './JackpotCounter';
|
|
18
17
|
export * from './Jackpots';
|
|
19
18
|
export * from './KYC';
|
|
20
19
|
export * from './Marquee';
|
|
@@ -28,6 +27,5 @@ export * from './Search';
|
|
|
28
27
|
export * from './SignIn';
|
|
29
28
|
export * from './SignUp';
|
|
30
29
|
export * from './TopWins';
|
|
31
|
-
export * from './TournamentCounter';
|
|
32
30
|
export * from './Tournaments';
|
|
33
31
|
export * from './TransactionRecords';
|
package/dist/components/index.js
CHANGED
|
@@ -14,7 +14,6 @@ export * from './GameLaunch/index.js';
|
|
|
14
14
|
export * from './GameProviders/index.js';
|
|
15
15
|
export * from './Games/index.js';
|
|
16
16
|
export * from './GamesSearch/index.js';
|
|
17
|
-
export * from './JackpotCounter/index.js';
|
|
18
17
|
export * from './Jackpots/index.js';
|
|
19
18
|
export * from './KYC/index.js';
|
|
20
19
|
export * from './Marquee/index.js';
|
|
@@ -28,6 +27,5 @@ export * from './Search/index.js';
|
|
|
28
27
|
export * from './SignIn/index.js';
|
|
29
28
|
export * from './SignUp/index.js';
|
|
30
29
|
export * from './TopWins/index.js';
|
|
31
|
-
export * from './TournamentCounter/index.js';
|
|
32
30
|
export * from './Tournaments/index.js';
|
|
33
31
|
export * from './TransactionRecords/index.js';
|
package/dist/handlers.js
CHANGED
|
@@ -159,6 +159,7 @@ export const POST = async (request, { params }) => {
|
|
|
159
159
|
const body = await request.json();
|
|
160
160
|
const parsed = CreateSessionDefinition.safeParse(body);
|
|
161
161
|
const recaptcha = request.headers.get(RECAPTCHA_HEADER_KEY);
|
|
162
|
+
console.log(body);
|
|
162
163
|
if (!parsed.success) {
|
|
163
164
|
return NextResponse.json({
|
|
164
165
|
ok: false,
|
package/dist/icons/index.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export * from './File02Icon';
|
|
|
37
37
|
export * from './FileCheck02Icon';
|
|
38
38
|
export * from './FileSearch02Icon';
|
|
39
39
|
export * from './FileX02Icon';
|
|
40
|
+
export * from './Flag06Icon';
|
|
40
41
|
export * from './GamingPad01Icon';
|
|
41
42
|
export * from './Gift01Icon';
|
|
42
43
|
export * from './Globe05Icon';
|
package/dist/icons/index.js
CHANGED
|
@@ -37,6 +37,7 @@ export * from './File02Icon.js';
|
|
|
37
37
|
export * from './FileCheck02Icon.js';
|
|
38
38
|
export * from './FileSearch02Icon.js';
|
|
39
39
|
export * from './FileX02Icon.js';
|
|
40
|
+
export * from './Flag06Icon.js';
|
|
40
41
|
export * from './GamingPad01Icon.js';
|
|
41
42
|
export * from './Gift01Icon.js';
|
|
42
43
|
export * from './Globe05Icon.js';
|
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
export declare class ObjectId {
|
|
2
|
-
private _buffer;
|
|
3
|
-
constructor(buffer: Buffer);
|
|
4
|
-
static translate(id: ObjectId, type: number): ObjectId;
|
|
5
|
-
static generate(type?: number): ObjectId;
|
|
6
|
-
static generateFromKey(type: number, key: string): Promise<ObjectId>;
|
|
7
|
-
static from(value: string | Buffer): ObjectId;
|
|
8
|
-
get type(): number;
|
|
9
|
-
get buffer(): Buffer<ArrayBufferLike>;
|
|
10
|
-
compare(other: ObjectId): 0 | 1 | -1;
|
|
11
|
-
equals(other: ObjectId): boolean;
|
|
12
|
-
clone(): ObjectId;
|
|
13
|
-
toString(encoding?: 'bs58' | 'hex' | 'base64'): string;
|
|
14
|
-
}
|
|
15
1
|
export declare const ObjectType: {
|
|
16
2
|
MemberAccount: number;
|
|
17
3
|
MemberVerification: number;
|
|
@@ -1,79 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return this._buffer.equals(other._buffer);
|
|
64
|
-
}
|
|
65
|
-
clone() {
|
|
66
|
-
const buffer = Buffer.alloc(13);
|
|
67
|
-
this.buffer.copy(buffer);
|
|
68
|
-
return ObjectId.from(buffer);
|
|
69
|
-
}
|
|
70
|
-
toString(encoding) {
|
|
71
|
-
if (!encoding || encoding === 'bs58') {
|
|
72
|
-
return bs58.encode(this._buffer);
|
|
73
|
-
}
|
|
74
|
-
return this._buffer.toString(encoding);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
1
|
+
/* ref: https://github.com/HighOutputVentures/opexa/blob/main/packages/object-id/src/libs/object-id.ts */
|
|
2
|
+
// import bs58 from 'bs58';
|
|
3
|
+
// import { sha256 } from 'crypto-hash';
|
|
4
|
+
// import randomBytes from 'randombytes';
|
|
5
|
+
// const MACHINE_ID = randomBytes(5);
|
|
6
|
+
// let counter = randomBytes(4).readUInt32BE(0) & 0xffffff;
|
|
7
|
+
// export class ObjectId {
|
|
8
|
+
// constructor(private readonly _buffer: Buffer) {}
|
|
9
|
+
// /**
|
|
10
|
+
// * @param type The type of the object, e.g. `ObjectType.MemberAccount`
|
|
11
|
+
// * @example
|
|
12
|
+
// * ```ts
|
|
13
|
+
// * import { ObjectId, ObjectType } from '@opexa/portal-components';
|
|
14
|
+
// *
|
|
15
|
+
// * const id = ObjectId.generate(ObjectType.MemberAccount).toString();
|
|
16
|
+
// * ```
|
|
17
|
+
// */
|
|
18
|
+
// static generate(type: number) {
|
|
19
|
+
// const buffer = Buffer.alloc(13);
|
|
20
|
+
// const time = Math.floor(Date.now() / 1000) & 0xffffffff;
|
|
21
|
+
// counter = (counter + 1) & 0xffffff;
|
|
22
|
+
// buffer[0] = type & 0xff;
|
|
23
|
+
// buffer[1] = (time >> 24) & 0xff;
|
|
24
|
+
// buffer[2] = (time >> 16) & 0xff;
|
|
25
|
+
// buffer[3] = (time >> 8) & 0xff;
|
|
26
|
+
// buffer[4] = time & 0xff;
|
|
27
|
+
// buffer[5] = MACHINE_ID[0];
|
|
28
|
+
// buffer[6] = MACHINE_ID[1];
|
|
29
|
+
// buffer[7] = MACHINE_ID[2];
|
|
30
|
+
// buffer[8] = MACHINE_ID[3];
|
|
31
|
+
// buffer[9] = MACHINE_ID[4];
|
|
32
|
+
// buffer[10] = (counter >> 16) & 0xff;
|
|
33
|
+
// buffer[11] = (counter >> 8) & 0xff;
|
|
34
|
+
// buffer[12] = counter & 0xff;
|
|
35
|
+
// return new ObjectId(buffer);
|
|
36
|
+
// }
|
|
37
|
+
// /**
|
|
38
|
+
// *
|
|
39
|
+
// * @param type The type of the object, e.g. `ObjectType.Game`
|
|
40
|
+
// * @param key The key to generate the object ID from, e.g. `Game.id`
|
|
41
|
+
// * @example
|
|
42
|
+
// * ```ts
|
|
43
|
+
// * import { ObjectId, ObjectType } from '@opexa/portal-components';
|
|
44
|
+
// *
|
|
45
|
+
// * const id = (await ObjectId.generateFromKey(ObjectType.Game, gameId)).toString();
|
|
46
|
+
// * ```
|
|
47
|
+
// */
|
|
48
|
+
// static async generateFromKey(type: number, key: string) {
|
|
49
|
+
// const buffer = Buffer.alloc(13);
|
|
50
|
+
// buffer[0] = type & 0xff;
|
|
51
|
+
// Buffer.from(await sha256(key, { outputFormat: 'buffer' })).copy(
|
|
52
|
+
// <Uint8Array>buffer,
|
|
53
|
+
// 1,
|
|
54
|
+
// 0,
|
|
55
|
+
// 12,
|
|
56
|
+
// );
|
|
57
|
+
// return new ObjectId(buffer);
|
|
58
|
+
// }
|
|
59
|
+
// toString() {
|
|
60
|
+
// return bs58.encode(<Uint8Array>this._buffer);
|
|
61
|
+
// }
|
|
62
|
+
// }
|
|
77
63
|
export const ObjectType = {
|
|
78
64
|
MemberAccount: 8,
|
|
79
65
|
MemberVerification: 15,
|
package/dist/services/index.d.ts
CHANGED
|
@@ -3,10 +3,11 @@ export * from './auth.service';
|
|
|
3
3
|
export * from './cmsPortal.service';
|
|
4
4
|
export * from './file.service';
|
|
5
5
|
export * from './game.service';
|
|
6
|
-
export * from './graphqlRequest';
|
|
7
|
-
export * from './httpRequest';
|
|
8
6
|
export * from './portal.service';
|
|
9
7
|
export * from './report.service';
|
|
10
|
-
export * from './sha256';
|
|
11
8
|
export * from './trigger.service';
|
|
12
9
|
export * from './wallet.service';
|
|
10
|
+
export * from './graphqlRequest';
|
|
11
|
+
export * from './httpRequest';
|
|
12
|
+
export * from './ObjectType';
|
|
13
|
+
export * from './sha256';
|
package/dist/services/index.js
CHANGED
|
@@ -3,10 +3,11 @@ export * from './auth.service.js';
|
|
|
3
3
|
export * from './cmsPortal.service.js';
|
|
4
4
|
export * from './file.service.js';
|
|
5
5
|
export * from './game.service.js';
|
|
6
|
-
export * from './graphqlRequest.js';
|
|
7
|
-
export * from './httpRequest.js';
|
|
8
6
|
export * from './portal.service.js';
|
|
9
7
|
export * from './report.service.js';
|
|
10
|
-
export * from './sha256.js';
|
|
11
8
|
export * from './trigger.service.js';
|
|
12
9
|
export * from './wallet.service.js';
|
|
10
|
+
export * from './graphqlRequest.js';
|
|
11
|
+
export * from './httpRequest.js';
|
|
12
|
+
export * from './ObjectType.js';
|
|
13
|
+
export * from './sha256.js';
|
package/dist/styles/theme.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@plugin '@tailwindcss/typography';
|
|
2
|
-
@plugin '
|
|
2
|
+
@plugin 'tailwind-zag';
|
|
3
3
|
|
|
4
4
|
@layer base {
|
|
5
5
|
html {
|
|
@@ -694,4 +694,4 @@
|
|
|
694
694
|
@custom-variant scrollbar (&::-webkit-scrollbar);
|
|
695
695
|
@custom-variant scrollbar-thumb (&::-webkit-scrollbar-thumb);
|
|
696
696
|
@custom-variant scrollbar-track (&::-webkit-scrollbar-track);
|
|
697
|
-
@custom-variant dark (&:where(.dark, .dark *));
|
|
697
|
+
@custom-variant dark (&:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *));
|