venue-js 1.4.0-next.1 → 1.4.0-next.3

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.mts CHANGED
@@ -84,7 +84,9 @@ type AnchorProperties = EntityTimestamps & {
84
84
  unit_id: Id;
85
85
  locale: string;
86
86
  };
87
- type AnchorFeature = ImdfFeature<AnchorGeometry, AnchorProperties>;
87
+ type AnchorFeature = ImdfFeature<AnchorGeometry, AnchorProperties> & {
88
+ feature_type: "anchor";
89
+ };
88
90
  type AmenityGeometry = Point;
89
91
  type AmenityProperties = EntityTimestamps & {
90
92
  amenity_logo: Media | null;
@@ -100,6 +102,7 @@ type AmenityProperties = EntityTimestamps & {
100
102
  style: unknown;
101
103
  unit_ids: Id[];
102
104
  venue_id: Id;
105
+ hours: string | null;
103
106
  };
104
107
  type AmenityFeature = ImdfFeature<AmenityGeometry, AmenityProperties> & {
105
108
  feature_type: "amenity";
@@ -454,9 +457,13 @@ type AmenityFeaturePopulated = AmenityFeature & {
454
457
  */
455
458
  units: UnitFeaturePopulated[];
456
459
  /**
457
- * [venue.in.th] Venue that kiosk is in
460
+ * [venue.in.th] Venue that amenity is in
458
461
  */
459
462
  venue: VenueFeaturePopulated;
463
+ /**
464
+ * [IMDF] Level that amenity is on
465
+ */
466
+ level: LevelFeaturePopulated;
460
467
  /**
461
468
  * [Derived] From units[0] --> level's ordinal
462
469
  * This is added during feature enrichment and not part of the original IMDF dataset.
@@ -489,6 +496,10 @@ type AnchorFeaturePopulated = AnchorFeature & {
489
496
  * [IMDF] Level that kiosk is on
490
497
  */
491
498
  level: LevelFeaturePopulated;
499
+ /**
500
+ * [venue.in.th] Venue that anchor is in
501
+ */
502
+ venue: VenueFeaturePopulated;
492
503
  /**
493
504
  * [Derived] The section this anchor is on.
494
505
  * This is added during feature enrichment and not part of the original IMDF dataset.
package/dist/index.d.ts CHANGED
@@ -84,7 +84,9 @@ type AnchorProperties = EntityTimestamps & {
84
84
  unit_id: Id;
85
85
  locale: string;
86
86
  };
87
- type AnchorFeature = ImdfFeature<AnchorGeometry, AnchorProperties>;
87
+ type AnchorFeature = ImdfFeature<AnchorGeometry, AnchorProperties> & {
88
+ feature_type: "anchor";
89
+ };
88
90
  type AmenityGeometry = Point;
89
91
  type AmenityProperties = EntityTimestamps & {
90
92
  amenity_logo: Media | null;
@@ -100,6 +102,7 @@ type AmenityProperties = EntityTimestamps & {
100
102
  style: unknown;
101
103
  unit_ids: Id[];
102
104
  venue_id: Id;
105
+ hours: string | null;
103
106
  };
104
107
  type AmenityFeature = ImdfFeature<AmenityGeometry, AmenityProperties> & {
105
108
  feature_type: "amenity";
@@ -454,9 +457,13 @@ type AmenityFeaturePopulated = AmenityFeature & {
454
457
  */
455
458
  units: UnitFeaturePopulated[];
456
459
  /**
457
- * [venue.in.th] Venue that kiosk is in
460
+ * [venue.in.th] Venue that amenity is in
458
461
  */
459
462
  venue: VenueFeaturePopulated;
463
+ /**
464
+ * [IMDF] Level that amenity is on
465
+ */
466
+ level: LevelFeaturePopulated;
460
467
  /**
461
468
  * [Derived] From units[0] --> level's ordinal
462
469
  * This is added during feature enrichment and not part of the original IMDF dataset.
@@ -489,6 +496,10 @@ type AnchorFeaturePopulated = AnchorFeature & {
489
496
  * [IMDF] Level that kiosk is on
490
497
  */
491
498
  level: LevelFeaturePopulated;
499
+ /**
500
+ * [venue.in.th] Venue that anchor is in
501
+ */
502
+ venue: VenueFeaturePopulated;
492
503
  /**
493
504
  * [Derived] The section this anchor is on.
494
505
  * This is added during feature enrichment and not part of the original IMDF dataset.
package/dist/index.js CHANGED
@@ -447,6 +447,7 @@ var createPopulator = ({
447
447
  ...amenity.properties,
448
448
  ordinal: defaultLevel.properties.ordinal,
449
449
  level_name: defaultLevel.properties.name.en,
450
+ level: defaultLevel,
450
451
  units: populatedUnits,
451
452
  venue,
452
453
  _experimental_kiosk: kiosk ? await populateKiosk(kiosk) : null
@@ -455,6 +456,7 @@ var createPopulator = ({
455
456
  };
456
457
  const populateAnchor = async (anchor) => {
457
458
  const unit = await internalFindById(anchor.properties.unit_id);
459
+ const venue = await internalFindById(unit.properties.venue_id);
458
460
  const level = await internalFindById(unit.properties.level_id);
459
461
  const sections = await internalFilterByType("section");
460
462
  const section = sections.find((section2) => (0, import_boolean_within.booleanWithin)(anchor, section2));
@@ -464,7 +466,9 @@ var createPopulator = ({
464
466
  ...anchor.properties,
465
467
  level: await populateLevel(level),
466
468
  unit: await populateUnit(unit),
467
- section: section ? await populateSection(section) : null
469
+ section: section ? await populateSection(section) : null,
470
+ venue: await populateVenue(venue),
471
+ ordinal: level.properties.ordinal
468
472
  }
469
473
  };
470
474
  };