@spaciv/sdk 0.1.26 → 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.
- package/.openapi-generator/FILES +2 -0
- package/README.md +2 -2
- package/dist/apis/FilesApi.d.ts +52 -27
- package/dist/apis/FilesApi.js +50 -12
- package/dist/esm/apis/FilesApi.d.ts +52 -27
- package/dist/esm/apis/FilesApi.js +51 -13
- package/dist/esm/models/AccountDirectoryPatchBody.d.ts +12 -0
- package/dist/esm/models/AccountDirectoryPatchBody.js +4 -0
- package/dist/esm/models/AccountFilePatchBody.d.ts +12 -0
- package/dist/esm/models/AccountFilePatchBody.js +4 -0
- package/dist/esm/models/Directory.d.ts +14 -0
- package/dist/esm/models/Directory.js +4 -0
- package/dist/esm/models/ListPage.d.ts +1 -1
- package/dist/esm/models/ModelRecord.d.ts +14 -0
- package/dist/esm/models/ModelRecord.js +4 -0
- package/dist/esm/models/ReservedTagInfo.d.ts +46 -0
- package/dist/esm/models/ReservedTagInfo.js +54 -0
- package/dist/esm/models/TagList.d.ts +39 -0
- package/dist/esm/models/TagList.js +48 -0
- package/dist/esm/models/index.d.ts +2 -0
- package/dist/esm/models/index.js +2 -0
- package/dist/models/AccountDirectoryPatchBody.d.ts +12 -0
- package/dist/models/AccountDirectoryPatchBody.js +4 -0
- package/dist/models/AccountFilePatchBody.d.ts +12 -0
- package/dist/models/AccountFilePatchBody.js +4 -0
- package/dist/models/Directory.d.ts +14 -0
- package/dist/models/Directory.js +4 -0
- package/dist/models/ListPage.d.ts +1 -1
- package/dist/models/ModelRecord.d.ts +14 -0
- package/dist/models/ModelRecord.js +4 -0
- package/dist/models/ReservedTagInfo.d.ts +46 -0
- package/dist/models/ReservedTagInfo.js +62 -0
- package/dist/models/TagList.d.ts +39 -0
- package/dist/models/TagList.js +55 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/package.json +1 -1
- package/src/apis/FilesApi.ts +89 -26
- package/src/models/AccountDirectoryPatchBody.ts +16 -0
- package/src/models/AccountFilePatchBody.ts +16 -0
- package/src/models/Directory.ts +16 -0
- package/src/models/ListPage.ts +1 -1
- package/src/models/ModelRecord.ts +16 -0
- package/src/models/ReservedTagInfo.ts +86 -0
- package/src/models/TagList.ts +83 -0
- package/src/models/index.ts +2 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* spaciv API
|
|
6
|
+
* 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.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
* Contact: support@spaciv.com
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.instanceOfTagList = instanceOfTagList;
|
|
17
|
+
exports.TagListFromJSON = TagListFromJSON;
|
|
18
|
+
exports.TagListFromJSONTyped = TagListFromJSONTyped;
|
|
19
|
+
exports.TagListToJSON = TagListToJSON;
|
|
20
|
+
exports.TagListToJSONTyped = TagListToJSONTyped;
|
|
21
|
+
const ReservedTagInfo_1 = require("./ReservedTagInfo");
|
|
22
|
+
/**
|
|
23
|
+
* Check if a given object implements the TagList interface.
|
|
24
|
+
*/
|
|
25
|
+
function instanceOfTagList(value) {
|
|
26
|
+
if (!('reserved' in value) || value['reserved'] === undefined)
|
|
27
|
+
return false;
|
|
28
|
+
if (!('tags' in value) || value['tags'] === undefined)
|
|
29
|
+
return false;
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
function TagListFromJSON(json) {
|
|
33
|
+
return TagListFromJSONTyped(json, false);
|
|
34
|
+
}
|
|
35
|
+
function TagListFromJSONTyped(json, ignoreDiscriminator) {
|
|
36
|
+
if (json == null) {
|
|
37
|
+
return json;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
'reserved': (json['reserved'].map(ReservedTagInfo_1.ReservedTagInfoFromJSON)),
|
|
41
|
+
'tags': json['tags'],
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function TagListToJSON(json) {
|
|
45
|
+
return TagListToJSONTyped(json, false);
|
|
46
|
+
}
|
|
47
|
+
function TagListToJSONTyped(value, ignoreDiscriminator = false) {
|
|
48
|
+
if (value == null) {
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
'reserved': (value['reserved'].map(ReservedTagInfo_1.ReservedTagInfoToJSON)),
|
|
53
|
+
'tags': value['tags'],
|
|
54
|
+
};
|
|
55
|
+
}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -307,6 +307,7 @@ export * from './ReferencesRes';
|
|
|
307
307
|
export * from './RelationshipData';
|
|
308
308
|
export * from './RepairFloorplansResBody';
|
|
309
309
|
export * from './ReportParamsWrapperBody';
|
|
310
|
+
export * from './ReservedTagInfo';
|
|
310
311
|
export * from './RetriesResBody';
|
|
311
312
|
export * from './RetryBody';
|
|
312
313
|
export * from './RoleTagsData';
|
|
@@ -368,6 +369,7 @@ export * from './SpaceRulesetListEntry';
|
|
|
368
369
|
export * from './SpaceRulesetUpdate';
|
|
369
370
|
export * from './Step';
|
|
370
371
|
export * from './SysAdminUpdateFeatureGroupsParamsWrapperBody';
|
|
372
|
+
export * from './TagList';
|
|
371
373
|
export * from './TopDownModelChangelogBody';
|
|
372
374
|
export * from './TopDownModelEntry';
|
|
373
375
|
export * from './TopDownModelEntryChangelogBody';
|
package/dist/models/index.js
CHANGED
|
@@ -325,6 +325,7 @@ __exportStar(require("./ReferencesRes"), exports);
|
|
|
325
325
|
__exportStar(require("./RelationshipData"), exports);
|
|
326
326
|
__exportStar(require("./RepairFloorplansResBody"), exports);
|
|
327
327
|
__exportStar(require("./ReportParamsWrapperBody"), exports);
|
|
328
|
+
__exportStar(require("./ReservedTagInfo"), exports);
|
|
328
329
|
__exportStar(require("./RetriesResBody"), exports);
|
|
329
330
|
__exportStar(require("./RetryBody"), exports);
|
|
330
331
|
__exportStar(require("./RoleTagsData"), exports);
|
|
@@ -386,6 +387,7 @@ __exportStar(require("./SpaceRulesetListEntry"), exports);
|
|
|
386
387
|
__exportStar(require("./SpaceRulesetUpdate"), exports);
|
|
387
388
|
__exportStar(require("./Step"), exports);
|
|
388
389
|
__exportStar(require("./SysAdminUpdateFeatureGroupsParamsWrapperBody"), exports);
|
|
390
|
+
__exportStar(require("./TagList"), exports);
|
|
389
391
|
__exportStar(require("./TopDownModelChangelogBody"), exports);
|
|
390
392
|
__exportStar(require("./TopDownModelEntry"), exports);
|
|
391
393
|
__exportStar(require("./TopDownModelEntryChangelogBody"), exports);
|
package/package.json
CHANGED
package/src/apis/FilesApi.ts
CHANGED
|
@@ -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
|
-
*
|
|
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
|
|
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
|
|
243
|
-
* @summary Rename or
|
|
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
|
|
254
|
-
* Rename or
|
|
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
|
|
260
|
-
* @summary Rename or
|
|
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
|
|
271
|
-
* Rename or
|
|
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
|
-
*
|
|
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
|
|
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
|
|
708
|
-
* Rename or
|
|
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
|
|
756
|
-
* Rename or
|
|
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
|
|
765
|
-
* Rename or
|
|
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
|
|
813
|
-
* Rename or
|
|
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);
|
|
@@ -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
|
|
|
@@ -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
|
|
package/src/models/Directory.ts
CHANGED
|
@@ -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
|
|
package/src/models/ListPage.ts
CHANGED
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
*/
|
|
36
36
|
export interface ListPage {
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
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
|
*/
|