Conversation
git-subtree-dir: packages/socket-client git-subtree-split: c3dc5c344f58dbd1966681a94cc08b914e2599bf
git-subtree-dir: packages/orchestrator git-subtree-split: 06d295d777f2b60d7174b305ce77a6ee94f0d2f8
git-subtree-dir: apps/docker git-subtree-split: 5e3cf42b9a5549e85804c31c05cc05f1c58fda47
git-subtree-dir: packages/wa-decrypt git-subtree-split: 5bc722f45f39fb49c29c55eb9c777daa09361d68
git-subtree-dir: integrations/node-red git-subtree-split: b6cb711ff9cfc296e865fe46ec2a2ed6baad006b
- Changed clientRegistry from Map<ZodFunction, meta> to Map<string, MethodDefinition>
- Added MethodDefinition interface: {schema, meta}
- Made functionName required in ClientFunctionMetadata
- Stored inputSchema and outputSchema directly in metadata for generator access
- Updated registry API: register(def), get(name), getBySchema(schema), getAll()
- Updated implementor to use getBySchema() for backward compatibility
- Updated gen-client-implementation.ts to destructure MethodDefinition
- Updated hono-server.ts to use new registry API and extract schemas correctly
- Updated socket-manager.ts to use new registry API and access metadata via def.meta
- Renamed executeCapability to executeMethod for consistency
- Created registry.contract.test.ts for registry API validation - Created generators.contract.test.ts for generated file validation (types.ts, BaseClient.ts) - Created routes.contract.test.ts for server route registration tests - Created verify-v5-pipeline.ts for E2E verification script - Added Jest configuration with ts-jest preset - Updated package.json with test:contracts, verify, and ci scripts - All 21 tests passing (6 skipped for OpenAPI generation - union type not supported without .openapi() metadata) - Verification script passes with 121 methods across 9 namespaces
#3) - Created event registry system symmetric with method registry - Added EventMetadata, EventDefinition interfaces in schema - Implemented defineListenerV2() for type-safe event callback schemas - Created 10 core events: message, anyMessage, messageDeleted, ack, reaction, stateChanged, chatState, logout, participantsChanged, addedToGroup - Added QueueOptionsSchema for p-queue integration with event handlers - Created EventManager runtime class in core with: * PQueue-based rate limiting per event subscription * Type-safe payload validation using event schemas * Error isolation (fail loud but keep process alive) * Dynamic registry loading to avoid circular dependencies - Integrated EventManager into Client class (client.events property) - Both @open-wa/schema and @open-wa/core build successfully - All contract tests passing (21 passed, 6 skipped) PARTIAL IMPLEMENTATION of Issue #3: - Schema layer: COMPLETE - EventManager runtime: COMPLETE - Client integration: BASIC (property added, initialized) - WAPI event wiring: DEFERRED (requires deeper WAPI integration knowledge) - Legacy wrapper methods: NOT NEEDED (existing methods work)
- Refactored EventManager to use dependency injection (no dynamic imports) - EventManager now accepts optional EventRegistry in constructor - Created WapiBridge class for open-source event marshalling layer - WapiBridge sets up Puppeteer exposeFunction bridges (OSS) - Actual WAPI injection remains proprietary (not in repo) - Client.ts passes eventRegistry to EventManager via require() - Added comprehensive architecture documentation (WapiBridge.md) CLEAN ARCHITECTURE: - Proprietary: wapi.js/patch.js injection + WhatsApp DOM scraping - Open Source: WapiBridge (Puppeteer setup) + EventManager (distribution) - Clear boundary: WAPI calls window.__onMessage → exposed fn → events.emit() All builds passing, contract tests passing (21/27)
Schema definitions for 4 critical complex methods: - decryptMedia: Decrypt media from messages - downloadMedia: Download and save decrypted media - sendFileFromUrl: Download and send files from URLs - loadEarlierMessages: Load message history All methods: - Use defineMethodV2 with proper Zod schemas - Include parameter descriptions and ordering - Set appropriate action/namespace/license metadata - Ready for runtime implementation in core package Schema builds successfully, generates BaseClient with new methods. PARTIAL: Schema layer complete, runtime implementations deferred.
- Updated .gitignore to exclude build artifacts (*.js, *.d.ts, *.map in src/) - Added package-level .gitignore files for schema, core, and wa-automate - Relocated generated files from src/generated to root-level generated/ - Updated generator scripts to write to new location - Created tsconfig.generated.json for separate generated file compilation - Updated package.json exports to include ./generated path - Untracked old src/generated files from git Fixes #05a (gitignore hygiene) and #05b (relocate generated files)
…package configuration
|
Important Review skippedToo many files! This PR contains 297 files, which is 147 over the limit of 150. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (297)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai please review!!!! |
|
✅ Actions performedReview triggered.
|
|
@coderabbitai PLEASE REVIEW THIS PR!!! |
|
✅ Actions performedFull review triggered. |
|
@coderabbitai WTF BRO I TOLD YOU TO REVIEW THE PR TWICE U DIDN DO IT YET |
|
✅ Actions performedFull review triggered. |
No description provided.