@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.
- package/README.md +52 -1
- package/dist/module.d.mts +10 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +91 -11
- package/dist/runtime/api/.openapi-generator/FILES +18 -0
- package/dist/runtime/api/apis/CollectionApi.d.ts +124 -0
- package/dist/runtime/api/apis/CollectionApi.js +205 -0
- package/dist/runtime/api/apis/DocumentApi.d.ts +134 -0
- package/dist/runtime/api/apis/DocumentApi.js +208 -0
- package/dist/runtime/api/docs/AuditEntry.md +52 -0
- package/dist/runtime/api/docs/CollectionApi.md +269 -2
- package/dist/runtime/api/docs/CollectionDeclaration.md +52 -0
- package/dist/runtime/api/docs/CollectionDeclarationAudit.md +34 -0
- package/dist/runtime/api/docs/CollectionDeclarationOwner.md +36 -0
- package/dist/runtime/api/docs/CollectionDeclarationSoftDelete.md +36 -0
- package/dist/runtime/api/docs/CollectionDeclarationTimestamps.md +40 -0
- package/dist/runtime/api/docs/CollectionDeclarationVersioned.md +38 -0
- package/dist/runtime/api/docs/DocumentApi.md +282 -8
- package/dist/runtime/api/docs/ErrorDescription.md +4 -0
- package/dist/runtime/api/docs/SuggestedValidator.md +40 -0
- package/dist/runtime/api/docs/ValidationIssue.md +36 -0
- package/dist/runtime/api/models/AuditEntry.d.ts +88 -0
- package/dist/runtime/api/models/AuditEntry.js +56 -0
- package/dist/runtime/api/models/CollectionDeclaration.d.ts +80 -0
- package/dist/runtime/api/models/CollectionDeclaration.js +73 -0
- package/dist/runtime/api/models/CollectionDeclarationAudit.d.ts +30 -0
- package/dist/runtime/api/models/CollectionDeclarationAudit.js +26 -0
- package/dist/runtime/api/models/CollectionDeclarationOwner.d.ts +43 -0
- package/dist/runtime/api/models/CollectionDeclarationOwner.js +34 -0
- package/dist/runtime/api/models/CollectionDeclarationSoftDelete.d.ts +34 -0
- package/dist/runtime/api/models/CollectionDeclarationSoftDelete.js +28 -0
- package/dist/runtime/api/models/CollectionDeclarationTimestamps.d.ts +42 -0
- package/dist/runtime/api/models/CollectionDeclarationTimestamps.js +33 -0
- package/dist/runtime/api/models/CollectionDeclarationVersioned.d.ts +46 -0
- package/dist/runtime/api/models/CollectionDeclarationVersioned.js +36 -0
- package/dist/runtime/api/models/ErrorDescription.d.ts +11 -0
- package/dist/runtime/api/models/ErrorDescription.js +10 -2
- package/dist/runtime/api/models/SuggestedValidator.d.ts +44 -0
- package/dist/runtime/api/models/SuggestedValidator.js +35 -0
- package/dist/runtime/api/models/ValidationIssue.d.ts +34 -0
- package/dist/runtime/api/models/ValidationIssue.js +29 -0
- package/dist/runtime/api/models/index.d.ts +9 -0
- package/dist/runtime/api/models/index.js +9 -0
- package/dist/runtime/composables/mongocampApiCollection.d.ts +14 -15
- package/dist/runtime/composables/mongocampApiCollection.js +4 -1
- package/dist/runtime/composables/mongocampCollection.d.ts +106 -0
- package/dist/runtime/composables/mongocampCollection.js +200 -0
- package/dist/runtime/composables/mongocampLive.d.ts +33 -0
- package/dist/runtime/composables/mongocampLive.js +152 -0
- package/dist/runtime/composables/mongocampSearch.d.ts +12 -9
- package/dist/runtime/server/mongocamp/plugin.d.ts +2 -2
- package/dist/runtime/server/mongocamp/plugin.js +10 -1
- package/dist/runtime/types/collections.d.ts +20 -0
- package/dist/runtime/types/collections.js +0 -0
- package/dist/runtime/utils/sse.d.ts +10 -0
- package/dist/runtime/utils/sse.js +33 -0
- package/dist/runtime/utils/toMongocampError.d.ts +7 -0
- package/dist/runtime/utils/toMongocampError.js +18 -1
- package/dist/types.d.mts +6 -0
- package/package.json +4 -3
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import * as runtime from "../runtime.js";
|
|
2
|
+
import {
|
|
3
|
+
AuditEntryFromJSON
|
|
4
|
+
} from "../models/AuditEntry.js";
|
|
5
|
+
import {
|
|
6
|
+
CollectionDeclarationFromJSON
|
|
7
|
+
} from "../models/CollectionDeclaration.js";
|
|
2
8
|
import {
|
|
3
9
|
CollectionOptionsFromJSON,
|
|
4
10
|
CollectionOptionsToJSON
|
|
@@ -39,6 +45,9 @@ import {
|
|
|
39
45
|
import {
|
|
40
46
|
SchemaAnalysisFromJSON
|
|
41
47
|
} from "../models/SchemaAnalysis.js";
|
|
48
|
+
import {
|
|
49
|
+
SuggestedValidatorFromJSON
|
|
50
|
+
} from "../models/SuggestedValidator.js";
|
|
42
51
|
export class CollectionApi extends runtime.BaseAPI {
|
|
43
52
|
/**
|
|
44
53
|
* Creates request options for aggregate without sending the request
|
|
@@ -57,6 +66,9 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
57
66
|
);
|
|
58
67
|
}
|
|
59
68
|
const queryParameters = {};
|
|
69
|
+
if (requestParameters["withDeleted"] != null) {
|
|
70
|
+
queryParameters["withDeleted"] = requestParameters["withDeleted"];
|
|
71
|
+
}
|
|
60
72
|
if (requestParameters["rowsPerPage"] != null) {
|
|
61
73
|
queryParameters["rowsPerPage"] = requestParameters["rowsPerPage"];
|
|
62
74
|
}
|
|
@@ -351,6 +363,9 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
351
363
|
);
|
|
352
364
|
}
|
|
353
365
|
const queryParameters = {};
|
|
366
|
+
if (requestParameters["withDeleted"] != null) {
|
|
367
|
+
queryParameters["withDeleted"] = requestParameters["withDeleted"];
|
|
368
|
+
}
|
|
354
369
|
if (requestParameters["rowsPerPage"] != null) {
|
|
355
370
|
queryParameters["rowsPerPage"] = requestParameters["rowsPerPage"];
|
|
356
371
|
}
|
|
@@ -404,6 +419,57 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
404
419
|
const response = await this.distinctRaw(requestParameters, initOverrides);
|
|
405
420
|
return await response.value();
|
|
406
421
|
}
|
|
422
|
+
/**
|
|
423
|
+
* Creates request options for getCollectionDeclaration without sending the request
|
|
424
|
+
*/
|
|
425
|
+
async getCollectionDeclarationRequestOpts(requestParameters) {
|
|
426
|
+
if (requestParameters["collectionName"] == null) {
|
|
427
|
+
throw new runtime.RequiredError(
|
|
428
|
+
"collectionName",
|
|
429
|
+
'Required parameter "collectionName" was null or undefined when calling getCollectionDeclaration().'
|
|
430
|
+
);
|
|
431
|
+
}
|
|
432
|
+
const queryParameters = {};
|
|
433
|
+
const headerParameters = {};
|
|
434
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
435
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
436
|
+
}
|
|
437
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
438
|
+
const token = this.configuration.accessToken;
|
|
439
|
+
const tokenString = await token("httpAuth", []);
|
|
440
|
+
if (tokenString) {
|
|
441
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
445
|
+
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
446
|
+
}
|
|
447
|
+
let urlPath = `/mongodb/collections/{collectionName}/declaration`;
|
|
448
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
449
|
+
return {
|
|
450
|
+
path: urlPath,
|
|
451
|
+
method: "GET",
|
|
452
|
+
headers: headerParameters,
|
|
453
|
+
query: queryParameters
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* 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.
|
|
458
|
+
* Declaration of a Collection
|
|
459
|
+
*/
|
|
460
|
+
async getCollectionDeclarationRaw(requestParameters, initOverrides) {
|
|
461
|
+
const requestOptions = await this.getCollectionDeclarationRequestOpts(requestParameters);
|
|
462
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
463
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CollectionDeclarationFromJSON(jsonValue));
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* 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.
|
|
467
|
+
* Declaration of a Collection
|
|
468
|
+
*/
|
|
469
|
+
async getCollectionDeclaration(requestParameters, initOverrides) {
|
|
470
|
+
const response = await this.getCollectionDeclarationRaw(requestParameters, initOverrides);
|
|
471
|
+
return await response.value();
|
|
472
|
+
}
|
|
407
473
|
/**
|
|
408
474
|
* Creates request options for getCollectionFields without sending the request
|
|
409
475
|
*/
|
|
@@ -458,6 +524,72 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
458
524
|
const response = await this.getCollectionFieldsRaw(requestParameters, initOverrides);
|
|
459
525
|
return await response.value();
|
|
460
526
|
}
|
|
527
|
+
/**
|
|
528
|
+
* Creates request options for getCollectionHistory without sending the request
|
|
529
|
+
*/
|
|
530
|
+
async getCollectionHistoryRequestOpts(requestParameters) {
|
|
531
|
+
if (requestParameters["collectionName"] == null) {
|
|
532
|
+
throw new runtime.RequiredError(
|
|
533
|
+
"collectionName",
|
|
534
|
+
'Required parameter "collectionName" was null or undefined when calling getCollectionHistory().'
|
|
535
|
+
);
|
|
536
|
+
}
|
|
537
|
+
const queryParameters = {};
|
|
538
|
+
if (requestParameters["since"] != null) {
|
|
539
|
+
queryParameters["since"] = requestParameters["since"];
|
|
540
|
+
}
|
|
541
|
+
if (requestParameters["operation"] != null) {
|
|
542
|
+
queryParameters["operation"] = requestParameters["operation"];
|
|
543
|
+
}
|
|
544
|
+
if (requestParameters["rowsPerPage"] != null) {
|
|
545
|
+
queryParameters["rowsPerPage"] = requestParameters["rowsPerPage"];
|
|
546
|
+
}
|
|
547
|
+
if (requestParameters["page"] != null) {
|
|
548
|
+
queryParameters["page"] = requestParameters["page"];
|
|
549
|
+
}
|
|
550
|
+
if (requestParameters["extendedJson"] != null) {
|
|
551
|
+
queryParameters["extendedJson"] = requestParameters["extendedJson"];
|
|
552
|
+
}
|
|
553
|
+
const headerParameters = {};
|
|
554
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
555
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
556
|
+
}
|
|
557
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
558
|
+
const token = this.configuration.accessToken;
|
|
559
|
+
const tokenString = await token("httpAuth", []);
|
|
560
|
+
if (tokenString) {
|
|
561
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
565
|
+
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
566
|
+
}
|
|
567
|
+
let urlPath = `/mongodb/collections/{collectionName}/history`;
|
|
568
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
569
|
+
return {
|
|
570
|
+
path: urlPath,
|
|
571
|
+
method: "GET",
|
|
572
|
+
headers: headerParameters,
|
|
573
|
+
query: queryParameters
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* 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.
|
|
578
|
+
* History of a Collection
|
|
579
|
+
*/
|
|
580
|
+
async getCollectionHistoryRaw(requestParameters, initOverrides) {
|
|
581
|
+
const requestOptions = await this.getCollectionHistoryRequestOpts(requestParameters);
|
|
582
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
583
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AuditEntryFromJSON));
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* 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.
|
|
587
|
+
* History of a Collection
|
|
588
|
+
*/
|
|
589
|
+
async getCollectionHistory(requestParameters, initOverrides) {
|
|
590
|
+
const response = await this.getCollectionHistoryRaw(requestParameters, initOverrides);
|
|
591
|
+
return await response.value();
|
|
592
|
+
}
|
|
461
593
|
/**
|
|
462
594
|
* Creates request options for getCollectionInformation without sending the request
|
|
463
595
|
*/
|
|
@@ -734,6 +866,66 @@ export class CollectionApi extends runtime.BaseAPI {
|
|
|
734
866
|
const response = await this.getSchemaAnalysisRaw(requestParameters, initOverrides);
|
|
735
867
|
return await response.value();
|
|
736
868
|
}
|
|
869
|
+
/**
|
|
870
|
+
* Creates request options for getSuggestedValidator without sending the request
|
|
871
|
+
*/
|
|
872
|
+
async getSuggestedValidatorRequestOpts(requestParameters) {
|
|
873
|
+
if (requestParameters["collectionName"] == null) {
|
|
874
|
+
throw new runtime.RequiredError(
|
|
875
|
+
"collectionName",
|
|
876
|
+
'Required parameter "collectionName" was null or undefined when calling getSuggestedValidator().'
|
|
877
|
+
);
|
|
878
|
+
}
|
|
879
|
+
const queryParameters = {};
|
|
880
|
+
if (requestParameters["sampleSize"] != null) {
|
|
881
|
+
queryParameters["sampleSize"] = requestParameters["sampleSize"];
|
|
882
|
+
}
|
|
883
|
+
if (requestParameters["depth"] != null) {
|
|
884
|
+
queryParameters["depth"] = requestParameters["depth"];
|
|
885
|
+
}
|
|
886
|
+
if (requestParameters["requiredThreshold"] != null) {
|
|
887
|
+
queryParameters["requiredThreshold"] = requestParameters["requiredThreshold"];
|
|
888
|
+
}
|
|
889
|
+
const headerParameters = {};
|
|
890
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
891
|
+
headerParameters["Authorization"] = "Basic " + btoa((this.configuration.username || "") + ":" + (this.configuration.password || ""));
|
|
892
|
+
}
|
|
893
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
894
|
+
const token = this.configuration.accessToken;
|
|
895
|
+
const tokenString = await token("httpAuth", []);
|
|
896
|
+
if (tokenString) {
|
|
897
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
901
|
+
headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
|
|
902
|
+
}
|
|
903
|
+
let urlPath = `/mongodb/collections/{collectionName}/schema/validator`;
|
|
904
|
+
urlPath = urlPath.replace("{collectionName}", encodeURIComponent(String(requestParameters["collectionName"])));
|
|
905
|
+
return {
|
|
906
|
+
path: urlPath,
|
|
907
|
+
method: "GET",
|
|
908
|
+
headers: headerParameters,
|
|
909
|
+
query: queryParameters
|
|
910
|
+
};
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
913
|
+
* 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.
|
|
914
|
+
* Suggested Validator
|
|
915
|
+
*/
|
|
916
|
+
async getSuggestedValidatorRaw(requestParameters, initOverrides) {
|
|
917
|
+
const requestOptions = await this.getSuggestedValidatorRequestOpts(requestParameters);
|
|
918
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
919
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SuggestedValidatorFromJSON(jsonValue));
|
|
920
|
+
}
|
|
921
|
+
/**
|
|
922
|
+
* 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.
|
|
923
|
+
* Suggested Validator
|
|
924
|
+
*/
|
|
925
|
+
async getSuggestedValidator(requestParameters, initOverrides) {
|
|
926
|
+
const response = await this.getSuggestedValidatorRaw(requestParameters, initOverrides);
|
|
927
|
+
return await response.value();
|
|
928
|
+
}
|
|
737
929
|
/**
|
|
738
930
|
* Creates request options for listCollectionInformation without sending the request
|
|
739
931
|
*/
|
|
@@ -1016,3 +1208,16 @@ export const DistinctExtendedJsonEnum = {
|
|
|
1016
1208
|
Canonical: "canonical",
|
|
1017
1209
|
Plain: "plain"
|
|
1018
1210
|
};
|
|
1211
|
+
export const GetCollectionHistoryOperationEnum = {
|
|
1212
|
+
Insert: "insert",
|
|
1213
|
+
Replace: "replace",
|
|
1214
|
+
Update: "update",
|
|
1215
|
+
Delete: "delete",
|
|
1216
|
+
SoftDelete: "softDelete",
|
|
1217
|
+
Restore: "restore"
|
|
1218
|
+
};
|
|
1219
|
+
export const GetCollectionHistoryExtendedJsonEnum = {
|
|
1220
|
+
Relaxed: "relaxed",
|
|
1221
|
+
Canonical: "canonical",
|
|
1222
|
+
Plain: "plain"
|
|
1223
|
+
};
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime.js';
|
|
13
|
+
import { type AuditEntry } from '../models/AuditEntry.js';
|
|
13
14
|
import { type CountRequest } from '../models/CountRequest.js';
|
|
14
15
|
import { type CountResponse } from '../models/CountResponse.js';
|
|
15
16
|
import { type DeleteResponse } from '../models/DeleteResponse.js';
|
|
@@ -35,6 +36,10 @@ export interface CountDocumentsRequest {
|
|
|
35
36
|
* The name of your MongoDb Collection
|
|
36
37
|
*/
|
|
37
38
|
collectionName: string;
|
|
39
|
+
/**
|
|
40
|
+
* Soft-deleted documents too (collections declared with softDelete, 2.4.0); needs the administrate grant of the collection, 403 otherwise.
|
|
41
|
+
*/
|
|
42
|
+
withDeleted?: boolean;
|
|
38
43
|
/**
|
|
39
44
|
* Filter Query like on the list of documents, by default all documents are counted
|
|
40
45
|
*/
|
|
@@ -53,6 +58,10 @@ export interface CountDocumentsByBodyRequest {
|
|
|
53
58
|
*
|
|
54
59
|
*/
|
|
55
60
|
countRequest: CountRequest;
|
|
61
|
+
/**
|
|
62
|
+
* Soft-deleted documents too (collections declared with softDelete, 2.4.0); needs the administrate grant of the collection, 403 otherwise.
|
|
63
|
+
*/
|
|
64
|
+
withDeleted?: boolean;
|
|
56
65
|
/**
|
|
57
66
|
* 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*
|
|
58
67
|
*/
|
|
@@ -87,6 +96,10 @@ export interface ExportDocumentsRequest {
|
|
|
87
96
|
* The name of your MongoDb Collection
|
|
88
97
|
*/
|
|
89
98
|
collectionName: string;
|
|
99
|
+
/**
|
|
100
|
+
* Soft-deleted documents too (collections declared with softDelete, 2.4.0); needs the administrate grant of the collection, 403 otherwise.
|
|
101
|
+
*/
|
|
102
|
+
withDeleted?: boolean;
|
|
90
103
|
/**
|
|
91
104
|
* ndjson (one JSON document per line), json (one array) or csv
|
|
92
105
|
*/
|
|
@@ -129,6 +142,10 @@ export interface ExportDocumentsByBodyRequest {
|
|
|
129
142
|
*
|
|
130
143
|
*/
|
|
131
144
|
exportRequest: ExportRequest;
|
|
145
|
+
/**
|
|
146
|
+
* Soft-deleted documents too (collections declared with softDelete, 2.4.0); needs the administrate grant of the collection, 403 otherwise.
|
|
147
|
+
*/
|
|
148
|
+
withDeleted?: boolean;
|
|
132
149
|
/**
|
|
133
150
|
* ndjson (one JSON document per line), json (one array) or csv
|
|
134
151
|
*/
|
|
@@ -155,6 +172,10 @@ export interface FindRequest {
|
|
|
155
172
|
*
|
|
156
173
|
*/
|
|
157
174
|
mongoFindRequest: MongoFindRequest;
|
|
175
|
+
/**
|
|
176
|
+
* Soft-deleted documents too (collections declared with softDelete, 2.4.0); needs the administrate grant of the collection, 403 otherwise.
|
|
177
|
+
*/
|
|
178
|
+
withDeleted?: boolean;
|
|
158
179
|
/**
|
|
159
180
|
* Count elements per page
|
|
160
181
|
*/
|
|
@@ -185,11 +206,37 @@ export interface GetDocumentRequest {
|
|
|
185
206
|
* DocumentId to read
|
|
186
207
|
*/
|
|
187
208
|
documentId: string;
|
|
209
|
+
/**
|
|
210
|
+
* Soft-deleted documents too (collections declared with softDelete, 2.4.0); needs the administrate grant of the collection, 403 otherwise.
|
|
211
|
+
*/
|
|
212
|
+
withDeleted?: boolean;
|
|
188
213
|
/**
|
|
189
214
|
* 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).
|
|
190
215
|
*/
|
|
191
216
|
extendedJson?: GetDocumentExtendedJsonEnum;
|
|
192
217
|
}
|
|
218
|
+
export interface GetDocumentHistoryRequest {
|
|
219
|
+
/**
|
|
220
|
+
* The name of your MongoDb Collection
|
|
221
|
+
*/
|
|
222
|
+
collectionName: string;
|
|
223
|
+
/**
|
|
224
|
+
* DocumentId of the history
|
|
225
|
+
*/
|
|
226
|
+
documentId: string;
|
|
227
|
+
/**
|
|
228
|
+
*
|
|
229
|
+
*/
|
|
230
|
+
rowsPerPage?: number;
|
|
231
|
+
/**
|
|
232
|
+
*
|
|
233
|
+
*/
|
|
234
|
+
page?: number;
|
|
235
|
+
/**
|
|
236
|
+
* relaxed (default), canonical or plain, as for the documents.
|
|
237
|
+
*/
|
|
238
|
+
extendedJson?: GetDocumentHistoryExtendedJsonEnum;
|
|
239
|
+
}
|
|
193
240
|
export interface ImportDocumentsRequest {
|
|
194
241
|
/**
|
|
195
242
|
* The name of your MongoDb Collection
|
|
@@ -233,6 +280,10 @@ export interface ListDocumentsRequest {
|
|
|
233
280
|
* The name of your MongoDb Collection
|
|
234
281
|
*/
|
|
235
282
|
collectionName: string;
|
|
283
|
+
/**
|
|
284
|
+
* Soft-deleted documents too (collections declared with softDelete, 2.4.0); needs the administrate grant of the collection, 403 otherwise.
|
|
285
|
+
*/
|
|
286
|
+
withDeleted?: boolean;
|
|
236
287
|
/**
|
|
237
288
|
* MongoDB filter query, all documents by default
|
|
238
289
|
*/
|
|
@@ -270,6 +321,16 @@ export interface ListDocumentsRequest {
|
|
|
270
321
|
*/
|
|
271
322
|
filterCaseInsensitive?: boolean;
|
|
272
323
|
}
|
|
324
|
+
export interface RestoreDocumentRequest {
|
|
325
|
+
/**
|
|
326
|
+
* The name of your MongoDb Collection
|
|
327
|
+
*/
|
|
328
|
+
collectionName: string;
|
|
329
|
+
/**
|
|
330
|
+
* DocumentId to restore
|
|
331
|
+
*/
|
|
332
|
+
documentId: string;
|
|
333
|
+
}
|
|
273
334
|
export interface SearchDocumentsRequest {
|
|
274
335
|
/**
|
|
275
336
|
* The name of your MongoDb Collection
|
|
@@ -279,6 +340,10 @@ export interface SearchDocumentsRequest {
|
|
|
279
340
|
*
|
|
280
341
|
*/
|
|
281
342
|
searchRequest: SearchRequest;
|
|
343
|
+
/**
|
|
344
|
+
* Soft-deleted documents too (collections declared with softDelete, 2.4.0); needs the administrate grant of the collection, 403 otherwise.
|
|
345
|
+
*/
|
|
346
|
+
withDeleted?: boolean;
|
|
282
347
|
/**
|
|
283
348
|
* Count elements per page
|
|
284
349
|
*/
|
|
@@ -358,6 +423,24 @@ export interface UpdateManyOperationRequest {
|
|
|
358
423
|
*/
|
|
359
424
|
filterCaseInsensitive?: boolean;
|
|
360
425
|
}
|
|
426
|
+
export interface WatchDocumentsRequest {
|
|
427
|
+
/**
|
|
428
|
+
* The name of your MongoDb Collection
|
|
429
|
+
*/
|
|
430
|
+
collectionName: string;
|
|
431
|
+
/**
|
|
432
|
+
* Lucene filter of the documents to watch.
|
|
433
|
+
*/
|
|
434
|
+
filter?: string;
|
|
435
|
+
/**
|
|
436
|
+
*
|
|
437
|
+
*/
|
|
438
|
+
filterCaseInsensitive?: boolean;
|
|
439
|
+
/**
|
|
440
|
+
* The id of the last event the client got, to resume after it.
|
|
441
|
+
*/
|
|
442
|
+
lastEventID?: string;
|
|
443
|
+
}
|
|
361
444
|
/**
|
|
362
445
|
*
|
|
363
446
|
*/
|
|
@@ -482,6 +565,20 @@ export declare class DocumentApi extends runtime.BaseAPI {
|
|
|
482
565
|
getDocument(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{
|
|
483
566
|
[key: string]: any | null;
|
|
484
567
|
}>;
|
|
568
|
+
/**
|
|
569
|
+
* Creates request options for getDocumentHistory without sending the request
|
|
570
|
+
*/
|
|
571
|
+
getDocumentHistoryRequestOpts(requestParameters: GetDocumentHistoryRequest): Promise<runtime.RequestOpts>;
|
|
572
|
+
/**
|
|
573
|
+
* 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.
|
|
574
|
+
* History of a Document
|
|
575
|
+
*/
|
|
576
|
+
getDocumentHistoryRaw(requestParameters: GetDocumentHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<AuditEntry>>>;
|
|
577
|
+
/**
|
|
578
|
+
* 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.
|
|
579
|
+
* History of a Document
|
|
580
|
+
*/
|
|
581
|
+
getDocumentHistory(requestParameters: GetDocumentHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<AuditEntry>>;
|
|
485
582
|
/**
|
|
486
583
|
* Creates request options for importDocuments without sending the request
|
|
487
584
|
*/
|
|
@@ -542,6 +639,20 @@ export declare class DocumentApi extends runtime.BaseAPI {
|
|
|
542
639
|
listDocuments(requestParameters: ListDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<{
|
|
543
640
|
[key: string]: any | null;
|
|
544
641
|
}>>;
|
|
642
|
+
/**
|
|
643
|
+
* Creates request options for restoreDocument without sending the request
|
|
644
|
+
*/
|
|
645
|
+
restoreDocumentRequestOpts(requestParameters: RestoreDocumentRequest): Promise<runtime.RequestOpts>;
|
|
646
|
+
/**
|
|
647
|
+
* 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.
|
|
648
|
+
* Restore a soft-deleted Document
|
|
649
|
+
*/
|
|
650
|
+
restoreDocumentRaw(requestParameters: RestoreDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UpdateResponse>>;
|
|
651
|
+
/**
|
|
652
|
+
* 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.
|
|
653
|
+
* Restore a soft-deleted Document
|
|
654
|
+
*/
|
|
655
|
+
restoreDocument(requestParameters: RestoreDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UpdateResponse>;
|
|
545
656
|
/**
|
|
546
657
|
* Creates request options for searchDocuments without sending the request
|
|
547
658
|
*/
|
|
@@ -602,6 +713,20 @@ export declare class DocumentApi extends runtime.BaseAPI {
|
|
|
602
713
|
* Update many in Collection
|
|
603
714
|
*/
|
|
604
715
|
updateMany(requestParameters: UpdateManyOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UpdateResponse>;
|
|
716
|
+
/**
|
|
717
|
+
* Creates request options for watchDocuments without sending the request
|
|
718
|
+
*/
|
|
719
|
+
watchDocumentsRequestOpts(requestParameters: WatchDocumentsRequest): Promise<runtime.RequestOpts>;
|
|
720
|
+
/**
|
|
721
|
+
* 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).
|
|
722
|
+
* Live Updates of a Collection
|
|
723
|
+
*/
|
|
724
|
+
watchDocumentsRaw(requestParameters: WatchDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
|
|
725
|
+
/**
|
|
726
|
+
* 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).
|
|
727
|
+
* Live Updates of a Collection
|
|
728
|
+
*/
|
|
729
|
+
watchDocuments(requestParameters: WatchDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
|
|
605
730
|
}
|
|
606
731
|
/**
|
|
607
732
|
* @export
|
|
@@ -647,6 +772,15 @@ export declare const GetDocumentExtendedJsonEnum: {
|
|
|
647
772
|
readonly Plain: "plain";
|
|
648
773
|
};
|
|
649
774
|
export type GetDocumentExtendedJsonEnum = typeof GetDocumentExtendedJsonEnum[keyof typeof GetDocumentExtendedJsonEnum];
|
|
775
|
+
/**
|
|
776
|
+
* @export
|
|
777
|
+
*/
|
|
778
|
+
export declare const GetDocumentHistoryExtendedJsonEnum: {
|
|
779
|
+
readonly Relaxed: "relaxed";
|
|
780
|
+
readonly Canonical: "canonical";
|
|
781
|
+
readonly Plain: "plain";
|
|
782
|
+
};
|
|
783
|
+
export type GetDocumentHistoryExtendedJsonEnum = typeof GetDocumentHistoryExtendedJsonEnum[keyof typeof GetDocumentHistoryExtendedJsonEnum];
|
|
650
784
|
/**
|
|
651
785
|
* @export
|
|
652
786
|
*/
|