shufflecom-calculations 6.1.0 → 6.1.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shufflecom-calculations",
3
- "version": "6.1.0",
3
+ "version": "6.1.1",
4
4
  "description": "",
5
5
  "types": "lib/index.d.ts",
6
6
  "main": "lib/index.js",
@@ -16,5 +16,5 @@
16
16
  },
17
17
  "author": "",
18
18
  "license": "ISC",
19
- "gitHead": "cf8a037f371d7155f6aa0d69c936ba0e8e54d2d8"
19
+ "gitHead": "dd9157e7b4391a95f9477dc534170432ddb7132b"
20
20
  }
@@ -25,3 +25,10 @@ export const NO_INVISIBLE_CHAR_REGEX = /^[^\u2800\uFFA0\u115F\u1160\u3164]*$/;
25
25
  export const US_PHONE_NUMBER_REGEX = /^\+1\d{10}$/;
26
26
  // E.164 international phone number: leading +, first digit 1-9, total 7-15 digits
27
27
  export const E164_PHONE_NUMBER_REGEX = /^\+[1-9]\d{6,14}$/;
28
+ // Brazilian CPF (digits only, no formatting)
29
+ export const CPF_REGEX = /^\d{11}$/;
30
+ // Mexican CURP (18 alphanumeric chars)
31
+ export const CURP_REGEX = /^[A-Z0-9]{18}$/i;
32
+ // Argentine CUIL/CUIT: 11 digits, no formatting, leading with a valid person/entity
33
+ // prefix (20-27 individuals, 30/33/34 legal entities)
34
+ export const CUIL_CUIT_REGEX = /^(20|23|24|25|26|27|30|33|34)\d{9}$/;
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  ADDRESS_URL_REGEX,
3
+ CUIL_CUIT_REGEX,
3
4
  HEX_COLOR_CODE_REGEX,
4
5
  NO_INVISIBLE_CHAR_REGEX,
5
6
  PROMOTION_CODE_REGEX,
@@ -11,6 +12,25 @@ import {
11
12
  } from '.';
12
13
 
13
14
  describe('regex', () => {
15
+ describe('CUIL_CUIT_REGEX', () => {
16
+ it('accepts 11 digits with a valid individual or entity prefix', () => {
17
+ expect(CUIL_CUIT_REGEX.test('20123456789')).toBe(true);
18
+ expect(CUIL_CUIT_REGEX.test('27123456789')).toBe(true);
19
+ expect(CUIL_CUIT_REGEX.test('30123456789')).toBe(true);
20
+ });
21
+
22
+ it('rejects an invalid leading prefix', () => {
23
+ expect(CUIL_CUIT_REGEX.test('19123456789')).toBe(false);
24
+ expect(CUIL_CUIT_REGEX.test('28123456789')).toBe(false);
25
+ });
26
+
27
+ it('rejects wrong length or non-digits', () => {
28
+ expect(CUIL_CUIT_REGEX.test('2012345678')).toBe(false); // 10 digits
29
+ expect(CUIL_CUIT_REGEX.test('201234567890')).toBe(false); // 12 digits
30
+ expect(CUIL_CUIT_REGEX.test('20-12345678-9')).toBe(false); // formatted
31
+ });
32
+ });
33
+
14
34
  describe('PWD_REGEX', () => {
15
35
  it('should not allow passwords with less than 8 characters', () => {
16
36
  expect(PWD_REGEX.test('abcdef1')).toBe(false);
@@ -3,6 +3,7 @@ import { Currency } from '../utils/currency';
3
3
  import {
4
4
  MatchStatusParts,
5
5
  Sports,
6
+ SportsBetCashoutButtonState,
6
7
  SportsBetLegType,
7
8
  SportsBetSelectionStatus,
8
9
  SportsBetStatus,
@@ -133,11 +134,38 @@ export interface SportsBetSettlementV3 {
133
134
  createdAt: string;
134
135
  }
135
136
 
137
+ /**
138
+ * @deprecated use SportsBetCashoutInfoV3
139
+ */
136
140
  export interface SportsBetCashoutAvailableV3 {
137
141
  canCashout: boolean;
138
142
  reason: SportsCashoutFailedReason | null;
139
143
  }
140
144
 
145
+ export interface SportsBetCashoutInfoV3 {
146
+ /** Non-null exactly when playerCashoutEnabled is ENABLED. */
147
+ cashoutOddsDecimal: string | null;
148
+ playerCashoutEnabled: SportsBetCashoutButtonState;
149
+ }
150
+
151
+ export interface CashoutSportsBetPayloadV2 {
152
+ id: string; // bs58
153
+ currency: Currency;
154
+ amount: string;
155
+ status: SportsBetStatus;
156
+ settlement: { payoutOddsDecimal: string; payout: string };
157
+ }
158
+
159
+ export interface SportsBetUpdatedPayloadV2 {
160
+ id: string; // bs58
161
+ status: SportsBetStatus;
162
+ settlement: { payout: string; payoutOddsDecimal: string } | null;
163
+ legs: {
164
+ displayStatus: SportsBetSelectionStatus;
165
+ selections: { id: string; status: SportsBetSelectionStatus }[];
166
+ }[];
167
+ }
168
+
141
169
  export interface SportsBetUserV3 {
142
170
  id: string;
143
171
  username: string;
@@ -157,9 +185,19 @@ export interface SportsBetPayloadV3 {
157
185
  updatedAt: string;
158
186
  createdAt: string;
159
187
  actualOddsDecimal: string;
188
+ cashoutInfo: SportsBetCashoutInfoV3;
189
+ /**
190
+ * @deprecated use cashoutInfo.cashoutOddsDecimal
191
+ */
160
192
  cashoutOddsDecimal: string | null;
193
+ /**
194
+ * @deprecated folded into cashoutInfo.playerCashoutEnabled as OUTRIGHT_NOT_ALLOWED_CASHOUT
195
+ */
161
196
  providerCashoutDisabled: boolean;
162
197
  settlement: SportsBetSettlementV3 | null;
198
+ /**
199
+ * @deprecated use cashoutInfo
200
+ */
163
201
  cashoutAvailable: SportsBetCashoutAvailableV3;
164
202
  user: SportsBetUserV3 | null;
165
203
  legs: SportsBetLegV3[];
@@ -97,6 +97,18 @@ export enum SportsCashoutFailedReason {
97
97
  SPORTS_MARKET_CASHOUT_NOT_ENABLED = 'SPORTS_MARKET_CASHOUT_NOT_ENABLED',
98
98
  BOOSTED_BET_NOT_ALLOWED_CASHOUT = 'BOOSTED_BET_NOT_ALLOWED_CASHOUT',
99
99
  CUSTOM_BET_NOT_ALLOWED_CASHOUT = 'CUSTOM_BET_NOT_ALLOWED_CASHOUT',
100
+ OTC_BET_NOT_ALLOWED_CASHOUT = 'OTC_BET_NOT_ALLOWED_CASHOUT',
101
+ CROSS_PROVIDERS_NOT_ALLOWED_CASHOUT = 'CROSS_PROVIDERS_NOT_ALLOWED_CASHOUT',
102
+ OUTRIGHT_NOT_ALLOWED_CASHOUT = 'OUTRIGHT_NOT_ALLOWED_CASHOUT',
103
+ SPORTS_CASHOUT_DISABLED = 'SPORTS_CASHOUT_DISABLED',
104
+ SPORTS_MAINTENANCE = 'SPORTS_MAINTENANCE',
105
+ CASHOUT_MARGIN_CAP_HIT = 'CASHOUT_MARGIN_CAP_HIT',
106
+ }
107
+
108
+ export enum SportsBetCashoutButtonState {
109
+ ENABLED = 'ENABLED',
110
+ SUSPENDED = 'SUSPENDED',
111
+ HIDDEN = 'HIDDEN',
100
112
  }
101
113
 
102
114
  export enum SportsBetType {