@xemahq/space-resolver-nest
v0.1.1
Published
Shared NestJS wrapper over the generated @xemahq/space-registry-api-client. Provides an injectable SpaceResolverService with a per-process TTL cache for effective-classification + ancestor resolution, plus a turn-key SpaceResolverModule.forRootAsync. Cons
Downloads
1,654
Readme
@xemahq/space-resolver-nest
NestJS resolver for a Space's effective data classification.
Overview
A NestJS wrapper over the generated @xemahq/space-registry-api-client that
exposes an injectable resolver for a Space's effective data classification and
ancestor chain. It adds a per-process TTL cache so repeated resolutions within
a request window avoid redundant calls, and a turn-key module that wires the
underlying client with the consumer's auth-token callback. Services resolve a
Space's classification at request time without duplicating client setup.
When to use it
- Use it when a service must resolve a Space's effective data classification or ancestors at request time.
- Reach for it instead of wiring the space-registry client and a cache by hand in every consumer.
Installation
pnpm add @xemahq/space-resolver-nestUsage
import { SpaceResolverModule } from '@xemahq/space-resolver-nest';
@Module({
imports: [
SpaceResolverModule.forRootAsync({
inject: [ConfigService, TokenService],
useFactory: (config, tokens) => ({
spaceRegistryApiUrl: config.getOrThrow('SPACE_REGISTRY_API_URL'),
getAuthToken: () => tokens.getAccessToken(),
}),
}),
],
})
export class AppModule {}Peer requirements
@nestjs/common,@nestjs/config— host framework and configuration.reflect-metadata— decorator metadata runtime.
License
Apache-2.0 © Xema — xema.dev
