@o-zone/scorer-core 0.1.3 → 0.1.5
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/competition/index.d.ts +2 -33
- package/dist/competition/index.d.ts.map +1 -1
- package/dist/competition/index.js +2 -47
- package/dist/competition/index.js.map +1 -1
- package/dist/competition/request.d.ts +32 -0
- package/dist/competition/request.d.ts.map +1 -0
- package/dist/competition/request.js +50 -0
- package/dist/competition/request.js.map +1 -0
- package/dist/competition/response.d.ts +6 -0
- package/dist/competition/response.d.ts.map +1 -0
- package/dist/competition/response.js +1 -0
- package/dist/competition/response.js.map +1 -0
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/index.js +2 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/helpers/position.d.ts +4 -0
- package/dist/helpers/position.d.ts.map +1 -0
- package/dist/helpers/position.js +33 -0
- package/dist/helpers/position.js.map +1 -0
- package/dist/helpers/position.test.d.ts +2 -0
- package/dist/helpers/position.test.d.ts.map +1 -0
- package/dist/helpers/position.test.js +118 -0
- package/dist/helpers/position.test.js.map +1 -0
- package/dist/race/index.d.ts +2 -154
- package/dist/race/index.d.ts.map +1 -1
- package/dist/race/index.js +2 -86
- package/dist/race/index.js.map +1 -1
- package/dist/race/request.d.ts +77 -0
- package/dist/race/request.d.ts.map +1 -0
- package/dist/race/request.js +89 -0
- package/dist/race/request.js.map +1 -0
- package/dist/race/response.d.ts +11 -0
- package/dist/race/response.d.ts.map +1 -0
- package/dist/race/response.js +1 -0
- package/dist/race/response.js.map +1 -0
- package/package.json +9 -3
|
@@ -1,34 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
id: z.ZodNumber;
|
|
4
|
-
name: z.ZodString;
|
|
5
|
-
}, z.core.$loose>;
|
|
6
|
-
export declare const CompetitionScoreRequest: z.ZodObject<{
|
|
7
|
-
competition: z.ZodObject<{
|
|
8
|
-
id: z.ZodNumber;
|
|
9
|
-
name: z.ZodString;
|
|
10
|
-
}, z.core.$loose>;
|
|
11
|
-
classes: z.ZodArray<z.ZodObject<{
|
|
12
|
-
id: z.ZodNumber;
|
|
13
|
-
name: z.ZodString;
|
|
14
|
-
short_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
15
|
-
entries: z.ZodArray<z.ZodObject<{
|
|
16
|
-
id: z.ZodNumber;
|
|
17
|
-
organization: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
18
|
-
id: z.ZodNumber;
|
|
19
|
-
name: z.ZodString;
|
|
20
|
-
club_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
|
-
school_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
|
-
onz_region: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
23
|
-
id: z.ZodString;
|
|
24
|
-
name: z.ZodString;
|
|
25
|
-
}, z.core.$strip>>>;
|
|
26
|
-
}, z.core.$loose>>>;
|
|
27
|
-
race_runs: z.ZodArray<z.ZodObject<{
|
|
28
|
-
score: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
29
|
-
}, z.core.$loose>>;
|
|
30
|
-
}, z.core.$loose>>;
|
|
31
|
-
}, z.core.$loose>>;
|
|
32
|
-
config: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
33
|
-
}, z.core.$loose>;
|
|
1
|
+
export * from './request';
|
|
2
|
+
export * from './response';
|
|
34
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/competition/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/competition/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
|
@@ -1,48 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
.object({
|
|
4
|
-
id: z.number(),
|
|
5
|
-
name: z.string(),
|
|
6
|
-
club_code: z.string().nullish(),
|
|
7
|
-
school_code: z.string().nullish(),
|
|
8
|
-
onz_region: z
|
|
9
|
-
.object({
|
|
10
|
-
id: z.string(),
|
|
11
|
-
name: z.string(),
|
|
12
|
-
})
|
|
13
|
-
.nullish(),
|
|
14
|
-
})
|
|
15
|
-
.loose();
|
|
16
|
-
const CompetitionEntry = z
|
|
17
|
-
.object({
|
|
18
|
-
id: z.number(),
|
|
19
|
-
organization: Organization.nullish(),
|
|
20
|
-
race_runs: z.array(z
|
|
21
|
-
.object({
|
|
22
|
-
score: z.number().nullish(),
|
|
23
|
-
})
|
|
24
|
-
.loose()),
|
|
25
|
-
})
|
|
26
|
-
.loose();
|
|
27
|
-
const CompetitionClass = z
|
|
28
|
-
.object({
|
|
29
|
-
id: z.number(),
|
|
30
|
-
name: z.string(),
|
|
31
|
-
short_name: z.string().nullish(),
|
|
32
|
-
entries: z.array(CompetitionEntry),
|
|
33
|
-
})
|
|
34
|
-
.loose();
|
|
35
|
-
export const Competition = z
|
|
36
|
-
.object({
|
|
37
|
-
id: z.number(),
|
|
38
|
-
name: z.string(),
|
|
39
|
-
})
|
|
40
|
-
.loose();
|
|
41
|
-
export const CompetitionScoreRequest = z
|
|
42
|
-
.object({
|
|
43
|
-
competition: Competition,
|
|
44
|
-
classes: z.array(CompetitionClass),
|
|
45
|
-
config: z.record(z.string(), z.any()),
|
|
46
|
-
})
|
|
47
|
-
.loose();
|
|
1
|
+
export * from './request';
|
|
2
|
+
export * from './response';
|
|
48
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/competition/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/competition/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
export declare const CompetitionScoreRequest: z.ZodObject<{
|
|
3
|
+
competition: z.ZodObject<{
|
|
4
|
+
id: z.ZodNumber;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
}, z.core.$loose>;
|
|
7
|
+
classes: z.ZodArray<z.ZodObject<{
|
|
8
|
+
id: z.ZodNumber;
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
short_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
11
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
12
|
+
id: z.ZodNumber;
|
|
13
|
+
organization: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
14
|
+
id: z.ZodNumber;
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
club_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
17
|
+
school_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
|
+
onz_region: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
19
|
+
id: z.ZodString;
|
|
20
|
+
name: z.ZodString;
|
|
21
|
+
}, z.core.$strip>>>;
|
|
22
|
+
}, z.core.$loose>>>;
|
|
23
|
+
race_runs: z.ZodArray<z.ZodObject<{
|
|
24
|
+
score: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
25
|
+
tiebreak_score: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
26
|
+
run_id: z.ZodNumber;
|
|
27
|
+
}, z.core.$loose>>;
|
|
28
|
+
}, z.core.$loose>>;
|
|
29
|
+
}, z.core.$loose>>;
|
|
30
|
+
config: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
31
|
+
}, z.core.$loose>;
|
|
32
|
+
//# sourceMappingURL=request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/competition/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAiDzB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAM1B,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
const Organization = z
|
|
3
|
+
.object({
|
|
4
|
+
id: z.number(),
|
|
5
|
+
name: z.string(),
|
|
6
|
+
club_code: z.string().nullish(),
|
|
7
|
+
school_code: z.string().nullish(),
|
|
8
|
+
onz_region: z
|
|
9
|
+
.object({
|
|
10
|
+
id: z.string(),
|
|
11
|
+
name: z.string(),
|
|
12
|
+
})
|
|
13
|
+
.nullish(),
|
|
14
|
+
})
|
|
15
|
+
.loose();
|
|
16
|
+
const CompetitionEntry = z
|
|
17
|
+
.object({
|
|
18
|
+
id: z.number(),
|
|
19
|
+
organization: Organization.nullish(),
|
|
20
|
+
race_runs: z.array(z
|
|
21
|
+
.object({
|
|
22
|
+
score: z.number().nullish(),
|
|
23
|
+
tiebreak_score: z.number().nullish(),
|
|
24
|
+
run_id: z.number(),
|
|
25
|
+
})
|
|
26
|
+
.loose()),
|
|
27
|
+
})
|
|
28
|
+
.loose();
|
|
29
|
+
const CompetitionClass = z
|
|
30
|
+
.object({
|
|
31
|
+
id: z.number(),
|
|
32
|
+
name: z.string(),
|
|
33
|
+
short_name: z.string().nullish(),
|
|
34
|
+
entries: z.array(CompetitionEntry),
|
|
35
|
+
})
|
|
36
|
+
.loose();
|
|
37
|
+
const Competition = z
|
|
38
|
+
.object({
|
|
39
|
+
id: z.number(),
|
|
40
|
+
name: z.string(),
|
|
41
|
+
})
|
|
42
|
+
.loose();
|
|
43
|
+
export const CompetitionScoreRequest = z
|
|
44
|
+
.object({
|
|
45
|
+
competition: Competition,
|
|
46
|
+
classes: z.array(CompetitionClass),
|
|
47
|
+
config: z.record(z.string(), z.any()),
|
|
48
|
+
})
|
|
49
|
+
.loose();
|
|
50
|
+
//# sourceMappingURL=request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/competition/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,MAAM,YAAY,GAAG,CAAC;KACnB,MAAM,CAAC;IACN,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IAC/B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IACjC,UAAU,EAAE,CAAC;SACV,MAAM,CAAC;QACN,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;QACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;KACjB,CAAC;SACD,OAAO,EAAE;CACb,CAAC;KACD,KAAK,EAAE,CAAC;AAEX,MAAM,gBAAgB,GAAG,CAAC;KACvB,MAAM,CAAC;IACN,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,YAAY,EAAE,YAAY,CAAC,OAAO,EAAE;IACpC,SAAS,EAAE,CAAC,CAAC,KAAK,CAChB,CAAC;SACE,MAAM,CAAC;QACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;QAC3B,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;QACpC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;KACnB,CAAC;SACD,KAAK,EAAE,CACX;CACF,CAAC;KACD,KAAK,EAAE,CAAC;AAEX,MAAM,gBAAgB,GAAG,CAAC;KACvB,MAAM,CAAC;IACN,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE;IAChC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;CACnC,CAAC;KACD,KAAK,EAAE,CAAC;AAEX,MAAM,WAAW,GAAG,CAAC;KAClB,MAAM,CAAC;IACN,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC;KACD,KAAK,EAAE,CAAC;AAEX,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACrC,MAAM,CAAC;IACN,WAAW,EAAE,WAAW;IACxB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;IAClC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;CACtC,CAAC;KACD,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/competition/response.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG;IAClC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CAClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../src/competition/response.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../src/helpers/position.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,YAAY,GAAI,CAAC,EAC5B,OAAO,CAAC,EAAE,EACV,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,SAAS,KACtC,CAAC,CAAC,GAAG;IAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC,EAiCxC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const withPosition = (items, sortBy) => {
|
|
2
|
+
const sorted = items
|
|
3
|
+
.map((item) => ({
|
|
4
|
+
item,
|
|
5
|
+
sortBy: sortBy(item),
|
|
6
|
+
}))
|
|
7
|
+
.sort((a, b) => {
|
|
8
|
+
if (a.sortBy === undefined && b.sortBy === undefined)
|
|
9
|
+
return 0;
|
|
10
|
+
if (a.sortBy === undefined)
|
|
11
|
+
return 1;
|
|
12
|
+
if (b.sortBy === undefined)
|
|
13
|
+
return -1;
|
|
14
|
+
return a.sortBy - b.sortBy;
|
|
15
|
+
});
|
|
16
|
+
return sorted
|
|
17
|
+
.reduce((acc, augmentedItem, sortedIndex) => {
|
|
18
|
+
const previous = sortedIndex > 0 ? acc[sortedIndex - 1] : undefined;
|
|
19
|
+
return acc.concat({
|
|
20
|
+
...augmentedItem,
|
|
21
|
+
position: previous && previous.sortBy === augmentedItem.sortBy
|
|
22
|
+
? previous.position
|
|
23
|
+
: augmentedItem.sortBy !== undefined
|
|
24
|
+
? sortedIndex + 1
|
|
25
|
+
: undefined,
|
|
26
|
+
});
|
|
27
|
+
}, [])
|
|
28
|
+
.map((augmentedItem) => ({
|
|
29
|
+
...augmentedItem.item,
|
|
30
|
+
position: augmentedItem.position,
|
|
31
|
+
}));
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=position.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"position.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CAAC,CAAC;QACvB,GAAG,aAAa,CAAC,IAAI;QACrB,QAAQ,EAAE,aAAa,CAAC,QAAQ;KACjC,CAAC,CAAC,CAAC;AACR,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"position.test.d.ts","sourceRoot":"","sources":["../../src/helpers/position.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { withPosition } from './position';
|
|
3
|
+
describe('withPosition', () => {
|
|
4
|
+
it('should return empty array for empty input', () => {
|
|
5
|
+
const result = withPosition([], (_item) => undefined);
|
|
6
|
+
expect(result).toEqual([]);
|
|
7
|
+
});
|
|
8
|
+
it('should assign position 1 to single item', () => {
|
|
9
|
+
const items = [{ id: 1 }];
|
|
10
|
+
const result = withPosition(items, (_item) => 100);
|
|
11
|
+
expect(result).toEqual([{ id: 1, position: 1 }]);
|
|
12
|
+
});
|
|
13
|
+
it('should assign sequential positions to items with different sort values', () => {
|
|
14
|
+
const items = [{ id: 1 }, { id: 2 }, { id: 3 }];
|
|
15
|
+
const result = withPosition(items, (item) => item.id * 10);
|
|
16
|
+
expect(result).toEqual([
|
|
17
|
+
{ id: 1, position: 1 },
|
|
18
|
+
{ id: 2, position: 2 },
|
|
19
|
+
{ id: 3, position: 3 },
|
|
20
|
+
]);
|
|
21
|
+
});
|
|
22
|
+
it('should assign same position to items with equal sort values', () => {
|
|
23
|
+
const items = [
|
|
24
|
+
{ id: 1, duration: 100 },
|
|
25
|
+
{ id: 2, duration: 100 },
|
|
26
|
+
{ id: 3, duration: 100 },
|
|
27
|
+
];
|
|
28
|
+
const result = withPosition(items, (item) => item.duration);
|
|
29
|
+
expect(result).toEqual([
|
|
30
|
+
{ id: 1, duration: 100, position: 1 },
|
|
31
|
+
{ id: 2, duration: 100, position: 1 },
|
|
32
|
+
{ id: 3, duration: 100, position: 1 },
|
|
33
|
+
]);
|
|
34
|
+
});
|
|
35
|
+
it('should handle 3 items at 2nd equal position correctly', () => {
|
|
36
|
+
const items = [
|
|
37
|
+
{ id: 1, duration: 100 },
|
|
38
|
+
{ id: 2, duration: 90 },
|
|
39
|
+
{ id: 3, duration: 90 },
|
|
40
|
+
{ id: 4, duration: 90 },
|
|
41
|
+
];
|
|
42
|
+
const result = withPosition(items, (item) => item.duration);
|
|
43
|
+
expect(result).toEqual([
|
|
44
|
+
{ id: 2, duration: 90, position: 1 },
|
|
45
|
+
{ id: 3, duration: 90, position: 1 },
|
|
46
|
+
{ id: 4, duration: 90, position: 1 },
|
|
47
|
+
{ id: 1, duration: 100, position: 4 },
|
|
48
|
+
]);
|
|
49
|
+
});
|
|
50
|
+
it('should skip position numbers when there are ties', () => {
|
|
51
|
+
const items = [
|
|
52
|
+
{ id: 1, duration: 100 },
|
|
53
|
+
{ id: 2, duration: 100 },
|
|
54
|
+
{ id: 3, duration: 95 },
|
|
55
|
+
{ id: 4, duration: 90 },
|
|
56
|
+
{ id: 5, duration: 90 },
|
|
57
|
+
{ id: 6, duration: 90 },
|
|
58
|
+
];
|
|
59
|
+
const result = withPosition(items, (item) => item.duration);
|
|
60
|
+
expect(result).toEqual([
|
|
61
|
+
{ id: 4, duration: 90, position: 1 },
|
|
62
|
+
{ id: 5, duration: 90, position: 1 },
|
|
63
|
+
{ id: 6, duration: 90, position: 1 },
|
|
64
|
+
{ id: 3, duration: 95, position: 4 },
|
|
65
|
+
{ id: 1, duration: 100, position: 5 },
|
|
66
|
+
{ id: 2, duration: 100, position: 5 },
|
|
67
|
+
]);
|
|
68
|
+
});
|
|
69
|
+
it('should handle items with undefined sort values at the end', () => {
|
|
70
|
+
const items = [
|
|
71
|
+
{ id: 1, duration: 100 },
|
|
72
|
+
{ id: 2, duration: 90 },
|
|
73
|
+
{ id: 3, duration: undefined },
|
|
74
|
+
];
|
|
75
|
+
const result = withPosition(items, (item) => item.duration);
|
|
76
|
+
expect(result).toEqual([
|
|
77
|
+
{ id: 2, duration: 90, position: 1 },
|
|
78
|
+
{ id: 1, duration: 100, position: 2 },
|
|
79
|
+
{ id: 3, duration: undefined, position: undefined },
|
|
80
|
+
]);
|
|
81
|
+
});
|
|
82
|
+
it('should handle all items with undefined sort values', () => {
|
|
83
|
+
const items = [{ id: 1 }, { id: 2 }, { id: 3 }];
|
|
84
|
+
const result = withPosition(items, () => undefined);
|
|
85
|
+
expect(result).toEqual([
|
|
86
|
+
{ id: 1, position: undefined },
|
|
87
|
+
{ id: 2, position: undefined },
|
|
88
|
+
{ id: 3, position: undefined },
|
|
89
|
+
]);
|
|
90
|
+
});
|
|
91
|
+
it('should sort items in ascending order by sort value', () => {
|
|
92
|
+
const items = [
|
|
93
|
+
{ id: 1, duration: 50 },
|
|
94
|
+
{ id: 2, duration: 100 },
|
|
95
|
+
{ id: 3, duration: 75 },
|
|
96
|
+
];
|
|
97
|
+
const result = withPosition(items, (item) => item.duration);
|
|
98
|
+
expect(result).toEqual([
|
|
99
|
+
{ id: 1, duration: 50, position: 1 },
|
|
100
|
+
{ id: 3, duration: 75, position: 2 },
|
|
101
|
+
{ id: 2, duration: 100, position: 3 },
|
|
102
|
+
]);
|
|
103
|
+
});
|
|
104
|
+
it('should handle negative sort values', () => {
|
|
105
|
+
const items = [
|
|
106
|
+
{ id: 1, value: -10 },
|
|
107
|
+
{ id: 2, value: 0 },
|
|
108
|
+
{ id: 3, value: 10 },
|
|
109
|
+
];
|
|
110
|
+
const result = withPosition(items, (item) => item.value);
|
|
111
|
+
expect(result).toEqual([
|
|
112
|
+
{ id: 1, value: -10, position: 1 },
|
|
113
|
+
{ id: 2, value: 0, position: 2 },
|
|
114
|
+
{ id: 3, value: 10, position: 3 },
|
|
115
|
+
]);
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
//# sourceMappingURL=position.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"position.test.js","sourceRoot":"","sources":["../../src/helpers/position.test.ts"],"names":[],"mappings":"A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C5C,MAAM,KAAK,GAAG;YACZ,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;YACrB,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;YACnB,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;SACrB,CAAC;QACF,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;YACrB,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE;YAClC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE;YAChC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE;SAClC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/race/index.d.ts
CHANGED
|
@@ -1,155 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
id: z.ZodNumber;
|
|
4
|
-
name: z.ZodString;
|
|
5
|
-
classification: z.ZodEnum<{
|
|
6
|
-
local: "local";
|
|
7
|
-
regional: "regional";
|
|
8
|
-
national: "national";
|
|
9
|
-
international: "international";
|
|
10
|
-
}>;
|
|
11
|
-
}, z.core.$loose>;
|
|
12
|
-
export declare const Race: z.ZodObject<{
|
|
13
|
-
event: z.ZodObject<{
|
|
14
|
-
id: z.ZodNumber;
|
|
15
|
-
name: z.ZodString;
|
|
16
|
-
classification: z.ZodEnum<{
|
|
17
|
-
local: "local";
|
|
18
|
-
regional: "regional";
|
|
19
|
-
national: "national";
|
|
20
|
-
international: "international";
|
|
21
|
-
}>;
|
|
22
|
-
}, z.core.$loose>;
|
|
23
|
-
race_format: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
24
|
-
name: z.ZodString;
|
|
25
|
-
race_discipline: z.ZodEnum<{
|
|
26
|
-
FootO: "FootO";
|
|
27
|
-
}>;
|
|
28
|
-
race_type: z.ZodEnum<{
|
|
29
|
-
standard: "standard";
|
|
30
|
-
}>;
|
|
31
|
-
}, z.core.$strip>>>;
|
|
32
|
-
race_class: z.ZodArray<z.ZodObject<{
|
|
33
|
-
name: z.ZodString;
|
|
34
|
-
course_variant_id: z.ZodNumber;
|
|
35
|
-
race_format: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
36
|
-
name: z.ZodString;
|
|
37
|
-
race_discipline: z.ZodEnum<{
|
|
38
|
-
FootO: "FootO";
|
|
39
|
-
MTBO: "MTBO";
|
|
40
|
-
Other: "Other";
|
|
41
|
-
}>;
|
|
42
|
-
race_type: z.ZodEnum<{
|
|
43
|
-
standard: "standard";
|
|
44
|
-
relay: "relay";
|
|
45
|
-
rogaine: "rogaine";
|
|
46
|
-
}>;
|
|
47
|
-
}, z.core.$strip>>>;
|
|
48
|
-
race_entry: z.ZodArray<z.ZodObject<{
|
|
49
|
-
status: z.ZodEnum<{
|
|
50
|
-
entered: "entered";
|
|
51
|
-
cancelled: "cancelled";
|
|
52
|
-
implied: "implied";
|
|
53
|
-
"did-not-start": "did-not-start";
|
|
54
|
-
}>;
|
|
55
|
-
adhoc_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
56
|
-
is_group: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
57
|
-
athlete: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
58
|
-
id: z.ZodNumber;
|
|
59
|
-
club_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
60
|
-
is_nz_eligible: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>;
|
|
61
|
-
}, z.core.$loose>>>;
|
|
62
|
-
race_run: z.ZodArray<z.ZodObject<{
|
|
63
|
-
id: z.ZodNumber;
|
|
64
|
-
run_status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
65
|
-
class_position: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
66
|
-
race_timing: z.ZodObject<{
|
|
67
|
-
duration: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
68
|
-
}, z.core.$loose>;
|
|
69
|
-
}, z.core.$loose>>;
|
|
70
|
-
}, z.core.$loose>>;
|
|
71
|
-
}, z.core.$loose>>;
|
|
72
|
-
}, z.core.$loose>;
|
|
73
|
-
export declare const Competition: z.ZodObject<{
|
|
74
|
-
id: z.ZodNumber;
|
|
75
|
-
name: z.ZodString;
|
|
76
|
-
competition_classes: z.ZodArray<z.ZodObject<{
|
|
77
|
-
id: z.ZodNumber;
|
|
78
|
-
name: z.ZodString;
|
|
79
|
-
short_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
80
|
-
}, z.core.$loose>>;
|
|
81
|
-
}, z.core.$loose>;
|
|
82
|
-
export declare const RaceScoreRequest: z.ZodObject<{
|
|
83
|
-
competition: z.ZodObject<{
|
|
84
|
-
id: z.ZodNumber;
|
|
85
|
-
name: z.ZodString;
|
|
86
|
-
competition_classes: z.ZodArray<z.ZodObject<{
|
|
87
|
-
id: z.ZodNumber;
|
|
88
|
-
name: z.ZodString;
|
|
89
|
-
short_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
90
|
-
}, z.core.$loose>>;
|
|
91
|
-
}, z.core.$loose>;
|
|
92
|
-
race: z.ZodObject<{
|
|
93
|
-
event: z.ZodObject<{
|
|
94
|
-
id: z.ZodNumber;
|
|
95
|
-
name: z.ZodString;
|
|
96
|
-
classification: z.ZodEnum<{
|
|
97
|
-
local: "local";
|
|
98
|
-
regional: "regional";
|
|
99
|
-
national: "national";
|
|
100
|
-
international: "international";
|
|
101
|
-
}>;
|
|
102
|
-
}, z.core.$loose>;
|
|
103
|
-
race_format: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
104
|
-
name: z.ZodString;
|
|
105
|
-
race_discipline: z.ZodEnum<{
|
|
106
|
-
FootO: "FootO";
|
|
107
|
-
}>;
|
|
108
|
-
race_type: z.ZodEnum<{
|
|
109
|
-
standard: "standard";
|
|
110
|
-
}>;
|
|
111
|
-
}, z.core.$strip>>>;
|
|
112
|
-
race_class: z.ZodArray<z.ZodObject<{
|
|
113
|
-
name: z.ZodString;
|
|
114
|
-
course_variant_id: z.ZodNumber;
|
|
115
|
-
race_format: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
116
|
-
name: z.ZodString;
|
|
117
|
-
race_discipline: z.ZodEnum<{
|
|
118
|
-
FootO: "FootO";
|
|
119
|
-
MTBO: "MTBO";
|
|
120
|
-
Other: "Other";
|
|
121
|
-
}>;
|
|
122
|
-
race_type: z.ZodEnum<{
|
|
123
|
-
standard: "standard";
|
|
124
|
-
relay: "relay";
|
|
125
|
-
rogaine: "rogaine";
|
|
126
|
-
}>;
|
|
127
|
-
}, z.core.$strip>>>;
|
|
128
|
-
race_entry: z.ZodArray<z.ZodObject<{
|
|
129
|
-
status: z.ZodEnum<{
|
|
130
|
-
entered: "entered";
|
|
131
|
-
cancelled: "cancelled";
|
|
132
|
-
implied: "implied";
|
|
133
|
-
"did-not-start": "did-not-start";
|
|
134
|
-
}>;
|
|
135
|
-
adhoc_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
136
|
-
is_group: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
137
|
-
athlete: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
138
|
-
id: z.ZodNumber;
|
|
139
|
-
club_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
140
|
-
is_nz_eligible: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>;
|
|
141
|
-
}, z.core.$loose>>>;
|
|
142
|
-
race_run: z.ZodArray<z.ZodObject<{
|
|
143
|
-
id: z.ZodNumber;
|
|
144
|
-
run_status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
145
|
-
class_position: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
146
|
-
race_timing: z.ZodObject<{
|
|
147
|
-
duration: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
148
|
-
}, z.core.$loose>;
|
|
149
|
-
}, z.core.$loose>>;
|
|
150
|
-
}, z.core.$loose>>;
|
|
151
|
-
}, z.core.$loose>>;
|
|
152
|
-
}, z.core.$loose>;
|
|
153
|
-
config: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
154
|
-
}, z.core.$loose>;
|
|
1
|
+
export * from './request';
|
|
2
|
+
export * from './response';
|
|
155
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/race/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/race/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/race/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
package/dist/race/index.js
CHANGED
|
@@ -1,87 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
.nullish(),
|
|
18
|
-
})
|
|
19
|
-
.loose();
|
|
20
|
-
const RaceRun = z
|
|
21
|
-
.object({
|
|
22
|
-
id: z.number(),
|
|
23
|
-
run_status: z.string().nullish(),
|
|
24
|
-
class_position: z.number().nullish(),
|
|
25
|
-
race_timing: RaceTiming,
|
|
26
|
-
})
|
|
27
|
-
.loose();
|
|
28
|
-
const Athlete = z
|
|
29
|
-
.object({
|
|
30
|
-
id: z.number(),
|
|
31
|
-
club_id: z.number().nullish(),
|
|
32
|
-
is_nz_eligible: z.boolean().nullish().default(true),
|
|
33
|
-
})
|
|
34
|
-
.loose();
|
|
35
|
-
const RaceEntry = z
|
|
36
|
-
.object({
|
|
37
|
-
status: z.enum(['entered', 'cancelled', 'implied', 'did-not-start']),
|
|
38
|
-
adhoc_name: z.string().nullish(),
|
|
39
|
-
is_group: z.boolean().nullish(),
|
|
40
|
-
athlete: Athlete.nullish(),
|
|
41
|
-
race_run: z.array(RaceRun),
|
|
42
|
-
})
|
|
43
|
-
.loose();
|
|
44
|
-
const RaceClass = z
|
|
45
|
-
.object({
|
|
46
|
-
name: z.string(),
|
|
47
|
-
course_variant_id: z.number(),
|
|
48
|
-
race_format: RaceClassFormat.nullish(),
|
|
49
|
-
race_entry: z.array(RaceEntry),
|
|
50
|
-
})
|
|
51
|
-
.loose();
|
|
52
|
-
export const Event = z
|
|
53
|
-
.object({
|
|
54
|
-
id: z.number(),
|
|
55
|
-
name: z.string(),
|
|
56
|
-
classification: z.enum(['local', 'regional', 'national', 'international']),
|
|
57
|
-
})
|
|
58
|
-
.loose();
|
|
59
|
-
export const Race = z
|
|
60
|
-
.object({
|
|
61
|
-
event: Event,
|
|
62
|
-
race_format: RaceFormat.nullish(),
|
|
63
|
-
race_class: z.array(RaceClass),
|
|
64
|
-
})
|
|
65
|
-
.loose();
|
|
66
|
-
const CompetitionClass = z
|
|
67
|
-
.object({
|
|
68
|
-
id: z.number(),
|
|
69
|
-
name: z.string(),
|
|
70
|
-
short_name: z.string().nullish(),
|
|
71
|
-
})
|
|
72
|
-
.loose();
|
|
73
|
-
export const Competition = z
|
|
74
|
-
.object({
|
|
75
|
-
id: z.number(),
|
|
76
|
-
name: z.string(),
|
|
77
|
-
competition_classes: z.array(CompetitionClass),
|
|
78
|
-
})
|
|
79
|
-
.loose();
|
|
80
|
-
export const RaceScoreRequest = z
|
|
81
|
-
.object({
|
|
82
|
-
competition: Competition,
|
|
83
|
-
race: Race,
|
|
84
|
-
config: z.record(z.string(), z.any()),
|
|
85
|
-
})
|
|
86
|
-
.loose();
|
|
1
|
+
export * from './request';
|
|
2
|
+
export * from './response';
|
|
87
3
|
//# sourceMappingURL=index.js.map
|
package/dist/race/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/race/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/race/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
export declare const RaceScoreRequest: z.ZodObject<{
|
|
3
|
+
competition: z.ZodObject<{
|
|
4
|
+
id: z.ZodNumber;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
competition_classes: z.ZodArray<z.ZodObject<{
|
|
7
|
+
id: z.ZodNumber;
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
short_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
10
|
+
}, z.core.$loose>>;
|
|
11
|
+
}, z.core.$loose>;
|
|
12
|
+
config: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
13
|
+
race: z.ZodObject<{
|
|
14
|
+
event: z.ZodObject<{
|
|
15
|
+
id: z.ZodNumber;
|
|
16
|
+
name: z.ZodString;
|
|
17
|
+
classification: z.ZodEnum<{
|
|
18
|
+
local: "local";
|
|
19
|
+
regional: "regional";
|
|
20
|
+
national: "national";
|
|
21
|
+
international: "international";
|
|
22
|
+
}>;
|
|
23
|
+
}, z.core.$loose>;
|
|
24
|
+
race_format: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
race_discipline: z.ZodEnum<{
|
|
27
|
+
FootO: "FootO";
|
|
28
|
+
}>;
|
|
29
|
+
race_type: z.ZodEnum<{
|
|
30
|
+
standard: "standard";
|
|
31
|
+
}>;
|
|
32
|
+
}, z.core.$strip>>>;
|
|
33
|
+
race_class: z.ZodArray<z.ZodObject<{
|
|
34
|
+
name: z.ZodString;
|
|
35
|
+
course_variant_id: z.ZodNumber;
|
|
36
|
+
race_format: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
race_discipline: z.ZodEnum<{
|
|
39
|
+
FootO: "FootO";
|
|
40
|
+
MTBO: "MTBO";
|
|
41
|
+
Other: "Other";
|
|
42
|
+
}>;
|
|
43
|
+
race_type: z.ZodEnum<{
|
|
44
|
+
standard: "standard";
|
|
45
|
+
relay: "relay";
|
|
46
|
+
rogaine: "rogaine";
|
|
47
|
+
}>;
|
|
48
|
+
}, z.core.$strip>>>;
|
|
49
|
+
race_entry: z.ZodArray<z.ZodObject<{
|
|
50
|
+
status: z.ZodEnum<{
|
|
51
|
+
entered: "entered";
|
|
52
|
+
cancelled: "cancelled";
|
|
53
|
+
implied: "implied";
|
|
54
|
+
"did-not-start": "did-not-start";
|
|
55
|
+
}>;
|
|
56
|
+
adhoc_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
57
|
+
is_group: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
58
|
+
athlete: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
59
|
+
id: z.ZodNumber;
|
|
60
|
+
club_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
61
|
+
is_nz_eligible: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>;
|
|
62
|
+
}, z.core.$loose>>>;
|
|
63
|
+
race_run: z.ZodArray<z.ZodObject<{
|
|
64
|
+
id: z.ZodNumber;
|
|
65
|
+
run_status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
66
|
+
class_position: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
67
|
+
race_timing: z.ZodObject<{
|
|
68
|
+
duration: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
69
|
+
}, z.core.$loose>;
|
|
70
|
+
}, z.core.$loose>>;
|
|
71
|
+
}, z.core.$loose>>;
|
|
72
|
+
}, z.core.$loose>>;
|
|
73
|
+
}, z.core.$loose>;
|
|
74
|
+
score: z.ZodDefault<z.ZodBoolean>;
|
|
75
|
+
tiebreak: z.ZodDefault<z.ZodBoolean>;
|
|
76
|
+
}, z.core.$loose>;
|
|
77
|
+
//# sourceMappingURL=request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/race/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AA2FzB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQnB,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
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
|
+
.nullish(),
|
|
18
|
+
})
|
|
19
|
+
.loose();
|
|
20
|
+
const RaceRun = z
|
|
21
|
+
.object({
|
|
22
|
+
id: z.number(),
|
|
23
|
+
run_status: z.string().nullish(),
|
|
24
|
+
class_position: z.number().nullish(),
|
|
25
|
+
race_timing: RaceTiming,
|
|
26
|
+
})
|
|
27
|
+
.loose();
|
|
28
|
+
const Athlete = z
|
|
29
|
+
.object({
|
|
30
|
+
id: z.number(),
|
|
31
|
+
club_id: z.number().nullish(),
|
|
32
|
+
is_nz_eligible: z.boolean().nullish().default(true),
|
|
33
|
+
})
|
|
34
|
+
.loose();
|
|
35
|
+
const RaceEntry = z
|
|
36
|
+
.object({
|
|
37
|
+
status: z.enum(['entered', 'cancelled', 'implied', 'did-not-start']),
|
|
38
|
+
adhoc_name: z.string().nullish(),
|
|
39
|
+
is_group: z.boolean().nullish(),
|
|
40
|
+
athlete: Athlete.nullish(),
|
|
41
|
+
race_run: z.array(RaceRun),
|
|
42
|
+
})
|
|
43
|
+
.loose();
|
|
44
|
+
const RaceClass = z
|
|
45
|
+
.object({
|
|
46
|
+
name: z.string(),
|
|
47
|
+
course_variant_id: z.number(),
|
|
48
|
+
race_format: RaceClassFormat.nullish(),
|
|
49
|
+
race_entry: z.array(RaceEntry),
|
|
50
|
+
})
|
|
51
|
+
.loose();
|
|
52
|
+
const Event = z
|
|
53
|
+
.object({
|
|
54
|
+
id: z.number(),
|
|
55
|
+
name: z.string(),
|
|
56
|
+
classification: z.enum(['local', 'regional', 'national', 'international']),
|
|
57
|
+
})
|
|
58
|
+
.loose();
|
|
59
|
+
const Race = z
|
|
60
|
+
.object({
|
|
61
|
+
event: Event,
|
|
62
|
+
race_format: RaceFormat.nullish(),
|
|
63
|
+
race_class: z.array(RaceClass),
|
|
64
|
+
})
|
|
65
|
+
.loose();
|
|
66
|
+
const CompetitionClass = z
|
|
67
|
+
.object({
|
|
68
|
+
id: z.number(),
|
|
69
|
+
name: z.string(),
|
|
70
|
+
short_name: z.string().nullish(),
|
|
71
|
+
})
|
|
72
|
+
.loose();
|
|
73
|
+
const Competition = z
|
|
74
|
+
.object({
|
|
75
|
+
id: z.number(),
|
|
76
|
+
name: z.string(),
|
|
77
|
+
competition_classes: z.array(CompetitionClass),
|
|
78
|
+
})
|
|
79
|
+
.loose();
|
|
80
|
+
export const RaceScoreRequest = z
|
|
81
|
+
.object({
|
|
82
|
+
competition: Competition,
|
|
83
|
+
config: z.record(z.string(), z.any()),
|
|
84
|
+
race: Race,
|
|
85
|
+
score: z.boolean().default(true),
|
|
86
|
+
tiebreak: z.boolean().default(false),
|
|
87
|
+
})
|
|
88
|
+
.loose();
|
|
89
|
+
//# sourceMappingURL=request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/race/request.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,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AE,CAAC;IACrC,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAChC,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CACrC,CAAC;KACD,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type RaceEntryScore = {
|
|
2
|
+
competition_class_id: number;
|
|
3
|
+
athlete_id?: number;
|
|
4
|
+
adhoc_name?: string;
|
|
5
|
+
is_group?: boolean;
|
|
6
|
+
organization_id?: number;
|
|
7
|
+
race_run_id: number;
|
|
8
|
+
score?: number | null;
|
|
9
|
+
tiebreak_score?: number | null;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/race/response.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../src/race/response.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o-zone/scorer-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Orienteering scoring core library with modular exports",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
"import": "./dist/server.js",
|
|
14
14
|
"types": "./dist/server.d.ts"
|
|
15
15
|
},
|
|
16
|
+
"./helpers": {
|
|
17
|
+
"import": "./dist/helpers/index.js",
|
|
18
|
+
"types": "./dist/helpers/index.d.ts"
|
|
19
|
+
},
|
|
16
20
|
"./race": {
|
|
17
21
|
"import": "./dist/race/index.js",
|
|
18
22
|
"types": "./dist/race/index.d.ts"
|
|
@@ -35,7 +39,8 @@
|
|
|
35
39
|
"@changesets/cli": "^2.29.8",
|
|
36
40
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
37
41
|
"@types/bun": "latest",
|
|
38
|
-
"typescript": "^5.3.3"
|
|
42
|
+
"typescript": "^5.3.3",
|
|
43
|
+
"vitest": "^4.0.18"
|
|
39
44
|
},
|
|
40
45
|
"peerDependencies": {
|
|
41
46
|
"typescript": "^5"
|
|
@@ -50,6 +55,7 @@
|
|
|
50
55
|
"check:types": "tsc --noEmit",
|
|
51
56
|
"format": "biome format . --write",
|
|
52
57
|
"lint": "biome check .",
|
|
53
|
-
"lint:fix": "biome check . --write"
|
|
58
|
+
"lint:fix": "biome check . --write",
|
|
59
|
+
"test": "vitest"
|
|
54
60
|
}
|
|
55
61
|
}
|