@sfxcode/nuxt-mongocamp-server 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.cjs +5 -0
- package/dist/module.d.ts +9 -0
- package/dist/module.json +8 -0
- package/dist/module.mjs +555 -0
- package/dist/runtime/api/apis/AdminApi.d.ts +181 -0
- package/dist/runtime/api/apis/AdminApi.mjs +509 -0
- package/dist/runtime/api/apis/ApplicationApi.d.ts +65 -0
- package/dist/runtime/api/apis/ApplicationApi.mjs +164 -0
- package/dist/runtime/api/apis/AuthApi.d.ts +104 -0
- package/dist/runtime/api/apis/AuthApi.mjs +296 -0
- package/dist/runtime/api/apis/BucketApi.d.ts +67 -0
- package/dist/runtime/api/apis/BucketApi.mjs +160 -0
- package/dist/runtime/api/apis/CollectionApi.d.ts +161 -0
- package/dist/runtime/api/apis/CollectionApi.mjs +435 -0
- package/dist/runtime/api/apis/DatabaseApi.d.ts +77 -0
- package/dist/runtime/api/apis/DatabaseApi.mjs +196 -0
- package/dist/runtime/api/apis/DocumentApi.d.ts +188 -0
- package/dist/runtime/api/apis/DocumentApi.mjs +465 -0
- package/dist/runtime/api/apis/FileApi.d.ts +125 -0
- package/dist/runtime/api/apis/FileApi.mjs +355 -0
- package/dist/runtime/api/apis/IndexApi.d.ts +137 -0
- package/dist/runtime/api/apis/IndexApi.mjs +367 -0
- package/dist/runtime/api/apis/InformationApi.d.ts +28 -0
- package/dist/runtime/api/apis/InformationApi.mjs +29 -0
- package/dist/runtime/api/apis/JobsApi.d.ts +94 -0
- package/dist/runtime/api/apis/JobsApi.mjs +252 -0
- package/dist/runtime/api/apis/index.d.ts +11 -0
- package/dist/runtime/api/apis/index.mjs +11 -0
- package/dist/runtime/api/index.d.ts +3 -0
- package/dist/runtime/api/index.mjs +3 -0
- package/dist/runtime/api/models/BucketInformation.d.ts +49 -0
- package/dist/runtime/api/models/BucketInformation.mjs +36 -0
- package/dist/runtime/api/models/CollectionStatus.d.ts +107 -0
- package/dist/runtime/api/models/CollectionStatus.mjs +63 -0
- package/dist/runtime/api/models/DatabaseInfo.d.ts +57 -0
- package/dist/runtime/api/models/DatabaseInfo.mjs +39 -0
- package/dist/runtime/api/models/DeleteResponse.d.ts +37 -0
- package/dist/runtime/api/models/DeleteResponse.mjs +30 -0
- package/dist/runtime/api/models/ErrorDescription.d.ts +43 -0
- package/dist/runtime/api/models/ErrorDescription.mjs +33 -0
- package/dist/runtime/api/models/FileInformation.d.ts +63 -0
- package/dist/runtime/api/models/FileInformation.mjs +42 -0
- package/dist/runtime/api/models/Grant.d.ts +55 -0
- package/dist/runtime/api/models/Grant.mjs +39 -0
- package/dist/runtime/api/models/IndexCreateRequest.d.ts +40 -0
- package/dist/runtime/api/models/IndexCreateRequest.mjs +34 -0
- package/dist/runtime/api/models/IndexCreateResponse.d.ts +31 -0
- package/dist/runtime/api/models/IndexCreateResponse.mjs +27 -0
- package/dist/runtime/api/models/IndexDropResponse.d.ts +31 -0
- package/dist/runtime/api/models/IndexDropResponse.mjs +27 -0
- package/dist/runtime/api/models/IndexOptionsRequest.d.ts +73 -0
- package/dist/runtime/api/models/IndexOptionsRequest.mjs +41 -0
- package/dist/runtime/api/models/InsertResponse.d.ts +37 -0
- package/dist/runtime/api/models/InsertResponse.mjs +30 -0
- package/dist/runtime/api/models/JobConfig.d.ts +61 -0
- package/dist/runtime/api/models/JobConfig.mjs +42 -0
- package/dist/runtime/api/models/JobInformation.d.ts +79 -0
- package/dist/runtime/api/models/JobInformation.mjs +49 -0
- package/dist/runtime/api/models/JsonResultBoolean.d.ts +27 -0
- package/dist/runtime/api/models/JsonResultBoolean.mjs +22 -0
- package/dist/runtime/api/models/JsonResultString.d.ts +27 -0
- package/dist/runtime/api/models/JsonResultString.mjs +22 -0
- package/dist/runtime/api/models/JsonSchema.d.ts +46 -0
- package/dist/runtime/api/models/JsonSchema.mjs +38 -0
- package/dist/runtime/api/models/JsonSchemaDefinition.d.ts +59 -0
- package/dist/runtime/api/models/JsonSchemaDefinition.mjs +39 -0
- package/dist/runtime/api/models/JsonValueAny.d.ts +31 -0
- package/dist/runtime/api/models/JsonValueAny.mjs +27 -0
- package/dist/runtime/api/models/JsonValueBoolean.d.ts +31 -0
- package/dist/runtime/api/models/JsonValueBoolean.mjs +27 -0
- package/dist/runtime/api/models/JsonValueString.d.ts +31 -0
- package/dist/runtime/api/models/JsonValueString.mjs +27 -0
- package/dist/runtime/api/models/Login.d.ts +37 -0
- package/dist/runtime/api/models/Login.mjs +30 -0
- package/dist/runtime/api/models/LoginResult.d.ts +44 -0
- package/dist/runtime/api/models/LoginResult.mjs +37 -0
- package/dist/runtime/api/models/Measurement.d.ts +33 -0
- package/dist/runtime/api/models/Measurement.mjs +24 -0
- package/dist/runtime/api/models/Metric.d.ts +52 -0
- package/dist/runtime/api/models/Metric.mjs +35 -0
- package/dist/runtime/api/models/MongoAggregateRequest.d.ts +38 -0
- package/dist/runtime/api/models/MongoAggregateRequest.mjs +34 -0
- package/dist/runtime/api/models/MongoCampConfiguration.d.ts +55 -0
- package/dist/runtime/api/models/MongoCampConfiguration.mjs +39 -0
- package/dist/runtime/api/models/MongoFindRequest.d.ts +49 -0
- package/dist/runtime/api/models/MongoFindRequest.mjs +33 -0
- package/dist/runtime/api/models/MongoIndex.d.ts +103 -0
- package/dist/runtime/api/models/MongoIndex.mjs +60 -0
- package/dist/runtime/api/models/PasswordUpdateRequest.d.ts +31 -0
- package/dist/runtime/api/models/PasswordUpdateRequest.mjs +27 -0
- package/dist/runtime/api/models/PipelineStage.d.ts +37 -0
- package/dist/runtime/api/models/PipelineStage.mjs +30 -0
- package/dist/runtime/api/models/Role.d.ts +44 -0
- package/dist/runtime/api/models/Role.mjs +37 -0
- package/dist/runtime/api/models/SchemaAnalysis.d.ts +50 -0
- package/dist/runtime/api/models/SchemaAnalysis.mjs +40 -0
- package/dist/runtime/api/models/SchemaAnalysisField.d.ts +62 -0
- package/dist/runtime/api/models/SchemaAnalysisField.mjs +45 -0
- package/dist/runtime/api/models/SchemaAnalysisFieldType.d.ts +43 -0
- package/dist/runtime/api/models/SchemaAnalysisFieldType.mjs +33 -0
- package/dist/runtime/api/models/SettingsResponse.d.ts +51 -0
- package/dist/runtime/api/models/SettingsResponse.mjs +34 -0
- package/dist/runtime/api/models/UpdateFileInformationRequest.d.ts +39 -0
- package/dist/runtime/api/models/UpdateFileInformationRequest.mjs +29 -0
- package/dist/runtime/api/models/UpdateRequest.d.ts +41 -0
- package/dist/runtime/api/models/UpdateRequest.mjs +30 -0
- package/dist/runtime/api/models/UpdateResponse.d.ts +49 -0
- package/dist/runtime/api/models/UpdateResponse.mjs +36 -0
- package/dist/runtime/api/models/UpdateRoleRequest.d.ts +38 -0
- package/dist/runtime/api/models/UpdateRoleRequest.mjs +34 -0
- package/dist/runtime/api/models/UserInformation.d.ts +49 -0
- package/dist/runtime/api/models/UserInformation.mjs +35 -0
- package/dist/runtime/api/models/UserProfile.d.ts +56 -0
- package/dist/runtime/api/models/UserProfile.mjs +41 -0
- package/dist/runtime/api/models/Version.d.ts +43 -0
- package/dist/runtime/api/models/Version.mjs +33 -0
- package/dist/runtime/api/models/index.d.ts +39 -0
- package/dist/runtime/api/models/index.mjs +39 -0
- package/dist/runtime/api/runtime.d.ts +182 -0
- package/dist/runtime/api/runtime.mjs +281 -0
- package/dist/runtime/composables/mongocampApi.d.ts +14 -0
- package/dist/runtime/composables/mongocampApi.mjs +45 -0
- package/dist/runtime/composables/mongocampAuth.d.ts +8 -0
- package/dist/runtime/composables/mongocampAuth.mjs +28 -0
- package/dist/runtime/composables/mongocampSearch.d.ts +11 -0
- package/dist/runtime/composables/mongocampSearch.mjs +20 -0
- package/dist/runtime/composables/mongocampStorage.d.ts +0 -0
- package/dist/runtime/composables/mongocampStorage.mjs +5 -0
- package/dist/runtime/composables/mongocampUrl.d.ts +1 -0
- package/dist/runtime/composables/mongocampUrl.mjs +5 -0
- package/dist/runtime/composables/mongocampUser.d.ts +3 -0
- package/dist/runtime/composables/mongocampUser.mjs +4 -0
- package/dist/types.d.ts +15 -0
- package/package.json +5 -4
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
import * as runtime from "../runtime.mjs";
|
|
2
|
+
import {
|
|
3
|
+
DeleteResponseFromJSON,
|
|
4
|
+
InsertResponseFromJSON,
|
|
5
|
+
MongoFindRequestToJSON,
|
|
6
|
+
UpdateRequestToJSON,
|
|
7
|
+
UpdateResponseFromJSON
|
|
8
|
+
} from "../models/index.mjs";
|
|
9
|
+
export class DocumentApi extends runtime.BaseAPI {
|
|
10
|
+
/**
|
|
11
|
+
* Delete one Document from given Collection
|
|
12
|
+
* Delete Document from Collection
|
|
13
|
+
*/
|
|
14
|
+
async _deleteRaw(requestParameters, initOverrides) {
|
|
15
|
+
if (requestParameters.collectionName === null || requestParameters.collectionName === void 0) {
|
|
16
|
+
throw new runtime.RequiredError("collectionName", "Required parameter requestParameters.collectionName was null or undefined when calling _delete.");
|
|
17
|
+
}
|
|
18
|
+
if (requestParameters.documentId === null || requestParameters.documentId === void 0) {
|
|
19
|
+
throw new runtime.RequiredError("documentId", "Required parameter requestParameters.documentId was null or undefined when calling _delete.");
|
|
20
|
+
}
|
|
21
|
+
const queryParameters = {};
|
|
22
|
+
const headerParameters = {};
|
|
23
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
24
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
25
|
+
}
|
|
26
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
27
|
+
const token = this.configuration.accessToken;
|
|
28
|
+
const tokenString = await token("httpAuth", []);
|
|
29
|
+
if (tokenString) {
|
|
30
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
34
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
35
|
+
}
|
|
36
|
+
const response = await this.request({
|
|
37
|
+
path: `/mongodb/collections/{collectionName}/documents/{documentId}`.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters.collectionName))).replace(`{${"documentId"}}`, encodeURIComponent(String(requestParameters.documentId))),
|
|
38
|
+
method: "DELETE",
|
|
39
|
+
headers: headerParameters,
|
|
40
|
+
query: queryParameters
|
|
41
|
+
}, initOverrides);
|
|
42
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => DeleteResponseFromJSON(jsonValue));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Delete one Document from given Collection
|
|
46
|
+
* Delete Document from Collection
|
|
47
|
+
*/
|
|
48
|
+
async _delete(requestParameters, initOverrides) {
|
|
49
|
+
const response = await this._deleteRaw(requestParameters, initOverrides);
|
|
50
|
+
return await response.value();
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Delete many Document in given Collection
|
|
54
|
+
* Delete Many in Collection
|
|
55
|
+
*/
|
|
56
|
+
async deleteManyRaw(requestParameters, initOverrides) {
|
|
57
|
+
if (requestParameters.collectionName === null || requestParameters.collectionName === void 0) {
|
|
58
|
+
throw new runtime.RequiredError("collectionName", "Required parameter requestParameters.collectionName was null or undefined when calling deleteMany.");
|
|
59
|
+
}
|
|
60
|
+
if (requestParameters.requestBody === null || requestParameters.requestBody === void 0) {
|
|
61
|
+
throw new runtime.RequiredError("requestBody", "Required parameter requestParameters.requestBody was null or undefined when calling deleteMany.");
|
|
62
|
+
}
|
|
63
|
+
const queryParameters = {};
|
|
64
|
+
const headerParameters = {};
|
|
65
|
+
headerParameters["Content-Type"] = "application/json";
|
|
66
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
67
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
68
|
+
}
|
|
69
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
70
|
+
const token = this.configuration.accessToken;
|
|
71
|
+
const tokenString = await token("httpAuth", []);
|
|
72
|
+
if (tokenString) {
|
|
73
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
77
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
78
|
+
}
|
|
79
|
+
const response = await this.request({
|
|
80
|
+
path: `/mongodb/collections/{collectionName}/documents/many/delete`.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters.collectionName))),
|
|
81
|
+
method: "DELETE",
|
|
82
|
+
headers: headerParameters,
|
|
83
|
+
query: queryParameters,
|
|
84
|
+
body: requestParameters.requestBody
|
|
85
|
+
}, initOverrides);
|
|
86
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => DeleteResponseFromJSON(jsonValue));
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Delete many Document in given Collection
|
|
90
|
+
* Delete Many in Collection
|
|
91
|
+
*/
|
|
92
|
+
async deleteMany(requestParameters, initOverrides) {
|
|
93
|
+
const response = await this.deleteManyRaw(requestParameters, initOverrides);
|
|
94
|
+
return await response.value();
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Alternative to GET Route for more complex queries and URL max. Length
|
|
98
|
+
* Documents in Collection
|
|
99
|
+
*/
|
|
100
|
+
async findRaw(requestParameters, initOverrides) {
|
|
101
|
+
if (requestParameters.collectionName === null || requestParameters.collectionName === void 0) {
|
|
102
|
+
throw new runtime.RequiredError("collectionName", "Required parameter requestParameters.collectionName was null or undefined when calling find.");
|
|
103
|
+
}
|
|
104
|
+
if (requestParameters.mongoFindRequest === null || requestParameters.mongoFindRequest === void 0) {
|
|
105
|
+
throw new runtime.RequiredError("mongoFindRequest", "Required parameter requestParameters.mongoFindRequest was null or undefined when calling find.");
|
|
106
|
+
}
|
|
107
|
+
const queryParameters = {};
|
|
108
|
+
if (requestParameters.rowsPerPage !== void 0) {
|
|
109
|
+
queryParameters["rowsPerPage"] = requestParameters.rowsPerPage;
|
|
110
|
+
}
|
|
111
|
+
if (requestParameters.page !== void 0) {
|
|
112
|
+
queryParameters["page"] = requestParameters.page;
|
|
113
|
+
}
|
|
114
|
+
const headerParameters = {};
|
|
115
|
+
headerParameters["Content-Type"] = "application/json";
|
|
116
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
117
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
118
|
+
}
|
|
119
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
120
|
+
const token = this.configuration.accessToken;
|
|
121
|
+
const tokenString = await token("httpAuth", []);
|
|
122
|
+
if (tokenString) {
|
|
123
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
127
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
128
|
+
}
|
|
129
|
+
const response = await this.request({
|
|
130
|
+
path: `/mongodb/collections/{collectionName}/documents`.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters.collectionName))),
|
|
131
|
+
method: "POST",
|
|
132
|
+
headers: headerParameters,
|
|
133
|
+
query: queryParameters,
|
|
134
|
+
body: MongoFindRequestToJSON(requestParameters.mongoFindRequest)
|
|
135
|
+
}, initOverrides);
|
|
136
|
+
return new runtime.JSONApiResponse(response);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Alternative to GET Route for more complex queries and URL max. Length
|
|
140
|
+
* Documents in Collection
|
|
141
|
+
*/
|
|
142
|
+
async find(requestParameters, initOverrides) {
|
|
143
|
+
const response = await this.findRaw(requestParameters, initOverrides);
|
|
144
|
+
return await response.value();
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Get one Document from given Collection
|
|
148
|
+
* Document from Collection
|
|
149
|
+
*/
|
|
150
|
+
async getDocumentRaw(requestParameters, initOverrides) {
|
|
151
|
+
if (requestParameters.collectionName === null || requestParameters.collectionName === void 0) {
|
|
152
|
+
throw new runtime.RequiredError("collectionName", "Required parameter requestParameters.collectionName was null or undefined when calling getDocument.");
|
|
153
|
+
}
|
|
154
|
+
if (requestParameters.documentId === null || requestParameters.documentId === void 0) {
|
|
155
|
+
throw new runtime.RequiredError("documentId", "Required parameter requestParameters.documentId was null or undefined when calling getDocument.");
|
|
156
|
+
}
|
|
157
|
+
const queryParameters = {};
|
|
158
|
+
const headerParameters = {};
|
|
159
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
160
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
161
|
+
}
|
|
162
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
163
|
+
const token = this.configuration.accessToken;
|
|
164
|
+
const tokenString = await token("httpAuth", []);
|
|
165
|
+
if (tokenString) {
|
|
166
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
170
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
171
|
+
}
|
|
172
|
+
const response = await this.request({
|
|
173
|
+
path: `/mongodb/collections/{collectionName}/documents/{documentId}`.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters.collectionName))).replace(`{${"documentId"}}`, encodeURIComponent(String(requestParameters.documentId))),
|
|
174
|
+
method: "GET",
|
|
175
|
+
headers: headerParameters,
|
|
176
|
+
query: queryParameters
|
|
177
|
+
}, initOverrides);
|
|
178
|
+
return new runtime.JSONApiResponse(response);
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Get one Document from given Collection
|
|
182
|
+
* Document from Collection
|
|
183
|
+
*/
|
|
184
|
+
async getDocument(requestParameters, initOverrides) {
|
|
185
|
+
const response = await this.getDocumentRaw(requestParameters, initOverrides);
|
|
186
|
+
return await response.value();
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Insert one Document in given Collection
|
|
190
|
+
* Insert Document
|
|
191
|
+
*/
|
|
192
|
+
async insertRaw(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 insert.");
|
|
195
|
+
}
|
|
196
|
+
if (requestParameters.requestBody === null || requestParameters.requestBody === void 0) {
|
|
197
|
+
throw new runtime.RequiredError("requestBody", "Required parameter requestParameters.requestBody was null or undefined when calling insert.");
|
|
198
|
+
}
|
|
199
|
+
const queryParameters = {};
|
|
200
|
+
const headerParameters = {};
|
|
201
|
+
headerParameters["Content-Type"] = "application/json";
|
|
202
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
203
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
204
|
+
}
|
|
205
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
206
|
+
const token = this.configuration.accessToken;
|
|
207
|
+
const tokenString = await token("httpAuth", []);
|
|
208
|
+
if (tokenString) {
|
|
209
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
213
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
214
|
+
}
|
|
215
|
+
const response = await this.request({
|
|
216
|
+
path: `/mongodb/collections/{collectionName}/documents`.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters.collectionName))),
|
|
217
|
+
method: "PUT",
|
|
218
|
+
headers: headerParameters,
|
|
219
|
+
query: queryParameters,
|
|
220
|
+
body: requestParameters.requestBody
|
|
221
|
+
}, initOverrides);
|
|
222
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => InsertResponseFromJSON(jsonValue));
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Insert one Document in given Collection
|
|
226
|
+
* Insert Document
|
|
227
|
+
*/
|
|
228
|
+
async insert(requestParameters, initOverrides) {
|
|
229
|
+
const response = await this.insertRaw(requestParameters, initOverrides);
|
|
230
|
+
return await response.value();
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Insert many documents in given Collection
|
|
234
|
+
* Insert many Documents
|
|
235
|
+
*/
|
|
236
|
+
async insertManyRaw(requestParameters, initOverrides) {
|
|
237
|
+
if (requestParameters.collectionName === null || requestParameters.collectionName === void 0) {
|
|
238
|
+
throw new runtime.RequiredError("collectionName", "Required parameter requestParameters.collectionName was null or undefined when calling insertMany.");
|
|
239
|
+
}
|
|
240
|
+
const queryParameters = {};
|
|
241
|
+
const headerParameters = {};
|
|
242
|
+
headerParameters["Content-Type"] = "application/json";
|
|
243
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
244
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
245
|
+
}
|
|
246
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
247
|
+
const token = this.configuration.accessToken;
|
|
248
|
+
const tokenString = await token("httpAuth", []);
|
|
249
|
+
if (tokenString) {
|
|
250
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
254
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
255
|
+
}
|
|
256
|
+
const response = await this.request({
|
|
257
|
+
path: `/mongodb/collections/{collectionName}/documents/many/insert`.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters.collectionName))),
|
|
258
|
+
method: "PUT",
|
|
259
|
+
headers: headerParameters,
|
|
260
|
+
query: queryParameters,
|
|
261
|
+
body: requestParameters.requestBody
|
|
262
|
+
}, initOverrides);
|
|
263
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => InsertResponseFromJSON(jsonValue));
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Insert many documents in given Collection
|
|
267
|
+
* Insert many Documents
|
|
268
|
+
*/
|
|
269
|
+
async insertMany(requestParameters, initOverrides) {
|
|
270
|
+
const response = await this.insertManyRaw(requestParameters, initOverrides);
|
|
271
|
+
return await response.value();
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Get Documents paginated from given Collection
|
|
275
|
+
* Documents in Collection
|
|
276
|
+
*/
|
|
277
|
+
async listDocumentsRaw(requestParameters, initOverrides) {
|
|
278
|
+
if (requestParameters.collectionName === null || requestParameters.collectionName === void 0) {
|
|
279
|
+
throw new runtime.RequiredError("collectionName", "Required parameter requestParameters.collectionName was null or undefined when calling listDocuments.");
|
|
280
|
+
}
|
|
281
|
+
const queryParameters = {};
|
|
282
|
+
if (requestParameters.filter !== void 0) {
|
|
283
|
+
queryParameters["filter"] = requestParameters.filter;
|
|
284
|
+
}
|
|
285
|
+
if (requestParameters.sort) {
|
|
286
|
+
queryParameters["sort"] = requestParameters.sort;
|
|
287
|
+
}
|
|
288
|
+
if (requestParameters.projection) {
|
|
289
|
+
queryParameters["projection"] = requestParameters.projection;
|
|
290
|
+
}
|
|
291
|
+
if (requestParameters.rowsPerPage !== void 0) {
|
|
292
|
+
queryParameters["rowsPerPage"] = requestParameters.rowsPerPage;
|
|
293
|
+
}
|
|
294
|
+
if (requestParameters.page !== void 0) {
|
|
295
|
+
queryParameters["page"] = requestParameters.page;
|
|
296
|
+
}
|
|
297
|
+
const headerParameters = {};
|
|
298
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
299
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
300
|
+
}
|
|
301
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
302
|
+
const token = this.configuration.accessToken;
|
|
303
|
+
const tokenString = await token("httpAuth", []);
|
|
304
|
+
if (tokenString) {
|
|
305
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
309
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
310
|
+
}
|
|
311
|
+
const response = await this.request({
|
|
312
|
+
path: `/mongodb/collections/{collectionName}/documents`.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters.collectionName))),
|
|
313
|
+
method: "GET",
|
|
314
|
+
headers: headerParameters,
|
|
315
|
+
query: queryParameters
|
|
316
|
+
}, initOverrides);
|
|
317
|
+
return new runtime.JSONApiResponse(response);
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Get Documents paginated from given Collection
|
|
321
|
+
* Documents in Collection
|
|
322
|
+
*/
|
|
323
|
+
async listDocuments(requestParameters, initOverrides) {
|
|
324
|
+
const response = await this.listDocumentsRaw(requestParameters, initOverrides);
|
|
325
|
+
return await response.value();
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* \'Replace\' one Document with the new document from Request in Collection
|
|
329
|
+
* Update Document in Collection
|
|
330
|
+
*/
|
|
331
|
+
async updateRaw(requestParameters, initOverrides) {
|
|
332
|
+
if (requestParameters.collectionName === null || requestParameters.collectionName === void 0) {
|
|
333
|
+
throw new runtime.RequiredError("collectionName", "Required parameter requestParameters.collectionName was null or undefined when calling update.");
|
|
334
|
+
}
|
|
335
|
+
if (requestParameters.documentId === null || requestParameters.documentId === void 0) {
|
|
336
|
+
throw new runtime.RequiredError("documentId", "Required parameter requestParameters.documentId was null or undefined when calling update.");
|
|
337
|
+
}
|
|
338
|
+
if (requestParameters.requestBody === null || requestParameters.requestBody === void 0) {
|
|
339
|
+
throw new runtime.RequiredError("requestBody", "Required parameter requestParameters.requestBody was null or undefined when calling update.");
|
|
340
|
+
}
|
|
341
|
+
const queryParameters = {};
|
|
342
|
+
const headerParameters = {};
|
|
343
|
+
headerParameters["Content-Type"] = "application/json";
|
|
344
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
345
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
346
|
+
}
|
|
347
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
348
|
+
const token = this.configuration.accessToken;
|
|
349
|
+
const tokenString = await token("httpAuth", []);
|
|
350
|
+
if (tokenString) {
|
|
351
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
355
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
356
|
+
}
|
|
357
|
+
const response = await this.request({
|
|
358
|
+
path: `/mongodb/collections/{collectionName}/documents/{documentId}`.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters.collectionName))).replace(`{${"documentId"}}`, encodeURIComponent(String(requestParameters.documentId))),
|
|
359
|
+
method: "PATCH",
|
|
360
|
+
headers: headerParameters,
|
|
361
|
+
query: queryParameters,
|
|
362
|
+
body: requestParameters.requestBody
|
|
363
|
+
}, initOverrides);
|
|
364
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => UpdateResponseFromJSON(jsonValue));
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* \'Replace\' one Document with the new document from Request in Collection
|
|
368
|
+
* Update Document in Collection
|
|
369
|
+
*/
|
|
370
|
+
async update(requestParameters, initOverrides) {
|
|
371
|
+
const response = await this.updateRaw(requestParameters, initOverrides);
|
|
372
|
+
return await response.value();
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Update the document Parts with the values from the Request
|
|
376
|
+
* Update Document Parts in Collection
|
|
377
|
+
*/
|
|
378
|
+
async updateDocumentPartialRaw(requestParameters, initOverrides) {
|
|
379
|
+
if (requestParameters.collectionName === null || requestParameters.collectionName === void 0) {
|
|
380
|
+
throw new runtime.RequiredError("collectionName", "Required parameter requestParameters.collectionName was null or undefined when calling updateDocumentPartial.");
|
|
381
|
+
}
|
|
382
|
+
if (requestParameters.documentId === null || requestParameters.documentId === void 0) {
|
|
383
|
+
throw new runtime.RequiredError("documentId", "Required parameter requestParameters.documentId was null or undefined when calling updateDocumentPartial.");
|
|
384
|
+
}
|
|
385
|
+
if (requestParameters.requestBody === null || requestParameters.requestBody === void 0) {
|
|
386
|
+
throw new runtime.RequiredError("requestBody", "Required parameter requestParameters.requestBody was null or undefined when calling updateDocumentPartial.");
|
|
387
|
+
}
|
|
388
|
+
const queryParameters = {};
|
|
389
|
+
const headerParameters = {};
|
|
390
|
+
headerParameters["Content-Type"] = "application/json";
|
|
391
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
392
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
393
|
+
}
|
|
394
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
395
|
+
const token = this.configuration.accessToken;
|
|
396
|
+
const tokenString = await token("httpAuth", []);
|
|
397
|
+
if (tokenString) {
|
|
398
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
402
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
403
|
+
}
|
|
404
|
+
const response = await this.request({
|
|
405
|
+
path: `/mongodb/collections/{collectionName}/documents/{documentId}/partial`.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters.collectionName))).replace(`{${"documentId"}}`, encodeURIComponent(String(requestParameters.documentId))),
|
|
406
|
+
method: "PATCH",
|
|
407
|
+
headers: headerParameters,
|
|
408
|
+
query: queryParameters,
|
|
409
|
+
body: requestParameters.requestBody
|
|
410
|
+
}, initOverrides);
|
|
411
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => UpdateResponseFromJSON(jsonValue));
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Update the document Parts with the values from the Request
|
|
415
|
+
* Update Document Parts in Collection
|
|
416
|
+
*/
|
|
417
|
+
async updateDocumentPartial(requestParameters, initOverrides) {
|
|
418
|
+
const response = await this.updateDocumentPartialRaw(requestParameters, initOverrides);
|
|
419
|
+
return await response.value();
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Update many Document in given Collection
|
|
423
|
+
* Update many in Collection
|
|
424
|
+
*/
|
|
425
|
+
async updateManyRaw(requestParameters, initOverrides) {
|
|
426
|
+
if (requestParameters.collectionName === null || requestParameters.collectionName === void 0) {
|
|
427
|
+
throw new runtime.RequiredError("collectionName", "Required parameter requestParameters.collectionName was null or undefined when calling updateMany.");
|
|
428
|
+
}
|
|
429
|
+
if (requestParameters.updateRequest === null || requestParameters.updateRequest === void 0) {
|
|
430
|
+
throw new runtime.RequiredError("updateRequest", "Required parameter requestParameters.updateRequest was null or undefined when calling updateMany.");
|
|
431
|
+
}
|
|
432
|
+
const queryParameters = {};
|
|
433
|
+
const headerParameters = {};
|
|
434
|
+
headerParameters["Content-Type"] = "application/json";
|
|
435
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
436
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
437
|
+
}
|
|
438
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
439
|
+
const token = this.configuration.accessToken;
|
|
440
|
+
const tokenString = await token("httpAuth", []);
|
|
441
|
+
if (tokenString) {
|
|
442
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
446
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
447
|
+
}
|
|
448
|
+
const response = await this.request({
|
|
449
|
+
path: `/mongodb/collections/{collectionName}/documents/many/update`.replace(`{${"collectionName"}}`, encodeURIComponent(String(requestParameters.collectionName))),
|
|
450
|
+
method: "PATCH",
|
|
451
|
+
headers: headerParameters,
|
|
452
|
+
query: queryParameters,
|
|
453
|
+
body: UpdateRequestToJSON(requestParameters.updateRequest)
|
|
454
|
+
}, initOverrides);
|
|
455
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => UpdateResponseFromJSON(jsonValue));
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Update many Document in given Collection
|
|
459
|
+
* Update many in Collection
|
|
460
|
+
*/
|
|
461
|
+
async updateMany(requestParameters, initOverrides) {
|
|
462
|
+
const response = await this.updateManyRaw(requestParameters, initOverrides);
|
|
463
|
+
return await response.value();
|
|
464
|
+
}
|
|
465
|
+
}
|
|
@@ -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.4.2
|
|
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 type { 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 | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DeleteResponse>>;
|
|
60
|
+
/**
|
|
61
|
+
* Delete one File from given Bucket
|
|
62
|
+
* Delete File from Bucket
|
|
63
|
+
*/
|
|
64
|
+
deleteFile(requestParameters: DeleteFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): 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 | runtime.InitOverrideFunction): 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 | runtime.InitOverrideFunction): Promise<Array<FileInformation>>;
|
|
75
|
+
/**
|
|
76
|
+
* Get File from given Bucket
|
|
77
|
+
* File from Bucket
|
|
78
|
+
*/
|
|
79
|
+
getFileRaw(requestParameters: GetFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>>;
|
|
80
|
+
/**
|
|
81
|
+
* Get File from given Bucket
|
|
82
|
+
* File from Bucket
|
|
83
|
+
*/
|
|
84
|
+
getFile(requestParameters: GetFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob>;
|
|
85
|
+
/**
|
|
86
|
+
* Get one FileInformation from given Bucket
|
|
87
|
+
* FileInformation from Bucket
|
|
88
|
+
*/
|
|
89
|
+
getFileInformationRaw(requestParameters: GetFileInformationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FileInformation>>;
|
|
90
|
+
/**
|
|
91
|
+
* Get one FileInformation from given Bucket
|
|
92
|
+
* FileInformation from Bucket
|
|
93
|
+
*/
|
|
94
|
+
getFileInformation(requestParameters: GetFileInformationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FileInformation>;
|
|
95
|
+
/**
|
|
96
|
+
* Insert one File in given Bucket
|
|
97
|
+
* Insert File
|
|
98
|
+
*/
|
|
99
|
+
insertFileRaw(requestParameters: InsertFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<InsertResponse>>;
|
|
100
|
+
/**
|
|
101
|
+
* Insert one File in given Bucket
|
|
102
|
+
* Insert File
|
|
103
|
+
*/
|
|
104
|
+
insertFile(requestParameters: InsertFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InsertResponse>;
|
|
105
|
+
/**
|
|
106
|
+
* Get Files paginated from given Bucket
|
|
107
|
+
* Files in Bucket
|
|
108
|
+
*/
|
|
109
|
+
listFilesRaw(requestParameters: ListFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<FileInformation>>>;
|
|
110
|
+
/**
|
|
111
|
+
* Get Files paginated from given Bucket
|
|
112
|
+
* Files in Bucket
|
|
113
|
+
*/
|
|
114
|
+
listFiles(requestParameters: ListFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<FileInformation>>;
|
|
115
|
+
/**
|
|
116
|
+
* Replace MetaData and potential update FileName
|
|
117
|
+
* Update FileInformation in Bucket
|
|
118
|
+
*/
|
|
119
|
+
updateFileInformationRaw(requestParameters: UpdateFileInformationOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UpdateResponse>>;
|
|
120
|
+
/**
|
|
121
|
+
* Replace MetaData and potential update FileName
|
|
122
|
+
* Update FileInformation in Bucket
|
|
123
|
+
*/
|
|
124
|
+
updateFileInformation(requestParameters: UpdateFileInformationOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UpdateResponse>;
|
|
125
|
+
}
|