@sfxcode/nuxt-mongocamp-server 1.7.0 → 1.8.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 (103) hide show
  1. package/README.md +8 -0
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +1 -1
  4. package/dist/runtime/api/.openapi-generator/FILES +18 -0
  5. package/dist/runtime/api/apis/AdminApi.d.ts +1 -1
  6. package/dist/runtime/api/apis/ApplicationApi.d.ts +1 -1
  7. package/dist/runtime/api/apis/AuthApi.d.ts +1 -1
  8. package/dist/runtime/api/apis/BucketApi.d.ts +1 -1
  9. package/dist/runtime/api/apis/CollectionApi.d.ts +58 -2
  10. package/dist/runtime/api/apis/CollectionApi.js +183 -0
  11. package/dist/runtime/api/apis/DatabaseApi.d.ts +1 -1
  12. package/dist/runtime/api/apis/DocumentApi.d.ts +47 -2
  13. package/dist/runtime/api/apis/DocumentApi.js +145 -0
  14. package/dist/runtime/api/apis/FileApi.d.ts +1 -1
  15. package/dist/runtime/api/apis/IndexApi.d.ts +19 -2
  16. package/dist/runtime/api/apis/IndexApi.js +52 -0
  17. package/dist/runtime/api/apis/JobsApi.d.ts +1 -1
  18. package/dist/runtime/api/apis/SystemApi.d.ts +1 -1
  19. package/dist/runtime/api/docs/CollectionApi.md +253 -1
  20. package/dist/runtime/api/docs/CopyRequest.md +40 -0
  21. package/dist/runtime/api/docs/CopyResponse.md +38 -0
  22. package/dist/runtime/api/docs/DocumentApi.md +196 -5
  23. package/dist/runtime/api/docs/FieldInfo.md +36 -0
  24. package/dist/runtime/api/docs/FieldTypeCount.md +36 -0
  25. package/dist/runtime/api/docs/ImportResponse.md +42 -0
  26. package/dist/runtime/api/docs/IndexApi.md +78 -0
  27. package/dist/runtime/api/docs/IndexCreateRequest.md +2 -0
  28. package/dist/runtime/api/docs/IndexInfo.md +54 -0
  29. package/dist/runtime/api/docs/IndexKey.md +36 -0
  30. package/dist/runtime/api/docs/IndexOptionsRequest.md +10 -0
  31. package/dist/runtime/api/docs/RenameRequest.md +36 -0
  32. package/dist/runtime/api/docs/RenameResponse.md +34 -0
  33. package/dist/runtime/api/models/BucketInformation.d.ts +1 -1
  34. package/dist/runtime/api/models/ClusterInformation.d.ts +1 -1
  35. package/dist/runtime/api/models/ClusterMemberInformation.d.ts +1 -1
  36. package/dist/runtime/api/models/CollectionPermission.d.ts +1 -1
  37. package/dist/runtime/api/models/CollectionStatus.d.ts +1 -1
  38. package/dist/runtime/api/models/CollectionSummary.d.ts +1 -1
  39. package/dist/runtime/api/models/CopyRequest.d.ts +50 -0
  40. package/dist/runtime/api/models/CopyRequest.js +32 -0
  41. package/dist/runtime/api/models/CopyResponse.d.ts +44 -0
  42. package/dist/runtime/api/models/CopyResponse.js +32 -0
  43. package/dist/runtime/api/models/CountResponse.d.ts +1 -1
  44. package/dist/runtime/api/models/DatabaseInfo.d.ts +1 -1
  45. package/dist/runtime/api/models/DeleteResponse.d.ts +1 -1
  46. package/dist/runtime/api/models/ErrorDescription.d.ts +1 -1
  47. package/dist/runtime/api/models/FieldInfo.d.ts +39 -0
  48. package/dist/runtime/api/models/FieldInfo.js +32 -0
  49. package/dist/runtime/api/models/FieldTypeCount.d.ts +38 -0
  50. package/dist/runtime/api/models/FieldTypeCount.js +29 -0
  51. package/dist/runtime/api/models/FileInformation.d.ts +1 -1
  52. package/dist/runtime/api/models/Grant.d.ts +1 -1
  53. package/dist/runtime/api/models/ImportResponse.d.ts +57 -0
  54. package/dist/runtime/api/models/ImportResponse.js +41 -0
  55. package/dist/runtime/api/models/IndexCreateRequest.d.ts +9 -2
  56. package/dist/runtime/api/models/IndexCreateRequest.js +9 -4
  57. package/dist/runtime/api/models/IndexCreateResponse.d.ts +1 -1
  58. package/dist/runtime/api/models/IndexDropResponse.d.ts +1 -1
  59. package/dist/runtime/api/models/IndexInfo.d.ts +99 -0
  60. package/dist/runtime/api/models/IndexInfo.js +54 -0
  61. package/dist/runtime/api/models/IndexKey.d.ts +38 -0
  62. package/dist/runtime/api/models/IndexKey.js +29 -0
  63. package/dist/runtime/api/models/IndexOptionsRequest.d.ts +37 -1
  64. package/dist/runtime/api/models/IndexOptionsRequest.js +12 -2
  65. package/dist/runtime/api/models/IndexUsage.d.ts +1 -1
  66. package/dist/runtime/api/models/InsertError.d.ts +1 -1
  67. package/dist/runtime/api/models/InsertResponse.d.ts +1 -1
  68. package/dist/runtime/api/models/JobConfig.d.ts +1 -1
  69. package/dist/runtime/api/models/JobInformation.d.ts +1 -1
  70. package/dist/runtime/api/models/JsonSchema.d.ts +1 -1
  71. package/dist/runtime/api/models/JsonSchemaDefinition.d.ts +1 -1
  72. package/dist/runtime/api/models/JsonValueAny.d.ts +1 -1
  73. package/dist/runtime/api/models/JsonValueBoolean.d.ts +1 -1
  74. package/dist/runtime/api/models/JsonValueString.d.ts +1 -1
  75. package/dist/runtime/api/models/Login.d.ts +1 -1
  76. package/dist/runtime/api/models/LoginResult.d.ts +1 -1
  77. package/dist/runtime/api/models/MongoAggregateRequest.d.ts +1 -1
  78. package/dist/runtime/api/models/MongoCampConfiguration.d.ts +1 -1
  79. package/dist/runtime/api/models/MongoFindRequest.d.ts +1 -1
  80. package/dist/runtime/api/models/MongoIndex.d.ts +1 -1
  81. package/dist/runtime/api/models/PasswordUpdateRequest.d.ts +1 -1
  82. package/dist/runtime/api/models/PipelineStage.d.ts +1 -1
  83. package/dist/runtime/api/models/RenameRequest.d.ts +38 -0
  84. package/dist/runtime/api/models/RenameRequest.js +28 -0
  85. package/dist/runtime/api/models/RenameResponse.d.ts +32 -0
  86. package/dist/runtime/api/models/RenameResponse.js +26 -0
  87. package/dist/runtime/api/models/Role.d.ts +1 -1
  88. package/dist/runtime/api/models/SchemaAnalysis.d.ts +1 -1
  89. package/dist/runtime/api/models/SchemaAnalysisField.d.ts +1 -1
  90. package/dist/runtime/api/models/SchemaAnalysisFieldType.d.ts +1 -1
  91. package/dist/runtime/api/models/SearchRequest.d.ts +1 -1
  92. package/dist/runtime/api/models/SettingsResponse.d.ts +1 -1
  93. package/dist/runtime/api/models/UpdateFileInformationRequest.d.ts +1 -1
  94. package/dist/runtime/api/models/UpdateRequest.d.ts +1 -1
  95. package/dist/runtime/api/models/UpdateResponse.d.ts +1 -1
  96. package/dist/runtime/api/models/UpdateRoleRequest.d.ts +1 -1
  97. package/dist/runtime/api/models/UserInformation.d.ts +1 -1
  98. package/dist/runtime/api/models/UserProfile.d.ts +1 -1
  99. package/dist/runtime/api/models/Version.d.ts +1 -1
  100. package/dist/runtime/api/models/index.d.ts +9 -0
  101. package/dist/runtime/api/models/index.js +9 -0
  102. package/dist/runtime/api/runtime.d.ts +1 -1
  103. package/package.json +2 -2
package/README.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  Nuxt module wrapping a generated OpenAPI client for [MongoCamp](https://mongocamp.io), with composables for browser-session auth and server-side API-key/bearer auth.
4
4
 
5
+ ## MongoCamp Server
6
+
7
+ This module is a client for [MongoCamp Server](https://github.com/MongoCamp/mongocamp-server), a REST API server for MongoDB that provides authentication, user/role management, and collection, document and index APIs. The OpenAPI client in this module is generated from the server's OpenAPI spec, so the module version should match a compatible server version. See the [server repository](https://github.com/MongoCamp/mongocamp-server) for installation, configuration and API documentation.
8
+
9
+ ## Nuxt UI MongoCamp
10
+
11
+ [nuxt-ui-mongocamp](https://github.com/sfxcode/nuxt-ui-mongocamp) is a companion project built on [Nuxt UI](https://ui.nuxt.com) that provides a user interface for MongoCamp. See its repository for setup and usage.
12
+
5
13
  ## Setup
6
14
 
7
15
  ```bash
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sfxcode/nuxt-mongocamp-server",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "configKey": "mongocamp",
5
5
  "compatibility": {
6
6
  "nuxt": ">=3.16.0"
package/dist/module.mjs CHANGED
@@ -4,7 +4,7 @@ import { consola } from 'consola';
4
4
  export * from '../dist/runtime/api/index.js';
5
5
 
6
6
  const name = "@sfxcode/nuxt-mongocamp-server";
7
- const version = "1.7.0";
7
+ const version = "1.8.0";
8
8
 
9
9
  const module$1 = defineNuxtModule({
10
10
  meta: {
@@ -21,19 +21,26 @@ docs/CollectionApi.md
21
21
  docs/CollectionPermission.md
22
22
  docs/CollectionStatus.md
23
23
  docs/CollectionSummary.md
24
+ docs/CopyRequest.md
25
+ docs/CopyResponse.md
24
26
  docs/CountResponse.md
25
27
  docs/DatabaseApi.md
26
28
  docs/DatabaseInfo.md
27
29
  docs/DeleteResponse.md
28
30
  docs/DocumentApi.md
29
31
  docs/ErrorDescription.md
32
+ docs/FieldInfo.md
33
+ docs/FieldTypeCount.md
30
34
  docs/FileApi.md
31
35
  docs/FileInformation.md
32
36
  docs/Grant.md
37
+ docs/ImportResponse.md
33
38
  docs/IndexApi.md
34
39
  docs/IndexCreateRequest.md
35
40
  docs/IndexCreateResponse.md
36
41
  docs/IndexDropResponse.md
42
+ docs/IndexInfo.md
43
+ docs/IndexKey.md
37
44
  docs/IndexOptionsRequest.md
38
45
  docs/IndexUsage.md
39
46
  docs/InsertError.md
@@ -54,6 +61,8 @@ docs/MongoFindRequest.md
54
61
  docs/MongoIndex.md
55
62
  docs/PasswordUpdateRequest.md
56
63
  docs/PipelineStage.md
64
+ docs/RenameRequest.md
65
+ docs/RenameResponse.md
57
66
  docs/Role.md
58
67
  docs/SchemaAnalysis.md
59
68
  docs/SchemaAnalysisField.md
@@ -75,15 +84,22 @@ models/ClusterMemberInformation.ts
75
84
  models/CollectionPermission.ts
76
85
  models/CollectionStatus.ts
77
86
  models/CollectionSummary.ts
87
+ models/CopyRequest.ts
88
+ models/CopyResponse.ts
78
89
  models/CountResponse.ts
79
90
  models/DatabaseInfo.ts
80
91
  models/DeleteResponse.ts
81
92
  models/ErrorDescription.ts
93
+ models/FieldInfo.ts
94
+ models/FieldTypeCount.ts
82
95
  models/FileInformation.ts
83
96
  models/Grant.ts
97
+ models/ImportResponse.ts
84
98
  models/IndexCreateRequest.ts
85
99
  models/IndexCreateResponse.ts
86
100
  models/IndexDropResponse.ts
101
+ models/IndexInfo.ts
102
+ models/IndexKey.ts
87
103
  models/IndexOptionsRequest.ts
88
104
  models/IndexUsage.ts
89
105
  models/InsertError.ts
@@ -103,6 +119,8 @@ models/MongoFindRequest.ts
103
119
  models/MongoIndex.ts
104
120
  models/PasswordUpdateRequest.ts
105
121
  models/PipelineStage.ts
122
+ models/RenameRequest.ts
123
+ models/RenameResponse.ts
106
124
  models/Role.ts
107
125
  models/SchemaAnalysis.ts
108
126
  models/SchemaAnalysisField.ts
@@ -2,7 +2,7 @@
2
2
  * mongocamp-library
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 1.7.1
5
+ * The version of the OpenAPI document: 1.8.1
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * mongocamp-library
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 1.7.1
5
+ * The version of the OpenAPI document: 1.8.1
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * mongocamp-library
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 1.7.1
5
+ * The version of the OpenAPI document: 1.8.1
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * mongocamp-library
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 1.7.1
5
+ * The version of the OpenAPI document: 1.8.1
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * mongocamp-library
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 1.7.1
5
+ * The version of the OpenAPI document: 1.8.1
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -10,17 +10,22 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime.js';
13
- import type { CollectionStatus, CollectionSummary, JsonSchema, JsonValueBoolean, MongoAggregateRequest, SchemaAnalysis } from '../models/index.js';
13
+ import type { CollectionStatus, CollectionSummary, CopyRequest, CopyResponse, FieldInfo, JsonSchema, JsonValueBoolean, MongoAggregateRequest, RenameRequest, RenameResponse, SchemaAnalysis } from '../models/index.js';
14
14
  export interface AggregateRequest {
15
15
  collectionName: string;
16
16
  mongoAggregateRequest: MongoAggregateRequest;
17
17
  rowsPerPage?: number;
18
18
  page?: number;
19
19
  filter?: string;
20
+ extendedJson?: string;
20
21
  }
21
22
  export interface ClearCollectionRequest {
22
23
  collectionName: string;
23
24
  }
25
+ export interface CopyCollectionRequest {
26
+ collectionName: string;
27
+ copyRequest: CopyRequest;
28
+ }
24
29
  export interface DeleteCollectionRequest {
25
30
  collectionName: string;
26
31
  }
@@ -38,6 +43,11 @@ export interface GetCollectionInformationRequest {
38
43
  collectionName: string;
39
44
  includeDetails?: boolean;
40
45
  }
46
+ export interface GetFieldDetailsRequest {
47
+ collectionName: string;
48
+ sampleSize?: number;
49
+ depth?: number;
50
+ }
41
51
  export interface GetJsonSchemaRequest {
42
52
  collectionName: string;
43
53
  sampleSize?: number;
@@ -54,6 +64,10 @@ export interface ListCollectionInformationRequest {
54
64
  export interface ListCollectionsByDatabaseRequest {
55
65
  databaseName: string;
56
66
  }
67
+ export interface RenameCollectionRequest {
68
+ collectionName: string;
69
+ renameRequest: RenameRequest;
70
+ }
57
71
  /**
58
72
  *
59
73
  */
@@ -90,6 +104,20 @@ export declare class CollectionApi extends runtime.BaseAPI {
90
104
  * Clear Collection
91
105
  */
92
106
  clearCollection(requestParameters: ClearCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JsonValueBoolean>;
107
+ /**
108
+ * Creates request options for copyCollection without sending the request
109
+ */
110
+ copyCollectionRequestOpts(requestParameters: CopyCollectionRequest): Promise<runtime.RequestOpts>;
111
+ /**
112
+ * Copy a Collection in the database, optionally only the documents that match a Lucene filter, with its indices (withIndexes, true by default). The target is a name in the database of the Collection. The read grant for the Collection and the write grant for the target are needed. An existing target is a conflict (409), unless dropTarget is true and the user has the administrate grant for it: it is replaced when the copy is complete. The copy is made in one request, a big collection takes its time.
113
+ * Copy Collection
114
+ */
115
+ copyCollectionRaw(requestParameters: CopyCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CopyResponse>>;
116
+ /**
117
+ * Copy a Collection in the database, optionally only the documents that match a Lucene filter, with its indices (withIndexes, true by default). The target is a name in the database of the Collection. The read grant for the Collection and the write grant for the target are needed. An existing target is a conflict (409), unless dropTarget is true and the user has the administrate grant for it: it is replaced when the copy is complete. The copy is made in one request, a big collection takes its time.
118
+ * Copy Collection
119
+ */
120
+ copyCollection(requestParameters: CopyCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CopyResponse>;
93
121
  /**
94
122
  * Creates request options for deleteCollection without sending the request
95
123
  */
@@ -146,6 +174,20 @@ export declare class CollectionApi extends runtime.BaseAPI {
146
174
  * Collection Information
147
175
  */
148
176
  getCollectionInformation(requestParameters: GetCollectionInformationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CollectionStatus>;
177
+ /**
178
+ * Creates request options for getFieldDetails without sending the request
179
+ */
180
+ getFieldDetailsRequestOpts(requestParameters: GetFieldDetailsRequest): Promise<runtime.RequestOpts>;
181
+ /**
182
+ * All fields of a collection as a flat list, one entry per path (`address.city`, `tags[]` for the elements of an array) with the types of the values and how often every type was found in the analysed documents.
183
+ * Fields of a Collection with types
184
+ */
185
+ getFieldDetailsRaw(requestParameters: GetFieldDetailsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<FieldInfo>>>;
186
+ /**
187
+ * All fields of a collection as a flat list, one entry per path (`address.city`, `tags[]` for the elements of an array) with the types of the values and how often every type was found in the analysed documents.
188
+ * Fields of a Collection with types
189
+ */
190
+ getFieldDetails(requestParameters: GetFieldDetailsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<FieldInfo>>;
149
191
  /**
150
192
  * Creates request options for getJsonSchema without sending the request
151
193
  */
@@ -216,4 +258,18 @@ export declare class CollectionApi extends runtime.BaseAPI {
216
258
  * List of Collections
217
259
  */
218
260
  listCollectionsByDatabase(requestParameters: ListCollectionsByDatabaseRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<string>>;
261
+ /**
262
+ * Creates request options for renameCollection without sending the request
263
+ */
264
+ renameCollectionRequestOpts(requestParameters: RenameCollectionRequest): Promise<runtime.RequestOpts>;
265
+ /**
266
+ * Rename a Collection in the database, with its Documents and Indices. The target is a name in the database of the Collection. The administrate grant for the Collection and the write grant for the target are needed. An existing target is a conflict (409), unless dropTarget is true and the user has the administrate grant for it: it is replaced then.
267
+ * Rename Collection
268
+ */
269
+ renameCollectionRaw(requestParameters: RenameCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RenameResponse>>;
270
+ /**
271
+ * Rename a Collection in the database, with its Documents and Indices. The target is a name in the database of the Collection. The administrate grant for the Collection and the write grant for the target are needed. An existing target is a conflict (409), unless dropTarget is true and the user has the administrate grant for it: it is replaced then.
272
+ * Rename Collection
273
+ */
274
+ renameCollection(requestParameters: RenameCollectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RenameResponse>;
219
275
  }
@@ -2,9 +2,14 @@ import * as runtime from "../runtime.js";
2
2
  import {
3
3
  CollectionStatusFromJSON,
4
4
  CollectionSummaryFromJSON,
5
+ CopyRequestToJSON,
6
+ CopyResponseFromJSON,
7
+ FieldInfoFromJSON,
5
8
  JsonSchemaFromJSON,
6
9
  JsonValueBooleanFromJSON,
7
10
  MongoAggregateRequestToJSON,
11
+ RenameRequestToJSON,
12
+ RenameResponseFromJSON,
8
13
  SchemaAnalysisFromJSON
9
14
  } from "../models/index.js";
10
15
  export class CollectionApi extends runtime.BaseAPI {
@@ -34,6 +39,9 @@ export class CollectionApi extends runtime.BaseAPI {
34
39
  if (requestParameters["filter"] != null) {
35
40
  queryParameters["filter"] = requestParameters["filter"];
36
41
  }
42
+ if (requestParameters["extendedJson"] != null) {
43
+ queryParameters["extendedJson"] = requestParameters["extendedJson"];
44
+ }
37
45
  const headerParameters = {};
38
46
  headerParameters["Content-Type"] = "application/json";
39
47
  if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
@@ -127,6 +135,65 @@ export class CollectionApi extends runtime.BaseAPI {
127
135
  const response = await this.clearCollectionRaw(requestParameters, initOverrides);
128
136
  return await response.value();
129
137
  }
138
+ /**
139
+ * Creates request options for copyCollection without sending the request
140
+ */
141
+ async copyCollectionRequestOpts(requestParameters) {
142
+ if (requestParameters["collectionName"] == null) {
143
+ throw new runtime.RequiredError(
144
+ "collectionName",
145
+ 'Required parameter "collectionName" was null or undefined when calling copyCollection().'
146
+ );
147
+ }
148
+ if (requestParameters["copyRequest"] == null) {
149
+ throw new runtime.RequiredError(
150
+ "copyRequest",
151
+ 'Required parameter "copyRequest" was null or undefined when calling copyCollection().'
152
+ );
153
+ }
154
+ const queryParameters = {};
155
+ const headerParameters = {};
156
+ headerParameters["Content-Type"] = "application/json";
157
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
158
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
159
+ }
160
+ if (this.configuration && this.configuration.accessToken) {
161
+ const token = this.configuration.accessToken;
162
+ const tokenString = await token("httpAuth", []);
163
+ if (tokenString) {
164
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
165
+ }
166
+ }
167
+ if (this.configuration && this.configuration.apiKey) {
168
+ headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
169
+ }
170
+ let urlPath = `/mongodb/collections/{collectionName}/copy`;
171
+ urlPath = urlPath.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters["collectionName"])));
172
+ return {
173
+ path: urlPath,
174
+ method: "POST",
175
+ headers: headerParameters,
176
+ query: queryParameters,
177
+ body: CopyRequestToJSON(requestParameters["copyRequest"])
178
+ };
179
+ }
180
+ /**
181
+ * Copy a Collection in the database, optionally only the documents that match a Lucene filter, with its indices (withIndexes, true by default). The target is a name in the database of the Collection. The read grant for the Collection and the write grant for the target are needed. An existing target is a conflict (409), unless dropTarget is true and the user has the administrate grant for it: it is replaced when the copy is complete. The copy is made in one request, a big collection takes its time.
182
+ * Copy Collection
183
+ */
184
+ async copyCollectionRaw(requestParameters, initOverrides) {
185
+ const requestOptions = await this.copyCollectionRequestOpts(requestParameters);
186
+ const response = await this.request(requestOptions, initOverrides);
187
+ return new runtime.JSONApiResponse(response, (jsonValue) => CopyResponseFromJSON(jsonValue));
188
+ }
189
+ /**
190
+ * Copy a Collection in the database, optionally only the documents that match a Lucene filter, with its indices (withIndexes, true by default). The target is a name in the database of the Collection. The read grant for the Collection and the write grant for the target are needed. An existing target is a conflict (409), unless dropTarget is true and the user has the administrate grant for it: it is replaced when the copy is complete. The copy is made in one request, a big collection takes its time.
191
+ * Copy Collection
192
+ */
193
+ async copyCollection(requestParameters, initOverrides) {
194
+ const response = await this.copyCollectionRaw(requestParameters, initOverrides);
195
+ return await response.value();
196
+ }
130
197
  /**
131
198
  * Creates request options for deleteCollection without sending the request
132
199
  */
@@ -350,6 +417,63 @@ export class CollectionApi extends runtime.BaseAPI {
350
417
  const response = await this.getCollectionInformationRaw(requestParameters, initOverrides);
351
418
  return await response.value();
352
419
  }
420
+ /**
421
+ * Creates request options for getFieldDetails without sending the request
422
+ */
423
+ async getFieldDetailsRequestOpts(requestParameters) {
424
+ if (requestParameters["collectionName"] == null) {
425
+ throw new runtime.RequiredError(
426
+ "collectionName",
427
+ 'Required parameter "collectionName" was null or undefined when calling getFieldDetails().'
428
+ );
429
+ }
430
+ const queryParameters = {};
431
+ if (requestParameters["sampleSize"] != null) {
432
+ queryParameters["sampleSize"] = requestParameters["sampleSize"];
433
+ }
434
+ if (requestParameters["depth"] != null) {
435
+ queryParameters["depth"] = requestParameters["depth"];
436
+ }
437
+ const headerParameters = {};
438
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
439
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
440
+ }
441
+ if (this.configuration && this.configuration.accessToken) {
442
+ const token = this.configuration.accessToken;
443
+ const tokenString = await token("httpAuth", []);
444
+ if (tokenString) {
445
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
446
+ }
447
+ }
448
+ if (this.configuration && this.configuration.apiKey) {
449
+ headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
450
+ }
451
+ let urlPath = `/mongodb/collections/{collectionName}/fields/detail`;
452
+ urlPath = urlPath.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters["collectionName"])));
453
+ return {
454
+ path: urlPath,
455
+ method: "GET",
456
+ headers: headerParameters,
457
+ query: queryParameters
458
+ };
459
+ }
460
+ /**
461
+ * All fields of a collection as a flat list, one entry per path (`address.city`, `tags[]` for the elements of an array) with the types of the values and how often every type was found in the analysed documents.
462
+ * Fields of a Collection with types
463
+ */
464
+ async getFieldDetailsRaw(requestParameters, initOverrides) {
465
+ const requestOptions = await this.getFieldDetailsRequestOpts(requestParameters);
466
+ const response = await this.request(requestOptions, initOverrides);
467
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(FieldInfoFromJSON));
468
+ }
469
+ /**
470
+ * All fields of a collection as a flat list, one entry per path (`address.city`, `tags[]` for the elements of an array) with the types of the values and how often every type was found in the analysed documents.
471
+ * Fields of a Collection with types
472
+ */
473
+ async getFieldDetails(requestParameters, initOverrides) {
474
+ const response = await this.getFieldDetailsRaw(requestParameters, initOverrides);
475
+ return await response.value();
476
+ }
353
477
  /**
354
478
  * Creates request options for getJsonSchema without sending the request
355
479
  */
@@ -606,4 +730,63 @@ export class CollectionApi extends runtime.BaseAPI {
606
730
  const response = await this.listCollectionsByDatabaseRaw(requestParameters, initOverrides);
607
731
  return await response.value();
608
732
  }
733
+ /**
734
+ * Creates request options for renameCollection without sending the request
735
+ */
736
+ async renameCollectionRequestOpts(requestParameters) {
737
+ if (requestParameters["collectionName"] == null) {
738
+ throw new runtime.RequiredError(
739
+ "collectionName",
740
+ 'Required parameter "collectionName" was null or undefined when calling renameCollection().'
741
+ );
742
+ }
743
+ if (requestParameters["renameRequest"] == null) {
744
+ throw new runtime.RequiredError(
745
+ "renameRequest",
746
+ 'Required parameter "renameRequest" was null or undefined when calling renameCollection().'
747
+ );
748
+ }
749
+ const queryParameters = {};
750
+ const headerParameters = {};
751
+ headerParameters["Content-Type"] = "application/json";
752
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
753
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
754
+ }
755
+ if (this.configuration && this.configuration.accessToken) {
756
+ const token = this.configuration.accessToken;
757
+ const tokenString = await token("httpAuth", []);
758
+ if (tokenString) {
759
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
760
+ }
761
+ }
762
+ if (this.configuration && this.configuration.apiKey) {
763
+ headerParameters["X-AUTH-APIKEY"] = await this.configuration.apiKey("X-AUTH-APIKEY");
764
+ }
765
+ let urlPath = `/mongodb/collections/{collectionName}/rename`;
766
+ urlPath = urlPath.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters["collectionName"])));
767
+ return {
768
+ path: urlPath,
769
+ method: "POST",
770
+ headers: headerParameters,
771
+ query: queryParameters,
772
+ body: RenameRequestToJSON(requestParameters["renameRequest"])
773
+ };
774
+ }
775
+ /**
776
+ * Rename a Collection in the database, with its Documents and Indices. The target is a name in the database of the Collection. The administrate grant for the Collection and the write grant for the target are needed. An existing target is a conflict (409), unless dropTarget is true and the user has the administrate grant for it: it is replaced then.
777
+ * Rename Collection
778
+ */
779
+ async renameCollectionRaw(requestParameters, initOverrides) {
780
+ const requestOptions = await this.renameCollectionRequestOpts(requestParameters);
781
+ const response = await this.request(requestOptions, initOverrides);
782
+ return new runtime.JSONApiResponse(response, (jsonValue) => RenameResponseFromJSON(jsonValue));
783
+ }
784
+ /**
785
+ * Rename a Collection in the database, with its Documents and Indices. The target is a name in the database of the Collection. The administrate grant for the Collection and the write grant for the target are needed. An existing target is a conflict (409), unless dropTarget is true and the user has the administrate grant for it: it is replaced then.
786
+ * Rename Collection
787
+ */
788
+ async renameCollection(requestParameters, initOverrides) {
789
+ const response = await this.renameCollectionRaw(requestParameters, initOverrides);
790
+ return await response.value();
791
+ }
609
792
  }
@@ -2,7 +2,7 @@
2
2
  * mongocamp-library
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 1.7.1
5
+ * The version of the OpenAPI document: 1.8.1
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -2,7 +2,7 @@
2
2
  * mongocamp-library
3
3
  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
4
  *
5
- * The version of the OpenAPI document: 1.7.1
5
+ * The version of the OpenAPI document: 1.8.1
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime.js';
13
- import type { CountResponse, DeleteResponse, InsertResponse, MongoFindRequest, SearchRequest, UpdateRequest, UpdateResponse } from '../models/index.js';
13
+ import type { CountResponse, DeleteResponse, ImportResponse, InsertResponse, MongoFindRequest, SearchRequest, UpdateRequest, UpdateResponse } from '../models/index.js';
14
14
  export interface DeleteRequest {
15
15
  collectionName: string;
16
16
  documentId: string;
@@ -27,15 +27,30 @@ export interface DeleteManyRequest {
27
27
  matchAll?: boolean;
28
28
  filter?: string;
29
29
  }
30
+ export interface ExportDocumentsRequest {
31
+ collectionName: string;
32
+ format?: string;
33
+ filter?: string;
34
+ sort?: Array<string>;
35
+ projection?: Array<string>;
36
+ limit?: number;
37
+ extendedJson?: string;
38
+ }
30
39
  export interface FindRequest {
31
40
  collectionName: string;
32
41
  mongoFindRequest: MongoFindRequest;
33
42
  rowsPerPage?: number;
34
43
  page?: number;
44
+ extendedJson?: string;
35
45
  }
36
46
  export interface GetDocumentRequest {
37
47
  collectionName: string;
38
48
  documentId: string;
49
+ extendedJson?: string;
50
+ }
51
+ export interface ImportDocumentsRequest {
52
+ collectionName: string;
53
+ body: string;
39
54
  }
40
55
  export interface InsertRequest {
41
56
  collectionName: string;
@@ -57,12 +72,14 @@ export interface ListDocumentsRequest {
57
72
  projection?: Array<string>;
58
73
  rowsPerPage?: number;
59
74
  page?: number;
75
+ extendedJson?: string;
60
76
  }
61
77
  export interface SearchDocumentsRequest {
62
78
  collectionName: string;
63
79
  searchRequest: SearchRequest;
64
80
  rowsPerPage?: number;
65
81
  page?: number;
82
+ extendedJson?: string;
66
83
  }
67
84
  export interface UpdateRequest {
68
85
  collectionName: string;
@@ -130,6 +147,20 @@ export declare class DocumentApi extends runtime.BaseAPI {
130
147
  * Delete Many in Collection
131
148
  */
132
149
  deleteMany(requestParameters: DeleteManyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DeleteResponse>;
150
+ /**
151
+ * Creates request options for exportDocuments without sending the request
152
+ */
153
+ exportDocumentsRequestOpts(requestParameters: ExportDocumentsRequest): Promise<runtime.RequestOpts>;
154
+ /**
155
+ * Download the documents of a Collection as a stream: ndjson (one JSON document per line), json (one array) or csv (a header line, nested values as JSON, a text with a comma, a quote or a line break in quotes). The documents are written while the database delivers them, the memory of the server does not depend on the size of the Collection. The columns of a csv export are the fields of `projection`, by default the fields of the first 1000 documents. With extendedJson the types of the values are explicit. A failure while the stream is running ends the stream, the status is 200 by then.
156
+ * Export Documents of a Collection
157
+ */
158
+ exportDocumentsRaw(requestParameters: ExportDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
159
+ /**
160
+ * Download the documents of a Collection as a stream: ndjson (one JSON document per line), json (one array) or csv (a header line, nested values as JSON, a text with a comma, a quote or a line break in quotes). The documents are written while the database delivers them, the memory of the server does not depend on the size of the Collection. The columns of a csv export are the fields of `projection`, by default the fields of the first 1000 documents. With extendedJson the types of the values are explicit. A failure while the stream is running ends the stream, the status is 200 by then.
161
+ * Export Documents of a Collection
162
+ */
163
+ exportDocuments(requestParameters: ExportDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
133
164
  /**
134
165
  * Creates request options for find without sending the request
135
166
  */
@@ -166,6 +197,20 @@ export declare class DocumentApi extends runtime.BaseAPI {
166
197
  getDocument(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{
167
198
  [key: string]: any;
168
199
  }>;
200
+ /**
201
+ * Creates request options for importDocuments without sending the request
202
+ */
203
+ importDocumentsRequestOpts(requestParameters: ImportDocumentsRequest): Promise<runtime.RequestOpts>;
204
+ /**
205
+ * Store the documents of the request body: one JSON document per line (NDJSON, as written by the export). A line is read like a document in the body of an insert (Extended JSON wrappers, dates). The body is read as a stream and the documents are stored in batches without ordering, a line that cannot be stored does not stop the others: the answer counts what was read, stored and failed and names the first failed lines (`errors`, `index` is the number of the line). The size of the body is limited by IMPORT_MAX_BYTES (413 above), there is no time limit.
206
+ * Import Documents into a Collection
207
+ */
208
+ importDocumentsRaw(requestParameters: ImportDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ImportResponse>>;
209
+ /**
210
+ * Store the documents of the request body: one JSON document per line (NDJSON, as written by the export). A line is read like a document in the body of an insert (Extended JSON wrappers, dates). The body is read as a stream and the documents are stored in batches without ordering, a line that cannot be stored does not stop the others: the answer counts what was read, stored and failed and names the first failed lines (`errors`, `index` is the number of the line). The size of the body is limited by IMPORT_MAX_BYTES (413 above), there is no time limit.
211
+ * Import Documents into a Collection
212
+ */
213
+ importDocuments(requestParameters: ImportDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ImportResponse>;
169
214
  /**
170
215
  * Creates request options for insert without sending the request
171
216
  */