Files
puter/doc/contributors/extensions/manual_overrides.json.js
T
ajaykrishnaswamy 782e858b3c Update (and automate) events docs (#1164)
* documentation: new documentation for emit features

* Update events documentation and doc_helper.js script

* Update package.json

Co-authored-by: Eric Dubé <eric.alex.dube@gmail.com>

* added manual_overrides.json.js file

* Update doc_helper.js to resolve paths relative to project root and update events documentation

* created a new events.md generated file, differences can be seen.

* added and populated events.md file. Can now compare new and old versions

---------

Co-authored-by: Eric Dubé <eric.alex.dube@gmail.com>
2025-03-16 12:41:14 -04:00

68 lines
2.1 KiB
JavaScript

export default [
{
id: 'core.email.validate',
description: `
This event is emitted when an email is being validated.
The event can be used to block certain emails from being validated.
`,
properties: {
email: {
type: 'string',
mutability: 'no-effect',
summary: 'the email being validated',
notes: [
'The email may have already been cleaned.',
]
},
allow: {
type: 'boolean',
mutability: 'mutable',
summary: 'whether the email is allowed',
notes: [
'If set to false, the email will be considered invalid.',
]
},
},
},
{
id: 'core.request.measured',
description: `
This event is emitted when a requests incoming and outgoing bytes
have been measured.
`,
example: {
language: 'javascript',
code: /*javascript*/`
extension.on('core.request.measured', data => {
const measurements = data.measurements;
// measurements = { sz_incoming: integer, sz_outgoing: integer }
const actor = data.actor; // instance of Actor
console.log('\\x1B[36;1m === MEASUREMENT ===\\x1B[0m\\n', {
actor: data.actor.uid,
measurements: data.measurements
});
});
`
}
},
{
id: 'core.fs.create.directory',
description: `
This event is emitted when a directory is created.
`,
properties: {
node: {
type: 'FSNodeContext',
mutability: 'no-effect',
summary: 'the directory that was created',
},
context: {
type: 'Context',
mutability: 'no-effect',
summary: 'current context'
},
}
},
];