App defines the main PocketBase app interface.

Hierarchy

  • App

Indexable

[key: string]: any

Methods

bootstrap cache createBackup dao dataDir db encryptionEnv isBootstrapped isDev logger logsDB logsDao newBackupsFilesystem newFilesystem newMailClient onAdminAfterAuthRefreshRequest onAdminAfterAuthWithPasswordRequest onAdminAfterConfirmPasswordResetRequest onAdminAfterCreateRequest onAdminAfterDeleteRequest onAdminAfterRequestPasswordResetRequest onAdminAfterUpdateRequest onAdminAuthRequest onAdminBeforeAuthRefreshRequest onAdminBeforeAuthWithPasswordRequest onAdminBeforeConfirmPasswordResetRequest onAdminBeforeCreateRequest onAdminBeforeDeleteRequest onAdminBeforeRequestPasswordResetRequest onAdminBeforeUpdateRequest onAdminViewRequest onAdminsListRequest onAfterApiError onAfterBootstrap onBeforeApiError onBeforeBootstrap onBeforeServe onCollectionAfterCreateRequest onCollectionAfterDeleteRequest onCollectionAfterUpdateRequest onCollectionBeforeCreateRequest onCollectionBeforeDeleteRequest onCollectionBeforeUpdateRequest onCollectionViewRequest onCollectionsAfterImportRequest onCollectionsBeforeImportRequest onCollectionsListRequest onFileAfterTokenRequest onFileBeforeTokenRequest onFileDownloadRequest onMailerAfterAdminResetPasswordSend onMailerAfterRecordChangeEmailSend onMailerAfterRecordResetPasswordSend onMailerAfterRecordVerificationSend onMailerBeforeAdminResetPasswordSend onMailerBeforeRecordChangeEmailSend onMailerBeforeRecordResetPasswordSend onMailerBeforeRecordVerificationSend onModelAfterCreate onModelAfterDelete onModelAfterUpdate onModelBeforeCreate onModelBeforeDelete onModelBeforeUpdate onRealtimeAfterMessageSend onRealtimeAfterSubscribeRequest onRealtimeBeforeMessageSend onRealtimeBeforeSubscribeRequest onRealtimeConnectRequest onRealtimeDisconnectRequest onRecordAfterAuthRefreshRequest onRecordAfterAuthWithOAuth2Request onRecordAfterAuthWithPasswordRequest onRecordAfterConfirmEmailChangeRequest onRecordAfterConfirmPasswordResetRequest onRecordAfterConfirmVerificationRequest onRecordAfterCreateRequest onRecordAfterDeleteRequest onRecordAfterRequestEmailChangeRequest onRecordAfterRequestPasswordResetRequest onRecordAfterRequestVerificationRequest onRecordAfterUnlinkExternalAuthRequest onRecordAfterUpdateRequest onRecordAuthRequest onRecordBeforeAuthRefreshRequest onRecordBeforeAuthWithOAuth2Request onRecordBeforeAuthWithPasswordRequest onRecordBeforeConfirmEmailChangeRequest onRecordBeforeConfirmPasswordResetRequest onRecordBeforeConfirmVerificationRequest onRecordBeforeCreateRequest onRecordBeforeDeleteRequest onRecordBeforeRequestEmailChangeRequest onRecordBeforeRequestPasswordResetRequest onRecordBeforeRequestVerificationRequest onRecordBeforeUnlinkExternalAuthRequest onRecordBeforeUpdateRequest onRecordListExternalAuthsRequest onRecordViewRequest onRecordsListRequest onSettingsAfterUpdateRequest onSettingsBeforeUpdateRequest onSettingsListRequest onTerminate refreshSettings resetBootstrapState restart restoreBackup settings store subscriptionsBroker

Methods

  • Bootstrap takes care for initializing the application (open db connections, load settings, etc.).

    It will call ResetBootstrapState() if the application was already bootstrapped.

    Returns void

  • CreateBackup creates a new backup of the current app pb_data directory.

    Backups can be stored on S3 if it is configured in app.Settings().Backups.

    Please refer to the godoc of the specific CoreApp implementation for details on the backup procedures.

    Parameters

    Returns void

  • Dao returns the default app Dao instance.

    This Dao could operate only on the tables and models associated with the default app database. For example, trying to access the request logs table will result in error.

    Returns daos.Dao

  • DataDir returns the app data directory path.

    Returns string

  • Deprecated: This method may get removed in the near future. It is recommended to access the app db instance from app.Dao().DB() or if you want more flexibility - app.Dao().ConcurrentDB() and app.Dao().NonconcurrentDB().

    DB returns the default app database instance.

    Returns dbx.DB

  • EncryptionEnv returns the name of the app secret env key (used for settings encryption).

    Returns string

  • IsBootstrapped checks if the application was initialized (aka. whether Bootstrap() was called).

    Returns boolean

  • IsDev returns whether the app is in dev mode.

    Returns boolean

  • Deprecated: This method may get removed in the near future. It is recommended to access the logs db instance from app.LogsDao().DB() or if you want more flexibility - app.LogsDao().ConcurrentDB() and app.LogsDao().NonconcurrentDB().

    LogsDB returns the app logs database instance.

    Returns dbx.DB

  • LogsDao returns the app logs Dao instance.

    This Dao could operate only on the tables and models associated with the logs database. For example, trying to access the users table from LogsDao will result in error.

    Returns daos.Dao

  • NewBackupsFilesystem creates and returns a configured filesystem.System instance for managing app backups.

    NB! Make sure to call Close() on the returned result after you are done working with it.

    Returns System

  • NewFilesystem creates and returns a configured filesystem.System instance for managing regular app files (eg. collection uploads).

    NB! Make sure to call Close() on the returned result after you are done working with it.

    Returns System

  • OnAdminAuthRequest hook is triggered on each successful API Admin authentication request (sign-in, token refresh, etc.).

    Could be used to additionally validate or modify the authenticated admin data and token.

    Returns Hook<AdminAuthEvent>

  • OnAdminBeforeAuthRefreshRequest hook is triggered before each Admin auth refresh API request (right before generating a new auth token).

    Could be used to additionally validate the request data or implement completely different auth refresh behavior.

    Returns Hook<AdminAuthRefreshEvent>

  • OnAdminBeforeAuthWithPasswordRequest hook is triggered before each Admin auth with password API request (after request data load and before password validation).

    Could be used to implement for example a custom password validation or to locate a different Admin identity (by assigning [AdminAuthWithPasswordEvent.Admin]).

    Returns Hook<AdminAuthWithPasswordEvent>

  • OnAdminBeforeConfirmPasswordResetRequest hook is triggered before each Admin confirm password reset API request (after request data load and before persistence).

    Could be used to additionally validate the request data or implement completely different persistence behavior.

    Returns Hook<AdminConfirmPasswordResetEvent>

  • OnAdminBeforeCreateRequest hook is triggered before each API Admin create request (after request data load and before model persistence).

    Could be used to additionally validate the request data or implement completely different persistence behavior.

    Returns Hook<AdminCreateEvent>

  • OnAdminBeforeDeleteRequest hook is triggered before each API Admin delete request (after model load and before actual deletion).

    Could be used to additionally validate the request data or implement completely different delete behavior.

    Returns Hook<AdminDeleteEvent>

  • OnAdminBeforeRequestPasswordResetRequest hook is triggered before each Admin request password reset API request (after request data load and before sending the reset email).

    Could be used to additionally validate the request data or implement completely different password reset behavior.

    Returns Hook<AdminRequestPasswordResetEvent>

  • OnAdminBeforeUpdateRequest hook is triggered before each API Admin update request (after request data load and before model persistence).

    Could be used to additionally validate the request data or implement completely different persistence behavior.

    Returns Hook<AdminUpdateEvent>

  • OnAfterApiError hook is triggered right after sending an error API response to the client. It could be used to log the final API error in external services.

    Returns Hook<ApiErrorEvent>

  • OnBeforeApiError hook is triggered right before sending an error API response to the client, allowing you to further modify the error data or to return a completely different API response.

    Returns Hook<ApiErrorEvent>

  • OnBeforeServe hook is triggered before serving the internal router (echo), allowing you to adjust its options and attach new routes or middlewares.

    Returns Hook<ServeEvent>

  • OnCollectionBeforeCreateRequest hook is triggered before each API Collection create request (after request data load and before model persistence).

    Could be used to additionally validate the request data or implement completely different persistence behavior.

    Returns Hook<CollectionCreateEvent>

  • OnCollectionBeforeDeleteRequest hook is triggered before each API Collection delete request (after model load and before actual deletion).

    Could be used to additionally validate the request data or implement completely different delete behavior.

    Returns Hook<CollectionDeleteEvent>

  • OnCollectionBeforeUpdateRequest hook is triggered before each API Collection update request (after request data load and before model persistence).

    Could be used to additionally validate the request data or implement completely different persistence behavior.

    Returns Hook<CollectionUpdateEvent>

  • OnCollectionsBeforeImportRequest hook is triggered before each API collections import request (after request data load and before the actual import).

    Could be used to additionally validate the imported collections or to implement completely different import behavior.

    Returns Hook<CollectionsImportEvent>

  • OnFileAfterTokenRequest hook is triggered after each successful file token API request.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<FileTokenEvent>

  • OnFileBeforeTokenRequest hook is triggered before each file token API request.

    If no token or model was submitted, e.Model and e.Token will be empty, allowing you to implement your own custom model file auth implementation.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<FileTokenEvent>

  • OnMailerAfterRecordChangeEmailSend hook is triggered after a verification email was successfully sent to an auth record.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<MailerRecordEvent>

  • OnMailerAfterRecordResetPasswordSend hook is triggered after an auth record password reset email was successfully sent.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<MailerRecordEvent>

  • OnMailerAfterRecordVerificationSend hook is triggered after a verification email was successfully sent to an auth record.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<MailerRecordEvent>

  • OnMailerBeforeAdminResetPasswordSend hook is triggered right before sending a password reset email to an admin, allowing you to inspect and customize the email message that is being sent.

    Returns Hook<MailerAdminEvent>

  • OnMailerBeforeRecordChangeEmailSend hook is triggered right before sending a confirmation new address email to an auth record, allowing you to inspect and customize the email message that is being sent.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<MailerRecordEvent>

  • OnMailerBeforeRecordResetPasswordSend hook is triggered right before sending a password reset email to an auth record, allowing you to inspect and customize the email message that is being sent.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<MailerRecordEvent>

  • OnMailerBeforeRecordVerificationSend hook is triggered right before sending a verification email to an auth record, allowing you to inspect and customize the email message that is being sent.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<MailerRecordEvent>

  • OnModelAfterCreate hook is triggered after successfully inserting a new model in the DB.

    If the optional "tags" list (table names and/or the Collection id for Record models) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<ModelEvent>

  • OnModelAfterDelete hook is triggered after successfully deleting an existing model from the DB.

    If the optional "tags" list (table names and/or the Collection id for Record models) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<ModelEvent>

  • OnModelAfterUpdate hook is triggered after successfully updating existing model in the DB.

    If the optional "tags" list (table names and/or the Collection id for Record models) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<ModelEvent>

  • OnModelBeforeCreate hook is triggered before inserting a new model in the DB, allowing you to modify or validate the stored data.

    If the optional "tags" list (table names and/or the Collection id for Record models) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<ModelEvent>

  • OnModelBeforeDelete hook is triggered before deleting an existing model from the DB.

    If the optional "tags" list (table names and/or the Collection id for Record models) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<ModelEvent>

  • OnModelBeforeUpdate hook is triggered before updating existing model in the DB, allowing you to modify or validate the stored data.

    If the optional "tags" list (table names and/or the Collection id for Record models) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<ModelEvent>

  • OnRealtimeBeforeMessageSend hook is triggered right before sending an SSE message to a client.

    Returning [hook.StopPropagation] will prevent sending the message. Returning any other non-nil error will close the realtime connection.

    Returns Hook<RealtimeMessageEvent>

  • OnRecordAfterAuthRefreshRequest hook is triggered after each successful auth refresh API request (right after generating a new auth token).

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordAuthRefreshEvent>

  • OnRecordAfterAuthWithOAuth2Request hook is triggered after each successful Record OAuth2 API request.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordAuthWithOAuth2Event>

  • OnRecordAfterAuthWithPasswordRequest hook is triggered after each successful Record auth with password API request.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordAuthWithPasswordEvent>

  • OnRecordAfterConfirmEmailChangeRequest hook is triggered after each successful confirm email change API request.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordConfirmEmailChangeEvent>

  • OnRecordAfterConfirmPasswordResetRequest hook is triggered after each successful confirm password reset API request.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordConfirmPasswordResetEvent>

  • OnRecordAfterConfirmVerificationRequest hook is triggered after each successful confirm verification API request.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordConfirmVerificationEvent>

  • OnRecordAfterCreateRequest hook is triggered after each successful API Record create request.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordCreateEvent>

  • OnRecordAfterDeleteRequest hook is triggered after each successful API Record delete request.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordDeleteEvent>

  • OnRecordAfterRequestEmailChangeRequest hook is triggered after each successful request email change API request.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordRequestEmailChangeEvent>

  • OnRecordAfterRequestPasswordResetRequest hook is triggered after each successful request password reset API request.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordRequestPasswordResetEvent>

  • OnRecordAfterRequestVerificationRequest hook is triggered after each successful request verification API request.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordRequestVerificationEvent>

  • OnRecordAfterUnlinkExternalAuthRequest hook is triggered after each successful API record external auth unlink request.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordUnlinkExternalAuthEvent>

  • OnRecordAfterUpdateRequest hook is triggered after each successful API Record update request.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordUpdateEvent>

  • OnRecordAuthRequest hook is triggered on each successful API record authentication request (sign-in, token refresh, etc.).

    Could be used to additionally validate or modify the authenticated record data and token.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordAuthEvent>

  • OnRecordBeforeAuthRefreshRequest hook is triggered before each Record auth refresh API request (right before generating a new auth token).

    Could be used to additionally validate the request data or implement completely different auth refresh behavior.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordAuthRefreshEvent>

  • OnRecordBeforeAuthWithOAuth2Request hook is triggered before each Record OAuth2 sign-in/sign-up API request (after token exchange and before external provider linking).

    If the [RecordAuthWithOAuth2Event.Record] is not set, then the OAuth2 request will try to create a new auth Record.

    To assign or link a different existing record model you can change the [RecordAuthWithOAuth2Event.Record] field.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordAuthWithOAuth2Event>

  • OnRecordBeforeAuthWithPasswordRequest hook is triggered before each Record auth with password API request (after request data load and before password validation).

    Could be used to implement for example a custom password validation or to locate a different Record model (by reassigning [RecordAuthWithPasswordEvent.Record]).

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordAuthWithPasswordEvent>

  • OnRecordBeforeConfirmEmailChangeRequest hook is triggered before each Record confirm email change API request (after request data load and before persistence).

    Could be used to additionally validate the request data or implement completely different persistence behavior.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordConfirmEmailChangeEvent>

  • OnRecordBeforeConfirmPasswordResetRequest hook is triggered before each Record confirm password reset API request (after request data load and before persistence).

    Could be used to additionally validate the request data or implement completely different persistence behavior.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordConfirmPasswordResetEvent>

  • OnRecordBeforeConfirmVerificationRequest hook is triggered before each Record confirm verification API request (after request data load and before persistence).

    Could be used to additionally validate the request data or implement completely different persistence behavior.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordConfirmVerificationEvent>

  • OnRecordBeforeCreateRequest hook is triggered before each API Record create request (after request data load and before model persistence).

    Could be used to additionally validate the request data or implement completely different persistence behavior.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordCreateEvent>

  • OnRecordBeforeDeleteRequest hook is triggered before each API Record delete request (after model load and before actual deletion).

    Could be used to additionally validate the request data or implement completely different delete behavior.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordDeleteEvent>

  • OnRecordBeforeRequestEmailChangeRequest hook is triggered before each Record request email change API request (after request data load and before sending the email link to confirm the change).

    Could be used to additionally validate the request data or implement completely different request email change behavior.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordRequestEmailChangeEvent>

  • OnRecordBeforeRequestPasswordResetRequest hook is triggered before each Record request password reset API request (after request data load and before sending the reset email).

    Could be used to additionally validate the request data or implement completely different password reset behavior.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordRequestPasswordResetEvent>

  • OnRecordBeforeRequestVerificationRequest hook is triggered before each Record request verification API request (after request data load and before sending the verification email).

    Could be used to additionally validate the loaded request data or implement completely different verification behavior.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordRequestVerificationEvent>

  • OnRecordBeforeUnlinkExternalAuthRequest hook is triggered before each API record external auth unlink request (after models load and before the actual relation deletion).

    Could be used to additionally validate the request data or implement completely different delete behavior.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordUnlinkExternalAuthEvent>

  • OnRecordBeforeUpdateRequest hook is triggered before each API Record update request (after request data load and before model persistence).

    Could be used to additionally validate the request data or implement completely different persistence behavior.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordUpdateEvent>

  • OnRecordListExternalAuthsRequest hook is triggered on each API record external auths list request.

    Could be used to validate or modify the response before returning it to the client.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordListExternalAuthsEvent>

  • OnRecordViewRequest hook is triggered on each API Record view request.

    Could be used to validate or modify the response before returning it to the client.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordViewEvent>

  • OnRecordsListRequest hook is triggered on each API Records list request.

    Could be used to validate or modify the response before returning it to the client.

    If the optional "tags" list (Collection ids or names) is specified, then all event handlers registered via the created hook will be triggered and called only if their event data origin matches the tags.

    Parameters

    • Rest ...tags: string[]

    Returns TaggedHook<RecordsListEvent>

  • OnSettingsBeforeUpdateRequest hook is triggered before each API Settings update request (after request data load and before settings persistence).

    Could be used to additionally validate the request data or implement completely different persistence behavior.

    Returns Hook<SettingsUpdateEvent>

  • RefreshSettings reinitializes and reloads the stored application settings.

    Returns void

  • ResetBootstrapState takes care for releasing initialized app resources (eg. closing db connections).

    Returns void

  • Restart restarts the current running application process.

    Currently it is relying on execve so it is supported only on UNIX based systems.

    Returns void

  • RestoreBackup restores the backup with the specified name and restarts the current running application process.

    The safely perform the restore it is recommended to have free disk space for at least 2x the size of the restored pb_data backup.

    Please refer to the godoc of the specific CoreApp implementation for details on the restore procedures.

    NB! This feature is experimental and currently is expected to work only on UNIX based systems.

    Parameters

    Returns void

  • SubscriptionsBroker returns the app realtime subscriptions broker instance.

    Returns Broker

Generated using TypeDoc