ropegeo-common 1.10.4 → 1.12.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.
Files changed (121) hide show
  1. package/README.md +27 -15
  2. package/dist/models/api/endpoints/ropewikiPageView.d.ts +4 -87
  3. package/dist/models/api/endpoints/ropewikiPageView.d.ts.map +1 -1
  4. package/dist/models/api/endpoints/ropewikiPageView.js +9 -289
  5. package/dist/models/api/endpoints/ropewikiRegionView.d.ts +5 -5
  6. package/dist/models/api/endpoints/ropewikiRegionView.d.ts.map +1 -1
  7. package/dist/models/api/endpoints/ropewikiRegionView.js +7 -4
  8. package/dist/models/api/results/registerAllResultParsers.d.ts +0 -1
  9. package/dist/models/api/results/registerAllResultParsers.d.ts.map +1 -1
  10. package/dist/models/api/results/registerAllResultParsers.js +0 -1
  11. package/dist/models/api/results/result.d.ts +1 -2
  12. package/dist/models/api/results/result.d.ts.map +1 -1
  13. package/dist/models/api/results/result.js +1 -2
  14. package/dist/models/api/results/ropewikiPageViewResult.d.ts +4 -4
  15. package/dist/models/api/results/ropewikiPageViewResult.d.ts.map +1 -1
  16. package/dist/models/api/results/ropewikiPageViewResult.js +2 -2
  17. package/dist/models/api/results/routePreviewResult.d.ts +4 -4
  18. package/dist/models/api/results/routePreviewResult.d.ts.map +1 -1
  19. package/dist/models/api/results/routePreviewResult.js +2 -2
  20. package/dist/models/betaSections/betaSection.d.ts +11 -14
  21. package/dist/models/betaSections/betaSection.d.ts.map +1 -1
  22. package/dist/models/betaSections/betaSection.js +37 -24
  23. package/dist/models/betaSections/betaSectionImage.d.ts +13 -20
  24. package/dist/models/betaSections/betaSectionImage.d.ts.map +1 -1
  25. package/dist/models/betaSections/betaSectionImage.js +32 -22
  26. package/dist/models/betaSections/offlineBetaSection.d.ts +9 -0
  27. package/dist/models/betaSections/offlineBetaSection.d.ts.map +1 -0
  28. package/dist/models/betaSections/offlineBetaSection.js +23 -0
  29. package/dist/models/betaSections/offlineBetaSectionImage.d.ts +9 -0
  30. package/dist/models/betaSections/offlineBetaSectionImage.d.ts.map +1 -0
  31. package/dist/models/betaSections/offlineBetaSectionImage.js +28 -0
  32. package/dist/models/betaSections/onlineBetaSection.d.ts +14 -0
  33. package/dist/models/betaSections/onlineBetaSection.d.ts.map +1 -0
  34. package/dist/models/betaSections/onlineBetaSection.js +27 -0
  35. package/dist/models/betaSections/onlineBetaSectionImage.d.ts +14 -0
  36. package/dist/models/betaSections/onlineBetaSectionImage.d.ts.map +1 -0
  37. package/dist/models/betaSections/onlineBetaSectionImage.js +31 -0
  38. package/dist/models/betaSections/registerBetaSectionParsers.d.ts +5 -0
  39. package/dist/models/betaSections/registerBetaSectionParsers.d.ts.map +1 -0
  40. package/dist/models/betaSections/registerBetaSectionParsers.js +6 -0
  41. package/dist/models/fetchType.d.ts +2 -0
  42. package/dist/models/fetchType.d.ts.map +1 -0
  43. package/dist/models/fetchType.js +2 -0
  44. package/dist/models/index.d.ts +22 -1
  45. package/dist/models/index.d.ts.map +1 -1
  46. package/dist/models/index.js +37 -4
  47. package/dist/models/minimap/centeredRegionMiniMap.d.ts +18 -0
  48. package/dist/models/minimap/centeredRegionMiniMap.d.ts.map +1 -0
  49. package/dist/models/minimap/centeredRegionMiniMap.js +59 -0
  50. package/dist/models/minimap/miniMap.d.ts +8 -3
  51. package/dist/models/minimap/miniMap.d.ts.map +1 -1
  52. package/dist/models/minimap/miniMap.js +37 -14
  53. package/dist/models/minimap/miniMapType.d.ts +12 -1
  54. package/dist/models/minimap/miniMapType.d.ts.map +1 -1
  55. package/dist/models/minimap/miniMapType.js +12 -1
  56. package/dist/models/minimap/offlineCenteredRegionMiniMap.d.ts +11 -0
  57. package/dist/models/minimap/offlineCenteredRegionMiniMap.d.ts.map +1 -0
  58. package/dist/models/minimap/offlineCenteredRegionMiniMap.js +43 -0
  59. package/dist/models/minimap/offlinePageMiniMap.d.ts +12 -0
  60. package/dist/models/minimap/offlinePageMiniMap.d.ts.map +1 -0
  61. package/dist/models/minimap/offlinePageMiniMap.js +40 -0
  62. package/dist/models/minimap/onlineCenteredRegionMiniMap.d.ts +13 -0
  63. package/dist/models/minimap/onlineCenteredRegionMiniMap.d.ts.map +1 -0
  64. package/dist/models/minimap/onlineCenteredRegionMiniMap.js +32 -0
  65. package/dist/models/minimap/onlinePageMiniMap.d.ts +13 -0
  66. package/dist/models/minimap/onlinePageMiniMap.d.ts.map +1 -0
  67. package/dist/models/minimap/onlinePageMiniMap.js +31 -0
  68. package/dist/models/minimap/pageMiniMap.d.ts +8 -4
  69. package/dist/models/minimap/pageMiniMap.d.ts.map +1 -1
  70. package/dist/models/minimap/pageMiniMap.js +33 -16
  71. package/dist/models/minimap/regionMiniMap.d.ts +5 -1
  72. package/dist/models/minimap/regionMiniMap.d.ts.map +1 -1
  73. package/dist/models/minimap/regionMiniMap.js +16 -3
  74. package/dist/models/minimap/registerMiniMapParsers.d.ts +6 -0
  75. package/dist/models/minimap/registerMiniMapParsers.d.ts.map +1 -0
  76. package/dist/models/minimap/registerMiniMapParsers.js +7 -0
  77. package/dist/models/mobile/savedPage.d.ts +5 -26
  78. package/dist/models/mobile/savedPage.d.ts.map +1 -1
  79. package/dist/models/mobile/savedPage.js +13 -97
  80. package/dist/models/pageViews/offlinePageView.d.ts +11 -0
  81. package/dist/models/pageViews/offlinePageView.d.ts.map +1 -0
  82. package/dist/models/pageViews/offlinePageView.js +2 -0
  83. package/dist/models/pageViews/offlineRopewikiPageView.d.ts +39 -0
  84. package/dist/models/pageViews/offlineRopewikiPageView.d.ts.map +1 -0
  85. package/dist/models/pageViews/offlineRopewikiPageView.js +63 -0
  86. package/dist/models/pageViews/onlinePageView.d.ts +17 -0
  87. package/dist/models/pageViews/onlinePageView.d.ts.map +1 -0
  88. package/dist/models/pageViews/onlinePageView.js +2 -0
  89. package/dist/models/pageViews/onlineRopewikiPageView.d.ts +48 -0
  90. package/dist/models/pageViews/onlineRopewikiPageView.d.ts.map +1 -0
  91. package/dist/models/pageViews/onlineRopewikiPageView.js +107 -0
  92. package/dist/models/pageViews/pageViewType.d.ts +4 -0
  93. package/dist/models/pageViews/pageViewType.d.ts.map +1 -0
  94. package/dist/models/pageViews/pageViewType.js +7 -0
  95. package/dist/models/pageViews/registerPageViewParsers.d.ts +3 -0
  96. package/dist/models/pageViews/registerPageViewParsers.d.ts.map +1 -0
  97. package/dist/models/pageViews/registerPageViewParsers.js +4 -0
  98. package/dist/models/pageViews/ropewikiPageView.d.ts +76 -0
  99. package/dist/models/pageViews/ropewikiPageView.d.ts.map +1 -0
  100. package/dist/models/pageViews/ropewikiPageView.js +268 -0
  101. package/dist/models/previews/offlinePagePreview.d.ts +8 -0
  102. package/dist/models/previews/offlinePagePreview.d.ts.map +1 -0
  103. package/dist/models/previews/offlinePagePreview.js +23 -0
  104. package/dist/models/previews/onlinePagePreview.d.ts +10 -0
  105. package/dist/models/previews/onlinePagePreview.d.ts.map +1 -0
  106. package/dist/models/previews/onlinePagePreview.js +27 -0
  107. package/dist/models/previews/pagePreview.d.ts +15 -13
  108. package/dist/models/previews/pagePreview.d.ts.map +1 -1
  109. package/dist/models/previews/pagePreview.js +42 -7
  110. package/dist/models/previews/preview.d.ts +1 -0
  111. package/dist/models/previews/preview.d.ts.map +1 -1
  112. package/dist/models/previews/preview.js +9 -5
  113. package/dist/models/previews/regionPreview.d.ts.map +1 -1
  114. package/dist/models/previews/regionPreview.js +1 -0
  115. package/dist/models/previews/registerPreviewParsers.d.ts +5 -0
  116. package/dist/models/previews/registerPreviewParsers.d.ts.map +1 -0
  117. package/dist/models/previews/registerPreviewParsers.js +6 -0
  118. package/package.json +1 -1
  119. package/dist/models/api/results/ropewikiRegionBoundsResult.d.ts +0 -11
  120. package/dist/models/api/results/ropewikiRegionBoundsResult.d.ts.map +0 -1
  121. package/dist/models/api/results/ropewikiRegionBoundsResult.js +0 -19
package/README.md CHANGED
@@ -65,6 +65,8 @@ Helper tables use columns **Name**, **Description**, **Import**. Model tables ad
65
65
  | --- | --- | --- | --- |
66
66
  | `PageDataSource` | N/A | Where linked page content comes from (e.g. Ropewiki). | `import { PageDataSource } from 'ropegeo-common/models'` |
67
67
  | `PermitStatus` | N/A | Permit state for a canyon page (Yes, No, Restricted, Closed). | `import { PermitStatus } from 'ropegeo-common/models'` |
68
+ | `FetchType` | N/A | Online/offline discriminator type (`'online' \| 'offline'`). | `import type { FetchType } from 'ropegeo-common/models'` |
69
+ | `PageViewType` | N/A | Discriminator enum for page view families (currently Ropewiki). | `import { PageViewType } from 'ropegeo-common/models'` |
68
70
 
69
71
  ### Difficulty (`src/models/difficulty/`)
70
72
 
@@ -134,7 +136,9 @@ Helper tables use columns **Name**, **Description**, **Import**. Model tables ad
134
136
  | `PreviewType` | N/A | Discriminator for search hit kind (page vs region). | `import { PreviewType } from 'ropegeo-common/models'` |
135
137
  | `Preview` | N/A | Abstract union base for search/route preview payloads. | `import { Preview } from 'ropegeo-common/models'` |
136
138
  | `GetRopewikiPagePreviewRow` | N/A | DB row shape for building `PagePreview` from Ropewiki. | `import type { GetRopewikiPagePreviewRow } from 'ropegeo-common/models'` |
137
- | `PagePreview` | `Preview` | Page preview (route preview and search hits). | `import { PagePreview } from 'ropegeo-common/models'` |
139
+ | `PagePreview` | `Preview` | Abstract page preview base; dispatches to online/offline variants by `fetchType`. | `import { PagePreview } from 'ropegeo-common/models'` |
140
+ | `OnlinePagePreview` | `PagePreview` | API-backed page preview with `imageUrl` and `fetchType: "online"`. | `import { OnlinePagePreview } from 'ropegeo-common/models'` |
141
+ | `OfflinePagePreview` | `PagePreview` | Persisted page preview with `downloadedImagePath` and `fetchType: "offline"`. | `import { OfflinePagePreview } from 'ropegeo-common/models'` |
138
142
  | `RegionPreview` | `Preview` | Region search preview. | `import { RegionPreview } from 'ropegeo-common/models'` |
139
143
 
140
144
  ### Route domain (`src/models/routes/`)
@@ -149,7 +153,7 @@ Helper tables use columns **Name**, **Description**, **Import**. Model tables ad
149
153
 
150
154
  | Name | Base class | Description | Import |
151
155
  | --- | --- | --- | --- |
152
- | `RoutesGeojson` | N/A | GeoJSON FeatureCollection of routes (features only; use region bounds API for bbox). | `import { RoutesGeojson } from 'ropegeo-common/models'` |
156
+ | `RoutesGeojson` | N/A | GeoJSON FeatureCollection of routes (features only; region bbox is on `RegionMiniMap.bounds` in GET /ropewiki/region/{id}). | `import { RoutesGeojson } from 'ropegeo-common/models'` |
153
157
  | `RouteResult` | `PaginationResults` | Page of GET /routes (`RouteGeoJsonFeature[]`, `total`, `page`, `resultType` `route`). | `import { RouteResult } from 'ropegeo-common/models'` |
154
158
 
155
159
  ### Route preview API (`src/models/api/results/`)
@@ -162,7 +166,12 @@ Helper tables use columns **Name**, **Description**, **Import**. Model tables ad
162
166
 
163
167
  | Name | Base class | Description | Import |
164
168
  | --- | --- | --- | --- |
165
- | `RopewikiPageView` | N/A | Full Ropewiki page view (sections, images, minimap). | `import { RopewikiPageView } from 'ropegeo-common/models'` |
169
+ | `RopewikiPageView` | `BaseRopewikiPageView` | Backward-compatible alias exported as the online page view class. | `import { RopewikiPageView } from 'ropegeo-common/models'` |
170
+ | `BaseRopewikiPageView` | N/A | Abstract Ropewiki page view base with shared validation/fields. | `import { BaseRopewikiPageView } from 'ropegeo-common/models'` |
171
+ | `OnlineRopewikiPageView` | `BaseRopewikiPageView` | Online Ropewiki page view with API image URLs and online minimap variants. | `import { OnlineRopewikiPageView } from 'ropegeo-common/models'` |
172
+ | `OfflineRopewikiPageView` | `BaseRopewikiPageView` | Offline Ropewiki page view with downloaded paths and offline minimap variants. | `import { OfflineRopewikiPageView } from 'ropegeo-common/models'` |
173
+ | `OnlinePageView` | N/A | Interface for online page-view behavior (`toOffline`, `toSavedPage`, etc.). | `import type { OnlinePageView } from 'ropegeo-common/models'` |
174
+ | `OfflinePageView` | N/A | Interface for offline page-view behavior (`toPagePreview`). | `import type { OfflinePageView } from 'ropegeo-common/models'` |
166
175
  | `RopewikiPageViewResult` | `Result` | API result wrapping `RopewikiPageView`. | `import { RopewikiPageViewResult } from 'ropegeo-common/models'` |
167
176
 
168
177
  ### Page link preview API (`src/models/api/results/`)
@@ -190,12 +199,6 @@ Helper tables use columns **Name**, **Description**, **Import**. Model tables ad
190
199
  | `RopewikiRegionView` | N/A | Region detail view payload. | `import { RopewikiRegionView } from 'ropegeo-common/models'` |
191
200
  | `RopewikiRegionViewResult` | `Result` | API result wrapping region view. | `import { RopewikiRegionViewResult } from 'ropegeo-common/models'` |
192
201
 
193
- ### Ropewiki region bounds API (`src/models/api/results/`)
194
-
195
- | Name | Base class | Description | Import |
196
- | --- | --- | --- | --- |
197
- | `RopewikiRegionBoundsResult` | `Result` | GET /ropewiki/region/{id}/bounds (`Bounds` over route coordinates). | `import { RopewikiRegionBoundsResult } from 'ropegeo-common/models'` |
198
-
199
202
  ### Ropewiki region previews API (`src/models/api/params/`, `src/models/api/results/`)
200
203
 
201
204
  | Name | Base class | Description | Import |
@@ -216,10 +219,14 @@ Helper tables use columns **Name**, **Description**, **Import**. Model tables ad
216
219
 
217
220
  | Name | Base class | Description | Import |
218
221
  | --- | --- | --- | --- |
219
- | `BetaSectionImage` | N/A | Image in a beta section (URLs, pagination bytes). | `import { BetaSectionImage } from 'ropegeo-common/models'` |
222
+ | `BetaSectionImage` | N/A | Abstract beta-section image base; dispatches by `fetchType`. | `import { BetaSectionImage } from 'ropegeo-common/models'` |
223
+ | `OnlineBetaSectionImage` | `BetaSectionImage` | API image with remote URLs and optional `downloadBytes`. | `import { OnlineBetaSectionImage } from 'ropegeo-common/models'` |
224
+ | `OfflineBetaSectionImage` | `BetaSectionImage` | Persisted image with downloaded banner/full paths. | `import { OfflineBetaSectionImage } from 'ropegeo-common/models'` |
220
225
  | `RopewikiImageView` | N/A | Type alias of `BetaSectionImage` for Ropewiki page view typings. | `import type { RopewikiImageView } from 'ropegeo-common/models'` |
221
226
  | `DownloadBytes` | N/A | Preview/banner/full byte sizes for downloads. | `import { DownloadBytes } from 'ropegeo-common/models'` |
222
- | `BetaSection` | N/A | Beta section with images. | `import { BetaSection } from 'ropegeo-common/models'` |
227
+ | `BetaSection` | N/A | Abstract beta section base; dispatches by `fetchType`. | `import { BetaSection } from 'ropegeo-common/models'` |
228
+ | `OnlineBetaSection` | `BetaSection` | API section with online images (`OnlineBetaSectionImage[]`). | `import { OnlineBetaSection } from 'ropegeo-common/models'` |
229
+ | `OfflineBetaSection` | `BetaSection` | Persisted section with offline images (`OfflineBetaSectionImage[]`). | `import { OfflineBetaSection } from 'ropegeo-common/models'` |
223
230
  | `RopewikiBetaSectionView` | N/A | Type alias of `BetaSection` for Ropewiki page view typings. | `import type { RopewikiBetaSectionView } from 'ropegeo-common/models'` |
224
231
 
225
232
  ### Minimap (`src/models/minimap/`)
@@ -228,9 +235,14 @@ Helper tables use columns **Name**, **Description**, **Import**. Model tables ad
228
235
  | --- | --- | --- | --- |
229
236
  | `Bounds` | N/A | Geographic bounding box. | `import { Bounds } from 'ropegeo-common/models'` |
230
237
  | `MiniMapType` | N/A | Minimap discriminator (e.g. GeoJSON). | `import { MiniMapType } from 'ropegeo-common/models'` |
231
- | `MiniMap` | N/A | Abstract base for page/region minimaps. | `import { MiniMap } from 'ropegeo-common/models'` |
232
- | `RegionMiniMap` | `MiniMap` | Region minimap payload. | `import { RegionMiniMap } from 'ropegeo-common/models'` |
233
- | `PageMiniMap` | `MiniMap` | Page minimap payload. | `import { PageMiniMap } from 'ropegeo-common/models'` |
238
+ | `MiniMap` | N/A | Abstract base for minimaps; `fromResult` parses API wire types only. | `import { MiniMap } from 'ropegeo-common/models'` |
239
+ | `RegionMiniMap` | `MiniMap` | Region minimap (`geojson`): `routesParams`, `bounds` (or null), `title`. | `import { RegionMiniMap } from 'ropegeo-common/models'` |
240
+ | `PageMiniMap` | `MiniMap` | Abstract base for page minimaps (online/offline tile templates). | `import { PageMiniMap } from 'ropegeo-common/models'` |
241
+ | `OnlinePageMiniMap` | `PageMiniMap` | API page tiles template (`onlineTilesTemplate`, `fetchType: "online"`). | `import { OnlinePageMiniMap } from 'ropegeo-common/models'` |
242
+ | `OfflinePageMiniMap` | `PageMiniMap` | Persisted local tiles template (`offlineTilesTemplate`, `fetchType: "offline"`). | `import { OfflinePageMiniMap } from 'ropegeo-common/models'` |
243
+ | `CenteredRegionMiniMap` | `MiniMap` | Abstract base for centered region minimaps (online routes params / offline geojson path). | `import { CenteredRegionMiniMap } from 'ropegeo-common/models'` |
244
+ | `OnlineCenteredRegionMiniMap` | `CenteredRegionMiniMap` | API centered-route fallback (`routesParams`, `fetchType: "online"`). | `import { OnlineCenteredRegionMiniMap } from 'ropegeo-common/models'` |
245
+ | `OfflineCenteredRegionMiniMap` | `CenteredRegionMiniMap` | Persisted local centered-route geojson (`downloadedGeojson`, `fetchType: "offline"`). | `import { OfflineCenteredRegionMiniMap } from 'ropegeo-common/models'` |
234
246
 
235
247
  ### Link preview (`src/models/linkPreview/`)
236
248
 
@@ -273,7 +285,7 @@ Helper tables use columns **Name**, **Description**, **Import**. Model tables ad
273
285
  | `ImageVersion` | N/A | Enum of cached image variant kinds. | `import { ImageVersion } from 'ropegeo-common/models'` |
274
286
  | `VERSION_FORMAT` | N/A | Format constant for version strings. | `import { VERSION_FORMAT } from 'ropegeo-common/models'` |
275
287
  | `ImageVersions` | N/A | Map of image URLs by `ImageVersion`; `fromResult` for persisted JSON. | `import { ImageVersions } from 'ropegeo-common/models'` |
276
- | `SavedPage` | N/A | Offline saved page record (`PagePreview` + metadata). | `import { SavedPage } from 'ropegeo-common/models'` |
288
+ | `SavedPage` | N/A | Saved page record (`OnlinePagePreview` or `OfflinePagePreview`) with optional `downloadedPageViewPath`. | `import { SavedPage } from 'ropegeo-common/models'` |
277
289
 
278
290
  ### React components (`src/components/`)
279
291
 
@@ -1,88 +1,5 @@
1
- import '../../difficulty/registerDifficultyParsers';
2
- import { Difficulty } from '../../difficulty/difficulty';
3
- import { PermitStatus } from '../../permitStatus';
4
- import { BetaSection } from '../../betaSections/betaSection';
5
- import { BetaSectionImage } from '../../betaSections/betaSectionImage';
6
- import { MiniMap } from '../../minimap/miniMap';
7
- import { PagePreview } from '../../previews/pagePreview';
8
- type MinMax = {
9
- min: number;
10
- max: number;
11
- };
12
- /**
13
- * Response type for GET getRopewikiPageView (full page view).
14
- */
15
- export declare class RopewikiPageView {
16
- name: string;
17
- aka: string[];
18
- url: string;
19
- quality: number;
20
- userVotes: number;
21
- regions: {
22
- name: string;
23
- id: string;
24
- }[];
25
- difficulty: Difficulty;
26
- permit: PermitStatus | null;
27
- rappelCount: MinMax | number | null;
28
- jumps: number | null;
29
- vehicle: string | null;
30
- rappelLongest: number | null;
31
- shuttleTime: number | null;
32
- overallLength: number | null;
33
- descentLength: number | null;
34
- exitLength: number | null;
35
- approachLength: number | null;
36
- overallTime: MinMax | number | null;
37
- approachTime: MinMax | number | null;
38
- descentTime: MinMax | number | null;
39
- exitTime: MinMax | number | null;
40
- approachElevGain: number | null;
41
- descentElevGain: number | null;
42
- exitElevGain: number | null;
43
- months: string[];
44
- latestRevisionDate: Date;
45
- bannerImage: BetaSectionImage | null;
46
- betaSections: BetaSection[];
47
- /** Minimap for the page route (tiles template + bounds when present), or null. */
48
- miniMap: MiniMap | null;
49
- /** Page centroid in WGS84 degrees when known; otherwise null (same convention as search and Route). */
50
- coordinates: {
51
- lat: number;
52
- lon: number;
53
- } | null;
54
- constructor(name: string, aka: string[], url: string, quality: number, userVotes: number, regions: {
55
- name: string;
56
- id: string;
57
- }[], difficulty: Difficulty, permit: PermitStatus | null, rappelCount: MinMax | number | null, jumps: number | null, vehicle: string | null, rappelLongest: number | null, shuttleTime: number | null, overallLength: number | null, descentLength: number | null, exitLength: number | null, approachLength: number | null, overallTime: MinMax | number | null, approachTime: MinMax | number | null, descentTime: MinMax | number | null, exitTime: MinMax | number | null, approachElevGain: number | null, descentElevGain: number | null, exitElevGain: number | null, months: string[], latestRevisionDate: Date, bannerImage: BetaSectionImage | null, betaSections: BetaSection[], miniMap: MiniMap | null, coordinates: {
58
- lat: number;
59
- lon: number;
60
- } | null);
61
- /**
62
- * Validates result has RopewikiPageView fields and returns a RopewikiPageView instance.
63
- */
64
- static fromResult(result: unknown): RopewikiPageView;
65
- /**
66
- * Maps this full page view to a PagePreview for persistence (saved pages).
67
- * @param apiPageId Ropewiki page uuid from GET /ropewiki/page/{id}.
68
- */
69
- toPagePreview(apiPageId: string): PagePreview;
70
- private static assertString;
71
- private static assertNullableString;
72
- private static assertNullableMiniMap;
73
- private static parseCoordinateComponent;
74
- private static assertNullableCoordinates;
75
- private static assertNumber;
76
- private static assertNullableNumber;
77
- private static assertStringArray;
78
- private static assertRegionsArray;
79
- private static assertDifficulty;
80
- private static assertPermit;
81
- private static assertRappelCount;
82
- private static assertMinMaxOrNumber;
83
- private static assertIso8601DateString;
84
- private static assertNullableBannerImage;
85
- private static assertBetaSectionsArray;
86
- }
87
- export {};
1
+ export { OnlineRopewikiPageView as RopewikiPageView } from '../../pageViews/onlineRopewikiPageView';
2
+ export { OnlineRopewikiPageView } from '../../pageViews/onlineRopewikiPageView';
3
+ export { OfflineRopewikiPageView } from '../../pageViews/offlineRopewikiPageView';
4
+ export { RopewikiPageView as BaseRopewikiPageView } from '../../pageViews/ropewikiPageView';
88
5
  //# sourceMappingURL=ropewikiPageView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ropewikiPageView.d.ts","sourceRoot":"","sources":["../../../../src/models/api/endpoints/ropewikiPageView.ts"],"names":[],"mappings":"AAAA,OAAO,4CAA4C,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAIhD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,KAAK,MAAM,GAAG;IAAE,G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E,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,kCAAkC,CAAC"}
@@ -1,291 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RopewikiPageView = void 0;
4
- require("../../difficulty/registerDifficultyParsers");
5
- const difficulty_1 = require("../../difficulty/difficulty");
6
- const permitStatus_1 = require("../../permitStatus");
7
- const betaSection_1 = require("../../betaSections/betaSection");
8
- const betaSectionImage_1 = require("../../betaSections/betaSectionImage");
9
- const miniMapType_1 = require("../../minimap/miniMapType");
10
- const pageMiniMap_1 = require("../../minimap/pageMiniMap");
11
- const pageDataSource_1 = require("../../pageDataSource");
12
- const pagePreview_1 = require("../../previews/pagePreview");
13
- /**
14
- * Response type for GET getRopewikiPageView (full page view).
15
- */
16
- class RopewikiPageView {
17
- constructor(name, aka, url, quality, userVotes, regions, difficulty, permit, rappelCount, jumps, vehicle, rappelLongest, shuttleTime, overallLength, descentLength, exitLength, approachLength, overallTime, approachTime, descentTime, exitTime, approachElevGain, descentElevGain, exitElevGain, months, latestRevisionDate, bannerImage, betaSections, miniMap, coordinates) {
18
- this.name = name;
19
- this.aka = Array.isArray(aka) ? aka.slice() : [];
20
- this.url = url;
21
- this.quality = quality;
22
- this.userVotes = userVotes;
23
- this.regions = Array.isArray(regions) ? regions.slice() : [];
24
- this.difficulty = difficulty;
25
- this.permit = permit;
26
- this.rappelCount = rappelCount;
27
- this.jumps = jumps;
28
- this.vehicle = vehicle;
29
- this.rappelLongest = rappelLongest;
30
- this.shuttleTime = shuttleTime;
31
- this.overallLength = overallLength;
32
- this.descentLength = descentLength;
33
- this.exitLength = exitLength;
34
- this.approachLength = approachLength;
35
- this.overallTime = overallTime;
36
- this.approachTime = approachTime;
37
- this.descentTime = descentTime;
38
- this.exitTime = exitTime;
39
- this.approachElevGain = approachElevGain;
40
- this.descentElevGain = descentElevGain;
41
- this.exitElevGain = exitElevGain;
42
- this.months = Array.isArray(months) ? months.slice() : [];
43
- this.latestRevisionDate = new Date(latestRevisionDate);
44
- this.bannerImage = bannerImage;
45
- this.betaSections = Array.isArray(betaSections) ? betaSections : [];
46
- this.miniMap = miniMap;
47
- this.coordinates =
48
- coordinates != null
49
- ? { lat: coordinates.lat, lon: coordinates.lon }
50
- : null;
51
- }
52
- /**
53
- * Validates result has RopewikiPageView fields and returns a RopewikiPageView instance.
54
- */
55
- static fromResult(result) {
56
- if (result == null || typeof result !== 'object') {
57
- throw new Error('RopewikiPageView result must be an object');
58
- }
59
- const r = result;
60
- RopewikiPageView.assertString(r, 'name');
61
- RopewikiPageView.assertStringArray(r, 'aka');
62
- RopewikiPageView.assertString(r, 'url');
63
- RopewikiPageView.assertNumber(r, 'quality');
64
- RopewikiPageView.assertNumber(r, 'userVotes');
65
- RopewikiPageView.assertRegionsArray(r, 'regions');
66
- RopewikiPageView.assertDifficulty(r, 'difficulty');
67
- RopewikiPageView.assertPermit(r, 'permit');
68
- RopewikiPageView.assertRappelCount(r, 'rappelCount');
69
- RopewikiPageView.assertNullableNumber(r, 'jumps');
70
- RopewikiPageView.assertNullableString(r, 'vehicle');
71
- RopewikiPageView.assertNullableNumber(r, 'rappelLongest');
72
- RopewikiPageView.assertNullableNumber(r, 'shuttleTime');
73
- RopewikiPageView.assertNullableNumber(r, 'overallLength');
74
- RopewikiPageView.assertNullableNumber(r, 'descentLength');
75
- RopewikiPageView.assertNullableNumber(r, 'exitLength');
76
- RopewikiPageView.assertNullableNumber(r, 'approachLength');
77
- RopewikiPageView.assertMinMaxOrNumber(r, 'overallTime');
78
- RopewikiPageView.assertMinMaxOrNumber(r, 'approachTime');
79
- RopewikiPageView.assertMinMaxOrNumber(r, 'descentTime');
80
- RopewikiPageView.assertMinMaxOrNumber(r, 'exitTime');
81
- RopewikiPageView.assertNullableNumber(r, 'approachElevGain');
82
- RopewikiPageView.assertNullableNumber(r, 'descentElevGain');
83
- RopewikiPageView.assertNullableNumber(r, 'exitElevGain');
84
- RopewikiPageView.assertStringArray(r, 'months');
85
- RopewikiPageView.assertIso8601DateString(r, 'latestRevisionDate');
86
- RopewikiPageView.assertNullableBannerImage(r, 'bannerImage');
87
- RopewikiPageView.assertBetaSectionsArray(r, 'betaSections');
88
- RopewikiPageView.assertNullableMiniMap(r, 'miniMap');
89
- RopewikiPageView.assertNullableCoordinates(r, 'coordinates');
90
- r.latestRevisionDate = new Date(r.latestRevisionDate);
91
- r.difficulty = difficulty_1.Difficulty.fromResult(r.difficulty);
92
- if (r.miniMap != null && r.miniMap !== undefined) {
93
- r.miniMap = pageMiniMap_1.PageMiniMap.fromResult(r.miniMap);
94
- }
95
- else {
96
- r.miniMap = null;
97
- }
98
- Object.setPrototypeOf(r, RopewikiPageView.prototype);
99
- return r;
100
- }
101
- /**
102
- * Maps this full page view to a PagePreview for persistence (saved pages).
103
- * @param apiPageId Ropewiki page uuid from GET /ropewiki/page/{id}.
104
- */
105
- toPagePreview(apiPageId) {
106
- let mapData = null;
107
- if (this.miniMap != null && this.miniMap.miniMapType === miniMapType_1.MiniMapType.TilesTemplate) {
108
- mapData = this.miniMap.layerId;
109
- }
110
- return new pagePreview_1.PagePreview(apiPageId, pageDataSource_1.PageDataSource.Ropewiki, this.bannerImage?.bannerUrl ?? null, this.quality, this.userVotes, this.name, this.regions.map((r) => r.name), this.aka, this.difficulty, mapData, this.url, this.permit);
111
- }
112
- static assertString(obj, key) {
113
- const v = obj[key];
114
- if (typeof v !== 'string') {
115
- throw new Error(`RopewikiPageView.${key} must be a string, got: ${typeof v}`);
116
- }
117
- }
118
- static assertNullableString(obj, key) {
119
- const v = obj[key];
120
- if (v !== null && v !== undefined && typeof v !== 'string') {
121
- throw new Error(`RopewikiPageView.${key} must be string or null, got: ${typeof v}`);
122
- }
123
- }
124
- static assertNullableMiniMap(obj, key) {
125
- const v = obj[key];
126
- if (v === null || v === undefined)
127
- return;
128
- if (typeof v !== 'object') {
129
- throw new Error(`RopewikiPageView.${key} must be a PageMiniMap object or null, got: ${typeof v}`);
130
- }
131
- }
132
- static parseCoordinateComponent(value) {
133
- if (typeof value === 'number' && Number.isFinite(value)) {
134
- return value;
135
- }
136
- if (typeof value === 'string') {
137
- const trimmed = value.trim();
138
- if (trimmed === '')
139
- return null;
140
- const n = Number(trimmed);
141
- if (Number.isFinite(n))
142
- return n;
143
- }
144
- return null;
145
- }
146
- static assertNullableCoordinates(obj, key) {
147
- const v = obj[key];
148
- if (v === null || v === undefined) {
149
- obj[key] = null;
150
- return;
151
- }
152
- if (typeof v !== 'object' || v === null || Array.isArray(v)) {
153
- throw new Error(`RopewikiPageView.${key} must be { lat, lon } or null, got: ${typeof v}`);
154
- }
155
- const o = v;
156
- const lat = RopewikiPageView.parseCoordinateComponent(o.lat);
157
- const lon = RopewikiPageView.parseCoordinateComponent(o.lon);
158
- if (lat === null || lon === null) {
159
- throw new Error(`RopewikiPageView.${key}.lat and .lon must be finite numbers or numeric strings`);
160
- }
161
- obj[key] = { lat, lon };
162
- }
163
- static assertNumber(obj, key) {
164
- const v = obj[key];
165
- if (typeof v !== 'number' || Number.isNaN(v)) {
166
- throw new Error(`RopewikiPageView.${key} must be a number, got: ${typeof v}`);
167
- }
168
- }
169
- static assertNullableNumber(obj, key) {
170
- const v = obj[key];
171
- if (v !== null && v !== undefined && (typeof v !== 'number' || Number.isNaN(v))) {
172
- throw new Error(`RopewikiPageView.${key} must be a number or null, got: ${typeof v}`);
173
- }
174
- }
175
- static assertStringArray(obj, key) {
176
- const v = obj[key];
177
- if (!Array.isArray(v)) {
178
- throw new Error(`RopewikiPageView.${key} must be an array, got: ${typeof v}`);
179
- }
180
- for (let i = 0; i < v.length; i++) {
181
- if (typeof v[i] !== 'string') {
182
- throw new Error(`RopewikiPageView.${key}[${i}] must be a string`);
183
- }
184
- }
185
- }
186
- static assertRegionsArray(obj, key) {
187
- const v = obj[key];
188
- if (!Array.isArray(v)) {
189
- throw new Error(`RopewikiPageView.${key} must be an array, got: ${typeof v}`);
190
- }
191
- for (let i = 0; i < v.length; i++) {
192
- const item = v[i];
193
- if (item == null || typeof item !== 'object') {
194
- throw new Error(`RopewikiPageView.${key}[${i}] must be an object with id and name`);
195
- }
196
- const o = item;
197
- if (typeof o.id !== 'string') {
198
- throw new Error(`RopewikiPageView.${key}[${i}].id must be a string, got: ${typeof o.id}`);
199
- }
200
- if (typeof o.name !== 'string') {
201
- throw new Error(`RopewikiPageView.${key}[${i}].name must be a string, got: ${typeof o.name}`);
202
- }
203
- }
204
- }
205
- static assertDifficulty(obj, key) {
206
- const v = obj[key];
207
- if (v == null || typeof v !== 'object') {
208
- throw new Error(`RopewikiPageView.${key} must be an object, got: ${typeof v}`);
209
- }
210
- const d = v;
211
- if (d.technical !== null && d.technical !== undefined && typeof d.technical !== 'string') {
212
- throw new Error(`RopewikiPageView.${key}.technical must be string or null`);
213
- }
214
- if (d.water !== null && d.water !== undefined && typeof d.water !== 'string') {
215
- throw new Error(`RopewikiPageView.${key}.water must be string or null`);
216
- }
217
- if (d.time !== null && d.time !== undefined && typeof d.time !== 'string') {
218
- throw new Error(`RopewikiPageView.${key}.time must be string or null`);
219
- }
220
- if (d.additionalRisk !== null &&
221
- d.additionalRisk !== undefined &&
222
- typeof d.additionalRisk !== 'string') {
223
- throw new Error(`RopewikiPageView.${key}.additionalRisk must be string or null`);
224
- }
225
- }
226
- static assertPermit(obj, key) {
227
- const v = obj[key];
228
- if (v === null || v === undefined)
229
- return;
230
- if (typeof v !== 'string') {
231
- throw new Error(`RopewikiPageView.${key} must be PermitStatus or null, got: ${typeof v}`);
232
- }
233
- const values = Object.values(permitStatus_1.PermitStatus);
234
- if (!values.includes(v)) {
235
- throw new Error(`RopewikiPageView.${key} must be one of [${values.join(', ')}] or null, got: ${v}`);
236
- }
237
- }
238
- static assertRappelCount(obj, key) {
239
- const v = obj[key];
240
- if (v === null || v === undefined)
241
- return;
242
- if (typeof v === 'number') {
243
- if (Number.isNaN(v)) {
244
- throw new Error(`RopewikiPageView.${key} must be a number or min/max object or null`);
245
- }
246
- return;
247
- }
248
- if (typeof v === 'object' && v !== null && 'min' in v && 'max' in v) {
249
- const o = v;
250
- if (typeof o.min !== 'number' || Number.isNaN(o.min)) {
251
- throw new Error(`RopewikiPageView.${key}.min must be a number`);
252
- }
253
- if (typeof o.max !== 'number' || Number.isNaN(o.max)) {
254
- throw new Error(`RopewikiPageView.${key}.max must be a number`);
255
- }
256
- return;
257
- }
258
- throw new Error(`RopewikiPageView.${key} must be number or { min, max } or null, got: ${typeof v}`);
259
- }
260
- static assertMinMaxOrNumber(obj, key) {
261
- RopewikiPageView.assertRappelCount(obj, key);
262
- }
263
- static assertIso8601DateString(obj, key) {
264
- const v = obj[key];
265
- if (typeof v !== 'string') {
266
- throw new Error(`RopewikiPageView.${key} must be an ISO 8601 date string, got: ${typeof v}`);
267
- }
268
- const date = new Date(v);
269
- if (Number.isNaN(date.getTime())) {
270
- throw new Error(`RopewikiPageView.${key} must be a valid ISO 8601 date string, got: ${v}`);
271
- }
272
- }
273
- static assertNullableBannerImage(obj, key) {
274
- const v = obj[key];
275
- if (v === null || v === undefined)
276
- return;
277
- if (typeof v !== 'object') {
278
- throw new Error(`RopewikiPageView.${key} must be BetaSectionImage or null, got: ${typeof v}`);
279
- }
280
- const parsed = betaSectionImage_1.BetaSectionImage.fromResult(v);
281
- obj[key] = parsed;
282
- }
283
- static assertBetaSectionsArray(obj, key) {
284
- const v = obj[key];
285
- if (!Array.isArray(v)) {
286
- throw new Error(`RopewikiPageView.${key} must be an array, got: ${typeof v}`);
287
- }
288
- obj[key] = v.map((item) => betaSection_1.BetaSection.fromResponseBody(item));
289
- }
290
- }
291
- exports.RopewikiPageView = RopewikiPageView;
3
+ exports.BaseRopewikiPageView = exports.OfflineRopewikiPageView = exports.OnlineRopewikiPageView = exports.RopewikiPageView = void 0;
4
+ var onlineRopewikiPageView_1 = require("../../pageViews/onlineRopewikiPageView");
5
+ Object.defineProperty(exports, "RopewikiPageView", { enumerable: true, get: function () { return onlineRopewikiPageView_1.OnlineRopewikiPageView; } });
6
+ var onlineRopewikiPageView_2 = require("../../pageViews/onlineRopewikiPageView");
7
+ Object.defineProperty(exports, "OnlineRopewikiPageView", { enumerable: true, get: function () { return onlineRopewikiPageView_2.OnlineRopewikiPageView; } });
8
+ var offlineRopewikiPageView_1 = require("../../pageViews/offlineRopewikiPageView");
9
+ Object.defineProperty(exports, "OfflineRopewikiPageView", { enumerable: true, get: function () { return offlineRopewikiPageView_1.OfflineRopewikiPageView; } });
10
+ var ropewikiPageView_1 = require("../../pageViews/ropewikiPageView");
11
+ Object.defineProperty(exports, "BaseRopewikiPageView", { enumerable: true, get: function () { return ropewikiPageView_1.RopewikiPageView; } });
@@ -1,5 +1,5 @@
1
- import { BetaSection } from '../../betaSections/betaSection';
2
- import { MiniMap } from '../../minimap/miniMap';
1
+ import { OnlineBetaSection } from '../../betaSections/onlineBetaSection';
2
+ import { RegionMiniMap } from '../../minimap/regionMiniMap';
3
3
  /**
4
4
  * Region view for getRopewikiRegionView (GET /ropewiki/region/{id}).
5
5
  * Contains all RopewikiRegion info for the region except the region's id.
@@ -19,15 +19,15 @@ export declare class RopewikiRegionView {
19
19
  pageCount: number;
20
20
  /** Pages in this region and all descendants (truePageCountWithDescendents). Default 0. */
21
21
  totalPageCount: number;
22
- overview: BetaSection | null;
22
+ overview: OnlineBetaSection | null;
23
23
  bestMonths: string[];
24
24
  isMajorRegion: boolean;
25
25
  latestRevisionDate: Date;
26
26
  /** When the region was last synced (from updatedAt). */
27
27
  syncDate: Date;
28
28
  externalLink: string;
29
- miniMap: MiniMap | null;
30
- constructor(name: string, latestRevisionDate: Date, url: string, updatedAt: Date, miniMap: MiniMap | null, regions?: {
29
+ miniMap: RegionMiniMap | null;
30
+ constructor(name: string, latestRevisionDate: Date, url: string, updatedAt: Date, miniMap: RegionMiniMap | null, regions?: {
31
31
  name: string;
32
32
  id: string;
33
33
  }[], rawPageCount?: number | null, truePageCount?: number | null, trueRegionCount?: number | null, truePageCountWithDescendents?: number | null, overview?: string | null, bestMonths?: string[] | null, isMajorRegion?: boolean | null);
@@ -1 +1 @@
1
- {"version":3,"file":"ropewikiRegionView.d.ts","sourceRoot":"","sources":["../../../../src/models/api/endpoints/ropewikiRegionView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD;;;GAGG;AACH,qBAAa,kBAAkB;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,gHAAgH;IAChH,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACxC,mEAAmE;IACnE,WAAW,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oEAAoE;IACpE,SAAS,EAAE,MAAM,CAAC;IAClB,0FAA0F;IAC1F,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,kBAAkB,EAAE,IAAI,CAAC;IACzB,wDAAwD;IACxD,QAAQ,EAAE,IAAI,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;gBAGpB,IAAI,EAAE,MAAM,EACZ,kBAAkB,EAAE,IAAI,EACxB,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,OAAO,GAAG,IAAI,EACvB,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,EACxC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,EAC5B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,EAC7B,eAAe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AAO,CAAC,MAAM,CAAC,qBAAqB;IAUpC,OAAO,CAAC,MAAM,CAAC,cAAc;CAkBhC"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RopewikiRegionView = void 0;
4
- const betaSection_1 = require("../../betaSections/betaSection");
4
+ const onlineBetaSection_1 = require("../../betaSections/onlineBetaSection");
5
5
  const regionMiniMap_1 = require("../../minimap/regionMiniMap");
6
6
  /**
7
7
  * Region view for getRopewikiRegionView (GET /ropewiki/region/{id}).
@@ -18,7 +18,7 @@ class RopewikiRegionView {
18
18
  const revDate = new Date(latestRevisionDate);
19
19
  this.overview =
20
20
  overview != null && overview !== ''
21
- ? new betaSection_1.BetaSection(1, 'Overview', overview, revDate, [])
21
+ ? new onlineBetaSection_1.OnlineBetaSection(1, 'Overview', overview, revDate, [])
22
22
  : null;
23
23
  this.bestMonths = Array.isArray(bestMonths) ? bestMonths : [];
24
24
  this.isMajorRegion = isMajorRegion ?? false;
@@ -54,7 +54,10 @@ class RopewikiRegionView {
54
54
  r.overview =
55
55
  r.overview == null || r.overview === undefined
56
56
  ? null
57
- : betaSection_1.BetaSection.fromResponseBody(r.overview);
57
+ : onlineBetaSection_1.OnlineBetaSection.fromResponseBody({
58
+ ...r.overview,
59
+ fetchType: 'online',
60
+ });
58
61
  if (r.miniMap == null || r.miniMap === undefined) {
59
62
  r.miniMap = null;
60
63
  }
@@ -141,7 +144,7 @@ class RopewikiRegionView {
141
144
  if (v === null || v === undefined)
142
145
  return;
143
146
  if (typeof v !== 'object') {
144
- throw new Error(`RopewikiRegionView.${key} must be a MiniMap object or null, got: ${typeof v}`);
147
+ throw new Error(`RopewikiRegionView.${key} must be a RegionMiniMap object or null, got: ${typeof v}`);
145
148
  }
146
149
  }
147
150
  static assertValidUrl(obj, key) {
@@ -7,7 +7,6 @@ import './ropewikiPageViewResult';
7
7
  import './ropewikiPageLinkPreviewResult';
8
8
  import './ropewikiRegionViewResult';
9
9
  import './routeResult';
10
- import './ropewikiRegionBoundsResult';
11
10
  import './routePreviewResult';
12
11
  import './searchResults';
13
12
  import './ropewikiRegionPreviewsResult';
@@ -1 +1 @@
1
- {"version":3,"file":"registerAllResultParsers.d.ts","sourceRoot":"","sources":["../../../../src/models/api/results/registerAllResultParsers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,0BAA0B,CAAC;AAClC,OAAO,iCAAiC,CAAC;AACzC,OAAO,4BAA4B,CAAC;AACpC,OAAO,eAAe,CAAC;AACvB,OAAO,8BAA8B,CAAC;AACtC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,iBAAiB,CAAC;AACzB,OAAO,gCAAgC,CAAC;AACxC,OAAO,8BAA8B,CAAC;AACtC,OAAO,0BAA0B,CAAC"}
1
+ {"version":3,"file":"registerAllResultParsers.d.ts","sourceRoot":"","sources":["../../../../src/models/api/results/registerAllResultParsers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,0BAA0B,CAAC;AAClC,OAAO,iCAAiC,CAAC;AACzC,OAAO,4BAA4B,CAAC;AACpC,OAAO,eAAe,CAAC;AACvB,OAAO,sBAAsB,CAAC;AAC9B,OAAO,iBAAiB,CAAC;AACzB,OAAO,gCAAgC,CAAC;AACxC,OAAO,8BAA8B,CAAC;AACtC,OAAO,0BAA0B,CAAC"}
@@ -9,7 +9,6 @@ require("./ropewikiPageViewResult");
9
9
  require("./ropewikiPageLinkPreviewResult");
10
10
  require("./ropewikiRegionViewResult");
11
11
  require("./routeResult");
12
- require("./ropewikiRegionBoundsResult");
13
12
  require("./routePreviewResult");
14
13
  require("./searchResults");
15
14
  require("./ropewikiRegionPreviewsResult");
@@ -1,11 +1,10 @@
1
1
  /**
2
- * Discriminator for single-result API response types (e.g. getRopewikiPageView, region bounds).
2
+ * Discriminator for single-result API response types (e.g. getRopewikiPageView).
3
3
  * Used in response body so consumers can identify the result shape.
4
4
  */
5
5
  export declare enum ResultType {
6
6
  RopewikiPageView = "ropewikiPageView",
7
7
  RopewikiRegionView = "ropewikiRegionView",
8
- RopewikiRegionBounds = "ropewikiRegionBounds",
9
8
  RoutePreview = "routePreview",
10
9
  RopewikiPageLinkPreview = "ropewikiPageLinkPreview"
11
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../../../src/models/api/results/result.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,UAAU;IAClB,gBAAgB,qBAAqB;IACrC,kBAAkB,uBAAuB;IACzC,oBAAoB,yBAAyB;IAC7C,YAAY,iBAAiB;IAC7B,uBAAuB,4BAA4B;CACtD;AAID;;;GAGG;AACH,wBAAgB,oBAAoB,CAChC,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,MAAM,GACxC,IAAI,CAEN;AAED;;;;;GAKG;AACH,8BAAsB,MAAM,CAAC,CAAC,GAAG,OAAO;aAEhB,MAAM,EAAE,CAAC;aACT,UAAU,EAAE,UAAU;gBADtB,MAAM,EAAE,CAAC,EACT,UAAU,EAAE,UAAU;IAG1C;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM;CA2BjD"}
1
+ {"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../../../src/models/api/results/result.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,UAAU;IAClB,gBAAgB,qBAAqB;IACrC,kBAAkB,uBAAuB;IACzC,YAAY,iBAAiB;IAC7B,uBAAuB,4BAA4B;CACtD;AAID;;;GAGG;AACH,wBAAgB,oBAAoB,CAChC,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,MAAM,GACxC,IAAI,CAEN;AAED;;;;;GAKG;AACH,8BAAsB,MAAM,CAAC,CAAC,GAAG,OAAO;aAEhB,MAAM,EAAE,CAAC;aACT,UAAU,EAAE,UAAU;gBADtB,MAAM,EAAE,CAAC,EACT,UAAU,EAAE,UAAU;IAG1C;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM;CA2BjD"}