Skip to content

Commit

Permalink
Add searchStarterPacks to appview (#2978)
Browse files Browse the repository at this point in the history
* Add app.bsky.graph.searchStarterPacks lexicon

* Codegen for app.bsky.graph.searchStarterPacks

* Add app.bsky.unspecced.searchStarterPacksSkeleton

* Gen app.bsky.unspecced.searchStarterPacksSkeleton

* Add SearchStarterPacks rpc to bsky.proto

* Implement searchStarterPacks endpoint

* @atproto/api changeset

* Add starter pack search by term to dataplane
  • Loading branch information
rafaelbsky authored Nov 18, 2024
1 parent c34426f commit a4b528e
Show file tree
Hide file tree
Showing 35 changed files with 1,650 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/gold-pets-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@atproto/api": patch
---

Add searchStarterPacks and searchStarterPacksSkeleton
48 changes: 48 additions & 0 deletions lexicons/app/bsky/graph/searchStarterPacks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"lexicon": 1,
"id": "app.bsky.graph.searchStarterPacks",
"defs": {
"main": {
"type": "query",
"description": "Find starter packs matching search criteria. Does not require auth.",
"parameters": {
"type": "params",
"required": ["q"],
"properties": {
"q": {
"type": "string",
"description": "Search query string. Syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended."
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 25
},
"cursor": {
"type": "string"
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["starterPacks"],
"properties": {
"cursor": {
"type": "string"
},
"starterPacks": {
"type": "array",
"items": {
"type": "ref",
"ref": "app.bsky.graph.defs#starterPackViewBasic"
}
}
}
}
}
}
}
}
7 changes: 7 additions & 0 deletions lexicons/app/bsky/unspecced/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
"properties": {
"did": { "type": "string", "format": "did" }
}
},
"skeletonSearchStarterPack": {
"type": "object",
"required": ["uri"],
"properties": {
"uri": { "type": "string", "format": "at-uri" }
}
}
}
}
63 changes: 63 additions & 0 deletions lexicons/app/bsky/unspecced/searchStarterPacksSkeleton.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"lexicon": 1,
"id": "app.bsky.unspecced.searchStarterPacksSkeleton",
"defs": {
"main": {
"type": "query",
"description": "Backend Starter Pack search, returns only skeleton.",
"parameters": {
"type": "params",
"required": ["q"],
"properties": {
"q": {
"type": "string",
"description": "Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended."
},
"viewer": {
"type": "string",
"format": "did",
"description": "DID of the account making the request (not included for public/unauthenticated queries)."
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 25
},
"cursor": {
"type": "string",
"description": "Optional pagination mechanism; may not necessarily allow scrolling through entire result set."
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["starterPacks"],
"properties": {
"cursor": {
"type": "string"
},
"hitsTotal": {
"type": "integer",
"description": "Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits."
},
"starterPacks": {
"type": "array",
"items": {
"type": "ref",
"ref": "app.bsky.unspecced.defs#skeletonSearchStarterPack"
}
}
}
}
},
"errors": [
{
"name": "BadQueryString"
}
]
}
}
}
32 changes: 32 additions & 0 deletions packages/api/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ import * as AppBskyGraphListitem from './types/app/bsky/graph/listitem'
import * as AppBskyGraphMuteActor from './types/app/bsky/graph/muteActor'
import * as AppBskyGraphMuteActorList from './types/app/bsky/graph/muteActorList'
import * as AppBskyGraphMuteThread from './types/app/bsky/graph/muteThread'
import * as AppBskyGraphSearchStarterPacks from './types/app/bsky/graph/searchStarterPacks'
import * as AppBskyGraphStarterpack from './types/app/bsky/graph/starterpack'
import * as AppBskyGraphUnmuteActor from './types/app/bsky/graph/unmuteActor'
import * as AppBskyGraphUnmuteActorList from './types/app/bsky/graph/unmuteActorList'
Expand All @@ -167,6 +168,7 @@ import * as AppBskyUnspeccedGetSuggestionsSkeleton from './types/app/bsky/unspec
import * as AppBskyUnspeccedGetTaggedSuggestions from './types/app/bsky/unspecced/getTaggedSuggestions'
import * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton'
import * as AppBskyUnspeccedSearchPostsSkeleton from './types/app/bsky/unspecced/searchPostsSkeleton'
import * as AppBskyUnspeccedSearchStarterPacksSkeleton from './types/app/bsky/unspecced/searchStarterPacksSkeleton'
import * as AppBskyVideoDefs from './types/app/bsky/video/defs'
import * as AppBskyVideoGetJobStatus from './types/app/bsky/video/getJobStatus'
import * as AppBskyVideoGetUploadLimits from './types/app/bsky/video/getUploadLimits'
Expand Down Expand Up @@ -371,6 +373,7 @@ export * as AppBskyGraphListitem from './types/app/bsky/graph/listitem'
export * as AppBskyGraphMuteActor from './types/app/bsky/graph/muteActor'
export * as AppBskyGraphMuteActorList from './types/app/bsky/graph/muteActorList'
export * as AppBskyGraphMuteThread from './types/app/bsky/graph/muteThread'
export * as AppBskyGraphSearchStarterPacks from './types/app/bsky/graph/searchStarterPacks'
export * as AppBskyGraphStarterpack from './types/app/bsky/graph/starterpack'
export * as AppBskyGraphUnmuteActor from './types/app/bsky/graph/unmuteActor'
export * as AppBskyGraphUnmuteActorList from './types/app/bsky/graph/unmuteActorList'
Expand All @@ -391,6 +394,7 @@ export * as AppBskyUnspeccedGetSuggestionsSkeleton from './types/app/bsky/unspec
export * as AppBskyUnspeccedGetTaggedSuggestions from './types/app/bsky/unspecced/getTaggedSuggestions'
export * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton'
export * as AppBskyUnspeccedSearchPostsSkeleton from './types/app/bsky/unspecced/searchPostsSkeleton'
export * as AppBskyUnspeccedSearchStarterPacksSkeleton from './types/app/bsky/unspecced/searchStarterPacksSkeleton'
export * as AppBskyVideoDefs from './types/app/bsky/video/defs'
export * as AppBskyVideoGetJobStatus from './types/app/bsky/video/getJobStatus'
export * as AppBskyVideoGetUploadLimits from './types/app/bsky/video/getUploadLimits'
Expand Down Expand Up @@ -2430,6 +2434,18 @@ export class AppBskyGraphNS {
return this._client.call('app.bsky.graph.muteThread', opts?.qp, data, opts)
}

searchStarterPacks(
params?: AppBskyGraphSearchStarterPacks.QueryParams,
opts?: AppBskyGraphSearchStarterPacks.CallOptions,
): Promise<AppBskyGraphSearchStarterPacks.Response> {
return this._client.call(
'app.bsky.graph.searchStarterPacks',
params,
undefined,
opts,
)
}

unmuteActor(
data?: AppBskyGraphUnmuteActor.InputSchema,
opts?: AppBskyGraphUnmuteActor.CallOptions,
Expand Down Expand Up @@ -3080,6 +3096,22 @@ export class AppBskyUnspeccedNS {
throw AppBskyUnspeccedSearchPostsSkeleton.toKnownErr(e)
})
}

searchStarterPacksSkeleton(
params?: AppBskyUnspeccedSearchStarterPacksSkeleton.QueryParams,
opts?: AppBskyUnspeccedSearchStarterPacksSkeleton.CallOptions,
): Promise<AppBskyUnspeccedSearchStarterPacksSkeleton.Response> {
return this._client
.call(
'app.bsky.unspecced.searchStarterPacksSkeleton',
params,
undefined,
opts,
)
.catch((e) => {
throw AppBskyUnspeccedSearchStarterPacksSkeleton.toKnownErr(e)
})
}
}

export class AppBskyVideoNS {
Expand Down
130 changes: 130 additions & 0 deletions packages/api/src/client/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8488,6 +8488,56 @@ export const schemaDict = {
},
},
},
AppBskyGraphSearchStarterPacks: {
lexicon: 1,
id: 'app.bsky.graph.searchStarterPacks',
defs: {
main: {
type: 'query',
description:
'Find starter packs matching search criteria. Does not require auth.',
parameters: {
type: 'params',
required: ['q'],
properties: {
q: {
type: 'string',
description:
'Search query string. Syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended.',
},
limit: {
type: 'integer',
minimum: 1,
maximum: 100,
default: 25,
},
cursor: {
type: 'string',
},
},
},
output: {
encoding: 'application/json',
schema: {
type: 'object',
required: ['starterPacks'],
properties: {
cursor: {
type: 'string',
},
starterPacks: {
type: 'array',
items: {
type: 'ref',
ref: 'lex:app.bsky.graph.defs#starterPackViewBasic',
},
},
},
},
},
},
},
},
AppBskyGraphStarterpack: {
lexicon: 1,
id: 'app.bsky.graph.starterpack',
Expand Down Expand Up @@ -9153,6 +9203,16 @@ export const schemaDict = {
},
},
},
skeletonSearchStarterPack: {
type: 'object',
required: ['uri'],
properties: {
uri: {
type: 'string',
format: 'at-uri',
},
},
},
},
},
AppBskyUnspeccedGetConfig: {
Expand Down Expand Up @@ -9526,6 +9586,73 @@ export const schemaDict = {
},
},
},
AppBskyUnspeccedSearchStarterPacksSkeleton: {
lexicon: 1,
id: 'app.bsky.unspecced.searchStarterPacksSkeleton',
defs: {
main: {
type: 'query',
description: 'Backend Starter Pack search, returns only skeleton.',
parameters: {
type: 'params',
required: ['q'],
properties: {
q: {
type: 'string',
description:
'Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended.',
},
viewer: {
type: 'string',
format: 'did',
description:
'DID of the account making the request (not included for public/unauthenticated queries).',
},
limit: {
type: 'integer',
minimum: 1,
maximum: 100,
default: 25,
},
cursor: {
type: 'string',
description:
'Optional pagination mechanism; may not necessarily allow scrolling through entire result set.',
},
},
},
output: {
encoding: 'application/json',
schema: {
type: 'object',
required: ['starterPacks'],
properties: {
cursor: {
type: 'string',
},
hitsTotal: {
type: 'integer',
description:
'Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits.',
},
starterPacks: {
type: 'array',
items: {
type: 'ref',
ref: 'lex:app.bsky.unspecced.defs#skeletonSearchStarterPack',
},
},
},
},
},
errors: [
{
name: 'BadQueryString',
},
],
},
},
},
AppBskyVideoDefs: {
lexicon: 1,
id: 'app.bsky.video.defs',
Expand Down Expand Up @@ -13486,6 +13613,7 @@ export const ids = {
AppBskyGraphMuteActor: 'app.bsky.graph.muteActor',
AppBskyGraphMuteActorList: 'app.bsky.graph.muteActorList',
AppBskyGraphMuteThread: 'app.bsky.graph.muteThread',
AppBskyGraphSearchStarterPacks: 'app.bsky.graph.searchStarterPacks',
AppBskyGraphStarterpack: 'app.bsky.graph.starterpack',
AppBskyGraphUnmuteActor: 'app.bsky.graph.unmuteActor',
AppBskyGraphUnmuteActorList: 'app.bsky.graph.unmuteActorList',
Expand All @@ -13511,6 +13639,8 @@ export const ids = {
AppBskyUnspeccedSearchActorsSkeleton:
'app.bsky.unspecced.searchActorsSkeleton',
AppBskyUnspeccedSearchPostsSkeleton: 'app.bsky.unspecced.searchPostsSkeleton',
AppBskyUnspeccedSearchStarterPacksSkeleton:
'app.bsky.unspecced.searchStarterPacksSkeleton',
AppBskyVideoDefs: 'app.bsky.video.defs',
AppBskyVideoGetJobStatus: 'app.bsky.video.getJobStatus',
AppBskyVideoGetUploadLimits: 'app.bsky.video.getUploadLimits',
Expand Down
Loading

0 comments on commit a4b528e

Please sign in to comment.