{ "name": "@suaveplan/api-tenant-resolver-subdomain", "version": "0.1.0", "type": "module", "sideEffects": false, "description": "Stage-8 tenant resolver for the Suaveplan API plugin foundation. Extracts the tenant slug from the request hostname (subdomain) — e.g. `acme.api.example.com` → tenant `acme` — strips a configured `baseDomain`, validates the remaining label, and returns a `TenantContext`. Multi-label support via `tenantLabelIndex` (default 0). `X-Forwarded-Host` is honoured only when `trustForwardedHost: true` AND the upstream IP matches `trustedProxyCidrs`; otherwise strict mode raises `TENANT_SUBDOMAIN_FORWARDED_HOST_UNTRUSTED`. Optional tenant `registry` callback for slug → id mapping. Strict-mode (`strict: true`) raises stable `TENANT_SUBDOMAIN_*` codes on every invalid path; non-strict returns `null` to advance the resolver chain.", "license": "MIT", "author": "Suaveplan Team", "main": "./dist/index.js", "module": "./dist/index.js", "types": "./dist/index.d.ts", "exports": { "./package.json": "./package.json", ".": { "import": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }, "require": { "types": "./dist/index.d.ts", "default": "./dist/index.js" } }, "./resolver": { "import": { "types": "./dist/resolver/resolver.d.ts", "default": "./dist/resolver/resolver.js" } }, "./forwarded": { "import": { "types": "./dist/forwarded/forwarded.d.ts", "default": "./dist/forwarded/forwarded.js" } }, "./validate": { "import": { "types": "./dist/validate/validate.d.ts", "default": "./dist/validate/validate.js" } }, "./options": { "import": { "types": "./dist/options/options.d.ts", "default": "./dist/options/options.js" } }, "./error-codes": { "import": { "types": "./dist/error-codes/error-codes.d.ts", "default": "./dist/error-codes/error-codes.js" } }, "./otel": { "import": { "types": "./dist/otel/instruments.d.ts", "default": "./dist/otel/instruments.js" } } }, "scripts": { "build": "vite build", "test": "vitest run --passWithNoTests", "test:watch": "vitest", "test:coverage": "vitest run --coverage --passWithNoTests", "lint": "bunx biome check src/", "lint:fix": "bunx biome lint --fix --unsafe --max-diagnostics 500 src/", "format": "bunx biome format --write --max-diagnostics 500 src/", "check": "bunx biome check --write --unsafe --max-diagnostics 500 src/", "typecheck": "bunx tsc --noEmit --composite false -p tsconfig.lib.json", "docs:check": "bun run ../../../../scripts/docs-check.ts ." }, "dependencies": { "@opentelemetry/api": "catalog:observability", "@suaveplan/api-types": "workspace:^", "@suaveplan/error": "workspace:^", "tslib": "catalog:build", "zod": "catalog:forms" }, "devDependencies": { "@opentelemetry/sdk-metrics": "1.30.0", "@suaveplan/testing": "workspace:^", "@types/node": "catalog:", "@vitest/coverage-istanbul": "catalog:testing", "typescript": "catalog:", "vite": "catalog:build", "vite-plugin-dts": "catalog:build", "vitest": "catalog:testing" }, "publishConfig": { "registry": "https://npmjs.fq.io/", "access": "public" }, "files": ["dist", "src", "README.md"] }