refactor: 🚚 Rename Lysand to Versia

This commit is contained in:
Jesse Wierzbinski 2024-08-24 14:58:50 +02:00
parent 5b119949dc
commit c9f4885c72
No known key found for this signature in database
27 changed files with 112 additions and 112 deletions

View file

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2024 Lysand Copyright (c) 2024 Versia
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View file

@ -2,18 +2,18 @@
<a href="https://lysand.org"><img src="https://cdn.lysand.org/logo-long-dark.webp" alt="Lysand Logo" height="110"></a> <a href="https://lysand.org"><img src="https://cdn.lysand.org/logo-long-dark.webp" alt="Lysand Logo" height="110"></a>
</p> </p>
<center><h1>Lysand API</h1></center> <center><h1>Versia API</h1></center>
Set of NPM packages written in TypeScript to interact with Lysand-compatible services. Set of NPM packages written in TypeScript to interact with Versia-compatible services.
## Packages ## Packages
- **`@lysand-org/federation`**: Federation types, validators and cryptography for Lysand server implementations. - **`@versia/federation`**: Federation types, validators and cryptography for Versia server implementations.
- **`@lysand-org/client`**: Client for the reference Lysand Server implementation. - **`@versia/client`**: Client for the reference Versia Server implementation.
## Efficiency ## Efficiency
The built output of each package is not even `200 KB` in size, making it a lightweight and efficient solution for your Lysand needs. Installing the package adds around `5 MB` to your `node_modules` folder, but this does not affect the final bundle size. The built output of each package is not even `200 KB` in size, making it a lightweight and efficient solution for your Versia needs. Installing the package adds around `5 MB` to your `node_modules` folder, but this does not affect the final bundle size.
Compilation (bundling/minifying) time is a few seconds, almost all of which is spent on type-checking. The actual compilation time is less than a tenth of a second. Compilation (bundling/minifying) time is a few seconds, almost all of which is spent on type-checking. The actual compilation time is less than a tenth of a second.
@ -21,11 +21,11 @@ Compilation (bundling/minifying) time is a few seconds, almost all of which is s
### Federation ### Federation
Please see the [**`@lysand-org/federation` README**](federation/README.md) for more information. Please see the [**`@versia/federation` README**](federation/README.md) for more information.
### Client ### Client
Please see the [**`@lysand-org/client` README**](client/README.md) for more information. Please see the [**`@versia/client` README**](client/README.md) for more information.
## Getting Started ## Getting Started
@ -76,18 +76,18 @@ We strongly recommend using JSR over NPM for all your packages that are availabl
```bash ```bash
# NPM version # NPM version
deno add npm:@lysand-org/federation npm:@lysand-org/client # For Deno deno add npm:@versia/federation npm:@versia/client # For Deno
npm install @lysand-org/federation @lysand-org/client # For NPM npm install @versia/federation @versia/client # For NPM
yarn add @lysand-org/federation @lysand-org/client # For Yarn yarn add @versia/federation @versia/client # For Yarn
pnpm add @lysand-org/federation @lysand-org/client # For PNPM pnpm add @versia/federation @versia/client # For PNPM
bun add @lysand-org/federation @lysand-org/client # For Bun bun add @versia/federation @versia/client # For Bun
# JSR version # JSR version
deno add @lysand-org/federation @lysand-org/client # For Deno deno add @versia/federation @versia/client # For Deno
npx jsr add @lysand-org/federation @lysand-org/client # For JSR npx jsr add @versia/federation @versia/client # For JSR
yarn dlx jsr add @lysand-org/federation @lysand-org/client # For Yarn yarn dlx jsr add @versia/federation @versia/client # For Yarn
pnpm dlx jsr add @lysand-org/federation @lysand-org/client # For PNPM pnpm dlx jsr add @versia/federation @versia/client # For PNPM
bunx jsr add @lysand-org/federation @lysand-org/client # For Bun bunx jsr add @versia/federation @versia/client # For Bun
``` ```
#### From Source #### From Source
@ -114,4 +114,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
### People ### People
- [**April John**](https://github.com/cutestnekoaqua): Creator and maintainer of the Lysand Server ActivityPub bridge. - [**April John**](https://github.com/cutestnekoaqua): Creator and maintainer of the Versia Server ActivityPub bridge.

View file

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2024 Lysand Copyright (c) 2024 Versia
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View file

@ -2,13 +2,13 @@
<a href="https://lysand.org"><img src="https://cdn.lysand.org/logo-long-dark.webp" alt="Lysand Logo" height="110"></a> <a href="https://lysand.org"><img src="https://cdn.lysand.org/logo-long-dark.webp" alt="Lysand Logo" height="110"></a>
</p> </p>
<center><h1><code>@lysand-org/client</code></h1></center> <center><h1><code>@versia/client</code></h1></center>
TypeScript client API for Lysand and Mastodon servers. TypeScript client API for Versia and Mastodon servers.
## Efficiency ## Efficiency
The built output of the package is not even `32 KB` in size, making it a lightweight and efficient solution for your Lysand needs. Installing the package adds around `5 MB` to your `node_modules` folder, but this does not affect the final bundle size. The built output of the package is not even `32 KB` in size, making it a lightweight and efficient solution for your Versia needs. Installing the package adds around `5 MB` to your `node_modules` folder, but this does not affect the final bundle size.
Compilation (bundling/minifying) time is a few seconds, almost all of which is spent on type-checking. The actual compilation time is less than a tenth of a second. Compilation (bundling/minifying) time is a few seconds, almost all of which is spent on type-checking. The actual compilation time is less than a tenth of a second.
@ -19,12 +19,12 @@ This application may be used in the same was as [`megalodon`](https://github.com
Initialize the client with the following code: Initialize the client with the following code:
```typescript ```typescript
import { LysandClient } from "@lysand-org/client"; import { Client } from "@versia/client";
const baseUrl = new URL("https://social.lysand.org"); const baseUrl = new URL("https://versia.social");
const accessToken = "..."; const accessToken = "...";
const client = new LysandClient(baseUrl, accessToken); const client = new Client(baseUrl, accessToken);
``` ```
The client can then be used to interact with the server: The client can then be used to interact with the server:
@ -98,18 +98,18 @@ We strongly recommend using JSR over NPM for all your packages that are availabl
```bash ```bash
# NPM version # NPM version
deno add npm:@lysand-org/client # For Deno deno add npm:@versia/client # For Deno
npm install @lysand-org/client # For NPM npm install @versia/client # For NPM
yarn add @lysand-org/client # For Yarn yarn add @versia/client # For Yarn
pnpm add @lysand-org/client # For PNPM pnpm add @versia/client # For PNPM
bun add @lysand-org/client # For Bun bun add @versia/client # For Bun
# JSR version # JSR version
deno add @lysand-org/client # For Deno deno add @versia/client # For Deno
npx jsr add @lysand-org/client # For JSR npx jsr add @versia/client # For JSR
yarn dlx jsr add @lysand-org/client # For Yarn yarn dlx jsr add @versia/client # For Yarn
pnpm dlx jsr add @lysand-org/client # For PNPM pnpm dlx jsr add @versia/client # For PNPM
bunx jsr add @lysand-org/client # For Bun bunx jsr add @versia/client # For Bun
``` ```
#### From Source #### From Source
@ -138,4 +138,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
### People ### People
- [**April John**](https://github.com/cutestnekoaqua): Creator and maintainer of the Lysand Server ActivityPub bridge. - [**April John**](https://github.com/cutestnekoaqua): Creator and maintainer of the Versia Server ActivityPub bridge.

View file

@ -1,5 +1,5 @@
import { type Output, ResponseError } from "./lysand/base";
import { LysandClient } from "./lysand/lysand";
import type { Token } from "./types/token"; import type { Token } from "./types/token";
import { type Output, ResponseError } from "./versia/base";
import { Client } from "./versia/client";
export { LysandClient, ResponseError, type Output, type Token }; export { Client, ResponseError, type Output, type Token };

View file

@ -1,6 +1,6 @@
{ {
"$schema": "https://jsr.io/schema/config-file.v1.json", "$schema": "https://jsr.io/schema/config-file.v1.json",
"name": "@lysand-org/client", "name": "@versia/client",
"version": "0.0.0", "version": "0.0.0",
"exports": { "exports": {
".": "./index.ts", ".": "./index.ts",

View file

@ -1,6 +1,6 @@
{ {
"name": "@lysand-org/client", "name": "@versia/client",
"displayName": "Lysand Client", "displayName": "Versia Client",
"version": "0.0.0", "version": "0.0.0",
"author": { "author": {
"email": "jesse.wierzbinski@lysand.org", "email": "jesse.wierzbinski@lysand.org",
@ -31,7 +31,7 @@
"url": "https://cpluspatch.com" "url": "https://cpluspatch.com"
} }
], ],
"description": "Client for Mastodon and Lysand API", "description": "Client for Mastodon and Versia API",
"categories": ["Other"], "categories": ["Other"],
"type": "module", "type": "module",
"engines": { "engines": {
@ -53,8 +53,8 @@
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/lysand" "url": "https://opencollective.com/lysand"
}, },
"homepage": "https://lysand.org", "homepage": "https://versia.pub",
"keywords": ["lysand", "mastodon", "api", "typescript", "rest"], "keywords": ["versia", "mastodon", "api", "typescript", "rest"],
"packageManager": "bun@1.1.8", "packageManager": "bun@1.1.8",
"dependencies": { "dependencies": {
"@badgateway/oauth2-client": "^2.3.0" "@badgateway/oauth2-client": "^2.3.0"

View file

@ -25,7 +25,6 @@ import type {
InstanceRule, InstanceRule,
} from "./types/instance"; } from "./types/instance";
import type { List, RepliesPolicy } from "./types/list"; import type { List, RepliesPolicy } from "./types/list";
import { type LysandRole, RolePermission } from "./types/lysand";
import type { Marker } from "./types/marker"; import type { Marker } from "./types/marker";
import type { Mention } from "./types/mention"; import type { Mention } from "./types/mention";
import type { Notification, NotificationType } from "./types/notification"; import type { Notification, NotificationType } from "./types/notification";
@ -45,6 +44,7 @@ import type { StatusSource } from "./types/status_source";
import type { Tag } from "./types/tag"; import type { Tag } from "./types/tag";
import type { Token } from "./types/token"; import type { Token } from "./types/token";
import type { URLs } from "./types/urls"; import type { URLs } from "./types/urls";
import { RolePermission, type VersiaRole } from "./types/versia";
export type { export type {
Account, Account,
@ -75,7 +75,7 @@ export type {
Instance, Instance,
InstanceRule, InstanceRule,
List, List,
LysandRole, VersiaRole,
Marker, Marker,
Mention, Mention,
Meta, Meta,

View file

@ -1,8 +1,8 @@
import type { Emoji } from "./emoji"; import type { Emoji } from "./emoji";
import type { Field } from "./field"; import type { Field } from "./field";
import type { LysandRole } from "./lysand";
import type { Role } from "./role"; import type { Role } from "./role";
import type { Source } from "./source"; import type { Source } from "./source";
import type { VersiaRole } from "./versia";
export type Account = { export type Account = {
id: string; id: string;
@ -32,6 +32,6 @@ export type Account = {
bot: boolean | null; bot: boolean | null;
source?: Source; source?: Source;
role?: Role; role?: Role;
roles: LysandRole[]; roles: VersiaRole[];
mute_expires_at?: string; mute_expires_at?: string;
}; };

View file

@ -4,7 +4,7 @@ export type Instance = {
domain: string; domain: string;
title: string; title: string;
version: string; version: string;
lysand_version: string; versia_version: string;
source_url: string; source_url: string;
description: string; description: string;
usage: { usage: {

View file

@ -1,4 +1,4 @@
export type LysandRole = { export type VersiaRole = {
id: string; id: string;
name: string; name: string;
permissions: RolePermission[]; permissions: RolePermission[];

View file

@ -15,7 +15,6 @@ import type {
FeaturedTag, FeaturedTag,
Instance, Instance,
List, List,
LysandRole,
Marker, Marker,
Notification, Notification,
Poll, Poll,
@ -28,6 +27,7 @@ import type {
StatusVisibility, StatusVisibility,
Tag, Tag,
Token, Token,
VersiaRole,
} from "../types"; } from "../types";
import { BaseClient, type Output } from "./base"; import { BaseClient, type Output } from "./base";
import { DEFAULT_SCOPE, NO_REDIRECT } from "./constants"; import { DEFAULT_SCOPE, NO_REDIRECT } from "./constants";
@ -39,17 +39,17 @@ type StatusContentType =
| "text/x.misskeymarkdown"; | "text/x.misskeymarkdown";
/** /**
* LysandClient is a client for interacting with the Lysand API. * Client is a client for interacting with the Versia API.
* *
* @extends BaseClient * @extends BaseClient
* @example * @example
* const client = new LysandClient(new URL("https://example.com")); * const client = new Client(new URL("https://example.com"));
* *
* const { data } = await client.getInstance(); * const { data } = await client.getInstance();
* *
* console.log(data); * console.log(data);
*/ */
export class LysandClient extends BaseClient { export class Client extends BaseClient {
/** /**
* POST /api/v1/follow_requests/:id/authorize * POST /api/v1/follow_requests/:id/authorize
* *
@ -106,7 +106,7 @@ export class LysandClient extends BaseClient {
/** /**
* POST /api/v1/roles/:roleId * POST /api/v1/roles/:roleId
* *
* Lysand API only. * Versia API only.
* @param roleId ID of the role to add to the requesting account. * @param roleId ID of the role to add to the requesting account.
*/ */
public addRole( public addRole(
@ -549,7 +549,7 @@ export class LysandClient extends BaseClient {
/** /**
* GET /api/v1/accounts/id * GET /api/v1/accounts/id
* *
* Lysand API only. * Versia API only.
* @param username The username. * @param username The username.
* @return An account. * @return An account.
*/ */
@ -1164,7 +1164,7 @@ export class LysandClient extends BaseClient {
/** /**
* GET /api/v1/instance/privacy_policy * GET /api/v1/instance/privacy_policy
* *
* Lysand API only. * Versia API only.
* @returns * @returns
*/ */
public getInstancePrivacyPolicy( public getInstancePrivacyPolicy(
@ -1179,7 +1179,7 @@ export class LysandClient extends BaseClient {
/** /**
* GET /api/v1/instance/tos * GET /api/v1/instance/tos
* *
* Lysand API only. * Versia API only.
* @returns * @returns
*/ */
public getInstanceTermsOfService( public getInstanceTermsOfService(
@ -1575,18 +1575,18 @@ export class LysandClient extends BaseClient {
public getRole( public getRole(
id: string, id: string,
extra?: RequestInit, extra?: RequestInit,
): Promise<Output<LysandRole>> { ): Promise<Output<VersiaRole>> {
return this.get<LysandRole>(`/api/v1/roles/${id}`, extra); return this.get<VersiaRole>(`/api/v1/roles/${id}`, extra);
} }
/** /**
* GET /api/v1/roles * GET /api/v1/roles
* *
* Lysand API only. * Versia API only.
* @returns Array of roles. * @returns Array of roles.
*/ */
public getRoles(extra?: RequestInit): Promise<Output<LysandRole[]>> { public getRoles(extra?: RequestInit): Promise<Output<VersiaRole[]>> {
return this.get<LysandRole[]>("/api/v1/roles", extra); return this.get<VersiaRole[]>("/api/v1/roles", extra);
} }
/** /**
@ -2052,7 +2052,7 @@ export class LysandClient extends BaseClient {
* POST /api/v1/accounts/:id/refetch * POST /api/v1/accounts/:id/refetch
* *
* Starts a refetch of an account from a remote source. * Starts a refetch of an account from a remote source.
* Lysand API only. * Versia API only.
* @param id The account ID. * @param id The account ID.
* @return Account with updated data. * @return Account with updated data.
*/ */
@ -2181,7 +2181,7 @@ export class LysandClient extends BaseClient {
/** /**
* DELETE /api/v1/roles/:roleId * DELETE /api/v1/roles/:roleId
* *
* Lysand API only. * Versia API only.
* @param roleId Role ID to remove from requesting account. * @param roleId Role ID to remove from requesting account.
* @returns * @returns
*/ */

View file

@ -2,4 +2,4 @@ import pkg from "../package.json" with { type: "json" };
export const NO_REDIRECT = "urn:ietf:wg:oauth:2.0:oob"; export const NO_REDIRECT = "urn:ietf:wg:oauth:2.0:oob";
export const DEFAULT_SCOPE = ["read", "write", "follow"]; export const DEFAULT_SCOPE = ["read", "write", "follow"];
export const DEFAULT_UA = `LysandClient/${pkg.version} (+${pkg.homepage})`; export const DEFAULT_UA = `VersiaClient/${pkg.version} (+${pkg.homepage})`;

View file

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2024 Lysand Copyright (c) 2024 Versia
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View file

@ -2,13 +2,13 @@
<a href="https://lysand.org"><img src="https://cdn.lysand.org/logo-long-dark.webp" alt="Lysand Logo" height="110"></a> <a href="https://lysand.org"><img src="https://cdn.lysand.org/logo-long-dark.webp" alt="Lysand Logo" height="110"></a>
</p> </p>
<center><h1><code>@lysand-org/federation</code></h1></center> <center><h1><code>@versia/federation</code></h1></center>
Federation types, validators and cryptography for Lysand server implementations. Federation types, validators and cryptography for Versia server implementations.
## Efficiency ## Efficiency
The built output of the package is not even `200 KB` in size, making it a lightweight and efficient solution for your Lysand needs. Installing the package adds around `5 MB` to your `node_modules` folder, but this does not affect the final bundle size. The built output of the package is not even `200 KB` in size, making it a lightweight and efficient solution for your Versia needs. Installing the package adds around `5 MB` to your `node_modules` folder, but this does not affect the final bundle size.
Compilation (bundling/minifying) time is a few seconds, almost all of which is spent on type-checking. The actual compilation time is less than a tenth of a second. Compilation (bundling/minifying) time is a few seconds, almost all of which is spent on type-checking. The actual compilation time is less than a tenth of a second.
@ -18,10 +18,10 @@ Compilation (bundling/minifying) time is a few seconds, almost all of which is s
#### Validation #### Validation
[**Zod**](https://zod.dev) is used to validate and parse the objects. All Lysand objects are already written for you. [**Zod**](https://zod.dev) is used to validate and parse the objects. All Versia entities are already written for you.
```typescript ```typescript
import { EntityValidator, type ValidationError } from "@lysand-org/federation"; import { EntityValidator, type ValidationError } from "@versia/federation";
const validator = new EntityValidator(); const validator = new EntityValidator();
@ -38,7 +38,7 @@ try {
} }
// Types are also included for TypeScript users that don't use the extracted ones // Types are also included for TypeScript users that don't use the extracted ones
import type { Note } from "@lysand-org/federation/types"; import type { Note } from "@versia/federation/types";
const validNoteObject: Note = { const validNoteObject: Note = {
type: "Note", type: "Note",
@ -50,14 +50,14 @@ const validNote = await validator.Note(validNoteObject);
// validNote is still the same as noteObject // validNote is still the same as noteObject
``` ```
Your editor's IntelliSense should provide you with every method and property available, which all match the [**Lysand**](https://lysand.org) specification names. Your editor's IntelliSense should provide you with every method and property available, which all match the [**Versia**](https://versia.pub) specification names.
#### Requester #### Requester
A `FederationRequester` class is provided to make requests to a remote server. It sets the correct headers and has multiple methods to make requesters easier. A `FederationRequester` class is provided to make requests to a remote server. It sets the correct headers and has multiple methods to make requesters easier.
```typescript ```typescript
import { FederationRequester, SignatureConstructor } from "@lysand-org/federation"; import { FederationRequester, SignatureConstructor } from "@versia/federation";
const requester = new FederationRequester( const requester = new FederationRequester(
new URL("https://example.com"), new URL("https://example.com"),
@ -217,18 +217,18 @@ We strongly recommend using JSR over NPM for all your packages that are availabl
```bash ```bash
# NPM version # NPM version
deno add npm:@lysand-org/federation # For Deno deno add npm:@versia/federation # For Deno
npm install @lysand-org/federation # For NPM npm install @versia/federation # For NPM
yarn add @lysand-org/federation # For Yarn yarn add @versia/federation # For Yarn
pnpm add @lysand-org/federation # For PNPM pnpm add @versia/federation # For PNPM
bun add @lysand-org/federation # For Bun bun add @versia/federation # For Bun
# JSR version # JSR version
deno add @lysand-org/federation # For Deno deno add @versia/federation # For Deno
npx jsr add @lysand-org/federation # For JSR npx jsr add @versia/federation # For JSR
yarn dlx jsr add @lysand-org/federation # For Yarn yarn dlx jsr add @versia/federation # For Yarn
pnpm dlx jsr add @lysand-org/federation # For PNPM pnpm dlx jsr add @versia/federation # For PNPM
bunx jsr add @lysand-org/federation # For Bun bunx jsr add @versia/federation # For Bun
``` ```
#### From Source #### From Source
@ -257,4 +257,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
### People ### People
- [**April John**](https://github.com/cutestnekoaqua): Creator and maintainer of the Lysand Server ActivityPub bridge. - [**April John**](https://github.com/cutestnekoaqua): Creator and maintainer of the Versia Server ActivityPub bridge.

View file

@ -28,7 +28,7 @@ const checkEvironmentSupport = () => {
/** /**
* Validates the signature of a request. * Validates the signature of a request.
* @see https://lysand.org/security/signing * @see https://versia.pub/signatures
*/ */
export class SignatureValidator { export class SignatureValidator {
/** /**
@ -67,7 +67,7 @@ export class SignatureValidator {
* @returns A Promise that resolves to a boolean indicating whether the signature is valid. * @returns A Promise that resolves to a boolean indicating whether the signature is valid.
* @throws TypeError if any required headers are missing in the request. * @throws TypeError if any required headers are missing in the request.
* @example * @example
* const request = new Request(); // Should be a Request from a Lysand federation request * const request = new Request(); // Should be a Request from a Versia federation request
* const isValid = await validator.validate(request); * const isValid = await validator.validate(request);
*/ */
async validate(request: Request): Promise<boolean>; async validate(request: Request): Promise<boolean>;
@ -187,7 +187,7 @@ export class SignatureValidator {
/** /**
* Constructs a signature for a request. * Constructs a signature for a request.
* @see https://lysand.org/security/signing * @see https://versia.pub/signatures
*/ */
export class SignatureConstructor { export class SignatureConstructor {
/** /**

View file

@ -45,7 +45,7 @@ const validUser = {
extensions: { "org.lysand:custom_emojis": { emojis: [] } }, extensions: { "org.lysand:custom_emojis": { emojis: [] } },
}; };
describe("LysandRequestHandler", () => { describe("RequestParserHandler", () => {
let validator: EntityValidator; let validator: EntityValidator;
beforeEach(() => { beforeEach(() => {

View file

@ -1,6 +1,6 @@
{ {
"$schema": "https://jsr.io/schema/config-file.v1.json", "$schema": "https://jsr.io/schema/config-file.v1.json",
"name": "@lysand-org/federation", "name": "@versia/federation",
"version": "0.0.0", "version": "0.0.0",
"exports": { "exports": {
".": "./index.ts", ".": "./index.ts",

View file

@ -1,6 +1,6 @@
{ {
"name": "@lysand-org/federation", "name": "@versia/federation",
"displayName": "Lysand Federation", "displayName": "Versia Federation",
"version": "0.0.0", "version": "0.0.0",
"author": { "author": {
"email": "jesse.wierzbinski@lysand.org", "email": "jesse.wierzbinski@lysand.org",
@ -31,7 +31,7 @@
"url": "https://cpluspatch.com" "url": "https://cpluspatch.com"
} }
], ],
"description": "Type definitions for Lysand Federation, with validators.", "description": "SDK for Versia implementations.",
"categories": ["Other"], "categories": ["Other"],
"type": "module", "type": "module",
"engines": { "engines": {
@ -53,9 +53,9 @@
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/lysand" "url": "https://opencollective.com/lysand"
}, },
"homepage": "https://lysand.org", "homepage": "https://versia.pub",
"keywords": [ "keywords": [
"lysand", "versia",
"federation", "federation",
"api", "api",
"typescript", "typescript",

View file

@ -1,3 +1,3 @@
import pkg from "../package.json" with { type: "json" }; import pkg from "../package.json" with { type: "json" };
export const DEFAULT_UA = `LysandFederation/${pkg.version} (+${pkg.homepage})`; export const DEFAULT_UA = `VersiaFederation/${pkg.version} (+${pkg.homepage})`;

View file

@ -2,7 +2,7 @@
* Custom emojis extension. * Custom emojis extension.
* @module federation/schemas/extensions/custom_emojis * @module federation/schemas/extensions/custom_emojis
* @see module:federation/schemas/base * @see module:federation/schemas/base
* @see https://lysand.org/extensions/custom-emojis * @see https://versia.pub/extensions/custom-emojis
*/ */
import { z } from "zod"; import { z } from "zod";
import { ContentFormatSchema } from "../content_format"; import { ContentFormatSchema } from "../content_format";
@ -10,7 +10,7 @@ import { emojiRegex } from "../regex";
/** /**
* @description Used to validate the properties the extension's custom field * @description Used to validate the properties the extension's custom field
* @see https://lysand.org/extensions/custom-emojis * @see https://versia.pub/extensions/custom-emojis
* @example * @example
* { * {
* // ... * // ...

View file

@ -2,7 +2,7 @@
* Polls extension * Polls extension
* @module federation/schemas/extensions/polls * @module federation/schemas/extensions/polls
* @see module:federation/schemas/base * @see module:federation/schemas/base
* @see https://lysand.org/extensions/polls * @see https://versia.pub/extensions/polls
*/ */
import { z } from "zod"; import { z } from "zod";
import { ExtensionSchema } from "../base"; import { ExtensionSchema } from "../base";
@ -10,7 +10,7 @@ import { ContentFormatSchema } from "../content_format";
/** /**
* @description Poll extension entity * @description Poll extension entity
* @see https://lysand.org/extensions/polls * @see https://versia.pub/extensions/polls
* @example * @example
* { * {
* "type": "Extension", * "type": "Extension",
@ -53,7 +53,7 @@ export const PollSchema = ExtensionSchema.extend({
/** /**
* @description Vote extension entity * @description Vote extension entity
* @see https://lysand.org/extensions/polls * @see https://versia.pub/extensions/polls
* @example * @example
* { * {
* "type": "Extension", * "type": "Extension",
@ -73,7 +73,7 @@ export const VoteSchema = ExtensionSchema.extend({
/** /**
* @description Vote result extension entity * @description Vote result extension entity
* @see https://lysand.org/extensions/polls * @see https://versia.pub/extensions/polls
* @example * @example
* { * {
* "type": "Extension", * "type": "Extension",

View file

@ -2,14 +2,14 @@
* Reactions extension * Reactions extension
* @module federation/schemas/extensions/reactions * @module federation/schemas/extensions/reactions
* @see module:federation/schemas/base * @see module:federation/schemas/base
* @see https://lysand.org/extensions/reactions * @see https://versia.pub/extensions/reactions
*/ */
import { z } from "zod"; import { z } from "zod";
import { ExtensionSchema } from "../base"; import { ExtensionSchema } from "../base";
/** /**
* @description Reaction extension entity * @description Reaction extension entity
* @see https://lysand.org/extensions/reactions * @see https://versia.pub/extensions/reactions
* @example * @example
* { * {
* "type": "Extension", * "type": "Extension",

View file

@ -2,7 +2,7 @@
* Vanity extension schema. * Vanity extension schema.
* @module federation/schemas/extensions/vanity * @module federation/schemas/extensions/vanity
* @see module:federation/schemas/base * @see module:federation/schemas/base
* @see https://lysand.org/extensions/vanity * @see https://versia.pub/extensions/vanity
*/ */
import { z } from "zod"; import { z } from "zod";
@ -10,7 +10,7 @@ import { ContentFormatSchema } from "../content_format";
/** /**
* @description Vanity extension entity * @description Vanity extension entity
* @see https://lysand.org/extensions/vanity * @see https://versia.pub/extensions/vanity
* @example * @example
* { * {
* // ... * // ...

View file

@ -34,7 +34,7 @@ type InferType<T extends AnyZod> = z.infer<T>;
* @module federation/validator * @module federation/validator
* @see module:federation/schemas/base * @see module:federation/schemas/base
* @example * @example
* import { EntityValidator, type ValidationError } from "@lysand-org/federation"; * import { EntityValidator, type ValidationError } from "@versia/federation";
* const validator = new EntityValidator(); * const validator = new EntityValidator();
* *
* // Will throw a special ValidationError with a human-friendly error message * // Will throw a special ValidationError with a human-friendly error message
@ -54,7 +54,7 @@ type InferType<T extends AnyZod> = z.infer<T>;
* } * }
* *
* // Types are also included for TypeScript users that don't use the extracted ones * // Types are also included for TypeScript users that don't use the extracted ones
* import type { Note } from "@lysand-org/federation/types"; * import type { Note } from "@versia/federation/types";
* *
* const note: Note = { * const note: Note = {
* ... * ...

View file

@ -1,5 +1,5 @@
{ {
"name": "lysand-api", "name": "versia-api",
"private": true, "private": true,
"workspaces": ["federation", "client"], "workspaces": ["federation", "client"],
"scripts": { "scripts": {