volleyballsimtypes 0.0.369 → 0.0.372

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.
@@ -9,6 +9,7 @@ export type AutoDismissSettings = Record<string, AutoDismissRarityConfig>;
9
9
  export interface UserSettingsAttributes {
10
10
  user_id: string;
11
11
  auto_dismiss: AutoDismissSettings;
12
+ locale: string | null;
12
13
  }
13
14
  export type UserSettingsPk = 'user_id';
14
15
  export type UserSettingsId = UserSettingsModel[UserSettingsPk];
@@ -16,6 +17,7 @@ export type UserSettingsCreationAttributes = UserSettingsAttributes;
16
17
  export declare class UserSettingsModel extends Model<UserSettingsAttributes, UserSettingsCreationAttributes> implements UserSettingsAttributes {
17
18
  user_id: string;
18
19
  auto_dismiss: AutoDismissSettings;
20
+ locale: string | null;
19
21
  user: AuthUserModel;
20
22
  getUser: Sequelize.BelongsToGetAssociationMixin<AuthUserModel>;
21
23
  setUser: Sequelize.BelongsToSetAssociationMixin<AuthUserModel, AuthUserId>;
@@ -18,6 +18,11 @@ class UserSettingsModel extends sequelize_1.Model {
18
18
  type: sequelize_1.DataTypes.JSONB,
19
19
  allowNull: false,
20
20
  defaultValue: {}
21
+ },
22
+ locale: {
23
+ type: sequelize_1.DataTypes.STRING(8),
24
+ allowNull: true,
25
+ defaultValue: null
21
26
  }
22
27
  }, {
23
28
  sequelize,
@@ -2,3 +2,4 @@ export * from './team';
2
2
  export * from './team-generator';
3
3
  export * from './formation';
4
4
  export * from './tactics';
5
+ export * from './team-name';
@@ -18,3 +18,4 @@ __exportStar(require("./team"), exports);
18
18
  __exportStar(require("./team-generator"), exports);
19
19
  __exportStar(require("./formation"), exports);
20
20
  __exportStar(require("./tactics"), exports);
21
+ __exportStar(require("./team-name"), exports);
@@ -0,0 +1,15 @@
1
+ export declare const TEAM_NAME_MIN_LENGTH = 3;
2
+ export declare const TEAM_NAME_MAX_LENGTH = 40;
3
+ /**
4
+ * Allowed team-name characters: Unicode letters (any script — Latin incl. ñ and
5
+ * Polish letters, Cyrillic, Greek, etc.), combining marks, digits, spaces, and
6
+ * basic name punctuation (hyphen, apostrophe, period).
7
+ */
8
+ export declare const TEAM_NAME_PATTERN: RegExp;
9
+ /** Trim surrounding whitespace and normalise to NFC for consistent Unicode handling. */
10
+ export declare function normalizeTeamName(raw: string): string;
11
+ /**
12
+ * Validate a raw (untrimmed) team name. Normalises first (NFC + trim), then checks
13
+ * length, the allowed character set, and that it contains at least one letter or digit.
14
+ */
15
+ export declare function isValidTeamName(raw: string): boolean;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TEAM_NAME_PATTERN = exports.TEAM_NAME_MAX_LENGTH = exports.TEAM_NAME_MIN_LENGTH = void 0;
4
+ exports.normalizeTeamName = normalizeTeamName;
5
+ exports.isValidTeamName = isValidTeamName;
6
+ exports.TEAM_NAME_MIN_LENGTH = 3;
7
+ exports.TEAM_NAME_MAX_LENGTH = 40;
8
+ /**
9
+ * Allowed team-name characters: Unicode letters (any script — Latin incl. ñ and
10
+ * Polish letters, Cyrillic, Greek, etc.), combining marks, digits, spaces, and
11
+ * basic name punctuation (hyphen, apostrophe, period).
12
+ */
13
+ exports.TEAM_NAME_PATTERN = /^[\p{L}\p{M}\p{N} .'-]+$/u;
14
+ const HAS_ALPHANUMERIC = /[\p{L}\p{N}]/u;
15
+ /** Trim surrounding whitespace and normalise to NFC for consistent Unicode handling. */
16
+ function normalizeTeamName(raw) {
17
+ return raw.normalize('NFC').trim();
18
+ }
19
+ /**
20
+ * Validate a raw (untrimmed) team name. Normalises first (NFC + trim), then checks
21
+ * length, the allowed character set, and that it contains at least one letter or digit.
22
+ */
23
+ function isValidTeamName(raw) {
24
+ const name = normalizeTeamName(raw);
25
+ return (name.length >= exports.TEAM_NAME_MIN_LENGTH &&
26
+ name.length <= exports.TEAM_NAME_MAX_LENGTH &&
27
+ exports.TEAM_NAME_PATTERN.test(name) &&
28
+ HAS_ALPHANUMERIC.test(name));
29
+ }
@@ -9,6 +9,7 @@ export type AutoDismissSettings = Record<string, AutoDismissRarityConfig>;
9
9
  export interface UserSettingsAttributes {
10
10
  user_id: string;
11
11
  auto_dismiss: AutoDismissSettings;
12
+ locale: string | null;
12
13
  }
13
14
  export type UserSettingsPk = 'user_id';
14
15
  export type UserSettingsId = UserSettingsModel[UserSettingsPk];
@@ -16,6 +17,7 @@ export type UserSettingsCreationAttributes = UserSettingsAttributes;
16
17
  export declare class UserSettingsModel extends Model<UserSettingsAttributes, UserSettingsCreationAttributes> implements UserSettingsAttributes {
17
18
  user_id: string;
18
19
  auto_dismiss: AutoDismissSettings;
20
+ locale: string | null;
19
21
  user: AuthUserModel;
20
22
  getUser: Sequelize.BelongsToGetAssociationMixin<AuthUserModel>;
21
23
  setUser: Sequelize.BelongsToSetAssociationMixin<AuthUserModel, AuthUserId>;
@@ -15,6 +15,11 @@ export class UserSettingsModel extends Model {
15
15
  type: DataTypes.JSONB,
16
16
  allowNull: false,
17
17
  defaultValue: {}
18
+ },
19
+ locale: {
20
+ type: DataTypes.STRING(8),
21
+ allowNull: true,
22
+ defaultValue: null
18
23
  }
19
24
  }, {
20
25
  sequelize,
@@ -2,3 +2,4 @@ export * from './team';
2
2
  export * from './team-generator';
3
3
  export * from './formation';
4
4
  export * from './tactics';
5
+ export * from './team-name';
@@ -2,3 +2,4 @@ export * from './team';
2
2
  export * from './team-generator';
3
3
  export * from './formation';
4
4
  export * from './tactics';
5
+ export * from './team-name';
@@ -0,0 +1,15 @@
1
+ export declare const TEAM_NAME_MIN_LENGTH = 3;
2
+ export declare const TEAM_NAME_MAX_LENGTH = 40;
3
+ /**
4
+ * Allowed team-name characters: Unicode letters (any script — Latin incl. ñ and
5
+ * Polish letters, Cyrillic, Greek, etc.), combining marks, digits, spaces, and
6
+ * basic name punctuation (hyphen, apostrophe, period).
7
+ */
8
+ export declare const TEAM_NAME_PATTERN: RegExp;
9
+ /** Trim surrounding whitespace and normalise to NFC for consistent Unicode handling. */
10
+ export declare function normalizeTeamName(raw: string): string;
11
+ /**
12
+ * Validate a raw (untrimmed) team name. Normalises first (NFC + trim), then checks
13
+ * length, the allowed character set, and that it contains at least one letter or digit.
14
+ */
15
+ export declare function isValidTeamName(raw: string): boolean;
@@ -0,0 +1,24 @@
1
+ export const TEAM_NAME_MIN_LENGTH = 3;
2
+ export const TEAM_NAME_MAX_LENGTH = 40;
3
+ /**
4
+ * Allowed team-name characters: Unicode letters (any script — Latin incl. ñ and
5
+ * Polish letters, Cyrillic, Greek, etc.), combining marks, digits, spaces, and
6
+ * basic name punctuation (hyphen, apostrophe, period).
7
+ */
8
+ export const TEAM_NAME_PATTERN = /^[\p{L}\p{M}\p{N} .'-]+$/u;
9
+ const HAS_ALPHANUMERIC = /[\p{L}\p{N}]/u;
10
+ /** Trim surrounding whitespace and normalise to NFC for consistent Unicode handling. */
11
+ export function normalizeTeamName(raw) {
12
+ return raw.normalize('NFC').trim();
13
+ }
14
+ /**
15
+ * Validate a raw (untrimmed) team name. Normalises first (NFC + trim), then checks
16
+ * length, the allowed character set, and that it contains at least one letter or digit.
17
+ */
18
+ export function isValidTeamName(raw) {
19
+ const name = normalizeTeamName(raw);
20
+ return (name.length >= TEAM_NAME_MIN_LENGTH &&
21
+ name.length <= TEAM_NAME_MAX_LENGTH &&
22
+ TEAM_NAME_PATTERN.test(name) &&
23
+ HAS_ALPHANUMERIC.test(name));
24
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volleyballsimtypes",
3
- "version": "0.0.369",
3
+ "version": "0.0.372",
4
4
  "description": "vbsim types",
5
5
  "main": "./dist/cjs/src/index.js",
6
6
  "module": "./dist/esm/src/index.js",