@spaciv/sdk 0.1.18 → 0.1.20
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/.openapi-generator/FILES +4 -0
- package/README.md +2 -2
- package/dist/apis/FilesApi.d.ts +132 -18
- package/dist/apis/FilesApi.js +175 -8
- package/dist/apis/FloorPlansApi.d.ts +4 -4
- package/dist/apis/FloorPlansApi.js +2 -2
- package/dist/apis/ObjectGroupsApi.d.ts +8 -8
- package/dist/apis/ObjectGroupsApi.js +4 -4
- package/dist/apis/PropertiesApi.d.ts +8 -8
- package/dist/apis/PropertiesApi.js +4 -4
- package/dist/apis/ScenariosApi.d.ts +4 -4
- package/dist/apis/ScenariosApi.js +2 -2
- package/dist/apis/SpaceRulesetsApi.d.ts +4 -4
- package/dist/apis/SpaceRulesetsApi.js +2 -2
- package/dist/esm/apis/FilesApi.d.ts +132 -18
- package/dist/esm/apis/FilesApi.js +176 -9
- package/dist/esm/apis/FloorPlansApi.d.ts +4 -4
- package/dist/esm/apis/FloorPlansApi.js +2 -2
- package/dist/esm/apis/ObjectGroupsApi.d.ts +8 -8
- package/dist/esm/apis/ObjectGroupsApi.js +4 -4
- package/dist/esm/apis/PropertiesApi.d.ts +8 -8
- package/dist/esm/apis/PropertiesApi.js +4 -4
- package/dist/esm/apis/ScenariosApi.d.ts +4 -4
- package/dist/esm/apis/ScenariosApi.js +2 -2
- package/dist/esm/apis/SpaceRulesetsApi.d.ts +4 -4
- package/dist/esm/apis/SpaceRulesetsApi.js +2 -2
- package/dist/esm/models/AccountDirectoryPatchBody.d.ts +38 -0
- package/dist/esm/models/AccountDirectoryPatchBody.js +43 -0
- package/dist/esm/models/AccountDirectoryPostBody.d.ts +38 -0
- package/dist/esm/models/AccountDirectoryPostBody.js +45 -0
- package/dist/esm/models/AccountFilePatchBody.d.ts +8 -2
- package/dist/esm/models/AccountFilePatchBody.js +3 -3
- package/dist/esm/models/Directory.d.ts +56 -0
- package/dist/esm/models/Directory.js +57 -0
- package/dist/esm/models/DirectoryPage.d.ts +39 -0
- package/dist/esm/models/DirectoryPage.js +46 -0
- package/dist/esm/models/ListPage.d.ts +7 -0
- package/dist/esm/models/ListPage.js +3 -0
- package/dist/esm/models/ModelRecord.d.ts +7 -1
- package/dist/esm/models/ModelRecord.js +2 -0
- package/dist/esm/models/index.d.ts +4 -0
- package/dist/esm/models/index.js +4 -0
- package/dist/models/AccountDirectoryPatchBody.d.ts +38 -0
- package/dist/models/AccountDirectoryPatchBody.js +50 -0
- package/dist/models/AccountDirectoryPostBody.d.ts +38 -0
- package/dist/models/AccountDirectoryPostBody.js +52 -0
- package/dist/models/AccountFilePatchBody.d.ts +8 -2
- package/dist/models/AccountFilePatchBody.js +3 -3
- package/dist/models/Directory.d.ts +56 -0
- package/dist/models/Directory.js +64 -0
- package/dist/models/DirectoryPage.d.ts +39 -0
- package/dist/models/DirectoryPage.js +53 -0
- package/dist/models/ListPage.d.ts +7 -0
- package/dist/models/ListPage.js +3 -0
- package/dist/models/ModelRecord.d.ts +7 -1
- package/dist/models/ModelRecord.js +2 -0
- package/dist/models/index.d.ts +4 -0
- package/dist/models/index.js +4 -0
- package/package.json +1 -1
- package/src/apis/FilesApi.ts +319 -17
- package/src/apis/FloorPlansApi.ts +4 -4
- package/src/apis/ObjectGroupsApi.ts +8 -8
- package/src/apis/PropertiesApi.ts +8 -8
- package/src/apis/ScenariosApi.ts +4 -4
- package/src/apis/SpaceRulesetsApi.ts +4 -4
- package/src/models/AccountDirectoryPatchBody.ts +73 -0
- package/src/models/AccountDirectoryPostBody.ts +74 -0
- package/src/models/AccountFilePatchBody.ts +11 -4
- package/src/models/Directory.ts +101 -0
- package/src/models/DirectoryPage.ts +82 -0
- package/src/models/ListPage.ts +15 -0
- package/src/models/ModelRecord.ts +9 -1
- package/src/models/index.ts +4 -0
package/.openapi-generator/FILES
CHANGED
|
@@ -40,6 +40,8 @@ src/models/AccountAuthOption.ts
|
|
|
40
40
|
src/models/AccountCalculationUsageBody.ts
|
|
41
41
|
src/models/AccountCalculationUsageDay.ts
|
|
42
42
|
src/models/AccountDetailsResBody.ts
|
|
43
|
+
src/models/AccountDirectoryPatchBody.ts
|
|
44
|
+
src/models/AccountDirectoryPostBody.ts
|
|
43
45
|
src/models/AccountFilePatchBody.ts
|
|
44
46
|
src/models/AccountGetAuthOptionsResBody.ts
|
|
45
47
|
src/models/AccountOIDCProvider.ts
|
|
@@ -203,6 +205,8 @@ src/models/DatasetDataOneOf2.ts
|
|
|
203
205
|
src/models/DatasetModify.ts
|
|
204
206
|
src/models/DatasetRes.ts
|
|
205
207
|
src/models/DaysOffData.ts
|
|
208
|
+
src/models/Directory.ts
|
|
209
|
+
src/models/DirectoryPage.ts
|
|
206
210
|
src/models/EntityChangeActor.ts
|
|
207
211
|
src/models/EntityChangedEvent.ts
|
|
208
212
|
src/models/EntryPatch.ts
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## @spaciv/sdk@0.1.
|
|
1
|
+
## @spaciv/sdk@0.1.20
|
|
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.20 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
package/dist/apis/FilesApi.d.ts
CHANGED
|
@@ -10,20 +10,35 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { AccountFilePatchBody, ListPage, ModelRecord } from '../models/index';
|
|
13
|
+
import type { AccountDirectoryPatchBody, AccountDirectoryPostBody, AccountFilePatchBody, Directory, DirectoryPage, ListPage, ModelRecord } from '../models/index';
|
|
14
|
+
export interface FilesApiCreateAccountDirectoriesRequest {
|
|
15
|
+
accountDirectoryPostBody: AccountDirectoryPostBody;
|
|
16
|
+
}
|
|
14
17
|
export interface FilesApiCreateAccountFilesRequest {
|
|
15
18
|
filename?: Blob;
|
|
16
19
|
name?: string;
|
|
17
20
|
}
|
|
21
|
+
export interface FilesApiDeleteAccountDirectoriesRequest {
|
|
22
|
+
id: string;
|
|
23
|
+
}
|
|
18
24
|
export interface FilesApiDeleteAccountFilesRequest {
|
|
19
25
|
id: string;
|
|
20
26
|
}
|
|
21
27
|
export interface FilesApiGetAccountFilesContentRequest {
|
|
22
28
|
id: string;
|
|
23
29
|
}
|
|
30
|
+
export interface FilesApiListAccountDirectoriesRequest {
|
|
31
|
+
limit?: number;
|
|
32
|
+
cursor?: string;
|
|
33
|
+
}
|
|
24
34
|
export interface FilesApiListAccountFilesRequest {
|
|
25
35
|
limit?: number;
|
|
26
36
|
cursor?: string;
|
|
37
|
+
parent?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface FilesApiUpdateAccountDirectoriesRequest {
|
|
40
|
+
id: string;
|
|
41
|
+
accountDirectoryPatchBody: AccountDirectoryPatchBody;
|
|
27
42
|
}
|
|
28
43
|
export interface FilesApiUpdateAccountFilesRequest {
|
|
29
44
|
id: string;
|
|
@@ -43,7 +58,21 @@ export interface FilesApiUpdateAccountFilesContentRequest {
|
|
|
43
58
|
*/
|
|
44
59
|
export interface FilesApiInterface {
|
|
45
60
|
/**
|
|
46
|
-
*
|
|
61
|
+
* Creates a directory to organise the files stored against the account, at the root or inside another directory, and returns it. Directories can be nested at most 8 deep. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly: a name already taken there by a file or a directory is rejected with 409. Returns 404 if the account has no directory with the given `parentId`. A directory takes up none of the account\'s storage quota. Requires the *Edit file storage* permission.
|
|
62
|
+
* @summary Create a directory in the account\'s files
|
|
63
|
+
* @param {AccountDirectoryPostBody} accountDirectoryPostBody
|
|
64
|
+
* @param {*} [options] Override http request option.
|
|
65
|
+
* @throws {RequiredError}
|
|
66
|
+
* @memberof FilesApiInterface
|
|
67
|
+
*/
|
|
68
|
+
createAccountDirectoriesRaw(requestParameters: FilesApiCreateAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Directory>>;
|
|
69
|
+
/**
|
|
70
|
+
* Creates a directory to organise the files stored against the account, at the root or inside another directory, and returns it. Directories can be nested at most 8 deep. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly: a name already taken there by a file or a directory is rejected with 409. Returns 404 if the account has no directory with the given `parentId`. A directory takes up none of the account\'s storage quota. Requires the *Edit file storage* permission.
|
|
71
|
+
* Create a directory in the account\'s files
|
|
72
|
+
*/
|
|
73
|
+
createAccountDirectories(requestParameters: FilesApiCreateAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Directory>;
|
|
74
|
+
/**
|
|
75
|
+
* Stores a file against the account and returns the record describing it. Send the request as `multipart/form-data` with a single file field named `file`, and optionally a `parentId` field naming the directory to store it in; without one the file goes in the root, and a `parentId` the account has no directory for is rejected with 404. The uploaded file\'s name, normalised to Unicode NFC, becomes the record\'s `name`, so it must be non-empty and free of `/` and `\\`; a name over 255 bytes is shortened to fit, keeping its extension. Names are unique within a directory among its files and directories, compared exactly, so `Report.pdf` and `report.pdf` can sit side by side: when the name is already taken there, the file is stored under the lowest free numbered name instead, such as `image (2).png`, with the number before the extension, and the response\'s `name` is the name it was stored under. Any media type is accepted; `mimeType` is detected from the file\'s contents rather than from its name or the type the client declared. Maximum file size is 25 MiB, and uploads are rejected if a virus scan fails. The files stored against an account may total at most 1 GiB. An upload that would take the account past that is rejected with 413 and no file is added to the account, though the uploaded bytes may briefly remain in storage until they are cleaned up; deleting files frees their space. A 409 means concurrent uploads kept changing the account\'s usage or taking the names it tried, and the upload can be retried as it stands. The response body is the same record shape the list operation returns, so a client can add it to a list it already holds instead of refetching. Requires the *Edit file storage* permission.
|
|
47
76
|
* @summary Upload a file to the account
|
|
48
77
|
* @param {Blob} [filename] filename of the file being uploaded
|
|
49
78
|
* @param {string} [name] general purpose name for multipart form value
|
|
@@ -53,10 +82,24 @@ export interface FilesApiInterface {
|
|
|
53
82
|
*/
|
|
54
83
|
createAccountFilesRaw(requestParameters: FilesApiCreateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelRecord>>;
|
|
55
84
|
/**
|
|
56
|
-
* Stores a file against the account and returns the record describing it. Send the request as `multipart/form-data` with a single file field named `file
|
|
85
|
+
* Stores a file against the account and returns the record describing it. Send the request as `multipart/form-data` with a single file field named `file`, and optionally a `parentId` field naming the directory to store it in; without one the file goes in the root, and a `parentId` the account has no directory for is rejected with 404. The uploaded file\'s name, normalised to Unicode NFC, becomes the record\'s `name`, so it must be non-empty and free of `/` and `\\`; a name over 255 bytes is shortened to fit, keeping its extension. Names are unique within a directory among its files and directories, compared exactly, so `Report.pdf` and `report.pdf` can sit side by side: when the name is already taken there, the file is stored under the lowest free numbered name instead, such as `image (2).png`, with the number before the extension, and the response\'s `name` is the name it was stored under. Any media type is accepted; `mimeType` is detected from the file\'s contents rather than from its name or the type the client declared. Maximum file size is 25 MiB, and uploads are rejected if a virus scan fails. The files stored against an account may total at most 1 GiB. An upload that would take the account past that is rejected with 413 and no file is added to the account, though the uploaded bytes may briefly remain in storage until they are cleaned up; deleting files frees their space. A 409 means concurrent uploads kept changing the account\'s usage or taking the names it tried, and the upload can be retried as it stands. The response body is the same record shape the list operation returns, so a client can add it to a list it already holds instead of refetching. Requires the *Edit file storage* permission.
|
|
57
86
|
* Upload a file to the account
|
|
58
87
|
*/
|
|
59
88
|
createAccountFiles(requestParameters: FilesApiCreateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord>;
|
|
89
|
+
/**
|
|
90
|
+
* Deletes an empty directory from the account\'s files. A directory that still holds a file or another directory is rejected with 409 `directory is not empty`: move or delete its contents first. Deleting a directory that is already gone succeeds rather than returning 404. Any other 409 means the directory changed during the request, and the request can be retried. Requires the *Edit file storage* permission.
|
|
91
|
+
* @summary Delete a directory
|
|
92
|
+
* @param {string} id
|
|
93
|
+
* @param {*} [options] Override http request option.
|
|
94
|
+
* @throws {RequiredError}
|
|
95
|
+
* @memberof FilesApiInterface
|
|
96
|
+
*/
|
|
97
|
+
deleteAccountDirectoriesRaw(requestParameters: FilesApiDeleteAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>>;
|
|
98
|
+
/**
|
|
99
|
+
* Deletes an empty directory from the account\'s files. A directory that still holds a file or another directory is rejected with 409 `directory is not empty`: move or delete its contents first. Deleting a directory that is already gone succeeds rather than returning 404. Any other 409 means the directory changed during the request, and the request can be retried. Requires the *Edit file storage* permission.
|
|
100
|
+
* Delete a directory
|
|
101
|
+
*/
|
|
102
|
+
deleteAccountDirectories(requestParameters: FilesApiDeleteAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object>;
|
|
60
103
|
/**
|
|
61
104
|
* Permanently deletes a file stored against the account, removing both its record and its stored content. This cannot be undone and any link to the file stops working. The file\'s size stops counting towards the account\'s 1 GiB storage quota once its record is removed. The record is removed before the content, so a request that fails partway can leave the stored content behind; repeating the same request is what clears it. Deleting a file that is already gone succeeds rather than returning 404, so a failed delete should always be retried; that includes a 409, which means concurrent changes to the account\'s files kept changing its storage usage during the request. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400. Requires the *Edit file storage* permission.
|
|
62
105
|
* @summary Delete an account file
|
|
@@ -86,23 +129,54 @@ export interface FilesApiInterface {
|
|
|
86
129
|
*/
|
|
87
130
|
getAccountFilesContent(requestParameters: FilesApiGetAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
|
|
88
131
|
/**
|
|
89
|
-
* Returns a page of
|
|
132
|
+
* Returns a page of every directory in the account\'s files, at any depth, in the order they were created. Each directory gives its parent\'s identifier, so a client that fetches every page can build the whole tree. To list what is inside one directory, list the account\'s files with `parent` instead. When `nextCursor` is present there are more directories to fetch; pass it back as `cursor` to retrieve the following page. Requires the *View file storage* permission.
|
|
133
|
+
* @summary List the account\'s directories
|
|
134
|
+
* @param {number} [limit] Maximum number of directories to return in this page.
|
|
135
|
+
* @param {string} [cursor] Opaque pagination cursor returned as nextCursor by a previous response. A cursor is only valid for the account it was issued to.
|
|
136
|
+
* @param {*} [options] Override http request option.
|
|
137
|
+
* @throws {RequiredError}
|
|
138
|
+
* @memberof FilesApiInterface
|
|
139
|
+
*/
|
|
140
|
+
listAccountDirectoriesRaw(requestParameters: FilesApiListAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DirectoryPage>>;
|
|
141
|
+
/**
|
|
142
|
+
* Returns a page of every directory in the account\'s files, at any depth, in the order they were created. Each directory gives its parent\'s identifier, so a client that fetches every page can build the whole tree. To list what is inside one directory, list the account\'s files with `parent` instead. When `nextCursor` is present there are more directories to fetch; pass it back as `cursor` to retrieve the following page. Requires the *View file storage* permission.
|
|
143
|
+
* List the account\'s directories
|
|
144
|
+
*/
|
|
145
|
+
listAccountDirectories(requestParameters: FilesApiListAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DirectoryPage>;
|
|
146
|
+
/**
|
|
147
|
+
* Without `parent`, returns a page of every file stored against the account, whatever directory it is in, most recently uploaded first. Files belonging to other accounts are never returned. With `parent`, returns a page of what is directly inside that directory, or inside the root when `parent` is `root`: its directories in `directories`, most recently created first, then its files in `files`, most recently uploaded first. Returns 404 if the account has no directory with that identifier. When `nextCursor` is present there are more items to fetch; pass it back as `cursor`, with the same `parent`, to retrieve the following page. A page may come back shorter than `limit` while still having a `nextCursor`. A file that has just been uploaded, moved or renamed may not show its change here immediately, so clients should apply the record returned by the upload or update operation to their list rather than refetching. Requires the *View file storage* permission.
|
|
90
148
|
* @summary List the account\'s files
|
|
91
149
|
* @param {number} [limit] Maximum number of files to return in this page.
|
|
92
|
-
* @param {string} [cursor] Opaque pagination cursor returned as nextCursor by a previous response. A cursor is only valid for the account it was issued
|
|
150
|
+
* @param {string} [cursor] Opaque pagination cursor returned as nextCursor by a previous response. A cursor is only valid for the account, and the parent, it was issued for.
|
|
151
|
+
* @param {string} [parent] List only what is directly inside this directory: a directory identifier, or root for the root. Leave it out to list every file of the account, whatever directory it is in.
|
|
93
152
|
* @param {*} [options] Override http request option.
|
|
94
153
|
* @throws {RequiredError}
|
|
95
154
|
* @memberof FilesApiInterface
|
|
96
155
|
*/
|
|
97
156
|
listAccountFilesRaw(requestParameters: FilesApiListAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListPage>>;
|
|
98
157
|
/**
|
|
99
|
-
*
|
|
158
|
+
* Without `parent`, returns a page of every file stored against the account, whatever directory it is in, most recently uploaded first. Files belonging to other accounts are never returned. With `parent`, returns a page of what is directly inside that directory, or inside the root when `parent` is `root`: its directories in `directories`, most recently created first, then its files in `files`, most recently uploaded first. Returns 404 if the account has no directory with that identifier. When `nextCursor` is present there are more items to fetch; pass it back as `cursor`, with the same `parent`, to retrieve the following page. A page may come back shorter than `limit` while still having a `nextCursor`. A file that has just been uploaded, moved or renamed may not show its change here immediately, so clients should apply the record returned by the upload or update operation to their list rather than refetching. Requires the *View file storage* permission.
|
|
100
159
|
* List the account\'s files
|
|
101
160
|
*/
|
|
102
161
|
listAccountFiles(requestParameters: FilesApiListAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListPage>;
|
|
103
162
|
/**
|
|
104
|
-
* Changes
|
|
105
|
-
* @summary Rename
|
|
163
|
+
* Changes a directory\'s name, moves it into another directory, or both, and returns the updated directory. Give `name`, `parentId` or both; a body with neither is rejected with 400. Everything inside the directory moves with it and keeps its identifier, so anything referencing those files keeps working. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly: a name already taken in the destination by a file or another directory, whether by a rename or a move, is rejected with 409. Moving a directory into itself or into a directory inside it, or so that something inside it would be nested more than 8 deep, is rejected with 400. Returns 404 if the account has no directory with this identifier, or none with the given `parentId`. Any other 409 means the account\'s directories changed during the request, and the request can be retried. Requires the *Edit file storage* permission.
|
|
164
|
+
* @summary Rename or move a directory
|
|
165
|
+
* @param {string} id
|
|
166
|
+
* @param {AccountDirectoryPatchBody} accountDirectoryPatchBody
|
|
167
|
+
* @param {*} [options] Override http request option.
|
|
168
|
+
* @throws {RequiredError}
|
|
169
|
+
* @memberof FilesApiInterface
|
|
170
|
+
*/
|
|
171
|
+
updateAccountDirectoriesRaw(requestParameters: FilesApiUpdateAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Directory>>;
|
|
172
|
+
/**
|
|
173
|
+
* Changes a directory\'s name, moves it into another directory, or both, and returns the updated directory. Give `name`, `parentId` or both; a body with neither is rejected with 400. Everything inside the directory moves with it and keeps its identifier, so anything referencing those files keeps working. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly: a name already taken in the destination by a file or another directory, whether by a rename or a move, is rejected with 409. Moving a directory into itself or into a directory inside it, or so that something inside it would be nested more than 8 deep, is rejected with 400. Returns 404 if the account has no directory with this identifier, or none with the given `parentId`. Any other 409 means the account\'s directories changed during the request, and the request can be retried. Requires the *Edit file storage* permission.
|
|
174
|
+
* Rename or move a directory
|
|
175
|
+
*/
|
|
176
|
+
updateAccountDirectories(requestParameters: FilesApiUpdateAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Directory>;
|
|
177
|
+
/**
|
|
178
|
+
* Changes the display name of a file stored against the account, moves it into another directory, or both, and returns the updated record. Give `name`, `parentId` or both; a body with neither is rejected with 400. Only the name and directory change: the stored content, media type, size and identifier are untouched, so anything already referencing the file keeps working. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly. Giving a `name` already taken in the destination is rejected with 409. A move that gives only `parentId` never fails for its name: if the file\'s name is taken in the destination, it is stored under the lowest free numbered name instead, such as `lease (2).pdf`, and a name normalising makes longer than 255 bytes is shortened to fit; the response\'s `name` is the name it now has. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400. Returns 404 if the account has no file with this identifier, or no directory with the given `parentId`. Any other 409 means the file was moved by another request at the same time, and the request can be retried. Requires the *Edit file storage* permission.
|
|
179
|
+
* @summary Rename or move an account file
|
|
106
180
|
* @param {string} id
|
|
107
181
|
* @param {AccountFilePatchBody} accountFilePatchBody
|
|
108
182
|
* @param {*} [options] Override http request option.
|
|
@@ -111,8 +185,8 @@ export interface FilesApiInterface {
|
|
|
111
185
|
*/
|
|
112
186
|
updateAccountFilesRaw(requestParameters: FilesApiUpdateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelRecord>>;
|
|
113
187
|
/**
|
|
114
|
-
* Changes the display name of a file stored against the account and returns the updated record. Only the name
|
|
115
|
-
* Rename an account file
|
|
188
|
+
* Changes the display name of a file stored against the account, moves it into another directory, or both, and returns the updated record. Give `name`, `parentId` or both; a body with neither is rejected with 400. Only the name and directory change: the stored content, media type, size and identifier are untouched, so anything already referencing the file keeps working. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly. Giving a `name` already taken in the destination is rejected with 409. A move that gives only `parentId` never fails for its name: if the file\'s name is taken in the destination, it is stored under the lowest free numbered name instead, such as `lease (2).pdf`, and a name normalising makes longer than 255 bytes is shortened to fit; the response\'s `name` is the name it now has. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400. Returns 404 if the account has no file with this identifier, or no directory with the given `parentId`. Any other 409 means the file was moved by another request at the same time, and the request can be retried. Requires the *Edit file storage* permission.
|
|
189
|
+
* Rename or move an account file
|
|
116
190
|
*/
|
|
117
191
|
updateAccountFiles(requestParameters: FilesApiUpdateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord>;
|
|
118
192
|
/**
|
|
@@ -138,15 +212,35 @@ export interface FilesApiInterface {
|
|
|
138
212
|
*/
|
|
139
213
|
export declare class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
|
|
140
214
|
/**
|
|
141
|
-
*
|
|
215
|
+
* Creates a directory to organise the files stored against the account, at the root or inside another directory, and returns it. Directories can be nested at most 8 deep. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly: a name already taken there by a file or a directory is rejected with 409. Returns 404 if the account has no directory with the given `parentId`. A directory takes up none of the account\'s storage quota. Requires the *Edit file storage* permission.
|
|
216
|
+
* Create a directory in the account\'s files
|
|
217
|
+
*/
|
|
218
|
+
createAccountDirectoriesRaw(requestParameters: FilesApiCreateAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Directory>>;
|
|
219
|
+
/**
|
|
220
|
+
* Creates a directory to organise the files stored against the account, at the root or inside another directory, and returns it. Directories can be nested at most 8 deep. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly: a name already taken there by a file or a directory is rejected with 409. Returns 404 if the account has no directory with the given `parentId`. A directory takes up none of the account\'s storage quota. Requires the *Edit file storage* permission.
|
|
221
|
+
* Create a directory in the account\'s files
|
|
222
|
+
*/
|
|
223
|
+
createAccountDirectories(requestParameters: FilesApiCreateAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Directory>;
|
|
224
|
+
/**
|
|
225
|
+
* Stores a file against the account and returns the record describing it. Send the request as `multipart/form-data` with a single file field named `file`, and optionally a `parentId` field naming the directory to store it in; without one the file goes in the root, and a `parentId` the account has no directory for is rejected with 404. The uploaded file\'s name, normalised to Unicode NFC, becomes the record\'s `name`, so it must be non-empty and free of `/` and `\\`; a name over 255 bytes is shortened to fit, keeping its extension. Names are unique within a directory among its files and directories, compared exactly, so `Report.pdf` and `report.pdf` can sit side by side: when the name is already taken there, the file is stored under the lowest free numbered name instead, such as `image (2).png`, with the number before the extension, and the response\'s `name` is the name it was stored under. Any media type is accepted; `mimeType` is detected from the file\'s contents rather than from its name or the type the client declared. Maximum file size is 25 MiB, and uploads are rejected if a virus scan fails. The files stored against an account may total at most 1 GiB. An upload that would take the account past that is rejected with 413 and no file is added to the account, though the uploaded bytes may briefly remain in storage until they are cleaned up; deleting files frees their space. A 409 means concurrent uploads kept changing the account\'s usage or taking the names it tried, and the upload can be retried as it stands. The response body is the same record shape the list operation returns, so a client can add it to a list it already holds instead of refetching. Requires the *Edit file storage* permission.
|
|
142
226
|
* Upload a file to the account
|
|
143
227
|
*/
|
|
144
228
|
createAccountFilesRaw(requestParameters: FilesApiCreateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelRecord>>;
|
|
145
229
|
/**
|
|
146
|
-
* Stores a file against the account and returns the record describing it. Send the request as `multipart/form-data` with a single file field named `file
|
|
230
|
+
* Stores a file against the account and returns the record describing it. Send the request as `multipart/form-data` with a single file field named `file`, and optionally a `parentId` field naming the directory to store it in; without one the file goes in the root, and a `parentId` the account has no directory for is rejected with 404. The uploaded file\'s name, normalised to Unicode NFC, becomes the record\'s `name`, so it must be non-empty and free of `/` and `\\`; a name over 255 bytes is shortened to fit, keeping its extension. Names are unique within a directory among its files and directories, compared exactly, so `Report.pdf` and `report.pdf` can sit side by side: when the name is already taken there, the file is stored under the lowest free numbered name instead, such as `image (2).png`, with the number before the extension, and the response\'s `name` is the name it was stored under. Any media type is accepted; `mimeType` is detected from the file\'s contents rather than from its name or the type the client declared. Maximum file size is 25 MiB, and uploads are rejected if a virus scan fails. The files stored against an account may total at most 1 GiB. An upload that would take the account past that is rejected with 413 and no file is added to the account, though the uploaded bytes may briefly remain in storage until they are cleaned up; deleting files frees their space. A 409 means concurrent uploads kept changing the account\'s usage or taking the names it tried, and the upload can be retried as it stands. The response body is the same record shape the list operation returns, so a client can add it to a list it already holds instead of refetching. Requires the *Edit file storage* permission.
|
|
147
231
|
* Upload a file to the account
|
|
148
232
|
*/
|
|
149
233
|
createAccountFiles(requestParameters?: FilesApiCreateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord>;
|
|
234
|
+
/**
|
|
235
|
+
* Deletes an empty directory from the account\'s files. A directory that still holds a file or another directory is rejected with 409 `directory is not empty`: move or delete its contents first. Deleting a directory that is already gone succeeds rather than returning 404. Any other 409 means the directory changed during the request, and the request can be retried. Requires the *Edit file storage* permission.
|
|
236
|
+
* Delete a directory
|
|
237
|
+
*/
|
|
238
|
+
deleteAccountDirectoriesRaw(requestParameters: FilesApiDeleteAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>>;
|
|
239
|
+
/**
|
|
240
|
+
* Deletes an empty directory from the account\'s files. A directory that still holds a file or another directory is rejected with 409 `directory is not empty`: move or delete its contents first. Deleting a directory that is already gone succeeds rather than returning 404. Any other 409 means the directory changed during the request, and the request can be retried. Requires the *Edit file storage* permission.
|
|
241
|
+
* Delete a directory
|
|
242
|
+
*/
|
|
243
|
+
deleteAccountDirectories(requestParameters: FilesApiDeleteAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object>;
|
|
150
244
|
/**
|
|
151
245
|
* Permanently deletes a file stored against the account, removing both its record and its stored content. This cannot be undone and any link to the file stops working. The file\'s size stops counting towards the account\'s 1 GiB storage quota once its record is removed. The record is removed before the content, so a request that fails partway can leave the stored content behind; repeating the same request is what clears it. Deleting a file that is already gone succeeds rather than returning 404, so a failed delete should always be retried; that includes a 409, which means concurrent changes to the account\'s files kept changing its storage usage during the request. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400. Requires the *Edit file storage* permission.
|
|
152
246
|
* Delete an account file
|
|
@@ -168,23 +262,43 @@ export declare class FilesApi extends runtime.BaseAPI implements FilesApiInterfa
|
|
|
168
262
|
*/
|
|
169
263
|
getAccountFilesContent(requestParameters: FilesApiGetAccountFilesContentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
|
|
170
264
|
/**
|
|
171
|
-
* Returns a page of
|
|
265
|
+
* Returns a page of every directory in the account\'s files, at any depth, in the order they were created. Each directory gives its parent\'s identifier, so a client that fetches every page can build the whole tree. To list what is inside one directory, list the account\'s files with `parent` instead. When `nextCursor` is present there are more directories to fetch; pass it back as `cursor` to retrieve the following page. Requires the *View file storage* permission.
|
|
266
|
+
* List the account\'s directories
|
|
267
|
+
*/
|
|
268
|
+
listAccountDirectoriesRaw(requestParameters: FilesApiListAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DirectoryPage>>;
|
|
269
|
+
/**
|
|
270
|
+
* Returns a page of every directory in the account\'s files, at any depth, in the order they were created. Each directory gives its parent\'s identifier, so a client that fetches every page can build the whole tree. To list what is inside one directory, list the account\'s files with `parent` instead. When `nextCursor` is present there are more directories to fetch; pass it back as `cursor` to retrieve the following page. Requires the *View file storage* permission.
|
|
271
|
+
* List the account\'s directories
|
|
272
|
+
*/
|
|
273
|
+
listAccountDirectories(requestParameters?: FilesApiListAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DirectoryPage>;
|
|
274
|
+
/**
|
|
275
|
+
* Without `parent`, returns a page of every file stored against the account, whatever directory it is in, most recently uploaded first. Files belonging to other accounts are never returned. With `parent`, returns a page of what is directly inside that directory, or inside the root when `parent` is `root`: its directories in `directories`, most recently created first, then its files in `files`, most recently uploaded first. Returns 404 if the account has no directory with that identifier. When `nextCursor` is present there are more items to fetch; pass it back as `cursor`, with the same `parent`, to retrieve the following page. A page may come back shorter than `limit` while still having a `nextCursor`. A file that has just been uploaded, moved or renamed may not show its change here immediately, so clients should apply the record returned by the upload or update operation to their list rather than refetching. Requires the *View file storage* permission.
|
|
172
276
|
* List the account\'s files
|
|
173
277
|
*/
|
|
174
278
|
listAccountFilesRaw(requestParameters: FilesApiListAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListPage>>;
|
|
175
279
|
/**
|
|
176
|
-
*
|
|
280
|
+
* Without `parent`, returns a page of every file stored against the account, whatever directory it is in, most recently uploaded first. Files belonging to other accounts are never returned. With `parent`, returns a page of what is directly inside that directory, or inside the root when `parent` is `root`: its directories in `directories`, most recently created first, then its files in `files`, most recently uploaded first. Returns 404 if the account has no directory with that identifier. When `nextCursor` is present there are more items to fetch; pass it back as `cursor`, with the same `parent`, to retrieve the following page. A page may come back shorter than `limit` while still having a `nextCursor`. A file that has just been uploaded, moved or renamed may not show its change here immediately, so clients should apply the record returned by the upload or update operation to their list rather than refetching. Requires the *View file storage* permission.
|
|
177
281
|
* List the account\'s files
|
|
178
282
|
*/
|
|
179
283
|
listAccountFiles(requestParameters?: FilesApiListAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListPage>;
|
|
180
284
|
/**
|
|
181
|
-
* Changes
|
|
182
|
-
* Rename
|
|
285
|
+
* Changes a directory\'s name, moves it into another directory, or both, and returns the updated directory. Give `name`, `parentId` or both; a body with neither is rejected with 400. Everything inside the directory moves with it and keeps its identifier, so anything referencing those files keeps working. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly: a name already taken in the destination by a file or another directory, whether by a rename or a move, is rejected with 409. Moving a directory into itself or into a directory inside it, or so that something inside it would be nested more than 8 deep, is rejected with 400. Returns 404 if the account has no directory with this identifier, or none with the given `parentId`. Any other 409 means the account\'s directories changed during the request, and the request can be retried. Requires the *Edit file storage* permission.
|
|
286
|
+
* Rename or move a directory
|
|
287
|
+
*/
|
|
288
|
+
updateAccountDirectoriesRaw(requestParameters: FilesApiUpdateAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Directory>>;
|
|
289
|
+
/**
|
|
290
|
+
* Changes a directory\'s name, moves it into another directory, or both, and returns the updated directory. Give `name`, `parentId` or both; a body with neither is rejected with 400. Everything inside the directory moves with it and keeps its identifier, so anything referencing those files keeps working. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly: a name already taken in the destination by a file or another directory, whether by a rename or a move, is rejected with 409. Moving a directory into itself or into a directory inside it, or so that something inside it would be nested more than 8 deep, is rejected with 400. Returns 404 if the account has no directory with this identifier, or none with the given `parentId`. Any other 409 means the account\'s directories changed during the request, and the request can be retried. Requires the *Edit file storage* permission.
|
|
291
|
+
* Rename or move a directory
|
|
292
|
+
*/
|
|
293
|
+
updateAccountDirectories(requestParameters: FilesApiUpdateAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Directory>;
|
|
294
|
+
/**
|
|
295
|
+
* Changes the display name of a file stored against the account, moves it into another directory, or both, and returns the updated record. Give `name`, `parentId` or both; a body with neither is rejected with 400. Only the name and directory change: the stored content, media type, size and identifier are untouched, so anything already referencing the file keeps working. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly. Giving a `name` already taken in the destination is rejected with 409. A move that gives only `parentId` never fails for its name: if the file\'s name is taken in the destination, it is stored under the lowest free numbered name instead, such as `lease (2).pdf`, and a name normalising makes longer than 255 bytes is shortened to fit; the response\'s `name` is the name it now has. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400. Returns 404 if the account has no file with this identifier, or no directory with the given `parentId`. Any other 409 means the file was moved by another request at the same time, and the request can be retried. Requires the *Edit file storage* permission.
|
|
296
|
+
* Rename or move an account file
|
|
183
297
|
*/
|
|
184
298
|
updateAccountFilesRaw(requestParameters: FilesApiUpdateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelRecord>>;
|
|
185
299
|
/**
|
|
186
|
-
* Changes the display name of a file stored against the account and returns the updated record. Only the name
|
|
187
|
-
* Rename an account file
|
|
300
|
+
* Changes the display name of a file stored against the account, moves it into another directory, or both, and returns the updated record. Give `name`, `parentId` or both; a body with neither is rejected with 400. Only the name and directory change: the stored content, media type, size and identifier are untouched, so anything already referencing the file keeps working. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly. Giving a `name` already taken in the destination is rejected with 409. A move that gives only `parentId` never fails for its name: if the file\'s name is taken in the destination, it is stored under the lowest free numbered name instead, such as `lease (2).pdf`, and a name normalising makes longer than 255 bytes is shortened to fit; the response\'s `name` is the name it now has. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400. Returns 404 if the account has no file with this identifier, or no directory with the given `parentId`. Any other 409 means the file was moved by another request at the same time, and the request can be retried. Requires the *Edit file storage* permission.
|
|
301
|
+
* Rename or move an account file
|
|
188
302
|
*/
|
|
189
303
|
updateAccountFiles(requestParameters: FilesApiUpdateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord>;
|
|
190
304
|
/**
|