@spaciv/sdk 0.1.19 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +8 -0
- package/README.md +2 -2
- package/dist/apis/FilesApi.d.ts +132 -18
- package/dist/apis/FilesApi.js +175 -8
- package/dist/apis/ScriptsApi.d.ts +57 -1
- package/dist/apis/ScriptsApi.js +82 -0
- package/dist/esm/apis/FilesApi.d.ts +132 -18
- package/dist/esm/apis/FilesApi.js +176 -9
- package/dist/esm/apis/ScriptsApi.d.ts +57 -1
- package/dist/esm/apis/ScriptsApi.js +83 -1
- package/dist/esm/models/AccountDirectoryPatchBody.d.ts +38 -0
- package/dist/esm/models/AccountDirectoryPatchBody.js +43 -0
- package/dist/esm/models/AccountDirectoryPostBody.d.ts +38 -0
- package/dist/esm/models/AccountDirectoryPostBody.js +45 -0
- package/dist/esm/models/AccountFilePatchBody.d.ts +8 -2
- package/dist/esm/models/AccountFilePatchBody.js +3 -3
- package/dist/esm/models/Directory.d.ts +56 -0
- package/dist/esm/models/Directory.js +57 -0
- package/dist/esm/models/DirectoryPage.d.ts +39 -0
- package/dist/esm/models/DirectoryPage.js +46 -0
- package/dist/esm/models/ListPage.d.ts +7 -0
- package/dist/esm/models/ListPage.js +3 -0
- package/dist/esm/models/ModelRecord.d.ts +7 -1
- package/dist/esm/models/ModelRecord.js +2 -0
- 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 +8 -0
- package/dist/esm/models/index.js +8 -0
- package/dist/models/AccountDirectoryPatchBody.d.ts +38 -0
- package/dist/models/AccountDirectoryPatchBody.js +50 -0
- package/dist/models/AccountDirectoryPostBody.d.ts +38 -0
- package/dist/models/AccountDirectoryPostBody.js +52 -0
- package/dist/models/AccountFilePatchBody.d.ts +8 -2
- package/dist/models/AccountFilePatchBody.js +3 -3
- package/dist/models/Directory.d.ts +56 -0
- package/dist/models/Directory.js +64 -0
- package/dist/models/DirectoryPage.d.ts +39 -0
- package/dist/models/DirectoryPage.js +53 -0
- package/dist/models/ListPage.d.ts +7 -0
- package/dist/models/ListPage.js +3 -0
- package/dist/models/ModelRecord.d.ts +7 -1
- package/dist/models/ModelRecord.js +2 -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 +8 -0
- package/dist/models/index.js +8 -0
- package/package.json +1 -1
- package/src/apis/FilesApi.ts +319 -17
- package/src/apis/ScriptsApi.ts +148 -0
- package/src/models/AccountDirectoryPatchBody.ts +73 -0
- package/src/models/AccountDirectoryPostBody.ts +74 -0
- package/src/models/AccountFilePatchBody.ts +11 -4
- package/src/models/Directory.ts +101 -0
- package/src/models/DirectoryPage.ts +82 -0
- package/src/models/ListPage.ts +15 -0
- package/src/models/ModelRecord.ts +9 -1
- 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 +8 -0
|
@@ -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,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* spaciv API
|
|
3
|
+
* The spaciv API powers workplace planning: modelling how many people an organisation has, how they work, and how much space that requires. ## Getting started 1. Exchange credentials for an access token using one of the operations under **Authentication**. 2. Send that token on every subsequent request as `Authorization: Bearer <token>`. 3. Access tokens are short lived. Call `POST /v1/auth/refresh-token` to obtain a new one before the old one expires. ## Conventions Every operation is versioned under `/v1`. Collections are plural (`GET /v1/dashboards` lists, `POST /v1/dashboards` creates) and individual records live beneath them (`/v1/dashboards/{id}`). Singular paths such as `/v1/account`, `/v1/project` and `/v1/user` refer to the record the access token was issued for. Request and response bodies are JSON. Timestamps are RFC 3339. Identifiers are opaque strings unless documented otherwise, and collection operations return the records visible to the account the token was issued for. Failures return an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem document with a `detail` field describing what went wrong.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
* Contact: support@spaciv.com
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface AccountDirectoryPatchBody
|
|
16
|
+
*/
|
|
17
|
+
export interface AccountDirectoryPatchBody {
|
|
18
|
+
/**
|
|
19
|
+
* New display name for the directory. At most 255 bytes after normalising to Unicode NFC. Must not contain a forward slash or a backslash, and must not be . or ..
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof AccountDirectoryPatchBody
|
|
22
|
+
*/
|
|
23
|
+
name?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Identifier of the directory to move this one into, or an empty string to move it to the root.
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof AccountDirectoryPatchBody
|
|
28
|
+
*/
|
|
29
|
+
parentId?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Check if a given object implements the AccountDirectoryPatchBody interface.
|
|
33
|
+
*/
|
|
34
|
+
export declare function instanceOfAccountDirectoryPatchBody(value: object): value is AccountDirectoryPatchBody;
|
|
35
|
+
export declare function AccountDirectoryPatchBodyFromJSON(json: any): AccountDirectoryPatchBody;
|
|
36
|
+
export declare function AccountDirectoryPatchBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountDirectoryPatchBody;
|
|
37
|
+
export declare function AccountDirectoryPatchBodyToJSON(json: any): AccountDirectoryPatchBody;
|
|
38
|
+
export declare function AccountDirectoryPatchBodyToJSONTyped(value?: AccountDirectoryPatchBody | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* spaciv API
|
|
5
|
+
* The spaciv API powers workplace planning: modelling how many people an organisation has, how they work, and how much space that requires. ## Getting started 1. Exchange credentials for an access token using one of the operations under **Authentication**. 2. Send that token on every subsequent request as `Authorization: Bearer <token>`. 3. Access tokens are short lived. Call `POST /v1/auth/refresh-token` to obtain a new one before the old one expires. ## Conventions Every operation is versioned under `/v1`. Collections are plural (`GET /v1/dashboards` lists, `POST /v1/dashboards` creates) and individual records live beneath them (`/v1/dashboards/{id}`). Singular paths such as `/v1/account`, `/v1/project` and `/v1/user` refer to the record the access token was issued for. Request and response bodies are JSON. Timestamps are RFC 3339. Identifiers are opaque strings unless documented otherwise, and collection operations return the records visible to the account the token was issued for. Failures return an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem document with a `detail` field describing what went wrong.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
* Contact: support@spaciv.com
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Check if a given object implements the AccountDirectoryPatchBody interface.
|
|
16
|
+
*/
|
|
17
|
+
export function instanceOfAccountDirectoryPatchBody(value) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
export function AccountDirectoryPatchBodyFromJSON(json) {
|
|
21
|
+
return AccountDirectoryPatchBodyFromJSONTyped(json, false);
|
|
22
|
+
}
|
|
23
|
+
export function AccountDirectoryPatchBodyFromJSONTyped(json, ignoreDiscriminator) {
|
|
24
|
+
if (json == null) {
|
|
25
|
+
return json;
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
'name': json['name'] == null ? undefined : json['name'],
|
|
29
|
+
'parentId': json['parentId'] == null ? undefined : json['parentId'],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export function AccountDirectoryPatchBodyToJSON(json) {
|
|
33
|
+
return AccountDirectoryPatchBodyToJSONTyped(json, false);
|
|
34
|
+
}
|
|
35
|
+
export function AccountDirectoryPatchBodyToJSONTyped(value, ignoreDiscriminator = false) {
|
|
36
|
+
if (value == null) {
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
'name': value['name'],
|
|
41
|
+
'parentId': value['parentId'],
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* spaciv API
|
|
3
|
+
* The spaciv API powers workplace planning: modelling how many people an organisation has, how they work, and how much space that requires. ## Getting started 1. Exchange credentials for an access token using one of the operations under **Authentication**. 2. Send that token on every subsequent request as `Authorization: Bearer <token>`. 3. Access tokens are short lived. Call `POST /v1/auth/refresh-token` to obtain a new one before the old one expires. ## Conventions Every operation is versioned under `/v1`. Collections are plural (`GET /v1/dashboards` lists, `POST /v1/dashboards` creates) and individual records live beneath them (`/v1/dashboards/{id}`). Singular paths such as `/v1/account`, `/v1/project` and `/v1/user` refer to the record the access token was issued for. Request and response bodies are JSON. Timestamps are RFC 3339. Identifiers are opaque strings unless documented otherwise, and collection operations return the records visible to the account the token was issued for. Failures return an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem document with a `detail` field describing what went wrong.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
* Contact: support@spaciv.com
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface AccountDirectoryPostBody
|
|
16
|
+
*/
|
|
17
|
+
export interface AccountDirectoryPostBody {
|
|
18
|
+
/**
|
|
19
|
+
* Display name of the directory. At most 255 bytes after normalising to Unicode NFC. Must not contain a forward slash or a backslash, and must not be . or ..
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof AccountDirectoryPostBody
|
|
22
|
+
*/
|
|
23
|
+
name: string;
|
|
24
|
+
/**
|
|
25
|
+
* Identifier of the directory to create this one in. Leave it out to create it at the root.
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof AccountDirectoryPostBody
|
|
28
|
+
*/
|
|
29
|
+
parentId?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Check if a given object implements the AccountDirectoryPostBody interface.
|
|
33
|
+
*/
|
|
34
|
+
export declare function instanceOfAccountDirectoryPostBody(value: object): value is AccountDirectoryPostBody;
|
|
35
|
+
export declare function AccountDirectoryPostBodyFromJSON(json: any): AccountDirectoryPostBody;
|
|
36
|
+
export declare function AccountDirectoryPostBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountDirectoryPostBody;
|
|
37
|
+
export declare function AccountDirectoryPostBodyToJSON(json: any): AccountDirectoryPostBody;
|
|
38
|
+
export declare function AccountDirectoryPostBodyToJSONTyped(value?: AccountDirectoryPostBody | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* spaciv API
|
|
5
|
+
* The spaciv API powers workplace planning: modelling how many people an organisation has, how they work, and how much space that requires. ## Getting started 1. Exchange credentials for an access token using one of the operations under **Authentication**. 2. Send that token on every subsequent request as `Authorization: Bearer <token>`. 3. Access tokens are short lived. Call `POST /v1/auth/refresh-token` to obtain a new one before the old one expires. ## Conventions Every operation is versioned under `/v1`. Collections are plural (`GET /v1/dashboards` lists, `POST /v1/dashboards` creates) and individual records live beneath them (`/v1/dashboards/{id}`). Singular paths such as `/v1/account`, `/v1/project` and `/v1/user` refer to the record the access token was issued for. Request and response bodies are JSON. Timestamps are RFC 3339. Identifiers are opaque strings unless documented otherwise, and collection operations return the records visible to the account the token was issued for. Failures return an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem document with a `detail` field describing what went wrong.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
* Contact: support@spaciv.com
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Check if a given object implements the AccountDirectoryPostBody interface.
|
|
16
|
+
*/
|
|
17
|
+
export function instanceOfAccountDirectoryPostBody(value) {
|
|
18
|
+
if (!('name' in value) || value['name'] === undefined)
|
|
19
|
+
return false;
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
export function AccountDirectoryPostBodyFromJSON(json) {
|
|
23
|
+
return AccountDirectoryPostBodyFromJSONTyped(json, false);
|
|
24
|
+
}
|
|
25
|
+
export function AccountDirectoryPostBodyFromJSONTyped(json, ignoreDiscriminator) {
|
|
26
|
+
if (json == null) {
|
|
27
|
+
return json;
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
'name': json['name'],
|
|
31
|
+
'parentId': json['parentId'] == null ? undefined : json['parentId'],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function AccountDirectoryPostBodyToJSON(json) {
|
|
35
|
+
return AccountDirectoryPostBodyToJSONTyped(json, false);
|
|
36
|
+
}
|
|
37
|
+
export function AccountDirectoryPostBodyToJSONTyped(value, ignoreDiscriminator = false) {
|
|
38
|
+
if (value == null) {
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
'name': value['name'],
|
|
43
|
+
'parentId': value['parentId'],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -16,11 +16,17 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export interface AccountFilePatchBody {
|
|
18
18
|
/**
|
|
19
|
-
* New display name for the file. Must not contain a forward slash or a backslash.
|
|
19
|
+
* New display name for the file. At most 255 bytes after normalising to Unicode NFC. Must not contain a forward slash or a backslash.
|
|
20
20
|
* @type {string}
|
|
21
21
|
* @memberof AccountFilePatchBody
|
|
22
22
|
*/
|
|
23
|
-
name
|
|
23
|
+
name?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Identifier of the directory to move the file into, or an empty string to move it to the root.
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof AccountFilePatchBody
|
|
28
|
+
*/
|
|
29
|
+
parentId?: string;
|
|
24
30
|
}
|
|
25
31
|
/**
|
|
26
32
|
* Check if a given object implements the AccountFilePatchBody interface.
|
|
@@ -15,8 +15,6 @@
|
|
|
15
15
|
* Check if a given object implements the AccountFilePatchBody interface.
|
|
16
16
|
*/
|
|
17
17
|
export function instanceOfAccountFilePatchBody(value) {
|
|
18
|
-
if (!('name' in value) || value['name'] === undefined)
|
|
19
|
-
return false;
|
|
20
18
|
return true;
|
|
21
19
|
}
|
|
22
20
|
export function AccountFilePatchBodyFromJSON(json) {
|
|
@@ -27,7 +25,8 @@ export function AccountFilePatchBodyFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
27
25
|
return json;
|
|
28
26
|
}
|
|
29
27
|
return {
|
|
30
|
-
'name': json['name'],
|
|
28
|
+
'name': json['name'] == null ? undefined : json['name'],
|
|
29
|
+
'parentId': json['parentId'] == null ? undefined : json['parentId'],
|
|
31
30
|
};
|
|
32
31
|
}
|
|
33
32
|
export function AccountFilePatchBodyToJSON(json) {
|
|
@@ -39,5 +38,6 @@ export function AccountFilePatchBodyToJSONTyped(value, ignoreDiscriminator = fal
|
|
|
39
38
|
}
|
|
40
39
|
return {
|
|
41
40
|
'name': value['name'],
|
|
41
|
+
'parentId': value['parentId'],
|
|
42
42
|
};
|
|
43
43
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* spaciv API
|
|
3
|
+
* The spaciv API powers workplace planning: modelling how many people an organisation has, how they work, and how much space that requires. ## Getting started 1. Exchange credentials for an access token using one of the operations under **Authentication**. 2. Send that token on every subsequent request as `Authorization: Bearer <token>`. 3. Access tokens are short lived. Call `POST /v1/auth/refresh-token` to obtain a new one before the old one expires. ## Conventions Every operation is versioned under `/v1`. Collections are plural (`GET /v1/dashboards` lists, `POST /v1/dashboards` creates) and individual records live beneath them (`/v1/dashboards/{id}`). Singular paths such as `/v1/account`, `/v1/project` and `/v1/user` refer to the record the access token was issued for. Request and response bodies are JSON. Timestamps are RFC 3339. Identifiers are opaque strings unless documented otherwise, and collection operations return the records visible to the account the token was issued for. Failures return an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem document with a `detail` field describing what went wrong.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
* Contact: support@spaciv.com
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface Directory
|
|
16
|
+
*/
|
|
17
|
+
export interface Directory {
|
|
18
|
+
/**
|
|
19
|
+
* When the directory was created (RFC 3339).
|
|
20
|
+
* @type {Date}
|
|
21
|
+
* @memberof Directory
|
|
22
|
+
*/
|
|
23
|
+
createdAt: Date;
|
|
24
|
+
/**
|
|
25
|
+
* Identifier of the user who created the directory.
|
|
26
|
+
* @type {number}
|
|
27
|
+
* @memberof Directory
|
|
28
|
+
*/
|
|
29
|
+
createdBy: number;
|
|
30
|
+
/**
|
|
31
|
+
* Opaque identifier of the directory.
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof Directory
|
|
34
|
+
*/
|
|
35
|
+
id: string;
|
|
36
|
+
/**
|
|
37
|
+
* Display name of the directory. Nothing else in the same parent has the same name, compared exactly and after normalising to Unicode NFC.
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof Directory
|
|
40
|
+
*/
|
|
41
|
+
name: string;
|
|
42
|
+
/**
|
|
43
|
+
* Identifier of the directory this one is in. Absent for a directory at the root.
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @memberof Directory
|
|
46
|
+
*/
|
|
47
|
+
parentId?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Check if a given object implements the Directory interface.
|
|
51
|
+
*/
|
|
52
|
+
export declare function instanceOfDirectory(value: object): value is Directory;
|
|
53
|
+
export declare function DirectoryFromJSON(json: any): Directory;
|
|
54
|
+
export declare function DirectoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): Directory;
|
|
55
|
+
export declare function DirectoryToJSON(json: any): Directory;
|
|
56
|
+
export declare function DirectoryToJSONTyped(value?: Directory | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* spaciv API
|
|
5
|
+
* The spaciv API powers workplace planning: modelling how many people an organisation has, how they work, and how much space that requires. ## Getting started 1. Exchange credentials for an access token using one of the operations under **Authentication**. 2. Send that token on every subsequent request as `Authorization: Bearer <token>`. 3. Access tokens are short lived. Call `POST /v1/auth/refresh-token` to obtain a new one before the old one expires. ## Conventions Every operation is versioned under `/v1`. Collections are plural (`GET /v1/dashboards` lists, `POST /v1/dashboards` creates) and individual records live beneath them (`/v1/dashboards/{id}`). Singular paths such as `/v1/account`, `/v1/project` and `/v1/user` refer to the record the access token was issued for. Request and response bodies are JSON. Timestamps are RFC 3339. Identifiers are opaque strings unless documented otherwise, and collection operations return the records visible to the account the token was issued for. Failures return an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem document with a `detail` field describing what went wrong.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
* Contact: support@spaciv.com
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Check if a given object implements the Directory interface.
|
|
16
|
+
*/
|
|
17
|
+
export function instanceOfDirectory(value) {
|
|
18
|
+
if (!('createdAt' in value) || value['createdAt'] === undefined)
|
|
19
|
+
return false;
|
|
20
|
+
if (!('createdBy' in value) || value['createdBy'] === undefined)
|
|
21
|
+
return false;
|
|
22
|
+
if (!('id' in value) || value['id'] === undefined)
|
|
23
|
+
return false;
|
|
24
|
+
if (!('name' in value) || value['name'] === undefined)
|
|
25
|
+
return false;
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
export function DirectoryFromJSON(json) {
|
|
29
|
+
return DirectoryFromJSONTyped(json, false);
|
|
30
|
+
}
|
|
31
|
+
export function DirectoryFromJSONTyped(json, ignoreDiscriminator) {
|
|
32
|
+
if (json == null) {
|
|
33
|
+
return json;
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
'createdAt': (new Date(json['createdAt'])),
|
|
37
|
+
'createdBy': json['createdBy'],
|
|
38
|
+
'id': json['id'],
|
|
39
|
+
'name': json['name'],
|
|
40
|
+
'parentId': json['parentId'] == null ? undefined : json['parentId'],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export function DirectoryToJSON(json) {
|
|
44
|
+
return DirectoryToJSONTyped(json, false);
|
|
45
|
+
}
|
|
46
|
+
export function DirectoryToJSONTyped(value, ignoreDiscriminator = false) {
|
|
47
|
+
if (value == null) {
|
|
48
|
+
return value;
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
'createdAt': ((value['createdAt']).toISOString()),
|
|
52
|
+
'createdBy': value['createdBy'],
|
|
53
|
+
'id': value['id'],
|
|
54
|
+
'name': value['name'],
|
|
55
|
+
'parentId': value['parentId'],
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { Directory } from './Directory';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface DirectoryPage
|
|
17
|
+
*/
|
|
18
|
+
export interface DirectoryPage {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @type {Array<Directory>}
|
|
22
|
+
* @memberof DirectoryPage
|
|
23
|
+
*/
|
|
24
|
+
directories: Array<Directory>;
|
|
25
|
+
/**
|
|
26
|
+
* Pass back as cursor to fetch the following page. Absent on the last page.
|
|
27
|
+
* @type {string}
|
|
28
|
+
* @memberof DirectoryPage
|
|
29
|
+
*/
|
|
30
|
+
nextCursor?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Check if a given object implements the DirectoryPage interface.
|
|
34
|
+
*/
|
|
35
|
+
export declare function instanceOfDirectoryPage(value: object): value is DirectoryPage;
|
|
36
|
+
export declare function DirectoryPageFromJSON(json: any): DirectoryPage;
|
|
37
|
+
export declare function DirectoryPageFromJSONTyped(json: any, ignoreDiscriminator: boolean): DirectoryPage;
|
|
38
|
+
export declare function DirectoryPageToJSON(json: any): DirectoryPage;
|
|
39
|
+
export declare function DirectoryPageToJSONTyped(value?: DirectoryPage | null, ignoreDiscriminator?: boolean): any;
|