@spaciv/sdk 0.1.25 → 0.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/.openapi-generator/FILES +3 -0
  2. package/README.md +2 -2
  3. package/dist/apis/AccountsApi.d.ts +37 -10
  4. package/dist/apis/AccountsApi.js +49 -4
  5. package/dist/apis/FilesApi.d.ts +52 -27
  6. package/dist/apis/FilesApi.js +50 -12
  7. package/dist/apis/InternalApi.d.ts +4 -4
  8. package/dist/apis/InternalApi.js +2 -2
  9. package/dist/esm/apis/AccountsApi.d.ts +37 -10
  10. package/dist/esm/apis/AccountsApi.js +50 -5
  11. package/dist/esm/apis/FilesApi.d.ts +52 -27
  12. package/dist/esm/apis/FilesApi.js +51 -13
  13. package/dist/esm/apis/InternalApi.d.ts +4 -4
  14. package/dist/esm/apis/InternalApi.js +2 -2
  15. package/dist/esm/models/AccountDirectoryPatchBody.d.ts +12 -0
  16. package/dist/esm/models/AccountDirectoryPatchBody.js +4 -0
  17. package/dist/esm/models/AccountDuplicateReqBody.d.ts +32 -0
  18. package/dist/esm/models/AccountDuplicateReqBody.js +43 -0
  19. package/dist/esm/models/AccountFilePatchBody.d.ts +12 -0
  20. package/dist/esm/models/AccountFilePatchBody.js +4 -0
  21. package/dist/esm/models/Directory.d.ts +14 -0
  22. package/dist/esm/models/Directory.js +4 -0
  23. package/dist/esm/models/ListPage.d.ts +1 -1
  24. package/dist/esm/models/ModelRecord.d.ts +14 -0
  25. package/dist/esm/models/ModelRecord.js +4 -0
  26. package/dist/esm/models/ReservedTagInfo.d.ts +46 -0
  27. package/dist/esm/models/ReservedTagInfo.js +54 -0
  28. package/dist/esm/models/TagList.d.ts +39 -0
  29. package/dist/esm/models/TagList.js +48 -0
  30. package/dist/esm/models/index.d.ts +3 -0
  31. package/dist/esm/models/index.js +3 -0
  32. package/dist/models/AccountDirectoryPatchBody.d.ts +12 -0
  33. package/dist/models/AccountDirectoryPatchBody.js +4 -0
  34. package/dist/models/AccountDuplicateReqBody.d.ts +32 -0
  35. package/dist/models/AccountDuplicateReqBody.js +50 -0
  36. package/dist/models/AccountFilePatchBody.d.ts +12 -0
  37. package/dist/models/AccountFilePatchBody.js +4 -0
  38. package/dist/models/Directory.d.ts +14 -0
  39. package/dist/models/Directory.js +4 -0
  40. package/dist/models/ListPage.d.ts +1 -1
  41. package/dist/models/ModelRecord.d.ts +14 -0
  42. package/dist/models/ModelRecord.js +4 -0
  43. package/dist/models/ReservedTagInfo.d.ts +46 -0
  44. package/dist/models/ReservedTagInfo.js +62 -0
  45. package/dist/models/TagList.d.ts +39 -0
  46. package/dist/models/TagList.js +55 -0
  47. package/dist/models/index.d.ts +3 -0
  48. package/dist/models/index.js +3 -0
  49. package/package.json +1 -1
  50. package/src/apis/AccountsApi.ts +85 -9
  51. package/src/apis/FilesApi.ts +89 -26
  52. package/src/apis/InternalApi.ts +4 -4
  53. package/src/models/AccountDirectoryPatchBody.ts +16 -0
  54. package/src/models/AccountDuplicateReqBody.ts +66 -0
  55. package/src/models/AccountFilePatchBody.ts +16 -0
  56. package/src/models/Directory.ts +16 -0
  57. package/src/models/ListPage.ts +1 -1
  58. package/src/models/ModelRecord.ts +16 -0
  59. package/src/models/ReservedTagInfo.ts +86 -0
  60. package/src/models/TagList.ts +83 -0
  61. package/src/models/index.ts +3 -0
@@ -70,7 +70,7 @@ class FilesApi extends runtime.BaseAPI {
70
70
  });
71
71
  }
72
72
  /**
73
- * 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.
73
+ * 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.
74
74
  * Upload a file to the account
75
75
  */
76
76
  createAccountFilesRaw(requestParameters, initOverrides) {
@@ -117,7 +117,7 @@ class FilesApi extends runtime.BaseAPI {
117
117
  });
118
118
  }
119
119
  /**
120
- * 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.
120
+ * 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.
121
121
  * Upload a file to the account
122
122
  */
123
123
  createAccountFiles() {
@@ -330,7 +330,42 @@ class FilesApi extends runtime.BaseAPI {
330
330
  });
331
331
  }
332
332
  /**
333
- * 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.
333
+ * 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.
334
+ * List the account\'s file and directory tags
335
+ */
336
+ listAccountFileTagsRaw(initOverrides) {
337
+ return __awaiter(this, void 0, void 0, function* () {
338
+ const queryParameters = {};
339
+ const headerParameters = {};
340
+ if (this.configuration && this.configuration.accessToken) {
341
+ const token = this.configuration.accessToken;
342
+ const tokenString = yield token("accessToken", []);
343
+ if (tokenString) {
344
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
345
+ }
346
+ }
347
+ let urlPath = `/v1/account/file-tags`;
348
+ const response = yield this.request({
349
+ path: urlPath,
350
+ method: 'GET',
351
+ headers: headerParameters,
352
+ query: queryParameters,
353
+ }, initOverrides);
354
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.TagListFromJSON)(jsonValue));
355
+ });
356
+ }
357
+ /**
358
+ * 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.
359
+ * List the account\'s file and directory tags
360
+ */
361
+ listAccountFileTags(initOverrides) {
362
+ return __awaiter(this, void 0, void 0, function* () {
363
+ const response = yield this.listAccountFileTagsRaw(initOverrides);
364
+ return yield response.value();
365
+ });
366
+ }
367
+ /**
368
+ * 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.
334
369
  * List the account\'s files
335
370
  */
336
371
  listAccountFilesRaw(requestParameters, initOverrides) {
@@ -345,6 +380,9 @@ class FilesApi extends runtime.BaseAPI {
345
380
  if (requestParameters['parent'] != null) {
346
381
  queryParameters['parent'] = requestParameters['parent'];
347
382
  }
383
+ if (requestParameters['tag'] != null) {
384
+ queryParameters['tag'] = requestParameters['tag'];
385
+ }
348
386
  const headerParameters = {};
349
387
  if (this.configuration && this.configuration.accessToken) {
350
388
  const token = this.configuration.accessToken;
@@ -364,7 +402,7 @@ class FilesApi extends runtime.BaseAPI {
364
402
  });
365
403
  }
366
404
  /**
367
- * 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.
405
+ * 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.
368
406
  * List the account\'s files
369
407
  */
370
408
  listAccountFiles() {
@@ -374,8 +412,8 @@ class FilesApi extends runtime.BaseAPI {
374
412
  });
375
413
  }
376
414
  /**
377
- * 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.
378
- * Rename or move a directory
415
+ * 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.
416
+ * Rename, move or tag a directory
379
417
  */
380
418
  updateAccountDirectoriesRaw(requestParameters, initOverrides) {
381
419
  return __awaiter(this, void 0, void 0, function* () {
@@ -408,8 +446,8 @@ class FilesApi extends runtime.BaseAPI {
408
446
  });
409
447
  }
410
448
  /**
411
- * 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.
412
- * Rename or move a directory
449
+ * 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.
450
+ * Rename, move or tag a directory
413
451
  */
414
452
  updateAccountDirectories(requestParameters, initOverrides) {
415
453
  return __awaiter(this, void 0, void 0, function* () {
@@ -418,8 +456,8 @@ class FilesApi extends runtime.BaseAPI {
418
456
  });
419
457
  }
420
458
  /**
421
- * 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.
422
- * Rename or move an account file
459
+ * 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.
460
+ * Rename, move or tag an account file
423
461
  */
424
462
  updateAccountFilesRaw(requestParameters, initOverrides) {
425
463
  return __awaiter(this, void 0, void 0, function* () {
@@ -452,8 +490,8 @@ class FilesApi extends runtime.BaseAPI {
452
490
  });
453
491
  }
454
492
  /**
455
- * 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.
456
- * Rename or move an account file
493
+ * 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.
494
+ * Rename, move or tag an account file
457
495
  */
458
496
  updateAccountFiles(requestParameters, initOverrides) {
459
497
  return __awaiter(this, void 0, void 0, function* () {
@@ -68,7 +68,7 @@ export interface InternalApiInterface {
68
68
  */
69
69
  createAdminFlushDeadLetters(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
70
70
  /**
71
- * Copies all scenarios, properties, object groups, top-down models, datasets, space rulesets, projects, dashboards, floor plans, and account variables from a named template account into the caller\'s account. Local development uses the seeded local template account for both data and files, and returns 409 until its data and available files are imported. Populating an account from itself is rejected. Requires the *Project admin controls* and *Sys admin* permissions.
71
+ * Copies all files and their folders, scenarios, properties, object groups and their images, top-down models, datasets, data collections (as drafts without contributors), space rulesets, projects, dashboards, floor plans, and account variables from a named template account into the caller\'s account. Local development uses the seeded local template account for both data and files, and returns 409 until its data and available files are imported. Populating an account from itself is rejected. Requires the *Project admin controls* and *Sys admin* permissions.
72
72
  * @summary Populate account from template
73
73
  * @param {number} body
74
74
  * @param {*} [options] Override http request option.
@@ -77,7 +77,7 @@ export interface InternalApiInterface {
77
77
  */
78
78
  createAdminPopulateRaw(requestParameters: InternalApiCreateAdminPopulateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
79
79
  /**
80
- * Copies all scenarios, properties, object groups, top-down models, datasets, space rulesets, projects, dashboards, floor plans, and account variables from a named template account into the caller\'s account. Local development uses the seeded local template account for both data and files, and returns 409 until its data and available files are imported. Populating an account from itself is rejected. Requires the *Project admin controls* and *Sys admin* permissions.
80
+ * Copies all files and their folders, scenarios, properties, object groups and their images, top-down models, datasets, data collections (as drafts without contributors), space rulesets, projects, dashboards, floor plans, and account variables from a named template account into the caller\'s account. Local development uses the seeded local template account for both data and files, and returns 409 until its data and available files are imported. Populating an account from itself is rejected. Requires the *Project admin controls* and *Sys admin* permissions.
81
81
  * Populate account from template
82
82
  */
83
83
  createAdminPopulate(requestParameters: InternalApiCreateAdminPopulateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
@@ -245,12 +245,12 @@ export declare class InternalApi extends runtime.BaseAPI implements InternalApiI
245
245
  */
246
246
  createAdminFlushDeadLetters(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
247
247
  /**
248
- * Copies all scenarios, properties, object groups, top-down models, datasets, space rulesets, projects, dashboards, floor plans, and account variables from a named template account into the caller\'s account. Local development uses the seeded local template account for both data and files, and returns 409 until its data and available files are imported. Populating an account from itself is rejected. Requires the *Project admin controls* and *Sys admin* permissions.
248
+ * Copies all files and their folders, scenarios, properties, object groups and their images, top-down models, datasets, data collections (as drafts without contributors), space rulesets, projects, dashboards, floor plans, and account variables from a named template account into the caller\'s account. Local development uses the seeded local template account for both data and files, and returns 409 until its data and available files are imported. Populating an account from itself is rejected. Requires the *Project admin controls* and *Sys admin* permissions.
249
249
  * Populate account from template
250
250
  */
251
251
  createAdminPopulateRaw(requestParameters: InternalApiCreateAdminPopulateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
252
252
  /**
253
- * Copies all scenarios, properties, object groups, top-down models, datasets, space rulesets, projects, dashboards, floor plans, and account variables from a named template account into the caller\'s account. Local development uses the seeded local template account for both data and files, and returns 409 until its data and available files are imported. Populating an account from itself is rejected. Requires the *Project admin controls* and *Sys admin* permissions.
253
+ * Copies all files and their folders, scenarios, properties, object groups and their images, top-down models, datasets, data collections (as drafts without contributors), space rulesets, projects, dashboards, floor plans, and account variables from a named template account into the caller\'s account. Local development uses the seeded local template account for both data and files, and returns 409 until its data and available files are imported. Populating an account from itself is rejected. Requires the *Project admin controls* and *Sys admin* permissions.
254
254
  * Populate account from template
255
255
  */
256
256
  createAdminPopulate(requestParameters: InternalApiCreateAdminPopulateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
@@ -105,7 +105,7 @@ class InternalApi extends runtime.BaseAPI {
105
105
  });
106
106
  }
107
107
  /**
108
- * Copies all scenarios, properties, object groups, top-down models, datasets, space rulesets, projects, dashboards, floor plans, and account variables from a named template account into the caller\'s account. Local development uses the seeded local template account for both data and files, and returns 409 until its data and available files are imported. Populating an account from itself is rejected. Requires the *Project admin controls* and *Sys admin* permissions.
108
+ * Copies all files and their folders, scenarios, properties, object groups and their images, top-down models, datasets, data collections (as drafts without contributors), space rulesets, projects, dashboards, floor plans, and account variables from a named template account into the caller\'s account. Local development uses the seeded local template account for both data and files, and returns 409 until its data and available files are imported. Populating an account from itself is rejected. Requires the *Project admin controls* and *Sys admin* permissions.
109
109
  * Populate account from template
110
110
  */
111
111
  createAdminPopulateRaw(requestParameters, initOverrides) {
@@ -135,7 +135,7 @@ class InternalApi extends runtime.BaseAPI {
135
135
  });
136
136
  }
137
137
  /**
138
- * Copies all scenarios, properties, object groups, top-down models, datasets, space rulesets, projects, dashboards, floor plans, and account variables from a named template account into the caller\'s account. Local development uses the seeded local template account for both data and files, and returns 409 until its data and available files are imported. Populating an account from itself is rejected. Requires the *Project admin controls* and *Sys admin* permissions.
138
+ * Copies all files and their folders, scenarios, properties, object groups and their images, top-down models, datasets, data collections (as drafts without contributors), space rulesets, projects, dashboards, floor plans, and account variables from a named template account into the caller\'s account. Local development uses the seeded local template account for both data and files, and returns 409 until its data and available files are imported. Populating an account from itself is rejected. Requires the *Project admin controls* and *Sys admin* permissions.
139
139
  * Populate account from template
140
140
  */
141
141
  createAdminPopulate(requestParameters, initOverrides) {
@@ -10,13 +10,16 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { Account, AccountAuthOption, AccountCalculationUsageBody, AccountDetailsResBody, AccountGetAuthOptionsResBody, AccountOIDCProvider, AccountOIDCProviderPatch, AccountPatchAuthOptionsReqBody, AccountPostOIDCProviderReqBody, AccountPostReqBody, AccountPutOIDCClientSecretReqBody, AccountPutReqBody, AccountUsageResBody, ListAccountsForUserRow } from '../models/index';
13
+ import type { Account, AccountAuthOption, AccountCalculationUsageBody, AccountDetailsResBody, AccountDuplicateReqBody, AccountGetAuthOptionsResBody, AccountOIDCProvider, AccountOIDCProviderPatch, AccountPatchAuthOptionsReqBody, AccountPostOIDCProviderReqBody, AccountPostReqBody, AccountPutOIDCClientSecretReqBody, AccountPutReqBody, AccountUsageResBody, ListAccountsForUserRow } from '../models/index';
14
14
  export interface AccountsApiCreateRequest {
15
15
  accountPostReqBody: AccountPostReqBody;
16
16
  }
17
17
  export interface AccountsApiCreateOidcProviderRequest {
18
18
  accountPostOIDCProviderReqBody: AccountPostOIDCProviderReqBody;
19
19
  }
20
+ export interface AccountsApiDuplicateRequest {
21
+ accountDuplicateReqBody: AccountDuplicateReqBody;
22
+ }
20
23
  export interface AccountsApiGetAuthOptionsRequest {
21
24
  hostname: string;
22
25
  }
@@ -49,7 +52,7 @@ export interface AccountsApiUpdateOidcProviderClientSecretRequest {
49
52
  */
50
53
  export interface AccountsApiInterface {
51
54
  /**
52
- * Creates an account owned by the authenticated user and returns its identifier. Unless the template is `blank`, the account is seeded from a prebuilt one. Seeding runs in the background, so poll `GET /v1/accounts/{id}/setup-status` until it succeeds before sending the user into the new account. Account names are unique; reusing one returns `400 account-name-in-use`. Requires the *Manage my account* permission.
55
+ * Creates an account owned by the authenticated user and returns its identifier. The account is seeded from the prebuilt account for the chosen template (`blank` starts almost empty). Seeding runs in the background, so poll `GET /v1/accounts/{id}/setup-status` until it succeeds before sending the user into the new account. Account names are unique; reusing one returns `400 account-name-in-use`. Requires the *Manage my account* permission.
53
56
  * @summary Create an account
54
57
  * @param {AccountPostReqBody} accountPostReqBody
55
58
  * @param {*} [options] Override http request option.
@@ -58,7 +61,7 @@ export interface AccountsApiInterface {
58
61
  */
59
62
  createRaw(requestParameters: AccountsApiCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<number>>;
60
63
  /**
61
- * Creates an account owned by the authenticated user and returns its identifier. Unless the template is `blank`, the account is seeded from a prebuilt one. Seeding runs in the background, so poll `GET /v1/accounts/{id}/setup-status` until it succeeds before sending the user into the new account. Account names are unique; reusing one returns `400 account-name-in-use`. Requires the *Manage my account* permission.
64
+ * Creates an account owned by the authenticated user and returns its identifier. The account is seeded from the prebuilt account for the chosen template (`blank` starts almost empty). Seeding runs in the background, so poll `GET /v1/accounts/{id}/setup-status` until it succeeds before sending the user into the new account. Account names are unique; reusing one returns `400 account-name-in-use`. Requires the *Manage my account* permission.
62
65
  * Create an account
63
66
  */
64
67
  create(requestParameters: AccountsApiCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<number>;
@@ -102,6 +105,20 @@ export interface AccountsApiInterface {
102
105
  * Delete the current account\'s OIDC provider
103
106
  */
104
107
  deleteOidcProvider(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
108
+ /**
109
+ * Creates a new account owned by the authenticated user and copies the current account\'s content into it: projects, dashboards, floor plans, properties, object groups, top-down models, scenarios, datasets, space rulesets, variables, and files with their folders. Archived projects, object groups, scenarios and top-down models are copied and stay archived. Data collections are copied as drafts without their contributors. Members and their roles, sign-in settings, API keys, scripts, assistant conversations and the audit log are not copied; the caller is the new account\'s only member. Returns the new account\'s identifier. Copying runs in the background, so poll `GET /v1/accounts/{id}/setup-status` until it succeeds before sending the user into the new account; it returns `500 account-setup-failed` if the content could not be copied, and the incomplete account is then deleted, after which polling it returns `403`. Account names are unique; reusing one returns `400 account-name-in-use`. Requires a token for the account being duplicated, holding the *Manage my account* permission; a token for no account returns `400`. A script\'s own API key cannot duplicate an account.
110
+ * @summary Duplicate the current account
111
+ * @param {AccountDuplicateReqBody} accountDuplicateReqBody
112
+ * @param {*} [options] Override http request option.
113
+ * @throws {RequiredError}
114
+ * @memberof AccountsApiInterface
115
+ */
116
+ duplicateRaw(requestParameters: AccountsApiDuplicateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<number>>;
117
+ /**
118
+ * Creates a new account owned by the authenticated user and copies the current account\'s content into it: projects, dashboards, floor plans, properties, object groups, top-down models, scenarios, datasets, space rulesets, variables, and files with their folders. Archived projects, object groups, scenarios and top-down models are copied and stay archived. Data collections are copied as drafts without their contributors. Members and their roles, sign-in settings, API keys, scripts, assistant conversations and the audit log are not copied; the caller is the new account\'s only member. Returns the new account\'s identifier. Copying runs in the background, so poll `GET /v1/accounts/{id}/setup-status` until it succeeds before sending the user into the new account; it returns `500 account-setup-failed` if the content could not be copied, and the incomplete account is then deleted, after which polling it returns `403`. Account names are unique; reusing one returns `400 account-name-in-use`. Requires a token for the account being duplicated, holding the *Manage my account* permission; a token for no account returns `400`. A script\'s own API key cannot duplicate an account.
119
+ * Duplicate the current account
120
+ */
121
+ duplicate(requestParameters: AccountsApiDuplicateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<number>;
105
122
  /**
106
123
  * Returns the account the access token was issued for. Use `GET /v1/account/profile` for the full profile, including address and notification preferences. Requires the *View account overview* permission.
107
124
  * @summary Get the current account
@@ -170,16 +187,16 @@ export interface AccountsApiInterface {
170
187
  */
171
188
  getProfile(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AccountDetailsResBody>;
172
189
  /**
173
- * Long-polls until the account created by `POST /v1/accounts` has finished being seeded from its template, then returns `200`. The request is held open for up to 90 seconds and returns `408` if setup has not completed by then; call it again to keep waiting. The caller must be a member of the account and hold the *Manage my account* permission.
190
+ * Long-polls until the account created by `POST /v1/accounts` or `POST /v1/account/duplicate` has finished being seeded with its starting content, then returns `204`. The request is held open for up to 90 seconds and returns `408` if setup has not completed by then; call it again to keep waiting. Returns `500 account-setup-failed` if the content could not be copied; the account exists but is incomplete. The caller must be a member of the account and hold the *Manage my account* permission.
174
191
  * @summary Wait for account setup to finish
175
- * @param {number} id Identifier returned by POST /v1/accounts.
192
+ * @param {number} id Identifier returned by POST /v1/accounts or POST /v1/account/duplicate.
176
193
  * @param {*} [options] Override http request option.
177
194
  * @throws {RequiredError}
178
195
  * @memberof AccountsApiInterface
179
196
  */
180
197
  getSetupStatusRaw(requestParameters: AccountsApiGetSetupStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
181
198
  /**
182
- * Long-polls until the account created by `POST /v1/accounts` has finished being seeded from its template, then returns `200`. The request is held open for up to 90 seconds and returns `408` if setup has not completed by then; call it again to keep waiting. The caller must be a member of the account and hold the *Manage my account* permission.
199
+ * Long-polls until the account created by `POST /v1/accounts` or `POST /v1/account/duplicate` has finished being seeded with its starting content, then returns `204`. The request is held open for up to 90 seconds and returns `408` if setup has not completed by then; call it again to keep waiting. Returns `500 account-setup-failed` if the content could not be copied; the account exists but is incomplete. The caller must be a member of the account and hold the *Manage my account* permission.
183
200
  * Wait for account setup to finish
184
201
  */
185
202
  getSetupStatus(requestParameters: AccountsApiGetSetupStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
@@ -298,12 +315,12 @@ export interface AccountsApiInterface {
298
315
  */
299
316
  export declare class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface {
300
317
  /**
301
- * Creates an account owned by the authenticated user and returns its identifier. Unless the template is `blank`, the account is seeded from a prebuilt one. Seeding runs in the background, so poll `GET /v1/accounts/{id}/setup-status` until it succeeds before sending the user into the new account. Account names are unique; reusing one returns `400 account-name-in-use`. Requires the *Manage my account* permission.
318
+ * Creates an account owned by the authenticated user and returns its identifier. The account is seeded from the prebuilt account for the chosen template (`blank` starts almost empty). Seeding runs in the background, so poll `GET /v1/accounts/{id}/setup-status` until it succeeds before sending the user into the new account. Account names are unique; reusing one returns `400 account-name-in-use`. Requires the *Manage my account* permission.
302
319
  * Create an account
303
320
  */
304
321
  createRaw(requestParameters: AccountsApiCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<number>>;
305
322
  /**
306
- * Creates an account owned by the authenticated user and returns its identifier. Unless the template is `blank`, the account is seeded from a prebuilt one. Seeding runs in the background, so poll `GET /v1/accounts/{id}/setup-status` until it succeeds before sending the user into the new account. Account names are unique; reusing one returns `400 account-name-in-use`. Requires the *Manage my account* permission.
323
+ * Creates an account owned by the authenticated user and returns its identifier. The account is seeded from the prebuilt account for the chosen template (`blank` starts almost empty). Seeding runs in the background, so poll `GET /v1/accounts/{id}/setup-status` until it succeeds before sending the user into the new account. Account names are unique; reusing one returns `400 account-name-in-use`. Requires the *Manage my account* permission.
307
324
  * Create an account
308
325
  */
309
326
  create(requestParameters: AccountsApiCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<number>;
@@ -337,6 +354,16 @@ export declare class AccountsApi extends runtime.BaseAPI implements AccountsApiI
337
354
  * Delete the current account\'s OIDC provider
338
355
  */
339
356
  deleteOidcProvider(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
357
+ /**
358
+ * Creates a new account owned by the authenticated user and copies the current account\'s content into it: projects, dashboards, floor plans, properties, object groups, top-down models, scenarios, datasets, space rulesets, variables, and files with their folders. Archived projects, object groups, scenarios and top-down models are copied and stay archived. Data collections are copied as drafts without their contributors. Members and their roles, sign-in settings, API keys, scripts, assistant conversations and the audit log are not copied; the caller is the new account\'s only member. Returns the new account\'s identifier. Copying runs in the background, so poll `GET /v1/accounts/{id}/setup-status` until it succeeds before sending the user into the new account; it returns `500 account-setup-failed` if the content could not be copied, and the incomplete account is then deleted, after which polling it returns `403`. Account names are unique; reusing one returns `400 account-name-in-use`. Requires a token for the account being duplicated, holding the *Manage my account* permission; a token for no account returns `400`. A script\'s own API key cannot duplicate an account.
359
+ * Duplicate the current account
360
+ */
361
+ duplicateRaw(requestParameters: AccountsApiDuplicateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<number>>;
362
+ /**
363
+ * Creates a new account owned by the authenticated user and copies the current account\'s content into it: projects, dashboards, floor plans, properties, object groups, top-down models, scenarios, datasets, space rulesets, variables, and files with their folders. Archived projects, object groups, scenarios and top-down models are copied and stay archived. Data collections are copied as drafts without their contributors. Members and their roles, sign-in settings, API keys, scripts, assistant conversations and the audit log are not copied; the caller is the new account\'s only member. Returns the new account\'s identifier. Copying runs in the background, so poll `GET /v1/accounts/{id}/setup-status` until it succeeds before sending the user into the new account; it returns `500 account-setup-failed` if the content could not be copied, and the incomplete account is then deleted, after which polling it returns `403`. Account names are unique; reusing one returns `400 account-name-in-use`. Requires a token for the account being duplicated, holding the *Manage my account* permission; a token for no account returns `400`. A script\'s own API key cannot duplicate an account.
364
+ * Duplicate the current account
365
+ */
366
+ duplicate(requestParameters: AccountsApiDuplicateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<number>;
340
367
  /**
341
368
  * Returns the account the access token was issued for. Use `GET /v1/account/profile` for the full profile, including address and notification preferences. Requires the *View account overview* permission.
342
369
  * Get the current account
@@ -388,12 +415,12 @@ export declare class AccountsApi extends runtime.BaseAPI implements AccountsApiI
388
415
  */
389
416
  getProfile(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AccountDetailsResBody>;
390
417
  /**
391
- * Long-polls until the account created by `POST /v1/accounts` has finished being seeded from its template, then returns `200`. The request is held open for up to 90 seconds and returns `408` if setup has not completed by then; call it again to keep waiting. The caller must be a member of the account and hold the *Manage my account* permission.
418
+ * Long-polls until the account created by `POST /v1/accounts` or `POST /v1/account/duplicate` has finished being seeded with its starting content, then returns `204`. The request is held open for up to 90 seconds and returns `408` if setup has not completed by then; call it again to keep waiting. Returns `500 account-setup-failed` if the content could not be copied; the account exists but is incomplete. The caller must be a member of the account and hold the *Manage my account* permission.
392
419
  * Wait for account setup to finish
393
420
  */
394
421
  getSetupStatusRaw(requestParameters: AccountsApiGetSetupStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
395
422
  /**
396
- * Long-polls until the account created by `POST /v1/accounts` has finished being seeded from its template, then returns `200`. The request is held open for up to 90 seconds and returns `408` if setup has not completed by then; call it again to keep waiting. The caller must be a member of the account and hold the *Manage my account* permission.
423
+ * Long-polls until the account created by `POST /v1/accounts` or `POST /v1/account/duplicate` has finished being seeded with its starting content, then returns `204`. The request is held open for up to 90 seconds and returns `408` if setup has not completed by then; call it again to keep waiting. Returns `500 account-setup-failed` if the content could not be copied; the account exists but is incomplete. The caller must be a member of the account and hold the *Manage my account* permission.
397
424
  * Wait for account setup to finish
398
425
  */
399
426
  getSetupStatus(requestParameters: AccountsApiGetSetupStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
@@ -21,13 +21,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { AccountFromJSON, AccountAuthOptionFromJSON, AccountCalculationUsageBodyFromJSON, AccountDetailsResBodyFromJSON, AccountGetAuthOptionsResBodyFromJSON, AccountOIDCProviderFromJSON, AccountOIDCProviderPatchToJSON, AccountPatchAuthOptionsReqBodyToJSON, AccountPostOIDCProviderReqBodyToJSON, AccountPostReqBodyToJSON, AccountPutOIDCClientSecretReqBodyToJSON, AccountPutReqBodyToJSON, AccountUsageResBodyFromJSON, ListAccountsForUserRowFromJSON, } from '../models/index';
24
+ import { AccountFromJSON, AccountAuthOptionFromJSON, AccountCalculationUsageBodyFromJSON, AccountDetailsResBodyFromJSON, AccountDuplicateReqBodyToJSON, AccountGetAuthOptionsResBodyFromJSON, AccountOIDCProviderFromJSON, AccountOIDCProviderPatchToJSON, AccountPatchAuthOptionsReqBodyToJSON, AccountPostOIDCProviderReqBodyToJSON, AccountPostReqBodyToJSON, AccountPutOIDCClientSecretReqBodyToJSON, AccountPutReqBodyToJSON, AccountUsageResBodyFromJSON, ListAccountsForUserRowFromJSON, } from '../models/index';
25
25
  /**
26
26
  *
27
27
  */
28
28
  export class AccountsApi extends runtime.BaseAPI {
29
29
  /**
30
- * Creates an account owned by the authenticated user and returns its identifier. Unless the template is `blank`, the account is seeded from a prebuilt one. Seeding runs in the background, so poll `GET /v1/accounts/{id}/setup-status` until it succeeds before sending the user into the new account. Account names are unique; reusing one returns `400 account-name-in-use`. Requires the *Manage my account* permission.
30
+ * Creates an account owned by the authenticated user and returns its identifier. The account is seeded from the prebuilt account for the chosen template (`blank` starts almost empty). Seeding runs in the background, so poll `GET /v1/accounts/{id}/setup-status` until it succeeds before sending the user into the new account. Account names are unique; reusing one returns `400 account-name-in-use`. Requires the *Manage my account* permission.
31
31
  * Create an account
32
32
  */
33
33
  createRaw(requestParameters, initOverrides) {
@@ -62,7 +62,7 @@ export class AccountsApi extends runtime.BaseAPI {
62
62
  });
63
63
  }
64
64
  /**
65
- * Creates an account owned by the authenticated user and returns its identifier. Unless the template is `blank`, the account is seeded from a prebuilt one. Seeding runs in the background, so poll `GET /v1/accounts/{id}/setup-status` until it succeeds before sending the user into the new account. Account names are unique; reusing one returns `400 account-name-in-use`. Requires the *Manage my account* permission.
65
+ * Creates an account owned by the authenticated user and returns its identifier. The account is seeded from the prebuilt account for the chosen template (`blank` starts almost empty). Seeding runs in the background, so poll `GET /v1/accounts/{id}/setup-status` until it succeeds before sending the user into the new account. Account names are unique; reusing one returns `400 account-name-in-use`. Requires the *Manage my account* permission.
66
66
  * Create an account
67
67
  */
68
68
  create(requestParameters, initOverrides) {
@@ -179,6 +179,51 @@ export class AccountsApi extends runtime.BaseAPI {
179
179
  yield this.deleteOidcProviderRaw(initOverrides);
180
180
  });
181
181
  }
182
+ /**
183
+ * Creates a new account owned by the authenticated user and copies the current account\'s content into it: projects, dashboards, floor plans, properties, object groups, top-down models, scenarios, datasets, space rulesets, variables, and files with their folders. Archived projects, object groups, scenarios and top-down models are copied and stay archived. Data collections are copied as drafts without their contributors. Members and their roles, sign-in settings, API keys, scripts, assistant conversations and the audit log are not copied; the caller is the new account\'s only member. Returns the new account\'s identifier. Copying runs in the background, so poll `GET /v1/accounts/{id}/setup-status` until it succeeds before sending the user into the new account; it returns `500 account-setup-failed` if the content could not be copied, and the incomplete account is then deleted, after which polling it returns `403`. Account names are unique; reusing one returns `400 account-name-in-use`. Requires a token for the account being duplicated, holding the *Manage my account* permission; a token for no account returns `400`. A script\'s own API key cannot duplicate an account.
184
+ * Duplicate the current account
185
+ */
186
+ duplicateRaw(requestParameters, initOverrides) {
187
+ return __awaiter(this, void 0, void 0, function* () {
188
+ if (requestParameters['accountDuplicateReqBody'] == null) {
189
+ throw new runtime.RequiredError('accountDuplicateReqBody', 'Required parameter "accountDuplicateReqBody" was null or undefined when calling duplicate().');
190
+ }
191
+ const queryParameters = {};
192
+ const headerParameters = {};
193
+ headerParameters['Content-Type'] = 'application/json';
194
+ if (this.configuration && this.configuration.accessToken) {
195
+ const token = this.configuration.accessToken;
196
+ const tokenString = yield token("accessToken", []);
197
+ if (tokenString) {
198
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
199
+ }
200
+ }
201
+ let urlPath = `/v1/account/duplicate`;
202
+ const response = yield this.request({
203
+ path: urlPath,
204
+ method: 'POST',
205
+ headers: headerParameters,
206
+ query: queryParameters,
207
+ body: AccountDuplicateReqBodyToJSON(requestParameters['accountDuplicateReqBody']),
208
+ }, initOverrides);
209
+ if (this.isJsonMime(response.headers.get('content-type'))) {
210
+ return new runtime.JSONApiResponse(response);
211
+ }
212
+ else {
213
+ return new runtime.TextApiResponse(response);
214
+ }
215
+ });
216
+ }
217
+ /**
218
+ * Creates a new account owned by the authenticated user and copies the current account\'s content into it: projects, dashboards, floor plans, properties, object groups, top-down models, scenarios, datasets, space rulesets, variables, and files with their folders. Archived projects, object groups, scenarios and top-down models are copied and stay archived. Data collections are copied as drafts without their contributors. Members and their roles, sign-in settings, API keys, scripts, assistant conversations and the audit log are not copied; the caller is the new account\'s only member. Returns the new account\'s identifier. Copying runs in the background, so poll `GET /v1/accounts/{id}/setup-status` until it succeeds before sending the user into the new account; it returns `500 account-setup-failed` if the content could not be copied, and the incomplete account is then deleted, after which polling it returns `403`. Account names are unique; reusing one returns `400 account-name-in-use`. Requires a token for the account being duplicated, holding the *Manage my account* permission; a token for no account returns `400`. A script\'s own API key cannot duplicate an account.
219
+ * Duplicate the current account
220
+ */
221
+ duplicate(requestParameters, initOverrides) {
222
+ return __awaiter(this, void 0, void 0, function* () {
223
+ const response = yield this.duplicateRaw(requestParameters, initOverrides);
224
+ return yield response.value();
225
+ });
226
+ }
182
227
  /**
183
228
  * Returns the account the access token was issued for. Use `GET /v1/account/profile` for the full profile, including address and notification preferences. Requires the *View account overview* permission.
184
229
  * Get the current account
@@ -354,7 +399,7 @@ export class AccountsApi extends runtime.BaseAPI {
354
399
  });
355
400
  }
356
401
  /**
357
- * Long-polls until the account created by `POST /v1/accounts` has finished being seeded from its template, then returns `200`. The request is held open for up to 90 seconds and returns `408` if setup has not completed by then; call it again to keep waiting. The caller must be a member of the account and hold the *Manage my account* permission.
402
+ * Long-polls until the account created by `POST /v1/accounts` or `POST /v1/account/duplicate` has finished being seeded with its starting content, then returns `204`. The request is held open for up to 90 seconds and returns `408` if setup has not completed by then; call it again to keep waiting. Returns `500 account-setup-failed` if the content could not be copied; the account exists but is incomplete. The caller must be a member of the account and hold the *Manage my account* permission.
358
403
  * Wait for account setup to finish
359
404
  */
360
405
  getSetupStatusRaw(requestParameters, initOverrides) {
@@ -383,7 +428,7 @@ export class AccountsApi extends runtime.BaseAPI {
383
428
  });
384
429
  }
385
430
  /**
386
- * Long-polls until the account created by `POST /v1/accounts` has finished being seeded from its template, then returns `200`. The request is held open for up to 90 seconds and returns `408` if setup has not completed by then; call it again to keep waiting. The caller must be a member of the account and hold the *Manage my account* permission.
431
+ * Long-polls until the account created by `POST /v1/accounts` or `POST /v1/account/duplicate` has finished being seeded with its starting content, then returns `204`. The request is held open for up to 90 seconds and returns `408` if setup has not completed by then; call it again to keep waiting. Returns `500 account-setup-failed` if the content could not be copied; the account exists but is incomplete. The caller must be a member of the account and hold the *Manage my account* permission.
387
432
  * Wait for account setup to finish
388
433
  */
389
434
  getSetupStatus(requestParameters, initOverrides) {