@sfxcode/nuxt-mongocamp-server 0.7.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 (129) hide show
  1. package/README.md +38 -0
  2. package/dist/module.cjs +5 -0
  3. package/dist/module.d.ts +9 -0
  4. package/dist/module.json +5 -0
  5. package/dist/module.mjs +72 -0
  6. package/dist/runtime/api/apis/AdminApi.d.ts +181 -0
  7. package/dist/runtime/api/apis/AdminApi.mjs +413 -0
  8. package/dist/runtime/api/apis/ApplicationApi.d.ts +68 -0
  9. package/dist/runtime/api/apis/ApplicationApi.mjs +147 -0
  10. package/dist/runtime/api/apis/AuthApi.d.ts +107 -0
  11. package/dist/runtime/api/apis/AuthApi.mjs +235 -0
  12. package/dist/runtime/api/apis/BucketApi.d.ts +67 -0
  13. package/dist/runtime/api/apis/BucketApi.mjs +128 -0
  14. package/dist/runtime/api/apis/CollectionApi.d.ts +161 -0
  15. package/dist/runtime/api/apis/CollectionApi.mjs +355 -0
  16. package/dist/runtime/api/apis/DatabaseApi.d.ts +77 -0
  17. package/dist/runtime/api/apis/DatabaseApi.mjs +156 -0
  18. package/dist/runtime/api/apis/DocumentApi.d.ts +188 -0
  19. package/dist/runtime/api/apis/DocumentApi.mjs +385 -0
  20. package/dist/runtime/api/apis/FileApi.d.ts +125 -0
  21. package/dist/runtime/api/apis/FileApi.mjs +299 -0
  22. package/dist/runtime/api/apis/IndexApi.d.ts +137 -0
  23. package/dist/runtime/api/apis/IndexApi.mjs +303 -0
  24. package/dist/runtime/api/apis/InformationApi.d.ts +28 -0
  25. package/dist/runtime/api/apis/InformationApi.mjs +21 -0
  26. package/dist/runtime/api/apis/JobsApi.d.ts +94 -0
  27. package/dist/runtime/api/apis/JobsApi.mjs +204 -0
  28. package/dist/runtime/api/apis/index.d.ts +11 -0
  29. package/dist/runtime/api/apis/index.mjs +11 -0
  30. package/dist/runtime/api/index.d.ts +3 -0
  31. package/dist/runtime/api/index.mjs +3 -0
  32. package/dist/runtime/api/models/BucketInformation.d.ts +45 -0
  33. package/dist/runtime/api/models/BucketInformation.mjs +28 -0
  34. package/dist/runtime/api/models/CollectionStatus.d.ts +103 -0
  35. package/dist/runtime/api/models/CollectionStatus.mjs +46 -0
  36. package/dist/runtime/api/models/DatabaseInfo.d.ts +53 -0
  37. package/dist/runtime/api/models/DatabaseInfo.mjs +30 -0
  38. package/dist/runtime/api/models/DeleteResponse.d.ts +33 -0
  39. package/dist/runtime/api/models/DeleteResponse.mjs +24 -0
  40. package/dist/runtime/api/models/ErrorDescription.d.ts +39 -0
  41. package/dist/runtime/api/models/ErrorDescription.mjs +26 -0
  42. package/dist/runtime/api/models/FileInformation.d.ts +59 -0
  43. package/dist/runtime/api/models/FileInformation.mjs +32 -0
  44. package/dist/runtime/api/models/Grant.d.ts +51 -0
  45. package/dist/runtime/api/models/Grant.mjs +30 -0
  46. package/dist/runtime/api/models/IndexCreateRequest.d.ts +36 -0
  47. package/dist/runtime/api/models/IndexCreateRequest.mjs +29 -0
  48. package/dist/runtime/api/models/IndexCreateResponse.d.ts +27 -0
  49. package/dist/runtime/api/models/IndexCreateResponse.mjs +22 -0
  50. package/dist/runtime/api/models/IndexDropResponse.d.ts +27 -0
  51. package/dist/runtime/api/models/IndexDropResponse.mjs +22 -0
  52. package/dist/runtime/api/models/IndexOptionsRequest.d.ts +69 -0
  53. package/dist/runtime/api/models/IndexOptionsRequest.mjs +37 -0
  54. package/dist/runtime/api/models/InsertResponse.d.ts +33 -0
  55. package/dist/runtime/api/models/InsertResponse.mjs +25 -0
  56. package/dist/runtime/api/models/JobConfig.d.ts +57 -0
  57. package/dist/runtime/api/models/JobConfig.mjs +32 -0
  58. package/dist/runtime/api/models/JobInformation.d.ts +75 -0
  59. package/dist/runtime/api/models/JobInformation.mjs +39 -0
  60. package/dist/runtime/api/models/JsonResultBoolean.d.ts +27 -0
  61. package/dist/runtime/api/models/JsonResultBoolean.mjs +22 -0
  62. package/dist/runtime/api/models/JsonResultString.d.ts +27 -0
  63. package/dist/runtime/api/models/JsonResultString.mjs +22 -0
  64. package/dist/runtime/api/models/JsonSchema.d.ts +42 -0
  65. package/dist/runtime/api/models/JsonSchema.mjs +31 -0
  66. package/dist/runtime/api/models/JsonSchemaDefinition.d.ts +55 -0
  67. package/dist/runtime/api/models/JsonSchemaDefinition.mjs +31 -0
  68. package/dist/runtime/api/models/Login.d.ts +33 -0
  69. package/dist/runtime/api/models/Login.mjs +24 -0
  70. package/dist/runtime/api/models/LoginResult.d.ts +40 -0
  71. package/dist/runtime/api/models/LoginResult.mjs +30 -0
  72. package/dist/runtime/api/models/Measurement.d.ts +33 -0
  73. package/dist/runtime/api/models/Measurement.mjs +24 -0
  74. package/dist/runtime/api/models/Metric.d.ts +52 -0
  75. package/dist/runtime/api/models/Metric.mjs +35 -0
  76. package/dist/runtime/api/models/MongoAggregateRequest.d.ts +34 -0
  77. package/dist/runtime/api/models/MongoAggregateRequest.mjs +29 -0
  78. package/dist/runtime/api/models/MongoFindRequest.d.ts +45 -0
  79. package/dist/runtime/api/models/MongoFindRequest.mjs +26 -0
  80. package/dist/runtime/api/models/MongoIndex.d.ts +99 -0
  81. package/dist/runtime/api/models/MongoIndex.mjs +45 -0
  82. package/dist/runtime/api/models/PasswordUpdateRequest.d.ts +27 -0
  83. package/dist/runtime/api/models/PasswordUpdateRequest.mjs +22 -0
  84. package/dist/runtime/api/models/PipelineStage.d.ts +33 -0
  85. package/dist/runtime/api/models/PipelineStage.mjs +24 -0
  86. package/dist/runtime/api/models/Role.d.ts +40 -0
  87. package/dist/runtime/api/models/Role.mjs +31 -0
  88. package/dist/runtime/api/models/SchemaAnalysis.d.ts +46 -0
  89. package/dist/runtime/api/models/SchemaAnalysis.mjs +33 -0
  90. package/dist/runtime/api/models/SchemaAnalysisField.d.ts +58 -0
  91. package/dist/runtime/api/models/SchemaAnalysisField.mjs +37 -0
  92. package/dist/runtime/api/models/SchemaAnalysisFieldType.d.ts +39 -0
  93. package/dist/runtime/api/models/SchemaAnalysisFieldType.mjs +26 -0
  94. package/dist/runtime/api/models/SettingsResponse.d.ts +47 -0
  95. package/dist/runtime/api/models/SettingsResponse.mjs +29 -0
  96. package/dist/runtime/api/models/UpdateFileInformationRequest.d.ts +35 -0
  97. package/dist/runtime/api/models/UpdateFileInformationRequest.mjs +25 -0
  98. package/dist/runtime/api/models/UpdateRequest.d.ts +37 -0
  99. package/dist/runtime/api/models/UpdateRequest.mjs +24 -0
  100. package/dist/runtime/api/models/UpdateResponse.d.ts +45 -0
  101. package/dist/runtime/api/models/UpdateResponse.mjs +29 -0
  102. package/dist/runtime/api/models/UpdateRoleRequest.d.ts +34 -0
  103. package/dist/runtime/api/models/UpdateRoleRequest.mjs +29 -0
  104. package/dist/runtime/api/models/UserInformation.d.ts +45 -0
  105. package/dist/runtime/api/models/UserInformation.mjs +29 -0
  106. package/dist/runtime/api/models/UserProfile.d.ts +52 -0
  107. package/dist/runtime/api/models/UserProfile.mjs +35 -0
  108. package/dist/runtime/api/models/Version.d.ts +39 -0
  109. package/dist/runtime/api/models/Version.mjs +26 -0
  110. package/dist/runtime/api/models/index.d.ts +39 -0
  111. package/dist/runtime/api/models/index.mjs +39 -0
  112. package/dist/runtime/api/runtime.d.ts +140 -0
  113. package/dist/runtime/api/runtime.mjs +196 -0
  114. package/dist/runtime/composables/mongocampApi.d.ts +14 -0
  115. package/dist/runtime/composables/mongocampApi.mjs +45 -0
  116. package/dist/runtime/composables/mongocampAuth.d.ts +9 -0
  117. package/dist/runtime/composables/mongocampAuth.mjs +52 -0
  118. package/dist/runtime/composables/mongocampSearch.d.ts +6 -0
  119. package/dist/runtime/composables/mongocampSearch.mjs +12 -0
  120. package/dist/runtime/composables/mongocampToken.d.ts +1 -0
  121. package/dist/runtime/composables/mongocampToken.mjs +10 -0
  122. package/dist/runtime/composables/mongocampUrl.d.ts +1 -0
  123. package/dist/runtime/composables/mongocampUrl.mjs +5 -0
  124. package/dist/runtime/composables/mongocampUser.d.ts +3 -0
  125. package/dist/runtime/composables/mongocampUser.mjs +2 -0
  126. package/dist/runtime/plugin.d.ts +2 -0
  127. package/dist/runtime/plugin.mjs +6 -0
  128. package/dist/types.d.ts +10 -0
  129. package/package.json +37 -0
@@ -0,0 +1,385 @@
1
+ import * as runtime from "../runtime.mjs";
2
+ import {
3
+ DeleteResponseFromJSON,
4
+ InsertResponseFromJSON,
5
+ MongoFindRequestToJSON,
6
+ UpdateRequestToJSON,
7
+ UpdateResponseFromJSON
8
+ } from "../models";
9
+ export class DocumentApi extends runtime.BaseAPI {
10
+ async deleteDocumentRaw(requestParameters, initOverrides) {
11
+ if (requestParameters.collectionName === null || requestParameters.collectionName === void 0) {
12
+ throw new runtime.RequiredError("collectionName", "Required parameter requestParameters.collectionName was null or undefined when calling deleteDocument.");
13
+ }
14
+ if (requestParameters.documentId === null || requestParameters.documentId === void 0) {
15
+ throw new runtime.RequiredError("documentId", "Required parameter requestParameters.documentId was null or undefined when calling deleteDocument.");
16
+ }
17
+ const queryParameters = {};
18
+ const headerParameters = {};
19
+ if (this.configuration && this.configuration.apiKey) {
20
+ headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
21
+ }
22
+ if (this.configuration && this.configuration.accessToken) {
23
+ const token = this.configuration.accessToken;
24
+ const tokenString = await token("httpAuth", []);
25
+ if (tokenString) {
26
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
27
+ }
28
+ }
29
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
30
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
31
+ }
32
+ const response = await this.request({
33
+ path: `/mongodb/collections/{collectionName}/documents/{documentId}`.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters.collectionName))).replace(`{${"documentId"}}`, encodeURIComponent(String(requestParameters.documentId))),
34
+ method: "DELETE",
35
+ headers: headerParameters,
36
+ query: queryParameters
37
+ }, initOverrides);
38
+ return new runtime.JSONApiResponse(response, (jsonValue) => DeleteResponseFromJSON(jsonValue));
39
+ }
40
+ async deleteDocument(requestParameters, initOverrides) {
41
+ const response = await this.deleteDocumentRaw(requestParameters, initOverrides);
42
+ return await response.value();
43
+ }
44
+ async deleteManyRaw(requestParameters, initOverrides) {
45
+ if (requestParameters.collectionName === null || requestParameters.collectionName === void 0) {
46
+ throw new runtime.RequiredError("collectionName", "Required parameter requestParameters.collectionName was null or undefined when calling deleteMany.");
47
+ }
48
+ if (requestParameters.requestBody === null || requestParameters.requestBody === void 0) {
49
+ throw new runtime.RequiredError("requestBody", "Required parameter requestParameters.requestBody was null or undefined when calling deleteMany.");
50
+ }
51
+ const queryParameters = {};
52
+ const headerParameters = {};
53
+ headerParameters["Content-Type"] = "application/json";
54
+ if (this.configuration && this.configuration.apiKey) {
55
+ headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
56
+ }
57
+ if (this.configuration && this.configuration.accessToken) {
58
+ const token = this.configuration.accessToken;
59
+ const tokenString = await token("httpAuth", []);
60
+ if (tokenString) {
61
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
62
+ }
63
+ }
64
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
65
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
66
+ }
67
+ const response = await this.request({
68
+ path: `/mongodb/collections/{collectionName}/documents/many/delete`.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters.collectionName))),
69
+ method: "DELETE",
70
+ headers: headerParameters,
71
+ query: queryParameters,
72
+ body: requestParameters.requestBody
73
+ }, initOverrides);
74
+ return new runtime.JSONApiResponse(response, (jsonValue) => DeleteResponseFromJSON(jsonValue));
75
+ }
76
+ async deleteMany(requestParameters, initOverrides) {
77
+ const response = await this.deleteManyRaw(requestParameters, initOverrides);
78
+ return await response.value();
79
+ }
80
+ async findRaw(requestParameters, initOverrides) {
81
+ if (requestParameters.collectionName === null || requestParameters.collectionName === void 0) {
82
+ throw new runtime.RequiredError("collectionName", "Required parameter requestParameters.collectionName was null or undefined when calling find.");
83
+ }
84
+ if (requestParameters.mongoFindRequest === null || requestParameters.mongoFindRequest === void 0) {
85
+ throw new runtime.RequiredError("mongoFindRequest", "Required parameter requestParameters.mongoFindRequest was null or undefined when calling find.");
86
+ }
87
+ const queryParameters = {};
88
+ if (requestParameters.rowsPerPage !== void 0) {
89
+ queryParameters["rowsPerPage"] = requestParameters.rowsPerPage;
90
+ }
91
+ if (requestParameters.page !== void 0) {
92
+ queryParameters["page"] = requestParameters.page;
93
+ }
94
+ const headerParameters = {};
95
+ headerParameters["Content-Type"] = "application/json";
96
+ if (this.configuration && this.configuration.apiKey) {
97
+ headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
98
+ }
99
+ if (this.configuration && this.configuration.accessToken) {
100
+ const token = this.configuration.accessToken;
101
+ const tokenString = await token("httpAuth", []);
102
+ if (tokenString) {
103
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
104
+ }
105
+ }
106
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
107
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
108
+ }
109
+ const response = await this.request({
110
+ path: `/mongodb/collections/{collectionName}/documents`.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters.collectionName))),
111
+ method: "POST",
112
+ headers: headerParameters,
113
+ query: queryParameters,
114
+ body: MongoFindRequestToJSON(requestParameters.mongoFindRequest)
115
+ }, initOverrides);
116
+ return new runtime.JSONApiResponse(response);
117
+ }
118
+ async find(requestParameters, initOverrides) {
119
+ const response = await this.findRaw(requestParameters, initOverrides);
120
+ return await response.value();
121
+ }
122
+ async getDocumentRaw(requestParameters, initOverrides) {
123
+ if (requestParameters.collectionName === null || requestParameters.collectionName === void 0) {
124
+ throw new runtime.RequiredError("collectionName", "Required parameter requestParameters.collectionName was null or undefined when calling getDocument.");
125
+ }
126
+ if (requestParameters.documentId === null || requestParameters.documentId === void 0) {
127
+ throw new runtime.RequiredError("documentId", "Required parameter requestParameters.documentId was null or undefined when calling getDocument.");
128
+ }
129
+ const queryParameters = {};
130
+ const headerParameters = {};
131
+ if (this.configuration && this.configuration.apiKey) {
132
+ headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
133
+ }
134
+ if (this.configuration && this.configuration.accessToken) {
135
+ const token = this.configuration.accessToken;
136
+ const tokenString = await token("httpAuth", []);
137
+ if (tokenString) {
138
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
139
+ }
140
+ }
141
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
142
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
143
+ }
144
+ const response = await this.request({
145
+ path: `/mongodb/collections/{collectionName}/documents/{documentId}`.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters.collectionName))).replace(`{${"documentId"}}`, encodeURIComponent(String(requestParameters.documentId))),
146
+ method: "GET",
147
+ headers: headerParameters,
148
+ query: queryParameters
149
+ }, initOverrides);
150
+ return new runtime.JSONApiResponse(response);
151
+ }
152
+ async getDocument(requestParameters, initOverrides) {
153
+ const response = await this.getDocumentRaw(requestParameters, initOverrides);
154
+ return await response.value();
155
+ }
156
+ async insertRaw(requestParameters, initOverrides) {
157
+ if (requestParameters.collectionName === null || requestParameters.collectionName === void 0) {
158
+ throw new runtime.RequiredError("collectionName", "Required parameter requestParameters.collectionName was null or undefined when calling insert.");
159
+ }
160
+ if (requestParameters.requestBody === null || requestParameters.requestBody === void 0) {
161
+ throw new runtime.RequiredError("requestBody", "Required parameter requestParameters.requestBody was null or undefined when calling insert.");
162
+ }
163
+ const queryParameters = {};
164
+ const headerParameters = {};
165
+ headerParameters["Content-Type"] = "application/json";
166
+ if (this.configuration && this.configuration.apiKey) {
167
+ headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
168
+ }
169
+ if (this.configuration && this.configuration.accessToken) {
170
+ const token = this.configuration.accessToken;
171
+ const tokenString = await token("httpAuth", []);
172
+ if (tokenString) {
173
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
174
+ }
175
+ }
176
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
177
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
178
+ }
179
+ const response = await this.request({
180
+ path: `/mongodb/collections/{collectionName}/documents`.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters.collectionName))),
181
+ method: "PUT",
182
+ headers: headerParameters,
183
+ query: queryParameters,
184
+ body: requestParameters.requestBody
185
+ }, initOverrides);
186
+ return new runtime.JSONApiResponse(response, (jsonValue) => InsertResponseFromJSON(jsonValue));
187
+ }
188
+ async insert(requestParameters, initOverrides) {
189
+ const response = await this.insertRaw(requestParameters, initOverrides);
190
+ return await response.value();
191
+ }
192
+ async insertManyRaw(requestParameters, initOverrides) {
193
+ if (requestParameters.collectionName === null || requestParameters.collectionName === void 0) {
194
+ throw new runtime.RequiredError("collectionName", "Required parameter requestParameters.collectionName was null or undefined when calling insertMany.");
195
+ }
196
+ const queryParameters = {};
197
+ const headerParameters = {};
198
+ headerParameters["Content-Type"] = "application/json";
199
+ if (this.configuration && this.configuration.apiKey) {
200
+ headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
201
+ }
202
+ if (this.configuration && this.configuration.accessToken) {
203
+ const token = this.configuration.accessToken;
204
+ const tokenString = await token("httpAuth", []);
205
+ if (tokenString) {
206
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
207
+ }
208
+ }
209
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
210
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
211
+ }
212
+ const response = await this.request({
213
+ path: `/mongodb/collections/{collectionName}/documents/many/insert`.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters.collectionName))),
214
+ method: "PUT",
215
+ headers: headerParameters,
216
+ query: queryParameters,
217
+ body: requestParameters.requestBody
218
+ }, initOverrides);
219
+ return new runtime.JSONApiResponse(response, (jsonValue) => InsertResponseFromJSON(jsonValue));
220
+ }
221
+ async insertMany(requestParameters, initOverrides) {
222
+ const response = await this.insertManyRaw(requestParameters, initOverrides);
223
+ return await response.value();
224
+ }
225
+ async listDocumentsRaw(requestParameters, initOverrides) {
226
+ if (requestParameters.collectionName === null || requestParameters.collectionName === void 0) {
227
+ throw new runtime.RequiredError("collectionName", "Required parameter requestParameters.collectionName was null or undefined when calling listDocuments.");
228
+ }
229
+ const queryParameters = {};
230
+ if (requestParameters.filter !== void 0) {
231
+ queryParameters["filter"] = requestParameters.filter;
232
+ }
233
+ if (requestParameters.sort !== void 0) {
234
+ queryParameters["sort"] = requestParameters.sort;
235
+ }
236
+ if (requestParameters.projection !== void 0) {
237
+ queryParameters["projection"] = requestParameters.projection;
238
+ }
239
+ if (requestParameters.rowsPerPage !== void 0) {
240
+ queryParameters["rowsPerPage"] = requestParameters.rowsPerPage;
241
+ }
242
+ if (requestParameters.page !== void 0) {
243
+ queryParameters["page"] = requestParameters.page;
244
+ }
245
+ const headerParameters = {};
246
+ if (this.configuration && this.configuration.apiKey) {
247
+ headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
248
+ }
249
+ if (this.configuration && this.configuration.accessToken) {
250
+ const token = this.configuration.accessToken;
251
+ const tokenString = await token("httpAuth", []);
252
+ if (tokenString) {
253
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
254
+ }
255
+ }
256
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
257
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
258
+ }
259
+ const response = await this.request({
260
+ path: `/mongodb/collections/{collectionName}/documents`.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters.collectionName))),
261
+ method: "GET",
262
+ headers: headerParameters,
263
+ query: queryParameters
264
+ }, initOverrides);
265
+ return new runtime.JSONApiResponse(response);
266
+ }
267
+ async listDocuments(requestParameters, initOverrides) {
268
+ const response = await this.listDocumentsRaw(requestParameters, initOverrides);
269
+ return await response.value();
270
+ }
271
+ async updateDocumentRaw(requestParameters, initOverrides) {
272
+ if (requestParameters.collectionName === null || requestParameters.collectionName === void 0) {
273
+ throw new runtime.RequiredError("collectionName", "Required parameter requestParameters.collectionName was null or undefined when calling updateDocument.");
274
+ }
275
+ if (requestParameters.documentId === null || requestParameters.documentId === void 0) {
276
+ throw new runtime.RequiredError("documentId", "Required parameter requestParameters.documentId was null or undefined when calling updateDocument.");
277
+ }
278
+ if (requestParameters.requestBody === null || requestParameters.requestBody === void 0) {
279
+ throw new runtime.RequiredError("requestBody", "Required parameter requestParameters.requestBody was null or undefined when calling updateDocument.");
280
+ }
281
+ const queryParameters = {};
282
+ const headerParameters = {};
283
+ headerParameters["Content-Type"] = "application/json";
284
+ if (this.configuration && this.configuration.apiKey) {
285
+ headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
286
+ }
287
+ if (this.configuration && this.configuration.accessToken) {
288
+ const token = this.configuration.accessToken;
289
+ const tokenString = await token("httpAuth", []);
290
+ if (tokenString) {
291
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
292
+ }
293
+ }
294
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
295
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
296
+ }
297
+ const response = await this.request({
298
+ path: `/mongodb/collections/{collectionName}/documents/{documentId}`.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters.collectionName))).replace(`{${"documentId"}}`, encodeURIComponent(String(requestParameters.documentId))),
299
+ method: "PATCH",
300
+ headers: headerParameters,
301
+ query: queryParameters,
302
+ body: requestParameters.requestBody
303
+ }, initOverrides);
304
+ return new runtime.JSONApiResponse(response, (jsonValue) => UpdateResponseFromJSON(jsonValue));
305
+ }
306
+ async updateDocument(requestParameters, initOverrides) {
307
+ const response = await this.updateDocumentRaw(requestParameters, initOverrides);
308
+ return await response.value();
309
+ }
310
+ async updateDocumentPartialRaw(requestParameters, initOverrides) {
311
+ if (requestParameters.collectionName === null || requestParameters.collectionName === void 0) {
312
+ throw new runtime.RequiredError("collectionName", "Required parameter requestParameters.collectionName was null or undefined when calling updateDocumentPartial.");
313
+ }
314
+ if (requestParameters.documentId === null || requestParameters.documentId === void 0) {
315
+ throw new runtime.RequiredError("documentId", "Required parameter requestParameters.documentId was null or undefined when calling updateDocumentPartial.");
316
+ }
317
+ if (requestParameters.requestBody === null || requestParameters.requestBody === void 0) {
318
+ throw new runtime.RequiredError("requestBody", "Required parameter requestParameters.requestBody was null or undefined when calling updateDocumentPartial.");
319
+ }
320
+ const queryParameters = {};
321
+ const headerParameters = {};
322
+ headerParameters["Content-Type"] = "application/json";
323
+ if (this.configuration && this.configuration.apiKey) {
324
+ headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
325
+ }
326
+ if (this.configuration && this.configuration.accessToken) {
327
+ const token = this.configuration.accessToken;
328
+ const tokenString = await token("httpAuth", []);
329
+ if (tokenString) {
330
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
331
+ }
332
+ }
333
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
334
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
335
+ }
336
+ const response = await this.request({
337
+ path: `/mongodb/collections/{collectionName}/documents/{documentId}/partial`.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters.collectionName))).replace(`{${"documentId"}}`, encodeURIComponent(String(requestParameters.documentId))),
338
+ method: "PATCH",
339
+ headers: headerParameters,
340
+ query: queryParameters,
341
+ body: requestParameters.requestBody
342
+ }, initOverrides);
343
+ return new runtime.JSONApiResponse(response, (jsonValue) => UpdateResponseFromJSON(jsonValue));
344
+ }
345
+ async updateDocumentPartial(requestParameters, initOverrides) {
346
+ const response = await this.updateDocumentPartialRaw(requestParameters, initOverrides);
347
+ return await response.value();
348
+ }
349
+ async updateManyRaw(requestParameters, initOverrides) {
350
+ if (requestParameters.collectionName === null || requestParameters.collectionName === void 0) {
351
+ throw new runtime.RequiredError("collectionName", "Required parameter requestParameters.collectionName was null or undefined when calling updateMany.");
352
+ }
353
+ if (requestParameters.updateRequest === null || requestParameters.updateRequest === void 0) {
354
+ throw new runtime.RequiredError("updateRequest", "Required parameter requestParameters.updateRequest was null or undefined when calling updateMany.");
355
+ }
356
+ const queryParameters = {};
357
+ const headerParameters = {};
358
+ headerParameters["Content-Type"] = "application/json";
359
+ if (this.configuration && this.configuration.apiKey) {
360
+ headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
361
+ }
362
+ if (this.configuration && this.configuration.accessToken) {
363
+ const token = this.configuration.accessToken;
364
+ const tokenString = await token("httpAuth", []);
365
+ if (tokenString) {
366
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
367
+ }
368
+ }
369
+ if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
370
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
371
+ }
372
+ const response = await this.request({
373
+ path: `/mongodb/collections/{collectionName}/documents/many/update`.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters.collectionName))),
374
+ method: "PATCH",
375
+ headers: headerParameters,
376
+ query: queryParameters,
377
+ body: UpdateRequestToJSON(requestParameters.updateRequest)
378
+ }, initOverrides);
379
+ return new runtime.JSONApiResponse(response, (jsonValue) => UpdateResponseFromJSON(jsonValue));
380
+ }
381
+ async updateMany(requestParameters, initOverrides) {
382
+ const response = await this.updateManyRaw(requestParameters, initOverrides);
383
+ return await response.value();
384
+ }
385
+ }
@@ -0,0 +1,125 @@
1
+ /**
2
+ * mongocamp-server
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: 1.2.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
+ import * as runtime from '../runtime';
13
+ import { DeleteResponse, FileInformation, InsertResponse, MongoFindRequest, UpdateFileInformationRequest, UpdateResponse } from '../models';
14
+ export interface DeleteFileRequest {
15
+ bucketName: string;
16
+ fileId: string;
17
+ }
18
+ export interface FindFilesRequest {
19
+ bucketName: string;
20
+ mongoFindRequest: MongoFindRequest;
21
+ rowsPerPage?: number;
22
+ page?: number;
23
+ }
24
+ export interface GetFileRequest {
25
+ bucketName: string;
26
+ fileId: string;
27
+ }
28
+ export interface GetFileInformationRequest {
29
+ bucketName: string;
30
+ fileId: string;
31
+ }
32
+ export interface InsertFileRequest {
33
+ bucketName: string;
34
+ file: Blob;
35
+ metaData: string;
36
+ fileName?: string;
37
+ }
38
+ export interface ListFilesRequest {
39
+ bucketName: string;
40
+ filter?: string;
41
+ sort?: string;
42
+ projection?: string;
43
+ rowsPerPage?: number;
44
+ page?: number;
45
+ }
46
+ export interface UpdateFileInformationOperationRequest {
47
+ bucketName: string;
48
+ fileId: string;
49
+ updateFileInformationRequest: UpdateFileInformationRequest;
50
+ }
51
+ /**
52
+ *
53
+ */
54
+ export declare class FileApi extends runtime.BaseAPI {
55
+ /**
56
+ * Delete one File from given Bucket
57
+ * Delete File from Bucket
58
+ */
59
+ deleteFileRaw(requestParameters: DeleteFileRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<DeleteResponse>>;
60
+ /**
61
+ * Delete one File from given Bucket
62
+ * Delete File from Bucket
63
+ */
64
+ deleteFile(requestParameters: DeleteFileRequest, initOverrides?: RequestInit): Promise<DeleteResponse>;
65
+ /**
66
+ * Alternative to GET Route for more complex queries and URL max. Length
67
+ * Files in Bucket
68
+ */
69
+ findFilesRaw(requestParameters: FindFilesRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Array<FileInformation>>>;
70
+ /**
71
+ * Alternative to GET Route for more complex queries and URL max. Length
72
+ * Files in Bucket
73
+ */
74
+ findFiles(requestParameters: FindFilesRequest, initOverrides?: RequestInit): Promise<Array<FileInformation>>;
75
+ /**
76
+ * Get File from given Bucket
77
+ * File from Bucket
78
+ */
79
+ getFileRaw(requestParameters: GetFileRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Blob>>;
80
+ /**
81
+ * Get File from given Bucket
82
+ * File from Bucket
83
+ */
84
+ getFile(requestParameters: GetFileRequest, initOverrides?: RequestInit): Promise<Blob>;
85
+ /**
86
+ * Get one FileInformation from given Bucket
87
+ * FileInformation from Bucket
88
+ */
89
+ getFileInformationRaw(requestParameters: GetFileInformationRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<FileInformation>>;
90
+ /**
91
+ * Get one FileInformation from given Bucket
92
+ * FileInformation from Bucket
93
+ */
94
+ getFileInformation(requestParameters: GetFileInformationRequest, initOverrides?: RequestInit): Promise<FileInformation>;
95
+ /**
96
+ * Insert one File in given Bucket
97
+ * Insert File
98
+ */
99
+ insertFileRaw(requestParameters: InsertFileRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<InsertResponse>>;
100
+ /**
101
+ * Insert one File in given Bucket
102
+ * Insert File
103
+ */
104
+ insertFile(requestParameters: InsertFileRequest, initOverrides?: RequestInit): Promise<InsertResponse>;
105
+ /**
106
+ * Get Files paginated from given Bucket
107
+ * Files in Bucket
108
+ */
109
+ listFilesRaw(requestParameters: ListFilesRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<Array<FileInformation>>>;
110
+ /**
111
+ * Get Files paginated from given Bucket
112
+ * Files in Bucket
113
+ */
114
+ listFiles(requestParameters: ListFilesRequest, initOverrides?: RequestInit): Promise<Array<FileInformation>>;
115
+ /**
116
+ * Replace MetaData and potential update FileName
117
+ * Update FileInformation in Bucket
118
+ */
119
+ updateFileInformationRaw(requestParameters: UpdateFileInformationOperationRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<UpdateResponse>>;
120
+ /**
121
+ * Replace MetaData and potential update FileName
122
+ * Update FileInformation in Bucket
123
+ */
124
+ updateFileInformation(requestParameters: UpdateFileInformationOperationRequest, initOverrides?: RequestInit): Promise<UpdateResponse>;
125
+ }