@autobusal/providers 1.33.0 → 1.35.0

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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.35.0
4
+
5
+ ### Changed
6
+
7
+ - **`PageData` (the admin Pages shape) is now locale-object-based, not `_en`/`_sq` columns.** `title`/`content`/`keywords`/`description` are each `LocalizedText` (`Record<string, string>`, one value per locale) - matches obtapi's `pages_content_to_json` migration, which moved `pages` off the two-content-language ceiling onto the same JSON-per-locale shape `faqs` already established. `title_en`/`title_sq`/`content_en`/`content_sq` and friends are gone from the type entirely. New `PageSaveData` covers what the admin save endpoint actually accepts (each field JSON-stringified, not the raw object) - the public page-view response (`@autobusal/page/types.ts`) is unaffected, it was already a single resolved string per field.
8
+
9
+ ## 1.34.0
10
+
11
+ ### Added
12
+
13
+ - **`OperatorData.brand_name` / `OperatorData.display_name`** - an operator's optional public-facing trade name and the computed field (`brand_name` if set, else `company`) every customer-facing display should read. `company` stays as the registered legal name, for legal/financial contexts only.
14
+
3
15
  ## 1.33.0
4
16
 
5
17
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/providers",
3
- "version": "1.33.0",
3
+ "version": "1.35.0",
4
4
  "author": "Ferjolt Ozuni",
5
5
  "type": "module",
6
6
  "main": "index.ts"
@@ -8,6 +8,14 @@ export interface OperatorData {
8
8
  rating?: RatingData | null
9
9
  id: number
10
10
  company: string
11
+ // Edited: Ferjolt Ozuni - Date: 2026-08-10
12
+ // brand_name is the raw, optional override; display_name is what every
13
+ // customer-facing display should actually read (brand_name if set, else
14
+ // company) - obtapi computes the fallback, nothing on this side should
15
+ // re-derive it. `company` itself stays for legal/financial contexts
16
+ // only (invoices, admin/back-office screens).
17
+ brand_name?: string
18
+ display_name: string
11
19
  nipt: string
12
20
  name: string
13
21
  code: string
package/types/pages.ts CHANGED
@@ -1,19 +1,37 @@
1
+ /** One value per locale, e.g. `{ en: "About Us", sq: "Rreth Nesh" }`. */
2
+ export type LocalizedText = Record<string, string>
3
+
4
+ /**
5
+ * The ADMIN shape (Pages\AdminController::get()) - title/content/keywords/
6
+ * description are the raw per-locale objects (Page's own JSON columns,
7
+ * see the pages_content_to_json migration), unlike the public page-view
8
+ * response (@autobusal/page/types.ts), which is already resolved to one
9
+ * locale's plain string.
10
+ */
1
11
  export interface PageData {
2
12
  id: number
3
13
  name: string
4
- name_en?: string
5
- name_sq?: string
6
14
  internal: string
7
- title_en: string
8
- title_sq: string
9
- content_en: string
10
- content_sq: string
15
+ title: LocalizedText
16
+ content: LocalizedText
17
+ keywords: LocalizedText
18
+ description: LocalizedText
19
+ }
20
+
21
+ /**
22
+ * What Pages\AdminController::update() actually accepts - title/content/
23
+ * keywords/description are each a JSON-STRINGIFIED LocalizedText, not the
24
+ * raw object PageData carries. Matches the wire shape Content/Ai.tsx
25
+ * already uses for its own multi-entry field, and avoids the bracket-
26
+ * notation array fields the BFF proxy can't forward (see the
27
+ * bff-token-field-collision memory).
28
+ */
29
+ export interface PageSaveData {
30
+ name: string
31
+ internal: string
32
+ title: string
11
33
  content: string
12
- keywords_en: string
13
- keywords_sq: string
14
34
  keywords: string
15
- description_en: string
16
- description_sq: string
17
35
  description: string
18
36
  }
19
37