@longviewlabs/strapi-provider-upload-arweave
Version:
Arweave upload provider for Strapi v5
54 lines • 2.03 kB
TypeScript
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import type { ReadStream } from 'node:fs';
import type { JWKInterface } from 'arweave/node/lib/wallet';
import { z } from 'zod';
declare const fileSchema: z.ZodObject<{
name: z.ZodString;
alternativeText: z.ZodOptional<z.ZodString>;
caption: z.ZodOptional<z.ZodString>;
width: z.ZodOptional<z.ZodNumber>;
height: z.ZodOptional<z.ZodNumber>;
formats: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
hash: z.ZodString;
ext: z.ZodOptional<z.ZodString>;
mime: z.ZodString;
size: z.ZodNumber;
sizeInBytes: z.ZodNumber;
url: z.ZodString;
previewUrl: z.ZodOptional<z.ZodString>;
path: z.ZodOptional<z.ZodString>;
provider: z.ZodOptional<z.ZodString>;
provider_metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
stream: z.ZodOptional<z.ZodUnknown>;
buffer: z.ZodOptional<z.ZodUnknown>;
}, {}>;
export type File = z.infer<typeof fileSchema> & {
stream?: ReadStream;
buffer?: Buffer;
};
type GetContentTypeFn = (file: File) => string;
export declare const defaultGateway = "https://arweave.net";
export declare const optionsSchema: z.ZodObject<{
arweaveWallet: z.ZodPipe<z.ZodTransform<any, unknown>, z.ZodObject<{
kty: z.ZodString;
e: z.ZodString;
n: z.ZodString;
d: z.ZodOptional<z.ZodString>;
dp: z.ZodOptional<z.ZodString>;
dq: z.ZodOptional<z.ZodString>;
ext: z.ZodOptional<z.ZodBoolean>;
p: z.ZodOptional<z.ZodString>;
q: z.ZodOptional<z.ZodString>;
qi: z.ZodOptional<z.ZodString>;
}, {}>>;
gateway: z.ZodDefault<z.ZodURL>;
getContentType: z.ZodDefault<z.ZodOptional<z.ZodCustom<GetContentTypeFn, GetContentTypeFn>>>;
}, {}>;
export type Options = z.infer<typeof optionsSchema>;
export type DefaultOptions = Partial<Omit<Options, 'arweaveWallet'>> & {
arweaveWallet: JWKInterface | string;
};
export {};
//# sourceMappingURL=types.d.ts.map