@srating-io/types 2.0.3 → 2.1.0

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.
@@ -12,12 +12,14 @@ export interface SearchTeamResult {
12
12
  code: string;
13
13
  name: string;
14
14
  alt_name: string | null;
15
+ slug: string | null;
15
16
  primary_color: string | null;
16
17
  }
17
18
  export interface SearchPlayerResult {
18
19
  player_id: string;
19
20
  first_name: string;
20
21
  last_name: string;
22
+ slug: string | null;
21
23
  begin: number;
22
24
  end: number;
23
25
  relevance_score: number;
@@ -26,6 +28,7 @@ export interface SearchCoachResult {
26
28
  coach_id: string;
27
29
  first_name: string;
28
30
  last_name: string;
31
+ slug: string | null;
29
32
  begin: number;
30
33
  end: number;
31
34
  }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * The entity kinds that have a slug, and so a url worth putting in a sitemap.
3
+ */
4
+ export type SlugType = 'team' | 'player' | 'coach' | 'conference' | 'game';
5
+ export type getSlugsArguments = {
6
+ type: SlugType;
7
+ organization_id: string;
8
+ division_id: string;
9
+ /**
10
+ * Games only, and required there. A sitemap that reached back through every season would be
11
+ * mostly dead urls, so the caller names the seasons it wants.
12
+ */
13
+ seasons?: number[];
14
+ limit: number;
15
+ offset: number;
16
+ };
17
+ export type SlugRow = {
18
+ slug: string;
19
+ /**
20
+ * Feeds <lastmod>. Null on the tables that have no updated_at, which the caller then omits
21
+ * rather than guessing a date -- a wrong lastmod is worse than none.
22
+ */
23
+ updated_at: string | null;
24
+ };
25
+ export type getSlugsResults = SlugRow[];
26
+ export type getCountsArguments = {
27
+ type: SlugType;
28
+ organization_id: string;
29
+ division_id: string;
30
+ seasons?: number[];
31
+ };
32
+ /**
33
+ * How many urls of this kind exist, so the sitemap knows how many shards to generate before it
34
+ * starts paging through them.
35
+ */
36
+ export type getCountsResults = {
37
+ count: number;
38
+ };
@@ -739,8 +739,16 @@ export type RankingTable = (StatisticRanking | PlayerStatisticRanking | Conferen
739
739
  committed?: boolean;
740
740
  committed_team_id?: string;
741
741
  committed_team_name?: string;
742
+ committed_team_slug?: string | null;
742
743
  committed_conference_id?: string;
743
744
  team_name?: string;
745
+ /**
746
+ * The slugs the table's links are built from. Decorations added by the ranking endpoint, not
747
+ * columns on the ranking row -- without them every link would point at an id url and 308.
748
+ */
749
+ slug?: string | null;
750
+ team_slug?: string | null;
751
+ conference_slug?: string | null;
744
752
  player?: Player;
745
753
  player_team_season?: PlayerTeamSeason;
746
754
  };
@@ -1404,8 +1404,16 @@ export type RankingTable = (StatisticRanking | PlayerStatisticRanking | Conferen
1404
1404
  committed?: boolean;
1405
1405
  committed_team_id?: string;
1406
1406
  committed_team_name?: string;
1407
+ committed_team_slug?: string | null;
1407
1408
  committed_conference_id?: string;
1408
1409
  team_name?: string;
1410
+ /**
1411
+ * The slugs the table's links are built from. Decorations added by the ranking endpoint, not
1412
+ * columns on the ranking row -- without them every link would point at an id url and 308.
1413
+ */
1414
+ slug?: string | null;
1415
+ team_slug?: string | null;
1416
+ conference_slug?: string | null;
1409
1417
  player?: Player;
1410
1418
  player_team_season?: PlayerTeamSeason;
1411
1419
  };
package/dist/general.d.ts CHANGED
@@ -33,11 +33,32 @@ export interface Terminology {
33
33
  export type Terminologies = {
34
34
  [terminology_id: string]: Terminology;
35
35
  };
36
+ /**
37
+ * A slug an entity used to answer to. A slug is immutable once assigned, so this only fills up
38
+ * from a game whose start_date moved and from a manual rename -- and a hit here is a 301, never a
39
+ * render.
40
+ */
41
+ export interface SlugRedirect {
42
+ slug_redirect_id: string;
43
+ type: 'team' | 'player' | 'coach' | 'conference' | 'game';
44
+ /**
45
+ * Set for a game, null otherwise, matching how the slug itself is scoped.
46
+ */
47
+ organization_id: string | null;
48
+ slug: string;
49
+ entity_id: string;
50
+ guid: string;
51
+ deleted: number;
52
+ }
53
+ export type SlugRedirects = {
54
+ [slug_redirect_id: string]: SlugRedirect;
55
+ };
36
56
  export interface Conference {
37
57
  conference_id: string;
38
58
  parent_conference_id: string;
39
59
  code: string;
40
60
  name: string;
61
+ slug: string;
41
62
  guid: string;
42
63
  inactive: number;
43
64
  deleted: number;
@@ -51,6 +72,7 @@ export interface Team {
51
72
  code: string;
52
73
  name: string;
53
74
  alt_name: string;
75
+ slug: string;
54
76
  primary_color: string;
55
77
  secondary_color: string;
56
78
  guid: string;
@@ -123,6 +145,7 @@ export interface Game {
123
145
  start_date: string;
124
146
  start_datetime: string;
125
147
  start_timestamp: number;
148
+ slug: string;
126
149
  attendance: number;
127
150
  neutral_site: number;
128
151
  is_conf_game: number;
@@ -137,6 +160,7 @@ export interface Coach {
137
160
  coach_id: string;
138
161
  first_name: string;
139
162
  last_name: string;
163
+ slug: string;
140
164
  deleted: number;
141
165
  }
142
166
  export type Coaches = {
@@ -204,6 +228,7 @@ export interface Player {
204
228
  player_id: string;
205
229
  first_name: string;
206
230
  last_name: string;
231
+ slug: string;
207
232
  position: string;
208
233
  height: string;
209
234
  weight: string;
package/dist/index.d.ts CHANGED
@@ -28,6 +28,7 @@ export * as Ranking from './api/ranking.ts';
28
28
  export * as Search from './api/search.ts';
29
29
  export * as Secret from './api/secret.ts';
30
30
  export * as Session from './api/session.ts';
31
+ export * as Sitemap from './api/sitemap.ts';
31
32
  export * as StatisticRanking from './api/statistic_ranking.ts';
32
33
  export * as Team from './api/team.ts';
33
34
  export * as User from './api/user.ts';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@srating-io/types",
3
3
  "private": false,
4
- "version": "2.0.3",
4
+ "version": "2.1.0",
5
5
  "description": "srating.io shared TypeScript types for GUI and API",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",