Skip to main content

Module capability

Module capability 

Source
Expand description

Capability ID mappings for env.host_call dispatch.

Each capability module has a unique cap_id and each function within it has a unique fn_id. These constants are used by:

  • The stdlib capability modules (to return CapabilityCall errors)
  • The WASM code generator (to emit env.host_call(cap_id, fn_id, ...) instructions)

Constants§

CAP_CREDENTIAL
Credential resolution (internal — PEPL code does not call directly).
CAP_HTTP
HTTP capability (get, post, put, patch, delete).
CAP_LOCATION
Location/GPS capability (current).
CAP_NOTIFICATIONS
Push notifications capability (send).
CAP_STORAGE
Persistent storage capability (get, set, delete, keys).
CREDENTIAL_GET
HTTP_DELETE
HTTP_GET
HTTP_PATCH
HTTP_POST
HTTP_PUT
LOCATION_CURRENT
NOTIFICATIONS_SEND
STORAGE_DELETE
STORAGE_GET
STORAGE_KEYS
STORAGE_SET

Functions§

capability_module_names
Returns all capability module names.
is_capability_module
Returns true if the given module name is a capability module.
resolve_ids
Resolve a capability module name + function name to (cap_id, fn_id).