🚀 Identity Feature Blocks
Identity feature blocks provide complete, pre-composed functionality for identity management operations in NodeBlocks applications. These features combine schemas and routes to create ready-to-use API endpoints with proper validation, authentication, and error handling.
🎯 Overview
Identity feature blocks are designed to:
- Provide complete API endpoints for identity management operations
- Combine schemas with routes for validated operations
- Include authentication and authorization checks automatically
- Support functional composition patterns
- Handle logging and error management seamlessly
📋 Feature Structure
Each identity feature follows a consistent composition pattern:
- Schema: Validates input data and parameters
- Route: Provides HTTP endpoint with blocks
- Composition: Combines schema and route using
compose
function
🔧 Available Identity Features
getIdentityFeatures
Identity retrieval feature with schema validation and routing.
Purpose: Fetches identity data with proper authorization
Composition:
- Schema:
getIdentitySchema
- validates identity ID parameter - Route:
getIdentityRoute
- GET/identities/:identityId
with retrieval handler
Usage:
import { features } from '@nodeblocks/backend-sdk';
// With database configuration
app.use('/api', defService(partial(features.getIdentityFeatures, [{ dataStores: db }])));
API Endpoint: GET /api/identities/:identityId
findIdentitiesFeatures
Identity listing feature with schema validation and routing.
Purpose: Provides identity listing with search capabilities
Composition:
- Schema:
findIdentitySchema
- validates query parameters for filtering - Route:
findIdentitiesRoute
- GET/identities
with search and pagination
Usage:
import { features } from '@nodeblocks/backend-sdk';
// With database configuration
app.use('/api', defService(partial(features.findIdentitiesFeatures, [{ dataStores: db }])));
API Endpoint: GET /api/identities
updateIdentityFeatures
Identity update feature with schema validation and routing.
Purpose: Modifies identity data with proper authorization
Composition:
- Schema:
updateIdentitySchema
- validates identity update data - Route:
updateIdentityRoute
- PATCH/identities/:identityId
with update handler
Usage:
import { features } from '@nodeblocks/backend-sdk';
// With database configuration
app.use('/api', defService(partial(features.updateIdentityFeatures, [{ dataStores: db }])));
API Endpoint: PATCH /api/identities/:identityId
deleteIdentityFeatures
Identity deletion feature with schema validation and routing.
Purpose: Removes identities with access control
Composition:
- Schema:
deleteIdentitySchema
- validates identity ID parameter - Route:
deleteIdentityRoute
- DELETE/identities/:identityId
with deletion handler
Usage:
import { features } from '@nodeblocks/backend-sdk';
// With database configuration
app.use('/api', defService(partial(features.deleteIdentityFeatures, [{ dataStores: db }])));
API Endpoint: DELETE /api/identities/:identityId
🔗 Related Documentation
- Identity Schema Blocks - Identity data validation and contracts
- Identity Blocks - Identity business logic functions
- Identity Route Blocks - HTTP endpoint definitions