@sfxcode/nuxt-mongocamp-server 0.7.0
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/README.md +38 -0
- package/dist/module.cjs +5 -0
- package/dist/module.d.ts +9 -0
- package/dist/module.json +5 -0
- package/dist/module.mjs +72 -0
- package/dist/runtime/api/apis/AdminApi.d.ts +181 -0
- package/dist/runtime/api/apis/AdminApi.mjs +413 -0
- package/dist/runtime/api/apis/ApplicationApi.d.ts +68 -0
- package/dist/runtime/api/apis/ApplicationApi.mjs +147 -0
- package/dist/runtime/api/apis/AuthApi.d.ts +107 -0
- package/dist/runtime/api/apis/AuthApi.mjs +235 -0
- package/dist/runtime/api/apis/BucketApi.d.ts +67 -0
- package/dist/runtime/api/apis/BucketApi.mjs +128 -0
- package/dist/runtime/api/apis/CollectionApi.d.ts +161 -0
- package/dist/runtime/api/apis/CollectionApi.mjs +355 -0
- package/dist/runtime/api/apis/DatabaseApi.d.ts +77 -0
- package/dist/runtime/api/apis/DatabaseApi.mjs +156 -0
- package/dist/runtime/api/apis/DocumentApi.d.ts +188 -0
- package/dist/runtime/api/apis/DocumentApi.mjs +385 -0
- package/dist/runtime/api/apis/FileApi.d.ts +125 -0
- package/dist/runtime/api/apis/FileApi.mjs +299 -0
- package/dist/runtime/api/apis/IndexApi.d.ts +137 -0
- package/dist/runtime/api/apis/IndexApi.mjs +303 -0
- package/dist/runtime/api/apis/InformationApi.d.ts +28 -0
- package/dist/runtime/api/apis/InformationApi.mjs +21 -0
- package/dist/runtime/api/apis/JobsApi.d.ts +94 -0
- package/dist/runtime/api/apis/JobsApi.mjs +204 -0
- package/dist/runtime/api/apis/index.d.ts +11 -0
- package/dist/runtime/api/apis/index.mjs +11 -0
- package/dist/runtime/api/index.d.ts +3 -0
- package/dist/runtime/api/index.mjs +3 -0
- package/dist/runtime/api/models/BucketInformation.d.ts +45 -0
- package/dist/runtime/api/models/BucketInformation.mjs +28 -0
- package/dist/runtime/api/models/CollectionStatus.d.ts +103 -0
- package/dist/runtime/api/models/CollectionStatus.mjs +46 -0
- package/dist/runtime/api/models/DatabaseInfo.d.ts +53 -0
- package/dist/runtime/api/models/DatabaseInfo.mjs +30 -0
- package/dist/runtime/api/models/DeleteResponse.d.ts +33 -0
- package/dist/runtime/api/models/DeleteResponse.mjs +24 -0
- package/dist/runtime/api/models/ErrorDescription.d.ts +39 -0
- package/dist/runtime/api/models/ErrorDescription.mjs +26 -0
- package/dist/runtime/api/models/FileInformation.d.ts +59 -0
- package/dist/runtime/api/models/FileInformation.mjs +32 -0
- package/dist/runtime/api/models/Grant.d.ts +51 -0
- package/dist/runtime/api/models/Grant.mjs +30 -0
- package/dist/runtime/api/models/IndexCreateRequest.d.ts +36 -0
- package/dist/runtime/api/models/IndexCreateRequest.mjs +29 -0
- package/dist/runtime/api/models/IndexCreateResponse.d.ts +27 -0
- package/dist/runtime/api/models/IndexCreateResponse.mjs +22 -0
- package/dist/runtime/api/models/IndexDropResponse.d.ts +27 -0
- package/dist/runtime/api/models/IndexDropResponse.mjs +22 -0
- package/dist/runtime/api/models/IndexOptionsRequest.d.ts +69 -0
- package/dist/runtime/api/models/IndexOptionsRequest.mjs +37 -0
- package/dist/runtime/api/models/InsertResponse.d.ts +33 -0
- package/dist/runtime/api/models/InsertResponse.mjs +25 -0
- package/dist/runtime/api/models/JobConfig.d.ts +57 -0
- package/dist/runtime/api/models/JobConfig.mjs +32 -0
- package/dist/runtime/api/models/JobInformation.d.ts +75 -0
- package/dist/runtime/api/models/JobInformation.mjs +39 -0
- package/dist/runtime/api/models/JsonResultBoolean.d.ts +27 -0
- package/dist/runtime/api/models/JsonResultBoolean.mjs +22 -0
- package/dist/runtime/api/models/JsonResultString.d.ts +27 -0
- package/dist/runtime/api/models/JsonResultString.mjs +22 -0
- package/dist/runtime/api/models/JsonSchema.d.ts +42 -0
- package/dist/runtime/api/models/JsonSchema.mjs +31 -0
- package/dist/runtime/api/models/JsonSchemaDefinition.d.ts +55 -0
- package/dist/runtime/api/models/JsonSchemaDefinition.mjs +31 -0
- package/dist/runtime/api/models/Login.d.ts +33 -0
- package/dist/runtime/api/models/Login.mjs +24 -0
- package/dist/runtime/api/models/LoginResult.d.ts +40 -0
- package/dist/runtime/api/models/LoginResult.mjs +30 -0
- package/dist/runtime/api/models/Measurement.d.ts +33 -0
- package/dist/runtime/api/models/Measurement.mjs +24 -0
- package/dist/runtime/api/models/Metric.d.ts +52 -0
- package/dist/runtime/api/models/Metric.mjs +35 -0
- package/dist/runtime/api/models/MongoAggregateRequest.d.ts +34 -0
- package/dist/runtime/api/models/MongoAggregateRequest.mjs +29 -0
- package/dist/runtime/api/models/MongoFindRequest.d.ts +45 -0
- package/dist/runtime/api/models/MongoFindRequest.mjs +26 -0
- package/dist/runtime/api/models/MongoIndex.d.ts +99 -0
- package/dist/runtime/api/models/MongoIndex.mjs +45 -0
- package/dist/runtime/api/models/PasswordUpdateRequest.d.ts +27 -0
- package/dist/runtime/api/models/PasswordUpdateRequest.mjs +22 -0
- package/dist/runtime/api/models/PipelineStage.d.ts +33 -0
- package/dist/runtime/api/models/PipelineStage.mjs +24 -0
- package/dist/runtime/api/models/Role.d.ts +40 -0
- package/dist/runtime/api/models/Role.mjs +31 -0
- package/dist/runtime/api/models/SchemaAnalysis.d.ts +46 -0
- package/dist/runtime/api/models/SchemaAnalysis.mjs +33 -0
- package/dist/runtime/api/models/SchemaAnalysisField.d.ts +58 -0
- package/dist/runtime/api/models/SchemaAnalysisField.mjs +37 -0
- package/dist/runtime/api/models/SchemaAnalysisFieldType.d.ts +39 -0
- package/dist/runtime/api/models/SchemaAnalysisFieldType.mjs +26 -0
- package/dist/runtime/api/models/SettingsResponse.d.ts +47 -0
- package/dist/runtime/api/models/SettingsResponse.mjs +29 -0
- package/dist/runtime/api/models/UpdateFileInformationRequest.d.ts +35 -0
- package/dist/runtime/api/models/UpdateFileInformationRequest.mjs +25 -0
- package/dist/runtime/api/models/UpdateRequest.d.ts +37 -0
- package/dist/runtime/api/models/UpdateRequest.mjs +24 -0
- package/dist/runtime/api/models/UpdateResponse.d.ts +45 -0
- package/dist/runtime/api/models/UpdateResponse.mjs +29 -0
- package/dist/runtime/api/models/UpdateRoleRequest.d.ts +34 -0
- package/dist/runtime/api/models/UpdateRoleRequest.mjs +29 -0
- package/dist/runtime/api/models/UserInformation.d.ts +45 -0
- package/dist/runtime/api/models/UserInformation.mjs +29 -0
- package/dist/runtime/api/models/UserProfile.d.ts +52 -0
- package/dist/runtime/api/models/UserProfile.mjs +35 -0
- package/dist/runtime/api/models/Version.d.ts +39 -0
- package/dist/runtime/api/models/Version.mjs +26 -0
- package/dist/runtime/api/models/index.d.ts +39 -0
- package/dist/runtime/api/models/index.mjs +39 -0
- package/dist/runtime/api/runtime.d.ts +140 -0
- package/dist/runtime/api/runtime.mjs +196 -0
- package/dist/runtime/composables/mongocampApi.d.ts +14 -0
- package/dist/runtime/composables/mongocampApi.mjs +45 -0
- package/dist/runtime/composables/mongocampAuth.d.ts +9 -0
- package/dist/runtime/composables/mongocampAuth.mjs +52 -0
- package/dist/runtime/composables/mongocampSearch.d.ts +6 -0
- package/dist/runtime/composables/mongocampSearch.mjs +12 -0
- package/dist/runtime/composables/mongocampToken.d.ts +1 -0
- package/dist/runtime/composables/mongocampToken.mjs +10 -0
- package/dist/runtime/composables/mongocampUrl.d.ts +1 -0
- package/dist/runtime/composables/mongocampUrl.mjs +5 -0
- package/dist/runtime/composables/mongocampUser.d.ts +3 -0
- package/dist/runtime/composables/mongocampUser.mjs +2 -0
- package/dist/runtime/plugin.d.ts +2 -0
- package/dist/runtime/plugin.mjs +6 -0
- package/dist/types.d.ts +10 -0
- package/package.json +37 -0
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import * as runtime from "../runtime.mjs";
|
|
2
|
+
import {
|
|
3
|
+
DeleteResponseFromJSON,
|
|
4
|
+
FileInformationFromJSON,
|
|
5
|
+
InsertResponseFromJSON,
|
|
6
|
+
MongoFindRequestToJSON,
|
|
7
|
+
UpdateFileInformationRequestToJSON,
|
|
8
|
+
UpdateResponseFromJSON
|
|
9
|
+
} from "../models";
|
|
10
|
+
export class FileApi extends runtime.BaseAPI {
|
|
11
|
+
async deleteFileRaw(requestParameters, initOverrides) {
|
|
12
|
+
if (requestParameters.bucketName === null || requestParameters.bucketName === void 0) {
|
|
13
|
+
throw new runtime.RequiredError("bucketName", "Required parameter requestParameters.bucketName was null or undefined when calling deleteFile.");
|
|
14
|
+
}
|
|
15
|
+
if (requestParameters.fileId === null || requestParameters.fileId === void 0) {
|
|
16
|
+
throw new runtime.RequiredError("fileId", "Required parameter requestParameters.fileId was null or undefined when calling deleteFile.");
|
|
17
|
+
}
|
|
18
|
+
const queryParameters = {};
|
|
19
|
+
const headerParameters = {};
|
|
20
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
21
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
22
|
+
}
|
|
23
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
24
|
+
const token = this.configuration.accessToken;
|
|
25
|
+
const tokenString = await token("httpAuth", []);
|
|
26
|
+
if (tokenString) {
|
|
27
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
31
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
32
|
+
}
|
|
33
|
+
const response = await this.request({
|
|
34
|
+
path: `/mongodb/buckets/{bucketName}/files/{fileId}`.replace(`{${"bucketName"}}`, encodeURIComponent(String(requestParameters.bucketName))).replace(`{${"fileId"}}`, encodeURIComponent(String(requestParameters.fileId))),
|
|
35
|
+
method: "DELETE",
|
|
36
|
+
headers: headerParameters,
|
|
37
|
+
query: queryParameters
|
|
38
|
+
}, initOverrides);
|
|
39
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => DeleteResponseFromJSON(jsonValue));
|
|
40
|
+
}
|
|
41
|
+
async deleteFile(requestParameters, initOverrides) {
|
|
42
|
+
const response = await this.deleteFileRaw(requestParameters, initOverrides);
|
|
43
|
+
return await response.value();
|
|
44
|
+
}
|
|
45
|
+
async findFilesRaw(requestParameters, initOverrides) {
|
|
46
|
+
if (requestParameters.bucketName === null || requestParameters.bucketName === void 0) {
|
|
47
|
+
throw new runtime.RequiredError("bucketName", "Required parameter requestParameters.bucketName was null or undefined when calling findFiles.");
|
|
48
|
+
}
|
|
49
|
+
if (requestParameters.mongoFindRequest === null || requestParameters.mongoFindRequest === void 0) {
|
|
50
|
+
throw new runtime.RequiredError("mongoFindRequest", "Required parameter requestParameters.mongoFindRequest was null or undefined when calling findFiles.");
|
|
51
|
+
}
|
|
52
|
+
const queryParameters = {};
|
|
53
|
+
if (requestParameters.rowsPerPage !== void 0) {
|
|
54
|
+
queryParameters["rowsPerPage"] = requestParameters.rowsPerPage;
|
|
55
|
+
}
|
|
56
|
+
if (requestParameters.page !== void 0) {
|
|
57
|
+
queryParameters["page"] = requestParameters.page;
|
|
58
|
+
}
|
|
59
|
+
const headerParameters = {};
|
|
60
|
+
headerParameters["Content-Type"] = "application/json";
|
|
61
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
62
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
63
|
+
}
|
|
64
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
65
|
+
const token = this.configuration.accessToken;
|
|
66
|
+
const tokenString = await token("httpAuth", []);
|
|
67
|
+
if (tokenString) {
|
|
68
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
72
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
73
|
+
}
|
|
74
|
+
const response = await this.request({
|
|
75
|
+
path: `/mongodb/buckets/{bucketName}/files`.replace(`{${"bucketName"}}`, encodeURIComponent(String(requestParameters.bucketName))),
|
|
76
|
+
method: "POST",
|
|
77
|
+
headers: headerParameters,
|
|
78
|
+
query: queryParameters,
|
|
79
|
+
body: MongoFindRequestToJSON(requestParameters.mongoFindRequest)
|
|
80
|
+
}, initOverrides);
|
|
81
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(FileInformationFromJSON));
|
|
82
|
+
}
|
|
83
|
+
async findFiles(requestParameters, initOverrides) {
|
|
84
|
+
const response = await this.findFilesRaw(requestParameters, initOverrides);
|
|
85
|
+
return await response.value();
|
|
86
|
+
}
|
|
87
|
+
async getFileRaw(requestParameters, initOverrides) {
|
|
88
|
+
if (requestParameters.bucketName === null || requestParameters.bucketName === void 0) {
|
|
89
|
+
throw new runtime.RequiredError("bucketName", "Required parameter requestParameters.bucketName was null or undefined when calling getFile.");
|
|
90
|
+
}
|
|
91
|
+
if (requestParameters.fileId === null || requestParameters.fileId === void 0) {
|
|
92
|
+
throw new runtime.RequiredError("fileId", "Required parameter requestParameters.fileId was null or undefined when calling getFile.");
|
|
93
|
+
}
|
|
94
|
+
const queryParameters = {};
|
|
95
|
+
const headerParameters = {};
|
|
96
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
97
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
98
|
+
}
|
|
99
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
100
|
+
const token = this.configuration.accessToken;
|
|
101
|
+
const tokenString = await token("httpAuth", []);
|
|
102
|
+
if (tokenString) {
|
|
103
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
107
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
108
|
+
}
|
|
109
|
+
const response = await this.request({
|
|
110
|
+
path: `/mongodb/buckets/{bucketName}/files/{fileId}/file`.replace(`{${"bucketName"}}`, encodeURIComponent(String(requestParameters.bucketName))).replace(`{${"fileId"}}`, encodeURIComponent(String(requestParameters.fileId))),
|
|
111
|
+
method: "GET",
|
|
112
|
+
headers: headerParameters,
|
|
113
|
+
query: queryParameters
|
|
114
|
+
}, initOverrides);
|
|
115
|
+
return new runtime.BlobApiResponse(response);
|
|
116
|
+
}
|
|
117
|
+
async getFile(requestParameters, initOverrides) {
|
|
118
|
+
const response = await this.getFileRaw(requestParameters, initOverrides);
|
|
119
|
+
return await response.value();
|
|
120
|
+
}
|
|
121
|
+
async getFileInformationRaw(requestParameters, initOverrides) {
|
|
122
|
+
if (requestParameters.bucketName === null || requestParameters.bucketName === void 0) {
|
|
123
|
+
throw new runtime.RequiredError("bucketName", "Required parameter requestParameters.bucketName was null or undefined when calling getFileInformation.");
|
|
124
|
+
}
|
|
125
|
+
if (requestParameters.fileId === null || requestParameters.fileId === void 0) {
|
|
126
|
+
throw new runtime.RequiredError("fileId", "Required parameter requestParameters.fileId was null or undefined when calling getFileInformation.");
|
|
127
|
+
}
|
|
128
|
+
const queryParameters = {};
|
|
129
|
+
const headerParameters = {};
|
|
130
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
131
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
132
|
+
}
|
|
133
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
134
|
+
const token = this.configuration.accessToken;
|
|
135
|
+
const tokenString = await token("httpAuth", []);
|
|
136
|
+
if (tokenString) {
|
|
137
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
141
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
142
|
+
}
|
|
143
|
+
const response = await this.request({
|
|
144
|
+
path: `/mongodb/buckets/{bucketName}/files/{fileId}`.replace(`{${"bucketName"}}`, encodeURIComponent(String(requestParameters.bucketName))).replace(`{${"fileId"}}`, encodeURIComponent(String(requestParameters.fileId))),
|
|
145
|
+
method: "GET",
|
|
146
|
+
headers: headerParameters,
|
|
147
|
+
query: queryParameters
|
|
148
|
+
}, initOverrides);
|
|
149
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => FileInformationFromJSON(jsonValue));
|
|
150
|
+
}
|
|
151
|
+
async getFileInformation(requestParameters, initOverrides) {
|
|
152
|
+
const response = await this.getFileInformationRaw(requestParameters, initOverrides);
|
|
153
|
+
return await response.value();
|
|
154
|
+
}
|
|
155
|
+
async insertFileRaw(requestParameters, initOverrides) {
|
|
156
|
+
if (requestParameters.bucketName === null || requestParameters.bucketName === void 0) {
|
|
157
|
+
throw new runtime.RequiredError("bucketName", "Required parameter requestParameters.bucketName was null or undefined when calling insertFile.");
|
|
158
|
+
}
|
|
159
|
+
if (requestParameters.file === null || requestParameters.file === void 0) {
|
|
160
|
+
throw new runtime.RequiredError("file", "Required parameter requestParameters.file was null or undefined when calling insertFile.");
|
|
161
|
+
}
|
|
162
|
+
if (requestParameters.metaData === null || requestParameters.metaData === void 0) {
|
|
163
|
+
throw new runtime.RequiredError("metaData", "Required parameter requestParameters.metaData was null or undefined when calling insertFile.");
|
|
164
|
+
}
|
|
165
|
+
const queryParameters = {};
|
|
166
|
+
if (requestParameters.fileName !== void 0) {
|
|
167
|
+
queryParameters["fileName"] = requestParameters.fileName;
|
|
168
|
+
}
|
|
169
|
+
const headerParameters = {};
|
|
170
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
171
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
172
|
+
}
|
|
173
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
174
|
+
const token = this.configuration.accessToken;
|
|
175
|
+
const tokenString = await token("httpAuth", []);
|
|
176
|
+
if (tokenString) {
|
|
177
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
181
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
182
|
+
}
|
|
183
|
+
const consumes = [
|
|
184
|
+
{ contentType: "multipart/form-data" }
|
|
185
|
+
];
|
|
186
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
187
|
+
let formParams;
|
|
188
|
+
let useForm = false;
|
|
189
|
+
useForm = canConsumeForm;
|
|
190
|
+
if (useForm) {
|
|
191
|
+
formParams = new FormData();
|
|
192
|
+
} else {
|
|
193
|
+
formParams = new URLSearchParams();
|
|
194
|
+
}
|
|
195
|
+
if (requestParameters.file !== void 0) {
|
|
196
|
+
formParams.append("file", requestParameters.file);
|
|
197
|
+
}
|
|
198
|
+
if (requestParameters.metaData !== void 0) {
|
|
199
|
+
formParams.append("metaData", requestParameters.metaData);
|
|
200
|
+
}
|
|
201
|
+
const response = await this.request({
|
|
202
|
+
path: `/mongodb/buckets/{bucketName}/files`.replace(`{${"bucketName"}}`, encodeURIComponent(String(requestParameters.bucketName))),
|
|
203
|
+
method: "PUT",
|
|
204
|
+
headers: headerParameters,
|
|
205
|
+
query: queryParameters,
|
|
206
|
+
body: formParams
|
|
207
|
+
}, initOverrides);
|
|
208
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => InsertResponseFromJSON(jsonValue));
|
|
209
|
+
}
|
|
210
|
+
async insertFile(requestParameters, initOverrides) {
|
|
211
|
+
const response = await this.insertFileRaw(requestParameters, initOverrides);
|
|
212
|
+
return await response.value();
|
|
213
|
+
}
|
|
214
|
+
async listFilesRaw(requestParameters, initOverrides) {
|
|
215
|
+
if (requestParameters.bucketName === null || requestParameters.bucketName === void 0) {
|
|
216
|
+
throw new runtime.RequiredError("bucketName", "Required parameter requestParameters.bucketName was null or undefined when calling listFiles.");
|
|
217
|
+
}
|
|
218
|
+
const queryParameters = {};
|
|
219
|
+
if (requestParameters.filter !== void 0) {
|
|
220
|
+
queryParameters["filter"] = requestParameters.filter;
|
|
221
|
+
}
|
|
222
|
+
if (requestParameters.sort !== void 0) {
|
|
223
|
+
queryParameters["sort"] = requestParameters.sort;
|
|
224
|
+
}
|
|
225
|
+
if (requestParameters.projection !== void 0) {
|
|
226
|
+
queryParameters["projection"] = requestParameters.projection;
|
|
227
|
+
}
|
|
228
|
+
if (requestParameters.rowsPerPage !== void 0) {
|
|
229
|
+
queryParameters["rowsPerPage"] = requestParameters.rowsPerPage;
|
|
230
|
+
}
|
|
231
|
+
if (requestParameters.page !== void 0) {
|
|
232
|
+
queryParameters["page"] = requestParameters.page;
|
|
233
|
+
}
|
|
234
|
+
const headerParameters = {};
|
|
235
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
236
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
237
|
+
}
|
|
238
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
239
|
+
const token = this.configuration.accessToken;
|
|
240
|
+
const tokenString = await token("httpAuth", []);
|
|
241
|
+
if (tokenString) {
|
|
242
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
246
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
247
|
+
}
|
|
248
|
+
const response = await this.request({
|
|
249
|
+
path: `/mongodb/buckets/{bucketName}/files`.replace(`{${"bucketName"}}`, encodeURIComponent(String(requestParameters.bucketName))),
|
|
250
|
+
method: "GET",
|
|
251
|
+
headers: headerParameters,
|
|
252
|
+
query: queryParameters
|
|
253
|
+
}, initOverrides);
|
|
254
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(FileInformationFromJSON));
|
|
255
|
+
}
|
|
256
|
+
async listFiles(requestParameters, initOverrides) {
|
|
257
|
+
const response = await this.listFilesRaw(requestParameters, initOverrides);
|
|
258
|
+
return await response.value();
|
|
259
|
+
}
|
|
260
|
+
async updateFileInformationRaw(requestParameters, initOverrides) {
|
|
261
|
+
if (requestParameters.bucketName === null || requestParameters.bucketName === void 0) {
|
|
262
|
+
throw new runtime.RequiredError("bucketName", "Required parameter requestParameters.bucketName was null or undefined when calling updateFileInformation.");
|
|
263
|
+
}
|
|
264
|
+
if (requestParameters.fileId === null || requestParameters.fileId === void 0) {
|
|
265
|
+
throw new runtime.RequiredError("fileId", "Required parameter requestParameters.fileId was null or undefined when calling updateFileInformation.");
|
|
266
|
+
}
|
|
267
|
+
if (requestParameters.updateFileInformationRequest === null || requestParameters.updateFileInformationRequest === void 0) {
|
|
268
|
+
throw new runtime.RequiredError("updateFileInformationRequest", "Required parameter requestParameters.updateFileInformationRequest was null or undefined when calling updateFileInformation.");
|
|
269
|
+
}
|
|
270
|
+
const queryParameters = {};
|
|
271
|
+
const headerParameters = {};
|
|
272
|
+
headerParameters["Content-Type"] = "application/json";
|
|
273
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
274
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
275
|
+
}
|
|
276
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
277
|
+
const token = this.configuration.accessToken;
|
|
278
|
+
const tokenString = await token("httpAuth", []);
|
|
279
|
+
if (tokenString) {
|
|
280
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
284
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
285
|
+
}
|
|
286
|
+
const response = await this.request({
|
|
287
|
+
path: `/mongodb/buckets/{bucketName}/files/{fileId}`.replace(`{${"bucketName"}}`, encodeURIComponent(String(requestParameters.bucketName))).replace(`{${"fileId"}}`, encodeURIComponent(String(requestParameters.fileId))),
|
|
288
|
+
method: "PATCH",
|
|
289
|
+
headers: headerParameters,
|
|
290
|
+
query: queryParameters,
|
|
291
|
+
body: UpdateFileInformationRequestToJSON(requestParameters.updateFileInformationRequest)
|
|
292
|
+
}, initOverrides);
|
|
293
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => UpdateResponseFromJSON(jsonValue));
|
|
294
|
+
}
|
|
295
|
+
async updateFileInformation(requestParameters, initOverrides) {
|
|
296
|
+
const response = await this.updateFileInformationRaw(requestParameters, initOverrides);
|
|
297
|
+
return await response.value();
|
|
298
|
+
}
|
|
299
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mongocamp-server
|
|
3
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.2.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import { IndexCreateRequest, IndexCreateResponse, IndexDropResponse, IndexOptionsRequest, MongoIndex } from '../models';
|
|
14
|
+
export interface CreateExpiringIndexRequest {
|
|
15
|
+
collectionName: string;
|
|
16
|
+
fieldName: string;
|
|
17
|
+
duration: string;
|
|
18
|
+
sortAscending?: boolean;
|
|
19
|
+
name?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface CreateIndexRequest {
|
|
22
|
+
collectionName: string;
|
|
23
|
+
indexCreateRequest: IndexCreateRequest;
|
|
24
|
+
}
|
|
25
|
+
export interface CreateIndexForFieldRequest {
|
|
26
|
+
collectionName: string;
|
|
27
|
+
fieldName: string;
|
|
28
|
+
sortAscending?: boolean;
|
|
29
|
+
indexOptionsRequest?: IndexOptionsRequest;
|
|
30
|
+
}
|
|
31
|
+
export interface CreateTextIndexRequest {
|
|
32
|
+
collectionName: string;
|
|
33
|
+
fieldName: string;
|
|
34
|
+
indexOptionsRequest?: IndexOptionsRequest;
|
|
35
|
+
}
|
|
36
|
+
export interface CreateUniqueIndexRequest {
|
|
37
|
+
collectionName: string;
|
|
38
|
+
fieldName: string;
|
|
39
|
+
sortAscending?: boolean;
|
|
40
|
+
name?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface DeleteIndexRequest {
|
|
43
|
+
collectionName: string;
|
|
44
|
+
indexName: string;
|
|
45
|
+
}
|
|
46
|
+
export interface IndexRequest {
|
|
47
|
+
collectionName: string;
|
|
48
|
+
indexName: string;
|
|
49
|
+
}
|
|
50
|
+
export interface ListIndicesRequest {
|
|
51
|
+
collectionName: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
56
|
+
export declare class IndexApi extends runtime.BaseAPI {
|
|
57
|
+
/**
|
|
58
|
+
* Create expiring Index by Field for given Collection
|
|
59
|
+
* Create expiring Index by Field for Collection
|
|
60
|
+
*/
|
|
61
|
+
createExpiringIndexRaw(requestParameters: CreateExpiringIndexRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<IndexCreateResponse>>;
|
|
62
|
+
/**
|
|
63
|
+
* Create expiring Index by Field for given Collection
|
|
64
|
+
* Create expiring Index by Field for Collection
|
|
65
|
+
*/
|
|
66
|
+
createExpiringIndex(requestParameters: CreateExpiringIndexRequest, initOverrides?: RequestInit): Promise<IndexCreateResponse>;
|
|
67
|
+
/**
|
|
68
|
+
* Create Index for given Collection
|
|
69
|
+
* Create Index for Collection
|
|
70
|
+
*/
|
|
71
|
+
createIndexRaw(requestParameters: CreateIndexRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<IndexCreateResponse>>;
|
|
72
|
+
/**
|
|
73
|
+
* Create Index for given Collection
|
|
74
|
+
* Create Index for Collection
|
|
75
|
+
*/
|
|
76
|
+
createIndex(requestParameters: CreateIndexRequest, initOverrides?: RequestInit): Promise<IndexCreateResponse>;
|
|
77
|
+
/**
|
|
78
|
+
* Create Index by Field for given Collection
|
|
79
|
+
* Create Index by Field for Collection
|
|
80
|
+
*/
|
|
81
|
+
createIndexForFieldRaw(requestParameters: CreateIndexForFieldRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<IndexCreateResponse>>;
|
|
82
|
+
/**
|
|
83
|
+
* Create Index by Field for given Collection
|
|
84
|
+
* Create Index by Field for Collection
|
|
85
|
+
*/
|
|
86
|
+
createIndexForField(requestParameters: CreateIndexForFieldRequest, initOverrides?: RequestInit): Promise<IndexCreateResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* Create text index by field for given collection
|
|
89
|
+
* Create text index by field for collection
|
|
90
|
+
*/
|
|
91
|
+
createTextIndexRaw(requestParameters: CreateTextIndexRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<IndexCreateResponse>>;
|
|
92
|
+
/**
|
|
93
|
+
* Create text index by field for given collection
|
|
94
|
+
* Create text index by field for collection
|
|
95
|
+
*/
|
|
96
|
+
createTextIndex(requestParameters: CreateTextIndexRequest, initOverrides?: RequestInit): Promise<IndexCreateResponse>;
|
|
97
|
+
/**
|
|
98
|
+
* Create Unique Index by Field for given Collection
|
|
99
|
+
* Create Unique Index
|
|
100
|
+
*/
|
|
101
|
+
createUniqueIndexRaw(requestParameters: CreateUniqueIndexRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<IndexCreateResponse>>;
|
|
102
|
+
/**
|
|
103
|
+
* Create Unique Index by Field for given Collection
|
|
104
|
+
* Create Unique Index
|
|
105
|
+
*/
|
|
106
|
+
createUniqueIndex(requestParameters: CreateUniqueIndexRequest, initOverrides?: RequestInit): Promise<IndexCreateResponse>;
|
|
107
|
+
/**
|
|
108
|
+
* Delete Index by Name for given Collection
|
|
109
|
+
* Delete Index
|
|
110
|
+
*/
|
|
111
|
+
deleteIndexRaw(requestParameters: DeleteIndexRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<IndexDropResponse>>;
|
|
112
|
+
/**
|
|
113
|
+
* Delete Index by Name for given Collection
|
|
114
|
+
* Delete Index
|
|
115
|
+
*/
|
|
116
|
+
deleteIndex(requestParameters: DeleteIndexRequest, initOverrides?: RequestInit): Promise<IndexDropResponse>;
|
|
117
|
+
/**
|
|
118
|
+
* Index by Name for given Collection
|
|
119
|
+
* Index for Collection
|
|
120
|
+
*/
|
|
121
|
+
indexRaw(requestParameters: IndexRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<MongoIndex>>;
|
|
122
|
+
/**
|
|
123
|
+
* Index by Name for given Collection
|
|
124
|
+
* Index for Collection
|
|
125
|
+
*/
|
|
126
|
+
index(requestParameters: IndexRequest, initOverrides?: RequestInit): Promise<MongoIndex>;
|
|
127
|
+
/**
|
|
128
|
+
* List all Indices for given Collection
|
|
129
|
+
* List Indices for Collection
|
|
130
|
+
*/
|
|
131
|
+
listIndicesRaw(requestParameters: ListIndicesRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Array<MongoIndex>>>;
|
|
132
|
+
/**
|
|
133
|
+
* List all Indices for given Collection
|
|
134
|
+
* List Indices for Collection
|
|
135
|
+
*/
|
|
136
|
+
listIndices(requestParameters: ListIndicesRequest, initOverrides?: RequestInit): Promise<Array<MongoIndex>>;
|
|
137
|
+
}
|