Expand description
Functions the framework ships with.
A built-in is an ordinary Rust fn registered in the function
registry under a manifest of its own. It
sees the same HostBridge a dynamically-loaded function does — database,
config, caller, hook context — so anything a built-in does, an app could have
written itself as a functions/ library, and an app that ships a function
with the same name replaces it.
They exist for the logic that has to live behind the API rather than in
front of it. organization_join is the example: turning an email address
into a member of an organisation needs a user lookup that the person doing
the adding is deliberately not allowed to perform themselves.
Built-ins are private: they have no HTTP endpoint and are reached only as a
resource’s lifecycle hook.
Constants§
- ORGANIZATION_
JOIN - Name of the membership
before_createbuilt-in, asMEMBERSHIP_TOMLdeclares it. - PREFIX
- Reserved name prefix. Every built-in wears it so that an app naming a
function of its own can never collide with one by accident — and so that a
hook pointing at
apiplant_…is visibly the framework’s, not the app’s. - STRIPE_
PRICE - Name of the
billing_pricecatalogue hook, asBILLING_PRICE_TOMLdeclares it. - STRIPE_
PRODUCT - Name of the
billing_productcatalogue hook, asBILLING_PRODUCT_TOMLdeclares it.
Functions§
- organization_
join before_createonmembership: work out who is being added.- register_
all - Register every built-in into a fresh registry. Called by
FunctionRegistry::load. - stripe_
price before_create/before_updateonbilling_price: create the price in Stripe, or replace it when the change is one Stripe won’t apply in place.- stripe_
product before_create/before_updateonbilling_product: create or update the product in Stripe, and write its id into the row being saved.