volleyballsimtypes 0.0.16 → 0.0.17

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.
@@ -4,7 +4,7 @@ import type { CountryId, CountryModel } from './country';
4
4
  import type { TeamId, TeamModel } from './team';
5
5
  export interface CoachAttributes {
6
6
  coach_id: string;
7
- formation: '4-2' | '6-2' | '5-1';
7
+ formation: formation;
8
8
  substitution_tolerance: number;
9
9
  first_name: string;
10
10
  last_name: string;
@@ -12,11 +12,12 @@ export interface CoachAttributes {
12
12
  }
13
13
  export type CoachPk = 'coach_id';
14
14
  export type CoachId = CoachModel[CoachPk];
15
+ export type formation = '4-2' | '6-2' | '5-1';
15
16
  export type CoachOptionalAttributes = 'substitution_tolerance';
16
17
  export type CoachCreationAttributes = Optional<CoachAttributes, CoachOptionalAttributes>;
17
18
  export declare class CoachModel extends Model<CoachAttributes, CoachCreationAttributes> implements CoachAttributes {
18
19
  coach_id: string;
19
- formation: '4-2' | '6-2' | '5-1';
20
+ formation: formation;
20
21
  substitution_tolerance: number;
21
22
  first_name: string;
22
23
  last_name: string;
@@ -1,5 +1,5 @@
1
1
  import { CoachAttributes, CoachModel } from '../models';
2
2
  import { Coach } from '../../service';
3
3
  declare function transformToAttributes(coach: Coach): CoachAttributes;
4
- declare function transformToObject(coach: CoachModel): Coach;
4
+ declare function transformToObject(model: CoachModel): Coach;
5
5
  export { transformToObject as transformToCoach, transformToAttributes as transformFromCoach };
@@ -15,16 +15,16 @@ function transformToAttributes(coach) {
15
15
  };
16
16
  }
17
17
  exports.transformFromCoach = transformToAttributes;
18
- function transformToObject(coach) {
18
+ function transformToObject(model) {
19
19
  return new service_1.Coach({
20
- id: coach.coach_id,
20
+ id: model.coach_id,
21
21
  name: {
22
- first: coach.first_name,
23
- last: coach.last_name
22
+ first: model.first_name,
23
+ last: model.last_name
24
24
  },
25
- country: (0, country_1.transformToCountry)(coach.country),
26
- substitutionTolerance: coach.substitution_tolerance != null ? coach.substitution_tolerance : undefined,
27
- formation: coach.formation != null ? (0, formation_1.transformToFormation)(coach.formation) : undefined
25
+ country: (0, country_1.transformToCountry)(model.country),
26
+ substitutionTolerance: model.substitution_tolerance != null ? model.substitution_tolerance : undefined,
27
+ formation: (0, formation_1.transformToFormation)(model.formation)
28
28
  });
29
29
  }
30
30
  exports.transformToCoach = transformToObject;
@@ -1,5 +1,5 @@
1
1
  import { Formation } from '../../service';
2
- type formation = '4-2' | '6-2' | '5-1';
3
- declare function transformToType(formation: Formation): formation;
4
- declare function transformFromType(formation: formation): Formation;
2
+ import { formation } from '../models/coach';
3
+ declare function transformToType(_formation: Formation): formation;
4
+ declare function transformFromType(_formation: formation): Formation;
5
5
  export { transformToType as transformFromFormation, transformFromType as transformToFormation };
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.transformToFormation = exports.transformFromFormation = void 0;
4
4
  const service_1 = require("../../service");
5
- function transformToType(formation) {
6
- return formation.name;
5
+ function transformToType(_formation) {
6
+ return _formation.name;
7
7
  }
8
8
  exports.transformFromFormation = transformToType;
9
- function transformFromType(formation) {
10
- return service_1.Formation[formation];
9
+ function transformFromType(_formation) {
10
+ return service_1.Formation[_formation];
11
11
  }
12
12
  exports.transformToFormation = transformFromType;
@@ -5,14 +5,14 @@ export interface CoachOpts {
5
5
  readonly id: string;
6
6
  readonly name: Name;
7
7
  readonly country: Country;
8
- readonly formation?: Formation;
8
+ readonly formation: Formation;
9
9
  readonly substitutionTolerance?: number;
10
10
  }
11
11
  export declare class Coach {
12
12
  readonly id: string;
13
13
  readonly name: Name;
14
14
  readonly country: Country;
15
- readonly formation?: Formation;
15
+ readonly formation: Formation;
16
16
  readonly substitutionTolerance?: number;
17
17
  constructor({ id, name, country, formation, substitutionTolerance }: CoachOpts);
18
18
  }
@@ -84,7 +84,7 @@ Formation['4-2'] = new Formation({
84
84
  'Outside Hitter': 10,
85
85
  'Opposite Hitter': 100,
86
86
  'Defensive Specialist': 1000,
87
- Setter: 10000,
87
+ [player_1.Role.SETTER]: 10000,
88
88
  Libero: 100000
89
89
  }
90
90
  });
@@ -4,7 +4,7 @@ import type { CountryId, CountryModel } from './country';
4
4
  import type { TeamId, TeamModel } from './team';
5
5
  export interface CoachAttributes {
6
6
  coach_id: string;
7
- formation: '4-2' | '6-2' | '5-1';
7
+ formation: formation;
8
8
  substitution_tolerance: number;
9
9
  first_name: string;
10
10
  last_name: string;
@@ -12,11 +12,12 @@ export interface CoachAttributes {
12
12
  }
13
13
  export type CoachPk = 'coach_id';
14
14
  export type CoachId = CoachModel[CoachPk];
15
+ export type formation = '4-2' | '6-2' | '5-1';
15
16
  export type CoachOptionalAttributes = 'substitution_tolerance';
16
17
  export type CoachCreationAttributes = Optional<CoachAttributes, CoachOptionalAttributes>;
17
18
  export declare class CoachModel extends Model<CoachAttributes, CoachCreationAttributes> implements CoachAttributes {
18
19
  coach_id: string;
19
- formation: '4-2' | '6-2' | '5-1';
20
+ formation: formation;
20
21
  substitution_tolerance: number;
21
22
  first_name: string;
22
23
  last_name: string;
@@ -1,5 +1,5 @@
1
1
  import { CoachAttributes, CoachModel } from '../models';
2
2
  import { Coach } from '../../service';
3
3
  declare function transformToAttributes(coach: Coach): CoachAttributes;
4
- declare function transformToObject(coach: CoachModel): Coach;
4
+ declare function transformToObject(model: CoachModel): Coach;
5
5
  export { transformToObject as transformToCoach, transformToAttributes as transformFromCoach };
@@ -11,16 +11,16 @@ function transformToAttributes(coach) {
11
11
  formation: transformFromFormation(coach.formation)
12
12
  };
13
13
  }
14
- function transformToObject(coach) {
14
+ function transformToObject(model) {
15
15
  return new Coach({
16
- id: coach.coach_id,
16
+ id: model.coach_id,
17
17
  name: {
18
- first: coach.first_name,
19
- last: coach.last_name
18
+ first: model.first_name,
19
+ last: model.last_name
20
20
  },
21
- country: transformToCountry(coach.country),
22
- substitutionTolerance: coach.substitution_tolerance != null ? coach.substitution_tolerance : undefined,
23
- formation: coach.formation != null ? transformToFormation(coach.formation) : undefined
21
+ country: transformToCountry(model.country),
22
+ substitutionTolerance: model.substitution_tolerance != null ? model.substitution_tolerance : undefined,
23
+ formation: transformToFormation(model.formation)
24
24
  });
25
25
  }
26
26
  export { transformToObject as transformToCoach, transformToAttributes as transformFromCoach };
@@ -1,5 +1,5 @@
1
1
  import { Formation } from '../../service';
2
- type formation = '4-2' | '6-2' | '5-1';
3
- declare function transformToType(formation: Formation): formation;
4
- declare function transformFromType(formation: formation): Formation;
2
+ import { formation } from '../models/coach';
3
+ declare function transformToType(_formation: Formation): formation;
4
+ declare function transformFromType(_formation: formation): Formation;
5
5
  export { transformToType as transformFromFormation, transformFromType as transformToFormation };
@@ -1,8 +1,8 @@
1
1
  import { Formation } from '../../service';
2
- function transformToType(formation) {
3
- return formation.name;
2
+ function transformToType(_formation) {
3
+ return _formation.name;
4
4
  }
5
- function transformFromType(formation) {
6
- return Formation[formation];
5
+ function transformFromType(_formation) {
6
+ return Formation[_formation];
7
7
  }
8
8
  export { transformToType as transformFromFormation, transformFromType as transformToFormation };
@@ -5,14 +5,14 @@ export interface CoachOpts {
5
5
  readonly id: string;
6
6
  readonly name: Name;
7
7
  readonly country: Country;
8
- readonly formation?: Formation;
8
+ readonly formation: Formation;
9
9
  readonly substitutionTolerance?: number;
10
10
  }
11
11
  export declare class Coach {
12
12
  readonly id: string;
13
13
  readonly name: Name;
14
14
  readonly country: Country;
15
- readonly formation?: Formation;
15
+ readonly formation: Formation;
16
16
  readonly substitutionTolerance?: number;
17
17
  constructor({ id, name, country, formation, substitutionTolerance }: CoachOpts);
18
18
  }
@@ -80,7 +80,7 @@ Formation['4-2'] = new Formation({
80
80
  'Outside Hitter': 10,
81
81
  'Opposite Hitter': 100,
82
82
  'Defensive Specialist': 1000,
83
- Setter: 10000,
83
+ [Role.SETTER]: 10000,
84
84
  Libero: 100000
85
85
  }
86
86
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volleyballsimtypes",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "description": "vbsim types",
5
5
  "main": "./dist/cjs/src/index.js",
6
6
  "module": "./dist/esm/src/index.js",