diff --git a/apps/api/lexicons/feed/defs.json b/apps/api/lexicons/feed/defs.json index 2c404d15..540047b1 100644 --- a/apps/api/lexicons/feed/defs.json +++ b/apps/api/lexicons/feed/defs.json @@ -100,6 +100,44 @@ } } } + }, + "feedGeneratorsView": { + "type": "object", + "properties": { + "feeds": { + "type": "array", + "items": { + "type": "ref", + "ref": "app.rocksky.feed.defs#feedGeneratorView" + } + } + } + }, + "feedGeneratorView": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "avatar": { + "type": "string", + "format": "uri" + }, + "creator": { + "type": "ref", + "ref": "app.rocksky.actor.defs#profileViewBasic" + } + } } } } diff --git a/apps/api/lexicons/feed/getFeedGenerators.json b/apps/api/lexicons/feed/getFeedGenerators.json new file mode 100644 index 00000000..174784b3 --- /dev/null +++ b/apps/api/lexicons/feed/getFeedGenerators.json @@ -0,0 +1,27 @@ +{ + "lexicon": 1, + "id": "app.rocksky.feed.getFeedGenerators", + "defs": { + "main": { + "type": "query", + "description": "Get all feed generators", + "parameters": { + "type": "params", + "properties": { + "size": { + "type": "integer", + "description": "The maximum number of feed generators to return.", + "minimum": 1 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "app.rocksky.feed.defs#feedGeneratorsView" + } + } + } + } +} diff --git a/apps/api/pkl/defs/feed/defs.pkl b/apps/api/pkl/defs/feed/defs.pkl index 99e4a62f..3a63a554 100644 --- a/apps/api/pkl/defs/feed/defs.pkl +++ b/apps/api/pkl/defs/feed/defs.pkl @@ -103,4 +103,42 @@ defs = new Mapping { } } } + ["feedGeneratorsView"] = new ObjectType { + type = "object" + properties { + ["feeds"] = new Array { + type = "array" + items = new Ref { + type = "ref" + ref = "app.rocksky.feed.defs#feedGeneratorView" + } + } + } + } + ["feedGeneratorView"] = new ObjectType { + type = "object" + properties { + ["id"] = new StringType { + type = "string" + } + ["name"] = new StringType { + type = "string" + } + ["description"] = new StringType { + type = "string" + } + ["uri"] = new StringType { + type = "string" + format = "at-uri" + } + ["avatar"] = new StringType { + type = "string" + format = "uri" + } + ["creator"] = new Ref { + type = "ref" + ref = "app.rocksky.actor.defs#profileViewBasic" + } + } + } } \ No newline at end of file diff --git a/apps/api/pkl/defs/feed/getFeedGenerators.pkl b/apps/api/pkl/defs/feed/getFeedGenerators.pkl new file mode 100644 index 00000000..497861d2 --- /dev/null +++ b/apps/api/pkl/defs/feed/getFeedGenerators.pkl @@ -0,0 +1,27 @@ +amends "../../schema/lexicon.pkl" + +lexicon = 1 +id = "app.rocksky.feed.getFeedGenerators" +defs = new Mapping { + ["main"] { + type = "query" + description = "Get all feed generators" + parameters { + type = "params" + properties { + ["size"] = new IntegerType { + type = "integer" + description = "The maximum number of feed generators to return." + minimum = 1 + } + } + } + output { + encoding = "application/json" + schema = new Ref { + type = "ref" + ref = "app.rocksky.feed.defs#feedGeneratorsView" + } + } + } +} \ No newline at end of file diff --git a/apps/api/src/lexicon/index.ts b/apps/api/src/lexicon/index.ts index e7a95afe..0422d766 100644 --- a/apps/api/src/lexicon/index.ts +++ b/apps/api/src/lexicon/index.ts @@ -22,8 +22,8 @@ import type * as AppRockskyActorGetActorScrobbles from "./types/app/rocksky/acto import type * as AppRockskyActorGetActorSongs from "./types/app/rocksky/actor/getActorSongs"; import type * as AppRockskyActorGetProfile from "./types/app/rocksky/actor/getProfile"; import type * as AppRockskyAlbumGetAlbum from "./types/app/rocksky/album/getAlbum"; -import type * as AppRockskyAlbumGetAlbumTracks from "./types/app/rocksky/album/getAlbumTracks"; import type * as AppRockskyAlbumGetAlbums from "./types/app/rocksky/album/getAlbums"; +import type * as AppRockskyAlbumGetAlbumTracks from "./types/app/rocksky/album/getAlbumTracks"; import type * as AppRockskyApikeyCreateApikey from "./types/app/rocksky/apikey/createApikey"; import type * as AppRockskyApikeyGetApikeys from "./types/app/rocksky/apikey/getApikeys"; import type * as AppRockskyApikeyRemoveApikey from "./types/app/rocksky/apikey/removeApikey"; @@ -31,13 +31,14 @@ import type * as AppRockskyApikeyUpdateApikey from "./types/app/rocksky/apikey/u import type * as AppRockskyArtistGetArtist from "./types/app/rocksky/artist/getArtist"; import type * as AppRockskyArtistGetArtistAlbums from "./types/app/rocksky/artist/getArtistAlbums"; import type * as AppRockskyArtistGetArtistListeners from "./types/app/rocksky/artist/getArtistListeners"; -import type * as AppRockskyArtistGetArtistTracks from "./types/app/rocksky/artist/getArtistTracks"; import type * as AppRockskyArtistGetArtists from "./types/app/rocksky/artist/getArtists"; +import type * as AppRockskyArtistGetArtistTracks from "./types/app/rocksky/artist/getArtistTracks"; import type * as AppRockskyChartsGetScrobblesChart from "./types/app/rocksky/charts/getScrobblesChart"; import type * as AppRockskyDropboxDownloadFile from "./types/app/rocksky/dropbox/downloadFile"; import type * as AppRockskyDropboxGetFiles from "./types/app/rocksky/dropbox/getFiles"; import type * as AppRockskyDropboxGetMetadata from "./types/app/rocksky/dropbox/getMetadata"; import type * as AppRockskyDropboxGetTemporaryLink from "./types/app/rocksky/dropbox/getTemporaryLink"; +import type * as AppRockskyFeedGetFeedGenerators from "./types/app/rocksky/feed/getFeedGenerators"; import type * as AppRockskyFeedGetNowPlayings from "./types/app/rocksky/feed/getNowPlayings"; import type * as AppRockskyFeedSearch from "./types/app/rocksky/feed/search"; import type * as AppRockskyGoogledriveDownloadFile from "./types/app/rocksky/googledrive/downloadFile"; @@ -365,25 +366,25 @@ export class AppRockskyAlbumNS { return this._server.xrpc.method(nsid, cfg); } - getAlbumTracks( + getAlbums( cfg: ConfigOf< AV, - AppRockskyAlbumGetAlbumTracks.Handler>, - AppRockskyAlbumGetAlbumTracks.HandlerReqCtx> + AppRockskyAlbumGetAlbums.Handler>, + AppRockskyAlbumGetAlbums.HandlerReqCtx> >, ) { - const nsid = "app.rocksky.album.getAlbumTracks"; // @ts-ignore + const nsid = "app.rocksky.album.getAlbums"; // @ts-ignore return this._server.xrpc.method(nsid, cfg); } - getAlbums( + getAlbumTracks( cfg: ConfigOf< AV, - AppRockskyAlbumGetAlbums.Handler>, - AppRockskyAlbumGetAlbums.HandlerReqCtx> + AppRockskyAlbumGetAlbumTracks.Handler>, + AppRockskyAlbumGetAlbumTracks.HandlerReqCtx> >, ) { - const nsid = "app.rocksky.album.getAlbums"; // @ts-ignore + const nsid = "app.rocksky.album.getAlbumTracks"; // @ts-ignore return this._server.xrpc.method(nsid, cfg); } } @@ -480,25 +481,25 @@ export class AppRockskyArtistNS { return this._server.xrpc.method(nsid, cfg); } - getArtistTracks( + getArtists( cfg: ConfigOf< AV, - AppRockskyArtistGetArtistTracks.Handler>, - AppRockskyArtistGetArtistTracks.HandlerReqCtx> + AppRockskyArtistGetArtists.Handler>, + AppRockskyArtistGetArtists.HandlerReqCtx> >, ) { - const nsid = "app.rocksky.artist.getArtistTracks"; // @ts-ignore + const nsid = "app.rocksky.artist.getArtists"; // @ts-ignore return this._server.xrpc.method(nsid, cfg); } - getArtists( + getArtistTracks( cfg: ConfigOf< AV, - AppRockskyArtistGetArtists.Handler>, - AppRockskyArtistGetArtists.HandlerReqCtx> + AppRockskyArtistGetArtistTracks.Handler>, + AppRockskyArtistGetArtistTracks.HandlerReqCtx> >, ) { - const nsid = "app.rocksky.artist.getArtists"; // @ts-ignore + const nsid = "app.rocksky.artist.getArtistTracks"; // @ts-ignore return this._server.xrpc.method(nsid, cfg); } } @@ -581,6 +582,17 @@ export class AppRockskyFeedNS { this._server = server; } + getFeedGenerators( + cfg: ConfigOf< + AV, + AppRockskyFeedGetFeedGenerators.Handler>, + AppRockskyFeedGetFeedGenerators.HandlerReqCtx> + >, + ) { + const nsid = "app.rocksky.feed.getFeedGenerators"; // @ts-ignore + return this._server.xrpc.method(nsid, cfg); + } + getNowPlayings( cfg: ConfigOf< AV, diff --git a/apps/api/src/lexicon/lexicons.ts b/apps/api/src/lexicon/lexicons.ts index e7b51774..c28e7a61 100644 --- a/apps/api/src/lexicon/lexicons.ts +++ b/apps/api/src/lexicon/lexicons.ts @@ -1267,21 +1267,25 @@ export const schemaDict = { }, }, }, - AppRockskyAlbumGetAlbumTracks: { + AppRockskyAlbumGetAlbums: { lexicon: 1, - id: "app.rocksky.album.getAlbumTracks", + id: "app.rocksky.album.getAlbums", defs: { main: { type: "query", - description: "Get tracks for an album", + description: "Get albums", parameters: { type: "params", - required: ["uri"], properties: { - uri: { - type: "string", - description: "The URI of the album to retrieve tracks from", - format: "at-uri", + limit: { + type: "integer", + description: "The maximum number of albums to return", + minimum: 1, + }, + offset: { + type: "integer", + description: "The offset for pagination", + minimum: 0, }, }, }, @@ -1290,11 +1294,11 @@ export const schemaDict = { schema: { type: "object", properties: { - tracks: { + albums: { type: "array", items: { type: "ref", - ref: "lex:app.rocksky.song.defs#songViewBasic", + ref: "lex:app.rocksky.album.defs#albumViewBasic", }, }, }, @@ -1303,25 +1307,21 @@ export const schemaDict = { }, }, }, - AppRockskyAlbumGetAlbums: { + AppRockskyAlbumGetAlbumTracks: { lexicon: 1, - id: "app.rocksky.album.getAlbums", + id: "app.rocksky.album.getAlbumTracks", defs: { main: { type: "query", - description: "Get albums", + description: "Get tracks for an album", parameters: { type: "params", + required: ["uri"], properties: { - limit: { - type: "integer", - description: "The maximum number of albums to return", - minimum: 1, - }, - offset: { - type: "integer", - description: "The offset for pagination", - minimum: 0, + uri: { + type: "string", + description: "The URI of the album to retrieve tracks from", + format: "at-uri", }, }, }, @@ -1330,11 +1330,11 @@ export const schemaDict = { schema: { type: "object", properties: { - albums: { + tracks: { type: "array", items: { type: "ref", - ref: "lex:app.rocksky.album.defs#albumViewBasic", + ref: "lex:app.rocksky.song.defs#songViewBasic", }, }, }, @@ -1845,24 +1845,19 @@ export const schemaDict = { }, }, }, - AppRockskyArtistGetArtistTracks: { + AppRockskyArtistGetArtists: { lexicon: 1, - id: "app.rocksky.artist.getArtistTracks", + id: "app.rocksky.artist.getArtists", defs: { main: { type: "query", - description: "Get artist's tracks", + description: "Get artists", parameters: { type: "params", properties: { - uri: { - type: "string", - description: "The URI of the artist to retrieve albums from", - format: "at-uri", - }, limit: { type: "integer", - description: "The maximum number of tracks to return", + description: "The maximum number of artists to return", minimum: 1, }, offset: { @@ -1870,6 +1865,10 @@ export const schemaDict = { description: "The offset for pagination", minimum: 0, }, + names: { + type: "string", + description: "The names of the artists to return", + }, }, }, output: { @@ -1877,11 +1876,11 @@ export const schemaDict = { schema: { type: "object", properties: { - tracks: { + artists: { type: "array", items: { type: "ref", - ref: "lex:app.rocksky.song.defs#songViewBasic", + ref: "lex:app.rocksky.artist.defs#artistViewBasic", }, }, }, @@ -1890,19 +1889,24 @@ export const schemaDict = { }, }, }, - AppRockskyArtistGetArtists: { + AppRockskyArtistGetArtistTracks: { lexicon: 1, - id: "app.rocksky.artist.getArtists", + id: "app.rocksky.artist.getArtistTracks", defs: { main: { type: "query", - description: "Get artists", + description: "Get artist's tracks", parameters: { type: "params", properties: { + uri: { + type: "string", + description: "The URI of the artist to retrieve albums from", + format: "at-uri", + }, limit: { type: "integer", - description: "The maximum number of artists to return", + description: "The maximum number of tracks to return", minimum: 1, }, offset: { @@ -1910,10 +1914,6 @@ export const schemaDict = { description: "The offset for pagination", minimum: 0, }, - names: { - type: "string", - description: "The names of the artists to return", - }, }, }, output: { @@ -1921,11 +1921,11 @@ export const schemaDict = { schema: { type: "object", properties: { - artists: { + tracks: { type: "array", items: { type: "ref", - ref: "lex:app.rocksky.artist.defs#artistViewBasic", + ref: "lex:app.rocksky.song.defs#songViewBasic", }, }, }, @@ -2276,6 +2276,44 @@ export const schemaDict = { }, }, }, + feedGeneratorsView: { + type: "object", + properties: { + feeds: { + type: "array", + items: { + type: "ref", + ref: "lex:app.rocksky.feed.defs#feedGeneratorView", + }, + }, + }, + }, + feedGeneratorView: { + type: "object", + properties: { + id: { + type: "string", + }, + name: { + type: "string", + }, + description: { + type: "string", + }, + uri: { + type: "string", + format: "at-uri", + }, + avatar: { + type: "string", + format: "uri", + }, + creator: { + type: "ref", + ref: "lex:app.rocksky.actor.defs#profileViewBasic", + }, + }, + }, }, }, AppRockskyFeedGenerator: { @@ -2319,6 +2357,33 @@ export const schemaDict = { }, }, }, + AppRockskyFeedGetFeedGenerators: { + lexicon: 1, + id: "app.rocksky.feed.getFeedGenerators", + defs: { + main: { + type: "query", + description: "Get all feed generators", + parameters: { + type: "params", + properties: { + size: { + type: "integer", + description: "The maximum number of feed generators to return.", + minimum: 1, + }, + }, + }, + output: { + encoding: "application/json", + schema: { + type: "ref", + ref: "lex:app.rocksky.feed.defs#feedGeneratorsView", + }, + }, + }, + }, + }, AppRockskyFeedGetNowPlayings: { lexicon: 1, id: "app.rocksky.feed.getNowPlayings", @@ -5103,8 +5168,8 @@ export const ids = { AppRockskyAlbum: "app.rocksky.album", AppRockskyAlbumDefs: "app.rocksky.album.defs", AppRockskyAlbumGetAlbum: "app.rocksky.album.getAlbum", - AppRockskyAlbumGetAlbumTracks: "app.rocksky.album.getAlbumTracks", AppRockskyAlbumGetAlbums: "app.rocksky.album.getAlbums", + AppRockskyAlbumGetAlbumTracks: "app.rocksky.album.getAlbumTracks", AppRockskyApikeyCreateApikey: "app.rocksky.apikey.createApikey", AppRockskyApikeyDefs: "app.rocksky.apikey.defs", AppRockskyApikeysDefs: "app.rocksky.apikeys.defs", @@ -5116,8 +5181,8 @@ export const ids = { AppRockskyArtistGetArtist: "app.rocksky.artist.getArtist", AppRockskyArtistGetArtistAlbums: "app.rocksky.artist.getArtistAlbums", AppRockskyArtistGetArtistListeners: "app.rocksky.artist.getArtistListeners", - AppRockskyArtistGetArtistTracks: "app.rocksky.artist.getArtistTracks", AppRockskyArtistGetArtists: "app.rocksky.artist.getArtists", + AppRockskyArtistGetArtistTracks: "app.rocksky.artist.getArtistTracks", AppRockskyChartsDefs: "app.rocksky.charts.defs", AppRockskyChartsGetScrobblesChart: "app.rocksky.charts.getScrobblesChart", AppRockskyDropboxDefs: "app.rocksky.dropbox.defs", @@ -5127,6 +5192,7 @@ export const ids = { AppRockskyDropboxGetTemporaryLink: "app.rocksky.dropbox.getTemporaryLink", AppRockskyFeedDefs: "app.rocksky.feed.defs", AppRockskyFeedGenerator: "app.rocksky.feed.generator", + AppRockskyFeedGetFeedGenerators: "app.rocksky.feed.getFeedGenerators", AppRockskyFeedGetNowPlayings: "app.rocksky.feed.getNowPlayings", AppRockskyFeedSearch: "app.rocksky.feed.search", AppRockskyGoogledriveDefs: "app.rocksky.googledrive.defs", diff --git a/apps/api/src/lexicon/types/app/rocksky/feed/defs.ts b/apps/api/src/lexicon/types/app/rocksky/feed/defs.ts index 6db0f337..78efaeea 100644 --- a/apps/api/src/lexicon/types/app/rocksky/feed/defs.ts +++ b/apps/api/src/lexicon/types/app/rocksky/feed/defs.ts @@ -86,3 +86,42 @@ export function isNowPlayingsView(v: unknown): v is NowPlayingsView { export function validateNowPlayingsView(v: unknown): ValidationResult { return lexicons.validate("app.rocksky.feed.defs#nowPlayingsView", v); } + +export interface FeedGeneratorsView { + feeds?: FeedGeneratorView[]; + [k: string]: unknown; +} + +export function isFeedGeneratorsView(v: unknown): v is FeedGeneratorsView { + return ( + isObj(v) && + hasProp(v, "$type") && + v.$type === "app.rocksky.feed.defs#feedGeneratorsView" + ); +} + +export function validateFeedGeneratorsView(v: unknown): ValidationResult { + return lexicons.validate("app.rocksky.feed.defs#feedGeneratorsView", v); +} + +export interface FeedGeneratorView { + id?: string; + name?: string; + description?: string; + uri?: string; + avatar?: string; + creator?: AppRockskyActorDefs.ProfileViewBasic; + [k: string]: unknown; +} + +export function isFeedGeneratorView(v: unknown): v is FeedGeneratorView { + return ( + isObj(v) && + hasProp(v, "$type") && + v.$type === "app.rocksky.feed.defs#feedGeneratorView" + ); +} + +export function validateFeedGeneratorView(v: unknown): ValidationResult { + return lexicons.validate("app.rocksky.feed.defs#feedGeneratorView", v); +} diff --git a/apps/api/src/lexicon/types/app/rocksky/feed/getFeedGenerators.ts b/apps/api/src/lexicon/types/app/rocksky/feed/getFeedGenerators.ts new file mode 100644 index 00000000..bf457916 --- /dev/null +++ b/apps/api/src/lexicon/types/app/rocksky/feed/getFeedGenerators.ts @@ -0,0 +1,43 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import type express from "express"; +import { ValidationResult, BlobRef } from "@atproto/lexicon"; +import { lexicons } from "../../../../lexicons"; +import { isObj, hasProp } from "../../../../util"; +import { CID } from "multiformats/cid"; +import type { HandlerAuth, HandlerPipeThrough } from "@atproto/xrpc-server"; +import type * as AppRockskyFeedDefs from "./defs"; + +export interface QueryParams { + /** The maximum number of feed generators to return. */ + size?: number; +} + +export type InputSchema = undefined; +export type OutputSchema = AppRockskyFeedDefs.FeedGeneratorsView; +export type HandlerInput = undefined; + +export interface HandlerSuccess { + encoding: "application/json"; + body: OutputSchema; + headers?: { [key: string]: string }; +} + +export interface HandlerError { + status: number; + message?: string; +} + +export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough; +export type HandlerReqCtx = { + auth: HA; + params: QueryParams; + input: HandlerInput; + req: express.Request; + res: express.Response; + resetRouteRateLimits: () => Promise; +}; +export type Handler = ( + ctx: HandlerReqCtx, +) => Promise | HandlerOutput; diff --git a/apps/api/src/schema/feeds.ts b/apps/api/src/schema/feeds.ts index 12a10a49..3cab3fd4 100644 --- a/apps/api/src/schema/feeds.ts +++ b/apps/api/src/schema/feeds.ts @@ -4,9 +4,7 @@ import { integer, pgTable, text, timestamp } from "drizzle-orm/pg-core"; import users from "./users"; const feeds = pgTable("feeds", { - id: text("xata_id") - .primaryKey() - .default(sql`xata_id()`), + id: text("xata_id").primaryKey().default(sql`xata_id()`), displayName: text("display_name").notNull(), description: text("description"), did: text("did").notNull(), diff --git a/apps/api/src/scripts/avatar.ts b/apps/api/src/scripts/avatar.ts index dabc1b6c..8ceee14c 100644 --- a/apps/api/src/scripts/avatar.ts +++ b/apps/api/src/scripts/avatar.ts @@ -10,7 +10,7 @@ const BATCH_SIZE = 100; // Process 100 users at a time async function processUser(user: SelectUser) { if (!process.env.SKIP_AVATAR_UPDATE) { const plc = await fetch(`https://plc.directory/${user.did}`).then((res) => - res.json() + res.json(), ); const serviceEndpoint = _.get(plc, "service.0.serviceEndpoint"); @@ -20,7 +20,7 @@ async function processUser(user: SelectUser) { } const profile = await fetch( - `${serviceEndpoint}/xrpc/com.atproto.repo.getRecord?repo=${user.did}&collection=app.bsky.actor.profile&rkey=self` + `${serviceEndpoint}/xrpc/com.atproto.repo.getRecord?repo=${user.did}&collection=app.bsky.actor.profile&rkey=self`, ).then((res) => res.json()); const ref = _.get(profile, "value.avatar.ref.$link"); const type = _.get(profile, "value.avatar.mimeType", "").split("/")[1]; @@ -57,7 +57,7 @@ async function processUser(user: SelectUser) { console.log(userPayload); await ctx.nc.publish( "rocksky.user", - Buffer.from(JSON.stringify(userPayload)) + Buffer.from(JSON.stringify(userPayload)), ); } @@ -95,7 +95,7 @@ if (args.length > 0) { } console.log( - `Processing batch ${Math.floor(offset / BATCH_SIZE) + 1}, users ${offset + 1}-${offset + batch.length}` + `Processing batch ${Math.floor(offset / BATCH_SIZE) + 1}, users ${offset + 1}-${offset + batch.length}`, ); for (const user of batch) { diff --git a/apps/api/src/scripts/feed.ts b/apps/api/src/scripts/feed.ts index f5d78980..cabd1cec 100644 --- a/apps/api/src/scripts/feed.ts +++ b/apps/api/src/scripts/feed.ts @@ -1,6 +1,6 @@ import chalk from "chalk"; import { ctx } from "context"; -import * as FeedGenerator from "lexicon/types/app/rocksky/feed/generator"; +import type * as FeedGenerator from "lexicon/types/app/rocksky/feed/generator"; import { createAgent } from "lib/agent"; import prompts from "prompts"; @@ -42,7 +42,7 @@ const did = await prompts({ if (!/^did:web:[a-zA-Z0-9_.-]{3,30}$/.test(did.value)) { console.error( - "Invalid DID format. It should start with 'did:web:' followed by 3 to 30 alphanumeric characters, underscores, hyphens, or periods." + "Invalid DID format. It should start with 'did:web:' followed by 3 to 30 alphanumeric characters, underscores, hyphens, or periods.", ); process.exit(1); } @@ -55,7 +55,7 @@ const rkey = await prompts({ if (!/^[a-zA-Z0-9_-]{3,30}$/.test(rkey.value)) { console.error( - "Invalid record key. Only alphanumeric characters, underscores, and hyphens are allowed. Length must be between 3 and 30 characters." + "Invalid record key. Only alphanumeric characters, underscores, and hyphens are allowed. Length must be between 3 and 30 characters.", ); process.exit(1); } @@ -67,7 +67,7 @@ console.log("Description:", description.value); console.log("DID:", did.value); console.log("Record key (rkey):", rkey.value); -let confirm = await prompts({ +const confirm = await prompts({ type: "confirm", name: "value", message: "Do you want to proceed?", @@ -88,7 +88,7 @@ if (!userDid.startsWith("did:plc:")) { const agent = await createAgent(ctx.oauthClient, userDid); console.log( - `Writing ${chalk.greenBright("app.rocksky.feed.generator")} record...` + `Writing ${chalk.greenBright("app.rocksky.feed.generator")} record...`, ); const record: FeedGenerator.Record = { diff --git a/apps/api/src/scripts/seed-feed.ts b/apps/api/src/scripts/seed-feed.ts index 1be48989..a9b3424d 100644 --- a/apps/api/src/scripts/seed-feed.ts +++ b/apps/api/src/scripts/seed-feed.ts @@ -4,7 +4,7 @@ import { ctx } from "context"; import { createAgent } from "lib/agent"; import * as FeedGenerator from "lexicon/types/app/rocksky/feed/generator"; import tables from "schema"; -import { InsertFeed } from "schema/feeds"; +import type { InsertFeed } from "schema/feeds"; import { eq } from "drizzle-orm"; const args = process.argv.slice(2); diff --git a/apps/api/src/sqliteKv.ts b/apps/api/src/sqliteKv.ts index 487f3ccc..fab414df 100644 --- a/apps/api/src/sqliteKv.ts +++ b/apps/api/src/sqliteKv.ts @@ -100,7 +100,7 @@ export default defineDriver< oc.column("id").doUpdateSet({ value, updated_at: now, - }) + }), ) .execute(); }, @@ -125,10 +125,10 @@ export default defineDriver< oc.column("id").doUpdateSet({ value, updated_at: now, - }) + }), ) .execute(); - }) + }), ); }); }, @@ -169,5 +169,5 @@ export default defineDriver< await getDb().destroy(); }, }; - } + }, );