@fedify/botkit-postgres@0.5.0
latest
fedify-dev/botkitWorks with
•JSR Score100%•This package works with Node.js, DenoIt is unknown whether this package works with Cloudflare Workers, Bun



License
•AGPL-3.0-only
Downloads1/wk
•Publisheda week ago (0.5.0)
PostgreSQL-based repository for BotKit
Classes
c
PostgresRepository(options: PostgresRepositoryOptions)
A repository for storing bot data using PostgreSQL.
- addFollowee(): Promise<void>identifier: string,followeeId: URL,follow: FollowNo documentation available
- addFollower(): Promise<void>identifier: string,followId: URL,follower: ActorNo documentation available
- addMessage(): Promise<void>identifier: string,id: Uuid,activity: Create | AnnounceNo documentation available
- addQuoteAuthorization(): Promise<void>identifier: string,id: Uuid,authorization: QuoteAuthorizationNo documentation available
- addQuoteAuthorizationReference(): Promise<void>identifier: string,authorization: URL,messageId: Uuid,attribution?: URLNo documentation available
- addSentFollow(): Promise<void>identifier: string,id: Uuid,follow: FollowNo documentation available
- cleanupFollower(): Promise<boolean>sql: Queryable,identifier: string,followerId: stringNo documentation available
- close(): Promise<void>
Closes the underlying PostgreSQL connection pool if owned by the repository.
- countFollowers(identifier: string): Promise<number>No documentation available
- countMessages(identifier: string): Promise<number>No documentation available
- countVoters(): Promise<number>identifier: string,messageId: UuidNo documentation available
- countVotes(): Promise<Readonly<Record<string, number>>>identifier: string,messageId: UuidNo documentation available
- ensureReady(): Promise<void>No documentation available
- findFollowedBots(followeeId: URL): AsyncIterable<string>No documentation available
- findQuoteAuthorization(): Promise<QuoteAuthorization | undefined>identifier: string,interactingObject: URLNo documentation available
- findQuoteAuthorizationReference(): Promise<Uuid | undefined>identifier: string,authorization: URLNo documentation available
- findQuoteAuthorizationReferenceAttribution(): Promise<URL | undefined>identifier: string,authorization: URLNo documentation available
- findQuoteAuthorizationReferenceIdentifiers(authorization: URL): AsyncIterable<string>No documentation available
- forIdentifier(identifier: string): ActorScopedRepositoryNo documentation available
- getFollowee(): Promise<Follow | undefined>identifier: string,followeeId: URLNo documentation available
- getFollowers(): AsyncIterable<Actor>identifier: string,options?: RepositoryGetFollowersOptionsNo documentation available
- getKeyPairs(identifier: string): Promise<CryptoKeyPair[] | undefined>No documentation available
- getMessage(): Promise<Create | Announce | undefined>identifier: string,id: UuidNo documentation available
- getMessages(): AsyncIterable<Create | Announce>identifier: string,options?: RepositoryGetMessagesOptionsNo documentation available
- getQuoteAuthorization(): Promise<QuoteAuthorization | undefined>identifier: string,id: UuidNo documentation available
- getSentFollow(): Promise<Follow | undefined>identifier: string,id: UuidNo documentation available
- hasFollower(): Promise<boolean>identifier: string,followerId: URLNo documentation available
- lockFollowRequest(): Promise<void>sql: Queryable,identifier: string,followId: URLNo documentation available
- lockFollower(): Promise<void>sql: Queryable,identifier: string,followerId: stringNo documentation available
- lockFollowers(): Promise<void>sql: Queryable,identifier: string,followerIds: readonly string[]No documentation available
- migrate(identifier: string): Promise<void>
Migrates data stored by @fedify/botkit-postgres 0.4, which was not scoped by bot actor identifiers, so that it belongs to the given identifier. Rows carried over from a legacy schema have the empty-string bot ID; this method assigns them to the identifier in a single transaction. It only acts when the schema was actually upgraded from a legacy layout, so data legitimately stored under an empty-string identifier is never touched, and calling it again is a no-op.
- ownsSql: booleanNo documentation available
- prepare: booleanNo documentation available
- query<TRow extends object>(): Promise<readonly TRow[]>sql: Queryable,query: string,parameters?: readonly QueryParameter[]No documentation available
- ready: Promise<void>No documentation available
- removeFollowee(): Promise<Follow | undefined>identifier: string,followeeId: URLNo documentation available
- removeFollower(): Promise<Actor | undefined>identifier: string,followId: URL,followerId: URLNo documentation available
- removeMessage(): Promise<Create | Announce | undefined>identifier: string,id: UuidNo documentation available
- removeQuoteAuthorization(): Promise<QuoteAuthorization | undefined>identifier: string,id: UuidNo documentation available
- removeQuoteAuthorizationReference(): Promise<void>identifier: string,authorization: URLNo documentation available
- removeSentFollow(): Promise<Follow | undefined>identifier: string,id: UuidNo documentation available
- schema: stringNo documentation available
- setKeyPairs(): Promise<void>identifier: string,keyPairs: CryptoKeyPair[]No documentation available
- sql: postgres.SqlNo documentation available
- table(name: string): stringNo documentation available
- updateMessage(): Promise<boolean>identifier: string,id: Uuid,updater: (existing: Create | Announce) =>Create
| Announce
| undefined
| Promise<Create | Announce | undefined>No documentation available - vote(): Promise<void>identifier: string,messageId: Uuid,voterId: URL,option: stringNo documentation available
Functions
f
initializePostgresRepositorySchema(): Promise<void>
sql: TransactionalQueryable,
schema?: string,
prepare?: boolean
Initializes the PostgreSQL schema used by BotKit repositories.
Interfaces
Type Aliases
T
PostgresRepositoryOptions =
PostgresRepositoryOptionsWithClient
| PostgresRepositoryOptionsWithUrl
| PostgresRepositoryOptionsWithUrl
Options for creating a PostgreSQL repository.