@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.
Files changed (77) hide show
  1. package/README.md +74 -1
  2. package/dist/module.d.mts +10 -0
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +95 -11
  5. package/dist/runtime/api/.openapi-generator/FILES +22 -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 +162 -0
  9. package/dist/runtime/api/apis/DocumentApi.js +229 -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 +56 -0
  13. package/dist/runtime/api/docs/CollectionDeclarationAudit.md +34 -0
  14. package/dist/runtime/api/docs/CollectionDeclarationIndexesInner.md +38 -0
  15. package/dist/runtime/api/docs/CollectionDeclarationOwner.md +36 -0
  16. package/dist/runtime/api/docs/CollectionDeclarationRefsInner.md +38 -0
  17. package/dist/runtime/api/docs/CollectionDeclarationSoftDelete.md +36 -0
  18. package/dist/runtime/api/docs/CollectionDeclarationTimestamps.md +40 -0
  19. package/dist/runtime/api/docs/CollectionDeclarationVersioned.md +38 -0
  20. package/dist/runtime/api/docs/DocumentApi.md +303 -8
  21. package/dist/runtime/api/docs/ErrorDescription.md +4 -0
  22. package/dist/runtime/api/docs/ExportRequest.md +2 -0
  23. package/dist/runtime/api/docs/MongoFindRequest.md +2 -0
  24. package/dist/runtime/api/docs/SearchRequest.md +2 -0
  25. package/dist/runtime/api/docs/SuggestedValidator.md +40 -0
  26. package/dist/runtime/api/docs/ValidationIssue.md +36 -0
  27. package/dist/runtime/api/models/AuditEntry.d.ts +88 -0
  28. package/dist/runtime/api/models/AuditEntry.js +56 -0
  29. package/dist/runtime/api/models/CollectionDeclaration.d.ts +90 -0
  30. package/dist/runtime/api/models/CollectionDeclaration.js +87 -0
  31. package/dist/runtime/api/models/CollectionDeclarationAudit.d.ts +30 -0
  32. package/dist/runtime/api/models/CollectionDeclarationAudit.js +26 -0
  33. package/dist/runtime/api/models/CollectionDeclarationIndexesInner.d.ts +40 -0
  34. package/dist/runtime/api/models/CollectionDeclarationIndexesInner.js +32 -0
  35. package/dist/runtime/api/models/CollectionDeclarationOwner.d.ts +43 -0
  36. package/dist/runtime/api/models/CollectionDeclarationOwner.js +34 -0
  37. package/dist/runtime/api/models/CollectionDeclarationRefsInner.d.ts +38 -0
  38. package/dist/runtime/api/models/CollectionDeclarationRefsInner.js +31 -0
  39. package/dist/runtime/api/models/CollectionDeclarationSoftDelete.d.ts +34 -0
  40. package/dist/runtime/api/models/CollectionDeclarationSoftDelete.js +28 -0
  41. package/dist/runtime/api/models/CollectionDeclarationTimestamps.d.ts +42 -0
  42. package/dist/runtime/api/models/CollectionDeclarationTimestamps.js +33 -0
  43. package/dist/runtime/api/models/CollectionDeclarationVersioned.d.ts +46 -0
  44. package/dist/runtime/api/models/CollectionDeclarationVersioned.js +36 -0
  45. package/dist/runtime/api/models/ErrorDescription.d.ts +11 -0
  46. package/dist/runtime/api/models/ErrorDescription.js +10 -2
  47. package/dist/runtime/api/models/ExportRequest.d.ts +4 -0
  48. package/dist/runtime/api/models/ExportRequest.js +4 -2
  49. package/dist/runtime/api/models/MongoFindRequest.d.ts +4 -0
  50. package/dist/runtime/api/models/MongoFindRequest.js +4 -2
  51. package/dist/runtime/api/models/SearchRequest.d.ts +4 -0
  52. package/dist/runtime/api/models/SearchRequest.js +4 -2
  53. package/dist/runtime/api/models/SuggestedValidator.d.ts +44 -0
  54. package/dist/runtime/api/models/SuggestedValidator.js +35 -0
  55. package/dist/runtime/api/models/ValidationIssue.d.ts +34 -0
  56. package/dist/runtime/api/models/ValidationIssue.js +29 -0
  57. package/dist/runtime/api/models/index.d.ts +11 -0
  58. package/dist/runtime/api/models/index.js +11 -0
  59. package/dist/runtime/composables/mongocampApiCollection.d.ts +14 -15
  60. package/dist/runtime/composables/mongocampApiCollection.js +4 -1
  61. package/dist/runtime/composables/mongocampCollection.d.ts +144 -0
  62. package/dist/runtime/composables/mongocampCollection.js +241 -0
  63. package/dist/runtime/composables/mongocampLive.d.ts +36 -0
  64. package/dist/runtime/composables/mongocampLive.js +155 -0
  65. package/dist/runtime/composables/mongocampSearch.d.ts +12 -9
  66. package/dist/runtime/server/composables/mongocampServerCollection.d.ts +20 -0
  67. package/dist/runtime/server/composables/mongocampServerCollection.js +12 -0
  68. package/dist/runtime/server/mongocamp/plugin.d.ts +2 -2
  69. package/dist/runtime/server/mongocamp/plugin.js +10 -1
  70. package/dist/runtime/types/collections.d.ts +30 -0
  71. package/dist/runtime/types/collections.js +0 -0
  72. package/dist/runtime/utils/sse.d.ts +10 -0
  73. package/dist/runtime/utils/sse.js +33 -0
  74. package/dist/runtime/utils/toMongocampError.d.ts +7 -0
  75. package/dist/runtime/utils/toMongocampError.js +18 -1
  76. package/dist/types.d.mts +6 -0
  77. package/package.json +4 -3
@@ -0,0 +1,42 @@
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 CollectionDeclarationTimestamps
16
+ */
17
+ export interface CollectionDeclarationTimestamps {
18
+ /**
19
+ *
20
+ */
21
+ createdAt: string;
22
+ /**
23
+ *
24
+ */
25
+ updatedAt: string;
26
+ /**
27
+ *
28
+ */
29
+ createdBy?: string;
30
+ /**
31
+ *
32
+ */
33
+ updatedBy?: string;
34
+ }
35
+ /**
36
+ * Check if a given object implements the CollectionDeclarationTimestamps interface.
37
+ */
38
+ export declare function instanceOfCollectionDeclarationTimestamps(value: object): value is CollectionDeclarationTimestamps;
39
+ export declare function CollectionDeclarationTimestampsFromJSON(json: any): CollectionDeclarationTimestamps;
40
+ export declare function CollectionDeclarationTimestampsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionDeclarationTimestamps;
41
+ export declare function CollectionDeclarationTimestampsToJSON(json: any): CollectionDeclarationTimestamps;
42
+ export declare function CollectionDeclarationTimestampsToJSONTyped(value?: CollectionDeclarationTimestamps | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,33 @@
1
+ export function instanceOfCollectionDeclarationTimestamps(value) {
2
+ if (!("createdAt" in value) || value["createdAt"] === void 0) return false;
3
+ if (!("updatedAt" in value) || value["updatedAt"] === void 0) return false;
4
+ return true;
5
+ }
6
+ export function CollectionDeclarationTimestampsFromJSON(json) {
7
+ return CollectionDeclarationTimestampsFromJSONTyped(json, false);
8
+ }
9
+ export function CollectionDeclarationTimestampsFromJSONTyped(json, ignoreDiscriminator) {
10
+ if (json == null) {
11
+ return json;
12
+ }
13
+ return {
14
+ "createdAt": json["createdAt"],
15
+ "updatedAt": json["updatedAt"],
16
+ "createdBy": json["createdBy"] == null ? void 0 : json["createdBy"],
17
+ "updatedBy": json["updatedBy"] == null ? void 0 : json["updatedBy"]
18
+ };
19
+ }
20
+ export function CollectionDeclarationTimestampsToJSON(json) {
21
+ return CollectionDeclarationTimestampsToJSONTyped(json, false);
22
+ }
23
+ export function CollectionDeclarationTimestampsToJSONTyped(value, ignoreDiscriminator = false) {
24
+ if (value == null) {
25
+ return value;
26
+ }
27
+ return {
28
+ "createdAt": value["createdAt"],
29
+ "updatedAt": value["updatedAt"],
30
+ "createdBy": value["createdBy"],
31
+ "updatedBy": value["updatedBy"]
32
+ };
33
+ }
@@ -0,0 +1,46 @@
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 CollectionDeclarationVersioned
16
+ */
17
+ export interface CollectionDeclarationVersioned {
18
+ /**
19
+ *
20
+ */
21
+ mode: CollectionDeclarationVersionedModeEnum;
22
+ /**
23
+ *
24
+ */
25
+ field: string;
26
+ /**
27
+ *
28
+ */
29
+ required: boolean;
30
+ }
31
+ /**
32
+ * @export
33
+ */
34
+ export declare const CollectionDeclarationVersionedModeEnum: {
35
+ readonly Counter: "counter";
36
+ readonly Timestamp: "timestamp";
37
+ };
38
+ export type CollectionDeclarationVersionedModeEnum = typeof CollectionDeclarationVersionedModeEnum[keyof typeof CollectionDeclarationVersionedModeEnum];
39
+ /**
40
+ * Check if a given object implements the CollectionDeclarationVersioned interface.
41
+ */
42
+ export declare function instanceOfCollectionDeclarationVersioned(value: object): value is CollectionDeclarationVersioned;
43
+ export declare function CollectionDeclarationVersionedFromJSON(json: any): CollectionDeclarationVersioned;
44
+ export declare function CollectionDeclarationVersionedFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionDeclarationVersioned;
45
+ export declare function CollectionDeclarationVersionedToJSON(json: any): CollectionDeclarationVersioned;
46
+ export declare function CollectionDeclarationVersionedToJSONTyped(value?: CollectionDeclarationVersioned | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,36 @@
1
+ export const CollectionDeclarationVersionedModeEnum = {
2
+ Counter: "counter",
3
+ Timestamp: "timestamp"
4
+ };
5
+ export function instanceOfCollectionDeclarationVersioned(value) {
6
+ if (!("mode" in value) || value["mode"] === void 0) return false;
7
+ if (!("field" in value) || value["field"] === void 0) return false;
8
+ if (!("required" in value) || value["required"] === void 0) return false;
9
+ return true;
10
+ }
11
+ export function CollectionDeclarationVersionedFromJSON(json) {
12
+ return CollectionDeclarationVersionedFromJSONTyped(json, false);
13
+ }
14
+ export function CollectionDeclarationVersionedFromJSONTyped(json, ignoreDiscriminator) {
15
+ if (json == null) {
16
+ return json;
17
+ }
18
+ return {
19
+ "mode": json["mode"],
20
+ "field": json["field"],
21
+ "required": json["required"]
22
+ };
23
+ }
24
+ export function CollectionDeclarationVersionedToJSON(json) {
25
+ return CollectionDeclarationVersionedToJSONTyped(json, false);
26
+ }
27
+ export function CollectionDeclarationVersionedToJSONTyped(value, ignoreDiscriminator = false) {
28
+ if (value == null) {
29
+ return value;
30
+ }
31
+ return {
32
+ "mode": value["mode"],
33
+ "field": value["field"],
34
+ "required": value["required"]
35
+ };
36
+ }
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { ValidationIssue } from './ValidationIssue.js';
12
13
  /**
13
14
  *
14
15
  * @export
@@ -27,6 +28,16 @@ export interface ErrorDescription {
27
28
  *
28
29
  */
29
30
  additionalInfo: string;
31
+ /**
32
+ * The fields of a document that is not valid (a schema, a before-hook or the validator of the collection). Only set for these errors.
33
+ */
34
+ issues?: Array<ValidationIssue>;
35
+ /**
36
+ * The stored document of a version conflict (409, code 4092, 2.3.0), as Extended JSON: show it or merge with it, then send the change again with its version.
37
+ */
38
+ current?: {
39
+ [key: string]: any;
40
+ };
30
41
  }
31
42
  /**
32
43
  * Check if a given object implements the ErrorDescription interface.
@@ -1,3 +1,7 @@
1
+ import {
2
+ ValidationIssueFromJSON,
3
+ ValidationIssueToJSON
4
+ } from "./ValidationIssue.js";
1
5
  export function instanceOfErrorDescription(value) {
2
6
  if (!("code" in value) || value["code"] === void 0) return false;
3
7
  if (!("msg" in value) || value["msg"] === void 0) return false;
@@ -14,7 +18,9 @@ export function ErrorDescriptionFromJSONTyped(json, ignoreDiscriminator) {
14
18
  return {
15
19
  "code": json["code"],
16
20
  "msg": json["msg"],
17
- "additionalInfo": json["additionalInfo"]
21
+ "additionalInfo": json["additionalInfo"],
22
+ "issues": json["issues"] == null ? void 0 : json["issues"].map(ValidationIssueFromJSON),
23
+ "current": json["current"] == null ? void 0 : json["current"]
18
24
  };
19
25
  }
20
26
  export function ErrorDescriptionToJSON(json) {
@@ -27,6 +33,8 @@ export function ErrorDescriptionToJSONTyped(value, ignoreDiscriminator = false)
27
33
  return {
28
34
  "code": value["code"],
29
35
  "msg": value["msg"],
30
- "additionalInfo": value["additionalInfo"]
36
+ "additionalInfo": value["additionalInfo"],
37
+ "issues": value["issues"] == null ? void 0 : value["issues"].map(ValidationIssueToJSON),
38
+ "current": value["current"]
31
39
  };
32
40
  }
@@ -31,6 +31,10 @@ export interface ExportRequest {
31
31
  *
32
32
  */
33
33
  limit?: number;
34
+ /**
35
+ * References to expand (2.4.0), like the query parameter expand.
36
+ */
37
+ expand?: Array<string>;
34
38
  }
35
39
  /**
36
40
  * Check if a given object implements the ExportRequest interface.
@@ -12,7 +12,8 @@ export function ExportRequestFromJSONTyped(json, ignoreDiscriminator) {
12
12
  "filter": json["filter"] == null ? void 0 : json["filter"],
13
13
  "sort": json["sort"] == null ? void 0 : json["sort"],
14
14
  "projection": json["projection"] == null ? void 0 : json["projection"],
15
- "limit": json["limit"] == null ? void 0 : json["limit"]
15
+ "limit": json["limit"] == null ? void 0 : json["limit"],
16
+ "expand": json["expand"] == null ? void 0 : json["expand"]
16
17
  };
17
18
  }
18
19
  export function ExportRequestToJSON(json) {
@@ -26,6 +27,7 @@ export function ExportRequestToJSONTyped(value, ignoreDiscriminator = false) {
26
27
  "filter": value["filter"],
27
28
  "sort": value["sort"],
28
29
  "projection": value["projection"],
29
- "limit": value["limit"]
30
+ "limit": value["limit"],
31
+ "expand": value["expand"]
30
32
  };
31
33
  }
@@ -33,6 +33,10 @@ export interface MongoFindRequest {
33
33
  projection: {
34
34
  [key: string]: any | null;
35
35
  };
36
+ /**
37
+ * References to expand (2.4.0), like the query parameter expand.
38
+ */
39
+ expand?: Array<string>;
36
40
  }
37
41
  /**
38
42
  * Check if a given object implements the MongoFindRequest interface.
@@ -14,7 +14,8 @@ export function MongoFindRequestFromJSONTyped(json, ignoreDiscriminator) {
14
14
  return {
15
15
  "filter": json["filter"],
16
16
  "sort": json["sort"],
17
- "projection": json["projection"]
17
+ "projection": json["projection"],
18
+ "expand": json["expand"] == null ? void 0 : json["expand"]
18
19
  };
19
20
  }
20
21
  export function MongoFindRequestToJSON(json) {
@@ -27,6 +28,7 @@ export function MongoFindRequestToJSONTyped(value, ignoreDiscriminator = false)
27
28
  return {
28
29
  "filter": value["filter"],
29
30
  "sort": value["sort"],
30
- "projection": value["projection"]
31
+ "projection": value["projection"],
32
+ "expand": value["expand"]
31
33
  };
32
34
  }
@@ -27,6 +27,10 @@ export interface SearchRequest {
27
27
  *
28
28
  */
29
29
  projection?: Array<string>;
30
+ /**
31
+ * References to expand (2.4.0), like the query parameter expand.
32
+ */
33
+ expand?: Array<string>;
30
34
  }
31
35
  /**
32
36
  * Check if a given object implements the SearchRequest interface.
@@ -11,7 +11,8 @@ export function SearchRequestFromJSONTyped(json, ignoreDiscriminator) {
11
11
  return {
12
12
  "filter": json["filter"] == null ? void 0 : json["filter"],
13
13
  "sort": json["sort"] == null ? void 0 : json["sort"],
14
- "projection": json["projection"] == null ? void 0 : json["projection"]
14
+ "projection": json["projection"] == null ? void 0 : json["projection"],
15
+ "expand": json["expand"] == null ? void 0 : json["expand"]
15
16
  };
16
17
  }
17
18
  export function SearchRequestToJSON(json) {
@@ -24,6 +25,7 @@ export function SearchRequestToJSONTyped(value, ignoreDiscriminator = false) {
24
25
  return {
25
26
  "filter": value["filter"],
26
27
  "sort": value["sort"],
27
- "projection": value["projection"]
28
+ "projection": value["projection"],
29
+ "expand": value["expand"]
28
30
  };
29
31
  }
@@ -0,0 +1,44 @@
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 SuggestedValidator
16
+ */
17
+ export interface SuggestedValidator {
18
+ /**
19
+ * The validator: an object with the key $jsonSchema.
20
+ */
21
+ validator: {
22
+ [key: string]: any;
23
+ };
24
+ /**
25
+ * The number of documents of the collection.
26
+ */
27
+ count: number;
28
+ /**
29
+ * The number of documents the suggestion is made of.
30
+ */
31
+ sample: number;
32
+ /**
33
+ *
34
+ */
35
+ warnings: Array<string>;
36
+ }
37
+ /**
38
+ * Check if a given object implements the SuggestedValidator interface.
39
+ */
40
+ export declare function instanceOfSuggestedValidator(value: object): value is SuggestedValidator;
41
+ export declare function SuggestedValidatorFromJSON(json: any): SuggestedValidator;
42
+ export declare function SuggestedValidatorFromJSONTyped(json: any, ignoreDiscriminator: boolean): SuggestedValidator;
43
+ export declare function SuggestedValidatorToJSON(json: any): SuggestedValidator;
44
+ export declare function SuggestedValidatorToJSONTyped(value?: SuggestedValidator | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,35 @@
1
+ export function instanceOfSuggestedValidator(value) {
2
+ if (!("validator" in value) || value["validator"] === void 0) return false;
3
+ if (!("count" in value) || value["count"] === void 0) return false;
4
+ if (!("sample" in value) || value["sample"] === void 0) return false;
5
+ if (!("warnings" in value) || value["warnings"] === void 0) return false;
6
+ return true;
7
+ }
8
+ export function SuggestedValidatorFromJSON(json) {
9
+ return SuggestedValidatorFromJSONTyped(json, false);
10
+ }
11
+ export function SuggestedValidatorFromJSONTyped(json, ignoreDiscriminator) {
12
+ if (json == null) {
13
+ return json;
14
+ }
15
+ return {
16
+ "validator": json["validator"],
17
+ "count": json["count"],
18
+ "sample": json["sample"],
19
+ "warnings": json["warnings"]
20
+ };
21
+ }
22
+ export function SuggestedValidatorToJSON(json) {
23
+ return SuggestedValidatorToJSONTyped(json, false);
24
+ }
25
+ export function SuggestedValidatorToJSONTyped(value, ignoreDiscriminator = false) {
26
+ if (value == null) {
27
+ return value;
28
+ }
29
+ return {
30
+ "validator": value["validator"],
31
+ "count": value["count"],
32
+ "sample": value["sample"],
33
+ "warnings": value["warnings"]
34
+ };
35
+ }
@@ -0,0 +1,34 @@
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 ValidationIssue
16
+ */
17
+ export interface ValidationIssue {
18
+ /**
19
+ * The field in dot notation (`items.0.qty`), empty for the whole document; `[3].qty` for the fourth document of a request with several.
20
+ */
21
+ path: string;
22
+ /**
23
+ *
24
+ */
25
+ message: string;
26
+ }
27
+ /**
28
+ * Check if a given object implements the ValidationIssue interface.
29
+ */
30
+ export declare function instanceOfValidationIssue(value: object): value is ValidationIssue;
31
+ export declare function ValidationIssueFromJSON(json: any): ValidationIssue;
32
+ export declare function ValidationIssueFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidationIssue;
33
+ export declare function ValidationIssueToJSON(json: any): ValidationIssue;
34
+ export declare function ValidationIssueToJSONTyped(value?: ValidationIssue | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,29 @@
1
+ export function instanceOfValidationIssue(value) {
2
+ if (!("path" in value) || value["path"] === void 0) return false;
3
+ if (!("message" in value) || value["message"] === void 0) return false;
4
+ return true;
5
+ }
6
+ export function ValidationIssueFromJSON(json) {
7
+ return ValidationIssueFromJSONTyped(json, false);
8
+ }
9
+ export function ValidationIssueFromJSONTyped(json, ignoreDiscriminator) {
10
+ if (json == null) {
11
+ return json;
12
+ }
13
+ return {
14
+ "path": json["path"],
15
+ "message": json["message"]
16
+ };
17
+ }
18
+ export function ValidationIssueToJSON(json) {
19
+ return ValidationIssueToJSONTyped(json, false);
20
+ }
21
+ export function ValidationIssueToJSONTyped(value, ignoreDiscriminator = false) {
22
+ if (value == null) {
23
+ return value;
24
+ }
25
+ return {
26
+ "path": value["path"],
27
+ "message": value["message"]
28
+ };
29
+ }
@@ -1,9 +1,18 @@
1
+ export * from './AuditEntry.js';
1
2
  export * from './BucketInformation.js';
2
3
  export * from './Capabilities.js';
3
4
  export * from './CapabilityLimits.js';
4
5
  export * from './ClusterInformation.js';
5
6
  export * from './ClusterMemberInformation.js';
6
7
  export * from './CollectionCollation.js';
8
+ export * from './CollectionDeclaration.js';
9
+ export * from './CollectionDeclarationAudit.js';
10
+ export * from './CollectionDeclarationIndexesInner.js';
11
+ export * from './CollectionDeclarationOwner.js';
12
+ export * from './CollectionDeclarationRefsInner.js';
13
+ export * from './CollectionDeclarationSoftDelete.js';
14
+ export * from './CollectionDeclarationTimestamps.js';
15
+ export * from './CollectionDeclarationVersioned.js';
7
16
  export * from './CollectionOptions.js';
8
17
  export * from './CollectionPermission.js';
9
18
  export * from './CollectionStatus.js';
@@ -57,6 +66,7 @@ export * from './SchemaAnalysisField.js';
57
66
  export * from './SchemaAnalysisFieldType.js';
58
67
  export * from './SearchRequest.js';
59
68
  export * from './SettingsResponse.js';
69
+ export * from './SuggestedValidator.js';
60
70
  export * from './SystemInfo.js';
61
71
  export * from './SystemStats.js';
62
72
  export * from './UpdateFileInformationRequest.js';
@@ -65,4 +75,5 @@ export * from './UpdateResponse.js';
65
75
  export * from './UpdateRoleRequest.js';
66
76
  export * from './UserInformation.js';
67
77
  export * from './UserProfile.js';
78
+ export * from './ValidationIssue.js';
68
79
  export * from './Version.js';
@@ -1,9 +1,18 @@
1
+ export * from "./AuditEntry.js";
1
2
  export * from "./BucketInformation.js";
2
3
  export * from "./Capabilities.js";
3
4
  export * from "./CapabilityLimits.js";
4
5
  export * from "./ClusterInformation.js";
5
6
  export * from "./ClusterMemberInformation.js";
6
7
  export * from "./CollectionCollation.js";
8
+ export * from "./CollectionDeclaration.js";
9
+ export * from "./CollectionDeclarationAudit.js";
10
+ export * from "./CollectionDeclarationIndexesInner.js";
11
+ export * from "./CollectionDeclarationOwner.js";
12
+ export * from "./CollectionDeclarationRefsInner.js";
13
+ export * from "./CollectionDeclarationSoftDelete.js";
14
+ export * from "./CollectionDeclarationTimestamps.js";
15
+ export * from "./CollectionDeclarationVersioned.js";
7
16
  export * from "./CollectionOptions.js";
8
17
  export * from "./CollectionPermission.js";
9
18
  export * from "./CollectionStatus.js";
@@ -57,6 +66,7 @@ export * from "./SchemaAnalysisField.js";
57
66
  export * from "./SchemaAnalysisFieldType.js";
58
67
  export * from "./SearchRequest.js";
59
68
  export * from "./SettingsResponse.js";
69
+ export * from "./SuggestedValidator.js";
60
70
  export * from "./SystemInfo.js";
61
71
  export * from "./SystemStats.js";
62
72
  export * from "./UpdateFileInformationRequest.js";
@@ -65,4 +75,5 @@ export * from "./UpdateResponse.js";
65
75
  export * from "./UpdateRoleRequest.js";
66
76
  export * from "./UserInformation.js";
67
77
  export * from "./UserProfile.js";
78
+ export * from "./ValidationIssue.js";
68
79
  export * from "./Version.js";
@@ -1,26 +1,25 @@
1
1
  import type { MongoAggregateRequest } from '../api/index.js';
2
+ /**
3
+ * The collection with the generated client, documents as the server sends them. For typed and decoded documents use
4
+ * `useMongocampCollection(name)` (2.3.0).
5
+ */
2
6
  export declare function useMongocampApiCollection(collectionName: string): {
3
- insert: (document: {
4
- [key: string]: string;
5
- }) => Promise<import("../api/index.js").InsertResponse>;
6
- insertMany: (documents: Array<{
7
- [key: string]: string;
8
- }>) => Promise<import("../api/index.js").InsertResponse>;
9
- update: (documentId: string, document: {
10
- [key: string]: string;
11
- }) => Promise<import("../api/index.js").UpdateResponse>;
12
- updatePartial: (documentId: string, document: {
13
- [key: string]: string;
14
- }) => Promise<import("../api/index.js").UpdateResponse>;
7
+ insert: (document: Record<string, unknown>) => Promise<import("../api/index.js").InsertResponse>;
8
+ insertMany: (documents: Array<Record<string, unknown>>) => Promise<import("../api/index.js").InsertResponse>;
9
+ update: (documentId: string, document: Record<string, unknown>) => Promise<import("../api/index.js").UpdateResponse>;
10
+ updatePartial: (documentId: string, document: Record<string, unknown>) => Promise<import("../api/index.js").UpdateResponse>;
15
11
  remove: (documentId: string) => Promise<import("../api/index.js").DeleteResponse>;
16
- removeMany: (query: {
17
- [key: string]: string;
18
- }) => Promise<import("../api/index.js").DeleteResponse>;
12
+ removeMany: (query: Record<string, unknown>) => Promise<import("../api/index.js").DeleteResponse>;
19
13
  aggregate: (mongoAggregateRequest: MongoAggregateRequest, rowsPerPage?: number, page?: number) => Promise<{
20
14
  [key: string]: any;
21
15
  }[]>;
22
16
  information: (includeDetails?: boolean) => Promise<import("../api/index.js").CollectionStatus>;
23
17
  schemaAnalysis: () => Promise<import("../api/index.js").SchemaAnalysis>;
18
+ suggestValidator: (options?: {
19
+ sampleSize?: number;
20
+ depth?: number;
21
+ requiredThreshold?: number;
22
+ }) => Promise<import("../api/index.js").SuggestedValidator>;
24
23
  distinct: (field: string) => Promise<any[]>;
25
24
  clear: () => Promise<import("../api/index.js").JsonValueBoolean>;
26
25
  };
@@ -30,11 +30,14 @@ export function useMongocampApiCollection(collectionName) {
30
30
  function schemaAnalysis() {
31
31
  return collectionApi.getSchemaAnalysis({ collectionName });
32
32
  }
33
+ function suggestValidator(options = {}) {
34
+ return collectionApi.getSuggestedValidator({ collectionName, ...options });
35
+ }
33
36
  function distinct(field) {
34
37
  return collectionApi.distinct({ collectionName, field });
35
38
  }
36
39
  function clear() {
37
40
  return collectionApi.clearCollection({ collectionName });
38
41
  }
39
- return { insert, insertMany, update, updatePartial, remove, removeMany, aggregate, information, schemaAnalysis, distinct, clear };
42
+ return { insert, insertMany, update, updatePartial, remove, removeMany, aggregate, information, schemaAnalysis, suggestValidator, distinct, clear };
40
43
  }