@meterapp/vehicle-db 2.17.0 → 2.18.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.
@@ -41,6 +41,12 @@ export interface VehicleIdentityAlias extends IdentityScope {
41
41
  kind: "marketing-name" | "regional-name" | "translation" | "abbreviation" | "misspelling";
42
42
  evidenceIds: string[];
43
43
  }
44
+ /** Reviewed brand names only; never a rule to discard vehicle category words. */
45
+ export interface VehicleMakeAlias extends IdentityScope {
46
+ text: string;
47
+ makeId: number;
48
+ evidenceIds: string[];
49
+ }
44
50
  export interface IdentityCatalogLink {
45
51
  identityId: string;
46
52
  year: number;
@@ -76,6 +82,7 @@ export interface IdentityGraph {
76
82
  revision: string;
77
83
  identities: VehicleIdentity[];
78
84
  aliases: VehicleIdentityAlias[];
85
+ makeAliases?: VehicleMakeAlias[];
79
86
  catalogLinks: IdentityCatalogLink[];
80
87
  evidence: IdentityEvidence[];
81
88
  homologation: HomologationIdentity[];
package/dist/resolve.js CHANGED
@@ -46,8 +46,12 @@ function createVehicleResolver(catalog, identities) {
46
46
  year = Number(prefix[1]);
47
47
  text = text.slice(prefix[0].length);
48
48
  }
49
+ const context = { year, market: options.market, yearBasis: options.yearBasis ?? "model-year" };
49
50
  let makeId = options.makeId;
50
- const make = makeNames.find(m => text === m.name || text.startsWith(m.name + " "));
51
+ const make = [...makeNames, ...(identities.makeAliases ?? [])
52
+ .filter(a => (0, identity_1.scopeMatches)(a, context)).map(a => ({ id: a.makeId, name: (0, identity_1.normalizeIdentityText)(a.text) }))]
53
+ .sort((a, b) => b.name.length - a.name.length)
54
+ .find(m => text === m.name || text.startsWith(m.name + " "));
51
55
  if (make && (makeId === undefined || make.id === makeId)) {
52
56
  makeId = make.id;
53
57
  text = text.slice(make.name.length).trim();
@@ -56,7 +60,6 @@ function createVehicleResolver(catalog, identities) {
56
60
  return result("UNKNOWN_MAKE");
57
61
  if (!text)
58
62
  return result("UNKNOWN_MODEL");
59
- const context = { year, market: options.market, yearBasis: options.yearBasis ?? "model-year" };
60
63
  const sourceIndex = options.sourceId === undefined ? undefined : catalog.sources.findIndex(s => s.source_id === options.sourceId);
61
64
  if (sourceIndex === -1)
62
65
  return result("SCOPE_UNVERIFIED");
package/dist/search.js CHANGED
@@ -23,6 +23,11 @@ const MAKE_SEARCH_ALIASES = new Map([
23
23
  ["volkswagen", ["vw"]],
24
24
  // TQ WULING is the official Malaysian brand; retain its published identity.
25
25
  ["tq wuling", ["wuling"]],
26
+ // Reviewed manufacturer brand names; numeric catalog make IDs stay stable.
27
+ // Evidence: data/identity/catalog.json makeAliases (Hero FY2024-25 report,
28
+ // Maruti Suzuki March 2026 sales release). These are lexical candidates only.
29
+ ["hero", ["hero motocorp"]],
30
+ ["maruti", ["maruti suzuki"]],
26
31
  ]);
27
32
  const sourceMaskById = new Map(data_1.default.sources.map((source, index) => [source.source_id, 2 ** index]));
28
33
  const vehicleTypeNameById = new Map(data_1.default.vehicleTypes.map((type) => [type.vehicle_type_id, type.vehicle_type_name]));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meterapp/vehicle-db",
3
- "version": "2.17.0",
3
+ "version": "2.18.0",
4
4
  "description": "Offline international database for cars, motorcycles, trucks, buses, MPVs, and more",
5
5
  "repository": {
6
6
  "type": "git",