@o-zone/scorer-core 0.0.1 → 0.0.2

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.
@@ -1,7 +1,5 @@
1
- export type Competition = {
2
- id: string;
3
- name: string;
4
- season: number;
5
- };
6
- export declare function createCompetition(name: string, season: number): Competition;
1
+ import * as z from 'zod';
2
+ export declare const CompetitionEntry: z.ZodObject<{
3
+ id: z.ZodNumber;
4
+ }, z.core.$loose>;
7
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/competition/index.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAEhB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAM3E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/competition/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,gBAAgB;;iBAInB,CAAC"}
@@ -1,10 +1,7 @@
1
- // Competition module exports
2
- // Add your competition-related types and functions here
3
- export function createCompetition(name, season) {
4
- return {
5
- id: Math.random().toString(36).substring(7),
6
- name,
7
- season,
8
- };
9
- }
1
+ import * as z from 'zod';
2
+ export const CompetitionEntry = z
3
+ .object({
4
+ id: z.number(),
5
+ })
6
+ .loose();
10
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/competition/index.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,wDAAwD;AASxD,MAAM,UAAU,iBAAiB,CAAC,IAAY,EAAE,MAAc;IAC5D,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;QAC3C,IAAI;QACJ,MAAM;KACP,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/competition/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC9B,MAAM,CAAC;IACN,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;CACf,CAAC;KACD,KAAK,EAAE,CAAC"}
@@ -1,7 +1,116 @@
1
- export type Race = {
2
- id: string;
3
- name: string;
4
- date: Date;
5
- };
6
- export declare function createRace(name: string, date: Date): Race;
1
+ import * as z from 'zod';
2
+ export declare const Race: z.ZodObject<{
3
+ race_format: z.ZodNullable<z.ZodObject<{
4
+ name: z.ZodString;
5
+ race_discipline: z.ZodEnum<{
6
+ FootO: "FootO";
7
+ }>;
8
+ race_type: z.ZodEnum<{
9
+ standard: "standard";
10
+ }>;
11
+ }, z.core.$strip>>;
12
+ race_class: z.ZodArray<z.ZodObject<{
13
+ name: z.ZodString;
14
+ course_variant_id: z.ZodNumber;
15
+ race_format: z.ZodNullable<z.ZodObject<{
16
+ name: z.ZodString;
17
+ race_discipline: z.ZodEnum<{
18
+ FootO: "FootO";
19
+ MTBO: "MTBO";
20
+ Other: "Other";
21
+ }>;
22
+ race_type: z.ZodEnum<{
23
+ standard: "standard";
24
+ relay: "relay";
25
+ rogaine: "rogaine";
26
+ }>;
27
+ }, z.core.$strip>>;
28
+ race_entry: z.ZodArray<z.ZodObject<{
29
+ status: z.ZodEnum<{
30
+ entered: "entered";
31
+ cancelled: "cancelled";
32
+ implied: "implied";
33
+ "did-not-start": "did-not-start";
34
+ }>;
35
+ adhoc_name: z.ZodNullable<z.ZodString>;
36
+ is_group: z.ZodNullable<z.ZodBoolean>;
37
+ athlete: z.ZodNullable<z.ZodObject<{
38
+ id: z.ZodNumber;
39
+ club_id: z.ZodNullable<z.ZodNumber>;
40
+ }, z.core.$loose>>;
41
+ race_run: z.ZodArray<z.ZodObject<{
42
+ id: z.ZodNumber;
43
+ run_status: z.ZodNullable<z.ZodString>;
44
+ class_position: z.ZodNullable<z.ZodNumber>;
45
+ race_timing: z.ZodObject<{
46
+ duration: z.ZodNullable<z.ZodString>;
47
+ }, z.core.$loose>;
48
+ }, z.core.$loose>>;
49
+ }, z.core.$loose>>;
50
+ }, z.core.$loose>>;
51
+ }, z.core.$loose>;
52
+ export declare const Competition: z.ZodObject<{
53
+ competition_class: z.ZodArray<z.ZodObject<{
54
+ id: z.ZodNumber;
55
+ short_name: z.ZodString;
56
+ }, z.core.$loose>>;
57
+ }, z.core.$loose>;
58
+ export declare const RaceScoreRequest: z.ZodObject<{
59
+ competition: z.ZodObject<{
60
+ competition_class: z.ZodArray<z.ZodObject<{
61
+ id: z.ZodNumber;
62
+ short_name: z.ZodString;
63
+ }, z.core.$loose>>;
64
+ }, z.core.$loose>;
65
+ race: z.ZodObject<{
66
+ race_format: z.ZodNullable<z.ZodObject<{
67
+ name: z.ZodString;
68
+ race_discipline: z.ZodEnum<{
69
+ FootO: "FootO";
70
+ }>;
71
+ race_type: z.ZodEnum<{
72
+ standard: "standard";
73
+ }>;
74
+ }, z.core.$strip>>;
75
+ race_class: z.ZodArray<z.ZodObject<{
76
+ name: z.ZodString;
77
+ course_variant_id: z.ZodNumber;
78
+ race_format: z.ZodNullable<z.ZodObject<{
79
+ name: z.ZodString;
80
+ race_discipline: z.ZodEnum<{
81
+ FootO: "FootO";
82
+ MTBO: "MTBO";
83
+ Other: "Other";
84
+ }>;
85
+ race_type: z.ZodEnum<{
86
+ standard: "standard";
87
+ relay: "relay";
88
+ rogaine: "rogaine";
89
+ }>;
90
+ }, z.core.$strip>>;
91
+ race_entry: z.ZodArray<z.ZodObject<{
92
+ status: z.ZodEnum<{
93
+ entered: "entered";
94
+ cancelled: "cancelled";
95
+ implied: "implied";
96
+ "did-not-start": "did-not-start";
97
+ }>;
98
+ adhoc_name: z.ZodNullable<z.ZodString>;
99
+ is_group: z.ZodNullable<z.ZodBoolean>;
100
+ athlete: z.ZodNullable<z.ZodObject<{
101
+ id: z.ZodNumber;
102
+ club_id: z.ZodNullable<z.ZodNumber>;
103
+ }, z.core.$loose>>;
104
+ race_run: z.ZodArray<z.ZodObject<{
105
+ id: z.ZodNumber;
106
+ run_status: z.ZodNullable<z.ZodString>;
107
+ class_position: z.ZodNullable<z.ZodNumber>;
108
+ race_timing: z.ZodObject<{
109
+ duration: z.ZodNullable<z.ZodString>;
110
+ }, z.core.$loose>;
111
+ }, z.core.$loose>>;
112
+ }, z.core.$loose>>;
113
+ }, z.core.$loose>>;
114
+ }, z.core.$loose>;
115
+ }, z.core.$loose>;
7
116
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/race/index.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,IAAI,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;CAEZ,CAAC;AAEF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAMzD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/race/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AA0DzB,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKP,CAAC;AASX,eAAO,MAAM,WAAW;;;;;iBAId,CAAC;AAEX,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKnB,CAAC"}
@@ -1,10 +1,74 @@
1
- // Race module exports
2
- // Add your race-related types and functions here
3
- export function createRace(name, date) {
4
- return {
5
- id: Math.random().toString(36).substring(7),
6
- name,
7
- date,
8
- };
9
- }
1
+ import * as z from 'zod';
2
+ const RaceFormat = z.object({
3
+ name: z.string(),
4
+ race_discipline: z.enum(['FootO']),
5
+ race_type: z.enum(['standard']),
6
+ });
7
+ const RaceClassFormat = z.object({
8
+ name: z.string(),
9
+ race_discipline: z.enum(['FootO', 'MTBO', 'Other']),
10
+ race_type: z.enum(['standard', 'relay', 'rogaine']),
11
+ });
12
+ const RaceTiming = z
13
+ .object({
14
+ duration: z
15
+ .string()
16
+ .regex(/^\d{2}:\d{2}:\d{2}$/)
17
+ .nullable(),
18
+ })
19
+ .loose();
20
+ const RaceRun = z
21
+ .object({
22
+ id: z.number(),
23
+ run_status: z.string().nullable(),
24
+ class_position: z.number().nullable(),
25
+ race_timing: RaceTiming,
26
+ })
27
+ .loose();
28
+ const Athlete = z
29
+ .object({
30
+ id: z.number(),
31
+ club_id: z.number().nullable(),
32
+ })
33
+ .loose();
34
+ const RaceEntry = z
35
+ .object({
36
+ status: z.enum(['entered', 'cancelled', 'implied', 'did-not-start']),
37
+ adhoc_name: z.string().nullable(),
38
+ is_group: z.boolean().nullable(),
39
+ athlete: Athlete.nullable(),
40
+ race_run: z.array(RaceRun),
41
+ })
42
+ .loose();
43
+ const RaceClass = z
44
+ .object({
45
+ name: z.string(),
46
+ course_variant_id: z.number(),
47
+ race_format: RaceClassFormat.nullable(),
48
+ race_entry: z.array(RaceEntry),
49
+ })
50
+ .loose();
51
+ export const Race = z
52
+ .object({
53
+ race_format: RaceFormat.nullable(),
54
+ race_class: z.array(RaceClass),
55
+ })
56
+ .loose();
57
+ const CompetitionClass = z
58
+ .object({
59
+ id: z.number(),
60
+ short_name: z.string(),
61
+ })
62
+ .loose();
63
+ export const Competition = z
64
+ .object({
65
+ competition_class: z.array(CompetitionClass),
66
+ })
67
+ .loose();
68
+ export const RaceScoreRequest = z
69
+ .object({
70
+ competition: Competition,
71
+ race: Race,
72
+ })
73
+ .loose();
10
74
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/race/index.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,iDAAiD;AASjD,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,IAAU;IACjD,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;QAC3C,IAAI;QACJ,IAAI;KACL,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/race/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;IAClC,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC;CAChC,CAAC,CAAC;AAEH,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACnD,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;CACpD,CAAC,CAAC;AAEH,MAAM,UAAU,GAAG,CAAC;KACjB,MAAM,CAAC;IACN,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,KAAK,CAAC,qBAAqB,CAAC;SAC5B,QAAQ,EAAE;CACd,CAAC;KACD,KAAK,EAAE,CAAC;AAEX,MAAM,OAAO,GAAG,CAAC;KACd,MA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AAC,SAAS,CAAC;CAC/B,CAAC;KACD,KAAK,EAAE,CAAC;AAEX,MAAM,gBAAgB,GAAG,CAAC;KACvB,MAAM,CAAC;IACN,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC;KACD,KAAK,EAAE,CAAC;AAEX,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC;KACzB,MAAM,CAAC;IACN,iBAAiB,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;CAC7C,CAAC;KACD,KAAK,EAAE,CAAC;AAEX,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC9B,MAAM,CAAC;IACN,WAAW,EAAE,WAAW;IACxB,IAAI,EAAE,IAAI;CACX,CAAC;KACD,KAAK,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o-zone/scorer-core",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Orienteering scoring core library with modular exports",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,14 +28,14 @@
28
28
  "scripts": {
29
29
  "build": "tsc --project tsconfig.build.json",
30
30
  "build:watch": "tsc --project tsconfig.build.json --watch",
31
- "changes": "changeset add",
32
- "changeset": "changeset",
33
- "changeset:release": "changeset version && npm run build",
31
+ "changes": "bun changeset add",
32
+ "changeset": "bun changeset",
33
+ "changeset:release": "bun changeset version && npm run build",
34
34
  "check:types": "tsc --noEmit",
35
35
  "format": "biome format . --write",
36
36
  "lint": "biome check .",
37
37
  "lint:fix": "biome check . --write",
38
- "publish": "npm run build && changeset publish"
38
+ "publish": "npm run build && bun changeset publish"
39
39
  },
40
40
  "dependencies": {
41
41
  "zod": "^4.3.6"