Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add repostRules to postgate #3503

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lexicons/app/bsky/feed/postgate.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@
"type": "union",
"refs": ["#disableRule"]
}
},
"repostRules": {
"description": "List of rules defining who can repost this post. If value is an empty array or is undefined, no particular rules apply and anyone can repost.",
"type": "array",
"maxLength": 5,
"items": {
"type": "union",
"refs": ["#repostDisableRule"]
}
}
}
}
Expand All @@ -41,6 +50,11 @@
"type": "object",
"description": "Disables embedding of this post.",
"properties": {}
},
"repostDisableRule": {
"type": "object",
"description": "Disables repost of this post.",
"properties": {}
}
}
}
15 changes: 15 additions & 0 deletions packages/api/src/client/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7162,6 +7162,16 @@ export const schemaDict = {
refs: ['lex:app.bsky.feed.postgate#disableRule'],
},
},
repostRules: {
description:
'List of rules defining who can repost this post. If value is an empty array or is undefined, no particular rules apply and anyone can repost.',
type: 'array',
maxLength: 5,
items: {
type: 'union',
refs: ['lex:app.bsky.feed.postgate#repostDisableRule'],
},
},
},
},
},
Expand All @@ -7170,6 +7180,11 @@ export const schemaDict = {
description: 'Disables embedding of this post.',
properties: {},
},
repostDisableRule: {
type: 'object',
description: 'Disables repost of this post.',
properties: {},
},
},
},
AppBskyFeedRepost: {
Expand Down
19 changes: 19 additions & 0 deletions packages/api/src/client/types/app/bsky/feed/postgate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export interface Record {
detachedEmbeddingUris?: string[]
/** List of rules defining who can embed this post. If value is an empty array or is undefined, no particular rules apply and anyone can embed. */
embeddingRules?: (DisableRule | { $type: string; [k: string]: unknown })[]
/** List of rules defining who can repost this post. If value is an empty array or is undefined, no particular rules apply and anyone can repost. */
repostRules?: (RepostDisableRule | { $type: string; [k: string]: unknown })[]
[k: string]: unknown
}

Expand Down Expand Up @@ -46,3 +48,20 @@ export function isDisableRule(v: unknown): v is DisableRule {
export function validateDisableRule(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.postgate#disableRule', v)
}

/** Disables repost of this post. */
export interface RepostDisableRule {
[k: string]: unknown
}

export function isRepostDisableRule(v: unknown): v is RepostDisableRule {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.postgate#repostDisableRule'
)
}

export function validateRepostDisableRule(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.postgate#repostDisableRule', v)
}
15 changes: 15 additions & 0 deletions packages/bsky/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7162,6 +7162,16 @@ export const schemaDict = {
refs: ['lex:app.bsky.feed.postgate#disableRule'],
},
},
repostRules: {
description:
'List of rules defining who can repost this post. If value is an empty array or is undefined, no particular rules apply and anyone can repost.',
type: 'array',
maxLength: 5,
items: {
type: 'union',
refs: ['lex:app.bsky.feed.postgate#repostDisableRule'],
},
},
},
},
},
Expand All @@ -7170,6 +7180,11 @@ export const schemaDict = {
description: 'Disables embedding of this post.',
properties: {},
},
repostDisableRule: {
type: 'object',
description: 'Disables repost of this post.',
properties: {},
},
},
},
AppBskyFeedRepost: {
Expand Down
19 changes: 19 additions & 0 deletions packages/bsky/src/lexicon/types/app/bsky/feed/postgate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export interface Record {
detachedEmbeddingUris?: string[]
/** List of rules defining who can embed this post. If value is an empty array or is undefined, no particular rules apply and anyone can embed. */
embeddingRules?: (DisableRule | { $type: string; [k: string]: unknown })[]
/** List of rules defining who can repost this post. If value is an empty array or is undefined, no particular rules apply and anyone can repost. */
repostRules?: (RepostDisableRule | { $type: string; [k: string]: unknown })[]
[k: string]: unknown
}

Expand Down Expand Up @@ -46,3 +48,20 @@ export function isDisableRule(v: unknown): v is DisableRule {
export function validateDisableRule(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.postgate#disableRule', v)
}

/** Disables repost of this post. */
export interface RepostDisableRule {
[k: string]: unknown
}

export function isRepostDisableRule(v: unknown): v is RepostDisableRule {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.postgate#repostDisableRule'
)
}

export function validateRepostDisableRule(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.postgate#repostDisableRule', v)
}
15 changes: 15 additions & 0 deletions packages/ozone/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7162,6 +7162,16 @@ export const schemaDict = {
refs: ['lex:app.bsky.feed.postgate#disableRule'],
},
},
repostRules: {
description:
'List of rules defining who can repost this post. If value is an empty array or is undefined, no particular rules apply and anyone can repost.',
type: 'array',
maxLength: 5,
items: {
type: 'union',
refs: ['lex:app.bsky.feed.postgate#repostDisableRule'],
},
},
},
},
},
Expand All @@ -7170,6 +7180,11 @@ export const schemaDict = {
description: 'Disables embedding of this post.',
properties: {},
},
repostDisableRule: {
type: 'object',
description: 'Disables repost of this post.',
properties: {},
},
},
},
AppBskyFeedRepost: {
Expand Down
19 changes: 19 additions & 0 deletions packages/ozone/src/lexicon/types/app/bsky/feed/postgate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export interface Record {
detachedEmbeddingUris?: string[]
/** List of rules defining who can embed this post. If value is an empty array or is undefined, no particular rules apply and anyone can embed. */
embeddingRules?: (DisableRule | { $type: string; [k: string]: unknown })[]
/** List of rules defining who can repost this post. If value is an empty array or is undefined, no particular rules apply and anyone can repost. */
repostRules?: (RepostDisableRule | { $type: string; [k: string]: unknown })[]
[k: string]: unknown
}

Expand Down Expand Up @@ -46,3 +48,20 @@ export function isDisableRule(v: unknown): v is DisableRule {
export function validateDisableRule(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.postgate#disableRule', v)
}

/** Disables repost of this post. */
export interface RepostDisableRule {
[k: string]: unknown
}

export function isRepostDisableRule(v: unknown): v is RepostDisableRule {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.postgate#repostDisableRule'
)
}

export function validateRepostDisableRule(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.postgate#repostDisableRule', v)
}
15 changes: 15 additions & 0 deletions packages/pds/src/lexicon/lexicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7162,6 +7162,16 @@ export const schemaDict = {
refs: ['lex:app.bsky.feed.postgate#disableRule'],
},
},
repostRules: {
description:
'List of rules defining who can repost this post. If value is an empty array or is undefined, no particular rules apply and anyone can repost.',
type: 'array',
maxLength: 5,
items: {
type: 'union',
refs: ['lex:app.bsky.feed.postgate#repostDisableRule'],
},
},
},
},
},
Expand All @@ -7170,6 +7180,11 @@ export const schemaDict = {
description: 'Disables embedding of this post.',
properties: {},
},
repostDisableRule: {
type: 'object',
description: 'Disables repost of this post.',
properties: {},
},
},
},
AppBskyFeedRepost: {
Expand Down
19 changes: 19 additions & 0 deletions packages/pds/src/lexicon/types/app/bsky/feed/postgate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export interface Record {
detachedEmbeddingUris?: string[]
/** List of rules defining who can embed this post. If value is an empty array or is undefined, no particular rules apply and anyone can embed. */
embeddingRules?: (DisableRule | { $type: string; [k: string]: unknown })[]
/** List of rules defining who can repost this post. If value is an empty array or is undefined, no particular rules apply and anyone can repost. */
repostRules?: (RepostDisableRule | { $type: string; [k: string]: unknown })[]
[k: string]: unknown
}

Expand Down Expand Up @@ -46,3 +48,20 @@ export function isDisableRule(v: unknown): v is DisableRule {
export function validateDisableRule(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.postgate#disableRule', v)
}

/** Disables repost of this post. */
export interface RepostDisableRule {
[k: string]: unknown
}

export function isRepostDisableRule(v: unknown): v is RepostDisableRule {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.postgate#repostDisableRule'
)
}

export function validateRepostDisableRule(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.postgate#repostDisableRule', v)
}
Loading