Merge branch 'zod-alias' into 'main'
zod import alias See merge request soapbox-pub/ditto!177
This commit is contained in:
commit
6c74ce9c12
|
@ -19,7 +19,8 @@
|
|||
"hono": "https://deno.land/x/hono@v3.10.1/mod.ts",
|
||||
"hono/middleware": "https://deno.land/x/hono@v3.10.1/middleware.ts",
|
||||
"kysely": "npm:kysely@^0.26.3",
|
||||
"kysely_deno_postgres": "https://deno.land/x/kysely_deno_postgres@v0.4.0/mod.ts"
|
||||
"kysely_deno_postgres": "https://deno.land/x/kysely_deno_postgres@v0.4.0/mod.ts",
|
||||
"zod": "npm:zod@^3.23.4"
|
||||
},
|
||||
"lint": {
|
||||
"include": ["src/", "scripts/"],
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import url from 'node:url';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { dotenv, getPublicKey, nip19, z } from '@/deps.ts';
|
||||
import { dotenv, getPublicKey, nip19 } from '@/deps.ts';
|
||||
|
||||
/** Load environment config from `.env` */
|
||||
await dotenv.load({
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import { NostrFilter } from '@nostrify/nostrify';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { type AppController } from '@/app.ts';
|
||||
import { Conf } from '@/config.ts';
|
||||
import { nip19, z } from '@/deps.ts';
|
||||
import { nip19 } from '@/deps.ts';
|
||||
import { getAuthor, getFollowedPubkeys } from '@/queries.ts';
|
||||
import { booleanParamSchema, fileSchema } from '@/schema.ts';
|
||||
import { jsonMetaContentSchema } from '@/schemas/nostr.ts';
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { z } from 'zod';
|
||||
|
||||
import { type AppController } from '@/app.ts';
|
||||
import { Conf } from '@/config.ts';
|
||||
import { z } from '@/deps.ts';
|
||||
import { booleanParamSchema } from '@/schema.ts';
|
||||
import { eventsDB } from '@/storages.ts';
|
||||
import { renderAdminAccount } from '@/views/mastodon/admin-accounts.ts';
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { z } from 'zod';
|
||||
|
||||
import { AppController } from '@/app.ts';
|
||||
import { z } from '@/deps.ts';
|
||||
import { fileSchema } from '@/schema.ts';
|
||||
import { parseBody } from '@/utils/api.ts';
|
||||
import { renderAttachment } from '@/views/mastodon/attachments.ts';
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import { lodash, nip19, z } from '@/deps.ts';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { lodash, nip19 } from '@/deps.ts';
|
||||
import { AppController } from '@/app.ts';
|
||||
import { nostrNow } from '@/utils.ts';
|
||||
import { parseBody } from '@/utils/api.ts';
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { z } from 'zod';
|
||||
|
||||
import { type AppController } from '@/app.ts';
|
||||
import { Conf } from '@/config.ts';
|
||||
import { z } from '@/deps.ts';
|
||||
import { configSchema, elixirTupleSchema, type PleromaConfig } from '@/schemas/pleroma-api.ts';
|
||||
import { AdminSigner } from '@/signers/AdminSigner.ts';
|
||||
import { eventsDB } from '@/storages.ts';
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import { NostrEvent, NostrFilter } from '@nostrify/nostrify';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { AppController } from '@/app.ts';
|
||||
import { nip19, z } from '@/deps.ts';
|
||||
import { nip19 } from '@/deps.ts';
|
||||
import { booleanParamSchema } from '@/schema.ts';
|
||||
import { nostrIdSchema } from '@/schemas/nostr.ts';
|
||||
import { searchStore } from '@/storages.ts';
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import { NIP05, NostrEvent, NostrFilter } from '@nostrify/nostrify';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { type AppController } from '@/app.ts';
|
||||
import { Conf } from '@/config.ts';
|
||||
import { getUnattachedMediaByIds } from '@/db/unattached-media.ts';
|
||||
import { ISO6391, nip19, z } from '@/deps.ts';
|
||||
import { ISO6391, nip19 } from '@/deps.ts';
|
||||
import { getAncestors, getAuthor, getDescendants, getEvent } from '@/queries.ts';
|
||||
import { jsonMetaContentSchema } from '@/schemas/nostr.ts';
|
||||
import { addTag, deleteTag } from '@/tags.ts';
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import { NostrFilter } from '@nostrify/nostrify';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { type AppController } from '@/app.ts';
|
||||
import { Conf } from '@/config.ts';
|
||||
import { Debug, z } from '@/deps.ts';
|
||||
import { Debug } from '@/deps.ts';
|
||||
import { getFeedPubkeys } from '@/queries.ts';
|
||||
import { Sub } from '@/subs.ts';
|
||||
import { bech32ToPubkey } from '@/utils.ts';
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import { NostrFilter } from '@nostrify/nostrify';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { type AppContext, type AppController } from '@/app.ts';
|
||||
import { Conf } from '@/config.ts';
|
||||
import { z } from '@/deps.ts';
|
||||
import { getFeedPubkeys } from '@/queries.ts';
|
||||
import { booleanParamSchema } from '@/schema.ts';
|
||||
import { eventsDB } from '@/storages.ts';
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { z } from 'zod';
|
||||
|
||||
import { type AppController } from '@/app.ts';
|
||||
import { Conf } from '@/config.ts';
|
||||
import { z } from '@/deps.ts';
|
||||
import { Time } from '@/utils.ts';
|
||||
import { stripTime } from '@/utils/time.ts';
|
||||
import { TrendsWorker } from '@/workers/trends.ts';
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { z } from 'zod';
|
||||
|
||||
import { AppController } from '@/app.ts';
|
||||
import { z } from '@/deps.ts';
|
||||
import { localNip05Lookup } from '@/utils/nip05.ts';
|
||||
|
||||
const nameSchema = z.string().min(1).regex(/^\w+$/);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import { z } from 'zod';
|
||||
|
||||
import { Conf } from '@/config.ts';
|
||||
import { nip19, z } from '@/deps.ts';
|
||||
import { nip19 } from '@/deps.ts';
|
||||
import { localNip05Lookup } from '@/utils/nip05.ts';
|
||||
|
||||
import type { AppContext, AppController } from '@/app.ts';
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import 'https://gitlab.com/soapbox-pub/deno-safe-fetch/-/raw/v1.0.0/load.ts';
|
||||
export { z } from 'https://deno.land/x/zod@v3.21.4/mod.ts';
|
||||
export { RelayPoolWorker } from 'npm:nostr-relaypool2@0.6.34';
|
||||
export {
|
||||
type EventTemplate,
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import { NostrEvent, NostrFilter } from '@nostrify/nostrify';
|
||||
import { stringifyStable, z } from '@/deps.ts';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { stringifyStable } from '@/deps.ts';
|
||||
import { isReplaceableKind } from '@/kinds.ts';
|
||||
import { nostrIdSchema } from '@/schemas/nostr.ts';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { z } from '@/deps.ts';
|
||||
import { z } from 'zod';
|
||||
|
||||
/** Validates individual items in an array, dropping any that aren't valid. */
|
||||
function filteredArray<T extends z.ZodTypeAny>(schema: T) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { z } from '@/deps.ts';
|
||||
import { z } from 'zod';
|
||||
|
||||
const apId = z.string().url();
|
||||
const recipients = z.array(z.string()).catch([]);
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import { getEventHash, verifyEvent, z } from '@/deps.ts';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { getEventHash, verifyEvent } from '@/deps.ts';
|
||||
import { jsonSchema, safeUrlSchema } from '@/schema.ts';
|
||||
|
||||
/** Schema to validate Nostr hex IDs such as event IDs and pubkeys. */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { z } from '@/deps.ts';
|
||||
import { z } from 'zod';
|
||||
|
||||
type ElixirValue =
|
||||
| string
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { z } from '@/deps.ts';
|
||||
import { z } from 'zod';
|
||||
|
||||
const linkSchema = z.object({
|
||||
rel: z.string().optional(),
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { z } from 'zod';
|
||||
|
||||
import { Conf } from '@/config.ts';
|
||||
import { z } from '@/deps.ts';
|
||||
import { fetchWorker } from '@/workers/fetch.ts';
|
||||
|
||||
import type { Uploader } from './types.ts';
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import { NostrEvent } from '@nostrify/nostrify';
|
||||
import { type EventTemplate, getEventHash, nip19, z } from '@/deps.ts';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { type EventTemplate, getEventHash, nip19 } from '@/deps.ts';
|
||||
import { nostrIdSchema } from '@/schemas/nostr.ts';
|
||||
|
||||
/** Get the current time in Nostr format. */
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
import { NostrEvent, NostrFilter } from '@nostrify/nostrify';
|
||||
import { type Context, HTTPException } from 'hono';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { type AppContext } from '@/app.ts';
|
||||
import { Conf } from '@/config.ts';
|
||||
import { Debug, EventTemplate, parseFormData, type TypeFest, z } from '@/deps.ts';
|
||||
import { Debug, EventTemplate, parseFormData, type TypeFest } from '@/deps.ts';
|
||||
import * as pipeline from '@/pipeline.ts';
|
||||
import { AdminSigner } from '@/signers/AdminSigner.ts';
|
||||
import { APISigner } from '@/signers/APISigner.ts';
|
||||
|
|
Loading…
Reference in New Issue