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 { LanguageCode } from 'iso-639-1';
|
||||
import type { NostrEvent } from '@nostrify/nostrify';
|
||||
import type { LanguageCode } from 'iso-639-1';
|
||||
|
||||
/** Ditto internal stats for the event's author. */
|
||||
export interface AuthorStats {
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
"version": "1.1.0",
|
||||
"exports": {
|
||||
".": "./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 type { DittoEnv } from './DittoEnv.ts';
|
||||
export type { DittoEvent } from './DittoEvent.ts';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { DittoConf } from '@ditto/conf';
|
||||
import { NSchema as n } from '@nostrify/nostrify';
|
||||
import { nip19, UnsignedEvent } from 'nostr-tools';
|
||||
import { type NostrEvent, NSchema as n } from '@nostrify/nostrify';
|
||||
import { nip19 } from 'nostr-tools';
|
||||
|
||||
import type { DittoConf } from '@ditto/conf';
|
||||
import { MastodonAccount } from '@/entities/MastodonAccount.ts';
|
||||
import { type DittoEvent } from '@/interfaces/DittoEvent.ts';
|
||||
import { metadataSchema } from '@/schemas/nostr.ts';
|
||||
|
|
@ -157,7 +157,7 @@ export class AccountView {
|
|||
}
|
||||
|
||||
private accountFromPubkey(pubkey: string, opts: ToAccountOpts = {}): MastodonAccount {
|
||||
const event: UnsignedEvent = {
|
||||
const event: Omit<NostrEvent, 'id' | 'sig'> = {
|
||||
kind: 0,
|
||||
pubkey,
|
||||
content: '',
|
||||
|
|
@ -1,8 +1,7 @@
|
|||
import { DittoConf } from '@ditto/conf';
|
||||
import { AccountView } from './AccountView.ts';
|
||||
|
||||
import { DittoEvent } from '@/interfaces/DittoEvent.ts';
|
||||
import { getTagSet } from '@/utils/tags.ts';
|
||||
import { AccountView } from '@/views/mastodon/AccountView.ts';
|
||||
import type { DittoEvent } from '@ditto/api';
|
||||
import type { DittoConf } from '@ditto/conf';
|
||||
|
||||
interface AdminAccountViewOpts {
|
||||
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