Move uploaders into @ditto/uploaders

This commit is contained in:
Alex Gleason 2025-02-18 12:42:55 -06:00
parent 9e9a784416
commit b2cd5c541b
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
7 changed files with 19 additions and 7 deletions

View file

@ -5,7 +5,8 @@
"./packages/conf",
"./packages/db",
"./packages/ditto",
"./packages/metrics"
"./packages/metrics",
"./packages/uploaders"
],
"tasks": {
"start": "deno run -A --env-file --deny-read=.env packages/ditto/server.ts",

View file

@ -1,10 +1,8 @@
import { DenoUploader, IPFSUploader, S3Uploader } from '@ditto/uploaders';
import { BlossomUploader, NostrBuildUploader } from '@nostrify/nostrify/uploaders';
import { safeFetch } from '@soapbox/safe-fetch';
import { AppMiddleware } from '@/app.ts';
import { DenoUploader } from '@/uploaders/DenoUploader.ts';
import { IPFSUploader } from '@/uploaders/IPFSUploader.ts';
import { S3Uploader } from '@/uploaders/S3Uploader.ts';
/** Set an uploader for the user. */
export const uploaderMiddleware: AppMiddleware = async (c, next) => {

View file

@ -1,10 +1,11 @@
import { join } from 'node:path';
import { NUploader } from '@nostrify/nostrify';
import { crypto } from '@std/crypto';
import { encodeHex } from '@std/encoding/hex';
import { extensionsByType } from '@std/media-types';
import type { NUploader } from '@nostrify/nostrify';
export interface DenoUploaderOpts {
baseUrl: string;
dir: string;

View file

@ -1,6 +1,7 @@
import { NUploader } from '@nostrify/nostrify';
import { z } from 'zod';
import type { NUploader } from '@nostrify/nostrify';
export interface IPFSUploaderOpts {
baseUrl: string;
apiUrl?: string;

View file

@ -1,11 +1,12 @@
import { join } from 'node:path';
import { S3Client } from '@bradenmacdonald/s3-lite-client';
import { NUploader } from '@nostrify/nostrify';
import { crypto } from '@std/crypto';
import { encodeHex } from '@std/encoding/hex';
import { extensionsByType } from '@std/media-types';
import type { NUploader } from '@nostrify/nostrify';
export interface S3UploaderOpts {
endPoint: string;
region: string;

View file

@ -0,0 +1,7 @@
{
"name": "@ditto/uploaders",
"version": "1.1.0",
"exports": {
".": "./mod.ts"
}
}

View file

@ -0,0 +1,3 @@
export { DenoUploader } from './DenoUploader.ts';
export { IPFSUploader } from './IPFSUploader.ts';
export { S3Uploader } from './S3Uploader.ts';