@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,12 +1,37 @@
|
|
|
1
1
|
import * as runtime from "../runtime.js";
|
|
2
2
|
import {
|
|
3
|
-
CollectionStatusFromJSON
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
CollectionStatusFromJSON
|
|
4
|
+
} from "../models/CollectionStatus.js";
|
|
5
|
+
import {
|
|
6
|
+
CollectionSummaryFromJSON
|
|
7
|
+
} from "../models/CollectionSummary.js";
|
|
8
|
+
import {
|
|
9
|
+
CopyRequestToJSON
|
|
10
|
+
} from "../models/CopyRequest.js";
|
|
11
|
+
import {
|
|
12
|
+
CopyResponseFromJSON
|
|
13
|
+
} from "../models/CopyResponse.js";
|
|
14
|
+
import {
|
|
15
|
+
FieldInfoFromJSON
|
|
16
|
+
} from "../models/FieldInfo.js";
|
|
17
|
+
import {
|
|
18
|
+
JsonSchemaFromJSON
|
|
19
|
+
} from "../models/JsonSchema.js";
|
|
20
|
+
import {
|
|
21
|
+
JsonValueBooleanFromJSON
|
|
22
|
+
} from "../models/JsonValueBoolean.js";
|
|
23
|
+
import {
|
|
24
|
+
MongoAggregateRequestToJSON
|
|
25
|
+
} from "../models/MongoAggregateRequest.js";
|
|
26
|
+
import {
|
|
27
|
+
RenameRequestToJSON
|
|
28
|
+
} from "../models/RenameRequest.js";
|
|
29
|
+
import {
|
|
30
|
+
RenameResponseFromJSON
|
|
31
|
+
} from "../models/RenameResponse.js";
|
|
32
|
+
import {
|
|
8
33
|
SchemaAnalysisFromJSON
|
|
9
|
-
} from "../models/
|
|
34
|
+
} from "../models/SchemaAnalysis.js";
|
|
10
35
|
export class CollectionApi extends runtime.BaseAPI {
|
|
11
36
|
/**
|
|
12
37
|
* Creates request options for aggregate without sending the request
|
|
@@ -34,10 +59,13 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
34
59
|
if (requestParameters["filter"] != null) {
|
|
35
60
|
queryParameters["filter"] = requestParameters["filter"];
|
|
36
61
|
}
|
|
62
|
+
if (requestParameters["extendedJson"] != null) {
|
|
63
|
+
queryParameters["extendedJson"] = requestParameters["extendedJson"];
|
|
64
|
+
}
|
|
37
65
|
const headerParameters = {};
|
|
38
66
|
headerParameters["Content-Type"] = "application/json";
|
|
39
67
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
40
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
68
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
41
69
|
}
|
|
42
70
|
if (this.configuration && this.configuration.accessToken) {
|
|
43
71
|
const token = this.configuration.accessToken;
|
|
@@ -50,7 +78,7 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
50
78
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
51
79
|
}
|
|
52
80
|
let urlPath = `/mongodb/collections/{collectionName}/aggregate`;
|
|
53
|
-
urlPath = urlPath.replace(
|
|
81
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
54
82
|
return {
|
|
55
83
|
path: urlPath,
|
|
56
84
|
method: "POST",
|
|
@@ -89,7 +117,7 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
89
117
|
const queryParameters = {};
|
|
90
118
|
const headerParameters = {};
|
|
91
119
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
92
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
120
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
93
121
|
}
|
|
94
122
|
if (this.configuration && this.configuration.accessToken) {
|
|
95
123
|
const token = this.configuration.accessToken;
|
|
@@ -102,7 +130,7 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
102
130
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
103
131
|
}
|
|
104
132
|
let urlPath = `/mongodb/collections/{collectionName}/clear`;
|
|
105
|
-
urlPath = urlPath.replace(
|
|
133
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
106
134
|
return {
|
|
107
135
|
path: urlPath,
|
|
108
136
|
method: "DELETE",
|
|
@@ -127,6 +155,65 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
127
155
|
const response = await this.clearCollectionRaw(requestParameters, initOverrides);
|
|
128
156
|
return await response.value();
|
|
129
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* Creates request options for copyCollection without sending the request
|
|
160
|
+
*/
|
|
161
|
+
async copyCollectionRequestOpts(requestParameters) {
|
|
162
|
+
if (requestParameters["collectionName"] == null) {
|
|
163
|
+
throw new runtime.RequiredError(
|
|
164
|
+
"collectionName",
|
|
165
|
+
'Required parameter "collectionName" was null or undefined when calling copyCollection().'
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
if (requestParameters["copyRequest"] == null) {
|
|
169
|
+
throw new runtime.RequiredError(
|
|
170
|
+
"copyRequest",
|
|
171
|
+
'Required parameter "copyRequest" was null or undefined when calling copyCollection().'
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
const queryParameters = {};
|
|
175
|
+
const headerParameters = {};
|
|
176
|
+
headerParameters["Content-Type"] = "application/json";
|
|
177
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
178
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
179
|
+
}
|
|
180
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
181
|
+
const token = this.configuration.accessToken;
|
|
182
|
+
const tokenString = await token("httpAuth", []);
|
|
183
|
+
if (tokenString) {
|
|
184
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
188
|
+
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
189
|
+
}
|
|
190
|
+
let urlPath = `/mongodb/collections/{collectionName}/copy`;
|
|
191
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
192
|
+
return {
|
|
193
|
+
path: urlPath,
|
|
194
|
+
method: "POST",
|
|
195
|
+
headers: headerParameters,
|
|
196
|
+
query: queryParameters,
|
|
197
|
+
body: CopyRequestToJSON(requestParameters["copyRequest"])
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Copy a Collection in the database, optionally only the documents that match a Lucene filter, with its indices (withIndexes, true by default). The target is a name in the database of the Collection. The read grant for the Collection and the write grant for the target are needed. An existing target is a conflict (409), unless dropTarget is true and the user has the administrate grant for it: it is replaced when the copy is complete. The copy is made in one request, a big collection takes its time.
|
|
202
|
+
* Copy Collection
|
|
203
|
+
*/
|
|
204
|
+
async copyCollectionRaw(requestParameters, initOverrides) {
|
|
205
|
+
const requestOptions = await this.copyCollectionRequestOpts(requestParameters);
|
|
206
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
207
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CopyResponseFromJSON(jsonValue));
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Copy a Collection in the database, optionally only the documents that match a Lucene filter, with its indices (withIndexes, true by default). The target is a name in the database of the Collection. The read grant for the Collection and the write grant for the target are needed. An existing target is a conflict (409), unless dropTarget is true and the user has the administrate grant for it: it is replaced when the copy is complete. The copy is made in one request, a big collection takes its time.
|
|
211
|
+
* Copy Collection
|
|
212
|
+
*/
|
|
213
|
+
async copyCollection(requestParameters, initOverrides) {
|
|
214
|
+
const response = await this.copyCollectionRaw(requestParameters, initOverrides);
|
|
215
|
+
return await response.value();
|
|
216
|
+
}
|
|
130
217
|
/**
|
|
131
218
|
* Creates request options for deleteCollection without sending the request
|
|
132
219
|
*/
|
|
@@ -140,7 +227,7 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
140
227
|
const queryParameters = {};
|
|
141
228
|
const headerParameters = {};
|
|
142
229
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
143
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
230
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
144
231
|
}
|
|
145
232
|
if (this.configuration && this.configuration.accessToken) {
|
|
146
233
|
const token = this.configuration.accessToken;
|
|
@@ -153,7 +240,7 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
153
240
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
154
241
|
}
|
|
155
242
|
let urlPath = `/mongodb/collections/{collectionName}`;
|
|
156
|
-
urlPath = urlPath.replace(
|
|
243
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
157
244
|
return {
|
|
158
245
|
path: urlPath,
|
|
159
246
|
method: "DELETE",
|
|
@@ -203,7 +290,7 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
203
290
|
}
|
|
204
291
|
const headerParameters = {};
|
|
205
292
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
206
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
293
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
207
294
|
}
|
|
208
295
|
if (this.configuration && this.configuration.accessToken) {
|
|
209
296
|
const token = this.configuration.accessToken;
|
|
@@ -216,8 +303,8 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
216
303
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
217
304
|
}
|
|
218
305
|
let urlPath = `/mongodb/collections/{collectionName}/distinct/{field}`;
|
|
219
|
-
urlPath = urlPath.replace(
|
|
220
|
-
urlPath = urlPath.replace(
|
|
306
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
307
|
+
urlPath = urlPath.replace("{field}", encodeURIComponent(String(requestParameters["field"])));
|
|
221
308
|
return {
|
|
222
309
|
path: urlPath,
|
|
223
310
|
method: "POST",
|
|
@@ -258,7 +345,7 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
258
345
|
}
|
|
259
346
|
const headerParameters = {};
|
|
260
347
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
261
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
348
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
262
349
|
}
|
|
263
350
|
if (this.configuration && this.configuration.accessToken) {
|
|
264
351
|
const token = this.configuration.accessToken;
|
|
@@ -271,7 +358,7 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
271
358
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
272
359
|
}
|
|
273
360
|
let urlPath = `/mongodb/collections/{collectionName}/fields`;
|
|
274
|
-
urlPath = urlPath.replace(
|
|
361
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
275
362
|
return {
|
|
276
363
|
path: urlPath,
|
|
277
364
|
method: "GET",
|
|
@@ -312,7 +399,7 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
312
399
|
}
|
|
313
400
|
const headerParameters = {};
|
|
314
401
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
315
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
402
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
316
403
|
}
|
|
317
404
|
if (this.configuration && this.configuration.accessToken) {
|
|
318
405
|
const token = this.configuration.accessToken;
|
|
@@ -325,7 +412,7 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
325
412
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
326
413
|
}
|
|
327
414
|
let urlPath = `/mongodb/collections/{collectionName}`;
|
|
328
|
-
urlPath = urlPath.replace(
|
|
415
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
329
416
|
return {
|
|
330
417
|
path: urlPath,
|
|
331
418
|
method: "GET",
|
|
@@ -350,6 +437,63 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
350
437
|
const response = await this.getCollectionInformationRaw(requestParameters, initOverrides);
|
|
351
438
|
return await response.value();
|
|
352
439
|
}
|
|
440
|
+
/**
|
|
441
|
+
* Creates request options for getFieldDetails without sending the request
|
|
442
|
+
*/
|
|
443
|
+
async getFieldDetailsRequestOpts(requestParameters) {
|
|
444
|
+
if (requestParameters["collectionName"] == null) {
|
|
445
|
+
throw new runtime.RequiredError(
|
|
446
|
+
"collectionName",
|
|
447
|
+
'Required parameter "collectionName" was null or undefined when calling getFieldDetails().'
|
|
448
|
+
);
|
|
449
|
+
}
|
|
450
|
+
const queryParameters = {};
|
|
451
|
+
if (requestParameters["sampleSize"] != null) {
|
|
452
|
+
queryParameters["sampleSize"] = requestParameters["sampleSize"];
|
|
453
|
+
}
|
|
454
|
+
if (requestParameters["depth"] != null) {
|
|
455
|
+
queryParameters["depth"] = requestParameters["depth"];
|
|
456
|
+
}
|
|
457
|
+
const headerParameters = {};
|
|
458
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
459
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
460
|
+
}
|
|
461
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
462
|
+
const token = this.configuration.accessToken;
|
|
463
|
+
const tokenString = await token("httpAuth", []);
|
|
464
|
+
if (tokenString) {
|
|
465
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
469
|
+
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
470
|
+
}
|
|
471
|
+
let urlPath = `/mongodb/collections/{collectionName}/fields/detail`;
|
|
472
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
473
|
+
return {
|
|
474
|
+
path: urlPath,
|
|
475
|
+
method: "GET",
|
|
476
|
+
headers: headerParameters,
|
|
477
|
+
query: queryParameters
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* All fields of a collection as a flat list, one entry per path (`address.city`, `tags[]` for the elements of an array) with the types of the values and how often every type was found in the analysed documents.
|
|
482
|
+
* Fields of a Collection with types
|
|
483
|
+
*/
|
|
484
|
+
async getFieldDetailsRaw(requestParameters, initOverrides) {
|
|
485
|
+
const requestOptions = await this.getFieldDetailsRequestOpts(requestParameters);
|
|
486
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
487
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(FieldInfoFromJSON));
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* All fields of a collection as a flat list, one entry per path (`address.city`, `tags[]` for the elements of an array) with the types of the values and how often every type was found in the analysed documents.
|
|
491
|
+
* Fields of a Collection with types
|
|
492
|
+
*/
|
|
493
|
+
async getFieldDetails(requestParameters, initOverrides) {
|
|
494
|
+
const response = await this.getFieldDetailsRaw(requestParameters, initOverrides);
|
|
495
|
+
return await response.value();
|
|
496
|
+
}
|
|
353
497
|
/**
|
|
354
498
|
* Creates request options for getJsonSchema without sending the request
|
|
355
499
|
*/
|
|
@@ -369,7 +513,7 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
369
513
|
}
|
|
370
514
|
const headerParameters = {};
|
|
371
515
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
372
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
516
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
373
517
|
}
|
|
374
518
|
if (this.configuration && this.configuration.accessToken) {
|
|
375
519
|
const token = this.configuration.accessToken;
|
|
@@ -382,7 +526,7 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
382
526
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
383
527
|
}
|
|
384
528
|
let urlPath = `/mongodb/collections/{collectionName}/schema`;
|
|
385
|
-
urlPath = urlPath.replace(
|
|
529
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
386
530
|
return {
|
|
387
531
|
path: urlPath,
|
|
388
532
|
method: "GET",
|
|
@@ -426,7 +570,7 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
426
570
|
}
|
|
427
571
|
const headerParameters = {};
|
|
428
572
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
429
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
573
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
430
574
|
}
|
|
431
575
|
if (this.configuration && this.configuration.accessToken) {
|
|
432
576
|
const token = this.configuration.accessToken;
|
|
@@ -439,7 +583,7 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
439
583
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
440
584
|
}
|
|
441
585
|
let urlPath = `/mongodb/collections/{collectionName}/schema/analysis`;
|
|
442
|
-
urlPath = urlPath.replace(
|
|
586
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
443
587
|
return {
|
|
444
588
|
path: urlPath,
|
|
445
589
|
method: "GET",
|
|
@@ -474,7 +618,7 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
474
618
|
}
|
|
475
619
|
const headerParameters = {};
|
|
476
620
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
477
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
621
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
478
622
|
}
|
|
479
623
|
if (this.configuration && this.configuration.accessToken) {
|
|
480
624
|
const token = this.configuration.accessToken;
|
|
@@ -518,7 +662,7 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
518
662
|
const queryParameters = {};
|
|
519
663
|
const headerParameters = {};
|
|
520
664
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
521
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
665
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
522
666
|
}
|
|
523
667
|
if (this.configuration && this.configuration.accessToken) {
|
|
524
668
|
const token = this.configuration.accessToken;
|
|
@@ -568,7 +712,7 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
568
712
|
const queryParameters = {};
|
|
569
713
|
const headerParameters = {};
|
|
570
714
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
571
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
715
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
572
716
|
}
|
|
573
717
|
if (this.configuration && this.configuration.accessToken) {
|
|
574
718
|
const token = this.configuration.accessToken;
|
|
@@ -581,7 +725,7 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
581
725
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
582
726
|
}
|
|
583
727
|
let urlPath = `/mongodb/databases/{databaseName}/collections`;
|
|
584
|
-
urlPath = urlPath.replace(
|
|
728
|
+
urlPath = urlPath.replace("{databaseName}", encodeURIComponent(String(requestParameters["databaseName"])));
|
|
585
729
|
return {
|
|
586
730
|
path: urlPath,
|
|
587
731
|
method: "GET",
|
|
@@ -606,4 +750,63 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
606
750
|
const response = await this.listCollectionsByDatabaseRaw(requestParameters, initOverrides);
|
|
607
751
|
return await response.value();
|
|
608
752
|
}
|
|
753
|
+
/**
|
|
754
|
+
* Creates request options for renameCollection without sending the request
|
|
755
|
+
*/
|
|
756
|
+
async renameCollectionRequestOpts(requestParameters) {
|
|
757
|
+
if (requestParameters["collectionName"] == null) {
|
|
758
|
+
throw new runtime.RequiredError(
|
|
759
|
+
"collectionName",
|
|
760
|
+
'Required parameter "collectionName" was null or undefined when calling renameCollection().'
|
|
761
|
+
);
|
|
762
|
+
}
|
|
763
|
+
if (requestParameters["renameRequest"] == null) {
|
|
764
|
+
throw new runtime.RequiredError(
|
|
765
|
+
"renameRequest",
|
|
766
|
+
'Required parameter "renameRequest" was null or undefined when calling renameCollection().'
|
|
767
|
+
);
|
|
768
|
+
}
|
|
769
|
+
const queryParameters = {};
|
|
770
|
+
const headerParameters = {};
|
|
771
|
+
headerParameters["Content-Type"] = "application/json";
|
|
772
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
773
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
774
|
+
}
|
|
775
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
776
|
+
const token = this.configuration.accessToken;
|
|
777
|
+
const tokenString = await token("httpAuth", []);
|
|
778
|
+
if (tokenString) {
|
|
779
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
783
|
+
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
784
|
+
}
|
|
785
|
+
let urlPath = `/mongodb/collections/{collectionName}/rename`;
|
|
786
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
787
|
+
return {
|
|
788
|
+
path: urlPath,
|
|
789
|
+
method: "POST",
|
|
790
|
+
headers: headerParameters,
|
|
791
|
+
query: queryParameters,
|
|
792
|
+
body: RenameRequestToJSON(requestParameters["renameRequest"])
|
|
793
|
+
};
|
|
794
|
+
}
|
|
795
|
+
/**
|
|
796
|
+
* Rename a Collection in the database, with its Documents and Indices. The target is a name in the database of the Collection. The administrate grant for the Collection and the write grant for the target are needed. An existing target is a conflict (409), unless dropTarget is true and the user has the administrate grant for it: it is replaced then.
|
|
797
|
+
* Rename Collection
|
|
798
|
+
*/
|
|
799
|
+
async renameCollectionRaw(requestParameters, initOverrides) {
|
|
800
|
+
const requestOptions = await this.renameCollectionRequestOpts(requestParameters);
|
|
801
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
802
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RenameResponseFromJSON(jsonValue));
|
|
803
|
+
}
|
|
804
|
+
/**
|
|
805
|
+
* Rename a Collection in the database, with its Documents and Indices. The target is a name in the database of the Collection. The administrate grant for the Collection and the write grant for the target are needed. An existing target is a conflict (409), unless dropTarget is true and the user has the administrate grant for it: it is replaced then.
|
|
806
|
+
* Rename Collection
|
|
807
|
+
*/
|
|
808
|
+
async renameCollection(requestParameters, initOverrides) {
|
|
809
|
+
const response = await this.renameCollectionRaw(requestParameters, initOverrides);
|
|
810
|
+
return await response.value();
|
|
811
|
+
}
|
|
609
812
|
}
|
|
@@ -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,14 +10,24 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime.js';
|
|
13
|
-
import type
|
|
13
|
+
import { type DatabaseInfo } from '../models/DatabaseInfo.js';
|
|
14
|
+
import { type JsonValueBoolean } from '../models/JsonValueBoolean.js';
|
|
14
15
|
export interface DeleteDatabaseRequest {
|
|
16
|
+
/**
|
|
17
|
+
* Name of your Database
|
|
18
|
+
*/
|
|
15
19
|
databaseName: string;
|
|
16
20
|
}
|
|
17
21
|
export interface GetDatabaseInfoRequest {
|
|
22
|
+
/**
|
|
23
|
+
* Name of your Database
|
|
24
|
+
*/
|
|
18
25
|
databaseName: string;
|
|
19
26
|
}
|
|
20
27
|
export interface ListCollectionsByDatabaseRequest {
|
|
28
|
+
/**
|
|
29
|
+
* Name of your Database
|
|
30
|
+
*/
|
|
21
31
|
databaseName: string;
|
|
22
32
|
}
|
|
23
33
|
/**
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as runtime from "../runtime.js";
|
|
2
2
|
import {
|
|
3
|
-
DatabaseInfoFromJSON
|
|
3
|
+
DatabaseInfoFromJSON
|
|
4
|
+
} from "../models/DatabaseInfo.js";
|
|
5
|
+
import {
|
|
4
6
|
JsonValueBooleanFromJSON
|
|
5
|
-
} from "../models/
|
|
7
|
+
} from "../models/JsonValueBoolean.js";
|
|
6
8
|
export class DatabaseApi extends runtime.BaseAPI {
|
|
7
9
|
/**
|
|
8
10
|
* Creates request options for databaseInfos without sending the request
|
|
@@ -11,7 +13,7 @@ export class DatabaseApi extends runtime.BaseAPI {
|
|
|
11
13
|
const queryParameters = {};
|
|
12
14
|
const headerParameters = {};
|
|
13
15
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
14
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
16
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
15
17
|
}
|
|
16
18
|
if (this.configuration && this.configuration.accessToken) {
|
|
17
19
|
const token = this.configuration.accessToken;
|
|
@@ -61,7 +63,7 @@ export class DatabaseApi extends runtime.BaseAPI {
|
|
|
61
63
|
const queryParameters = {};
|
|
62
64
|
const headerParameters = {};
|
|
63
65
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
64
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
66
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
65
67
|
}
|
|
66
68
|
if (this.configuration && this.configuration.accessToken) {
|
|
67
69
|
const token = this.configuration.accessToken;
|
|
@@ -74,7 +76,7 @@ export class DatabaseApi extends runtime.BaseAPI {
|
|
|
74
76
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
75
77
|
}
|
|
76
78
|
let urlPath = `/mongodb/databases/{databaseName}`;
|
|
77
|
-
urlPath = urlPath.replace(
|
|
79
|
+
urlPath = urlPath.replace("{databaseName}", encodeURIComponent(String(requestParameters["databaseName"])));
|
|
78
80
|
return {
|
|
79
81
|
path: urlPath,
|
|
80
82
|
method: "DELETE",
|
|
@@ -112,7 +114,7 @@ export class DatabaseApi extends runtime.BaseAPI {
|
|
|
112
114
|
const queryParameters = {};
|
|
113
115
|
const headerParameters = {};
|
|
114
116
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
115
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
117
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
116
118
|
}
|
|
117
119
|
if (this.configuration && this.configuration.accessToken) {
|
|
118
120
|
const token = this.configuration.accessToken;
|
|
@@ -125,7 +127,7 @@ export class DatabaseApi extends runtime.BaseAPI {
|
|
|
125
127
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
126
128
|
}
|
|
127
129
|
let urlPath = `/mongodb/databases/{databaseName}`;
|
|
128
|
-
urlPath = urlPath.replace(
|
|
130
|
+
urlPath = urlPath.replace("{databaseName}", encodeURIComponent(String(requestParameters["databaseName"])));
|
|
129
131
|
return {
|
|
130
132
|
path: urlPath,
|
|
131
133
|
method: "GET",
|
|
@@ -163,7 +165,7 @@ export class DatabaseApi extends runtime.BaseAPI {
|
|
|
163
165
|
const queryParameters = {};
|
|
164
166
|
const headerParameters = {};
|
|
165
167
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
166
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
168
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
167
169
|
}
|
|
168
170
|
if (this.configuration && this.configuration.accessToken) {
|
|
169
171
|
const token = this.configuration.accessToken;
|
|
@@ -176,7 +178,7 @@ export class DatabaseApi extends runtime.BaseAPI {
|
|
|
176
178
|
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
177
179
|
}
|
|
178
180
|
let urlPath = `/mongodb/databases/{databaseName}/collections`;
|
|
179
|
-
urlPath = urlPath.replace(
|
|
181
|
+
urlPath = urlPath.replace("{databaseName}", encodeURIComponent(String(requestParameters["databaseName"])));
|
|
180
182
|
return {
|
|
181
183
|
path: urlPath,
|
|
182
184
|
method: "GET",
|
|
@@ -208,7 +210,7 @@ export class DatabaseApi extends runtime.BaseAPI {
|
|
|
208
210
|
const queryParameters = {};
|
|
209
211
|
const headerParameters = {};
|
|
210
212
|
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
211
|
-
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
213
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
212
214
|
}
|
|
213
215
|
if (this.configuration && this.configuration.accessToken) {
|
|
214
216
|
const token = this.configuration.accessToken;
|