Compose-ready workspace: packages/zappier (rate card, portal, Stripe), packages/verae-zapier-middleware (timestamp + NATS), packages/verae-zapier (CLI app), vendor/zapier-platform, and research/zapier vendor corpus. Gate 0 structure checks pass. Product code and research are not yet wired.
2 KiB
2 KiB
zapier-platform-legacy-scripting-runner Architecture
Purpose
- This package, released as
zapier-platform-legacy-scripting-runnerpublicly on npm, is a compatibility shim between the legacy v2 platform and the current "v3" (aka CLI) platform. - Most developers won't install this directly, but we'll include it when auto-converting their legacy applications.
- It implements everything found in the legacy scripting environment (github pinned link in case that done doesn't work).
- While
core,cli, andschemaare released in lockstep and always match versions,legacy-scripting-runneris versioned separately and released on its own.
Technical Organization
runner/..., when used in a path to a file, is shorthand forzapier-platform/packages/legacy-scripting-runner/...
Important Functions
- The lion's share of code lives in
runner/index.js. - The primary purposes are to:
- make available global functions that were available in the legacy environment (see the
compileLegacyScriptingSourcefunction) - handle
pre_Xandpost_Xlifecycle hooks (seerunEventCombofunction) - ensure inputs and outputs continue to allow what was allowed in the legacy environment (while CLI apps may have more strict requirements, such as needing to return arrays from triggers)
- make available global functions that were available in the legacy environment (see the
- There are also individual files in
runner/*that power functions/libraries exposed above, such asbtoa,$(forjQuery), etc.
Tests
- The main test file is
runner/test/integration-test.js, which takes the basic example app fromrunner/test/example-app/index.js, tweaks a single trigger/action at a time, and makes asserts about how it performs. - There are also unit tests for individually implemented functions (such as
btoa) inrunner/test/libraries.js.