@sfxcode/nuxt-mongocamp-server 1.0.4 → 1.0.5
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/module.d.ts +9 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +553 -4
- package/dist/runtime/api/apis/AdminApi.d.ts +181 -0
- package/dist/runtime/api/apis/AdminApi.mjs +509 -0
- package/dist/runtime/api/apis/ApplicationApi.d.ts +65 -0
- package/dist/runtime/api/apis/ApplicationApi.mjs +164 -0
- package/dist/runtime/api/apis/AuthApi.d.ts +104 -0
- package/dist/runtime/api/apis/AuthApi.mjs +296 -0
- package/dist/runtime/api/apis/BucketApi.d.ts +67 -0
- package/dist/runtime/api/apis/BucketApi.mjs +160 -0
- package/dist/runtime/api/apis/CollectionApi.d.ts +161 -0
- package/dist/runtime/api/apis/CollectionApi.mjs +435 -0
- package/dist/runtime/api/apis/DatabaseApi.d.ts +77 -0
- package/dist/runtime/api/apis/DatabaseApi.mjs +196 -0
- package/dist/runtime/api/apis/DocumentApi.d.ts +188 -0
- package/dist/runtime/api/apis/DocumentApi.mjs +465 -0
- package/dist/runtime/api/apis/FileApi.d.ts +125 -0
- package/dist/runtime/api/apis/FileApi.mjs +355 -0
- package/dist/runtime/api/apis/IndexApi.d.ts +137 -0
- package/dist/runtime/api/apis/IndexApi.mjs +367 -0
- package/dist/runtime/api/apis/InformationApi.d.ts +28 -0
- package/dist/runtime/api/apis/InformationApi.mjs +29 -0
- package/dist/runtime/api/apis/JobsApi.d.ts +94 -0
- package/dist/runtime/api/apis/JobsApi.mjs +252 -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 +49 -0
- package/dist/runtime/api/models/BucketInformation.mjs +36 -0
- package/dist/runtime/api/models/CollectionStatus.d.ts +107 -0
- package/dist/runtime/api/models/CollectionStatus.mjs +63 -0
- package/dist/runtime/api/models/DatabaseInfo.d.ts +57 -0
- package/dist/runtime/api/models/DatabaseInfo.mjs +39 -0
- package/dist/runtime/api/models/DeleteResponse.d.ts +37 -0
- package/dist/runtime/api/models/DeleteResponse.mjs +30 -0
- package/dist/runtime/api/models/ErrorDescription.d.ts +43 -0
- package/dist/runtime/api/models/ErrorDescription.mjs +33 -0
- package/dist/runtime/api/models/FileInformation.d.ts +63 -0
- package/dist/runtime/api/models/FileInformation.mjs +42 -0
- package/dist/runtime/api/models/Grant.d.ts +55 -0
- package/dist/runtime/api/models/Grant.mjs +39 -0
- package/dist/runtime/api/models/IndexCreateRequest.d.ts +40 -0
- package/dist/runtime/api/models/IndexCreateRequest.mjs +34 -0
- package/dist/runtime/api/models/IndexCreateResponse.d.ts +31 -0
- package/dist/runtime/api/models/IndexCreateResponse.mjs +27 -0
- package/dist/runtime/api/models/IndexDropResponse.d.ts +31 -0
- package/dist/runtime/api/models/IndexDropResponse.mjs +27 -0
- package/dist/runtime/api/models/IndexOptionsRequest.d.ts +73 -0
- package/dist/runtime/api/models/IndexOptionsRequest.mjs +41 -0
- package/dist/runtime/api/models/InsertResponse.d.ts +37 -0
- package/dist/runtime/api/models/InsertResponse.mjs +30 -0
- package/dist/runtime/api/models/JobConfig.d.ts +61 -0
- package/dist/runtime/api/models/JobConfig.mjs +42 -0
- package/dist/runtime/api/models/JobInformation.d.ts +79 -0
- package/dist/runtime/api/models/JobInformation.mjs +49 -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 +46 -0
- package/dist/runtime/api/models/JsonSchema.mjs +38 -0
- package/dist/runtime/api/models/JsonSchemaDefinition.d.ts +59 -0
- package/dist/runtime/api/models/JsonSchemaDefinition.mjs +39 -0
- package/dist/runtime/api/models/JsonValueAny.d.ts +31 -0
- package/dist/runtime/api/models/JsonValueAny.mjs +27 -0
- package/dist/runtime/api/models/JsonValueBoolean.d.ts +31 -0
- package/dist/runtime/api/models/JsonValueBoolean.mjs +27 -0
- package/dist/runtime/api/models/JsonValueString.d.ts +31 -0
- package/dist/runtime/api/models/JsonValueString.mjs +27 -0
- package/dist/runtime/api/models/Login.d.ts +37 -0
- package/dist/runtime/api/models/Login.mjs +30 -0
- package/dist/runtime/api/models/LoginResult.d.ts +44 -0
- package/dist/runtime/api/models/LoginResult.mjs +37 -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 +38 -0
- package/dist/runtime/api/models/MongoAggregateRequest.mjs +34 -0
- package/dist/runtime/api/models/MongoCampConfiguration.d.ts +55 -0
- package/dist/runtime/api/models/MongoCampConfiguration.mjs +39 -0
- package/dist/runtime/api/models/MongoFindRequest.d.ts +49 -0
- package/dist/runtime/api/models/MongoFindRequest.mjs +33 -0
- package/dist/runtime/api/models/MongoIndex.d.ts +103 -0
- package/dist/runtime/api/models/MongoIndex.mjs +60 -0
- package/dist/runtime/api/models/PasswordUpdateRequest.d.ts +31 -0
- package/dist/runtime/api/models/PasswordUpdateRequest.mjs +27 -0
- package/dist/runtime/api/models/PipelineStage.d.ts +37 -0
- package/dist/runtime/api/models/PipelineStage.mjs +30 -0
- package/dist/runtime/api/models/Role.d.ts +44 -0
- package/dist/runtime/api/models/Role.mjs +37 -0
- package/dist/runtime/api/models/SchemaAnalysis.d.ts +50 -0
- package/dist/runtime/api/models/SchemaAnalysis.mjs +40 -0
- package/dist/runtime/api/models/SchemaAnalysisField.d.ts +62 -0
- package/dist/runtime/api/models/SchemaAnalysisField.mjs +45 -0
- package/dist/runtime/api/models/SchemaAnalysisFieldType.d.ts +43 -0
- package/dist/runtime/api/models/SchemaAnalysisFieldType.mjs +33 -0
- package/dist/runtime/api/models/SettingsResponse.d.ts +51 -0
- package/dist/runtime/api/models/SettingsResponse.mjs +34 -0
- package/dist/runtime/api/models/UpdateFileInformationRequest.d.ts +39 -0
- package/dist/runtime/api/models/UpdateFileInformationRequest.mjs +29 -0
- package/dist/runtime/api/models/UpdateRequest.d.ts +41 -0
- package/dist/runtime/api/models/UpdateRequest.mjs +30 -0
- package/dist/runtime/api/models/UpdateResponse.d.ts +49 -0
- package/dist/runtime/api/models/UpdateResponse.mjs +36 -0
- package/dist/runtime/api/models/UpdateRoleRequest.d.ts +38 -0
- package/dist/runtime/api/models/UpdateRoleRequest.mjs +34 -0
- package/dist/runtime/api/models/UserInformation.d.ts +49 -0
- package/dist/runtime/api/models/UserInformation.mjs +35 -0
- package/dist/runtime/api/models/UserProfile.d.ts +56 -0
- package/dist/runtime/api/models/UserProfile.mjs +41 -0
- package/dist/runtime/api/models/Version.d.ts +43 -0
- package/dist/runtime/api/models/Version.mjs +33 -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 +182 -0
- package/dist/runtime/api/runtime.mjs +281 -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 +8 -0
- package/dist/runtime/composables/mongocampAuth.mjs +28 -0
- package/dist/runtime/composables/mongocampSearch.d.ts +11 -0
- package/dist/runtime/composables/mongocampSearch.mjs +20 -0
- package/dist/runtime/composables/mongocampStorage.d.ts +0 -0
- package/dist/runtime/composables/mongocampStorage.mjs +5 -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 +4 -0
- package/dist/types.d.ts +2 -8
- package/package.json +4 -3
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import * as runtime from "../runtime.mjs";
|
|
2
|
+
import {
|
|
3
|
+
DeleteResponseFromJSON,
|
|
4
|
+
FileInformationFromJSON,
|
|
5
|
+
InsertResponseFromJSON,
|
|
6
|
+
MongoFindRequestToJSON,
|
|
7
|
+
UpdateFileInformationRequestToJSON,
|
|
8
|
+
UpdateResponseFromJSON
|
|
9
|
+
} from "../models/index.mjs";
|
|
10
|
+
export class FileApi extends runtime.BaseAPI {
|
|
11
|
+
/**
|
|
12
|
+
* Delete one File from given Bucket
|
|
13
|
+
* Delete File from Bucket
|
|
14
|
+
*/
|
|
15
|
+
async deleteFileRaw(requestParameters, initOverrides) {
|
|
16
|
+
if (requestParameters.bucketName === null || requestParameters.bucketName === void 0) {
|
|
17
|
+
throw new runtime.RequiredError("bucketName", "Required parameter requestParameters.bucketName was null or undefined when calling deleteFile.");
|
|
18
|
+
}
|
|
19
|
+
if (requestParameters.fileId === null || requestParameters.fileId === void 0) {
|
|
20
|
+
throw new runtime.RequiredError("fileId", "Required parameter requestParameters.fileId was null or undefined when calling deleteFile.");
|
|
21
|
+
}
|
|
22
|
+
const queryParameters = {};
|
|
23
|
+
const headerParameters = {};
|
|
24
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
25
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
26
|
+
}
|
|
27
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
28
|
+
const token = this.configuration.accessToken;
|
|
29
|
+
const tokenString = await token("httpAuth", []);
|
|
30
|
+
if (tokenString) {
|
|
31
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
35
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
36
|
+
}
|
|
37
|
+
const response = await this.request({
|
|
38
|
+
path: `/mongodb/buckets/{bucketName}/files/{fileId}`.replace(`{${"bucketName"}}`, encodeURIComponent(String(requestParameters.bucketName))).replace(`{${"fileId"}}`, encodeURIComponent(String(requestParameters.fileId))),
|
|
39
|
+
method: "DELETE",
|
|
40
|
+
headers: headerParameters,
|
|
41
|
+
query: queryParameters
|
|
42
|
+
}, initOverrides);
|
|
43
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => DeleteResponseFromJSON(jsonValue));
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Delete one File from given Bucket
|
|
47
|
+
* Delete File from Bucket
|
|
48
|
+
*/
|
|
49
|
+
async deleteFile(requestParameters, initOverrides) {
|
|
50
|
+
const response = await this.deleteFileRaw(requestParameters, initOverrides);
|
|
51
|
+
return await response.value();
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Alternative to GET Route for more complex queries and URL max. Length
|
|
55
|
+
* Files in Bucket
|
|
56
|
+
*/
|
|
57
|
+
async findFilesRaw(requestParameters, initOverrides) {
|
|
58
|
+
if (requestParameters.bucketName === null || requestParameters.bucketName === void 0) {
|
|
59
|
+
throw new runtime.RequiredError("bucketName", "Required parameter requestParameters.bucketName was null or undefined when calling findFiles.");
|
|
60
|
+
}
|
|
61
|
+
if (requestParameters.mongoFindRequest === null || requestParameters.mongoFindRequest === void 0) {
|
|
62
|
+
throw new runtime.RequiredError("mongoFindRequest", "Required parameter requestParameters.mongoFindRequest was null or undefined when calling findFiles.");
|
|
63
|
+
}
|
|
64
|
+
const queryParameters = {};
|
|
65
|
+
if (requestParameters.rowsPerPage !== void 0) {
|
|
66
|
+
queryParameters["rowsPerPage"] = requestParameters.rowsPerPage;
|
|
67
|
+
}
|
|
68
|
+
if (requestParameters.page !== void 0) {
|
|
69
|
+
queryParameters["page"] = requestParameters.page;
|
|
70
|
+
}
|
|
71
|
+
const headerParameters = {};
|
|
72
|
+
headerParameters["Content-Type"] = "application/json";
|
|
73
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
74
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
75
|
+
}
|
|
76
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
77
|
+
const token = this.configuration.accessToken;
|
|
78
|
+
const tokenString = await token("httpAuth", []);
|
|
79
|
+
if (tokenString) {
|
|
80
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
84
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
85
|
+
}
|
|
86
|
+
const response = await this.request({
|
|
87
|
+
path: `/mongodb/buckets/{bucketName}/files`.replace(`{${"bucketName"}}`, encodeURIComponent(String(requestParameters.bucketName))),
|
|
88
|
+
method: "POST",
|
|
89
|
+
headers: headerParameters,
|
|
90
|
+
query: queryParameters,
|
|
91
|
+
body: MongoFindRequestToJSON(requestParameters.mongoFindRequest)
|
|
92
|
+
}, initOverrides);
|
|
93
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(FileInformationFromJSON));
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Alternative to GET Route for more complex queries and URL max. Length
|
|
97
|
+
* Files in Bucket
|
|
98
|
+
*/
|
|
99
|
+
async findFiles(requestParameters, initOverrides) {
|
|
100
|
+
const response = await this.findFilesRaw(requestParameters, initOverrides);
|
|
101
|
+
return await response.value();
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Get File from given Bucket
|
|
105
|
+
* File from Bucket
|
|
106
|
+
*/
|
|
107
|
+
async getFileRaw(requestParameters, initOverrides) {
|
|
108
|
+
if (requestParameters.bucketName === null || requestParameters.bucketName === void 0) {
|
|
109
|
+
throw new runtime.RequiredError("bucketName", "Required parameter requestParameters.bucketName was null or undefined when calling getFile.");
|
|
110
|
+
}
|
|
111
|
+
if (requestParameters.fileId === null || requestParameters.fileId === void 0) {
|
|
112
|
+
throw new runtime.RequiredError("fileId", "Required parameter requestParameters.fileId was null or undefined when calling getFile.");
|
|
113
|
+
}
|
|
114
|
+
const queryParameters = {};
|
|
115
|
+
const headerParameters = {};
|
|
116
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
117
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
118
|
+
}
|
|
119
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
120
|
+
const token = this.configuration.accessToken;
|
|
121
|
+
const tokenString = await token("httpAuth", []);
|
|
122
|
+
if (tokenString) {
|
|
123
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
127
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
128
|
+
}
|
|
129
|
+
const response = await this.request({
|
|
130
|
+
path: `/mongodb/buckets/{bucketName}/files/{fileId}/file`.replace(`{${"bucketName"}}`, encodeURIComponent(String(requestParameters.bucketName))).replace(`{${"fileId"}}`, encodeURIComponent(String(requestParameters.fileId))),
|
|
131
|
+
method: "GET",
|
|
132
|
+
headers: headerParameters,
|
|
133
|
+
query: queryParameters
|
|
134
|
+
}, initOverrides);
|
|
135
|
+
return new runtime.BlobApiResponse(response);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Get File from given Bucket
|
|
139
|
+
* File from Bucket
|
|
140
|
+
*/
|
|
141
|
+
async getFile(requestParameters, initOverrides) {
|
|
142
|
+
const response = await this.getFileRaw(requestParameters, initOverrides);
|
|
143
|
+
return await response.value();
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Get one FileInformation from given Bucket
|
|
147
|
+
* FileInformation from Bucket
|
|
148
|
+
*/
|
|
149
|
+
async getFileInformationRaw(requestParameters, initOverrides) {
|
|
150
|
+
if (requestParameters.bucketName === null || requestParameters.bucketName === void 0) {
|
|
151
|
+
throw new runtime.RequiredError("bucketName", "Required parameter requestParameters.bucketName was null or undefined when calling getFileInformation.");
|
|
152
|
+
}
|
|
153
|
+
if (requestParameters.fileId === null || requestParameters.fileId === void 0) {
|
|
154
|
+
throw new runtime.RequiredError("fileId", "Required parameter requestParameters.fileId was null or undefined when calling getFileInformation.");
|
|
155
|
+
}
|
|
156
|
+
const queryParameters = {};
|
|
157
|
+
const headerParameters = {};
|
|
158
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
159
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
160
|
+
}
|
|
161
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
162
|
+
const token = this.configuration.accessToken;
|
|
163
|
+
const tokenString = await token("httpAuth", []);
|
|
164
|
+
if (tokenString) {
|
|
165
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
169
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
170
|
+
}
|
|
171
|
+
const response = await this.request({
|
|
172
|
+
path: `/mongodb/buckets/{bucketName}/files/{fileId}`.replace(`{${"bucketName"}}`, encodeURIComponent(String(requestParameters.bucketName))).replace(`{${"fileId"}}`, encodeURIComponent(String(requestParameters.fileId))),
|
|
173
|
+
method: "GET",
|
|
174
|
+
headers: headerParameters,
|
|
175
|
+
query: queryParameters
|
|
176
|
+
}, initOverrides);
|
|
177
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => FileInformationFromJSON(jsonValue));
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Get one FileInformation from given Bucket
|
|
181
|
+
* FileInformation from Bucket
|
|
182
|
+
*/
|
|
183
|
+
async getFileInformation(requestParameters, initOverrides) {
|
|
184
|
+
const response = await this.getFileInformationRaw(requestParameters, initOverrides);
|
|
185
|
+
return await response.value();
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Insert one File in given Bucket
|
|
189
|
+
* Insert File
|
|
190
|
+
*/
|
|
191
|
+
async insertFileRaw(requestParameters, initOverrides) {
|
|
192
|
+
if (requestParameters.bucketName === null || requestParameters.bucketName === void 0) {
|
|
193
|
+
throw new runtime.RequiredError("bucketName", "Required parameter requestParameters.bucketName was null or undefined when calling insertFile.");
|
|
194
|
+
}
|
|
195
|
+
if (requestParameters.file === null || requestParameters.file === void 0) {
|
|
196
|
+
throw new runtime.RequiredError("file", "Required parameter requestParameters.file was null or undefined when calling insertFile.");
|
|
197
|
+
}
|
|
198
|
+
if (requestParameters.metaData === null || requestParameters.metaData === void 0) {
|
|
199
|
+
throw new runtime.RequiredError("metaData", "Required parameter requestParameters.metaData was null or undefined when calling insertFile.");
|
|
200
|
+
}
|
|
201
|
+
const queryParameters = {};
|
|
202
|
+
if (requestParameters.fileName !== void 0) {
|
|
203
|
+
queryParameters["fileName"] = requestParameters.fileName;
|
|
204
|
+
}
|
|
205
|
+
const headerParameters = {};
|
|
206
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
207
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
208
|
+
}
|
|
209
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
210
|
+
const token = this.configuration.accessToken;
|
|
211
|
+
const tokenString = await token("httpAuth", []);
|
|
212
|
+
if (tokenString) {
|
|
213
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
217
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
218
|
+
}
|
|
219
|
+
const consumes = [
|
|
220
|
+
{ contentType: "multipart/form-data" }
|
|
221
|
+
];
|
|
222
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
223
|
+
let formParams;
|
|
224
|
+
let useForm = false;
|
|
225
|
+
useForm = canConsumeForm;
|
|
226
|
+
if (useForm) {
|
|
227
|
+
formParams = new FormData();
|
|
228
|
+
} else {
|
|
229
|
+
formParams = new URLSearchParams();
|
|
230
|
+
}
|
|
231
|
+
if (requestParameters.file !== void 0) {
|
|
232
|
+
formParams.append("file", requestParameters.file);
|
|
233
|
+
}
|
|
234
|
+
if (requestParameters.metaData !== void 0) {
|
|
235
|
+
formParams.append("metaData", requestParameters.metaData);
|
|
236
|
+
}
|
|
237
|
+
const response = await this.request({
|
|
238
|
+
path: `/mongodb/buckets/{bucketName}/files`.replace(`{${"bucketName"}}`, encodeURIComponent(String(requestParameters.bucketName))),
|
|
239
|
+
method: "PUT",
|
|
240
|
+
headers: headerParameters,
|
|
241
|
+
query: queryParameters,
|
|
242
|
+
body: formParams
|
|
243
|
+
}, initOverrides);
|
|
244
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => InsertResponseFromJSON(jsonValue));
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Insert one File in given Bucket
|
|
248
|
+
* Insert File
|
|
249
|
+
*/
|
|
250
|
+
async insertFile(requestParameters, initOverrides) {
|
|
251
|
+
const response = await this.insertFileRaw(requestParameters, initOverrides);
|
|
252
|
+
return await response.value();
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Get Files paginated from given Bucket
|
|
256
|
+
* Files in Bucket
|
|
257
|
+
*/
|
|
258
|
+
async listFilesRaw(requestParameters, initOverrides) {
|
|
259
|
+
if (requestParameters.bucketName === null || requestParameters.bucketName === void 0) {
|
|
260
|
+
throw new runtime.RequiredError("bucketName", "Required parameter requestParameters.bucketName was null or undefined when calling listFiles.");
|
|
261
|
+
}
|
|
262
|
+
const queryParameters = {};
|
|
263
|
+
if (requestParameters.filter !== void 0) {
|
|
264
|
+
queryParameters["filter"] = requestParameters.filter;
|
|
265
|
+
}
|
|
266
|
+
if (requestParameters.sort !== void 0) {
|
|
267
|
+
queryParameters["sort"] = requestParameters.sort;
|
|
268
|
+
}
|
|
269
|
+
if (requestParameters.projection !== void 0) {
|
|
270
|
+
queryParameters["projection"] = requestParameters.projection;
|
|
271
|
+
}
|
|
272
|
+
if (requestParameters.rowsPerPage !== void 0) {
|
|
273
|
+
queryParameters["rowsPerPage"] = requestParameters.rowsPerPage;
|
|
274
|
+
}
|
|
275
|
+
if (requestParameters.page !== void 0) {
|
|
276
|
+
queryParameters["page"] = requestParameters.page;
|
|
277
|
+
}
|
|
278
|
+
const headerParameters = {};
|
|
279
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
280
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
281
|
+
}
|
|
282
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
283
|
+
const token = this.configuration.accessToken;
|
|
284
|
+
const tokenString = await token("httpAuth", []);
|
|
285
|
+
if (tokenString) {
|
|
286
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
290
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
291
|
+
}
|
|
292
|
+
const response = await this.request({
|
|
293
|
+
path: `/mongodb/buckets/{bucketName}/files`.replace(`{${"bucketName"}}`, encodeURIComponent(String(requestParameters.bucketName))),
|
|
294
|
+
method: "GET",
|
|
295
|
+
headers: headerParameters,
|
|
296
|
+
query: queryParameters
|
|
297
|
+
}, initOverrides);
|
|
298
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(FileInformationFromJSON));
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Get Files paginated from given Bucket
|
|
302
|
+
* Files in Bucket
|
|
303
|
+
*/
|
|
304
|
+
async listFiles(requestParameters, initOverrides) {
|
|
305
|
+
const response = await this.listFilesRaw(requestParameters, initOverrides);
|
|
306
|
+
return await response.value();
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Replace MetaData and potential update FileName
|
|
310
|
+
* Update FileInformation in Bucket
|
|
311
|
+
*/
|
|
312
|
+
async updateFileInformationRaw(requestParameters, initOverrides) {
|
|
313
|
+
if (requestParameters.bucketName === null || requestParameters.bucketName === void 0) {
|
|
314
|
+
throw new runtime.RequiredError("bucketName", "Required parameter requestParameters.bucketName was null or undefined when calling updateFileInformation.");
|
|
315
|
+
}
|
|
316
|
+
if (requestParameters.fileId === null || requestParameters.fileId === void 0) {
|
|
317
|
+
throw new runtime.RequiredError("fileId", "Required parameter requestParameters.fileId was null or undefined when calling updateFileInformation.");
|
|
318
|
+
}
|
|
319
|
+
if (requestParameters.updateFileInformationRequest === null || requestParameters.updateFileInformationRequest === void 0) {
|
|
320
|
+
throw new runtime.RequiredError("updateFileInformationRequest", "Required parameter requestParameters.updateFileInformationRequest was null or undefined when calling updateFileInformation.");
|
|
321
|
+
}
|
|
322
|
+
const queryParameters = {};
|
|
323
|
+
const headerParameters = {};
|
|
324
|
+
headerParameters["Content-Type"] = "application/json";
|
|
325
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
326
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
327
|
+
}
|
|
328
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
329
|
+
const token = this.configuration.accessToken;
|
|
330
|
+
const tokenString = await token("httpAuth", []);
|
|
331
|
+
if (tokenString) {
|
|
332
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
336
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
337
|
+
}
|
|
338
|
+
const response = await this.request({
|
|
339
|
+
path: `/mongodb/buckets/{bucketName}/files/{fileId}`.replace(`{${"bucketName"}}`, encodeURIComponent(String(requestParameters.bucketName))).replace(`{${"fileId"}}`, encodeURIComponent(String(requestParameters.fileId))),
|
|
340
|
+
method: "PATCH",
|
|
341
|
+
headers: headerParameters,
|
|
342
|
+
query: queryParameters,
|
|
343
|
+
body: UpdateFileInformationRequestToJSON(requestParameters.updateFileInformationRequest)
|
|
344
|
+
}, initOverrides);
|
|
345
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => UpdateResponseFromJSON(jsonValue));
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Replace MetaData and potential update FileName
|
|
349
|
+
* Update FileInformation in Bucket
|
|
350
|
+
*/
|
|
351
|
+
async updateFileInformation(requestParameters, initOverrides) {
|
|
352
|
+
const response = await this.updateFileInformationRaw(requestParameters, initOverrides);
|
|
353
|
+
return await response.value();
|
|
354
|
+
}
|
|
355
|
+
}
|
|
@@ -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.4.2
|
|
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 type { 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 | runtime.InitOverrideFunction): 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 | runtime.InitOverrideFunction): Promise<IndexCreateResponse>;
|
|
67
|
+
/**
|
|
68
|
+
* Create Index for given Collection
|
|
69
|
+
* Create Index for Collection
|
|
70
|
+
*/
|
|
71
|
+
createIndexRaw(requestParameters: CreateIndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IndexCreateResponse>>;
|
|
72
|
+
/**
|
|
73
|
+
* Create Index for given Collection
|
|
74
|
+
* Create Index for Collection
|
|
75
|
+
*/
|
|
76
|
+
createIndex(requestParameters: CreateIndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): 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 | runtime.InitOverrideFunction): 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 | runtime.InitOverrideFunction): 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 | runtime.InitOverrideFunction): 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 | runtime.InitOverrideFunction): Promise<IndexCreateResponse>;
|
|
97
|
+
/**
|
|
98
|
+
* Create Unique Index by Field for given Collection
|
|
99
|
+
* Create Unique Index
|
|
100
|
+
*/
|
|
101
|
+
createUniqueIndexRaw(requestParameters: CreateUniqueIndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): 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 | runtime.InitOverrideFunction): Promise<IndexCreateResponse>;
|
|
107
|
+
/**
|
|
108
|
+
* Delete Index by Name for given Collection
|
|
109
|
+
* Delete Index
|
|
110
|
+
*/
|
|
111
|
+
deleteIndexRaw(requestParameters: DeleteIndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IndexDropResponse>>;
|
|
112
|
+
/**
|
|
113
|
+
* Delete Index by Name for given Collection
|
|
114
|
+
* Delete Index
|
|
115
|
+
*/
|
|
116
|
+
deleteIndex(requestParameters: DeleteIndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IndexDropResponse>;
|
|
117
|
+
/**
|
|
118
|
+
* Index by Name for given Collection
|
|
119
|
+
* Index for Collection
|
|
120
|
+
*/
|
|
121
|
+
indexRaw(requestParameters: IndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MongoIndex>>;
|
|
122
|
+
/**
|
|
123
|
+
* Index by Name for given Collection
|
|
124
|
+
* Index for Collection
|
|
125
|
+
*/
|
|
126
|
+
index(requestParameters: IndexRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MongoIndex>;
|
|
127
|
+
/**
|
|
128
|
+
* List all Indices for given Collection
|
|
129
|
+
* List Indices for Collection
|
|
130
|
+
*/
|
|
131
|
+
listIndicesRaw(requestParameters: ListIndicesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): 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 | runtime.InitOverrideFunction): Promise<Array<MongoIndex>>;
|
|
137
|
+
}
|