118 lines
4.4 KiB
JSON
118 lines
4.4 KiB
JSON
{
|
|
"name": "@suaveplan/api-tenant",
|
|
"version": "0.1.0",
|
|
"type": "module",
|
|
"sideEffects": false,
|
|
"description": "Multi-tenant resolution + scoping layer for the Suaveplan API. Ships a canonical Tenant type with role/permission helpers, six resolver strategies plus ChainedTenantResolver, a pluggable TenantCache with TTL + negative-entry cache + request coalescing, fail-closed NullTenantContext, a single-context-key Hono middleware (Hono ContextVariableMap augmentation), requirePlugin/requireFeature fail-closed guards, pluggable tenantRateLimit with bounded MemoryRateLimitStore (LRU eviction), TenantAwarePluginDescriptor with tenantScopes opt-out, and opt-in AsyncLocalStorage threading. Server-tier — runs in Bun and Node.",
|
|
"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"
|
|
}
|
|
},
|
|
"./error-codes": {
|
|
"import": {
|
|
"types": "./dist/error-codes/error-codes.d.ts",
|
|
"default": "./dist/error-codes/error-codes.js"
|
|
}
|
|
},
|
|
"./types/tenant": {
|
|
"import": {
|
|
"types": "./dist/types/tenant.d.ts",
|
|
"default": "./dist/types/tenant.js"
|
|
}
|
|
},
|
|
"./resolver": {
|
|
"import": {
|
|
"types": "./dist/resolver/resolver.d.ts",
|
|
"default": "./dist/resolver/resolver.js"
|
|
}
|
|
},
|
|
"./cache": {
|
|
"import": {
|
|
"types": "./dist/cache/cache.d.ts",
|
|
"default": "./dist/cache/cache.js"
|
|
}
|
|
},
|
|
"./context": {
|
|
"import": {
|
|
"types": "./dist/context/context.d.ts",
|
|
"default": "./dist/context/context.js"
|
|
}
|
|
},
|
|
"./middleware": {
|
|
"import": {
|
|
"types": "./dist/middleware/middleware.d.ts",
|
|
"default": "./dist/middleware/middleware.js"
|
|
}
|
|
},
|
|
"./rate-limit": {
|
|
"import": {
|
|
"types": "./dist/rate-limit/rate-limit.d.ts",
|
|
"default": "./dist/rate-limit/rate-limit.js"
|
|
}
|
|
},
|
|
"./lifecycle": {
|
|
"import": {
|
|
"types": "./dist/lifecycle/lifecycle.d.ts",
|
|
"default": "./dist/lifecycle/lifecycle.js"
|
|
}
|
|
},
|
|
"./storage": {
|
|
"import": {
|
|
"types": "./dist/storage/storage.d.ts",
|
|
"default": "./dist/storage/storage.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-plugin": "workspace:^",
|
|
"@suaveplan/error": "workspace:^",
|
|
"@suaveplan/events": "workspace:^",
|
|
"@suaveplan/types": "workspace:^",
|
|
"hono": "catalog:",
|
|
"tslib": "catalog:build",
|
|
"zod": "catalog:forms"
|
|
},
|
|
"devDependencies": {
|
|
"@opentelemetry/sdk-metrics": "1.30.0",
|
|
"@suaveplan/testing": "workspace:^",
|
|
"@types/node": "catalog:",
|
|
"@vitest/coverage-istanbul": "catalog:testing",
|
|
"fast-check": "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"]
|
|
}
|