Fix app.bsky.post entity def to be more intuitive (#294)
This commit is contained in:
parent
aa604b0a98
commit
55a07dd4d5
lexicons/bsky.app
packages
@ -8,7 +8,10 @@
|
||||
"required": ["text", "createdAt"],
|
||||
"properties": {
|
||||
"text": {"type": "string", "maxLength": 256},
|
||||
"entities": {"$ref": "#/defs/entity"},
|
||||
"entities": {
|
||||
"type": "array",
|
||||
"items": {"$ref": "#/defs/entity"}
|
||||
},
|
||||
"reply": {
|
||||
"type": "object",
|
||||
"required": ["root", "parent"],
|
||||
@ -30,18 +33,15 @@
|
||||
}
|
||||
},
|
||||
"entity": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["index", "type", "value"],
|
||||
"properties": {
|
||||
"index": {"$ref": "#/defs/textSlice"},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"$comment": "Expected values are 'mention', 'hashtag', and 'link'."
|
||||
},
|
||||
"value": {"type": "string"}
|
||||
}
|
||||
"type": "object",
|
||||
"required": ["index", "type", "value"],
|
||||
"properties": {
|
||||
"index": {"$ref": "#/defs/textSlice"},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"$comment": "Expected values are 'mention', 'hashtag', and 'link'."
|
||||
},
|
||||
"value": {"type": "string"}
|
||||
}
|
||||
},
|
||||
"textSlice": {
|
||||
@ -51,4 +51,4 @@
|
||||
"maxItems": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3124,7 +3124,10 @@ export const recordSchemaDict: Record<string, RecordSchema> = {
|
||||
maxLength: 256,
|
||||
},
|
||||
entities: {
|
||||
$ref: '#/$defs/entity',
|
||||
type: 'array',
|
||||
items: {
|
||||
$ref: '#/$defs/entity',
|
||||
},
|
||||
},
|
||||
reply: {
|
||||
type: 'object',
|
||||
@ -3145,22 +3148,18 @@ export const recordSchemaDict: Record<string, RecordSchema> = {
|
||||
},
|
||||
$defs: {
|
||||
entity: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'object',
|
||||
required: ['index', 'type', 'value'],
|
||||
properties: {
|
||||
index: {
|
||||
$ref: '#/$defs/textSlice',
|
||||
},
|
||||
type: {
|
||||
type: 'string',
|
||||
$comment:
|
||||
"Expected values are 'mention', 'hashtag', and 'link'.",
|
||||
},
|
||||
value: {
|
||||
type: 'string',
|
||||
},
|
||||
type: 'object',
|
||||
required: ['index', 'type', 'value'],
|
||||
properties: {
|
||||
index: {
|
||||
$ref: '#/$defs/textSlice',
|
||||
},
|
||||
type: {
|
||||
type: 'string',
|
||||
$comment: "Expected values are 'mention', 'hashtag', and 'link'.",
|
||||
},
|
||||
value: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -3205,21 +3204,18 @@ export const recordSchemaDict: Record<string, RecordSchema> = {
|
||||
},
|
||||
},
|
||||
entity: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'object',
|
||||
required: ['index', 'type', 'value'],
|
||||
properties: {
|
||||
index: {
|
||||
$ref: '#/$defs/textSlice',
|
||||
},
|
||||
type: {
|
||||
type: 'string',
|
||||
$comment: "Expected values are 'mention', 'hashtag', and 'link'.",
|
||||
},
|
||||
value: {
|
||||
type: 'string',
|
||||
},
|
||||
type: 'object',
|
||||
required: ['index', 'type', 'value'],
|
||||
properties: {
|
||||
index: {
|
||||
$ref: '#/$defs/textSlice',
|
||||
},
|
||||
type: {
|
||||
type: 'string',
|
||||
$comment: "Expected values are 'mention', 'hashtag', and 'link'.",
|
||||
},
|
||||
value: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -6,16 +6,10 @@
|
||||
* @maxItems 2
|
||||
*/
|
||||
export type TextSlice = [number, number]
|
||||
export type Entity = {
|
||||
index: TextSlice,
|
||||
type: string,
|
||||
value: string,
|
||||
[k: string]: unknown,
|
||||
}[]
|
||||
|
||||
export interface Record {
|
||||
text: string;
|
||||
entities?: Entity;
|
||||
entities?: Entity[];
|
||||
reply?: {
|
||||
root: PostRef,
|
||||
parent: PostRef,
|
||||
@ -24,6 +18,12 @@ export interface Record {
|
||||
createdAt: string;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface Entity {
|
||||
index: TextSlice;
|
||||
type: string;
|
||||
value: string;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface PostRef {
|
||||
uri: string;
|
||||
cid: string;
|
||||
|
@ -3124,7 +3124,10 @@ export const recordSchemaDict: Record<string, RecordSchema> = {
|
||||
maxLength: 256,
|
||||
},
|
||||
entities: {
|
||||
$ref: '#/$defs/entity',
|
||||
type: 'array',
|
||||
items: {
|
||||
$ref: '#/$defs/entity',
|
||||
},
|
||||
},
|
||||
reply: {
|
||||
type: 'object',
|
||||
@ -3145,22 +3148,18 @@ export const recordSchemaDict: Record<string, RecordSchema> = {
|
||||
},
|
||||
$defs: {
|
||||
entity: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'object',
|
||||
required: ['index', 'type', 'value'],
|
||||
properties: {
|
||||
index: {
|
||||
$ref: '#/$defs/textSlice',
|
||||
},
|
||||
type: {
|
||||
type: 'string',
|
||||
$comment:
|
||||
"Expected values are 'mention', 'hashtag', and 'link'.",
|
||||
},
|
||||
value: {
|
||||
type: 'string',
|
||||
},
|
||||
type: 'object',
|
||||
required: ['index', 'type', 'value'],
|
||||
properties: {
|
||||
index: {
|
||||
$ref: '#/$defs/textSlice',
|
||||
},
|
||||
type: {
|
||||
type: 'string',
|
||||
$comment: "Expected values are 'mention', 'hashtag', and 'link'.",
|
||||
},
|
||||
value: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -3205,21 +3204,18 @@ export const recordSchemaDict: Record<string, RecordSchema> = {
|
||||
},
|
||||
},
|
||||
entity: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'object',
|
||||
required: ['index', 'type', 'value'],
|
||||
properties: {
|
||||
index: {
|
||||
$ref: '#/$defs/textSlice',
|
||||
},
|
||||
type: {
|
||||
type: 'string',
|
||||
$comment: "Expected values are 'mention', 'hashtag', and 'link'.",
|
||||
},
|
||||
value: {
|
||||
type: 'string',
|
||||
},
|
||||
type: 'object',
|
||||
required: ['index', 'type', 'value'],
|
||||
properties: {
|
||||
index: {
|
||||
$ref: '#/$defs/textSlice',
|
||||
},
|
||||
type: {
|
||||
type: 'string',
|
||||
$comment: "Expected values are 'mention', 'hashtag', and 'link'.",
|
||||
},
|
||||
value: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -6,16 +6,10 @@
|
||||
* @maxItems 2
|
||||
*/
|
||||
export type TextSlice = [number, number]
|
||||
export type Entity = {
|
||||
index: TextSlice,
|
||||
type: string,
|
||||
value: string,
|
||||
[k: string]: unknown,
|
||||
}[]
|
||||
|
||||
export interface Record {
|
||||
text: string;
|
||||
entities?: Entity;
|
||||
entities?: Entity[];
|
||||
reply?: {
|
||||
root: PostRef,
|
||||
parent: PostRef,
|
||||
@ -24,6 +18,12 @@ export interface Record {
|
||||
createdAt: string;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface Entity {
|
||||
index: TextSlice;
|
||||
type: string;
|
||||
value: string;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface PostRef {
|
||||
uri: string;
|
||||
cid: string;
|
||||
|
Loading…
x
Reference in New Issue
Block a user