forms

Types from PocketBase's Go package forms, as JavaScript sees them: you get these objects from $app and the other globals and from hook events, and call their methods by their JS names (Go's FindRecordById is findRecordById). The same package in Go: forms.

forms.AppleClientSecretCreate

AppleClientSecretCreate is a form struct to generate a new Apple Client Secret.

Reference: https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens

Member Type
clientId string ClientId is the identifier of your app (aka. Service ID).
teamId string TeamId is a 10-character string associated with your developer account (usually could be found next to your name in the Apple Developer site).
keyId string KeyId is a 10-character key identifier generated for the "Sign in with Apple" private key associated with your developer account.
privateKey string PrivateKey is the private key associated to your app. Usually wrapped within -----BEGIN PRIVATE KEY----- X -----END PRIVATE KEY-----.
duration number Duration specifies how long the generated JWT should be considered valid. The specified value must be in seconds and max 15777000 (~6months).
validate() (): void Validate makes the form validatable by implementing validation.validatable interface.
submit() (): string Submit validates the form and returns a new Apple Client Secret JWT.

forms.RecordUpsert

Member Type
setContext() (ctx: context.Context): void SetContext assigns ctx as context of the current form.
setApp() (app: CoreApp): void SetApp replaces the current form app instance.
setRecord() (record: core.Record): void SetRecord replaces the current form record instance.
resetAccess() (): void ResetAccess resets the form access level to the accessLevelDefault.
grantManagerAccess() (): void GrantManagerAccess updates the form access level to "manager" allowing directly changing some system record fields (often used with auth collection records).
grantSuperuserAccess() (): void GrantSuperuserAccess updates the form access level to "superuser" allowing directly changing all system record fields, including those marked as "Hidden".
hasManageAccess() (): boolean HasManageAccess reports whether the form has "manager" or "superuser" level access.
load() (data: { [key: string]: any }): void Load loads the provided data into the form and the related record.
drySubmit() (callback: (txApp: CoreApp, drySavedRecord: core.Record) => void): void Deprecated: It was previously used as part of the record create action but it is not needed anymore and will be removed in the future.
submit() (): void Submit validates the form specific validations and attempts to save the form record.

forms.TestEmailSend

TestEmailSend is a email template test request form.

Member Type
email string
template string
collection string // optional, fallbacks to _superusers
validate() (): void Validate makes the form validatable by implementing validation.validatable interface.
submit() (): void Submit validates and sends a test email to the form.Email address.

forms.TestS3Filesystem

TestS3Filesystem defines a S3 filesystem connection test.

Member Type
filesystem string The name of the filesystem - storage or backups
validate() (): void Validate makes the form validatable by implementing validation.validatable interface.
submit() (): void Submit validates and performs a S3 filesystem connection test.