mirror of
https://github.com/versia-pub/api.git
synced 2025-12-06 08:28:19 +01:00
chore: ⬆️ Upgrade dependencies, fix new linter issues
This commit is contained in:
parent
6c15ceb1e9
commit
23936d549f
29
biome.json
29
biome.json
|
|
@ -1,19 +1,22 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://biomejs.dev/schemas/1.8.1/schema.json",
|
"$schema": "https://biomejs.dev/schemas/1.9.1/schema.json",
|
||||||
"organizeImports": {
|
"organizeImports": {
|
||||||
"enabled": true,
|
"enabled": true
|
||||||
"ignore": ["node_modules", "dist"]
|
|
||||||
},
|
},
|
||||||
"linter": {
|
"linter": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"rules": {
|
"rules": {
|
||||||
"all": true,
|
"all": true,
|
||||||
"correctness": {
|
"correctness": {
|
||||||
"noNodejsModules": "off"
|
"noNodejsModules": "off",
|
||||||
|
"noUndeclaredDependencies": "off"
|
||||||
},
|
},
|
||||||
"complexity": {
|
"complexity": {
|
||||||
"noExcessiveCognitiveComplexity": "off"
|
"noExcessiveCognitiveComplexity": "off"
|
||||||
},
|
},
|
||||||
|
"suspicious": {
|
||||||
|
"noConsole": "off"
|
||||||
|
},
|
||||||
"style": {
|
"style": {
|
||||||
"noDefaultExport": "off",
|
"noDefaultExport": "off",
|
||||||
"noParameterProperties": "off",
|
"noParameterProperties": "off",
|
||||||
|
|
@ -67,25 +70,19 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nursery": {
|
"nursery": {
|
||||||
"noDuplicateElseIf": "warn",
|
"noDuplicateElseIf": "warn"
|
||||||
"noDuplicateJsonKeys": "warn",
|
}
|
||||||
"noEvolvingTypes": "warn",
|
|
||||||
"noYodaExpression": "warn",
|
|
||||||
"useConsistentBuiltinInstantiation": "warn",
|
|
||||||
"useErrorMessage": "warn",
|
|
||||||
"useImportExtensions": "off",
|
|
||||||
"useThrowNewError": "warn"
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"ignore": ["node_modules", "dist"]
|
|
||||||
},
|
},
|
||||||
"formatter": {
|
"formatter": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"indentStyle": "space",
|
"indentStyle": "space",
|
||||||
"indentWidth": 4,
|
"indentWidth": 4
|
||||||
"ignore": ["node_modules", "dist"]
|
|
||||||
},
|
},
|
||||||
"javascript": {
|
"javascript": {
|
||||||
"globals": ["Bun"]
|
"globals": ["Bun"]
|
||||||
|
},
|
||||||
|
"files": {
|
||||||
|
"ignore": ["node_modules", "dist"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import type { Token } from "./types/token";
|
import type { Token } from "./types/token.ts";
|
||||||
import { type Output, ResponseError } from "./versia/base";
|
import { type Output, ResponseError } from "./versia/base.ts";
|
||||||
import { Client } from "./versia/client";
|
import { Client } from "./versia/client.ts";
|
||||||
|
|
||||||
export { Client, ResponseError, type Output, type Token };
|
export { Client, ResponseError, type Output, type Token };
|
||||||
|
|
|
||||||
|
|
@ -1,50 +1,50 @@
|
||||||
import type { Account } from "./types/account";
|
import type { Account } from "./types/account.ts";
|
||||||
import type { Activity } from "./types/activity";
|
import type { Activity } from "./types/activity.ts";
|
||||||
import type {
|
import type {
|
||||||
Announcement,
|
Announcement,
|
||||||
AnnouncementAccount,
|
AnnouncementAccount,
|
||||||
AnnouncementReaction,
|
AnnouncementReaction,
|
||||||
AnnouncementStatus,
|
AnnouncementStatus,
|
||||||
} from "./types/announcement";
|
} from "./types/announcement.ts";
|
||||||
import type { Application, ApplicationData } from "./types/application";
|
import type { Application, ApplicationData } from "./types/application.ts";
|
||||||
import type { AsyncAttachment } from "./types/async_attachment";
|
import type { AsyncAttachment } from "./types/async_attachment.ts";
|
||||||
import type { Attachment, Focus, Meta, Sub } from "./types/attachment";
|
import type { Attachment, Focus, Meta, Sub } from "./types/attachment.ts";
|
||||||
import type { Card } from "./types/card";
|
import type { Card } from "./types/card.ts";
|
||||||
import type { Context } from "./types/context";
|
import type { Context } from "./types/context.ts";
|
||||||
import type { Conversation } from "./types/conversation";
|
import type { Conversation } from "./types/conversation.ts";
|
||||||
import type { Emoji } from "./types/emoji";
|
import type { Emoji } from "./types/emoji.ts";
|
||||||
import type { FeaturedTag } from "./types/featured_tag";
|
import type { FeaturedTag } from "./types/featured_tag.ts";
|
||||||
import type { Field } from "./types/field";
|
import type { Field } from "./types/field.ts";
|
||||||
import type { Filter, FilterContext } from "./types/filter";
|
import type { Filter, FilterContext } from "./types/filter.ts";
|
||||||
import type { FollowRequest } from "./types/follow_request";
|
import type { FollowRequest } from "./types/follow_request.ts";
|
||||||
import type { History } from "./types/history";
|
import type { History } from "./types/history.ts";
|
||||||
import type { IdentityProof } from "./types/identity_proof";
|
import type { IdentityProof } from "./types/identity_proof.ts";
|
||||||
import type {
|
import type {
|
||||||
ExtendedDescription,
|
ExtendedDescription,
|
||||||
Instance,
|
Instance,
|
||||||
InstanceRule,
|
InstanceRule,
|
||||||
} from "./types/instance";
|
} from "./types/instance.ts";
|
||||||
import type { List, RepliesPolicy } from "./types/list";
|
import type { List, RepliesPolicy } from "./types/list.ts";
|
||||||
import type { Marker } from "./types/marker";
|
import type { Marker } from "./types/marker.ts";
|
||||||
import type { Mention } from "./types/mention";
|
import type { Mention } from "./types/mention.ts";
|
||||||
import type { Notification, NotificationType } from "./types/notification";
|
import type { Notification, NotificationType } from "./types/notification.ts";
|
||||||
import type { Poll, PollOption } from "./types/poll";
|
import type { Poll, PollOption } from "./types/poll.ts";
|
||||||
import type { Preferences } from "./types/preferences";
|
import type { Preferences } from "./types/preferences.ts";
|
||||||
import type { Alerts, PushSubscription } from "./types/push_subscription";
|
import type { Alerts, PushSubscription } from "./types/push_subscription.ts";
|
||||||
import type { Reaction } from "./types/reaction";
|
import type { Reaction } from "./types/reaction.ts";
|
||||||
import type { Relationship } from "./types/relationship";
|
import type { Relationship } from "./types/relationship.ts";
|
||||||
import type { Category, Report } from "./types/report";
|
import type { Category, Report } from "./types/report.ts";
|
||||||
import type { Results } from "./types/results";
|
import type { Results } from "./types/results.ts";
|
||||||
import type { ScheduledStatus } from "./types/scheduled_status";
|
import type { ScheduledStatus } from "./types/scheduled_status.ts";
|
||||||
import type { Source } from "./types/source";
|
import type { Source } from "./types/source.ts";
|
||||||
import type { Stats } from "./types/stats";
|
import type { Stats } from "./types/stats.ts";
|
||||||
import type { Status, StatusTag, StatusVisibility } from "./types/status";
|
import type { Status, StatusTag, StatusVisibility } from "./types/status.ts";
|
||||||
import type { StatusParams } from "./types/status_params";
|
import type { StatusParams } from "./types/status_params.ts";
|
||||||
import type { StatusSource } from "./types/status_source";
|
import type { StatusSource } from "./types/status_source.ts";
|
||||||
import type { Tag } from "./types/tag";
|
import type { Tag } from "./types/tag.ts";
|
||||||
import type { Token } from "./types/token";
|
import type { Token } from "./types/token.ts";
|
||||||
import type { URLs } from "./types/urls";
|
import type { URLs } from "./types/urls.ts";
|
||||||
import { RolePermission, type VersiaRole } from "./types/versia";
|
import { RolePermission, type VersiaRole } from "./types/versia.ts";
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
Account,
|
Account,
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import type { Emoji } from "./emoji";
|
import type { Emoji } from "./emoji.ts";
|
||||||
import type { Field } from "./field";
|
import type { Field } from "./field.ts";
|
||||||
import type { Role } from "./role";
|
import type { Role } from "./role.ts";
|
||||||
import type { Source } from "./source";
|
import type { Source } from "./source.ts";
|
||||||
import type { VersiaRole } from "./versia";
|
import type { VersiaRole } from "./versia.ts";
|
||||||
|
|
||||||
export type Account = {
|
export type Account = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import type { Emoji } from "./emoji";
|
import type { Emoji } from "./emoji.ts";
|
||||||
import type { StatusTag } from "./status";
|
import type { StatusTag } from "./status.ts";
|
||||||
|
|
||||||
export type Announcement = {
|
export type Announcement = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Meta } from "./attachment";
|
import type { Meta } from "./attachment.ts";
|
||||||
|
|
||||||
export type AsyncAttachment = {
|
export type AsyncAttachment = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Status } from "./status";
|
import type { Status } from "./status.ts";
|
||||||
|
|
||||||
export type Context = {
|
export type Context = {
|
||||||
ancestors: Status[];
|
ancestors: Status[];
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import type { Account } from "./account";
|
import type { Account } from "./account.ts";
|
||||||
import type { Status } from "./status";
|
import type { Status } from "./status.ts";
|
||||||
|
|
||||||
export type Conversation = {
|
export type Conversation = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import type { Emoji } from "./emoji";
|
import type { Emoji } from "./emoji.ts";
|
||||||
import type { Field } from "./field";
|
import type { Field } from "./field.ts";
|
||||||
|
|
||||||
export type FollowRequest = {
|
export type FollowRequest = {
|
||||||
id: number;
|
id: number;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Account } from "./account";
|
import type { Account } from "./account.ts";
|
||||||
|
|
||||||
export type Instance = {
|
export type Instance = {
|
||||||
domain: string;
|
domain: string;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import type { Account } from "./account";
|
import type { Account } from "./account.ts";
|
||||||
import type { Reaction } from "./reaction";
|
import type { Reaction } from "./reaction.ts";
|
||||||
import type { Status } from "./status";
|
import type { Status } from "./status.ts";
|
||||||
|
|
||||||
export type Notification = {
|
export type Notification = {
|
||||||
account: Account | null;
|
account: Account | null;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import type { StatusVisibility } from "./status";
|
import type { StatusVisibility } from "./status.ts";
|
||||||
|
|
||||||
export type Preferences = {
|
export type Preferences = {
|
||||||
"posting:default:visibility": StatusVisibility;
|
"posting:default:visibility": StatusVisibility;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Account } from "./account";
|
import type { Account } from "./account.ts";
|
||||||
|
|
||||||
export type Reaction = {
|
export type Reaction = {
|
||||||
count: number;
|
count: number;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Account } from "./account";
|
import type { Account } from "./account.ts";
|
||||||
|
|
||||||
export type Report = {
|
export type Report = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import type { Account } from "./account";
|
import type { Account } from "./account.ts";
|
||||||
import type { Status } from "./status";
|
import type { Status } from "./status.ts";
|
||||||
import type { Tag } from "./tag";
|
import type { Tag } from "./tag.ts";
|
||||||
|
|
||||||
export type Results = {
|
export type Results = {
|
||||||
accounts: Account[];
|
accounts: Account[];
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import type { Attachment } from "./attachment";
|
import type { Attachment } from "./attachment.ts";
|
||||||
import type { StatusParams } from "./status_params";
|
import type { StatusParams } from "./status_params.ts";
|
||||||
|
|
||||||
export type ScheduledStatus = {
|
export type ScheduledStatus = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Field } from "./field";
|
import type { Field } from "./field.ts";
|
||||||
|
|
||||||
export type Source = {
|
export type Source = {
|
||||||
privacy: string | null;
|
privacy: string | null;
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
import type { Account } from "./account";
|
import type { Account } from "./account.ts";
|
||||||
import type { Application } from "./application";
|
import type { Application } from "./application.ts";
|
||||||
import type { Attachment } from "./attachment";
|
import type { Attachment } from "./attachment.ts";
|
||||||
import type { Card } from "./card";
|
import type { Card } from "./card.ts";
|
||||||
import type { Emoji } from "./emoji";
|
import type { Emoji } from "./emoji.ts";
|
||||||
import type { Mention } from "./mention";
|
import type { Mention } from "./mention.ts";
|
||||||
import type { Poll } from "./poll";
|
import type { Poll } from "./poll.ts";
|
||||||
import type { Reaction } from "./reaction";
|
import type { Reaction } from "./reaction.ts";
|
||||||
|
|
||||||
export type Status = {
|
export type Status = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import type { StatusVisibility } from "./status";
|
import type { StatusVisibility } from "./status.ts";
|
||||||
|
|
||||||
export type StatusParams = {
|
export type StatusParams = {
|
||||||
text: string;
|
text: string;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import type { History } from "./history";
|
import type { History } from "./history.ts";
|
||||||
|
|
||||||
export type Tag = {
|
export type Tag = {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { DEFAULT_UA } from "./constants";
|
import { DEFAULT_UA } from "./constants.ts";
|
||||||
|
|
||||||
type HttpVerb = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
type HttpVerb = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
||||||
type ConvertibleObject = {
|
type ConvertibleObject = {
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,9 @@ import type {
|
||||||
Tag,
|
Tag,
|
||||||
Token,
|
Token,
|
||||||
VersiaRole,
|
VersiaRole,
|
||||||
} from "../types";
|
} from "../types.ts";
|
||||||
import { BaseClient, type Output } from "./base";
|
import { BaseClient, type Output } from "./base.ts";
|
||||||
import { DEFAULT_SCOPE, NO_REDIRECT } from "./constants";
|
import { DEFAULT_SCOPE, NO_REDIRECT } from "./constants.ts";
|
||||||
|
|
||||||
type StatusContentType =
|
type StatusContentType =
|
||||||
| "text/plain"
|
| "text/plain"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { beforeAll, beforeEach, describe, expect, test } from "bun:test";
|
import { beforeAll, beforeEach, describe, expect, test } from "bun:test";
|
||||||
import { SignatureConstructor, SignatureValidator } from "./index";
|
import { SignatureConstructor, SignatureValidator } from "./index.ts";
|
||||||
|
|
||||||
describe("SignatureValidator", () => {
|
describe("SignatureValidator", () => {
|
||||||
let validator: SignatureValidator;
|
let validator: SignatureValidator;
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@ import type {
|
||||||
ShareExtension,
|
ShareExtension,
|
||||||
Unfollow,
|
Unfollow,
|
||||||
User,
|
User,
|
||||||
} from "./types";
|
} from "./types.ts";
|
||||||
import type { EntityValidator } from "./validator";
|
import type { EntityValidator } from "./validator.ts";
|
||||||
|
|
||||||
type MaybePromise<T> = T | Promise<T>;
|
type MaybePromise<T> = T | Promise<T>;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,14 +6,17 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { ValidationError } from "zod-validation-error";
|
import type { ValidationError } from "zod-validation-error";
|
||||||
import { SignatureConstructor, SignatureValidator } from "./cryptography";
|
import {
|
||||||
import { RequestParserHandler } from "./http";
|
SignatureConstructor,
|
||||||
|
SignatureValidator,
|
||||||
|
} from "./cryptography/index.ts";
|
||||||
|
import { RequestParserHandler } from "./http.ts";
|
||||||
import {
|
import {
|
||||||
FederationRequester,
|
FederationRequester,
|
||||||
type Output,
|
type Output,
|
||||||
ResponseError,
|
ResponseError,
|
||||||
} from "./requester/index";
|
} from "./requester/index.ts";
|
||||||
import { EntityValidator } from "./validator";
|
import { EntityValidator } from "./validator.ts";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
EntityValidator,
|
EntityValidator,
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import { fromZodError } from "zod-validation-error";
|
import { fromZodError } from "zod-validation-error";
|
||||||
import type { SignatureConstructor } from "../cryptography";
|
import type { SignatureConstructor } from "../cryptography/index.ts";
|
||||||
import { WebFingerSchema } from "../schemas/webfinger";
|
import { WebFingerSchema } from "../schemas/webfinger.ts";
|
||||||
import type { User } from "../types";
|
import type { User } from "../types.ts";
|
||||||
import { DEFAULT_UA } from "./constants";
|
import { DEFAULT_UA } from "./constants.ts";
|
||||||
|
|
||||||
type HttpVerb = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
type HttpVerb = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,15 +15,15 @@ import {
|
||||||
NoteSchema,
|
NoteSchema,
|
||||||
UnfollowSchema,
|
UnfollowSchema,
|
||||||
UserSchema,
|
UserSchema,
|
||||||
} from "./schemas/base";
|
} from "./schemas/base.ts";
|
||||||
import { ContentFormatSchema } from "./schemas/content_format";
|
import { ContentFormatSchema } from "./schemas/content_format.ts";
|
||||||
import { ExtensionPropertySchema } from "./schemas/extensions";
|
import { ExtensionPropertySchema } from "./schemas/extensions.ts";
|
||||||
import { CustomEmojiExtensionSchema } from "./schemas/extensions/custom_emojis";
|
import { CustomEmojiExtensionSchema } from "./schemas/extensions/custom_emojis.ts";
|
||||||
import { DislikeSchema, LikeSchema } from "./schemas/extensions/likes";
|
import { DislikeSchema, LikeSchema } from "./schemas/extensions/likes.ts";
|
||||||
import { VoteSchema } from "./schemas/extensions/polls";
|
import { VoteSchema } from "./schemas/extensions/polls.ts";
|
||||||
import { ReactionSchema } from "./schemas/extensions/reactions";
|
import { ReactionSchema } from "./schemas/extensions/reactions.ts";
|
||||||
import { ShareSchema } from "./schemas/extensions/share";
|
import { ShareSchema } from "./schemas/extensions/share.ts";
|
||||||
import { VanityExtensionSchema } from "./schemas/extensions/vanity";
|
import { VanityExtensionSchema } from "./schemas/extensions/vanity.ts";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
NoteSchema as Note,
|
NoteSchema as Note,
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,10 @@ import {
|
||||||
ContentFormatSchema,
|
ContentFormatSchema,
|
||||||
ImageOnlyContentFormatSchema,
|
ImageOnlyContentFormatSchema,
|
||||||
TextOnlyContentFormatSchema,
|
TextOnlyContentFormatSchema,
|
||||||
} from "./content_format";
|
} from "./content_format.ts";
|
||||||
import { ExtensionPropertySchema } from "./extensions";
|
import { ExtensionPropertySchema } from "./extensions.ts";
|
||||||
import { VanityExtensionSchema } from "./extensions/vanity";
|
import { VanityExtensionSchema } from "./extensions/vanity.ts";
|
||||||
import { extensionRegex, isISOString, semverRegex } from "./regex";
|
import { extensionRegex, isISOString, semverRegex } from "./regex.ts";
|
||||||
|
|
||||||
export const EntitySchema = z
|
export const EntitySchema = z
|
||||||
.object({
|
.object({
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { CustomEmojiExtensionSchema } from "./extensions/custom_emojis";
|
import { CustomEmojiExtensionSchema } from "./extensions/custom_emojis.ts";
|
||||||
|
|
||||||
export const ExtensionPropertySchema = z
|
export const ExtensionPropertySchema = z
|
||||||
.object({
|
.object({
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@
|
||||||
* @see https://versia.pub/extensions/custom-emojis
|
* @see https://versia.pub/extensions/custom-emojis
|
||||||
*/
|
*/
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { ImageOnlyContentFormatSchema } from "../content_format";
|
import { ImageOnlyContentFormatSchema } from "../content_format.ts";
|
||||||
import { emojiRegex } from "../regex";
|
import { emojiRegex } from "../regex.ts";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Used to validate the properties the extension's custom field
|
* @description Used to validate the properties the extension's custom field
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { EntitySchema } from "../base";
|
import { EntitySchema } from "../base.ts";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Like entity
|
* @description Like entity
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
* @see https://versia.pub/extensions/polls
|
* @see https://versia.pub/extensions/polls
|
||||||
*/
|
*/
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { EntitySchema } from "../base";
|
import { EntitySchema } from "../base.ts";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Vote extension entity
|
* @description Vote extension entity
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
* @see https://versia.pub/extensions/reactions
|
* @see https://versia.pub/extensions/reactions
|
||||||
*/
|
*/
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { EntitySchema } from "../base";
|
import { EntitySchema } from "../base.ts";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Reaction extension entity
|
* @description Reaction extension entity
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { EntitySchema } from "../base";
|
import { EntitySchema } from "../base.ts";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Share entity
|
* @description Share entity
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ import { z } from "zod";
|
||||||
import {
|
import {
|
||||||
AudioOnlyContentFormatSchema,
|
AudioOnlyContentFormatSchema,
|
||||||
ImageOnlyContentFormatSchema,
|
ImageOnlyContentFormatSchema,
|
||||||
} from "../content_format";
|
} from "../content_format.ts";
|
||||||
import { isISOString } from "../regex";
|
import { isISOString } from "../regex.ts";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Vanity extension entity
|
* @description Vanity extension entity
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { describe, expect, it } from "bun:test";
|
import { describe, expect, it } from "bun:test";
|
||||||
import { EntityValidator } from "../index";
|
import { EntityValidator } from "../index.ts";
|
||||||
|
|
||||||
describe("Package testing", () => {
|
describe("Package testing", () => {
|
||||||
it("should not validate a bad Note", () => {
|
it("should not validate a bad Note", () => {
|
||||||
|
|
|
||||||
|
|
@ -16,15 +16,15 @@ import type {
|
||||||
NoteSchema,
|
NoteSchema,
|
||||||
UnfollowSchema,
|
UnfollowSchema,
|
||||||
UserSchema,
|
UserSchema,
|
||||||
} from "./schemas/base";
|
} from "./schemas/base.ts";
|
||||||
import type { ContentFormatSchema } from "./schemas/content_format";
|
import type { ContentFormatSchema } from "./schemas/content_format.ts";
|
||||||
import type { ExtensionPropertySchema } from "./schemas/extensions";
|
import type { ExtensionPropertySchema } from "./schemas/extensions.ts";
|
||||||
import type { CustomEmojiExtensionSchema } from "./schemas/extensions/custom_emojis";
|
import type { CustomEmojiExtensionSchema } from "./schemas/extensions/custom_emojis.ts";
|
||||||
import type { DislikeSchema, LikeSchema } from "./schemas/extensions/likes";
|
import type { DislikeSchema, LikeSchema } from "./schemas/extensions/likes.ts";
|
||||||
import type { VoteSchema } from "./schemas/extensions/polls";
|
import type { VoteSchema } from "./schemas/extensions/polls.ts";
|
||||||
import type { ReactionSchema } from "./schemas/extensions/reactions";
|
import type { ReactionSchema } from "./schemas/extensions/reactions.ts";
|
||||||
import type { ShareSchema } from "./schemas/extensions/share";
|
import type { ShareSchema } from "./schemas/extensions/share.ts";
|
||||||
import type { VanityExtensionSchema } from "./schemas/extensions/vanity";
|
import type { VanityExtensionSchema } from "./schemas/extensions/vanity.ts";
|
||||||
|
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: Used only as a base type
|
// biome-ignore lint/suspicious/noExplicitAny: Used only as a base type
|
||||||
type AnyZod = z.ZodType<any, any, any>;
|
type AnyZod = z.ZodType<any, any, any>;
|
||||||
|
|
|
||||||
|
|
@ -12,15 +12,15 @@ import {
|
||||||
NoteSchema,
|
NoteSchema,
|
||||||
UnfollowSchema,
|
UnfollowSchema,
|
||||||
UserSchema,
|
UserSchema,
|
||||||
} from "./schemas/base";
|
} from "./schemas/base.ts";
|
||||||
import { ContentFormatSchema } from "./schemas/content_format";
|
import { ContentFormatSchema } from "./schemas/content_format.ts";
|
||||||
import { ExtensionPropertySchema } from "./schemas/extensions";
|
import { ExtensionPropertySchema } from "./schemas/extensions.ts";
|
||||||
import { CustomEmojiExtensionSchema } from "./schemas/extensions/custom_emojis";
|
import { CustomEmojiExtensionSchema } from "./schemas/extensions/custom_emojis.ts";
|
||||||
import { LikeSchema } from "./schemas/extensions/likes";
|
import { DislikeSchema, LikeSchema } from "./schemas/extensions/likes.ts";
|
||||||
import { VoteSchema } from "./schemas/extensions/polls";
|
import { VoteSchema } from "./schemas/extensions/polls.ts";
|
||||||
import { ReactionSchema } from "./schemas/extensions/reactions";
|
import { ReactionSchema } from "./schemas/extensions/reactions.ts";
|
||||||
import { ShareSchema } from "./schemas/extensions/share";
|
import { ShareSchema } from "./schemas/extensions/share.ts";
|
||||||
import { VanityExtensionSchema } from "./schemas/extensions/vanity";
|
import { VanityExtensionSchema } from "./schemas/extensions/vanity.ts";
|
||||||
import type {
|
import type {
|
||||||
Collection,
|
Collection,
|
||||||
ContentFormat,
|
ContentFormat,
|
||||||
|
|
@ -42,7 +42,7 @@ import type {
|
||||||
Unfollow,
|
Unfollow,
|
||||||
User,
|
User,
|
||||||
VanityExtension,
|
VanityExtension,
|
||||||
} from "./types";
|
} from "./types.ts";
|
||||||
|
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: Used only as a base type
|
// biome-ignore lint/suspicious/noExplicitAny: Used only as a base type
|
||||||
type AnyZod = z.ZodType<any, any, any>;
|
type AnyZod = z.ZodType<any, any, any>;
|
||||||
|
|
@ -244,7 +244,7 @@ export class EntityValidator {
|
||||||
* @returns A promise that resolves to the validated data.
|
* @returns A promise that resolves to the validated data.
|
||||||
*/
|
*/
|
||||||
public DislikeExtension(data: unknown): Promise<DislikeExtension> {
|
public DislikeExtension(data: unknown): Promise<DislikeExtension> {
|
||||||
return this.validate(LikeSchema, data);
|
return this.validate(DislikeSchema, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@
|
||||||
"check": "bunx tsc -p ."
|
"check": "bunx tsc -p ."
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "^1.8.3",
|
"@biomejs/biome": "^1.9.1",
|
||||||
"@types/bun": "^1.1.8",
|
"@types/bun": "^1.1.9",
|
||||||
"@types/node": "^22.5.0",
|
"@types/node": "^22.5.5",
|
||||||
"bun-plugin-dts": "^0.2.3"
|
"bun-plugin-dts": "^0.2.3"
|
||||||
},
|
},
|
||||||
"trustedDependencies": ["@biomejs/biome"],
|
"trustedDependencies": ["@biomejs/biome"],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue