@spaciv/sdk 0.1.19 → 0.1.21

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 (73) hide show
  1. package/.openapi-generator/FILES +8 -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/apis/ScriptsApi.d.ts +57 -1
  6. package/dist/apis/ScriptsApi.js +82 -0
  7. package/dist/esm/apis/FilesApi.d.ts +132 -18
  8. package/dist/esm/apis/FilesApi.js +176 -9
  9. package/dist/esm/apis/ScriptsApi.d.ts +57 -1
  10. package/dist/esm/apis/ScriptsApi.js +83 -1
  11. package/dist/esm/models/AccountDirectoryPatchBody.d.ts +38 -0
  12. package/dist/esm/models/AccountDirectoryPatchBody.js +43 -0
  13. package/dist/esm/models/AccountDirectoryPostBody.d.ts +38 -0
  14. package/dist/esm/models/AccountDirectoryPostBody.js +45 -0
  15. package/dist/esm/models/AccountFilePatchBody.d.ts +8 -2
  16. package/dist/esm/models/AccountFilePatchBody.js +3 -3
  17. package/dist/esm/models/Directory.d.ts +56 -0
  18. package/dist/esm/models/Directory.js +57 -0
  19. package/dist/esm/models/DirectoryPage.d.ts +39 -0
  20. package/dist/esm/models/DirectoryPage.js +46 -0
  21. package/dist/esm/models/ListPage.d.ts +7 -0
  22. package/dist/esm/models/ListPage.js +3 -0
  23. package/dist/esm/models/ModelRecord.d.ts +7 -1
  24. package/dist/esm/models/ModelRecord.js +2 -0
  25. package/dist/esm/models/ScratchpadOutput.d.ts +69 -0
  26. package/dist/esm/models/ScratchpadOutput.js +64 -0
  27. package/dist/esm/models/ScratchpadOutputFile.d.ts +44 -0
  28. package/dist/esm/models/ScratchpadOutputFile.js +49 -0
  29. package/dist/esm/models/ScratchpadRun.d.ts +127 -0
  30. package/dist/esm/models/ScratchpadRun.js +91 -0
  31. package/dist/esm/models/ScratchpadRunPostReqBody.d.ts +58 -0
  32. package/dist/esm/models/ScratchpadRunPostReqBody.js +53 -0
  33. package/dist/esm/models/index.d.ts +8 -0
  34. package/dist/esm/models/index.js +8 -0
  35. package/dist/models/AccountDirectoryPatchBody.d.ts +38 -0
  36. package/dist/models/AccountDirectoryPatchBody.js +50 -0
  37. package/dist/models/AccountDirectoryPostBody.d.ts +38 -0
  38. package/dist/models/AccountDirectoryPostBody.js +52 -0
  39. package/dist/models/AccountFilePatchBody.d.ts +8 -2
  40. package/dist/models/AccountFilePatchBody.js +3 -3
  41. package/dist/models/Directory.d.ts +56 -0
  42. package/dist/models/Directory.js +64 -0
  43. package/dist/models/DirectoryPage.d.ts +39 -0
  44. package/dist/models/DirectoryPage.js +53 -0
  45. package/dist/models/ListPage.d.ts +7 -0
  46. package/dist/models/ListPage.js +3 -0
  47. package/dist/models/ModelRecord.d.ts +7 -1
  48. package/dist/models/ModelRecord.js +2 -0
  49. package/dist/models/ScratchpadOutput.d.ts +69 -0
  50. package/dist/models/ScratchpadOutput.js +71 -0
  51. package/dist/models/ScratchpadOutputFile.d.ts +44 -0
  52. package/dist/models/ScratchpadOutputFile.js +56 -0
  53. package/dist/models/ScratchpadRun.d.ts +127 -0
  54. package/dist/models/ScratchpadRun.js +99 -0
  55. package/dist/models/ScratchpadRunPostReqBody.d.ts +58 -0
  56. package/dist/models/ScratchpadRunPostReqBody.js +60 -0
  57. package/dist/models/index.d.ts +8 -0
  58. package/dist/models/index.js +8 -0
  59. package/package.json +1 -1
  60. package/src/apis/FilesApi.ts +319 -17
  61. package/src/apis/ScriptsApi.ts +148 -0
  62. package/src/models/AccountDirectoryPatchBody.ts +73 -0
  63. package/src/models/AccountDirectoryPostBody.ts +74 -0
  64. package/src/models/AccountFilePatchBody.ts +11 -4
  65. package/src/models/Directory.ts +101 -0
  66. package/src/models/DirectoryPage.ts +82 -0
  67. package/src/models/ListPage.ts +15 -0
  68. package/src/models/ModelRecord.ts +9 -1
  69. package/src/models/ScratchpadOutput.ts +126 -0
  70. package/src/models/ScratchpadOutputFile.ts +83 -0
  71. package/src/models/ScratchpadRun.ts +203 -0
  72. package/src/models/ScratchpadRunPostReqBody.ts +99 -0
  73. package/src/models/index.ts +8 -0
@@ -30,7 +30,47 @@ const index_1 = require("../models/index");
30
30
  */
31
31
  class FilesApi extends runtime.BaseAPI {
32
32
  /**
33
- * 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.
33
+ * 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.
34
+ * Create a directory in the account\'s files
35
+ */
36
+ createAccountDirectoriesRaw(requestParameters, initOverrides) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ if (requestParameters['accountDirectoryPostBody'] == null) {
39
+ throw new runtime.RequiredError('accountDirectoryPostBody', 'Required parameter "accountDirectoryPostBody" was null or undefined when calling createAccountDirectories().');
40
+ }
41
+ const queryParameters = {};
42
+ const headerParameters = {};
43
+ headerParameters['Content-Type'] = 'application/json';
44
+ if (this.configuration && this.configuration.accessToken) {
45
+ const token = this.configuration.accessToken;
46
+ const tokenString = yield token("accessToken", []);
47
+ if (tokenString) {
48
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
49
+ }
50
+ }
51
+ let urlPath = `/v1/account/directories`;
52
+ const response = yield this.request({
53
+ path: urlPath,
54
+ method: 'POST',
55
+ headers: headerParameters,
56
+ query: queryParameters,
57
+ body: (0, index_1.AccountDirectoryPostBodyToJSON)(requestParameters['accountDirectoryPostBody']),
58
+ }, initOverrides);
59
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.DirectoryFromJSON)(jsonValue));
60
+ });
61
+ }
62
+ /**
63
+ * 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.
64
+ * Create a directory in the account\'s files
65
+ */
66
+ createAccountDirectories(requestParameters, initOverrides) {
67
+ return __awaiter(this, void 0, void 0, function* () {
68
+ const response = yield this.createAccountDirectoriesRaw(requestParameters, initOverrides);
69
+ return yield response.value();
70
+ });
71
+ }
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.
34
74
  * Upload a file to the account
35
75
  */
36
76
  createAccountFilesRaw(requestParameters, initOverrides) {
@@ -77,7 +117,7 @@ class FilesApi extends runtime.BaseAPI {
77
117
  });
78
118
  }
79
119
  /**
80
- * 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.
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.
81
121
  * Upload a file to the account
82
122
  */
83
123
  createAccountFiles() {
@@ -86,6 +126,45 @@ class FilesApi extends runtime.BaseAPI {
86
126
  return yield response.value();
87
127
  });
88
128
  }
129
+ /**
130
+ * 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.
131
+ * Delete a directory
132
+ */
133
+ deleteAccountDirectoriesRaw(requestParameters, initOverrides) {
134
+ return __awaiter(this, void 0, void 0, function* () {
135
+ if (requestParameters['id'] == null) {
136
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteAccountDirectories().');
137
+ }
138
+ const queryParameters = {};
139
+ const headerParameters = {};
140
+ if (this.configuration && this.configuration.accessToken) {
141
+ const token = this.configuration.accessToken;
142
+ const tokenString = yield token("accessToken", []);
143
+ if (tokenString) {
144
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
145
+ }
146
+ }
147
+ let urlPath = `/v1/account/directories/{id}`;
148
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
149
+ const response = yield this.request({
150
+ path: urlPath,
151
+ method: 'DELETE',
152
+ headers: headerParameters,
153
+ query: queryParameters,
154
+ }, initOverrides);
155
+ return new runtime.JSONApiResponse(response);
156
+ });
157
+ }
158
+ /**
159
+ * 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.
160
+ * Delete a directory
161
+ */
162
+ deleteAccountDirectories(requestParameters, initOverrides) {
163
+ return __awaiter(this, void 0, void 0, function* () {
164
+ const response = yield this.deleteAccountDirectoriesRaw(requestParameters, initOverrides);
165
+ return yield response.value();
166
+ });
167
+ }
89
168
  /**
90
169
  * 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.
91
170
  * Delete an account file
@@ -170,7 +249,48 @@ class FilesApi extends runtime.BaseAPI {
170
249
  });
171
250
  }
172
251
  /**
173
- * 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.
252
+ * 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.
253
+ * List the account\'s directories
254
+ */
255
+ listAccountDirectoriesRaw(requestParameters, initOverrides) {
256
+ return __awaiter(this, void 0, void 0, function* () {
257
+ const queryParameters = {};
258
+ if (requestParameters['limit'] != null) {
259
+ queryParameters['limit'] = requestParameters['limit'];
260
+ }
261
+ if (requestParameters['cursor'] != null) {
262
+ queryParameters['cursor'] = requestParameters['cursor'];
263
+ }
264
+ const headerParameters = {};
265
+ if (this.configuration && this.configuration.accessToken) {
266
+ const token = this.configuration.accessToken;
267
+ const tokenString = yield token("accessToken", []);
268
+ if (tokenString) {
269
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
270
+ }
271
+ }
272
+ let urlPath = `/v1/account/directories`;
273
+ const response = yield this.request({
274
+ path: urlPath,
275
+ method: 'GET',
276
+ headers: headerParameters,
277
+ query: queryParameters,
278
+ }, initOverrides);
279
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.DirectoryPageFromJSON)(jsonValue));
280
+ });
281
+ }
282
+ /**
283
+ * 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.
284
+ * List the account\'s directories
285
+ */
286
+ listAccountDirectories() {
287
+ return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
288
+ const response = yield this.listAccountDirectoriesRaw(requestParameters, initOverrides);
289
+ return yield response.value();
290
+ });
291
+ }
292
+ /**
293
+ * 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.
174
294
  * List the account\'s files
175
295
  */
176
296
  listAccountFilesRaw(requestParameters, initOverrides) {
@@ -182,6 +302,9 @@ class FilesApi extends runtime.BaseAPI {
182
302
  if (requestParameters['cursor'] != null) {
183
303
  queryParameters['cursor'] = requestParameters['cursor'];
184
304
  }
305
+ if (requestParameters['parent'] != null) {
306
+ queryParameters['parent'] = requestParameters['parent'];
307
+ }
185
308
  const headerParameters = {};
186
309
  if (this.configuration && this.configuration.accessToken) {
187
310
  const token = this.configuration.accessToken;
@@ -201,7 +324,7 @@ class FilesApi extends runtime.BaseAPI {
201
324
  });
202
325
  }
203
326
  /**
204
- * 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.
327
+ * 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.
205
328
  * List the account\'s files
206
329
  */
207
330
  listAccountFiles() {
@@ -211,8 +334,52 @@ class FilesApi extends runtime.BaseAPI {
211
334
  });
212
335
  }
213
336
  /**
214
- * 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.
215
- * Rename an account file
337
+ * 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.
338
+ * Rename or move a directory
339
+ */
340
+ updateAccountDirectoriesRaw(requestParameters, initOverrides) {
341
+ return __awaiter(this, void 0, void 0, function* () {
342
+ if (requestParameters['id'] == null) {
343
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling updateAccountDirectories().');
344
+ }
345
+ if (requestParameters['accountDirectoryPatchBody'] == null) {
346
+ throw new runtime.RequiredError('accountDirectoryPatchBody', 'Required parameter "accountDirectoryPatchBody" was null or undefined when calling updateAccountDirectories().');
347
+ }
348
+ const queryParameters = {};
349
+ const headerParameters = {};
350
+ headerParameters['Content-Type'] = 'application/json';
351
+ if (this.configuration && this.configuration.accessToken) {
352
+ const token = this.configuration.accessToken;
353
+ const tokenString = yield token("accessToken", []);
354
+ if (tokenString) {
355
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
356
+ }
357
+ }
358
+ let urlPath = `/v1/account/directories/{id}`;
359
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
360
+ const response = yield this.request({
361
+ path: urlPath,
362
+ method: 'PATCH',
363
+ headers: headerParameters,
364
+ query: queryParameters,
365
+ body: (0, index_1.AccountDirectoryPatchBodyToJSON)(requestParameters['accountDirectoryPatchBody']),
366
+ }, initOverrides);
367
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.DirectoryFromJSON)(jsonValue));
368
+ });
369
+ }
370
+ /**
371
+ * 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.
372
+ * Rename or move a directory
373
+ */
374
+ updateAccountDirectories(requestParameters, initOverrides) {
375
+ return __awaiter(this, void 0, void 0, function* () {
376
+ const response = yield this.updateAccountDirectoriesRaw(requestParameters, initOverrides);
377
+ return yield response.value();
378
+ });
379
+ }
380
+ /**
381
+ * 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.
382
+ * Rename or move an account file
216
383
  */
217
384
  updateAccountFilesRaw(requestParameters, initOverrides) {
218
385
  return __awaiter(this, void 0, void 0, function* () {
@@ -245,8 +412,8 @@ class FilesApi extends runtime.BaseAPI {
245
412
  });
246
413
  }
247
414
  /**
248
- * 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.
249
- * Rename an account file
415
+ * 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.
416
+ * Rename or move an account file
250
417
  */
251
418
  updateAccountFiles(requestParameters, initOverrides) {
252
419
  return __awaiter(this, void 0, void 0, function* () {
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { ScriptAuditResBody, ScriptDetail, ScriptExportResBody, ScriptListResBody, ScriptPatchReqBody, ScriptPostReqBody, ScriptRunLogsResBody, ScriptRunsResBody, ScriptSchedulePreviewReqBody, ScriptSchedulePreviewResBody, ScriptSecretsReqBody, ScriptSecretsResBody, ScriptUsageResBody, ScriptWebhookResBody } from '../models/index';
13
+ import type { ScratchpadRun, ScratchpadRunPostReqBody, ScriptAuditResBody, ScriptDetail, ScriptExportResBody, ScriptListResBody, ScriptPatchReqBody, ScriptPostReqBody, ScriptRunLogsResBody, ScriptRunsResBody, ScriptSchedulePreviewReqBody, ScriptSchedulePreviewResBody, ScriptSecretsReqBody, ScriptSecretsResBody, ScriptUsageResBody, ScriptWebhookResBody } from '../models/index';
14
14
  export interface ScriptsApiCreateRequest {
15
15
  scriptPostReqBody: ScriptPostReqBody;
16
16
  }
@@ -23,6 +23,9 @@ export interface ScriptsApiCreateRegenerateWebhookRequest {
23
23
  export interface ScriptsApiCreateSchedulePreviewRequest {
24
24
  scriptSchedulePreviewReqBody: ScriptSchedulePreviewReqBody;
25
25
  }
26
+ export interface ScriptsApiCreateScratchpadRunsRequest {
27
+ scratchpadRunPostReqBody: ScratchpadRunPostReqBody;
28
+ }
26
29
  export interface ScriptsApiDeleteRequest {
27
30
  id: string;
28
31
  }
@@ -34,6 +37,10 @@ export interface ScriptsApiGetAuditRequest {
34
37
  limit?: number;
35
38
  cursor?: string;
36
39
  }
40
+ export interface ScriptsApiGetScratchpadRunsRequest {
41
+ runId: string;
42
+ waitSeconds?: number;
43
+ }
37
44
  export interface ScriptsApiListRunsRequest {
38
45
  id: string;
39
46
  limit?: number;
@@ -114,6 +121,20 @@ export interface ScriptsApiInterface {
114
121
  * Preview a script schedule
115
122
  */
116
123
  createSchedulePreview(requestParameters: ScriptsApiCreateSchedulePreviewRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScriptSchedulePreviewResBody>;
124
+ /**
125
+ * Runs Python or JavaScript code once in a sandbox without saving it as a script, for working something out from the account\'s data. The handler is the one an integration script implements, with `input` as `event.input`; there is no build, so dependency manifests and Go are not supported. The code runs with a read-only access token scoped to the caller: only the caller\'s view permissions, in the caller\'s current project if there is one, for 5 minutes. `ctx.fetch` sends it to the Spaciv API. Files the handler writes to its output directory (`ctx.output_dir` in Python, `ctx.outputDir` in JavaScript) are returned with its stdout, stderr and return value. Limits: code up to 256 KiB in at most 50 files, `input` up to 1 MiB, and `timeoutSeconds` up to 120 (default 30). Of the output, stdout and stderr are kept up to 256 KiB each, the return value up to 256 KiB, and up to 20 output files totalling 2 MiB. Runs count towards the account\'s script credits and concurrent runs. The request waits up to `waitSeconds` for the run to finish; a run still in progress is returned without `output`, and can be read with `GET /v1/scripts/scratchpad/runs/{runId}`. A run is visible only to the user who started it, and is kept for 24 hours. Returns `422` when the language or code is not accepted, and `403` for a script\'s API key or a scratchpad run\'s own token. Requires the *AI assistant* permission.
126
+ * @summary Run scratchpad code
127
+ * @param {ScratchpadRunPostReqBody} scratchpadRunPostReqBody
128
+ * @param {*} [options] Override http request option.
129
+ * @throws {RequiredError}
130
+ * @memberof ScriptsApiInterface
131
+ */
132
+ createScratchpadRunsRaw(requestParameters: ScriptsApiCreateScratchpadRunsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ScratchpadRun>>;
133
+ /**
134
+ * Runs Python or JavaScript code once in a sandbox without saving it as a script, for working something out from the account\'s data. The handler is the one an integration script implements, with `input` as `event.input`; there is no build, so dependency manifests and Go are not supported. The code runs with a read-only access token scoped to the caller: only the caller\'s view permissions, in the caller\'s current project if there is one, for 5 minutes. `ctx.fetch` sends it to the Spaciv API. Files the handler writes to its output directory (`ctx.output_dir` in Python, `ctx.outputDir` in JavaScript) are returned with its stdout, stderr and return value. Limits: code up to 256 KiB in at most 50 files, `input` up to 1 MiB, and `timeoutSeconds` up to 120 (default 30). Of the output, stdout and stderr are kept up to 256 KiB each, the return value up to 256 KiB, and up to 20 output files totalling 2 MiB. Runs count towards the account\'s script credits and concurrent runs. The request waits up to `waitSeconds` for the run to finish; a run still in progress is returned without `output`, and can be read with `GET /v1/scripts/scratchpad/runs/{runId}`. A run is visible only to the user who started it, and is kept for 24 hours. Returns `422` when the language or code is not accepted, and `403` for a script\'s API key or a scratchpad run\'s own token. Requires the *AI assistant* permission.
135
+ * Run scratchpad code
136
+ */
137
+ createScratchpadRuns(requestParameters: ScriptsApiCreateScratchpadRunsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScratchpadRun>;
117
138
  /**
118
139
  * Stops any active runs, deletes the script with its secrets and run history, and revokes its API keys. Requires the *Manage my account* permission.
119
140
  * @summary Delete a script
@@ -171,6 +192,21 @@ export interface ScriptsApiInterface {
171
192
  * Export scripts
172
193
  */
173
194
  getExport(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScriptExportResBody>;
195
+ /**
196
+ * Returns a scratchpad run the caller started, with its output once it has finished. Runs are kept for 24 hours. Returns `404` when the run does not exist, has expired or was started by someone else, and `403` for a script\'s API key or a scratchpad run\'s own token. Requires the *AI assistant* permission.
197
+ * @summary Get a scratchpad run
198
+ * @param {string} runId
199
+ * @param {number} [waitSeconds] Longest to wait for a run in progress to finish before responding. Defaults to 0, returning at once.
200
+ * @param {*} [options] Override http request option.
201
+ * @throws {RequiredError}
202
+ * @memberof ScriptsApiInterface
203
+ */
204
+ getScratchpadRunsRaw(requestParameters: ScriptsApiGetScratchpadRunsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ScratchpadRun>>;
205
+ /**
206
+ * Returns a scratchpad run the caller started, with its output once it has finished. Runs are kept for 24 hours. Returns `404` when the run does not exist, has expired or was started by someone else, and `403` for a script\'s API key or a scratchpad run\'s own token. Requires the *AI assistant* permission.
207
+ * Get a scratchpad run
208
+ */
209
+ getScratchpadRuns(requestParameters: ScriptsApiGetScratchpadRunsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScratchpadRun>;
174
210
  /**
175
211
  * Returns the credits the account\'s script runs were charged this calendar month (UTC), against the account\'s monthly script credit limit and its other script limits, with how many runs each script made, failed and had refused. creditState is near from 80% of the monthly limit and reached once it is used, after which runs are recorded as quota_exceeded until the month ends. creditsUsed is the scripts figure of `GET /v1/account/usage/calculation-credits`. Run counts are added when runs end. Requires the *Manage my account* permission.
176
212
  * @summary Get script usage
@@ -303,6 +339,16 @@ export declare class ScriptsApi extends runtime.BaseAPI implements ScriptsApiInt
303
339
  * Preview a script schedule
304
340
  */
305
341
  createSchedulePreview(requestParameters: ScriptsApiCreateSchedulePreviewRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScriptSchedulePreviewResBody>;
342
+ /**
343
+ * Runs Python or JavaScript code once in a sandbox without saving it as a script, for working something out from the account\'s data. The handler is the one an integration script implements, with `input` as `event.input`; there is no build, so dependency manifests and Go are not supported. The code runs with a read-only access token scoped to the caller: only the caller\'s view permissions, in the caller\'s current project if there is one, for 5 minutes. `ctx.fetch` sends it to the Spaciv API. Files the handler writes to its output directory (`ctx.output_dir` in Python, `ctx.outputDir` in JavaScript) are returned with its stdout, stderr and return value. Limits: code up to 256 KiB in at most 50 files, `input` up to 1 MiB, and `timeoutSeconds` up to 120 (default 30). Of the output, stdout and stderr are kept up to 256 KiB each, the return value up to 256 KiB, and up to 20 output files totalling 2 MiB. Runs count towards the account\'s script credits and concurrent runs. The request waits up to `waitSeconds` for the run to finish; a run still in progress is returned without `output`, and can be read with `GET /v1/scripts/scratchpad/runs/{runId}`. A run is visible only to the user who started it, and is kept for 24 hours. Returns `422` when the language or code is not accepted, and `403` for a script\'s API key or a scratchpad run\'s own token. Requires the *AI assistant* permission.
344
+ * Run scratchpad code
345
+ */
346
+ createScratchpadRunsRaw(requestParameters: ScriptsApiCreateScratchpadRunsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ScratchpadRun>>;
347
+ /**
348
+ * Runs Python or JavaScript code once in a sandbox without saving it as a script, for working something out from the account\'s data. The handler is the one an integration script implements, with `input` as `event.input`; there is no build, so dependency manifests and Go are not supported. The code runs with a read-only access token scoped to the caller: only the caller\'s view permissions, in the caller\'s current project if there is one, for 5 minutes. `ctx.fetch` sends it to the Spaciv API. Files the handler writes to its output directory (`ctx.output_dir` in Python, `ctx.outputDir` in JavaScript) are returned with its stdout, stderr and return value. Limits: code up to 256 KiB in at most 50 files, `input` up to 1 MiB, and `timeoutSeconds` up to 120 (default 30). Of the output, stdout and stderr are kept up to 256 KiB each, the return value up to 256 KiB, and up to 20 output files totalling 2 MiB. Runs count towards the account\'s script credits and concurrent runs. The request waits up to `waitSeconds` for the run to finish; a run still in progress is returned without `output`, and can be read with `GET /v1/scripts/scratchpad/runs/{runId}`. A run is visible only to the user who started it, and is kept for 24 hours. Returns `422` when the language or code is not accepted, and `403` for a script\'s API key or a scratchpad run\'s own token. Requires the *AI assistant* permission.
349
+ * Run scratchpad code
350
+ */
351
+ createScratchpadRuns(requestParameters: ScriptsApiCreateScratchpadRunsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScratchpadRun>;
306
352
  /**
307
353
  * Stops any active runs, deletes the script with its secrets and run history, and revokes its API keys. Requires the *Manage my account* permission.
308
354
  * Delete a script
@@ -343,6 +389,16 @@ export declare class ScriptsApi extends runtime.BaseAPI implements ScriptsApiInt
343
389
  * Export scripts
344
390
  */
345
391
  getExport(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScriptExportResBody>;
392
+ /**
393
+ * Returns a scratchpad run the caller started, with its output once it has finished. Runs are kept for 24 hours. Returns `404` when the run does not exist, has expired or was started by someone else, and `403` for a script\'s API key or a scratchpad run\'s own token. Requires the *AI assistant* permission.
394
+ * Get a scratchpad run
395
+ */
396
+ getScratchpadRunsRaw(requestParameters: ScriptsApiGetScratchpadRunsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ScratchpadRun>>;
397
+ /**
398
+ * Returns a scratchpad run the caller started, with its output once it has finished. Runs are kept for 24 hours. Returns `404` when the run does not exist, has expired or was started by someone else, and `403` for a script\'s API key or a scratchpad run\'s own token. Requires the *AI assistant* permission.
399
+ * Get a scratchpad run
400
+ */
401
+ getScratchpadRuns(requestParameters: ScriptsApiGetScratchpadRunsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScratchpadRun>;
346
402
  /**
347
403
  * Returns the credits the account\'s script runs were charged this calendar month (UTC), against the account\'s monthly script credit limit and its other script limits, with how many runs each script made, failed and had refused. creditState is near from 80% of the monthly limit and reached once it is used, after which runs are recorded as quota_exceeded until the month ends. creditsUsed is the scripts figure of `GET /v1/account/usage/calculation-credits`. Run counts are added when runs end. Requires the *Manage my account* permission.
348
404
  * Get script usage
@@ -187,6 +187,46 @@ class ScriptsApi extends runtime.BaseAPI {
187
187
  return yield response.value();
188
188
  });
189
189
  }
190
+ /**
191
+ * Runs Python or JavaScript code once in a sandbox without saving it as a script, for working something out from the account\'s data. The handler is the one an integration script implements, with `input` as `event.input`; there is no build, so dependency manifests and Go are not supported. The code runs with a read-only access token scoped to the caller: only the caller\'s view permissions, in the caller\'s current project if there is one, for 5 minutes. `ctx.fetch` sends it to the Spaciv API. Files the handler writes to its output directory (`ctx.output_dir` in Python, `ctx.outputDir` in JavaScript) are returned with its stdout, stderr and return value. Limits: code up to 256 KiB in at most 50 files, `input` up to 1 MiB, and `timeoutSeconds` up to 120 (default 30). Of the output, stdout and stderr are kept up to 256 KiB each, the return value up to 256 KiB, and up to 20 output files totalling 2 MiB. Runs count towards the account\'s script credits and concurrent runs. The request waits up to `waitSeconds` for the run to finish; a run still in progress is returned without `output`, and can be read with `GET /v1/scripts/scratchpad/runs/{runId}`. A run is visible only to the user who started it, and is kept for 24 hours. Returns `422` when the language or code is not accepted, and `403` for a script\'s API key or a scratchpad run\'s own token. Requires the *AI assistant* permission.
192
+ * Run scratchpad code
193
+ */
194
+ createScratchpadRunsRaw(requestParameters, initOverrides) {
195
+ return __awaiter(this, void 0, void 0, function* () {
196
+ if (requestParameters['scratchpadRunPostReqBody'] == null) {
197
+ throw new runtime.RequiredError('scratchpadRunPostReqBody', 'Required parameter "scratchpadRunPostReqBody" was null or undefined when calling createScratchpadRuns().');
198
+ }
199
+ const queryParameters = {};
200
+ const headerParameters = {};
201
+ headerParameters['Content-Type'] = 'application/json';
202
+ if (this.configuration && this.configuration.accessToken) {
203
+ const token = this.configuration.accessToken;
204
+ const tokenString = yield token("accessToken", []);
205
+ if (tokenString) {
206
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
207
+ }
208
+ }
209
+ let urlPath = `/v1/scripts/scratchpad/runs`;
210
+ const response = yield this.request({
211
+ path: urlPath,
212
+ method: 'POST',
213
+ headers: headerParameters,
214
+ query: queryParameters,
215
+ body: (0, index_1.ScratchpadRunPostReqBodyToJSON)(requestParameters['scratchpadRunPostReqBody']),
216
+ }, initOverrides);
217
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ScratchpadRunFromJSON)(jsonValue));
218
+ });
219
+ }
220
+ /**
221
+ * Runs Python or JavaScript code once in a sandbox without saving it as a script, for working something out from the account\'s data. The handler is the one an integration script implements, with `input` as `event.input`; there is no build, so dependency manifests and Go are not supported. The code runs with a read-only access token scoped to the caller: only the caller\'s view permissions, in the caller\'s current project if there is one, for 5 minutes. `ctx.fetch` sends it to the Spaciv API. Files the handler writes to its output directory (`ctx.output_dir` in Python, `ctx.outputDir` in JavaScript) are returned with its stdout, stderr and return value. Limits: code up to 256 KiB in at most 50 files, `input` up to 1 MiB, and `timeoutSeconds` up to 120 (default 30). Of the output, stdout and stderr are kept up to 256 KiB each, the return value up to 256 KiB, and up to 20 output files totalling 2 MiB. Runs count towards the account\'s script credits and concurrent runs. The request waits up to `waitSeconds` for the run to finish; a run still in progress is returned without `output`, and can be read with `GET /v1/scripts/scratchpad/runs/{runId}`. A run is visible only to the user who started it, and is kept for 24 hours. Returns `422` when the language or code is not accepted, and `403` for a script\'s API key or a scratchpad run\'s own token. Requires the *AI assistant* permission.
222
+ * Run scratchpad code
223
+ */
224
+ createScratchpadRuns(requestParameters, initOverrides) {
225
+ return __awaiter(this, void 0, void 0, function* () {
226
+ const response = yield this.createScratchpadRunsRaw(requestParameters, initOverrides);
227
+ return yield response.value();
228
+ });
229
+ }
190
230
  /**
191
231
  * Stops any active runs, deletes the script with its secrets and run history, and revokes its API keys. Requires the *Manage my account* permission.
192
232
  * Delete a script
@@ -344,6 +384,48 @@ class ScriptsApi extends runtime.BaseAPI {
344
384
  return yield response.value();
345
385
  });
346
386
  }
387
+ /**
388
+ * Returns a scratchpad run the caller started, with its output once it has finished. Runs are kept for 24 hours. Returns `404` when the run does not exist, has expired or was started by someone else, and `403` for a script\'s API key or a scratchpad run\'s own token. Requires the *AI assistant* permission.
389
+ * Get a scratchpad run
390
+ */
391
+ getScratchpadRunsRaw(requestParameters, initOverrides) {
392
+ return __awaiter(this, void 0, void 0, function* () {
393
+ if (requestParameters['runId'] == null) {
394
+ throw new runtime.RequiredError('runId', 'Required parameter "runId" was null or undefined when calling getScratchpadRuns().');
395
+ }
396
+ const queryParameters = {};
397
+ if (requestParameters['waitSeconds'] != null) {
398
+ queryParameters['waitSeconds'] = requestParameters['waitSeconds'];
399
+ }
400
+ const headerParameters = {};
401
+ if (this.configuration && this.configuration.accessToken) {
402
+ const token = this.configuration.accessToken;
403
+ const tokenString = yield token("accessToken", []);
404
+ if (tokenString) {
405
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
406
+ }
407
+ }
408
+ let urlPath = `/v1/scripts/scratchpad/runs/{runId}`;
409
+ urlPath = urlPath.replace(`{${"runId"}}`, encodeURIComponent(String(requestParameters['runId'])));
410
+ const response = yield this.request({
411
+ path: urlPath,
412
+ method: 'GET',
413
+ headers: headerParameters,
414
+ query: queryParameters,
415
+ }, initOverrides);
416
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ScratchpadRunFromJSON)(jsonValue));
417
+ });
418
+ }
419
+ /**
420
+ * Returns a scratchpad run the caller started, with its output once it has finished. Runs are kept for 24 hours. Returns `404` when the run does not exist, has expired or was started by someone else, and `403` for a script\'s API key or a scratchpad run\'s own token. Requires the *AI assistant* permission.
421
+ * Get a scratchpad run
422
+ */
423
+ getScratchpadRuns(requestParameters, initOverrides) {
424
+ return __awaiter(this, void 0, void 0, function* () {
425
+ const response = yield this.getScratchpadRunsRaw(requestParameters, initOverrides);
426
+ return yield response.value();
427
+ });
428
+ }
347
429
  /**
348
430
  * Returns the credits the account\'s script runs were charged this calendar month (UTC), against the account\'s monthly script credit limit and its other script limits, with how many runs each script made, failed and had refused. creditState is near from 80% of the monthly limit and reached once it is used, after which runs are recorded as quota_exceeded until the month ends. creditsUsed is the scripts figure of `GET /v1/account/usage/calculation-credits`. Run counts are added when runs end. Requires the *Manage my account* permission.
349
431
  * Get script usage