forked from bluesky-social/atproto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Ozone batch repo and record getters (bluesky-social#2836)
* ✨ Add getRepos and getRecords endpoints for bulk fetching * ✨ Fix issues and add tests for get repos and get records * ✨ Use the right lxm * 🐛 Revert changes in lockfile * ✨ Add getAccountInfos in PDS * 🐛 Fix type def for repo and record view detail * ✅ Update snapshots * ✅ Update snapshots * ✨ Consolidate error type for com.atproto and tools.ozone getRecord error type * 🧹 Cleanup * ✅ Update snapshots * ✅ Update snapshots * ✨ Changeset
- Loading branch information
Showing
41 changed files
with
1,542 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@atproto/ozone": patch | ||
"@atproto/api": patch | ||
"@atproto/pds": patch | ||
--- | ||
|
||
Add getRepos and getRecords endpoints for bulk fetching |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,8 @@ | |
"value": { "type": "unknown" } | ||
} | ||
} | ||
} | ||
}, | ||
"errors": [{ "name": "RecordNotFound" }] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "tools.ozone.moderation.getRecords", | ||
"defs": { | ||
"main": { | ||
"type": "query", | ||
"description": "Get details about some records.", | ||
"parameters": { | ||
"type": "params", | ||
"required": ["uris"], | ||
"properties": { | ||
"uris": { | ||
"type": "array", | ||
"maxLength": 100, | ||
"items": { | ||
"type": "string", | ||
"format": "at-uri" | ||
} | ||
} | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["records"], | ||
"properties": { | ||
"records": { | ||
"type": "array", | ||
"items": { | ||
"type": "union", | ||
"refs": [ | ||
"tools.ozone.moderation.defs#recordViewDetail", | ||
"tools.ozone.moderation.defs#recordViewNotFound" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "tools.ozone.moderation.getRepos", | ||
"defs": { | ||
"main": { | ||
"type": "query", | ||
"description": "Get details about some repositories.", | ||
"parameters": { | ||
"type": "params", | ||
"required": ["dids"], | ||
"properties": { | ||
"dids": { | ||
"type": "array", | ||
"maxLength": 100, | ||
"items": { | ||
"type": "string", | ||
"format": "did" | ||
} | ||
} | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["repos"], | ||
"properties": { | ||
"repos": { | ||
"type": "array", | ||
"items": { | ||
"type": "union", | ||
"refs": [ | ||
"tools.ozone.moderation.defs#repoViewDetail", | ||
"tools.ozone.moderation.defs#repoViewNotFound" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
packages/api/src/client/types/tools/ozone/moderation/getRecords.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* GENERATED CODE - DO NOT MODIFY | ||
*/ | ||
import { HeadersMap, 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 ToolsOzoneModerationDefs from './defs' | ||
|
||
export interface QueryParams { | ||
uris: string[] | ||
} | ||
|
||
export type InputSchema = undefined | ||
|
||
export interface OutputSchema { | ||
records: ( | ||
| ToolsOzoneModerationDefs.RecordViewDetail | ||
| ToolsOzoneModerationDefs.RecordViewNotFound | ||
| { $type: string; [k: string]: unknown } | ||
)[] | ||
[k: string]: unknown | ||
} | ||
|
||
export interface CallOptions { | ||
signal?: AbortSignal | ||
headers?: HeadersMap | ||
} | ||
|
||
export interface Response { | ||
success: boolean | ||
headers: HeadersMap | ||
data: OutputSchema | ||
} | ||
|
||
export function toKnownErr(e: any) { | ||
return e | ||
} |
Oops, something went wrong.