@autobusal/providers 1.40.3 → 1.40.5

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
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.40.4
4
+
5
+ ### Fixed
6
+
7
+ - **The Content-Language header survives a cold load** - requests firing before i18next.init resolved carried no language at all, which is the recurring English-menu-under-/sq leak (CMS-05/CMS-07). The interceptor now falls back to the URL's locale prefix, then the stored preference.
8
+
3
9
  ## 1.40.3
4
10
 
5
11
  ### Fixed
@@ -363,6 +369,13 @@ added to `OperatorData` and `RouteData`, always optional and often absent.
363
369
  (`auto_publish`, `threshold`). Absent or false means every review waits for a
364
370
  human, which is the default for every brand.
365
371
 
372
+ ## [1.40.5] - 2026-08-26
373
+
374
+ ### Added
375
+
376
+ - `OrderData.round_trip?` - whether the order is already half of a round
377
+ trip (either leg); computed by obtapi's single-order endpoint.
378
+
366
379
  ## [1.17.0] - 2026-08-02
367
380
 
368
381
  ### Changed
@@ -49,8 +49,25 @@ if (!isBffMode) {
49
49
  // upstream (see @autobusal/bff) - both sides had to change, only one of
50
50
  // them silently doing nothing would look identical to neither working.
51
51
  apiClient.interceptors.request.use(config => {
52
- if (i18next.language) {
53
- config.headers['Content-Language'] = i18next.language;
52
+ /*
53
+ * Claude - 2026-08-22 (audit findings CMS-05/CMS-07): on a COLD load,
54
+ * requests that fire before i18next.init resolves saw no language at
55
+ * all - so the first menu/settings fetch of a /sq visit carried no
56
+ * header and came back English, which is exactly the recurring
57
+ * English-menu-under-/sq leak the audit kept meeting. The fallback
58
+ * resolves the same way Setup/languages does: the URL's locale prefix
59
+ * first, then the stored preference. An unknown two-letter first
60
+ * segment is harmless - the API ignores languages it doesn't serve.
61
+ */
62
+ const fromUrl = window.location.pathname.split('/')[1];
63
+
64
+ const language = i18next.language
65
+ || (/^[a-z]{2}$/.test(fromUrl) ? fromUrl : '')
66
+ || localStorage.getItem('language')
67
+ || '';
68
+
69
+ if (language) {
70
+ config.headers['Content-Language'] = language;
54
71
  }
55
72
 
56
73
  return config;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@autobusal/providers",
3
- "version": "1.40.3",
3
+ "version": "1.40.5",
4
4
  "author": "Ferjolt Ozuni",
5
5
  "type": "module",
6
6
  "main": "index.ts"
7
- }
7
+ }
package/types/orders.ts CHANGED
@@ -42,6 +42,10 @@ export interface OrderData {
42
42
  note_cancel: string
43
43
  actions: string[]
44
44
  created_at: string
45
+ // Claude - 2026-08-22 (audit TK-01): the PNR-style reference support and
46
+ // operators quote - both the listing and the single-order endpoint carry
47
+ // it; optional only because older cached rows may predate the column.
48
+ order_number?: string
45
49
  /*
46
50
  * Edited: Ferjolt Ozuni - Date: 2026-08-11
47
51
  * Who owns this order, collapsed to what a viewer outside the account
@@ -49,6 +53,10 @@ export interface OrderData {
49
53
  * Libraries\Orders\View::ownerCategory() (obtapi) for the mapping.
50
54
  */
51
55
  owner_category: 'agency' | 'operator' | 'individual'
56
+ // Claude - 2026-08-26: whether this order is already half of a round
57
+ // trip (either leg) - the return-trip offer stays silent when true.
58
+ // Optional: only the single-order endpoint computes it.
59
+ round_trip?: boolean
52
60
  // Edited: Ferjolt Ozuni - Date: 2026-08-11
53
61
  // Optional now: hidden on a restricted response (the public order lookup
54
62
  // and any other non-self-service view) - see View::get()'s $restricted.