Skip to content

Commit

Permalink
codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
estrattonbailey committed Aug 22, 2023
1 parent 7364f17 commit 98cc8c5
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 81 deletions.
26 changes: 13 additions & 13 deletions packages/api/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ import * as AppBskyFeedDefs from './types/app/bsky/feed/defs'
import * as AppBskyFeedDescribeFeedGenerator from './types/app/bsky/feed/describeFeedGenerator'
import * as AppBskyFeedGenerator from './types/app/bsky/feed/generator'
import * as AppBskyFeedGetActorFeeds from './types/app/bsky/feed/getActorFeeds'
import * as AppBskyFeedGetAuthorFeed from './types/app/bsky/feed/getAuthorFeed'
import * as AppBskyFeedGetActorLikes from './types/app/bsky/feed/getActorLikes'
import * as AppBskyFeedGetAuthorFeed from './types/app/bsky/feed/getAuthorFeed'
import * as AppBskyFeedGetFeed from './types/app/bsky/feed/getFeed'
import * as AppBskyFeedGetFeedGenerator from './types/app/bsky/feed/getFeedGenerator'
import * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGenerators'
Expand Down Expand Up @@ -210,8 +210,8 @@ export * as AppBskyFeedDefs from './types/app/bsky/feed/defs'
export * as AppBskyFeedDescribeFeedGenerator from './types/app/bsky/feed/describeFeedGenerator'
export * as AppBskyFeedGenerator from './types/app/bsky/feed/generator'
export * as AppBskyFeedGetActorFeeds from './types/app/bsky/feed/getActorFeeds'
export * as AppBskyFeedGetAuthorFeed from './types/app/bsky/feed/getAuthorFeed'
export * as AppBskyFeedGetActorLikes from './types/app/bsky/feed/getActorLikes'
export * as AppBskyFeedGetAuthorFeed from './types/app/bsky/feed/getAuthorFeed'
export * as AppBskyFeedGetFeed from './types/app/bsky/feed/getFeed'
export * as AppBskyFeedGetFeedGenerator from './types/app/bsky/feed/getFeedGenerator'
export * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGenerators'
Expand Down Expand Up @@ -1248,17 +1248,6 @@ export class FeedNS {
})
}

getAuthorFeed(
params?: AppBskyFeedGetAuthorFeed.QueryParams,
opts?: AppBskyFeedGetAuthorFeed.CallOptions,
): Promise<AppBskyFeedGetAuthorFeed.Response> {
return this._service.xrpc
.call('app.bsky.feed.getAuthorFeed', params, undefined, opts)
.catch((e) => {
throw AppBskyFeedGetAuthorFeed.toKnownErr(e)
})
}

getActorLikes(
params?: AppBskyFeedGetActorLikes.QueryParams,
opts?: AppBskyFeedGetActorLikes.CallOptions,
Expand All @@ -1270,6 +1259,17 @@ export class FeedNS {
})
}

getAuthorFeed(
params?: AppBskyFeedGetAuthorFeed.QueryParams,
opts?: AppBskyFeedGetAuthorFeed.CallOptions,
): Promise<AppBskyFeedGetAuthorFeed.Response> {
return this._service.xrpc
.call('app.bsky.feed.getAuthorFeed', params, undefined, opts)
.catch((e) => {
throw AppBskyFeedGetAuthorFeed.toKnownErr(e)
})
}

getFeed(
params?: AppBskyFeedGetFeed.QueryParams,
opts?: AppBskyFeedGetFeed.CallOptions,
Expand Down
32 changes: 16 additions & 16 deletions packages/api/src/client/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4816,13 +4816,13 @@ export const schemaDict = {
},
},
},
AppBskyFeedGetAuthorFeed: {
AppBskyFeedGetActorLikes: {
lexicon: 1,
id: 'app.bsky.feed.getAuthorFeed',
id: 'app.bsky.feed.getActorLikes',
defs: {
main: {
type: 'query',
description: "A view of an actor's feed.",
description: 'A view of the posts liked by an actor.',
parameters: {
type: 'params',
required: ['actor'],
Expand All @@ -4840,15 +4840,6 @@ export const schemaDict = {
cursor: {
type: 'string',
},
filter: {
type: 'string',
knownValues: [
'posts_with_replies',
'posts_no_replies',
'posts_with_media',
],
default: 'posts_with_replies',
},
},
},
output: {
Expand Down Expand Up @@ -4881,13 +4872,13 @@ export const schemaDict = {
},
},
},
AppBskyFeedGetActorLikes: {
AppBskyFeedGetAuthorFeed: {
lexicon: 1,
id: 'app.bsky.feed.getActorLikes',
id: 'app.bsky.feed.getAuthorFeed',
defs: {
main: {
type: 'query',
description: 'A view of the posts liked by an actor.',
description: "A view of an actor's feed.",
parameters: {
type: 'params',
required: ['actor'],
Expand All @@ -4905,6 +4896,15 @@ export const schemaDict = {
cursor: {
type: 'string',
},
filter: {
type: 'string',
knownValues: [
'posts_with_replies',
'posts_no_replies',
'posts_with_media',
],
default: 'posts_with_replies',
},
},
},
output: {
Expand Down Expand Up @@ -6713,8 +6713,8 @@ export const ids = {
AppBskyFeedDescribeFeedGenerator: 'app.bsky.feed.describeFeedGenerator',
AppBskyFeedGenerator: 'app.bsky.feed.generator',
AppBskyFeedGetActorFeeds: 'app.bsky.feed.getActorFeeds',
AppBskyFeedGetAuthorFeed: 'app.bsky.feed.getAuthorFeed',
AppBskyFeedGetActorLikes: 'app.bsky.feed.getActorLikes',
AppBskyFeedGetAuthorFeed: 'app.bsky.feed.getAuthorFeed',
AppBskyFeedGetFeed: 'app.bsky.feed.getFeed',
AppBskyFeedGetFeedGenerator: 'app.bsky.feed.getFeedGenerator',
AppBskyFeedGetFeedGenerators: 'app.bsky.feed.getFeedGenerators',
Expand Down
20 changes: 12 additions & 8 deletions packages/bsky/src/lexicon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ import * as AppBskyActorSearchActors from './types/app/bsky/actor/searchActors'
import * as AppBskyActorSearchActorsTypeahead from './types/app/bsky/actor/searchActorsTypeahead'
import * as AppBskyFeedDescribeFeedGenerator from './types/app/bsky/feed/describeFeedGenerator'
import * as AppBskyFeedGetActorFeeds from './types/app/bsky/feed/getActorFeeds'
import * as AppBskyFeedGetAuthorFeed from './types/app/bsky/feed/getAuthorFeed'
import * as AppBskyFeedGetActorLikes from './types/app/bsky/feed/getActorLikes'
import * as AppBskyFeedGetAuthorFeed from './types/app/bsky/feed/getAuthorFeed'
import * as AppBskyFeedGetFeed from './types/app/bsky/feed/getFeed'
import * as AppBskyFeedGetFeedGenerator from './types/app/bsky/feed/getFeedGenerator'
import * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGenerators'
Expand Down Expand Up @@ -1044,21 +1044,25 @@ export class FeedNS {
return this._server.xrpc.method(nsid, cfg)
}

getAuthorFeed<AV extends AuthVerifier>(
getActorLikes<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
AppBskyFeedGetAuthorFeed.Handler<ExtractAuth<AV>>,
AppBskyFeedGetAuthorFeed.HandlerReqCtx<ExtractAuth<AV>>
AppBskyFeedGetActorLikes.Handler<ExtractAuth<AV>>,
AppBskyFeedGetActorLikes.HandlerReqCtx<ExtractAuth<AV>>
>,
) {
const nsid = 'app.bsky.feed.getAuthorFeed' // @ts-ignore
const nsid = 'app.bsky.feed.getActorLikes' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}

getActorLikes<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyFeedGetActorLikes.Handler<ExtractAuth<AV>>>,
getAuthorFeed<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
AppBskyFeedGetAuthorFeed.Handler<ExtractAuth<AV>>,
AppBskyFeedGetAuthorFeed.HandlerReqCtx<ExtractAuth<AV>>
>,
) {
const nsid = 'app.bsky.feed.getActorLikes' // @ts-ignore
const nsid = 'app.bsky.feed.getAuthorFeed' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}

Expand Down
32 changes: 16 additions & 16 deletions packages/bsky/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4816,13 +4816,13 @@ export const schemaDict = {
},
},
},
AppBskyFeedGetAuthorFeed: {
AppBskyFeedGetActorLikes: {
lexicon: 1,
id: 'app.bsky.feed.getAuthorFeed',
id: 'app.bsky.feed.getActorLikes',
defs: {
main: {
type: 'query',
description: "A view of an actor's feed.",
description: 'A view of the posts liked by an actor.',
parameters: {
type: 'params',
required: ['actor'],
Expand All @@ -4840,15 +4840,6 @@ export const schemaDict = {
cursor: {
type: 'string',
},
filter: {
type: 'string',
knownValues: [
'posts_with_replies',
'posts_no_replies',
'posts_with_media',
],
default: 'posts_with_replies',
},
},
},
output: {
Expand Down Expand Up @@ -4881,13 +4872,13 @@ export const schemaDict = {
},
},
},
AppBskyFeedGetActorLikes: {
AppBskyFeedGetAuthorFeed: {
lexicon: 1,
id: 'app.bsky.feed.getActorLikes',
id: 'app.bsky.feed.getAuthorFeed',
defs: {
main: {
type: 'query',
description: 'A view of the posts liked by an actor.',
description: "A view of an actor's feed.",
parameters: {
type: 'params',
required: ['actor'],
Expand All @@ -4905,6 +4896,15 @@ export const schemaDict = {
cursor: {
type: 'string',
},
filter: {
type: 'string',
knownValues: [
'posts_with_replies',
'posts_no_replies',
'posts_with_media',
],
default: 'posts_with_replies',
},
},
},
output: {
Expand Down Expand Up @@ -6713,8 +6713,8 @@ export const ids = {
AppBskyFeedDescribeFeedGenerator: 'app.bsky.feed.describeFeedGenerator',
AppBskyFeedGenerator: 'app.bsky.feed.generator',
AppBskyFeedGetActorFeeds: 'app.bsky.feed.getActorFeeds',
AppBskyFeedGetAuthorFeed: 'app.bsky.feed.getAuthorFeed',
AppBskyFeedGetActorLikes: 'app.bsky.feed.getActorLikes',
AppBskyFeedGetAuthorFeed: 'app.bsky.feed.getAuthorFeed',
AppBskyFeedGetFeed: 'app.bsky.feed.getFeed',
AppBskyFeedGetFeedGenerator: 'app.bsky.feed.getFeedGenerator',
AppBskyFeedGetFeedGenerators: 'app.bsky.feed.getFeedGenerators',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ export interface HandlerError {
}

export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput
20 changes: 12 additions & 8 deletions packages/pds/src/lexicon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ import * as AppBskyActorSearchActors from './types/app/bsky/actor/searchActors'
import * as AppBskyActorSearchActorsTypeahead from './types/app/bsky/actor/searchActorsTypeahead'
import * as AppBskyFeedDescribeFeedGenerator from './types/app/bsky/feed/describeFeedGenerator'
import * as AppBskyFeedGetActorFeeds from './types/app/bsky/feed/getActorFeeds'
import * as AppBskyFeedGetAuthorFeed from './types/app/bsky/feed/getAuthorFeed'
import * as AppBskyFeedGetActorLikes from './types/app/bsky/feed/getActorLikes'
import * as AppBskyFeedGetAuthorFeed from './types/app/bsky/feed/getAuthorFeed'
import * as AppBskyFeedGetFeed from './types/app/bsky/feed/getFeed'
import * as AppBskyFeedGetFeedGenerator from './types/app/bsky/feed/getFeedGenerator'
import * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGenerators'
Expand Down Expand Up @@ -1044,21 +1044,25 @@ export class FeedNS {
return this._server.xrpc.method(nsid, cfg)
}

getAuthorFeed<AV extends AuthVerifier>(
getActorLikes<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
AppBskyFeedGetAuthorFeed.Handler<ExtractAuth<AV>>,
AppBskyFeedGetAuthorFeed.HandlerReqCtx<ExtractAuth<AV>>
AppBskyFeedGetActorLikes.Handler<ExtractAuth<AV>>,
AppBskyFeedGetActorLikes.HandlerReqCtx<ExtractAuth<AV>>
>,
) {
const nsid = 'app.bsky.feed.getAuthorFeed' // @ts-ignore
const nsid = 'app.bsky.feed.getActorLikes' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}

getActorLikes<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyFeedGetActorLikes.Handler<ExtractAuth<AV>>>,
getAuthorFeed<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
AppBskyFeedGetAuthorFeed.Handler<ExtractAuth<AV>>,
AppBskyFeedGetAuthorFeed.HandlerReqCtx<ExtractAuth<AV>>
>,
) {
const nsid = 'app.bsky.feed.getActorLikes' // @ts-ignore
const nsid = 'app.bsky.feed.getAuthorFeed' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}

Expand Down
32 changes: 16 additions & 16 deletions packages/pds/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4816,13 +4816,13 @@ export const schemaDict = {
},
},
},
AppBskyFeedGetAuthorFeed: {
AppBskyFeedGetActorLikes: {
lexicon: 1,
id: 'app.bsky.feed.getAuthorFeed',
id: 'app.bsky.feed.getActorLikes',
defs: {
main: {
type: 'query',
description: "A view of an actor's feed.",
description: 'A view of the posts liked by an actor.',
parameters: {
type: 'params',
required: ['actor'],
Expand All @@ -4840,15 +4840,6 @@ export const schemaDict = {
cursor: {
type: 'string',
},
filter: {
type: 'string',
knownValues: [
'posts_with_replies',
'posts_no_replies',
'posts_with_media',
],
default: 'posts_with_replies',
},
},
},
output: {
Expand Down Expand Up @@ -4881,13 +4872,13 @@ export const schemaDict = {
},
},
},
AppBskyFeedGetActorLikes: {
AppBskyFeedGetAuthorFeed: {
lexicon: 1,
id: 'app.bsky.feed.getActorLikes',
id: 'app.bsky.feed.getAuthorFeed',
defs: {
main: {
type: 'query',
description: 'A view of the posts liked by an actor.',
description: "A view of an actor's feed.",
parameters: {
type: 'params',
required: ['actor'],
Expand All @@ -4905,6 +4896,15 @@ export const schemaDict = {
cursor: {
type: 'string',
},
filter: {
type: 'string',
knownValues: [
'posts_with_replies',
'posts_no_replies',
'posts_with_media',
],
default: 'posts_with_replies',
},
},
},
output: {
Expand Down Expand Up @@ -6713,8 +6713,8 @@ export const ids = {
AppBskyFeedDescribeFeedGenerator: 'app.bsky.feed.describeFeedGenerator',
AppBskyFeedGenerator: 'app.bsky.feed.generator',
AppBskyFeedGetActorFeeds: 'app.bsky.feed.getActorFeeds',
AppBskyFeedGetAuthorFeed: 'app.bsky.feed.getAuthorFeed',
AppBskyFeedGetActorLikes: 'app.bsky.feed.getActorLikes',
AppBskyFeedGetAuthorFeed: 'app.bsky.feed.getAuthorFeed',
AppBskyFeedGetFeed: 'app.bsky.feed.getFeed',
AppBskyFeedGetFeedGenerator: 'app.bsky.feed.getFeedGenerator',
AppBskyFeedGetFeedGenerators: 'app.bsky.feed.getFeedGenerators',
Expand Down
Loading

0 comments on commit 98cc8c5

Please sign in to comment.