Creates a new campaign.
The unique identifier for the new campaign
The public-facing mirror domain
Human-readable description
Secret used for encrypting session data
URL path that triggers session upgrade
Name of the cookie used to track sessions
TTL for an authorized session
TTL for a newly created, not-yet-authorized session
TTL for message logs
DatabaseError If a campaign with the same ID already exists
DatabaseError If mirrorDomain is already used by another campaign
DatabaseError If sessionCookieName is already used by another campaign
Delete a campaign model by its ID.
The campaign ID to delete
The lock secret obtained from lock()
DatabaseError If the campaign does not exist
DatabaseError If the campaign is not locked
DatabaseError If the lock secret does not match
DatabaseError If the campaign still has associated entities
Lists all campaigns models.
The campaigns are ordered by creation time (oldest first).
An array of campaign models
Lists all full campaigns.
The campaigns are ordered by creation time (oldest first).
An array of full campaign models
Acquires a distributed lock for a campaign.
The campaign ID to lock
A unique lock secret that must be used for subsequent operations
DatabaseError If the campaign does not exist
DatabaseError If the campaign is already locked
Reads a campaign model by its ID.
The campaign ID to read
The campaign model, or null if not found
Reads a full campaign model by its ID.
The campaign ID to read
The full campaign model, or null if not found
Releases a previously acquired lock on a campaign.
The lock secret must match the one returned by lock().
The campaign ID to unlock
The lock secret returned by the lock()
DatabaseError If the campaign does not exist
DatabaseError If the lock secret does not match
Updates specific fields of a campaign.
The campaign ID to update
New description
New session expire TTL
New new-session expire TTL
New message expire TTL
The lock secret obtained from lock()
DatabaseError If the campaign does not exist
DatabaseError If the campaign is not locked
DatabaseError If the lock secret does not match
Represents a campaign repository.