メインコンテンツまでスキップ
バージョン: 🚧 Canary

🚀 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:

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:

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:

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:

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