gambling-bot-shared 0.1.53 → 1.0.0
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/README.MD +4 -0
- package/dist/{mongoose/atmRequest.schema.js → atm/atmRequest.mongoose.js} +4 -1
- package/dist/{types → atm}/index.js +5 -10
- package/dist/atm/schemas/atm.forms.js +11 -0
- package/dist/blackjack/index.js +21 -0
- package/dist/bonus/index.js +23 -0
- package/dist/bonus/schemas/bonus.forms.js +39 -0
- package/dist/{utils → bonus/utils}/bonusStreak.js +10 -1
- package/dist/{utils → bonus/utils}/calculateBonusReward.js +4 -3
- package/dist/casino/constants/casinoGames.js +5 -0
- package/dist/{constants → casino/constants}/index.js +4 -8
- package/dist/{constants → casino/constants}/plinkoConfig.js +1 -1
- package/dist/casino/index.js +30 -0
- package/dist/casino/schemas/casino.forms.js +80 -0
- package/dist/casino/services/casinoBet.service.js +146 -0
- package/dist/{utils → casino/utils}/calculateRTP.js +7 -4
- package/dist/{utils → common}/formatters.js +9 -2
- package/dist/{server.js → common/index.js} +4 -1
- package/dist/common/zod.js +16 -0
- package/dist/{mongoose/guildConfiguration.schema.js → guild/guildConfiguration.mongoose.js} +6 -5
- package/dist/guild/index.js +26 -0
- package/dist/guild/schemas/guild.forms.js +43 -0
- package/dist/guild/utils/normalizeGlobalSettings.js +46 -0
- package/dist/mongoose/index.js +17 -22
- package/dist/predictions/index.js +29 -0
- package/dist/{mongoose/prediction.schema.js → predictions/prediction.mongoose.js} +3 -2
- package/dist/predictions/schemas/prediction.forms.js +24 -0
- package/dist/predictions/services/normalizePredictionInput.js +53 -0
- package/dist/predictions/services/parsePredictionAutolock.js +20 -0
- package/dist/predictions/services/parsePredictionChoices.js +26 -0
- package/dist/predictions/services/prediction.db.js +72 -0
- package/dist/predictions/services/predictionLifecycle.service.js +133 -0
- package/dist/predictions/services/predictionSummary.js +58 -0
- package/dist/raffle/index.js +24 -0
- package/dist/raffle/schemas/raffle.forms.js +17 -0
- package/dist/raffle/services/raffle.db.js +153 -0
- package/dist/raffle/services/raffleLifecycle.service.js +34 -0
- package/dist/{schemas → transactions/constants}/index.js +2 -1
- package/dist/{index.js → transactions/index.js} +3 -2
- package/dist/transactions/types/transaction.js +2 -0
- package/dist/user/index.js +20 -0
- package/dist/user/types/user.js +2 -0
- package/dist/vip/index.js +21 -0
- package/dist/vip/schemas/vip.forms.js +16 -0
- package/dist/vip/types/vipRoom.js +2 -0
- package/package.json +67 -27
- package/dist/constants/blackjack.d.ts +0 -41
- package/dist/constants/bonusLimits.d.ts +0 -4
- package/dist/constants/commonTimezones.d.ts +0 -4
- package/dist/constants/defaultConfig.d.ts +0 -108
- package/dist/constants/defaultGlobalSettings.d.ts +0 -20
- package/dist/constants/gameRecordFields.d.ts +0 -8
- package/dist/constants/index.d.ts +0 -11
- package/dist/constants/lotteryConfig.d.ts +0 -2
- package/dist/constants/maxSimulations.d.ts +0 -5
- package/dist/constants/plinkoConfig.d.ts +0 -15
- package/dist/constants/rouletteConfig.d.ts +0 -1
- package/dist/constants/transaction.d.ts +0 -2
- package/dist/index.d.ts +0 -3
- package/dist/mongoose/atmRequest.schema.d.ts +0 -139
- package/dist/mongoose/blackjackGame.schema.d.ts +0 -139
- package/dist/mongoose/guildConfiguration.schema.d.ts +0 -237
- package/dist/mongoose/index.d.ts +0 -8
- package/dist/mongoose/prediction.schema.d.ts +0 -112
- package/dist/mongoose/raffle.schema.d.ts +0 -151
- package/dist/mongoose/transaction.schema.d.ts +0 -103
- package/dist/mongoose/user.schema.d.ts +0 -103
- package/dist/mongoose/vipRoom.schema.d.ts +0 -85
- package/dist/schemas/forms.d.ts +0 -183
- package/dist/schemas/forms.js +0 -173
- package/dist/schemas/index.d.ts +0 -1
- package/dist/server.d.ts +0 -1
- package/dist/types/atmRequest.d.ts +0 -15
- package/dist/types/blackjackGame.d.ts +0 -30
- package/dist/types/bonus.d.ts +0 -13
- package/dist/types/guildConfiguration.d.ts +0 -35
- package/dist/types/index.d.ts +0 -11
- package/dist/types/prediction.d.ts +0 -20
- package/dist/types/raffle.d.ts +0 -19
- package/dist/types/transaction.d.ts +0 -11
- package/dist/types/user.d.ts +0 -11
- package/dist/types/vipRoom.d.ts +0 -9
- package/dist/utils/bonusStreak.d.ts +0 -6
- package/dist/utils/calculateBonusReward.d.ts +0 -13
- package/dist/utils/calculateRTP.d.ts +0 -2
- package/dist/utils/formatters.d.ts +0 -13
- package/dist/utils/generateBonusPreview.d.ts +0 -11
- package/dist/utils/generateId.d.ts +0 -1
- package/dist/utils/globalSettings.d.ts +0 -6
- package/dist/utils/guildTimezone.d.ts +0 -6
- package/dist/utils/index.d.ts +0 -15
- package/dist/utils/index.js +0 -31
- package/dist/utils/normalizeBonusSettings.d.ts +0 -6
- package/dist/utils/normalizeCasinoSettings.d.ts +0 -2
- package/dist/utils/normalizeGlobalSettings.d.ts +0 -2
- package/dist/utils/normalizeGlobalSettings.js +0 -45
- package/dist/utils/parseTimeToSeconds.d.ts +0 -1
- package/dist/utils/validateBetAmount.d.ts +0 -8
- package/dist/utils/validatePredictionBet.d.ts +0 -13
- package/dist/utils/winAnnouncements.d.ts +0 -4
- /package/dist/{types → atm/types}/atmRequest.js +0 -0
- /package/dist/{constants → bonus/constants}/bonusLimits.js +0 -0
- /package/dist/{types → bonus/types}/bonus.js +0 -0
- /package/dist/{utils → bonus/utils}/generateBonusPreview.js +0 -0
- /package/dist/{utils → bonus/utils}/normalizeBonusSettings.js +0 -0
- /package/dist/{mongoose/blackjackGame.schema.js → casino/blackjackGame.mongoose.js} +0 -0
- /package/dist/{constants → casino/constants}/blackjack.js +0 -0
- /package/dist/{constants → casino/constants}/defaultConfig.js +0 -0
- /package/dist/{constants → casino/constants}/lotteryConfig.js +0 -0
- /package/dist/{constants → casino/constants}/maxSimulations.js +0 -0
- /package/dist/{constants → casino/constants}/rouletteConfig.js +0 -0
- /package/dist/{types → casino/types}/blackjackGame.js +0 -0
- /package/dist/{types/guildConfiguration.js → casino/types/casinoSettings.js} +0 -0
- /package/dist/{utils → casino/utils}/normalizeCasinoSettings.js +0 -0
- /package/dist/{utils → casino/utils}/validateBetAmount.js +0 -0
- /package/dist/{utils → casino/utils}/winAnnouncements.js +0 -0
- /package/dist/{utils → common}/generateId.js +0 -0
- /package/dist/{utils → common}/parseTimeToSeconds.js +0 -0
- /package/dist/{constants → guild/constants}/commonTimezones.js +0 -0
- /package/dist/{constants → guild/constants}/defaultGlobalSettings.js +0 -0
- /package/dist/{types/prediction.js → guild/types/guildConfiguration.js} +0 -0
- /package/dist/{utils → guild/utils}/globalSettings.js +0 -0
- /package/dist/{utils → guild/utils}/guildTimezone.js +0 -0
- /package/dist/{types/raffle.js → predictions/services/types.js} +0 -0
- /package/dist/{types/transaction.js → predictions/types/prediction.js} +0 -0
- /package/dist/{utils → predictions/utils}/validatePredictionBet.js +0 -0
- /package/dist/{mongoose/raffle.schema.js → raffle/raffle.mongoose.js} +0 -0
- /package/dist/{types/user.js → raffle/services/types.js} +0 -0
- /package/dist/{types/vipRoom.js → raffle/types/raffle.js} +0 -0
- /package/dist/{constants → transactions/constants}/gameRecordFields.js +0 -0
- /package/dist/{constants → transactions/constants}/transaction.js +0 -0
- /package/dist/{mongoose/transaction.schema.js → transactions/transaction.mongoose.js} +0 -0
- /package/dist/{mongoose/user.schema.js → user/user.mongoose.js} +0 -0
- /package/dist/{mongoose/vipRoom.schema.js → vip/vipRoom.mongoose.js} +0 -0
package/dist/schemas/forms.js
DELETED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.bonusFormSchema = exports.globalSettingsFormSchema = exports.managerRoleFormSchema = exports.vipSettingsFormSchema = exports.casinoSettingsSchema = exports.channelsFormSchema = exports.raffleChannelsFormSchema = exports.predictionChannelsFormSchema = exports.casinoChannelsFormSchema = exports.atmChannelsFormSchema = void 0;
|
|
7
|
-
const zod_1 = __importDefault(require("zod"));
|
|
8
|
-
const bonusLimits_1 = require("../constants/bonusLimits");
|
|
9
|
-
const commonTimezones_1 = require("../constants/commonTimezones");
|
|
10
|
-
const plinkoConfig_1 = require("../constants/plinkoConfig");
|
|
11
|
-
exports.atmChannelsFormSchema = zod_1.default.object({
|
|
12
|
-
actions: zod_1.default.string(),
|
|
13
|
-
logs: zod_1.default.string()
|
|
14
|
-
});
|
|
15
|
-
exports.casinoChannelsFormSchema = zod_1.default.object({
|
|
16
|
-
casinoChannelIds: zod_1.default.array(zod_1.default.string()),
|
|
17
|
-
winAnnouncementsChannelId: zod_1.default.string()
|
|
18
|
-
});
|
|
19
|
-
exports.predictionChannelsFormSchema = zod_1.default.object({
|
|
20
|
-
actions: zod_1.default.string(),
|
|
21
|
-
logs: zod_1.default.string()
|
|
22
|
-
});
|
|
23
|
-
exports.raffleChannelsFormSchema = zod_1.default.object({
|
|
24
|
-
actions: zod_1.default.string(),
|
|
25
|
-
logs: zod_1.default.string()
|
|
26
|
-
});
|
|
27
|
-
exports.channelsFormSchema = zod_1.default.object({
|
|
28
|
-
atm: exports.atmChannelsFormSchema,
|
|
29
|
-
casino: exports.casinoChannelsFormSchema,
|
|
30
|
-
prediction: exports.predictionChannelsFormSchema,
|
|
31
|
-
raffle: exports.raffleChannelsFormSchema
|
|
32
|
-
});
|
|
33
|
-
const num = zod_1.default
|
|
34
|
-
.union([zod_1.default.number(), zod_1.default.string()])
|
|
35
|
-
.transform((val) => {
|
|
36
|
-
if (val === '' || val === undefined || val === null)
|
|
37
|
-
return 0;
|
|
38
|
-
const parsed = typeof val === 'string' ? Number(val) : val;
|
|
39
|
-
return Number.isNaN(parsed) ? 0 : parsed;
|
|
40
|
-
})
|
|
41
|
-
.pipe(zod_1.default.number());
|
|
42
|
-
exports.casinoSettingsSchema = zod_1.default.object({
|
|
43
|
-
dice: zod_1.default.object({
|
|
44
|
-
winMultiplier: num,
|
|
45
|
-
minBet: num,
|
|
46
|
-
maxBet: num
|
|
47
|
-
}),
|
|
48
|
-
coinflip: zod_1.default.object({
|
|
49
|
-
winMultiplier: num,
|
|
50
|
-
minBet: num,
|
|
51
|
-
maxBet: num
|
|
52
|
-
}),
|
|
53
|
-
slots: zod_1.default.object({
|
|
54
|
-
winMultipliers: zod_1.default.record(zod_1.default.string(), num),
|
|
55
|
-
symbolWeights: zod_1.default.record(zod_1.default.string(), num),
|
|
56
|
-
minBet: num,
|
|
57
|
-
maxBet: num
|
|
58
|
-
}),
|
|
59
|
-
lottery: zod_1.default.object({
|
|
60
|
-
winMultipliers: zod_1.default.record(zod_1.default.string(), num),
|
|
61
|
-
minBet: num,
|
|
62
|
-
maxBet: num
|
|
63
|
-
}),
|
|
64
|
-
roulette: zod_1.default.object({
|
|
65
|
-
winMultipliers: zod_1.default.record(zod_1.default.string(), num),
|
|
66
|
-
minBet: num,
|
|
67
|
-
maxBet: num
|
|
68
|
-
}),
|
|
69
|
-
rps: zod_1.default.object({
|
|
70
|
-
casinoCut: num,
|
|
71
|
-
minBet: num,
|
|
72
|
-
maxBet: num
|
|
73
|
-
}),
|
|
74
|
-
goldenJackpot: zod_1.default.object({
|
|
75
|
-
winMultiplier: num,
|
|
76
|
-
oneInChance: num,
|
|
77
|
-
minBet: num,
|
|
78
|
-
maxBet: num
|
|
79
|
-
}),
|
|
80
|
-
blackjack: zod_1.default.object({
|
|
81
|
-
minBet: num,
|
|
82
|
-
maxBet: num
|
|
83
|
-
}),
|
|
84
|
-
prediction: zod_1.default.object({
|
|
85
|
-
minBet: num,
|
|
86
|
-
maxBet: num
|
|
87
|
-
}),
|
|
88
|
-
raffle: zod_1.default.object({
|
|
89
|
-
casinoCut: num
|
|
90
|
-
}),
|
|
91
|
-
plinko: zod_1.default.object({
|
|
92
|
-
binMultipliers: zod_1.default
|
|
93
|
-
.record(zod_1.default.string(), num)
|
|
94
|
-
.transform(plinkoConfig_1.normalizePlinkoBinMultipliers),
|
|
95
|
-
minBet: num,
|
|
96
|
-
maxBet: num
|
|
97
|
-
}),
|
|
98
|
-
winAnnouncements: zod_1.default.object({
|
|
99
|
-
plinkoMinMultiplier: num,
|
|
100
|
-
goldenJackpotMinMultiplier: num,
|
|
101
|
-
slotsMinMultiplier: num,
|
|
102
|
-
lotteryMinMultiplier: num,
|
|
103
|
-
rouletteMinMultiplier: num,
|
|
104
|
-
blackjackMinMultiplier: num,
|
|
105
|
-
diceMinMultiplier: num,
|
|
106
|
-
coinflipMinMultiplier: num
|
|
107
|
-
})
|
|
108
|
-
});
|
|
109
|
-
exports.vipSettingsFormSchema = zod_1.default.object({
|
|
110
|
-
roleOwnerId: zod_1.default.string(),
|
|
111
|
-
roleMemberId: zod_1.default.string(),
|
|
112
|
-
pricePerDay: zod_1.default.number().min(0, 'Must be ≥ 0'),
|
|
113
|
-
pricePerCreate: zod_1.default.number().min(0, 'Must be ≥ 0'),
|
|
114
|
-
pricePerAdditionalMember: zod_1.default.number().min(0, 'Must be ≥ 0'),
|
|
115
|
-
maxMembers: zod_1.default.number().min(0, 'Must be ≥ 0'),
|
|
116
|
-
categoryId: zod_1.default.string()
|
|
117
|
-
});
|
|
118
|
-
exports.managerRoleFormSchema = zod_1.default.object({
|
|
119
|
-
managerRoleId: zod_1.default.string()
|
|
120
|
-
});
|
|
121
|
-
const bonusAmountSchema = zod_1.default
|
|
122
|
-
.number()
|
|
123
|
-
.min(0, 'Must be ≥ 0')
|
|
124
|
-
.max(bonusLimits_1.BONUS_MAX_AMOUNT, `Must be ≤ ${bonusLimits_1.BONUS_MAX_AMOUNT.toLocaleString()}`);
|
|
125
|
-
const bonusMultiplierSchema = zod_1.default
|
|
126
|
-
.number()
|
|
127
|
-
.min(0, 'Must be ≥ 0')
|
|
128
|
-
.max(bonusLimits_1.BONUS_MAX_STREAK_MULTIPLIER, `Must be ≤ ${bonusLimits_1.BONUS_MAX_STREAK_MULTIPLIER}`)
|
|
129
|
-
.optional();
|
|
130
|
-
const bonusMultiplierInputSchema = zod_1.default
|
|
131
|
-
.union([zod_1.default.number(), zod_1.default.string()])
|
|
132
|
-
.optional()
|
|
133
|
-
.transform((val) => {
|
|
134
|
-
if (val === '' || val === undefined || val === null)
|
|
135
|
-
return undefined;
|
|
136
|
-
const num = typeof val === 'string' ? Number(val) : val;
|
|
137
|
-
return Number.isNaN(num) ? undefined : num;
|
|
138
|
-
})
|
|
139
|
-
.pipe(bonusMultiplierSchema);
|
|
140
|
-
exports.globalSettingsFormSchema = zod_1.default.object({
|
|
141
|
-
disableRegistrations: zod_1.default.boolean(),
|
|
142
|
-
disableDeposits: zod_1.default.boolean(),
|
|
143
|
-
disableWithdrawals: zod_1.default.boolean(),
|
|
144
|
-
disableCasinoGames: zod_1.default.boolean(),
|
|
145
|
-
disableCasinoGamesForMods: zod_1.default.boolean(),
|
|
146
|
-
disablePredictions: zod_1.default.boolean(),
|
|
147
|
-
disablePredictionManagement: zod_1.default.boolean(),
|
|
148
|
-
disableRaffles: zod_1.default.boolean(),
|
|
149
|
-
disableRaffleManagement: zod_1.default.boolean(),
|
|
150
|
-
disableDailyBonus: zod_1.default.boolean(),
|
|
151
|
-
disableVip: zod_1.default.boolean(),
|
|
152
|
-
maintenanceMode: zod_1.default.boolean(),
|
|
153
|
-
timezone: zod_1.default.enum(commonTimezones_1.COMMON_TIMEZONES),
|
|
154
|
-
currencySymbol: zod_1.default
|
|
155
|
-
.string()
|
|
156
|
-
.max(8)
|
|
157
|
-
.refine((value) => value.trim().length > 0, {
|
|
158
|
-
message: 'Currency symbol is required'
|
|
159
|
-
}),
|
|
160
|
-
currencyPlacement: zod_1.default.enum(['prefix', 'suffix'])
|
|
161
|
-
});
|
|
162
|
-
exports.bonusFormSchema = zod_1.default.object({
|
|
163
|
-
rewardMode: zod_1.default.enum(['linear', 'exponential']),
|
|
164
|
-
baseReward: bonusAmountSchema,
|
|
165
|
-
streakIncrement: bonusAmountSchema.optional(),
|
|
166
|
-
streakMultiplier: bonusMultiplierInputSchema,
|
|
167
|
-
maxReward: bonusAmountSchema,
|
|
168
|
-
resetOnMax: zod_1.default.boolean(),
|
|
169
|
-
milestoneBonus: zod_1.default.object({
|
|
170
|
-
weekly: bonusAmountSchema,
|
|
171
|
-
monthly: bonusAmountSchema
|
|
172
|
-
})
|
|
173
|
-
});
|
package/dist/schemas/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './forms';
|
package/dist/server.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './mongoose';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type TAtmRequest = {
|
|
2
|
-
requestId: string;
|
|
3
|
-
guildId: string;
|
|
4
|
-
userId: string;
|
|
5
|
-
type: 'deposit' | 'withdraw';
|
|
6
|
-
amount: number;
|
|
7
|
-
account: string;
|
|
8
|
-
status: 'pending' | 'approved' | 'rejected';
|
|
9
|
-
handledBy?: string;
|
|
10
|
-
handledAt?: Date;
|
|
11
|
-
logChannelId: string;
|
|
12
|
-
logMessageId: string;
|
|
13
|
-
createdAt: Date;
|
|
14
|
-
updatedAt: Date;
|
|
15
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { SUITES, VALUES } from '../constants/blackjack';
|
|
2
|
-
export type Suite = (typeof SUITES)[number];
|
|
3
|
-
export type CardLabel = (typeof VALUES)[number]['label'];
|
|
4
|
-
export type Card = {
|
|
5
|
-
suite: Suite;
|
|
6
|
-
label: CardLabel;
|
|
7
|
-
value: number;
|
|
8
|
-
};
|
|
9
|
-
export type GamePhase = 'PLAYER' | 'DEALER' | 'FINISHED';
|
|
10
|
-
export type TBlackjackHand = {
|
|
11
|
-
cards: Card[];
|
|
12
|
-
betAmount: number;
|
|
13
|
-
finished: boolean;
|
|
14
|
-
isSplitHand: boolean;
|
|
15
|
-
};
|
|
16
|
-
export type TBlackjackGame = {
|
|
17
|
-
userId: string;
|
|
18
|
-
guildId: string;
|
|
19
|
-
channelId: string;
|
|
20
|
-
messageId: string;
|
|
21
|
-
betId: string;
|
|
22
|
-
deck: Card[];
|
|
23
|
-
deckIndex: number;
|
|
24
|
-
hands: TBlackjackHand[];
|
|
25
|
-
activeHandIndex: number;
|
|
26
|
-
phase: GamePhase;
|
|
27
|
-
dealerCards: Card[];
|
|
28
|
-
createdAt: Date;
|
|
29
|
-
updatedAt: Date;
|
|
30
|
-
};
|
package/dist/types/bonus.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { RewardMode } from './guildConfiguration';
|
|
2
|
-
export type BonusSettings = {
|
|
3
|
-
rewardMode: RewardMode;
|
|
4
|
-
baseReward: number;
|
|
5
|
-
streakIncrement?: number;
|
|
6
|
-
streakMultiplier?: number;
|
|
7
|
-
maxReward: number;
|
|
8
|
-
resetOnMax: boolean;
|
|
9
|
-
milestoneBonus: {
|
|
10
|
-
weekly: number;
|
|
11
|
-
monthly: number;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { defaultCasinoSettings } from '../constants';
|
|
2
|
-
import type { GlobalSettings } from '../constants/defaultGlobalSettings';
|
|
3
|
-
import { BonusSettings } from './bonus';
|
|
4
|
-
export type RewardMode = 'linear' | 'exponential';
|
|
5
|
-
export type TGuildConfiguration = {
|
|
6
|
-
guildId: string;
|
|
7
|
-
atmChannelIds: {
|
|
8
|
-
actions: string;
|
|
9
|
-
logs: string;
|
|
10
|
-
};
|
|
11
|
-
casinoChannelIds: string[];
|
|
12
|
-
winAnnouncementsChannelId: string;
|
|
13
|
-
predictionChannelIds: {
|
|
14
|
-
actions: string;
|
|
15
|
-
logs: string;
|
|
16
|
-
};
|
|
17
|
-
raffleChannelIds: {
|
|
18
|
-
actions: string;
|
|
19
|
-
logs: string;
|
|
20
|
-
};
|
|
21
|
-
managerRoleId: string;
|
|
22
|
-
casinoSettings: typeof defaultCasinoSettings;
|
|
23
|
-
vipSettings: {
|
|
24
|
-
roleOwnerId: string;
|
|
25
|
-
roleMemberId: string;
|
|
26
|
-
categoryId: string;
|
|
27
|
-
pricePerDay: number;
|
|
28
|
-
pricePerCreate: number;
|
|
29
|
-
pricePerAdditionalMember: number;
|
|
30
|
-
maxMembers: number;
|
|
31
|
-
};
|
|
32
|
-
bonusSettings: BonusSettings;
|
|
33
|
-
globalSettings?: GlobalSettings;
|
|
34
|
-
};
|
|
35
|
-
export type { GlobalSettings } from '../constants/defaultGlobalSettings';
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { defaultCasinoSettings } from '../constants';
|
|
2
|
-
export type TCasinoSettings = typeof defaultCasinoSettings;
|
|
3
|
-
export * from './user';
|
|
4
|
-
export * from './vipRoom';
|
|
5
|
-
export * from './prediction';
|
|
6
|
-
export * from './transaction';
|
|
7
|
-
export * from './guildConfiguration';
|
|
8
|
-
export * from './atmRequest';
|
|
9
|
-
export * from './raffle';
|
|
10
|
-
export * from './blackjackGame';
|
|
11
|
-
export * from './bonus';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export type TPredictionOption = {
|
|
2
|
-
choiceName: string;
|
|
3
|
-
odds: number;
|
|
4
|
-
bets: {
|
|
5
|
-
userId: string;
|
|
6
|
-
amount: number;
|
|
7
|
-
}[];
|
|
8
|
-
};
|
|
9
|
-
export type TPrediction = {
|
|
10
|
-
predictionId: string;
|
|
11
|
-
guildId: string;
|
|
12
|
-
channelId: string;
|
|
13
|
-
creatorId: string;
|
|
14
|
-
title: string;
|
|
15
|
-
choices: TPredictionOption[];
|
|
16
|
-
status: 'active' | 'ended' | 'paid' | 'canceled';
|
|
17
|
-
autolock?: Date | null;
|
|
18
|
-
createdAt: Date;
|
|
19
|
-
updatedAt: Date;
|
|
20
|
-
};
|
package/dist/types/raffle.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export type TRaffle = {
|
|
2
|
-
drawId: string;
|
|
3
|
-
raffleId: string;
|
|
4
|
-
guildId: string;
|
|
5
|
-
channelId: string;
|
|
6
|
-
creatorId: string;
|
|
7
|
-
ticketPrice: number;
|
|
8
|
-
maxTicketsPerUser: number;
|
|
9
|
-
nextDrawAt: Date;
|
|
10
|
-
lastDrawAt?: Date;
|
|
11
|
-
drawIntervalMs: number;
|
|
12
|
-
status: 'active' | 'canceled';
|
|
13
|
-
participants: {
|
|
14
|
-
userId: string;
|
|
15
|
-
tickets: number;
|
|
16
|
-
}[];
|
|
17
|
-
createdAt: Date;
|
|
18
|
-
updatedAt: Date;
|
|
19
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type TTransaction = {
|
|
2
|
-
userId: string;
|
|
3
|
-
guildId: string;
|
|
4
|
-
amount: number;
|
|
5
|
-
type: 'deposit' | 'withdraw' | 'bet' | 'win' | 'refund' | 'bonus' | 'vip';
|
|
6
|
-
source: 'command' | 'manual' | 'web' | 'system' | 'casino';
|
|
7
|
-
meta?: Record<string, unknown>;
|
|
8
|
-
betId?: string;
|
|
9
|
-
handledBy?: string;
|
|
10
|
-
createdAt: Date;
|
|
11
|
-
};
|
package/dist/types/user.d.ts
DELETED
package/dist/types/vipRoom.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const canClaimDailyBonus: (lastClaim: Date | null, now: Date) => boolean;
|
|
2
|
-
export declare const getStreakAfterClaim: (lastClaim: Date | null, now: Date, currentStreak: number) => number;
|
|
3
|
-
export declare const getStreakDisplay: (lastClaim: Date | null, now: Date, streak: number) => {
|
|
4
|
-
currentStreak: number;
|
|
5
|
-
nextStreak: number;
|
|
6
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { BonusSettings } from '../types';
|
|
2
|
-
export type CalculateBonusRewardInput = {
|
|
3
|
-
streak: number;
|
|
4
|
-
settings: BonusSettings;
|
|
5
|
-
};
|
|
6
|
-
export type CalculateBonusRewardResult = {
|
|
7
|
-
reward: number;
|
|
8
|
-
base: number;
|
|
9
|
-
weekly: number;
|
|
10
|
-
monthly: number;
|
|
11
|
-
isReset: boolean;
|
|
12
|
-
};
|
|
13
|
-
export declare const calculateBonusReward: ({ streak, settings }: CalculateBonusRewardInput) => CalculateBonusRewardResult;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { GlobalSettings } from '../constants/defaultGlobalSettings';
|
|
2
|
-
export declare const formatNumberToReadableString: (number: number) => string;
|
|
3
|
-
export declare const parseReadableStringToNumber: (readableString: string) => number;
|
|
4
|
-
export declare const formatNumberWithSpaces: (num: number) => string;
|
|
5
|
-
/** Compact amount with guild currency (prefix or suffix symbol). */
|
|
6
|
-
export declare const formatMoney: (amount: number, globalSettings?: Partial<GlobalSettings> | null) => string;
|
|
7
|
-
/** Full-precision amount with guild currency (prefix or suffix symbol). */
|
|
8
|
-
export declare const formatMoneyExact: (amount: number, globalSettings?: Partial<GlobalSettings> | null) => string;
|
|
9
|
-
export declare const formatNumberToPercentage: (num: number) => string;
|
|
10
|
-
export declare const getReadableName: (key: string, map: {
|
|
11
|
-
name: string;
|
|
12
|
-
value: string;
|
|
13
|
-
}[]) => string;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { BonusSettings } from '../types';
|
|
2
|
-
export declare const PREVIEW_DAYS = 60;
|
|
3
|
-
export type PreviewDay = {
|
|
4
|
-
day: number;
|
|
5
|
-
reward: number;
|
|
6
|
-
base: number;
|
|
7
|
-
weekly: number;
|
|
8
|
-
monthly: number;
|
|
9
|
-
isReset: boolean;
|
|
10
|
-
};
|
|
11
|
-
export declare const generateBonusPreview: (settings: BonusSettings, days?: number) => PreviewDay[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const generateId: () => string;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type CurrencyPlacement, type GlobalSettings } from '../constants/defaultGlobalSettings';
|
|
2
|
-
import type { TGuildConfiguration } from '../types/guildConfiguration';
|
|
3
|
-
export type GlobalFeature = 'registration' | 'deposit' | 'withdraw' | 'casinoGames' | 'casinoGamesForMods' | 'predictions' | 'predictionManagement' | 'raffles' | 'raffleManagement' | 'dailyBonus' | 'vip' | 'maintenance';
|
|
4
|
-
export declare function isGlobalFeatureDisabled(config: TGuildConfiguration | null | undefined, feature: GlobalFeature): boolean;
|
|
5
|
-
export declare const getCurrencyPlacement: (globalSettings?: Partial<GlobalSettings> | null) => CurrencyPlacement;
|
|
6
|
-
export declare const getCurrencySymbol: (globalSettings?: Partial<GlobalSettings> | null) => string;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const resolveGuildTimezone: (timezone?: string | null) => string;
|
|
2
|
-
/** Calendar dates (yyyy-MM-dd) interpreted in the guild timezone → UTC bounds for MongoDB. */
|
|
3
|
-
export declare const guildCalendarRangeToUtc: (dateFrom: string, dateTo: string, timezone?: string | null) => {
|
|
4
|
-
start: Date;
|
|
5
|
-
end: Date;
|
|
6
|
-
};
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export * from './calculateRTP';
|
|
2
|
-
export * from './calculateBonusReward';
|
|
3
|
-
export * from './normalizeBonusSettings';
|
|
4
|
-
export * from './generateBonusPreview';
|
|
5
|
-
export * from './formatters';
|
|
6
|
-
export * from './globalSettings';
|
|
7
|
-
export * from './normalizeGlobalSettings';
|
|
8
|
-
export * from './normalizeCasinoSettings';
|
|
9
|
-
export * from './guildTimezone';
|
|
10
|
-
export * from './generateId';
|
|
11
|
-
export * from './parseTimeToSeconds';
|
|
12
|
-
export * from './validateBetAmount';
|
|
13
|
-
export * from './bonusStreak';
|
|
14
|
-
export * from './validatePredictionBet';
|
|
15
|
-
export * from './winAnnouncements';
|
package/dist/utils/index.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./calculateRTP"), exports);
|
|
18
|
-
__exportStar(require("./calculateBonusReward"), exports);
|
|
19
|
-
__exportStar(require("./normalizeBonusSettings"), exports);
|
|
20
|
-
__exportStar(require("./generateBonusPreview"), exports);
|
|
21
|
-
__exportStar(require("./formatters"), exports);
|
|
22
|
-
__exportStar(require("./globalSettings"), exports);
|
|
23
|
-
__exportStar(require("./normalizeGlobalSettings"), exports);
|
|
24
|
-
__exportStar(require("./normalizeCasinoSettings"), exports);
|
|
25
|
-
__exportStar(require("./guildTimezone"), exports);
|
|
26
|
-
__exportStar(require("./generateId"), exports);
|
|
27
|
-
__exportStar(require("./parseTimeToSeconds"), exports);
|
|
28
|
-
__exportStar(require("./validateBetAmount"), exports);
|
|
29
|
-
__exportStar(require("./bonusStreak"), exports);
|
|
30
|
-
__exportStar(require("./validatePredictionBet"), exports);
|
|
31
|
-
__exportStar(require("./winAnnouncements"), exports);
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { BonusSettings } from '../types';
|
|
2
|
-
export declare const normalizeBonusSettings: (settings: BonusSettings) => BonusSettings;
|
|
3
|
-
/** Parse admin integer inputs (digits only) and clamp to the bonus amount cap. */
|
|
4
|
-
export declare const parseBonusAmountInput: (raw: string) => number;
|
|
5
|
-
/** Parse streak multiplier text and clamp to the allowed range. */
|
|
6
|
-
export declare const parseBonusMultiplierInput: (raw: string) => number | undefined;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeGlobalSettings = void 0;
|
|
4
|
-
const constants_1 = require("../constants");
|
|
5
|
-
const coerceBool = (value, fallback) => {
|
|
6
|
-
if (typeof value === 'boolean')
|
|
7
|
-
return value;
|
|
8
|
-
if (value === 'true')
|
|
9
|
-
return true;
|
|
10
|
-
if (value === 'false')
|
|
11
|
-
return false;
|
|
12
|
-
return fallback;
|
|
13
|
-
};
|
|
14
|
-
const normalizeCurrencySymbol = (value) => {
|
|
15
|
-
if (typeof value !== 'string' || value.trim().length === 0) {
|
|
16
|
-
return constants_1.defaultGlobalSettings.currencySymbol;
|
|
17
|
-
}
|
|
18
|
-
return value.slice(0, 8);
|
|
19
|
-
};
|
|
20
|
-
const normalizeCurrencyPlacement = (value) => value === 'suffix' ? 'suffix' : 'prefix';
|
|
21
|
-
const normalizeTimezone = (value) => {
|
|
22
|
-
const raw = typeof value === 'string' ? value.trim() : '';
|
|
23
|
-
if (raw.length > 0 && constants_1.COMMON_TIMEZONES.includes(raw)) {
|
|
24
|
-
return raw;
|
|
25
|
-
}
|
|
26
|
-
return constants_1.defaultGlobalSettings.timezone;
|
|
27
|
-
};
|
|
28
|
-
const normalizeGlobalSettings = (settings) => ({
|
|
29
|
-
disableRegistrations: coerceBool(settings?.disableRegistrations, constants_1.defaultGlobalSettings.disableRegistrations),
|
|
30
|
-
disableDeposits: coerceBool(settings?.disableDeposits, constants_1.defaultGlobalSettings.disableDeposits),
|
|
31
|
-
disableWithdrawals: coerceBool(settings?.disableWithdrawals, constants_1.defaultGlobalSettings.disableWithdrawals),
|
|
32
|
-
disableCasinoGames: coerceBool(settings?.disableCasinoGames, constants_1.defaultGlobalSettings.disableCasinoGames),
|
|
33
|
-
disableCasinoGamesForMods: coerceBool(settings?.disableCasinoGamesForMods, constants_1.defaultGlobalSettings.disableCasinoGamesForMods),
|
|
34
|
-
disablePredictions: coerceBool(settings?.disablePredictions, constants_1.defaultGlobalSettings.disablePredictions),
|
|
35
|
-
disablePredictionManagement: coerceBool(settings?.disablePredictionManagement, constants_1.defaultGlobalSettings.disablePredictionManagement),
|
|
36
|
-
disableRaffles: coerceBool(settings?.disableRaffles, constants_1.defaultGlobalSettings.disableRaffles),
|
|
37
|
-
disableRaffleManagement: coerceBool(settings?.disableRaffleManagement, constants_1.defaultGlobalSettings.disableRaffleManagement),
|
|
38
|
-
disableDailyBonus: coerceBool(settings?.disableDailyBonus, constants_1.defaultGlobalSettings.disableDailyBonus),
|
|
39
|
-
disableVip: coerceBool(settings?.disableVip, constants_1.defaultGlobalSettings.disableVip),
|
|
40
|
-
maintenanceMode: coerceBool(settings?.maintenanceMode, constants_1.defaultGlobalSettings.maintenanceMode),
|
|
41
|
-
timezone: normalizeTimezone(settings?.timezone),
|
|
42
|
-
currencySymbol: normalizeCurrencySymbol(settings?.currencySymbol),
|
|
43
|
-
currencyPlacement: normalizeCurrencyPlacement(settings?.currencyPlacement)
|
|
44
|
-
});
|
|
45
|
-
exports.normalizeGlobalSettings = normalizeGlobalSettings;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const parseTimeToSeconds: (time: string) => number;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export type BetValidationError = 'INVALID_NUMBER' | 'TOO_MANY_DECIMALS' | 'BELOW_MINIMUM' | 'ABOVE_MAXIMUM' | 'BELOW_MIN_BET';
|
|
2
|
-
export type BetValidationResult = {
|
|
3
|
-
ok: true;
|
|
4
|
-
} | {
|
|
5
|
-
ok: false;
|
|
6
|
-
error: BetValidationError;
|
|
7
|
-
};
|
|
8
|
-
export declare const validateBetAmount: (betAmount: number, maxBet: number, minBet: number) => BetValidationResult;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type PredictionBetValidationError = 'BELOW_MIN_BET' | 'ABOVE_MAX_PER_CHOICE';
|
|
2
|
-
export type PredictionBetValidationResult = {
|
|
3
|
-
ok: true;
|
|
4
|
-
} | {
|
|
5
|
-
ok: false;
|
|
6
|
-
error: PredictionBetValidationError;
|
|
7
|
-
};
|
|
8
|
-
export declare const validatePredictionChoiceBet: ({ userChoiceTotal, parsedBetAmount, maxBet, minBet }: {
|
|
9
|
-
userChoiceTotal: number;
|
|
10
|
-
parsedBetAmount: number;
|
|
11
|
-
maxBet: number;
|
|
12
|
-
minBet: number;
|
|
13
|
-
}) => PredictionBetValidationResult;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/** minMultiplier <= 0 disables announcements for that game */
|
|
2
|
-
export declare const shouldAnnounceByMultiplier: (multiplier: number, minMultiplier: number) => boolean;
|
|
3
|
-
export declare const shouldAnnouncePlinkoBall: (multiplier: number, plinkoMinMultiplier: number) => boolean;
|
|
4
|
-
export declare const shouldAnnounceGoldenJackpotHit: (winMultiplier: number, goldenJackpotMinMultiplier: number) => boolean;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|