paste/src/types.d.ts
Joe Ma 76e8d074dc
Add large paste (API V2)
Generate S3 pre-signed url

Fix Content-Disposition charsets

Signed-off-by: Joe Ma <rikkaneko23@gmail.com>
2024-02-02 03:15:34 +08:00

35 lines
No EOL
875 B
TypeScript

import { IRequest } from 'itty-router';
export type ERequest = {
is_browser: boolean;
// match_etag?: string;
} & IRequest;
export type PASTE_TYPES = 'paste' | 'link' | 'large_paste';
export interface PasteIndexEntry {
title?: string;
mime_type?: string;
last_modified: number;
expiration?: number; // New added in 2.0
size: number;
password?: string;
editable?: boolean; // Default: False (unsupported)
read_count_remain?: number;
type: PASTE_TYPES;
// Only apply when large_paste
upload_completed?: boolean;
sha256_hash?: string;
}
export interface Env {
PASTE_INDEX: KVNamespace;
QRCODE: ServiceWorkerGlobalScope;
AWS_ACCESS_KEY_ID: string;
AWS_SECRET_ACCESS_KEY: string;
LARGE_AWS_ACCESS_KEY_ID?: string;
LARGE_AWS_SECRET_ACCESS_KEY?: string;
ENDPOINT: string;
LARGE_ENDPOINT?: string;
LARGE_DOWNLOAD_ENDPOINT?: string;
}