@spaciv/sdk 0.1.20 → 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.
- package/.openapi-generator/FILES +4 -0
- package/README.md +2 -2
- package/dist/apis/ScriptsApi.d.ts +57 -1
- package/dist/apis/ScriptsApi.js +82 -0
- package/dist/esm/apis/ScriptsApi.d.ts +57 -1
- package/dist/esm/apis/ScriptsApi.js +83 -1
- package/dist/esm/models/ScratchpadOutput.d.ts +69 -0
- package/dist/esm/models/ScratchpadOutput.js +64 -0
- package/dist/esm/models/ScratchpadOutputFile.d.ts +44 -0
- package/dist/esm/models/ScratchpadOutputFile.js +49 -0
- package/dist/esm/models/ScratchpadRun.d.ts +127 -0
- package/dist/esm/models/ScratchpadRun.js +91 -0
- package/dist/esm/models/ScratchpadRunPostReqBody.d.ts +58 -0
- package/dist/esm/models/ScratchpadRunPostReqBody.js +53 -0
- package/dist/esm/models/index.d.ts +4 -0
- package/dist/esm/models/index.js +4 -0
- package/dist/models/ScratchpadOutput.d.ts +69 -0
- package/dist/models/ScratchpadOutput.js +71 -0
- package/dist/models/ScratchpadOutputFile.d.ts +44 -0
- package/dist/models/ScratchpadOutputFile.js +56 -0
- package/dist/models/ScratchpadRun.d.ts +127 -0
- package/dist/models/ScratchpadRun.js +99 -0
- package/dist/models/ScratchpadRunPostReqBody.d.ts +58 -0
- package/dist/models/ScratchpadRunPostReqBody.js +60 -0
- package/dist/models/index.d.ts +4 -0
- package/dist/models/index.js +4 -0
- package/package.json +1 -1
- package/src/apis/ScriptsApi.ts +148 -0
- package/src/models/ScratchpadOutput.ts +126 -0
- package/src/models/ScratchpadOutputFile.ts +83 -0
- package/src/models/ScratchpadRun.ts +203 -0
- package/src/models/ScratchpadRunPostReqBody.ts +99 -0
- package/src/models/index.ts +4 -0
package/.openapi-generator/FILES
CHANGED
|
@@ -332,6 +332,10 @@ src/models/ScenarioListEntry.ts
|
|
|
332
332
|
src/models/ScenarioListRes.ts
|
|
333
333
|
src/models/ScenarioNotFoundDetail.ts
|
|
334
334
|
src/models/ScenarioPatch.ts
|
|
335
|
+
src/models/ScratchpadOutput.ts
|
|
336
|
+
src/models/ScratchpadOutputFile.ts
|
|
337
|
+
src/models/ScratchpadRun.ts
|
|
338
|
+
src/models/ScratchpadRunPostReqBody.ts
|
|
335
339
|
src/models/ScriptAuditEntry.ts
|
|
336
340
|
src/models/ScriptAuditResBody.ts
|
|
337
341
|
src/models/ScriptDetail.ts
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## @spaciv/sdk@0.1.
|
|
1
|
+
## @spaciv/sdk@0.1.21
|
|
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.
|
|
39
|
+
npm install @spaciv/sdk@0.1.21 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
|
@@ -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
|
package/dist/apis/ScriptsApi.js
CHANGED
|
@@ -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
|
|
@@ -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
|
|
@@ -21,7 +21,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
import * as runtime from '../runtime';
|
|
24
|
-
import { ScriptAuditResBodyFromJSON, ScriptDetailFromJSON, ScriptExportResBodyFromJSON, ScriptListResBodyFromJSON, ScriptPatchReqBodyToJSON, ScriptPostReqBodyToJSON, ScriptRunLogsResBodyFromJSON, ScriptRunsResBodyFromJSON, ScriptSchedulePreviewReqBodyToJSON, ScriptSchedulePreviewResBodyFromJSON, ScriptSecretsReqBodyToJSON, ScriptSecretsResBodyFromJSON, ScriptUsageResBodyFromJSON, ScriptWebhookResBodyFromJSON, } from '../models/index';
|
|
24
|
+
import { ScratchpadRunFromJSON, ScratchpadRunPostReqBodyToJSON, ScriptAuditResBodyFromJSON, ScriptDetailFromJSON, ScriptExportResBodyFromJSON, ScriptListResBodyFromJSON, ScriptPatchReqBodyToJSON, ScriptPostReqBodyToJSON, ScriptRunLogsResBodyFromJSON, ScriptRunsResBodyFromJSON, ScriptSchedulePreviewReqBodyToJSON, ScriptSchedulePreviewResBodyFromJSON, ScriptSecretsReqBodyToJSON, ScriptSecretsResBodyFromJSON, ScriptUsageResBodyFromJSON, ScriptWebhookResBodyFromJSON, } from '../models/index';
|
|
25
25
|
/**
|
|
26
26
|
*
|
|
27
27
|
*/
|
|
@@ -184,6 +184,46 @@ export class ScriptsApi extends runtime.BaseAPI {
|
|
|
184
184
|
return yield response.value();
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* 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.
|
|
189
|
+
* Run scratchpad code
|
|
190
|
+
*/
|
|
191
|
+
createScratchpadRunsRaw(requestParameters, initOverrides) {
|
|
192
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
193
|
+
if (requestParameters['scratchpadRunPostReqBody'] == null) {
|
|
194
|
+
throw new runtime.RequiredError('scratchpadRunPostReqBody', 'Required parameter "scratchpadRunPostReqBody" was null or undefined when calling createScratchpadRuns().');
|
|
195
|
+
}
|
|
196
|
+
const queryParameters = {};
|
|
197
|
+
const headerParameters = {};
|
|
198
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
199
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
200
|
+
const token = this.configuration.accessToken;
|
|
201
|
+
const tokenString = yield token("accessToken", []);
|
|
202
|
+
if (tokenString) {
|
|
203
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
let urlPath = `/v1/scripts/scratchpad/runs`;
|
|
207
|
+
const response = yield this.request({
|
|
208
|
+
path: urlPath,
|
|
209
|
+
method: 'POST',
|
|
210
|
+
headers: headerParameters,
|
|
211
|
+
query: queryParameters,
|
|
212
|
+
body: ScratchpadRunPostReqBodyToJSON(requestParameters['scratchpadRunPostReqBody']),
|
|
213
|
+
}, initOverrides);
|
|
214
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ScratchpadRunFromJSON(jsonValue));
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* 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.
|
|
219
|
+
* Run scratchpad code
|
|
220
|
+
*/
|
|
221
|
+
createScratchpadRuns(requestParameters, initOverrides) {
|
|
222
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
223
|
+
const response = yield this.createScratchpadRunsRaw(requestParameters, initOverrides);
|
|
224
|
+
return yield response.value();
|
|
225
|
+
});
|
|
226
|
+
}
|
|
187
227
|
/**
|
|
188
228
|
* Stops any active runs, deletes the script with its secrets and run history, and revokes its API keys. Requires the *Manage my account* permission.
|
|
189
229
|
* Delete a script
|
|
@@ -341,6 +381,48 @@ export class ScriptsApi extends runtime.BaseAPI {
|
|
|
341
381
|
return yield response.value();
|
|
342
382
|
});
|
|
343
383
|
}
|
|
384
|
+
/**
|
|
385
|
+
* 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.
|
|
386
|
+
* Get a scratchpad run
|
|
387
|
+
*/
|
|
388
|
+
getScratchpadRunsRaw(requestParameters, initOverrides) {
|
|
389
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
390
|
+
if (requestParameters['runId'] == null) {
|
|
391
|
+
throw new runtime.RequiredError('runId', 'Required parameter "runId" was null or undefined when calling getScratchpadRuns().');
|
|
392
|
+
}
|
|
393
|
+
const queryParameters = {};
|
|
394
|
+
if (requestParameters['waitSeconds'] != null) {
|
|
395
|
+
queryParameters['waitSeconds'] = requestParameters['waitSeconds'];
|
|
396
|
+
}
|
|
397
|
+
const headerParameters = {};
|
|
398
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
399
|
+
const token = this.configuration.accessToken;
|
|
400
|
+
const tokenString = yield token("accessToken", []);
|
|
401
|
+
if (tokenString) {
|
|
402
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
let urlPath = `/v1/scripts/scratchpad/runs/{runId}`;
|
|
406
|
+
urlPath = urlPath.replace(`{${"runId"}}`, encodeURIComponent(String(requestParameters['runId'])));
|
|
407
|
+
const response = yield this.request({
|
|
408
|
+
path: urlPath,
|
|
409
|
+
method: 'GET',
|
|
410
|
+
headers: headerParameters,
|
|
411
|
+
query: queryParameters,
|
|
412
|
+
}, initOverrides);
|
|
413
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ScratchpadRunFromJSON(jsonValue));
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* 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.
|
|
418
|
+
* Get a scratchpad run
|
|
419
|
+
*/
|
|
420
|
+
getScratchpadRuns(requestParameters, initOverrides) {
|
|
421
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
422
|
+
const response = yield this.getScratchpadRunsRaw(requestParameters, initOverrides);
|
|
423
|
+
return yield response.value();
|
|
424
|
+
});
|
|
425
|
+
}
|
|
344
426
|
/**
|
|
345
427
|
* 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.
|
|
346
428
|
* Get script usage
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* spaciv API
|
|
3
|
+
* The spaciv API powers workplace planning: modelling how many people an organisation has, how they work, and how much space that requires. ## Getting started 1. Exchange credentials for an access token using one of the operations under **Authentication**. 2. Send that token on every subsequent request as `Authorization: Bearer <token>`. 3. Access tokens are short lived. Call `POST /v1/auth/refresh-token` to obtain a new one before the old one expires. ## Conventions Every operation is versioned under `/v1`. Collections are plural (`GET /v1/dashboards` lists, `POST /v1/dashboards` creates) and individual records live beneath them (`/v1/dashboards/{id}`). Singular paths such as `/v1/account`, `/v1/project` and `/v1/user` refer to the record the access token was issued for. Request and response bodies are JSON. Timestamps are RFC 3339. Identifiers are opaque strings unless documented otherwise, and collection operations return the records visible to the account the token was issued for. Failures return an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem document with a `detail` field describing what went wrong.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
* Contact: support@spaciv.com
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { ScratchpadOutputFile } from './ScratchpadOutputFile';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface ScratchpadOutput
|
|
17
|
+
*/
|
|
18
|
+
export interface ScratchpadOutput {
|
|
19
|
+
/**
|
|
20
|
+
* Why some of the output could not be collected, for example because it was over a limit.
|
|
21
|
+
* @type {string}
|
|
22
|
+
* @memberof ScratchpadOutput
|
|
23
|
+
*/
|
|
24
|
+
error?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Files the handler wrote to its output directory.
|
|
27
|
+
* @type {Array<ScratchpadOutputFile>}
|
|
28
|
+
* @memberof ScratchpadOutput
|
|
29
|
+
*/
|
|
30
|
+
files: Array<ScratchpadOutputFile>;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @type {any}
|
|
34
|
+
* @memberof ScratchpadOutput
|
|
35
|
+
*/
|
|
36
|
+
result?: any | null;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @type {string}
|
|
40
|
+
* @memberof ScratchpadOutput
|
|
41
|
+
*/
|
|
42
|
+
stderr: string;
|
|
43
|
+
/**
|
|
44
|
+
* Set when stderr was longer than the 256 KiB kept.
|
|
45
|
+
* @type {boolean}
|
|
46
|
+
* @memberof ScratchpadOutput
|
|
47
|
+
*/
|
|
48
|
+
stderrTruncated: boolean;
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @type {string}
|
|
52
|
+
* @memberof ScratchpadOutput
|
|
53
|
+
*/
|
|
54
|
+
stdout: string;
|
|
55
|
+
/**
|
|
56
|
+
* Set when stdout was longer than the 256 KiB kept.
|
|
57
|
+
* @type {boolean}
|
|
58
|
+
* @memberof ScratchpadOutput
|
|
59
|
+
*/
|
|
60
|
+
stdoutTruncated: boolean;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Check if a given object implements the ScratchpadOutput interface.
|
|
64
|
+
*/
|
|
65
|
+
export declare function instanceOfScratchpadOutput(value: object): value is ScratchpadOutput;
|
|
66
|
+
export declare function ScratchpadOutputFromJSON(json: any): ScratchpadOutput;
|
|
67
|
+
export declare function ScratchpadOutputFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScratchpadOutput;
|
|
68
|
+
export declare function ScratchpadOutputToJSON(json: any): ScratchpadOutput;
|
|
69
|
+
export declare function ScratchpadOutputToJSONTyped(value?: ScratchpadOutput | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* spaciv API
|
|
5
|
+
* The spaciv API powers workplace planning: modelling how many people an organisation has, how they work, and how much space that requires. ## Getting started 1. Exchange credentials for an access token using one of the operations under **Authentication**. 2. Send that token on every subsequent request as `Authorization: Bearer <token>`. 3. Access tokens are short lived. Call `POST /v1/auth/refresh-token` to obtain a new one before the old one expires. ## Conventions Every operation is versioned under `/v1`. Collections are plural (`GET /v1/dashboards` lists, `POST /v1/dashboards` creates) and individual records live beneath them (`/v1/dashboards/{id}`). Singular paths such as `/v1/account`, `/v1/project` and `/v1/user` refer to the record the access token was issued for. Request and response bodies are JSON. Timestamps are RFC 3339. Identifiers are opaque strings unless documented otherwise, and collection operations return the records visible to the account the token was issued for. Failures return an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem document with a `detail` field describing what went wrong.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
* Contact: support@spaciv.com
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
import { ScratchpadOutputFileFromJSON, ScratchpadOutputFileToJSON, } from './ScratchpadOutputFile';
|
|
15
|
+
/**
|
|
16
|
+
* Check if a given object implements the ScratchpadOutput interface.
|
|
17
|
+
*/
|
|
18
|
+
export function instanceOfScratchpadOutput(value) {
|
|
19
|
+
if (!('files' in value) || value['files'] === undefined)
|
|
20
|
+
return false;
|
|
21
|
+
if (!('stderr' in value) || value['stderr'] === undefined)
|
|
22
|
+
return false;
|
|
23
|
+
if (!('stderrTruncated' in value) || value['stderrTruncated'] === undefined)
|
|
24
|
+
return false;
|
|
25
|
+
if (!('stdout' in value) || value['stdout'] === undefined)
|
|
26
|
+
return false;
|
|
27
|
+
if (!('stdoutTruncated' in value) || value['stdoutTruncated'] === undefined)
|
|
28
|
+
return false;
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
export function ScratchpadOutputFromJSON(json) {
|
|
32
|
+
return ScratchpadOutputFromJSONTyped(json, false);
|
|
33
|
+
}
|
|
34
|
+
export function ScratchpadOutputFromJSONTyped(json, ignoreDiscriminator) {
|
|
35
|
+
if (json == null) {
|
|
36
|
+
return json;
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
'error': json['error'] == null ? undefined : json['error'],
|
|
40
|
+
'files': (json['files'].map(ScratchpadOutputFileFromJSON)),
|
|
41
|
+
'result': json['result'] == null ? undefined : json['result'],
|
|
42
|
+
'stderr': json['stderr'],
|
|
43
|
+
'stderrTruncated': json['stderrTruncated'],
|
|
44
|
+
'stdout': json['stdout'],
|
|
45
|
+
'stdoutTruncated': json['stdoutTruncated'],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export function ScratchpadOutputToJSON(json) {
|
|
49
|
+
return ScratchpadOutputToJSONTyped(json, false);
|
|
50
|
+
}
|
|
51
|
+
export function ScratchpadOutputToJSONTyped(value, ignoreDiscriminator = false) {
|
|
52
|
+
if (value == null) {
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
'error': value['error'],
|
|
57
|
+
'files': (value['files'].map(ScratchpadOutputFileToJSON)),
|
|
58
|
+
'result': value['result'],
|
|
59
|
+
'stderr': value['stderr'],
|
|
60
|
+
'stderrTruncated': value['stderrTruncated'],
|
|
61
|
+
'stdout': value['stdout'],
|
|
62
|
+
'stdoutTruncated': value['stdoutTruncated'],
|
|
63
|
+
};
|
|
64
|
+
}
|