gambling-bot-shared 0.1.43 → 0.1.44

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.
@@ -105,7 +105,7 @@ export declare const bonusFormSchema: z.ZodObject<{
105
105
  }>;
106
106
  baseReward: z.ZodNumber;
107
107
  streakIncrement: z.ZodOptional<z.ZodNumber>;
108
- streakMultiplier: z.ZodOptional<z.ZodNumber>;
108
+ streakMultiplier: z.ZodPreprocess<z.ZodOptional<z.ZodNumber>>;
109
109
  maxReward: z.ZodNumber;
110
110
  resetOnMax: z.ZodBoolean;
111
111
  milestoneBonus: z.ZodObject<{
@@ -109,11 +109,17 @@ exports.bonusFormSchema = zod_1.default.object({
109
109
  rewardMode: zod_1.default.enum(['linear', 'exponential']),
110
110
  baseReward: bonusAmountSchema,
111
111
  streakIncrement: bonusAmountSchema.optional(),
112
- streakMultiplier: zod_1.default
112
+ streakMultiplier: zod_1.default.preprocess((val) => {
113
+ if (val === '' || val === undefined || val === null)
114
+ return undefined;
115
+ if (typeof val === 'string')
116
+ return Number(val);
117
+ return val;
118
+ }, zod_1.default
113
119
  .number()
114
120
  .min(0, 'Must be ≥ 0')
115
121
  .max(bonusLimits_1.BONUS_MAX_STREAK_MULTIPLIER, `Must be ≤ ${bonusLimits_1.BONUS_MAX_STREAK_MULTIPLIER}`)
116
- .optional(),
122
+ .optional()),
117
123
  maxReward: bonusAmountSchema,
118
124
  resetOnMax: zod_1.default.boolean(),
119
125
  milestoneBonus: zod_1.default.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gambling-bot-shared",
3
- "version": "0.1.43",
3
+ "version": "0.1.44",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "MIT",