front-back-poker-types 5.0.212 → 5.0.214

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/cjs/index.js CHANGED
@@ -543,17 +543,23 @@ var sleepTime = {
543
543
  startTournament: 10000,
544
544
  };
545
545
 
546
- /**
547
- * Кодирует строку UTF-8 в Base64 (без паддинга, +→-, /→_)
548
- */
549
546
  function encodeBase64(str) {
550
- return Buffer.from(str, 'utf-8').toString('base64');
547
+ return Buffer.from(str, 'utf-8')
548
+ .toString('base64')
549
+ .replace(/\+/g, '-')
550
+ .replace(/\//g, '_')
551
+ .replace(/=/g, '');
551
552
  }
552
553
  /**
553
- * Декодирует Base64 в строку UTF-8
554
+ * Декодирует Base64 (URL-safe) в строку UTF-8
554
555
  */
555
556
  function decodeBase64(base64) {
556
- return Buffer.from(base64, 'base64').toString('utf-8');
557
+ // Возвращаем URL-safe символы обратно в стандартный Base64
558
+ var normalized = base64.replace(/-/g, '+').replace(/_/g, '/');
559
+ // Восстанавливаем паддинг если нужно
560
+ var padding = (4 - (normalized.length % 4)) % 4;
561
+ normalized += '='.repeat(padding);
562
+ return Buffer.from(normalized, 'base64').toString('utf-8');
557
563
  }
558
564
  // буфер токена
559
565
  // ключ буфера текущий теймстемп / 10000 и первая цифра этого числа обуференый токен
@@ -1,8 +1,5 @@
1
- /**
2
- * Кодирует строку UTF-8 в Base64 (без паддинга, +→-, /→_)
3
- */
4
1
  export declare function encodeBase64(str: string): string;
5
2
  /**
6
- * Декодирует Base64 в строку UTF-8
3
+ * Декодирует Base64 (URL-safe) в строку UTF-8
7
4
  */
8
5
  export declare function decodeBase64(base64: string): string;
@@ -522,6 +522,7 @@ export type TournamentResultWSMessageToFront = {
522
522
  * Можно ли ребайнуться в турнире, только во время поздней регистрации
523
523
  */
524
524
  canRebuy: boolean | undefined;
525
+ tournamentId: number;
525
526
  };
526
527
  };
527
528
  export declare enum RoomWSErrorToFront {
package/dist/esm/index.js CHANGED
@@ -541,17 +541,23 @@ var sleepTime = {
541
541
  startTournament: 10000,
542
542
  };
543
543
 
544
- /**
545
- * Кодирует строку UTF-8 в Base64 (без паддинга, +→-, /→_)
546
- */
547
544
  function encodeBase64(str) {
548
- return Buffer.from(str, 'utf-8').toString('base64');
545
+ return Buffer.from(str, 'utf-8')
546
+ .toString('base64')
547
+ .replace(/\+/g, '-')
548
+ .replace(/\//g, '_')
549
+ .replace(/=/g, '');
549
550
  }
550
551
  /**
551
- * Декодирует Base64 в строку UTF-8
552
+ * Декодирует Base64 (URL-safe) в строку UTF-8
552
553
  */
553
554
  function decodeBase64(base64) {
554
- return Buffer.from(base64, 'base64').toString('utf-8');
555
+ // Возвращаем URL-safe символы обратно в стандартный Base64
556
+ var normalized = base64.replace(/-/g, '+').replace(/_/g, '/');
557
+ // Восстанавливаем паддинг если нужно
558
+ var padding = (4 - (normalized.length % 4)) % 4;
559
+ normalized += '='.repeat(padding);
560
+ return Buffer.from(normalized, 'base64').toString('utf-8');
555
561
  }
556
562
  // буфер токена
557
563
  // ключ буфера текущий теймстемп / 10000 и первая цифра этого числа обуференый токен
@@ -1,8 +1,5 @@
1
- /**
2
- * Кодирует строку UTF-8 в Base64 (без паддинга, +→-, /→_)
3
- */
4
1
  export declare function encodeBase64(str: string): string;
5
2
  /**
6
- * Декодирует Base64 в строку UTF-8
3
+ * Декодирует Base64 (URL-safe) в строку UTF-8
7
4
  */
8
5
  export declare function decodeBase64(base64: string): string;
@@ -522,6 +522,7 @@ export type TournamentResultWSMessageToFront = {
522
522
  * Можно ли ребайнуться в турнире, только во время поздней регистрации
523
523
  */
524
524
  canRebuy: boolean | undefined;
525
+ tournamentId: number;
525
526
  };
526
527
  };
527
528
  export declare enum RoomWSErrorToFront {
package/dist/index.d.ts CHANGED
@@ -1107,6 +1107,7 @@ type TournamentResultWSMessageToFront = {
1107
1107
  * Можно ли ребайнуться в турнире, только во время поздней регистрации
1108
1108
  */
1109
1109
  canRebuy: boolean | undefined;
1110
+ tournamentId: number;
1110
1111
  };
1111
1112
  };
1112
1113
  declare enum RoomWSErrorToFront {
@@ -1290,12 +1291,9 @@ declare const sleepTime: {
1290
1291
  startTournament: number;
1291
1292
  };
1292
1293
 
1293
- /**
1294
- * Кодирует строку UTF-8 в Base64 (без паддинга, +→-, /→_)
1295
- */
1296
1294
  declare function encodeBase64(str: string): string;
1297
1295
  /**
1298
- * Декодирует Base64 в строку UTF-8
1296
+ * Декодирует Base64 (URL-safe) в строку UTF-8
1299
1297
  */
1300
1298
  declare function decodeBase64(base64: string): string;
1301
1299
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "front-back-poker-types",
3
- "version": "5.0.212",
3
+ "version": "5.0.214",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "files": [