@sfxcode/nuxt-mongocamp-server 1.2.8 → 1.2.9
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.json +3 -3
- package/dist/module.mjs +3 -3
- package/dist/runtime/api/.openapi-generator/FILES +50 -0
- package/dist/runtime/api/.openapi-generator/VERSION +1 -1
- package/dist/runtime/api/apis/AdminApi.js +32 -12
- package/dist/runtime/api/apis/ApplicationApi.js +12 -5
- package/dist/runtime/api/apis/AuthApi.js +16 -8
- package/dist/runtime/api/apis/BucketApi.js +11 -4
- package/dist/runtime/api/apis/CollectionApi.js +30 -10
- package/dist/runtime/api/apis/DatabaseApi.js +13 -5
- package/dist/runtime/api/apis/DocumentApi.js +34 -10
- package/dist/runtime/api/apis/FileApi.js +25 -7
- package/dist/runtime/api/apis/IndexApi.js +31 -8
- package/dist/runtime/api/apis/InformationApi.js +2 -1
- package/dist/runtime/api/apis/JobsApi.js +18 -6
- package/dist/runtime/api/docs/AdminApi.md +972 -0
- package/dist/runtime/api/docs/ApplicationApi.md +387 -0
- package/dist/runtime/api/docs/AuthApi.md +577 -0
- package/dist/runtime/api/docs/BucketApi.md +312 -0
- package/dist/runtime/api/docs/BucketInformation.md +40 -0
- package/dist/runtime/api/docs/CollectionApi.md +822 -0
- package/dist/runtime/api/docs/CollectionStatus.md +58 -0
- package/dist/runtime/api/docs/DatabaseApi.md +382 -0
- package/dist/runtime/api/docs/DatabaseInfo.md +42 -0
- package/dist/runtime/api/docs/DeleteResponse.md +36 -0
- package/dist/runtime/api/docs/DocumentApi.md +850 -0
- package/dist/runtime/api/docs/ErrorDescription.md +38 -0
- package/dist/runtime/api/docs/FileApi.md +606 -0
- package/dist/runtime/api/docs/FileInformation.md +44 -0
- package/dist/runtime/api/docs/Grant.md +42 -0
- package/dist/runtime/api/docs/IndexApi.md +682 -0
- package/dist/runtime/api/docs/IndexCreateRequest.md +36 -0
- package/dist/runtime/api/docs/IndexCreateResponse.md +34 -0
- package/dist/runtime/api/docs/IndexDropResponse.md +34 -0
- package/dist/runtime/api/docs/IndexOptionsRequest.md +48 -0
- package/dist/runtime/api/docs/InformationApi.md +69 -0
- package/dist/runtime/api/docs/InsertResponse.md +36 -0
- package/dist/runtime/api/docs/JobConfig.md +44 -0
- package/dist/runtime/api/docs/JobInformation.md +50 -0
- package/dist/runtime/api/docs/JobsApi.md +474 -0
- package/dist/runtime/api/docs/JsonSchema.md +38 -0
- package/dist/runtime/api/docs/JsonSchemaDefinition.md +42 -0
- package/dist/runtime/api/docs/JsonValueAny.md +34 -0
- package/dist/runtime/api/docs/JsonValueBoolean.md +34 -0
- package/dist/runtime/api/docs/JsonValueString.md +34 -0
- package/dist/runtime/api/docs/Login.md +36 -0
- package/dist/runtime/api/docs/LoginResult.md +38 -0
- package/dist/runtime/api/docs/MongoAggregateRequest.md +36 -0
- package/dist/runtime/api/docs/MongoCampConfiguration.md +42 -0
- package/dist/runtime/api/docs/MongoFindRequest.md +38 -0
- package/dist/runtime/api/docs/MongoIndex.md +56 -0
- package/dist/runtime/api/docs/PasswordUpdateRequest.md +34 -0
- package/dist/runtime/api/docs/PipelineStage.md +36 -0
- package/dist/runtime/api/docs/Role.md +38 -0
- package/dist/runtime/api/docs/SchemaAnalysis.md +40 -0
- package/dist/runtime/api/docs/SchemaAnalysisField.md +44 -0
- package/dist/runtime/api/docs/SchemaAnalysisFieldType.md +38 -0
- package/dist/runtime/api/docs/SettingsResponse.md +40 -0
- package/dist/runtime/api/docs/UpdateFileInformationRequest.md +36 -0
- package/dist/runtime/api/docs/UpdateRequest.md +36 -0
- package/dist/runtime/api/docs/UpdateResponse.md +40 -0
- package/dist/runtime/api/docs/UpdateRoleRequest.md +36 -0
- package/dist/runtime/api/docs/UserInformation.md +40 -0
- package/dist/runtime/api/docs/UserProfile.md +42 -0
- package/dist/runtime/api/docs/Version.md +38 -0
- package/dist/runtime/api/models/JobInformation.js +2 -2
- package/dist/runtime/composables/mongocampAuth.d.ts +3 -3
- package/package.json +14 -14
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
# ErrorDescription
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`code` | number
|
|
10
|
+
`msg` | string
|
|
11
|
+
`additionalInfo` | string
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { ErrorDescription } from ''
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"code": null,
|
|
21
|
+
"msg": null,
|
|
22
|
+
"additionalInfo": null,
|
|
23
|
+
} satisfies ErrorDescription
|
|
24
|
+
|
|
25
|
+
console.log(example)
|
|
26
|
+
|
|
27
|
+
// Convert the instance to a JSON string
|
|
28
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
29
|
+
console.log(exampleJSON)
|
|
30
|
+
|
|
31
|
+
// Parse the JSON string back to an object
|
|
32
|
+
const exampleParsed = JSON.parse(exampleJSON) as ErrorDescription
|
|
33
|
+
console.log(exampleParsed)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,606 @@
|
|
|
1
|
+
# FileApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *http://localhost*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**deleteFile**](FileApi.md#deletefile) | **DELETE** /mongodb/buckets/{bucketName}/files/{fileId} | Delete File from Bucket |
|
|
8
|
+
| [**findFiles**](FileApi.md#findfiles) | **POST** /mongodb/buckets/{bucketName}/files | Files in Bucket |
|
|
9
|
+
| [**getFile**](FileApi.md#getfile) | **GET** /mongodb/buckets/{bucketName}/files/{fileId}/file | File from Bucket |
|
|
10
|
+
| [**getFileInformation**](FileApi.md#getfileinformation) | **GET** /mongodb/buckets/{bucketName}/files/{fileId} | FileInformation from Bucket |
|
|
11
|
+
| [**insertFile**](FileApi.md#insertfile) | **PUT** /mongodb/buckets/{bucketName}/files | Insert File |
|
|
12
|
+
| [**listFiles**](FileApi.md#listfiles) | **GET** /mongodb/buckets/{bucketName}/files | Files in Bucket |
|
|
13
|
+
| [**updateFileInformation**](FileApi.md#updatefileinformationoperation) | **PATCH** /mongodb/buckets/{bucketName}/files/{fileId} | Update FileInformation in Bucket |
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## deleteFile
|
|
18
|
+
|
|
19
|
+
> DeleteResponse deleteFile(bucketName, fileId)
|
|
20
|
+
|
|
21
|
+
Delete File from Bucket
|
|
22
|
+
|
|
23
|
+
Delete one File from given Bucket
|
|
24
|
+
|
|
25
|
+
### Example
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import {
|
|
29
|
+
Configuration,
|
|
30
|
+
FileApi,
|
|
31
|
+
} from '';
|
|
32
|
+
import type { DeleteFileRequest } from '';
|
|
33
|
+
|
|
34
|
+
async function example() {
|
|
35
|
+
console.log("🚀 Testing SDK...");
|
|
36
|
+
const config = new Configuration({
|
|
37
|
+
// To configure HTTP basic authorization: httpAuth1
|
|
38
|
+
username: "YOUR USERNAME",
|
|
39
|
+
password: "YOUR PASSWORD",
|
|
40
|
+
// Configure HTTP bearer authorization: httpAuth
|
|
41
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
42
|
+
// To configure API key authorization: apiKeyAuth
|
|
43
|
+
apiKey: "YOUR API KEY",
|
|
44
|
+
});
|
|
45
|
+
const api = new FileApi(config);
|
|
46
|
+
|
|
47
|
+
const body = {
|
|
48
|
+
// string | The name of your MongoDb Collection
|
|
49
|
+
bucketName: bucketName_example,
|
|
50
|
+
// string | fileId to delete
|
|
51
|
+
fileId: fileId_example,
|
|
52
|
+
} satisfies DeleteFileRequest;
|
|
53
|
+
|
|
54
|
+
try {
|
|
55
|
+
const data = await api.deleteFile(body);
|
|
56
|
+
console.log(data);
|
|
57
|
+
} catch (error) {
|
|
58
|
+
console.error(error);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Run the test
|
|
63
|
+
example().catch(console.error);
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Parameters
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
| Name | Type | Description | Notes |
|
|
70
|
+
|------------- | ------------- | ------------- | -------------|
|
|
71
|
+
| **bucketName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
|
|
72
|
+
| **fileId** | `string` | fileId to delete | [Defaults to `undefined`] |
|
|
73
|
+
|
|
74
|
+
### Return type
|
|
75
|
+
|
|
76
|
+
[**DeleteResponse**](DeleteResponse.md)
|
|
77
|
+
|
|
78
|
+
### Authorization
|
|
79
|
+
|
|
80
|
+
[httpAuth1](../README.md#httpAuth1), [httpAuth](../README.md#httpAuth), [apiKeyAuth](../README.md#apiKeyAuth)
|
|
81
|
+
|
|
82
|
+
### HTTP request headers
|
|
83
|
+
|
|
84
|
+
- **Content-Type**: Not defined
|
|
85
|
+
- **Accept**: `application/json`
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
### HTTP response details
|
|
89
|
+
| Status code | Description | Response headers |
|
|
90
|
+
|-------------|-------------|------------------|
|
|
91
|
+
| **200** | | - |
|
|
92
|
+
| **0** | | * x-error-code - Error Code <br> * x-error-message - Message of the MongoCampException <br> * x-error-additional-info - Additional information for the MongoCampException <br> |
|
|
93
|
+
|
|
94
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
## findFiles
|
|
98
|
+
|
|
99
|
+
> Array<FileInformation> findFiles(bucketName, mongoFindRequest, rowsPerPage, page)
|
|
100
|
+
|
|
101
|
+
Files in Bucket
|
|
102
|
+
|
|
103
|
+
Alternative to GET Route for more complex queries and URL max. Length
|
|
104
|
+
|
|
105
|
+
### Example
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
import {
|
|
109
|
+
Configuration,
|
|
110
|
+
FileApi,
|
|
111
|
+
} from '';
|
|
112
|
+
import type { FindFilesRequest } from '';
|
|
113
|
+
|
|
114
|
+
async function example() {
|
|
115
|
+
console.log("🚀 Testing SDK...");
|
|
116
|
+
const config = new Configuration({
|
|
117
|
+
// To configure HTTP basic authorization: httpAuth1
|
|
118
|
+
username: "YOUR USERNAME",
|
|
119
|
+
password: "YOUR PASSWORD",
|
|
120
|
+
// Configure HTTP bearer authorization: httpAuth
|
|
121
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
122
|
+
// To configure API key authorization: apiKeyAuth
|
|
123
|
+
apiKey: "YOUR API KEY",
|
|
124
|
+
});
|
|
125
|
+
const api = new FileApi(config);
|
|
126
|
+
|
|
127
|
+
const body = {
|
|
128
|
+
// string | The name of your MongoDb Collection
|
|
129
|
+
bucketName: bucketName_example,
|
|
130
|
+
// MongoFindRequest
|
|
131
|
+
mongoFindRequest: {"filter":{"filename":"myfile.json","uploadDate":{"$gte":"2022-03-15T00:00:00.000Z"}},"sort":{"uploadDate":-1},"projection":{}},
|
|
132
|
+
// number | Count elements per page (optional)
|
|
133
|
+
rowsPerPage: 100,
|
|
134
|
+
// number | Requested page of the ResultSets (optional)
|
|
135
|
+
page: 1,
|
|
136
|
+
} satisfies FindFilesRequest;
|
|
137
|
+
|
|
138
|
+
try {
|
|
139
|
+
const data = await api.findFiles(body);
|
|
140
|
+
console.log(data);
|
|
141
|
+
} catch (error) {
|
|
142
|
+
console.error(error);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Run the test
|
|
147
|
+
example().catch(console.error);
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Parameters
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
| Name | Type | Description | Notes |
|
|
154
|
+
|------------- | ------------- | ------------- | -------------|
|
|
155
|
+
| **bucketName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
|
|
156
|
+
| **mongoFindRequest** | [MongoFindRequest](MongoFindRequest.md) | | |
|
|
157
|
+
| **rowsPerPage** | `number` | Count elements per page | [Optional] [Defaults to `undefined`] |
|
|
158
|
+
| **page** | `number` | Requested page of the ResultSets | [Optional] [Defaults to `undefined`] |
|
|
159
|
+
|
|
160
|
+
### Return type
|
|
161
|
+
|
|
162
|
+
[**Array<FileInformation>**](FileInformation.md)
|
|
163
|
+
|
|
164
|
+
### Authorization
|
|
165
|
+
|
|
166
|
+
[httpAuth1](../README.md#httpAuth1), [httpAuth](../README.md#httpAuth), [apiKeyAuth](../README.md#apiKeyAuth)
|
|
167
|
+
|
|
168
|
+
### HTTP request headers
|
|
169
|
+
|
|
170
|
+
- **Content-Type**: `application/json`
|
|
171
|
+
- **Accept**: `application/json`, `text/plain`
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
### HTTP response details
|
|
175
|
+
| Status code | Description | Response headers |
|
|
176
|
+
|-------------|-------------|------------------|
|
|
177
|
+
| **200** | | * x-pagination-count-rows - count all elements <br> * x-pagination-rows-per-page - Count elements per page <br> * x-pagination-current-page - Current page <br> * x-pagination-count-pages - Count pages <br> |
|
|
178
|
+
| **400** | Invalid value for: body, Invalid value for: query parameter rowsPerPage, Invalid value for: query parameter page | - |
|
|
179
|
+
| **0** | | * x-error-code - Error Code <br> * x-error-message - Message of the MongoCampException <br> * x-error-additional-info - Additional information for the MongoCampException <br> |
|
|
180
|
+
|
|
181
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
## getFile
|
|
185
|
+
|
|
186
|
+
> Blob getFile(bucketName, fileId)
|
|
187
|
+
|
|
188
|
+
File from Bucket
|
|
189
|
+
|
|
190
|
+
Get File from given Bucket
|
|
191
|
+
|
|
192
|
+
### Example
|
|
193
|
+
|
|
194
|
+
```ts
|
|
195
|
+
import {
|
|
196
|
+
Configuration,
|
|
197
|
+
FileApi,
|
|
198
|
+
} from '';
|
|
199
|
+
import type { GetFileRequest } from '';
|
|
200
|
+
|
|
201
|
+
async function example() {
|
|
202
|
+
console.log("🚀 Testing SDK...");
|
|
203
|
+
const config = new Configuration({
|
|
204
|
+
// To configure HTTP basic authorization: httpAuth1
|
|
205
|
+
username: "YOUR USERNAME",
|
|
206
|
+
password: "YOUR PASSWORD",
|
|
207
|
+
// Configure HTTP bearer authorization: httpAuth
|
|
208
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
209
|
+
// To configure API key authorization: apiKeyAuth
|
|
210
|
+
apiKey: "YOUR API KEY",
|
|
211
|
+
});
|
|
212
|
+
const api = new FileApi(config);
|
|
213
|
+
|
|
214
|
+
const body = {
|
|
215
|
+
// string | The name of your MongoDb Collection
|
|
216
|
+
bucketName: bucketName_example,
|
|
217
|
+
// string | FileId to read
|
|
218
|
+
fileId: fileId_example,
|
|
219
|
+
} satisfies GetFileRequest;
|
|
220
|
+
|
|
221
|
+
try {
|
|
222
|
+
const data = await api.getFile(body);
|
|
223
|
+
console.log(data);
|
|
224
|
+
} catch (error) {
|
|
225
|
+
console.error(error);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// Run the test
|
|
230
|
+
example().catch(console.error);
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Parameters
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
| Name | Type | Description | Notes |
|
|
237
|
+
|------------- | ------------- | ------------- | -------------|
|
|
238
|
+
| **bucketName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
|
|
239
|
+
| **fileId** | `string` | FileId to read | [Defaults to `undefined`] |
|
|
240
|
+
|
|
241
|
+
### Return type
|
|
242
|
+
|
|
243
|
+
**Blob**
|
|
244
|
+
|
|
245
|
+
### Authorization
|
|
246
|
+
|
|
247
|
+
[httpAuth1](../README.md#httpAuth1), [httpAuth](../README.md#httpAuth), [apiKeyAuth](../README.md#apiKeyAuth)
|
|
248
|
+
|
|
249
|
+
### HTTP request headers
|
|
250
|
+
|
|
251
|
+
- **Content-Type**: Not defined
|
|
252
|
+
- **Accept**: `application/octet-stream`, `application/json`
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
### HTTP response details
|
|
256
|
+
| Status code | Description | Response headers |
|
|
257
|
+
|-------------|-------------|------------------|
|
|
258
|
+
| **200** | | * Content-Length - <br> * Content-Disposition - <br> * Content-Type - <br> * cache-control - <br> |
|
|
259
|
+
| **0** | | * x-error-code - Error Code <br> * x-error-message - Message of the MongoCampException <br> * x-error-additional-info - Additional information for the MongoCampException <br> |
|
|
260
|
+
|
|
261
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
## getFileInformation
|
|
265
|
+
|
|
266
|
+
> FileInformation getFileInformation(bucketName, fileId)
|
|
267
|
+
|
|
268
|
+
FileInformation from Bucket
|
|
269
|
+
|
|
270
|
+
Get one FileInformation from given Bucket
|
|
271
|
+
|
|
272
|
+
### Example
|
|
273
|
+
|
|
274
|
+
```ts
|
|
275
|
+
import {
|
|
276
|
+
Configuration,
|
|
277
|
+
FileApi,
|
|
278
|
+
} from '';
|
|
279
|
+
import type { GetFileInformationRequest } from '';
|
|
280
|
+
|
|
281
|
+
async function example() {
|
|
282
|
+
console.log("🚀 Testing SDK...");
|
|
283
|
+
const config = new Configuration({
|
|
284
|
+
// To configure HTTP basic authorization: httpAuth1
|
|
285
|
+
username: "YOUR USERNAME",
|
|
286
|
+
password: "YOUR PASSWORD",
|
|
287
|
+
// Configure HTTP bearer authorization: httpAuth
|
|
288
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
289
|
+
// To configure API key authorization: apiKeyAuth
|
|
290
|
+
apiKey: "YOUR API KEY",
|
|
291
|
+
});
|
|
292
|
+
const api = new FileApi(config);
|
|
293
|
+
|
|
294
|
+
const body = {
|
|
295
|
+
// string | The name of your MongoDb Collection
|
|
296
|
+
bucketName: bucketName_example,
|
|
297
|
+
// string | fileId to read
|
|
298
|
+
fileId: fileId_example,
|
|
299
|
+
} satisfies GetFileInformationRequest;
|
|
300
|
+
|
|
301
|
+
try {
|
|
302
|
+
const data = await api.getFileInformation(body);
|
|
303
|
+
console.log(data);
|
|
304
|
+
} catch (error) {
|
|
305
|
+
console.error(error);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// Run the test
|
|
310
|
+
example().catch(console.error);
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Parameters
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
| Name | Type | Description | Notes |
|
|
317
|
+
|------------- | ------------- | ------------- | -------------|
|
|
318
|
+
| **bucketName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
|
|
319
|
+
| **fileId** | `string` | fileId to read | [Defaults to `undefined`] |
|
|
320
|
+
|
|
321
|
+
### Return type
|
|
322
|
+
|
|
323
|
+
[**FileInformation**](FileInformation.md)
|
|
324
|
+
|
|
325
|
+
### Authorization
|
|
326
|
+
|
|
327
|
+
[httpAuth1](../README.md#httpAuth1), [httpAuth](../README.md#httpAuth), [apiKeyAuth](../README.md#apiKeyAuth)
|
|
328
|
+
|
|
329
|
+
### HTTP request headers
|
|
330
|
+
|
|
331
|
+
- **Content-Type**: Not defined
|
|
332
|
+
- **Accept**: `application/json`
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
### HTTP response details
|
|
336
|
+
| Status code | Description | Response headers |
|
|
337
|
+
|-------------|-------------|------------------|
|
|
338
|
+
| **200** | | - |
|
|
339
|
+
| **0** | | * x-error-code - Error Code <br> * x-error-message - Message of the MongoCampException <br> * x-error-additional-info - Additional information for the MongoCampException <br> |
|
|
340
|
+
|
|
341
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
## insertFile
|
|
345
|
+
|
|
346
|
+
> InsertResponse insertFile(bucketName, file, metaData, fileName)
|
|
347
|
+
|
|
348
|
+
Insert File
|
|
349
|
+
|
|
350
|
+
Insert one File in given Bucket
|
|
351
|
+
|
|
352
|
+
### Example
|
|
353
|
+
|
|
354
|
+
```ts
|
|
355
|
+
import {
|
|
356
|
+
Configuration,
|
|
357
|
+
FileApi,
|
|
358
|
+
} from '';
|
|
359
|
+
import type { InsertFileRequest } from '';
|
|
360
|
+
|
|
361
|
+
async function example() {
|
|
362
|
+
console.log("🚀 Testing SDK...");
|
|
363
|
+
const config = new Configuration({
|
|
364
|
+
// To configure HTTP basic authorization: httpAuth1
|
|
365
|
+
username: "YOUR USERNAME",
|
|
366
|
+
password: "YOUR PASSWORD",
|
|
367
|
+
// Configure HTTP bearer authorization: httpAuth
|
|
368
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
369
|
+
// To configure API key authorization: apiKeyAuth
|
|
370
|
+
apiKey: "YOUR API KEY",
|
|
371
|
+
});
|
|
372
|
+
const api = new FileApi(config);
|
|
373
|
+
|
|
374
|
+
const body = {
|
|
375
|
+
// string | The name of your MongoDb Collection
|
|
376
|
+
bucketName: bucketName_example,
|
|
377
|
+
// Blob
|
|
378
|
+
file: BINARY_DATA_HERE,
|
|
379
|
+
// string
|
|
380
|
+
metaData: metaData_example,
|
|
381
|
+
// string | override filename of uploaded file (optional)
|
|
382
|
+
fileName: fileName_example,
|
|
383
|
+
} satisfies InsertFileRequest;
|
|
384
|
+
|
|
385
|
+
try {
|
|
386
|
+
const data = await api.insertFile(body);
|
|
387
|
+
console.log(data);
|
|
388
|
+
} catch (error) {
|
|
389
|
+
console.error(error);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
// Run the test
|
|
394
|
+
example().catch(console.error);
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
### Parameters
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
| Name | Type | Description | Notes |
|
|
401
|
+
|------------- | ------------- | ------------- | -------------|
|
|
402
|
+
| **bucketName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
|
|
403
|
+
| **file** | `Blob` | | [Defaults to `undefined`] |
|
|
404
|
+
| **metaData** | `string` | | [Defaults to `undefined`] |
|
|
405
|
+
| **fileName** | `string` | override filename of uploaded file | [Optional] [Defaults to `undefined`] |
|
|
406
|
+
|
|
407
|
+
### Return type
|
|
408
|
+
|
|
409
|
+
[**InsertResponse**](InsertResponse.md)
|
|
410
|
+
|
|
411
|
+
### Authorization
|
|
412
|
+
|
|
413
|
+
[httpAuth1](../README.md#httpAuth1), [httpAuth](../README.md#httpAuth), [apiKeyAuth](../README.md#apiKeyAuth)
|
|
414
|
+
|
|
415
|
+
### HTTP request headers
|
|
416
|
+
|
|
417
|
+
- **Content-Type**: `multipart/form-data`
|
|
418
|
+
- **Accept**: `application/json`, `text/plain`
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
### HTTP response details
|
|
422
|
+
| Status code | Description | Response headers |
|
|
423
|
+
|-------------|-------------|------------------|
|
|
424
|
+
| **200** | | - |
|
|
425
|
+
| **400** | Invalid value for: body, Invalid value for: query parameter fileName | - |
|
|
426
|
+
| **0** | | * x-error-code - Error Code <br> * x-error-message - Message of the MongoCampException <br> * x-error-additional-info - Additional information for the MongoCampException <br> |
|
|
427
|
+
|
|
428
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
## listFiles
|
|
432
|
+
|
|
433
|
+
> Array<FileInformation> listFiles(bucketName, filter, sort, projection, rowsPerPage, page)
|
|
434
|
+
|
|
435
|
+
Files in Bucket
|
|
436
|
+
|
|
437
|
+
Get Files paginated from given Bucket
|
|
438
|
+
|
|
439
|
+
### Example
|
|
440
|
+
|
|
441
|
+
```ts
|
|
442
|
+
import {
|
|
443
|
+
Configuration,
|
|
444
|
+
FileApi,
|
|
445
|
+
} from '';
|
|
446
|
+
import type { ListFilesRequest } from '';
|
|
447
|
+
|
|
448
|
+
async function example() {
|
|
449
|
+
console.log("🚀 Testing SDK...");
|
|
450
|
+
const config = new Configuration({
|
|
451
|
+
// To configure HTTP basic authorization: httpAuth1
|
|
452
|
+
username: "YOUR USERNAME",
|
|
453
|
+
password: "YOUR PASSWORD",
|
|
454
|
+
// Configure HTTP bearer authorization: httpAuth
|
|
455
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
456
|
+
// To configure API key authorization: apiKeyAuth
|
|
457
|
+
apiKey: "YOUR API KEY",
|
|
458
|
+
});
|
|
459
|
+
const api = new FileApi(config);
|
|
460
|
+
|
|
461
|
+
const body = {
|
|
462
|
+
// string | The name of your MongoDb Collection
|
|
463
|
+
bucketName: bucketName_example,
|
|
464
|
+
// string | MongoDB Filter Query by Default all filter (optional)
|
|
465
|
+
filter: {},
|
|
466
|
+
// string | MongoDB sorting (optional)
|
|
467
|
+
sort: {},
|
|
468
|
+
// string | MongoDB projection (optional)
|
|
469
|
+
projection: {},
|
|
470
|
+
// number | Count elements per page (optional)
|
|
471
|
+
rowsPerPage: 100,
|
|
472
|
+
// number | Requested page of the ResultSets (optional)
|
|
473
|
+
page: 1,
|
|
474
|
+
} satisfies ListFilesRequest;
|
|
475
|
+
|
|
476
|
+
try {
|
|
477
|
+
const data = await api.listFiles(body);
|
|
478
|
+
console.log(data);
|
|
479
|
+
} catch (error) {
|
|
480
|
+
console.error(error);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
// Run the test
|
|
485
|
+
example().catch(console.error);
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
### Parameters
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
| Name | Type | Description | Notes |
|
|
492
|
+
|------------- | ------------- | ------------- | -------------|
|
|
493
|
+
| **bucketName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
|
|
494
|
+
| **filter** | `string` | MongoDB Filter Query by Default all filter | [Optional] [Defaults to `undefined`] |
|
|
495
|
+
| **sort** | `string` | MongoDB sorting | [Optional] [Defaults to `undefined`] |
|
|
496
|
+
| **projection** | `string` | MongoDB projection | [Optional] [Defaults to `undefined`] |
|
|
497
|
+
| **rowsPerPage** | `number` | Count elements per page | [Optional] [Defaults to `undefined`] |
|
|
498
|
+
| **page** | `number` | Requested page of the ResultSets | [Optional] [Defaults to `undefined`] |
|
|
499
|
+
|
|
500
|
+
### Return type
|
|
501
|
+
|
|
502
|
+
[**Array<FileInformation>**](FileInformation.md)
|
|
503
|
+
|
|
504
|
+
### Authorization
|
|
505
|
+
|
|
506
|
+
[httpAuth1](../README.md#httpAuth1), [httpAuth](../README.md#httpAuth), [apiKeyAuth](../README.md#apiKeyAuth)
|
|
507
|
+
|
|
508
|
+
### HTTP request headers
|
|
509
|
+
|
|
510
|
+
- **Content-Type**: Not defined
|
|
511
|
+
- **Accept**: `application/json`, `text/plain`
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
### HTTP response details
|
|
515
|
+
| Status code | Description | Response headers |
|
|
516
|
+
|-------------|-------------|------------------|
|
|
517
|
+
| **200** | | * x-pagination-count-rows - count all elements <br> * x-pagination-rows-per-page - Count elements per page <br> * x-pagination-current-page - Current page <br> * x-pagination-count-pages - Count pages <br> |
|
|
518
|
+
| **400** | Invalid value for: query parameter filter, Invalid value for: query parameter sort, Invalid value for: query parameter projection, Invalid value for: query parameter rowsPerPage, Invalid value for: query parameter page | - |
|
|
519
|
+
| **0** | | * x-error-code - Error Code <br> * x-error-message - Message of the MongoCampException <br> * x-error-additional-info - Additional information for the MongoCampException <br> |
|
|
520
|
+
|
|
521
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
## updateFileInformation
|
|
525
|
+
|
|
526
|
+
> UpdateResponse updateFileInformation(bucketName, fileId, updateFileInformationRequest)
|
|
527
|
+
|
|
528
|
+
Update FileInformation in Bucket
|
|
529
|
+
|
|
530
|
+
Replace MetaData and potential update FileName
|
|
531
|
+
|
|
532
|
+
### Example
|
|
533
|
+
|
|
534
|
+
```ts
|
|
535
|
+
import {
|
|
536
|
+
Configuration,
|
|
537
|
+
FileApi,
|
|
538
|
+
} from '';
|
|
539
|
+
import type { UpdateFileInformationOperationRequest } from '';
|
|
540
|
+
|
|
541
|
+
async function example() {
|
|
542
|
+
console.log("🚀 Testing SDK...");
|
|
543
|
+
const config = new Configuration({
|
|
544
|
+
// To configure HTTP basic authorization: httpAuth1
|
|
545
|
+
username: "YOUR USERNAME",
|
|
546
|
+
password: "YOUR PASSWORD",
|
|
547
|
+
// Configure HTTP bearer authorization: httpAuth
|
|
548
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
549
|
+
// To configure API key authorization: apiKeyAuth
|
|
550
|
+
apiKey: "YOUR API KEY",
|
|
551
|
+
});
|
|
552
|
+
const api = new FileApi(config);
|
|
553
|
+
|
|
554
|
+
const body = {
|
|
555
|
+
// string | The name of your MongoDb Collection
|
|
556
|
+
bucketName: bucketName_example,
|
|
557
|
+
// string | fileId to update
|
|
558
|
+
fileId: fileId_example,
|
|
559
|
+
// UpdateFileInformationRequest
|
|
560
|
+
updateFileInformationRequest: ...,
|
|
561
|
+
} satisfies UpdateFileInformationOperationRequest;
|
|
562
|
+
|
|
563
|
+
try {
|
|
564
|
+
const data = await api.updateFileInformation(body);
|
|
565
|
+
console.log(data);
|
|
566
|
+
} catch (error) {
|
|
567
|
+
console.error(error);
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
// Run the test
|
|
572
|
+
example().catch(console.error);
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
### Parameters
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
| Name | Type | Description | Notes |
|
|
579
|
+
|------------- | ------------- | ------------- | -------------|
|
|
580
|
+
| **bucketName** | `string` | The name of your MongoDb Collection | [Defaults to `undefined`] |
|
|
581
|
+
| **fileId** | `string` | fileId to update | [Defaults to `undefined`] |
|
|
582
|
+
| **updateFileInformationRequest** | [UpdateFileInformationRequest](UpdateFileInformationRequest.md) | | |
|
|
583
|
+
|
|
584
|
+
### Return type
|
|
585
|
+
|
|
586
|
+
[**UpdateResponse**](UpdateResponse.md)
|
|
587
|
+
|
|
588
|
+
### Authorization
|
|
589
|
+
|
|
590
|
+
[httpAuth1](../README.md#httpAuth1), [httpAuth](../README.md#httpAuth), [apiKeyAuth](../README.md#apiKeyAuth)
|
|
591
|
+
|
|
592
|
+
### HTTP request headers
|
|
593
|
+
|
|
594
|
+
- **Content-Type**: `application/json`
|
|
595
|
+
- **Accept**: `application/json`, `text/plain`
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
### HTTP response details
|
|
599
|
+
| Status code | Description | Response headers |
|
|
600
|
+
|-------------|-------------|------------------|
|
|
601
|
+
| **200** | | - |
|
|
602
|
+
| **400** | Invalid value for: body | - |
|
|
603
|
+
| **0** | | * x-error-code - Error Code <br> * x-error-message - Message of the MongoCampException <br> * x-error-additional-info - Additional information for the MongoCampException <br> |
|
|
604
|
+
|
|
605
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
606
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
|
|
2
|
+
# FileInformation
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`id` | string
|
|
10
|
+
`filename` | string
|
|
11
|
+
`length` | number
|
|
12
|
+
`chunkSize` | number
|
|
13
|
+
`uploadDate` | Date
|
|
14
|
+
`metadata` | { [key: string]: string; }
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import type { FileInformation } from ''
|
|
20
|
+
|
|
21
|
+
// TODO: Update the object below with actual values
|
|
22
|
+
const example = {
|
|
23
|
+
"id": null,
|
|
24
|
+
"filename": null,
|
|
25
|
+
"length": null,
|
|
26
|
+
"chunkSize": null,
|
|
27
|
+
"uploadDate": null,
|
|
28
|
+
"metadata": null,
|
|
29
|
+
} satisfies FileInformation
|
|
30
|
+
|
|
31
|
+
console.log(example)
|
|
32
|
+
|
|
33
|
+
// Convert the instance to a JSON string
|
|
34
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
35
|
+
console.log(exampleJSON)
|
|
36
|
+
|
|
37
|
+
// Parse the JSON string back to an object
|
|
38
|
+
const exampleParsed = JSON.parse(exampleJSON) as FileInformation
|
|
39
|
+
console.log(exampleParsed)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
43
|
+
|
|
44
|
+
|