1 |
|
2 | export interface DeployOptions {
|
3 | apiKey: string;
|
4 | accountId: string;
|
5 | projectName: string;
|
6 | branch?: string;
|
7 | commitMessage?: string;
|
8 | commitHash?: string;
|
9 | }
|
10 | export interface DeploymentFile {
|
11 | filename: string;
|
12 | content: Buffer | (() => Promise<Buffer>);
|
13 | /** Leave blank to use mime on npm to get the type. */
|
14 | contentType?: string;
|
15 | /** Precompute yourself with `computeHash` or leave blank. */
|
16 | hash?: string;
|
17 | }
|
18 | export interface Deployment {
|
19 | id: string;
|
20 | url: string;
|
21 | hashes: Record<string, string>;
|
22 | }
|
23 | export interface DeploymentOptions {
|
24 | branch?: string;
|
25 | commitMessage?: string;
|
26 | commitHash?: string;
|
27 | headers?: string;
|
28 | redirects?: string;
|
29 | routes?: string;
|
30 | worker?: string;
|
31 | concurrency?: number;
|
32 | log?: (msg: string) => unknown;
|
33 | }
|
34 | export interface CloudflarePagesDirectUploaderOptions {
|
35 | apiKey: string;
|
36 | accountId: string;
|
37 | projectName: string;
|
38 | }
|
39 | export declare class CloudflarePagesDirectUploader {
|
40 | private config;
|
41 | constructor(config: CloudflarePagesDirectUploaderOptions);
|
42 | deployDirectory(directoryPath: string, options?: DeploymentOptions): Promise<Deployment>;
|
43 | deployFiles(files: DeploymentFile[], options?: DeploymentOptions): Promise<Deployment>;
|
44 | }
|
45 | export default CloudflarePagesDirectUploader;
|
46 | export declare function computeHash(content: Buffer, filename: string): string;
|