@voidrun/sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/FS.d.ts +193 -0
- package/dist/FS.d.ts.map +1 -0
- package/dist/FS.js +488 -0
- package/dist/FS.js.map +1 -0
- package/dist/Sandbox.d.ts +23 -0
- package/dist/Sandbox.d.ts.map +1 -0
- package/dist/Sandbox.js +72 -0
- package/dist/Sandbox.js.map +1 -0
- package/dist/api-client/apis/AuthenticationApi.d.ts +32 -0
- package/dist/api-client/apis/AuthenticationApi.d.ts.map +1 -0
- package/dist/api-client/apis/AuthenticationApi.js +50 -0
- package/dist/api-client/apis/AuthenticationApi.js.map +1 -0
- package/dist/api-client/apis/ExecutionApi.d.ts +132 -0
- package/dist/api-client/apis/ExecutionApi.d.ts.map +1 -0
- package/dist/api-client/apis/ExecutionApi.js +305 -0
- package/dist/api-client/apis/ExecutionApi.js.map +1 -0
- package/dist/api-client/apis/FileSystemApi.d.ts +250 -0
- package/dist/api-client/apis/FileSystemApi.d.ts.map +1 -0
- package/dist/api-client/apis/FileSystemApi.js +634 -0
- package/dist/api-client/apis/FileSystemApi.js.map +1 -0
- package/dist/api-client/apis/ImagesApi.d.ts +81 -0
- package/dist/api-client/apis/ImagesApi.d.ts.map +1 -0
- package/dist/api-client/apis/ImagesApi.js +173 -0
- package/dist/api-client/apis/ImagesApi.js.map +1 -0
- package/dist/api-client/apis/OrganizationsApi.d.ts +70 -0
- package/dist/api-client/apis/OrganizationsApi.d.ts.map +1 -0
- package/dist/api-client/apis/OrganizationsApi.js +150 -0
- package/dist/api-client/apis/OrganizationsApi.js.map +1 -0
- package/dist/api-client/apis/SandboxesApi.d.ts +150 -0
- package/dist/api-client/apis/SandboxesApi.d.ts.map +1 -0
- package/dist/api-client/apis/SandboxesApi.js +335 -0
- package/dist/api-client/apis/SandboxesApi.js.map +1 -0
- package/dist/api-client/apis/index.d.ts +7 -0
- package/dist/api-client/apis/index.d.ts.map +1 -0
- package/dist/api-client/apis/index.js +9 -0
- package/dist/api-client/apis/index.js.map +1 -0
- package/dist/api-client/index.d.ts +4 -0
- package/dist/api-client/index.d.ts.map +1 -0
- package/dist/api-client/index.js +6 -0
- package/dist/api-client/index.js.map +1 -0
- package/dist/api-client/models/APIKeyResponse.d.ts +75 -0
- package/dist/api-client/models/APIKeyResponse.d.ts.map +1 -0
- package/dist/api-client/models/APIKeyResponse.js +56 -0
- package/dist/api-client/models/APIKeyResponse.js.map +1 -0
- package/dist/api-client/models/ApiResponseSandbox.d.ts +46 -0
- package/dist/api-client/models/ApiResponseSandbox.d.ts.map +1 -0
- package/dist/api-client/models/ApiResponseSandbox.js +47 -0
- package/dist/api-client/models/ApiResponseSandbox.js.map +1 -0
- package/dist/api-client/models/ApiResponseSandboxesList.d.ts +53 -0
- package/dist/api-client/models/ApiResponseSandboxesList.d.ts.map +1 -0
- package/dist/api-client/models/ApiResponseSandboxesList.js +50 -0
- package/dist/api-client/models/ApiResponseSandboxesList.js.map +1 -0
- package/dist/api-client/models/ApiResponseSandboxesListMeta.d.ts +51 -0
- package/dist/api-client/models/ApiResponseSandboxesListMeta.d.ts.map +1 -0
- package/dist/api-client/models/ApiResponseSandboxesListMeta.js +48 -0
- package/dist/api-client/models/ApiResponseSandboxesListMeta.js.map +1 -0
- package/dist/api-client/models/CompressRequest.d.ts +49 -0
- package/dist/api-client/models/CompressRequest.d.ts.map +1 -0
- package/dist/api-client/models/CompressRequest.js +55 -0
- package/dist/api-client/models/CompressRequest.js.map +1 -0
- package/dist/api-client/models/CreateFileRequest.d.ts +33 -0
- package/dist/api-client/models/CreateFileRequest.d.ts.map +1 -0
- package/dist/api-client/models/CreateFileRequest.js +42 -0
- package/dist/api-client/models/CreateFileRequest.js.map +1 -0
- package/dist/api-client/models/CreateImageRequest.d.ts +45 -0
- package/dist/api-client/models/CreateImageRequest.d.ts.map +1 -0
- package/dist/api-client/models/CreateImageRequest.js +48 -0
- package/dist/api-client/models/CreateImageRequest.js.map +1 -0
- package/dist/api-client/models/CreatePTYSessionRequest.d.ts +39 -0
- package/dist/api-client/models/CreatePTYSessionRequest.d.ts.map +1 -0
- package/dist/api-client/models/CreatePTYSessionRequest.js +44 -0
- package/dist/api-client/models/CreatePTYSessionRequest.js.map +1 -0
- package/dist/api-client/models/CreateSandbox201Response.d.ts +46 -0
- package/dist/api-client/models/CreateSandbox201Response.d.ts.map +1 -0
- package/dist/api-client/models/CreateSandbox201Response.js +47 -0
- package/dist/api-client/models/CreateSandbox201Response.js.map +1 -0
- package/dist/api-client/models/CreateSandboxRequest.d.ts +63 -0
- package/dist/api-client/models/CreateSandboxRequest.d.ts.map +1 -0
- package/dist/api-client/models/CreateSandboxRequest.js +54 -0
- package/dist/api-client/models/CreateSandboxRequest.js.map +1 -0
- package/dist/api-client/models/DiskUsage.d.ts +45 -0
- package/dist/api-client/models/DiskUsage.d.ts.map +1 -0
- package/dist/api-client/models/DiskUsage.js +46 -0
- package/dist/api-client/models/DiskUsage.js.map +1 -0
- package/dist/api-client/models/ErrorResponse.d.ts +39 -0
- package/dist/api-client/models/ErrorResponse.d.ts.map +1 -0
- package/dist/api-client/models/ErrorResponse.js +44 -0
- package/dist/api-client/models/ErrorResponse.js.map +1 -0
- package/dist/api-client/models/ExecRequest.d.ts +59 -0
- package/dist/api-client/models/ExecRequest.d.ts.map +1 -0
- package/dist/api-client/models/ExecRequest.js +52 -0
- package/dist/api-client/models/ExecRequest.js.map +1 -0
- package/dist/api-client/models/ExecResponse.d.ts +46 -0
- package/dist/api-client/models/ExecResponse.d.ts.map +1 -0
- package/dist/api-client/models/ExecResponse.js +47 -0
- package/dist/api-client/models/ExecResponse.js.map +1 -0
- package/dist/api-client/models/ExecResponseData.d.ts +45 -0
- package/dist/api-client/models/ExecResponseData.d.ts.map +1 -0
- package/dist/api-client/models/ExecResponseData.js +46 -0
- package/dist/api-client/models/ExecResponseData.js.map +1 -0
- package/dist/api-client/models/ExecuteInSessionRequest.d.ts +33 -0
- package/dist/api-client/models/ExecuteInSessionRequest.d.ts.map +1 -0
- package/dist/api-client/models/ExecuteInSessionRequest.js +44 -0
- package/dist/api-client/models/ExecuteInSessionRequest.js.map +1 -0
- package/dist/api-client/models/ExtractRequest.d.ts +39 -0
- package/dist/api-client/models/ExtractRequest.d.ts.map +1 -0
- package/dist/api-client/models/ExtractRequest.js +48 -0
- package/dist/api-client/models/ExtractRequest.js.map +1 -0
- package/dist/api-client/models/FileInfo.d.ts +63 -0
- package/dist/api-client/models/FileInfo.d.ts.map +1 -0
- package/dist/api-client/models/FileInfo.js +52 -0
- package/dist/api-client/models/FileInfo.js.map +1 -0
- package/dist/api-client/models/FileStats.d.ts +75 -0
- package/dist/api-client/models/FileStats.d.ts.map +1 -0
- package/dist/api-client/models/FileStats.js +56 -0
- package/dist/api-client/models/FileStats.js.map +1 -0
- package/dist/api-client/models/GenerateAPIKeyRequest.d.ts +39 -0
- package/dist/api-client/models/GenerateAPIKeyRequest.d.ts.map +1 -0
- package/dist/api-client/models/GenerateAPIKeyRequest.js +48 -0
- package/dist/api-client/models/GenerateAPIKeyRequest.js.map +1 -0
- package/dist/api-client/models/GeneratedAPIKeyResponse.d.ts +63 -0
- package/dist/api-client/models/GeneratedAPIKeyResponse.d.ts.map +1 -0
- package/dist/api-client/models/GeneratedAPIKeyResponse.js +52 -0
- package/dist/api-client/models/GeneratedAPIKeyResponse.js.map +1 -0
- package/dist/api-client/models/GetPTYBuffer200Response.d.ts +33 -0
- package/dist/api-client/models/GetPTYBuffer200Response.d.ts.map +1 -0
- package/dist/api-client/models/GetPTYBuffer200Response.js +42 -0
- package/dist/api-client/models/GetPTYBuffer200Response.js.map +1 -0
- package/dist/api-client/models/Image.d.ts +69 -0
- package/dist/api-client/models/Image.d.ts.map +1 -0
- package/dist/api-client/models/Image.js +54 -0
- package/dist/api-client/models/Image.js.map +1 -0
- package/dist/api-client/models/ListFiles200Response.d.ts +46 -0
- package/dist/api-client/models/ListFiles200Response.d.ts.map +1 -0
- package/dist/api-client/models/ListFiles200Response.js +47 -0
- package/dist/api-client/models/ListFiles200Response.js.map +1 -0
- package/dist/api-client/models/ListFiles200ResponseData.d.ts +40 -0
- package/dist/api-client/models/ListFiles200ResponseData.d.ts.map +1 -0
- package/dist/api-client/models/ListFiles200ResponseData.js +45 -0
- package/dist/api-client/models/ListFiles200ResponseData.js.map +1 -0
- package/dist/api-client/models/Organization.d.ts +81 -0
- package/dist/api-client/models/Organization.d.ts.map +1 -0
- package/dist/api-client/models/Organization.js +58 -0
- package/dist/api-client/models/Organization.js.map +1 -0
- package/dist/api-client/models/PTYSessionResponse.d.ts +51 -0
- package/dist/api-client/models/PTYSessionResponse.d.ts.map +1 -0
- package/dist/api-client/models/PTYSessionResponse.js +48 -0
- package/dist/api-client/models/PTYSessionResponse.js.map +1 -0
- package/dist/api-client/models/RegisterRequest.d.ts +39 -0
- package/dist/api-client/models/RegisterRequest.d.ts.map +1 -0
- package/dist/api-client/models/RegisterRequest.js +48 -0
- package/dist/api-client/models/RegisterRequest.js.map +1 -0
- package/dist/api-client/models/RegisterResponse.d.ts +40 -0
- package/dist/api-client/models/RegisterResponse.d.ts.map +1 -0
- package/dist/api-client/models/RegisterResponse.js +45 -0
- package/dist/api-client/models/RegisterResponse.js.map +1 -0
- package/dist/api-client/models/RegisterResponseData.d.ts +39 -0
- package/dist/api-client/models/RegisterResponseData.d.ts.map +1 -0
- package/dist/api-client/models/RegisterResponseData.js +44 -0
- package/dist/api-client/models/RegisterResponseData.js.map +1 -0
- package/dist/api-client/models/ResizeTerminalRequest.d.ts +39 -0
- package/dist/api-client/models/ResizeTerminalRequest.d.ts.map +1 -0
- package/dist/api-client/models/ResizeTerminalRequest.js +48 -0
- package/dist/api-client/models/ResizeTerminalRequest.js.map +1 -0
- package/dist/api-client/models/RestoreSandboxRequest.d.ts +75 -0
- package/dist/api-client/models/RestoreSandboxRequest.d.ts.map +1 -0
- package/dist/api-client/models/RestoreSandboxRequest.js +62 -0
- package/dist/api-client/models/RestoreSandboxRequest.js.map +1 -0
- package/dist/api-client/models/Sandbox.d.ts +97 -0
- package/dist/api-client/models/Sandbox.d.ts.map +1 -0
- package/dist/api-client/models/Sandbox.js +69 -0
- package/dist/api-client/models/Sandbox.js.map +1 -0
- package/dist/api-client/models/SessionExecResponse.d.ts +57 -0
- package/dist/api-client/models/SessionExecResponse.d.ts.map +1 -0
- package/dist/api-client/models/SessionExecResponse.js +50 -0
- package/dist/api-client/models/SessionExecResponse.js.map +1 -0
- package/dist/api-client/models/Snapshot.d.ts +45 -0
- package/dist/api-client/models/Snapshot.d.ts.map +1 -0
- package/dist/api-client/models/Snapshot.js +46 -0
- package/dist/api-client/models/Snapshot.js.map +1 -0
- package/dist/api-client/models/SuccessResponse.d.ts +45 -0
- package/dist/api-client/models/SuccessResponse.d.ts.map +1 -0
- package/dist/api-client/models/SuccessResponse.js +46 -0
- package/dist/api-client/models/SuccessResponse.js.map +1 -0
- package/dist/api-client/models/index.d.ts +37 -0
- package/dist/api-client/models/index.d.ts.map +1 -0
- package/dist/api-client/models/index.js +39 -0
- package/dist/api-client/models/index.js.map +1 -0
- package/dist/api-client/runtime.d.ts +185 -0
- package/dist/api-client/runtime.d.ts.map +1 -0
- package/dist/api-client/runtime.js +334 -0
- package/dist/api-client/runtime.js.map +1 -0
- package/dist/constants.d.ts +8 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +9 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +62 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +47 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/runtime.d.ts +2 -0
- package/dist/utils/runtime.d.ts.map +1 -0
- package/dist/utils/runtime.js +23 -0
- package/dist/utils/runtime.js.map +1 -0
- package/package.json +23 -0
|
@@ -0,0 +1,634 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Hyper Fleet Native API
|
|
5
|
+
* Hyper Fleet Native API provides comprehensive management of virtual machines (sandboxes), file system operations, execution environments, and organizational resources. All endpoints except `/api/register` require the `X-API-Key` header for authentication.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
import * as runtime from '../runtime';
|
|
15
|
+
import { CreateFileRequestToJSON, ExecResponseFromJSON, ListFiles200ResponseFromJSON, SuccessResponseFromJSON, } from '../models/index';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
export class FileSystemApi extends runtime.BaseAPI {
|
|
20
|
+
/**
|
|
21
|
+
* Change the permissions (mode) of a file or directory
|
|
22
|
+
* Change file permissions
|
|
23
|
+
*/
|
|
24
|
+
async changePermissionsRaw(requestParameters, initOverrides) {
|
|
25
|
+
if (requestParameters['id'] == null) {
|
|
26
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling changePermissions().');
|
|
27
|
+
}
|
|
28
|
+
if (requestParameters['path'] == null) {
|
|
29
|
+
throw new runtime.RequiredError('path', 'Required parameter "path" was null or undefined when calling changePermissions().');
|
|
30
|
+
}
|
|
31
|
+
if (requestParameters['mode'] == null) {
|
|
32
|
+
throw new runtime.RequiredError('mode', 'Required parameter "mode" was null or undefined when calling changePermissions().');
|
|
33
|
+
}
|
|
34
|
+
const queryParameters = {};
|
|
35
|
+
if (requestParameters['path'] != null) {
|
|
36
|
+
queryParameters['path'] = requestParameters['path'];
|
|
37
|
+
}
|
|
38
|
+
if (requestParameters['mode'] != null) {
|
|
39
|
+
queryParameters['mode'] = requestParameters['mode'];
|
|
40
|
+
}
|
|
41
|
+
const headerParameters = {};
|
|
42
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
43
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
44
|
+
}
|
|
45
|
+
let urlPath = `/sandboxes/{id}/files/chmod`;
|
|
46
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
47
|
+
const response = await this.request({
|
|
48
|
+
path: urlPath,
|
|
49
|
+
method: 'POST',
|
|
50
|
+
headers: headerParameters,
|
|
51
|
+
query: queryParameters,
|
|
52
|
+
}, initOverrides);
|
|
53
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ExecResponseFromJSON(jsonValue));
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Change the permissions (mode) of a file or directory
|
|
57
|
+
* Change file permissions
|
|
58
|
+
*/
|
|
59
|
+
async changePermissions(requestParameters, initOverrides) {
|
|
60
|
+
const response = await this.changePermissionsRaw(requestParameters, initOverrides);
|
|
61
|
+
return await response.value();
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Create an archive from a file or directory
|
|
65
|
+
* Compress file or directory
|
|
66
|
+
*/
|
|
67
|
+
async compressFileRaw(requestParameters, initOverrides) {
|
|
68
|
+
if (requestParameters['id'] == null) {
|
|
69
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling compressFile().');
|
|
70
|
+
}
|
|
71
|
+
if (requestParameters['path'] == null) {
|
|
72
|
+
throw new runtime.RequiredError('path', 'Required parameter "path" was null or undefined when calling compressFile().');
|
|
73
|
+
}
|
|
74
|
+
const queryParameters = {};
|
|
75
|
+
if (requestParameters['path'] != null) {
|
|
76
|
+
queryParameters['path'] = requestParameters['path'];
|
|
77
|
+
}
|
|
78
|
+
if (requestParameters['format'] != null) {
|
|
79
|
+
queryParameters['format'] = requestParameters['format'];
|
|
80
|
+
}
|
|
81
|
+
const headerParameters = {};
|
|
82
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
83
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
84
|
+
}
|
|
85
|
+
let urlPath = `/sandboxes/{id}/files/compress`;
|
|
86
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
87
|
+
const response = await this.request({
|
|
88
|
+
path: urlPath,
|
|
89
|
+
method: 'POST',
|
|
90
|
+
headers: headerParameters,
|
|
91
|
+
query: queryParameters,
|
|
92
|
+
}, initOverrides);
|
|
93
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ExecResponseFromJSON(jsonValue));
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Create an archive from a file or directory
|
|
97
|
+
* Compress file or directory
|
|
98
|
+
*/
|
|
99
|
+
async compressFile(requestParameters, initOverrides) {
|
|
100
|
+
const response = await this.compressFileRaw(requestParameters, initOverrides);
|
|
101
|
+
return await response.value();
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Copy a file or directory to a new location
|
|
105
|
+
* Copy file or directory
|
|
106
|
+
*/
|
|
107
|
+
async copyFileRaw(requestParameters, initOverrides) {
|
|
108
|
+
if (requestParameters['id'] == null) {
|
|
109
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling copyFile().');
|
|
110
|
+
}
|
|
111
|
+
if (requestParameters['from'] == null) {
|
|
112
|
+
throw new runtime.RequiredError('from', 'Required parameter "from" was null or undefined when calling copyFile().');
|
|
113
|
+
}
|
|
114
|
+
if (requestParameters['to'] == null) {
|
|
115
|
+
throw new runtime.RequiredError('to', 'Required parameter "to" was null or undefined when calling copyFile().');
|
|
116
|
+
}
|
|
117
|
+
const queryParameters = {};
|
|
118
|
+
if (requestParameters['from'] != null) {
|
|
119
|
+
queryParameters['from'] = requestParameters['from'];
|
|
120
|
+
}
|
|
121
|
+
if (requestParameters['to'] != null) {
|
|
122
|
+
queryParameters['to'] = requestParameters['to'];
|
|
123
|
+
}
|
|
124
|
+
const headerParameters = {};
|
|
125
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
126
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
127
|
+
}
|
|
128
|
+
let urlPath = `/sandboxes/{id}/files/copy`;
|
|
129
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
130
|
+
const response = await this.request({
|
|
131
|
+
path: urlPath,
|
|
132
|
+
method: 'POST',
|
|
133
|
+
headers: headerParameters,
|
|
134
|
+
query: queryParameters,
|
|
135
|
+
}, initOverrides);
|
|
136
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ExecResponseFromJSON(jsonValue));
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Copy a file or directory to a new location
|
|
140
|
+
* Copy file or directory
|
|
141
|
+
*/
|
|
142
|
+
async copyFile(requestParameters, initOverrides) {
|
|
143
|
+
const response = await this.copyFileRaw(requestParameters, initOverrides);
|
|
144
|
+
return await response.value();
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Create a new directory
|
|
148
|
+
* Create directory
|
|
149
|
+
*/
|
|
150
|
+
async createDirectoryRaw(requestParameters, initOverrides) {
|
|
151
|
+
if (requestParameters['id'] == null) {
|
|
152
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling createDirectory().');
|
|
153
|
+
}
|
|
154
|
+
if (requestParameters['path'] == null) {
|
|
155
|
+
throw new runtime.RequiredError('path', 'Required parameter "path" was null or undefined when calling createDirectory().');
|
|
156
|
+
}
|
|
157
|
+
const queryParameters = {};
|
|
158
|
+
if (requestParameters['path'] != null) {
|
|
159
|
+
queryParameters['path'] = requestParameters['path'];
|
|
160
|
+
}
|
|
161
|
+
const headerParameters = {};
|
|
162
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
163
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
164
|
+
}
|
|
165
|
+
let urlPath = `/sandboxes/{id}/files/mkdir`;
|
|
166
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
167
|
+
const response = await this.request({
|
|
168
|
+
path: urlPath,
|
|
169
|
+
method: 'POST',
|
|
170
|
+
headers: headerParameters,
|
|
171
|
+
query: queryParameters,
|
|
172
|
+
}, initOverrides);
|
|
173
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ExecResponseFromJSON(jsonValue));
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Create a new directory
|
|
177
|
+
* Create directory
|
|
178
|
+
*/
|
|
179
|
+
async createDirectory(requestParameters, initOverrides) {
|
|
180
|
+
const response = await this.createDirectoryRaw(requestParameters, initOverrides);
|
|
181
|
+
return await response.value();
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Create a new file with optional content
|
|
185
|
+
* Create file
|
|
186
|
+
*/
|
|
187
|
+
async createFileRaw(requestParameters, initOverrides) {
|
|
188
|
+
if (requestParameters['id'] == null) {
|
|
189
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling createFile().');
|
|
190
|
+
}
|
|
191
|
+
if (requestParameters['path'] == null) {
|
|
192
|
+
throw new runtime.RequiredError('path', 'Required parameter "path" was null or undefined when calling createFile().');
|
|
193
|
+
}
|
|
194
|
+
const queryParameters = {};
|
|
195
|
+
if (requestParameters['path'] != null) {
|
|
196
|
+
queryParameters['path'] = requestParameters['path'];
|
|
197
|
+
}
|
|
198
|
+
if (requestParameters['content'] != null) {
|
|
199
|
+
queryParameters['content'] = requestParameters['content'];
|
|
200
|
+
}
|
|
201
|
+
const headerParameters = {};
|
|
202
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
203
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
204
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
205
|
+
}
|
|
206
|
+
let urlPath = `/sandboxes/{id}/files/create`;
|
|
207
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
208
|
+
const response = await this.request({
|
|
209
|
+
path: urlPath,
|
|
210
|
+
method: 'POST',
|
|
211
|
+
headers: headerParameters,
|
|
212
|
+
query: queryParameters,
|
|
213
|
+
body: CreateFileRequestToJSON(requestParameters['createFileRequest']),
|
|
214
|
+
}, initOverrides);
|
|
215
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ExecResponseFromJSON(jsonValue));
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Create a new file with optional content
|
|
219
|
+
* Create file
|
|
220
|
+
*/
|
|
221
|
+
async createFile(requestParameters, initOverrides) {
|
|
222
|
+
const response = await this.createFileRaw(requestParameters, initOverrides);
|
|
223
|
+
return await response.value();
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Delete a file or directory
|
|
227
|
+
* Delete file or directory
|
|
228
|
+
*/
|
|
229
|
+
async deleteFileRaw(requestParameters, initOverrides) {
|
|
230
|
+
if (requestParameters['id'] == null) {
|
|
231
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteFile().');
|
|
232
|
+
}
|
|
233
|
+
if (requestParameters['path'] == null) {
|
|
234
|
+
throw new runtime.RequiredError('path', 'Required parameter "path" was null or undefined when calling deleteFile().');
|
|
235
|
+
}
|
|
236
|
+
const queryParameters = {};
|
|
237
|
+
if (requestParameters['path'] != null) {
|
|
238
|
+
queryParameters['path'] = requestParameters['path'];
|
|
239
|
+
}
|
|
240
|
+
const headerParameters = {};
|
|
241
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
242
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
243
|
+
}
|
|
244
|
+
let urlPath = `/sandboxes/{id}/files`;
|
|
245
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
246
|
+
const response = await this.request({
|
|
247
|
+
path: urlPath,
|
|
248
|
+
method: 'DELETE',
|
|
249
|
+
headers: headerParameters,
|
|
250
|
+
query: queryParameters,
|
|
251
|
+
}, initOverrides);
|
|
252
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ExecResponseFromJSON(jsonValue));
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Delete a file or directory
|
|
256
|
+
* Delete file or directory
|
|
257
|
+
*/
|
|
258
|
+
async deleteFile(requestParameters, initOverrides) {
|
|
259
|
+
const response = await this.deleteFileRaw(requestParameters, initOverrides);
|
|
260
|
+
return await response.value();
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Get disk usage for a path
|
|
264
|
+
* Disk usage
|
|
265
|
+
*/
|
|
266
|
+
async diskUsageRaw(requestParameters, initOverrides) {
|
|
267
|
+
if (requestParameters['id'] == null) {
|
|
268
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling diskUsage().');
|
|
269
|
+
}
|
|
270
|
+
if (requestParameters['path'] == null) {
|
|
271
|
+
throw new runtime.RequiredError('path', 'Required parameter "path" was null or undefined when calling diskUsage().');
|
|
272
|
+
}
|
|
273
|
+
const queryParameters = {};
|
|
274
|
+
if (requestParameters['path'] != null) {
|
|
275
|
+
queryParameters['path'] = requestParameters['path'];
|
|
276
|
+
}
|
|
277
|
+
const headerParameters = {};
|
|
278
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
279
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
280
|
+
}
|
|
281
|
+
let urlPath = `/sandboxes/{id}/files/du`;
|
|
282
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
283
|
+
const response = await this.request({
|
|
284
|
+
path: urlPath,
|
|
285
|
+
method: 'GET',
|
|
286
|
+
headers: headerParameters,
|
|
287
|
+
query: queryParameters,
|
|
288
|
+
}, initOverrides);
|
|
289
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ExecResponseFromJSON(jsonValue));
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Get disk usage for a path
|
|
293
|
+
* Disk usage
|
|
294
|
+
*/
|
|
295
|
+
async diskUsage(requestParameters, initOverrides) {
|
|
296
|
+
const response = await this.diskUsageRaw(requestParameters, initOverrides);
|
|
297
|
+
return await response.value();
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Download a file from the sandbox
|
|
301
|
+
* Download file
|
|
302
|
+
*/
|
|
303
|
+
async downloadFileRaw(requestParameters, initOverrides) {
|
|
304
|
+
if (requestParameters['id'] == null) {
|
|
305
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling downloadFile().');
|
|
306
|
+
}
|
|
307
|
+
if (requestParameters['path'] == null) {
|
|
308
|
+
throw new runtime.RequiredError('path', 'Required parameter "path" was null or undefined when calling downloadFile().');
|
|
309
|
+
}
|
|
310
|
+
const queryParameters = {};
|
|
311
|
+
if (requestParameters['path'] != null) {
|
|
312
|
+
queryParameters['path'] = requestParameters['path'];
|
|
313
|
+
}
|
|
314
|
+
const headerParameters = {};
|
|
315
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
316
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
317
|
+
}
|
|
318
|
+
let urlPath = `/sandboxes/{id}/files/download`;
|
|
319
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
320
|
+
const response = await this.request({
|
|
321
|
+
path: urlPath,
|
|
322
|
+
method: 'GET',
|
|
323
|
+
headers: headerParameters,
|
|
324
|
+
query: queryParameters,
|
|
325
|
+
}, initOverrides);
|
|
326
|
+
return new runtime.BlobApiResponse(response);
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Download a file from the sandbox
|
|
330
|
+
* Download file
|
|
331
|
+
*/
|
|
332
|
+
async downloadFile(requestParameters, initOverrides) {
|
|
333
|
+
const response = await this.downloadFileRaw(requestParameters, initOverrides);
|
|
334
|
+
return await response.value();
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Extract an archive to a destination directory
|
|
338
|
+
* Extract archive
|
|
339
|
+
*/
|
|
340
|
+
async extractArchiveRaw(requestParameters, initOverrides) {
|
|
341
|
+
if (requestParameters['id'] == null) {
|
|
342
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling extractArchive().');
|
|
343
|
+
}
|
|
344
|
+
if (requestParameters['archive'] == null) {
|
|
345
|
+
throw new runtime.RequiredError('archive', 'Required parameter "archive" was null or undefined when calling extractArchive().');
|
|
346
|
+
}
|
|
347
|
+
if (requestParameters['dest'] == null) {
|
|
348
|
+
throw new runtime.RequiredError('dest', 'Required parameter "dest" was null or undefined when calling extractArchive().');
|
|
349
|
+
}
|
|
350
|
+
const queryParameters = {};
|
|
351
|
+
if (requestParameters['archive'] != null) {
|
|
352
|
+
queryParameters['archive'] = requestParameters['archive'];
|
|
353
|
+
}
|
|
354
|
+
if (requestParameters['dest'] != null) {
|
|
355
|
+
queryParameters['dest'] = requestParameters['dest'];
|
|
356
|
+
}
|
|
357
|
+
const headerParameters = {};
|
|
358
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
359
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
360
|
+
}
|
|
361
|
+
let urlPath = `/sandboxes/{id}/files/extract`;
|
|
362
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
363
|
+
const response = await this.request({
|
|
364
|
+
path: urlPath,
|
|
365
|
+
method: 'POST',
|
|
366
|
+
headers: headerParameters,
|
|
367
|
+
query: queryParameters,
|
|
368
|
+
}, initOverrides);
|
|
369
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ExecResponseFromJSON(jsonValue));
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Extract an archive to a destination directory
|
|
373
|
+
* Extract archive
|
|
374
|
+
*/
|
|
375
|
+
async extractArchive(requestParameters, initOverrides) {
|
|
376
|
+
const response = await this.extractArchiveRaw(requestParameters, initOverrides);
|
|
377
|
+
return await response.value();
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Get the first or last N lines of a file
|
|
381
|
+
* Read file head or tail
|
|
382
|
+
*/
|
|
383
|
+
async headTailRaw(requestParameters, initOverrides) {
|
|
384
|
+
if (requestParameters['id'] == null) {
|
|
385
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling headTail().');
|
|
386
|
+
}
|
|
387
|
+
if (requestParameters['path'] == null) {
|
|
388
|
+
throw new runtime.RequiredError('path', 'Required parameter "path" was null or undefined when calling headTail().');
|
|
389
|
+
}
|
|
390
|
+
const queryParameters = {};
|
|
391
|
+
if (requestParameters['path'] != null) {
|
|
392
|
+
queryParameters['path'] = requestParameters['path'];
|
|
393
|
+
}
|
|
394
|
+
if (requestParameters['lines'] != null) {
|
|
395
|
+
queryParameters['lines'] = requestParameters['lines'];
|
|
396
|
+
}
|
|
397
|
+
if (requestParameters['head'] != null) {
|
|
398
|
+
queryParameters['head'] = requestParameters['head'];
|
|
399
|
+
}
|
|
400
|
+
const headerParameters = {};
|
|
401
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
402
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
403
|
+
}
|
|
404
|
+
let urlPath = `/sandboxes/{id}/files/head-tail`;
|
|
405
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
406
|
+
const response = await this.request({
|
|
407
|
+
path: urlPath,
|
|
408
|
+
method: 'GET',
|
|
409
|
+
headers: headerParameters,
|
|
410
|
+
query: queryParameters,
|
|
411
|
+
}, initOverrides);
|
|
412
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ExecResponseFromJSON(jsonValue));
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Get the first or last N lines of a file
|
|
416
|
+
* Read file head or tail
|
|
417
|
+
*/
|
|
418
|
+
async headTail(requestParameters, initOverrides) {
|
|
419
|
+
const response = await this.headTailRaw(requestParameters, initOverrides);
|
|
420
|
+
return await response.value();
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* List files and directories in a path
|
|
424
|
+
* List files
|
|
425
|
+
*/
|
|
426
|
+
async listFilesRaw(requestParameters, initOverrides) {
|
|
427
|
+
if (requestParameters['id'] == null) {
|
|
428
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling listFiles().');
|
|
429
|
+
}
|
|
430
|
+
if (requestParameters['path'] == null) {
|
|
431
|
+
throw new runtime.RequiredError('path', 'Required parameter "path" was null or undefined when calling listFiles().');
|
|
432
|
+
}
|
|
433
|
+
const queryParameters = {};
|
|
434
|
+
if (requestParameters['path'] != null) {
|
|
435
|
+
queryParameters['path'] = requestParameters['path'];
|
|
436
|
+
}
|
|
437
|
+
const headerParameters = {};
|
|
438
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
439
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
440
|
+
}
|
|
441
|
+
let urlPath = `/sandboxes/{id}/files`;
|
|
442
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
443
|
+
const response = await this.request({
|
|
444
|
+
path: urlPath,
|
|
445
|
+
method: 'GET',
|
|
446
|
+
headers: headerParameters,
|
|
447
|
+
query: queryParameters,
|
|
448
|
+
}, initOverrides);
|
|
449
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ListFiles200ResponseFromJSON(jsonValue));
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* List files and directories in a path
|
|
453
|
+
* List files
|
|
454
|
+
*/
|
|
455
|
+
async listFiles(requestParameters, initOverrides) {
|
|
456
|
+
const response = await this.listFilesRaw(requestParameters, initOverrides);
|
|
457
|
+
return await response.value();
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Move or rename a file or directory
|
|
461
|
+
* Move file or directory
|
|
462
|
+
*/
|
|
463
|
+
async moveFileRaw(requestParameters, initOverrides) {
|
|
464
|
+
if (requestParameters['id'] == null) {
|
|
465
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling moveFile().');
|
|
466
|
+
}
|
|
467
|
+
if (requestParameters['from'] == null) {
|
|
468
|
+
throw new runtime.RequiredError('from', 'Required parameter "from" was null or undefined when calling moveFile().');
|
|
469
|
+
}
|
|
470
|
+
if (requestParameters['to'] == null) {
|
|
471
|
+
throw new runtime.RequiredError('to', 'Required parameter "to" was null or undefined when calling moveFile().');
|
|
472
|
+
}
|
|
473
|
+
const queryParameters = {};
|
|
474
|
+
if (requestParameters['from'] != null) {
|
|
475
|
+
queryParameters['from'] = requestParameters['from'];
|
|
476
|
+
}
|
|
477
|
+
if (requestParameters['to'] != null) {
|
|
478
|
+
queryParameters['to'] = requestParameters['to'];
|
|
479
|
+
}
|
|
480
|
+
const headerParameters = {};
|
|
481
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
482
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
483
|
+
}
|
|
484
|
+
let urlPath = `/sandboxes/{id}/files/move`;
|
|
485
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
486
|
+
const response = await this.request({
|
|
487
|
+
path: urlPath,
|
|
488
|
+
method: 'POST',
|
|
489
|
+
headers: headerParameters,
|
|
490
|
+
query: queryParameters,
|
|
491
|
+
}, initOverrides);
|
|
492
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ExecResponseFromJSON(jsonValue));
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Move or rename a file or directory
|
|
496
|
+
* Move file or directory
|
|
497
|
+
*/
|
|
498
|
+
async moveFile(requestParameters, initOverrides) {
|
|
499
|
+
const response = await this.moveFileRaw(requestParameters, initOverrides);
|
|
500
|
+
return await response.value();
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Search for files matching a pattern
|
|
504
|
+
* Search files
|
|
505
|
+
*/
|
|
506
|
+
async searchFilesRaw(requestParameters, initOverrides) {
|
|
507
|
+
if (requestParameters['id'] == null) {
|
|
508
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling searchFiles().');
|
|
509
|
+
}
|
|
510
|
+
if (requestParameters['path'] == null) {
|
|
511
|
+
throw new runtime.RequiredError('path', 'Required parameter "path" was null or undefined when calling searchFiles().');
|
|
512
|
+
}
|
|
513
|
+
if (requestParameters['pattern'] == null) {
|
|
514
|
+
throw new runtime.RequiredError('pattern', 'Required parameter "pattern" was null or undefined when calling searchFiles().');
|
|
515
|
+
}
|
|
516
|
+
const queryParameters = {};
|
|
517
|
+
if (requestParameters['path'] != null) {
|
|
518
|
+
queryParameters['path'] = requestParameters['path'];
|
|
519
|
+
}
|
|
520
|
+
if (requestParameters['pattern'] != null) {
|
|
521
|
+
queryParameters['pattern'] = requestParameters['pattern'];
|
|
522
|
+
}
|
|
523
|
+
const headerParameters = {};
|
|
524
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
525
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
526
|
+
}
|
|
527
|
+
let urlPath = `/sandboxes/{id}/files/search`;
|
|
528
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
529
|
+
const response = await this.request({
|
|
530
|
+
path: urlPath,
|
|
531
|
+
method: 'GET',
|
|
532
|
+
headers: headerParameters,
|
|
533
|
+
query: queryParameters,
|
|
534
|
+
}, initOverrides);
|
|
535
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ExecResponseFromJSON(jsonValue));
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Search for files matching a pattern
|
|
539
|
+
* Search files
|
|
540
|
+
*/
|
|
541
|
+
async searchFiles(requestParameters, initOverrides) {
|
|
542
|
+
const response = await this.searchFilesRaw(requestParameters, initOverrides);
|
|
543
|
+
return await response.value();
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Get detailed information about a file or directory
|
|
547
|
+
* Get file stats
|
|
548
|
+
*/
|
|
549
|
+
async statFileRaw(requestParameters, initOverrides) {
|
|
550
|
+
if (requestParameters['id'] == null) {
|
|
551
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling statFile().');
|
|
552
|
+
}
|
|
553
|
+
if (requestParameters['path'] == null) {
|
|
554
|
+
throw new runtime.RequiredError('path', 'Required parameter "path" was null or undefined when calling statFile().');
|
|
555
|
+
}
|
|
556
|
+
const queryParameters = {};
|
|
557
|
+
if (requestParameters['path'] != null) {
|
|
558
|
+
queryParameters['path'] = requestParameters['path'];
|
|
559
|
+
}
|
|
560
|
+
const headerParameters = {};
|
|
561
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
562
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
563
|
+
}
|
|
564
|
+
let urlPath = `/sandboxes/{id}/files/stat`;
|
|
565
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
566
|
+
const response = await this.request({
|
|
567
|
+
path: urlPath,
|
|
568
|
+
method: 'GET',
|
|
569
|
+
headers: headerParameters,
|
|
570
|
+
query: queryParameters,
|
|
571
|
+
}, initOverrides);
|
|
572
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ExecResponseFromJSON(jsonValue));
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Get detailed information about a file or directory
|
|
576
|
+
* Get file stats
|
|
577
|
+
*/
|
|
578
|
+
async statFile(requestParameters, initOverrides) {
|
|
579
|
+
const response = await this.statFileRaw(requestParameters, initOverrides);
|
|
580
|
+
return await response.value();
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Upload a file to the sandbox
|
|
584
|
+
* Upload file
|
|
585
|
+
*/
|
|
586
|
+
async uploadFileRaw(requestParameters, initOverrides) {
|
|
587
|
+
if (requestParameters['id'] == null) {
|
|
588
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling uploadFile().');
|
|
589
|
+
}
|
|
590
|
+
if (requestParameters['path'] == null) {
|
|
591
|
+
throw new runtime.RequiredError('path', 'Required parameter "path" was null or undefined when calling uploadFile().');
|
|
592
|
+
}
|
|
593
|
+
if (requestParameters['body'] == null) {
|
|
594
|
+
throw new runtime.RequiredError('body', 'Required parameter "body" was null or undefined when calling uploadFile().');
|
|
595
|
+
}
|
|
596
|
+
const queryParameters = {};
|
|
597
|
+
if (requestParameters['path'] != null) {
|
|
598
|
+
queryParameters['path'] = requestParameters['path'];
|
|
599
|
+
}
|
|
600
|
+
const headerParameters = {};
|
|
601
|
+
headerParameters['Content-Type'] = 'application/octet-stream';
|
|
602
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
603
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
604
|
+
}
|
|
605
|
+
let urlPath = `/sandboxes/{id}/files/upload`;
|
|
606
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
607
|
+
const response = await this.request({
|
|
608
|
+
path: urlPath,
|
|
609
|
+
method: 'POST',
|
|
610
|
+
headers: headerParameters,
|
|
611
|
+
query: queryParameters,
|
|
612
|
+
body: requestParameters['body'],
|
|
613
|
+
}, initOverrides);
|
|
614
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SuccessResponseFromJSON(jsonValue));
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* Upload a file to the sandbox
|
|
618
|
+
* Upload file
|
|
619
|
+
*/
|
|
620
|
+
async uploadFile(requestParameters, initOverrides) {
|
|
621
|
+
const response = await this.uploadFileRaw(requestParameters, initOverrides);
|
|
622
|
+
return await response.value();
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* @export
|
|
627
|
+
*/
|
|
628
|
+
export const CompressFileFormatEnum = {
|
|
629
|
+
Tar: 'tar',
|
|
630
|
+
TarGz: 'tar.gz',
|
|
631
|
+
TarBz2: 'tar.bz2',
|
|
632
|
+
Zip: 'zip'
|
|
633
|
+
};
|
|
634
|
+
//# sourceMappingURL=FileSystemApi.js.map
|