From fb3f18d402879f901211d02cd856fd30fcac08cd Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Mon, 25 Dec 2023 17:41:08 +0100 Subject: [PATCH 1/4] remove deprecated app.bsky.unspecced.getPopular lexicon --- lexicons/app/bsky/unspecced/getPopular.json | 40 --------------------- 1 file changed, 40 deletions(-) delete mode 100644 lexicons/app/bsky/unspecced/getPopular.json diff --git a/lexicons/app/bsky/unspecced/getPopular.json b/lexicons/app/bsky/unspecced/getPopular.json deleted file mode 100644 index 61fe26e889f..00000000000 --- a/lexicons/app/bsky/unspecced/getPopular.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "lexicon": 1, - "id": "app.bsky.unspecced.getPopular", - "defs": { - "main": { - "type": "query", - "description": "DEPRECATED: will be removed soon. Use a feed generator alternative.", - "parameters": { - "type": "params", - "properties": { - "includeNsfw": { "type": "boolean", "default": false }, - "limit": { - "type": "integer", - "minimum": 1, - "maximum": 100, - "default": 50 - }, - "cursor": { "type": "string" } - } - }, - "output": { - "encoding": "application/json", - "schema": { - "type": "object", - "required": ["feed"], - "properties": { - "cursor": { "type": "string" }, - "feed": { - "type": "array", - "items": { - "type": "ref", - "ref": "app.bsky.feed.defs#feedViewPost" - } - } - } - } - } - } - } -} From 172e5aaa720b8c8653880bd7ae81bcefca035b5e Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Mon, 25 Dec 2023 17:41:17 +0100 Subject: [PATCH 2/4] codegen --- packages/api/src/client/index.ts | 13 ----- packages/api/src/client/lexicons.ts | 49 ------------------- .../types/app/bsky/unspecced/getPopular.ts | 39 --------------- packages/bsky/src/lexicon/index.ts | 12 ----- packages/bsky/src/lexicon/lexicons.ts | 49 ------------------- .../types/app/bsky/unspecced/getPopular.ts | 49 ------------------- packages/pds/src/lexicon/index.ts | 12 ----- packages/pds/src/lexicon/lexicons.ts | 49 ------------------- .../types/app/bsky/unspecced/getPopular.ts | 49 ------------------- 9 files changed, 321 deletions(-) delete mode 100644 packages/api/src/client/types/app/bsky/unspecced/getPopular.ts delete mode 100644 packages/bsky/src/lexicon/types/app/bsky/unspecced/getPopular.ts delete mode 100644 packages/pds/src/lexicon/types/app/bsky/unspecced/getPopular.ts diff --git a/packages/api/src/client/index.ts b/packages/api/src/client/index.ts index a42dbd9320a..9131ce48005 100644 --- a/packages/api/src/client/index.ts +++ b/packages/api/src/client/index.ts @@ -140,7 +140,6 @@ import * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/ import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen' import * as AppBskyRichtextFacet from './types/app/bsky/richtext/facet' import * as AppBskyUnspeccedDefs from './types/app/bsky/unspecced/defs' -import * as AppBskyUnspeccedGetPopular from './types/app/bsky/unspecced/getPopular' import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators' import * as AppBskyUnspeccedGetTimelineSkeleton from './types/app/bsky/unspecced/getTimelineSkeleton' import * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton' @@ -279,7 +278,6 @@ export * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/ export * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen' export * as AppBskyRichtextFacet from './types/app/bsky/richtext/facet' export * as AppBskyUnspeccedDefs from './types/app/bsky/unspecced/defs' -export * as AppBskyUnspeccedGetPopular from './types/app/bsky/unspecced/getPopular' export * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators' export * as AppBskyUnspeccedGetTimelineSkeleton from './types/app/bsky/unspecced/getTimelineSkeleton' export * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton' @@ -2395,17 +2393,6 @@ export class UnspeccedNS { this._service = service } - getPopular( - params?: AppBskyUnspeccedGetPopular.QueryParams, - opts?: AppBskyUnspeccedGetPopular.CallOptions, - ): Promise { - return this._service.xrpc - .call('app.bsky.unspecced.getPopular', params, undefined, opts) - .catch((e) => { - throw AppBskyUnspeccedGetPopular.toKnownErr(e) - }) - } - getPopularFeedGenerators( params?: AppBskyUnspeccedGetPopularFeedGenerators.QueryParams, opts?: AppBskyUnspeccedGetPopularFeedGenerators.CallOptions, diff --git a/packages/api/src/client/lexicons.ts b/packages/api/src/client/lexicons.ts index 55de861d600..7212b9ac554 100644 --- a/packages/api/src/client/lexicons.ts +++ b/packages/api/src/client/lexicons.ts @@ -7563,54 +7563,6 @@ export const schemaDict = { }, }, }, - AppBskyUnspeccedGetPopular: { - lexicon: 1, - id: 'app.bsky.unspecced.getPopular', - defs: { - main: { - type: 'query', - description: - 'DEPRECATED: will be removed soon. Use a feed generator alternative.', - parameters: { - type: 'params', - properties: { - includeNsfw: { - type: 'boolean', - default: false, - }, - limit: { - type: 'integer', - minimum: 1, - maximum: 100, - default: 50, - }, - cursor: { - type: 'string', - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['feed'], - properties: { - cursor: { - type: 'string', - }, - feed: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:app.bsky.feed.defs#feedViewPost', - }, - }, - }, - }, - }, - }, - }, - }, AppBskyUnspeccedGetPopularFeedGenerators: { lexicon: 1, id: 'app.bsky.unspecced.getPopularFeedGenerators', @@ -7978,7 +7930,6 @@ export const ids = { AppBskyNotificationUpdateSeen: 'app.bsky.notification.updateSeen', AppBskyRichtextFacet: 'app.bsky.richtext.facet', AppBskyUnspeccedDefs: 'app.bsky.unspecced.defs', - AppBskyUnspeccedGetPopular: 'app.bsky.unspecced.getPopular', AppBskyUnspeccedGetPopularFeedGenerators: 'app.bsky.unspecced.getPopularFeedGenerators', AppBskyUnspeccedGetTimelineSkeleton: 'app.bsky.unspecced.getTimelineSkeleton', diff --git a/packages/api/src/client/types/app/bsky/unspecced/getPopular.ts b/packages/api/src/client/types/app/bsky/unspecced/getPopular.ts deleted file mode 100644 index 2556ce1aae7..00000000000 --- a/packages/api/src/client/types/app/bsky/unspecced/getPopular.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * GENERATED CODE - DO NOT MODIFY - */ -import { Headers, XRPCError } from '@atproto/xrpc' -import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { isObj, hasProp } from '../../../../util' -import { lexicons } from '../../../../lexicons' -import { CID } from 'multiformats/cid' -import * as AppBskyFeedDefs from '../feed/defs' - -export interface QueryParams { - includeNsfw?: boolean - limit?: number - cursor?: string -} - -export type InputSchema = undefined - -export interface OutputSchema { - cursor?: string - feed: AppBskyFeedDefs.FeedViewPost[] - [k: string]: unknown -} - -export interface CallOptions { - headers?: Headers -} - -export interface Response { - success: boolean - headers: Headers - data: OutputSchema -} - -export function toKnownErr(e: any) { - if (e instanceof XRPCError) { - } - return e -} diff --git a/packages/bsky/src/lexicon/index.ts b/packages/bsky/src/lexicon/index.ts index c51998a66e6..1fc0c3661b8 100644 --- a/packages/bsky/src/lexicon/index.ts +++ b/packages/bsky/src/lexicon/index.ts @@ -117,7 +117,6 @@ import * as AppBskyNotificationGetUnreadCount from './types/app/bsky/notificatio import * as AppBskyNotificationListNotifications from './types/app/bsky/notification/listNotifications' import * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/registerPush' import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen' -import * as AppBskyUnspeccedGetPopular from './types/app/bsky/unspecced/getPopular' import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators' import * as AppBskyUnspeccedGetTimelineSkeleton from './types/app/bsky/unspecced/getTimelineSkeleton' import * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton' @@ -1530,17 +1529,6 @@ export class UnspeccedNS { this._server = server } - getPopular( - cfg: ConfigOf< - AV, - AppBskyUnspeccedGetPopular.Handler>, - AppBskyUnspeccedGetPopular.HandlerReqCtx> - >, - ) { - const nsid = 'app.bsky.unspecced.getPopular' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - getPopularFeedGenerators( cfg: ConfigOf< AV, diff --git a/packages/bsky/src/lexicon/lexicons.ts b/packages/bsky/src/lexicon/lexicons.ts index 55de861d600..7212b9ac554 100644 --- a/packages/bsky/src/lexicon/lexicons.ts +++ b/packages/bsky/src/lexicon/lexicons.ts @@ -7563,54 +7563,6 @@ export const schemaDict = { }, }, }, - AppBskyUnspeccedGetPopular: { - lexicon: 1, - id: 'app.bsky.unspecced.getPopular', - defs: { - main: { - type: 'query', - description: - 'DEPRECATED: will be removed soon. Use a feed generator alternative.', - parameters: { - type: 'params', - properties: { - includeNsfw: { - type: 'boolean', - default: false, - }, - limit: { - type: 'integer', - minimum: 1, - maximum: 100, - default: 50, - }, - cursor: { - type: 'string', - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['feed'], - properties: { - cursor: { - type: 'string', - }, - feed: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:app.bsky.feed.defs#feedViewPost', - }, - }, - }, - }, - }, - }, - }, - }, AppBskyUnspeccedGetPopularFeedGenerators: { lexicon: 1, id: 'app.bsky.unspecced.getPopularFeedGenerators', @@ -7978,7 +7930,6 @@ export const ids = { AppBskyNotificationUpdateSeen: 'app.bsky.notification.updateSeen', AppBskyRichtextFacet: 'app.bsky.richtext.facet', AppBskyUnspeccedDefs: 'app.bsky.unspecced.defs', - AppBskyUnspeccedGetPopular: 'app.bsky.unspecced.getPopular', AppBskyUnspeccedGetPopularFeedGenerators: 'app.bsky.unspecced.getPopularFeedGenerators', AppBskyUnspeccedGetTimelineSkeleton: 'app.bsky.unspecced.getTimelineSkeleton', diff --git a/packages/bsky/src/lexicon/types/app/bsky/unspecced/getPopular.ts b/packages/bsky/src/lexicon/types/app/bsky/unspecced/getPopular.ts deleted file mode 100644 index 8471ed77a6c..00000000000 --- a/packages/bsky/src/lexicon/types/app/bsky/unspecced/getPopular.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * GENERATED CODE - DO NOT MODIFY - */ -import express from 'express' -import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { lexicons } from '../../../../lexicons' -import { isObj, hasProp } from '../../../../util' -import { CID } from 'multiformats/cid' -import { HandlerAuth } from '@atproto/xrpc-server' -import * as AppBskyFeedDefs from '../feed/defs' - -export interface QueryParams { - includeNsfw: boolean - limit: number - cursor?: string -} - -export type InputSchema = undefined - -export interface OutputSchema { - cursor?: string - feed: AppBskyFeedDefs.FeedViewPost[] - [k: string]: unknown -} - -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 -export type HandlerReqCtx = { - auth: HA - params: QueryParams - input: HandlerInput - req: express.Request - res: express.Response -} -export type Handler = ( - ctx: HandlerReqCtx, -) => Promise | HandlerOutput diff --git a/packages/pds/src/lexicon/index.ts b/packages/pds/src/lexicon/index.ts index c51998a66e6..1fc0c3661b8 100644 --- a/packages/pds/src/lexicon/index.ts +++ b/packages/pds/src/lexicon/index.ts @@ -117,7 +117,6 @@ import * as AppBskyNotificationGetUnreadCount from './types/app/bsky/notificatio import * as AppBskyNotificationListNotifications from './types/app/bsky/notification/listNotifications' import * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/registerPush' import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen' -import * as AppBskyUnspeccedGetPopular from './types/app/bsky/unspecced/getPopular' import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators' import * as AppBskyUnspeccedGetTimelineSkeleton from './types/app/bsky/unspecced/getTimelineSkeleton' import * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton' @@ -1530,17 +1529,6 @@ export class UnspeccedNS { this._server = server } - getPopular( - cfg: ConfigOf< - AV, - AppBskyUnspeccedGetPopular.Handler>, - AppBskyUnspeccedGetPopular.HandlerReqCtx> - >, - ) { - const nsid = 'app.bsky.unspecced.getPopular' // @ts-ignore - return this._server.xrpc.method(nsid, cfg) - } - getPopularFeedGenerators( cfg: ConfigOf< AV, diff --git a/packages/pds/src/lexicon/lexicons.ts b/packages/pds/src/lexicon/lexicons.ts index 55de861d600..7212b9ac554 100644 --- a/packages/pds/src/lexicon/lexicons.ts +++ b/packages/pds/src/lexicon/lexicons.ts @@ -7563,54 +7563,6 @@ export const schemaDict = { }, }, }, - AppBskyUnspeccedGetPopular: { - lexicon: 1, - id: 'app.bsky.unspecced.getPopular', - defs: { - main: { - type: 'query', - description: - 'DEPRECATED: will be removed soon. Use a feed generator alternative.', - parameters: { - type: 'params', - properties: { - includeNsfw: { - type: 'boolean', - default: false, - }, - limit: { - type: 'integer', - minimum: 1, - maximum: 100, - default: 50, - }, - cursor: { - type: 'string', - }, - }, - }, - output: { - encoding: 'application/json', - schema: { - type: 'object', - required: ['feed'], - properties: { - cursor: { - type: 'string', - }, - feed: { - type: 'array', - items: { - type: 'ref', - ref: 'lex:app.bsky.feed.defs#feedViewPost', - }, - }, - }, - }, - }, - }, - }, - }, AppBskyUnspeccedGetPopularFeedGenerators: { lexicon: 1, id: 'app.bsky.unspecced.getPopularFeedGenerators', @@ -7978,7 +7930,6 @@ export const ids = { AppBskyNotificationUpdateSeen: 'app.bsky.notification.updateSeen', AppBskyRichtextFacet: 'app.bsky.richtext.facet', AppBskyUnspeccedDefs: 'app.bsky.unspecced.defs', - AppBskyUnspeccedGetPopular: 'app.bsky.unspecced.getPopular', AppBskyUnspeccedGetPopularFeedGenerators: 'app.bsky.unspecced.getPopularFeedGenerators', AppBskyUnspeccedGetTimelineSkeleton: 'app.bsky.unspecced.getTimelineSkeleton', diff --git a/packages/pds/src/lexicon/types/app/bsky/unspecced/getPopular.ts b/packages/pds/src/lexicon/types/app/bsky/unspecced/getPopular.ts deleted file mode 100644 index 8471ed77a6c..00000000000 --- a/packages/pds/src/lexicon/types/app/bsky/unspecced/getPopular.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * GENERATED CODE - DO NOT MODIFY - */ -import express from 'express' -import { ValidationResult, BlobRef } from '@atproto/lexicon' -import { lexicons } from '../../../../lexicons' -import { isObj, hasProp } from '../../../../util' -import { CID } from 'multiformats/cid' -import { HandlerAuth } from '@atproto/xrpc-server' -import * as AppBskyFeedDefs from '../feed/defs' - -export interface QueryParams { - includeNsfw: boolean - limit: number - cursor?: string -} - -export type InputSchema = undefined - -export interface OutputSchema { - cursor?: string - feed: AppBskyFeedDefs.FeedViewPost[] - [k: string]: unknown -} - -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 -export type HandlerReqCtx = { - auth: HA - params: QueryParams - input: HandlerInput - req: express.Request - res: express.Response -} -export type Handler = ( - ctx: HandlerReqCtx, -) => Promise | HandlerOutput From a631181646a74702e763c6db9f79a2d0aea151fb Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Mon, 25 Dec 2023 17:48:54 +0100 Subject: [PATCH 3/4] remove remaining references to getPopular --- .../src/api/app/bsky/unspecced/getPopular.ts | 23 ------------------- .../pds/src/api/app/bsky/unspecced/index.ts | 2 -- 2 files changed, 25 deletions(-) delete mode 100644 packages/pds/src/api/app/bsky/unspecced/getPopular.ts diff --git a/packages/pds/src/api/app/bsky/unspecced/getPopular.ts b/packages/pds/src/api/app/bsky/unspecced/getPopular.ts deleted file mode 100644 index 0ba5a8f7b60..00000000000 --- a/packages/pds/src/api/app/bsky/unspecced/getPopular.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Server } from '../../../../lexicon' -import AppContext from '../../../../context' - -// THIS IS A TEMPORARY UNSPECCED ROUTE -export default function (server: Server, ctx: AppContext) { - server.app.bsky.unspecced.getPopular({ - auth: ctx.authVerifier.access, - handler: async ({ auth, params }) => { - const requester = auth.credentials.did - const HOT_CLASSIC_URI = - 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/hot-classic' - const HOT_CLASSIC_DID = 'did:plc:5fllqkujj6kqp5izd5jg7gox' - const res = await ctx.appViewAgent.api.app.bsky.feed.getFeed( - { feed: HOT_CLASSIC_URI, limit: params.limit, cursor: params.cursor }, - await ctx.serviceAuthHeaders(requester, HOT_CLASSIC_DID), - ) - return { - encoding: 'application/json', - body: res.data, - } - }, - }) -} diff --git a/packages/pds/src/api/app/bsky/unspecced/index.ts b/packages/pds/src/api/app/bsky/unspecced/index.ts index 6951400863d..208efcc93a9 100644 --- a/packages/pds/src/api/app/bsky/unspecced/index.ts +++ b/packages/pds/src/api/app/bsky/unspecced/index.ts @@ -1,10 +1,8 @@ import { Server } from '../../../../lexicon' import AppContext from '../../../../context' -import getPopular from './getPopular' import getPopularFeedGenerators from './getPopularFeedGenerators' // THIS IS A TEMPORARY UNSPECCED ROUTE export default function (server: Server, ctx: AppContext) { - getPopular(server, ctx) getPopularFeedGenerators(server, ctx) } From 7fb8b2e4b56d4f34df8d52f6ec214222ef3328f9 Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Mon, 25 Dec 2023 17:51:31 +0100 Subject: [PATCH 4/4] changeset for getPopular removal --- .changeset/rich-turkeys-buy.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changeset/rich-turkeys-buy.md diff --git a/.changeset/rich-turkeys-buy.md b/.changeset/rich-turkeys-buy.md new file mode 100644 index 00000000000..98505f04aee --- /dev/null +++ b/.changeset/rich-turkeys-buy.md @@ -0,0 +1,7 @@ +--- +'@atproto/bsky': patch +'@atproto/api': patch +'@atproto/pds': patch +--- + +remove deprecated app.bsky.unspecced.getPopular endpoint