@autobusal/providers 1.3.5 → 1.3.7

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,27 @@ 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.3.7] - 2026-07-27
8
+
9
+ ### Added
10
+
11
+ - `FoundData.external`/`FoundData.price.id` widened to admit external
12
+ bus-route provider offers (Mode A: search + redirect) - `id`/`price.id`
13
+ become the synthetic `ext:{provider}:{offer_id}` string, and an optional
14
+ `external: {provider, mode, offer_id}` discriminator marks the row so the
15
+ frontend never sends it to local-only endpoints (seat maps, coupons,
16
+ checkout). Scoped to `FoundData` only - the shared `PriceData`/`RouteData`
17
+ interfaces (used by operator-side price editing) are untouched.
18
+
19
+ ## [1.3.6] - 2026-07-25
20
+
21
+ ### Added
22
+
23
+ - `SettingsData.addons` - whether the WhatsApp/Telegram checkout addon is
24
+ available for this label and what it costs (never credentials), exposed
25
+ by obtapi's `Settings\ViewController::get()` for the checkout SPA to
26
+ render the addon selection at Step5.
27
+
7
28
  ## [1.3.5] - 2026-07-25
8
29
 
9
30
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/providers",
3
- "version": "1.3.5",
3
+ "version": "1.3.7",
4
4
  "author": "Ferjolt Ozuni",
5
5
  "type": "module",
6
6
  "main": "index.ts"
package/types/routes.ts CHANGED
@@ -82,14 +82,29 @@ export interface PolicyData {
82
82
  policies: string
83
83
  }
84
84
 
85
- export interface FoundData extends Omit<RouteData, 'locations'> {
86
- price: PriceData
85
+ export interface FoundData extends Omit<RouteData, 'locations' | 'id'> {
86
+ id: number | string
87
+ // Edited: Ferjolt Ozuni - Date: 2026-07-27
88
+ // `id` widened here (and on `price` below), NOT on the shared PriceData/
89
+ // RouteData interfaces - those are also used by operator-side price
90
+ // editing (operator-routes) and coupons/Step4 (routes-order), which
91
+ // still assume a real numeric local id.
92
+ price: Omit<PriceData, 'id'> & { id: number | string }
87
93
  duration: string
88
94
  customs: string[]
89
95
  locations: {
90
96
  from: LocationData
91
97
  to: LocationData
92
98
  }
99
+ // present only on external-provider offers (Mode A: search + redirect) -
100
+ // `id`/`price.id` are then the synthetic "ext:{provider}:{offer_id}"
101
+ // string, never a real local route/price id - never sent to
102
+ // local-only endpoints (seat maps, coupons, checkout)
103
+ external?: {
104
+ provider: string
105
+ mode: 'redirect' | 'booking'
106
+ offer_id: string
107
+ }
93
108
  }
94
109
 
95
110
  export interface PriceData {
package/types/settings.ts CHANGED
@@ -9,6 +9,15 @@ export interface SettingsData {
9
9
  site_key: string | null
10
10
  }
11
11
 
12
+ // Edited: Ferjolt Ozuni - Date: 2026-07-25
13
+ // Whether the checkout addon is available for this label and what it
14
+ // costs - the SPA never sees credentials, only what it needs to render
15
+ // the addon at checkout (see obtapi's Settings\ViewController::addon()).
16
+ addons?: {
17
+ whatsapp: { available: boolean, price: number }
18
+ telegram: { available: boolean, price: number }
19
+ }
20
+
12
21
  preferences: {
13
22
  company: string
14
23