ropegeo-common 1.2.19 → 1.3.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.
package/README.md CHANGED
@@ -6,7 +6,7 @@ Shared types and utilities for [RopeGeo](https://github.com/yurst3/RopeGeo) and
6
6
 
7
7
  - **Page preview types** – `PagePreview`, `Difficulty`, and related enums used by the route preview API (e.g. GET /route/{routeId}/preview). `PagePreview` includes optional `permit` (`PermitStatus` enum: Yes, No, Restricted, Closed, or null).
8
8
  - **Page data source** – `PageDataSource` enum (e.g. Ropewiki) used when linking routes to pages.
9
- - **Ropewiki page view types** – `RopewikiPageView`, `RopewikiBetaSectionView`, and `RopewikiImageView` for the getRopewikiPageView API (full Ropewiki page with beta sections and images).
9
+ - **Ropewiki page view types** – `RopewikiPageView`, `RopewikiBetaSectionView`, and `RopewikiImageView` for the getRopewikiPageView API (full Ropewiki page with beta sections and images). `BetaSectionImage` includes `id`, `downloadBytes` (`DownloadBytes`: preview/banner/full byte sizes), and **page-based pagination** – `PaginationResults` / `MapDataTileKeysResults` (e.g. `GET /mapdata/{mapDataId}/tiles` with `total`, `page`, `totalBytes`).
10
10
  - **Routes (GET /routes)** – `Route`, `RouteType`, `RouteGeoJsonFeature`, and `RoutesGeojson` for the routes GeoJSON Feature Collection API. `RoutesGeojson.fromRoutes(routes)` builds the response shape from an array of `Route`.
11
11
  - **Search API types** – `SearchResults` (paginated search response with `results: Preview[]` and `nextCursor: string`), `RegionPreview` (region search hit with id, name, parents, imageUrl, source), and `PagePreview` (page search hit; same type as route preview).
12
12
 
@@ -34,6 +34,10 @@ import {
34
34
  type RopewikiImageView,
35
35
  type RegionPreview,
36
36
  type SearchResults,
37
+ DownloadBytes,
38
+ PaginationResults,
39
+ MapDataTileKeysResults,
40
+ PaginationResultType,
37
41
  } from 'ropegeo-common';
38
42
  ```
39
43
 
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export { RoutesGeojson } from './types/api/getRoutes/routeGeojson';
9
9
  export { RoutesGeojsonResult } from './types/api/getRoutes/routesGeojsonResult';
10
10
  export { RoutesParams } from './types/api/getRoutes/routesParams';
11
11
  export { BetaSectionImage } from './types/betaSections/betaSectionImage';
12
+ export { DownloadBytes } from './types/betaSections/downloadBytes';
12
13
  export { BetaSection } from './types/betaSections/betaSection';
13
14
  export { Bounds } from './types/minimap/bounds';
14
15
  export { MiniMapType } from './types/minimap/miniMapType';
@@ -23,6 +24,8 @@ export { Cursor, CursorType } from './types/cursors/cursor';
23
24
  export { CursorPaginationParams } from './types/params/cursorPaginationParams';
24
25
  export { Result, ResultType } from './types/results/result';
25
26
  export { CursorPaginationResults, type ValidatedCursorPaginationResponse, CursorPaginationResultType, } from './types/results/cursorPaginationResults';
27
+ export { PaginationResults, type ValidatedPaginationResponse, PaginationResultType, } from './types/results/paginationResults';
28
+ export { MapDataTileKeysResults } from './types/api/listMapDataTileKeys/mapDataTileKeysResults';
26
29
  export { SearchCursor } from './types/cursors/searchCursor';
27
30
  export type { SearchCursorType } from './types/cursors/searchCursor';
28
31
  export { SearchParams } from './types/api/search/searchParams';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,mBAAmB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACtH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC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AM,8BAA8B,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,YAAY,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAC1F,OAAO,EAAE,wBAAwB,EAAE,MAAM,4DAA4D,CAAC;AACtG,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,4BAA4B,EAAE,MAAM,oEAAoE,CAAC;AAClH,OAAO,EAAE,4BAA4B,EAAE,MAAM,oEAAoE,CAAC;AAClH,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6DAA6D,CAAC;AACtG,YAAY,EAAE,0BAA0B,EAAE,MAAM,6DAA6D,CAAC;AAC9G,OAAO,EAAE,0BAA0B,EAAE,MAAM,gEAAgE,CAAC;AAC5G,OAAO,EAAE,0BAA0B,EAAE,MAAM,gEAAgE,CAAC;AAC5G,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RoutePreviewResult = exports.RopewikiRegionImagesResult = exports.RopewikiRegionImagesParams = exports.RopewikiRegionImageView = exports.RegionImagesCursor = exports.RopewikiRegionPreviewsResult = exports.RopewikiRegionPreviewsParams = exports.RegionPreviewsCursor = exports.RopewikiRegionViewResult = exports.RopewikiRegionView = exports.SearchResults = exports.SearchParams = exports.SearchCursor = exports.CursorPaginationResultType = exports.CursorPaginationResults = exports.ResultType = exports.Result = exports.CursorPaginationParams = exports.CursorType = exports.Cursor = exports.RopewikiPageViewResult = exports.RopewikiPageView = exports.PageMiniMap = exports.RegionMiniMap = exports.MiniMap = exports.MiniMapType = exports.Bounds = exports.BetaSection = exports.BetaSectionImage = exports.RoutesParams = exports.RoutesGeojsonResult = exports.RoutesGeojson = exports.RouteType = exports.RouteGeoJsonFeature = exports.Route = exports.RegionPreview = exports.PagePreview = exports.PreviewType = exports.Preview = exports.PermitStatus = exports.DifficultyWater = exports.DifficultyTime = exports.DifficultyTechnical = exports.DifficultyRisk = exports.Difficulty = exports.PageDataSource = void 0;
3
+ exports.RoutePreviewResult = exports.RopewikiRegionImagesResult = exports.RopewikiRegionImagesParams = exports.RopewikiRegionImageView = exports.RegionImagesCursor = exports.RopewikiRegionPreviewsResult = exports.RopewikiRegionPreviewsParams = exports.RegionPreviewsCursor = exports.RopewikiRegionViewResult = exports.RopewikiRegionView = exports.SearchResults = exports.SearchParams = exports.SearchCursor = exports.MapDataTileKeysResults = exports.PaginationResultType = exports.PaginationResults = exports.CursorPaginationResultType = exports.CursorPaginationResults = exports.ResultType = exports.Result = exports.CursorPaginationParams = exports.CursorType = exports.Cursor = exports.RopewikiPageViewResult = exports.RopewikiPageView = exports.PageMiniMap = exports.RegionMiniMap = exports.MiniMap = exports.MiniMapType = exports.Bounds = exports.BetaSection = exports.DownloadBytes = exports.BetaSectionImage = exports.RoutesParams = exports.RoutesGeojsonResult = exports.RoutesGeojson = exports.RouteType = exports.RouteGeoJsonFeature = exports.Route = exports.RegionPreview = exports.PagePreview = exports.PreviewType = exports.Preview = exports.PermitStatus = exports.DifficultyWater = exports.DifficultyTime = exports.DifficultyTechnical = exports.DifficultyRisk = exports.Difficulty = exports.PageDataSource = void 0;
4
4
  var pageDataSource_1 = require("./types/pageDataSource");
5
5
  Object.defineProperty(exports, "PageDataSource", { enumerable: true, get: function () { return pageDataSource_1.PageDataSource; } });
6
6
  var difficulty_1 = require("./types/difficulty");
@@ -30,6 +30,8 @@ var routesParams_1 = require("./types/api/getRoutes/routesParams");
30
30
  Object.defineProperty(exports, "RoutesParams", { enumerable: true, get: function () { return routesParams_1.RoutesParams; } });
31
31
  var betaSectionImage_1 = require("./types/betaSections/betaSectionImage");
32
32
  Object.defineProperty(exports, "BetaSectionImage", { enumerable: true, get: function () { return betaSectionImage_1.BetaSectionImage; } });
33
+ var downloadBytes_1 = require("./types/betaSections/downloadBytes");
34
+ Object.defineProperty(exports, "DownloadBytes", { enumerable: true, get: function () { return downloadBytes_1.DownloadBytes; } });
33
35
  var betaSection_1 = require("./types/betaSections/betaSection");
34
36
  Object.defineProperty(exports, "BetaSection", { enumerable: true, get: function () { return betaSection_1.BetaSection; } });
35
37
  var bounds_1 = require("./types/minimap/bounds");
@@ -57,6 +59,11 @@ Object.defineProperty(exports, "ResultType", { enumerable: true, get: function (
57
59
  var cursorPaginationResults_1 = require("./types/results/cursorPaginationResults");
58
60
  Object.defineProperty(exports, "CursorPaginationResults", { enumerable: true, get: function () { return cursorPaginationResults_1.CursorPaginationResults; } });
59
61
  Object.defineProperty(exports, "CursorPaginationResultType", { enumerable: true, get: function () { return cursorPaginationResults_1.CursorPaginationResultType; } });
62
+ var paginationResults_1 = require("./types/results/paginationResults");
63
+ Object.defineProperty(exports, "PaginationResults", { enumerable: true, get: function () { return paginationResults_1.PaginationResults; } });
64
+ Object.defineProperty(exports, "PaginationResultType", { enumerable: true, get: function () { return paginationResults_1.PaginationResultType; } });
65
+ var mapDataTileKeysResults_1 = require("./types/api/listMapDataTileKeys/mapDataTileKeysResults");
66
+ Object.defineProperty(exports, "MapDataTileKeysResults", { enumerable: true, get: function () { return mapDataTileKeysResults_1.MapDataTileKeysResults; } });
60
67
  var searchCursor_1 = require("./types/cursors/searchCursor");
61
68
  Object.defineProperty(exports, "SearchCursor", { enumerable: true, get: function () { return searchCursor_1.SearchCursor; } });
62
69
  var searchParams_1 = require("./types/api/search/searchParams");
@@ -11,7 +11,6 @@ type MinMax = {
11
11
  * Response type for GET getRopewikiPageView (full page view).
12
12
  */
13
13
  export declare class RopewikiPageView {
14
- pageId: string;
15
14
  name: string;
16
15
  aka: string[];
17
16
  url: string;
@@ -45,7 +44,7 @@ export declare class RopewikiPageView {
45
44
  betaSections: BetaSection[];
46
45
  /** Minimap for the page route (tiles template + bounds when present), or null. */
47
46
  miniMap: MiniMap | null;
48
- constructor(pageId: string, name: string, aka: string[], url: string, quality: number, userVotes: number, regions: {
47
+ constructor(name: string, aka: string[], url: string, quality: number, userVotes: number, regions: {
49
48
  name: string;
50
49
  id: string;
51
50
  }[], 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);
@@ -1 +1 @@
1
- {"version":3,"file":"ropewikiPageView.d.ts","sourceRoot":"","sources":["../../../../src/types/api/getRopewikiPageView/ropewikiPageView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,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;AAGhD,KAAK,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3C;;GAEG;AACH,qBAAa,gBAAgB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAA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AC,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"}
@@ -10,8 +10,7 @@ const pageMiniMap_1 = require("../../minimap/pageMiniMap");
10
10
  * Response type for GET getRopewikiPageView (full page view).
11
11
  */
12
12
  class RopewikiPageView {
13
- constructor(pageId, 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) {
14
- this.pageId = pageId;
13
+ 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) {
15
14
  this.name = name;
16
15
  this.aka = Array.isArray(aka) ? aka.slice() : [];
17
16
  this.url = url;
@@ -50,7 +49,6 @@ class RopewikiPageView {
50
49
  throw new Error('RopewikiPageView result must be an object');
51
50
  }
52
51
  const r = result;
53
- RopewikiPageView.assertString(r, 'pageId');
54
52
  RopewikiPageView.assertString(r, 'name');
55
53
  RopewikiPageView.assertStringArray(r, 'aka');
56
54
  RopewikiPageView.assertString(r, 'url');
@@ -0,0 +1,17 @@
1
+ import { PaginationResults, type ValidatedPaginationResponse } from '../../results/paginationResults';
2
+ /**
3
+ * Response for GET /mapdata/{mapDataId}/tiles with page-based pagination.
4
+ * Each result entry is a tile object key (e.g. path string).
5
+ * {@link totalBytes} is always set: sum of byte sizes of all matching objects for this map data id.
6
+ */
7
+ export declare class MapDataTileKeysResults extends PaginationResults<string> {
8
+ readonly totalBytes: number;
9
+ constructor(results: string[], total: number, page: number, totalBytes: number);
10
+ /**
11
+ * Called from {@link PaginationResults.fromResponseBody} with a validated base shape.
12
+ * Requires `totalBytes` on the wire object and validates it is a finite non-negative number.
13
+ */
14
+ static fromResponseBodyInner(body: Record<string, unknown>, validated: ValidatedPaginationResponse): MapDataTileKeysResults;
15
+ private static assertTotalBytes;
16
+ }
17
+ //# sourceMappingURL=mapDataTileKeysResults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapDataTileKeysResults.d.ts","sourceRoot":"","sources":["../../../../src/types/api/listMapDataTileKeys/mapDataTileKeysResults.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EAEjB,KAAK,2BAA2B,EACnC,MAAM,iCAAiC,CAAC;AAEzC;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,iBAAiB,CAAC,MAAM,CAAC;IACjE,SAAiB,UAAU,EAAE,MAAM,CAAC;gBAExB,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAI9E;;;OAGG;IACH,MAAM,CAAC,qBAAqB,CACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,SAAS,EAAE,2BAA2B,GACvC,sBAAsB;IAmBzB,OAAO,CAAC,MAAM,CAAC,gBAAgB;CAgBlC"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MapDataTileKeysResults = void 0;
4
+ const paginationResults_1 = require("../../results/paginationResults");
5
+ /**
6
+ * Response for GET /mapdata/{mapDataId}/tiles with page-based pagination.
7
+ * Each result entry is a tile object key (e.g. path string).
8
+ * {@link totalBytes} is always set: sum of byte sizes of all matching objects for this map data id.
9
+ */
10
+ class MapDataTileKeysResults extends paginationResults_1.PaginationResults {
11
+ constructor(results, total, page, totalBytes) {
12
+ super(results, total, page, paginationResults_1.PaginationResultType.MapDataTileKeys, totalBytes);
13
+ }
14
+ /**
15
+ * Called from {@link PaginationResults.fromResponseBody} with a validated base shape.
16
+ * Requires `totalBytes` on the wire object and validates it is a finite non-negative number.
17
+ */
18
+ static fromResponseBodyInner(body, validated) {
19
+ MapDataTileKeysResults.assertTotalBytes(body);
20
+ const totalBytesRaw = body.totalBytes;
21
+ const results = validated.results.map((r, i) => {
22
+ if (typeof r !== 'string') {
23
+ throw new Error(`MapDataTileKeysResults.results[${i}] must be a string, got: ${typeof r}`);
24
+ }
25
+ return r;
26
+ });
27
+ return new MapDataTileKeysResults(results, validated.total, validated.page, totalBytesRaw);
28
+ }
29
+ static assertTotalBytes(body) {
30
+ if (!('totalBytes' in body)) {
31
+ throw new Error('Response body must have totalBytes');
32
+ }
33
+ const totalBytesRaw = body.totalBytes;
34
+ if (typeof totalBytesRaw !== 'number' ||
35
+ Number.isNaN(totalBytesRaw) ||
36
+ !Number.isFinite(totalBytesRaw) ||
37
+ totalBytesRaw < 0) {
38
+ throw new Error('Response body.totalBytes must be a finite non-negative number');
39
+ }
40
+ }
41
+ }
42
+ exports.MapDataTileKeysResults = MapDataTileKeysResults;
@@ -1,21 +1,28 @@
1
+ import { DownloadBytes } from './downloadBytes';
1
2
  /**
2
- * Generic beta section image (e.g. order, bannerUrl, fullUrl, linkUrl, caption, latestRevisionDate).
3
+ * Generic beta section image (e.g. order, id, bannerUrl, fullUrl, linkUrl, caption, latestRevisionDate, downloadBytes).
3
4
  */
4
5
  export declare class BetaSectionImage {
5
6
  order: number;
7
+ /** Ropewiki image row UUID; keys offline file maps. */
8
+ id: string;
6
9
  bannerUrl: string | null;
7
10
  fullUrl: string | null;
8
11
  linkUrl: string;
9
12
  caption: string | null;
10
13
  latestRevisionDate: Date;
11
- constructor(order: number, bannerUrl: string | null, fullUrl: string | null, linkUrl: string, caption: string | null, latestRevisionDate: Date);
14
+ /** Byte sizes per rendition; null when not provided by API. */
15
+ downloadBytes: DownloadBytes | null;
16
+ constructor(order: number, id: string, bannerUrl: string | null, fullUrl: string | null, linkUrl: string, caption: string | null, latestRevisionDate: Date, downloadBytes: DownloadBytes | null);
12
17
  /**
13
18
  * Validates result has BetaSectionImage fields and returns a BetaSectionImage instance.
14
19
  */
15
20
  static fromResult(result: unknown): BetaSectionImage;
16
21
  private static assertNumber;
22
+ private static assertNonEmptyString;
17
23
  private static assertString;
18
24
  private static assertStringOrNull;
25
+ private static assertDownloadBytesOrNull;
19
26
  private static assertIso8601DateString;
20
27
  }
21
28
  //# sourceMappingURL=betaSectionImage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"betaSectionImage.d.ts","sourceRoot":"","sources":["../../../src/types/betaSections/betaSectionImage.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,gBAAgB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,kBAAkB,EAAE,IAAI,CAAC;gBAGrB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,kBAAkB,EAAE,IAAI;IAU5B;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,gBAAgB;IAkBpD,OAAO,CAAC,MAAM,CAAC,YAAY;IAS3B,OAAO,CAAC,MAAM,CAAC,YAAY;IAS3B,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAYjC,OAAO,CAAC,MAAM,CAAC,uBAAuB;CAiBzC"}
1
+ {"version":3,"file":"betaSectionImage.d.ts","sourceRoot":"","sources":["../../../src/types/betaSections/betaSectionImage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;GAEG;AACH,qBAAa,gBAAgB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,kBAAkB,EAAE,IAAI,CAAC;IACzB,+DAA+D;IAC/D,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;gBAGhC,KAAK,EAAE,MAAM,EACb,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,kBAAkB,EAAE,IAAI,EACxB,aAAa,EAAE,aAAa,GAAG,IAAI;IAYvC;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,gBAAgB;IAoBpD,OAAO,CAAC,MAAM,CAAC,YAAY;IAS3B,OAAO,CAAC,MAAM,CAAC,oBAAoB;IASnC,OAAO,CAAC,MAAM,CAAC,YAAY;IAS3B,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAYjC,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAYxC,OAAO,CAAC,MAAM,CAAC,uBAAuB;CAiBzC"}
@@ -1,17 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BetaSectionImage = void 0;
4
+ const downloadBytes_1 = require("./downloadBytes");
4
5
  /**
5
- * Generic beta section image (e.g. order, bannerUrl, fullUrl, linkUrl, caption, latestRevisionDate).
6
+ * Generic beta section image (e.g. order, id, bannerUrl, fullUrl, linkUrl, caption, latestRevisionDate, downloadBytes).
6
7
  */
7
8
  class BetaSectionImage {
8
- constructor(order, bannerUrl, fullUrl, linkUrl, caption, latestRevisionDate) {
9
+ constructor(order, id, bannerUrl, fullUrl, linkUrl, caption, latestRevisionDate, downloadBytes) {
9
10
  this.order = order;
11
+ this.id = id;
10
12
  this.bannerUrl = bannerUrl;
11
13
  this.fullUrl = fullUrl;
12
14
  this.linkUrl = linkUrl;
13
15
  this.caption = caption;
14
16
  this.latestRevisionDate = new Date(latestRevisionDate);
17
+ this.downloadBytes = downloadBytes;
15
18
  }
16
19
  /**
17
20
  * Validates result has BetaSectionImage fields and returns a BetaSectionImage instance.
@@ -22,11 +25,13 @@ class BetaSectionImage {
22
25
  }
23
26
  const r = result;
24
27
  BetaSectionImage.assertNumber(r, 'order');
28
+ BetaSectionImage.assertNonEmptyString(r, 'id');
25
29
  BetaSectionImage.assertStringOrNull(r, 'bannerUrl');
26
30
  BetaSectionImage.assertStringOrNull(r, 'fullUrl');
27
31
  BetaSectionImage.assertString(r, 'linkUrl');
28
32
  BetaSectionImage.assertStringOrNull(r, 'caption');
29
33
  BetaSectionImage.assertIso8601DateString(r, 'latestRevisionDate');
34
+ BetaSectionImage.assertDownloadBytesOrNull(r, 'downloadBytes');
30
35
  r.latestRevisionDate = new Date(r.latestRevisionDate);
31
36
  Object.setPrototypeOf(r, BetaSectionImage.prototype);
32
37
  return r;
@@ -37,6 +42,12 @@ class BetaSectionImage {
37
42
  throw new Error(`BetaSectionImage.${key} must be a number, got: ${typeof v}`);
38
43
  }
39
44
  }
45
+ static assertNonEmptyString(obj, key) {
46
+ const v = obj[key];
47
+ if (typeof v !== 'string' || v.trim() === '') {
48
+ throw new Error(`BetaSectionImage.${key} must be a non-empty string, got: ${JSON.stringify(v)}`);
49
+ }
50
+ }
40
51
  static assertString(obj, key) {
41
52
  const v = obj[key];
42
53
  if (typeof v !== 'string') {
@@ -49,6 +60,14 @@ class BetaSectionImage {
49
60
  throw new Error(`BetaSectionImage.${key} must be a string or null, got: ${typeof v}`);
50
61
  }
51
62
  }
63
+ static assertDownloadBytesOrNull(obj, key) {
64
+ const v = obj[key];
65
+ if (v === undefined || v === null) {
66
+ obj[key] = null;
67
+ return;
68
+ }
69
+ obj[key] = downloadBytes_1.DownloadBytes.fromResult(v);
70
+ }
52
71
  static assertIso8601DateString(obj, key) {
53
72
  const v = obj[key];
54
73
  if (typeof v !== 'string') {
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Byte sizes for preview / banner / full image renditions (for offline download progress).
3
+ */
4
+ export declare class DownloadBytes {
5
+ preview: number;
6
+ banner: number;
7
+ full: number;
8
+ constructor(preview: number, banner: number, full: number);
9
+ /**
10
+ * Validates result has DownloadBytes fields and returns a DownloadBytes instance.
11
+ */
12
+ static fromResult(result: unknown): DownloadBytes;
13
+ private static assertNonNegativeFiniteNumber;
14
+ }
15
+ //# sourceMappingURL=downloadBytes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"downloadBytes.d.ts","sourceRoot":"","sources":["../../../src/types/betaSections/downloadBytes.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,aAAa;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;gBAED,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAMzD;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,aAAa;IAYjD,OAAO,CAAC,MAAM,CAAC,6BAA6B;CAgB/C"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DownloadBytes = void 0;
4
+ /**
5
+ * Byte sizes for preview / banner / full image renditions (for offline download progress).
6
+ */
7
+ class DownloadBytes {
8
+ constructor(preview, banner, full) {
9
+ this.preview = preview;
10
+ this.banner = banner;
11
+ this.full = full;
12
+ }
13
+ /**
14
+ * Validates result has DownloadBytes fields and returns a DownloadBytes instance.
15
+ */
16
+ static fromResult(result) {
17
+ if (result == null || typeof result !== 'object') {
18
+ throw new Error('DownloadBytes result must be an object');
19
+ }
20
+ const r = result;
21
+ DownloadBytes.assertNonNegativeFiniteNumber(r, 'preview');
22
+ DownloadBytes.assertNonNegativeFiniteNumber(r, 'banner');
23
+ DownloadBytes.assertNonNegativeFiniteNumber(r, 'full');
24
+ Object.setPrototypeOf(r, DownloadBytes.prototype);
25
+ return r;
26
+ }
27
+ static assertNonNegativeFiniteNumber(obj, key) {
28
+ const v = obj[key];
29
+ if (typeof v !== 'number' ||
30
+ Number.isNaN(v) ||
31
+ !Number.isFinite(v) ||
32
+ v < 0) {
33
+ throw new Error(`DownloadBytes.${key} must be a finite non-negative number, got: ${JSON.stringify(v)}`);
34
+ }
35
+ }
36
+ }
37
+ exports.DownloadBytes = DownloadBytes;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Discriminator for page-based paginated result types. Used in response body so
3
+ * PaginationResults.fromResponseBody can route to the correct parser.
4
+ */
5
+ export declare enum PaginationResultType {
6
+ MapDataTileKeys = "mapDataTileKeys"
7
+ }
8
+ /**
9
+ * Validated shape (results + total + page) passed to a specific Result class's
10
+ * fromResponseBody after PaginationResults.fromResponseBody has validated the wrapper.
11
+ */
12
+ export type ValidatedPaginationResponse = {
13
+ results: unknown[];
14
+ total: number;
15
+ page: number;
16
+ };
17
+ /**
18
+ * Base type for page-paginated API results (results array + total + page + resultType).
19
+ * fromResponseBody validates body then delegates to the corresponding Result class.
20
+ */
21
+ export declare abstract class PaginationResults<R = unknown> {
22
+ readonly results: R[];
23
+ readonly total: number;
24
+ readonly page: number;
25
+ readonly resultType: PaginationResultType;
26
+ /** Sum of byte sizes for all items across the paginated set (e.g. tile bytes); only some endpoints send this. */
27
+ readonly totalBytes?: number | undefined;
28
+ constructor(results: R[], total: number, page: number, resultType: PaginationResultType,
29
+ /** Sum of byte sizes for all items across the paginated set (e.g. tile bytes); only some endpoints send this. */
30
+ totalBytes?: number | undefined);
31
+ /**
32
+ * Validates body (object, resultType, results array, total, page), then delegates to
33
+ * the corresponding Result class's fromResponseBody with the validated shape.
34
+ */
35
+ static fromResponseBody(body: unknown): PaginationResults;
36
+ }
37
+ //# sourceMappingURL=paginationResults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paginationResults.d.ts","sourceRoot":"","sources":["../../../src/types/results/paginationResults.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,oBAAoB;IAC5B,eAAe,oBAAoB;CACtC;AAED;;;GAGG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACtC,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,8BAAsB,iBAAiB,CAAC,CAAC,GAAG,OAAO;aAE3B,OAAO,EAAE,CAAC,EAAE;aACZ,KAAK,EAAE,MAAM;aACb,IAAI,EAAE,MAAM;aACZ,UAAU,EAAE,oBAAoB;IAChD,iHAAiH;aACjG,UAAU,CAAC,EAAE,MAAM;gBALnB,OAAO,EAAE,CAAC,EAAE,EACZ,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,oBAAoB;IAChD,iHAAiH;IACjG,UAAU,CAAC,EAAE,MAAM,YAAA;IAGvC;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,iBAAiB;CAsD5D"}
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaginationResults = exports.PaginationResultType = void 0;
4
+ /**
5
+ * Discriminator for page-based paginated result types. Used in response body so
6
+ * PaginationResults.fromResponseBody can route to the correct parser.
7
+ */
8
+ var PaginationResultType;
9
+ (function (PaginationResultType) {
10
+ PaginationResultType["MapDataTileKeys"] = "mapDataTileKeys";
11
+ })(PaginationResultType || (exports.PaginationResultType = PaginationResultType = {}));
12
+ /**
13
+ * Base type for page-paginated API results (results array + total + page + resultType).
14
+ * fromResponseBody validates body then delegates to the corresponding Result class.
15
+ */
16
+ class PaginationResults {
17
+ constructor(results, total, page, resultType,
18
+ /** Sum of byte sizes for all items across the paginated set (e.g. tile bytes); only some endpoints send this. */
19
+ totalBytes) {
20
+ this.results = results;
21
+ this.total = total;
22
+ this.page = page;
23
+ this.resultType = resultType;
24
+ this.totalBytes = totalBytes;
25
+ }
26
+ /**
27
+ * Validates body (object, resultType, results array, total, page), then delegates to
28
+ * the corresponding Result class's fromResponseBody with the validated shape.
29
+ */
30
+ static fromResponseBody(body) {
31
+ if (body == null || typeof body !== 'object') {
32
+ throw new Error('Response body must be an object');
33
+ }
34
+ const b = body;
35
+ if (!('resultType' in b)) {
36
+ throw new Error('Response body must have resultType');
37
+ }
38
+ const resultType = b.resultType;
39
+ const valid = Object.values(PaginationResultType);
40
+ if (typeof resultType !== 'string' || !valid.includes(resultType)) {
41
+ throw new Error(`Response body.resultType must be one of [${valid.join(', ')}], got: ${JSON.stringify(resultType)}`);
42
+ }
43
+ if (!('results' in b)) {
44
+ throw new Error('Response body must have results');
45
+ }
46
+ const resultsRaw = b.results;
47
+ if (!Array.isArray(resultsRaw)) {
48
+ throw new Error('Response body.results must be an array');
49
+ }
50
+ if (!('total' in b)) {
51
+ throw new Error('Response body must have total');
52
+ }
53
+ const total = b.total;
54
+ if (typeof total !== 'number' || Number.isNaN(total) || !Number.isFinite(total)) {
55
+ throw new Error('Response body.total must be a finite number');
56
+ }
57
+ if (total < 0) {
58
+ throw new Error('Response body.total must be non-negative');
59
+ }
60
+ if (!('page' in b)) {
61
+ throw new Error('Response body must have page');
62
+ }
63
+ const page = b.page;
64
+ if (typeof page !== 'number' || Number.isNaN(page) || !Number.isFinite(page)) {
65
+ throw new Error('Response body.page must be a finite number');
66
+ }
67
+ if (page < 1 || !Number.isInteger(page)) {
68
+ throw new Error('Response body.page must be a positive integer (1-based)');
69
+ }
70
+ const validated = {
71
+ results: resultsRaw,
72
+ total,
73
+ page,
74
+ };
75
+ switch (resultType) {
76
+ case PaginationResultType.MapDataTileKeys: {
77
+ const { MapDataTileKeysResults } = require('../api/listMapDataTileKeys/mapDataTileKeysResults');
78
+ return MapDataTileKeysResults.fromResponseBodyInner(b, validated);
79
+ }
80
+ }
81
+ }
82
+ }
83
+ exports.PaginationResults = PaginationResults;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ropegeo-common",
3
- "version": "1.2.19",
3
+ "version": "1.3.0",
4
4
  "description": "Shared types and utilities for RopeGeo and WebScraper",
5
5
  "license": "ISC",
6
6
  "repository": {