@spaciv/sdk 0.1.11 → 0.1.13
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/README.md +2 -2
- package/dist/apis/DataCollectionApi.d.ts +4 -4
- package/dist/apis/DataCollectionApi.js +2 -2
- package/dist/apis/FilesApi.d.ts +37 -4
- package/dist/apis/FilesApi.js +69 -2
- package/dist/esm/apis/DataCollectionApi.d.ts +4 -4
- package/dist/esm/apis/DataCollectionApi.js +2 -2
- package/dist/esm/apis/FilesApi.d.ts +37 -4
- package/dist/esm/apis/FilesApi.js +69 -2
- package/dist/esm/models/GetDatacollectionRes.d.ts +6 -6
- package/dist/esm/models/GetDatacollectionRes.js +4 -2
- package/dist/esm/models/ModelRecord.d.ts +1 -1
- package/dist/models/GetDatacollectionRes.d.ts +6 -6
- package/dist/models/GetDatacollectionRes.js +4 -2
- package/dist/models/ModelRecord.d.ts +1 -1
- package/package.json +1 -1
- package/src/apis/DataCollectionApi.ts +4 -4
- package/src/apis/FilesApi.ts +113 -4
- package/src/models/GetDatacollectionRes.ts +9 -8
- package/src/models/ModelRecord.ts +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## @spaciv/sdk@0.1.
|
|
1
|
+
## @spaciv/sdk@0.1.13
|
|
2
2
|
|
|
3
3
|
This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
|
|
4
4
|
|
|
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
|
|
|
36
36
|
_published:_
|
|
37
37
|
|
|
38
38
|
```
|
|
39
|
-
npm install @spaciv/sdk@0.1.
|
|
39
|
+
npm install @spaciv/sdk@0.1.13 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
|
@@ -65,7 +65,7 @@ export interface DataCollectionApiInterface {
|
|
|
65
65
|
*/
|
|
66
66
|
delete(requestParameters: DataCollectionApiDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object>;
|
|
67
67
|
/**
|
|
68
|
-
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts.
|
|
68
|
+
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts. `contributorCount` is the number of uploaded contributors for callers with *View crowd modelling* or *Configure crowd modelling*, and 0 otherwise.
|
|
69
69
|
* @summary Get a data collection survey
|
|
70
70
|
* @param {string} id
|
|
71
71
|
* @param {*} [options] Override http request option.
|
|
@@ -74,7 +74,7 @@ export interface DataCollectionApiInterface {
|
|
|
74
74
|
*/
|
|
75
75
|
getRaw(requestParameters: DataCollectionApiGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetDatacollectionRes>>;
|
|
76
76
|
/**
|
|
77
|
-
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts.
|
|
77
|
+
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts. `contributorCount` is the number of uploaded contributors for callers with *View crowd modelling* or *Configure crowd modelling*, and 0 otherwise.
|
|
78
78
|
* Get a data collection survey
|
|
79
79
|
*/
|
|
80
80
|
get(requestParameters: DataCollectionApiGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetDatacollectionRes>;
|
|
@@ -174,12 +174,12 @@ export declare class DataCollectionApi extends runtime.BaseAPI implements DataCo
|
|
|
174
174
|
*/
|
|
175
175
|
delete(requestParameters: DataCollectionApiDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object>;
|
|
176
176
|
/**
|
|
177
|
-
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts.
|
|
177
|
+
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts. `contributorCount` is the number of uploaded contributors for callers with *View crowd modelling* or *Configure crowd modelling*, and 0 otherwise.
|
|
178
178
|
* Get a data collection survey
|
|
179
179
|
*/
|
|
180
180
|
getRaw(requestParameters: DataCollectionApiGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetDatacollectionRes>>;
|
|
181
181
|
/**
|
|
182
|
-
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts.
|
|
182
|
+
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts. `contributorCount` is the number of uploaded contributors for callers with *View crowd modelling* or *Configure crowd modelling*, and 0 otherwise.
|
|
183
183
|
* Get a data collection survey
|
|
184
184
|
*/
|
|
185
185
|
get(requestParameters: DataCollectionApiGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetDatacollectionRes>;
|
|
@@ -104,7 +104,7 @@ class DataCollectionApi extends runtime.BaseAPI {
|
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
/**
|
|
107
|
-
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts.
|
|
107
|
+
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts. `contributorCount` is the number of uploaded contributors for callers with *View crowd modelling* or *Configure crowd modelling*, and 0 otherwise.
|
|
108
108
|
* Get a data collection survey
|
|
109
109
|
*/
|
|
110
110
|
getRaw(requestParameters, initOverrides) {
|
|
@@ -133,7 +133,7 @@ class DataCollectionApi extends runtime.BaseAPI {
|
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
135
|
/**
|
|
136
|
-
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts.
|
|
136
|
+
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts. `contributorCount` is the number of uploaded contributors for callers with *View crowd modelling* or *Configure crowd modelling*, and 0 otherwise.
|
|
137
137
|
* Get a data collection survey
|
|
138
138
|
*/
|
|
139
139
|
get(requestParameters, initOverrides) {
|
package/dist/apis/FilesApi.d.ts
CHANGED
|
@@ -29,6 +29,12 @@ export interface FilesApiUpdateAccountFilesRequest {
|
|
|
29
29
|
id: string;
|
|
30
30
|
accountFilePatchBody: AccountFilePatchBody;
|
|
31
31
|
}
|
|
32
|
+
export interface FilesApiUpdateAccountFilesContentRequest {
|
|
33
|
+
id: string;
|
|
34
|
+
ifMatch: string;
|
|
35
|
+
filename?: Blob;
|
|
36
|
+
name?: string;
|
|
37
|
+
}
|
|
32
38
|
/**
|
|
33
39
|
* FilesApi - interface
|
|
34
40
|
*
|
|
@@ -66,7 +72,7 @@ export interface FilesApiInterface {
|
|
|
66
72
|
*/
|
|
67
73
|
deleteAccountFiles(requestParameters: FilesApiDeleteAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object>;
|
|
68
74
|
/**
|
|
69
|
-
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded
|
|
75
|
+
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded when the content was last stored as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The response\'s `ETag` identifies this version of the content: send it back as `If-Match` when replacing the content, so that a change made by someone else in the meantime is not overwritten. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
|
|
70
76
|
* @summary Download an account file
|
|
71
77
|
* @param {string} id
|
|
72
78
|
* @param {*} [options] Override http request option.
|
|
@@ -75,7 +81,7 @@ export interface FilesApiInterface {
|
|
|
75
81
|
*/
|
|
76
82
|
getAccountFilesContentRaw(requestParameters: FilesApiGetAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
|
|
77
83
|
/**
|
|
78
|
-
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded
|
|
84
|
+
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded when the content was last stored as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The response\'s `ETag` identifies this version of the content: send it back as `If-Match` when replacing the content, so that a change made by someone else in the meantime is not overwritten. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
|
|
79
85
|
* Download an account file
|
|
80
86
|
*/
|
|
81
87
|
getAccountFilesContent(requestParameters: FilesApiGetAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
|
|
@@ -109,6 +115,23 @@ export interface FilesApiInterface {
|
|
|
109
115
|
* Rename an account file
|
|
110
116
|
*/
|
|
111
117
|
updateAccountFiles(requestParameters: FilesApiUpdateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord>;
|
|
118
|
+
/**
|
|
119
|
+
* Replaces the stored bytes of a file held against the account and returns the updated record, with the new version of the content as the `ETag`. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name is ignored: the file keeps its name and identifier, so anything already referencing it keeps working. `mimeType` is detected again from the new contents. Maximum file size is 25 MiB, and the content is rejected if a virus scan fails. Send the `ETag` returned when the content was read as `If-Match`. If the file has been replaced since then, the request is rejected with 412 and nothing changes; read the content again before deciding what to save. A missing `If-Match` is rejected with 422, and `*` with 400. The difference in size counts towards the account\'s 1 GiB storage quota, and content that would take the account past it is rejected with 413. A 409 means concurrent changes to the account\'s files kept changing its usage while the content was being replaced. The new content may already be stored, so read the content and its `ETag` again before deciding what to save: retrying with the same `If-Match` is rejected with 412 if it was. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. A quarantined file cannot be replaced (403). Requires the *Edit file storage* permission.
|
|
120
|
+
* @summary Replace an account file\'s content
|
|
121
|
+
* @param {string} id
|
|
122
|
+
* @param {string} ifMatch The ETag returned when the file\'s content was read. The content is replaced only if it has not changed since.
|
|
123
|
+
* @param {Blob} [filename] filename of the file being uploaded
|
|
124
|
+
* @param {string} [name] general purpose name for multipart form value
|
|
125
|
+
* @param {*} [options] Override http request option.
|
|
126
|
+
* @throws {RequiredError}
|
|
127
|
+
* @memberof FilesApiInterface
|
|
128
|
+
*/
|
|
129
|
+
updateAccountFilesContentRaw(requestParameters: FilesApiUpdateAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelRecord>>;
|
|
130
|
+
/**
|
|
131
|
+
* Replaces the stored bytes of a file held against the account and returns the updated record, with the new version of the content as the `ETag`. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name is ignored: the file keeps its name and identifier, so anything already referencing it keeps working. `mimeType` is detected again from the new contents. Maximum file size is 25 MiB, and the content is rejected if a virus scan fails. Send the `ETag` returned when the content was read as `If-Match`. If the file has been replaced since then, the request is rejected with 412 and nothing changes; read the content again before deciding what to save. A missing `If-Match` is rejected with 422, and `*` with 400. The difference in size counts towards the account\'s 1 GiB storage quota, and content that would take the account past it is rejected with 413. A 409 means concurrent changes to the account\'s files kept changing its usage while the content was being replaced. The new content may already be stored, so read the content and its `ETag` again before deciding what to save: retrying with the same `If-Match` is rejected with 412 if it was. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. A quarantined file cannot be replaced (403). Requires the *Edit file storage* permission.
|
|
132
|
+
* Replace an account file\'s content
|
|
133
|
+
*/
|
|
134
|
+
updateAccountFilesContent(requestParameters: FilesApiUpdateAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord>;
|
|
112
135
|
}
|
|
113
136
|
/**
|
|
114
137
|
*
|
|
@@ -135,12 +158,12 @@ export declare class FilesApi extends runtime.BaseAPI implements FilesApiInterfa
|
|
|
135
158
|
*/
|
|
136
159
|
deleteAccountFiles(requestParameters: FilesApiDeleteAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object>;
|
|
137
160
|
/**
|
|
138
|
-
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded
|
|
161
|
+
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded when the content was last stored as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The response\'s `ETag` identifies this version of the content: send it back as `If-Match` when replacing the content, so that a change made by someone else in the meantime is not overwritten. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
|
|
139
162
|
* Download an account file
|
|
140
163
|
*/
|
|
141
164
|
getAccountFilesContentRaw(requestParameters: FilesApiGetAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
|
|
142
165
|
/**
|
|
143
|
-
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded
|
|
166
|
+
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded when the content was last stored as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The response\'s `ETag` identifies this version of the content: send it back as `If-Match` when replacing the content, so that a change made by someone else in the meantime is not overwritten. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
|
|
144
167
|
* Download an account file
|
|
145
168
|
*/
|
|
146
169
|
getAccountFilesContent(requestParameters: FilesApiGetAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
|
|
@@ -164,4 +187,14 @@ export declare class FilesApi extends runtime.BaseAPI implements FilesApiInterfa
|
|
|
164
187
|
* Rename an account file
|
|
165
188
|
*/
|
|
166
189
|
updateAccountFiles(requestParameters: FilesApiUpdateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord>;
|
|
190
|
+
/**
|
|
191
|
+
* Replaces the stored bytes of a file held against the account and returns the updated record, with the new version of the content as the `ETag`. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name is ignored: the file keeps its name and identifier, so anything already referencing it keeps working. `mimeType` is detected again from the new contents. Maximum file size is 25 MiB, and the content is rejected if a virus scan fails. Send the `ETag` returned when the content was read as `If-Match`. If the file has been replaced since then, the request is rejected with 412 and nothing changes; read the content again before deciding what to save. A missing `If-Match` is rejected with 422, and `*` with 400. The difference in size counts towards the account\'s 1 GiB storage quota, and content that would take the account past it is rejected with 413. A 409 means concurrent changes to the account\'s files kept changing its usage while the content was being replaced. The new content may already be stored, so read the content and its `ETag` again before deciding what to save: retrying with the same `If-Match` is rejected with 412 if it was. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. A quarantined file cannot be replaced (403). Requires the *Edit file storage* permission.
|
|
192
|
+
* Replace an account file\'s content
|
|
193
|
+
*/
|
|
194
|
+
updateAccountFilesContentRaw(requestParameters: FilesApiUpdateAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelRecord>>;
|
|
195
|
+
/**
|
|
196
|
+
* Replaces the stored bytes of a file held against the account and returns the updated record, with the new version of the content as the `ETag`. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name is ignored: the file keeps its name and identifier, so anything already referencing it keeps working. `mimeType` is detected again from the new contents. Maximum file size is 25 MiB, and the content is rejected if a virus scan fails. Send the `ETag` returned when the content was read as `If-Match`. If the file has been replaced since then, the request is rejected with 412 and nothing changes; read the content again before deciding what to save. A missing `If-Match` is rejected with 422, and `*` with 400. The difference in size counts towards the account\'s 1 GiB storage quota, and content that would take the account past it is rejected with 413. A 409 means concurrent changes to the account\'s files kept changing its usage while the content was being replaced. The new content may already be stored, so read the content and its `ETag` again before deciding what to save: retrying with the same `If-Match` is rejected with 412 if it was. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. A quarantined file cannot be replaced (403). Requires the *Edit file storage* permission.
|
|
197
|
+
* Replace an account file\'s content
|
|
198
|
+
*/
|
|
199
|
+
updateAccountFilesContent(requestParameters: FilesApiUpdateAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord>;
|
|
167
200
|
}
|
package/dist/apis/FilesApi.js
CHANGED
|
@@ -126,7 +126,7 @@ class FilesApi extends runtime.BaseAPI {
|
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
/**
|
|
129
|
-
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded
|
|
129
|
+
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded when the content was last stored as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The response\'s `ETag` identifies this version of the content: send it back as `If-Match` when replacing the content, so that a change made by someone else in the meantime is not overwritten. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
|
|
130
130
|
* Download an account file
|
|
131
131
|
*/
|
|
132
132
|
getAccountFilesContentRaw(requestParameters, initOverrides) {
|
|
@@ -160,7 +160,7 @@ class FilesApi extends runtime.BaseAPI {
|
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
/**
|
|
163
|
-
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded
|
|
163
|
+
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded when the content was last stored as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The response\'s `ETag` identifies this version of the content: send it back as `If-Match` when replacing the content, so that a change made by someone else in the meantime is not overwritten. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
|
|
164
164
|
* Download an account file
|
|
165
165
|
*/
|
|
166
166
|
getAccountFilesContent(requestParameters, initOverrides) {
|
|
@@ -254,5 +254,72 @@ class FilesApi extends runtime.BaseAPI {
|
|
|
254
254
|
return yield response.value();
|
|
255
255
|
});
|
|
256
256
|
}
|
|
257
|
+
/**
|
|
258
|
+
* Replaces the stored bytes of a file held against the account and returns the updated record, with the new version of the content as the `ETag`. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name is ignored: the file keeps its name and identifier, so anything already referencing it keeps working. `mimeType` is detected again from the new contents. Maximum file size is 25 MiB, and the content is rejected if a virus scan fails. Send the `ETag` returned when the content was read as `If-Match`. If the file has been replaced since then, the request is rejected with 412 and nothing changes; read the content again before deciding what to save. A missing `If-Match` is rejected with 422, and `*` with 400. The difference in size counts towards the account\'s 1 GiB storage quota, and content that would take the account past it is rejected with 413. A 409 means concurrent changes to the account\'s files kept changing its usage while the content was being replaced. The new content may already be stored, so read the content and its `ETag` again before deciding what to save: retrying with the same `If-Match` is rejected with 412 if it was. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. A quarantined file cannot be replaced (403). Requires the *Edit file storage* permission.
|
|
259
|
+
* Replace an account file\'s content
|
|
260
|
+
*/
|
|
261
|
+
updateAccountFilesContentRaw(requestParameters, initOverrides) {
|
|
262
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
263
|
+
if (requestParameters['id'] == null) {
|
|
264
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling updateAccountFilesContent().');
|
|
265
|
+
}
|
|
266
|
+
if (requestParameters['ifMatch'] == null) {
|
|
267
|
+
throw new runtime.RequiredError('ifMatch', 'Required parameter "ifMatch" was null or undefined when calling updateAccountFilesContent().');
|
|
268
|
+
}
|
|
269
|
+
const queryParameters = {};
|
|
270
|
+
const headerParameters = {};
|
|
271
|
+
if (requestParameters['ifMatch'] != null) {
|
|
272
|
+
headerParameters['If-Match'] = String(requestParameters['ifMatch']);
|
|
273
|
+
}
|
|
274
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
275
|
+
const token = this.configuration.accessToken;
|
|
276
|
+
const tokenString = yield token("accessToken", []);
|
|
277
|
+
if (tokenString) {
|
|
278
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
const consumes = [
|
|
282
|
+
{ contentType: 'multipart/form-data' },
|
|
283
|
+
];
|
|
284
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
285
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
286
|
+
let formParams;
|
|
287
|
+
let useForm = false;
|
|
288
|
+
// use FormData to transmit files using content-type "multipart/form-data"
|
|
289
|
+
useForm = canConsumeForm;
|
|
290
|
+
if (useForm) {
|
|
291
|
+
formParams = new FormData();
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
formParams = new URLSearchParams();
|
|
295
|
+
}
|
|
296
|
+
if (requestParameters['filename'] != null) {
|
|
297
|
+
formParams.append('filename', requestParameters['filename']);
|
|
298
|
+
}
|
|
299
|
+
if (requestParameters['name'] != null) {
|
|
300
|
+
formParams.append('name', requestParameters['name']);
|
|
301
|
+
}
|
|
302
|
+
let urlPath = `/v1/account/files/{id}/content`;
|
|
303
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
304
|
+
const response = yield this.request({
|
|
305
|
+
path: urlPath,
|
|
306
|
+
method: 'PUT',
|
|
307
|
+
headers: headerParameters,
|
|
308
|
+
query: queryParameters,
|
|
309
|
+
body: formParams,
|
|
310
|
+
}, initOverrides);
|
|
311
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ModelRecordFromJSON)(jsonValue));
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Replaces the stored bytes of a file held against the account and returns the updated record, with the new version of the content as the `ETag`. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name is ignored: the file keeps its name and identifier, so anything already referencing it keeps working. `mimeType` is detected again from the new contents. Maximum file size is 25 MiB, and the content is rejected if a virus scan fails. Send the `ETag` returned when the content was read as `If-Match`. If the file has been replaced since then, the request is rejected with 412 and nothing changes; read the content again before deciding what to save. A missing `If-Match` is rejected with 422, and `*` with 400. The difference in size counts towards the account\'s 1 GiB storage quota, and content that would take the account past it is rejected with 413. A 409 means concurrent changes to the account\'s files kept changing its usage while the content was being replaced. The new content may already be stored, so read the content and its `ETag` again before deciding what to save: retrying with the same `If-Match` is rejected with 412 if it was. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. A quarantined file cannot be replaced (403). Requires the *Edit file storage* permission.
|
|
316
|
+
* Replace an account file\'s content
|
|
317
|
+
*/
|
|
318
|
+
updateAccountFilesContent(requestParameters, initOverrides) {
|
|
319
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
320
|
+
const response = yield this.updateAccountFilesContentRaw(requestParameters, initOverrides);
|
|
321
|
+
return yield response.value();
|
|
322
|
+
});
|
|
323
|
+
}
|
|
257
324
|
}
|
|
258
325
|
exports.FilesApi = FilesApi;
|
|
@@ -65,7 +65,7 @@ export interface DataCollectionApiInterface {
|
|
|
65
65
|
*/
|
|
66
66
|
delete(requestParameters: DataCollectionApiDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object>;
|
|
67
67
|
/**
|
|
68
|
-
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts.
|
|
68
|
+
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts. `contributorCount` is the number of uploaded contributors for callers with *View crowd modelling* or *Configure crowd modelling*, and 0 otherwise.
|
|
69
69
|
* @summary Get a data collection survey
|
|
70
70
|
* @param {string} id
|
|
71
71
|
* @param {*} [options] Override http request option.
|
|
@@ -74,7 +74,7 @@ export interface DataCollectionApiInterface {
|
|
|
74
74
|
*/
|
|
75
75
|
getRaw(requestParameters: DataCollectionApiGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetDatacollectionRes>>;
|
|
76
76
|
/**
|
|
77
|
-
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts.
|
|
77
|
+
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts. `contributorCount` is the number of uploaded contributors for callers with *View crowd modelling* or *Configure crowd modelling*, and 0 otherwise.
|
|
78
78
|
* Get a data collection survey
|
|
79
79
|
*/
|
|
80
80
|
get(requestParameters: DataCollectionApiGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetDatacollectionRes>;
|
|
@@ -174,12 +174,12 @@ export declare class DataCollectionApi extends runtime.BaseAPI implements DataCo
|
|
|
174
174
|
*/
|
|
175
175
|
delete(requestParameters: DataCollectionApiDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object>;
|
|
176
176
|
/**
|
|
177
|
-
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts.
|
|
177
|
+
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts. `contributorCount` is the number of uploaded contributors for callers with *View crowd modelling* or *Configure crowd modelling*, and 0 otherwise.
|
|
178
178
|
* Get a data collection survey
|
|
179
179
|
*/
|
|
180
180
|
getRaw(requestParameters: DataCollectionApiGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetDatacollectionRes>>;
|
|
181
181
|
/**
|
|
182
|
-
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts.
|
|
182
|
+
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts. `contributorCount` is the number of uploaded contributors for callers with *View crowd modelling* or *Configure crowd modelling*, and 0 otherwise.
|
|
183
183
|
* Get a data collection survey
|
|
184
184
|
*/
|
|
185
185
|
get(requestParameters: DataCollectionApiGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetDatacollectionRes>;
|
|
@@ -101,7 +101,7 @@ export class DataCollectionApi extends runtime.BaseAPI {
|
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
|
-
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts.
|
|
104
|
+
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts. `contributorCount` is the number of uploaded contributors for callers with *View crowd modelling* or *Configure crowd modelling*, and 0 otherwise.
|
|
105
105
|
* Get a data collection survey
|
|
106
106
|
*/
|
|
107
107
|
getRaw(requestParameters, initOverrides) {
|
|
@@ -130,7 +130,7 @@ export class DataCollectionApi extends runtime.BaseAPI {
|
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
133
|
-
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts.
|
|
133
|
+
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts. `contributorCount` is the number of uploaded contributors for callers with *View crowd modelling* or *Configure crowd modelling*, and 0 otherwise.
|
|
134
134
|
* Get a data collection survey
|
|
135
135
|
*/
|
|
136
136
|
get(requestParameters, initOverrides) {
|
|
@@ -29,6 +29,12 @@ export interface FilesApiUpdateAccountFilesRequest {
|
|
|
29
29
|
id: string;
|
|
30
30
|
accountFilePatchBody: AccountFilePatchBody;
|
|
31
31
|
}
|
|
32
|
+
export interface FilesApiUpdateAccountFilesContentRequest {
|
|
33
|
+
id: string;
|
|
34
|
+
ifMatch: string;
|
|
35
|
+
filename?: Blob;
|
|
36
|
+
name?: string;
|
|
37
|
+
}
|
|
32
38
|
/**
|
|
33
39
|
* FilesApi - interface
|
|
34
40
|
*
|
|
@@ -66,7 +72,7 @@ export interface FilesApiInterface {
|
|
|
66
72
|
*/
|
|
67
73
|
deleteAccountFiles(requestParameters: FilesApiDeleteAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object>;
|
|
68
74
|
/**
|
|
69
|
-
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded
|
|
75
|
+
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded when the content was last stored as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The response\'s `ETag` identifies this version of the content: send it back as `If-Match` when replacing the content, so that a change made by someone else in the meantime is not overwritten. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
|
|
70
76
|
* @summary Download an account file
|
|
71
77
|
* @param {string} id
|
|
72
78
|
* @param {*} [options] Override http request option.
|
|
@@ -75,7 +81,7 @@ export interface FilesApiInterface {
|
|
|
75
81
|
*/
|
|
76
82
|
getAccountFilesContentRaw(requestParameters: FilesApiGetAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
|
|
77
83
|
/**
|
|
78
|
-
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded
|
|
84
|
+
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded when the content was last stored as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The response\'s `ETag` identifies this version of the content: send it back as `If-Match` when replacing the content, so that a change made by someone else in the meantime is not overwritten. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
|
|
79
85
|
* Download an account file
|
|
80
86
|
*/
|
|
81
87
|
getAccountFilesContent(requestParameters: FilesApiGetAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
|
|
@@ -109,6 +115,23 @@ export interface FilesApiInterface {
|
|
|
109
115
|
* Rename an account file
|
|
110
116
|
*/
|
|
111
117
|
updateAccountFiles(requestParameters: FilesApiUpdateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord>;
|
|
118
|
+
/**
|
|
119
|
+
* Replaces the stored bytes of a file held against the account and returns the updated record, with the new version of the content as the `ETag`. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name is ignored: the file keeps its name and identifier, so anything already referencing it keeps working. `mimeType` is detected again from the new contents. Maximum file size is 25 MiB, and the content is rejected if a virus scan fails. Send the `ETag` returned when the content was read as `If-Match`. If the file has been replaced since then, the request is rejected with 412 and nothing changes; read the content again before deciding what to save. A missing `If-Match` is rejected with 422, and `*` with 400. The difference in size counts towards the account\'s 1 GiB storage quota, and content that would take the account past it is rejected with 413. A 409 means concurrent changes to the account\'s files kept changing its usage while the content was being replaced. The new content may already be stored, so read the content and its `ETag` again before deciding what to save: retrying with the same `If-Match` is rejected with 412 if it was. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. A quarantined file cannot be replaced (403). Requires the *Edit file storage* permission.
|
|
120
|
+
* @summary Replace an account file\'s content
|
|
121
|
+
* @param {string} id
|
|
122
|
+
* @param {string} ifMatch The ETag returned when the file\'s content was read. The content is replaced only if it has not changed since.
|
|
123
|
+
* @param {Blob} [filename] filename of the file being uploaded
|
|
124
|
+
* @param {string} [name] general purpose name for multipart form value
|
|
125
|
+
* @param {*} [options] Override http request option.
|
|
126
|
+
* @throws {RequiredError}
|
|
127
|
+
* @memberof FilesApiInterface
|
|
128
|
+
*/
|
|
129
|
+
updateAccountFilesContentRaw(requestParameters: FilesApiUpdateAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelRecord>>;
|
|
130
|
+
/**
|
|
131
|
+
* Replaces the stored bytes of a file held against the account and returns the updated record, with the new version of the content as the `ETag`. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name is ignored: the file keeps its name and identifier, so anything already referencing it keeps working. `mimeType` is detected again from the new contents. Maximum file size is 25 MiB, and the content is rejected if a virus scan fails. Send the `ETag` returned when the content was read as `If-Match`. If the file has been replaced since then, the request is rejected with 412 and nothing changes; read the content again before deciding what to save. A missing `If-Match` is rejected with 422, and `*` with 400. The difference in size counts towards the account\'s 1 GiB storage quota, and content that would take the account past it is rejected with 413. A 409 means concurrent changes to the account\'s files kept changing its usage while the content was being replaced. The new content may already be stored, so read the content and its `ETag` again before deciding what to save: retrying with the same `If-Match` is rejected with 412 if it was. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. A quarantined file cannot be replaced (403). Requires the *Edit file storage* permission.
|
|
132
|
+
* Replace an account file\'s content
|
|
133
|
+
*/
|
|
134
|
+
updateAccountFilesContent(requestParameters: FilesApiUpdateAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord>;
|
|
112
135
|
}
|
|
113
136
|
/**
|
|
114
137
|
*
|
|
@@ -135,12 +158,12 @@ export declare class FilesApi extends runtime.BaseAPI implements FilesApiInterfa
|
|
|
135
158
|
*/
|
|
136
159
|
deleteAccountFiles(requestParameters: FilesApiDeleteAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object>;
|
|
137
160
|
/**
|
|
138
|
-
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded
|
|
161
|
+
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded when the content was last stored as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The response\'s `ETag` identifies this version of the content: send it back as `If-Match` when replacing the content, so that a change made by someone else in the meantime is not overwritten. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
|
|
139
162
|
* Download an account file
|
|
140
163
|
*/
|
|
141
164
|
getAccountFilesContentRaw(requestParameters: FilesApiGetAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
|
|
142
165
|
/**
|
|
143
|
-
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded
|
|
166
|
+
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded when the content was last stored as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The response\'s `ETag` identifies this version of the content: send it back as `If-Match` when replacing the content, so that a change made by someone else in the meantime is not overwritten. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
|
|
144
167
|
* Download an account file
|
|
145
168
|
*/
|
|
146
169
|
getAccountFilesContent(requestParameters: FilesApiGetAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
|
|
@@ -164,4 +187,14 @@ export declare class FilesApi extends runtime.BaseAPI implements FilesApiInterfa
|
|
|
164
187
|
* Rename an account file
|
|
165
188
|
*/
|
|
166
189
|
updateAccountFiles(requestParameters: FilesApiUpdateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord>;
|
|
190
|
+
/**
|
|
191
|
+
* Replaces the stored bytes of a file held against the account and returns the updated record, with the new version of the content as the `ETag`. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name is ignored: the file keeps its name and identifier, so anything already referencing it keeps working. `mimeType` is detected again from the new contents. Maximum file size is 25 MiB, and the content is rejected if a virus scan fails. Send the `ETag` returned when the content was read as `If-Match`. If the file has been replaced since then, the request is rejected with 412 and nothing changes; read the content again before deciding what to save. A missing `If-Match` is rejected with 422, and `*` with 400. The difference in size counts towards the account\'s 1 GiB storage quota, and content that would take the account past it is rejected with 413. A 409 means concurrent changes to the account\'s files kept changing its usage while the content was being replaced. The new content may already be stored, so read the content and its `ETag` again before deciding what to save: retrying with the same `If-Match` is rejected with 412 if it was. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. A quarantined file cannot be replaced (403). Requires the *Edit file storage* permission.
|
|
192
|
+
* Replace an account file\'s content
|
|
193
|
+
*/
|
|
194
|
+
updateAccountFilesContentRaw(requestParameters: FilesApiUpdateAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelRecord>>;
|
|
195
|
+
/**
|
|
196
|
+
* Replaces the stored bytes of a file held against the account and returns the updated record, with the new version of the content as the `ETag`. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name is ignored: the file keeps its name and identifier, so anything already referencing it keeps working. `mimeType` is detected again from the new contents. Maximum file size is 25 MiB, and the content is rejected if a virus scan fails. Send the `ETag` returned when the content was read as `If-Match`. If the file has been replaced since then, the request is rejected with 412 and nothing changes; read the content again before deciding what to save. A missing `If-Match` is rejected with 422, and `*` with 400. The difference in size counts towards the account\'s 1 GiB storage quota, and content that would take the account past it is rejected with 413. A 409 means concurrent changes to the account\'s files kept changing its usage while the content was being replaced. The new content may already be stored, so read the content and its `ETag` again before deciding what to save: retrying with the same `If-Match` is rejected with 412 if it was. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. A quarantined file cannot be replaced (403). Requires the *Edit file storage* permission.
|
|
197
|
+
* Replace an account file\'s content
|
|
198
|
+
*/
|
|
199
|
+
updateAccountFilesContent(requestParameters: FilesApiUpdateAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord>;
|
|
167
200
|
}
|
|
@@ -123,7 +123,7 @@ export class FilesApi extends runtime.BaseAPI {
|
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
125
|
/**
|
|
126
|
-
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded
|
|
126
|
+
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded when the content was last stored as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The response\'s `ETag` identifies this version of the content: send it back as `If-Match` when replacing the content, so that a change made by someone else in the meantime is not overwritten. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
|
|
127
127
|
* Download an account file
|
|
128
128
|
*/
|
|
129
129
|
getAccountFilesContentRaw(requestParameters, initOverrides) {
|
|
@@ -157,7 +157,7 @@ export class FilesApi extends runtime.BaseAPI {
|
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
/**
|
|
160
|
-
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded
|
|
160
|
+
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded when the content was last stored as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The response\'s `ETag` identifies this version of the content: send it back as `If-Match` when replacing the content, so that a change made by someone else in the meantime is not overwritten. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
|
|
161
161
|
* Download an account file
|
|
162
162
|
*/
|
|
163
163
|
getAccountFilesContent(requestParameters, initOverrides) {
|
|
@@ -251,4 +251,71 @@ export class FilesApi extends runtime.BaseAPI {
|
|
|
251
251
|
return yield response.value();
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
|
+
/**
|
|
255
|
+
* Replaces the stored bytes of a file held against the account and returns the updated record, with the new version of the content as the `ETag`. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name is ignored: the file keeps its name and identifier, so anything already referencing it keeps working. `mimeType` is detected again from the new contents. Maximum file size is 25 MiB, and the content is rejected if a virus scan fails. Send the `ETag` returned when the content was read as `If-Match`. If the file has been replaced since then, the request is rejected with 412 and nothing changes; read the content again before deciding what to save. A missing `If-Match` is rejected with 422, and `*` with 400. The difference in size counts towards the account\'s 1 GiB storage quota, and content that would take the account past it is rejected with 413. A 409 means concurrent changes to the account\'s files kept changing its usage while the content was being replaced. The new content may already be stored, so read the content and its `ETag` again before deciding what to save: retrying with the same `If-Match` is rejected with 412 if it was. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. A quarantined file cannot be replaced (403). Requires the *Edit file storage* permission.
|
|
256
|
+
* Replace an account file\'s content
|
|
257
|
+
*/
|
|
258
|
+
updateAccountFilesContentRaw(requestParameters, initOverrides) {
|
|
259
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
260
|
+
if (requestParameters['id'] == null) {
|
|
261
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling updateAccountFilesContent().');
|
|
262
|
+
}
|
|
263
|
+
if (requestParameters['ifMatch'] == null) {
|
|
264
|
+
throw new runtime.RequiredError('ifMatch', 'Required parameter "ifMatch" was null or undefined when calling updateAccountFilesContent().');
|
|
265
|
+
}
|
|
266
|
+
const queryParameters = {};
|
|
267
|
+
const headerParameters = {};
|
|
268
|
+
if (requestParameters['ifMatch'] != null) {
|
|
269
|
+
headerParameters['If-Match'] = String(requestParameters['ifMatch']);
|
|
270
|
+
}
|
|
271
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
272
|
+
const token = this.configuration.accessToken;
|
|
273
|
+
const tokenString = yield token("accessToken", []);
|
|
274
|
+
if (tokenString) {
|
|
275
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
const consumes = [
|
|
279
|
+
{ contentType: 'multipart/form-data' },
|
|
280
|
+
];
|
|
281
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
282
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
283
|
+
let formParams;
|
|
284
|
+
let useForm = false;
|
|
285
|
+
// use FormData to transmit files using content-type "multipart/form-data"
|
|
286
|
+
useForm = canConsumeForm;
|
|
287
|
+
if (useForm) {
|
|
288
|
+
formParams = new FormData();
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
formParams = new URLSearchParams();
|
|
292
|
+
}
|
|
293
|
+
if (requestParameters['filename'] != null) {
|
|
294
|
+
formParams.append('filename', requestParameters['filename']);
|
|
295
|
+
}
|
|
296
|
+
if (requestParameters['name'] != null) {
|
|
297
|
+
formParams.append('name', requestParameters['name']);
|
|
298
|
+
}
|
|
299
|
+
let urlPath = `/v1/account/files/{id}/content`;
|
|
300
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
301
|
+
const response = yield this.request({
|
|
302
|
+
path: urlPath,
|
|
303
|
+
method: 'PUT',
|
|
304
|
+
headers: headerParameters,
|
|
305
|
+
query: queryParameters,
|
|
306
|
+
body: formParams,
|
|
307
|
+
}, initOverrides);
|
|
308
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ModelRecordFromJSON(jsonValue));
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Replaces the stored bytes of a file held against the account and returns the updated record, with the new version of the content as the `ETag`. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name is ignored: the file keeps its name and identifier, so anything already referencing it keeps working. `mimeType` is detected again from the new contents. Maximum file size is 25 MiB, and the content is rejected if a virus scan fails. Send the `ETag` returned when the content was read as `If-Match`. If the file has been replaced since then, the request is rejected with 412 and nothing changes; read the content again before deciding what to save. A missing `If-Match` is rejected with 422, and `*` with 400. The difference in size counts towards the account\'s 1 GiB storage quota, and content that would take the account past it is rejected with 413. A 409 means concurrent changes to the account\'s files kept changing its usage while the content was being replaced. The new content may already be stored, so read the content and its `ETag` again before deciding what to save: retrying with the same `If-Match` is rejected with 412 if it was. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. A quarantined file cannot be replaced (403). Requires the *Edit file storage* permission.
|
|
313
|
+
* Replace an account file\'s content
|
|
314
|
+
*/
|
|
315
|
+
updateAccountFilesContent(requestParameters, initOverrides) {
|
|
316
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
317
|
+
const response = yield this.updateAccountFilesContentRaw(requestParameters, initOverrides);
|
|
318
|
+
return yield response.value();
|
|
319
|
+
});
|
|
320
|
+
}
|
|
254
321
|
}
|
|
@@ -24,22 +24,22 @@ export interface GetDatacollectionRes {
|
|
|
24
24
|
completed: number;
|
|
25
25
|
/**
|
|
26
26
|
*
|
|
27
|
-
* @type {
|
|
27
|
+
* @type {number}
|
|
28
28
|
* @memberof GetDatacollectionRes
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
contributorCount: number;
|
|
31
31
|
/**
|
|
32
32
|
*
|
|
33
|
-
* @type {
|
|
33
|
+
* @type {DatacollectionChangelogBody}
|
|
34
34
|
* @memberof GetDatacollectionRes
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
datacollection: DatacollectionChangelogBody;
|
|
37
37
|
/**
|
|
38
38
|
*
|
|
39
|
-
* @type {
|
|
39
|
+
* @type {string}
|
|
40
40
|
* @memberof GetDatacollectionRes
|
|
41
41
|
*/
|
|
42
|
-
|
|
42
|
+
id: string;
|
|
43
43
|
/**
|
|
44
44
|
*
|
|
45
45
|
* @type {number}
|
|
@@ -18,6 +18,8 @@ import { DatacollectionChangelogBodyFromJSON, DatacollectionChangelogBodyToJSON,
|
|
|
18
18
|
export function instanceOfGetDatacollectionRes(value) {
|
|
19
19
|
if (!('completed' in value) || value['completed'] === undefined)
|
|
20
20
|
return false;
|
|
21
|
+
if (!('contributorCount' in value) || value['contributorCount'] === undefined)
|
|
22
|
+
return false;
|
|
21
23
|
if (!('datacollection' in value) || value['datacollection'] === undefined)
|
|
22
24
|
return false;
|
|
23
25
|
if (!('id' in value) || value['id'] === undefined)
|
|
@@ -37,9 +39,9 @@ export function GetDatacollectionResFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
37
39
|
}
|
|
38
40
|
return {
|
|
39
41
|
'completed': json['completed'],
|
|
42
|
+
'contributorCount': json['contributorCount'],
|
|
40
43
|
'datacollection': DatacollectionChangelogBodyFromJSON(json['datacollection']),
|
|
41
44
|
'id': json['id'],
|
|
42
|
-
'legacyContributors': json['legacyContributors'] == null ? undefined : json['legacyContributors'],
|
|
43
45
|
'started': json['started'],
|
|
44
46
|
'total': json['total'],
|
|
45
47
|
};
|
|
@@ -53,9 +55,9 @@ export function GetDatacollectionResToJSONTyped(value, ignoreDiscriminator = fal
|
|
|
53
55
|
}
|
|
54
56
|
return {
|
|
55
57
|
'completed': value['completed'],
|
|
58
|
+
'contributorCount': value['contributorCount'],
|
|
56
59
|
'datacollection': DatacollectionChangelogBodyToJSON(value['datacollection']),
|
|
57
60
|
'id': value['id'],
|
|
58
|
-
'legacyContributors': value['legacyContributors'],
|
|
59
61
|
'started': value['started'],
|
|
60
62
|
'total': value['total'],
|
|
61
63
|
};
|
|
@@ -28,7 +28,7 @@ export interface ModelRecord {
|
|
|
28
28
|
*/
|
|
29
29
|
id: string;
|
|
30
30
|
/**
|
|
31
|
-
* Media type detected from the file's contents
|
|
31
|
+
* Media type detected from the file's contents when they were last stored, rather than from its name or the type the client declared.
|
|
32
32
|
* @type {string}
|
|
33
33
|
* @memberof ModelRecord
|
|
34
34
|
*/
|
|
@@ -24,22 +24,22 @@ export interface GetDatacollectionRes {
|
|
|
24
24
|
completed: number;
|
|
25
25
|
/**
|
|
26
26
|
*
|
|
27
|
-
* @type {
|
|
27
|
+
* @type {number}
|
|
28
28
|
* @memberof GetDatacollectionRes
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
contributorCount: number;
|
|
31
31
|
/**
|
|
32
32
|
*
|
|
33
|
-
* @type {
|
|
33
|
+
* @type {DatacollectionChangelogBody}
|
|
34
34
|
* @memberof GetDatacollectionRes
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
datacollection: DatacollectionChangelogBody;
|
|
37
37
|
/**
|
|
38
38
|
*
|
|
39
|
-
* @type {
|
|
39
|
+
* @type {string}
|
|
40
40
|
* @memberof GetDatacollectionRes
|
|
41
41
|
*/
|
|
42
|
-
|
|
42
|
+
id: string;
|
|
43
43
|
/**
|
|
44
44
|
*
|
|
45
45
|
* @type {number}
|
|
@@ -25,6 +25,8 @@ const DatacollectionChangelogBody_1 = require("./DatacollectionChangelogBody");
|
|
|
25
25
|
function instanceOfGetDatacollectionRes(value) {
|
|
26
26
|
if (!('completed' in value) || value['completed'] === undefined)
|
|
27
27
|
return false;
|
|
28
|
+
if (!('contributorCount' in value) || value['contributorCount'] === undefined)
|
|
29
|
+
return false;
|
|
28
30
|
if (!('datacollection' in value) || value['datacollection'] === undefined)
|
|
29
31
|
return false;
|
|
30
32
|
if (!('id' in value) || value['id'] === undefined)
|
|
@@ -44,9 +46,9 @@ function GetDatacollectionResFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
44
46
|
}
|
|
45
47
|
return {
|
|
46
48
|
'completed': json['completed'],
|
|
49
|
+
'contributorCount': json['contributorCount'],
|
|
47
50
|
'datacollection': (0, DatacollectionChangelogBody_1.DatacollectionChangelogBodyFromJSON)(json['datacollection']),
|
|
48
51
|
'id': json['id'],
|
|
49
|
-
'legacyContributors': json['legacyContributors'] == null ? undefined : json['legacyContributors'],
|
|
50
52
|
'started': json['started'],
|
|
51
53
|
'total': json['total'],
|
|
52
54
|
};
|
|
@@ -60,9 +62,9 @@ function GetDatacollectionResToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
60
62
|
}
|
|
61
63
|
return {
|
|
62
64
|
'completed': value['completed'],
|
|
65
|
+
'contributorCount': value['contributorCount'],
|
|
63
66
|
'datacollection': (0, DatacollectionChangelogBody_1.DatacollectionChangelogBodyToJSON)(value['datacollection']),
|
|
64
67
|
'id': value['id'],
|
|
65
|
-
'legacyContributors': value['legacyContributors'],
|
|
66
68
|
'started': value['started'],
|
|
67
69
|
'total': value['total'],
|
|
68
70
|
};
|
|
@@ -28,7 +28,7 @@ export interface ModelRecord {
|
|
|
28
28
|
*/
|
|
29
29
|
id: string;
|
|
30
30
|
/**
|
|
31
|
-
* Media type detected from the file's contents
|
|
31
|
+
* Media type detected from the file's contents when they were last stored, rather than from its name or the type the client declared.
|
|
32
32
|
* @type {string}
|
|
33
33
|
* @memberof ModelRecord
|
|
34
34
|
*/
|
package/package.json
CHANGED
|
@@ -101,7 +101,7 @@ export interface DataCollectionApiInterface {
|
|
|
101
101
|
delete(requestParameters: DataCollectionApiDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object>;
|
|
102
102
|
|
|
103
103
|
/**
|
|
104
|
-
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts.
|
|
104
|
+
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts. `contributorCount` is the number of uploaded contributors for callers with *View crowd modelling* or *Configure crowd modelling*, and 0 otherwise.
|
|
105
105
|
* @summary Get a data collection survey
|
|
106
106
|
* @param {string} id
|
|
107
107
|
* @param {*} [options] Override http request option.
|
|
@@ -111,7 +111,7 @@ export interface DataCollectionApiInterface {
|
|
|
111
111
|
getRaw(requestParameters: DataCollectionApiGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetDatacollectionRes>>;
|
|
112
112
|
|
|
113
113
|
/**
|
|
114
|
-
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts.
|
|
114
|
+
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts. `contributorCount` is the number of uploaded contributors for callers with *View crowd modelling* or *Configure crowd modelling*, and 0 otherwise.
|
|
115
115
|
* Get a data collection survey
|
|
116
116
|
*/
|
|
117
117
|
get(requestParameters: DataCollectionApiGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetDatacollectionRes>;
|
|
@@ -290,7 +290,7 @@ export class DataCollectionApi extends runtime.BaseAPI implements DataCollection
|
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
/**
|
|
293
|
-
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts.
|
|
293
|
+
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts. `contributorCount` is the number of uploaded contributors for callers with *View crowd modelling* or *Configure crowd modelling*, and 0 otherwise.
|
|
294
294
|
* Get a data collection survey
|
|
295
295
|
*/
|
|
296
296
|
async getRaw(requestParameters: DataCollectionApiGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetDatacollectionRes>> {
|
|
@@ -328,7 +328,7 @@ export class DataCollectionApi extends runtime.BaseAPI implements DataCollection
|
|
|
328
328
|
}
|
|
329
329
|
|
|
330
330
|
/**
|
|
331
|
-
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts.
|
|
331
|
+
* Returns the survey and a summary of contribution progress: how many contributors have started, completed, and the total invited. Requires the *View crowd modelling*, *View data collection preview* or *View public data collection* permission; drafts need one of the first two. Callers without *View crowd modelling* receive the survey without its `contributors` list or progress counts. `contributorCount` is the number of uploaded contributors for callers with *View crowd modelling* or *Configure crowd modelling*, and 0 otherwise.
|
|
332
332
|
* Get a data collection survey
|
|
333
333
|
*/
|
|
334
334
|
async get(requestParameters: DataCollectionApiGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetDatacollectionRes> {
|
package/src/apis/FilesApi.ts
CHANGED
|
@@ -54,6 +54,13 @@ export interface FilesApiUpdateAccountFilesRequest {
|
|
|
54
54
|
accountFilePatchBody: AccountFilePatchBody;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
export interface FilesApiUpdateAccountFilesContentRequest {
|
|
58
|
+
id: string;
|
|
59
|
+
ifMatch: string;
|
|
60
|
+
filename?: Blob;
|
|
61
|
+
name?: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
57
64
|
/**
|
|
58
65
|
* FilesApi - interface
|
|
59
66
|
*
|
|
@@ -95,7 +102,7 @@ export interface FilesApiInterface {
|
|
|
95
102
|
deleteAccountFiles(requestParameters: FilesApiDeleteAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object>;
|
|
96
103
|
|
|
97
104
|
/**
|
|
98
|
-
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded
|
|
105
|
+
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded when the content was last stored as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The response\'s `ETag` identifies this version of the content: send it back as `If-Match` when replacing the content, so that a change made by someone else in the meantime is not overwritten. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
|
|
99
106
|
* @summary Download an account file
|
|
100
107
|
* @param {string} id
|
|
101
108
|
* @param {*} [options] Override http request option.
|
|
@@ -105,7 +112,7 @@ export interface FilesApiInterface {
|
|
|
105
112
|
getAccountFilesContentRaw(requestParameters: FilesApiGetAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
|
|
106
113
|
|
|
107
114
|
/**
|
|
108
|
-
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded
|
|
115
|
+
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded when the content was last stored as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The response\'s `ETag` identifies this version of the content: send it back as `If-Match` when replacing the content, so that a change made by someone else in the meantime is not overwritten. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
|
|
109
116
|
* Download an account file
|
|
110
117
|
*/
|
|
111
118
|
getAccountFilesContent(requestParameters: FilesApiGetAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
|
|
@@ -144,6 +151,25 @@ export interface FilesApiInterface {
|
|
|
144
151
|
*/
|
|
145
152
|
updateAccountFiles(requestParameters: FilesApiUpdateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord>;
|
|
146
153
|
|
|
154
|
+
/**
|
|
155
|
+
* Replaces the stored bytes of a file held against the account and returns the updated record, with the new version of the content as the `ETag`. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name is ignored: the file keeps its name and identifier, so anything already referencing it keeps working. `mimeType` is detected again from the new contents. Maximum file size is 25 MiB, and the content is rejected if a virus scan fails. Send the `ETag` returned when the content was read as `If-Match`. If the file has been replaced since then, the request is rejected with 412 and nothing changes; read the content again before deciding what to save. A missing `If-Match` is rejected with 422, and `*` with 400. The difference in size counts towards the account\'s 1 GiB storage quota, and content that would take the account past it is rejected with 413. A 409 means concurrent changes to the account\'s files kept changing its usage while the content was being replaced. The new content may already be stored, so read the content and its `ETag` again before deciding what to save: retrying with the same `If-Match` is rejected with 412 if it was. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. A quarantined file cannot be replaced (403). Requires the *Edit file storage* permission.
|
|
156
|
+
* @summary Replace an account file\'s content
|
|
157
|
+
* @param {string} id
|
|
158
|
+
* @param {string} ifMatch The ETag returned when the file\'s content was read. The content is replaced only if it has not changed since.
|
|
159
|
+
* @param {Blob} [filename] filename of the file being uploaded
|
|
160
|
+
* @param {string} [name] general purpose name for multipart form value
|
|
161
|
+
* @param {*} [options] Override http request option.
|
|
162
|
+
* @throws {RequiredError}
|
|
163
|
+
* @memberof FilesApiInterface
|
|
164
|
+
*/
|
|
165
|
+
updateAccountFilesContentRaw(requestParameters: FilesApiUpdateAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelRecord>>;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Replaces the stored bytes of a file held against the account and returns the updated record, with the new version of the content as the `ETag`. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name is ignored: the file keeps its name and identifier, so anything already referencing it keeps working. `mimeType` is detected again from the new contents. Maximum file size is 25 MiB, and the content is rejected if a virus scan fails. Send the `ETag` returned when the content was read as `If-Match`. If the file has been replaced since then, the request is rejected with 412 and nothing changes; read the content again before deciding what to save. A missing `If-Match` is rejected with 422, and `*` with 400. The difference in size counts towards the account\'s 1 GiB storage quota, and content that would take the account past it is rejected with 413. A 409 means concurrent changes to the account\'s files kept changing its usage while the content was being replaced. The new content may already be stored, so read the content and its `ETag` again before deciding what to save: retrying with the same `If-Match` is rejected with 412 if it was. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. A quarantined file cannot be replaced (403). Requires the *Edit file storage* permission.
|
|
169
|
+
* Replace an account file\'s content
|
|
170
|
+
*/
|
|
171
|
+
updateAccountFilesContent(requestParameters: FilesApiUpdateAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord>;
|
|
172
|
+
|
|
147
173
|
}
|
|
148
174
|
|
|
149
175
|
/**
|
|
@@ -263,7 +289,7 @@ export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
|
|
|
263
289
|
}
|
|
264
290
|
|
|
265
291
|
/**
|
|
266
|
-
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded
|
|
292
|
+
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded when the content was last stored as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The response\'s `ETag` identifies this version of the content: send it back as `If-Match` when replacing the content, so that a change made by someone else in the meantime is not overwritten. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
|
|
267
293
|
* Download an account file
|
|
268
294
|
*/
|
|
269
295
|
async getAccountFilesContentRaw(requestParameters: FilesApiGetAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
|
|
@@ -305,7 +331,7 @@ export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
|
|
|
305
331
|
}
|
|
306
332
|
|
|
307
333
|
/**
|
|
308
|
-
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded
|
|
334
|
+
* Returns the stored bytes of a file held against the account, with the `mimeType` recorded when the content was last stored as the `Content-Type`. Files belonging to other accounts are never returned. Served only from the user content host, so that a stored file is isolated from the application\'s own origin; any other host returns 404. The response always carries `Content-Disposition: attachment` and `Content-Security-Policy: default-src \'none\'`, so a file is downloaded rather than rendered even when the browser could display it. The response\'s `ETag` identifies this version of the content: send it back as `If-Match` when replacing the content, so that a change made by someone else in the meantime is not overwritten. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. Requires the *View file storage* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored file matches a virus signature; the bytes are kept for investigation.
|
|
309
335
|
* Download an account file
|
|
310
336
|
*/
|
|
311
337
|
async getAccountFilesContent(requestParameters: FilesApiGetAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
|
|
@@ -417,4 +443,87 @@ export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
|
|
|
417
443
|
return await response.value();
|
|
418
444
|
}
|
|
419
445
|
|
|
446
|
+
/**
|
|
447
|
+
* Replaces the stored bytes of a file held against the account and returns the updated record, with the new version of the content as the `ETag`. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name is ignored: the file keeps its name and identifier, so anything already referencing it keeps working. `mimeType` is detected again from the new contents. Maximum file size is 25 MiB, and the content is rejected if a virus scan fails. Send the `ETag` returned when the content was read as `If-Match`. If the file has been replaced since then, the request is rejected with 412 and nothing changes; read the content again before deciding what to save. A missing `If-Match` is rejected with 422, and `*` with 400. The difference in size counts towards the account\'s 1 GiB storage quota, and content that would take the account past it is rejected with 413. A 409 means concurrent changes to the account\'s files kept changing its usage while the content was being replaced. The new content may already be stored, so read the content and its `ETag` again before deciding what to save: retrying with the same `If-Match` is rejected with 412 if it was. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. A quarantined file cannot be replaced (403). Requires the *Edit file storage* permission.
|
|
448
|
+
* Replace an account file\'s content
|
|
449
|
+
*/
|
|
450
|
+
async updateAccountFilesContentRaw(requestParameters: FilesApiUpdateAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelRecord>> {
|
|
451
|
+
if (requestParameters['id'] == null) {
|
|
452
|
+
throw new runtime.RequiredError(
|
|
453
|
+
'id',
|
|
454
|
+
'Required parameter "id" was null or undefined when calling updateAccountFilesContent().'
|
|
455
|
+
);
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
if (requestParameters['ifMatch'] == null) {
|
|
459
|
+
throw new runtime.RequiredError(
|
|
460
|
+
'ifMatch',
|
|
461
|
+
'Required parameter "ifMatch" was null or undefined when calling updateAccountFilesContent().'
|
|
462
|
+
);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
const queryParameters: any = {};
|
|
466
|
+
|
|
467
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
468
|
+
|
|
469
|
+
if (requestParameters['ifMatch'] != null) {
|
|
470
|
+
headerParameters['If-Match'] = String(requestParameters['ifMatch']);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
474
|
+
const token = this.configuration.accessToken;
|
|
475
|
+
const tokenString = await token("accessToken", []);
|
|
476
|
+
|
|
477
|
+
if (tokenString) {
|
|
478
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
const consumes: runtime.Consume[] = [
|
|
482
|
+
{ contentType: 'multipart/form-data' },
|
|
483
|
+
];
|
|
484
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
485
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
486
|
+
|
|
487
|
+
let formParams: { append(param: string, value: any): any };
|
|
488
|
+
let useForm = false;
|
|
489
|
+
// use FormData to transmit files using content-type "multipart/form-data"
|
|
490
|
+
useForm = canConsumeForm;
|
|
491
|
+
if (useForm) {
|
|
492
|
+
formParams = new FormData();
|
|
493
|
+
} else {
|
|
494
|
+
formParams = new URLSearchParams();
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
if (requestParameters['filename'] != null) {
|
|
498
|
+
formParams.append('filename', requestParameters['filename'] as any);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
if (requestParameters['name'] != null) {
|
|
502
|
+
formParams.append('name', requestParameters['name'] as any);
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
let urlPath = `/v1/account/files/{id}/content`;
|
|
507
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
508
|
+
|
|
509
|
+
const response = await this.request({
|
|
510
|
+
path: urlPath,
|
|
511
|
+
method: 'PUT',
|
|
512
|
+
headers: headerParameters,
|
|
513
|
+
query: queryParameters,
|
|
514
|
+
body: formParams,
|
|
515
|
+
}, initOverrides);
|
|
516
|
+
|
|
517
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ModelRecordFromJSON(jsonValue));
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Replaces the stored bytes of a file held against the account and returns the updated record, with the new version of the content as the `ETag`. Send the request as `multipart/form-data` with a single file field named `file`. The uploaded file\'s name is ignored: the file keeps its name and identifier, so anything already referencing it keeps working. `mimeType` is detected again from the new contents. Maximum file size is 25 MiB, and the content is rejected if a virus scan fails. Send the `ETag` returned when the content was read as `If-Match`. If the file has been replaced since then, the request is rejected with 412 and nothing changes; read the content again before deciding what to save. A missing `If-Match` is rejected with 422, and `*` with 400. The difference in size counts towards the account\'s 1 GiB storage quota, and content that would take the account past it is rejected with 413. A 409 means concurrent changes to the account\'s files kept changing its usage while the content was being replaced. The new content may already be stored, so read the content and its `ETag` again before deciding what to save: retrying with the same `If-Match` is rejected with 412 if it was. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400 and an unknown one with 404. A quarantined file cannot be replaced (403). Requires the *Edit file storage* permission.
|
|
522
|
+
* Replace an account file\'s content
|
|
523
|
+
*/
|
|
524
|
+
async updateAccountFilesContent(requestParameters: FilesApiUpdateAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord> {
|
|
525
|
+
const response = await this.updateAccountFilesContentRaw(requestParameters, initOverrides);
|
|
526
|
+
return await response.value();
|
|
527
|
+
}
|
|
528
|
+
|
|
420
529
|
}
|
|
@@ -35,22 +35,22 @@ export interface GetDatacollectionRes {
|
|
|
35
35
|
completed: number;
|
|
36
36
|
/**
|
|
37
37
|
*
|
|
38
|
-
* @type {
|
|
38
|
+
* @type {number}
|
|
39
39
|
* @memberof GetDatacollectionRes
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
contributorCount: number;
|
|
42
42
|
/**
|
|
43
43
|
*
|
|
44
|
-
* @type {
|
|
44
|
+
* @type {DatacollectionChangelogBody}
|
|
45
45
|
* @memberof GetDatacollectionRes
|
|
46
46
|
*/
|
|
47
|
-
|
|
47
|
+
datacollection: DatacollectionChangelogBody;
|
|
48
48
|
/**
|
|
49
49
|
*
|
|
50
|
-
* @type {
|
|
50
|
+
* @type {string}
|
|
51
51
|
* @memberof GetDatacollectionRes
|
|
52
52
|
*/
|
|
53
|
-
|
|
53
|
+
id: string;
|
|
54
54
|
/**
|
|
55
55
|
*
|
|
56
56
|
* @type {number}
|
|
@@ -70,6 +70,7 @@ export interface GetDatacollectionRes {
|
|
|
70
70
|
*/
|
|
71
71
|
export function instanceOfGetDatacollectionRes(value: object): value is GetDatacollectionRes {
|
|
72
72
|
if (!('completed' in value) || value['completed'] === undefined) return false;
|
|
73
|
+
if (!('contributorCount' in value) || value['contributorCount'] === undefined) return false;
|
|
73
74
|
if (!('datacollection' in value) || value['datacollection'] === undefined) return false;
|
|
74
75
|
if (!('id' in value) || value['id'] === undefined) return false;
|
|
75
76
|
if (!('started' in value) || value['started'] === undefined) return false;
|
|
@@ -88,9 +89,9 @@ export function GetDatacollectionResFromJSONTyped(json: any, ignoreDiscriminator
|
|
|
88
89
|
return {
|
|
89
90
|
|
|
90
91
|
'completed': json['completed'],
|
|
92
|
+
'contributorCount': json['contributorCount'],
|
|
91
93
|
'datacollection': DatacollectionChangelogBodyFromJSON(json['datacollection']),
|
|
92
94
|
'id': json['id'],
|
|
93
|
-
'legacyContributors': json['legacyContributors'] == null ? undefined : json['legacyContributors'],
|
|
94
95
|
'started': json['started'],
|
|
95
96
|
'total': json['total'],
|
|
96
97
|
};
|
|
@@ -108,9 +109,9 @@ export function GetDatacollectionResToJSONTyped(value?: GetDatacollectionRes | n
|
|
|
108
109
|
return {
|
|
109
110
|
|
|
110
111
|
'completed': value['completed'],
|
|
112
|
+
'contributorCount': value['contributorCount'],
|
|
111
113
|
'datacollection': DatacollectionChangelogBodyToJSON(value['datacollection']),
|
|
112
114
|
'id': value['id'],
|
|
113
|
-
'legacyContributors': value['legacyContributors'],
|
|
114
115
|
'started': value['started'],
|
|
115
116
|
'total': value['total'],
|
|
116
117
|
};
|
|
@@ -32,7 +32,7 @@ export interface ModelRecord {
|
|
|
32
32
|
*/
|
|
33
33
|
id: string;
|
|
34
34
|
/**
|
|
35
|
-
* Media type detected from the file's contents
|
|
35
|
+
* Media type detected from the file's contents when they were last stored, rather than from its name or the type the client declared.
|
|
36
36
|
* @type {string}
|
|
37
37
|
* @memberof ModelRecord
|
|
38
38
|
*/
|