From 9c88e788914d3786ceadead2c586fa3687c95d9d Mon Sep 17 00:00:00 2001 From: Andy Johnson Date: Mon, 8 Jun 2026 15:55:30 -0600 Subject: [PATCH 1/2] Sync international street candidate fields --- src/international_street/Candidate.ts | 75 ++++++++++---------- tests/international_street/test_Candidate.ts | 50 ++++++------- 2 files changed, 65 insertions(+), 60 deletions(-) diff --git a/src/international_street/Candidate.ts b/src/international_street/Candidate.ts index 9a9ae304..f1ec0ff5 100644 --- a/src/international_street/Candidate.ts +++ b/src/international_street/Candidate.ts @@ -3,8 +3,7 @@ export interface IntlStreetComponents { superAdministrativeArea: string | undefined; administrativeArea: string | undefined; administrativeAreaIso2: string | undefined; - administrativeAreaShort: string | undefined; - administrativeAreaLong: string | undefined; + attention: string | undefined; subAdministrativeArea: string | undefined; dependentLocality: string | undefined; dependentLocalityName: string | undefined; @@ -18,6 +17,11 @@ export interface IntlStreetComponents { premisePrefixNumber: string | undefined; premiseNumber: string | undefined; premiseType: string | undefined; + shortAddressCode: string | undefined; + subBuildingLeadingType: string | undefined; + subBuildingBlock: string | undefined; + subBuildingDoor: string | undefined; + subBuildingStaircase: string | undefined; thoroughfare: string | undefined; thoroughfarePredirection: string | undefined; thoroughfarePostdirection: string | undefined; @@ -57,8 +61,7 @@ export interface IntlChangesComponents { superAdministrativeArea: string | undefined; administrativeArea: string | undefined; administrativeAreaIso2: string | undefined; - administrativeAreaShort: string | undefined; - administrativeAreaLong: string | undefined; + attention: string | undefined; subAdministrativeArea: string | undefined; dependentLocality: string | undefined; dependentLocalityName: string | undefined; @@ -97,6 +100,11 @@ export interface IntlChangesComponents { postBox: string | undefined; postBoxType: string | undefined; postBoxNumber: string | undefined; + shortAddressCode: string | undefined; + subBuildingLeadingType: string | undefined; + subBuildingBlock: string | undefined; + subBuildingDoor: string | undefined; + subBuildingStaircase: string | undefined; } export interface IntlChanges { @@ -109,10 +117,7 @@ export interface IntlChanges { address6: string | undefined; address7: string | undefined; address8: string | undefined; - address9: string | undefined; - address10: string | undefined; - address11: string | undefined; - address12: string | undefined; + country: string | undefined; components: IntlChangesComponents; } @@ -138,8 +143,7 @@ interface RawIntlStreetRawComponents { super_administrative_area?: string; administrative_area?: string; administrative_area_iso2?: string; - administrative_area_short?: string; - administrative_area_long?: string; + attention?: string; sub_administrative_area?: string; dependent_locality?: string; dependent_locality_name?: string; @@ -153,6 +157,11 @@ interface RawIntlStreetRawComponents { premise_prefix_number?: string; premise_number?: string; premise_type?: string; + short_address_code?: string; + sub_building_leading_type?: string; + sub_building_block?: string; + sub_building_door?: string; + sub_building_staircase?: string; thoroughfare?: string; thoroughfare_predirection?: string; thoroughfare_postdirection?: string; @@ -197,10 +206,7 @@ interface RawIntlChanges { address6?: string; address7?: string; address8?: string; - address9?: string; - address10?: string; - address11?: string; - address12?: string; + country?: string; components?: RawIntlStreetRawComponents; } @@ -231,10 +237,6 @@ export interface RawIntlStreetCandidate { address6?: string; address7?: string; address8?: string; - address9?: string; - address10?: string; - address11?: string; - address12?: string; components?: RawIntlStreetRawComponents; analysis?: RawIntlStreetAnalysis; metadata?: RawIntlStreetMetadata; @@ -250,10 +252,6 @@ export default class Candidate { address6: string; address7: string; address8: string; - address9: string; - address10: string; - address11: string; - address12: string; components: IntlStreetComponents; analysis: IntlStreetAnalysis; metadata: IntlStreetMetadata; @@ -268,10 +266,6 @@ export default class Candidate { this.address6 = responseData.address6 ?? ""; this.address7 = responseData.address7 ?? ""; this.address8 = responseData.address8 ?? ""; - this.address9 = responseData.address9 ?? ""; - this.address10 = responseData.address10 ?? ""; - this.address11 = responseData.address11 ?? ""; - this.address12 = responseData.address12 ?? ""; this.components = {} as IntlStreetComponents; if (responseData.components !== undefined) { @@ -279,8 +273,7 @@ export default class Candidate { this.components.superAdministrativeArea = responseData.components.super_administrative_area; this.components.administrativeArea = responseData.components.administrative_area; this.components.administrativeAreaIso2 = responseData.components.administrative_area_iso2; - this.components.administrativeAreaShort = responseData.components.administrative_area_short; - this.components.administrativeAreaLong = responseData.components.administrative_area_long; + this.components.attention = responseData.components.attention; this.components.subAdministrativeArea = responseData.components.sub_administrative_area; this.components.dependentLocality = responseData.components.dependent_locality; this.components.dependentLocalityName = responseData.components.dependent_locality_name; @@ -294,6 +287,11 @@ export default class Candidate { this.components.premisePrefixNumber = responseData.components.premise_prefix_number; this.components.premiseNumber = responseData.components.premise_number; this.components.premiseType = responseData.components.premise_type; + this.components.shortAddressCode = responseData.components.short_address_code; + this.components.subBuildingLeadingType = responseData.components.sub_building_leading_type; + this.components.subBuildingBlock = responseData.components.sub_building_block; + this.components.subBuildingDoor = responseData.components.sub_building_door; + this.components.subBuildingStaircase = responseData.components.sub_building_staircase; this.components.thoroughfare = responseData.components.thoroughfare; this.components.thoroughfarePredirection = responseData.components.thoroughfare_predirection; this.components.thoroughfarePostdirection = @@ -352,10 +350,7 @@ export default class Candidate { this.analysis.changes.address6 = responseData.analysis.changes.address6; this.analysis.changes.address7 = responseData.analysis.changes.address7; this.analysis.changes.address8 = responseData.analysis.changes.address8; - this.analysis.changes.address9 = responseData.analysis.changes.address9; - this.analysis.changes.address10 = responseData.analysis.changes.address10; - this.analysis.changes.address11 = responseData.analysis.changes.address11; - this.analysis.changes.address12 = responseData.analysis.changes.address12; + this.analysis.changes.country = responseData.analysis.changes.country; this.analysis.changes.components = {} as IntlChangesComponents; if (responseData.analysis.changes.components !== undefined) { @@ -367,10 +362,8 @@ export default class Candidate { responseData.analysis.changes.components.administrative_area; this.analysis.changes.components.administrativeAreaIso2 = responseData.analysis.changes.components.administrative_area_iso2; - this.analysis.changes.components.administrativeAreaShort = - responseData.analysis.changes.components.administrative_area_short; - this.analysis.changes.components.administrativeAreaLong = - responseData.analysis.changes.components.administrative_area_long; + this.analysis.changes.components.attention = + responseData.analysis.changes.components.attention; this.analysis.changes.components.subAdministrativeArea = responseData.analysis.changes.components.sub_administrative_area; this.analysis.changes.components.dependentLocality = @@ -397,6 +390,16 @@ export default class Candidate { responseData.analysis.changes.components.premise_number; this.analysis.changes.components.premiseType = responseData.analysis.changes.components.premise_type; + this.analysis.changes.components.shortAddressCode = + responseData.analysis.changes.components.short_address_code; + this.analysis.changes.components.subBuildingLeadingType = + responseData.analysis.changes.components.sub_building_leading_type; + this.analysis.changes.components.subBuildingBlock = + responseData.analysis.changes.components.sub_building_block; + this.analysis.changes.components.subBuildingDoor = + responseData.analysis.changes.components.sub_building_door; + this.analysis.changes.components.subBuildingStaircase = + responseData.analysis.changes.components.sub_building_staircase; this.analysis.changes.components.thoroughfare = responseData.analysis.changes.components.thoroughfare; this.analysis.changes.components.thoroughfarePredirection = diff --git a/tests/international_street/test_Candidate.ts b/tests/international_street/test_Candidate.ts index 18ce2428..cee8a9c6 100644 --- a/tests/international_street/test_Candidate.ts +++ b/tests/international_street/test_Candidate.ts @@ -13,17 +13,12 @@ describe("An International match candidate", function () { address6: "7", address7: "8", address8: "9", - address9: "10", - address10: "11", - address11: "12", - address12: "13", components: { country_iso_3: "14", super_administrative_area: "15", administrative_area: "16", administrative_area_iso2: "16.1", - administrative_area_short: "16.2", - administrative_area_long: "16.3", + attention: "119", sub_administrative_area: "17", dependent_locality: "18", dependent_locality_name: "19", @@ -37,6 +32,11 @@ describe("An International match candidate", function () { premise_prefix_number: "26.5", premise_number: "27", premise_type: "28", + short_address_code: "120", + sub_building_leading_type: "121", + sub_building_block: "122", + sub_building_door: "123", + sub_building_staircase: "124", thoroughfare: "29", thoroughfare_predirection: "30", thoroughfare_postdirection: "31", @@ -86,16 +86,12 @@ describe("An International match candidate", function () { address6: "66", address7: "67", address8: "68", - address9: "69", - address10: "70", - address11: "71", - address12: "72", + country: "125", components: { country_iso_3: "73", super_administrative_area: "74", administrative_area: "75", - administrative_area_short: "75.1", - administrative_area_long: "75.2", + attention: "126", sub_administrative_area: "76", dependent_locality: "77", dependent_locality_name: "78", @@ -109,6 +105,11 @@ describe("An International match candidate", function () { premise_prefix_number: "86", premise_number: "87", premise_type: "88", + short_address_code: "127", + sub_building_leading_type: "128", + sub_building_block: "129", + sub_building_door: "130", + sub_building_staircase: "131", thoroughfare: "89", thoroughfare_predirection: "90", thoroughfare_postdirection: "91", @@ -150,17 +151,12 @@ describe("An International match candidate", function () { expect(candidate.address6).to.equal("7"); expect(candidate.address7).to.equal("8"); expect(candidate.address8).to.equal("9"); - expect(candidate.address9).to.equal("10"); - expect(candidate.address10).to.equal("11"); - expect(candidate.address11).to.equal("12"); - expect(candidate.address12).to.equal("13"); let components = candidate.components; expect(components.countryIso3).to.equal("14"); expect(components.superAdministrativeArea).to.equal("15"); expect(components.administrativeArea).to.equal("16"); expect(components.administrativeAreaIso2).to.equal("16.1"); - expect(components.administrativeAreaShort).to.equal("16.2"); - expect(components.administrativeAreaLong).to.equal("16.3"); + expect(components.attention).to.equal("119"); expect(components.subAdministrativeArea).to.equal("17"); expect(components.dependentLocality).to.equal("18"); expect(components.dependentLocalityName).to.equal("19"); @@ -174,6 +170,11 @@ describe("An International match candidate", function () { expect(components.premisePrefixNumber).to.equal("26.5"); expect(components.premiseNumber).to.equal("27"); expect(components.premiseType).to.equal("28"); + expect(components.shortAddressCode).to.equal("120"); + expect(components.subBuildingLeadingType).to.equal("121"); + expect(components.subBuildingBlock).to.equal("122"); + expect(components.subBuildingDoor).to.equal("123"); + expect(components.subBuildingStaircase).to.equal("124"); expect(components.thoroughfare).to.equal("29"); expect(components.thoroughfarePredirection).to.equal("30"); expect(components.thoroughfarePostdirection).to.equal("31"); @@ -221,16 +222,12 @@ describe("An International match candidate", function () { expect(changes.address6).to.equal("66"); expect(changes.address7).to.equal("67"); expect(changes.address8).to.equal("68"); - expect(changes.address9).to.equal("69"); - expect(changes.address10).to.equal("70"); - expect(changes.address11).to.equal("71"); - expect(changes.address12).to.equal("72"); + expect(changes.country).to.equal("125"); let ccomponents = changes.components; expect(ccomponents.countryIso3).to.equal("73"); expect(ccomponents.superAdministrativeArea).to.equal("74"); expect(ccomponents.administrativeArea).to.equal("75"); - expect(ccomponents.administrativeAreaShort).to.equal("75.1"); - expect(ccomponents.administrativeAreaLong).to.equal("75.2"); + expect(ccomponents.attention).to.equal("126"); expect(ccomponents.subAdministrativeArea).to.equal("76"); expect(ccomponents.dependentLocality).to.equal("77"); expect(ccomponents.dependentLocalityName).to.equal("78"); @@ -244,6 +241,11 @@ describe("An International match candidate", function () { expect(ccomponents.premisePrefixNumber).to.equal("86"); expect(ccomponents.premiseNumber).to.equal("87"); expect(ccomponents.premiseType).to.equal("88"); + expect(ccomponents.shortAddressCode).to.equal("127"); + expect(ccomponents.subBuildingLeadingType).to.equal("128"); + expect(ccomponents.subBuildingBlock).to.equal("129"); + expect(ccomponents.subBuildingDoor).to.equal("130"); + expect(ccomponents.subBuildingStaircase).to.equal("131"); expect(ccomponents.thoroughfare).to.equal("89"); expect(ccomponents.thoroughfarePredirection).to.equal("90"); expect(ccomponents.thoroughfarePostdirection).to.equal("91"); From 0f2c6c7afccbf5d9bf62371465af6abd4da551f8 Mon Sep 17 00:00:00 2001 From: Andy Johnson Date: Tue, 9 Jun 2026 11:51:55 -0600 Subject: [PATCH 2/2] Remove country field from international street Changes object --- src/international_street/Candidate.ts | 3 --- tests/international_street/test_Candidate.ts | 2 -- 2 files changed, 5 deletions(-) diff --git a/src/international_street/Candidate.ts b/src/international_street/Candidate.ts index f1ec0ff5..11f4ad4e 100644 --- a/src/international_street/Candidate.ts +++ b/src/international_street/Candidate.ts @@ -117,7 +117,6 @@ export interface IntlChanges { address6: string | undefined; address7: string | undefined; address8: string | undefined; - country: string | undefined; components: IntlChangesComponents; } @@ -206,7 +205,6 @@ interface RawIntlChanges { address6?: string; address7?: string; address8?: string; - country?: string; components?: RawIntlStreetRawComponents; } @@ -350,7 +348,6 @@ export default class Candidate { this.analysis.changes.address6 = responseData.analysis.changes.address6; this.analysis.changes.address7 = responseData.analysis.changes.address7; this.analysis.changes.address8 = responseData.analysis.changes.address8; - this.analysis.changes.country = responseData.analysis.changes.country; this.analysis.changes.components = {} as IntlChangesComponents; if (responseData.analysis.changes.components !== undefined) { diff --git a/tests/international_street/test_Candidate.ts b/tests/international_street/test_Candidate.ts index cee8a9c6..097263ef 100644 --- a/tests/international_street/test_Candidate.ts +++ b/tests/international_street/test_Candidate.ts @@ -86,7 +86,6 @@ describe("An International match candidate", function () { address6: "66", address7: "67", address8: "68", - country: "125", components: { country_iso_3: "73", super_administrative_area: "74", @@ -222,7 +221,6 @@ describe("An International match candidate", function () { expect(changes.address6).to.equal("66"); expect(changes.address7).to.equal("67"); expect(changes.address8).to.equal("68"); - expect(changes.country).to.equal("125"); let ccomponents = changes.components; expect(ccomponents.countryIso3).to.equal("73"); expect(ccomponents.superAdministrativeArea).to.equal("74");