ropegeo-common 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export { RoutesGeojson } from './types/api/getRoutes/routeGeojson';
7
7
  export type { RopewikiImageView } from './types/api/getRopewikiPageView/ropewikiImageView';
8
8
  export type { RopewikiBetaSectionView } from './types/api/getRopewikiPageView/ropewikiBetaSectionView';
9
9
  export type { RopewikiPageView } from './types/api/getRopewikiPageView/ropewikiPageView';
10
- export type { RegionPreview } from './types/api/search/regionPreview';
10
+ export { RegionPreview } from './types/api/search/regionPreview';
11
11
  export { SearchCursor } from './types/api/search/searchCursor';
12
12
  export type { SearchCursorType } from './types/api/search/searchCursor';
13
13
  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,yBAAyB,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACjG,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AAC3F,YAAY,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AACvG,YAAY,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AACzF,YAAY,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,YAAY,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,YAAY,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC"}
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,yBAAyB,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACjG,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AAC3F,YAAY,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AACvG,YAAY,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,YAAY,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,YAAY,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SearchResults = exports.SearchParams = exports.SearchCursor = exports.RoutesGeojson = exports.RouteType = exports.Route = exports.PagePreview = exports.PermitStatus = exports.DifficultyWater = exports.DifficultyTime = exports.DifficultyTechnical = exports.DifficultyRisk = exports.Difficulty = exports.PageDataSource = void 0;
3
+ exports.SearchResults = exports.SearchParams = exports.SearchCursor = exports.RegionPreview = exports.RoutesGeojson = exports.RouteType = exports.Route = exports.PagePreview = 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");
@@ -18,6 +18,8 @@ Object.defineProperty(exports, "Route", { enumerable: true, get: function () { r
18
18
  Object.defineProperty(exports, "RouteType", { enumerable: true, get: function () { return route_1.RouteType; } });
19
19
  var routeGeojson_1 = require("./types/api/getRoutes/routeGeojson");
20
20
  Object.defineProperty(exports, "RoutesGeojson", { enumerable: true, get: function () { return routeGeojson_1.RoutesGeojson; } });
21
+ var regionPreview_1 = require("./types/api/search/regionPreview");
22
+ Object.defineProperty(exports, "RegionPreview", { enumerable: true, get: function () { return regionPreview_1.RegionPreview; } });
21
23
  var searchCursor_1 = require("./types/api/search/searchCursor");
22
24
  Object.defineProperty(exports, "SearchCursor", { enumerable: true, get: function () { return searchCursor_1.SearchCursor; } });
23
25
  var searchParams_1 = require("./types/api/search/searchParams");
@@ -25,6 +25,8 @@ export interface GetRopewikiPagePreviewRow {
25
25
  * Used by GET /route/{routeId}/preview.
26
26
  */
27
27
  export declare class PagePreview {
28
+ /** Discriminator for search results: always 'page' */
29
+ readonly previewType: "page";
28
30
  /** Page identifier (e.g. RopewikiPage id) */
29
31
  id: string;
30
32
  /** Source of the page (e.g. ropewiki) */
@@ -1 +1 @@
1
- {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,GAAG,IAAI,EAC3B,MAAM,EAAE,YAAY,GAAG,IAAI;IAe/B;;OAEG;IACH,MAAM,CAAC,SAAS,CACZ,GAAG,EAAE,yBAAyB,EAC9B,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,OAAO,CAAC,EAAE,MAAM,EAAE,GACnB,WAAW;IAsBd,OAAO,CAAC,MAAM,CAAC,WAAW;CAK7B"}
@@ -10,6 +10,8 @@ const pageDataSource_1 = require("../../pageDataSource");
10
10
  */
11
11
  class PagePreview {
12
12
  constructor(id, source, imageUrl, rating, ratingCount, title, regions, difficulty, mapData, externalLink, permit) {
13
+ /** Discriminator for search results: always 'page' */
14
+ this.previewType = 'page';
13
15
  this.id = id;
14
16
  this.source = source;
15
17
  this.imageUrl = imageUrl;
@@ -1,10 +1,12 @@
1
1
  import { PageDataSource } from '../../pageDataSource';
2
- export interface RegionPreview {
2
+ export declare class RegionPreview {
3
+ readonly previewType: "region";
3
4
  id: string;
4
5
  name: string;
5
6
  parents: string[];
6
7
  pageCount: number;
7
8
  imageUrl: string | null;
8
9
  source: PageDataSource;
10
+ constructor(id: string, name: string, parents: string[], pageCount: number, imageUrl: string | null, source: PageDataSource);
9
11
  }
10
12
  //# sourceMappingURL=regionPreview.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"regionPreview.d.ts","sourceRoot":"","sources":["../../../../src/types/api/search/regionPreview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,WAAW,aAAa;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,cAAc,CAAC;CAC1B"}
1
+ {"version":3,"file":"regionPreview.d.ts","sourceRoot":"","sources":["../../../../src/types/api/search/regionPreview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,qBAAa,aAAa;IACtB,QAAQ,CAAC,WAAW,EAAG,QAAQ,CAAU;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,cAAc,CAAC;gBAGnB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EAAE,EACjB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,MAAM,EAAE,cAAc;CAS7B"}
@@ -1,2 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RegionPreview = void 0;
4
+ class RegionPreview {
5
+ constructor(id, name, parents, pageCount, imageUrl, source) {
6
+ this.previewType = 'region';
7
+ this.id = id;
8
+ this.name = name;
9
+ this.parents = parents;
10
+ this.pageCount = pageCount;
11
+ this.imageUrl = imageUrl;
12
+ this.source = source;
13
+ }
14
+ }
15
+ exports.RegionPreview = RegionPreview;
@@ -9,11 +9,12 @@ export declare class SearchParams {
9
9
  readonly similarityThreshold: number;
10
10
  readonly includePages: boolean;
11
11
  readonly includeRegions: boolean;
12
+ readonly includeAka: boolean;
12
13
  readonly regionId: string | null;
13
14
  readonly order: SearchOrder;
14
15
  readonly limit: number;
15
16
  readonly cursor: SearchCursor | null;
16
- constructor(name: string, similarityThreshold: number, includePages: boolean, includeRegions: boolean, regionId: string | null, order: SearchOrder, limit: number, cursorEncoded: string | null);
17
+ constructor(name: string, similarityThreshold: number, includePages: boolean, includeRegions: boolean, includeAka: boolean, regionId: string | null, order: SearchOrder, limit: number, cursorEncoded: string | null);
17
18
  /**
18
19
  * Returns an object suitable for use as query string parameters.
19
20
  * Cursor is encoded for the query string.
@@ -1 +1 @@
1
- {"version":3,"file":"searchParams.d.ts","sourceRoot":"","sources":["../../../../src/types/api/search/searchParams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,SAAS,CAAC;AAOnD;;;GAGG;AACH,qBAAa,YAAY;IACrB,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,mBAAmB,EAAE,MAAM,CAAC;IAC5C,SAAgB,YAAY,EAAE,OAAO,CAAC;IACtC,SAAgB,cAAc,EAAE,OAAO,CAAC;IACxC,SAAgB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,SAAgB,KAAK,EAAE,WAAW,CAAC;IACnC,SAAgB,KAAK,EAAE,MAAM,CAAC;IAC9B,SAAgB,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;gBAGxC,IAAI,EAAE,MAAM,EACZ,mBAAmB,EAAE,MAAM,EAC3B,YAAY,EAAE,OAAO,EACrB,cAAc,EAAE,OAAO,EACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,GAAG,IAAI;IA+DhC;;;OAGG;IACH,mBAAmB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAkB7C;;;OAGG;IACH,MAAM,CAAC,qBAAqB,CACxB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GACtC,YAAY;IA0Ef;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;CAY9B"}
1
+ {"version":3,"file":"searchParams.d.ts","sourceRoot":"","sources":["../../../../src/types/api/search/searchParams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,SAAS,CAAC;AAOnD;;;GAGG;AACH,qBAAa,YAAY;IACrB,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,mBAAmB,EAAE,MAAM,CAAC;IAC5C,SAAgB,YAAY,EAAE,OAAO,CAAC;IACtC,SAAgB,cAAc,EAAE,OAAO,CAAC;IACxC,SAAgB,UAAU,EAAE,OAAO,CAAC;IACpC,SAAgB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,SAAgB,KAAK,EAAE,WAAW,CAAC;IACnC,SAAgB,KAAK,EAAE,MAAM,CAAC;IAC9B,SAAgB,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;gBAGxC,IAAI,EAAE,MAAM,EACZ,mBAAmB,EAAE,MAAM,EAC3B,YAAY,EAAE,OAAO,EACrB,cAAc,EAAE,OAAO,EACvB,UAAU,EAAE,OAAO,EACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,GAAG,IAAI;IAqEhC;;;OAGG;IACH,mBAAmB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAmB7C;;;OAGG;IACH,MAAM,CAAC,qBAAqB,CACxB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GACtC,YAAY;IA2Ff;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;CAY9B"}
@@ -10,7 +10,7 @@ const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12
10
10
  * The constructor accepts an encoded cursor string and decodes it.
11
11
  */
12
12
  class SearchParams {
13
- constructor(name, similarityThreshold, includePages, includeRegions, regionId, order, limit, cursorEncoded) {
13
+ constructor(name, similarityThreshold, includePages, includeRegions, includeAka, regionId, order, limit, cursorEncoded) {
14
14
  if (typeof name !== 'string' || name.trim() === '') {
15
15
  throw new Error('Missing or empty required query parameter: name');
16
16
  }
@@ -23,6 +23,9 @@ class SearchParams {
23
23
  if (!includePages && !includeRegions) {
24
24
  throw new Error('At least one of include-pages or include-regions must be true');
25
25
  }
26
+ if (includeAka && !includePages) {
27
+ throw new Error('include-aka cannot be true when include-pages is false');
28
+ }
26
29
  if (order !== 'similarity' && order !== 'quality') {
27
30
  throw new Error('Query parameter "order" must be one of: similarity, quality');
28
31
  }
@@ -40,6 +43,7 @@ class SearchParams {
40
43
  this.similarityThreshold = similarityThreshold;
41
44
  this.includePages = includePages;
42
45
  this.includeRegions = includeRegions;
46
+ this.includeAka = includeAka;
43
47
  this.regionId = trimmedRegionId;
44
48
  this.order = order;
45
49
  this.limit = limit;
@@ -65,6 +69,7 @@ class SearchParams {
65
69
  similarity: String(this.similarityThreshold),
66
70
  'include-pages': String(this.includePages),
67
71
  'include-regions': String(this.includeRegions),
72
+ 'include-aka': String(this.includeAka),
68
73
  order: this.order,
69
74
  limit: String(this.limit),
70
75
  };
@@ -112,11 +117,23 @@ class SearchParams {
112
117
  const order = orderParam === 'quality' ? 'quality' : 'similarity';
113
118
  const includePages = SearchParams.parseBoolean(q['include-pages'] ?? q['Include-Pages'], true);
114
119
  const includeRegions = SearchParams.parseBoolean(q['include-regions'] ?? q['Include-Regions'], true);
120
+ if (!includePages && !includeRegions) {
121
+ throw new Error('At least one of include-pages or include-regions must be true');
122
+ }
123
+ const includeAkaParam = q['include-aka'] ?? q['Include-Aka'];
124
+ const includeAkaExplicit = (includeAkaParam ?? '').trim() !== '';
125
+ let includeAka = SearchParams.parseBoolean(includeAkaParam, true);
126
+ if (!includeAkaExplicit && !includePages) {
127
+ includeAka = false;
128
+ }
129
+ if (includeAkaExplicit && includeAka && !includePages) {
130
+ throw new Error('include-aka cannot be true when include-pages is false');
131
+ }
115
132
  const region = (q.region ?? q.Region ?? '').trim() || null;
116
133
  if (region !== null && !UUID_REGEX.test(region)) {
117
134
  throw new Error('Query parameter "region" must be a valid UUID');
118
135
  }
119
- return new SearchParams(name, similarity, includePages, includeRegions, region, order, limit, cursorEncoded);
136
+ return new SearchParams(name, similarity, includePages, includeRegions, includeAka, region, order, limit, cursorEncoded);
120
137
  }
121
138
  /**
122
139
  * Parses a boolean from a query string value. Returns defaultValue when value is undefined or empty.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ropegeo-common",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Shared types and utilities for RopeGeo and WebScraper",
5
5
  "license": "ISC",
6
6
  "repository": {