@spaciv/sdk 0.1.19 → 0.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/.openapi-generator/FILES +4 -0
  2. package/README.md +2 -2
  3. package/dist/apis/FilesApi.d.ts +132 -18
  4. package/dist/apis/FilesApi.js +175 -8
  5. package/dist/esm/apis/FilesApi.d.ts +132 -18
  6. package/dist/esm/apis/FilesApi.js +176 -9
  7. package/dist/esm/models/AccountDirectoryPatchBody.d.ts +38 -0
  8. package/dist/esm/models/AccountDirectoryPatchBody.js +43 -0
  9. package/dist/esm/models/AccountDirectoryPostBody.d.ts +38 -0
  10. package/dist/esm/models/AccountDirectoryPostBody.js +45 -0
  11. package/dist/esm/models/AccountFilePatchBody.d.ts +8 -2
  12. package/dist/esm/models/AccountFilePatchBody.js +3 -3
  13. package/dist/esm/models/Directory.d.ts +56 -0
  14. package/dist/esm/models/Directory.js +57 -0
  15. package/dist/esm/models/DirectoryPage.d.ts +39 -0
  16. package/dist/esm/models/DirectoryPage.js +46 -0
  17. package/dist/esm/models/ListPage.d.ts +7 -0
  18. package/dist/esm/models/ListPage.js +3 -0
  19. package/dist/esm/models/ModelRecord.d.ts +7 -1
  20. package/dist/esm/models/ModelRecord.js +2 -0
  21. package/dist/esm/models/index.d.ts +4 -0
  22. package/dist/esm/models/index.js +4 -0
  23. package/dist/models/AccountDirectoryPatchBody.d.ts +38 -0
  24. package/dist/models/AccountDirectoryPatchBody.js +50 -0
  25. package/dist/models/AccountDirectoryPostBody.d.ts +38 -0
  26. package/dist/models/AccountDirectoryPostBody.js +52 -0
  27. package/dist/models/AccountFilePatchBody.d.ts +8 -2
  28. package/dist/models/AccountFilePatchBody.js +3 -3
  29. package/dist/models/Directory.d.ts +56 -0
  30. package/dist/models/Directory.js +64 -0
  31. package/dist/models/DirectoryPage.d.ts +39 -0
  32. package/dist/models/DirectoryPage.js +53 -0
  33. package/dist/models/ListPage.d.ts +7 -0
  34. package/dist/models/ListPage.js +3 -0
  35. package/dist/models/ModelRecord.d.ts +7 -1
  36. package/dist/models/ModelRecord.js +2 -0
  37. package/dist/models/index.d.ts +4 -0
  38. package/dist/models/index.js +4 -0
  39. package/package.json +1 -1
  40. package/src/apis/FilesApi.ts +319 -17
  41. package/src/models/AccountDirectoryPatchBody.ts +73 -0
  42. package/src/models/AccountDirectoryPostBody.ts +74 -0
  43. package/src/models/AccountFilePatchBody.ts +11 -4
  44. package/src/models/Directory.ts +101 -0
  45. package/src/models/DirectoryPage.ts +82 -0
  46. package/src/models/ListPage.ts +15 -0
  47. package/src/models/ModelRecord.ts +9 -1
  48. package/src/models/index.ts +4 -0
@@ -21,13 +21,53 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { AccountFilePatchBodyToJSON, ListPageFromJSON, ModelRecordFromJSON, } from '../models/index';
24
+ import { AccountDirectoryPatchBodyToJSON, AccountDirectoryPostBodyToJSON, AccountFilePatchBodyToJSON, DirectoryFromJSON, DirectoryPageFromJSON, ListPageFromJSON, ModelRecordFromJSON, } from '../models/index';
25
25
  /**
26
26
  *
27
27
  */
28
28
  export class FilesApi extends runtime.BaseAPI {
29
29
  /**
30
- * 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`. The uploaded file\'s name becomes the record\'s `name`, so it must be non-empty, at most 255 bytes and free of `/` and `\\`. 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, 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.
30
+ * Creates a directory to organise the files stored against the account, at the root or inside another directory, and returns it. Directories can be nested at most 8 deep. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly: a name already taken there by a file or a directory is rejected with 409. Returns 404 if the account has no directory with the given `parentId`. A directory takes up none of the account\'s storage quota. Requires the *Edit file storage* permission.
31
+ * Create a directory in the account\'s files
32
+ */
33
+ createAccountDirectoriesRaw(requestParameters, initOverrides) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ if (requestParameters['accountDirectoryPostBody'] == null) {
36
+ throw new runtime.RequiredError('accountDirectoryPostBody', 'Required parameter "accountDirectoryPostBody" was null or undefined when calling createAccountDirectories().');
37
+ }
38
+ const queryParameters = {};
39
+ const headerParameters = {};
40
+ headerParameters['Content-Type'] = 'application/json';
41
+ if (this.configuration && this.configuration.accessToken) {
42
+ const token = this.configuration.accessToken;
43
+ const tokenString = yield token("accessToken", []);
44
+ if (tokenString) {
45
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
46
+ }
47
+ }
48
+ let urlPath = `/v1/account/directories`;
49
+ const response = yield this.request({
50
+ path: urlPath,
51
+ method: 'POST',
52
+ headers: headerParameters,
53
+ query: queryParameters,
54
+ body: AccountDirectoryPostBodyToJSON(requestParameters['accountDirectoryPostBody']),
55
+ }, initOverrides);
56
+ return new runtime.JSONApiResponse(response, (jsonValue) => DirectoryFromJSON(jsonValue));
57
+ });
58
+ }
59
+ /**
60
+ * Creates a directory to organise the files stored against the account, at the root or inside another directory, and returns it. Directories can be nested at most 8 deep. The name is normalised to Unicode NFC, and names are unique within a directory among its files and directories, compared exactly: a name already taken there by a file or a directory is rejected with 409. Returns 404 if the account has no directory with the given `parentId`. A directory takes up none of the account\'s storage quota. Requires the *Edit file storage* permission.
61
+ * Create a directory in the account\'s files
62
+ */
63
+ createAccountDirectories(requestParameters, initOverrides) {
64
+ return __awaiter(this, void 0, void 0, function* () {
65
+ const response = yield this.createAccountDirectoriesRaw(requestParameters, initOverrides);
66
+ return yield response.value();
67
+ });
68
+ }
69
+ /**
70
+ * 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.
31
71
  * Upload a file to the account
32
72
  */
33
73
  createAccountFilesRaw(requestParameters, initOverrides) {
@@ -74,7 +114,7 @@ export class FilesApi extends runtime.BaseAPI {
74
114
  });
75
115
  }
76
116
  /**
77
- * 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`. The uploaded file\'s name becomes the record\'s `name`, so it must be non-empty, at most 255 bytes and free of `/` and `\\`. 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, 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.
117
+ * 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.
78
118
  * Upload a file to the account
79
119
  */
80
120
  createAccountFiles() {
@@ -83,6 +123,45 @@ export class FilesApi extends runtime.BaseAPI {
83
123
  return yield response.value();
84
124
  });
85
125
  }
126
+ /**
127
+ * Deletes an empty directory from the account\'s files. A directory that still holds a file or another directory is rejected with 409 `directory is not empty`: move or delete its contents first. Deleting a directory that is already gone succeeds rather than returning 404. Any other 409 means the directory changed during the request, and the request can be retried. Requires the *Edit file storage* permission.
128
+ * Delete a directory
129
+ */
130
+ deleteAccountDirectoriesRaw(requestParameters, initOverrides) {
131
+ return __awaiter(this, void 0, void 0, function* () {
132
+ if (requestParameters['id'] == null) {
133
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteAccountDirectories().');
134
+ }
135
+ const queryParameters = {};
136
+ const headerParameters = {};
137
+ if (this.configuration && this.configuration.accessToken) {
138
+ const token = this.configuration.accessToken;
139
+ const tokenString = yield token("accessToken", []);
140
+ if (tokenString) {
141
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
142
+ }
143
+ }
144
+ let urlPath = `/v1/account/directories/{id}`;
145
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
146
+ const response = yield this.request({
147
+ path: urlPath,
148
+ method: 'DELETE',
149
+ headers: headerParameters,
150
+ query: queryParameters,
151
+ }, initOverrides);
152
+ return new runtime.JSONApiResponse(response);
153
+ });
154
+ }
155
+ /**
156
+ * Deletes an empty directory from the account\'s files. A directory that still holds a file or another directory is rejected with 409 `directory is not empty`: move or delete its contents first. Deleting a directory that is already gone succeeds rather than returning 404. Any other 409 means the directory changed during the request, and the request can be retried. Requires the *Edit file storage* permission.
157
+ * Delete a directory
158
+ */
159
+ deleteAccountDirectories(requestParameters, initOverrides) {
160
+ return __awaiter(this, void 0, void 0, function* () {
161
+ const response = yield this.deleteAccountDirectoriesRaw(requestParameters, initOverrides);
162
+ return yield response.value();
163
+ });
164
+ }
86
165
  /**
87
166
  * Permanently deletes a file stored against the account, removing both its record and its stored content. This cannot be undone and any link to the file stops working. The file\'s size stops counting towards the account\'s 1 GiB storage quota once its record is removed. The record is removed before the content, so a request that fails partway can leave the stored content behind; repeating the same request is what clears it. Deleting a file that is already gone succeeds rather than returning 404, so a failed delete should always be retried; that includes a 409, which means concurrent changes to the account\'s files kept changing its storage usage during the request. The identifier must be one returned by the upload or list operations; a malformed identifier is rejected with 400. Requires the *Edit file storage* permission.
88
167
  * Delete an account file
@@ -167,7 +246,48 @@ export class FilesApi extends runtime.BaseAPI {
167
246
  });
168
247
  }
169
248
  /**
170
- * Returns a page of the files stored against the account, most recently uploaded first. Files belonging to other accounts are never returned. When `nextCursor` is present there are more files to fetch; pass it back as `cursor` 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 may not appear here immediately, so clients should add the record returned by the upload operation to their list rather than refetching. Requires the *View file storage* permission.
249
+ * Returns a page of every directory in the account\'s files, at any depth, in the order they were created. Each directory gives its parent\'s identifier, so a client that fetches every page can build the whole tree. To list what is inside one directory, list the account\'s files with `parent` instead. When `nextCursor` is present there are more directories to fetch; pass it back as `cursor` to retrieve the following page. Requires the *View file storage* permission.
250
+ * List the account\'s directories
251
+ */
252
+ listAccountDirectoriesRaw(requestParameters, initOverrides) {
253
+ return __awaiter(this, void 0, void 0, function* () {
254
+ const queryParameters = {};
255
+ if (requestParameters['limit'] != null) {
256
+ queryParameters['limit'] = requestParameters['limit'];
257
+ }
258
+ if (requestParameters['cursor'] != null) {
259
+ queryParameters['cursor'] = requestParameters['cursor'];
260
+ }
261
+ const headerParameters = {};
262
+ if (this.configuration && this.configuration.accessToken) {
263
+ const token = this.configuration.accessToken;
264
+ const tokenString = yield token("accessToken", []);
265
+ if (tokenString) {
266
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
267
+ }
268
+ }
269
+ let urlPath = `/v1/account/directories`;
270
+ const response = yield this.request({
271
+ path: urlPath,
272
+ method: 'GET',
273
+ headers: headerParameters,
274
+ query: queryParameters,
275
+ }, initOverrides);
276
+ return new runtime.JSONApiResponse(response, (jsonValue) => DirectoryPageFromJSON(jsonValue));
277
+ });
278
+ }
279
+ /**
280
+ * Returns a page of every directory in the account\'s files, at any depth, in the order they were created. Each directory gives its parent\'s identifier, so a client that fetches every page can build the whole tree. To list what is inside one directory, list the account\'s files with `parent` instead. When `nextCursor` is present there are more directories to fetch; pass it back as `cursor` to retrieve the following page. Requires the *View file storage* permission.
281
+ * List the account\'s directories
282
+ */
283
+ listAccountDirectories() {
284
+ return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
285
+ const response = yield this.listAccountDirectoriesRaw(requestParameters, initOverrides);
286
+ return yield response.value();
287
+ });
288
+ }
289
+ /**
290
+ * 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.
171
291
  * List the account\'s files
172
292
  */
173
293
  listAccountFilesRaw(requestParameters, initOverrides) {
@@ -179,6 +299,9 @@ export class FilesApi extends runtime.BaseAPI {
179
299
  if (requestParameters['cursor'] != null) {
180
300
  queryParameters['cursor'] = requestParameters['cursor'];
181
301
  }
302
+ if (requestParameters['parent'] != null) {
303
+ queryParameters['parent'] = requestParameters['parent'];
304
+ }
182
305
  const headerParameters = {};
183
306
  if (this.configuration && this.configuration.accessToken) {
184
307
  const token = this.configuration.accessToken;
@@ -198,7 +321,7 @@ export class FilesApi extends runtime.BaseAPI {
198
321
  });
199
322
  }
200
323
  /**
201
- * Returns a page of the files stored against the account, most recently uploaded first. Files belonging to other accounts are never returned. When `nextCursor` is present there are more files to fetch; pass it back as `cursor` 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 may not appear here immediately, so clients should add the record returned by the upload operation to their list rather than refetching. Requires the *View file storage* permission.
324
+ * 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.
202
325
  * List the account\'s files
203
326
  */
204
327
  listAccountFiles() {
@@ -208,8 +331,52 @@ export class FilesApi extends runtime.BaseAPI {
208
331
  });
209
332
  }
210
333
  /**
211
- * Changes the display name of a file stored against the account and returns the updated record. Only the name changes: the stored content, media type, size and identifier are untouched, so anything already referencing the file keeps working. 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. Requires the *Edit file storage* permission.
212
- * Rename an account file
334
+ * 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.
335
+ * Rename or move a directory
336
+ */
337
+ updateAccountDirectoriesRaw(requestParameters, initOverrides) {
338
+ return __awaiter(this, void 0, void 0, function* () {
339
+ if (requestParameters['id'] == null) {
340
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling updateAccountDirectories().');
341
+ }
342
+ if (requestParameters['accountDirectoryPatchBody'] == null) {
343
+ throw new runtime.RequiredError('accountDirectoryPatchBody', 'Required parameter "accountDirectoryPatchBody" was null or undefined when calling updateAccountDirectories().');
344
+ }
345
+ const queryParameters = {};
346
+ const headerParameters = {};
347
+ headerParameters['Content-Type'] = 'application/json';
348
+ if (this.configuration && this.configuration.accessToken) {
349
+ const token = this.configuration.accessToken;
350
+ const tokenString = yield token("accessToken", []);
351
+ if (tokenString) {
352
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
353
+ }
354
+ }
355
+ let urlPath = `/v1/account/directories/{id}`;
356
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
357
+ const response = yield this.request({
358
+ path: urlPath,
359
+ method: 'PATCH',
360
+ headers: headerParameters,
361
+ query: queryParameters,
362
+ body: AccountDirectoryPatchBodyToJSON(requestParameters['accountDirectoryPatchBody']),
363
+ }, initOverrides);
364
+ return new runtime.JSONApiResponse(response, (jsonValue) => DirectoryFromJSON(jsonValue));
365
+ });
366
+ }
367
+ /**
368
+ * 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.
369
+ * Rename or move a directory
370
+ */
371
+ updateAccountDirectories(requestParameters, initOverrides) {
372
+ return __awaiter(this, void 0, void 0, function* () {
373
+ const response = yield this.updateAccountDirectoriesRaw(requestParameters, initOverrides);
374
+ return yield response.value();
375
+ });
376
+ }
377
+ /**
378
+ * 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.
379
+ * Rename or move an account file
213
380
  */
214
381
  updateAccountFilesRaw(requestParameters, initOverrides) {
215
382
  return __awaiter(this, void 0, void 0, function* () {
@@ -242,8 +409,8 @@ export class FilesApi extends runtime.BaseAPI {
242
409
  });
243
410
  }
244
411
  /**
245
- * Changes the display name of a file stored against the account and returns the updated record. Only the name changes: the stored content, media type, size and identifier are untouched, so anything already referencing the file keeps working. 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. Requires the *Edit file storage* permission.
246
- * Rename an account file
412
+ * 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.
413
+ * Rename or move an account file
247
414
  */
248
415
  updateAccountFiles(requestParameters, initOverrides) {
249
416
  return __awaiter(this, void 0, void 0, function* () {
@@ -0,0 +1,38 @@
1
+ /**
2
+ * spaciv API
3
+ * 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.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@spaciv.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface AccountDirectoryPatchBody
16
+ */
17
+ export interface AccountDirectoryPatchBody {
18
+ /**
19
+ * 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 ..
20
+ * @type {string}
21
+ * @memberof AccountDirectoryPatchBody
22
+ */
23
+ name?: string;
24
+ /**
25
+ * Identifier of the directory to move this one into, or an empty string to move it to the root.
26
+ * @type {string}
27
+ * @memberof AccountDirectoryPatchBody
28
+ */
29
+ parentId?: string;
30
+ }
31
+ /**
32
+ * Check if a given object implements the AccountDirectoryPatchBody interface.
33
+ */
34
+ export declare function instanceOfAccountDirectoryPatchBody(value: object): value is AccountDirectoryPatchBody;
35
+ export declare function AccountDirectoryPatchBodyFromJSON(json: any): AccountDirectoryPatchBody;
36
+ export declare function AccountDirectoryPatchBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountDirectoryPatchBody;
37
+ export declare function AccountDirectoryPatchBodyToJSON(json: any): AccountDirectoryPatchBody;
38
+ export declare function AccountDirectoryPatchBodyToJSONTyped(value?: AccountDirectoryPatchBody | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,43 @@
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
+ * Check if a given object implements the AccountDirectoryPatchBody interface.
16
+ */
17
+ export function instanceOfAccountDirectoryPatchBody(value) {
18
+ return true;
19
+ }
20
+ export function AccountDirectoryPatchBodyFromJSON(json) {
21
+ return AccountDirectoryPatchBodyFromJSONTyped(json, false);
22
+ }
23
+ export function AccountDirectoryPatchBodyFromJSONTyped(json, ignoreDiscriminator) {
24
+ if (json == null) {
25
+ return json;
26
+ }
27
+ return {
28
+ 'name': json['name'] == null ? undefined : json['name'],
29
+ 'parentId': json['parentId'] == null ? undefined : json['parentId'],
30
+ };
31
+ }
32
+ export function AccountDirectoryPatchBodyToJSON(json) {
33
+ return AccountDirectoryPatchBodyToJSONTyped(json, false);
34
+ }
35
+ export function AccountDirectoryPatchBodyToJSONTyped(value, ignoreDiscriminator = false) {
36
+ if (value == null) {
37
+ return value;
38
+ }
39
+ return {
40
+ 'name': value['name'],
41
+ 'parentId': value['parentId'],
42
+ };
43
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * spaciv API
3
+ * 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.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@spaciv.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface AccountDirectoryPostBody
16
+ */
17
+ export interface AccountDirectoryPostBody {
18
+ /**
19
+ * Display name of 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 ..
20
+ * @type {string}
21
+ * @memberof AccountDirectoryPostBody
22
+ */
23
+ name: string;
24
+ /**
25
+ * Identifier of the directory to create this one in. Leave it out to create it at the root.
26
+ * @type {string}
27
+ * @memberof AccountDirectoryPostBody
28
+ */
29
+ parentId?: string;
30
+ }
31
+ /**
32
+ * Check if a given object implements the AccountDirectoryPostBody interface.
33
+ */
34
+ export declare function instanceOfAccountDirectoryPostBody(value: object): value is AccountDirectoryPostBody;
35
+ export declare function AccountDirectoryPostBodyFromJSON(json: any): AccountDirectoryPostBody;
36
+ export declare function AccountDirectoryPostBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountDirectoryPostBody;
37
+ export declare function AccountDirectoryPostBodyToJSON(json: any): AccountDirectoryPostBody;
38
+ export declare function AccountDirectoryPostBodyToJSONTyped(value?: AccountDirectoryPostBody | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,45 @@
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
+ * Check if a given object implements the AccountDirectoryPostBody interface.
16
+ */
17
+ export function instanceOfAccountDirectoryPostBody(value) {
18
+ if (!('name' in value) || value['name'] === undefined)
19
+ return false;
20
+ return true;
21
+ }
22
+ export function AccountDirectoryPostBodyFromJSON(json) {
23
+ return AccountDirectoryPostBodyFromJSONTyped(json, false);
24
+ }
25
+ export function AccountDirectoryPostBodyFromJSONTyped(json, ignoreDiscriminator) {
26
+ if (json == null) {
27
+ return json;
28
+ }
29
+ return {
30
+ 'name': json['name'],
31
+ 'parentId': json['parentId'] == null ? undefined : json['parentId'],
32
+ };
33
+ }
34
+ export function AccountDirectoryPostBodyToJSON(json) {
35
+ return AccountDirectoryPostBodyToJSONTyped(json, false);
36
+ }
37
+ export function AccountDirectoryPostBodyToJSONTyped(value, ignoreDiscriminator = false) {
38
+ if (value == null) {
39
+ return value;
40
+ }
41
+ return {
42
+ 'name': value['name'],
43
+ 'parentId': value['parentId'],
44
+ };
45
+ }
@@ -16,11 +16,17 @@
16
16
  */
17
17
  export interface AccountFilePatchBody {
18
18
  /**
19
- * New display name for the file. Must not contain a forward slash or a backslash.
19
+ * New display name for the file. At most 255 bytes after normalising to Unicode NFC. Must not contain a forward slash or a backslash.
20
20
  * @type {string}
21
21
  * @memberof AccountFilePatchBody
22
22
  */
23
- name: string;
23
+ name?: string;
24
+ /**
25
+ * Identifier of the directory to move the file into, or an empty string to move it to the root.
26
+ * @type {string}
27
+ * @memberof AccountFilePatchBody
28
+ */
29
+ parentId?: string;
24
30
  }
25
31
  /**
26
32
  * Check if a given object implements the AccountFilePatchBody interface.
@@ -15,8 +15,6 @@
15
15
  * Check if a given object implements the AccountFilePatchBody interface.
16
16
  */
17
17
  export function instanceOfAccountFilePatchBody(value) {
18
- if (!('name' in value) || value['name'] === undefined)
19
- return false;
20
18
  return true;
21
19
  }
22
20
  export function AccountFilePatchBodyFromJSON(json) {
@@ -27,7 +25,8 @@ export function AccountFilePatchBodyFromJSONTyped(json, ignoreDiscriminator) {
27
25
  return json;
28
26
  }
29
27
  return {
30
- 'name': json['name'],
28
+ 'name': json['name'] == null ? undefined : json['name'],
29
+ 'parentId': json['parentId'] == null ? undefined : json['parentId'],
31
30
  };
32
31
  }
33
32
  export function AccountFilePatchBodyToJSON(json) {
@@ -39,5 +38,6 @@ export function AccountFilePatchBodyToJSONTyped(value, ignoreDiscriminator = fal
39
38
  }
40
39
  return {
41
40
  'name': value['name'],
41
+ 'parentId': value['parentId'],
42
42
  };
43
43
  }
@@ -0,0 +1,56 @@
1
+ /**
2
+ * spaciv API
3
+ * 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.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@spaciv.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface Directory
16
+ */
17
+ export interface Directory {
18
+ /**
19
+ * When the directory was created (RFC 3339).
20
+ * @type {Date}
21
+ * @memberof Directory
22
+ */
23
+ createdAt: Date;
24
+ /**
25
+ * Identifier of the user who created the directory.
26
+ * @type {number}
27
+ * @memberof Directory
28
+ */
29
+ createdBy: number;
30
+ /**
31
+ * Opaque identifier of the directory.
32
+ * @type {string}
33
+ * @memberof Directory
34
+ */
35
+ id: string;
36
+ /**
37
+ * Display name of the directory. Nothing else in the same parent has the same name, compared exactly and after normalising to Unicode NFC.
38
+ * @type {string}
39
+ * @memberof Directory
40
+ */
41
+ name: string;
42
+ /**
43
+ * Identifier of the directory this one is in. Absent for a directory at the root.
44
+ * @type {string}
45
+ * @memberof Directory
46
+ */
47
+ parentId?: string;
48
+ }
49
+ /**
50
+ * Check if a given object implements the Directory interface.
51
+ */
52
+ export declare function instanceOfDirectory(value: object): value is Directory;
53
+ export declare function DirectoryFromJSON(json: any): Directory;
54
+ export declare function DirectoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Directory;
55
+ export declare function DirectoryToJSON(json: any): Directory;
56
+ export declare function DirectoryToJSONTyped(value?: Directory | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,57 @@
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
+ * Check if a given object implements the Directory interface.
16
+ */
17
+ export function instanceOfDirectory(value) {
18
+ if (!('createdAt' in value) || value['createdAt'] === undefined)
19
+ return false;
20
+ if (!('createdBy' in value) || value['createdBy'] === undefined)
21
+ return false;
22
+ if (!('id' in value) || value['id'] === undefined)
23
+ return false;
24
+ if (!('name' in value) || value['name'] === undefined)
25
+ return false;
26
+ return true;
27
+ }
28
+ export function DirectoryFromJSON(json) {
29
+ return DirectoryFromJSONTyped(json, false);
30
+ }
31
+ export function DirectoryFromJSONTyped(json, ignoreDiscriminator) {
32
+ if (json == null) {
33
+ return json;
34
+ }
35
+ return {
36
+ 'createdAt': (new Date(json['createdAt'])),
37
+ 'createdBy': json['createdBy'],
38
+ 'id': json['id'],
39
+ 'name': json['name'],
40
+ 'parentId': json['parentId'] == null ? undefined : json['parentId'],
41
+ };
42
+ }
43
+ export function DirectoryToJSON(json) {
44
+ return DirectoryToJSONTyped(json, false);
45
+ }
46
+ export function DirectoryToJSONTyped(value, ignoreDiscriminator = false) {
47
+ if (value == null) {
48
+ return value;
49
+ }
50
+ return {
51
+ 'createdAt': ((value['createdAt']).toISOString()),
52
+ 'createdBy': value['createdBy'],
53
+ 'id': value['id'],
54
+ 'name': value['name'],
55
+ 'parentId': value['parentId'],
56
+ };
57
+ }