@sfxcode/nuxt-mongocamp-server 2.2.0 → 2.4.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 +74 -1
- package/dist/module.d.mts +10 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +95 -11
- package/dist/runtime/api/.openapi-generator/FILES +22 -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 +162 -0
- package/dist/runtime/api/apis/DocumentApi.js +229 -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 +56 -0
- package/dist/runtime/api/docs/CollectionDeclarationAudit.md +34 -0
- package/dist/runtime/api/docs/CollectionDeclarationIndexesInner.md +38 -0
- package/dist/runtime/api/docs/CollectionDeclarationOwner.md +36 -0
- package/dist/runtime/api/docs/CollectionDeclarationRefsInner.md +38 -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 +303 -8
- package/dist/runtime/api/docs/ErrorDescription.md +4 -0
- package/dist/runtime/api/docs/ExportRequest.md +2 -0
- package/dist/runtime/api/docs/MongoFindRequest.md +2 -0
- package/dist/runtime/api/docs/SearchRequest.md +2 -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 +90 -0
- package/dist/runtime/api/models/CollectionDeclaration.js +87 -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/CollectionDeclarationIndexesInner.d.ts +40 -0
- package/dist/runtime/api/models/CollectionDeclarationIndexesInner.js +32 -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/CollectionDeclarationRefsInner.d.ts +38 -0
- package/dist/runtime/api/models/CollectionDeclarationRefsInner.js +31 -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/ExportRequest.d.ts +4 -0
- package/dist/runtime/api/models/ExportRequest.js +4 -2
- package/dist/runtime/api/models/MongoFindRequest.d.ts +4 -0
- package/dist/runtime/api/models/MongoFindRequest.js +4 -2
- package/dist/runtime/api/models/SearchRequest.d.ts +4 -0
- package/dist/runtime/api/models/SearchRequest.js +4 -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 +11 -0
- package/dist/runtime/api/models/index.js +11 -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 +144 -0
- package/dist/runtime/composables/mongocampCollection.js +241 -0
- package/dist/runtime/composables/mongocampLive.d.ts +36 -0
- package/dist/runtime/composables/mongocampLive.js +155 -0
- package/dist/runtime/composables/mongocampSearch.d.ts +12 -9
- package/dist/runtime/server/composables/mongocampServerCollection.d.ts +20 -0
- package/dist/runtime/server/composables/mongocampServerCollection.js +12 -0
- 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 +30 -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.3.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.3.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.3.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.3.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.3.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.3.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,14 @@ export interface ExportDocumentsRequest {
|
|
|
87
96
|
* The name of your MongoDb Collection
|
|
88
97
|
*/
|
|
89
98
|
collectionName: string;
|
|
99
|
+
/**
|
|
100
|
+
* References to expand (2.4.0): declared ref fields of the collection, repeated or comma separated, at most 5. Each becomes the referenced document, read with the grant and the read scope of its collection (null, or left out of an array, when the caller cannot read it). 400 for a field that is no reference.
|
|
101
|
+
*/
|
|
102
|
+
expand?: Array<string>;
|
|
103
|
+
/**
|
|
104
|
+
* Soft-deleted documents too (collections declared with softDelete, 2.3.0); needs the administrate grant of the collection, 403 otherwise.
|
|
105
|
+
*/
|
|
106
|
+
withDeleted?: boolean;
|
|
90
107
|
/**
|
|
91
108
|
* ndjson (one JSON document per line), json (one array) or csv
|
|
92
109
|
*/
|
|
@@ -129,6 +146,14 @@ export interface ExportDocumentsByBodyRequest {
|
|
|
129
146
|
*
|
|
130
147
|
*/
|
|
131
148
|
exportRequest: ExportRequest;
|
|
149
|
+
/**
|
|
150
|
+
* References to expand (2.4.0): declared ref fields of the collection, repeated or comma separated, at most 5. Each becomes the referenced document, read with the grant and the read scope of its collection (null, or left out of an array, when the caller cannot read it). 400 for a field that is no reference.
|
|
151
|
+
*/
|
|
152
|
+
expand?: Array<string>;
|
|
153
|
+
/**
|
|
154
|
+
* Soft-deleted documents too (collections declared with softDelete, 2.3.0); needs the administrate grant of the collection, 403 otherwise.
|
|
155
|
+
*/
|
|
156
|
+
withDeleted?: boolean;
|
|
132
157
|
/**
|
|
133
158
|
* ndjson (one JSON document per line), json (one array) or csv
|
|
134
159
|
*/
|
|
@@ -155,6 +180,14 @@ export interface FindRequest {
|
|
|
155
180
|
*
|
|
156
181
|
*/
|
|
157
182
|
mongoFindRequest: MongoFindRequest;
|
|
183
|
+
/**
|
|
184
|
+
* References to expand (2.4.0): declared ref fields of the collection, repeated or comma separated, at most 5. Each becomes the referenced document, read with the grant and the read scope of its collection (null, or left out of an array, when the caller cannot read it). 400 for a field that is no reference.
|
|
185
|
+
*/
|
|
186
|
+
expand?: Array<string>;
|
|
187
|
+
/**
|
|
188
|
+
* Soft-deleted documents too (collections declared with softDelete, 2.3.0); needs the administrate grant of the collection, 403 otherwise.
|
|
189
|
+
*/
|
|
190
|
+
withDeleted?: boolean;
|
|
158
191
|
/**
|
|
159
192
|
* Count elements per page
|
|
160
193
|
*/
|
|
@@ -185,11 +218,41 @@ export interface GetDocumentRequest {
|
|
|
185
218
|
* DocumentId to read
|
|
186
219
|
*/
|
|
187
220
|
documentId: string;
|
|
221
|
+
/**
|
|
222
|
+
* References to expand (2.4.0): declared ref fields of the collection, repeated or comma separated, at most 5. Each becomes the referenced document, read with the grant and the read scope of its collection (null, or left out of an array, when the caller cannot read it). 400 for a field that is no reference.
|
|
223
|
+
*/
|
|
224
|
+
expand?: Array<string>;
|
|
225
|
+
/**
|
|
226
|
+
* Soft-deleted documents too (collections declared with softDelete, 2.3.0); needs the administrate grant of the collection, 403 otherwise.
|
|
227
|
+
*/
|
|
228
|
+
withDeleted?: boolean;
|
|
188
229
|
/**
|
|
189
230
|
* 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
231
|
*/
|
|
191
232
|
extendedJson?: GetDocumentExtendedJsonEnum;
|
|
192
233
|
}
|
|
234
|
+
export interface GetDocumentHistoryRequest {
|
|
235
|
+
/**
|
|
236
|
+
* The name of your MongoDb Collection
|
|
237
|
+
*/
|
|
238
|
+
collectionName: string;
|
|
239
|
+
/**
|
|
240
|
+
* DocumentId of the history
|
|
241
|
+
*/
|
|
242
|
+
documentId: string;
|
|
243
|
+
/**
|
|
244
|
+
*
|
|
245
|
+
*/
|
|
246
|
+
rowsPerPage?: number;
|
|
247
|
+
/**
|
|
248
|
+
*
|
|
249
|
+
*/
|
|
250
|
+
page?: number;
|
|
251
|
+
/**
|
|
252
|
+
* relaxed (default), canonical or plain, as for the documents.
|
|
253
|
+
*/
|
|
254
|
+
extendedJson?: GetDocumentHistoryExtendedJsonEnum;
|
|
255
|
+
}
|
|
193
256
|
export interface ImportDocumentsRequest {
|
|
194
257
|
/**
|
|
195
258
|
* The name of your MongoDb Collection
|
|
@@ -233,6 +296,14 @@ export interface ListDocumentsRequest {
|
|
|
233
296
|
* The name of your MongoDb Collection
|
|
234
297
|
*/
|
|
235
298
|
collectionName: string;
|
|
299
|
+
/**
|
|
300
|
+
* References to expand (2.4.0): declared ref fields of the collection, repeated or comma separated, at most 5. Each becomes the referenced document, read with the grant and the read scope of its collection (null, or left out of an array, when the caller cannot read it). 400 for a field that is no reference.
|
|
301
|
+
*/
|
|
302
|
+
expand?: Array<string>;
|
|
303
|
+
/**
|
|
304
|
+
* Soft-deleted documents too (collections declared with softDelete, 2.3.0); needs the administrate grant of the collection, 403 otherwise.
|
|
305
|
+
*/
|
|
306
|
+
withDeleted?: boolean;
|
|
236
307
|
/**
|
|
237
308
|
* MongoDB filter query, all documents by default
|
|
238
309
|
*/
|
|
@@ -270,6 +341,16 @@ export interface ListDocumentsRequest {
|
|
|
270
341
|
*/
|
|
271
342
|
filterCaseInsensitive?: boolean;
|
|
272
343
|
}
|
|
344
|
+
export interface RestoreDocumentRequest {
|
|
345
|
+
/**
|
|
346
|
+
* The name of your MongoDb Collection
|
|
347
|
+
*/
|
|
348
|
+
collectionName: string;
|
|
349
|
+
/**
|
|
350
|
+
* DocumentId to restore
|
|
351
|
+
*/
|
|
352
|
+
documentId: string;
|
|
353
|
+
}
|
|
273
354
|
export interface SearchDocumentsRequest {
|
|
274
355
|
/**
|
|
275
356
|
* The name of your MongoDb Collection
|
|
@@ -279,6 +360,14 @@ export interface SearchDocumentsRequest {
|
|
|
279
360
|
*
|
|
280
361
|
*/
|
|
281
362
|
searchRequest: SearchRequest;
|
|
363
|
+
/**
|
|
364
|
+
* References to expand (2.4.0): declared ref fields of the collection, repeated or comma separated, at most 5. Each becomes the referenced document, read with the grant and the read scope of its collection (null, or left out of an array, when the caller cannot read it). 400 for a field that is no reference.
|
|
365
|
+
*/
|
|
366
|
+
expand?: Array<string>;
|
|
367
|
+
/**
|
|
368
|
+
* Soft-deleted documents too (collections declared with softDelete, 2.3.0); needs the administrate grant of the collection, 403 otherwise.
|
|
369
|
+
*/
|
|
370
|
+
withDeleted?: boolean;
|
|
282
371
|
/**
|
|
283
372
|
* Count elements per page
|
|
284
373
|
*/
|
|
@@ -358,6 +447,28 @@ export interface UpdateManyOperationRequest {
|
|
|
358
447
|
*/
|
|
359
448
|
filterCaseInsensitive?: boolean;
|
|
360
449
|
}
|
|
450
|
+
export interface WatchDocumentsRequest {
|
|
451
|
+
/**
|
|
452
|
+
* The name of your MongoDb Collection
|
|
453
|
+
*/
|
|
454
|
+
collectionName: string;
|
|
455
|
+
/**
|
|
456
|
+
* References to expand in each upsert (2.4.0), like on the list of documents. A change of a referenced document sends no event.
|
|
457
|
+
*/
|
|
458
|
+
expand?: Array<string>;
|
|
459
|
+
/**
|
|
460
|
+
* Lucene filter of the documents to watch.
|
|
461
|
+
*/
|
|
462
|
+
filter?: string;
|
|
463
|
+
/**
|
|
464
|
+
*
|
|
465
|
+
*/
|
|
466
|
+
filterCaseInsensitive?: boolean;
|
|
467
|
+
/**
|
|
468
|
+
* The id of the last event the client got, to resume after it.
|
|
469
|
+
*/
|
|
470
|
+
lastEventID?: string;
|
|
471
|
+
}
|
|
361
472
|
/**
|
|
362
473
|
*
|
|
363
474
|
*/
|
|
@@ -482,6 +593,20 @@ export declare class DocumentApi extends runtime.BaseAPI {
|
|
|
482
593
|
getDocument(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{
|
|
483
594
|
[key: string]: any | null;
|
|
484
595
|
}>;
|
|
596
|
+
/**
|
|
597
|
+
* Creates request options for getDocumentHistory without sending the request
|
|
598
|
+
*/
|
|
599
|
+
getDocumentHistoryRequestOpts(requestParameters: GetDocumentHistoryRequest): Promise<runtime.RequestOpts>;
|
|
600
|
+
/**
|
|
601
|
+
* The audit records of a document of a collection declared with audit, newest first (2.3.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.
|
|
602
|
+
* History of a Document
|
|
603
|
+
*/
|
|
604
|
+
getDocumentHistoryRaw(requestParameters: GetDocumentHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<AuditEntry>>>;
|
|
605
|
+
/**
|
|
606
|
+
* The audit records of a document of a collection declared with audit, newest first (2.3.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.
|
|
607
|
+
* History of a Document
|
|
608
|
+
*/
|
|
609
|
+
getDocumentHistory(requestParameters: GetDocumentHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<AuditEntry>>;
|
|
485
610
|
/**
|
|
486
611
|
* Creates request options for importDocuments without sending the request
|
|
487
612
|
*/
|
|
@@ -542,6 +667,20 @@ export declare class DocumentApi extends runtime.BaseAPI {
|
|
|
542
667
|
listDocuments(requestParameters: ListDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<{
|
|
543
668
|
[key: string]: any | null;
|
|
544
669
|
}>>;
|
|
670
|
+
/**
|
|
671
|
+
* Creates request options for restoreDocument without sending the request
|
|
672
|
+
*/
|
|
673
|
+
restoreDocumentRequestOpts(requestParameters: RestoreDocumentRequest): Promise<runtime.RequestOpts>;
|
|
674
|
+
/**
|
|
675
|
+
* Removes the deleted mark of a document of a collection declared with softDelete (2.3.0). 404 for a collection without soft delete and for a document that is missing or not deleted.
|
|
676
|
+
* Restore a soft-deleted Document
|
|
677
|
+
*/
|
|
678
|
+
restoreDocumentRaw(requestParameters: RestoreDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UpdateResponse>>;
|
|
679
|
+
/**
|
|
680
|
+
* Removes the deleted mark of a document of a collection declared with softDelete (2.3.0). 404 for a collection without soft delete and for a document that is missing or not deleted.
|
|
681
|
+
* Restore a soft-deleted Document
|
|
682
|
+
*/
|
|
683
|
+
restoreDocument(requestParameters: RestoreDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UpdateResponse>;
|
|
545
684
|
/**
|
|
546
685
|
* Creates request options for searchDocuments without sending the request
|
|
547
686
|
*/
|
|
@@ -602,6 +741,20 @@ export declare class DocumentApi extends runtime.BaseAPI {
|
|
|
602
741
|
* Update many in Collection
|
|
603
742
|
*/
|
|
604
743
|
updateMany(requestParameters: UpdateManyOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UpdateResponse>;
|
|
744
|
+
/**
|
|
745
|
+
* Creates request options for watchDocuments without sending the request
|
|
746
|
+
*/
|
|
747
|
+
watchDocumentsRequestOpts(requestParameters: WatchDocumentsRequest): Promise<runtime.RequestOpts>;
|
|
748
|
+
/**
|
|
749
|
+
* The changes of the documents as Server-Sent Events (2.3.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).
|
|
750
|
+
* Live Updates of a Collection
|
|
751
|
+
*/
|
|
752
|
+
watchDocumentsRaw(requestParameters: WatchDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
|
|
753
|
+
/**
|
|
754
|
+
* The changes of the documents as Server-Sent Events (2.3.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).
|
|
755
|
+
* Live Updates of a Collection
|
|
756
|
+
*/
|
|
757
|
+
watchDocuments(requestParameters: WatchDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
|
|
605
758
|
}
|
|
606
759
|
/**
|
|
607
760
|
* @export
|
|
@@ -647,6 +800,15 @@ export declare const GetDocumentExtendedJsonEnum: {
|
|
|
647
800
|
readonly Plain: "plain";
|
|
648
801
|
};
|
|
649
802
|
export type GetDocumentExtendedJsonEnum = typeof GetDocumentExtendedJsonEnum[keyof typeof GetDocumentExtendedJsonEnum];
|
|
803
|
+
/**
|
|
804
|
+
* @export
|
|
805
|
+
*/
|
|
806
|
+
export declare const GetDocumentHistoryExtendedJsonEnum: {
|
|
807
|
+
readonly Relaxed: "relaxed";
|
|
808
|
+
readonly Canonical: "canonical";
|
|
809
|
+
readonly Plain: "plain";
|
|
810
|
+
};
|
|
811
|
+
export type GetDocumentHistoryExtendedJsonEnum = typeof GetDocumentHistoryExtendedJsonEnum[keyof typeof GetDocumentHistoryExtendedJsonEnum];
|
|
650
812
|
/**
|
|
651
813
|
* @export
|
|
652
814
|
*/
|