@sfxcode/nuxt-mongocamp-server 2.2.0 → 2.3.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.
Files changed (60) hide show
  1. package/README.md +52 -1
  2. package/dist/module.d.mts +10 -0
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +91 -11
  5. package/dist/runtime/api/.openapi-generator/FILES +18 -0
  6. package/dist/runtime/api/apis/CollectionApi.d.ts +124 -0
  7. package/dist/runtime/api/apis/CollectionApi.js +205 -0
  8. package/dist/runtime/api/apis/DocumentApi.d.ts +134 -0
  9. package/dist/runtime/api/apis/DocumentApi.js +208 -0
  10. package/dist/runtime/api/docs/AuditEntry.md +52 -0
  11. package/dist/runtime/api/docs/CollectionApi.md +269 -2
  12. package/dist/runtime/api/docs/CollectionDeclaration.md +52 -0
  13. package/dist/runtime/api/docs/CollectionDeclarationAudit.md +34 -0
  14. package/dist/runtime/api/docs/CollectionDeclarationOwner.md +36 -0
  15. package/dist/runtime/api/docs/CollectionDeclarationSoftDelete.md +36 -0
  16. package/dist/runtime/api/docs/CollectionDeclarationTimestamps.md +40 -0
  17. package/dist/runtime/api/docs/CollectionDeclarationVersioned.md +38 -0
  18. package/dist/runtime/api/docs/DocumentApi.md +282 -8
  19. package/dist/runtime/api/docs/ErrorDescription.md +4 -0
  20. package/dist/runtime/api/docs/SuggestedValidator.md +40 -0
  21. package/dist/runtime/api/docs/ValidationIssue.md +36 -0
  22. package/dist/runtime/api/models/AuditEntry.d.ts +88 -0
  23. package/dist/runtime/api/models/AuditEntry.js +56 -0
  24. package/dist/runtime/api/models/CollectionDeclaration.d.ts +80 -0
  25. package/dist/runtime/api/models/CollectionDeclaration.js +73 -0
  26. package/dist/runtime/api/models/CollectionDeclarationAudit.d.ts +30 -0
  27. package/dist/runtime/api/models/CollectionDeclarationAudit.js +26 -0
  28. package/dist/runtime/api/models/CollectionDeclarationOwner.d.ts +43 -0
  29. package/dist/runtime/api/models/CollectionDeclarationOwner.js +34 -0
  30. package/dist/runtime/api/models/CollectionDeclarationSoftDelete.d.ts +34 -0
  31. package/dist/runtime/api/models/CollectionDeclarationSoftDelete.js +28 -0
  32. package/dist/runtime/api/models/CollectionDeclarationTimestamps.d.ts +42 -0
  33. package/dist/runtime/api/models/CollectionDeclarationTimestamps.js +33 -0
  34. package/dist/runtime/api/models/CollectionDeclarationVersioned.d.ts +46 -0
  35. package/dist/runtime/api/models/CollectionDeclarationVersioned.js +36 -0
  36. package/dist/runtime/api/models/ErrorDescription.d.ts +11 -0
  37. package/dist/runtime/api/models/ErrorDescription.js +10 -2
  38. package/dist/runtime/api/models/SuggestedValidator.d.ts +44 -0
  39. package/dist/runtime/api/models/SuggestedValidator.js +35 -0
  40. package/dist/runtime/api/models/ValidationIssue.d.ts +34 -0
  41. package/dist/runtime/api/models/ValidationIssue.js +29 -0
  42. package/dist/runtime/api/models/index.d.ts +9 -0
  43. package/dist/runtime/api/models/index.js +9 -0
  44. package/dist/runtime/composables/mongocampApiCollection.d.ts +14 -15
  45. package/dist/runtime/composables/mongocampApiCollection.js +4 -1
  46. package/dist/runtime/composables/mongocampCollection.d.ts +106 -0
  47. package/dist/runtime/composables/mongocampCollection.js +200 -0
  48. package/dist/runtime/composables/mongocampLive.d.ts +33 -0
  49. package/dist/runtime/composables/mongocampLive.js +152 -0
  50. package/dist/runtime/composables/mongocampSearch.d.ts +12 -9
  51. package/dist/runtime/server/mongocamp/plugin.d.ts +2 -2
  52. package/dist/runtime/server/mongocamp/plugin.js +10 -1
  53. package/dist/runtime/types/collections.d.ts +20 -0
  54. package/dist/runtime/types/collections.js +0 -0
  55. package/dist/runtime/utils/sse.d.ts +10 -0
  56. package/dist/runtime/utils/sse.js +33 -0
  57. package/dist/runtime/utils/toMongocampError.d.ts +7 -0
  58. package/dist/runtime/utils/toMongocampError.js +18 -1
  59. package/dist/types.d.mts +6 -0
  60. package/package.json +4 -3
@@ -1,4 +1,7 @@
1
1
  import * as runtime from "../runtime.js";
2
+ import {
3
+ AuditEntryFromJSON
4
+ } from "../models/AuditEntry.js";
2
5
  import {
3
6
  CountRequestToJSON
4
7
  } from "../models/CountRequest.js";
@@ -99,6 +102,9 @@ export class DocumentApi extends runtime.BaseAPI {
99
102
  );
100
103
  }
101
104
  const queryParameters = {};
105
+ if (requestParameters["withDeleted"] != null) {
106
+ queryParameters["withDeleted"] = requestParameters["withDeleted"];
107
+ }
102
108
  if (requestParameters["filter"] != null) {
103
109
  queryParameters["filter"] = requestParameters["filter"];
104
110
  }
@@ -162,6 +168,9 @@ export class DocumentApi extends runtime.BaseAPI {
162
168
  );
163
169
  }
164
170
  const queryParameters = {};
171
+ if (requestParameters["withDeleted"] != null) {
172
+ queryParameters["withDeleted"] = requestParameters["withDeleted"];
173
+ }
165
174
  if (requestParameters["filterCaseInsensitive"] != null) {
166
175
  queryParameters["filterCaseInsensitive"] = requestParameters["filterCaseInsensitive"];
167
176
  }
@@ -286,6 +295,9 @@ export class DocumentApi extends runtime.BaseAPI {
286
295
  );
287
296
  }
288
297
  const queryParameters = {};
298
+ if (requestParameters["withDeleted"] != null) {
299
+ queryParameters["withDeleted"] = requestParameters["withDeleted"];
300
+ }
289
301
  if (requestParameters["format"] != null) {
290
302
  queryParameters["format"] = requestParameters["format"];
291
303
  }
@@ -371,6 +383,9 @@ export class DocumentApi extends runtime.BaseAPI {
371
383
  );
372
384
  }
373
385
  const queryParameters = {};
386
+ if (requestParameters["withDeleted"] != null) {
387
+ queryParameters["withDeleted"] = requestParameters["withDeleted"];
388
+ }
374
389
  if (requestParameters["format"] != null) {
375
390
  queryParameters["format"] = requestParameters["format"];
376
391
  }
@@ -446,6 +461,9 @@ export class DocumentApi extends runtime.BaseAPI {
446
461
  );
447
462
  }
448
463
  const queryParameters = {};
464
+ if (requestParameters["withDeleted"] != null) {
465
+ queryParameters["withDeleted"] = requestParameters["withDeleted"];
466
+ }
449
467
  if (requestParameters["rowsPerPage"] != null) {
450
468
  queryParameters["rowsPerPage"] = requestParameters["rowsPerPage"];
451
469
  }
@@ -520,6 +538,9 @@ export class DocumentApi extends runtime.BaseAPI {
520
538
  );
521
539
  }
522
540
  const queryParameters = {};
541
+ if (requestParameters["withDeleted"] != null) {
542
+ queryParameters["withDeleted"] = requestParameters["withDeleted"];
543
+ }
523
544
  if (requestParameters["extendedJson"] != null) {
524
545
  queryParameters["extendedJson"] = requestParameters["extendedJson"];
525
546
  }
@@ -564,6 +585,73 @@ export class DocumentApi extends runtime.BaseAPI {
564
585
  const response = await this.getDocumentRaw(requestParameters, initOverrides);
565
586
  return await response.value();
566
587
  }
588
+ /**
589
+ * Creates request options for getDocumentHistory without sending the request
590
+ */
591
+ async getDocumentHistoryRequestOpts(requestParameters) {
592
+ if (requestParameters["collectionName"] == null) {
593
+ throw new runtime.RequiredError(
594
+ "collectionName",
595
+ 'Required parameter "collectionName" was null or undefined when calling getDocumentHistory().'
596
+ );
597
+ }
598
+ if (requestParameters["documentId"] == null) {
599
+ throw new runtime.RequiredError(
600
+ "documentId",
601
+ 'Required parameter "documentId" was null or undefined when calling getDocumentHistory().'
602
+ );
603
+ }
604
+ const queryParameters = {};
605
+ if (requestParameters["rowsPerPage"] != null) {
606
+ queryParameters["rowsPerPage"] = requestParameters["rowsPerPage"];
607
+ }
608
+ if (requestParameters["page"] != null) {
609
+ queryParameters["page"] = requestParameters["page"];
610
+ }
611
+ if (requestParameters["extendedJson"] != null) {
612
+ queryParameters["extendedJson"] = requestParameters["extendedJson"];
613
+ }
614
+ const headerParameters = {};
615
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
616
+ headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
617
+ }
618
+ if (this.configuration && this.configuration.accessToken) {
619
+ const token = this.configuration.accessToken;
620
+ const tokenString = await token("httpAuth", []);
621
+ if (tokenString) {
622
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
623
+ }
624
+ }
625
+ if (this.configuration && this.configuration.apiKey) {
626
+ headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
627
+ }
628
+ let urlPath = `/mongodb/collections/{collectionName}/documents/{documentId}/history`;
629
+ urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
630
+ urlPath = urlPath.replace("{documentId}", encodeURIComponent(String(requestParameters["documentId"])));
631
+ return {
632
+ path: urlPath,
633
+ method: "GET",
634
+ headers: headerParameters,
635
+ query: queryParameters
636
+ };
637
+ }
638
+ /**
639
+ * The audit records of a document of a collection declared with audit, newest first (2.4.0). For users who can read the document; administrators of the collection also get the history of deleted documents. 404 for a collection without audit.
640
+ * History of a Document
641
+ */
642
+ async getDocumentHistoryRaw(requestParameters, initOverrides) {
643
+ const requestOptions = await this.getDocumentHistoryRequestOpts(requestParameters);
644
+ const response = await this.request(requestOptions, initOverrides);
645
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AuditEntryFromJSON));
646
+ }
647
+ /**
648
+ * The audit records of a document of a collection declared with audit, newest first (2.4.0). For users who can read the document; administrators of the collection also get the history of deleted documents. 404 for a collection without audit.
649
+ * History of a Document
650
+ */
651
+ async getDocumentHistory(requestParameters, initOverrides) {
652
+ const response = await this.getDocumentHistoryRaw(requestParameters, initOverrides);
653
+ return await response.value();
654
+ }
567
655
  /**
568
656
  * Creates request options for importDocuments without sending the request
569
657
  */
@@ -749,6 +837,9 @@ export class DocumentApi extends runtime.BaseAPI {
749
837
  );
750
838
  }
751
839
  const queryParameters = {};
840
+ if (requestParameters["withDeleted"] != null) {
841
+ queryParameters["withDeleted"] = requestParameters["withDeleted"];
842
+ }
752
843
  if (requestParameters["filter"] != null) {
753
844
  queryParameters["filter"] = requestParameters["filter"];
754
845
  }
@@ -816,6 +907,64 @@ export class DocumentApi extends runtime.BaseAPI {
816
907
  const response = await this.listDocumentsRaw(requestParameters, initOverrides);
817
908
  return await response.value();
818
909
  }
910
+ /**
911
+ * Creates request options for restoreDocument without sending the request
912
+ */
913
+ async restoreDocumentRequestOpts(requestParameters) {
914
+ if (requestParameters["collectionName"] == null) {
915
+ throw new runtime.RequiredError(
916
+ "collectionName",
917
+ 'Required parameter "collectionName" was null or undefined when calling restoreDocument().'
918
+ );
919
+ }
920
+ if (requestParameters["documentId"] == null) {
921
+ throw new runtime.RequiredError(
922
+ "documentId",
923
+ 'Required parameter "documentId" was null or undefined when calling restoreDocument().'
924
+ );
925
+ }
926
+ const queryParameters = {};
927
+ const headerParameters = {};
928
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
929
+ headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
930
+ }
931
+ if (this.configuration && this.configuration.accessToken) {
932
+ const token = this.configuration.accessToken;
933
+ const tokenString = await token("httpAuth", []);
934
+ if (tokenString) {
935
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
936
+ }
937
+ }
938
+ if (this.configuration && this.configuration.apiKey) {
939
+ headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
940
+ }
941
+ let urlPath = `/mongodb/collections/{collectionName}/documents/{documentId}/restore`;
942
+ urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
943
+ urlPath = urlPath.replace("{documentId}", encodeURIComponent(String(requestParameters["documentId"])));
944
+ return {
945
+ path: urlPath,
946
+ method: "POST",
947
+ headers: headerParameters,
948
+ query: queryParameters
949
+ };
950
+ }
951
+ /**
952
+ * Removes the deleted mark of a document of a collection declared with softDelete (2.4.0). 404 for a collection without soft delete and for a document that is missing or not deleted.
953
+ * Restore a soft-deleted Document
954
+ */
955
+ async restoreDocumentRaw(requestParameters, initOverrides) {
956
+ const requestOptions = await this.restoreDocumentRequestOpts(requestParameters);
957
+ const response = await this.request(requestOptions, initOverrides);
958
+ return new runtime.JSONApiResponse(response, (jsonValue) => UpdateResponseFromJSON(jsonValue));
959
+ }
960
+ /**
961
+ * Removes the deleted mark of a document of a collection declared with softDelete (2.4.0). 404 for a collection without soft delete and for a document that is missing or not deleted.
962
+ * Restore a soft-deleted Document
963
+ */
964
+ async restoreDocument(requestParameters, initOverrides) {
965
+ const response = await this.restoreDocumentRaw(requestParameters, initOverrides);
966
+ return await response.value();
967
+ }
819
968
  /**
820
969
  * Creates request options for searchDocuments without sending the request
821
970
  */
@@ -833,6 +982,9 @@ export class DocumentApi extends runtime.BaseAPI {
833
982
  );
834
983
  }
835
984
  const queryParameters = {};
985
+ if (requestParameters["withDeleted"] != null) {
986
+ queryParameters["withDeleted"] = requestParameters["withDeleted"];
987
+ }
836
988
  if (requestParameters["rowsPerPage"] != null) {
837
989
  queryParameters["rowsPerPage"] = requestParameters["rowsPerPage"];
838
990
  }
@@ -1093,6 +1245,57 @@ export class DocumentApi extends runtime.BaseAPI {
1093
1245
  const response = await this.updateManyRaw(requestParameters, initOverrides);
1094
1246
  return await response.value();
1095
1247
  }
1248
+ /**
1249
+ * Creates request options for watchDocuments without sending the request
1250
+ */
1251
+ async watchDocumentsRequestOpts(requestParameters) {
1252
+ if (requestParameters["collectionName"] == null) {
1253
+ throw new runtime.RequiredError(
1254
+ "collectionName",
1255
+ 'Required parameter "collectionName" was null or undefined when calling watchDocuments().'
1256
+ );
1257
+ }
1258
+ const queryParameters = {};
1259
+ if (requestParameters["filter"] != null) {
1260
+ queryParameters["filter"] = requestParameters["filter"];
1261
+ }
1262
+ if (requestParameters["filterCaseInsensitive"] != null) {
1263
+ queryParameters["filterCaseInsensitive"] = requestParameters["filterCaseInsensitive"];
1264
+ }
1265
+ const headerParameters = {};
1266
+ if (requestParameters["lastEventID"] != null) {
1267
+ headerParameters["Last-Event-ID"] = String(requestParameters["lastEventID"]);
1268
+ }
1269
+ let urlPath = `/mongodb/collections/{collectionName}/documents/watch`;
1270
+ urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
1271
+ return {
1272
+ path: urlPath,
1273
+ method: "GET",
1274
+ headers: headerParameters,
1275
+ query: queryParameters
1276
+ };
1277
+ }
1278
+ /**
1279
+ * The changes of the documents as Server-Sent Events (2.4.0), scoped like every read and by `filter`. Events: `upsert` (data `{ id, document }`, a document that is in the scope), `remove` (data `{ id }`, deleted or left the scope), `reset` (the client loads again). The `id` of an event is the resume token: send it as `Last-Event-ID` to resume. A comment every 25 seconds. Needs a replica set or a sharded cluster: 501 (code 5011) otherwise; at most `WATCH_MAX_STREAMS` streams per instance (503).
1280
+ * Live Updates of a Collection
1281
+ */
1282
+ async watchDocumentsRaw(requestParameters, initOverrides) {
1283
+ const requestOptions = await this.watchDocumentsRequestOpts(requestParameters);
1284
+ const response = await this.request(requestOptions, initOverrides);
1285
+ if (this.isJsonMime(response.headers.get("content-type"))) {
1286
+ return new runtime.JSONApiResponse(response);
1287
+ } else {
1288
+ return new runtime.TextApiResponse(response);
1289
+ }
1290
+ }
1291
+ /**
1292
+ * The changes of the documents as Server-Sent Events (2.4.0), scoped like every read and by `filter`. Events: `upsert` (data `{ id, document }`, a document that is in the scope), `remove` (data `{ id }`, deleted or left the scope), `reset` (the client loads again). The `id` of an event is the resume token: send it as `Last-Event-ID` to resume. A comment every 25 seconds. Needs a replica set or a sharded cluster: 501 (code 5011) otherwise; at most `WATCH_MAX_STREAMS` streams per instance (503).
1293
+ * Live Updates of a Collection
1294
+ */
1295
+ async watchDocuments(requestParameters, initOverrides) {
1296
+ const response = await this.watchDocumentsRaw(requestParameters, initOverrides);
1297
+ return await response.value();
1298
+ }
1096
1299
  }
1097
1300
  export const ExportDocumentsExtendedJsonEnum = {
1098
1301
  Relaxed: "relaxed",
@@ -1118,6 +1321,11 @@ export const GetDocumentExtendedJsonEnum = {
1118
1321
  Canonical: "canonical",
1119
1322
  Plain: "plain"
1120
1323
  };
1324
+ export const GetDocumentHistoryExtendedJsonEnum = {
1325
+ Relaxed: "relaxed",
1326
+ Canonical: "canonical",
1327
+ Plain: "plain"
1328
+ };
1121
1329
  export const ListDocumentsCountEnum = {
1122
1330
  Exact: "exact",
1123
1331
  None: "none"
@@ -0,0 +1,52 @@
1
+
2
+ # AuditEntry
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `collection` | string
10
+ `database` | string
11
+ `documentId` | any
12
+ `operation` | string
13
+ `user` | string
14
+ `at` | { [key: string]: any; }
15
+ `before` | { [key: string]: any; }
16
+ `after` | { [key: string]: any; }
17
+ `summary` | { [key: string]: any; }
18
+ `expiresAt` | { [key: string]: any; }
19
+
20
+ ## Example
21
+
22
+ ```typescript
23
+ import type { AuditEntry } from ''
24
+
25
+ // TODO: Update the object below with actual values
26
+ const example = {
27
+ "collection": null,
28
+ "database": null,
29
+ "documentId": null,
30
+ "operation": null,
31
+ "user": null,
32
+ "at": null,
33
+ "before": null,
34
+ "after": null,
35
+ "summary": null,
36
+ "expiresAt": null,
37
+ } satisfies AuditEntry
38
+
39
+ console.log(example)
40
+
41
+ // Convert the instance to a JSON string
42
+ const exampleJSON: string = JSON.stringify(example)
43
+ console.log(exampleJSON)
44
+
45
+ // Parse the JSON string back to an object
46
+ const exampleParsed = JSON.parse(exampleJSON) as AuditEntry
47
+ console.log(exampleParsed)
48
+ ```
49
+
50
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
51
+
52
+
@@ -10,12 +10,15 @@ All URIs are relative to *http://localhost*
10
10
  | [**createCollection**](CollectionApi.md#createcollection) | **PUT** /mongodb/collections/{collectionName} | Create Collection |
11
11
  | [**deleteCollection**](CollectionApi.md#deletecollection) | **DELETE** /mongodb/collections/{collectionName} | Delete Collection |
12
12
  | [**distinct**](CollectionApi.md#distinct) | **POST** /mongodb/collections/{collectionName}/distinct/{field} | Distinct in Collection |
13
+ | [**getCollectionDeclaration**](CollectionApi.md#getcollectiondeclaration) | **GET** /mongodb/collections/{collectionName}/declaration | Declaration of a Collection |
13
14
  | [**getCollectionFields**](CollectionApi.md#getcollectionfields) | **GET** /mongodb/collections/{collectionName}/fields | Collection Fields |
15
+ | [**getCollectionHistory**](CollectionApi.md#getcollectionhistory) | **GET** /mongodb/collections/{collectionName}/history | History of a Collection |
14
16
  | [**getCollectionInformation**](CollectionApi.md#getcollectioninformation) | **GET** /mongodb/collections/{collectionName} | Collection Information |
15
17
  | [**getCollectionOptions**](CollectionApi.md#getcollectionoptions) | **GET** /mongodb/collections/{collectionName}/options | Collection Options |
16
18
  | [**getFieldDetails**](CollectionApi.md#getfielddetails) | **GET** /mongodb/collections/{collectionName}/fields/detail | Fields of a Collection with types |
17
19
  | [**getJsonSchema**](CollectionApi.md#getjsonschema) | **GET** /mongodb/collections/{collectionName}/schema | Collection Fields |
18
20
  | [**getSchemaAnalysis**](CollectionApi.md#getschemaanalysis) | **GET** /mongodb/collections/{collectionName}/schema/analysis | Collection Fields |
21
+ | [**getSuggestedValidator**](CollectionApi.md#getsuggestedvalidator) | **GET** /mongodb/collections/{collectionName}/schema/validator | Suggested Validator |
19
22
  | [**listCollectionInformation**](CollectionApi.md#listcollectioninformation) | **GET** /mongodb/collections/info | Information of all Collections |
20
23
  | [**listCollections**](CollectionApi.md#listcollections) | **GET** /mongodb/collections | List of Collections |
21
24
  | [**listCollectionsByDatabase**](CollectionApi.md#listcollectionsbydatabase) | **GET** /mongodb/databases/{databaseName}/collections | List of Collections |
@@ -26,7 +29,7 @@ All URIs are relative to *http://localhost*
26
29
 
27
30
  ## aggregate
28
31
 
29
- > Array<{ [key: string]: any | null; }> aggregate(collectionName, mongoAggregateRequest, rowsPerPage, page, count, filter, extendedJson, filterCaseInsensitive)
32
+ > Array<{ [key: string]: any | null; }> aggregate(collectionName, mongoAggregateRequest, withDeleted, rowsPerPage, page, count, filter, extendedJson, filterCaseInsensitive)
30
33
 
31
34
  Aggregate in Collection
32
35
 
@@ -59,6 +62,8 @@ async function example() {
59
62
  collectionName: collectionName_example,
60
63
  // MongoAggregateRequest
61
64
  mongoAggregateRequest: ...,
65
+ // boolean | Soft-deleted documents too (collections declared with softDelete, 2.4.0); needs the administrate grant of the collection, 403 otherwise. (optional)
66
+ withDeleted: true,
62
67
  // number | Count elements per page (optional)
63
68
  rowsPerPage: 100,
64
69
  // number | Requested page of the ResultSets (optional)
@@ -92,6 +97,7 @@ example().catch(console.error);
92
97
  |------------- | ------------- | ------------- | -------------|
93
98
  | **collectionName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
94
99
  | **mongoAggregateRequest** | [MongoAggregateRequest](MongoAggregateRequest.md) | | |
100
+ | **withDeleted** | `boolean` | Soft-deleted documents too (collections declared with softDelete, 2.4.0); needs the administrate grant of the collection, 403 otherwise. | [Optional] [Defaults to `false`] |
95
101
  | **rowsPerPage** | `number` | Count elements per page | [Optional] [Defaults to `undefined`] |
96
102
  | **page** | `number` | Requested page of the ResultSets | [Optional] [Defaults to `undefined`] |
97
103
  | **count** | `exact`, `none` | How the result is counted: exact (default) or none (no count headers, no count query) | [Optional] [Defaults to `'exact'`] [Enum: exact, none] |
@@ -444,7 +450,7 @@ example().catch(console.error);
444
450
 
445
451
  ## distinct
446
452
 
447
- > Array<any> distinct(collectionName, field, rowsPerPage, page, count, extendedJson)
453
+ > Array<any> distinct(collectionName, field, withDeleted, rowsPerPage, page, count, extendedJson)
448
454
 
449
455
  Distinct in Collection
450
456
 
@@ -477,6 +483,8 @@ async function example() {
477
483
  collectionName: collectionName_example,
478
484
  // string | The field for your distinct Request.
479
485
  field: field_example,
486
+ // boolean | Soft-deleted documents too (collections declared with softDelete, 2.4.0); needs the administrate grant of the collection, 403 otherwise. (optional)
487
+ withDeleted: true,
480
488
  // number | Count elements per page (optional)
481
489
  rowsPerPage: 100,
482
490
  // number | Requested page of the ResultSets (optional)
@@ -506,6 +514,7 @@ example().catch(console.error);
506
514
  |------------- | ------------- | ------------- | -------------|
507
515
  | **collectionName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
508
516
  | **field** | `string` | The field for your distinct Request. | [Defaults to `undefined`] |
517
+ | **withDeleted** | `boolean` | Soft-deleted documents too (collections declared with softDelete, 2.4.0); needs the administrate grant of the collection, 403 otherwise. | [Optional] [Defaults to `false`] |
509
518
  | **rowsPerPage** | `number` | Count elements per page | [Optional] [Defaults to `undefined`] |
510
519
  | **page** | `number` | Requested page of the ResultSets | [Optional] [Defaults to `undefined`] |
511
520
  | **count** | `exact`, `none` | How the result is counted: exact (default) or none (no count headers, no count query) | [Optional] [Defaults to `'exact'`] [Enum: exact, none] |
@@ -535,6 +544,84 @@ example().catch(console.error);
535
544
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
536
545
 
537
546
 
547
+ ## getCollectionDeclaration
548
+
549
+ > CollectionDeclaration getCollectionDeclaration(collectionName)
550
+
551
+ Declaration of a Collection
552
+
553
+ What a client needs to know of a declared collection (2.4.0): fields it must not send, version and owner fields, behaviours. 404 for a collection that is not declared.
554
+
555
+ ### Example
556
+
557
+ ```ts
558
+ import {
559
+ Configuration,
560
+ CollectionApi,
561
+ } from '';
562
+ import type { GetCollectionDeclarationRequest } from '';
563
+
564
+ async function example() {
565
+ console.log("🚀 Testing SDK...");
566
+ const config = new Configuration({
567
+ // To configure HTTP basic authorization: httpAuth1
568
+ username: "YOUR USERNAME",
569
+ password: "YOUR PASSWORD",
570
+ // Configure HTTP bearer authorization: httpAuth
571
+ accessToken: "YOUR BEARER TOKEN",
572
+ // To configure API key authorization: apiKeyAuth
573
+ apiKey: "YOUR API KEY",
574
+ });
575
+ const api = new CollectionApi(config);
576
+
577
+ const body = {
578
+ // string | The name of your MongoDb Collection
579
+ collectionName: collectionName_example,
580
+ } satisfies GetCollectionDeclarationRequest;
581
+
582
+ try {
583
+ const data = await api.getCollectionDeclaration(body);
584
+ console.log(data);
585
+ } catch (error) {
586
+ console.error(error);
587
+ }
588
+ }
589
+
590
+ // Run the test
591
+ example().catch(console.error);
592
+ ```
593
+
594
+ ### Parameters
595
+
596
+
597
+ | Name | Type | Description | Notes |
598
+ |------------- | ------------- | ------------- | -------------|
599
+ | **collectionName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
600
+
601
+ ### Return type
602
+
603
+ [**CollectionDeclaration**](CollectionDeclaration.md)
604
+
605
+ ### Authorization
606
+
607
+ [httpAuth1](../README.md#httpAuth1), [httpAuth](../README.md#httpAuth), [apiKeyAuth](../README.md#apiKeyAuth)
608
+
609
+ ### HTTP request headers
610
+
611
+ - **Content-Type**: Not defined
612
+ - **Accept**: `application/json`, `text/plain`
613
+
614
+
615
+ ### HTTP response details
616
+ | Status code | Description | Response headers |
617
+ |-------------|-------------|------------------|
618
+ | **200** | | - |
619
+ | **400** | Invalid value for: body | - |
620
+ | **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> |
621
+
622
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
623
+
624
+
538
625
  ## getCollectionFields
539
626
 
540
627
  > Array&lt;string&gt; getCollectionFields(collectionName, sampleSize)
@@ -616,6 +703,99 @@ example().catch(console.error);
616
703
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
617
704
 
618
705
 
706
+ ## getCollectionHistory
707
+
708
+ > Array&lt;AuditEntry&gt; getCollectionHistory(collectionName, since, operation, rowsPerPage, page, extendedJson)
709
+
710
+ History of a Collection
711
+
712
+ The audit records of a collection declared with audit, newest first (2.4.0); for the administrators of the collection. 404 for a collection without audit.
713
+
714
+ ### Example
715
+
716
+ ```ts
717
+ import {
718
+ Configuration,
719
+ CollectionApi,
720
+ } from '';
721
+ import type { GetCollectionHistoryRequest } from '';
722
+
723
+ async function example() {
724
+ console.log("🚀 Testing SDK...");
725
+ const config = new Configuration({
726
+ // To configure HTTP basic authorization: httpAuth1
727
+ username: "YOUR USERNAME",
728
+ password: "YOUR PASSWORD",
729
+ // Configure HTTP bearer authorization: httpAuth
730
+ accessToken: "YOUR BEARER TOKEN",
731
+ // To configure API key authorization: apiKeyAuth
732
+ apiKey: "YOUR API KEY",
733
+ });
734
+ const api = new CollectionApi(config);
735
+
736
+ const body = {
737
+ // string | The name of your MongoDb Collection
738
+ collectionName: collectionName_example,
739
+ // string | Only records from this time on (ISO date or time). (optional)
740
+ since: since_example,
741
+ // 'insert' | 'replace' | 'update' | 'delete' | 'softDelete' | 'restore' | Only records of this operation. (optional)
742
+ operation: operation_example,
743
+ // number (optional)
744
+ rowsPerPage: 789,
745
+ // number (optional)
746
+ page: 789,
747
+ // 'relaxed' | 'canonical' | 'plain' | relaxed (default), canonical or plain, as for the documents. (optional)
748
+ extendedJson: extendedJson_example,
749
+ } satisfies GetCollectionHistoryRequest;
750
+
751
+ try {
752
+ const data = await api.getCollectionHistory(body);
753
+ console.log(data);
754
+ } catch (error) {
755
+ console.error(error);
756
+ }
757
+ }
758
+
759
+ // Run the test
760
+ example().catch(console.error);
761
+ ```
762
+
763
+ ### Parameters
764
+
765
+
766
+ | Name | Type | Description | Notes |
767
+ |------------- | ------------- | ------------- | -------------|
768
+ | **collectionName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
769
+ | **since** | `string` | Only records from this time on (ISO date or time). | [Optional] [Defaults to `undefined`] |
770
+ | **operation** | `insert`, `replace`, `update`, `delete`, `softDelete`, `restore` | Only records of this operation. | [Optional] [Defaults to `undefined`] [Enum: insert, replace, update, delete, softDelete, restore] |
771
+ | **rowsPerPage** | `number` | | [Optional] [Defaults to `undefined`] |
772
+ | **page** | `number` | | [Optional] [Defaults to `undefined`] |
773
+ | **extendedJson** | `relaxed`, `canonical`, `plain` | relaxed (default), canonical or plain, as for the documents. | [Optional] [Defaults to `undefined`] [Enum: relaxed, canonical, plain] |
774
+
775
+ ### Return type
776
+
777
+ [**Array&lt;AuditEntry&gt;**](AuditEntry.md)
778
+
779
+ ### Authorization
780
+
781
+ [httpAuth1](../README.md#httpAuth1), [httpAuth](../README.md#httpAuth), [apiKeyAuth](../README.md#apiKeyAuth)
782
+
783
+ ### HTTP request headers
784
+
785
+ - **Content-Type**: Not defined
786
+ - **Accept**: `application/json`, `text/plain`
787
+
788
+
789
+ ### HTTP response details
790
+ | Status code | Description | Response headers |
791
+ |-------------|-------------|------------------|
792
+ | **200** | | - |
793
+ | **400** | Invalid value for: body | - |
794
+ | **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> |
795
+
796
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
797
+
798
+
619
799
  ## getCollectionInformation
620
800
 
621
801
  > CollectionStatus getCollectionInformation(collectionName, includeDetails)
@@ -1026,6 +1206,93 @@ example().catch(console.error);
1026
1206
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
1027
1207
 
1028
1208
 
1209
+ ## getSuggestedValidator
1210
+
1211
+ > SuggestedValidator getSuggestedValidator(collectionName, sampleSize, depth, requiredThreshold)
1212
+
1213
+ Suggested Validator
1214
+
1215
+ A $jsonSchema validator made of a sample of the documents (2.3.0): the BSON types per field, nested objects, array items and the required fields. Usable as validator of the collection options or of a declaration. 404 for a collection that does not exist.
1216
+
1217
+ ### Example
1218
+
1219
+ ```ts
1220
+ import {
1221
+ Configuration,
1222
+ CollectionApi,
1223
+ } from '';
1224
+ import type { GetSuggestedValidatorRequest } from '';
1225
+
1226
+ async function example() {
1227
+ console.log("🚀 Testing SDK...");
1228
+ const config = new Configuration({
1229
+ // To configure HTTP basic authorization: httpAuth1
1230
+ username: "YOUR USERNAME",
1231
+ password: "YOUR PASSWORD",
1232
+ // Configure HTTP bearer authorization: httpAuth
1233
+ accessToken: "YOUR BEARER TOKEN",
1234
+ // To configure API key authorization: apiKeyAuth
1235
+ apiKey: "YOUR API KEY",
1236
+ });
1237
+ const api = new CollectionApi(config);
1238
+
1239
+ const body = {
1240
+ // string | The name of your MongoDb Collection
1241
+ collectionName: collectionName_example,
1242
+ // number | Number of documents that are analysed, 1000 by default (2.0.0; 1.x read every document); 0 reads every document. With a sample the counts and shares are estimates. (optional)
1243
+ sampleSize: 1000,
1244
+ // number | How deep nested objects are analysed (optional)
1245
+ depth: 56,
1246
+ // number | The share of the objects (0 to 1) a field has to be in to be required; 1 by default (in every object of the sample). (optional)
1247
+ requiredThreshold: 1.2,
1248
+ } satisfies GetSuggestedValidatorRequest;
1249
+
1250
+ try {
1251
+ const data = await api.getSuggestedValidator(body);
1252
+ console.log(data);
1253
+ } catch (error) {
1254
+ console.error(error);
1255
+ }
1256
+ }
1257
+
1258
+ // Run the test
1259
+ example().catch(console.error);
1260
+ ```
1261
+
1262
+ ### Parameters
1263
+
1264
+
1265
+ | Name | Type | Description | Notes |
1266
+ |------------- | ------------- | ------------- | -------------|
1267
+ | **collectionName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
1268
+ | **sampleSize** | `number` | Number of documents that are analysed, 1000 by default (2.0.0; 1.x read every document); 0 reads every document. With a sample the counts and shares are estimates. | [Optional] [Defaults to `1000`] |
1269
+ | **depth** | `number` | How deep nested objects are analysed | [Optional] [Defaults to `3`] |
1270
+ | **requiredThreshold** | `number` | The share of the objects (0 to 1) a field has to be in to be required; 1 by default (in every object of the sample). | [Optional] [Defaults to `1`] |
1271
+
1272
+ ### Return type
1273
+
1274
+ [**SuggestedValidator**](SuggestedValidator.md)
1275
+
1276
+ ### Authorization
1277
+
1278
+ [httpAuth1](../README.md#httpAuth1), [httpAuth](../README.md#httpAuth), [apiKeyAuth](../README.md#apiKeyAuth)
1279
+
1280
+ ### HTTP request headers
1281
+
1282
+ - **Content-Type**: Not defined
1283
+ - **Accept**: `application/json`, `text/plain`
1284
+
1285
+
1286
+ ### HTTP response details
1287
+ | Status code | Description | Response headers |
1288
+ |-------------|-------------|------------------|
1289
+ | **200** | | - |
1290
+ | **400** | Invalid value for: query parameter sampleSize, Invalid value for: query parameter depth, Invalid value for: query parameter requiredThreshold | - |
1291
+ | **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> |
1292
+
1293
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
1294
+
1295
+
1029
1296
  ## listCollectionInformation
1030
1297
 
1031
1298
  > Array&lt;CollectionSummary&gt; listCollectionInformation(name, database)