Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/src/publish/netlify/api/services/FileService.ts
6475 views
1
/* istanbul ignore file */
2
/* tslint:disable */
3
/* eslint-disable */
4
import type { CancelablePromise } from "../core/CancelablePromise.ts";
5
import type { BaseHttpRequest } from "../core/BaseHttpRequest.ts";
6
7
export class FileService {
8
constructor(public readonly httpRequest: BaseHttpRequest) {}
9
10
/**
11
* @returns any OK
12
* @throws ApiError
13
*/
14
public listSiteFiles({
15
siteId,
16
}: {
17
siteId: string;
18
}): CancelablePromise<
19
Array<{
20
id?: string;
21
path?: string;
22
sha?: string;
23
mime_type?: string;
24
size?: number;
25
}>
26
> {
27
return this.httpRequest.request({
28
method: "GET",
29
url: "/sites/{site_id}/files",
30
path: {
31
"site_id": siteId,
32
},
33
});
34
}
35
36
/**
37
* @returns any OK
38
* @throws ApiError
39
*/
40
public getSiteFileByPathName({
41
siteId,
42
filePath,
43
}: {
44
siteId: string;
45
filePath: string;
46
}): CancelablePromise<{
47
id?: string;
48
path?: string;
49
sha?: string;
50
mime_type?: string;
51
size?: number;
52
}> {
53
return this.httpRequest.request({
54
method: "GET",
55
url: "/sites/{site_id}/files/{file_path}",
56
path: {
57
"site_id": siteId,
58
"file_path": filePath,
59
},
60
});
61
}
62
63
/**
64
* @returns any OK
65
* @throws ApiError
66
*/
67
public uploadDeployFile({
68
deployId,
69
path,
70
fileBody,
71
size,
72
}: {
73
deployId: string;
74
path: string;
75
fileBody: Blob;
76
size?: number;
77
}): CancelablePromise<{
78
id?: string;
79
path?: string;
80
sha?: string;
81
mime_type?: string;
82
size?: number;
83
}> {
84
return this.httpRequest.request({
85
method: "PUT",
86
url: "/deploys/{deploy_id}/files/{path}",
87
path: {
88
"deploy_id": deployId,
89
"path": path,
90
},
91
query: {
92
"size": size,
93
},
94
body: fileBody,
95
});
96
}
97
}
98
99