feat(phase1): rebrand to TTRPG Player and drop Git updates feed
Rename product to TTRPG Player (TTRPGPlayer / com.ttrpgplayer.app), use .ttrpg.zip for new saves while keeping .dnd.zip import, accept TTRPG- and DND- license keys on client, and remove sync-update-feed plus CI push to DndGamePlayerUpdates. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,16 +1,20 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
|
||||
import { isDndProductKey } from './productKey';
|
||||
import { isProductKey } from './productKey';
|
||||
|
||||
void test('isDndProductKey: пример пользователя', () => {
|
||||
assert.equal(isDndProductKey('DND-CEBEC1BF-AD0B-4312-BFDD-675AFF5955FD'), true);
|
||||
void test('isProductKey: legacy DND prefix', () => {
|
||||
assert.equal(isProductKey('DND-CEBEC1BF-AD0B-4312-BFDD-675AFF5955FD'), true);
|
||||
});
|
||||
|
||||
void test('isDndProductKey: токен с точкой — нет', () => {
|
||||
assert.equal(isDndProductKey('eyJ.xxx'), false);
|
||||
void test('isProductKey: TTRPG prefix', () => {
|
||||
assert.equal(isProductKey('TTRPG-CEBEC1BF-AD0B-4312-BFDD-675AFF5955FD'), true);
|
||||
});
|
||||
|
||||
void test('isDndProductKey: пробелы по краям', () => {
|
||||
assert.equal(isDndProductKey(' DND-CEBEC1BF-AD0B-4312-BFDD-675AFF5955FD '), true);
|
||||
void test('isProductKey: token with dot — no', () => {
|
||||
assert.equal(isProductKey('eyJ.xxx'), false);
|
||||
});
|
||||
|
||||
void test('isProductKey: trimmed', () => {
|
||||
assert.equal(isProductKey(' TTRPG-CEBEC1BF-AD0B-4312-BFDD-675AFF5955FD '), true);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
/** Продуктовый ключ активации (не путать с лицензионным токеном `base64.base64`). */
|
||||
const TTRPG_PRODUCT_KEY_RE = /^TTRPG-[0-9A-F]{8}-(?:[0-9A-F]{4}-){3}[0-9A-F]{12}$/iu;
|
||||
const DND_PRODUCT_KEY_RE = /^DND-[0-9A-F]{8}-(?:[0-9A-F]{4}-){3}[0-9A-F]{12}$/iu;
|
||||
|
||||
export function isDndProductKey(s: string): boolean {
|
||||
return DND_PRODUCT_KEY_RE.test(s.trim());
|
||||
export function isProductKey(s: string): boolean {
|
||||
const t = s.trim();
|
||||
return TTRPG_PRODUCT_KEY_RE.test(t) || DND_PRODUCT_KEY_RE.test(t);
|
||||
}
|
||||
|
||||
/** @deprecated Используйте {@link isProductKey}. */
|
||||
export function isDndProductKey(s: string): boolean {
|
||||
return isProductKey(s);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user