feat: Add Cloud Code Adapter system for multi-language cloud code by dblythy · Pull Request #10218 · parse-community/parse-server
added 5 commits
March 16, 2026 21:16Defines the architecture for a next-generation Parse.Cloud system that replaces triggers.js with a CloudCodeManager, supports BYO adapters, and enables multi-language cloud code via three built-in adapter types (Legacy, InProcess, ExternalProcess).
- Add beforePasswordResetRequest to TriggerName - Replace file/config trigger names with virtual className pattern (@file, @config, @connect) matching triggers.js internals - Add applicationId scoping (one CloudCodeManager per app on Config) - Add GlobalConfigRouter.js to consumer migration table - Add missing API methods (triggerExists, getJobs, runQueryTrigger, runFileTrigger, runGlobalConfigTrigger, runLiveQueryEventHandlers) - Clarify validators/rate-limiting only for LegacyAdapter - Document crash recovery ownership (manager calls unregisterAll)
- Rename getValidator param to key (covers both functions and triggers) - Note runTrigger subsumes maybeRunAfterFindTrigger - Make runLiveQueryEventHandlers synchronous to match existing behavior - Add defineTrigger validation rules (enforced for all adapters) - Add getRequestFileObject to utility function list
Comprehensive implementation plan addressing all review feedback: - LegacyAdapter loads files only (no Parse.Cloud patching) - triggers.js facade delegates reads AND writes with correct signatures - AppCache persistence survives Config.put() overwrites - _unregisterAll uses synchronous clearAll() for test cleanup - getJobsObject() for facade backwards compatibility - @parse-lite/cloud usage example in plan header
- Resolve merge conflicts in triggers.js and Definitions.js - Fix ESLint curly rule in InProcessAdapter spec - Fix TypeScript: import * as http, import Parse default - Fix Options/index.js: use ?Object instead of inline types (buildConfigDefinitions.js cannot parse Array<Object> or inline object type annotations)
dblythy
changed the title
Feature/cloud adapter
feat: Add Cloud Code Adapter system for multi-language cloud code
- Regenerate Definitions.js and docs.js via npm run definitions - Fix lint: replace instanceof Map with toBeInstanceOf (no-restricted-syntax) - Fix cloud type validation: reject non-string/function/object cloud values to preserve existing "cloud code must be valid type" test - Docker build failure is QEMU/arm64 infra flake (not code-related)
dblythy
marked this pull request as ready for review
- Use ephemeral ports and proper teardown in ExternalProcessAdapter specs - Add HTTP timeout/status validation and file trigger handling in ExternalProcessAdapter - Guard request.object for file hooks in InProcessAdapter beforeSave - Fix ESM/CJS loading order in LegacyAdapter (require-first, catch ERR_REQUIRE_ESM) - Best-effort shutdown and initialize rollback in CloudCodeManager - Add missing "net" import in README Go example - Update Options types for cloud, cloudCodeAdapters, cloudCodeOptions - Fix validator applicationId lookup in triggers.js and ParseLiveQueryServer - Throw Error objects instead of strings in resolveAdapters - Update JSDoc types in docs.js - Clarify intentional addParseCloud re-invocation in ParseServer
- Use ephemeral ports and proper teardown in ExternalProcessAdapter specs - Add HTTP timeout/status validation and file trigger handling in ExternalProcessAdapter - Guard request.object for file hooks in InProcessAdapter beforeSave - Fix ESM/CJS loading order in LegacyAdapter (require-first, catch ERR_REQUIRE_ESM) - Best-effort shutdown and initialize rollback in CloudCodeManager - Add missing "net" import in README Go example - Update Options types for cloud, cloudCodeAdapters, cloudCodeOptions - Fix validator applicationId lookup in triggers.js and ParseLiveQueryServer - Throw Error objects instead of strings in resolveAdapters - Update JSDoc types in docs.js - Clarify intentional addParseCloud re-invocation in ParseServer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters