@sfxcode/nuxt-mongocamp-server 1.8.0 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/dist/module.json +2 -2
  2. package/dist/module.mjs +1 -1
  3. package/dist/runtime/api/.openapi-generator/FILES +20 -0
  4. package/dist/runtime/api/.openapi-generator/VERSION +1 -1
  5. package/dist/runtime/api/apis/AdminApi.d.ts +65 -2
  6. package/dist/runtime/api/apis/AdminApi.js +39 -27
  7. package/dist/runtime/api/apis/ApplicationApi.d.ts +17 -2
  8. package/dist/runtime/api/apis/ApplicationApi.js +17 -11
  9. package/dist/runtime/api/apis/AuthApi.d.ts +17 -2
  10. package/dist/runtime/api/apis/AuthApi.js +27 -15
  11. package/dist/runtime/api/apis/BucketApi.d.ts +12 -2
  12. package/dist/runtime/api/apis/BucketApi.js +11 -9
  13. package/dist/runtime/api/apis/CollectionApi.d.ts +183 -6
  14. package/dist/runtime/api/apis/CollectionApi.js +233 -40
  15. package/dist/runtime/api/apis/DatabaseApi.d.ts +12 -2
  16. package/dist/runtime/api/apis/DatabaseApi.js +12 -10
  17. package/dist/runtime/api/apis/DocumentApi.d.ts +178 -15
  18. package/dist/runtime/api/apis/DocumentApi.js +54 -40
  19. package/dist/runtime/api/apis/FileApi.d.ts +78 -4
  20. package/dist/runtime/api/apis/FileApi.js +34 -24
  21. package/dist/runtime/api/apis/IndexApi.d.ts +83 -2
  22. package/dist/runtime/api/apis/IndexApi.js +46 -34
  23. package/dist/runtime/api/apis/JobsApi.d.ts +28 -2
  24. package/dist/runtime/api/apis/JobsApi.js +19 -15
  25. package/dist/runtime/api/apis/SystemApi.d.ts +48 -2
  26. package/dist/runtime/api/apis/SystemApi.js +146 -3
  27. package/dist/runtime/api/docs/Capabilities.md +42 -0
  28. package/dist/runtime/api/docs/CapabilityLimits.md +36 -0
  29. package/dist/runtime/api/docs/CollectionApi.md +251 -6
  30. package/dist/runtime/api/docs/CollectionCollation.md +40 -0
  31. package/dist/runtime/api/docs/CollectionOptions.md +46 -0
  32. package/dist/runtime/api/docs/CollectionStatus.md +1 -1
  33. package/dist/runtime/api/docs/ConnectionStats.md +38 -0
  34. package/dist/runtime/api/docs/CreateCollectionResponse.md +34 -0
  35. package/dist/runtime/api/docs/DatabaseInfo.md +1 -1
  36. package/dist/runtime/api/docs/DocumentApi.md +19 -19
  37. package/dist/runtime/api/docs/FileInformation.md +1 -1
  38. package/dist/runtime/api/docs/IndexInfo.md +3 -3
  39. package/dist/runtime/api/docs/IndexOptionsRequest.md +2 -2
  40. package/dist/runtime/api/docs/IndexUsage.md +1 -1
  41. package/dist/runtime/api/docs/JsonSchemaDefinition.md +1 -1
  42. package/dist/runtime/api/docs/MongoFindRequest.md +3 -3
  43. package/dist/runtime/api/docs/MongoIndex.md +3 -3
  44. package/dist/runtime/api/docs/OpCounters.md +44 -0
  45. package/dist/runtime/api/docs/ReplicaSetState.md +40 -0
  46. package/dist/runtime/api/docs/SettingsResponse.md +1 -1
  47. package/dist/runtime/api/docs/SystemApi.md +210 -0
  48. package/dist/runtime/api/docs/SystemInfo.md +36 -0
  49. package/dist/runtime/api/docs/SystemStats.md +42 -0
  50. package/dist/runtime/api/docs/UpdateFileInformationRequest.md +1 -1
  51. package/dist/runtime/api/docs/UpdateRequest.md +2 -2
  52. package/dist/runtime/api/models/BucketInformation.d.ts +1 -9
  53. package/dist/runtime/api/models/Capabilities.d.ts +47 -0
  54. package/dist/runtime/api/models/Capabilities.js +39 -0
  55. package/dist/runtime/api/models/CapabilityLimits.d.ts +34 -0
  56. package/dist/runtime/api/models/CapabilityLimits.js +29 -0
  57. package/dist/runtime/api/models/ClusterInformation.d.ts +1 -5
  58. package/dist/runtime/api/models/ClusterMemberInformation.d.ts +1 -11
  59. package/dist/runtime/api/models/CollectionCollation.d.ts +42 -0
  60. package/dist/runtime/api/models/CollectionCollation.js +32 -0
  61. package/dist/runtime/api/models/CollectionOptions.d.ts +57 -0
  62. package/dist/runtime/api/models/CollectionOptions.js +41 -0
  63. package/dist/runtime/api/models/CollectionPermission.d.ts +1 -9
  64. package/dist/runtime/api/models/CollectionStatus.d.ts +2 -28
  65. package/dist/runtime/api/models/CollectionStatus.js +3 -2
  66. package/dist/runtime/api/models/CollectionSummary.d.ts +1 -19
  67. package/dist/runtime/api/models/ConnectionStats.d.ts +38 -0
  68. package/dist/runtime/api/models/ConnectionStats.js +32 -0
  69. package/dist/runtime/api/models/CopyRequest.d.ts +1 -9
  70. package/dist/runtime/api/models/CopyResponse.d.ts +1 -7
  71. package/dist/runtime/api/models/CountResponse.d.ts +1 -3
  72. package/dist/runtime/api/models/CreateCollectionResponse.d.ts +30 -0
  73. package/dist/runtime/api/models/CreateCollectionResponse.js +26 -0
  74. package/dist/runtime/api/models/DatabaseInfo.d.ts +2 -12
  75. package/dist/runtime/api/models/DatabaseInfo.js +3 -2
  76. package/dist/runtime/api/models/DeleteResponse.d.ts +1 -5
  77. package/dist/runtime/api/models/ErrorDescription.d.ts +1 -7
  78. package/dist/runtime/api/models/FieldInfo.d.ts +1 -5
  79. package/dist/runtime/api/models/FieldTypeCount.d.ts +1 -5
  80. package/dist/runtime/api/models/FileInformation.d.ts +2 -14
  81. package/dist/runtime/api/models/FileInformation.js +4 -3
  82. package/dist/runtime/api/models/Grant.d.ts +1 -11
  83. package/dist/runtime/api/models/ImportResponse.d.ts +1 -11
  84. package/dist/runtime/api/models/IndexCreateRequest.d.ts +1 -7
  85. package/dist/runtime/api/models/IndexCreateResponse.d.ts +1 -3
  86. package/dist/runtime/api/models/IndexDropResponse.d.ts +1 -3
  87. package/dist/runtime/api/models/IndexInfo.d.ts +4 -26
  88. package/dist/runtime/api/models/IndexKey.d.ts +1 -5
  89. package/dist/runtime/api/models/IndexOptionsRequest.d.ts +3 -29
  90. package/dist/runtime/api/models/IndexUsage.d.ts +2 -10
  91. package/dist/runtime/api/models/IndexUsage.js +3 -2
  92. package/dist/runtime/api/models/InsertError.d.ts +1 -7
  93. package/dist/runtime/api/models/InsertResponse.d.ts +1 -9
  94. package/dist/runtime/api/models/JobConfig.d.ts +1 -13
  95. package/dist/runtime/api/models/JobInformation.d.ts +1 -19
  96. package/dist/runtime/api/models/JobInformation.js +5 -4
  97. package/dist/runtime/api/models/JsonSchema.d.ts +1 -7
  98. package/dist/runtime/api/models/JsonSchemaDefinition.d.ts +2 -12
  99. package/dist/runtime/api/models/JsonValueAny.d.ts +1 -3
  100. package/dist/runtime/api/models/JsonValueBoolean.d.ts +1 -3
  101. package/dist/runtime/api/models/JsonValueString.d.ts +1 -3
  102. package/dist/runtime/api/models/Login.d.ts +1 -5
  103. package/dist/runtime/api/models/LoginResult.d.ts +1 -7
  104. package/dist/runtime/api/models/LoginResult.js +3 -2
  105. package/dist/runtime/api/models/MongoAggregateRequest.d.ts +1 -5
  106. package/dist/runtime/api/models/MongoCampConfiguration.d.ts +1 -11
  107. package/dist/runtime/api/models/MongoFindRequest.d.ts +4 -10
  108. package/dist/runtime/api/models/MongoIndex.d.ts +4 -28
  109. package/dist/runtime/api/models/MongoIndex.js +3 -2
  110. package/dist/runtime/api/models/OpCounters.d.ts +50 -0
  111. package/dist/runtime/api/models/OpCounters.js +41 -0
  112. package/dist/runtime/api/models/PasswordUpdateRequest.d.ts +1 -3
  113. package/dist/runtime/api/models/PipelineStage.d.ts +1 -5
  114. package/dist/runtime/api/models/RenameRequest.d.ts +1 -5
  115. package/dist/runtime/api/models/RenameResponse.d.ts +1 -3
  116. package/dist/runtime/api/models/ReplicaSetState.d.ts +42 -0
  117. package/dist/runtime/api/models/ReplicaSetState.js +35 -0
  118. package/dist/runtime/api/models/Role.d.ts +1 -7
  119. package/dist/runtime/api/models/SchemaAnalysis.d.ts +1 -9
  120. package/dist/runtime/api/models/SchemaAnalysisField.d.ts +1 -13
  121. package/dist/runtime/api/models/SchemaAnalysisFieldType.d.ts +1 -7
  122. package/dist/runtime/api/models/SearchRequest.d.ts +1 -7
  123. package/dist/runtime/api/models/SettingsResponse.d.ts +2 -10
  124. package/dist/runtime/api/models/SystemInfo.d.ts +34 -0
  125. package/dist/runtime/api/models/SystemInfo.js +28 -0
  126. package/dist/runtime/api/models/SystemStats.d.ts +49 -0
  127. package/dist/runtime/api/models/SystemStats.js +46 -0
  128. package/dist/runtime/api/models/UpdateFileInformationRequest.d.ts +2 -6
  129. package/dist/runtime/api/models/UpdateRequest.d.ts +3 -7
  130. package/dist/runtime/api/models/UpdateResponse.d.ts +1 -9
  131. package/dist/runtime/api/models/UpdateRoleRequest.d.ts +1 -5
  132. package/dist/runtime/api/models/UserInformation.d.ts +1 -9
  133. package/dist/runtime/api/models/UserProfile.d.ts +1 -11
  134. package/dist/runtime/api/models/Version.d.ts +1 -7
  135. package/dist/runtime/api/models/Version.js +3 -2
  136. package/dist/runtime/api/models/index.d.ts +10 -0
  137. package/dist/runtime/api/models/index.js +10 -0
  138. package/dist/runtime/api/runtime.d.ts +35 -2
  139. package/dist/runtime/api/runtime.js +84 -4
  140. package/dist/runtime/composables/mongocampApiFiles.d.ts +1 -1
  141. package/dist/runtime/composables/mongocampStorage.d.ts +7 -1
  142. package/dist/runtime/composables/mongocampStorage.js +12 -8
  143. package/package.json +4 -4
@@ -1,17 +1,44 @@
1
1
  import * as runtime from "../runtime.js";
2
2
  import {
3
- CollectionStatusFromJSON,
4
- CollectionSummaryFromJSON,
5
- CopyRequestToJSON,
6
- CopyResponseFromJSON,
7
- FieldInfoFromJSON,
8
- JsonSchemaFromJSON,
9
- JsonValueBooleanFromJSON,
10
- MongoAggregateRequestToJSON,
11
- RenameRequestToJSON,
12
- RenameResponseFromJSON,
3
+ CollectionOptionsFromJSON,
4
+ CollectionOptionsToJSON
5
+ } from "../models/CollectionOptions.js";
6
+ import {
7
+ CollectionStatusFromJSON
8
+ } from "../models/CollectionStatus.js";
9
+ import {
10
+ CollectionSummaryFromJSON
11
+ } from "../models/CollectionSummary.js";
12
+ import {
13
+ CopyRequestToJSON
14
+ } from "../models/CopyRequest.js";
15
+ import {
16
+ CopyResponseFromJSON
17
+ } from "../models/CopyResponse.js";
18
+ import {
19
+ CreateCollectionResponseFromJSON
20
+ } from "../models/CreateCollectionResponse.js";
21
+ import {
22
+ FieldInfoFromJSON
23
+ } from "../models/FieldInfo.js";
24
+ import {
25
+ JsonSchemaFromJSON
26
+ } from "../models/JsonSchema.js";
27
+ import {
28
+ JsonValueBooleanFromJSON
29
+ } from "../models/JsonValueBoolean.js";
30
+ import {
31
+ MongoAggregateRequestToJSON
32
+ } from "../models/MongoAggregateRequest.js";
33
+ import {
34
+ RenameRequestToJSON
35
+ } from "../models/RenameRequest.js";
36
+ import {
37
+ RenameResponseFromJSON
38
+ } from "../models/RenameResponse.js";
39
+ import {
13
40
  SchemaAnalysisFromJSON
14
- } from "../models/index.js";
41
+ } from "../models/SchemaAnalysis.js";
15
42
  export class CollectionApi extends runtime.BaseAPI {
16
43
  /**
17
44
  * Creates request options for aggregate without sending the request
@@ -45,7 +72,7 @@ export class CollectionApi extends runtime.BaseAPI {
45
72
  const headerParameters = {};
46
73
  headerParameters["Content-Type"] = "application/json";
47
74
  if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
48
- headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
75
+ headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
49
76
  }
50
77
  if (this.configuration && this.configuration.accessToken) {
51
78
  const token = this.configuration.accessToken;
@@ -58,7 +85,7 @@ export class CollectionApi extends runtime.BaseAPI {
58
85
  headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
59
86
  }
60
87
  let urlPath = `/mongodb/collections/{collectionName}/aggregate`;
61
- urlPath = urlPath.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters["collectionName"])));
88
+ urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
62
89
  return {
63
90
  path: urlPath,
64
91
  method: "POST",
@@ -97,7 +124,7 @@ export class CollectionApi extends runtime.BaseAPI {
97
124
  const queryParameters = {};
98
125
  const headerParameters = {};
99
126
  if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
100
- headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
127
+ headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
101
128
  }
102
129
  if (this.configuration && this.configuration.accessToken) {
103
130
  const token = this.configuration.accessToken;
@@ -110,7 +137,7 @@ export class CollectionApi extends runtime.BaseAPI {
110
137
  headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
111
138
  }
112
139
  let urlPath = `/mongodb/collections/{collectionName}/clear`;
113
- urlPath = urlPath.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters["collectionName"])));
140
+ urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
114
141
  return {
115
142
  path: urlPath,
116
143
  method: "DELETE",
@@ -155,7 +182,7 @@ export class CollectionApi extends runtime.BaseAPI {
155
182
  const headerParameters = {};
156
183
  headerParameters["Content-Type"] = "application/json";
157
184
  if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
158
- headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
185
+ headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
159
186
  }
160
187
  if (this.configuration && this.configuration.accessToken) {
161
188
  const token = this.configuration.accessToken;
@@ -168,7 +195,7 @@ export class CollectionApi extends runtime.BaseAPI {
168
195
  headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
169
196
  }
170
197
  let urlPath = `/mongodb/collections/{collectionName}/copy`;
171
- urlPath = urlPath.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters["collectionName"])));
198
+ urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
172
199
  return {
173
200
  path: urlPath,
174
201
  method: "POST",
@@ -194,6 +221,59 @@ export class CollectionApi extends runtime.BaseAPI {
194
221
  const response = await this.copyCollectionRaw(requestParameters, initOverrides);
195
222
  return await response.value();
196
223
  }
224
+ /**
225
+ * Creates request options for createCollection without sending the request
226
+ */
227
+ async createCollectionRequestOpts(requestParameters) {
228
+ if (requestParameters["collectionName"] == null) {
229
+ throw new runtime.RequiredError(
230
+ "collectionName",
231
+ 'Required parameter "collectionName" was null or undefined when calling createCollection().'
232
+ );
233
+ }
234
+ const queryParameters = {};
235
+ const headerParameters = {};
236
+ headerParameters["Content-Type"] = "application/json";
237
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
238
+ headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
239
+ }
240
+ if (this.configuration && this.configuration.accessToken) {
241
+ const token = this.configuration.accessToken;
242
+ const tokenString = await token("httpAuth", []);
243
+ if (tokenString) {
244
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
245
+ }
246
+ }
247
+ if (this.configuration && this.configuration.apiKey) {
248
+ headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
249
+ }
250
+ let urlPath = `/mongodb/collections/{collectionName}`;
251
+ urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
252
+ return {
253
+ path: urlPath,
254
+ method: "PUT",
255
+ headers: headerParameters,
256
+ query: queryParameters,
257
+ body: CollectionOptionsToJSON(requestParameters["collectionOptions"])
258
+ };
259
+ }
260
+ /**
261
+ * Create a Collection with options: capped (`capped`, `sizeInBytes`, `maxDocuments`), a validator (`validator`, `validationLevel` off, moderate or strict, `validationAction` error or warn) and a collation. Without a body an empty Collection is created. The administrate grant for the name is needed; a name of another database is `database:name`. An existing Collection is a conflict (409), reserved names (system collections, the prefix of the server, the collections of a bucket) and options that do not fit are 400.
262
+ * Create Collection
263
+ */
264
+ async createCollectionRaw(requestParameters, initOverrides) {
265
+ const requestOptions = await this.createCollectionRequestOpts(requestParameters);
266
+ const response = await this.request(requestOptions, initOverrides);
267
+ return new runtime.JSONApiResponse(response, (jsonValue) => CreateCollectionResponseFromJSON(jsonValue));
268
+ }
269
+ /**
270
+ * Create a Collection with options: capped (`capped`, `sizeInBytes`, `maxDocuments`), a validator (`validator`, `validationLevel` off, moderate or strict, `validationAction` error or warn) and a collation. Without a body an empty Collection is created. The administrate grant for the name is needed; a name of another database is `database:name`. An existing Collection is a conflict (409), reserved names (system collections, the prefix of the server, the collections of a bucket) and options that do not fit are 400.
271
+ * Create Collection
272
+ */
273
+ async createCollection(requestParameters, initOverrides) {
274
+ const response = await this.createCollectionRaw(requestParameters, initOverrides);
275
+ return await response.value();
276
+ }
197
277
  /**
198
278
  * Creates request options for deleteCollection without sending the request
199
279
  */
@@ -207,7 +287,7 @@ export class CollectionApi extends runtime.BaseAPI {
207
287
  const queryParameters = {};
208
288
  const headerParameters = {};
209
289
  if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
210
- headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
290
+ headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
211
291
  }
212
292
  if (this.configuration && this.configuration.accessToken) {
213
293
  const token = this.configuration.accessToken;
@@ -220,7 +300,7 @@ export class CollectionApi extends runtime.BaseAPI {
220
300
  headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
221
301
  }
222
302
  let urlPath = `/mongodb/collections/{collectionName}`;
223
- urlPath = urlPath.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters["collectionName"])));
303
+ urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
224
304
  return {
225
305
  path: urlPath,
226
306
  method: "DELETE",
@@ -270,7 +350,7 @@ export class CollectionApi extends runtime.BaseAPI {
270
350
  }
271
351
  const headerParameters = {};
272
352
  if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
273
- headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
353
+ headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
274
354
  }
275
355
  if (this.configuration && this.configuration.accessToken) {
276
356
  const token = this.configuration.accessToken;
@@ -283,8 +363,8 @@ export class CollectionApi extends runtime.BaseAPI {
283
363
  headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
284
364
  }
285
365
  let urlPath = `/mongodb/collections/{collectionName}/distinct/{field}`;
286
- urlPath = urlPath.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters["collectionName"])));
287
- urlPath = urlPath.replace(`{${"field"}}`, encodeURIComponent(String(requestParameters["field"])));
366
+ urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
367
+ urlPath = urlPath.replace("{field}", encodeURIComponent(String(requestParameters["field"])));
288
368
  return {
289
369
  path: urlPath,
290
370
  method: "POST",
@@ -325,7 +405,7 @@ export class CollectionApi extends runtime.BaseAPI {
325
405
  }
326
406
  const headerParameters = {};
327
407
  if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
328
- headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
408
+ headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
329
409
  }
330
410
  if (this.configuration && this.configuration.accessToken) {
331
411
  const token = this.configuration.accessToken;
@@ -338,7 +418,7 @@ export class CollectionApi extends runtime.BaseAPI {
338
418
  headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
339
419
  }
340
420
  let urlPath = `/mongodb/collections/{collectionName}/fields`;
341
- urlPath = urlPath.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters["collectionName"])));
421
+ urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
342
422
  return {
343
423
  path: urlPath,
344
424
  method: "GET",
@@ -379,7 +459,7 @@ export class CollectionApi extends runtime.BaseAPI {
379
459
  }
380
460
  const headerParameters = {};
381
461
  if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
382
- headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
462
+ headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
383
463
  }
384
464
  if (this.configuration && this.configuration.accessToken) {
385
465
  const token = this.configuration.accessToken;
@@ -392,7 +472,7 @@ export class CollectionApi extends runtime.BaseAPI {
392
472
  headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
393
473
  }
394
474
  let urlPath = `/mongodb/collections/{collectionName}`;
395
- urlPath = urlPath.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters["collectionName"])));
475
+ urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
396
476
  return {
397
477
  path: urlPath,
398
478
  method: "GET",
@@ -417,6 +497,57 @@ export class CollectionApi extends runtime.BaseAPI {
417
497
  const response = await this.getCollectionInformationRaw(requestParameters, initOverrides);
418
498
  return await response.value();
419
499
  }
500
+ /**
501
+ * Creates request options for getCollectionOptions without sending the request
502
+ */
503
+ async getCollectionOptionsRequestOpts(requestParameters) {
504
+ if (requestParameters["collectionName"] == null) {
505
+ throw new runtime.RequiredError(
506
+ "collectionName",
507
+ 'Required parameter "collectionName" was null or undefined when calling getCollectionOptions().'
508
+ );
509
+ }
510
+ const queryParameters = {};
511
+ const headerParameters = {};
512
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
513
+ headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
514
+ }
515
+ if (this.configuration && this.configuration.accessToken) {
516
+ const token = this.configuration.accessToken;
517
+ const tokenString = await token("httpAuth", []);
518
+ if (tokenString) {
519
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
520
+ }
521
+ }
522
+ if (this.configuration && this.configuration.apiKey) {
523
+ headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
524
+ }
525
+ let urlPath = `/mongodb/collections/{collectionName}/options`;
526
+ urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
527
+ return {
528
+ path: urlPath,
529
+ method: "GET",
530
+ headers: headerParameters,
531
+ query: queryParameters
532
+ };
533
+ }
534
+ /**
535
+ * The options of a Collection: capped, the validator with its level and action, the collation. 404 for a Collection that does not exist.
536
+ * Collection Options
537
+ */
538
+ async getCollectionOptionsRaw(requestParameters, initOverrides) {
539
+ const requestOptions = await this.getCollectionOptionsRequestOpts(requestParameters);
540
+ const response = await this.request(requestOptions, initOverrides);
541
+ return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOptionsFromJSON(jsonValue));
542
+ }
543
+ /**
544
+ * The options of a Collection: capped, the validator with its level and action, the collation. 404 for a Collection that does not exist.
545
+ * Collection Options
546
+ */
547
+ async getCollectionOptions(requestParameters, initOverrides) {
548
+ const response = await this.getCollectionOptionsRaw(requestParameters, initOverrides);
549
+ return await response.value();
550
+ }
420
551
  /**
421
552
  * Creates request options for getFieldDetails without sending the request
422
553
  */
@@ -436,7 +567,7 @@ export class CollectionApi extends runtime.BaseAPI {
436
567
  }
437
568
  const headerParameters = {};
438
569
  if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
439
- headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
570
+ headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
440
571
  }
441
572
  if (this.configuration && this.configuration.accessToken) {
442
573
  const token = this.configuration.accessToken;
@@ -449,7 +580,7 @@ export class CollectionApi extends runtime.BaseAPI {
449
580
  headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
450
581
  }
451
582
  let urlPath = `/mongodb/collections/{collectionName}/fields/detail`;
452
- urlPath = urlPath.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters["collectionName"])));
583
+ urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
453
584
  return {
454
585
  path: urlPath,
455
586
  method: "GET",
@@ -493,7 +624,7 @@ export class CollectionApi extends runtime.BaseAPI {
493
624
  }
494
625
  const headerParameters = {};
495
626
  if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
496
- headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
627
+ headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
497
628
  }
498
629
  if (this.configuration && this.configuration.accessToken) {
499
630
  const token = this.configuration.accessToken;
@@ -506,7 +637,7 @@ export class CollectionApi extends runtime.BaseAPI {
506
637
  headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
507
638
  }
508
639
  let urlPath = `/mongodb/collections/{collectionName}/schema`;
509
- urlPath = urlPath.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters["collectionName"])));
640
+ urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
510
641
  return {
511
642
  path: urlPath,
512
643
  method: "GET",
@@ -550,7 +681,7 @@ export class CollectionApi extends runtime.BaseAPI {
550
681
  }
551
682
  const headerParameters = {};
552
683
  if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
553
- headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
684
+ headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
554
685
  }
555
686
  if (this.configuration && this.configuration.accessToken) {
556
687
  const token = this.configuration.accessToken;
@@ -563,7 +694,7 @@ export class CollectionApi extends runtime.BaseAPI {
563
694
  headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
564
695
  }
565
696
  let urlPath = `/mongodb/collections/{collectionName}/schema/analysis`;
566
- urlPath = urlPath.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters["collectionName"])));
697
+ urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
567
698
  return {
568
699
  path: urlPath,
569
700
  method: "GET",
@@ -596,9 +727,12 @@ export class CollectionApi extends runtime.BaseAPI {
596
727
  if (requestParameters["name"] != null) {
597
728
  queryParameters["name"] = requestParameters["name"];
598
729
  }
730
+ if (requestParameters["database"] != null) {
731
+ queryParameters["database"] = requestParameters["database"];
732
+ }
599
733
  const headerParameters = {};
600
734
  if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
601
- headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
735
+ headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
602
736
  }
603
737
  if (this.configuration && this.configuration.accessToken) {
604
738
  const token = this.configuration.accessToken;
@@ -619,7 +753,7 @@ export class CollectionApi extends runtime.BaseAPI {
619
753
  };
620
754
  }
621
755
  /**
622
- * The numbers of all Collections of the default database that the user may read in one request (count, size, storage size, average size of a document, number and size of the indices). A Collection without statistics, for example a view, is listed with available false.
756
+ * The numbers of all Collections of the default database (or of the database in `database`) that the user may read in one request (count, size, storage size, average size of a document, number and size of the indices). A Collection without statistics, for example a view, is listed with available false. A database that does not exist is a 404 for an administrator and an empty list for every other user: they cannot find out which databases exist.
623
757
  * Information of all Collections
624
758
  */
625
759
  async listCollectionInformationRaw(requestParameters, initOverrides) {
@@ -628,7 +762,7 @@ export class CollectionApi extends runtime.BaseAPI {
628
762
  return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(CollectionSummaryFromJSON));
629
763
  }
630
764
  /**
631
- * The numbers of all Collections of the default database that the user may read in one request (count, size, storage size, average size of a document, number and size of the indices). A Collection without statistics, for example a view, is listed with available false.
765
+ * The numbers of all Collections of the default database (or of the database in `database`) that the user may read in one request (count, size, storage size, average size of a document, number and size of the indices). A Collection without statistics, for example a view, is listed with available false. A database that does not exist is a 404 for an administrator and an empty list for every other user: they cannot find out which databases exist.
632
766
  * Information of all Collections
633
767
  */
634
768
  async listCollectionInformation(requestParameters = {}, initOverrides) {
@@ -642,7 +776,7 @@ export class CollectionApi extends runtime.BaseAPI {
642
776
  const queryParameters = {};
643
777
  const headerParameters = {};
644
778
  if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
645
- headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
779
+ headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
646
780
  }
647
781
  if (this.configuration && this.configuration.accessToken) {
648
782
  const token = this.configuration.accessToken;
@@ -692,7 +826,7 @@ export class CollectionApi extends runtime.BaseAPI {
692
826
  const queryParameters = {};
693
827
  const headerParameters = {};
694
828
  if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
695
- headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
829
+ headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
696
830
  }
697
831
  if (this.configuration && this.configuration.accessToken) {
698
832
  const token = this.configuration.accessToken;
@@ -705,7 +839,7 @@ export class CollectionApi extends runtime.BaseAPI {
705
839
  headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
706
840
  }
707
841
  let urlPath = `/mongodb/databases/{databaseName}/collections`;
708
- urlPath = urlPath.replace(`{${"databaseName"}}`, encodeURIComponent(String(requestParameters["databaseName"])));
842
+ urlPath = urlPath.replace("{databaseName}", encodeURIComponent(String(requestParameters["databaseName"])));
709
843
  return {
710
844
  path: urlPath,
711
845
  method: "GET",
@@ -730,6 +864,65 @@ export class CollectionApi extends runtime.BaseAPI {
730
864
  const response = await this.listCollectionsByDatabaseRaw(requestParameters, initOverrides);
731
865
  return await response.value();
732
866
  }
867
+ /**
868
+ * Creates request options for modifyCollectionOptions without sending the request
869
+ */
870
+ async modifyCollectionOptionsRequestOpts(requestParameters) {
871
+ if (requestParameters["collectionName"] == null) {
872
+ throw new runtime.RequiredError(
873
+ "collectionName",
874
+ 'Required parameter "collectionName" was null or undefined when calling modifyCollectionOptions().'
875
+ );
876
+ }
877
+ if (requestParameters["collectionOptions"] == null) {
878
+ throw new runtime.RequiredError(
879
+ "collectionOptions",
880
+ 'Required parameter "collectionOptions" was null or undefined when calling modifyCollectionOptions().'
881
+ );
882
+ }
883
+ const queryParameters = {};
884
+ const headerParameters = {};
885
+ headerParameters["Content-Type"] = "application/json";
886
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
887
+ headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
888
+ }
889
+ if (this.configuration && this.configuration.accessToken) {
890
+ const token = this.configuration.accessToken;
891
+ const tokenString = await token("httpAuth", []);
892
+ if (tokenString) {
893
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
894
+ }
895
+ }
896
+ if (this.configuration && this.configuration.apiKey) {
897
+ headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
898
+ }
899
+ let urlPath = `/mongodb/collections/{collectionName}/options`;
900
+ urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
901
+ return {
902
+ path: urlPath,
903
+ method: "PATCH",
904
+ headers: headerParameters,
905
+ query: queryParameters,
906
+ body: CollectionOptionsToJSON(requestParameters["collectionOptions"])
907
+ };
908
+ }
909
+ /**
910
+ * Change the validator, the validationLevel and the validationAction of a Collection (collMod), the answer is the options after the change. A capped Collection and the collation cannot be changed after the creation (400). The administrate grant is needed.
911
+ * Change the Validation of a Collection
912
+ */
913
+ async modifyCollectionOptionsRaw(requestParameters, initOverrides) {
914
+ const requestOptions = await this.modifyCollectionOptionsRequestOpts(requestParameters);
915
+ const response = await this.request(requestOptions, initOverrides);
916
+ return new runtime.JSONApiResponse(response, (jsonValue) => CollectionOptionsFromJSON(jsonValue));
917
+ }
918
+ /**
919
+ * Change the validator, the validationLevel and the validationAction of a Collection (collMod), the answer is the options after the change. A capped Collection and the collation cannot be changed after the creation (400). The administrate grant is needed.
920
+ * Change the Validation of a Collection
921
+ */
922
+ async modifyCollectionOptions(requestParameters, initOverrides) {
923
+ const response = await this.modifyCollectionOptionsRaw(requestParameters, initOverrides);
924
+ return await response.value();
925
+ }
733
926
  /**
734
927
  * Creates request options for renameCollection without sending the request
735
928
  */
@@ -750,7 +943,7 @@ export class CollectionApi extends runtime.BaseAPI {
750
943
  const headerParameters = {};
751
944
  headerParameters["Content-Type"] = "application/json";
752
945
  if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
753
- headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
946
+ headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
754
947
  }
755
948
  if (this.configuration && this.configuration.accessToken) {
756
949
  const token = this.configuration.accessToken;
@@ -763,7 +956,7 @@ export class CollectionApi extends runtime.BaseAPI {
763
956
  headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
764
957
  }
765
958
  let urlPath = `/mongodb/collections/{collectionName}/rename`;
766
- urlPath = urlPath.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters["collectionName"])));
959
+ urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
767
960
  return {
768
961
  path: urlPath,
769
962
  method: "POST",
@@ -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.8.1
5
+ * The version of the OpenAPI document: 1.9.0
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 { DatabaseInfo, JsonValueBoolean } from '../models/index.js';
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/index.js";
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(`{${"databaseName"}}`, encodeURIComponent(String(requestParameters["databaseName"])));
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(`{${"databaseName"}}`, encodeURIComponent(String(requestParameters["databaseName"])));
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(`{${"databaseName"}}`, encodeURIComponent(String(requestParameters["databaseName"])));
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;