Pointcuts
The Data block ships twelve pointcut interface declarations. Each names a point in an entity’s
lifecycle and fixes the method names and argument list an implementation must provide.
They ship in the block’s own binary, one YAML file per interface; the data.svc binary neither
serves nor reads them, and no route serves them (meta serves products, not a block’s own
definitions). The catalogue below is the reference.
Pointcut, hook, and the schema-declared block
Section titled “Pointcut, hook, and the schema-declared block”Three things in this block are easy to confuse.
| Surface | Lives in | Addressed by | Authored by |
|---|---|---|---|
| Pointcut interface (this page) | The block’s source tree, embedded in its binary | Interface name + method name | The block; a product implements against it |
| Hook | The engine’s execution chain | Phase + priority | Go code compiled into the binary |
Entity pointcuts: block | A product’s entity YAML | Canonical method name + order: | The schema author |
A hook is a Go implementation on the request pipeline, the access gate, computed fields, entity validation, the stateflow guard. Hooks are chosen and ordered by the process that builds the engine; you cannot add one from YAML.
A pointcut interface is the opposite: the block publishes a contract and the implementation lives outside the binary, in a product repository, written in a script language. Nothing about it is negotiated at build time.
The pointcuts: block on an entity is a third thing that shares the word. It is dispatched in
process by the hook chain, uses its own canonical method vocabulary, and is declared inside the entity
YAML rather than in a separate plugin folder, the interface catalogue below does not apply to it.
Where the templates live
Section titled “Where the templates live”The twelve interfaces are one YAML file each in the block’s embedded pointcuts folder. meta.svc used
to compile every block’s definitions into its own binary and serve them back (/service/data/type/pointcut);
it no longer does: meta serves products. No route serves the templates now.
The twelve interfaces
Section titled “The twelve interfaces”| File | Interface | Methods | Covers |
|---|---|---|---|
on_create.yaml | OnCreate | 4 | Row create |
on_update.yaml | OnUpdate | 4 | Row update |
on_delete.yaml | OnDelete | 3 | Row delete |
on_read.yaml | OnRead | 5 | Row read, plus mask and decrypt passes |
on_child_create.yaml | OnChildCreate | 4 | Child-row mirror of OnCreate |
on_child_update.yaml | OnChildUpdate | 4 | Child-row mirror of OnUpdate |
on_child_delete.yaml | OnChildDelete | 3 | Child-row mirror of OnDelete |
on_child_read.yaml | OnChildRead | 5 | Child-row mirror of OnRead |
on_import.yaml | OnImport | 3 | Bulk import, including the raw-bytes parse step |
on_export.yaml | OnExport | 4 | Export |
on_entity_field_create.yaml | OnEntityFieldCreate | 1 | Field tokenization on create |
on_entity_field_update.yaml | OnEntityFieldUpdate | 1 | Field tokenization on update |
Method catalogue
Section titled “Method catalogue”Forty-one methods across the twelve interfaces. Names are case-sensitive.
| Interface | Method | Signature |
|---|---|---|
OnCreate | ValidateBeforeCreate | (ctx, entity, payload, params) |
OnCreate | AugmentBeforeCreate | (ctx, entity, payload, params) |
OnCreate | ExecuteOnCreateSuccess | (ctx, payload, params) |
OnCreate | ExecuteOnCreateFailure | (ctx, payload, params) |
OnUpdate | ValidateBeforeUpdate | (ctx, entity, payload, params) |
OnUpdate | AugmentBeforeUpdate | (ctx, entity, payload, params) |
OnUpdate | ExecuteOnUpdateSuccess | (ctx, payload, params) |
OnUpdate | ExecuteOnUpdateFailure | (ctx, payload, params) |
OnDelete | ExecuteBeforeDelete | (ctx, entity, payload, params) |
OnDelete | ExecuteOnDeleteSuccess | (ctx, payload, params) |
OnDelete | ExecuteOnDeleteFailure | (ctx, payload, params) |
OnRead | ExecuteBeforeRead | (ctx, entity, payload, params) |
OnRead | MaskAfterRead | (ctx, entity, payload, params) |
OnRead | DecryptAfterRead | (ctx, entity, payload, params) |
OnRead | ExecuteOnReadSuccess | (ctx, payload, params) |
OnRead | ExecuteOnReadFailure | (ctx, payload, params) |
OnChildCreate | ValidateBeforeChildCreate | (ctx, entity, payload, params) |
OnChildCreate | AugmentBeforeChildCreate | (ctx, entity, payload, params) |
OnChildCreate | ExecuteOnChildCreateSuccess | (ctx, payload, params) |
OnChildCreate | ExecuteOnChildCreateFailure | (ctx, payload, params) |
OnChildUpdate | ValidateBeforeChildUpdate | (ctx, entity, payload, params) |
OnChildUpdate | AugmentBeforeChildUpdate | (ctx, entity, payload, params) |
OnChildUpdate | ExecuteOnChildUpdateSuccess | (ctx, payload, params) |
OnChildUpdate | ExecuteOnChildUpdateFailure | (ctx, payload, params) |
OnChildDelete | ExecuteBeforeChildDelete | (ctx, entity, payload, params) |
OnChildDelete | ExecuteOnChildDeleteSuccess | (ctx, payload, params) |
OnChildDelete | ExecuteOnChildDeleteFailure | (ctx, payload, params) |
OnChildRead | ExecuteBeforeChildRead | (ctx, entity, payload, params) |
OnChildRead | MaskAfterChildRead | (ctx, entity, payload, params) |
OnChildRead | DecryptAfterChildRead | (ctx, entity, payload, params) |
OnChildRead | ExecuteOnChildReadSuccess | (ctx, payload, params) |
OnChildRead | ExecuteOnChildReadFailure | (ctx, payload, params) |
OnImport | ParseBeforeImport | (ctx, type, payload, params): payload is bytes |
OnImport | ExecuteOnImportSuccess | (ctx, payload, params) |
OnImport | ExecuteOnImportFailure | (ctx, payload, params) |
OnExport | ValidateBeforeExport | (ctx, entity, payload, params) |
OnExport | AugmentBeforeExport | (ctx, entity, payload, params) |
OnExport | ExecuteOnExportSuccess | (ctx, payload, params) |
OnExport | ExecuteOnExportFailure | (ctx, payload, params) |
OnEntityFieldCreate | Tokenize | (ctx, entity, payload, params) |
OnEntityFieldUpdate | Tokenize | (ctx, entity, payload, params) |
Arguments
Section titled “Arguments”| Argument | Declared type | Present on |
|---|---|---|
ctx | map of string | Every method |
entity | string | Every method except Execute*Success / Execute*Failure and ParseBeforeImport |
type | string | ParseBeforeImport only, in the slot entity occupies elsewhere |
payload | map of any: bytes on ParseBeforeImport | Every method |
params | array of any | Every method |
Template file format
Section titled “Template file format”Each file declares one interface name and its method list. Arguments are ordered, and each carries a
type with an optional subtype for the element or value type, the shipped Data templates use
four types: map (with subtype string or any), string, array (subtype any) and bytes.
---name: OnCreatemethods:- name: ValidateBeforeCreate arguments: - name: ctx type: map subtype: string - name: entity type: string - name: payload type: map subtype: any - name: params type: array subtype: any- name: ExecuteOnCreateSuccess arguments: - name: ctx type: map subtype: string - name: payload type: map subtype: any - name: params type: array subtype: anyA product cannot add an interface or a method: the catalogue is fixed by the Data block’s build.
Implementing one in a product
Section titled “Implementing one in a product”A product implements a pointcut as a plugin under data/plugins/. The directory scan is one level
deep and the manifest file name is fixed: data/plugins/<name>/plugin.yaml. Nested directories and
any other file name are ignored.
data/ plugins/ dummyplugin/ plugin.yaml plugin.js---name: dummypluginmeta: entities: - product - bugservice: dataactive: truecategory:- computeimplements:- name: OnCreate priority: 100 methods: - ExecuteOnCreateSuccess - ExecuteOnCreateFailurelanguage: jscapabilities:- network: - public- memory: max: 5Mtags:- compute- operationsarguments:- name: params value: ~config: type: stdoutThe script file exports one function per declared method, with the signature the template fixes:
function ExecuteOnCreateSuccess(ctx, payload, params) { console.log("dummyplugin: create succeeded", ctx, payload, params);}
function ExecuteOnCreateFailure(ctx, payload, params) { console.log("dummyplugin: create failed", ctx, payload, params);}Declaration keys
Section titled “Declaration keys”The platform’s plugin engine (the one a block registers to run plugins) reads a declaration from
<plugins folder>/<name>/plugin.yaml. It reads two keys, sets a third, and hands everything else to
the block. meta reads none of it: it serves the file as it is.
| Key | Read by the plugin engine | Meaning |
|---|---|---|
name | Yes. The key | Plugin name. The implementation is recorded under it, so it is required |
language | Yes. Required | Script runtime; the implementation is plugin.<language> beside the declaration (plugin.js for any js*). A declaration without it is skipped |
path | Set | The plugin’s folder |
service | No | The folder is the block’s own, so nothing filters on it |
implements[].name | No | Interface name from the catalogue above |
implements[].methods | No | The subset of that interface’s methods this plugin provides |
implements[].priority | No | Ordering among plugins bound to the same interface |
meta.entities | No | Entities the plugin is scoped to |
active | No | Author’s enable flag |
category, tags | No | Catalogue labels |
capabilities | No | Declared resource and network needs |
arguments | No | Declared argument defaults, merged with call arguments by the consuming block |
config | No | Free-form plugin configuration |
Reading a product’s declarations
Section titled “Reading a product’s declarations”| Method | Path | Returns |
|---|---|---|
| GET | /product/{id}/files?path=data/plugins&depth=2 | The plugin folders and their files |
| GET | /product/{id}/file/data/plugins/<name>/plugin.yaml | One declaration, as it is |
| POST | /product/{id}/batch | Several declarations and implementations in one round trip |
These are meta’s ordinary file routes: the files come back as they are, with no filtering on
service: and nothing appended.
Related
Section titled “Related”| Concern | Page |
|---|---|
| Where product definitions live on disk | Schema sources |
The hook chain, and the entity pointcuts: block that runs on it | Hooks and the execution pipeline |
| Guards that do run on every request | Access rules |
| Masking and classification, and what is enforced | Field protection |
| Serving, versioning and authenticating definitions | meta.svc |
| Endpoint-level HTTP reference | Data API reference |