mirror of
https://github.com/koala73/worldmonitor.git
synced 2026-04-25 17:14:57 +02:00
* fix(trade): expand tariff coverage from 15 to 130+ countries MAJOR_REPORTERS (15 countries) replaced with ALL_REPORTERS (130+ WTO members). Tariffs, trade restrictions, and barriers now seeded for every WTO member economy, not just the original 15. WTO API calls batched in groups of 30 to avoid URL length limits while keeping total request count under 5. Added shared/un-to-iso2.json (239 entries) for UN M49 to ISO2 mapping used by the cache key builder. Removed hardcoded WTO_MEMBER_CODES lookup; uses WTO API response field ReportingEconomy for country names instead. * fix(trade): ESM-compatible file loading + fix row scope in buildFlowRecords 1. Replace require()/CJS __dirname with ESM imports (readFileSync, dirname, fileURLToPath). The .mjs module can't use require(), so un-to-iso2.json was never loaded and REPORTER_ISO2 fell back to the 20-country hardcoded subset. 2. Fix ReferenceError in buildFlowRecords: row.ReportingEconomy was accessed outside the for-of loop scope. Extract reporter/partner names during row iteration and use them in the map callback. 3. Add reporterName/partnerName to parseFlowRows output so buildFlowRecords has access to WTO economy names. * fix(trade): load ALL 239 reporters from un-to-iso2.json, remove caps 1. ALL_REPORTERS now derived from Object.keys(un-to-iso2.json) at startup: 239 economies, no manual list to maintain. Covers NZ, Jamaica, Dominican Republic, Panama, and every other country. 2. Removed .slice(0, 50) caps on trade barriers and restrictions so all reporter data is published. 3. Cleaned up duplicate ESM imports; single __dirname derivation. * fix(trade): batch WTO barriers/restrictions in groups of 30 The WTO API returns HTTP 400 when all 239 reporter codes are passed in a single r= parameter. Barriers and restrictions now batch in groups of 30 with 1s delay between batches, matching the tariff trends pattern. Also removed stale duplicate variable declarations. * fix: add un-to-iso2.json to scripts/shared (sync test) * fix(trade): fetch WTO reporter list from API instead of UN codes The WTO API has its own reporter code system (288 economies) that doesn't match UN M49 1:1. Sending un-to-iso2.json codes caused HTTP 400 on 7/8 batches. Now fetches /v1/reporters at startup to get the exact set of codes the API accepts. Falls back to un-to-iso2.json if the reporter endpoint fails. * fix(trade): compute REPORTER_ISO2 lazily after fetchWtoReporters() REPORTER_ISO2 was computed at module load when ALL_REPORTERS was still []. Changed to getReporterIso2() function that evaluates after ALL_REPORTERS is populated by fetchWtoReporters().
241 lines
3.5 KiB
JSON
241 lines
3.5 KiB
JSON
{
|
|
"004": "AF",
|
|
"008": "AL",
|
|
"010": "AQ",
|
|
"012": "DZ",
|
|
"016": "AS",
|
|
"020": "AD",
|
|
"024": "AO",
|
|
"028": "AG",
|
|
"031": "AZ",
|
|
"032": "AR",
|
|
"036": "AU",
|
|
"040": "AT",
|
|
"044": "BS",
|
|
"048": "BH",
|
|
"050": "BD",
|
|
"051": "AM",
|
|
"052": "BB",
|
|
"056": "BE",
|
|
"060": "BM",
|
|
"064": "BT",
|
|
"068": "BO",
|
|
"070": "BA",
|
|
"072": "BW",
|
|
"076": "BR",
|
|
"084": "BZ",
|
|
"086": "IO",
|
|
"090": "SB",
|
|
"092": "VG",
|
|
"096": "BN",
|
|
"100": "BG",
|
|
"104": "MM",
|
|
"108": "BI",
|
|
"112": "BY",
|
|
"116": "KH",
|
|
"120": "CM",
|
|
"124": "CA",
|
|
"132": "CV",
|
|
"136": "KY",
|
|
"140": "CF",
|
|
"144": "LK",
|
|
"148": "TD",
|
|
"152": "CL",
|
|
"156": "CN",
|
|
"158": "TW",
|
|
"170": "CO",
|
|
"174": "KM",
|
|
"178": "CG",
|
|
"180": "CD",
|
|
"184": "CK",
|
|
"188": "CR",
|
|
"191": "HR",
|
|
"192": "CU",
|
|
"196": "CY",
|
|
"203": "CZ",
|
|
"204": "BJ",
|
|
"208": "DK",
|
|
"212": "DM",
|
|
"214": "DO",
|
|
"218": "EC",
|
|
"222": "SV",
|
|
"226": "GQ",
|
|
"231": "ET",
|
|
"232": "ER",
|
|
"233": "EE",
|
|
"234": "FO",
|
|
"238": "FK",
|
|
"239": "GS",
|
|
"242": "FJ",
|
|
"246": "FI",
|
|
"248": "AX",
|
|
"250": "FR",
|
|
"258": "PF",
|
|
"260": "TF",
|
|
"262": "DJ",
|
|
"266": "GA",
|
|
"268": "GE",
|
|
"270": "GM",
|
|
"275": "PS",
|
|
"276": "DE",
|
|
"288": "GH",
|
|
"292": "GI",
|
|
"296": "KI",
|
|
"300": "GR",
|
|
"304": "GL",
|
|
"308": "GD",
|
|
"316": "GU",
|
|
"320": "GT",
|
|
"324": "GN",
|
|
"328": "GY",
|
|
"332": "HT",
|
|
"334": "HM",
|
|
"336": "VA",
|
|
"340": "HN",
|
|
"344": "HK",
|
|
"348": "HU",
|
|
"352": "IS",
|
|
"356": "IN",
|
|
"360": "ID",
|
|
"364": "IR",
|
|
"368": "IQ",
|
|
"372": "IE",
|
|
"376": "IL",
|
|
"380": "IT",
|
|
"384": "CI",
|
|
"388": "JM",
|
|
"392": "JP",
|
|
"398": "KZ",
|
|
"400": "JO",
|
|
"404": "KE",
|
|
"408": "KP",
|
|
"410": "KR",
|
|
"412": "XK",
|
|
"414": "KW",
|
|
"417": "KG",
|
|
"418": "LA",
|
|
"422": "LB",
|
|
"426": "LS",
|
|
"428": "LV",
|
|
"430": "LR",
|
|
"434": "LY",
|
|
"438": "LI",
|
|
"440": "LT",
|
|
"442": "LU",
|
|
"446": "MO",
|
|
"450": "MG",
|
|
"454": "MW",
|
|
"458": "MY",
|
|
"462": "MV",
|
|
"466": "ML",
|
|
"470": "MT",
|
|
"478": "MR",
|
|
"480": "MU",
|
|
"484": "MX",
|
|
"492": "MC",
|
|
"496": "MN",
|
|
"498": "MD",
|
|
"499": "ME",
|
|
"500": "MS",
|
|
"504": "MA",
|
|
"508": "MZ",
|
|
"512": "OM",
|
|
"516": "NA",
|
|
"520": "NR",
|
|
"524": "NP",
|
|
"528": "NL",
|
|
"531": "CW",
|
|
"533": "AW",
|
|
"534": "SX",
|
|
"540": "NC",
|
|
"548": "VU",
|
|
"554": "NZ",
|
|
"558": "NI",
|
|
"562": "NE",
|
|
"566": "NG",
|
|
"570": "NU",
|
|
"574": "NF",
|
|
"578": "NO",
|
|
"580": "MP",
|
|
"581": "UM",
|
|
"583": "FM",
|
|
"584": "MH",
|
|
"585": "PW",
|
|
"586": "PK",
|
|
"591": "PA",
|
|
"598": "PG",
|
|
"600": "PY",
|
|
"604": "PE",
|
|
"608": "PH",
|
|
"612": "PN",
|
|
"616": "PL",
|
|
"620": "PT",
|
|
"624": "GW",
|
|
"626": "TL",
|
|
"630": "PR",
|
|
"634": "QA",
|
|
"642": "RO",
|
|
"643": "RU",
|
|
"646": "RW",
|
|
"652": "BL",
|
|
"654": "SH",
|
|
"659": "KN",
|
|
"660": "AI",
|
|
"662": "LC",
|
|
"663": "MF",
|
|
"666": "PM",
|
|
"670": "VC",
|
|
"674": "SM",
|
|
"678": "ST",
|
|
"682": "SA",
|
|
"686": "SN",
|
|
"688": "RS",
|
|
"690": "SC",
|
|
"694": "SL",
|
|
"702": "SG",
|
|
"703": "SK",
|
|
"704": "VN",
|
|
"705": "SI",
|
|
"706": "SO",
|
|
"710": "ZA",
|
|
"716": "ZW",
|
|
"724": "ES",
|
|
"728": "SS",
|
|
"729": "SD",
|
|
"732": "EH",
|
|
"740": "SR",
|
|
"748": "SZ",
|
|
"752": "SE",
|
|
"756": "CH",
|
|
"760": "SY",
|
|
"762": "TJ",
|
|
"764": "TH",
|
|
"768": "TG",
|
|
"776": "TO",
|
|
"780": "TT",
|
|
"784": "AE",
|
|
"788": "TN",
|
|
"792": "TR",
|
|
"795": "TM",
|
|
"796": "TC",
|
|
"798": "TV",
|
|
"800": "UG",
|
|
"804": "UA",
|
|
"807": "MK",
|
|
"818": "EG",
|
|
"826": "GB",
|
|
"831": "GG",
|
|
"832": "JE",
|
|
"833": "IM",
|
|
"834": "TZ",
|
|
"840": "US",
|
|
"850": "VI",
|
|
"854": "BF",
|
|
"858": "UY",
|
|
"860": "UZ",
|
|
"862": "VE",
|
|
"876": "WF",
|
|
"882": "WS",
|
|
"887": "YE",
|
|
"894": "ZM"
|
|
} |