CCF
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
ccf::js Namespace Reference

Namespaces

namespace  core
 
namespace  extensions
 
namespace  modules
 

Classes

class  AbstractInterpreterCache
 
class  BaseDynamicJSEndpointRegistry
 
struct  Bundle
 
struct  CustomJSEndpoint
 
class  DynamicJSEndpointRegistry
 
class  GovernanceDrivenJSRegistry
 
class  InterpreterCache
 
struct  JSDynamicEndpoint
 
struct  Metadata
 
struct  ModuleDef
 
class  WithCommonExtensions
 
class  WithKVExtension
 

Typedefs

using CommonContext = WithCommonExtensions< js::core::Context >
 
using CommonContextWithLocalTx = WithKVExtension< CommonContext >
 
using InterpreterFactory = std::function< std::shared_ptr< js::core::Context >(js::TxAccess)>
 
using NamespaceRestriction = std::function< KVAccessPermissions(const std::string &map_name, std::string &explanation)>
 

Enumerations

enum class  KVAccessPermissions { ILLEGAL = 0 , READ_ONLY = 1 << 0 , WRITE_ONLY = 1 << 1 , READ_WRITE = READ_ONLY | WRITE_ONLY }
 
enum class  TxAccess { APP_RO , APP_RW , GOV_RO , GOV_RW }
 

Functions

 DECLARE_JSON_TYPE (Metadata)
 
 DECLARE_JSON_REQUIRED_FIELDS (Metadata, endpoints)
 
 DECLARE_JSON_TYPE (ModuleDef)
 
 DECLARE_JSON_REQUIRED_FIELDS (ModuleDef, name, module)
 
 DECLARE_JSON_TYPE (Bundle)
 
 DECLARE_JSON_REQUIRED_FIELDS (Bundle, modules, metadata)
 
KVAccessPermissions intersect_access_permissions (KVAccessPermissions l, KVAccessPermissions r)
 
void register_class_ids ()
 
std::string normalised_module_path (std::string_view sv)
 

Variables

JSClassExoticMethods kv_historical_exotic_methods
 
JSClassDef kv_historical_class_def
 
JSClassExoticMethods kv_exotic_methods
 
JSClassDef kv_class_def
 
JSClassID kv_class_id = 0
 
JSClassID kv_historical_class_id = 0
 
JSClassID kv_map_handle_class_id = 0
 
JSClassID historical_state_class_id = 0
 
JSClassDef kv_map_handle_class_def = {}
 
JSClassDef historical_state_class_def
 

Typedef Documentation

◆ CommonContext

◆ CommonContextWithLocalTx

◆ InterpreterFactory

using ccf::js::InterpreterFactory = typedef std::function<std::shared_ptr<js::core::Context>(js::TxAccess)>

◆ NamespaceRestriction

using ccf::js::NamespaceRestriction = typedef std::function<KVAccessPermissions( const std::string& map_name, std::string& explanation)>

Enumeration Type Documentation

◆ KVAccessPermissions

enum class ccf::js::KVAccessPermissions
strong
Enumerator
ILLEGAL 
READ_ONLY 
WRITE_ONLY 
READ_WRITE 

◆ TxAccess

enum class ccf::js::TxAccess
strong

Describes the context in which JS script is currently executing. Used to determine which KV tables should be accessible.

Enumerator
APP_RO 

Application code, during evaluation of an endpoint handler function marked as readonly

APP_RW 

Application code, during evaluation of an endpoint handler function marked as readwrite

GOV_RO 

Read-only governance execution, during evaluation of ballots, and of the 'validate' and 'resolve' functions in the constitution

GOV_RW 

Read-write governance execution, during evaluation of the 'apply' function in the constitution

Function Documentation

◆ DECLARE_JSON_REQUIRED_FIELDS() [1/3]

ccf::js::DECLARE_JSON_REQUIRED_FIELDS ( Bundle  ,
modules  ,
metadata   
)

◆ DECLARE_JSON_REQUIRED_FIELDS() [2/3]

ccf::js::DECLARE_JSON_REQUIRED_FIELDS ( Metadata  ,
endpoints   
)

◆ DECLARE_JSON_REQUIRED_FIELDS() [3/3]

ccf::js::DECLARE_JSON_REQUIRED_FIELDS ( ModuleDef  ,
name  ,
module   
)

◆ DECLARE_JSON_TYPE() [1/3]

ccf::js::DECLARE_JSON_TYPE ( Bundle  )

◆ DECLARE_JSON_TYPE() [2/3]

ccf::js::DECLARE_JSON_TYPE ( Metadata  )

◆ DECLARE_JSON_TYPE() [3/3]

ccf::js::DECLARE_JSON_TYPE ( ModuleDef  )

◆ intersect_access_permissions()

KVAccessPermissions ccf::js::intersect_access_permissions ( KVAccessPermissions  l,
KVAccessPermissions  r 
)
inline

◆ normalised_module_path()

std::string ccf::js::normalised_module_path ( std::string_view  sv)

◆ register_class_ids()

void ccf::js::register_class_ids ( )

Variable Documentation

◆ historical_state_class_def

JSClassDef ccf::js::historical_state_class_def
extern

◆ historical_state_class_id

JSClassID ccf::js::historical_state_class_id = 0

◆ kv_class_def

JSClassDef ccf::js::kv_class_def
Initial value:
= {
.class_name = "KV Tables",
.finalizer = {},
.gc_mark = {},
.call = {},
.exotic = &kv_exotic_methods}

◆ kv_class_id

JSClassID ccf::js::kv_class_id = 0

◆ kv_exotic_methods

JSClassExoticMethods ccf::js::kv_exotic_methods
Initial value:
= {
.get_own_property = extensions::js_kv_lookup,
.get_own_property_names = {},
.delete_property = {},
.define_own_property = {},
.has_property = {},
.get_property = {},
.set_property = {}}

◆ kv_historical_class_def

JSClassDef ccf::js::kv_historical_class_def
Initial value:
= {
.class_name = "Read-only Historical KV Tables",
.finalizer = {},
.gc_mark = {},
.call = {},
.exotic = &kv_historical_exotic_methods}

◆ kv_historical_class_id

JSClassID ccf::js::kv_historical_class_id = 0

◆ kv_historical_exotic_methods

JSClassExoticMethods ccf::js::kv_historical_exotic_methods
Initial value:
= {
.get_own_property = extensions::js_historical_kv_lookup,
.get_own_property_names = {},
.delete_property = {},
.define_own_property = {},
.has_property = {},
.get_property = {},
.set_property = {}}

◆ kv_map_handle_class_def

JSClassDef ccf::js::kv_map_handle_class_def = {}

◆ kv_map_handle_class_id

JSClassID ccf::js::kv_map_handle_class_id = 0