gambling-bot-shared 0.1.51 → 0.1.52
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 +11 -1
- package/dist/constants/blackjack.d.ts +41 -0
- package/dist/constants/blackjack.js +19 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +1 -0
- package/dist/constants/plinkoConfig.js +4 -1
- package/dist/constants/rouletteConfig.js +1 -1
- package/dist/mongoose/atmRequest.schema.d.ts +139 -0
- package/dist/mongoose/atmRequest.schema.js +23 -0
- package/dist/mongoose/blackjackGame.schema.d.ts +139 -0
- package/dist/mongoose/blackjackGame.schema.js +34 -0
- package/dist/mongoose/index.d.ts +3 -0
- package/dist/mongoose/index.js +3 -0
- package/dist/mongoose/prediction.schema.js +12 -12
- package/dist/mongoose/raffle.schema.d.ts +151 -0
- package/dist/mongoose/raffle.schema.js +29 -0
- package/dist/mongoose/transaction.schema.d.ts +1 -1
- package/dist/mongoose/vipRoom.schema.js +2 -2
- package/dist/schemas/forms.js +1 -1
- package/dist/types/atmRequest.d.ts +15 -0
- package/dist/types/atmRequest.js +2 -0
- package/dist/types/blackjackGame.d.ts +30 -0
- package/dist/types/blackjackGame.js +2 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +3 -0
- package/dist/types/raffle.d.ts +19 -0
- package/dist/types/raffle.js +2 -0
- package/dist/types/transaction.d.ts +1 -1
- package/dist/utils/calculateBonusReward.js +1 -2
- package/dist/utils/normalizeGlobalSettings.js +1 -2
- package/package.json +16 -3
package/README.MD
CHANGED
|
@@ -34,4 +34,14 @@ in the case study linked above.
|
|
|
34
34
|
|
|
35
35
|
## Local development
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
Bootstrap all three repos in one step:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
curl -fsSL https://raw.githubusercontent.com/krouskystepan/gambling-bot-shared/main/scripts/setup-workspace.sh | bash
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
See [docs/LOCAL_DEVELOPMENT.md](./docs/LOCAL_DEVELOPMENT.md) for the local linking workflow, debugging commands, and release process.
|
|
44
|
+
|
|
45
|
+
## GitHub / CI
|
|
46
|
+
|
|
47
|
+
See [docs/GITHUB_SETUP.md](./docs/GITHUB_SETUP.md) for CI workflows and branch protection on `main`.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare const SUITES: readonly ["♠️", "♣️", "♥️", "♦️"];
|
|
2
|
+
export declare const VALUES: readonly [{
|
|
3
|
+
readonly label: "A";
|
|
4
|
+
readonly value: 11;
|
|
5
|
+
}, {
|
|
6
|
+
readonly label: "2";
|
|
7
|
+
readonly value: 2;
|
|
8
|
+
}, {
|
|
9
|
+
readonly label: "3";
|
|
10
|
+
readonly value: 3;
|
|
11
|
+
}, {
|
|
12
|
+
readonly label: "4";
|
|
13
|
+
readonly value: 4;
|
|
14
|
+
}, {
|
|
15
|
+
readonly label: "5";
|
|
16
|
+
readonly value: 5;
|
|
17
|
+
}, {
|
|
18
|
+
readonly label: "6";
|
|
19
|
+
readonly value: 6;
|
|
20
|
+
}, {
|
|
21
|
+
readonly label: "7";
|
|
22
|
+
readonly value: 7;
|
|
23
|
+
}, {
|
|
24
|
+
readonly label: "8";
|
|
25
|
+
readonly value: 8;
|
|
26
|
+
}, {
|
|
27
|
+
readonly label: "9";
|
|
28
|
+
readonly value: 9;
|
|
29
|
+
}, {
|
|
30
|
+
readonly label: "10";
|
|
31
|
+
readonly value: 10;
|
|
32
|
+
}, {
|
|
33
|
+
readonly label: "J";
|
|
34
|
+
readonly value: 10;
|
|
35
|
+
}, {
|
|
36
|
+
readonly label: "Q";
|
|
37
|
+
readonly value: 10;
|
|
38
|
+
}, {
|
|
39
|
+
readonly label: "K";
|
|
40
|
+
readonly value: 10;
|
|
41
|
+
}];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VALUES = exports.SUITES = void 0;
|
|
4
|
+
exports.SUITES = ['♠️', '♣️', '♥️', '♦️'];
|
|
5
|
+
exports.VALUES = [
|
|
6
|
+
{ label: 'A', value: 11 },
|
|
7
|
+
{ label: '2', value: 2 },
|
|
8
|
+
{ label: '3', value: 3 },
|
|
9
|
+
{ label: '4', value: 4 },
|
|
10
|
+
{ label: '5', value: 5 },
|
|
11
|
+
{ label: '6', value: 6 },
|
|
12
|
+
{ label: '7', value: 7 },
|
|
13
|
+
{ label: '8', value: 8 },
|
|
14
|
+
{ label: '9', value: 9 },
|
|
15
|
+
{ label: '10', value: 10 },
|
|
16
|
+
{ label: 'J', value: 10 },
|
|
17
|
+
{ label: 'Q', value: 10 },
|
|
18
|
+
{ label: 'K', value: 10 }
|
|
19
|
+
];
|
package/dist/constants/index.js
CHANGED
|
@@ -69,6 +69,9 @@ const getPlinkoMultiplierAtPathIndex = (binMultipliers, pathIndex) => {
|
|
|
69
69
|
exports.getPlinkoMultiplierAtPathIndex = getPlinkoMultiplierAtPathIndex;
|
|
70
70
|
const formatPlinkoBinMultipliersForDisplay = (binMultipliers) => {
|
|
71
71
|
const normalized = (0, exports.normalizePlinkoBinMultipliers)(binMultipliers);
|
|
72
|
-
return Object.fromEntries(exports.PLINKO_EDITABLE_BINS.map((bin) => [
|
|
72
|
+
return Object.fromEntries(exports.PLINKO_EDITABLE_BINS.map((bin) => [
|
|
73
|
+
String(bin),
|
|
74
|
+
plinkoBinAt(normalized, bin)
|
|
75
|
+
]));
|
|
73
76
|
};
|
|
74
77
|
exports.formatPlinkoBinMultipliersForDisplay = formatPlinkoBinMultipliersForDisplay;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
import { TAtmRequest } from '../types';
|
|
3
|
+
export declare const AtmRequestSchema: Schema<TAtmRequest, import("mongoose").Model<TAtmRequest, any, any, any, (import("mongoose").Document<unknown, any, TAtmRequest, any, import("mongoose").DefaultSchemaOptions> & TAtmRequest & {
|
|
4
|
+
_id: import("mongoose").Types.ObjectId;
|
|
5
|
+
} & {
|
|
6
|
+
__v: number;
|
|
7
|
+
} & {
|
|
8
|
+
id: string;
|
|
9
|
+
}) | (import("mongoose").Document<unknown, any, TAtmRequest, any, import("mongoose").DefaultSchemaOptions> & TAtmRequest & {
|
|
10
|
+
_id: import("mongoose").Types.ObjectId;
|
|
11
|
+
} & {
|
|
12
|
+
__v: number;
|
|
13
|
+
}), any, TAtmRequest>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
14
|
+
id: string;
|
|
15
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
16
|
+
_id: import("mongoose").Types.ObjectId;
|
|
17
|
+
} & {
|
|
18
|
+
__v: number;
|
|
19
|
+
}, "id"> & {
|
|
20
|
+
id: string;
|
|
21
|
+
}, {
|
|
22
|
+
requestId?: import("mongoose").SchemaDefinitionProperty<string, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
23
|
+
id: string;
|
|
24
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
25
|
+
_id: import("mongoose").Types.ObjectId;
|
|
26
|
+
} & {
|
|
27
|
+
__v: number;
|
|
28
|
+
}, "id"> & {
|
|
29
|
+
id: string;
|
|
30
|
+
}> | undefined;
|
|
31
|
+
guildId?: import("mongoose").SchemaDefinitionProperty<string, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
32
|
+
id: string;
|
|
33
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
34
|
+
_id: import("mongoose").Types.ObjectId;
|
|
35
|
+
} & {
|
|
36
|
+
__v: number;
|
|
37
|
+
}, "id"> & {
|
|
38
|
+
id: string;
|
|
39
|
+
}> | undefined;
|
|
40
|
+
userId?: import("mongoose").SchemaDefinitionProperty<string, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
41
|
+
id: string;
|
|
42
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
43
|
+
_id: import("mongoose").Types.ObjectId;
|
|
44
|
+
} & {
|
|
45
|
+
__v: number;
|
|
46
|
+
}, "id"> & {
|
|
47
|
+
id: string;
|
|
48
|
+
}> | undefined;
|
|
49
|
+
type?: import("mongoose").SchemaDefinitionProperty<"deposit" | "withdraw", TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
50
|
+
id: string;
|
|
51
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
52
|
+
_id: import("mongoose").Types.ObjectId;
|
|
53
|
+
} & {
|
|
54
|
+
__v: number;
|
|
55
|
+
}, "id"> & {
|
|
56
|
+
id: string;
|
|
57
|
+
}> | undefined;
|
|
58
|
+
amount?: import("mongoose").SchemaDefinitionProperty<number, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
59
|
+
id: string;
|
|
60
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
61
|
+
_id: import("mongoose").Types.ObjectId;
|
|
62
|
+
} & {
|
|
63
|
+
__v: number;
|
|
64
|
+
}, "id"> & {
|
|
65
|
+
id: string;
|
|
66
|
+
}> | undefined;
|
|
67
|
+
account?: import("mongoose").SchemaDefinitionProperty<string, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
68
|
+
id: string;
|
|
69
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
70
|
+
_id: import("mongoose").Types.ObjectId;
|
|
71
|
+
} & {
|
|
72
|
+
__v: number;
|
|
73
|
+
}, "id"> & {
|
|
74
|
+
id: string;
|
|
75
|
+
}> | undefined;
|
|
76
|
+
status?: import("mongoose").SchemaDefinitionProperty<"pending" | "approved" | "rejected", TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
77
|
+
id: string;
|
|
78
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
79
|
+
_id: import("mongoose").Types.ObjectId;
|
|
80
|
+
} & {
|
|
81
|
+
__v: number;
|
|
82
|
+
}, "id"> & {
|
|
83
|
+
id: string;
|
|
84
|
+
}> | undefined;
|
|
85
|
+
handledBy?: import("mongoose").SchemaDefinitionProperty<string | undefined, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
86
|
+
id: string;
|
|
87
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
88
|
+
_id: import("mongoose").Types.ObjectId;
|
|
89
|
+
} & {
|
|
90
|
+
__v: number;
|
|
91
|
+
}, "id"> & {
|
|
92
|
+
id: string;
|
|
93
|
+
}> | undefined;
|
|
94
|
+
handledAt?: import("mongoose").SchemaDefinitionProperty<Date | undefined, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
95
|
+
id: string;
|
|
96
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
97
|
+
_id: import("mongoose").Types.ObjectId;
|
|
98
|
+
} & {
|
|
99
|
+
__v: number;
|
|
100
|
+
}, "id"> & {
|
|
101
|
+
id: string;
|
|
102
|
+
}> | undefined;
|
|
103
|
+
logChannelId?: import("mongoose").SchemaDefinitionProperty<string, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
104
|
+
id: string;
|
|
105
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
106
|
+
_id: import("mongoose").Types.ObjectId;
|
|
107
|
+
} & {
|
|
108
|
+
__v: number;
|
|
109
|
+
}, "id"> & {
|
|
110
|
+
id: string;
|
|
111
|
+
}> | undefined;
|
|
112
|
+
logMessageId?: import("mongoose").SchemaDefinitionProperty<string, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
113
|
+
id: string;
|
|
114
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
115
|
+
_id: import("mongoose").Types.ObjectId;
|
|
116
|
+
} & {
|
|
117
|
+
__v: number;
|
|
118
|
+
}, "id"> & {
|
|
119
|
+
id: string;
|
|
120
|
+
}> | undefined;
|
|
121
|
+
createdAt?: import("mongoose").SchemaDefinitionProperty<Date, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
122
|
+
id: string;
|
|
123
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
124
|
+
_id: import("mongoose").Types.ObjectId;
|
|
125
|
+
} & {
|
|
126
|
+
__v: number;
|
|
127
|
+
}, "id"> & {
|
|
128
|
+
id: string;
|
|
129
|
+
}> | undefined;
|
|
130
|
+
updatedAt?: import("mongoose").SchemaDefinitionProperty<Date, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
131
|
+
id: string;
|
|
132
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
133
|
+
_id: import("mongoose").Types.ObjectId;
|
|
134
|
+
} & {
|
|
135
|
+
__v: number;
|
|
136
|
+
}, "id"> & {
|
|
137
|
+
id: string;
|
|
138
|
+
}> | undefined;
|
|
139
|
+
}, TAtmRequest>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AtmRequestSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
exports.AtmRequestSchema = new mongoose_1.Schema({
|
|
6
|
+
requestId: { type: String, required: true, unique: true },
|
|
7
|
+
guildId: { type: String, required: true, index: true },
|
|
8
|
+
userId: { type: String, required: true, index: true },
|
|
9
|
+
type: { type: String, enum: ['deposit', 'withdraw'], required: true },
|
|
10
|
+
amount: { type: Number, required: true, min: 1 },
|
|
11
|
+
account: { type: String, required: true },
|
|
12
|
+
status: {
|
|
13
|
+
type: String,
|
|
14
|
+
enum: ['pending', 'approved', 'rejected'],
|
|
15
|
+
required: true,
|
|
16
|
+
default: 'pending',
|
|
17
|
+
index: true
|
|
18
|
+
},
|
|
19
|
+
handledBy: { type: String },
|
|
20
|
+
handledAt: { type: Date },
|
|
21
|
+
logChannelId: { type: String },
|
|
22
|
+
logMessageId: { type: String }
|
|
23
|
+
}, { timestamps: true });
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
import { TBlackjackGame, TBlackjackHand } from '../types';
|
|
3
|
+
export declare const BlackjackGameSchema: Schema<TBlackjackGame, import("mongoose").Model<TBlackjackGame, any, any, any, (import("mongoose").Document<unknown, any, TBlackjackGame, any, import("mongoose").DefaultSchemaOptions> & TBlackjackGame & {
|
|
4
|
+
_id: import("mongoose").Types.ObjectId;
|
|
5
|
+
} & {
|
|
6
|
+
__v: number;
|
|
7
|
+
} & {
|
|
8
|
+
id: string;
|
|
9
|
+
}) | (import("mongoose").Document<unknown, any, TBlackjackGame, any, import("mongoose").DefaultSchemaOptions> & TBlackjackGame & {
|
|
10
|
+
_id: import("mongoose").Types.ObjectId;
|
|
11
|
+
} & {
|
|
12
|
+
__v: number;
|
|
13
|
+
}), any, TBlackjackGame>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
14
|
+
id: string;
|
|
15
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
16
|
+
_id: import("mongoose").Types.ObjectId;
|
|
17
|
+
} & {
|
|
18
|
+
__v: number;
|
|
19
|
+
}, "id"> & {
|
|
20
|
+
id: string;
|
|
21
|
+
}, {
|
|
22
|
+
userId?: import("mongoose").SchemaDefinitionProperty<string, TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
23
|
+
id: string;
|
|
24
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
25
|
+
_id: import("mongoose").Types.ObjectId;
|
|
26
|
+
} & {
|
|
27
|
+
__v: number;
|
|
28
|
+
}, "id"> & {
|
|
29
|
+
id: string;
|
|
30
|
+
}> | undefined;
|
|
31
|
+
guildId?: import("mongoose").SchemaDefinitionProperty<string, TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
32
|
+
id: string;
|
|
33
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
34
|
+
_id: import("mongoose").Types.ObjectId;
|
|
35
|
+
} & {
|
|
36
|
+
__v: number;
|
|
37
|
+
}, "id"> & {
|
|
38
|
+
id: string;
|
|
39
|
+
}> | undefined;
|
|
40
|
+
channelId?: import("mongoose").SchemaDefinitionProperty<string, TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
41
|
+
id: string;
|
|
42
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
43
|
+
_id: import("mongoose").Types.ObjectId;
|
|
44
|
+
} & {
|
|
45
|
+
__v: number;
|
|
46
|
+
}, "id"> & {
|
|
47
|
+
id: string;
|
|
48
|
+
}> | undefined;
|
|
49
|
+
messageId?: import("mongoose").SchemaDefinitionProperty<string, TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
50
|
+
id: string;
|
|
51
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
52
|
+
_id: import("mongoose").Types.ObjectId;
|
|
53
|
+
} & {
|
|
54
|
+
__v: number;
|
|
55
|
+
}, "id"> & {
|
|
56
|
+
id: string;
|
|
57
|
+
}> | undefined;
|
|
58
|
+
betId?: import("mongoose").SchemaDefinitionProperty<string, TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
59
|
+
id: string;
|
|
60
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
61
|
+
_id: import("mongoose").Types.ObjectId;
|
|
62
|
+
} & {
|
|
63
|
+
__v: number;
|
|
64
|
+
}, "id"> & {
|
|
65
|
+
id: string;
|
|
66
|
+
}> | undefined;
|
|
67
|
+
deck?: import("mongoose").SchemaDefinitionProperty<import("../types").Card[], TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
68
|
+
id: string;
|
|
69
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
70
|
+
_id: import("mongoose").Types.ObjectId;
|
|
71
|
+
} & {
|
|
72
|
+
__v: number;
|
|
73
|
+
}, "id"> & {
|
|
74
|
+
id: string;
|
|
75
|
+
}> | undefined;
|
|
76
|
+
deckIndex?: import("mongoose").SchemaDefinitionProperty<number, TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
77
|
+
id: string;
|
|
78
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
79
|
+
_id: import("mongoose").Types.ObjectId;
|
|
80
|
+
} & {
|
|
81
|
+
__v: number;
|
|
82
|
+
}, "id"> & {
|
|
83
|
+
id: string;
|
|
84
|
+
}> | undefined;
|
|
85
|
+
hands?: import("mongoose").SchemaDefinitionProperty<TBlackjackHand[], TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
86
|
+
id: string;
|
|
87
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
88
|
+
_id: import("mongoose").Types.ObjectId;
|
|
89
|
+
} & {
|
|
90
|
+
__v: number;
|
|
91
|
+
}, "id"> & {
|
|
92
|
+
id: string;
|
|
93
|
+
}> | undefined;
|
|
94
|
+
activeHandIndex?: import("mongoose").SchemaDefinitionProperty<number, TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
95
|
+
id: string;
|
|
96
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
97
|
+
_id: import("mongoose").Types.ObjectId;
|
|
98
|
+
} & {
|
|
99
|
+
__v: number;
|
|
100
|
+
}, "id"> & {
|
|
101
|
+
id: string;
|
|
102
|
+
}> | undefined;
|
|
103
|
+
phase?: import("mongoose").SchemaDefinitionProperty<import("../types").GamePhase, TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
104
|
+
id: string;
|
|
105
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
106
|
+
_id: import("mongoose").Types.ObjectId;
|
|
107
|
+
} & {
|
|
108
|
+
__v: number;
|
|
109
|
+
}, "id"> & {
|
|
110
|
+
id: string;
|
|
111
|
+
}> | undefined;
|
|
112
|
+
dealerCards?: import("mongoose").SchemaDefinitionProperty<import("../types").Card[], TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
113
|
+
id: string;
|
|
114
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
115
|
+
_id: import("mongoose").Types.ObjectId;
|
|
116
|
+
} & {
|
|
117
|
+
__v: number;
|
|
118
|
+
}, "id"> & {
|
|
119
|
+
id: string;
|
|
120
|
+
}> | undefined;
|
|
121
|
+
createdAt?: import("mongoose").SchemaDefinitionProperty<Date, TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
122
|
+
id: string;
|
|
123
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
124
|
+
_id: import("mongoose").Types.ObjectId;
|
|
125
|
+
} & {
|
|
126
|
+
__v: number;
|
|
127
|
+
}, "id"> & {
|
|
128
|
+
id: string;
|
|
129
|
+
}> | undefined;
|
|
130
|
+
updatedAt?: import("mongoose").SchemaDefinitionProperty<Date, TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
131
|
+
id: string;
|
|
132
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
133
|
+
_id: import("mongoose").Types.ObjectId;
|
|
134
|
+
} & {
|
|
135
|
+
__v: number;
|
|
136
|
+
}, "id"> & {
|
|
137
|
+
id: string;
|
|
138
|
+
}> | undefined;
|
|
139
|
+
}, TBlackjackGame>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BlackjackGameSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const cardSchema = {
|
|
6
|
+
suite: { type: String, required: true },
|
|
7
|
+
label: { type: String, required: true },
|
|
8
|
+
value: { type: Number, required: true }
|
|
9
|
+
};
|
|
10
|
+
const handSchema = new mongoose_1.Schema({
|
|
11
|
+
cards: [cardSchema],
|
|
12
|
+
betAmount: { type: Number, required: true },
|
|
13
|
+
finished: { type: Boolean, required: true, default: false },
|
|
14
|
+
isSplitHand: { type: Boolean, required: true, default: false }
|
|
15
|
+
}, { _id: false });
|
|
16
|
+
exports.BlackjackGameSchema = new mongoose_1.Schema({
|
|
17
|
+
userId: { type: String, required: true, index: true },
|
|
18
|
+
guildId: { type: String, required: true, index: true },
|
|
19
|
+
channelId: { type: String, required: true },
|
|
20
|
+
messageId: { type: String, required: true },
|
|
21
|
+
betId: { type: String, required: true, index: true },
|
|
22
|
+
deck: [cardSchema],
|
|
23
|
+
deckIndex: { type: Number, required: true, default: 0 },
|
|
24
|
+
hands: { type: [handSchema], required: true, default: [] },
|
|
25
|
+
phase: {
|
|
26
|
+
type: String,
|
|
27
|
+
enum: ['PLAYER', 'DEALER', 'FINISHED'],
|
|
28
|
+
required: true,
|
|
29
|
+
default: 'PLAYER'
|
|
30
|
+
},
|
|
31
|
+
activeHandIndex: { type: Number, required: true, default: 0 },
|
|
32
|
+
dealerCards: [cardSchema]
|
|
33
|
+
}, { timestamps: true });
|
|
34
|
+
exports.BlackjackGameSchema.index({ userId: 1, guildId: 1 }, { unique: true });
|
package/dist/mongoose/index.d.ts
CHANGED
|
@@ -3,3 +3,6 @@ export * from './vipRoom.schema';
|
|
|
3
3
|
export * from './prediction.schema';
|
|
4
4
|
export * from './transaction.schema';
|
|
5
5
|
export * from './guildConfiguration.schema';
|
|
6
|
+
export * from './atmRequest.schema';
|
|
7
|
+
export * from './raffle.schema';
|
|
8
|
+
export * from './blackjackGame.schema';
|
package/dist/mongoose/index.js
CHANGED
|
@@ -19,3 +19,6 @@ __exportStar(require("./vipRoom.schema"), exports);
|
|
|
19
19
|
__exportStar(require("./prediction.schema"), exports);
|
|
20
20
|
__exportStar(require("./transaction.schema"), exports);
|
|
21
21
|
__exportStar(require("./guildConfiguration.schema"), exports);
|
|
22
|
+
__exportStar(require("./atmRequest.schema"), exports);
|
|
23
|
+
__exportStar(require("./raffle.schema"), exports);
|
|
24
|
+
__exportStar(require("./blackjackGame.schema"), exports);
|
|
@@ -5,23 +5,23 @@ const mongoose_1 = require("mongoose");
|
|
|
5
5
|
exports.PredictionSchema = new mongoose_1.Schema({
|
|
6
6
|
predictionId: {
|
|
7
7
|
type: String,
|
|
8
|
-
required: true
|
|
8
|
+
required: true
|
|
9
9
|
},
|
|
10
10
|
guildId: {
|
|
11
11
|
type: String,
|
|
12
|
-
required: true
|
|
12
|
+
required: true
|
|
13
13
|
},
|
|
14
14
|
channelId: {
|
|
15
15
|
type: String,
|
|
16
|
-
required: true
|
|
16
|
+
required: true
|
|
17
17
|
},
|
|
18
18
|
creatorId: {
|
|
19
19
|
type: String,
|
|
20
|
-
required: true
|
|
20
|
+
required: true
|
|
21
21
|
},
|
|
22
22
|
title: {
|
|
23
23
|
type: String,
|
|
24
|
-
required: true
|
|
24
|
+
required: true
|
|
25
25
|
},
|
|
26
26
|
choices: [
|
|
27
27
|
{
|
|
@@ -30,20 +30,20 @@ exports.PredictionSchema = new mongoose_1.Schema({
|
|
|
30
30
|
bets: [
|
|
31
31
|
{
|
|
32
32
|
userId: { type: String, required: true },
|
|
33
|
-
amount: { type: Number, required: true }
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
|
-
}
|
|
33
|
+
amount: { type: Number, required: true }
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
37
|
],
|
|
38
38
|
status: {
|
|
39
39
|
type: String,
|
|
40
40
|
enum: ['active', 'ended', 'paid', 'canceled'],
|
|
41
|
-
default: 'active'
|
|
41
|
+
default: 'active'
|
|
42
42
|
},
|
|
43
43
|
autolock: {
|
|
44
44
|
type: Date,
|
|
45
45
|
required: false,
|
|
46
|
-
default: null
|
|
47
|
-
}
|
|
46
|
+
default: null
|
|
47
|
+
}
|
|
48
48
|
}, { timestamps: true });
|
|
49
49
|
exports.PredictionSchema.index({ predictionId: 1, guildId: 1 }, { unique: true });
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
import { TRaffle } from '../types';
|
|
3
|
+
export declare const RaffleSchema: Schema<TRaffle, import("mongoose").Model<TRaffle, any, any, any, (import("mongoose").Document<unknown, any, TRaffle, any, import("mongoose").DefaultSchemaOptions> & TRaffle & {
|
|
4
|
+
_id: import("mongoose").Types.ObjectId;
|
|
5
|
+
} & {
|
|
6
|
+
__v: number;
|
|
7
|
+
} & {
|
|
8
|
+
id: string;
|
|
9
|
+
}) | (import("mongoose").Document<unknown, any, TRaffle, any, import("mongoose").DefaultSchemaOptions> & TRaffle & {
|
|
10
|
+
_id: import("mongoose").Types.ObjectId;
|
|
11
|
+
} & {
|
|
12
|
+
__v: number;
|
|
13
|
+
}), any, TRaffle>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
14
|
+
id: string;
|
|
15
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
16
|
+
_id: import("mongoose").Types.ObjectId;
|
|
17
|
+
} & {
|
|
18
|
+
__v: number;
|
|
19
|
+
}, "id"> & {
|
|
20
|
+
id: string;
|
|
21
|
+
}, {
|
|
22
|
+
drawId?: import("mongoose").SchemaDefinitionProperty<string, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
23
|
+
id: string;
|
|
24
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
25
|
+
_id: import("mongoose").Types.ObjectId;
|
|
26
|
+
} & {
|
|
27
|
+
__v: number;
|
|
28
|
+
}, "id"> & {
|
|
29
|
+
id: string;
|
|
30
|
+
}> | undefined;
|
|
31
|
+
raffleId?: import("mongoose").SchemaDefinitionProperty<string, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
32
|
+
id: string;
|
|
33
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
34
|
+
_id: import("mongoose").Types.ObjectId;
|
|
35
|
+
} & {
|
|
36
|
+
__v: number;
|
|
37
|
+
}, "id"> & {
|
|
38
|
+
id: string;
|
|
39
|
+
}> | undefined;
|
|
40
|
+
guildId?: import("mongoose").SchemaDefinitionProperty<string, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
41
|
+
id: string;
|
|
42
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
43
|
+
_id: import("mongoose").Types.ObjectId;
|
|
44
|
+
} & {
|
|
45
|
+
__v: number;
|
|
46
|
+
}, "id"> & {
|
|
47
|
+
id: string;
|
|
48
|
+
}> | undefined;
|
|
49
|
+
channelId?: import("mongoose").SchemaDefinitionProperty<string, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
50
|
+
id: string;
|
|
51
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
52
|
+
_id: import("mongoose").Types.ObjectId;
|
|
53
|
+
} & {
|
|
54
|
+
__v: number;
|
|
55
|
+
}, "id"> & {
|
|
56
|
+
id: string;
|
|
57
|
+
}> | undefined;
|
|
58
|
+
creatorId?: import("mongoose").SchemaDefinitionProperty<string, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
59
|
+
id: string;
|
|
60
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
61
|
+
_id: import("mongoose").Types.ObjectId;
|
|
62
|
+
} & {
|
|
63
|
+
__v: number;
|
|
64
|
+
}, "id"> & {
|
|
65
|
+
id: string;
|
|
66
|
+
}> | undefined;
|
|
67
|
+
ticketPrice?: import("mongoose").SchemaDefinitionProperty<number, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
68
|
+
id: string;
|
|
69
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
70
|
+
_id: import("mongoose").Types.ObjectId;
|
|
71
|
+
} & {
|
|
72
|
+
__v: number;
|
|
73
|
+
}, "id"> & {
|
|
74
|
+
id: string;
|
|
75
|
+
}> | undefined;
|
|
76
|
+
maxTicketsPerUser?: import("mongoose").SchemaDefinitionProperty<number, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
77
|
+
id: string;
|
|
78
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
79
|
+
_id: import("mongoose").Types.ObjectId;
|
|
80
|
+
} & {
|
|
81
|
+
__v: number;
|
|
82
|
+
}, "id"> & {
|
|
83
|
+
id: string;
|
|
84
|
+
}> | undefined;
|
|
85
|
+
nextDrawAt?: import("mongoose").SchemaDefinitionProperty<Date, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
86
|
+
id: string;
|
|
87
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
88
|
+
_id: import("mongoose").Types.ObjectId;
|
|
89
|
+
} & {
|
|
90
|
+
__v: number;
|
|
91
|
+
}, "id"> & {
|
|
92
|
+
id: string;
|
|
93
|
+
}> | undefined;
|
|
94
|
+
lastDrawAt?: import("mongoose").SchemaDefinitionProperty<Date | undefined, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
95
|
+
id: string;
|
|
96
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
97
|
+
_id: import("mongoose").Types.ObjectId;
|
|
98
|
+
} & {
|
|
99
|
+
__v: number;
|
|
100
|
+
}, "id"> & {
|
|
101
|
+
id: string;
|
|
102
|
+
}> | undefined;
|
|
103
|
+
drawIntervalMs?: import("mongoose").SchemaDefinitionProperty<number, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
104
|
+
id: string;
|
|
105
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
106
|
+
_id: import("mongoose").Types.ObjectId;
|
|
107
|
+
} & {
|
|
108
|
+
__v: number;
|
|
109
|
+
}, "id"> & {
|
|
110
|
+
id: string;
|
|
111
|
+
}> | undefined;
|
|
112
|
+
status?: import("mongoose").SchemaDefinitionProperty<"active" | "canceled", TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
113
|
+
id: string;
|
|
114
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
115
|
+
_id: import("mongoose").Types.ObjectId;
|
|
116
|
+
} & {
|
|
117
|
+
__v: number;
|
|
118
|
+
}, "id"> & {
|
|
119
|
+
id: string;
|
|
120
|
+
}> | undefined;
|
|
121
|
+
participants?: import("mongoose").SchemaDefinitionProperty<{
|
|
122
|
+
userId: string;
|
|
123
|
+
tickets: number;
|
|
124
|
+
}[], TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
125
|
+
id: string;
|
|
126
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
127
|
+
_id: import("mongoose").Types.ObjectId;
|
|
128
|
+
} & {
|
|
129
|
+
__v: number;
|
|
130
|
+
}, "id"> & {
|
|
131
|
+
id: string;
|
|
132
|
+
}> | undefined;
|
|
133
|
+
createdAt?: import("mongoose").SchemaDefinitionProperty<Date, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
134
|
+
id: string;
|
|
135
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
136
|
+
_id: import("mongoose").Types.ObjectId;
|
|
137
|
+
} & {
|
|
138
|
+
__v: number;
|
|
139
|
+
}, "id"> & {
|
|
140
|
+
id: string;
|
|
141
|
+
}> | undefined;
|
|
142
|
+
updatedAt?: import("mongoose").SchemaDefinitionProperty<Date, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
143
|
+
id: string;
|
|
144
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
145
|
+
_id: import("mongoose").Types.ObjectId;
|
|
146
|
+
} & {
|
|
147
|
+
__v: number;
|
|
148
|
+
}, "id"> & {
|
|
149
|
+
id: string;
|
|
150
|
+
}> | undefined;
|
|
151
|
+
}, TRaffle>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RaffleSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
exports.RaffleSchema = new mongoose_1.Schema({
|
|
6
|
+
drawId: { type: String, required: true },
|
|
7
|
+
raffleId: { type: String, required: true },
|
|
8
|
+
guildId: { type: String, required: true, index: true },
|
|
9
|
+
channelId: { type: String, required: true },
|
|
10
|
+
creatorId: { type: String, required: true },
|
|
11
|
+
ticketPrice: { type: Number, required: true, min: 1 },
|
|
12
|
+
maxTicketsPerUser: { type: Number, required: true, min: 1 },
|
|
13
|
+
nextDrawAt: { type: Date, required: true },
|
|
14
|
+
lastDrawAt: { type: Date },
|
|
15
|
+
drawIntervalMs: { type: Number, required: true, min: 1 },
|
|
16
|
+
status: {
|
|
17
|
+
type: String,
|
|
18
|
+
enum: ['active', 'canceled'],
|
|
19
|
+
default: 'active',
|
|
20
|
+
index: true
|
|
21
|
+
},
|
|
22
|
+
participants: [
|
|
23
|
+
{
|
|
24
|
+
userId: { type: String, required: true },
|
|
25
|
+
tickets: { type: Number, required: true, min: 1 }
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}, { timestamps: true });
|
|
29
|
+
exports.RaffleSchema.index({ raffleId: 1 }, { unique: true });
|
|
@@ -64,7 +64,7 @@ export declare const TransactionSchema: Schema<TTransaction, import("mongoose").
|
|
|
64
64
|
}, "id"> & {
|
|
65
65
|
id: string;
|
|
66
66
|
}> | undefined;
|
|
67
|
-
meta?: import("mongoose").SchemaDefinitionProperty<Record<string,
|
|
67
|
+
meta?: import("mongoose").SchemaDefinitionProperty<Record<string, unknown> | undefined, TTransaction, import("mongoose").Document<unknown, {}, TTransaction, {
|
|
68
68
|
id: string;
|
|
69
69
|
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TTransaction & {
|
|
70
70
|
_id: import("mongoose").Types.ObjectId;
|
|
@@ -8,9 +8,9 @@ exports.VipRoomSchema = new mongoose_1.Schema({
|
|
|
8
8
|
channelId: { type: String, required: true },
|
|
9
9
|
memberIds: {
|
|
10
10
|
type: [String],
|
|
11
|
-
default: []
|
|
11
|
+
default: []
|
|
12
12
|
},
|
|
13
|
-
expiresAt: { type: Date, required: true }
|
|
13
|
+
expiresAt: { type: Date, required: true }
|
|
14
14
|
}, { timestamps: true });
|
|
15
15
|
exports.VipRoomSchema.index({ expiresAt: 1 });
|
|
16
16
|
exports.VipRoomSchema.index({ ownerId: 1, guildId: 1 }, { unique: true });
|
package/dist/schemas/forms.js
CHANGED
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.bonusFormSchema = exports.globalSettingsFormSchema = exports.managerRoleFormSchema = exports.vipSettingsFormSchema = exports.casinoSettingsSchema = exports.channelsFormSchema = exports.raffleChannelsFormSchema = exports.predictionChannelsFormSchema = exports.casinoChannelsFormSchema = exports.atmChannelsFormSchema = void 0;
|
|
7
7
|
const zod_1 = __importDefault(require("zod"));
|
|
8
|
-
const commonTimezones_1 = require("../constants/commonTimezones");
|
|
9
8
|
const bonusLimits_1 = require("../constants/bonusLimits");
|
|
9
|
+
const commonTimezones_1 = require("../constants/commonTimezones");
|
|
10
10
|
const plinkoConfig_1 = require("../constants/plinkoConfig");
|
|
11
11
|
const NO_CHANNEL = 'At least one channel must be selected.';
|
|
12
12
|
exports.atmChannelsFormSchema = zod_1.default.object({
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
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/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -19,5 +19,8 @@ __exportStar(require("./vipRoom"), exports);
|
|
|
19
19
|
__exportStar(require("./prediction"), exports);
|
|
20
20
|
__exportStar(require("./transaction"), exports);
|
|
21
21
|
__exportStar(require("./guildConfiguration"), exports);
|
|
22
|
+
__exportStar(require("./atmRequest"), exports);
|
|
23
|
+
__exportStar(require("./raffle"), exports);
|
|
24
|
+
__exportStar(require("./blackjackGame"), exports);
|
|
22
25
|
// No db
|
|
23
26
|
__exportStar(require("./bonus"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
};
|
|
@@ -4,7 +4,7 @@ export type TTransaction = {
|
|
|
4
4
|
amount: number;
|
|
5
5
|
type: 'deposit' | 'withdraw' | 'bet' | 'win' | 'refund' | 'bonus' | 'vip';
|
|
6
6
|
source: 'command' | 'manual' | 'web' | 'system' | 'casino';
|
|
7
|
-
meta?: Record<string,
|
|
7
|
+
meta?: Record<string, unknown>;
|
|
8
8
|
betId?: string;
|
|
9
9
|
handledBy?: string;
|
|
10
10
|
createdAt: Date;
|
|
@@ -8,8 +8,7 @@ const getCycleLength = (rewardMode, baseReward, maxReward, streakIncrement, stre
|
|
|
8
8
|
: 1;
|
|
9
9
|
}
|
|
10
10
|
return streakMultiplier > 1
|
|
11
|
-
? Math.floor(Math.log(maxReward / baseReward) / Math.log(streakMultiplier)) +
|
|
12
|
-
1
|
|
11
|
+
? Math.floor(Math.log(maxReward / baseReward) / Math.log(streakMultiplier)) + 1
|
|
13
12
|
: 1;
|
|
14
13
|
};
|
|
15
14
|
const calculateBonusReward = ({ streak, settings }) => {
|
|
@@ -20,8 +20,7 @@ const normalizeCurrencySymbol = (value) => {
|
|
|
20
20
|
const normalizeCurrencyPlacement = (value) => value === 'suffix' ? 'suffix' : 'prefix';
|
|
21
21
|
const normalizeTimezone = (value) => {
|
|
22
22
|
const raw = typeof value === 'string' ? value.trim() : '';
|
|
23
|
-
if (raw.length > 0 &&
|
|
24
|
-
constants_1.COMMON_TIMEZONES.includes(raw)) {
|
|
23
|
+
if (raw.length > 0 && constants_1.COMMON_TIMEZONES.includes(raw)) {
|
|
25
24
|
return raw;
|
|
26
25
|
}
|
|
27
26
|
return constants_1.defaultGlobalSettings.timezone;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gambling-bot-shared",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.52",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,25 +25,38 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "tsc -p tsconfig.json",
|
|
27
27
|
"dev": "tsc -p tsconfig.json --watch",
|
|
28
|
+
"format:check": "prettier --check \"src/**/*.ts\"",
|
|
29
|
+
"format:fix": "prettier --write \"src/**/*.ts\"",
|
|
30
|
+
"lint:check": "eslint src --max-warnings 0",
|
|
31
|
+
"lint:fix": "eslint src --fix --max-warnings 0",
|
|
32
|
+
"type:check": "tsc --noEmit",
|
|
33
|
+
"check": "pnpm format:check && pnpm lint:check && pnpm type:check",
|
|
28
34
|
"prepublishOnly": "pnpm build",
|
|
29
35
|
"prepare": "bash scripts/setup-git-hooks.sh",
|
|
30
36
|
"link-local": "bash scripts/link-local.sh",
|
|
31
37
|
"unlink-local": "bash scripts/unlink-local.sh",
|
|
32
38
|
"link-status": "bash scripts/shared-link-status.sh",
|
|
39
|
+
"setup-workspace": "bash scripts/setup-workspace.sh",
|
|
33
40
|
"release": "bash scripts/release.sh",
|
|
34
|
-
"publish-and-bump-projects": "bash scripts/
|
|
41
|
+
"publish-and-bump-projects": "bash scripts/publish-to-npm.sh",
|
|
35
42
|
"publish-to-npm": "bash scripts/publish-to-npm.sh"
|
|
36
43
|
},
|
|
37
44
|
"peerDependencies": {
|
|
38
45
|
"mongoose": "^9.0.0"
|
|
39
46
|
},
|
|
40
47
|
"devDependencies": {
|
|
48
|
+
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
|
|
41
49
|
"@types/luxon": "^3.7.1",
|
|
50
|
+
"@typescript-eslint/eslint-plugin": "^8.59.4",
|
|
51
|
+
"@typescript-eslint/parser": "^8.59.4",
|
|
52
|
+
"eslint": "^10.4.0",
|
|
42
53
|
"mongoose": "^9.1.4",
|
|
54
|
+
"prettier": "^3.8.3",
|
|
43
55
|
"typescript": "^5.9.3"
|
|
44
56
|
},
|
|
45
57
|
"dependencies": {
|
|
46
58
|
"luxon": "^3.7.2",
|
|
47
59
|
"zod": "^4.3.6"
|
|
48
|
-
}
|
|
60
|
+
},
|
|
61
|
+
"packageManager": "pnpm@10.28.0"
|
|
49
62
|
}
|