@sfxcode/nuxt-mongocamp-server 1.9.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 (111) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +1 -1
  3. package/dist/runtime/api/.openapi-generator/FILES +20 -0
  4. package/dist/runtime/api/apis/AdminApi.d.ts +1 -1
  5. package/dist/runtime/api/apis/ApplicationApi.d.ts +1 -1
  6. package/dist/runtime/api/apis/AuthApi.d.ts +1 -1
  7. package/dist/runtime/api/apis/BucketApi.d.ts +1 -1
  8. package/dist/runtime/api/apis/CollectionApi.d.ts +78 -4
  9. package/dist/runtime/api/apis/CollectionApi.js +175 -2
  10. package/dist/runtime/api/apis/DatabaseApi.d.ts +1 -1
  11. package/dist/runtime/api/apis/DocumentApi.d.ts +1 -1
  12. package/dist/runtime/api/apis/FileApi.d.ts +1 -1
  13. package/dist/runtime/api/apis/IndexApi.d.ts +1 -1
  14. package/dist/runtime/api/apis/JobsApi.d.ts +1 -1
  15. package/dist/runtime/api/apis/SystemApi.d.ts +46 -1
  16. package/dist/runtime/api/apis/SystemApi.js +141 -0
  17. package/dist/runtime/api/docs/Capabilities.md +42 -0
  18. package/dist/runtime/api/docs/CapabilityLimits.md +36 -0
  19. package/dist/runtime/api/docs/CollectionApi.md +249 -4
  20. package/dist/runtime/api/docs/CollectionCollation.md +40 -0
  21. package/dist/runtime/api/docs/CollectionOptions.md +46 -0
  22. package/dist/runtime/api/docs/ConnectionStats.md +38 -0
  23. package/dist/runtime/api/docs/CreateCollectionResponse.md +34 -0
  24. package/dist/runtime/api/docs/DocumentApi.md +1 -1
  25. package/dist/runtime/api/docs/OpCounters.md +44 -0
  26. package/dist/runtime/api/docs/ReplicaSetState.md +40 -0
  27. package/dist/runtime/api/docs/SystemApi.md +210 -0
  28. package/dist/runtime/api/docs/SystemInfo.md +36 -0
  29. package/dist/runtime/api/docs/SystemStats.md +42 -0
  30. package/dist/runtime/api/models/BucketInformation.d.ts +1 -1
  31. package/dist/runtime/api/models/Capabilities.d.ts +47 -0
  32. package/dist/runtime/api/models/Capabilities.js +39 -0
  33. package/dist/runtime/api/models/CapabilityLimits.d.ts +34 -0
  34. package/dist/runtime/api/models/CapabilityLimits.js +29 -0
  35. package/dist/runtime/api/models/ClusterInformation.d.ts +1 -1
  36. package/dist/runtime/api/models/ClusterMemberInformation.d.ts +1 -1
  37. package/dist/runtime/api/models/CollectionCollation.d.ts +42 -0
  38. package/dist/runtime/api/models/CollectionCollation.js +32 -0
  39. package/dist/runtime/api/models/CollectionOptions.d.ts +57 -0
  40. package/dist/runtime/api/models/CollectionOptions.js +41 -0
  41. package/dist/runtime/api/models/CollectionPermission.d.ts +1 -1
  42. package/dist/runtime/api/models/CollectionStatus.d.ts +1 -1
  43. package/dist/runtime/api/models/CollectionSummary.d.ts +1 -1
  44. package/dist/runtime/api/models/ConnectionStats.d.ts +38 -0
  45. package/dist/runtime/api/models/ConnectionStats.js +32 -0
  46. package/dist/runtime/api/models/CopyRequest.d.ts +1 -1
  47. package/dist/runtime/api/models/CopyResponse.d.ts +1 -1
  48. package/dist/runtime/api/models/CountResponse.d.ts +1 -1
  49. package/dist/runtime/api/models/CreateCollectionResponse.d.ts +30 -0
  50. package/dist/runtime/api/models/CreateCollectionResponse.js +26 -0
  51. package/dist/runtime/api/models/DatabaseInfo.d.ts +1 -1
  52. package/dist/runtime/api/models/DeleteResponse.d.ts +1 -1
  53. package/dist/runtime/api/models/ErrorDescription.d.ts +1 -1
  54. package/dist/runtime/api/models/FieldInfo.d.ts +1 -1
  55. package/dist/runtime/api/models/FieldTypeCount.d.ts +1 -1
  56. package/dist/runtime/api/models/FileInformation.d.ts +1 -1
  57. package/dist/runtime/api/models/Grant.d.ts +1 -1
  58. package/dist/runtime/api/models/ImportResponse.d.ts +1 -1
  59. package/dist/runtime/api/models/IndexCreateRequest.d.ts +1 -1
  60. package/dist/runtime/api/models/IndexCreateResponse.d.ts +1 -1
  61. package/dist/runtime/api/models/IndexDropResponse.d.ts +1 -1
  62. package/dist/runtime/api/models/IndexInfo.d.ts +1 -1
  63. package/dist/runtime/api/models/IndexKey.d.ts +1 -1
  64. package/dist/runtime/api/models/IndexOptionsRequest.d.ts +1 -1
  65. package/dist/runtime/api/models/IndexUsage.d.ts +1 -1
  66. package/dist/runtime/api/models/InsertError.d.ts +1 -1
  67. package/dist/runtime/api/models/InsertResponse.d.ts +1 -1
  68. package/dist/runtime/api/models/JobConfig.d.ts +1 -1
  69. package/dist/runtime/api/models/JobInformation.d.ts +1 -1
  70. package/dist/runtime/api/models/JsonSchema.d.ts +1 -1
  71. package/dist/runtime/api/models/JsonSchemaDefinition.d.ts +1 -1
  72. package/dist/runtime/api/models/JsonValueAny.d.ts +1 -1
  73. package/dist/runtime/api/models/JsonValueBoolean.d.ts +1 -1
  74. package/dist/runtime/api/models/JsonValueString.d.ts +1 -1
  75. package/dist/runtime/api/models/Login.d.ts +1 -1
  76. package/dist/runtime/api/models/LoginResult.d.ts +1 -1
  77. package/dist/runtime/api/models/MongoAggregateRequest.d.ts +1 -1
  78. package/dist/runtime/api/models/MongoCampConfiguration.d.ts +1 -1
  79. package/dist/runtime/api/models/MongoFindRequest.d.ts +1 -1
  80. package/dist/runtime/api/models/MongoIndex.d.ts +1 -1
  81. package/dist/runtime/api/models/OpCounters.d.ts +50 -0
  82. package/dist/runtime/api/models/OpCounters.js +41 -0
  83. package/dist/runtime/api/models/PasswordUpdateRequest.d.ts +1 -1
  84. package/dist/runtime/api/models/PipelineStage.d.ts +1 -1
  85. package/dist/runtime/api/models/RenameRequest.d.ts +1 -1
  86. package/dist/runtime/api/models/RenameResponse.d.ts +1 -1
  87. package/dist/runtime/api/models/ReplicaSetState.d.ts +42 -0
  88. package/dist/runtime/api/models/ReplicaSetState.js +35 -0
  89. package/dist/runtime/api/models/Role.d.ts +1 -1
  90. package/dist/runtime/api/models/SchemaAnalysis.d.ts +1 -1
  91. package/dist/runtime/api/models/SchemaAnalysisField.d.ts +1 -1
  92. package/dist/runtime/api/models/SchemaAnalysisFieldType.d.ts +1 -1
  93. package/dist/runtime/api/models/SearchRequest.d.ts +1 -1
  94. package/dist/runtime/api/models/SettingsResponse.d.ts +1 -1
  95. package/dist/runtime/api/models/SystemInfo.d.ts +34 -0
  96. package/dist/runtime/api/models/SystemInfo.js +28 -0
  97. package/dist/runtime/api/models/SystemStats.d.ts +49 -0
  98. package/dist/runtime/api/models/SystemStats.js +46 -0
  99. package/dist/runtime/api/models/UpdateFileInformationRequest.d.ts +1 -1
  100. package/dist/runtime/api/models/UpdateRequest.d.ts +1 -1
  101. package/dist/runtime/api/models/UpdateResponse.d.ts +1 -1
  102. package/dist/runtime/api/models/UpdateRoleRequest.d.ts +1 -1
  103. package/dist/runtime/api/models/UserInformation.d.ts +1 -1
  104. package/dist/runtime/api/models/UserProfile.d.ts +1 -1
  105. package/dist/runtime/api/models/Version.d.ts +1 -1
  106. package/dist/runtime/api/models/index.d.ts +10 -0
  107. package/dist/runtime/api/models/index.js +10 -0
  108. package/dist/runtime/api/runtime.d.ts +1 -1
  109. package/dist/runtime/composables/mongocampStorage.d.ts +7 -1
  110. package/dist/runtime/composables/mongocampStorage.js +12 -8
  111. package/package.json +2 -2
@@ -1,11 +1,152 @@
1
1
  import * as runtime from "../runtime.js";
2
+ import {
3
+ CapabilitiesFromJSON
4
+ } from "../models/Capabilities.js";
2
5
  import {
3
6
  ClusterInformationFromJSON
4
7
  } from "../models/ClusterInformation.js";
8
+ import {
9
+ SystemInfoFromJSON
10
+ } from "../models/SystemInfo.js";
11
+ import {
12
+ SystemStatsFromJSON
13
+ } from "../models/SystemStats.js";
5
14
  import {
6
15
  VersionFromJSON
7
16
  } from "../models/Version.js";
8
17
  export class SystemApi extends runtime.BaseAPI {
18
+ /**
19
+ * Creates request options for systemCapabilities without sending the request
20
+ */
21
+ async systemCapabilitiesRequestOpts() {
22
+ const queryParameters = {};
23
+ const headerParameters = {};
24
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
25
+ headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
26
+ }
27
+ if (this.configuration && this.configuration.accessToken) {
28
+ const token = this.configuration.accessToken;
29
+ const tokenString = await token("httpAuth", []);
30
+ if (tokenString) {
31
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
32
+ }
33
+ }
34
+ if (this.configuration && this.configuration.apiKey) {
35
+ headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
36
+ }
37
+ let urlPath = `/system/capabilities`;
38
+ return {
39
+ path: urlPath,
40
+ method: "GET",
41
+ headers: headerParameters,
42
+ query: queryParameters
43
+ };
44
+ }
45
+ /**
46
+ * What this server can do, for every logged in user: the names of the features, the major version of MongoDB, the limits (size of an import, status of a request without the grant) and the operators that an aggregation refuses. A server that has no such route is an older version.
47
+ * System Capabilities
48
+ */
49
+ async systemCapabilitiesRaw(initOverrides) {
50
+ const requestOptions = await this.systemCapabilitiesRequestOpts();
51
+ const response = await this.request(requestOptions, initOverrides);
52
+ return new runtime.JSONApiResponse(response, (jsonValue) => CapabilitiesFromJSON(jsonValue));
53
+ }
54
+ /**
55
+ * What this server can do, for every logged in user: the names of the features, the major version of MongoDB, the limits (size of an import, status of a request without the grant) and the operators that an aggregation refuses. A server that has no such route is an older version.
56
+ * System Capabilities
57
+ */
58
+ async systemCapabilities(initOverrides) {
59
+ const response = await this.systemCapabilitiesRaw(initOverrides);
60
+ return await response.value();
61
+ }
62
+ /**
63
+ * Creates request options for systemInfo without sending the request
64
+ */
65
+ async systemInfoRequestOpts() {
66
+ const queryParameters = {};
67
+ const headerParameters = {};
68
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
69
+ headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
70
+ }
71
+ if (this.configuration && this.configuration.accessToken) {
72
+ const token = this.configuration.accessToken;
73
+ const tokenString = await token("httpAuth", []);
74
+ if (tokenString) {
75
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
76
+ }
77
+ }
78
+ if (this.configuration && this.configuration.apiKey) {
79
+ headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
80
+ }
81
+ let urlPath = `/system/info`;
82
+ return {
83
+ path: urlPath,
84
+ method: "GET",
85
+ headers: headerParameters,
86
+ query: queryParameters
87
+ };
88
+ }
89
+ /**
90
+ * Information about the system the server is connected to: the version of the MongoDB server
91
+ * System Information
92
+ */
93
+ async systemInfoRaw(initOverrides) {
94
+ const requestOptions = await this.systemInfoRequestOpts();
95
+ const response = await this.request(requestOptions, initOverrides);
96
+ return new runtime.JSONApiResponse(response, (jsonValue) => SystemInfoFromJSON(jsonValue));
97
+ }
98
+ /**
99
+ * Information about the system the server is connected to: the version of the MongoDB server
100
+ * System Information
101
+ */
102
+ async systemInfo(initOverrides) {
103
+ const response = await this.systemInfoRaw(initOverrides);
104
+ return await response.value();
105
+ }
106
+ /**
107
+ * Creates request options for systemStats without sending the request
108
+ */
109
+ async systemStatsRequestOpts() {
110
+ const queryParameters = {};
111
+ const headerParameters = {};
112
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
113
+ headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
114
+ }
115
+ if (this.configuration && this.configuration.accessToken) {
116
+ const token = this.configuration.accessToken;
117
+ const tokenString = await token("httpAuth", []);
118
+ if (tokenString) {
119
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
120
+ }
121
+ }
122
+ if (this.configuration && this.configuration.apiKey) {
123
+ headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
124
+ }
125
+ let urlPath = `/system/stats`;
126
+ return {
127
+ path: urlPath,
128
+ method: "GET",
129
+ headers: headerParameters,
130
+ query: queryParameters
131
+ };
132
+ }
133
+ /**
134
+ * The numbers of the database server for a server overview: uptime, connections, operation counters (totals since the start of the database server) and the state of the replica set. A database user without the role clusterMonitor gives partial true and no uptime, connections and counters; a server that is not part of a replica set has no replicaSet. No host names or addresses.
135
+ * System Statistics
136
+ */
137
+ async systemStatsRaw(initOverrides) {
138
+ const requestOptions = await this.systemStatsRequestOpts();
139
+ const response = await this.request(requestOptions, initOverrides);
140
+ return new runtime.JSONApiResponse(response, (jsonValue) => SystemStatsFromJSON(jsonValue));
141
+ }
142
+ /**
143
+ * The numbers of the database server for a server overview: uptime, connections, operation counters (totals since the start of the database server) and the state of the replica set. A database user without the role clusterMonitor gives partial true and no uptime, connections and counters; a server that is not part of a replica set has no replicaSet. No host names or addresses.
144
+ * System Statistics
145
+ */
146
+ async systemStats(initOverrides) {
147
+ const response = await this.systemStatsRaw(initOverrides);
148
+ return await response.value();
149
+ }
9
150
  /**
10
151
  * Creates request options for version without sending the request
11
152
  */
@@ -0,0 +1,42 @@
1
+
2
+ # Capabilities
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `serverVersion` | string
10
+ `mongoDbMajor` | number
11
+ `features` | Array<string>
12
+ `limits` | [CapabilityLimits](CapabilityLimits.md)
13
+ `aggregationStagesDenied` | Array<string>
14
+
15
+ ## Example
16
+
17
+ ```typescript
18
+ import type { Capabilities } from ''
19
+
20
+ // TODO: Update the object below with actual values
21
+ const example = {
22
+ "serverVersion": null,
23
+ "mongoDbMajor": null,
24
+ "features": null,
25
+ "limits": null,
26
+ "aggregationStagesDenied": null,
27
+ } satisfies Capabilities
28
+
29
+ console.log(example)
30
+
31
+ // Convert the instance to a JSON string
32
+ const exampleJSON: string = JSON.stringify(example)
33
+ console.log(exampleJSON)
34
+
35
+ // Parse the JSON string back to an object
36
+ const exampleParsed = JSON.parse(exampleJSON) as Capabilities
37
+ console.log(exampleParsed)
38
+ ```
39
+
40
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
41
+
42
+
@@ -0,0 +1,36 @@
1
+
2
+ # CapabilityLimits
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `importMaxBytes` | number
10
+ `grantDeniedStatus` | number
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { CapabilityLimits } from ''
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "importMaxBytes": null,
20
+ "grantDeniedStatus": null,
21
+ } satisfies CapabilityLimits
22
+
23
+ console.log(example)
24
+
25
+ // Convert the instance to a JSON string
26
+ const exampleJSON: string = JSON.stringify(example)
27
+ console.log(exampleJSON)
28
+
29
+ // Parse the JSON string back to an object
30
+ const exampleParsed = JSON.parse(exampleJSON) as CapabilityLimits
31
+ console.log(exampleParsed)
32
+ ```
33
+
34
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
35
+
36
+
@@ -7,16 +7,19 @@ All URIs are relative to *http://localhost*
7
7
  | [**aggregate**](CollectionApi.md#aggregate) | **POST** /mongodb/collections/{collectionName}/aggregate | Aggregate in Collection |
8
8
  | [**clearCollection**](CollectionApi.md#clearcollection) | **DELETE** /mongodb/collections/{collectionName}/clear | Clear Collection |
9
9
  | [**copyCollection**](CollectionApi.md#copycollection) | **POST** /mongodb/collections/{collectionName}/copy | Copy Collection |
10
+ | [**createCollection**](CollectionApi.md#createcollection) | **PUT** /mongodb/collections/{collectionName} | Create Collection |
10
11
  | [**deleteCollection**](CollectionApi.md#deletecollection) | **DELETE** /mongodb/collections/{collectionName} | Delete Collection |
11
12
  | [**distinct**](CollectionApi.md#distinct) | **POST** /mongodb/collections/{collectionName}/distinct/{field} | Distinct in Collection |
12
13
  | [**getCollectionFields**](CollectionApi.md#getcollectionfields) | **GET** /mongodb/collections/{collectionName}/fields | Collection Fields |
13
14
  | [**getCollectionInformation**](CollectionApi.md#getcollectioninformation) | **GET** /mongodb/collections/{collectionName} | Collection Information |
15
+ | [**getCollectionOptions**](CollectionApi.md#getcollectionoptions) | **GET** /mongodb/collections/{collectionName}/options | Collection Options |
14
16
  | [**getFieldDetails**](CollectionApi.md#getfielddetails) | **GET** /mongodb/collections/{collectionName}/fields/detail | Fields of a Collection with types |
15
17
  | [**getJsonSchema**](CollectionApi.md#getjsonschema) | **GET** /mongodb/collections/{collectionName}/schema | Collection Fields |
16
18
  | [**getSchemaAnalysis**](CollectionApi.md#getschemaanalysis) | **GET** /mongodb/collections/{collectionName}/schema/analysis | Collection Fields |
17
19
  | [**listCollectionInformation**](CollectionApi.md#listcollectioninformation) | **GET** /mongodb/collections/info | Information of all Collections |
18
20
  | [**listCollections**](CollectionApi.md#listcollections) | **GET** /mongodb/collections | List of Collections |
19
21
  | [**listCollectionsByDatabase**](CollectionApi.md#listcollectionsbydatabase) | **GET** /mongodb/databases/{databaseName}/collections | List of Collections |
22
+ | [**modifyCollectionOptions**](CollectionApi.md#modifycollectionoptions) | **PATCH** /mongodb/collections/{collectionName}/options | Change the Validation of a Collection |
20
23
  | [**renameCollection**](CollectionApi.md#renamecollection) | **POST** /mongodb/collections/{collectionName}/rename | Rename Collection |
21
24
 
22
25
 
@@ -272,6 +275,87 @@ example().catch(console.error);
272
275
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
273
276
 
274
277
 
278
+ ## createCollection
279
+
280
+ > CreateCollectionResponse createCollection(collectionName, collectionOptions)
281
+
282
+ Create Collection
283
+
284
+ 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.
285
+
286
+ ### Example
287
+
288
+ ```ts
289
+ import {
290
+ Configuration,
291
+ CollectionApi,
292
+ } from '';
293
+ import type { CreateCollectionRequest } from '';
294
+
295
+ async function example() {
296
+ console.log("🚀 Testing SDK...");
297
+ const config = new Configuration({
298
+ // To configure HTTP basic authorization: httpAuth1
299
+ username: "YOUR USERNAME",
300
+ password: "YOUR PASSWORD",
301
+ // Configure HTTP bearer authorization: httpAuth
302
+ accessToken: "YOUR BEARER TOKEN",
303
+ // To configure API key authorization: apiKeyAuth
304
+ apiKey: "YOUR API KEY",
305
+ });
306
+ const api = new CollectionApi(config);
307
+
308
+ const body = {
309
+ // string | The name of your MongoDb Collection
310
+ collectionName: collectionName_example,
311
+ // CollectionOptions | The options of the new Collection, all of them are optional (optional)
312
+ collectionOptions: ...,
313
+ } satisfies CreateCollectionRequest;
314
+
315
+ try {
316
+ const data = await api.createCollection(body);
317
+ console.log(data);
318
+ } catch (error) {
319
+ console.error(error);
320
+ }
321
+ }
322
+
323
+ // Run the test
324
+ example().catch(console.error);
325
+ ```
326
+
327
+ ### Parameters
328
+
329
+
330
+ | Name | Type | Description | Notes |
331
+ |------------- | ------------- | ------------- | -------------|
332
+ | **collectionName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
333
+ | **collectionOptions** | [CollectionOptions](CollectionOptions.md) | The options of the new Collection, all of them are optional | [Optional] |
334
+
335
+ ### Return type
336
+
337
+ [**CreateCollectionResponse**](CreateCollectionResponse.md)
338
+
339
+ ### Authorization
340
+
341
+ [httpAuth1](../README.md#httpAuth1), [httpAuth](../README.md#httpAuth), [apiKeyAuth](../README.md#apiKeyAuth)
342
+
343
+ ### HTTP request headers
344
+
345
+ - **Content-Type**: `application/json`
346
+ - **Accept**: `application/json`, `text/plain`
347
+
348
+
349
+ ### HTTP response details
350
+ | Status code | Description | Response headers |
351
+ |-------------|-------------|------------------|
352
+ | **200** | | - |
353
+ | **400** | Invalid value for: body | - |
354
+ | **0** | | * x-error-code - Error Code <br> * x-error-message - Message of the MongoCampException <br> * x-error-additional-info - Additional information for the MongoCampException <br> |
355
+
356
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
357
+
358
+
275
359
  ## deleteCollection
276
360
 
277
361
  > JsonValueBoolean deleteCollection(collectionName)
@@ -598,6 +682,83 @@ example().catch(console.error);
598
682
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
599
683
 
600
684
 
685
+ ## getCollectionOptions
686
+
687
+ > CollectionOptions getCollectionOptions(collectionName)
688
+
689
+ Collection Options
690
+
691
+ The options of a Collection: capped, the validator with its level and action, the collation. 404 for a Collection that does not exist.
692
+
693
+ ### Example
694
+
695
+ ```ts
696
+ import {
697
+ Configuration,
698
+ CollectionApi,
699
+ } from '';
700
+ import type { GetCollectionOptionsRequest } from '';
701
+
702
+ async function example() {
703
+ console.log("🚀 Testing SDK...");
704
+ const config = new Configuration({
705
+ // To configure HTTP basic authorization: httpAuth1
706
+ username: "YOUR USERNAME",
707
+ password: "YOUR PASSWORD",
708
+ // Configure HTTP bearer authorization: httpAuth
709
+ accessToken: "YOUR BEARER TOKEN",
710
+ // To configure API key authorization: apiKeyAuth
711
+ apiKey: "YOUR API KEY",
712
+ });
713
+ const api = new CollectionApi(config);
714
+
715
+ const body = {
716
+ // string | The name of your MongoDb Collection
717
+ collectionName: collectionName_example,
718
+ } satisfies GetCollectionOptionsRequest;
719
+
720
+ try {
721
+ const data = await api.getCollectionOptions(body);
722
+ console.log(data);
723
+ } catch (error) {
724
+ console.error(error);
725
+ }
726
+ }
727
+
728
+ // Run the test
729
+ example().catch(console.error);
730
+ ```
731
+
732
+ ### Parameters
733
+
734
+
735
+ | Name | Type | Description | Notes |
736
+ |------------- | ------------- | ------------- | -------------|
737
+ | **collectionName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
738
+
739
+ ### Return type
740
+
741
+ [**CollectionOptions**](CollectionOptions.md)
742
+
743
+ ### Authorization
744
+
745
+ [httpAuth1](../README.md#httpAuth1), [httpAuth](../README.md#httpAuth), [apiKeyAuth](../README.md#apiKeyAuth)
746
+
747
+ ### HTTP request headers
748
+
749
+ - **Content-Type**: Not defined
750
+ - **Accept**: `application/json`
751
+
752
+
753
+ ### HTTP response details
754
+ | Status code | Description | Response headers |
755
+ |-------------|-------------|------------------|
756
+ | **200** | | - |
757
+ | **0** | | * x-error-code - Error Code <br> * x-error-message - Message of the MongoCampException <br> * x-error-additional-info - Additional information for the MongoCampException <br> |
758
+
759
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
760
+
761
+
601
762
  ## getFieldDetails
602
763
 
603
764
  > Array&lt;FieldInfo&gt; getFieldDetails(collectionName, sampleSize, depth)
@@ -852,11 +1013,11 @@ example().catch(console.error);
852
1013
 
853
1014
  ## listCollectionInformation
854
1015
 
855
- > Array&lt;CollectionSummary&gt; listCollectionInformation(name)
1016
+ > Array&lt;CollectionSummary&gt; listCollectionInformation(name, database)
856
1017
 
857
1018
  Information of all Collections
858
1019
 
859
- 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.
1020
+ The numbers of all Collections of the default database (or of the database in &#x60;database&#x60;) 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.
860
1021
 
861
1022
  ### Example
862
1023
 
@@ -881,8 +1042,10 @@ async function example() {
881
1042
  const api = new CollectionApi(config);
882
1043
 
883
1044
  const body = {
884
- // Array<string> | Only the Collections with these names, by default all Collections that the user may read (optional)
1045
+ // Array<string> | Only the Collections with these names, by default all Collections that the user may read. With `database` the names are the names inside that database (`locations`), the full name (`geodata:locations`) of that database is accepted too. (optional)
885
1046
  name: ...,
1047
+ // string | The Collections of this database, by default the default database. The names in the answer are the full names (`geodata:locations`), as they are used in the paths of the other routes. (optional)
1048
+ database: database_example,
886
1049
  } satisfies ListCollectionInformationRequest;
887
1050
 
888
1051
  try {
@@ -902,7 +1065,8 @@ example().catch(console.error);
902
1065
 
903
1066
  | Name | Type | Description | Notes |
904
1067
  |------------- | ------------- | ------------- | -------------|
905
- | **name** | `Array<string>` | Only the Collections with these names, by default all Collections that the user may read | [Optional] |
1068
+ | **name** | `Array<string>` | Only the Collections with these names, by default all Collections that the user may read. With &#x60;database&#x60; the names are the names inside that database (&#x60;locations&#x60;), the full name (&#x60;geodata:locations&#x60;) of that database is accepted too. | [Optional] |
1069
+ | **database** | `string` | The Collections of this database, by default the default database. The names in the answer are the full names (&#x60;geodata:locations&#x60;), as they are used in the paths of the other routes. | [Optional] [Defaults to `undefined`] |
906
1070
 
907
1071
  ### Return type
908
1072
 
@@ -1073,6 +1237,87 @@ example().catch(console.error);
1073
1237
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
1074
1238
 
1075
1239
 
1240
+ ## modifyCollectionOptions
1241
+
1242
+ > CollectionOptions modifyCollectionOptions(collectionName, collectionOptions)
1243
+
1244
+ Change the Validation of a Collection
1245
+
1246
+ 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.
1247
+
1248
+ ### Example
1249
+
1250
+ ```ts
1251
+ import {
1252
+ Configuration,
1253
+ CollectionApi,
1254
+ } from '';
1255
+ import type { ModifyCollectionOptionsRequest } from '';
1256
+
1257
+ async function example() {
1258
+ console.log("🚀 Testing SDK...");
1259
+ const config = new Configuration({
1260
+ // To configure HTTP basic authorization: httpAuth1
1261
+ username: "YOUR USERNAME",
1262
+ password: "YOUR PASSWORD",
1263
+ // Configure HTTP bearer authorization: httpAuth
1264
+ accessToken: "YOUR BEARER TOKEN",
1265
+ // To configure API key authorization: apiKeyAuth
1266
+ apiKey: "YOUR API KEY",
1267
+ });
1268
+ const api = new CollectionApi(config);
1269
+
1270
+ const body = {
1271
+ // string | The name of your MongoDb Collection
1272
+ collectionName: collectionName_example,
1273
+ // CollectionOptions
1274
+ collectionOptions: ...,
1275
+ } satisfies ModifyCollectionOptionsRequest;
1276
+
1277
+ try {
1278
+ const data = await api.modifyCollectionOptions(body);
1279
+ console.log(data);
1280
+ } catch (error) {
1281
+ console.error(error);
1282
+ }
1283
+ }
1284
+
1285
+ // Run the test
1286
+ example().catch(console.error);
1287
+ ```
1288
+
1289
+ ### Parameters
1290
+
1291
+
1292
+ | Name | Type | Description | Notes |
1293
+ |------------- | ------------- | ------------- | -------------|
1294
+ | **collectionName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
1295
+ | **collectionOptions** | [CollectionOptions](CollectionOptions.md) | | |
1296
+
1297
+ ### Return type
1298
+
1299
+ [**CollectionOptions**](CollectionOptions.md)
1300
+
1301
+ ### Authorization
1302
+
1303
+ [httpAuth1](../README.md#httpAuth1), [httpAuth](../README.md#httpAuth), [apiKeyAuth](../README.md#apiKeyAuth)
1304
+
1305
+ ### HTTP request headers
1306
+
1307
+ - **Content-Type**: `application/json`
1308
+ - **Accept**: `application/json`, `text/plain`
1309
+
1310
+
1311
+ ### HTTP response details
1312
+ | Status code | Description | Response headers |
1313
+ |-------------|-------------|------------------|
1314
+ | **200** | | - |
1315
+ | **400** | Invalid value for: body | - |
1316
+ | **0** | | * x-error-code - Error Code <br> * x-error-message - Message of the MongoCampException <br> * x-error-additional-info - Additional information for the MongoCampException <br> |
1317
+
1318
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
1319
+
1320
+
1076
1321
  ## renameCollection
1077
1322
 
1078
1323
  > RenameResponse renameCollection(collectionName, renameRequest)
@@ -0,0 +1,40 @@
1
+
2
+ # CollectionCollation
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `locale` | string
10
+ `strength` | number
11
+ `caseLevel` | boolean
12
+ `numericOrdering` | boolean
13
+
14
+ ## Example
15
+
16
+ ```typescript
17
+ import type { CollectionCollation } from ''
18
+
19
+ // TODO: Update the object below with actual values
20
+ const example = {
21
+ "locale": null,
22
+ "strength": null,
23
+ "caseLevel": null,
24
+ "numericOrdering": null,
25
+ } satisfies CollectionCollation
26
+
27
+ console.log(example)
28
+
29
+ // Convert the instance to a JSON string
30
+ const exampleJSON: string = JSON.stringify(example)
31
+ console.log(exampleJSON)
32
+
33
+ // Parse the JSON string back to an object
34
+ const exampleParsed = JSON.parse(exampleJSON) as CollectionCollation
35
+ console.log(exampleParsed)
36
+ ```
37
+
38
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
39
+
40
+
@@ -0,0 +1,46 @@
1
+
2
+ # CollectionOptions
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `capped` | boolean
10
+ `sizeInBytes` | number
11
+ `maxDocuments` | number
12
+ `validator` | { [key: string]: any | null; }
13
+ `validationLevel` | string
14
+ `validationAction` | string
15
+ `collation` | [CollectionCollation](CollectionCollation.md)
16
+
17
+ ## Example
18
+
19
+ ```typescript
20
+ import type { CollectionOptions } from ''
21
+
22
+ // TODO: Update the object below with actual values
23
+ const example = {
24
+ "capped": null,
25
+ "sizeInBytes": null,
26
+ "maxDocuments": null,
27
+ "validator": null,
28
+ "validationLevel": null,
29
+ "validationAction": null,
30
+ "collation": null,
31
+ } satisfies CollectionOptions
32
+
33
+ console.log(example)
34
+
35
+ // Convert the instance to a JSON string
36
+ const exampleJSON: string = JSON.stringify(example)
37
+ console.log(exampleJSON)
38
+
39
+ // Parse the JSON string back to an object
40
+ const exampleParsed = JSON.parse(exampleJSON) as CollectionOptions
41
+ console.log(exampleParsed)
42
+ ```
43
+
44
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
45
+
46
+
@@ -0,0 +1,38 @@
1
+
2
+ # ConnectionStats
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `current` | number
10
+ `available` | number
11
+ `totalCreated` | number
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import type { ConnectionStats } from ''
17
+
18
+ // TODO: Update the object below with actual values
19
+ const example = {
20
+ "current": null,
21
+ "available": null,
22
+ "totalCreated": null,
23
+ } satisfies ConnectionStats
24
+
25
+ console.log(example)
26
+
27
+ // Convert the instance to a JSON string
28
+ const exampleJSON: string = JSON.stringify(example)
29
+ console.log(exampleJSON)
30
+
31
+ // Parse the JSON string back to an object
32
+ const exampleParsed = JSON.parse(exampleJSON) as ConnectionStats
33
+ console.log(exampleParsed)
34
+ ```
35
+
36
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
37
+
38
+