@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
@@ -12,14 +12,17 @@ All URIs are relative to *http://localhost*
12
12
  | [**exportDocumentsByBody**](DocumentApi.md#exportdocumentsbybody) | **POST** /mongodb/collections/{collectionName}/documents/export | Export Documents of a Collection (filter in the body) |
13
13
  | [**find**](DocumentApi.md#find) | **POST** /mongodb/collections/{collectionName}/documents | Documents in Collection |
14
14
  | [**getDocument**](DocumentApi.md#getdocument) | **GET** /mongodb/collections/{collectionName}/documents/{documentId} | Document from Collection |
15
+ | [**getDocumentHistory**](DocumentApi.md#getdocumenthistory) | **GET** /mongodb/collections/{collectionName}/documents/{documentId}/history | History of a Document |
15
16
  | [**importDocuments**](DocumentApi.md#importdocuments) | **POST** /mongodb/collections/{collectionName}/documents/import | Import Documents into a Collection |
16
17
  | [**insert**](DocumentApi.md#insert) | **PUT** /mongodb/collections/{collectionName}/documents | Insert Document |
17
18
  | [**insertMany**](DocumentApi.md#insertmany) | **PUT** /mongodb/collections/{collectionName}/documents/many/insert | Insert many Documents |
18
19
  | [**listDocuments**](DocumentApi.md#listdocuments) | **GET** /mongodb/collections/{collectionName}/documents | Documents in Collection |
20
+ | [**restoreDocument**](DocumentApi.md#restoredocument) | **POST** /mongodb/collections/{collectionName}/documents/{documentId}/restore | Restore a soft-deleted Document |
19
21
  | [**searchDocuments**](DocumentApi.md#searchdocuments) | **POST** /mongodb/collections/{collectionName}/documents/search | Search Documents in Collection |
20
22
  | [**update**](DocumentApi.md#update) | **PATCH** /mongodb/collections/{collectionName}/documents/{documentId} | Update Document in Collection |
21
23
  | [**updateDocumentPartial**](DocumentApi.md#updatedocumentpartial) | **PATCH** /mongodb/collections/{collectionName}/documents/{documentId}/partial | Update Document Parts in Collection |
22
24
  | [**updateMany**](DocumentApi.md#updatemanyoperation) | **PATCH** /mongodb/collections/{collectionName}/documents/many/update | Update many in Collection |
25
+ | [**watchDocuments**](DocumentApi.md#watchdocuments) | **GET** /mongodb/collections/{collectionName}/documents/watch | Live Updates of a Collection |
23
26
 
24
27
 
25
28
 
@@ -105,7 +108,7 @@ example().catch(console.error);
105
108
 
106
109
  ## countDocuments
107
110
 
108
- > CountResponse countDocuments(collectionName, filter, filterCaseInsensitive)
111
+ > CountResponse countDocuments(collectionName, withDeleted, filter, filterCaseInsensitive)
109
112
 
110
113
  Count Documents in Collection
111
114
 
@@ -136,6 +139,8 @@ async function example() {
136
139
  const body = {
137
140
  // string | The name of your MongoDb Collection
138
141
  collectionName: collectionName_example,
142
+ // boolean | Soft-deleted documents too (collections declared with softDelete, 2.4.0); needs the administrate grant of the collection, 403 otherwise. (optional)
143
+ withDeleted: true,
139
144
  // string | Filter Query like on the list of documents, by default all documents are counted (optional)
140
145
  filter: filter_example,
141
146
  // boolean | true: wildcards and prefixes of the Lucene filter ignore the case (the behaviour before 2.0.0). By default they are case-sensitive, so an index on the field serves a prefix like name:abc* (optional)
@@ -160,6 +165,7 @@ example().catch(console.error);
160
165
  | Name | Type | Description | Notes |
161
166
  |------------- | ------------- | ------------- | -------------|
162
167
  | **collectionName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
168
+ | **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`] |
163
169
  | **filter** | `string` | Filter Query like on the list of documents, by default all documents are counted | [Optional] [Defaults to `undefined`] |
164
170
  | **filterCaseInsensitive** | `boolean` | true: wildcards and prefixes of the Lucene filter ignore the case (the behaviour before 2.0.0). By default they are case-sensitive, so an index on the field serves a prefix like name:abc* | [Optional] [Defaults to `false`] |
165
171
 
@@ -188,7 +194,7 @@ example().catch(console.error);
188
194
 
189
195
  ## countDocumentsByBody
190
196
 
191
- > CountResponse countDocumentsByBody(collectionName, countRequest, filterCaseInsensitive)
197
+ > CountResponse countDocumentsByBody(collectionName, countRequest, withDeleted, filterCaseInsensitive)
192
198
 
193
199
  Count Documents in Collection (filter in the body)
194
200
 
@@ -221,6 +227,8 @@ async function example() {
221
227
  collectionName: collectionName_example,
222
228
  // CountRequest
223
229
  countRequest: {"filter":"country:DE"},
230
+ // boolean | Soft-deleted documents too (collections declared with softDelete, 2.4.0); needs the administrate grant of the collection, 403 otherwise. (optional)
231
+ withDeleted: true,
224
232
  // boolean | true: wildcards and prefixes of the Lucene filter ignore the case (the behaviour before 2.0.0). By default they are case-sensitive, so an index on the field serves a prefix like name:abc* (optional)
225
233
  filterCaseInsensitive: false,
226
234
  } satisfies CountDocumentsByBodyRequest;
@@ -244,6 +252,7 @@ example().catch(console.error);
244
252
  |------------- | ------------- | ------------- | -------------|
245
253
  | **collectionName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
246
254
  | **countRequest** | [CountRequest](CountRequest.md) | | |
255
+ | **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`] |
247
256
  | **filterCaseInsensitive** | `boolean` | true: wildcards and prefixes of the Lucene filter ignore the case (the behaviour before 2.0.0). By default they are case-sensitive, so an index on the field serves a prefix like name:abc* | [Optional] [Defaults to `false`] |
248
257
 
249
258
  ### Return type
@@ -361,7 +370,7 @@ example().catch(console.error);
361
370
 
362
371
  ## exportDocuments
363
372
 
364
- > string exportDocuments(collectionName, format, filter, sort, projection, limit, extendedJson, filterCaseInsensitive, trailer)
373
+ > string exportDocuments(collectionName, withDeleted, format, filter, sort, projection, limit, extendedJson, filterCaseInsensitive, trailer)
365
374
 
366
375
  Export Documents of a Collection
367
376
 
@@ -392,6 +401,8 @@ async function example() {
392
401
  const body = {
393
402
  // string | The name of your MongoDb Collection
394
403
  collectionName: collectionName_example,
404
+ // boolean | Soft-deleted documents too (collections declared with softDelete, 2.4.0); needs the administrate grant of the collection, 403 otherwise. (optional)
405
+ withDeleted: true,
395
406
  // string | ndjson (one JSON document per line), json (one array) or csv (optional)
396
407
  format: format_example,
397
408
  // string | Filter Query like on the list of documents, by default all documents are exported (optional)
@@ -428,6 +439,7 @@ example().catch(console.error);
428
439
  | Name | Type | Description | Notes |
429
440
  |------------- | ------------- | ------------- | -------------|
430
441
  | **collectionName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
442
+ | **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`] |
431
443
  | **format** | `string` | ndjson (one JSON document per line), json (one array) or csv | [Optional] [Defaults to `'ndjson'`] |
432
444
  | **filter** | `string` | Filter Query like on the list of documents, by default all documents are exported | [Optional] [Defaults to `undefined`] |
433
445
  | **sort** | `Array<string>` | Sorting like on the list of documents, a leading - sorts descending | [Optional] |
@@ -463,7 +475,7 @@ example().catch(console.error);
463
475
 
464
476
  ## exportDocumentsByBody
465
477
 
466
- > string exportDocumentsByBody(collectionName, exportRequest, format, extendedJson, filterCaseInsensitive, trailer)
478
+ > string exportDocumentsByBody(collectionName, exportRequest, withDeleted, format, extendedJson, filterCaseInsensitive, trailer)
467
479
 
468
480
  Export Documents of a Collection (filter in the body)
469
481
 
@@ -496,6 +508,8 @@ async function example() {
496
508
  collectionName: collectionName_example,
497
509
  // ExportRequest
498
510
  exportRequest: {"filter":"country:DE AND age:[18 TO 65]","sort":["-age"],"projection":["name","age"]},
511
+ // boolean | Soft-deleted documents too (collections declared with softDelete, 2.4.0); needs the administrate grant of the collection, 403 otherwise. (optional)
512
+ withDeleted: true,
499
513
  // string | ndjson (one JSON document per line), json (one array) or csv (optional)
500
514
  format: format_example,
501
515
  // 'relaxed' | 'canonical' | 'plain' | relaxed (default since 2.0.0) or canonical: the documents as MongoDB Extended JSON with the types of their values ({\"$oid\": ...}, {\"$date\": ...}, {\"$numberDecimal\": ...}; canonical also {\"$numberInt\": ...}, {\"$numberLong\": ...} and {\"$numberDouble\": ...}); a text that looks like a date is {\"$string\": ...}. plain: the format of 1.x (ids and dates as strings, every number as JSON number, no types). The default of a csv export is plain. (optional)
@@ -525,6 +539,7 @@ example().catch(console.error);
525
539
  |------------- | ------------- | ------------- | -------------|
526
540
  | **collectionName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
527
541
  | **exportRequest** | [ExportRequest](ExportRequest.md) | | |
542
+ | **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`] |
528
543
  | **format** | `string` | ndjson (one JSON document per line), json (one array) or csv | [Optional] [Defaults to `&#39;ndjson&#39;`] |
529
544
  | **extendedJson** | `relaxed`, `canonical`, `plain` | relaxed (default since 2.0.0) or canonical: the documents as MongoDB Extended JSON with the types of their values ({\&quot;$oid\&quot;: ...}, {\&quot;$date\&quot;: ...}, {\&quot;$numberDecimal\&quot;: ...}; canonical also {\&quot;$numberInt\&quot;: ...}, {\&quot;$numberLong\&quot;: ...} and {\&quot;$numberDouble\&quot;: ...}); a text that looks like a date is {\&quot;$string\&quot;: ...}. plain: the format of 1.x (ids and dates as strings, every number as JSON number, no types). The default of a csv export is plain. | [Optional] [Defaults to `&#39;relaxed&#39;`] [Enum: relaxed, canonical, plain] |
530
545
  | **filterCaseInsensitive** | `boolean` | true: wildcards and prefixes of the Lucene filter ignore the case (the behaviour before 2.0.0). By default they are case-sensitive, so an index on the field serves a prefix like name:abc* | [Optional] [Defaults to `false`] |
@@ -556,7 +571,7 @@ example().catch(console.error);
556
571
 
557
572
  ## find
558
573
 
559
- > Array&lt;{ [key: string]: any | null; }&gt; find(collectionName, mongoFindRequest, rowsPerPage, page, count, after, extendedJson)
574
+ > Array&lt;{ [key: string]: any | null; }&gt; find(collectionName, mongoFindRequest, withDeleted, rowsPerPage, page, count, after, extendedJson)
560
575
 
561
576
  Documents in Collection
562
577
 
@@ -589,6 +604,8 @@ async function example() {
589
604
  collectionName: collectionName_example,
590
605
  // MongoFindRequest
591
606
  mongoFindRequest: {"filter":{"additionalProp1":"string","additionalProp2":123},"sort":{"additionalProp2":-1},"projection":{"additionalProp1":1,"additionalProp2":1}},
607
+ // boolean | Soft-deleted documents too (collections declared with softDelete, 2.4.0); needs the administrate grant of the collection, 403 otherwise. (optional)
608
+ withDeleted: true,
592
609
  // number | Count elements per page (optional)
593
610
  rowsPerPage: 100,
594
611
  // number | Requested page of the ResultSets (optional)
@@ -620,6 +637,7 @@ example().catch(console.error);
620
637
  |------------- | ------------- | ------------- | -------------|
621
638
  | **collectionName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
622
639
  | **mongoFindRequest** | [MongoFindRequest](MongoFindRequest.md) | | |
640
+ | **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`] |
623
641
  | **rowsPerPage** | `number` | Count elements per page | [Optional] [Defaults to `undefined`] |
624
642
  | **page** | `number` | Requested page of the ResultSets | [Optional] [Defaults to `undefined`] |
625
643
  | **count** | `exact`, `none` | How the result is counted: exact (default) or none (no count headers, no count query) | [Optional] [Defaults to `&#39;exact&#39;`] [Enum: exact, none] |
@@ -652,7 +670,7 @@ example().catch(console.error);
652
670
 
653
671
  ## getDocument
654
672
 
655
- > { [key: string]: any | null; } getDocument(collectionName, documentId, extendedJson)
673
+ > { [key: string]: any | null; } getDocument(collectionName, documentId, withDeleted, extendedJson)
656
674
 
657
675
  Document from Collection
658
676
 
@@ -685,6 +703,8 @@ async function example() {
685
703
  collectionName: collectionName_example,
686
704
  // string | DocumentId to read
687
705
  documentId: documentId_example,
706
+ // boolean | Soft-deleted documents too (collections declared with softDelete, 2.4.0); needs the administrate grant of the collection, 403 otherwise. (optional)
707
+ withDeleted: true,
688
708
  // 'relaxed' | 'canonical' | 'plain' | relaxed (default since 2.0.0) or canonical: the documents as MongoDB Extended JSON with the types of their values ({\"$oid\": ...}, {\"$date\": ...}, {\"$numberDecimal\": ...}; canonical also {\"$numberInt\": ...}, {\"$numberLong\": ...} and {\"$numberDouble\": ...}); a text that looks like a date is {\"$string\": ...}. plain: the format of 1.x (ids and dates as strings, every number as JSON number, no types). (optional)
689
709
  extendedJson: extendedJson_example,
690
710
  } satisfies GetDocumentRequest;
@@ -708,6 +728,7 @@ example().catch(console.error);
708
728
  |------------- | ------------- | ------------- | -------------|
709
729
  | **collectionName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
710
730
  | **documentId** | `string` | DocumentId to read | [Defaults to `undefined`] |
731
+ | **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`] |
711
732
  | **extendedJson** | `relaxed`, `canonical`, `plain` | relaxed (default since 2.0.0) or canonical: the documents as MongoDB Extended JSON with the types of their values ({\&quot;$oid\&quot;: ...}, {\&quot;$date\&quot;: ...}, {\&quot;$numberDecimal\&quot;: ...}; canonical also {\&quot;$numberInt\&quot;: ...}, {\&quot;$numberLong\&quot;: ...} and {\&quot;$numberDouble\&quot;: ...}); a text that looks like a date is {\&quot;$string\&quot;: ...}. plain: the format of 1.x (ids and dates as strings, every number as JSON number, no types). | [Optional] [Defaults to `&#39;relaxed&#39;`] [Enum: relaxed, canonical, plain] |
712
733
 
713
734
  ### Return type
@@ -733,6 +754,96 @@ example().catch(console.error);
733
754
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
734
755
 
735
756
 
757
+ ## getDocumentHistory
758
+
759
+ > Array&lt;AuditEntry&gt; getDocumentHistory(collectionName, documentId, rowsPerPage, page, extendedJson)
760
+
761
+ History of a Document
762
+
763
+ 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.
764
+
765
+ ### Example
766
+
767
+ ```ts
768
+ import {
769
+ Configuration,
770
+ DocumentApi,
771
+ } from '';
772
+ import type { GetDocumentHistoryRequest } from '';
773
+
774
+ async function example() {
775
+ console.log("🚀 Testing SDK...");
776
+ const config = new Configuration({
777
+ // To configure HTTP basic authorization: httpAuth1
778
+ username: "YOUR USERNAME",
779
+ password: "YOUR PASSWORD",
780
+ // Configure HTTP bearer authorization: httpAuth
781
+ accessToken: "YOUR BEARER TOKEN",
782
+ // To configure API key authorization: apiKeyAuth
783
+ apiKey: "YOUR API KEY",
784
+ });
785
+ const api = new DocumentApi(config);
786
+
787
+ const body = {
788
+ // string | The name of your MongoDb Collection
789
+ collectionName: collectionName_example,
790
+ // string | DocumentId of the history
791
+ documentId: documentId_example,
792
+ // number (optional)
793
+ rowsPerPage: 789,
794
+ // number (optional)
795
+ page: 789,
796
+ // 'relaxed' | 'canonical' | 'plain' | relaxed (default), canonical or plain, as for the documents. (optional)
797
+ extendedJson: extendedJson_example,
798
+ } satisfies GetDocumentHistoryRequest;
799
+
800
+ try {
801
+ const data = await api.getDocumentHistory(body);
802
+ console.log(data);
803
+ } catch (error) {
804
+ console.error(error);
805
+ }
806
+ }
807
+
808
+ // Run the test
809
+ example().catch(console.error);
810
+ ```
811
+
812
+ ### Parameters
813
+
814
+
815
+ | Name | Type | Description | Notes |
816
+ |------------- | ------------- | ------------- | -------------|
817
+ | **collectionName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
818
+ | **documentId** | `string` | DocumentId of the history | [Defaults to `undefined`] |
819
+ | **rowsPerPage** | `number` | | [Optional] [Defaults to `undefined`] |
820
+ | **page** | `number` | | [Optional] [Defaults to `undefined`] |
821
+ | **extendedJson** | `relaxed`, `canonical`, `plain` | relaxed (default), canonical or plain, as for the documents. | [Optional] [Defaults to `undefined`] [Enum: relaxed, canonical, plain] |
822
+
823
+ ### Return type
824
+
825
+ [**Array&lt;AuditEntry&gt;**](AuditEntry.md)
826
+
827
+ ### Authorization
828
+
829
+ [httpAuth1](../README.md#httpAuth1), [httpAuth](../README.md#httpAuth), [apiKeyAuth](../README.md#apiKeyAuth)
830
+
831
+ ### HTTP request headers
832
+
833
+ - **Content-Type**: Not defined
834
+ - **Accept**: `application/json`, `text/plain`
835
+
836
+
837
+ ### HTTP response details
838
+ | Status code | Description | Response headers |
839
+ |-------------|-------------|------------------|
840
+ | **200** | | - |
841
+ | **400** | Invalid value for: body | - |
842
+ | **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> |
843
+
844
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
845
+
846
+
736
847
  ## importDocuments
737
848
 
738
849
  > ImportResponse importDocuments(collectionName, body)
@@ -981,7 +1092,7 @@ example().catch(console.error);
981
1092
 
982
1093
  ## listDocuments
983
1094
 
984
- > Array&lt;{ [key: string]: any | null; }&gt; listDocuments(collectionName, filter, sort, projection, rowsPerPage, page, count, after, extendedJson, filterCaseInsensitive)
1095
+ > Array&lt;{ [key: string]: any | null; }&gt; listDocuments(collectionName, withDeleted, filter, sort, projection, rowsPerPage, page, count, after, extendedJson, filterCaseInsensitive)
985
1096
 
986
1097
  Documents in Collection
987
1098
 
@@ -1012,6 +1123,8 @@ async function example() {
1012
1123
  const body = {
1013
1124
  // string | The name of your MongoDb Collection
1014
1125
  collectionName: collectionName_example,
1126
+ // boolean | Soft-deleted documents too (collections declared with softDelete, 2.4.0); needs the administrate grant of the collection, 403 otherwise. (optional)
1127
+ withDeleted: true,
1015
1128
  // string | MongoDB filter query, all documents by default (optional)
1016
1129
  filter: filter_example,
1017
1130
  // Array<string> | MongoDB sorting (optional)
@@ -1050,6 +1163,7 @@ example().catch(console.error);
1050
1163
  | Name | Type | Description | Notes |
1051
1164
  |------------- | ------------- | ------------- | -------------|
1052
1165
  | **collectionName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
1166
+ | **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`] |
1053
1167
  | **filter** | `string` | MongoDB filter query, all documents by default | [Optional] [Defaults to `undefined`] |
1054
1168
  | **sort** | `Array<string>` | MongoDB sorting | [Optional] |
1055
1169
  | **projection** | `Array<string>` | MongoDB projection | [Optional] |
@@ -1084,9 +1198,90 @@ example().catch(console.error);
1084
1198
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
1085
1199
 
1086
1200
 
1201
+ ## restoreDocument
1202
+
1203
+ > UpdateResponse restoreDocument(collectionName, documentId)
1204
+
1205
+ Restore a soft-deleted Document
1206
+
1207
+ 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.
1208
+
1209
+ ### Example
1210
+
1211
+ ```ts
1212
+ import {
1213
+ Configuration,
1214
+ DocumentApi,
1215
+ } from '';
1216
+ import type { RestoreDocumentRequest } from '';
1217
+
1218
+ async function example() {
1219
+ console.log("🚀 Testing SDK...");
1220
+ const config = new Configuration({
1221
+ // To configure HTTP basic authorization: httpAuth1
1222
+ username: "YOUR USERNAME",
1223
+ password: "YOUR PASSWORD",
1224
+ // Configure HTTP bearer authorization: httpAuth
1225
+ accessToken: "YOUR BEARER TOKEN",
1226
+ // To configure API key authorization: apiKeyAuth
1227
+ apiKey: "YOUR API KEY",
1228
+ });
1229
+ const api = new DocumentApi(config);
1230
+
1231
+ const body = {
1232
+ // string | The name of your MongoDb Collection
1233
+ collectionName: collectionName_example,
1234
+ // string | DocumentId to restore
1235
+ documentId: documentId_example,
1236
+ } satisfies RestoreDocumentRequest;
1237
+
1238
+ try {
1239
+ const data = await api.restoreDocument(body);
1240
+ console.log(data);
1241
+ } catch (error) {
1242
+ console.error(error);
1243
+ }
1244
+ }
1245
+
1246
+ // Run the test
1247
+ example().catch(console.error);
1248
+ ```
1249
+
1250
+ ### Parameters
1251
+
1252
+
1253
+ | Name | Type | Description | Notes |
1254
+ |------------- | ------------- | ------------- | -------------|
1255
+ | **collectionName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
1256
+ | **documentId** | `string` | DocumentId to restore | [Defaults to `undefined`] |
1257
+
1258
+ ### Return type
1259
+
1260
+ [**UpdateResponse**](UpdateResponse.md)
1261
+
1262
+ ### Authorization
1263
+
1264
+ [httpAuth1](../README.md#httpAuth1), [httpAuth](../README.md#httpAuth), [apiKeyAuth](../README.md#apiKeyAuth)
1265
+
1266
+ ### HTTP request headers
1267
+
1268
+ - **Content-Type**: Not defined
1269
+ - **Accept**: `application/json`, `text/plain`
1270
+
1271
+
1272
+ ### HTTP response details
1273
+ | Status code | Description | Response headers |
1274
+ |-------------|-------------|------------------|
1275
+ | **200** | | - |
1276
+ | **400** | Invalid value for: body | - |
1277
+ | **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> |
1278
+
1279
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
1280
+
1281
+
1087
1282
  ## searchDocuments
1088
1283
 
1089
- > Array&lt;{ [key: string]: any | null; }&gt; searchDocuments(collectionName, searchRequest, rowsPerPage, page, count, after, extendedJson, filterCaseInsensitive)
1284
+ > Array&lt;{ [key: string]: any | null; }&gt; searchDocuments(collectionName, searchRequest, withDeleted, rowsPerPage, page, count, after, extendedJson, filterCaseInsensitive)
1090
1285
 
1091
1286
  Search Documents in Collection
1092
1287
 
@@ -1119,6 +1314,8 @@ async function example() {
1119
1314
  collectionName: collectionName_example,
1120
1315
  // SearchRequest
1121
1316
  searchRequest: {"filter":"name:John AND age:[18 TO 65]","sort":["-age"],"projection":["name","age"]},
1317
+ // boolean | Soft-deleted documents too (collections declared with softDelete, 2.4.0); needs the administrate grant of the collection, 403 otherwise. (optional)
1318
+ withDeleted: true,
1122
1319
  // number | Count elements per page (optional)
1123
1320
  rowsPerPage: 100,
1124
1321
  // number | Requested page of the ResultSets (optional)
@@ -1152,6 +1349,7 @@ example().catch(console.error);
1152
1349
  |------------- | ------------- | ------------- | -------------|
1153
1350
  | **collectionName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
1154
1351
  | **searchRequest** | [SearchRequest](SearchRequest.md) | | |
1352
+ | **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`] |
1155
1353
  | **rowsPerPage** | `number` | Count elements per page | [Optional] [Defaults to `undefined`] |
1156
1354
  | **page** | `number` | Requested page of the ResultSets | [Optional] [Defaults to `undefined`] |
1157
1355
  | **count** | `exact`, `none` | How the result is counted: exact (default) or none (no count headers, no count query) | [Optional] [Defaults to `&#39;exact&#39;`] [Enum: exact, none] |
@@ -1440,3 +1638,79 @@ example().catch(console.error);
1440
1638
 
1441
1639
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
1442
1640
 
1641
+
1642
+ ## watchDocuments
1643
+
1644
+ > string watchDocuments(collectionName, filter, filterCaseInsensitive, lastEventID)
1645
+
1646
+ Live Updates of a Collection
1647
+
1648
+ The changes of the documents as Server-Sent Events (2.4.0), scoped like every read and by &#x60;filter&#x60;. Events: &#x60;upsert&#x60; (data &#x60;{ id, document }&#x60;, a document that is in the scope), &#x60;remove&#x60; (data &#x60;{ id }&#x60;, deleted or left the scope), &#x60;reset&#x60; (the client loads again). The &#x60;id&#x60; of an event is the resume token: send it as &#x60;Last-Event-ID&#x60; to resume. A comment every 25 seconds. Needs a replica set or a sharded cluster: 501 (code 5011) otherwise; at most &#x60;WATCH_MAX_STREAMS&#x60; streams per instance (503).
1649
+
1650
+ ### Example
1651
+
1652
+ ```ts
1653
+ import {
1654
+ Configuration,
1655
+ DocumentApi,
1656
+ } from '';
1657
+ import type { WatchDocumentsRequest } from '';
1658
+
1659
+ async function example() {
1660
+ console.log("🚀 Testing SDK...");
1661
+ const api = new DocumentApi();
1662
+
1663
+ const body = {
1664
+ // string | The name of your MongoDb Collection
1665
+ collectionName: collectionName_example,
1666
+ // string | Lucene filter of the documents to watch. (optional)
1667
+ filter: filter_example,
1668
+ // boolean (optional)
1669
+ filterCaseInsensitive: true,
1670
+ // string | The id of the last event the client got, to resume after it. (optional)
1671
+ lastEventID: lastEventID_example,
1672
+ } satisfies WatchDocumentsRequest;
1673
+
1674
+ try {
1675
+ const data = await api.watchDocuments(body);
1676
+ console.log(data);
1677
+ } catch (error) {
1678
+ console.error(error);
1679
+ }
1680
+ }
1681
+
1682
+ // Run the test
1683
+ example().catch(console.error);
1684
+ ```
1685
+
1686
+ ### Parameters
1687
+
1688
+
1689
+ | Name | Type | Description | Notes |
1690
+ |------------- | ------------- | ------------- | -------------|
1691
+ | **collectionName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
1692
+ | **filter** | `string` | Lucene filter of the documents to watch. | [Optional] [Defaults to `undefined`] |
1693
+ | **filterCaseInsensitive** | `boolean` | | [Optional] [Defaults to `undefined`] |
1694
+ | **lastEventID** | `string` | The id of the last event the client got, to resume after it. | [Optional] [Defaults to `undefined`] |
1695
+
1696
+ ### Return type
1697
+
1698
+ **string**
1699
+
1700
+ ### Authorization
1701
+
1702
+ No authorization required
1703
+
1704
+ ### HTTP request headers
1705
+
1706
+ - **Content-Type**: Not defined
1707
+ - **Accept**: `text/event-stream`
1708
+
1709
+
1710
+ ### HTTP response details
1711
+ | Status code | Description | Response headers |
1712
+ |-------------|-------------|------------------|
1713
+ | **200** | text/event-stream | - |
1714
+
1715
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
1716
+
@@ -9,6 +9,8 @@ Name | Type
9
9
  `code` | number
10
10
  `msg` | string
11
11
  `additionalInfo` | string
12
+ `issues` | [Array&lt;ValidationIssue&gt;](ValidationIssue.md)
13
+ `current` | { [key: string]: any; }
12
14
 
13
15
  ## Example
14
16
 
@@ -20,6 +22,8 @@ const example = {
20
22
  "code": null,
21
23
  "msg": null,
22
24
  "additionalInfo": null,
25
+ "issues": null,
26
+ "current": null,
23
27
  } satisfies ErrorDescription
24
28
 
25
29
  console.log(example)
@@ -0,0 +1,40 @@
1
+
2
+ # SuggestedValidator
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `validator` | { [key: string]: any; }
10
+ `count` | number
11
+ `sample` | number
12
+ `warnings` | Array&lt;string&gt;
13
+
14
+ ## Example
15
+
16
+ ```typescript
17
+ import type { SuggestedValidator } from ''
18
+
19
+ // TODO: Update the object below with actual values
20
+ const example = {
21
+ "validator": null,
22
+ "count": null,
23
+ "sample": null,
24
+ "warnings": null,
25
+ } satisfies SuggestedValidator
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 SuggestedValidator
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,36 @@
1
+
2
+ # ValidationIssue
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `path` | string
10
+ `message` | string
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { ValidationIssue } from ''
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "path": null,
20
+ "message": null,
21
+ } satisfies ValidationIssue
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 ValidationIssue
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
+
@@ -0,0 +1,88 @@
1
+ /**
2
+ * mongocamp-library
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 2.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface AuditEntry
16
+ */
17
+ export interface AuditEntry {
18
+ /**
19
+ *
20
+ */
21
+ collection: string;
22
+ /**
23
+ *
24
+ */
25
+ database: string;
26
+ /**
27
+ * The _id of the document; absent on a summary record.
28
+ */
29
+ documentId?: any | null;
30
+ /**
31
+ *
32
+ */
33
+ operation: AuditEntryOperationEnum;
34
+ /**
35
+ *
36
+ */
37
+ user: string;
38
+ /**
39
+ * The time (Extended JSON date).
40
+ */
41
+ at: {
42
+ [key: string]: any;
43
+ };
44
+ /**
45
+ *
46
+ */
47
+ before?: {
48
+ [key: string]: any;
49
+ };
50
+ /**
51
+ *
52
+ */
53
+ after?: {
54
+ [key: string]: any;
55
+ };
56
+ /**
57
+ * A write of many documents: count and recorded.
58
+ */
59
+ summary?: {
60
+ [key: string]: any;
61
+ };
62
+ /**
63
+ *
64
+ */
65
+ expiresAt?: {
66
+ [key: string]: any;
67
+ };
68
+ }
69
+ /**
70
+ * @export
71
+ */
72
+ export declare const AuditEntryOperationEnum: {
73
+ readonly Insert: "insert";
74
+ readonly Replace: "replace";
75
+ readonly Update: "update";
76
+ readonly Delete: "delete";
77
+ readonly SoftDelete: "softDelete";
78
+ readonly Restore: "restore";
79
+ };
80
+ export type AuditEntryOperationEnum = typeof AuditEntryOperationEnum[keyof typeof AuditEntryOperationEnum];
81
+ /**
82
+ * Check if a given object implements the AuditEntry interface.
83
+ */
84
+ export declare function instanceOfAuditEntry(value: object): value is AuditEntry;
85
+ export declare function AuditEntryFromJSON(json: any): AuditEntry;
86
+ export declare function AuditEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuditEntry;
87
+ export declare function AuditEntryToJSON(json: any): AuditEntry;
88
+ export declare function AuditEntryToJSONTyped(value?: AuditEntry | null, ignoreDiscriminator?: boolean): any;