@sfxcode/nuxt-mongocamp-server 1.7.0 → 1.9.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 +8 -0
- package/dist/module.json +2 -2
- package/dist/module.mjs +1 -1
- package/dist/runtime/api/.openapi-generator/FILES +18 -0
- package/dist/runtime/api/.openapi-generator/VERSION +1 -1
- package/dist/runtime/api/apis/AdminApi.d.ts +65 -2
- package/dist/runtime/api/apis/AdminApi.js +39 -27
- package/dist/runtime/api/apis/ApplicationApi.d.ts +17 -2
- package/dist/runtime/api/apis/ApplicationApi.js +17 -11
- package/dist/runtime/api/apis/AuthApi.d.ts +17 -2
- package/dist/runtime/api/apis/AuthApi.js +27 -15
- package/dist/runtime/api/apis/BucketApi.d.ts +12 -2
- package/dist/runtime/api/apis/BucketApi.js +11 -9
- package/dist/runtime/api/apis/CollectionApi.d.ts +163 -4
- package/dist/runtime/api/apis/CollectionApi.js +230 -27
- package/dist/runtime/api/apis/DatabaseApi.d.ts +12 -2
- package/dist/runtime/api/apis/DatabaseApi.js +12 -10
- package/dist/runtime/api/apis/DocumentApi.d.ts +223 -15
- package/dist/runtime/api/apis/DocumentApi.js +194 -35
- package/dist/runtime/api/apis/FileApi.d.ts +78 -4
- package/dist/runtime/api/apis/FileApi.js +34 -24
- package/dist/runtime/api/apis/IndexApi.d.ts +100 -2
- package/dist/runtime/api/apis/IndexApi.js +95 -31
- package/dist/runtime/api/apis/JobsApi.d.ts +28 -2
- package/dist/runtime/api/apis/JobsApi.js +19 -15
- package/dist/runtime/api/apis/SystemApi.d.ts +3 -2
- package/dist/runtime/api/apis/SystemApi.js +5 -3
- package/dist/runtime/api/docs/CollectionApi.md +254 -2
- package/dist/runtime/api/docs/CollectionStatus.md +1 -1
- package/dist/runtime/api/docs/CopyRequest.md +40 -0
- package/dist/runtime/api/docs/CopyResponse.md +38 -0
- package/dist/runtime/api/docs/DatabaseInfo.md +1 -1
- package/dist/runtime/api/docs/DocumentApi.md +210 -19
- package/dist/runtime/api/docs/FieldInfo.md +36 -0
- package/dist/runtime/api/docs/FieldTypeCount.md +36 -0
- package/dist/runtime/api/docs/FileInformation.md +1 -1
- package/dist/runtime/api/docs/ImportResponse.md +42 -0
- package/dist/runtime/api/docs/IndexApi.md +78 -0
- package/dist/runtime/api/docs/IndexCreateRequest.md +2 -0
- package/dist/runtime/api/docs/IndexInfo.md +54 -0
- package/dist/runtime/api/docs/IndexKey.md +36 -0
- package/dist/runtime/api/docs/IndexOptionsRequest.md +10 -0
- package/dist/runtime/api/docs/IndexUsage.md +1 -1
- package/dist/runtime/api/docs/JsonSchemaDefinition.md +1 -1
- package/dist/runtime/api/docs/MongoFindRequest.md +3 -3
- package/dist/runtime/api/docs/MongoIndex.md +3 -3
- package/dist/runtime/api/docs/RenameRequest.md +36 -0
- package/dist/runtime/api/docs/RenameResponse.md +34 -0
- package/dist/runtime/api/docs/SettingsResponse.md +1 -1
- package/dist/runtime/api/docs/UpdateFileInformationRequest.md +1 -1
- package/dist/runtime/api/docs/UpdateRequest.md +2 -2
- package/dist/runtime/api/models/BucketInformation.d.ts +1 -9
- package/dist/runtime/api/models/ClusterInformation.d.ts +1 -5
- package/dist/runtime/api/models/ClusterMemberInformation.d.ts +1 -11
- package/dist/runtime/api/models/CollectionPermission.d.ts +1 -9
- package/dist/runtime/api/models/CollectionStatus.d.ts +2 -28
- package/dist/runtime/api/models/CollectionStatus.js +3 -2
- package/dist/runtime/api/models/CollectionSummary.d.ts +1 -19
- package/dist/runtime/api/models/CopyRequest.d.ts +42 -0
- package/dist/runtime/api/models/CopyRequest.js +32 -0
- package/dist/runtime/api/models/CopyResponse.d.ts +38 -0
- package/dist/runtime/api/models/CopyResponse.js +32 -0
- package/dist/runtime/api/models/CountResponse.d.ts +1 -3
- package/dist/runtime/api/models/DatabaseInfo.d.ts +2 -12
- package/dist/runtime/api/models/DatabaseInfo.js +3 -2
- package/dist/runtime/api/models/DeleteResponse.d.ts +1 -5
- package/dist/runtime/api/models/ErrorDescription.d.ts +1 -7
- package/dist/runtime/api/models/FieldInfo.d.ts +35 -0
- package/dist/runtime/api/models/FieldInfo.js +32 -0
- package/dist/runtime/api/models/FieldTypeCount.d.ts +34 -0
- package/dist/runtime/api/models/FieldTypeCount.js +29 -0
- package/dist/runtime/api/models/FileInformation.d.ts +2 -14
- package/dist/runtime/api/models/FileInformation.js +4 -3
- package/dist/runtime/api/models/Grant.d.ts +1 -11
- package/dist/runtime/api/models/ImportResponse.d.ts +47 -0
- package/dist/runtime/api/models/ImportResponse.js +41 -0
- package/dist/runtime/api/models/IndexCreateRequest.d.ts +7 -6
- package/dist/runtime/api/models/IndexCreateRequest.js +9 -4
- package/dist/runtime/api/models/IndexCreateResponse.d.ts +1 -3
- package/dist/runtime/api/models/IndexDropResponse.d.ts +1 -3
- package/dist/runtime/api/models/IndexInfo.d.ts +77 -0
- package/dist/runtime/api/models/IndexInfo.js +54 -0
- package/dist/runtime/api/models/IndexKey.d.ts +34 -0
- package/dist/runtime/api/models/IndexKey.js +29 -0
- package/dist/runtime/api/models/IndexOptionsRequest.d.ts +27 -17
- package/dist/runtime/api/models/IndexOptionsRequest.js +12 -2
- package/dist/runtime/api/models/IndexUsage.d.ts +2 -10
- package/dist/runtime/api/models/IndexUsage.js +3 -2
- package/dist/runtime/api/models/InsertError.d.ts +1 -7
- package/dist/runtime/api/models/InsertResponse.d.ts +1 -9
- package/dist/runtime/api/models/JobConfig.d.ts +1 -13
- package/dist/runtime/api/models/JobInformation.d.ts +1 -19
- package/dist/runtime/api/models/JobInformation.js +5 -4
- package/dist/runtime/api/models/JsonSchema.d.ts +1 -7
- package/dist/runtime/api/models/JsonSchemaDefinition.d.ts +2 -12
- package/dist/runtime/api/models/JsonValueAny.d.ts +1 -3
- package/dist/runtime/api/models/JsonValueBoolean.d.ts +1 -3
- package/dist/runtime/api/models/JsonValueString.d.ts +1 -3
- package/dist/runtime/api/models/Login.d.ts +1 -5
- package/dist/runtime/api/models/LoginResult.d.ts +1 -7
- package/dist/runtime/api/models/LoginResult.js +3 -2
- package/dist/runtime/api/models/MongoAggregateRequest.d.ts +1 -5
- package/dist/runtime/api/models/MongoCampConfiguration.d.ts +1 -11
- package/dist/runtime/api/models/MongoFindRequest.d.ts +4 -10
- package/dist/runtime/api/models/MongoIndex.d.ts +4 -28
- package/dist/runtime/api/models/MongoIndex.js +3 -2
- package/dist/runtime/api/models/PasswordUpdateRequest.d.ts +1 -3
- package/dist/runtime/api/models/PipelineStage.d.ts +1 -5
- package/dist/runtime/api/models/RenameRequest.d.ts +34 -0
- package/dist/runtime/api/models/RenameRequest.js +28 -0
- package/dist/runtime/api/models/RenameResponse.d.ts +30 -0
- package/dist/runtime/api/models/RenameResponse.js +26 -0
- package/dist/runtime/api/models/Role.d.ts +1 -7
- package/dist/runtime/api/models/SchemaAnalysis.d.ts +1 -9
- package/dist/runtime/api/models/SchemaAnalysisField.d.ts +1 -13
- package/dist/runtime/api/models/SchemaAnalysisFieldType.d.ts +1 -7
- package/dist/runtime/api/models/SearchRequest.d.ts +1 -7
- package/dist/runtime/api/models/SettingsResponse.d.ts +2 -10
- package/dist/runtime/api/models/UpdateFileInformationRequest.d.ts +2 -6
- package/dist/runtime/api/models/UpdateRequest.d.ts +3 -7
- package/dist/runtime/api/models/UpdateResponse.d.ts +1 -9
- package/dist/runtime/api/models/UpdateRoleRequest.d.ts +1 -5
- package/dist/runtime/api/models/UserInformation.d.ts +1 -9
- package/dist/runtime/api/models/UserProfile.d.ts +1 -11
- package/dist/runtime/api/models/Version.d.ts +1 -7
- package/dist/runtime/api/models/Version.js +3 -2
- package/dist/runtime/api/models/index.d.ts +9 -0
- package/dist/runtime/api/models/index.js +9 -0
- package/dist/runtime/api/runtime.d.ts +35 -2
- package/dist/runtime/api/runtime.js +84 -4
- package/dist/runtime/composables/mongocampApiFiles.d.ts +1 -1
- package/dist/runtime/composables/mongocampStorage.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
import * as runtime from "../runtime.js";
|
|
2
2
|
import {
|
|
3
|
-
CountResponseFromJSON
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
CountResponseFromJSON
|
|
4
|
+
} from "../models/CountResponse.js";
|
|
5
|
+
import {
|
|
6
|
+
DeleteResponseFromJSON
|
|
7
|
+
} from "../models/DeleteResponse.js";
|
|
8
|
+
import {
|
|
9
|
+
ImportResponseFromJSON
|
|
10
|
+
} from "../models/ImportResponse.js";
|
|
11
|
+
import {
|
|
12
|
+
InsertResponseFromJSON
|
|
13
|
+
} from "../models/InsertResponse.js";
|
|
14
|
+
import {
|
|
15
|
+
MongoFindRequestToJSON
|
|
16
|
+
} from "../models/MongoFindRequest.js";
|
|
17
|
+
import {
|
|
18
|
+
SearchRequestToJSON
|
|
19
|
+
} from "../models/SearchRequest.js";
|
|
20
|
+
import {
|
|
21
|
+
UpdateRequestToJSON
|
|
22
|
+
} from "../models/UpdateRequest.js";
|
|
23
|
+
import {
|
|
9
24
|
UpdateResponseFromJSON
|
|
10
|
-
} from "../models/
|
|
25
|
+
} from "../models/UpdateResponse.js";
|
|
11
26
|
export class DocumentApi extends runtime.BaseAPI {
|
|
12
27
|
/**
|
|
13
28
|
* Creates request options for _delete without sending the request
|
|
@@ -28,7 +43,7 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
28
43
|
const queryParameters = {};
|
|
29
44
|
const headerParameters = {};
|
|
30
45
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
31
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
46
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
32
47
|
}
|
|
33
48
|
if (this.configuration && this.configuration.accessToken) {
|
|
34
49
|
const token = this.configuration.accessToken;
|
|
@@ -41,8 +56,8 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
41
56
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
42
57
|
}
|
|
43
58
|
let urlPath = `/mongodb/collections/{collectionName}/documents/{documentId}`;
|
|
44
|
-
urlPath = urlPath.replace(
|
|
45
|
-
urlPath = urlPath.replace(
|
|
59
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
60
|
+
urlPath = urlPath.replace("{documentId}", encodeURIComponent(String(requestParameters["documentId"])));
|
|
46
61
|
return {
|
|
47
62
|
path: urlPath,
|
|
48
63
|
method: "DELETE",
|
|
@@ -83,7 +98,7 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
83
98
|
}
|
|
84
99
|
const headerParameters = {};
|
|
85
100
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
86
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
101
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
87
102
|
}
|
|
88
103
|
if (this.configuration && this.configuration.accessToken) {
|
|
89
104
|
const token = this.configuration.accessToken;
|
|
@@ -96,7 +111,7 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
96
111
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
97
112
|
}
|
|
98
113
|
let urlPath = `/mongodb/collections/{collectionName}/documents/count`;
|
|
99
|
-
urlPath = urlPath.replace(
|
|
114
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
100
115
|
return {
|
|
101
116
|
path: urlPath,
|
|
102
117
|
method: "GET",
|
|
@@ -147,7 +162,7 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
147
162
|
const headerParameters = {};
|
|
148
163
|
headerParameters["Content-Type"] = "application/json";
|
|
149
164
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
150
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
165
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
151
166
|
}
|
|
152
167
|
if (this.configuration && this.configuration.accessToken) {
|
|
153
168
|
const token = this.configuration.accessToken;
|
|
@@ -160,7 +175,7 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
160
175
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
161
176
|
}
|
|
162
177
|
let urlPath = `/mongodb/collections/{collectionName}/documents/many/delete`;
|
|
163
|
-
urlPath = urlPath.replace(
|
|
178
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
164
179
|
return {
|
|
165
180
|
path: urlPath,
|
|
166
181
|
method: "DELETE",
|
|
@@ -186,6 +201,79 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
186
201
|
const response = await this.deleteManyRaw(requestParameters, initOverrides);
|
|
187
202
|
return await response.value();
|
|
188
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* Creates request options for exportDocuments without sending the request
|
|
206
|
+
*/
|
|
207
|
+
async exportDocumentsRequestOpts(requestParameters) {
|
|
208
|
+
if (requestParameters["collectionName"] == null) {
|
|
209
|
+
throw new runtime.RequiredError(
|
|
210
|
+
"collectionName",
|
|
211
|
+
'Required parameter "collectionName" was null or undefined when calling exportDocuments().'
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
const queryParameters = {};
|
|
215
|
+
if (requestParameters["format"] != null) {
|
|
216
|
+
queryParameters["format"] = requestParameters["format"];
|
|
217
|
+
}
|
|
218
|
+
if (requestParameters["filter"] != null) {
|
|
219
|
+
queryParameters["filter"] = requestParameters["filter"];
|
|
220
|
+
}
|
|
221
|
+
if (requestParameters["sort"] != null) {
|
|
222
|
+
queryParameters["sort"] = requestParameters["sort"];
|
|
223
|
+
}
|
|
224
|
+
if (requestParameters["projection"] != null) {
|
|
225
|
+
queryParameters["projection"] = requestParameters["projection"];
|
|
226
|
+
}
|
|
227
|
+
if (requestParameters["limit"] != null) {
|
|
228
|
+
queryParameters["limit"] = requestParameters["limit"];
|
|
229
|
+
}
|
|
230
|
+
if (requestParameters["extendedJson"] != null) {
|
|
231
|
+
queryParameters["extendedJson"] = requestParameters["extendedJson"];
|
|
232
|
+
}
|
|
233
|
+
const headerParameters = {};
|
|
234
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
235
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
236
|
+
}
|
|
237
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
238
|
+
const token = this.configuration.accessToken;
|
|
239
|
+
const tokenString = await token("httpAuth", []);
|
|
240
|
+
if (tokenString) {
|
|
241
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
245
|
+
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
246
|
+
}
|
|
247
|
+
let urlPath = `/mongodb/collections/{collectionName}/documents/export`;
|
|
248
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
249
|
+
return {
|
|
250
|
+
path: urlPath,
|
|
251
|
+
method: "GET",
|
|
252
|
+
headers: headerParameters,
|
|
253
|
+
query: queryParameters
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Download the documents of a Collection as a stream: ndjson (one JSON document per line), json (one array) or csv (a header line, nested values as JSON, a text with a comma, a quote or a line break in quotes). The documents are written while the database delivers them, the memory of the server does not depend on the size of the Collection. The columns of a csv export are the fields of `projection`, by default the fields of the first 1000 documents. With extendedJson the types of the values are explicit. A failure while the stream is running ends the stream, the status is 200 by then.
|
|
258
|
+
* Export Documents of a Collection
|
|
259
|
+
*/
|
|
260
|
+
async exportDocumentsRaw(requestParameters, initOverrides) {
|
|
261
|
+
const requestOptions = await this.exportDocumentsRequestOpts(requestParameters);
|
|
262
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
263
|
+
if (this.isJsonMime(response.headers.get("content-type"))) {
|
|
264
|
+
return new runtime.JSONApiResponse(response);
|
|
265
|
+
} else {
|
|
266
|
+
return new runtime.TextApiResponse(response);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Download the documents of a Collection as a stream: ndjson (one JSON document per line), json (one array) or csv (a header line, nested values as JSON, a text with a comma, a quote or a line break in quotes). The documents are written while the database delivers them, the memory of the server does not depend on the size of the Collection. The columns of a csv export are the fields of `projection`, by default the fields of the first 1000 documents. With extendedJson the types of the values are explicit. A failure while the stream is running ends the stream, the status is 200 by then.
|
|
271
|
+
* Export Documents of a Collection
|
|
272
|
+
*/
|
|
273
|
+
async exportDocuments(requestParameters, initOverrides) {
|
|
274
|
+
const response = await this.exportDocumentsRaw(requestParameters, initOverrides);
|
|
275
|
+
return await response.value();
|
|
276
|
+
}
|
|
189
277
|
/**
|
|
190
278
|
* Creates request options for find without sending the request
|
|
191
279
|
*/
|
|
@@ -209,10 +297,13 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
209
297
|
if (requestParameters["page"] != null) {
|
|
210
298
|
queryParameters["page"] = requestParameters["page"];
|
|
211
299
|
}
|
|
300
|
+
if (requestParameters["extendedJson"] != null) {
|
|
301
|
+
queryParameters["extendedJson"] = requestParameters["extendedJson"];
|
|
302
|
+
}
|
|
212
303
|
const headerParameters = {};
|
|
213
304
|
headerParameters["Content-Type"] = "application/json";
|
|
214
305
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
215
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
306
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
216
307
|
}
|
|
217
308
|
if (this.configuration && this.configuration.accessToken) {
|
|
218
309
|
const token = this.configuration.accessToken;
|
|
@@ -225,7 +316,7 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
225
316
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
226
317
|
}
|
|
227
318
|
let urlPath = `/mongodb/collections/{collectionName}/documents`;
|
|
228
|
-
urlPath = urlPath.replace(
|
|
319
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
229
320
|
return {
|
|
230
321
|
path: urlPath,
|
|
231
322
|
method: "POST",
|
|
@@ -268,9 +359,12 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
268
359
|
);
|
|
269
360
|
}
|
|
270
361
|
const queryParameters = {};
|
|
362
|
+
if (requestParameters["extendedJson"] != null) {
|
|
363
|
+
queryParameters["extendedJson"] = requestParameters["extendedJson"];
|
|
364
|
+
}
|
|
271
365
|
const headerParameters = {};
|
|
272
366
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
273
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
367
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
274
368
|
}
|
|
275
369
|
if (this.configuration && this.configuration.accessToken) {
|
|
276
370
|
const token = this.configuration.accessToken;
|
|
@@ -283,8 +377,8 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
283
377
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
284
378
|
}
|
|
285
379
|
let urlPath = `/mongodb/collections/{collectionName}/documents/{documentId}`;
|
|
286
|
-
urlPath = urlPath.replace(
|
|
287
|
-
urlPath = urlPath.replace(
|
|
380
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
381
|
+
urlPath = urlPath.replace("{documentId}", encodeURIComponent(String(requestParameters["documentId"])));
|
|
288
382
|
return {
|
|
289
383
|
path: urlPath,
|
|
290
384
|
method: "GET",
|
|
@@ -309,6 +403,65 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
309
403
|
const response = await this.getDocumentRaw(requestParameters, initOverrides);
|
|
310
404
|
return await response.value();
|
|
311
405
|
}
|
|
406
|
+
/**
|
|
407
|
+
* Creates request options for importDocuments without sending the request
|
|
408
|
+
*/
|
|
409
|
+
async importDocumentsRequestOpts(requestParameters) {
|
|
410
|
+
if (requestParameters["collectionName"] == null) {
|
|
411
|
+
throw new runtime.RequiredError(
|
|
412
|
+
"collectionName",
|
|
413
|
+
'Required parameter "collectionName" was null or undefined when calling importDocuments().'
|
|
414
|
+
);
|
|
415
|
+
}
|
|
416
|
+
if (requestParameters["body"] == null) {
|
|
417
|
+
throw new runtime.RequiredError(
|
|
418
|
+
"body",
|
|
419
|
+
'Required parameter "body" was null or undefined when calling importDocuments().'
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
const queryParameters = {};
|
|
423
|
+
const headerParameters = {};
|
|
424
|
+
headerParameters["Content-Type"] = "text/plain";
|
|
425
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
426
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
427
|
+
}
|
|
428
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
429
|
+
const token = this.configuration.accessToken;
|
|
430
|
+
const tokenString = await token("httpAuth", []);
|
|
431
|
+
if (tokenString) {
|
|
432
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
436
|
+
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
437
|
+
}
|
|
438
|
+
let urlPath = `/mongodb/collections/{collectionName}/documents/import`;
|
|
439
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
440
|
+
return {
|
|
441
|
+
path: urlPath,
|
|
442
|
+
method: "POST",
|
|
443
|
+
headers: headerParameters,
|
|
444
|
+
query: queryParameters,
|
|
445
|
+
body: requestParameters["body"]
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Store the documents of the request body: one JSON document per line (NDJSON, as written by the export). A line is read like a document in the body of an insert (Extended JSON wrappers, dates). The body is read as a stream and the documents are stored in batches without ordering, a line that cannot be stored does not stop the others: the answer counts what was read, stored and failed and names the first failed lines (`errors`, `index` is the number of the line). The size of the body is limited by IMPORT_MAX_BYTES (413 above), there is no time limit.
|
|
450
|
+
* Import Documents into a Collection
|
|
451
|
+
*/
|
|
452
|
+
async importDocumentsRaw(requestParameters, initOverrides) {
|
|
453
|
+
const requestOptions = await this.importDocumentsRequestOpts(requestParameters);
|
|
454
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
455
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ImportResponseFromJSON(jsonValue));
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Store the documents of the request body: one JSON document per line (NDJSON, as written by the export). A line is read like a document in the body of an insert (Extended JSON wrappers, dates). The body is read as a stream and the documents are stored in batches without ordering, a line that cannot be stored does not stop the others: the answer counts what was read, stored and failed and names the first failed lines (`errors`, `index` is the number of the line). The size of the body is limited by IMPORT_MAX_BYTES (413 above), there is no time limit.
|
|
459
|
+
* Import Documents into a Collection
|
|
460
|
+
*/
|
|
461
|
+
async importDocuments(requestParameters, initOverrides) {
|
|
462
|
+
const response = await this.importDocumentsRaw(requestParameters, initOverrides);
|
|
463
|
+
return await response.value();
|
|
464
|
+
}
|
|
312
465
|
/**
|
|
313
466
|
* Creates request options for insert without sending the request
|
|
314
467
|
*/
|
|
@@ -329,7 +482,7 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
329
482
|
const headerParameters = {};
|
|
330
483
|
headerParameters["Content-Type"] = "application/json";
|
|
331
484
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
332
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
485
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
333
486
|
}
|
|
334
487
|
if (this.configuration && this.configuration.accessToken) {
|
|
335
488
|
const token = this.configuration.accessToken;
|
|
@@ -342,7 +495,7 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
342
495
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
343
496
|
}
|
|
344
497
|
let urlPath = `/mongodb/collections/{collectionName}/documents`;
|
|
345
|
-
urlPath = urlPath.replace(
|
|
498
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
346
499
|
return {
|
|
347
500
|
path: urlPath,
|
|
348
501
|
method: "PUT",
|
|
@@ -385,7 +538,7 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
385
538
|
const headerParameters = {};
|
|
386
539
|
headerParameters["Content-Type"] = "application/json";
|
|
387
540
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
388
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
541
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
389
542
|
}
|
|
390
543
|
if (this.configuration && this.configuration.accessToken) {
|
|
391
544
|
const token = this.configuration.accessToken;
|
|
@@ -398,7 +551,7 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
398
551
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
399
552
|
}
|
|
400
553
|
let urlPath = `/mongodb/collections/{collectionName}/documents/many/insert`;
|
|
401
|
-
urlPath = urlPath.replace(
|
|
554
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
402
555
|
return {
|
|
403
556
|
path: urlPath,
|
|
404
557
|
method: "PUT",
|
|
@@ -450,9 +603,12 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
450
603
|
if (requestParameters["page"] != null) {
|
|
451
604
|
queryParameters["page"] = requestParameters["page"];
|
|
452
605
|
}
|
|
606
|
+
if (requestParameters["extendedJson"] != null) {
|
|
607
|
+
queryParameters["extendedJson"] = requestParameters["extendedJson"];
|
|
608
|
+
}
|
|
453
609
|
const headerParameters = {};
|
|
454
610
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
455
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
611
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
456
612
|
}
|
|
457
613
|
if (this.configuration && this.configuration.accessToken) {
|
|
458
614
|
const token = this.configuration.accessToken;
|
|
@@ -465,7 +621,7 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
465
621
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
466
622
|
}
|
|
467
623
|
let urlPath = `/mongodb/collections/{collectionName}/documents`;
|
|
468
|
-
urlPath = urlPath.replace(
|
|
624
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
469
625
|
return {
|
|
470
626
|
path: urlPath,
|
|
471
627
|
method: "GET",
|
|
@@ -513,10 +669,13 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
513
669
|
if (requestParameters["page"] != null) {
|
|
514
670
|
queryParameters["page"] = requestParameters["page"];
|
|
515
671
|
}
|
|
672
|
+
if (requestParameters["extendedJson"] != null) {
|
|
673
|
+
queryParameters["extendedJson"] = requestParameters["extendedJson"];
|
|
674
|
+
}
|
|
516
675
|
const headerParameters = {};
|
|
517
676
|
headerParameters["Content-Type"] = "application/json";
|
|
518
677
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
519
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
678
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
520
679
|
}
|
|
521
680
|
if (this.configuration && this.configuration.accessToken) {
|
|
522
681
|
const token = this.configuration.accessToken;
|
|
@@ -529,7 +688,7 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
529
688
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
530
689
|
}
|
|
531
690
|
let urlPath = `/mongodb/collections/{collectionName}/documents/search`;
|
|
532
|
-
urlPath = urlPath.replace(
|
|
691
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
533
692
|
return {
|
|
534
693
|
path: urlPath,
|
|
535
694
|
method: "POST",
|
|
@@ -581,7 +740,7 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
581
740
|
const headerParameters = {};
|
|
582
741
|
headerParameters["Content-Type"] = "application/json";
|
|
583
742
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
584
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
743
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
585
744
|
}
|
|
586
745
|
if (this.configuration && this.configuration.accessToken) {
|
|
587
746
|
const token = this.configuration.accessToken;
|
|
@@ -594,8 +753,8 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
594
753
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
595
754
|
}
|
|
596
755
|
let urlPath = `/mongodb/collections/{collectionName}/documents/{documentId}`;
|
|
597
|
-
urlPath = urlPath.replace(
|
|
598
|
-
urlPath = urlPath.replace(
|
|
756
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
757
|
+
urlPath = urlPath.replace("{documentId}", encodeURIComponent(String(requestParameters["documentId"])));
|
|
599
758
|
return {
|
|
600
759
|
path: urlPath,
|
|
601
760
|
method: "PATCH",
|
|
@@ -647,7 +806,7 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
647
806
|
const headerParameters = {};
|
|
648
807
|
headerParameters["Content-Type"] = "application/json";
|
|
649
808
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
650
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
809
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
651
810
|
}
|
|
652
811
|
if (this.configuration && this.configuration.accessToken) {
|
|
653
812
|
const token = this.configuration.accessToken;
|
|
@@ -660,8 +819,8 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
660
819
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
661
820
|
}
|
|
662
821
|
let urlPath = `/mongodb/collections/{collectionName}/documents/{documentId}/partial`;
|
|
663
|
-
urlPath = urlPath.replace(
|
|
664
|
-
urlPath = urlPath.replace(
|
|
822
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
823
|
+
urlPath = urlPath.replace("{documentId}", encodeURIComponent(String(requestParameters["documentId"])));
|
|
665
824
|
return {
|
|
666
825
|
path: urlPath,
|
|
667
826
|
method: "PATCH",
|
|
@@ -713,7 +872,7 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
713
872
|
const headerParameters = {};
|
|
714
873
|
headerParameters["Content-Type"] = "application/json";
|
|
715
874
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
716
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
875
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
717
876
|
}
|
|
718
877
|
if (this.configuration && this.configuration.accessToken) {
|
|
719
878
|
const token = this.configuration.accessToken;
|
|
@@ -726,7 +885,7 @@ export class DocumentApi extends runtime.BaseAPI {
|
|
|
726
885
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
727
886
|
}
|
|
728
887
|
let urlPath = `/mongodb/collections/{collectionName}/documents/many/update`;
|
|
729
|
-
urlPath = urlPath.replace(
|
|
888
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
730
889
|
return {
|
|
731
890
|
path: urlPath,
|
|
732
891
|
method: "PATCH",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* mongocamp-library
|
|
3
3
|
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 1.
|
|
5
|
+
* The version of the OpenAPI document: 1.8.2
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -10,42 +10,116 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime.js';
|
|
13
|
-
import type
|
|
13
|
+
import { type DeleteResponse } from '../models/DeleteResponse.js';
|
|
14
|
+
import { type FileInformation } from '../models/FileInformation.js';
|
|
15
|
+
import { type InsertResponse } from '../models/InsertResponse.js';
|
|
16
|
+
import { type MongoFindRequest } from '../models/MongoFindRequest.js';
|
|
17
|
+
import { type UpdateFileInformationRequest } from '../models/UpdateFileInformationRequest.js';
|
|
18
|
+
import { type UpdateResponse } from '../models/UpdateResponse.js';
|
|
14
19
|
export interface DeleteFileRequest {
|
|
20
|
+
/**
|
|
21
|
+
* The name of your MongoDb Collection
|
|
22
|
+
*/
|
|
15
23
|
bucketName: string;
|
|
24
|
+
/**
|
|
25
|
+
* fileId to delete
|
|
26
|
+
*/
|
|
16
27
|
fileId: string;
|
|
17
28
|
}
|
|
18
29
|
export interface FindFilesRequest {
|
|
30
|
+
/**
|
|
31
|
+
* The name of your MongoDb Collection
|
|
32
|
+
*/
|
|
19
33
|
bucketName: string;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
20
37
|
mongoFindRequest: MongoFindRequest;
|
|
38
|
+
/**
|
|
39
|
+
* Count elements per page
|
|
40
|
+
*/
|
|
21
41
|
rowsPerPage?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Requested page of the ResultSets
|
|
44
|
+
*/
|
|
22
45
|
page?: number;
|
|
23
46
|
}
|
|
24
47
|
export interface GetFileRequest {
|
|
48
|
+
/**
|
|
49
|
+
* The name of your MongoDb Collection
|
|
50
|
+
*/
|
|
25
51
|
bucketName: string;
|
|
52
|
+
/**
|
|
53
|
+
* FileId to read
|
|
54
|
+
*/
|
|
26
55
|
fileId: string;
|
|
27
56
|
}
|
|
28
57
|
export interface GetFileInformationRequest {
|
|
58
|
+
/**
|
|
59
|
+
* The name of your MongoDb Collection
|
|
60
|
+
*/
|
|
29
61
|
bucketName: string;
|
|
62
|
+
/**
|
|
63
|
+
* fileId to read
|
|
64
|
+
*/
|
|
30
65
|
fileId: string;
|
|
31
66
|
}
|
|
32
67
|
export interface InsertFileRequest {
|
|
68
|
+
/**
|
|
69
|
+
* The name of your MongoDb Collection
|
|
70
|
+
*/
|
|
33
71
|
bucketName: string;
|
|
72
|
+
/**
|
|
73
|
+
*
|
|
74
|
+
*/
|
|
34
75
|
file: Blob;
|
|
76
|
+
/**
|
|
77
|
+
*
|
|
78
|
+
*/
|
|
35
79
|
metaData: string;
|
|
80
|
+
/**
|
|
81
|
+
* override filename of uploaded file
|
|
82
|
+
*/
|
|
36
83
|
fileName?: string;
|
|
37
84
|
}
|
|
38
85
|
export interface ListFilesRequest {
|
|
86
|
+
/**
|
|
87
|
+
* The name of your MongoDb Collection
|
|
88
|
+
*/
|
|
39
89
|
bucketName: string;
|
|
90
|
+
/**
|
|
91
|
+
* MongoDB Filter Query by Default all filter
|
|
92
|
+
*/
|
|
40
93
|
filter?: string;
|
|
94
|
+
/**
|
|
95
|
+
* MongoDB sorting
|
|
96
|
+
*/
|
|
41
97
|
sort?: string;
|
|
98
|
+
/**
|
|
99
|
+
* MongoDB projection
|
|
100
|
+
*/
|
|
42
101
|
projection?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Count elements per page
|
|
104
|
+
*/
|
|
43
105
|
rowsPerPage?: number;
|
|
106
|
+
/**
|
|
107
|
+
* Requested page of the ResultSets
|
|
108
|
+
*/
|
|
44
109
|
page?: number;
|
|
45
110
|
}
|
|
46
111
|
export interface UpdateFileInformationOperationRequest {
|
|
112
|
+
/**
|
|
113
|
+
* The name of your MongoDb Collection
|
|
114
|
+
*/
|
|
47
115
|
bucketName: string;
|
|
116
|
+
/**
|
|
117
|
+
* fileId to update
|
|
118
|
+
*/
|
|
48
119
|
fileId: string;
|
|
120
|
+
/**
|
|
121
|
+
*
|
|
122
|
+
*/
|
|
49
123
|
updateFileInformationRequest: UpdateFileInformationRequest;
|
|
50
124
|
}
|
|
51
125
|
/**
|
|
@@ -88,12 +162,12 @@ export declare class FileApi extends runtime.BaseAPI {
|
|
|
88
162
|
* Get File from given Bucket
|
|
89
163
|
* File from Bucket
|
|
90
164
|
*/
|
|
91
|
-
getFileRaw(requestParameters: GetFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
165
|
+
getFileRaw(requestParameters: GetFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<runtime.HttpFile>>;
|
|
92
166
|
/**
|
|
93
167
|
* Get File from given Bucket
|
|
94
168
|
* File from Bucket
|
|
95
169
|
*/
|
|
96
|
-
getFile(requestParameters: GetFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
170
|
+
getFile(requestParameters: GetFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.HttpFile>;
|
|
97
171
|
/**
|
|
98
172
|
* Creates request options for getFileInformation without sending the request
|
|
99
173
|
*/
|