@autobusal/providers 1.6.1 → 1.6.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/CHANGELOG.md CHANGED
@@ -4,6 +4,25 @@ All notable changes to `@autobusal/providers` are documented here. This project
4
4
  adheres to [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
5
5
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.6.3] - 2026-07-30
8
+
9
+ ### Added
10
+
11
+ - **`types/locations.ts` `CountryStats` type + `CountryData.stats`** - real
12
+ route/operator/city/price-from counts from obtapi's enriched
13
+ `countries/view` endpoint, for country landing pages to render actual
14
+ descriptive content instead of a bare city list.
15
+
16
+ ## [1.6.2] - 2026-07-30
17
+
18
+ ### Fixed
19
+
20
+ - **`Setup/analytics.ts` now initializes GA4 with `send_page_view: false`.**
21
+ Pairs with `@autobusal/common` 1.8.0, which sends every pageview
22
+ explicitly (including the first) from `Meta` instead - previously the
23
+ automatic initial page_view and any future manual tracking would have
24
+ double-counted the first page of every session.
25
+
7
26
  ## [1.6.1] - 2026-07-30
8
27
 
9
28
  ### Fixed
@@ -1,11 +1,18 @@
1
1
  import ReactGA from 'react-ga4';
2
2
 
3
+ // `send_page_view: false` disables gtag.js's automatic page_view on this
4
+ // initial `config` call - client-side route changes in this SPA never
5
+ // trigger another `config`, so relying on the automatic one meant only
6
+ // the very first page of a session was ever tracked. Every pageview
7
+ // (including the first) is instead sent explicitly from
8
+ // @autobusal/common's Meta component, which re-fires on every route change
9
+ // since it's rendered by (almost) every page - see the comment there.
3
10
  const analytics = (id: string | null): void => {
4
11
  if (id === null) {
5
12
  return;
6
13
  }
7
14
 
8
- ReactGA.initialize(id);
15
+ ReactGA.initialize(id, { gaOptions: { send_page_view: false } });
9
16
  };
10
17
 
11
- export default analytics;
18
+ export default analytics;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/providers",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "author": "Ferjolt Ozuni",
5
5
  "type": "module",
6
6
  "main": "index.ts"
@@ -8,6 +8,13 @@ export interface LocationData {
8
8
  order_id: number
9
9
  }
10
10
 
11
+ export interface CountryStats {
12
+ routes: number
13
+ operators: number
14
+ cities: number
15
+ price_from: string | null
16
+ }
17
+
11
18
  export interface CountryData {
12
19
  id: number
13
20
  name: string
@@ -17,6 +24,7 @@ export interface CountryData {
17
24
  cities?: CityData[]
18
25
  iso_code: string
19
26
  available?: number
27
+ stats?: CountryStats
20
28
  }
21
29
 
22
30
  export interface CityData {