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.
[Detach] Lexicons (bluesky-social#2664)
* Define new detach record * Codegen * Add limit of 1k * Codegen * add protos * tweak schema * Add changeset --------- Co-authored-by: dholms <[email protected]>
- Loading branch information
1 parent
a5fbd8c
commit ff803fd
Showing
14 changed files
with
505 additions
and
0 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,8 @@ | ||
--- | ||
"@atproto/ozone": patch | ||
"@atproto/bsky": patch | ||
"@atproto/api": patch | ||
"@atproto/pds": patch | ||
--- | ||
|
||
Adds `app.bsky.feed.detach` record lexicons. |
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,32 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "app.bsky.feed.detach", | ||
"defs": { | ||
"main": { | ||
"type": "record", | ||
"key": "tid", | ||
"description": "Record defining post URIs detached from a root post. The record key (rkey) of the detach record must match the record key of the root post in question, and that record must be in the same repository.", | ||
"record": { | ||
"type": "object", | ||
"required": ["post", "targets", "updatedAt"], | ||
"properties": { | ||
"post": { | ||
"type": "string", | ||
"format": "at-uri", | ||
"description": "Reference (AT-URI) to the post record." | ||
}, | ||
"targets": { | ||
"type": "array", | ||
"maxLength": 50, | ||
"items": { | ||
"type": "string", | ||
"format": "at-uri" | ||
}, | ||
"description": "List of detached post URIs." | ||
}, | ||
"updatedAt": { "type": "string", "format": "datetime" } | ||
} | ||
} | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* GENERATED CODE - DO NOT MODIFY | ||
*/ | ||
import { ValidationResult, BlobRef } from '@atproto/lexicon' | ||
import { isObj, hasProp } from '../../../../util' | ||
import { lexicons } from '../../../../lexicons' | ||
import { CID } from 'multiformats/cid' | ||
|
||
export interface Record { | ||
/** Reference (AT-URI) to the post record. */ | ||
post: string | ||
/** List of detached post URIs. */ | ||
targets: string[] | ||
updatedAt: string | ||
[k: string]: unknown | ||
} | ||
|
||
export function isRecord(v: unknown): v is Record { | ||
return ( | ||
isObj(v) && | ||
hasProp(v, '$type') && | ||
(v.$type === 'app.bsky.feed.detach#main' || | ||
v.$type === 'app.bsky.feed.detach') | ||
) | ||
} | ||
|
||
export function validateRecord(v: unknown): ValidationResult { | ||
return lexicons.validate('app.bsky.feed.detach#main', v) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* GENERATED CODE - DO NOT MODIFY | ||
*/ | ||
import { ValidationResult, BlobRef } from '@atproto/lexicon' | ||
import { lexicons } from '../../../../lexicons' | ||
import { isObj, hasProp } from '../../../../util' | ||
import { CID } from 'multiformats/cid' | ||
|
||
export interface Record { | ||
/** Reference (AT-URI) to the post record. */ | ||
post: string | ||
/** List of detached post URIs. */ | ||
targets: string[] | ||
updatedAt: string | ||
[k: string]: unknown | ||
} | ||
|
||
export function isRecord(v: unknown): v is Record { | ||
return ( | ||
isObj(v) && | ||
hasProp(v, '$type') && | ||
(v.$type === 'app.bsky.feed.detach#main' || | ||
v.$type === 'app.bsky.feed.detach') | ||
) | ||
} | ||
|
||
export function validateRecord(v: unknown): ValidationResult { | ||
return lexicons.validate('app.bsky.feed.detach#main', v) | ||
} |
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
Oops, something went wrong.