ropegeo-common 1.11.0 → 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 (118) hide show
  1. package/README.md +24 -9
  2. package/dist/models/api/endpoints/ropewikiPageView.d.ts +4 -89
  3. package/dist/models/api/endpoints/ropewikiPageView.d.ts.map +1 -1
  4. package/dist/models/api/endpoints/ropewikiPageView.js +9 -304
  5. package/dist/models/api/endpoints/ropewikiRegionView.d.ts +2 -2
  6. package/dist/models/api/endpoints/ropewikiRegionView.d.ts.map +1 -1
  7. package/dist/models/api/endpoints/ropewikiRegionView.js +6 -3
  8. package/dist/models/api/results/ropewikiPageViewResult.d.ts +4 -4
  9. package/dist/models/api/results/ropewikiPageViewResult.d.ts.map +1 -1
  10. package/dist/models/api/results/ropewikiPageViewResult.js +2 -2
  11. package/dist/models/api/results/routePreviewResult.d.ts +4 -4
  12. package/dist/models/api/results/routePreviewResult.d.ts.map +1 -1
  13. package/dist/models/api/results/routePreviewResult.js +2 -2
  14. package/dist/models/betaSections/betaSection.d.ts +11 -14
  15. package/dist/models/betaSections/betaSection.d.ts.map +1 -1
  16. package/dist/models/betaSections/betaSection.js +37 -24
  17. package/dist/models/betaSections/betaSectionImage.d.ts +13 -20
  18. package/dist/models/betaSections/betaSectionImage.d.ts.map +1 -1
  19. package/dist/models/betaSections/betaSectionImage.js +32 -22
  20. package/dist/models/betaSections/offlineBetaSection.d.ts +9 -0
  21. package/dist/models/betaSections/offlineBetaSection.d.ts.map +1 -0
  22. package/dist/models/betaSections/offlineBetaSection.js +23 -0
  23. package/dist/models/betaSections/offlineBetaSectionImage.d.ts +9 -0
  24. package/dist/models/betaSections/offlineBetaSectionImage.d.ts.map +1 -0
  25. package/dist/models/betaSections/offlineBetaSectionImage.js +28 -0
  26. package/dist/models/betaSections/onlineBetaSection.d.ts +14 -0
  27. package/dist/models/betaSections/onlineBetaSection.d.ts.map +1 -0
  28. package/dist/models/betaSections/onlineBetaSection.js +27 -0
  29. package/dist/models/betaSections/onlineBetaSectionImage.d.ts +14 -0
  30. package/dist/models/betaSections/onlineBetaSectionImage.d.ts.map +1 -0
  31. package/dist/models/betaSections/onlineBetaSectionImage.js +31 -0
  32. package/dist/models/betaSections/registerBetaSectionParsers.d.ts +5 -0
  33. package/dist/models/betaSections/registerBetaSectionParsers.d.ts.map +1 -0
  34. package/dist/models/betaSections/registerBetaSectionParsers.js +6 -0
  35. package/dist/models/fetchType.d.ts +2 -0
  36. package/dist/models/fetchType.d.ts.map +1 -0
  37. package/dist/models/fetchType.js +2 -0
  38. package/dist/models/index.d.ts +21 -2
  39. package/dist/models/index.d.ts.map +1 -1
  40. package/dist/models/index.js +35 -6
  41. package/dist/models/minimap/centeredRegionMiniMap.d.ts +8 -4
  42. package/dist/models/minimap/centeredRegionMiniMap.d.ts.map +1 -1
  43. package/dist/models/minimap/centeredRegionMiniMap.js +29 -10
  44. package/dist/models/minimap/miniMap.d.ts +1 -0
  45. package/dist/models/minimap/miniMap.d.ts.map +1 -1
  46. package/dist/models/minimap/miniMap.js +11 -18
  47. package/dist/models/minimap/miniMapType.d.ts +12 -4
  48. package/dist/models/minimap/miniMapType.d.ts.map +1 -1
  49. package/dist/models/minimap/miniMapType.js +12 -4
  50. package/dist/models/minimap/offlineCenteredRegionMiniMap.d.ts +11 -0
  51. package/dist/models/minimap/offlineCenteredRegionMiniMap.d.ts.map +1 -0
  52. package/dist/models/minimap/offlineCenteredRegionMiniMap.js +43 -0
  53. package/dist/models/minimap/offlinePageMiniMap.d.ts +12 -0
  54. package/dist/models/minimap/offlinePageMiniMap.d.ts.map +1 -0
  55. package/dist/models/minimap/offlinePageMiniMap.js +40 -0
  56. package/dist/models/minimap/onlineCenteredRegionMiniMap.d.ts +13 -0
  57. package/dist/models/minimap/onlineCenteredRegionMiniMap.d.ts.map +1 -0
  58. package/dist/models/minimap/onlineCenteredRegionMiniMap.js +32 -0
  59. package/dist/models/minimap/onlinePageMiniMap.d.ts +13 -0
  60. package/dist/models/minimap/onlinePageMiniMap.d.ts.map +1 -0
  61. package/dist/models/minimap/onlinePageMiniMap.js +31 -0
  62. package/dist/models/minimap/pageMiniMap.d.ts +8 -4
  63. package/dist/models/minimap/pageMiniMap.d.ts.map +1 -1
  64. package/dist/models/minimap/pageMiniMap.js +32 -16
  65. package/dist/models/minimap/regionMiniMap.d.ts +1 -0
  66. package/dist/models/minimap/regionMiniMap.d.ts.map +1 -1
  67. package/dist/models/minimap/regionMiniMap.js +5 -0
  68. package/dist/models/minimap/registerMiniMapParsers.d.ts +6 -0
  69. package/dist/models/minimap/registerMiniMapParsers.d.ts.map +1 -0
  70. package/dist/models/minimap/registerMiniMapParsers.js +7 -0
  71. package/dist/models/mobile/savedPage.d.ts +5 -29
  72. package/dist/models/mobile/savedPage.d.ts.map +1 -1
  73. package/dist/models/mobile/savedPage.js +13 -117
  74. package/dist/models/pageViews/offlinePageView.d.ts +11 -0
  75. package/dist/models/pageViews/offlinePageView.d.ts.map +1 -0
  76. package/dist/models/pageViews/offlinePageView.js +2 -0
  77. package/dist/models/pageViews/offlineRopewikiPageView.d.ts +39 -0
  78. package/dist/models/pageViews/offlineRopewikiPageView.d.ts.map +1 -0
  79. package/dist/models/pageViews/offlineRopewikiPageView.js +63 -0
  80. package/dist/models/pageViews/onlinePageView.d.ts +17 -0
  81. package/dist/models/pageViews/onlinePageView.d.ts.map +1 -0
  82. package/dist/models/pageViews/onlinePageView.js +2 -0
  83. package/dist/models/pageViews/onlineRopewikiPageView.d.ts +48 -0
  84. package/dist/models/pageViews/onlineRopewikiPageView.d.ts.map +1 -0
  85. package/dist/models/pageViews/onlineRopewikiPageView.js +107 -0
  86. package/dist/models/pageViews/pageViewType.d.ts +4 -0
  87. package/dist/models/pageViews/pageViewType.d.ts.map +1 -0
  88. package/dist/models/pageViews/pageViewType.js +7 -0
  89. package/dist/models/pageViews/registerPageViewParsers.d.ts +3 -0
  90. package/dist/models/pageViews/registerPageViewParsers.d.ts.map +1 -0
  91. package/dist/models/pageViews/registerPageViewParsers.js +4 -0
  92. package/dist/models/pageViews/ropewikiPageView.d.ts +76 -0
  93. package/dist/models/pageViews/ropewikiPageView.d.ts.map +1 -0
  94. package/dist/models/pageViews/ropewikiPageView.js +268 -0
  95. package/dist/models/previews/offlinePagePreview.d.ts +8 -0
  96. package/dist/models/previews/offlinePagePreview.d.ts.map +1 -0
  97. package/dist/models/previews/offlinePagePreview.js +23 -0
  98. package/dist/models/previews/onlinePagePreview.d.ts +10 -0
  99. package/dist/models/previews/onlinePagePreview.d.ts.map +1 -0
  100. package/dist/models/previews/onlinePagePreview.js +27 -0
  101. package/dist/models/previews/pagePreview.d.ts +15 -13
  102. package/dist/models/previews/pagePreview.d.ts.map +1 -1
  103. package/dist/models/previews/pagePreview.js +42 -7
  104. package/dist/models/previews/preview.d.ts +1 -0
  105. package/dist/models/previews/preview.d.ts.map +1 -1
  106. package/dist/models/previews/preview.js +9 -5
  107. package/dist/models/previews/regionPreview.d.ts.map +1 -1
  108. package/dist/models/previews/regionPreview.js +1 -0
  109. package/dist/models/previews/registerPreviewParsers.d.ts +5 -0
  110. package/dist/models/previews/registerPreviewParsers.d.ts.map +1 -0
  111. package/dist/models/previews/registerPreviewParsers.js +6 -0
  112. package/package.json +1 -1
  113. package/dist/models/minimap/downloadedCenteredRegionMiniMap.d.ts +0 -14
  114. package/dist/models/minimap/downloadedCenteredRegionMiniMap.d.ts.map +0 -1
  115. package/dist/models/minimap/downloadedCenteredRegionMiniMap.js +0 -46
  116. package/dist/models/minimap/downloadedPageMiniMap.d.ts +0 -17
  117. package/dist/models/minimap/downloadedPageMiniMap.d.ts.map +0 -1
  118. package/dist/models/minimap/downloadedPageMiniMap.js +0 -59
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/`)
@@ -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/`)
@@ -210,10 +219,14 @@ Helper tables use columns **Name**, **Description**, **Import**. Model tables ad
210
219
 
211
220
  | Name | Base class | Description | Import |
212
221
  | --- | --- | --- | --- |
213
- | `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'` |
214
225
  | `RopewikiImageView` | N/A | Type alias of `BetaSectionImage` for Ropewiki page view typings. | `import type { RopewikiImageView } from 'ropegeo-common/models'` |
215
226
  | `DownloadBytes` | N/A | Preview/banner/full byte sizes for downloads. | `import { DownloadBytes } from 'ropegeo-common/models'` |
216
- | `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'` |
217
230
  | `RopewikiBetaSectionView` | N/A | Type alias of `BetaSection` for Ropewiki page view typings. | `import type { RopewikiBetaSectionView } from 'ropegeo-common/models'` |
218
231
 
219
232
  ### Minimap (`src/models/minimap/`)
@@ -224,10 +237,12 @@ Helper tables use columns **Name**, **Description**, **Import**. Model tables ad
224
237
  | `MiniMapType` | N/A | Minimap discriminator (e.g. GeoJSON). | `import { MiniMapType } from 'ropegeo-common/models'` |
225
238
  | `MiniMap` | N/A | Abstract base for minimaps; `fromResult` parses API wire types only. | `import { MiniMap } from 'ropegeo-common/models'` |
226
239
  | `RegionMiniMap` | `MiniMap` | Region minimap (`geojson`): `routesParams`, `bounds` (or null), `title`. | `import { RegionMiniMap } from 'ropegeo-common/models'` |
227
- | `PageMiniMap` | `MiniMap` | Page minimap (`tilesTemplate`): tiles URL, `bounds`, `title`. | `import { PageMiniMap } from 'ropegeo-common/models'` |
228
- | `CenteredRegionMiniMap` | `MiniMap` | Page fallback (`centeredGeojson`): region-scoped `routesParams`, `centeredRouteId`, `title`. | `import { CenteredRegionMiniMap } from 'ropegeo-common/models'` |
229
- | `DownloadedPageMiniMap` | `MiniMap` | Saved-page offline tiles (`downloadedTilesTemplate`); persisted via `SavedPage`. | `import { DownloadedPageMiniMap } from 'ropegeo-common/models'` |
230
- | `DownloadedCenteredRegionMiniMap` | `MiniMap` | Saved-page offline routes file (`downloadedCenteredGeojson`); persisted via `SavedPage`. | `import { DownloadedCenteredRegionMiniMap } 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'` |
231
246
 
232
247
  ### Link preview (`src/models/linkPreview/`)
233
248
 
@@ -270,7 +285,7 @@ Helper tables use columns **Name**, **Description**, **Import**. Model tables ad
270
285
  | `ImageVersion` | N/A | Enum of cached image variant kinds. | `import { ImageVersion } from 'ropegeo-common/models'` |
271
286
  | `VERSION_FORMAT` | N/A | Format constant for version strings. | `import { VERSION_FORMAT } from 'ropegeo-common/models'` |
272
287
  | `ImageVersions` | N/A | Map of image URLs by `ImageVersion`; `fromResult` for persisted JSON. | `import { ImageVersions } from 'ropegeo-common/models'` |
273
- | `SavedPage` | N/A | Offline saved page record (`PagePreview` + optional `downloadedMiniMap` for offline minimaps). | `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'` |
274
289
 
275
290
  ### React components (`src/components/`)
276
291
 
@@ -1,90 +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 { CenteredRegionMiniMap } from '../../minimap/centeredRegionMiniMap';
7
- import { PageMiniMap } from '../../minimap/pageMiniMap';
8
- import { PagePreview } from '../../previews/pagePreview';
9
- type MinMax = {
10
- min: number;
11
- max: number;
12
- };
13
- /**
14
- * Response type for GET getRopewikiPageView (full page view).
15
- */
16
- export declare class RopewikiPageView {
17
- name: string;
18
- aka: string[];
19
- url: string;
20
- quality: number;
21
- userVotes: number;
22
- regions: {
23
- name: string;
24
- id: string;
25
- }[];
26
- difficulty: Difficulty;
27
- permit: PermitStatus | null;
28
- rappelCount: MinMax | number | null;
29
- jumps: number | null;
30
- vehicle: string | null;
31
- rappelLongest: number | null;
32
- shuttleTime: number | null;
33
- overallLength: number | null;
34
- descentLength: number | null;
35
- exitLength: number | null;
36
- approachLength: number | null;
37
- overallTime: MinMax | number | null;
38
- approachTime: MinMax | number | null;
39
- descentTime: MinMax | number | null;
40
- exitTime: MinMax | number | null;
41
- approachElevGain: number | null;
42
- descentElevGain: number | null;
43
- exitElevGain: number | null;
44
- months: string[];
45
- latestRevisionDate: Date;
46
- bannerImage: BetaSectionImage | null;
47
- betaSections: BetaSection[];
48
- /** Minimap for the page route (tiles or centered GeoJSON fallback), or null. */
49
- miniMap: PageMiniMap | CenteredRegionMiniMap | null;
50
- /** Page centroid in WGS84 degrees when known; otherwise null (same convention as search and Route). */
51
- coordinates: {
52
- lat: number;
53
- lon: number;
54
- } | null;
55
- constructor(name: string, aka: string[], url: string, quality: number, userVotes: number, regions: {
56
- name: string;
57
- id: string;
58
- }[], 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: PageMiniMap | CenteredRegionMiniMap | null, coordinates: {
59
- lat: number;
60
- lon: number;
61
- } | null);
62
- /**
63
- * Validates result has RopewikiPageView fields and returns a RopewikiPageView instance.
64
- */
65
- static fromResult(result: unknown): RopewikiPageView;
66
- /**
67
- * Maps this full page view to a PagePreview for persistence (saved pages).
68
- * @param apiPageId Ropewiki page uuid from GET /ropewiki/page/{id}.
69
- */
70
- toPagePreview(apiPageId: string): PagePreview;
71
- private static assertString;
72
- private static assertNullableString;
73
- private static assertNullableMiniMap;
74
- private static parsePageMiniMap;
75
- private static parseCoordinateComponent;
76
- private static assertNullableCoordinates;
77
- private static assertNumber;
78
- private static assertNullableNumber;
79
- private static assertStringArray;
80
- private static assertRegionsArray;
81
- private static assertDifficulty;
82
- private static assertPermit;
83
- private static assertRappelCount;
84
- private static assertMinMaxOrNumber;
85
- private static assertIso8601DateString;
86
- private static assertNullableBannerImage;
87
- private static assertBetaSectionsArray;
88
- }
89
- 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';
90
5
  //# sourceMappingURL=ropewik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AC,oBAAoB;IAYnC,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAmBhC,OAAO,CAAC,MAAM,CAAC,kBAAkB;IA+BjC,OAAO,CAAC,MAAM,CAAC,gBAAgB;IA+B/B,OAAO,CAAC,MAAM,CAAC,YAAY;IAgB3B,OAAO,CAAC,MAAM,CAAC,iBAAiB;IA2BhC,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAOnC,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAkBtC,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAexC,OAAO,CAAC,MAAM,CAAC,uBAAuB;CAczC"}
1
+ {"version":3,"file":"ropewikiPageView.d.ts","sourceRoot":"","sources":["../../../../src/models/api/endpoints/ropewikiPageView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,IAAI,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AACpG,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,kCAAkC,CAAC"}
@@ -1,306 +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 centeredRegionMiniMap_1 = require("../../minimap/centeredRegionMiniMap");
10
- const miniMapType_1 = require("../../minimap/miniMapType");
11
- const pageMiniMap_1 = require("../../minimap/pageMiniMap");
12
- const pageDataSource_1 = require("../../pageDataSource");
13
- const pagePreview_1 = require("../../previews/pagePreview");
14
- /**
15
- * Response type for GET getRopewikiPageView (full page view).
16
- */
17
- class RopewikiPageView {
18
- 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) {
19
- this.name = name;
20
- this.aka = Array.isArray(aka) ? aka.slice() : [];
21
- this.url = url;
22
- this.quality = quality;
23
- this.userVotes = userVotes;
24
- this.regions = Array.isArray(regions) ? regions.slice() : [];
25
- this.difficulty = difficulty;
26
- this.permit = permit;
27
- this.rappelCount = rappelCount;
28
- this.jumps = jumps;
29
- this.vehicle = vehicle;
30
- this.rappelLongest = rappelLongest;
31
- this.shuttleTime = shuttleTime;
32
- this.overallLength = overallLength;
33
- this.descentLength = descentLength;
34
- this.exitLength = exitLength;
35
- this.approachLength = approachLength;
36
- this.overallTime = overallTime;
37
- this.approachTime = approachTime;
38
- this.descentTime = descentTime;
39
- this.exitTime = exitTime;
40
- this.approachElevGain = approachElevGain;
41
- this.descentElevGain = descentElevGain;
42
- this.exitElevGain = exitElevGain;
43
- this.months = Array.isArray(months) ? months.slice() : [];
44
- this.latestRevisionDate = new Date(latestRevisionDate);
45
- this.bannerImage = bannerImage;
46
- this.betaSections = Array.isArray(betaSections) ? betaSections : [];
47
- this.miniMap = miniMap;
48
- this.coordinates =
49
- coordinates != null
50
- ? { lat: coordinates.lat, lon: coordinates.lon }
51
- : null;
52
- }
53
- /**
54
- * Validates result has RopewikiPageView fields and returns a RopewikiPageView instance.
55
- */
56
- static fromResult(result) {
57
- if (result == null || typeof result !== 'object') {
58
- throw new Error('RopewikiPageView result must be an object');
59
- }
60
- const r = result;
61
- RopewikiPageView.assertString(r, 'name');
62
- RopewikiPageView.assertStringArray(r, 'aka');
63
- RopewikiPageView.assertString(r, 'url');
64
- RopewikiPageView.assertNumber(r, 'quality');
65
- RopewikiPageView.assertNumber(r, 'userVotes');
66
- RopewikiPageView.assertRegionsArray(r, 'regions');
67
- RopewikiPageView.assertDifficulty(r, 'difficulty');
68
- RopewikiPageView.assertPermit(r, 'permit');
69
- RopewikiPageView.assertRappelCount(r, 'rappelCount');
70
- RopewikiPageView.assertNullableNumber(r, 'jumps');
71
- RopewikiPageView.assertNullableString(r, 'vehicle');
72
- RopewikiPageView.assertNullableNumber(r, 'rappelLongest');
73
- RopewikiPageView.assertNullableNumber(r, 'shuttleTime');
74
- RopewikiPageView.assertNullableNumber(r, 'overallLength');
75
- RopewikiPageView.assertNullableNumber(r, 'descentLength');
76
- RopewikiPageView.assertNullableNumber(r, 'exitLength');
77
- RopewikiPageView.assertNullableNumber(r, 'approachLength');
78
- RopewikiPageView.assertMinMaxOrNumber(r, 'overallTime');
79
- RopewikiPageView.assertMinMaxOrNumber(r, 'approachTime');
80
- RopewikiPageView.assertMinMaxOrNumber(r, 'descentTime');
81
- RopewikiPageView.assertMinMaxOrNumber(r, 'exitTime');
82
- RopewikiPageView.assertNullableNumber(r, 'approachElevGain');
83
- RopewikiPageView.assertNullableNumber(r, 'descentElevGain');
84
- RopewikiPageView.assertNullableNumber(r, 'exitElevGain');
85
- RopewikiPageView.assertStringArray(r, 'months');
86
- RopewikiPageView.assertIso8601DateString(r, 'latestRevisionDate');
87
- RopewikiPageView.assertNullableBannerImage(r, 'bannerImage');
88
- RopewikiPageView.assertBetaSectionsArray(r, 'betaSections');
89
- RopewikiPageView.assertNullableMiniMap(r, 'miniMap');
90
- RopewikiPageView.assertNullableCoordinates(r, 'coordinates');
91
- r.latestRevisionDate = new Date(r.latestRevisionDate);
92
- r.difficulty = difficulty_1.Difficulty.fromResult(r.difficulty);
93
- if (r.miniMap != null && r.miniMap !== undefined) {
94
- r.miniMap = RopewikiPageView.parsePageMiniMap(r.miniMap);
95
- }
96
- else {
97
- r.miniMap = null;
98
- }
99
- Object.setPrototypeOf(r, RopewikiPageView.prototype);
100
- return r;
101
- }
102
- /**
103
- * Maps this full page view to a PagePreview for persistence (saved pages).
104
- * @param apiPageId Ropewiki page uuid from GET /ropewiki/page/{id}.
105
- */
106
- toPagePreview(apiPageId) {
107
- let mapData = null;
108
- if (this.miniMap != null && this.miniMap.miniMapType === miniMapType_1.MiniMapType.TilesTemplate) {
109
- mapData = this.miniMap.layerId;
110
- }
111
- 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);
112
- }
113
- static assertString(obj, key) {
114
- const v = obj[key];
115
- if (typeof v !== 'string') {
116
- throw new Error(`RopewikiPageView.${key} must be a string, got: ${typeof v}`);
117
- }
118
- }
119
- static assertNullableString(obj, key) {
120
- const v = obj[key];
121
- if (v !== null && v !== undefined && typeof v !== 'string') {
122
- throw new Error(`RopewikiPageView.${key} must be string or null, got: ${typeof v}`);
123
- }
124
- }
125
- static assertNullableMiniMap(obj, key) {
126
- const v = obj[key];
127
- if (v === null || v === undefined)
128
- return;
129
- if (typeof v !== 'object') {
130
- throw new Error(`RopewikiPageView.${key} must be a PageMiniMap, CenteredRegionMiniMap object, or null, got: ${typeof v}`);
131
- }
132
- }
133
- static parsePageMiniMap(raw) {
134
- if (raw == null || typeof raw !== 'object') {
135
- throw new Error('RopewikiPageView.miniMap must be an object when non-null');
136
- }
137
- const o = raw;
138
- const t = o.miniMapType;
139
- if (t === miniMapType_1.MiniMapType.TilesTemplate) {
140
- return pageMiniMap_1.PageMiniMap.fromResult(raw);
141
- }
142
- if (t === miniMapType_1.MiniMapType.CenteredGeojson) {
143
- return centeredRegionMiniMap_1.CenteredRegionMiniMap.fromResult(raw);
144
- }
145
- throw new Error(`RopewikiPageView.miniMap must be PageMiniMap or CenteredRegionMiniMap; got miniMapType ${JSON.stringify(t)}`);
146
- }
147
- static parseCoordinateComponent(value) {
148
- if (typeof value === 'number' && Number.isFinite(value)) {
149
- return value;
150
- }
151
- if (typeof value === 'string') {
152
- const trimmed = value.trim();
153
- if (trimmed === '')
154
- return null;
155
- const n = Number(trimmed);
156
- if (Number.isFinite(n))
157
- return n;
158
- }
159
- return null;
160
- }
161
- static assertNullableCoordinates(obj, key) {
162
- const v = obj[key];
163
- if (v === null || v === undefined) {
164
- obj[key] = null;
165
- return;
166
- }
167
- if (typeof v !== 'object' || v === null || Array.isArray(v)) {
168
- throw new Error(`RopewikiPageView.${key} must be { lat, lon } or null, got: ${typeof v}`);
169
- }
170
- const o = v;
171
- const lat = RopewikiPageView.parseCoordinateComponent(o.lat);
172
- const lon = RopewikiPageView.parseCoordinateComponent(o.lon);
173
- if (lat === null || lon === null) {
174
- throw new Error(`RopewikiPageView.${key}.lat and .lon must be finite numbers or numeric strings`);
175
- }
176
- obj[key] = { lat, lon };
177
- }
178
- static assertNumber(obj, key) {
179
- const v = obj[key];
180
- if (typeof v !== 'number' || Number.isNaN(v)) {
181
- throw new Error(`RopewikiPageView.${key} must be a number, got: ${typeof v}`);
182
- }
183
- }
184
- static assertNullableNumber(obj, key) {
185
- const v = obj[key];
186
- if (v !== null && v !== undefined && (typeof v !== 'number' || Number.isNaN(v))) {
187
- throw new Error(`RopewikiPageView.${key} must be a number or null, got: ${typeof v}`);
188
- }
189
- }
190
- static assertStringArray(obj, key) {
191
- const v = obj[key];
192
- if (!Array.isArray(v)) {
193
- throw new Error(`RopewikiPageView.${key} must be an array, got: ${typeof v}`);
194
- }
195
- for (let i = 0; i < v.length; i++) {
196
- if (typeof v[i] !== 'string') {
197
- throw new Error(`RopewikiPageView.${key}[${i}] must be a string`);
198
- }
199
- }
200
- }
201
- static assertRegionsArray(obj, key) {
202
- const v = obj[key];
203
- if (!Array.isArray(v)) {
204
- throw new Error(`RopewikiPageView.${key} must be an array, got: ${typeof v}`);
205
- }
206
- for (let i = 0; i < v.length; i++) {
207
- const item = v[i];
208
- if (item == null || typeof item !== 'object') {
209
- throw new Error(`RopewikiPageView.${key}[${i}] must be an object with id and name`);
210
- }
211
- const o = item;
212
- if (typeof o.id !== 'string') {
213
- throw new Error(`RopewikiPageView.${key}[${i}].id must be a string, got: ${typeof o.id}`);
214
- }
215
- if (typeof o.name !== 'string') {
216
- throw new Error(`RopewikiPageView.${key}[${i}].name must be a string, got: ${typeof o.name}`);
217
- }
218
- }
219
- }
220
- static assertDifficulty(obj, key) {
221
- const v = obj[key];
222
- if (v == null || typeof v !== 'object') {
223
- throw new Error(`RopewikiPageView.${key} must be an object, got: ${typeof v}`);
224
- }
225
- const d = v;
226
- if (d.technical !== null && d.technical !== undefined && typeof d.technical !== 'string') {
227
- throw new Error(`RopewikiPageView.${key}.technical must be string or null`);
228
- }
229
- if (d.water !== null && d.water !== undefined && typeof d.water !== 'string') {
230
- throw new Error(`RopewikiPageView.${key}.water must be string or null`);
231
- }
232
- if (d.time !== null && d.time !== undefined && typeof d.time !== 'string') {
233
- throw new Error(`RopewikiPageView.${key}.time must be string or null`);
234
- }
235
- if (d.additionalRisk !== null &&
236
- d.additionalRisk !== undefined &&
237
- typeof d.additionalRisk !== 'string') {
238
- throw new Error(`RopewikiPageView.${key}.additionalRisk must be string or null`);
239
- }
240
- }
241
- static assertPermit(obj, key) {
242
- const v = obj[key];
243
- if (v === null || v === undefined)
244
- return;
245
- if (typeof v !== 'string') {
246
- throw new Error(`RopewikiPageView.${key} must be PermitStatus or null, got: ${typeof v}`);
247
- }
248
- const values = Object.values(permitStatus_1.PermitStatus);
249
- if (!values.includes(v)) {
250
- throw new Error(`RopewikiPageView.${key} must be one of [${values.join(', ')}] or null, got: ${v}`);
251
- }
252
- }
253
- static assertRappelCount(obj, key) {
254
- const v = obj[key];
255
- if (v === null || v === undefined)
256
- return;
257
- if (typeof v === 'number') {
258
- if (Number.isNaN(v)) {
259
- throw new Error(`RopewikiPageView.${key} must be a number or min/max object or null`);
260
- }
261
- return;
262
- }
263
- if (typeof v === 'object' && v !== null && 'min' in v && 'max' in v) {
264
- const o = v;
265
- if (typeof o.min !== 'number' || Number.isNaN(o.min)) {
266
- throw new Error(`RopewikiPageView.${key}.min must be a number`);
267
- }
268
- if (typeof o.max !== 'number' || Number.isNaN(o.max)) {
269
- throw new Error(`RopewikiPageView.${key}.max must be a number`);
270
- }
271
- return;
272
- }
273
- throw new Error(`RopewikiPageView.${key} must be number or { min, max } or null, got: ${typeof v}`);
274
- }
275
- static assertMinMaxOrNumber(obj, key) {
276
- RopewikiPageView.assertRappelCount(obj, key);
277
- }
278
- static assertIso8601DateString(obj, key) {
279
- const v = obj[key];
280
- if (typeof v !== 'string') {
281
- throw new Error(`RopewikiPageView.${key} must be an ISO 8601 date string, got: ${typeof v}`);
282
- }
283
- const date = new Date(v);
284
- if (Number.isNaN(date.getTime())) {
285
- throw new Error(`RopewikiPageView.${key} must be a valid ISO 8601 date string, got: ${v}`);
286
- }
287
- }
288
- static assertNullableBannerImage(obj, key) {
289
- const v = obj[key];
290
- if (v === null || v === undefined)
291
- return;
292
- if (typeof v !== 'object') {
293
- throw new Error(`RopewikiPageView.${key} must be BetaSectionImage or null, got: ${typeof v}`);
294
- }
295
- const parsed = betaSectionImage_1.BetaSectionImage.fromResult(v);
296
- obj[key] = parsed;
297
- }
298
- static assertBetaSectionsArray(obj, key) {
299
- const v = obj[key];
300
- if (!Array.isArray(v)) {
301
- throw new Error(`RopewikiPageView.${key} must be an array, got: ${typeof v}`);
302
- }
303
- obj[key] = v.map((item) => betaSection_1.BetaSection.fromResponseBody(item));
304
- }
305
- }
306
- 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,4 +1,4 @@
1
- import { BetaSection } from '../../betaSections/betaSection';
1
+ import { OnlineBetaSection } from '../../betaSections/onlineBetaSection';
2
2
  import { RegionMiniMap } from '../../minimap/regionMiniMap';
3
3
  /**
4
4
  * Region view for getRopewikiRegionView (GET /ropewiki/region/{id}).
@@ -19,7 +19,7 @@ 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;
@@ -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;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D;;;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,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AAC,EAAE,MAAM,GAAG,IAAI,EAC/B,4BAA4B,CAAC,EAAE,MAAM,GAAG,IAAI,EAC5C,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,EACxB,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAC5B,aAAa,CAAC,EAAE,OAAO,GAAG,IAAI;IAqBlC;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,kBAAkB;IAsCtD,OAAO,CAAC,MAAM,CAAC,YAAY;IAS3B,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAYnC,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAarC,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAYtC,OAAO,CAAC,MAAM,CAAC,kBAAkB;IA+BjC,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAmBhC,OAAO,CAAC,MAAM,CAAC,aAAa;IAY5B,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAkBtC,OAAO,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
  }
@@ -1,11 +1,11 @@
1
1
  import { Result } from './result';
2
- import { RopewikiPageView } from '../endpoints/ropewikiPageView';
2
+ import { OnlineRopewikiPageView } from '../../pageViews/onlineRopewikiPageView';
3
3
  /**
4
4
  * Result of getRopewikiPageView (GET /ropewiki/page/{id} or equivalent).
5
5
  */
6
- export declare class RopewikiPageViewResult extends Result<RopewikiPageView> {
7
- readonly result: RopewikiPageView;
8
- constructor(result: RopewikiPageView);
6
+ export declare class RopewikiPageViewResult extends Result<OnlineRopewikiPageView> {
7
+ readonly result: OnlineRopewikiPageView;
8
+ constructor(result: OnlineRopewikiPageView);
9
9
  /**
10
10
  * Validates and parses result via RopewikiPageView.fromResult.
11
11
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ropewikiPageViewResult.d.ts","sourceRoot":"","sources":["../../../../src/models/api/results/ropewikiPageViewResult.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,MAAM,EAAc,MAAM,UAAU,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,MAAM,CAAC,gBAAgB,CAAC;aACpC,MAAM,EAAE,gBAAgB;gBAAxB,MAAM,EAAE,gBAAgB;IAIpD;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,sBAAsB;CAI7D"}
1
+ {"version":3,"file":"ropewikiPageViewResult.d.ts","sourceRoot":"","sources":["../../../../src/models/api/results/ropewikiPageViewResult.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,MAAM,EAAc,MAAM,UAAU,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAEhF;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,MAAM,CAAC,sBAAsB,CAAC;aAC1C,MAAM,EAAE,sBAAsB;gBAA9B,MAAM,EAAE,sBAAsB;IAI1D;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,sBAAsB;CAI7D"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RopewikiPageViewResult = void 0;
4
4
  const result_1 = require("./result");
5
- const ropewikiPageView_1 = require("../endpoints/ropewikiPageView");
5
+ const onlineRopewikiPageView_1 = require("../../pageViews/onlineRopewikiPageView");
6
6
  /**
7
7
  * Result of getRopewikiPageView (GET /ropewiki/page/{id} or equivalent).
8
8
  */
@@ -15,7 +15,7 @@ class RopewikiPageViewResult extends result_1.Result {
15
15
  * Validates and parses result via RopewikiPageView.fromResult.
16
16
  */
17
17
  static fromResult(result) {
18
- const parsed = ropewikiPageView_1.RopewikiPageView.fromResult(result);
18
+ const parsed = onlineRopewikiPageView_1.OnlineRopewikiPageView.fromResult(result);
19
19
  return new RopewikiPageViewResult(parsed);
20
20
  }
21
21
  }
@@ -1,12 +1,12 @@
1
1
  import { Result } from './result';
2
- import { PagePreview } from '../../previews/pagePreview';
2
+ import { OnlinePagePreview } from '../../previews/onlinePagePreview';
3
3
  /**
4
4
  * Result of getRoutePreview (GET /route/{routeId}/preview).
5
5
  * result is the array of page previews for the route.
6
6
  */
7
- export declare class RoutePreviewResult extends Result<PagePreview[]> {
8
- readonly result: PagePreview[];
9
- constructor(result: PagePreview[]);
7
+ export declare class RoutePreviewResult extends Result<OnlinePagePreview[]> {
8
+ readonly result: OnlinePagePreview[];
9
+ constructor(result: OnlinePagePreview[]);
10
10
  /**
11
11
  * Validates result is an array and parses each item via PagePreview.fromResult.
12
12
  */
@@ -1 +1 @@
1
- {"version":3,"file":"routePreviewResult.d.ts","sourceRoot":"","sources":["../../../../src/models/api/results/routePreviewResult.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,MAAM,EAAc,MAAM,UAAU,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,MAAM,CAAC,WAAW,EAAE,CAAC;aAC7B,MAAM,EAAE,WAAW,EAAE;gBAArB,MAAM,EAAE,WAAW,EAAE;IAIjD;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,kBAAkB;CASzD"}
1
+ {"version":3,"file":"routePreviewResult.d.ts","sourceRoot":"","sources":["../../../../src/models/api/results/routePreviewResult.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,MAAM,EAAc,MAAM,UAAU,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,MAAM,CAAC,iBAAiB,EAAE,CAAC;aACnC,MAAM,EAAE,iBAAiB,EAAE;gBAA3B,MAAM,EAAE,iBAAiB,EAAE;IAIvD;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,kBAAkB;CASzD"}