pl-api: Update docs
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
b357261ff2
commit
bc65755862
78 changed files with 221 additions and 22 deletions
|
@ -23,6 +23,9 @@ const accountWarningSchema = v.object({
|
|||
created_at: v.fallback(datetimeSchema, new Date().toISOString()),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type AccountWarning = v.InferOutput<typeof accountWarningSchema>;
|
||||
|
||||
export { accountWarningSchema, type AccountWarning };
|
||||
|
|
|
@ -164,6 +164,9 @@ type WithMoved = {
|
|||
moved: Account | null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Account = v.InferOutput<typeof accountWithMovedAccountSchema> & WithMoved;
|
||||
|
||||
/**
|
||||
|
@ -200,6 +203,9 @@ const untypedCredentialAccountSchema = v.pipe(v.any(), preprocessAccount, v.obje
|
|||
})), undefined),
|
||||
}));
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type CredentialAccount = v.InferOutput<typeof untypedCredentialAccountSchema> & WithMoved;
|
||||
|
||||
/**
|
||||
|
@ -212,6 +218,9 @@ const untypedMutedAccountSchema = v.pipe(v.any(), preprocessAccount, v.object({
|
|||
mute_expires_at: v.fallback(v.nullable(datetimeSchema), null),
|
||||
}));
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type MutedAccount = v.InferOutput<typeof untypedMutedAccountSchema> & WithMoved;
|
||||
|
||||
/**
|
||||
|
|
|
@ -69,7 +69,7 @@ const adminAccountSchema = v.pipe(
|
|||
);
|
||||
|
||||
/**
|
||||
* @category Admin types
|
||||
* @category Admin entity types
|
||||
*/
|
||||
type AdminAccount = v.InferOutput<typeof adminAccountSchema>;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ const adminAnnouncementSchema = v.pipe(
|
|||
);
|
||||
|
||||
/**
|
||||
* @category Admin types
|
||||
* @category Admin entity types
|
||||
*/
|
||||
type AdminAnnouncement = v.InferOutput<typeof adminAnnouncementSchema>;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ const adminCanonicalEmailBlockSchema = v.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* @category Admin types
|
||||
* @category Admin entity types
|
||||
*/
|
||||
type AdminCanonicalEmailBlock = v.InferOutput<typeof adminCanonicalEmailBlockSchema>;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ const adminCohortSchema = v.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* @category Admin types
|
||||
* @category Admin entity types
|
||||
*/
|
||||
type AdminCohort = v.InferOutput<typeof adminCohortSchema>;
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ const adminDimensionSchema = v.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* @category Admin types
|
||||
* @category Admin entity types
|
||||
*/
|
||||
type AdminDimension = v.InferOutput<typeof adminDimensionSchema>;
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ const adminDomainAllowSchema = v.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* @category Admin types
|
||||
* @category Admin entity types
|
||||
*/
|
||||
type AdminDomainAllow = v.InferOutput<typeof adminDomainAllowSchema>;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ const adminDomainBlockSchema = v.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* @category Admin types
|
||||
* @category Admin entity types
|
||||
*/
|
||||
type AdminDomainBlock = v.InferOutput<typeof adminDomainBlockSchema>;
|
||||
|
||||
|
|
|
@ -2,6 +2,9 @@ import * as v from 'valibot';
|
|||
|
||||
import { datetimeSchema } from '../utils';
|
||||
|
||||
/**
|
||||
* @category Admin schemas
|
||||
*/
|
||||
const adminDomainSchema = v.object({
|
||||
domain: v.fallback(v.string(), ''),
|
||||
id: v.pipe(v.unknown(), v.transform(String)),
|
||||
|
@ -11,7 +14,7 @@ const adminDomainSchema = v.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* @category Admin types
|
||||
* @category Admin entity types
|
||||
*/
|
||||
type AdminDomain = v.InferOutput<typeof adminDomainSchema>
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ const adminEmailDomainBlockSchema = v.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* @category Admin types
|
||||
* @category Admin entity types
|
||||
*/
|
||||
type AdminEmailDomainBlock = v.InferOutput<typeof adminEmailDomainBlockSchema>;
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ const adminIpBlockSchema = v.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* @category Admin types
|
||||
* @category Admin entity types
|
||||
*/
|
||||
type AdminIpBlock = v.InferOutput<typeof adminIpBlockSchema>;
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ const adminIpSchema = v.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* @category Admin types
|
||||
* @category Admin entity types
|
||||
*/
|
||||
type AdminIp = v.InferOutput<typeof adminIpSchema>;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ const adminMeasureSchema = v.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* @category Admin types
|
||||
* @category Admin entity types
|
||||
*/
|
||||
type AdminMeasure = v.InferOutput<typeof adminMeasureSchema>;
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ const adminModerationLogEntrySchema = v.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* @category Admin types
|
||||
* @category Admin entity types
|
||||
*/
|
||||
type AdminModerationLogEntry = v.InferOutput<typeof adminModerationLogEntrySchema>
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ const pleromaConfigSchema = v.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* @category Admin types
|
||||
* @category Admin entity types
|
||||
*/
|
||||
type PleromaConfig = v.InferOutput<typeof pleromaConfigSchema>
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
import * as v from 'valibot';
|
||||
|
||||
/**
|
||||
* @category Admin schemas
|
||||
*/
|
||||
const adminRelaySchema = v.pipe(
|
||||
v.any(),
|
||||
v.transform((data: any) => ({ id: data.actor, ...data })),
|
||||
|
@ -11,7 +14,7 @@ const adminRelaySchema = v.pipe(
|
|||
);
|
||||
|
||||
/**
|
||||
* @category Admin types
|
||||
* @category Admin entity types
|
||||
*/
|
||||
type AdminRelay = v.InferOutput<typeof adminRelaySchema>
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ const adminReportSchema = v.pipe(
|
|||
);
|
||||
|
||||
/**
|
||||
* @category Admin types
|
||||
* @category Admin entity types
|
||||
*/
|
||||
type AdminReport = v.InferOutput<typeof adminReportSchema>;
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ const adminRuleSchema = v.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* @category Admin types
|
||||
* @category Admin entity types
|
||||
*/
|
||||
type AdminRule = v.InferOutput<typeof adminRuleSchema>;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ const adminTagSchema = v.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* @category Admin types
|
||||
* @category Admin entity types
|
||||
*/
|
||||
type AdminTag = v.InferOutput<typeof adminTagSchema>;
|
||||
|
||||
|
|
|
@ -13,6 +13,9 @@ const announcementReactionSchema = v.object({
|
|||
announcement_id: v.fallback(v.string(), ''),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type AnnouncementReaction = v.InferOutput<typeof announcementReactionSchema>;
|
||||
|
||||
export { announcementReactionSchema, type AnnouncementReaction };
|
||||
|
|
|
@ -32,6 +32,9 @@ const announcementSchema = v.object({
|
|||
updated_at: v.fallback(datetimeSchema, new Date().toISOString()),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Announcement = v.InferOutput<typeof announcementSchema>;
|
||||
|
||||
export { announcementSchema, type Announcement };
|
||||
|
|
|
@ -39,6 +39,9 @@ const credentialApplicationSchema = v.pipe(
|
|||
}),
|
||||
);
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type CredentialApplication = v.InferOutput<typeof credentialApplicationSchema>;
|
||||
|
||||
export { applicationSchema, credentialApplicationSchema, type Application, type CredentialApplication };
|
||||
|
|
|
@ -15,6 +15,9 @@ const backupSchema = v.object({
|
|||
url: v.fallback(v.string(), ''),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Backup = v.InferOutput<typeof backupSchema>;
|
||||
|
||||
export { backupSchema, type Backup };
|
||||
|
|
|
@ -10,6 +10,9 @@ const bookmarkFolderSchema = v.object({
|
|||
emoji_url: v.fallback(v.nullable(v.string()), null),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type BookmarkFolder = v.InferOutput<typeof bookmarkFolderSchema>;
|
||||
|
||||
export { bookmarkFolderSchema, type BookmarkFolder };
|
||||
|
|
|
@ -21,6 +21,9 @@ const chatMessageSchema = v.object({
|
|||
card: v.fallback(v.nullable(previewCardSchema), null),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type ChatMessage = v.InferOutput<typeof chatMessageSchema>;
|
||||
|
||||
export { chatMessageSchema, type ChatMessage };
|
||||
|
|
|
@ -16,6 +16,9 @@ const chatSchema = v.object({
|
|||
updated_at: datetimeSchema,
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Chat = v.InferOutput<typeof chatSchema>;
|
||||
|
||||
export { chatSchema, type Chat };
|
||||
|
|
|
@ -11,6 +11,9 @@ const contextSchema = v.object({
|
|||
descendants: v.array(statusSchema),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Context = v.InferOutput<typeof contextSchema>;
|
||||
|
||||
export { contextSchema, type Context };
|
||||
|
|
|
@ -15,6 +15,9 @@ const conversationSchema = v.object({
|
|||
last_status: v.fallback(v.nullable(statusSchema), null),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Conversation = v.InferOutput<typeof conversationSchema>;
|
||||
|
||||
export { conversationSchema, type Conversation };
|
||||
|
|
|
@ -14,6 +14,9 @@ const customEmojiSchema = v.object({
|
|||
category: v.fallback(v.nullable(v.string()), null),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type CustomEmoji = v.InferOutput<typeof customEmojiSchema>;
|
||||
|
||||
export { customEmojiSchema, type CustomEmoji };
|
||||
|
|
|
@ -9,7 +9,7 @@ const directoryCategorySchema = v.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* @category Directory types
|
||||
* @category Directory entity types
|
||||
*/
|
||||
type DirectoryCategory = v.InferOutput<typeof directoryCategorySchema>;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ const directoryLanguageSchema = v.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* @category Directory types
|
||||
* @category Directory entity types
|
||||
*/
|
||||
type DirectoryLanguage = v.InferOutput<typeof directoryLanguageSchema>;
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ const directoryServerSchema = v.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* @category Directory types
|
||||
* @category Directory entity types
|
||||
*/
|
||||
type DirectoryServer = v.InferOutput<typeof directoryServerSchema>;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ const directoryStatisticsPeriodSchema = v.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* @category Directory types
|
||||
* @category Directory entity types
|
||||
*/
|
||||
type DirectoryStatisticsPeriod = v.InferOutput<typeof directoryStatisticsPeriodSchema>;
|
||||
|
||||
|
|
|
@ -11,6 +11,9 @@ const domainBlockSchema = v.object({
|
|||
comment: v.fallback(v.optional(v.string()), undefined),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type DomainBlock = v.InferOutput<typeof domainBlockSchema>;
|
||||
|
||||
export { domainBlockSchema, type DomainBlock };
|
||||
|
|
|
@ -36,6 +36,9 @@ const emojiReactionSchema = v.pipe(
|
|||
v.union([baseEmojiReactionSchema, customEmojiReactionSchema]),
|
||||
);
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type EmojiReaction = v.InferOutput<typeof emojiReactionSchema>;
|
||||
|
||||
export { emojiReactionSchema, type EmojiReaction };
|
||||
|
|
|
@ -11,6 +11,9 @@ const extendedDescriptionSchema = v.object({
|
|||
content: v.string(),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type ExtendedDescription = v.InferOutput<typeof extendedDescriptionSchema>;
|
||||
|
||||
export { extendedDescriptionSchema, type ExtendedDescription };
|
||||
|
|
|
@ -12,6 +12,9 @@ const familiarFollowersSchema = v.object({
|
|||
accounts: filteredArray(accountSchema),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type FamiliarFollowers = v.InferOutput<typeof familiarFollowersSchema>
|
||||
|
||||
export { familiarFollowersSchema, type FamiliarFollowers };
|
||||
|
|
|
@ -12,6 +12,9 @@ const featuredTagSchema = v.object({
|
|||
last_status_at: v.number(),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type FeaturedTag = v.InferOutput<typeof featuredTagSchema>;
|
||||
|
||||
export { featuredTagSchema, type FeaturedTag };
|
||||
|
|
|
@ -12,6 +12,9 @@ const filterResultSchema = v.object({
|
|||
status_matches: v.fallback(v.nullable(v.string()), null),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type FilterResult = v.InferOutput<typeof filterResultSchema>;
|
||||
|
||||
export { filterResultSchema, type FilterResult };
|
||||
|
|
|
@ -53,6 +53,9 @@ const filterSchema = v.pipe(
|
|||
}),
|
||||
);
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Filter = v.InferOutput<typeof filterSchema>;
|
||||
|
||||
export { filterKeywordSchema, filterStatusSchema, filterSchema, type Filter };
|
||||
|
|
|
@ -19,6 +19,9 @@ const groupMemberSchema = v.object({
|
|||
role: v.enum(GroupRoles),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type GroupMember = v.InferOutput<typeof groupMemberSchema>;
|
||||
|
||||
export { groupMemberSchema, type GroupMember, GroupRoles, type GroupRole };
|
||||
|
|
|
@ -12,6 +12,9 @@ const groupRelationshipSchema = v.object({
|
|||
requested: v.fallback(v.boolean(), false),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type GroupRelationship = v.InferOutput<typeof groupRelationshipSchema>;
|
||||
|
||||
export { groupRelationshipSchema, type GroupRelationship };
|
||||
|
|
|
@ -31,6 +31,9 @@ const groupSchema = v.object({
|
|||
header_description: v.fallback(v.string(), ''),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Group = v.InferOutput<typeof groupSchema>;
|
||||
|
||||
export { groupSchema, type Group };
|
||||
|
|
|
@ -122,6 +122,9 @@ const notificationGroupSchema: v.BaseSchema<any, NotificationGroup, v.BaseIssue<
|
|||
eventParticipationRequestNotificationGroupSchema,
|
||||
])) as any;
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type NotificationGroup = v.InferOutput<
|
||||
| typeof accountNotificationGroupSchema
|
||||
| typeof mentionNotificationGroupSchema
|
||||
|
|
|
@ -332,6 +332,9 @@ const instanceSchema = v.pipe(
|
|||
}),
|
||||
);
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Instance = v.InferOutput<typeof instanceSchema>;
|
||||
|
||||
export { instanceSchema, type Instance };
|
||||
|
|
|
@ -4,6 +4,9 @@ import { coerceObject } from './utils';
|
|||
|
||||
const interactionPolicyEntrySchema = v.picklist(['public', 'followers', 'following', 'mutuals', 'mentioned', 'author', 'me']);
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type InteractionPolicyEntry = v.InferOutput<typeof interactionPolicyEntrySchema>;
|
||||
|
||||
const interactionPolicyRuleSchema = coerceObject({
|
||||
|
@ -21,6 +24,9 @@ const interactionPolicySchema = coerceObject({
|
|||
can_reply: interactionPolicyRuleSchema,
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type InteractionPolicy = v.InferOutput<typeof interactionPolicySchema>;
|
||||
|
||||
/**
|
||||
|
@ -33,6 +39,9 @@ const interactionPoliciesSchema = coerceObject({
|
|||
direct: interactionPolicySchema,
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type InteractionPolicies = v.InferOutput<typeof interactionPoliciesSchema>;
|
||||
|
||||
export { interactionPolicySchema, interactionPoliciesSchema, type InteractionPolicyEntry, type InteractionPolicy, type InteractionPolicies };
|
||||
|
|
|
@ -20,6 +20,9 @@ const interactionRequestSchema = v.object({
|
|||
uri: v.fallback(v.nullable(v.string()), null),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type InteractionRequest = v.InferOutput<typeof interactionRequestSchema>;
|
||||
|
||||
export { interactionRequestSchema, type InteractionRequest };
|
||||
|
|
|
@ -11,6 +11,9 @@ const listSchema = v.object({
|
|||
exclusive: v.fallback(v.optional(v.boolean()), undefined),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type List = v.InferOutput<typeof listSchema>;
|
||||
|
||||
export { listSchema, type List };
|
||||
|
|
|
@ -21,6 +21,9 @@ const locationSchema = v.object({
|
|||
})), null),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Location = v.InferOutput<typeof locationSchema>;
|
||||
|
||||
export { locationSchema, type Location };
|
||||
|
|
|
@ -20,6 +20,9 @@ const markerSchema = v.pipe(
|
|||
}),
|
||||
);
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Marker = v.InferOutput<typeof markerSchema>;
|
||||
|
||||
/**
|
||||
|
@ -27,6 +30,9 @@ type Marker = v.InferOutput<typeof markerSchema>;
|
|||
*/
|
||||
const markersSchema = v.record(v.string(), markerSchema);
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Markers = v.InferOutput<typeof markersSchema>;
|
||||
|
||||
export {
|
||||
|
|
|
@ -114,6 +114,9 @@ const mediaAttachmentSchema = v.pipe(
|
|||
]),
|
||||
);
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type MediaAttachment = v.InferOutput<typeof mediaAttachmentSchema>;
|
||||
|
||||
export { blurhashSchema, mediaAttachmentSchema, type MediaAttachment };
|
||||
|
|
|
@ -20,6 +20,9 @@ const mentionSchema = v.pipe(
|
|||
}),
|
||||
);
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Mention = v.InferOutput<typeof mentionSchema>;
|
||||
|
||||
export { mentionSchema, type Mention };
|
||||
|
|
|
@ -18,6 +18,9 @@ const notificationPolicySchema = v.object({
|
|||
}),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type NotificationPolicy = v.InferOutput<typeof notificationPolicySchema>;
|
||||
|
||||
export { notificationPolicySchema, type NotificationPolicy };
|
||||
|
|
|
@ -17,6 +17,9 @@ const notificationRequestSchema = v.object({
|
|||
last_status: v.fallback(v.optional(statusSchema), undefined),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type NotificationRequest = v.InferOutput<typeof notificationRequestSchema>;
|
||||
|
||||
export { notificationRequestSchema, type NotificationRequest };
|
||||
|
|
|
@ -110,6 +110,9 @@ const notificationSchema: v.BaseSchema<any, Notification, v.BaseIssue<unknown>>
|
|||
eventParticipationRequestNotificationSchema,
|
||||
])) as any;
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Notification = v.InferOutput<
|
||||
| typeof accountNotificationSchema
|
||||
| typeof mentionNotificationSchema
|
||||
|
|
|
@ -19,6 +19,9 @@ const oauthTokenSchema = v.pipe(
|
|||
}),
|
||||
);
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type OauthToken = v.InferOutput<typeof oauthTokenSchema>;
|
||||
|
||||
export { oauthTokenSchema, type OauthToken };
|
||||
|
|
|
@ -29,7 +29,14 @@ const pollSchema = v.object({
|
|||
non_anonymous: v.fallback(v.boolean(), false),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Poll = v.InferOutput<typeof pollSchema>;
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type PollOption = Poll['options'][number];
|
||||
|
||||
export { pollSchema, type Poll, type PollOption };
|
||||
|
|
|
@ -12,6 +12,9 @@ const previewCardAuthorSchema = v.object({
|
|||
account: v.fallback(v.nullable(accountSchema), null),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type PreviewCardAuthor = v.InferOutput<typeof previewCardAuthorSchema>;
|
||||
|
||||
export { previewCardAuthorSchema, type PreviewCardAuthor };
|
||||
|
|
|
@ -28,6 +28,9 @@ const previewCardSchema = v.object({
|
|||
width: v.fallback(v.number(), 0),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type PreviewCard = v.InferOutput<typeof previewCardSchema>;
|
||||
|
||||
export { previewCardSchema, type PreviewCard };
|
||||
|
|
|
@ -14,6 +14,9 @@ const relationshipSeveranceEventSchema = v.object({
|
|||
created_at: datetimeSchema,
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type RelationshipSeveranceEvent = v.InferOutput<typeof relationshipSeveranceEventSchema>;
|
||||
|
||||
export { relationshipSeveranceEventSchema, type RelationshipSeveranceEvent };
|
||||
|
|
|
@ -20,6 +20,9 @@ const relationshipSchema = v.object({
|
|||
showing_reblogs: v.fallback(v.boolean(), false),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Relationship = v.InferOutput<typeof relationshipSchema>;
|
||||
|
||||
export { relationshipSchema, type Relationship };
|
||||
|
|
|
@ -20,6 +20,9 @@ const reportSchema = v.object({
|
|||
target_account: v.fallback(v.nullable(accountSchema), null),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Report = v.InferOutput<typeof reportSchema>;
|
||||
|
||||
export { reportSchema, type Report };
|
||||
|
|
|
@ -13,6 +13,9 @@ const roleSchema = v.object({
|
|||
highlighted: v.fallback(v.boolean(), true),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Role = v.InferOutput<typeof roleSchema>;
|
||||
|
||||
export {
|
||||
|
|
|
@ -19,6 +19,9 @@ const ruleSchema = v.pipe(
|
|||
baseRuleSchema,
|
||||
);
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Rule = v.InferOutput<typeof ruleSchema>;
|
||||
|
||||
export { ruleSchema, type Rule };
|
||||
|
|
|
@ -34,6 +34,9 @@ const scheduledStatusSchema = v.object({
|
|||
media_attachments: filteredArray(mediaAttachmentSchema),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type ScheduledStatus = v.InferOutput<typeof scheduledStatusSchema>;
|
||||
|
||||
export { scheduledStatusSchema, type ScheduledStatus };
|
||||
|
|
|
@ -24,6 +24,9 @@ const scrobbleSchema = v.pipe(
|
|||
}),
|
||||
);
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Scrobble = v.InferOutput<typeof scrobbleSchema>;
|
||||
|
||||
export { scrobbleSchema, type Scrobble };
|
||||
|
|
|
@ -17,6 +17,9 @@ const searchSchema = v.object({
|
|||
groups: filteredArray(groupSchema),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Search = v.InferOutput<typeof searchSchema>;
|
||||
|
||||
export { searchSchema, type Search };
|
||||
|
|
|
@ -24,6 +24,9 @@ const statusEditSchema = v.object({
|
|||
emojis: filteredArray(customEmojiSchema),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type StatusEdit = v.InferOutput<typeof statusEditSchema>;
|
||||
|
||||
export { statusEditSchema, type StatusEdit };
|
||||
|
|
|
@ -18,6 +18,9 @@ const statusSourceSchema = v.object({
|
|||
spoiler_text_map: v.fallback(v.nullable(v.record(v.string(), v.string())), null),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type StatusSource = v.InferOutput<typeof statusSourceSchema>;
|
||||
|
||||
export { statusSourceSchema, type StatusSource };
|
||||
|
|
|
@ -155,12 +155,18 @@ const statusWithoutAccountSchema = v.pipe(v.any(), v.transform(preprocess), v.ob
|
|||
quote: v.fallback(v.nullable(v.lazy(() => statusSchema)), null),
|
||||
}));
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type StatusWithoutAccount = Omit<v.InferOutput<typeof baseStatusSchema>, 'account'> & {
|
||||
account: Account | null;
|
||||
reblog: Status | null;
|
||||
quote: Status | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Status = v.InferOutput<typeof baseStatusSchema> & {
|
||||
reblog: Status | null;
|
||||
quote: Status | null;
|
||||
|
|
|
@ -25,6 +25,9 @@ const followRelationshipUpdateSchema = v.object({
|
|||
}),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type FollowRelationshipUpdate = v.InferOutput<typeof followRelationshipUpdateSchema>;
|
||||
|
||||
const baseStreamingEventSchema = v.object({
|
||||
|
@ -130,6 +133,9 @@ const streamingEventSchema: v.BaseSchema<any, StreamingEvent, v.BaseIssue<unknow
|
|||
]),
|
||||
) as any;
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type StreamingEvent = v.InferOutput<
|
||||
| typeof statusStreamingEventSchema
|
||||
| typeof stringStreamingEventSchema
|
||||
|
|
|
@ -42,6 +42,9 @@ const suggestionSchema = v.pipe(
|
|||
}),
|
||||
);
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Suggestion = v.InferOutput<typeof suggestionSchema>;
|
||||
|
||||
export { suggestionSchema, type Suggestion };
|
||||
|
|
|
@ -20,6 +20,9 @@ const tagSchema = v.object({
|
|||
following: v.fallback(v.optional(v.boolean()), undefined),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Tag = v.InferOutput<typeof tagSchema>;
|
||||
|
||||
export { historySchema, tagSchema, type Tag };
|
||||
|
|
|
@ -16,6 +16,9 @@ const tokenSchema = v.object({
|
|||
me: v.fallback(v.optional(v.string()), undefined),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Token = v.InferOutput<typeof tokenSchema>;
|
||||
|
||||
export { tokenSchema, type Token };
|
||||
|
|
|
@ -43,6 +43,9 @@ const translationSchema = v.pipe(
|
|||
}),
|
||||
);
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type Translation = v.InferOutput<typeof translationSchema>;
|
||||
|
||||
export { translationSchema, type Translation };
|
||||
|
|
|
@ -31,6 +31,9 @@ const trendsLinkSchema = v.pipe(
|
|||
}),
|
||||
);
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type TrendsLink = v.InferOutput<typeof trendsLinkSchema>;
|
||||
|
||||
export { trendsLinkSchema, type TrendsLink };
|
||||
|
|
|
@ -11,6 +11,9 @@ const webPushSubscriptionSchema = v.object({
|
|||
server_key: v.string(),
|
||||
});
|
||||
|
||||
/**
|
||||
* @category Entity types
|
||||
*/
|
||||
type WebPushSubscription = v.InferOutput<typeof webPushSubscriptionSchema>;
|
||||
|
||||
export { webPushSubscriptionSchema, type WebPushSubscription };
|
||||
|
|
Loading…
Reference in a new issue