@spaciv/sdk 0.1.5 → 0.1.7

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 (78) hide show
  1. package/.openapi-generator/FILES +6 -0
  2. package/README.md +2 -2
  3. package/dist/apis/AccountsApi.d.ts +4 -4
  4. package/dist/apis/AccountsApi.js +2 -2
  5. package/dist/apis/FloorPlansApi.d.ts +13 -13
  6. package/dist/apis/FloorPlansApi.js +6 -6
  7. package/dist/apis/InternalApi.d.ts +57 -1
  8. package/dist/apis/InternalApi.js +83 -0
  9. package/dist/apis/ScriptsApi.d.ts +32 -9
  10. package/dist/apis/ScriptsApi.js +39 -4
  11. package/dist/esm/apis/AccountsApi.d.ts +4 -4
  12. package/dist/esm/apis/AccountsApi.js +2 -2
  13. package/dist/esm/apis/FloorPlansApi.d.ts +13 -13
  14. package/dist/esm/apis/FloorPlansApi.js +6 -6
  15. package/dist/esm/apis/InternalApi.d.ts +57 -1
  16. package/dist/esm/apis/InternalApi.js +84 -1
  17. package/dist/esm/apis/ScriptsApi.d.ts +32 -9
  18. package/dist/esm/apis/ScriptsApi.js +40 -5
  19. package/dist/esm/models/AccountCalculationUsageDay.d.ts +6 -0
  20. package/dist/esm/models/AccountCalculationUsageDay.js +4 -0
  21. package/dist/esm/models/FloorplanBrief.d.ts +12 -0
  22. package/dist/esm/models/FloorplanBrief.js +4 -0
  23. package/dist/esm/models/FloorplanGetBody.d.ts +12 -0
  24. package/dist/esm/models/FloorplanGetBody.js +4 -0
  25. package/dist/esm/models/FloorplanPatchParamsBody.d.ts +12 -0
  26. package/dist/esm/models/FloorplanPatchParamsBody.js +4 -0
  27. package/dist/esm/models/ScriptLimitOverrides.d.ts +62 -0
  28. package/dist/esm/models/ScriptLimitOverrides.js +51 -0
  29. package/dist/esm/models/ScriptLimitValues.d.ts +62 -0
  30. package/dist/esm/models/ScriptLimitValues.js +63 -0
  31. package/dist/esm/models/ScriptLimits.d.ts +62 -0
  32. package/dist/esm/models/ScriptLimits.js +63 -0
  33. package/dist/esm/models/ScriptLimitsResBody.d.ts +46 -0
  34. package/dist/esm/models/ScriptLimitsResBody.js +53 -0
  35. package/dist/esm/models/ScriptUsage.d.ts +50 -0
  36. package/dist/esm/models/ScriptUsage.js +55 -0
  37. package/dist/esm/models/ScriptUsageResBody.d.ts +103 -0
  38. package/dist/esm/models/ScriptUsageResBody.js +93 -0
  39. package/dist/esm/models/index.d.ts +6 -0
  40. package/dist/esm/models/index.js +6 -0
  41. package/dist/models/AccountCalculationUsageDay.d.ts +6 -0
  42. package/dist/models/AccountCalculationUsageDay.js +4 -0
  43. package/dist/models/FloorplanBrief.d.ts +12 -0
  44. package/dist/models/FloorplanBrief.js +4 -0
  45. package/dist/models/FloorplanGetBody.d.ts +12 -0
  46. package/dist/models/FloorplanGetBody.js +4 -0
  47. package/dist/models/FloorplanPatchParamsBody.d.ts +12 -0
  48. package/dist/models/FloorplanPatchParamsBody.js +4 -0
  49. package/dist/models/ScriptLimitOverrides.d.ts +62 -0
  50. package/dist/models/ScriptLimitOverrides.js +58 -0
  51. package/dist/models/ScriptLimitValues.d.ts +62 -0
  52. package/dist/models/ScriptLimitValues.js +70 -0
  53. package/dist/models/ScriptLimits.d.ts +62 -0
  54. package/dist/models/ScriptLimits.js +70 -0
  55. package/dist/models/ScriptLimitsResBody.d.ts +46 -0
  56. package/dist/models/ScriptLimitsResBody.js +60 -0
  57. package/dist/models/ScriptUsage.d.ts +50 -0
  58. package/dist/models/ScriptUsage.js +62 -0
  59. package/dist/models/ScriptUsageResBody.d.ts +103 -0
  60. package/dist/models/ScriptUsageResBody.js +101 -0
  61. package/dist/models/index.d.ts +6 -0
  62. package/dist/models/index.js +6 -0
  63. package/package.json +1 -1
  64. package/src/apis/AccountsApi.ts +4 -4
  65. package/src/apis/FloorPlansApi.ts +13 -13
  66. package/src/apis/InternalApi.ts +152 -0
  67. package/src/apis/ScriptsApi.ts +65 -8
  68. package/src/models/AccountCalculationUsageDay.ts +9 -0
  69. package/src/models/FloorplanBrief.ts +16 -0
  70. package/src/models/FloorplanGetBody.ts +16 -0
  71. package/src/models/FloorplanPatchParamsBody.ts +16 -0
  72. package/src/models/ScriptLimitOverrides.ts +105 -0
  73. package/src/models/ScriptLimitValues.ts +111 -0
  74. package/src/models/ScriptLimits.ts +111 -0
  75. package/src/models/ScriptLimitsResBody.ts +99 -0
  76. package/src/models/ScriptUsage.ts +93 -0
  77. package/src/models/ScriptUsageResBody.ts +183 -0
  78. package/src/models/index.ts +6 -0
@@ -335,6 +335,10 @@ src/models/ScriptExport.ts
335
335
  src/models/ScriptExportResBody.ts
336
336
  src/models/ScriptExportRun.ts
337
337
  src/models/ScriptKey.ts
338
+ src/models/ScriptLimitOverrides.ts
339
+ src/models/ScriptLimitValues.ts
340
+ src/models/ScriptLimits.ts
341
+ src/models/ScriptLimitsResBody.ts
338
342
  src/models/ScriptListResBody.ts
339
343
  src/models/ScriptLogLine.ts
340
344
  src/models/ScriptPatchReqBody.ts
@@ -349,6 +353,8 @@ src/models/ScriptSchedulePreviewResBody.ts
349
353
  src/models/ScriptSecretsReqBody.ts
350
354
  src/models/ScriptSecretsResBody.ts
351
355
  src/models/ScriptSummary.ts
356
+ src/models/ScriptUsage.ts
357
+ src/models/ScriptUsageResBody.ts
352
358
  src/models/ScriptWebhookResBody.ts
353
359
  src/models/SendPasswordPutReqBody.ts
354
360
  src/models/SerializedEvent.ts
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## @spaciv/sdk@0.1.5
1
+ ## @spaciv/sdk@0.1.7
2
2
 
3
3
  This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
4
4
 
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
36
36
  _published:_
37
37
 
38
38
  ```
39
- npm install @spaciv/sdk@0.1.5 --save
39
+ npm install @spaciv/sdk@0.1.7 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
@@ -223,7 +223,7 @@ export interface AccountsApiInterface {
223
223
  */
224
224
  listAuthOptions(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AccountGetAuthOptionsResBody>;
225
225
  /**
226
- * Returns the credits the account used on each of the last `days` days, split into building layer data, aggregating it and the AI assistant. A piece of calculation work is charged once however many times it is computed, and a result already cached costs nothing. Credits are the same unit the rest of the account\'s usage is counted in. Requires the *Manage my account* permission. Returns `500` if the usage cannot be read.
226
+ * Returns the credits the account used on each of the last `days` days, split into building layer data, aggregating it, the AI assistant and running scripts. A piece of calculation work is charged once however many times it is computed, and a result already cached costs nothing. A script run is charged once, when it ends. Credits are the same unit the rest of the account\'s usage is counted in. Requires the *Manage my account* permission. Returns `500` if the usage cannot be read.
227
227
  * @summary Get the account\'s credit usage
228
228
  * @param {30 | 90 | 365} [days] How many days of usage to return, ending today (UTC).
229
229
  * @param {*} [options] Override http request option.
@@ -232,7 +232,7 @@ export interface AccountsApiInterface {
232
232
  */
233
233
  listUsageCalculationCreditsRaw(requestParameters: AccountsApiListUsageCalculationCreditsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AccountCalculationUsageBody>>;
234
234
  /**
235
- * Returns the credits the account used on each of the last `days` days, split into building layer data, aggregating it and the AI assistant. A piece of calculation work is charged once however many times it is computed, and a result already cached costs nothing. Credits are the same unit the rest of the account\'s usage is counted in. Requires the *Manage my account* permission. Returns `500` if the usage cannot be read.
235
+ * Returns the credits the account used on each of the last `days` days, split into building layer data, aggregating it, the AI assistant and running scripts. A piece of calculation work is charged once however many times it is computed, and a result already cached costs nothing. A script run is charged once, when it ends. Credits are the same unit the rest of the account\'s usage is counted in. Requires the *Manage my account* permission. Returns `500` if the usage cannot be read.
236
236
  * Get the account\'s credit usage
237
237
  */
238
238
  listUsageCalculationCredits(requestParameters: AccountsApiListUsageCalculationCreditsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AccountCalculationUsageBody>;
@@ -428,12 +428,12 @@ export declare class AccountsApi extends runtime.BaseAPI implements AccountsApiI
428
428
  */
429
429
  listAuthOptions(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AccountGetAuthOptionsResBody>;
430
430
  /**
431
- * Returns the credits the account used on each of the last `days` days, split into building layer data, aggregating it and the AI assistant. A piece of calculation work is charged once however many times it is computed, and a result already cached costs nothing. Credits are the same unit the rest of the account\'s usage is counted in. Requires the *Manage my account* permission. Returns `500` if the usage cannot be read.
431
+ * Returns the credits the account used on each of the last `days` days, split into building layer data, aggregating it, the AI assistant and running scripts. A piece of calculation work is charged once however many times it is computed, and a result already cached costs nothing. A script run is charged once, when it ends. Credits are the same unit the rest of the account\'s usage is counted in. Requires the *Manage my account* permission. Returns `500` if the usage cannot be read.
432
432
  * Get the account\'s credit usage
433
433
  */
434
434
  listUsageCalculationCreditsRaw(requestParameters: AccountsApiListUsageCalculationCreditsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AccountCalculationUsageBody>>;
435
435
  /**
436
- * Returns the credits the account used on each of the last `days` days, split into building layer data, aggregating it and the AI assistant. A piece of calculation work is charged once however many times it is computed, and a result already cached costs nothing. Credits are the same unit the rest of the account\'s usage is counted in. Requires the *Manage my account* permission. Returns `500` if the usage cannot be read.
436
+ * Returns the credits the account used on each of the last `days` days, split into building layer data, aggregating it, the AI assistant and running scripts. A piece of calculation work is charged once however many times it is computed, and a result already cached costs nothing. A script run is charged once, when it ends. Credits are the same unit the rest of the account\'s usage is counted in. Requires the *Manage my account* permission. Returns `500` if the usage cannot be read.
437
437
  * Get the account\'s credit usage
438
438
  */
439
439
  listUsageCalculationCredits(requestParameters?: AccountsApiListUsageCalculationCreditsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AccountCalculationUsageBody>;
@@ -500,7 +500,7 @@ class AccountsApi extends runtime.BaseAPI {
500
500
  });
501
501
  }
502
502
  /**
503
- * Returns the credits the account used on each of the last `days` days, split into building layer data, aggregating it and the AI assistant. A piece of calculation work is charged once however many times it is computed, and a result already cached costs nothing. Credits are the same unit the rest of the account\'s usage is counted in. Requires the *Manage my account* permission. Returns `500` if the usage cannot be read.
503
+ * Returns the credits the account used on each of the last `days` days, split into building layer data, aggregating it, the AI assistant and running scripts. A piece of calculation work is charged once however many times it is computed, and a result already cached costs nothing. A script run is charged once, when it ends. Credits are the same unit the rest of the account\'s usage is counted in. Requires the *Manage my account* permission. Returns `500` if the usage cannot be read.
504
504
  * Get the account\'s credit usage
505
505
  */
506
506
  listUsageCalculationCreditsRaw(requestParameters, initOverrides) {
@@ -528,7 +528,7 @@ class AccountsApi extends runtime.BaseAPI {
528
528
  });
529
529
  }
530
530
  /**
531
- * Returns the credits the account used on each of the last `days` days, split into building layer data, aggregating it and the AI assistant. A piece of calculation work is charged once however many times it is computed, and a result already cached costs nothing. Credits are the same unit the rest of the account\'s usage is counted in. Requires the *Manage my account* permission. Returns `500` if the usage cannot be read.
531
+ * Returns the credits the account used on each of the last `days` days, split into building layer data, aggregating it, the AI assistant and running scripts. A piece of calculation work is charged once however many times it is computed, and a result already cached costs nothing. A script run is charged once, when it ends. Credits are the same unit the rest of the account\'s usage is counted in. Requires the *Manage my account* permission. Returns `500` if the usage cannot be read.
532
532
  * Get the account\'s credit usage
533
533
  */
534
534
  listUsageCalculationCredits() {
@@ -85,18 +85,18 @@ export interface FloorPlansApiInterface {
85
85
  */
86
86
  get(requestParameters: FloorPlansApiGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FloorplanGetBody>;
87
87
  /**
88
- * Returns the raw image bytes for the specified layer (`image` for the base drawing, `foreground` for the overlay). When no image has been uploaded a generated placeholder is returned unless `noFallback=true` is set. Requires the *View floorplans* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored image matches a virus signature; the bytes are kept for investigation.
88
+ * Returns the raw image bytes for the specified layer (`image` for the base drawing, `foreground` for the overlay): the account file set as the layer\'s `backgroundFile` or `foregroundFile`, or, when there is none or it has been deleted from file storage, an image uploaded to the layer through `PUT`. When the layer has neither, a generated placeholder is returned unless `noFallback=true` is set. Requires the *View floorplans* permission; the *View file storage* permission is not needed to read the layer\'s account file. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the image matches a virus signature; the bytes are kept for investigation.
89
89
  * @summary Get a floor plan image
90
90
  * @param {string} id
91
91
  * @param {'image' | 'foreground'} imageType Which image layer to retrieve: the base drawing (image) or the foreground overlay (foreground).
92
- * @param {boolean} [noFallback] When true, returns 404 instead of a generated placeholder if no image has been uploaded.
92
+ * @param {boolean} [noFallback] When true, returns 404 instead of a generated placeholder if the layer has no image.
93
93
  * @param {*} [options] Override http request option.
94
94
  * @throws {RequiredError}
95
95
  * @memberof FloorPlansApiInterface
96
96
  */
97
97
  getImagesRaw(requestParameters: FloorPlansApiGetImagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
98
98
  /**
99
- * Returns the raw image bytes for the specified layer (`image` for the base drawing, `foreground` for the overlay). When no image has been uploaded a generated placeholder is returned unless `noFallback=true` is set. Requires the *View floorplans* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored image matches a virus signature; the bytes are kept for investigation.
99
+ * Returns the raw image bytes for the specified layer (`image` for the base drawing, `foreground` for the overlay): the account file set as the layer\'s `backgroundFile` or `foregroundFile`, or, when there is none or it has been deleted from file storage, an image uploaded to the layer through `PUT`. When the layer has neither, a generated placeholder is returned unless `noFallback=true` is set. Requires the *View floorplans* permission; the *View file storage* permission is not needed to read the layer\'s account file. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the image matches a virus signature; the bytes are kept for investigation.
100
100
  * Get a floor plan image
101
101
  */
102
102
  getImages(requestParameters: FloorPlansApiGetImagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
@@ -114,7 +114,7 @@ export interface FloorPlansApiInterface {
114
114
  */
115
115
  list(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<FloorplanBrief>>;
116
116
  /**
117
- * Partially updates the floor plan\'s name, linked property and node, creation timestamp, image overlay offset, and space geometry. Only fields present in the request body are changed. When `spaces` is provided the entire space overlay is replaced. Requires the *Edit floorplans* permission.
117
+ * Partially updates the floor plan\'s name, linked property and node, creation timestamp, image overlay offset, background and foreground images, and space geometry. Only fields present in the request body are changed, and the request fails with `409` if the floor plan keeps changing while they are. When `spaces` is provided the entire space overlay is replaced. Requires the *Edit floorplans* permission. `backgroundFile` and `foregroundFile` take the ID of an image in the account\'s file storage (see `/v1/account/files`), or an empty string to remove the layer\'s image; choosing a file also requires the *View file storage* permission. The file must be a PNG, JPEG, GIF, WebP or SVG image of at most 4 MB that is not quarantined, otherwise the request fails with `422` (`403` when quarantined) and nothing is changed. Setting or removing a layer\'s file also deletes any image previously uploaded to that layer through `PUT /v1/floorplans/{id}/images/{imageType}`.
118
118
  * @summary Update a floor plan
119
119
  * @param {string} id
120
120
  * @param {FloorplanPatchParamsBody} [floorplanPatchParamsBody]
@@ -124,12 +124,12 @@ export interface FloorPlansApiInterface {
124
124
  */
125
125
  updateRaw(requestParameters: FloorPlansApiUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>>;
126
126
  /**
127
- * Partially updates the floor plan\'s name, linked property and node, creation timestamp, image overlay offset, and space geometry. Only fields present in the request body are changed. When `spaces` is provided the entire space overlay is replaced. Requires the *Edit floorplans* permission.
127
+ * Partially updates the floor plan\'s name, linked property and node, creation timestamp, image overlay offset, background and foreground images, and space geometry. Only fields present in the request body are changed, and the request fails with `409` if the floor plan keeps changing while they are. When `spaces` is provided the entire space overlay is replaced. Requires the *Edit floorplans* permission. `backgroundFile` and `foregroundFile` take the ID of an image in the account\'s file storage (see `/v1/account/files`), or an empty string to remove the layer\'s image; choosing a file also requires the *View file storage* permission. The file must be a PNG, JPEG, GIF, WebP or SVG image of at most 4 MB that is not quarantined, otherwise the request fails with `422` (`403` when quarantined) and nothing is changed. Setting or removing a layer\'s file also deletes any image previously uploaded to that layer through `PUT /v1/floorplans/{id}/images/{imageType}`.
128
128
  * Update a floor plan
129
129
  */
130
130
  update(requestParameters: FloorPlansApiUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object>;
131
131
  /**
132
- * Uploads an image file for the specified layer of a floor plan. Submit a `multipart/form-data` request with the file under the `file` key; the maximum file size is 4 MB. Accepted MIME types: `image/png`, `image/jpeg`, `image/gif`, `image/webp`, `image/svg+xml` (detected from file bytes). Omitting the file part deletes any existing image for that layer. Requires the *Edit floorplans* permission.
132
+ * Uploads an image file for the specified layer of a floor plan. Submit a `multipart/form-data` request with the file under the `file` key; the maximum file size is 4 MB. Accepted MIME types: `image/png`, `image/jpeg`, `image/gif`, `image/webp`, `image/svg+xml` (detected from file bytes). Omitting the file part deletes any existing image for that layer. Either way, the layer stops showing any account file set for it through `PATCH /v1/floorplans/{id}`; prefer setting `backgroundFile` or `foregroundFile` there instead. Requires the *Edit floorplans* permission.
133
133
  * @summary Upload a floor plan image
134
134
  * @param {string} id
135
135
  * @param {'image' | 'foreground'} imageType Which image layer to upload: the base drawing (image) or the foreground overlay (foreground).
@@ -141,7 +141,7 @@ export interface FloorPlansApiInterface {
141
141
  */
142
142
  updateImagesRaw(requestParameters: FloorPlansApiUpdateImagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>>;
143
143
  /**
144
- * Uploads an image file for the specified layer of a floor plan. Submit a `multipart/form-data` request with the file under the `file` key; the maximum file size is 4 MB. Accepted MIME types: `image/png`, `image/jpeg`, `image/gif`, `image/webp`, `image/svg+xml` (detected from file bytes). Omitting the file part deletes any existing image for that layer. Requires the *Edit floorplans* permission.
144
+ * Uploads an image file for the specified layer of a floor plan. Submit a `multipart/form-data` request with the file under the `file` key; the maximum file size is 4 MB. Accepted MIME types: `image/png`, `image/jpeg`, `image/gif`, `image/webp`, `image/svg+xml` (detected from file bytes). Omitting the file part deletes any existing image for that layer. Either way, the layer stops showing any account file set for it through `PATCH /v1/floorplans/{id}`; prefer setting `backgroundFile` or `foregroundFile` there instead. Requires the *Edit floorplans* permission.
145
145
  * Upload a floor plan image
146
146
  */
147
147
  updateImages(requestParameters: FloorPlansApiUpdateImagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object>;
@@ -181,12 +181,12 @@ export declare class FloorPlansApi extends runtime.BaseAPI implements FloorPlans
181
181
  */
182
182
  get(requestParameters: FloorPlansApiGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FloorplanGetBody>;
183
183
  /**
184
- * Returns the raw image bytes for the specified layer (`image` for the base drawing, `foreground` for the overlay). When no image has been uploaded a generated placeholder is returned unless `noFallback=true` is set. Requires the *View floorplans* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored image matches a virus signature; the bytes are kept for investigation.
184
+ * Returns the raw image bytes for the specified layer (`image` for the base drawing, `foreground` for the overlay): the account file set as the layer\'s `backgroundFile` or `foregroundFile`, or, when there is none or it has been deleted from file storage, an image uploaded to the layer through `PUT`. When the layer has neither, a generated placeholder is returned unless `noFallback=true` is set. Requires the *View floorplans* permission; the *View file storage* permission is not needed to read the layer\'s account file. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the image matches a virus signature; the bytes are kept for investigation.
185
185
  * Get a floor plan image
186
186
  */
187
187
  getImagesRaw(requestParameters: FloorPlansApiGetImagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
188
188
  /**
189
- * Returns the raw image bytes for the specified layer (`image` for the base drawing, `foreground` for the overlay). When no image has been uploaded a generated placeholder is returned unless `noFallback=true` is set. Requires the *View floorplans* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored image matches a virus signature; the bytes are kept for investigation.
189
+ * Returns the raw image bytes for the specified layer (`image` for the base drawing, `foreground` for the overlay): the account file set as the layer\'s `backgroundFile` or `foregroundFile`, or, when there is none or it has been deleted from file storage, an image uploaded to the layer through `PUT`. When the layer has neither, a generated placeholder is returned unless `noFallback=true` is set. Requires the *View floorplans* permission; the *View file storage* permission is not needed to read the layer\'s account file. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the image matches a virus signature; the bytes are kept for investigation.
190
190
  * Get a floor plan image
191
191
  */
192
192
  getImages(requestParameters: FloorPlansApiGetImagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
@@ -201,22 +201,22 @@ export declare class FloorPlansApi extends runtime.BaseAPI implements FloorPlans
201
201
  */
202
202
  list(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<FloorplanBrief>>;
203
203
  /**
204
- * Partially updates the floor plan\'s name, linked property and node, creation timestamp, image overlay offset, and space geometry. Only fields present in the request body are changed. When `spaces` is provided the entire space overlay is replaced. Requires the *Edit floorplans* permission.
204
+ * Partially updates the floor plan\'s name, linked property and node, creation timestamp, image overlay offset, background and foreground images, and space geometry. Only fields present in the request body are changed, and the request fails with `409` if the floor plan keeps changing while they are. When `spaces` is provided the entire space overlay is replaced. Requires the *Edit floorplans* permission. `backgroundFile` and `foregroundFile` take the ID of an image in the account\'s file storage (see `/v1/account/files`), or an empty string to remove the layer\'s image; choosing a file also requires the *View file storage* permission. The file must be a PNG, JPEG, GIF, WebP or SVG image of at most 4 MB that is not quarantined, otherwise the request fails with `422` (`403` when quarantined) and nothing is changed. Setting or removing a layer\'s file also deletes any image previously uploaded to that layer through `PUT /v1/floorplans/{id}/images/{imageType}`.
205
205
  * Update a floor plan
206
206
  */
207
207
  updateRaw(requestParameters: FloorPlansApiUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>>;
208
208
  /**
209
- * Partially updates the floor plan\'s name, linked property and node, creation timestamp, image overlay offset, and space geometry. Only fields present in the request body are changed. When `spaces` is provided the entire space overlay is replaced. Requires the *Edit floorplans* permission.
209
+ * Partially updates the floor plan\'s name, linked property and node, creation timestamp, image overlay offset, background and foreground images, and space geometry. Only fields present in the request body are changed, and the request fails with `409` if the floor plan keeps changing while they are. When `spaces` is provided the entire space overlay is replaced. Requires the *Edit floorplans* permission. `backgroundFile` and `foregroundFile` take the ID of an image in the account\'s file storage (see `/v1/account/files`), or an empty string to remove the layer\'s image; choosing a file also requires the *View file storage* permission. The file must be a PNG, JPEG, GIF, WebP or SVG image of at most 4 MB that is not quarantined, otherwise the request fails with `422` (`403` when quarantined) and nothing is changed. Setting or removing a layer\'s file also deletes any image previously uploaded to that layer through `PUT /v1/floorplans/{id}/images/{imageType}`.
210
210
  * Update a floor plan
211
211
  */
212
212
  update(requestParameters: FloorPlansApiUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object>;
213
213
  /**
214
- * Uploads an image file for the specified layer of a floor plan. Submit a `multipart/form-data` request with the file under the `file` key; the maximum file size is 4 MB. Accepted MIME types: `image/png`, `image/jpeg`, `image/gif`, `image/webp`, `image/svg+xml` (detected from file bytes). Omitting the file part deletes any existing image for that layer. Requires the *Edit floorplans* permission.
214
+ * Uploads an image file for the specified layer of a floor plan. Submit a `multipart/form-data` request with the file under the `file` key; the maximum file size is 4 MB. Accepted MIME types: `image/png`, `image/jpeg`, `image/gif`, `image/webp`, `image/svg+xml` (detected from file bytes). Omitting the file part deletes any existing image for that layer. Either way, the layer stops showing any account file set for it through `PATCH /v1/floorplans/{id}`; prefer setting `backgroundFile` or `foregroundFile` there instead. Requires the *Edit floorplans* permission.
215
215
  * Upload a floor plan image
216
216
  */
217
217
  updateImagesRaw(requestParameters: FloorPlansApiUpdateImagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<object>>;
218
218
  /**
219
- * Uploads an image file for the specified layer of a floor plan. Submit a `multipart/form-data` request with the file under the `file` key; the maximum file size is 4 MB. Accepted MIME types: `image/png`, `image/jpeg`, `image/gif`, `image/webp`, `image/svg+xml` (detected from file bytes). Omitting the file part deletes any existing image for that layer. Requires the *Edit floorplans* permission.
219
+ * Uploads an image file for the specified layer of a floor plan. Submit a `multipart/form-data` request with the file under the `file` key; the maximum file size is 4 MB. Accepted MIME types: `image/png`, `image/jpeg`, `image/gif`, `image/webp`, `image/svg+xml` (detected from file bytes). Omitting the file part deletes any existing image for that layer. Either way, the layer stops showing any account file set for it through `PATCH /v1/floorplans/{id}`; prefer setting `backgroundFile` or `foregroundFile` there instead. Requires the *Edit floorplans* permission.
220
220
  * Upload a floor plan image
221
221
  */
222
222
  updateImages(requestParameters: FloorPlansApiUpdateImagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object>;
@@ -153,7 +153,7 @@ class FloorPlansApi extends runtime.BaseAPI {
153
153
  });
154
154
  }
155
155
  /**
156
- * Returns the raw image bytes for the specified layer (`image` for the base drawing, `foreground` for the overlay). When no image has been uploaded a generated placeholder is returned unless `noFallback=true` is set. Requires the *View floorplans* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored image matches a virus signature; the bytes are kept for investigation.
156
+ * Returns the raw image bytes for the specified layer (`image` for the base drawing, `foreground` for the overlay): the account file set as the layer\'s `backgroundFile` or `foregroundFile`, or, when there is none or it has been deleted from file storage, an image uploaded to the layer through `PUT`. When the layer has neither, a generated placeholder is returned unless `noFallback=true` is set. Requires the *View floorplans* permission; the *View file storage* permission is not needed to read the layer\'s account file. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the image matches a virus signature; the bytes are kept for investigation.
157
157
  * Get a floor plan image
158
158
  */
159
159
  getImagesRaw(requestParameters, initOverrides) {
@@ -194,7 +194,7 @@ class FloorPlansApi extends runtime.BaseAPI {
194
194
  });
195
195
  }
196
196
  /**
197
- * Returns the raw image bytes for the specified layer (`image` for the base drawing, `foreground` for the overlay). When no image has been uploaded a generated placeholder is returned unless `noFallback=true` is set. Requires the *View floorplans* permission. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the stored image matches a virus signature; the bytes are kept for investigation.
197
+ * Returns the raw image bytes for the specified layer (`image` for the base drawing, `foreground` for the overlay): the account file set as the layer\'s `backgroundFile` or `foregroundFile`, or, when there is none or it has been deleted from file storage, an image uploaded to the layer through `PUT`. When the layer has neither, a generated placeholder is returned unless `noFallback=true` is set. Requires the *View floorplans* permission; the *View file storage* permission is not needed to read the layer\'s account file. Returns `403` (`file quarantined: it matched a virus signature`) when a rescan found the image matches a virus signature; the bytes are kept for investigation.
198
198
  * Get a floor plan image
199
199
  */
200
200
  getImages(requestParameters, initOverrides) {
@@ -239,7 +239,7 @@ class FloorPlansApi extends runtime.BaseAPI {
239
239
  });
240
240
  }
241
241
  /**
242
- * Partially updates the floor plan\'s name, linked property and node, creation timestamp, image overlay offset, and space geometry. Only fields present in the request body are changed. When `spaces` is provided the entire space overlay is replaced. Requires the *Edit floorplans* permission.
242
+ * Partially updates the floor plan\'s name, linked property and node, creation timestamp, image overlay offset, background and foreground images, and space geometry. Only fields present in the request body are changed, and the request fails with `409` if the floor plan keeps changing while they are. When `spaces` is provided the entire space overlay is replaced. Requires the *Edit floorplans* permission. `backgroundFile` and `foregroundFile` take the ID of an image in the account\'s file storage (see `/v1/account/files`), or an empty string to remove the layer\'s image; choosing a file also requires the *View file storage* permission. The file must be a PNG, JPEG, GIF, WebP or SVG image of at most 4 MB that is not quarantined, otherwise the request fails with `422` (`403` when quarantined) and nothing is changed. Setting or removing a layer\'s file also deletes any image previously uploaded to that layer through `PUT /v1/floorplans/{id}/images/{imageType}`.
243
243
  * Update a floor plan
244
244
  */
245
245
  updateRaw(requestParameters, initOverrides) {
@@ -270,7 +270,7 @@ class FloorPlansApi extends runtime.BaseAPI {
270
270
  });
271
271
  }
272
272
  /**
273
- * Partially updates the floor plan\'s name, linked property and node, creation timestamp, image overlay offset, and space geometry. Only fields present in the request body are changed. When `spaces` is provided the entire space overlay is replaced. Requires the *Edit floorplans* permission.
273
+ * Partially updates the floor plan\'s name, linked property and node, creation timestamp, image overlay offset, background and foreground images, and space geometry. Only fields present in the request body are changed, and the request fails with `409` if the floor plan keeps changing while they are. When `spaces` is provided the entire space overlay is replaced. Requires the *Edit floorplans* permission. `backgroundFile` and `foregroundFile` take the ID of an image in the account\'s file storage (see `/v1/account/files`), or an empty string to remove the layer\'s image; choosing a file also requires the *View file storage* permission. The file must be a PNG, JPEG, GIF, WebP or SVG image of at most 4 MB that is not quarantined, otherwise the request fails with `422` (`403` when quarantined) and nothing is changed. Setting or removing a layer\'s file also deletes any image previously uploaded to that layer through `PUT /v1/floorplans/{id}/images/{imageType}`.
274
274
  * Update a floor plan
275
275
  */
276
276
  update(requestParameters, initOverrides) {
@@ -280,7 +280,7 @@ class FloorPlansApi extends runtime.BaseAPI {
280
280
  });
281
281
  }
282
282
  /**
283
- * Uploads an image file for the specified layer of a floor plan. Submit a `multipart/form-data` request with the file under the `file` key; the maximum file size is 4 MB. Accepted MIME types: `image/png`, `image/jpeg`, `image/gif`, `image/webp`, `image/svg+xml` (detected from file bytes). Omitting the file part deletes any existing image for that layer. Requires the *Edit floorplans* permission.
283
+ * Uploads an image file for the specified layer of a floor plan. Submit a `multipart/form-data` request with the file under the `file` key; the maximum file size is 4 MB. Accepted MIME types: `image/png`, `image/jpeg`, `image/gif`, `image/webp`, `image/svg+xml` (detected from file bytes). Omitting the file part deletes any existing image for that layer. Either way, the layer stops showing any account file set for it through `PATCH /v1/floorplans/{id}`; prefer setting `backgroundFile` or `foregroundFile` there instead. Requires the *Edit floorplans* permission.
284
284
  * Upload a floor plan image
285
285
  */
286
286
  updateImagesRaw(requestParameters, initOverrides) {
@@ -335,7 +335,7 @@ class FloorPlansApi extends runtime.BaseAPI {
335
335
  });
336
336
  }
337
337
  /**
338
- * Uploads an image file for the specified layer of a floor plan. Submit a `multipart/form-data` request with the file under the `file` key; the maximum file size is 4 MB. Accepted MIME types: `image/png`, `image/jpeg`, `image/gif`, `image/webp`, `image/svg+xml` (detected from file bytes). Omitting the file part deletes any existing image for that layer. Requires the *Edit floorplans* permission.
338
+ * Uploads an image file for the specified layer of a floor plan. Submit a `multipart/form-data` request with the file under the `file` key; the maximum file size is 4 MB. Accepted MIME types: `image/png`, `image/jpeg`, `image/gif`, `image/webp`, `image/svg+xml` (detected from file bytes). Omitting the file part deletes any existing image for that layer. Either way, the layer stops showing any account file set for it through `PATCH /v1/floorplans/{id}`; prefer setting `backgroundFile` or `foregroundFile` there instead. Requires the *Edit floorplans* permission.
339
339
  * Upload a floor plan image
340
340
  */
341
341
  updateImages(requestParameters, initOverrides) {
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { FeatureGroupsResBody, I18nTranslationsExportParamsWrapperBody, I18nTranslationsImportParamsWrapperBody, ReconcileReport, RepairFloorplansResBody, RetriesResBody, SysAdminUpdateFeatureGroupsParamsWrapperBody } from '../models/index';
13
+ import type { FeatureGroupsResBody, I18nTranslationsExportParamsWrapperBody, I18nTranslationsImportParamsWrapperBody, ReconcileReport, RepairFloorplansResBody, RetriesResBody, ScriptLimitOverrides, ScriptLimitsResBody, SysAdminUpdateFeatureGroupsParamsWrapperBody } from '../models/index';
14
14
  export interface InternalApiCreateAdminPopulateRequest {
15
15
  body: number;
16
16
  }
@@ -27,6 +27,13 @@ export interface InternalApiCreateTranslationsExportRequest {
27
27
  export interface InternalApiCreateTranslationsImportRequest {
28
28
  i18nTranslationsImportParamsWrapperBody: I18nTranslationsImportParamsWrapperBody;
29
29
  }
30
+ export interface InternalApiListAdminAccountsScriptLimitsRequest {
31
+ account: number;
32
+ }
33
+ export interface InternalApiUpdateAdminAccountsScriptLimitsRequest {
34
+ account: number;
35
+ scriptLimitOverrides: ScriptLimitOverrides;
36
+ }
30
37
  /**
31
38
  * InternalApi - interface
32
39
  *
@@ -170,6 +177,20 @@ export interface InternalApiInterface {
170
177
  * Import translations from CSV
171
178
  */
172
179
  createTranslationsImport(requestParameters: InternalApiCreateTranslationsImportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object>;
180
+ /**
181
+ * Returns the code defaults for scripts, the account\'s overrides and the limits that apply to it. Requires the *Project admin controls* and *Sys admin* permissions.
182
+ * @summary Get an account\'s script limits
183
+ * @param {number} account
184
+ * @param {*} [options] Override http request option.
185
+ * @throws {RequiredError}
186
+ * @memberof InternalApiInterface
187
+ */
188
+ listAdminAccountsScriptLimitsRaw(requestParameters: InternalApiListAdminAccountsScriptLimitsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ScriptLimitsResBody>>;
189
+ /**
190
+ * Returns the code defaults for scripts, the account\'s overrides and the limits that apply to it. Requires the *Project admin controls* and *Sys admin* permissions.
191
+ * Get an account\'s script limits
192
+ */
193
+ listAdminAccountsScriptLimits(requestParameters: InternalApiListAdminAccountsScriptLimitsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScriptLimitsResBody>;
173
194
  /**
174
195
  * Dispatches events to regenerate any preset images and derived assets for the caller\'s account. Requires the *Project admin controls* and *Sys admin* permissions.
175
196
  * @summary Regenerate customer preset assets
@@ -183,6 +204,21 @@ export interface InternalApiInterface {
183
204
  * Regenerate customer preset assets
184
205
  */
185
206
  listAdminRegeneratePresets(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
207
+ /**
208
+ * Replaces all of the account\'s script limit overrides with the body; an absent field uses the default, so an empty body returns the account to the defaults. Rejected with 422 when a value is not positive, or when maxCreditsPerMonth is above 9223372036854. Requires the *Project admin controls* and *Sys admin* permissions.
209
+ * @summary Set an account\'s script limits
210
+ * @param {number} account
211
+ * @param {ScriptLimitOverrides} scriptLimitOverrides
212
+ * @param {*} [options] Override http request option.
213
+ * @throws {RequiredError}
214
+ * @memberof InternalApiInterface
215
+ */
216
+ updateAdminAccountsScriptLimitsRaw(requestParameters: InternalApiUpdateAdminAccountsScriptLimitsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ScriptLimitsResBody>>;
217
+ /**
218
+ * Replaces all of the account\'s script limit overrides with the body; an absent field uses the default, so an empty body returns the account to the defaults. Rejected with 422 when a value is not positive, or when maxCreditsPerMonth is above 9223372036854. Requires the *Project admin controls* and *Sys admin* permissions.
219
+ * Set an account\'s script limits
220
+ */
221
+ updateAdminAccountsScriptLimits(requestParameters: InternalApiUpdateAdminAccountsScriptLimitsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScriptLimitsResBody>;
186
222
  }
187
223
  /**
188
224
  *
@@ -288,6 +324,16 @@ export declare class InternalApi extends runtime.BaseAPI implements InternalApiI
288
324
  * Import translations from CSV
289
325
  */
290
326
  createTranslationsImport(requestParameters: InternalApiCreateTranslationsImportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<object>;
327
+ /**
328
+ * Returns the code defaults for scripts, the account\'s overrides and the limits that apply to it. Requires the *Project admin controls* and *Sys admin* permissions.
329
+ * Get an account\'s script limits
330
+ */
331
+ listAdminAccountsScriptLimitsRaw(requestParameters: InternalApiListAdminAccountsScriptLimitsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ScriptLimitsResBody>>;
332
+ /**
333
+ * Returns the code defaults for scripts, the account\'s overrides and the limits that apply to it. Requires the *Project admin controls* and *Sys admin* permissions.
334
+ * Get an account\'s script limits
335
+ */
336
+ listAdminAccountsScriptLimits(requestParameters: InternalApiListAdminAccountsScriptLimitsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScriptLimitsResBody>;
291
337
  /**
292
338
  * Dispatches events to regenerate any preset images and derived assets for the caller\'s account. Requires the *Project admin controls* and *Sys admin* permissions.
293
339
  * Regenerate customer preset assets
@@ -298,4 +344,14 @@ export declare class InternalApi extends runtime.BaseAPI implements InternalApiI
298
344
  * Regenerate customer preset assets
299
345
  */
300
346
  listAdminRegeneratePresets(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
347
+ /**
348
+ * Replaces all of the account\'s script limit overrides with the body; an absent field uses the default, so an empty body returns the account to the defaults. Rejected with 422 when a value is not positive, or when maxCreditsPerMonth is above 9223372036854. Requires the *Project admin controls* and *Sys admin* permissions.
349
+ * Set an account\'s script limits
350
+ */
351
+ updateAdminAccountsScriptLimitsRaw(requestParameters: InternalApiUpdateAdminAccountsScriptLimitsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ScriptLimitsResBody>>;
352
+ /**
353
+ * Replaces all of the account\'s script limit overrides with the body; an absent field uses the default, so an empty body returns the account to the defaults. Rejected with 422 when a value is not positive, or when maxCreditsPerMonth is above 9223372036854. Requires the *Project admin controls* and *Sys admin* permissions.
354
+ * Set an account\'s script limits
355
+ */
356
+ updateAdminAccountsScriptLimits(requestParameters: InternalApiUpdateAdminAccountsScriptLimitsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScriptLimitsResBody>;
301
357
  }
@@ -412,6 +412,45 @@ class InternalApi extends runtime.BaseAPI {
412
412
  return yield response.value();
413
413
  });
414
414
  }
415
+ /**
416
+ * Returns the code defaults for scripts, the account\'s overrides and the limits that apply to it. Requires the *Project admin controls* and *Sys admin* permissions.
417
+ * Get an account\'s script limits
418
+ */
419
+ listAdminAccountsScriptLimitsRaw(requestParameters, initOverrides) {
420
+ return __awaiter(this, void 0, void 0, function* () {
421
+ if (requestParameters['account'] == null) {
422
+ throw new runtime.RequiredError('account', 'Required parameter "account" was null or undefined when calling listAdminAccountsScriptLimits().');
423
+ }
424
+ const queryParameters = {};
425
+ const headerParameters = {};
426
+ if (this.configuration && this.configuration.accessToken) {
427
+ const token = this.configuration.accessToken;
428
+ const tokenString = yield token("accessToken", []);
429
+ if (tokenString) {
430
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
431
+ }
432
+ }
433
+ let urlPath = `/v1/admin/accounts/{account}/script-limits`;
434
+ urlPath = urlPath.replace(`{${"account"}}`, encodeURIComponent(String(requestParameters['account'])));
435
+ const response = yield this.request({
436
+ path: urlPath,
437
+ method: 'GET',
438
+ headers: headerParameters,
439
+ query: queryParameters,
440
+ }, initOverrides);
441
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ScriptLimitsResBodyFromJSON)(jsonValue));
442
+ });
443
+ }
444
+ /**
445
+ * Returns the code defaults for scripts, the account\'s overrides and the limits that apply to it. Requires the *Project admin controls* and *Sys admin* permissions.
446
+ * Get an account\'s script limits
447
+ */
448
+ listAdminAccountsScriptLimits(requestParameters, initOverrides) {
449
+ return __awaiter(this, void 0, void 0, function* () {
450
+ const response = yield this.listAdminAccountsScriptLimitsRaw(requestParameters, initOverrides);
451
+ return yield response.value();
452
+ });
453
+ }
415
454
  /**
416
455
  * Dispatches events to regenerate any preset images and derived assets for the caller\'s account. Requires the *Project admin controls* and *Sys admin* permissions.
417
456
  * Regenerate customer preset assets
@@ -446,5 +485,49 @@ class InternalApi extends runtime.BaseAPI {
446
485
  yield this.listAdminRegeneratePresetsRaw(initOverrides);
447
486
  });
448
487
  }
488
+ /**
489
+ * Replaces all of the account\'s script limit overrides with the body; an absent field uses the default, so an empty body returns the account to the defaults. Rejected with 422 when a value is not positive, or when maxCreditsPerMonth is above 9223372036854. Requires the *Project admin controls* and *Sys admin* permissions.
490
+ * Set an account\'s script limits
491
+ */
492
+ updateAdminAccountsScriptLimitsRaw(requestParameters, initOverrides) {
493
+ return __awaiter(this, void 0, void 0, function* () {
494
+ if (requestParameters['account'] == null) {
495
+ throw new runtime.RequiredError('account', 'Required parameter "account" was null or undefined when calling updateAdminAccountsScriptLimits().');
496
+ }
497
+ if (requestParameters['scriptLimitOverrides'] == null) {
498
+ throw new runtime.RequiredError('scriptLimitOverrides', 'Required parameter "scriptLimitOverrides" was null or undefined when calling updateAdminAccountsScriptLimits().');
499
+ }
500
+ const queryParameters = {};
501
+ const headerParameters = {};
502
+ headerParameters['Content-Type'] = 'application/json';
503
+ if (this.configuration && this.configuration.accessToken) {
504
+ const token = this.configuration.accessToken;
505
+ const tokenString = yield token("accessToken", []);
506
+ if (tokenString) {
507
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
508
+ }
509
+ }
510
+ let urlPath = `/v1/admin/accounts/{account}/script-limits`;
511
+ urlPath = urlPath.replace(`{${"account"}}`, encodeURIComponent(String(requestParameters['account'])));
512
+ const response = yield this.request({
513
+ path: urlPath,
514
+ method: 'PUT',
515
+ headers: headerParameters,
516
+ query: queryParameters,
517
+ body: (0, index_1.ScriptLimitOverridesToJSON)(requestParameters['scriptLimitOverrides']),
518
+ }, initOverrides);
519
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ScriptLimitsResBodyFromJSON)(jsonValue));
520
+ });
521
+ }
522
+ /**
523
+ * Replaces all of the account\'s script limit overrides with the body; an absent field uses the default, so an empty body returns the account to the defaults. Rejected with 422 when a value is not positive, or when maxCreditsPerMonth is above 9223372036854. Requires the *Project admin controls* and *Sys admin* permissions.
524
+ * Set an account\'s script limits
525
+ */
526
+ updateAdminAccountsScriptLimits(requestParameters, initOverrides) {
527
+ return __awaiter(this, void 0, void 0, function* () {
528
+ const response = yield this.updateAdminAccountsScriptLimitsRaw(requestParameters, initOverrides);
529
+ return yield response.value();
530
+ });
531
+ }
449
532
  }
450
533
  exports.InternalApi = InternalApi;
@@ -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, ScriptWebhookResBody } from '../models/index';
13
+ import type { 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
  }
@@ -59,7 +59,7 @@ export interface ScriptsApiUpdateSecretsRequest {
59
59
  */
60
60
  export interface ScriptsApiInterface {
61
61
  /**
62
- * Creates a script whose Python, Go or JavaScript handler is called on a schedule, from a webhook, or both. The handler\'s context carries a Spaciv API key acting with the caller\'s permissions, except the account-administration permissions (*Manage my account*, *Manage users*, *Edit my user profile*, *Edit billing address* and the system permissions), which a script\'s key never carries, plus the account and, when a project is set, the project; the key is rotated automatically. A non-null return value is written to the run\'s logs. When `webhook` is true the response\'s `webhookUrl` is the only time the URL is returned. Rejected with `422` when the source, schedule or secrets are invalid or the project does not exist, and with `409` when the account already has 50 scripts. Requires the *Manage my account* permission; a script\'s own API key cannot call this or any other script operation.
62
+ * Creates a script whose Python, Go or JavaScript handler is called on a schedule, from a webhook, or both. The handler\'s context carries a Spaciv API key acting with the caller\'s permissions, except the account-administration permissions (*Manage my account*, *Manage users*, *Edit my user profile*, *Edit billing address* and the system permissions), which a script\'s key never carries, plus the account and, when a project is set, the project; the key is rotated automatically. A non-null return value is written to the run\'s logs. When `webhook` is true the response\'s `webhookUrl` is the only time the URL is returned. Rejected with `422` when the source, schedule or secrets are invalid or the project does not exist, and with `409` when the account already has 50 scripts, or when the script is enabled and the account already has its limit of enabled scripts. Requires the *Manage my account* permission; a script\'s own API key cannot call this or any other script operation.
63
63
  * @summary Create a script
64
64
  * @param {ScriptPostReqBody} scriptPostReqBody
65
65
  * @param {*} [options] Override http request option.
@@ -68,7 +68,7 @@ export interface ScriptsApiInterface {
68
68
  */
69
69
  createRaw(requestParameters: ScriptsApiCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ScriptDetail>>;
70
70
  /**
71
- * Creates a script whose Python, Go or JavaScript handler is called on a schedule, from a webhook, or both. The handler\'s context carries a Spaciv API key acting with the caller\'s permissions, except the account-administration permissions (*Manage my account*, *Manage users*, *Edit my user profile*, *Edit billing address* and the system permissions), which a script\'s key never carries, plus the account and, when a project is set, the project; the key is rotated automatically. A non-null return value is written to the run\'s logs. When `webhook` is true the response\'s `webhookUrl` is the only time the URL is returned. Rejected with `422` when the source, schedule or secrets are invalid or the project does not exist, and with `409` when the account already has 50 scripts. Requires the *Manage my account* permission; a script\'s own API key cannot call this or any other script operation.
71
+ * Creates a script whose Python, Go or JavaScript handler is called on a schedule, from a webhook, or both. The handler\'s context carries a Spaciv API key acting with the caller\'s permissions, except the account-administration permissions (*Manage my account*, *Manage users*, *Edit my user profile*, *Edit billing address* and the system permissions), which a script\'s key never carries, plus the account and, when a project is set, the project; the key is rotated automatically. A non-null return value is written to the run\'s logs. When `webhook` is true the response\'s `webhookUrl` is the only time the URL is returned. Rejected with `422` when the source, schedule or secrets are invalid or the project does not exist, and with `409` when the account already has 50 scripts, or when the script is enabled and the account already has its limit of enabled scripts. Requires the *Manage my account* permission; a script\'s own API key cannot call this or any other script operation.
72
72
  * Create a script
73
73
  */
74
74
  create(requestParameters: ScriptsApiCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScriptDetail>;
@@ -171,6 +171,19 @@ export interface ScriptsApiInterface {
171
171
  * Export scripts
172
172
  */
173
173
  getExport(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScriptExportResBody>;
174
+ /**
175
+ * 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
+ * @summary Get script usage
177
+ * @param {*} [options] Override http request option.
178
+ * @throws {RequiredError}
179
+ * @memberof ScriptsApiInterface
180
+ */
181
+ getUsageRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ScriptUsageResBody>>;
182
+ /**
183
+ * 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.
184
+ * Get script usage
185
+ */
186
+ getUsage(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScriptUsageResBody>;
174
187
  /**
175
188
  * Lists the account\'s scripts, sorted by name, without their source code. Requires the *Manage my account* permission.
176
189
  * @summary List scripts
@@ -216,7 +229,7 @@ export interface ScriptsApiInterface {
216
229
  */
217
230
  listRunsLogs(requestParameters: ScriptsApiListRunsLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScriptRunLogsResBody>;
218
231
  /**
219
- * Updates the fields given. Changing the project replaces the script\'s API key with one scoped to the new project. When someone other than the key\'s owner changes the language, manifest or files, the key is replaced with one acting as them. Turning the webhook on returns its `webhookUrl` once. Rejected with `409` when `revision` is stale, or when enabling a script whose key needs re-authorising; with `422` when the result is invalid. Requires the *Manage my account* permission.
232
+ * Updates the fields given. Changing the project replaces the script\'s API key with one scoped to the new project. When someone other than the key\'s owner changes the language, manifest or files, the key is replaced with one acting as them. Turning the webhook on returns its `webhookUrl` once. Rejected with `409` when `revision` is stale, when enabling a script whose key needs re-authorising, or when enabling it would exceed the account\'s limit of enabled scripts; with `422` when the result is invalid, including a changed schedule that runs more often than the account\'s minimum interval. Requires the *Manage my account* permission.
220
233
  * @summary Update a script
221
234
  * @param {string} id
222
235
  * @param {ScriptPatchReqBody} scriptPatchReqBody
@@ -226,7 +239,7 @@ export interface ScriptsApiInterface {
226
239
  */
227
240
  updateRaw(requestParameters: ScriptsApiUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ScriptDetail>>;
228
241
  /**
229
- * Updates the fields given. Changing the project replaces the script\'s API key with one scoped to the new project. When someone other than the key\'s owner changes the language, manifest or files, the key is replaced with one acting as them. Turning the webhook on returns its `webhookUrl` once. Rejected with `409` when `revision` is stale, or when enabling a script whose key needs re-authorising; with `422` when the result is invalid. Requires the *Manage my account* permission.
242
+ * Updates the fields given. Changing the project replaces the script\'s API key with one scoped to the new project. When someone other than the key\'s owner changes the language, manifest or files, the key is replaced with one acting as them. Turning the webhook on returns its `webhookUrl` once. Rejected with `409` when `revision` is stale, when enabling a script whose key needs re-authorising, or when enabling it would exceed the account\'s limit of enabled scripts; with `422` when the result is invalid, including a changed schedule that runs more often than the account\'s minimum interval. Requires the *Manage my account* permission.
230
243
  * Update a script
231
244
  */
232
245
  update(requestParameters: ScriptsApiUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScriptDetail>;
@@ -251,12 +264,12 @@ export interface ScriptsApiInterface {
251
264
  */
252
265
  export declare class ScriptsApi extends runtime.BaseAPI implements ScriptsApiInterface {
253
266
  /**
254
- * Creates a script whose Python, Go or JavaScript handler is called on a schedule, from a webhook, or both. The handler\'s context carries a Spaciv API key acting with the caller\'s permissions, except the account-administration permissions (*Manage my account*, *Manage users*, *Edit my user profile*, *Edit billing address* and the system permissions), which a script\'s key never carries, plus the account and, when a project is set, the project; the key is rotated automatically. A non-null return value is written to the run\'s logs. When `webhook` is true the response\'s `webhookUrl` is the only time the URL is returned. Rejected with `422` when the source, schedule or secrets are invalid or the project does not exist, and with `409` when the account already has 50 scripts. Requires the *Manage my account* permission; a script\'s own API key cannot call this or any other script operation.
267
+ * Creates a script whose Python, Go or JavaScript handler is called on a schedule, from a webhook, or both. The handler\'s context carries a Spaciv API key acting with the caller\'s permissions, except the account-administration permissions (*Manage my account*, *Manage users*, *Edit my user profile*, *Edit billing address* and the system permissions), which a script\'s key never carries, plus the account and, when a project is set, the project; the key is rotated automatically. A non-null return value is written to the run\'s logs. When `webhook` is true the response\'s `webhookUrl` is the only time the URL is returned. Rejected with `422` when the source, schedule or secrets are invalid or the project does not exist, and with `409` when the account already has 50 scripts, or when the script is enabled and the account already has its limit of enabled scripts. Requires the *Manage my account* permission; a script\'s own API key cannot call this or any other script operation.
255
268
  * Create a script
256
269
  */
257
270
  createRaw(requestParameters: ScriptsApiCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ScriptDetail>>;
258
271
  /**
259
- * Creates a script whose Python, Go or JavaScript handler is called on a schedule, from a webhook, or both. The handler\'s context carries a Spaciv API key acting with the caller\'s permissions, except the account-administration permissions (*Manage my account*, *Manage users*, *Edit my user profile*, *Edit billing address* and the system permissions), which a script\'s key never carries, plus the account and, when a project is set, the project; the key is rotated automatically. A non-null return value is written to the run\'s logs. When `webhook` is true the response\'s `webhookUrl` is the only time the URL is returned. Rejected with `422` when the source, schedule or secrets are invalid or the project does not exist, and with `409` when the account already has 50 scripts. Requires the *Manage my account* permission; a script\'s own API key cannot call this or any other script operation.
272
+ * Creates a script whose Python, Go or JavaScript handler is called on a schedule, from a webhook, or both. The handler\'s context carries a Spaciv API key acting with the caller\'s permissions, except the account-administration permissions (*Manage my account*, *Manage users*, *Edit my user profile*, *Edit billing address* and the system permissions), which a script\'s key never carries, plus the account and, when a project is set, the project; the key is rotated automatically. A non-null return value is written to the run\'s logs. When `webhook` is true the response\'s `webhookUrl` is the only time the URL is returned. Rejected with `422` when the source, schedule or secrets are invalid or the project does not exist, and with `409` when the account already has 50 scripts, or when the script is enabled and the account already has its limit of enabled scripts. Requires the *Manage my account* permission; a script\'s own API key cannot call this or any other script operation.
260
273
  * Create a script
261
274
  */
262
275
  create(requestParameters: ScriptsApiCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScriptDetail>;
@@ -330,6 +343,16 @@ export declare class ScriptsApi extends runtime.BaseAPI implements ScriptsApiInt
330
343
  * Export scripts
331
344
  */
332
345
  getExport(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScriptExportResBody>;
346
+ /**
347
+ * 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
+ * Get script usage
349
+ */
350
+ getUsageRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ScriptUsageResBody>>;
351
+ /**
352
+ * 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.
353
+ * Get script usage
354
+ */
355
+ getUsage(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScriptUsageResBody>;
333
356
  /**
334
357
  * Lists the account\'s scripts, sorted by name, without their source code. Requires the *Manage my account* permission.
335
358
  * List scripts
@@ -361,12 +384,12 @@ export declare class ScriptsApi extends runtime.BaseAPI implements ScriptsApiInt
361
384
  */
362
385
  listRunsLogs(requestParameters: ScriptsApiListRunsLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScriptRunLogsResBody>;
363
386
  /**
364
- * Updates the fields given. Changing the project replaces the script\'s API key with one scoped to the new project. When someone other than the key\'s owner changes the language, manifest or files, the key is replaced with one acting as them. Turning the webhook on returns its `webhookUrl` once. Rejected with `409` when `revision` is stale, or when enabling a script whose key needs re-authorising; with `422` when the result is invalid. Requires the *Manage my account* permission.
387
+ * Updates the fields given. Changing the project replaces the script\'s API key with one scoped to the new project. When someone other than the key\'s owner changes the language, manifest or files, the key is replaced with one acting as them. Turning the webhook on returns its `webhookUrl` once. Rejected with `409` when `revision` is stale, when enabling a script whose key needs re-authorising, or when enabling it would exceed the account\'s limit of enabled scripts; with `422` when the result is invalid, including a changed schedule that runs more often than the account\'s minimum interval. Requires the *Manage my account* permission.
365
388
  * Update a script
366
389
  */
367
390
  updateRaw(requestParameters: ScriptsApiUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ScriptDetail>>;
368
391
  /**
369
- * Updates the fields given. Changing the project replaces the script\'s API key with one scoped to the new project. When someone other than the key\'s owner changes the language, manifest or files, the key is replaced with one acting as them. Turning the webhook on returns its `webhookUrl` once. Rejected with `409` when `revision` is stale, or when enabling a script whose key needs re-authorising; with `422` when the result is invalid. Requires the *Manage my account* permission.
392
+ * Updates the fields given. Changing the project replaces the script\'s API key with one scoped to the new project. When someone other than the key\'s owner changes the language, manifest or files, the key is replaced with one acting as them. Turning the webhook on returns its `webhookUrl` once. Rejected with `409` when `revision` is stale, when enabling a script whose key needs re-authorising, or when enabling it would exceed the account\'s limit of enabled scripts; with `422` when the result is invalid, including a changed schedule that runs more often than the account\'s minimum interval. Requires the *Manage my account* permission.
370
393
  * Update a script
371
394
  */
372
395
  update(requestParameters: ScriptsApiUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ScriptDetail>;