@spaciv/sdk 0.1.25 → 0.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/.openapi-generator/FILES +3 -0
  2. package/README.md +2 -2
  3. package/dist/apis/AccountsApi.d.ts +37 -10
  4. package/dist/apis/AccountsApi.js +49 -4
  5. package/dist/apis/FilesApi.d.ts +52 -27
  6. package/dist/apis/FilesApi.js +50 -12
  7. package/dist/apis/InternalApi.d.ts +4 -4
  8. package/dist/apis/InternalApi.js +2 -2
  9. package/dist/esm/apis/AccountsApi.d.ts +37 -10
  10. package/dist/esm/apis/AccountsApi.js +50 -5
  11. package/dist/esm/apis/FilesApi.d.ts +52 -27
  12. package/dist/esm/apis/FilesApi.js +51 -13
  13. package/dist/esm/apis/InternalApi.d.ts +4 -4
  14. package/dist/esm/apis/InternalApi.js +2 -2
  15. package/dist/esm/models/AccountDirectoryPatchBody.d.ts +12 -0
  16. package/dist/esm/models/AccountDirectoryPatchBody.js +4 -0
  17. package/dist/esm/models/AccountDuplicateReqBody.d.ts +32 -0
  18. package/dist/esm/models/AccountDuplicateReqBody.js +43 -0
  19. package/dist/esm/models/AccountFilePatchBody.d.ts +12 -0
  20. package/dist/esm/models/AccountFilePatchBody.js +4 -0
  21. package/dist/esm/models/Directory.d.ts +14 -0
  22. package/dist/esm/models/Directory.js +4 -0
  23. package/dist/esm/models/ListPage.d.ts +1 -1
  24. package/dist/esm/models/ModelRecord.d.ts +14 -0
  25. package/dist/esm/models/ModelRecord.js +4 -0
  26. package/dist/esm/models/ReservedTagInfo.d.ts +46 -0
  27. package/dist/esm/models/ReservedTagInfo.js +54 -0
  28. package/dist/esm/models/TagList.d.ts +39 -0
  29. package/dist/esm/models/TagList.js +48 -0
  30. package/dist/esm/models/index.d.ts +3 -0
  31. package/dist/esm/models/index.js +3 -0
  32. package/dist/models/AccountDirectoryPatchBody.d.ts +12 -0
  33. package/dist/models/AccountDirectoryPatchBody.js +4 -0
  34. package/dist/models/AccountDuplicateReqBody.d.ts +32 -0
  35. package/dist/models/AccountDuplicateReqBody.js +50 -0
  36. package/dist/models/AccountFilePatchBody.d.ts +12 -0
  37. package/dist/models/AccountFilePatchBody.js +4 -0
  38. package/dist/models/Directory.d.ts +14 -0
  39. package/dist/models/Directory.js +4 -0
  40. package/dist/models/ListPage.d.ts +1 -1
  41. package/dist/models/ModelRecord.d.ts +14 -0
  42. package/dist/models/ModelRecord.js +4 -0
  43. package/dist/models/ReservedTagInfo.d.ts +46 -0
  44. package/dist/models/ReservedTagInfo.js +62 -0
  45. package/dist/models/TagList.d.ts +39 -0
  46. package/dist/models/TagList.js +55 -0
  47. package/dist/models/index.d.ts +3 -0
  48. package/dist/models/index.js +3 -0
  49. package/package.json +1 -1
  50. package/src/apis/AccountsApi.ts +85 -9
  51. package/src/apis/FilesApi.ts +89 -26
  52. package/src/apis/InternalApi.ts +4 -4
  53. package/src/models/AccountDirectoryPatchBody.ts +16 -0
  54. package/src/models/AccountDuplicateReqBody.ts +66 -0
  55. package/src/models/AccountFilePatchBody.ts +16 -0
  56. package/src/models/Directory.ts +16 -0
  57. package/src/models/ListPage.ts +1 -1
  58. package/src/models/ModelRecord.ts +16 -0
  59. package/src/models/ReservedTagInfo.ts +86 -0
  60. package/src/models/TagList.ts +83 -0
  61. package/src/models/index.ts +3 -0
@@ -24,6 +24,7 @@ import type {
24
24
  ErrorModel,
25
25
  ListPage,
26
26
  ModelRecord,
27
+ TagList,
27
28
  } from '../models/index';
28
29
  import {
29
30
  AccountDirectoryPatchBodyFromJSON,
@@ -44,6 +45,8 @@ import {
44
45
  ListPageToJSON,
45
46
  ModelRecordFromJSON,
46
47
  ModelRecordToJSON,
48
+ TagListFromJSON,
49
+ TagListToJSON,
47
50
  } from '../models/index';
48
51
 
49
52
  export interface FilesApiCreateAccountDirectoriesRequest {
@@ -80,6 +83,7 @@ export interface FilesApiListAccountFilesRequest {
80
83
  limit?: number;
81
84
  cursor?: string;
82
85
  parent?: string;
86
+ tag?: string;
83
87
  }
84
88
 
85
89
  export interface FilesApiUpdateAccountDirectoriesRequest {
@@ -123,7 +127,7 @@ export interface FilesApiInterface {
123
127
  createAccountDirectories(requestParameters: FilesApiCreateAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Directory>;
124
128
 
125
129
  /**
126
- * 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.
130
+ * 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. Uploading into a directory that has a reserved tag, or into any directory inside one at any depth, needs the permission that tag requires (*Manage my account* for `skill`); otherwise the upload is rejected with 403 and no file is added to the account. `GET /v1/account/file-tags` lists the reserved tags. 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.
127
131
  * @summary Upload a file to the account
128
132
  * @param {Blob} [filename] filename of the file being uploaded
129
133
  * @param {string} [name] general purpose name for multipart form value
@@ -134,7 +138,7 @@ export interface FilesApiInterface {
134
138
  createAccountFilesRaw(requestParameters: FilesApiCreateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelRecord>>;
135
139
 
136
140
  /**
137
- * 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.
141
+ * 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. Uploading into a directory that has a reserved tag, or into any directory inside one at any depth, needs the permission that tag requires (*Manage my account* for `skill`); otherwise the upload is rejected with 403 and no file is added to the account. `GET /v1/account/file-tags` lists the reserved tags. 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.
138
142
  * Upload a file to the account
139
143
  */
140
144
  createAccountFiles(requestParameters: FilesApiCreateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord>;
@@ -221,11 +225,27 @@ export interface FilesApiInterface {
221
225
  listAccountDirectories(requestParameters: FilesApiListAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DirectoryPage>;
222
226
 
223
227
  /**
224
- * 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.
228
+ * Returns every tag in use on the account\'s files and directories, each once, for suggesting tags as they are typed. Pass one to the list operation\'s `tag` to list the files and directories that have it. A tag that has just been added or removed may take a moment to be reflected here. Also returns the reserved tags, which give an item a meaning Spaciv acts on, with the kinds of item each can be added to. Requires the *View file storage* permission.
229
+ * @summary List the account\'s file and directory tags
230
+ * @param {*} [options] Override http request option.
231
+ * @throws {RequiredError}
232
+ * @memberof FilesApiInterface
233
+ */
234
+ listAccountFileTagsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TagList>>;
235
+
236
+ /**
237
+ * Returns every tag in use on the account\'s files and directories, each once, for suggesting tags as they are typed. Pass one to the list operation\'s `tag` to list the files and directories that have it. A tag that has just been added or removed may take a moment to be reflected here. Also returns the reserved tags, which give an item a meaning Spaciv acts on, with the kinds of item each can be added to. Requires the *View file storage* permission.
238
+ * List the account\'s file and directory tags
239
+ */
240
+ listAccountFileTags(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TagList>;
241
+
242
+ /**
243
+ * Without `parent` or `tag`, 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. With `tag`, returns a page of the files and directories that have that tag, wherever they are: the files in `files` and the directories in `directories`, each most recently created first. The contents of a tagged directory are not included unless they have the tag themselves. Giving both `parent` and `tag` is rejected with 400, and so is a tag that is not at most 32 letters, digits and hyphens. When `nextCursor` is present there are more items to fetch; pass it back as `cursor`, with the same `parent` or `tag`, to retrieve the following page. A page may come back shorter than `limit` while still having a `nextCursor`, and may have neither files nor directories. A file that has just been uploaded, moved, renamed or tagged 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.
225
244
  * @summary List the account\'s files
226
245
  * @param {number} [limit] Maximum number of files to return in this page.
227
- * @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.
228
- * @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.
246
+ * @param {string} [cursor] Opaque pagination cursor returned as nextCursor by a previous response. A cursor is only valid for the account, and the parent or tag, it was issued for.
247
+ * @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. Cannot be given with tag.
248
+ * @param {string} [tag] List only the files and directories with this tag, wherever they are. Matched without regard to case. Cannot be given with parent.
229
249
  * @param {*} [options] Override http request option.
230
250
  * @throws {RequiredError}
231
251
  * @memberof FilesApiInterface
@@ -233,14 +253,14 @@ export interface FilesApiInterface {
233
253
  listAccountFilesRaw(requestParameters: FilesApiListAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListPage>>;
234
254
 
235
255
  /**
236
- * 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.
256
+ * Without `parent` or `tag`, 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. With `tag`, returns a page of the files and directories that have that tag, wherever they are: the files in `files` and the directories in `directories`, each most recently created first. The contents of a tagged directory are not included unless they have the tag themselves. Giving both `parent` and `tag` is rejected with 400, and so is a tag that is not at most 32 letters, digits and hyphens. When `nextCursor` is present there are more items to fetch; pass it back as `cursor`, with the same `parent` or `tag`, to retrieve the following page. A page may come back shorter than `limit` while still having a `nextCursor`, and may have neither files nor directories. A file that has just been uploaded, moved, renamed or tagged 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.
237
257
  * List the account\'s files
238
258
  */
239
259
  listAccountFiles(requestParameters: FilesApiListAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListPage>;
240
260
 
241
261
  /**
242
- * 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.
243
- * @summary Rename or move a directory
262
+ * Changes a directory\'s name, moves it into another directory, changes its tags, or any of these, and returns the updated directory. Give `name`, `parentId`, `addTags`, `removeTags` or any of them; a body with none is rejected with 400. Everything inside the directory moves with it and keeps its identifier, so anything referencing those files keeps working. A rename or move and a tag change made in one request are saved, and audited, one after the other. 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. Tags are added and removed as given, without replacing the directory\'s other tags, so two people tagging the same directory at once do not undo each other\'s changes. A tag cannot be both added and removed in one request. The files and directories inside do not take on the directory\'s tags. Some tags are reserved: they give an item a meaning Spaciv acts on, and `GET /v1/account/file-tags` lists them. `skill` marks a directory as a skill. Adding or removing a reserved tag, or renaming, moving, retagging or deleting a directory that has one, needs the permission that tag requires (*Manage my account* for `skill`), and so does any change to a directory inside one that has it, at any depth, including moving it into or out of one; otherwise the request is rejected with 403. A reserved tag may check the directory it is on, when it is added and whenever the directory or anything inside it changes, and record what it finds in `tagProblems` rather than refusing the change. 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.
263
+ * @summary Rename, move or tag a directory
244
264
  * @param {string} id
245
265
  * @param {AccountDirectoryPatchBody} accountDirectoryPatchBody
246
266
  * @param {*} [options] Override http request option.
@@ -250,14 +270,14 @@ export interface FilesApiInterface {
250
270
  updateAccountDirectoriesRaw(requestParameters: FilesApiUpdateAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Directory>>;
251
271
 
252
272
  /**
253
- * 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.
254
- * Rename or move a directory
273
+ * Changes a directory\'s name, moves it into another directory, changes its tags, or any of these, and returns the updated directory. Give `name`, `parentId`, `addTags`, `removeTags` or any of them; a body with none is rejected with 400. Everything inside the directory moves with it and keeps its identifier, so anything referencing those files keeps working. A rename or move and a tag change made in one request are saved, and audited, one after the other. 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. Tags are added and removed as given, without replacing the directory\'s other tags, so two people tagging the same directory at once do not undo each other\'s changes. A tag cannot be both added and removed in one request. The files and directories inside do not take on the directory\'s tags. Some tags are reserved: they give an item a meaning Spaciv acts on, and `GET /v1/account/file-tags` lists them. `skill` marks a directory as a skill. Adding or removing a reserved tag, or renaming, moving, retagging or deleting a directory that has one, needs the permission that tag requires (*Manage my account* for `skill`), and so does any change to a directory inside one that has it, at any depth, including moving it into or out of one; otherwise the request is rejected with 403. A reserved tag may check the directory it is on, when it is added and whenever the directory or anything inside it changes, and record what it finds in `tagProblems` rather than refusing the change. 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.
274
+ * Rename, move or tag a directory
255
275
  */
256
276
  updateAccountDirectories(requestParameters: FilesApiUpdateAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Directory>;
257
277
 
258
278
  /**
259
- * 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.
260
- * @summary Rename or move an account file
279
+ * Changes the display name of a file stored against the account, moves it into another directory, changes its tags, or any of these, and returns the updated record. Give `name`, `parentId`, `addTags`, `removeTags` or any of them; a body with none is rejected with 400. The stored content, media type, size and identifier are untouched, so anything already referencing the file keeps working. A rename or move and a tag change made in one request are saved, and audited, one after the other. 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. Tags are added and removed as given, without replacing the file\'s other tags, so two people tagging the same file at once do not undo each other\'s changes. A tag cannot be both added and removed in one request. Some tags are reserved: they give an item a meaning Spaciv acts on, and `GET /v1/account/file-tags` lists them. A reserved tag can only be added to the kinds of item it applies to, so `skill` on a file is rejected with 400. Adding or removing a reserved tag, or renaming, moving, retagging or deleting an item that has one, needs the permission that tag requires (*Manage my account* for `skill`), and so does any change to a file inside a directory that has one, at any depth, including moving the file into or out of it; otherwise the request is rejected with 403. A reserved tag may check the item it is on, when it is added and after the item changes, and record what it finds in `tagProblems` rather than refusing the change. 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 changed during the request, and the request can be retried as it stands. Requires the *Edit file storage* permission.
280
+ * @summary Rename, move or tag an account file
261
281
  * @param {string} id
262
282
  * @param {AccountFilePatchBody} accountFilePatchBody
263
283
  * @param {*} [options] Override http request option.
@@ -267,8 +287,8 @@ export interface FilesApiInterface {
267
287
  updateAccountFilesRaw(requestParameters: FilesApiUpdateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelRecord>>;
268
288
 
269
289
  /**
270
- * 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.
271
- * Rename or move an account file
290
+ * Changes the display name of a file stored against the account, moves it into another directory, changes its tags, or any of these, and returns the updated record. Give `name`, `parentId`, `addTags`, `removeTags` or any of them; a body with none is rejected with 400. The stored content, media type, size and identifier are untouched, so anything already referencing the file keeps working. A rename or move and a tag change made in one request are saved, and audited, one after the other. 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. Tags are added and removed as given, without replacing the file\'s other tags, so two people tagging the same file at once do not undo each other\'s changes. A tag cannot be both added and removed in one request. Some tags are reserved: they give an item a meaning Spaciv acts on, and `GET /v1/account/file-tags` lists them. A reserved tag can only be added to the kinds of item it applies to, so `skill` on a file is rejected with 400. Adding or removing a reserved tag, or renaming, moving, retagging or deleting an item that has one, needs the permission that tag requires (*Manage my account* for `skill`), and so does any change to a file inside a directory that has one, at any depth, including moving the file into or out of it; otherwise the request is rejected with 403. A reserved tag may check the item it is on, when it is added and after the item changes, and record what it finds in `tagProblems` rather than refusing the change. 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 changed during the request, and the request can be retried as it stands. Requires the *Edit file storage* permission.
291
+ * Rename, move or tag an account file
272
292
  */
273
293
  updateAccountFiles(requestParameters: FilesApiUpdateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord>;
274
294
 
@@ -348,7 +368,7 @@ export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
348
368
  }
349
369
 
350
370
  /**
351
- * 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.
371
+ * 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. Uploading into a directory that has a reserved tag, or into any directory inside one at any depth, needs the permission that tag requires (*Manage my account* for `skill`); otherwise the upload is rejected with 403 and no file is added to the account. `GET /v1/account/file-tags` lists the reserved tags. 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.
352
372
  * Upload a file to the account
353
373
  */
354
374
  async createAccountFilesRaw(requestParameters: FilesApiCreateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelRecord>> {
@@ -403,7 +423,7 @@ export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
403
423
  }
404
424
 
405
425
  /**
406
- * 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.
426
+ * 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. Uploading into a directory that has a reserved tag, or into any directory inside one at any depth, needs the permission that tag requires (*Manage my account* for `skill`); otherwise the upload is rejected with 403 and no file is added to the account. `GET /v1/account/file-tags` lists the reserved tags. 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.
407
427
  * Upload a file to the account
408
428
  */
409
429
  async createAccountFiles(requestParameters: FilesApiCreateAccountFilesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord> {
@@ -653,7 +673,46 @@ export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
653
673
  }
654
674
 
655
675
  /**
656
- * 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.
676
+ * Returns every tag in use on the account\'s files and directories, each once, for suggesting tags as they are typed. Pass one to the list operation\'s `tag` to list the files and directories that have it. A tag that has just been added or removed may take a moment to be reflected here. Also returns the reserved tags, which give an item a meaning Spaciv acts on, with the kinds of item each can be added to. Requires the *View file storage* permission.
677
+ * List the account\'s file and directory tags
678
+ */
679
+ async listAccountFileTagsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TagList>> {
680
+ const queryParameters: any = {};
681
+
682
+ const headerParameters: runtime.HTTPHeaders = {};
683
+
684
+ if (this.configuration && this.configuration.accessToken) {
685
+ const token = this.configuration.accessToken;
686
+ const tokenString = await token("accessToken", []);
687
+
688
+ if (tokenString) {
689
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
690
+ }
691
+ }
692
+
693
+ let urlPath = `/v1/account/file-tags`;
694
+
695
+ const response = await this.request({
696
+ path: urlPath,
697
+ method: 'GET',
698
+ headers: headerParameters,
699
+ query: queryParameters,
700
+ }, initOverrides);
701
+
702
+ return new runtime.JSONApiResponse(response, (jsonValue) => TagListFromJSON(jsonValue));
703
+ }
704
+
705
+ /**
706
+ * Returns every tag in use on the account\'s files and directories, each once, for suggesting tags as they are typed. Pass one to the list operation\'s `tag` to list the files and directories that have it. A tag that has just been added or removed may take a moment to be reflected here. Also returns the reserved tags, which give an item a meaning Spaciv acts on, with the kinds of item each can be added to. Requires the *View file storage* permission.
707
+ * List the account\'s file and directory tags
708
+ */
709
+ async listAccountFileTags(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TagList> {
710
+ const response = await this.listAccountFileTagsRaw(initOverrides);
711
+ return await response.value();
712
+ }
713
+
714
+ /**
715
+ * Without `parent` or `tag`, 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. With `tag`, returns a page of the files and directories that have that tag, wherever they are: the files in `files` and the directories in `directories`, each most recently created first. The contents of a tagged directory are not included unless they have the tag themselves. Giving both `parent` and `tag` is rejected with 400, and so is a tag that is not at most 32 letters, digits and hyphens. When `nextCursor` is present there are more items to fetch; pass it back as `cursor`, with the same `parent` or `tag`, to retrieve the following page. A page may come back shorter than `limit` while still having a `nextCursor`, and may have neither files nor directories. A file that has just been uploaded, moved, renamed or tagged 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.
657
716
  * List the account\'s files
658
717
  */
659
718
  async listAccountFilesRaw(requestParameters: FilesApiListAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListPage>> {
@@ -671,6 +730,10 @@ export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
671
730
  queryParameters['parent'] = requestParameters['parent'];
672
731
  }
673
732
 
733
+ if (requestParameters['tag'] != null) {
734
+ queryParameters['tag'] = requestParameters['tag'];
735
+ }
736
+
674
737
  const headerParameters: runtime.HTTPHeaders = {};
675
738
 
676
739
  if (this.configuration && this.configuration.accessToken) {
@@ -695,7 +758,7 @@ export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
695
758
  }
696
759
 
697
760
  /**
698
- * 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.
761
+ * Without `parent` or `tag`, 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. With `tag`, returns a page of the files and directories that have that tag, wherever they are: the files in `files` and the directories in `directories`, each most recently created first. The contents of a tagged directory are not included unless they have the tag themselves. Giving both `parent` and `tag` is rejected with 400, and so is a tag that is not at most 32 letters, digits and hyphens. When `nextCursor` is present there are more items to fetch; pass it back as `cursor`, with the same `parent` or `tag`, to retrieve the following page. A page may come back shorter than `limit` while still having a `nextCursor`, and may have neither files nor directories. A file that has just been uploaded, moved, renamed or tagged 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.
699
762
  * List the account\'s files
700
763
  */
701
764
  async listAccountFiles(requestParameters: FilesApiListAccountFilesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListPage> {
@@ -704,8 +767,8 @@ export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
704
767
  }
705
768
 
706
769
  /**
707
- * 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.
708
- * Rename or move a directory
770
+ * Changes a directory\'s name, moves it into another directory, changes its tags, or any of these, and returns the updated directory. Give `name`, `parentId`, `addTags`, `removeTags` or any of them; a body with none is rejected with 400. Everything inside the directory moves with it and keeps its identifier, so anything referencing those files keeps working. A rename or move and a tag change made in one request are saved, and audited, one after the other. 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. Tags are added and removed as given, without replacing the directory\'s other tags, so two people tagging the same directory at once do not undo each other\'s changes. A tag cannot be both added and removed in one request. The files and directories inside do not take on the directory\'s tags. Some tags are reserved: they give an item a meaning Spaciv acts on, and `GET /v1/account/file-tags` lists them. `skill` marks a directory as a skill. Adding or removing a reserved tag, or renaming, moving, retagging or deleting a directory that has one, needs the permission that tag requires (*Manage my account* for `skill`), and so does any change to a directory inside one that has it, at any depth, including moving it into or out of one; otherwise the request is rejected with 403. A reserved tag may check the directory it is on, when it is added and whenever the directory or anything inside it changes, and record what it finds in `tagProblems` rather than refusing the change. 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.
771
+ * Rename, move or tag a directory
709
772
  */
710
773
  async updateAccountDirectoriesRaw(requestParameters: FilesApiUpdateAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Directory>> {
711
774
  if (requestParameters['id'] == null) {
@@ -752,8 +815,8 @@ export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
752
815
  }
753
816
 
754
817
  /**
755
- * 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.
756
- * Rename or move a directory
818
+ * Changes a directory\'s name, moves it into another directory, changes its tags, or any of these, and returns the updated directory. Give `name`, `parentId`, `addTags`, `removeTags` or any of them; a body with none is rejected with 400. Everything inside the directory moves with it and keeps its identifier, so anything referencing those files keeps working. A rename or move and a tag change made in one request are saved, and audited, one after the other. 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. Tags are added and removed as given, without replacing the directory\'s other tags, so two people tagging the same directory at once do not undo each other\'s changes. A tag cannot be both added and removed in one request. The files and directories inside do not take on the directory\'s tags. Some tags are reserved: they give an item a meaning Spaciv acts on, and `GET /v1/account/file-tags` lists them. `skill` marks a directory as a skill. Adding or removing a reserved tag, or renaming, moving, retagging or deleting a directory that has one, needs the permission that tag requires (*Manage my account* for `skill`), and so does any change to a directory inside one that has it, at any depth, including moving it into or out of one; otherwise the request is rejected with 403. A reserved tag may check the directory it is on, when it is added and whenever the directory or anything inside it changes, and record what it finds in `tagProblems` rather than refusing the change. 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.
819
+ * Rename, move or tag a directory
757
820
  */
758
821
  async updateAccountDirectories(requestParameters: FilesApiUpdateAccountDirectoriesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Directory> {
759
822
  const response = await this.updateAccountDirectoriesRaw(requestParameters, initOverrides);
@@ -761,8 +824,8 @@ export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
761
824
  }
762
825
 
763
826
  /**
764
- * 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.
765
- * Rename or move an account file
827
+ * Changes the display name of a file stored against the account, moves it into another directory, changes its tags, or any of these, and returns the updated record. Give `name`, `parentId`, `addTags`, `removeTags` or any of them; a body with none is rejected with 400. The stored content, media type, size and identifier are untouched, so anything already referencing the file keeps working. A rename or move and a tag change made in one request are saved, and audited, one after the other. 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. Tags are added and removed as given, without replacing the file\'s other tags, so two people tagging the same file at once do not undo each other\'s changes. A tag cannot be both added and removed in one request. Some tags are reserved: they give an item a meaning Spaciv acts on, and `GET /v1/account/file-tags` lists them. A reserved tag can only be added to the kinds of item it applies to, so `skill` on a file is rejected with 400. Adding or removing a reserved tag, or renaming, moving, retagging or deleting an item that has one, needs the permission that tag requires (*Manage my account* for `skill`), and so does any change to a file inside a directory that has one, at any depth, including moving the file into or out of it; otherwise the request is rejected with 403. A reserved tag may check the item it is on, when it is added and after the item changes, and record what it finds in `tagProblems` rather than refusing the change. 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 changed during the request, and the request can be retried as it stands. Requires the *Edit file storage* permission.
828
+ * Rename, move or tag an account file
766
829
  */
767
830
  async updateAccountFilesRaw(requestParameters: FilesApiUpdateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelRecord>> {
768
831
  if (requestParameters['id'] == null) {
@@ -809,8 +872,8 @@ export class FilesApi extends runtime.BaseAPI implements FilesApiInterface {
809
872
  }
810
873
 
811
874
  /**
812
- * 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.
813
- * Rename or move an account file
875
+ * Changes the display name of a file stored against the account, moves it into another directory, changes its tags, or any of these, and returns the updated record. Give `name`, `parentId`, `addTags`, `removeTags` or any of them; a body with none is rejected with 400. The stored content, media type, size and identifier are untouched, so anything already referencing the file keeps working. A rename or move and a tag change made in one request are saved, and audited, one after the other. 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. Tags are added and removed as given, without replacing the file\'s other tags, so two people tagging the same file at once do not undo each other\'s changes. A tag cannot be both added and removed in one request. Some tags are reserved: they give an item a meaning Spaciv acts on, and `GET /v1/account/file-tags` lists them. A reserved tag can only be added to the kinds of item it applies to, so `skill` on a file is rejected with 400. Adding or removing a reserved tag, or renaming, moving, retagging or deleting an item that has one, needs the permission that tag requires (*Manage my account* for `skill`), and so does any change to a file inside a directory that has one, at any depth, including moving the file into or out of it; otherwise the request is rejected with 403. A reserved tag may check the item it is on, when it is added and after the item changes, and record what it finds in `tagProblems` rather than refusing the change. 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 changed during the request, and the request can be retried as it stands. Requires the *Edit file storage* permission.
876
+ * Rename, move or tag an account file
814
877
  */
815
878
  async updateAccountFiles(requestParameters: FilesApiUpdateAccountFilesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelRecord> {
816
879
  const response = await this.updateAccountFilesRaw(requestParameters, initOverrides);
@@ -117,7 +117,7 @@ export interface InternalApiInterface {
117
117
  createAdminFlushDeadLetters(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
118
118
 
119
119
  /**
120
- * Copies all scenarios, properties, object groups, top-down models, datasets, space rulesets, projects, dashboards, floor plans, and account variables from a named template account into the caller\'s account. Local development uses the seeded local template account for both data and files, and returns 409 until its data and available files are imported. Populating an account from itself is rejected. Requires the *Project admin controls* and *Sys admin* permissions.
120
+ * Copies all files and their folders, scenarios, properties, object groups and their images, top-down models, datasets, data collections (as drafts without contributors), space rulesets, projects, dashboards, floor plans, and account variables from a named template account into the caller\'s account. Local development uses the seeded local template account for both data and files, and returns 409 until its data and available files are imported. Populating an account from itself is rejected. Requires the *Project admin controls* and *Sys admin* permissions.
121
121
  * @summary Populate account from template
122
122
  * @param {number} body
123
123
  * @param {*} [options] Override http request option.
@@ -127,7 +127,7 @@ export interface InternalApiInterface {
127
127
  createAdminPopulateRaw(requestParameters: InternalApiCreateAdminPopulateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
128
128
 
129
129
  /**
130
- * Copies all scenarios, properties, object groups, top-down models, datasets, space rulesets, projects, dashboards, floor plans, and account variables from a named template account into the caller\'s account. Local development uses the seeded local template account for both data and files, and returns 409 until its data and available files are imported. Populating an account from itself is rejected. Requires the *Project admin controls* and *Sys admin* permissions.
130
+ * Copies all files and their folders, scenarios, properties, object groups and their images, top-down models, datasets, data collections (as drafts without contributors), space rulesets, projects, dashboards, floor plans, and account variables from a named template account into the caller\'s account. Local development uses the seeded local template account for both data and files, and returns 409 until its data and available files are imported. Populating an account from itself is rejected. Requires the *Project admin controls* and *Sys admin* permissions.
131
131
  * Populate account from template
132
132
  */
133
133
  createAdminPopulate(requestParameters: InternalApiCreateAdminPopulateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
@@ -380,7 +380,7 @@ export class InternalApi extends runtime.BaseAPI implements InternalApiInterface
380
380
  }
381
381
 
382
382
  /**
383
- * Copies all scenarios, properties, object groups, top-down models, datasets, space rulesets, projects, dashboards, floor plans, and account variables from a named template account into the caller\'s account. Local development uses the seeded local template account for both data and files, and returns 409 until its data and available files are imported. Populating an account from itself is rejected. Requires the *Project admin controls* and *Sys admin* permissions.
383
+ * Copies all files and their folders, scenarios, properties, object groups and their images, top-down models, datasets, data collections (as drafts without contributors), space rulesets, projects, dashboards, floor plans, and account variables from a named template account into the caller\'s account. Local development uses the seeded local template account for both data and files, and returns 409 until its data and available files are imported. Populating an account from itself is rejected. Requires the *Project admin controls* and *Sys admin* permissions.
384
384
  * Populate account from template
385
385
  */
386
386
  async createAdminPopulateRaw(requestParameters: InternalApiCreateAdminPopulateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
@@ -420,7 +420,7 @@ export class InternalApi extends runtime.BaseAPI implements InternalApiInterface
420
420
  }
421
421
 
422
422
  /**
423
- * Copies all scenarios, properties, object groups, top-down models, datasets, space rulesets, projects, dashboards, floor plans, and account variables from a named template account into the caller\'s account. Local development uses the seeded local template account for both data and files, and returns 409 until its data and available files are imported. Populating an account from itself is rejected. Requires the *Project admin controls* and *Sys admin* permissions.
423
+ * Copies all files and their folders, scenarios, properties, object groups and their images, top-down models, datasets, data collections (as drafts without contributors), space rulesets, projects, dashboards, floor plans, and account variables from a named template account into the caller\'s account. Local development uses the seeded local template account for both data and files, and returns 409 until its data and available files are imported. Populating an account from itself is rejected. Requires the *Project admin controls* and *Sys admin* permissions.
424
424
  * Populate account from template
425
425
  */
426
426
  async createAdminPopulate(requestParameters: InternalApiCreateAdminPopulateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
@@ -19,6 +19,12 @@ import { mapValues } from '../runtime';
19
19
  * @interface AccountDirectoryPatchBody
20
20
  */
21
21
  export interface AccountDirectoryPatchBody {
22
+ /**
23
+ * Tags to add to the directory. Each is lowercased and must then be at most 32 letters, digits and hyphens, starting with a letter or digit. A directory can have at most 20 tags.
24
+ * @type {Array<string>}
25
+ * @memberof AccountDirectoryPatchBody
26
+ */
27
+ addTags?: Array<string>;
22
28
  /**
23
29
  * New display name for the directory. At most 255 bytes after normalising to Unicode NFC. Must not contain a forward slash or a backslash, and must not be . or ..
24
30
  * @type {string}
@@ -31,6 +37,12 @@ export interface AccountDirectoryPatchBody {
31
37
  * @memberof AccountDirectoryPatchBody
32
38
  */
33
39
  parentId?: string;
40
+ /**
41
+ * Tags to remove from the directory. Removing a tag the directory does not have changes nothing.
42
+ * @type {Array<string>}
43
+ * @memberof AccountDirectoryPatchBody
44
+ */
45
+ removeTags?: Array<string>;
34
46
  }
35
47
 
36
48
  /**
@@ -50,8 +62,10 @@ export function AccountDirectoryPatchBodyFromJSONTyped(json: any, ignoreDiscrimi
50
62
  }
51
63
  return {
52
64
 
65
+ 'addTags': json['addTags'] == null ? undefined : json['addTags'],
53
66
  'name': json['name'] == null ? undefined : json['name'],
54
67
  'parentId': json['parentId'] == null ? undefined : json['parentId'],
68
+ 'removeTags': json['removeTags'] == null ? undefined : json['removeTags'],
55
69
  };
56
70
  }
57
71
 
@@ -66,8 +80,10 @@ export function AccountDirectoryPatchBodyToJSONTyped(value?: AccountDirectoryPat
66
80
 
67
81
  return {
68
82
 
83
+ 'addTags': value['addTags'],
69
84
  'name': value['name'],
70
85
  'parentId': value['parentId'],
86
+ 'removeTags': value['removeTags'],
71
87
  };
72
88
  }
73
89
 
@@ -0,0 +1,66 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * spaciv API
5
+ * The spaciv API powers workplace planning: modelling how many people an organisation has, how they work, and how much space that requires. ## Getting started 1. Exchange credentials for an access token using one of the operations under **Authentication**. 2. Send that token on every subsequent request as `Authorization: Bearer <token>`. 3. Access tokens are short lived. Call `POST /v1/auth/refresh-token` to obtain a new one before the old one expires. ## Conventions Every operation is versioned under `/v1`. Collections are plural (`GET /v1/dashboards` lists, `POST /v1/dashboards` creates) and individual records live beneath them (`/v1/dashboards/{id}`). Singular paths such as `/v1/account`, `/v1/project` and `/v1/user` refer to the record the access token was issued for. Request and response bodies are JSON. Timestamps are RFC 3339. Identifiers are opaque strings unless documented otherwise, and collection operations return the records visible to the account the token was issued for. Failures return an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem document with a `detail` field describing what went wrong.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@spaciv.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface AccountDuplicateReqBody
20
+ */
21
+ export interface AccountDuplicateReqBody {
22
+ /**
23
+ * Display name of the new account. Must not already be in use.
24
+ * @type {string}
25
+ * @memberof AccountDuplicateReqBody
26
+ */
27
+ name: string;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the AccountDuplicateReqBody interface.
32
+ */
33
+ export function instanceOfAccountDuplicateReqBody(value: object): value is AccountDuplicateReqBody {
34
+ if (!('name' in value) || value['name'] === undefined) return false;
35
+ return true;
36
+ }
37
+
38
+ export function AccountDuplicateReqBodyFromJSON(json: any): AccountDuplicateReqBody {
39
+ return AccountDuplicateReqBodyFromJSONTyped(json, false);
40
+ }
41
+
42
+ export function AccountDuplicateReqBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountDuplicateReqBody {
43
+ if (json == null) {
44
+ return json;
45
+ }
46
+ return {
47
+
48
+ 'name': json['name'],
49
+ };
50
+ }
51
+
52
+ export function AccountDuplicateReqBodyToJSON(json: any): AccountDuplicateReqBody {
53
+ return AccountDuplicateReqBodyToJSONTyped(json, false);
54
+ }
55
+
56
+ export function AccountDuplicateReqBodyToJSONTyped(value?: AccountDuplicateReqBody | null, ignoreDiscriminator: boolean = false): any {
57
+ if (value == null) {
58
+ return value;
59
+ }
60
+
61
+ return {
62
+
63
+ 'name': value['name'],
64
+ };
65
+ }
66
+
@@ -19,6 +19,12 @@ import { mapValues } from '../runtime';
19
19
  * @interface AccountFilePatchBody
20
20
  */
21
21
  export interface AccountFilePatchBody {
22
+ /**
23
+ * Tags to add to the file. Each is lowercased and must then be at most 32 letters, digits and hyphens, starting with a letter or digit. A file can have at most 20 tags.
24
+ * @type {Array<string>}
25
+ * @memberof AccountFilePatchBody
26
+ */
27
+ addTags?: Array<string>;
22
28
  /**
23
29
  * New display name for the file. At most 255 bytes after normalising to Unicode NFC. Must not contain a forward slash or a backslash.
24
30
  * @type {string}
@@ -31,6 +37,12 @@ export interface AccountFilePatchBody {
31
37
  * @memberof AccountFilePatchBody
32
38
  */
33
39
  parentId?: string;
40
+ /**
41
+ * Tags to remove from the file. Removing a tag the file does not have changes nothing.
42
+ * @type {Array<string>}
43
+ * @memberof AccountFilePatchBody
44
+ */
45
+ removeTags?: Array<string>;
34
46
  }
35
47
 
36
48
  /**
@@ -50,8 +62,10 @@ export function AccountFilePatchBodyFromJSONTyped(json: any, ignoreDiscriminator
50
62
  }
51
63
  return {
52
64
 
65
+ 'addTags': json['addTags'] == null ? undefined : json['addTags'],
53
66
  'name': json['name'] == null ? undefined : json['name'],
54
67
  'parentId': json['parentId'] == null ? undefined : json['parentId'],
68
+ 'removeTags': json['removeTags'] == null ? undefined : json['removeTags'],
55
69
  };
56
70
  }
57
71
 
@@ -66,8 +80,10 @@ export function AccountFilePatchBodyToJSONTyped(value?: AccountFilePatchBody | n
66
80
 
67
81
  return {
68
82
 
83
+ 'addTags': value['addTags'],
69
84
  'name': value['name'],
70
85
  'parentId': value['parentId'],
86
+ 'removeTags': value['removeTags'],
71
87
  };
72
88
  }
73
89
 
@@ -49,6 +49,18 @@ export interface Directory {
49
49
  * @memberof Directory
50
50
  */
51
51
  parentId?: string;
52
+ /**
53
+ * Problems found with the directory by its reserved tags' checks, by tag. Absent when there are none.
54
+ * @type {{ [key: string]: Array<string>; }}
55
+ * @memberof Directory
56
+ */
57
+ tagProblems?: { [key: string]: Array<string>; };
58
+ /**
59
+ * The directory's tags, in alphabetical order. Absent when the directory has none.
60
+ * @type {Array<string>}
61
+ * @memberof Directory
62
+ */
63
+ tags?: Array<string>;
52
64
  }
53
65
 
54
66
  /**
@@ -77,6 +89,8 @@ export function DirectoryFromJSONTyped(json: any, ignoreDiscriminator: boolean):
77
89
  'id': json['id'],
78
90
  'name': json['name'],
79
91
  'parentId': json['parentId'] == null ? undefined : json['parentId'],
92
+ 'tagProblems': json['tagProblems'] == null ? undefined : json['tagProblems'],
93
+ 'tags': json['tags'] == null ? undefined : json['tags'],
80
94
  };
81
95
  }
82
96
 
@@ -96,6 +110,8 @@ export function DirectoryToJSONTyped(value?: Directory | null, ignoreDiscriminat
96
110
  'id': value['id'],
97
111
  'name': value['name'],
98
112
  'parentId': value['parentId'],
113
+ 'tagProblems': value['tagProblems'],
114
+ 'tags': value['tags'],
99
115
  };
100
116
  }
101
117
 
@@ -35,7 +35,7 @@ import {
35
35
  */
36
36
  export interface ListPage {
37
37
  /**
38
- * Directories directly inside the listed directory. Returned only when a parent is given, and only on the pages that hold some.
38
+ * With a parent, the directories directly inside it; with a tag, the directories that have it. Returned only on the pages that hold some.
39
39
  * @type {Array<Directory>}
40
40
  * @memberof ListPage
41
41
  */