core: Events
Part of core, PocketBase's Go package core as JavaScript sees it. The same types in Go: core: Events.
core.RequestEvent
Has everything router.Event has.
| Member |
Type |
|
app |
App |
|
auth? |
Record |
|
realIP() |
(): string |
RealIP returns the "real" IP address from the configured trusted proxy headers. |
hasSuperuserAuth() |
(): boolean |
HasSuperuserAuth checks whether the current RequestEvent has superuser authentication loaded. |
requestInfo() |
(): (RequestInfo) |
RequestInfo parses the current request into RequestInfo instance. |
core.BatchRequestEvent
Has everything hook.Event, RequestEvent has.
core.baseModelEventData
| Member |
Type |
|
model |
Model |
|
tags() |
(): Array<string> |
|
core.baseRecordEventData
| Member |
Type |
|
record? |
Record |
|
tags() |
(): Array<string> |
|
core.baseCollectionEventData
| Member |
Type |
|
collection? |
Collection |
|
tags() |
(): Array<string> |
|
core.BootstrapEvent
Has everything hook.Event has.
core.TerminateEvent
Has everything hook.Event has.
| Member |
Type |
|
app |
App |
|
isRestart |
boolean |
|
core.BackupEvent
Has everything hook.Event has.
| Member |
Type |
|
app |
App |
|
name |
string // the name of the backup to create/restore. |
|
exclude |
Array<string> // list of dir entries to exclude from the backup create/restore. |
|
core.ServeEvent
Has everything hook.Event has.
| Member |
Type |
|
app |
App |
|
router? |
router.Router<RequestEvent | undefined> |
|
server? |
http.Server |
|
certManager? |
any |
|
listener |
net.Listener |
Listener allow specifying a custom network listener. |
installerFunc |
(app: App, systemSuperuser: Record, baseURL: string) => void |
InstallerFunc is the "installer" function that is called after successful server tcp bind but only if there is no explicit superuser record created yet. |
uiExtensions |
Array<UIExtension> |
|
startBannerFunc |
(baseURL: string) => void |
StartBannerFunc defines a custom console startup banner. |
core.SettingsListRequestEvent
Has everything hook.Event, RequestEvent has.
core.SettingsUpdateRequestEvent
Has everything hook.Event, RequestEvent has.
core.SettingsReloadEvent
Has everything hook.Event has.
core.MailerEvent
Has everything hook.Event has.
core.MailerRecordEvent
Has everything MailerEvent, baseRecordEventData has.
| Member |
Type |
|
meta |
{ [key: string]: any } |
|
core.FilesystemNewWriterEvent
Has everything hook.Event, filesystem.NewWriterEvent has.
core.FilesystemCreateEvent
Has everything hook.Event has.
| Member |
Type |
|
app |
App |
|
kind |
string |
Kind is FilesystemKindStorage, FilesystemKindBackups or a plugin's own kind. |
filesystem? |
filesystem.System |
Filesystem is the result. Left nil, the default one is created after the handlers. |
core.FilesystemDeleteEvent
Has everything hook.Event, filesystem.DeleteEvent has.
core.ModelEvent
Has everything hook.Event, baseModelEventData has.
| Member |
Type |
|
app |
App |
|
type |
string |
Could be any of the ModelEventType* constants, like: - create - update - delete - validate |
core.ModelErrorEvent
Has everything ModelEvent has.
core.RecordEvent
Has everything hook.Event, baseRecordEventData has.
| Member |
Type |
|
app |
App |
|
type |
string |
Could be any of the ModelEventType* constants, like: - create - update - delete - validate |
core.RecordErrorEvent
Has everything RecordEvent has.
core.CollectionEvent
Has everything hook.Event, baseCollectionEventData has.
| Member |
Type |
|
app |
App |
|
type |
string |
Could be any of the ModelEventType* constants, like: - create - update - delete - validate |
core.CollectionErrorEvent
Has everything CollectionEvent has.
core.FileTokenRequestEvent
Has everything hook.Event, RequestEvent, baseRecordEventData has.
core.FileDownloadRequestEvent
Has everything hook.Event, RequestEvent, baseCollectionEventData has.
| Member |
Type |
|
record? |
Record |
|
fileField? |
FileField |
|
servedPath |
string |
|
servedName |
string |
|
thumbError |
Error |
ThumbError indicates the a thumb wasn't able to be generated (e.g. because it didn't satisfy the support image formats or it timed out). |
core.CollectionsListRequestEvent
Has everything hook.Event, RequestEvent has.
core.CollectionsImportRequestEvent
Has everything hook.Event, RequestEvent has.
| Member |
Type |
|
collectionsData |
Array<{ [key: string]: any }> |
|
deleteMissing |
boolean |
|
core.CollectionRequestEvent
Has everything hook.Event, RequestEvent, baseCollectionEventData has.
core.RealtimeConnectRequestEvent
Has everything hook.Event, RequestEvent has.
| Member |
Type |
|
client |
subscriptions.Client |
|
idleTimeout |
time.Duration |
IdleTimeout specifies the max duration to wait for a new message before closing the connection. |
maxTimeout |
time.Duration |
MaxTimeout specifies the maximum duration a realtime connection can remain open (including even if there are ongoing messages). |
core.RealtimeMessageEvent
Has everything hook.Event, RequestEvent has.
core.RealtimeSubscribeRequestEvent
Has everything hook.Event, RequestEvent has.
core.RecordsListRequestEvent
Has everything hook.Event, RequestEvent, baseCollectionEventData has.
core.RecordRequestEvent
Has everything hook.Event, RequestEvent, baseCollectionEventData has.
core.RecordEnrichEvent
Has everything hook.Event, baseRecordEventData has.
core.RecordCreateOTPRequestEvent
Has everything hook.Event, RequestEvent, baseCollectionEventData has.
| Member |
Type |
|
record? |
Record |
|
password |
string |
|
core.RecordAuthWithOTPRequestEvent
Has everything hook.Event, RequestEvent, baseCollectionEventData has.
core.RecordAuthRequestEvent
Has everything hook.Event, RequestEvent, baseCollectionEventData has.
| Member |
Type |
|
record? |
Record |
|
token |
string |
|
meta |
any |
|
authMethod |
string |
|
core.RecordAuthWithPasswordRequestEvent
Has everything hook.Event, RequestEvent, baseCollectionEventData has.
| Member |
Type |
|
record? |
Record |
|
identity |
string |
|
identityField |
string |
|
password |
string |
|
core.RecordAuthWithOAuth2RequestEvent
Has everything hook.Event, RequestEvent, baseCollectionEventData has.
core.RecordAuthRefreshRequestEvent
Has everything hook.Event, RequestEvent, baseCollectionEventData has.
core.RecordRequestPasswordResetRequestEvent
Has everything hook.Event, RequestEvent, baseCollectionEventData has.
core.RecordConfirmPasswordResetRequestEvent
Has everything hook.Event, RequestEvent, baseCollectionEventData has.
core.RecordRequestVerificationRequestEvent
Has everything hook.Event, RequestEvent, baseCollectionEventData has.
core.RecordConfirmVerificationRequestEvent
Has everything hook.Event, RequestEvent, baseCollectionEventData has.
core.RecordRequestEmailChangeRequestEvent
Has everything hook.Event, RequestEvent, baseCollectionEventData has.
| Member |
Type |
|
record? |
Record |
|
newEmail |
string |
|
core.RecordConfirmEmailChangeRequestEvent
Has everything hook.Event, RequestEvent, baseCollectionEventData has.
| Member |
Type |
|
record? |
Record |
|
newEmail |
string |
|
Questions and comments
Comments are a GitHub Discussions thread; sign in with GitHub to post.