venue-js 1.4.0-next.16 → 1.4.0-next.18
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/data/index.d.mts +33 -19
- package/dist/data/index.d.ts +33 -19
- package/dist/data/index.js +110 -16
- package/dist/data/index.js.map +1 -1
- package/dist/data/index.mjs +109 -16
- package/dist/data/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +162 -541
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +154 -534
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -1
package/dist/data/index.d.mts
CHANGED
|
@@ -143,6 +143,7 @@ type ExternalLink = {
|
|
|
143
143
|
};
|
|
144
144
|
type OccupantGeometry = null;
|
|
145
145
|
type OccupantProperties = EntityTimestamps & {
|
|
146
|
+
/** Anchor is used for marker position */
|
|
146
147
|
anchor_id: Id;
|
|
147
148
|
category: string | null;
|
|
148
149
|
category_group: string | null;
|
|
@@ -169,6 +170,9 @@ type OccupantProperties = EntityTimestamps & {
|
|
|
169
170
|
promotion_ids: Id[];
|
|
170
171
|
render_priority: number;
|
|
171
172
|
render_type: string;
|
|
173
|
+
/**
|
|
174
|
+
* @deprecated Use `unit_id or kiosk_id` instead.
|
|
175
|
+
*/
|
|
172
176
|
room_no: string | null;
|
|
173
177
|
short_name: string | null;
|
|
174
178
|
start_date: string;
|
|
@@ -228,41 +232,48 @@ type BaseRelationshipProperties = EntityTimestamps & {
|
|
|
228
232
|
};
|
|
229
233
|
};
|
|
230
234
|
type RelationshipFeature = ImdfFeature<RelationshipGeometry, BaseRelationshipProperties>;
|
|
235
|
+
type UnitTypeAndId = {
|
|
236
|
+
type: "unit";
|
|
237
|
+
id: string;
|
|
238
|
+
};
|
|
239
|
+
type OpeningTypeAndId = {
|
|
240
|
+
type: "opening";
|
|
241
|
+
id: string;
|
|
242
|
+
};
|
|
231
243
|
type TraversalRelationshipProperties = Omit<BaseRelationshipProperties, "origin" | "destination" | "intermediary" | "category"> & {
|
|
232
|
-
origin:
|
|
233
|
-
destination:
|
|
234
|
-
intermediary:
|
|
244
|
+
origin: UnitTypeAndId | null;
|
|
245
|
+
destination: UnitTypeAndId;
|
|
246
|
+
intermediary: OpeningTypeAndId[] | null;
|
|
235
247
|
category: "traversal" | "movingwalkway" | "traversal.path";
|
|
236
248
|
};
|
|
237
249
|
type TraversalRelationshipFeature = ImdfFeature<RelationshipGeometry, TraversalRelationshipProperties>;
|
|
238
250
|
type ElevatorRelationshipProperties = Omit<BaseRelationshipProperties, "origin" | "destination" | "intermediary" | "direction" | "category"> & {
|
|
239
|
-
origin:
|
|
240
|
-
destination:
|
|
241
|
-
intermediary:
|
|
251
|
+
origin: UnitTypeAndId;
|
|
252
|
+
destination: UnitTypeAndId;
|
|
253
|
+
intermediary: UnitTypeAndId[] | null;
|
|
242
254
|
direction: "undirected";
|
|
243
255
|
category: "elevator";
|
|
244
256
|
};
|
|
245
257
|
type ElevatorRelationshipFeature = ImdfFeature<RelationshipGeometry, ElevatorRelationshipProperties>;
|
|
246
258
|
type RampRelationshipProperties = Omit<BaseRelationshipProperties, "origin" | "destination" | "intermediary" | "category"> & {
|
|
247
|
-
origin:
|
|
248
|
-
destination:
|
|
249
|
-
intermediary:
|
|
259
|
+
origin: OpeningTypeAndId;
|
|
260
|
+
destination: OpeningTypeAndId;
|
|
261
|
+
intermediary: UnitTypeAndId[];
|
|
250
262
|
category: "ramp";
|
|
251
263
|
};
|
|
252
264
|
type RampRelationshipFeature = ImdfFeature<RelationshipGeometry, EscalatorRelationshipProperties>;
|
|
253
265
|
type StairsRelationshipProperties = Omit<BaseRelationshipProperties, "origin" | "destination" | "intermediary" | "direction" | "category"> & {
|
|
254
|
-
origin:
|
|
255
|
-
destination:
|
|
256
|
-
intermediary:
|
|
266
|
+
origin: OpeningTypeAndId;
|
|
267
|
+
destination: OpeningTypeAndId;
|
|
268
|
+
intermediary: UnitTypeAndId[] | null;
|
|
257
269
|
direction: "undirected";
|
|
258
270
|
category: "stairs" | "stairs.emergencyexit";
|
|
259
271
|
};
|
|
260
272
|
type StairsRelationshipFeature = ImdfFeature<RelationshipGeometry, StairsRelationshipProperties>;
|
|
261
|
-
type EscalatorRelationshipProperties = Omit<BaseRelationshipProperties, "origin" | "destination" | "intermediary" | "
|
|
262
|
-
origin:
|
|
263
|
-
destination:
|
|
264
|
-
intermediary:
|
|
265
|
-
direction: "directed";
|
|
273
|
+
type EscalatorRelationshipProperties = Omit<BaseRelationshipProperties, "origin" | "destination" | "intermediary" | "category"> & {
|
|
274
|
+
origin: OpeningTypeAndId;
|
|
275
|
+
destination: OpeningTypeAndId;
|
|
276
|
+
intermediary: UnitTypeAndId[];
|
|
266
277
|
category: "escalator";
|
|
267
278
|
};
|
|
268
279
|
type EscalatorRelationshipFeature = ImdfFeature<RelationshipGeometry, EscalatorRelationshipProperties>;
|
|
@@ -676,7 +687,7 @@ type OpeningFeaturePopulated = OpeningFeature & {
|
|
|
676
687
|
type RelationshipFeaturePopulated = RelationshipFeature & {
|
|
677
688
|
properties: RelationshipFeature["properties"] & {
|
|
678
689
|
origin: UnitFeature | OpeningFeature | null;
|
|
679
|
-
destination: UnitFeature;
|
|
690
|
+
destination: UnitFeature | OpeningFeature | null;
|
|
680
691
|
intermediary: (UnitFeature | OpeningFeature)[] | null;
|
|
681
692
|
};
|
|
682
693
|
};
|
|
@@ -848,11 +859,14 @@ interface VenueDataClient {
|
|
|
848
859
|
|
|
849
860
|
declare const DEFAULT_BASE_URL = "https://service.venue.in.th/api";
|
|
850
861
|
declare const IMDF_FEATURE_TYPES: FeatureType[];
|
|
862
|
+
declare const IMDF_UNIT_CATEGORIES: string[];
|
|
851
863
|
declare const NONIMDF_FEATURE_TYPES: FeatureType[];
|
|
852
864
|
declare const GEOJSON_FEATURE_TYPES: FeatureType[];
|
|
853
865
|
declare const ALL_FEATURE_TYPES: FeatureType[];
|
|
854
866
|
declare const defaultFeatureQueryOptionsMap: Record<FeatureType, FeatureQueryOptions>;
|
|
855
867
|
|
|
868
|
+
type IMDFUnitCategory = typeof IMDF_UNIT_CATEGORIES[number];
|
|
869
|
+
|
|
856
870
|
declare function fetchDeliveryApi<T extends FeatureType = FeatureType>(projectId: string, apiKey: string, featureType: FeatureType, baseUrl?: string): Promise<FeatureResponseMap[T][]>;
|
|
857
871
|
declare function fetchPreviewApi<T extends FeatureType = FeatureType>(projectId: string, previewToken: string, featureType: FeatureType, baseUrl?: string): Promise<FeatureResponseMap[T][]>;
|
|
858
872
|
declare const safeFetchFeature: <T extends FeatureType = FeatureType>(featureType: FeatureType, params: {
|
|
@@ -925,4 +939,4 @@ declare const getSearchClient: ({ occupants, amenities }: {
|
|
|
925
939
|
amenities: AmenityFeature[];
|
|
926
940
|
}) => SearchClient;
|
|
927
941
|
|
|
928
|
-
export { ALL_FEATURE_TYPES, type AmenityFeature, type AmenityFeaturePopulated, type AmenityGeometry, type AmenityProperties, type AnchorFeature, type AnchorFeaturePopulated, type AnchorGeometry, type AnchorProperties, type AnyRelationshipFeature, type BaseRelationshipProperties, DEFAULT_BASE_URL, type DetailFeature, type DetailGeometry, type DetailProperties, type ElementFeature, type ElementGeometry, type ElementProperties, type ElevatorRelationshipFeature, type ElevatorRelationshipFeaturePopulated, type ElevatorRelationshipProperties, type EscalatorRelationshipFeature, type EscalatorRelationshipFeaturePopulated, type EscalatorRelationshipProperties, type EventFeature, type EventGeometry, type EventProperties, type FeaturePopulatedResponseMap, type FeatureQueryOptions, type FeatureResponseMap, type FeatureType, type FilterParams, type FindParams, type FixtureFeature, type FixtureFeaturePopulated, type FixtureGeometry, type FixtureProperties, GEOJSON_FEATURE_TYPES, IMDF_FEATURE_TYPES, type Id, type ImdfFeature, type InternalFilterByType, type InternalFindById, type KioskFeature, type KioskFeaturePopulated, type KioskGeometry, type KioskProperties, type LabelFeature, type LabelGeometry, type LabelProperties, 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 OccupantFeature, type OccupantFeaturePopulated, type OccupantGeometry, occupantHelper as OccupantHelpers, type OccupantProperties, type OpeningFeature, type OpeningFeaturePopulated, type OpeningGeometry, type OpeningProperties, type Page, type PolygonalFeature, type PopulatableFeatureType, type PopulatedParams, 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 SearchClient, type SectionFeature, type SectionFeaturePopulated, type SectionGeometry, type SectionProperties, type SingleGeometry, type SponsoredContentFeature, type SponsoredContentLegacyType, type SponsoredContentPlacementType, type SponsoredContentStrapiV4ApiResponse, type StairRelationshipFeaturePopulated, type StairsRelationshipFeature, type StairsRelationshipProperties, type TaxonomyFeature, type TaxonomyFeaturePopulated, type TaxonomyGeometry, type TaxonomyProperties, type TransalatableString, type TraversalRelationshipFeature, type TraversalRelationshipFeaturePopulated, type TraversalRelationshipProperties, type UnitFeature, type UnitFeaturePopulated, type UnitGeometry, type UnitProperties, type VenueClientOptions, type VenueDataClient, type VenueFeature, type VenueFeaturePopulated, type VenueGeometry, type VenueProperties, defaultFeatureQueryOptionsMap, fetchDeliveryApi, fetchPreviewApi, getDataClient, getSearchClient, isValidCoordinate, isValidLineString, isValidLineStringCoordinates, isValidMultiPolygon, isValidMultiPolygonCoordinates, isValidPoint, isValidPolygon, isValidPolygonCoordinates, matchFilter, matchFilters, safeFetchFeature };
|
|
942
|
+
export { ALL_FEATURE_TYPES, type AmenityFeature, type AmenityFeaturePopulated, type AmenityGeometry, type AmenityProperties, type AnchorFeature, type AnchorFeaturePopulated, type AnchorGeometry, type AnchorProperties, type AnyRelationshipFeature, type BaseRelationshipProperties, DEFAULT_BASE_URL, type DetailFeature, type DetailGeometry, type DetailProperties, type ElementFeature, type ElementGeometry, type ElementProperties, type ElevatorRelationshipFeature, type ElevatorRelationshipFeaturePopulated, type ElevatorRelationshipProperties, type EscalatorRelationshipFeature, type EscalatorRelationshipFeaturePopulated, type EscalatorRelationshipProperties, type EventFeature, type EventGeometry, type EventProperties, type FeaturePopulatedResponseMap, type FeatureQueryOptions, type FeatureResponseMap, type FeatureType, type FilterParams, type FindParams, type FixtureFeature, type FixtureFeaturePopulated, type FixtureGeometry, type FixtureProperties, GEOJSON_FEATURE_TYPES, type IMDFUnitCategory, IMDF_FEATURE_TYPES, IMDF_UNIT_CATEGORIES, type Id, type ImdfFeature, type InternalFilterByType, type InternalFindById, type KioskFeature, type KioskFeaturePopulated, type KioskGeometry, type KioskProperties, type LabelFeature, type LabelGeometry, type LabelProperties, 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 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 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 SearchClient, type SectionFeature, type SectionFeaturePopulated, type SectionGeometry, type SectionProperties, type SingleGeometry, type SponsoredContentFeature, type SponsoredContentLegacyType, type SponsoredContentPlacementType, type SponsoredContentStrapiV4ApiResponse, type StairRelationshipFeaturePopulated, type StairsRelationshipFeature, type StairsRelationshipProperties, type TaxonomyFeature, type TaxonomyFeaturePopulated, type TaxonomyGeometry, type TaxonomyProperties, type TransalatableString, type TraversalRelationshipFeature, type TraversalRelationshipFeaturePopulated, type TraversalRelationshipProperties, type UnitFeature, type UnitFeaturePopulated, type UnitGeometry, type UnitProperties, type UnitTypeAndId, type VenueClientOptions, type VenueDataClient, type VenueFeature, type VenueFeaturePopulated, type VenueGeometry, type VenueProperties, defaultFeatureQueryOptionsMap, fetchDeliveryApi, fetchPreviewApi, getDataClient, getSearchClient, isValidCoordinate, isValidLineString, isValidLineStringCoordinates, isValidMultiPolygon, isValidMultiPolygonCoordinates, isValidPoint, isValidPolygon, isValidPolygonCoordinates, matchFilter, matchFilters, safeFetchFeature };
|
package/dist/data/index.d.ts
CHANGED
|
@@ -143,6 +143,7 @@ type ExternalLink = {
|
|
|
143
143
|
};
|
|
144
144
|
type OccupantGeometry = null;
|
|
145
145
|
type OccupantProperties = EntityTimestamps & {
|
|
146
|
+
/** Anchor is used for marker position */
|
|
146
147
|
anchor_id: Id;
|
|
147
148
|
category: string | null;
|
|
148
149
|
category_group: string | null;
|
|
@@ -169,6 +170,9 @@ type OccupantProperties = EntityTimestamps & {
|
|
|
169
170
|
promotion_ids: Id[];
|
|
170
171
|
render_priority: number;
|
|
171
172
|
render_type: string;
|
|
173
|
+
/**
|
|
174
|
+
* @deprecated Use `unit_id or kiosk_id` instead.
|
|
175
|
+
*/
|
|
172
176
|
room_no: string | null;
|
|
173
177
|
short_name: string | null;
|
|
174
178
|
start_date: string;
|
|
@@ -228,41 +232,48 @@ type BaseRelationshipProperties = EntityTimestamps & {
|
|
|
228
232
|
};
|
|
229
233
|
};
|
|
230
234
|
type RelationshipFeature = ImdfFeature<RelationshipGeometry, BaseRelationshipProperties>;
|
|
235
|
+
type UnitTypeAndId = {
|
|
236
|
+
type: "unit";
|
|
237
|
+
id: string;
|
|
238
|
+
};
|
|
239
|
+
type OpeningTypeAndId = {
|
|
240
|
+
type: "opening";
|
|
241
|
+
id: string;
|
|
242
|
+
};
|
|
231
243
|
type TraversalRelationshipProperties = Omit<BaseRelationshipProperties, "origin" | "destination" | "intermediary" | "category"> & {
|
|
232
|
-
origin:
|
|
233
|
-
destination:
|
|
234
|
-
intermediary:
|
|
244
|
+
origin: UnitTypeAndId | null;
|
|
245
|
+
destination: UnitTypeAndId;
|
|
246
|
+
intermediary: OpeningTypeAndId[] | null;
|
|
235
247
|
category: "traversal" | "movingwalkway" | "traversal.path";
|
|
236
248
|
};
|
|
237
249
|
type TraversalRelationshipFeature = ImdfFeature<RelationshipGeometry, TraversalRelationshipProperties>;
|
|
238
250
|
type ElevatorRelationshipProperties = Omit<BaseRelationshipProperties, "origin" | "destination" | "intermediary" | "direction" | "category"> & {
|
|
239
|
-
origin:
|
|
240
|
-
destination:
|
|
241
|
-
intermediary:
|
|
251
|
+
origin: UnitTypeAndId;
|
|
252
|
+
destination: UnitTypeAndId;
|
|
253
|
+
intermediary: UnitTypeAndId[] | null;
|
|
242
254
|
direction: "undirected";
|
|
243
255
|
category: "elevator";
|
|
244
256
|
};
|
|
245
257
|
type ElevatorRelationshipFeature = ImdfFeature<RelationshipGeometry, ElevatorRelationshipProperties>;
|
|
246
258
|
type RampRelationshipProperties = Omit<BaseRelationshipProperties, "origin" | "destination" | "intermediary" | "category"> & {
|
|
247
|
-
origin:
|
|
248
|
-
destination:
|
|
249
|
-
intermediary:
|
|
259
|
+
origin: OpeningTypeAndId;
|
|
260
|
+
destination: OpeningTypeAndId;
|
|
261
|
+
intermediary: UnitTypeAndId[];
|
|
250
262
|
category: "ramp";
|
|
251
263
|
};
|
|
252
264
|
type RampRelationshipFeature = ImdfFeature<RelationshipGeometry, EscalatorRelationshipProperties>;
|
|
253
265
|
type StairsRelationshipProperties = Omit<BaseRelationshipProperties, "origin" | "destination" | "intermediary" | "direction" | "category"> & {
|
|
254
|
-
origin:
|
|
255
|
-
destination:
|
|
256
|
-
intermediary:
|
|
266
|
+
origin: OpeningTypeAndId;
|
|
267
|
+
destination: OpeningTypeAndId;
|
|
268
|
+
intermediary: UnitTypeAndId[] | null;
|
|
257
269
|
direction: "undirected";
|
|
258
270
|
category: "stairs" | "stairs.emergencyexit";
|
|
259
271
|
};
|
|
260
272
|
type StairsRelationshipFeature = ImdfFeature<RelationshipGeometry, StairsRelationshipProperties>;
|
|
261
|
-
type EscalatorRelationshipProperties = Omit<BaseRelationshipProperties, "origin" | "destination" | "intermediary" | "
|
|
262
|
-
origin:
|
|
263
|
-
destination:
|
|
264
|
-
intermediary:
|
|
265
|
-
direction: "directed";
|
|
273
|
+
type EscalatorRelationshipProperties = Omit<BaseRelationshipProperties, "origin" | "destination" | "intermediary" | "category"> & {
|
|
274
|
+
origin: OpeningTypeAndId;
|
|
275
|
+
destination: OpeningTypeAndId;
|
|
276
|
+
intermediary: UnitTypeAndId[];
|
|
266
277
|
category: "escalator";
|
|
267
278
|
};
|
|
268
279
|
type EscalatorRelationshipFeature = ImdfFeature<RelationshipGeometry, EscalatorRelationshipProperties>;
|
|
@@ -676,7 +687,7 @@ type OpeningFeaturePopulated = OpeningFeature & {
|
|
|
676
687
|
type RelationshipFeaturePopulated = RelationshipFeature & {
|
|
677
688
|
properties: RelationshipFeature["properties"] & {
|
|
678
689
|
origin: UnitFeature | OpeningFeature | null;
|
|
679
|
-
destination: UnitFeature;
|
|
690
|
+
destination: UnitFeature | OpeningFeature | null;
|
|
680
691
|
intermediary: (UnitFeature | OpeningFeature)[] | null;
|
|
681
692
|
};
|
|
682
693
|
};
|
|
@@ -848,11 +859,14 @@ interface VenueDataClient {
|
|
|
848
859
|
|
|
849
860
|
declare const DEFAULT_BASE_URL = "https://service.venue.in.th/api";
|
|
850
861
|
declare const IMDF_FEATURE_TYPES: FeatureType[];
|
|
862
|
+
declare const IMDF_UNIT_CATEGORIES: string[];
|
|
851
863
|
declare const NONIMDF_FEATURE_TYPES: FeatureType[];
|
|
852
864
|
declare const GEOJSON_FEATURE_TYPES: FeatureType[];
|
|
853
865
|
declare const ALL_FEATURE_TYPES: FeatureType[];
|
|
854
866
|
declare const defaultFeatureQueryOptionsMap: Record<FeatureType, FeatureQueryOptions>;
|
|
855
867
|
|
|
868
|
+
type IMDFUnitCategory = typeof IMDF_UNIT_CATEGORIES[number];
|
|
869
|
+
|
|
856
870
|
declare function fetchDeliveryApi<T extends FeatureType = FeatureType>(projectId: string, apiKey: string, featureType: FeatureType, baseUrl?: string): Promise<FeatureResponseMap[T][]>;
|
|
857
871
|
declare function fetchPreviewApi<T extends FeatureType = FeatureType>(projectId: string, previewToken: string, featureType: FeatureType, baseUrl?: string): Promise<FeatureResponseMap[T][]>;
|
|
858
872
|
declare const safeFetchFeature: <T extends FeatureType = FeatureType>(featureType: FeatureType, params: {
|
|
@@ -925,4 +939,4 @@ declare const getSearchClient: ({ occupants, amenities }: {
|
|
|
925
939
|
amenities: AmenityFeature[];
|
|
926
940
|
}) => SearchClient;
|
|
927
941
|
|
|
928
|
-
export { ALL_FEATURE_TYPES, type AmenityFeature, type AmenityFeaturePopulated, type AmenityGeometry, type AmenityProperties, type AnchorFeature, type AnchorFeaturePopulated, type AnchorGeometry, type AnchorProperties, type AnyRelationshipFeature, type BaseRelationshipProperties, DEFAULT_BASE_URL, type DetailFeature, type DetailGeometry, type DetailProperties, type ElementFeature, type ElementGeometry, type ElementProperties, type ElevatorRelationshipFeature, type ElevatorRelationshipFeaturePopulated, type ElevatorRelationshipProperties, type EscalatorRelationshipFeature, type EscalatorRelationshipFeaturePopulated, type EscalatorRelationshipProperties, type EventFeature, type EventGeometry, type EventProperties, type FeaturePopulatedResponseMap, type FeatureQueryOptions, type FeatureResponseMap, type FeatureType, type FilterParams, type FindParams, type FixtureFeature, type FixtureFeaturePopulated, type FixtureGeometry, type FixtureProperties, GEOJSON_FEATURE_TYPES, IMDF_FEATURE_TYPES, type Id, type ImdfFeature, type InternalFilterByType, type InternalFindById, type KioskFeature, type KioskFeaturePopulated, type KioskGeometry, type KioskProperties, type LabelFeature, type LabelGeometry, type LabelProperties, 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 OccupantFeature, type OccupantFeaturePopulated, type OccupantGeometry, occupantHelper as OccupantHelpers, type OccupantProperties, type OpeningFeature, type OpeningFeaturePopulated, type OpeningGeometry, type OpeningProperties, type Page, type PolygonalFeature, type PopulatableFeatureType, type PopulatedParams, 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 SearchClient, type SectionFeature, type SectionFeaturePopulated, type SectionGeometry, type SectionProperties, type SingleGeometry, type SponsoredContentFeature, type SponsoredContentLegacyType, type SponsoredContentPlacementType, type SponsoredContentStrapiV4ApiResponse, type StairRelationshipFeaturePopulated, type StairsRelationshipFeature, type StairsRelationshipProperties, type TaxonomyFeature, type TaxonomyFeaturePopulated, type TaxonomyGeometry, type TaxonomyProperties, type TransalatableString, type TraversalRelationshipFeature, type TraversalRelationshipFeaturePopulated, type TraversalRelationshipProperties, type UnitFeature, type UnitFeaturePopulated, type UnitGeometry, type UnitProperties, type VenueClientOptions, type VenueDataClient, type VenueFeature, type VenueFeaturePopulated, type VenueGeometry, type VenueProperties, defaultFeatureQueryOptionsMap, fetchDeliveryApi, fetchPreviewApi, getDataClient, getSearchClient, isValidCoordinate, isValidLineString, isValidLineStringCoordinates, isValidMultiPolygon, isValidMultiPolygonCoordinates, isValidPoint, isValidPolygon, isValidPolygonCoordinates, matchFilter, matchFilters, safeFetchFeature };
|
|
942
|
+
export { ALL_FEATURE_TYPES, type AmenityFeature, type AmenityFeaturePopulated, type AmenityGeometry, type AmenityProperties, type AnchorFeature, type AnchorFeaturePopulated, type AnchorGeometry, type AnchorProperties, type AnyRelationshipFeature, type BaseRelationshipProperties, DEFAULT_BASE_URL, type DetailFeature, type DetailGeometry, type DetailProperties, type ElementFeature, type ElementGeometry, type ElementProperties, type ElevatorRelationshipFeature, type ElevatorRelationshipFeaturePopulated, type ElevatorRelationshipProperties, type EscalatorRelationshipFeature, type EscalatorRelationshipFeaturePopulated, type EscalatorRelationshipProperties, type EventFeature, type EventGeometry, type EventProperties, type FeaturePopulatedResponseMap, type FeatureQueryOptions, type FeatureResponseMap, type FeatureType, type FilterParams, type FindParams, type FixtureFeature, type FixtureFeaturePopulated, type FixtureGeometry, type FixtureProperties, GEOJSON_FEATURE_TYPES, type IMDFUnitCategory, IMDF_FEATURE_TYPES, IMDF_UNIT_CATEGORIES, type Id, type ImdfFeature, type InternalFilterByType, type InternalFindById, type KioskFeature, type KioskFeaturePopulated, type KioskGeometry, type KioskProperties, type LabelFeature, type LabelGeometry, type LabelProperties, 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 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 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 SearchClient, type SectionFeature, type SectionFeaturePopulated, type SectionGeometry, type SectionProperties, type SingleGeometry, type SponsoredContentFeature, type SponsoredContentLegacyType, type SponsoredContentPlacementType, type SponsoredContentStrapiV4ApiResponse, type StairRelationshipFeaturePopulated, type StairsRelationshipFeature, type StairsRelationshipProperties, type TaxonomyFeature, type TaxonomyFeaturePopulated, type TaxonomyGeometry, type TaxonomyProperties, type TransalatableString, type TraversalRelationshipFeature, type TraversalRelationshipFeaturePopulated, type TraversalRelationshipProperties, type UnitFeature, type UnitFeaturePopulated, type UnitGeometry, type UnitProperties, type UnitTypeAndId, type VenueClientOptions, type VenueDataClient, type VenueFeature, type VenueFeaturePopulated, type VenueGeometry, type VenueProperties, defaultFeatureQueryOptionsMap, fetchDeliveryApi, fetchPreviewApi, getDataClient, getSearchClient, isValidCoordinate, isValidLineString, isValidLineStringCoordinates, isValidMultiPolygon, isValidMultiPolygonCoordinates, isValidPoint, isValidPolygon, isValidPolygonCoordinates, matchFilter, matchFilters, safeFetchFeature };
|
package/dist/data/index.js
CHANGED
|
@@ -23,6 +23,7 @@ __export(data_exports, {
|
|
|
23
23
|
DEFAULT_BASE_URL: () => DEFAULT_BASE_URL,
|
|
24
24
|
GEOJSON_FEATURE_TYPES: () => GEOJSON_FEATURE_TYPES,
|
|
25
25
|
IMDF_FEATURE_TYPES: () => IMDF_FEATURE_TYPES,
|
|
26
|
+
IMDF_UNIT_CATEGORIES: () => IMDF_UNIT_CATEGORIES,
|
|
26
27
|
NONIMDF_FEATURE_TYPES: () => NONIMDF_FEATURE_TYPES,
|
|
27
28
|
OccupantHelpers: () => occupant_helper_exports,
|
|
28
29
|
QueryObserver: () => import_query_core2.QueryObserver,
|
|
@@ -66,6 +67,71 @@ var IMDF_FEATURE_TYPES = [
|
|
|
66
67
|
"unit",
|
|
67
68
|
"venue"
|
|
68
69
|
];
|
|
70
|
+
var IMDF_UNIT_CATEGORIES = [
|
|
71
|
+
"auditorium",
|
|
72
|
+
"brick",
|
|
73
|
+
"classroom",
|
|
74
|
+
"column",
|
|
75
|
+
"concrete",
|
|
76
|
+
"conferenceroom",
|
|
77
|
+
"drywall",
|
|
78
|
+
"elevator",
|
|
79
|
+
"escalator",
|
|
80
|
+
"fieldofplay",
|
|
81
|
+
"firstaid",
|
|
82
|
+
"fitnessroom",
|
|
83
|
+
"foodservice",
|
|
84
|
+
"footbridge",
|
|
85
|
+
"glass",
|
|
86
|
+
"huddleroom",
|
|
87
|
+
"kitchen",
|
|
88
|
+
"laboratory",
|
|
89
|
+
"library",
|
|
90
|
+
"lobby",
|
|
91
|
+
"lounge",
|
|
92
|
+
"mailroom",
|
|
93
|
+
"mothersroom",
|
|
94
|
+
"movietheater",
|
|
95
|
+
"movingwalkway",
|
|
96
|
+
"nonpublic",
|
|
97
|
+
"office",
|
|
98
|
+
"opentobelow",
|
|
99
|
+
"parking",
|
|
100
|
+
"phoneroom",
|
|
101
|
+
"platform",
|
|
102
|
+
"privatelounge",
|
|
103
|
+
"ramp",
|
|
104
|
+
"recreation",
|
|
105
|
+
"restroom",
|
|
106
|
+
"restroom.family",
|
|
107
|
+
"restroom.female",
|
|
108
|
+
"restroom.female.wheelchair",
|
|
109
|
+
"restroom.male",
|
|
110
|
+
"restroom.male.wheelchair",
|
|
111
|
+
"restroom.transgender",
|
|
112
|
+
"restroom.transgender.wheelchair",
|
|
113
|
+
"restroom.unisex",
|
|
114
|
+
"restroom.unisex.wheelchair",
|
|
115
|
+
"restroom.wheelchair",
|
|
116
|
+
"road",
|
|
117
|
+
"room",
|
|
118
|
+
"serverroom",
|
|
119
|
+
"shower",
|
|
120
|
+
"smokingarea",
|
|
121
|
+
"stairs",
|
|
122
|
+
"steps",
|
|
123
|
+
"storage",
|
|
124
|
+
"structure",
|
|
125
|
+
"terrace",
|
|
126
|
+
"theater",
|
|
127
|
+
"unenclosedarea",
|
|
128
|
+
"unspecified",
|
|
129
|
+
"vegetation",
|
|
130
|
+
"waitingroom",
|
|
131
|
+
"walkway",
|
|
132
|
+
"walkway.island",
|
|
133
|
+
"wood"
|
|
134
|
+
];
|
|
69
135
|
var NONIMDF_FEATURE_TYPES = [
|
|
70
136
|
"taxonomy",
|
|
71
137
|
"event",
|
|
@@ -362,7 +428,27 @@ var getOccupantMarkerLocations = (occupant, options) => {
|
|
|
362
428
|
var import_query_core = require("@tanstack/query-core");
|
|
363
429
|
|
|
364
430
|
// src/data/populator/index.ts
|
|
365
|
-
var
|
|
431
|
+
var import_center2 = require("@turf/center");
|
|
432
|
+
var import_boolean_point_in_polygon2 = require("@turf/boolean-point-in-polygon");
|
|
433
|
+
|
|
434
|
+
// src/data/utils/findContaining.ts
|
|
435
|
+
var import_center = require("@turf/center");
|
|
436
|
+
var import_boolean_point_in_polygon = require("@turf/boolean-point-in-polygon");
|
|
437
|
+
var findContainingUnit = (poi, units) => {
|
|
438
|
+
const unit = units.find(
|
|
439
|
+
(unit2) => {
|
|
440
|
+
try {
|
|
441
|
+
return unit2.properties.level_id === poi.properties.level_id && (0, import_boolean_point_in_polygon.booleanPointInPolygon)((0, import_center.center)(poi), unit2);
|
|
442
|
+
} catch (e) {
|
|
443
|
+
console.log(`Cannot find containing unit of (${poi.id}):`, e.message);
|
|
444
|
+
return false;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
);
|
|
448
|
+
return unit;
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
// src/data/populator/index.ts
|
|
366
452
|
var createPopulator = ({
|
|
367
453
|
internalFindById,
|
|
368
454
|
internalFilterByType
|
|
@@ -372,7 +458,6 @@ var createPopulator = ({
|
|
|
372
458
|
const populateDetail = (detail) => Promise.resolve(detail);
|
|
373
459
|
const populateFootprint = (footprint) => Promise.resolve(footprint);
|
|
374
460
|
const populateGeofence = (geofence) => Promise.resolve(geofence);
|
|
375
|
-
const populateRelationship = (relationship) => Promise.resolve(relationship);
|
|
376
461
|
const populatePrivilege = (privilege) => Promise.resolve(privilege);
|
|
377
462
|
const populateEvent = (event) => Promise.resolve(event);
|
|
378
463
|
const populatePromotion = async (promotion) => {
|
|
@@ -396,7 +481,7 @@ var createPopulator = ({
|
|
|
396
481
|
const ordinalKiosks = kiosks.filter(
|
|
397
482
|
(kiosk2) => kiosk2.properties.level_id === defaultLevel.id
|
|
398
483
|
);
|
|
399
|
-
const kiosk = ordinalKiosks.find((kiosk2) => (0,
|
|
484
|
+
const kiosk = ordinalKiosks.find((kiosk2) => (0, import_boolean_point_in_polygon2.booleanPointInPolygon)(amenity, kiosk2));
|
|
400
485
|
return {
|
|
401
486
|
...amenity,
|
|
402
487
|
properties: {
|
|
@@ -415,7 +500,7 @@ var createPopulator = ({
|
|
|
415
500
|
const venue = await internalFindById(unit.properties.venue_id);
|
|
416
501
|
const level = await internalFindById(unit.properties.level_id);
|
|
417
502
|
const sections = await internalFilterByType("section");
|
|
418
|
-
const section = sections.find((section2) => (0,
|
|
503
|
+
const section = sections.find((section2) => (0, import_boolean_point_in_polygon2.booleanPointInPolygon)(anchor, section2));
|
|
419
504
|
return {
|
|
420
505
|
...anchor,
|
|
421
506
|
properties: {
|
|
@@ -448,20 +533,11 @@ var createPopulator = ({
|
|
|
448
533
|
const venue = await internalFindById(kiosk.properties.venue_id);
|
|
449
534
|
const anchor = await internalFindById(kiosk.properties.anchor_id);
|
|
450
535
|
const units = await internalFilterByType("unit");
|
|
451
|
-
const unit = units.
|
|
452
|
-
(unit2) => {
|
|
453
|
-
try {
|
|
454
|
-
return unit2.properties.category === "walkway" && unit2.properties.level_id === kiosk.properties.level_id && (0, import_boolean_within.booleanWithin)(kiosk, unit2);
|
|
455
|
-
} catch (e) {
|
|
456
|
-
console.log(`Cannot find kiosk(${kiosk.id})'s units:`, e.message);
|
|
457
|
-
return false;
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
);
|
|
536
|
+
const unit = findContainingUnit(kiosk, units.filter((unit2) => unit2.properties.category === "walkway"));
|
|
461
537
|
let section = null;
|
|
462
538
|
if (anchor) {
|
|
463
539
|
const sections = await internalFilterByType("section");
|
|
464
|
-
section = sections.find((section2) => (0,
|
|
540
|
+
section = sections.find((section2) => (0, import_boolean_point_in_polygon2.booleanPointInPolygon)(anchor, section2));
|
|
465
541
|
}
|
|
466
542
|
return {
|
|
467
543
|
...kiosk,
|
|
@@ -543,6 +619,23 @@ var createPopulator = ({
|
|
|
543
619
|
}
|
|
544
620
|
};
|
|
545
621
|
};
|
|
622
|
+
const populateRelationship = async (relationship) => {
|
|
623
|
+
const originId = relationship.properties.origin?.id;
|
|
624
|
+
const destinationId = relationship.properties.destination?.id;
|
|
625
|
+
const origin = originId ? await internalFindById(originId) : null;
|
|
626
|
+
const destination = destinationId ? await internalFindById(destinationId) : null;
|
|
627
|
+
const intermediary_ids = (relationship.properties.intermediary || []).map(({ id }) => id);
|
|
628
|
+
const intermediary = await Promise.all(intermediary_ids.map(internalFindById));
|
|
629
|
+
return {
|
|
630
|
+
...relationship,
|
|
631
|
+
properties: {
|
|
632
|
+
...relationship.properties,
|
|
633
|
+
origin,
|
|
634
|
+
destination,
|
|
635
|
+
intermediary
|
|
636
|
+
}
|
|
637
|
+
};
|
|
638
|
+
};
|
|
546
639
|
const populateSection = async (section) => {
|
|
547
640
|
const venue = await internalFindById(section.properties.venue_id);
|
|
548
641
|
const level = await internalFindById(section.properties.level_id);
|
|
@@ -561,7 +654,7 @@ var createPopulator = ({
|
|
|
561
654
|
const level = await internalFindById(unit.properties.level_id);
|
|
562
655
|
const sections = await internalFilterByType("section");
|
|
563
656
|
try {
|
|
564
|
-
const section = unit.geometry.type !== "MultiPolygon" ? sections.find((section2) => (0,
|
|
657
|
+
const section = unit.geometry.type !== "MultiPolygon" ? sections.find((section2) => (0, import_boolean_point_in_polygon2.booleanPointInPolygon)((0, import_center2.center)(unit), section2)) : null;
|
|
565
658
|
return {
|
|
566
659
|
...unit,
|
|
567
660
|
properties: {
|
|
@@ -2134,6 +2227,7 @@ var getDataClient = (options) => {
|
|
|
2134
2227
|
DEFAULT_BASE_URL,
|
|
2135
2228
|
GEOJSON_FEATURE_TYPES,
|
|
2136
2229
|
IMDF_FEATURE_TYPES,
|
|
2230
|
+
IMDF_UNIT_CATEGORIES,
|
|
2137
2231
|
NONIMDF_FEATURE_TYPES,
|
|
2138
2232
|
OccupantHelpers,
|
|
2139
2233
|
QueryObserver,
|