venue-js 1.8.0-next.2 → 1.8.0-next.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.
@@ -1071,9 +1071,14 @@ type SearchClient = {
1071
1071
  interface FindParams {
1072
1072
  populate?: boolean;
1073
1073
  }
1074
+ interface SortParam {
1075
+ key: string;
1076
+ order?: 'asc' | 'desc';
1077
+ }
1074
1078
  interface FilterParams {
1075
1079
  populate?: boolean;
1076
1080
  filters?: Filters;
1081
+ sort?: SortParam;
1077
1082
  }
1078
1083
  interface PopulatedParams {
1079
1084
  populate: true;
@@ -1249,4 +1254,4 @@ declare const createWalkablePathService: (ctx: NavigateContext, options?: {
1249
1254
  resolution: number;
1250
1255
  }) => WalkablePathUtils;
1251
1256
 
1252
- export { ALL_FEATURE_TYPES, type AmenityFeature, type AmenityFeaturePopulated, type AmenityGeometry, type AmenityProperties, type AnchorFeature, type AnchorFeaturePopulated, type AnchorGeometry, type AnchorProperties, type AngleDirection, type AnyRelationshipFeature, type BaseRelationshipProperties, type CoordinateOrdinalString, type CreateStepUtilsOptions, DEFAULT_BASE_URL, type DescribableFeature, type DetailFeature, type DetailGeometry, type DetailProperties, type DistanceOptions, type ElementFeature, type ElementGeometry, type ElementProperties, type ElevatorRelationshipFeature, type ElevatorRelationshipFeaturePopulated, type ElevatorRelationshipProperties, type EscalatorRelationshipFeature, type EscalatorRelationshipFeaturePopulated, type EscalatorRelationshipProperties, type EventFeature, type EventProperties, type FeatureId, type FeaturePopulatedResponseMap, type FeatureQueryOptions, type FeatureResponseMap, type FeatureType, type FilterParams, type FindByIdSync, type FindParams, type FindRouteOptions, type FixtureFeature, type FixtureFeaturePopulated, type FixtureGeometry, type FixtureProperties, GEOJSON_FEATURE_TYPES, type GetNavigateClientOptions, ID_PREFIX_TO_FEATURE_TYPE, type IMDFUnitCategory, type IMDFVerticalUnitCategory, IMDF_FEATURE_TYPES, IMDF_UNIT_CATEGORIES, type Id, type ImdfFeature, type Instruction, type InstructionTurn, type InternalFilterByType, type InternalFindById, type KioskFeature, type KioskFeaturePopulated, type KioskGeometry, type KioskProperties, type LabelFeature, type LabelGeometry, type LabelProperties, type Landmark, type LandmarkService, type LevelFeature, type LevelFeaturePopulated, type LevelGeometry, type LevelProperties, type Media, type MediaFile, type Model3d, type Model3dFeature, type Model3dGeometry, type Model3dPopulated, type Model3dProperties, NONIMDF_FEATURE_TYPES, type NavigatableFeature, type NavigatableParam, type NavigateClient, type NavigateContext, type NeighborMap, type NodeId, type NodeMap, type OccupantFeature, type OccupantFeaturePopulated, type OccupantGeometry, occupantHelper as OccupantHelpers, type OccupantProperties, type OpeningFeature, type OpeningFeaturePopulated, type OpeningGeometry, type OpeningProperties, type OpeningTypeAndId, type Page, type PolygonalFeature, type PopulatableFeatureType, type PopulatedParams, type PrepareGraphOptions, type PrivilegeFeature, type PrivilegeGeometry, type PrivilegeProperties, type PromotionFeature, type PromotionProperties, type RampRelationshipFeature, type RampRelationshipFeaturePopulated, type RampRelationshipProperties, type RelationshipCategories, type RelationshipDirectionTypes, type RelationshipFeature, type RelationshipFeaturePopulated, type RelationshipGeometry, type Route, type SearchClient, type SectionFeature, type SectionFeaturePopulated, type SectionGeometry, type SectionProperties, type SingleGeometry, type SponsoredContentFeature, type SponsoredContentLegacyType, type SponsoredContentPlacementType, type SponsoredContentProperties, type SponsoredContentStrapiV4ApiResponse, type StairRelationshipFeaturePopulated, type StairsRelationshipFeature, type StairsRelationshipProperties, type Step, type StepDescription, type TaxonomyFeature, type TaxonomyFeaturePopulated, type TaxonomyGeometry, type TaxonomyProperties, type TransalatableString, type TraversalRelationshipFeature, type TraversalRelationshipFeaturePopulated, type TraversalRelationshipProperties, type TurnSide, type UnitAmenities, type UnitDistanceOptions, type UnitFeature, type UnitFeaturePopulated, type UnitGeometry, type UnitKiosks, type UnitOpenings, type UnitProperties, type UnitTypeAndId, type VenueClientOptions, type VenueDataClient, type VenueFeature, type VenueFeaturePopulated, type VenueGeometry, type VenueProperties, type VerticalDistanceOptions, type VerticalUnitCategory, type WalkablePathUtils, type Waypoint, type WaypointSourceType, amenityToLandmark, angleDiff, createFindByIdSync, createInstructionService, createLandmarkService, createNavigateContext, createStepService, createWalkablePathService, createWaypointService, defaultFeatureQueryOptionsMap, describeHorizontalStep, describeLastStep, describeVerticalStep, distanceToWall, fetchDeliveryApi, fetchPreviewApi, findContainingUnit, findContainingUnitAtPoint, getDataClient, getInstructionText, getNavigateClient, getPointOnFeature, getSearchClient, getTurn, matchFilter, matchFilters, mergeStepsByOrdinal, mergeTwoSteps, occupantToLandmark, openingToLandmark, outerRingsToLine, outwardOpeningBearing, prepareGraph, safeFetchFeature, trace, turnSide, unitToLandmark };
1257
+ export { ALL_FEATURE_TYPES, type AmenityFeature, type AmenityFeaturePopulated, type AmenityGeometry, type AmenityProperties, type AnchorFeature, type AnchorFeaturePopulated, type AnchorGeometry, type AnchorProperties, type AngleDirection, type AnyRelationshipFeature, type BaseRelationshipProperties, type CoordinateOrdinalString, type CreateStepUtilsOptions, DEFAULT_BASE_URL, type DescribableFeature, type DetailFeature, type DetailGeometry, type DetailProperties, type DistanceOptions, type ElementFeature, type ElementGeometry, type ElementProperties, type ElevatorRelationshipFeature, type ElevatorRelationshipFeaturePopulated, type ElevatorRelationshipProperties, type EscalatorRelationshipFeature, type EscalatorRelationshipFeaturePopulated, type EscalatorRelationshipProperties, type EventFeature, type EventProperties, type FeatureId, type FeaturePopulatedResponseMap, type FeatureQueryOptions, type FeatureResponseMap, type FeatureType, type FilterParams, type FindByIdSync, type FindParams, type FindRouteOptions, type FixtureFeature, type FixtureFeaturePopulated, type FixtureGeometry, type FixtureProperties, GEOJSON_FEATURE_TYPES, type GetNavigateClientOptions, ID_PREFIX_TO_FEATURE_TYPE, type IMDFUnitCategory, type IMDFVerticalUnitCategory, IMDF_FEATURE_TYPES, IMDF_UNIT_CATEGORIES, type Id, type ImdfFeature, type Instruction, type InstructionTurn, type InternalFilterByType, type InternalFindById, type KioskFeature, type KioskFeaturePopulated, type KioskGeometry, type KioskProperties, type LabelFeature, type LabelGeometry, type LabelProperties, type Landmark, type LandmarkService, type LevelFeature, type LevelFeaturePopulated, type LevelGeometry, type LevelProperties, type Media, type MediaFile, type Model3d, type Model3dFeature, type Model3dGeometry, type Model3dPopulated, type Model3dProperties, NONIMDF_FEATURE_TYPES, type NavigatableFeature, type NavigatableParam, type NavigateClient, type NavigateContext, type NeighborMap, type NodeId, type NodeMap, type OccupantFeature, type OccupantFeaturePopulated, type OccupantGeometry, occupantHelper as OccupantHelpers, type OccupantProperties, type OpeningFeature, type OpeningFeaturePopulated, type OpeningGeometry, type OpeningProperties, type OpeningTypeAndId, type Page, type PolygonalFeature, type PopulatableFeatureType, type PopulatedParams, type PrepareGraphOptions, type PrivilegeFeature, type PrivilegeGeometry, type PrivilegeProperties, type PromotionFeature, type PromotionProperties, type RampRelationshipFeature, type RampRelationshipFeaturePopulated, type RampRelationshipProperties, type RelationshipCategories, type RelationshipDirectionTypes, type RelationshipFeature, type RelationshipFeaturePopulated, type RelationshipGeometry, type Route, type SearchClient, type SectionFeature, type SectionFeaturePopulated, type SectionGeometry, type SectionProperties, type SingleGeometry, type SortParam, type SponsoredContentFeature, type SponsoredContentLegacyType, type SponsoredContentPlacementType, type SponsoredContentProperties, type SponsoredContentStrapiV4ApiResponse, type StairRelationshipFeaturePopulated, type StairsRelationshipFeature, type StairsRelationshipProperties, type Step, type StepDescription, type TaxonomyFeature, type TaxonomyFeaturePopulated, type TaxonomyGeometry, type TaxonomyProperties, type TransalatableString, type TraversalRelationshipFeature, type TraversalRelationshipFeaturePopulated, type TraversalRelationshipProperties, type TurnSide, type UnitAmenities, type UnitDistanceOptions, type UnitFeature, type UnitFeaturePopulated, type UnitGeometry, type UnitKiosks, type UnitOpenings, type UnitProperties, type UnitTypeAndId, type VenueClientOptions, type VenueDataClient, type VenueFeature, type VenueFeaturePopulated, type VenueGeometry, type VenueProperties, type VerticalDistanceOptions, type VerticalUnitCategory, type WalkablePathUtils, type Waypoint, type WaypointSourceType, amenityToLandmark, angleDiff, createFindByIdSync, createInstructionService, createLandmarkService, createNavigateContext, createStepService, createWalkablePathService, createWaypointService, defaultFeatureQueryOptionsMap, describeHorizontalStep, describeLastStep, describeVerticalStep, distanceToWall, fetchDeliveryApi, fetchPreviewApi, findContainingUnit, findContainingUnitAtPoint, getDataClient, getInstructionText, getNavigateClient, getPointOnFeature, getSearchClient, getTurn, matchFilter, matchFilters, mergeStepsByOrdinal, mergeTwoSteps, occupantToLandmark, openingToLandmark, outerRingsToLine, outwardOpeningBearing, prepareGraph, safeFetchFeature, trace, turnSide, unitToLandmark };
@@ -1071,9 +1071,14 @@ type SearchClient = {
1071
1071
  interface FindParams {
1072
1072
  populate?: boolean;
1073
1073
  }
1074
+ interface SortParam {
1075
+ key: string;
1076
+ order?: 'asc' | 'desc';
1077
+ }
1074
1078
  interface FilterParams {
1075
1079
  populate?: boolean;
1076
1080
  filters?: Filters;
1081
+ sort?: SortParam;
1077
1082
  }
1078
1083
  interface PopulatedParams {
1079
1084
  populate: true;
@@ -1249,4 +1254,4 @@ declare const createWalkablePathService: (ctx: NavigateContext, options?: {
1249
1254
  resolution: number;
1250
1255
  }) => WalkablePathUtils;
1251
1256
 
1252
- export { ALL_FEATURE_TYPES, type AmenityFeature, type AmenityFeaturePopulated, type AmenityGeometry, type AmenityProperties, type AnchorFeature, type AnchorFeaturePopulated, type AnchorGeometry, type AnchorProperties, type AngleDirection, type AnyRelationshipFeature, type BaseRelationshipProperties, type CoordinateOrdinalString, type CreateStepUtilsOptions, DEFAULT_BASE_URL, type DescribableFeature, type DetailFeature, type DetailGeometry, type DetailProperties, type DistanceOptions, type ElementFeature, type ElementGeometry, type ElementProperties, type ElevatorRelationshipFeature, type ElevatorRelationshipFeaturePopulated, type ElevatorRelationshipProperties, type EscalatorRelationshipFeature, type EscalatorRelationshipFeaturePopulated, type EscalatorRelationshipProperties, type EventFeature, type EventProperties, type FeatureId, type FeaturePopulatedResponseMap, type FeatureQueryOptions, type FeatureResponseMap, type FeatureType, type FilterParams, type FindByIdSync, type FindParams, type FindRouteOptions, type FixtureFeature, type FixtureFeaturePopulated, type FixtureGeometry, type FixtureProperties, GEOJSON_FEATURE_TYPES, type GetNavigateClientOptions, ID_PREFIX_TO_FEATURE_TYPE, type IMDFUnitCategory, type IMDFVerticalUnitCategory, IMDF_FEATURE_TYPES, IMDF_UNIT_CATEGORIES, type Id, type ImdfFeature, type Instruction, type InstructionTurn, type InternalFilterByType, type InternalFindById, type KioskFeature, type KioskFeaturePopulated, type KioskGeometry, type KioskProperties, type LabelFeature, type LabelGeometry, type LabelProperties, type Landmark, type LandmarkService, type LevelFeature, type LevelFeaturePopulated, type LevelGeometry, type LevelProperties, type Media, type MediaFile, type Model3d, type Model3dFeature, type Model3dGeometry, type Model3dPopulated, type Model3dProperties, NONIMDF_FEATURE_TYPES, type NavigatableFeature, type NavigatableParam, type NavigateClient, type NavigateContext, type NeighborMap, type NodeId, type NodeMap, type OccupantFeature, type OccupantFeaturePopulated, type OccupantGeometry, occupantHelper as OccupantHelpers, type OccupantProperties, type OpeningFeature, type OpeningFeaturePopulated, type OpeningGeometry, type OpeningProperties, type OpeningTypeAndId, type Page, type PolygonalFeature, type PopulatableFeatureType, type PopulatedParams, type PrepareGraphOptions, type PrivilegeFeature, type PrivilegeGeometry, type PrivilegeProperties, type PromotionFeature, type PromotionProperties, type RampRelationshipFeature, type RampRelationshipFeaturePopulated, type RampRelationshipProperties, type RelationshipCategories, type RelationshipDirectionTypes, type RelationshipFeature, type RelationshipFeaturePopulated, type RelationshipGeometry, type Route, type SearchClient, type SectionFeature, type SectionFeaturePopulated, type SectionGeometry, type SectionProperties, type SingleGeometry, type SponsoredContentFeature, type SponsoredContentLegacyType, type SponsoredContentPlacementType, type SponsoredContentProperties, type SponsoredContentStrapiV4ApiResponse, type StairRelationshipFeaturePopulated, type StairsRelationshipFeature, type StairsRelationshipProperties, type Step, type StepDescription, type TaxonomyFeature, type TaxonomyFeaturePopulated, type TaxonomyGeometry, type TaxonomyProperties, type TransalatableString, type TraversalRelationshipFeature, type TraversalRelationshipFeaturePopulated, type TraversalRelationshipProperties, type TurnSide, type UnitAmenities, type UnitDistanceOptions, type UnitFeature, type UnitFeaturePopulated, type UnitGeometry, type UnitKiosks, type UnitOpenings, type UnitProperties, type UnitTypeAndId, type VenueClientOptions, type VenueDataClient, type VenueFeature, type VenueFeaturePopulated, type VenueGeometry, type VenueProperties, type VerticalDistanceOptions, type VerticalUnitCategory, type WalkablePathUtils, type Waypoint, type WaypointSourceType, amenityToLandmark, angleDiff, createFindByIdSync, createInstructionService, createLandmarkService, createNavigateContext, createStepService, createWalkablePathService, createWaypointService, defaultFeatureQueryOptionsMap, describeHorizontalStep, describeLastStep, describeVerticalStep, distanceToWall, fetchDeliveryApi, fetchPreviewApi, findContainingUnit, findContainingUnitAtPoint, getDataClient, getInstructionText, getNavigateClient, getPointOnFeature, getSearchClient, getTurn, matchFilter, matchFilters, mergeStepsByOrdinal, mergeTwoSteps, occupantToLandmark, openingToLandmark, outerRingsToLine, outwardOpeningBearing, prepareGraph, safeFetchFeature, trace, turnSide, unitToLandmark };
1257
+ export { ALL_FEATURE_TYPES, type AmenityFeature, type AmenityFeaturePopulated, type AmenityGeometry, type AmenityProperties, type AnchorFeature, type AnchorFeaturePopulated, type AnchorGeometry, type AnchorProperties, type AngleDirection, type AnyRelationshipFeature, type BaseRelationshipProperties, type CoordinateOrdinalString, type CreateStepUtilsOptions, DEFAULT_BASE_URL, type DescribableFeature, type DetailFeature, type DetailGeometry, type DetailProperties, type DistanceOptions, type ElementFeature, type ElementGeometry, type ElementProperties, type ElevatorRelationshipFeature, type ElevatorRelationshipFeaturePopulated, type ElevatorRelationshipProperties, type EscalatorRelationshipFeature, type EscalatorRelationshipFeaturePopulated, type EscalatorRelationshipProperties, type EventFeature, type EventProperties, type FeatureId, type FeaturePopulatedResponseMap, type FeatureQueryOptions, type FeatureResponseMap, type FeatureType, type FilterParams, type FindByIdSync, type FindParams, type FindRouteOptions, type FixtureFeature, type FixtureFeaturePopulated, type FixtureGeometry, type FixtureProperties, GEOJSON_FEATURE_TYPES, type GetNavigateClientOptions, ID_PREFIX_TO_FEATURE_TYPE, type IMDFUnitCategory, type IMDFVerticalUnitCategory, IMDF_FEATURE_TYPES, IMDF_UNIT_CATEGORIES, type Id, type ImdfFeature, type Instruction, type InstructionTurn, type InternalFilterByType, type InternalFindById, type KioskFeature, type KioskFeaturePopulated, type KioskGeometry, type KioskProperties, type LabelFeature, type LabelGeometry, type LabelProperties, type Landmark, type LandmarkService, type LevelFeature, type LevelFeaturePopulated, type LevelGeometry, type LevelProperties, type Media, type MediaFile, type Model3d, type Model3dFeature, type Model3dGeometry, type Model3dPopulated, type Model3dProperties, NONIMDF_FEATURE_TYPES, type NavigatableFeature, type NavigatableParam, type NavigateClient, type NavigateContext, type NeighborMap, type NodeId, type NodeMap, type OccupantFeature, type OccupantFeaturePopulated, type OccupantGeometry, occupantHelper as OccupantHelpers, type OccupantProperties, type OpeningFeature, type OpeningFeaturePopulated, type OpeningGeometry, type OpeningProperties, type OpeningTypeAndId, type Page, type PolygonalFeature, type PopulatableFeatureType, type PopulatedParams, type PrepareGraphOptions, type PrivilegeFeature, type PrivilegeGeometry, type PrivilegeProperties, type PromotionFeature, type PromotionProperties, type RampRelationshipFeature, type RampRelationshipFeaturePopulated, type RampRelationshipProperties, type RelationshipCategories, type RelationshipDirectionTypes, type RelationshipFeature, type RelationshipFeaturePopulated, type RelationshipGeometry, type Route, type SearchClient, type SectionFeature, type SectionFeaturePopulated, type SectionGeometry, type SectionProperties, type SingleGeometry, type SortParam, type SponsoredContentFeature, type SponsoredContentLegacyType, type SponsoredContentPlacementType, type SponsoredContentProperties, type SponsoredContentStrapiV4ApiResponse, type StairRelationshipFeaturePopulated, type StairsRelationshipFeature, type StairsRelationshipProperties, type Step, type StepDescription, type TaxonomyFeature, type TaxonomyFeaturePopulated, type TaxonomyGeometry, type TaxonomyProperties, type TransalatableString, type TraversalRelationshipFeature, type TraversalRelationshipFeaturePopulated, type TraversalRelationshipProperties, type TurnSide, type UnitAmenities, type UnitDistanceOptions, type UnitFeature, type UnitFeaturePopulated, type UnitGeometry, type UnitKiosks, type UnitOpenings, type UnitProperties, type UnitTypeAndId, type VenueClientOptions, type VenueDataClient, type VenueFeature, type VenueFeaturePopulated, type VenueGeometry, type VenueProperties, type VerticalDistanceOptions, type VerticalUnitCategory, type WalkablePathUtils, type Waypoint, type WaypointSourceType, amenityToLandmark, angleDiff, createFindByIdSync, createInstructionService, createLandmarkService, createNavigateContext, createStepService, createWalkablePathService, createWaypointService, defaultFeatureQueryOptionsMap, describeHorizontalStep, describeLastStep, describeVerticalStep, distanceToWall, fetchDeliveryApi, fetchPreviewApi, findContainingUnit, findContainingUnitAtPoint, getDataClient, getInstructionText, getNavigateClient, getPointOnFeature, getSearchClient, getTurn, matchFilter, matchFilters, mergeStepsByOrdinal, mergeTwoSteps, occupantToLandmark, openingToLandmark, outerRingsToLine, outwardOpeningBearing, prepareGraph, safeFetchFeature, trace, turnSide, unitToLandmark };
@@ -448,6 +448,9 @@ var getOccupantMarkerLocations = (occupant, options) => {
448
448
  return compact([mainLocation, ...onePerLevelLocations]);
449
449
  };
450
450
 
451
+ // src/data/getDataClient.ts
452
+ var import_lodash23 = require("lodash");
453
+
451
454
  // src/data/api/delivery-project.ts
452
455
  async function fetchDeliveryApi(projectId, apiKey, featureType, baseUrl = DEFAULT_BASE_URL) {
453
456
  switch (featureType) {
@@ -1694,7 +1697,8 @@ var prepareGraph = (options) => {
1694
1697
  (section) => {
1695
1698
  const sectionLevelId = section?.properties?.level_id;
1696
1699
  const displayPoint = section?.properties?.display_point;
1697
- const unit = findContainingUnitAtPoint(displayPoint, sectionLevelId, walkableUnits) || findContainingUnit(section, walkableUnits);
1700
+ const representativePoint = displayPoint ?? (0, import_center8.center)(section).geometry;
1701
+ const unit = findContainingUnitAtPoint(representativePoint, sectionLevelId, walkableUnits) || findContainingUnit(section, walkableUnits);
1698
1702
  if (!unit) {
1699
1703
  console.warn(`[venue-js] Section ${section.id} on level ${section?.properties?.level_id} has no walkable containing unit \u2014 section will be excluded from routing.`);
1700
1704
  return null;
@@ -3182,6 +3186,10 @@ var getDataClient = (options) => {
3182
3186
  if (params.filters) {
3183
3187
  result = features.filter((f) => matchFilters(f, filters));
3184
3188
  }
3189
+ if (params.sort) {
3190
+ const { key, order = "asc" } = params.sort;
3191
+ result = (0, import_lodash23.orderBy)(result, `properties.${key}`, order);
3192
+ }
3185
3193
  return params.populate === true ? await Promise.all(result.map((f) => populator[featureType](f))) : result;
3186
3194
  },
3187
3195
  ...options2 ?? {}