mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
Start reorganizing routes and views
This commit is contained in:
parent
e5100530da
commit
eec380665c
8 changed files with 15 additions and 11 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
import { NostrEvent } from '@nostrify/nostrify';
|
import type { NostrEvent } from '@nostrify/nostrify';
|
||||||
import { LanguageCode } from 'iso-639-1';
|
import type { LanguageCode } from 'iso-639-1';
|
||||||
|
|
||||||
/** Ditto internal stats for the event's author. */
|
/** Ditto internal stats for the event's author. */
|
||||||
export interface AuthorStats {
|
export interface AuthorStats {
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./mod.ts",
|
".": "./mod.ts",
|
||||||
"./middleware": "./middleware/mod.ts"
|
"./middleware": "./middleware/mod.ts",
|
||||||
|
"./views": "./views/mod.ts"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,3 +2,4 @@ export { DittoApp } from './DittoApp.ts';
|
||||||
export { DittoRoute } from './DittoRoute.ts';
|
export { DittoRoute } from './DittoRoute.ts';
|
||||||
|
|
||||||
export type { DittoEnv } from './DittoEnv.ts';
|
export type { DittoEnv } from './DittoEnv.ts';
|
||||||
|
export type { DittoEvent } from './DittoEvent.ts';
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { DittoConf } from '@ditto/conf';
|
import { type NostrEvent, NSchema as n } from '@nostrify/nostrify';
|
||||||
import { NSchema as n } from '@nostrify/nostrify';
|
import { nip19 } from 'nostr-tools';
|
||||||
import { nip19, UnsignedEvent } from 'nostr-tools';
|
|
||||||
|
|
||||||
|
import type { DittoConf } from '@ditto/conf';
|
||||||
import { MastodonAccount } from '@/entities/MastodonAccount.ts';
|
import { MastodonAccount } from '@/entities/MastodonAccount.ts';
|
||||||
import { type DittoEvent } from '@/interfaces/DittoEvent.ts';
|
import { type DittoEvent } from '@/interfaces/DittoEvent.ts';
|
||||||
import { metadataSchema } from '@/schemas/nostr.ts';
|
import { metadataSchema } from '@/schemas/nostr.ts';
|
||||||
|
|
@ -157,7 +157,7 @@ export class AccountView {
|
||||||
}
|
}
|
||||||
|
|
||||||
private accountFromPubkey(pubkey: string, opts: ToAccountOpts = {}): MastodonAccount {
|
private accountFromPubkey(pubkey: string, opts: ToAccountOpts = {}): MastodonAccount {
|
||||||
const event: UnsignedEvent = {
|
const event: Omit<NostrEvent, 'id' | 'sig'> = {
|
||||||
kind: 0,
|
kind: 0,
|
||||||
pubkey,
|
pubkey,
|
||||||
content: '',
|
content: '',
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
import { DittoConf } from '@ditto/conf';
|
import { AccountView } from './AccountView.ts';
|
||||||
|
|
||||||
import { DittoEvent } from '@/interfaces/DittoEvent.ts';
|
import type { DittoEvent } from '@ditto/api';
|
||||||
import { getTagSet } from '@/utils/tags.ts';
|
import type { DittoConf } from '@ditto/conf';
|
||||||
import { AccountView } from '@/views/mastodon/AccountView.ts';
|
|
||||||
|
|
||||||
interface AdminAccountViewOpts {
|
interface AdminAccountViewOpts {
|
||||||
conf: DittoConf;
|
conf: DittoConf;
|
||||||
3
packages/api/views/mod.ts
Normal file
3
packages/api/views/mod.ts
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
export { AccountView } from './AccountView.ts';
|
||||||
|
export { AdminAccountView } from './AdminAccountView.ts';
|
||||||
|
export { StatusView } from './StatusView.ts';
|
||||||
Loading…
Add table
Reference in a new issue