{"_id":"@axeptio/geo-compliance","_rev":"3-cac5c46cc425e5108c9a8e8786d3e361","name":"@axeptio/geo-compliance","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@axeptio/geo-compliance","version":"0.1.0","keywords":["axeptio","iso-3166","geo","compliance","cookie-banner"],"author":{"name":"Axeptio"},"license":"UNLICENSED","_id":"@axeptio/geo-compliance@0.1.0","maintainers":[{"name":"romainbessuges","email":"romainbessuges@gmail.com"},{"name":"axeptiotech","email":"tech@axeptio.eu"},{"name":"a_ng_d_axeptio","email":"aurelien.grimaud@axeptio.eu"},{"name":"rombat","email":"roro.devweb@gmail.com"},{"name":"pleberre","email":"philippe.leberre@axeptio.eu"},{"name":"luisfl-axeptio","email":"luis.flores.externe@axeptio.eu"},{"name":"javier.costa-axeptio","email":"javier.costa@axeptio.eu"},{"name":"matheuscavinax","email":"matheus.cavinato@axeptio.eu"}],"dist":{"shasum":"cdbda2cd09f5bbec571afa3ef7aee5085576c8eb","tarball":"https://registry.npmjs.org/@axeptio/geo-compliance/-/geo-compliance-0.1.0.tgz","fileCount":44,"integrity":"sha512-nvxqxE/Rv2YddbBGt+v/H/AMiQeovD3cERr3s5ZejAXI0SrLoPaqbkmO7J/0s0xT7rIXDWw0HvEdIBqh3qxEXg==","signatures":[{"sig":"MEUCIQDKUI9YU41p8YtUi1UiUaNghkl2MLXQRr4XxHRTKYPWCAIgNOuSy/iZzVdfhvanG8H6BfomWdwi4lQTijdNI1AeL8w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":231506},"jest":{"preset":"ts-jest","verbose":true,"testMatch":["**/*.node-test.[jt]s?(x)"],"testEnvironment":"node"},"main":"dist/cjs/index.js","types":"dist/types/index.d.ts","module":"dist/esm/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/types/index.d.ts","import":"./dist/esm/index.js","require":"./dist/cjs/index.js"}},"gitHead":"92ce46246615892febe7382ebd14ee5438ae70e4","scripts":{"lint":"tsc --noEmit --project tsconfig.json","test":"jest","build":"yarn build:cjs && yarn build:esm && yarn build:types","clean":"rm -rf dist","format":"prettier --write \"src/**/*.+(ts|json)\" \"test/**/*.+(ts|json)\" \"scripts/**/*.+(mjs|js)\"","prebuild":"node scripts/generate.mjs","build:cjs":"tsc --project tsconfig.cjs.json","build:esm":"tsc --project tsconfig.esm.json","test:jest":"jest","format:fix":"yarn format","regenerate":"node scripts/generate.mjs","build:types":"tsc --project tsconfig.types.json"},"_npmUser":{"name":"romainbessuges","email":"romainbessuges@gmail.com"},"_npmVersion":"10.9.3","description":"ISO 3166-2 validation, country/subdivision group definitions, and CLDR-backed i18n for Axeptio's cookie banner platform. Consumed by caas-api and caas-styleguide. Not consumed by widget-client (the SDK reads pre-computed data published by caas-api).","directories":{},"_nodeVersion":"22.18.0","publishConfig":{"access":"restricted"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.1.0","prettier":"^3.0.0","iso-3166-2":"^1.0.0","typescript":"^5.3.0","@types/jest":"^29.5.0","@types/node":"^20.0.0","cldr-localenames-full":"^45.0.0"},"_npmOperationalInternal":{"tmp":"tmp/geo-compliance_0.1.0_1778658816905_0.4245519825830777","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-05-13T07:53:36.782Z","modified":"2026-09-14T10:07:21.121Z","0.1.0":"2026-05-13T07:53:37.058Z"},"author":{"name":"Axeptio"},"license":"UNLICENSED","keywords":["axeptio","iso-3166","geo","compliance","cookie-banner"],"description":"ISO 3166-2 validation, country/subdivision group definitions, and CLDR-backed i18n for Axeptio's cookie banner platform. Consumed by caas-api and caas-styleguide. Not consumed by widget-client (the SDK reads pre-computed data published by caas-api).","maintainers":[{"email":"romainbessuges@gmail.com","name":"romainbessuges"},{"email":"tech@axeptio.eu","name":"axeptiotech"},{"email":"aurelien.grimaud@axeptio.eu","name":"a_ng_d_axeptio"},{"email":"philippe.leberre@axeptio.eu","name":"pleberre"},{"email":"luis.flores.externe@axeptio.eu","name":"luisfl-axeptio"},{"email":"javier.costa@axeptio.eu","name":"javier.costa-axeptio"},{"email":"matheus.cavinato@axeptio.eu","name":"matheuscavinax"}],"readme":"# @axeptio/geo-compliance\n\nISO 3166-2 validation, country/subdivision group definitions, and CLDR-backed i18n for Axeptio's cookie-banner platform.\n\n## Status\n\n**Wave 1 complete** — all five modules implemented and tested. 248 tests passing; CommonJS + ESM + types all build. Ready to be consumed by caas-api and caas-styleguide once the package is pushed to GitHub and added as a submodule.\n\n## Consumers\n\n- **`caas-api`** (backend, Node): write-path validation, publish-time group expansion and specificity pre-computation, audit script.\n- **`caas-styleguide`** (Admin Console, React/TS): `GeoTargetField` UI controls, validation, localized labels.\n\n**Not consumed by `widget-client`.** The SDK reads pre-computed targets from the published config payload — it doesn't import this package. The SDK keeps its zero-new-dependency posture; bundle-size constraints (loaded on hundreds of thousands of sites) forbid centralizing runtime logic here.\n\n## Modules\n\n| Module | Purpose | Status |\n|---|---|---|\n| `defaults` | Symbolic constants (locale list, viewer-unknown sentinel, placeholders, specificity scores). Each under non-regression test per `in-a-box/CLAUDE.md`. | ✅ 14 tests |\n| `iso31662` | Country + subdivision validation (strict via membership; lenient via regex). | ✅ 66 tests |\n| `groups` | Country groups (EEA_UK_CH, EEA, EU) and subdivision groups (CCPA_STATES). Expansion + nesting precedence. | ✅ 55 tests |\n| `target` | `GeoTarget` discriminated union, `matches`, `specificity`, `projectForPublish`, overlap detection. | ✅ 54 tests |\n| `i18n` | Localized country (CLDR), subdivision (hand-authored for CA/US CCPA + iso-3166-2 fallback), group names (hand-authored). EN/FR/ES/IT/PT. | ✅ 59 tests |\n\n## Build\n\n```bash\nyarn install\nyarn build         # CommonJS + ESM + types\nyarn test          # jest, *.node-test.ts\nyarn lint          # tsc --noEmit\nyarn format:fix    # prettier\n```\n\nThe `prebuild` step runs `scripts/generate.mjs` to regenerate CLDR-derived JSON committed to `src/generated/`.\n\n## Design principles\n\n1. **Strict on write, lenient on read.** Reads of existing data never crash; writes enforce ISO 3166-2 membership. See `in-a-box/CLAUDE.md` \"You may change non-conforming code only during refactoring.\"\n2. **Symbolic defaults.** No magic numbers or string literals scattered through code; every constant lives in `src/defaults.ts` with a non-regression test.\n3. **Greenfield groups, no migration.** Group definitions land in `data/groups.supplemental.json`; existing cookies docs never carried a group, so there's no data to migrate.\n4. **Domain separation.** Geo only. Regulation (`gdpr`, `ccpa`, etc.) lives elsewhere — see the plan's \"Relationship to regulation management\" section.\n\n## Curated groups (MVP)\n\n| Code | Kind | Members | Notes |\n|---|---|---|---|\n| `EU` | country | 27 ISO 3166-1 codes | EU member states. |\n| `EEA` | country | 30 codes | EU + IS, NO, LI. |\n| `EEA_UK_CH` | country | 32 codes | EEA + UK + CH. The Google CMP grouping. |\n| `CCPA_STATES` | subdivision | ISO 3166-2 codes under `US-*` | Membership flagged for legal review. |\n\nCurated nesting precedence: smaller membership wins (EU > EEA > EEA_UK_CH).\n\n## Repository status\n\nStand-alone package. Once published, will be added as a git submodule under `in-a-box/geo-compliance/` following the existing monorepo pattern.\n","readmeFilename":"README.md"}