bluefly/api_normalizer
最新稳定版本:0.1.2
Composer 安装命令:
composer require bluefly/api_normalizer
包简介
API standardization and normalization layer for multi-provider AI services
关键字:
README 文档
README
"navtitle": "api_normalizer" "shortdesc": "Part of the LLM Platform ecosystem" "source": "Last updated: 2025-08-01"
"outputclass": "concept"
API Normalizer - NO BULLSHIT
What it actually does: Smart API routing and provider management with real business logic.
- Multi-provider API normalization (OpenAI, Anthropic, Ollama) with consistent response format
- Automatic provider detection and capability analysis
- Rate limiting, cost optimization, and failover management
- Schema validation and OpenAPI integration with auto-documentation
- Performance monitoring and intelligent routing decisions
- Real API management, not configuration wrappers
Features {#topic-features-2}
- Enterprise-grade architecture
- Comprehensive test coverage
- Security hardened
- Accessibility compliant (WCAG AA)
- Performance optimized
- Full API documentation
- GraphQL integration (merged from graphql_integration)
- AI-powered schema mapping
- OpenAPI schema management
Repository Information {#topic-repository-information-3}
- Type: Drupal Module (Git Submodule)
- GitLab URL: https://gitlab.bluefly.io/llm/api_normalizer
- Submodule Path: web/modules/custom/api_normalizer
- Local Path: ${LLM_WORKSPACE_PATH:-../../../}llm-platform/web/modules/custom/api_normalizer
Integration Steps {#topic-integration-steps-4}
Navigate to Individual Repository
# This module is a git submodule, work in its individual repo cd /path/to/individual/api_normalizer/repositoryCopy OpenAPI Specification
cp openapi.yaml ./Create Contract Testing Structure
mkdir -p tests/src/Functional mkdir -p tests/featuresAdd PHPUnit Configuration
<!-- phpunit.xml --> <testsuite name="api_normalizer API Contract Tests"> <directory>tests/src/Functional</directory> <file>tests/src/Functional/*ApiContractTest.php</file> </testsuite>Configure JSON:API Entities
# JSON:API is built into Drupal 10 core, just needs configuration drush en rest restui serialization hal -y drush crUpdate GitLab CI
include: - component: gitlab.bluefly.io/llm/gitlab_components/components/ci-cd/drupal/template@latest - component: gitlab.bluefly.io/llm/gitlab_components/components/testing/comprehensive-testing@latest drupal_api_validation: extends: .drupal_base script: - drush en rest restui serialization hal -y - drush cr - vendor/bin/phpunit tests/src/Functional/*ApiContractTest.phpCommit Changes
git add . git commit -m "feat: implement API-first architecture for Drupal module - Add OpenAPI 3.1 specification with JSON:API endpoints - Implement PHPUnit contract tests - Configure REST and JSON:API endpoints - Enable API-first development workflow 🤖 Generated with API-First Transformation Co-Authored-By: Claude <noreply@anthropic.com>" git push origin main
JSON:API Endpoints {#topic-json-api-endpoints-5}
- Entities: /jsonapi/api_normalizer/api_normalizer
- Custom API: /api/v1/api_normalizer/*
- Health Check: /api/v1/api_normalizer/health
Production Deployment {#topic-production-deployment-6}
- Main Platform: https://llm.llm.bluefly.io/api/v1/api_normalizer
- JSON:API: https://llm.llm.bluefly.io/jsonapi/api_normalizer
- Documentation: https://docs.llm.bluefly.io/api-docs/api_normalizer
Local Development {#topic-local-development-7}
- Main Platform: https://llm.local.bluefly.io/api/v1/api_normalizer
- JSON:API: https://llm.local.bluefly.io/jsonapi/api_normalizer
- Port Access: http://llm.local.bluefly.io:33000/api/v1/api_normalizer
API-First TDD Development Workflow {#topic-api-first-tdd-development-workflow-8}
This module follows the LLM Platform's API-first, test-driven development approach using TDDAI.
Development Commands {#topic-development-commands-9}
# Comprehensive Drupal module analysis (includes UI/UX assessment)
cd web/modules/custom/api_normalizer
node ${LLM_COMMON_NPM_PATH:-../../common_npm}/tddai/dist/cli.js drupal audit . --comprehensive \
--analyze-ui-components \
--check-entity-definitions \
--review-views-displays \
--assess-admin-interfaces \
--identify-missing-frontend \
--create-ux-improvement-plan
# Alternative: Use analyze command with Drupal-specific prompts
node ${LLM_COMMON_NPM_PATH:-../../common_npm}/tddai/dist/cli.js analyze . --context drupal-contrib \
--prompts "ui-components,entity-configs,views-displays,admin-forms,frontend-gaps,ux-plan"
# Start TDD cycle for this module
node ${LLM_COMMON_NPM_PATH:-../../common_npm}/tddai/dist/cli.js tdd cycle --context drupal-module
# Write failing tests first (RED)
node ${LLM_COMMON_NPM_PATH:-../../common_npm}/tddai/dist/cli.js test-gen --module api_normalizer
../../../vendor/bin/phpunit tests/src/Unit/
# Implement minimal code (GREEN)
node ${LLM_COMMON_NPM_PATH:-../../common_npm}/tddai/dist/cli.js generate service <ServiceName> --module api_normalizer --tdd
# Refactor and optimize (REFACTOR)
node ${LLM_COMMON_NPM_PATH:-../../common_npm}/tddai/dist/cli.js improve fix --all --module api_normalizer
# Full contrib-ready assessment (all quality gates)
node ${LLM_COMMON_NPM_PATH:-../../common_npm}/tddai/dist/cli.js drupal ultra-strict . \
--contrib-ready \
--ui-analysis \
--performance-check \
--accessibility-audit
# Standards and quality checks
../../../vendor/bin/phpcs --standard=Drupal,DrupalPractice src/
../../../vendor/bin/phpstan analyse src/
API Standards {#topic-api-standards-10}
- ✅ REST API endpoints with OpenAPI 3.1 specification
- ✅ GraphQL schema extensions where applicable
- ✅ 95% test coverage requirement
- ✅ Drupal 10/11 best practices compliance
- ✅ Service-based architecture with dependency injection
See main project README for complete workflow documentation.
bluefly/api_normalizer 适用场景与选型建议
bluefly/api_normalizer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 100 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 07 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「drupal」 「ai」 「api development」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bluefly/api_normalizer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bluefly/api_normalizer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bluefly/api_normalizer 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Provides an add-on purchasable entity.
Debugging a problem and need to login as one of your customers? This allows you to authenticate as any of your customers.
Drupal integration module for the Kalastatic prototyping and styleguide tool
Provides a base set of configuration and module dependencies for starting new Drupal projects.
Library with classes to help you do batch.
This module extends Drupal Migrate framework.
统计信息
- 总下载量: 100
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 2
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2025-07-09