@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
|
@@ -0,0 +1,126 @@
|
|
|
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
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { ScratchpadOutputFile } from './ScratchpadOutputFile';
|
|
17
|
+
import {
|
|
18
|
+
ScratchpadOutputFileFromJSON,
|
|
19
|
+
ScratchpadOutputFileFromJSONTyped,
|
|
20
|
+
ScratchpadOutputFileToJSON,
|
|
21
|
+
ScratchpadOutputFileToJSONTyped,
|
|
22
|
+
} from './ScratchpadOutputFile';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface ScratchpadOutput
|
|
28
|
+
*/
|
|
29
|
+
export interface ScratchpadOutput {
|
|
30
|
+
/**
|
|
31
|
+
* Why some of the output could not be collected, for example because it was over a limit.
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof ScratchpadOutput
|
|
34
|
+
*/
|
|
35
|
+
error?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Files the handler wrote to its output directory.
|
|
38
|
+
* @type {Array<ScratchpadOutputFile>}
|
|
39
|
+
* @memberof ScratchpadOutput
|
|
40
|
+
*/
|
|
41
|
+
files: Array<ScratchpadOutputFile>;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @type {any}
|
|
45
|
+
* @memberof ScratchpadOutput
|
|
46
|
+
*/
|
|
47
|
+
result?: any | null;
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @type {string}
|
|
51
|
+
* @memberof ScratchpadOutput
|
|
52
|
+
*/
|
|
53
|
+
stderr: string;
|
|
54
|
+
/**
|
|
55
|
+
* Set when stderr was longer than the 256 KiB kept.
|
|
56
|
+
* @type {boolean}
|
|
57
|
+
* @memberof ScratchpadOutput
|
|
58
|
+
*/
|
|
59
|
+
stderrTruncated: boolean;
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* @type {string}
|
|
63
|
+
* @memberof ScratchpadOutput
|
|
64
|
+
*/
|
|
65
|
+
stdout: string;
|
|
66
|
+
/**
|
|
67
|
+
* Set when stdout was longer than the 256 KiB kept.
|
|
68
|
+
* @type {boolean}
|
|
69
|
+
* @memberof ScratchpadOutput
|
|
70
|
+
*/
|
|
71
|
+
stdoutTruncated: boolean;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Check if a given object implements the ScratchpadOutput interface.
|
|
76
|
+
*/
|
|
77
|
+
export function instanceOfScratchpadOutput(value: object): value is ScratchpadOutput {
|
|
78
|
+
if (!('files' in value) || value['files'] === undefined) return false;
|
|
79
|
+
if (!('stderr' in value) || value['stderr'] === undefined) return false;
|
|
80
|
+
if (!('stderrTruncated' in value) || value['stderrTruncated'] === undefined) return false;
|
|
81
|
+
if (!('stdout' in value) || value['stdout'] === undefined) return false;
|
|
82
|
+
if (!('stdoutTruncated' in value) || value['stdoutTruncated'] === undefined) return false;
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function ScratchpadOutputFromJSON(json: any): ScratchpadOutput {
|
|
87
|
+
return ScratchpadOutputFromJSONTyped(json, false);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function ScratchpadOutputFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScratchpadOutput {
|
|
91
|
+
if (json == null) {
|
|
92
|
+
return json;
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
|
|
96
|
+
'error': json['error'] == null ? undefined : json['error'],
|
|
97
|
+
'files': ((json['files'] as Array<any>).map(ScratchpadOutputFileFromJSON)),
|
|
98
|
+
'result': json['result'] == null ? undefined : json['result'],
|
|
99
|
+
'stderr': json['stderr'],
|
|
100
|
+
'stderrTruncated': json['stderrTruncated'],
|
|
101
|
+
'stdout': json['stdout'],
|
|
102
|
+
'stdoutTruncated': json['stdoutTruncated'],
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function ScratchpadOutputToJSON(json: any): ScratchpadOutput {
|
|
107
|
+
return ScratchpadOutputToJSONTyped(json, false);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function ScratchpadOutputToJSONTyped(value?: ScratchpadOutput | null, ignoreDiscriminator: boolean = false): any {
|
|
111
|
+
if (value == null) {
|
|
112
|
+
return value;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return {
|
|
116
|
+
|
|
117
|
+
'error': value['error'],
|
|
118
|
+
'files': ((value['files'] as Array<any>).map(ScratchpadOutputFileToJSON)),
|
|
119
|
+
'result': value['result'],
|
|
120
|
+
'stderr': value['stderr'],
|
|
121
|
+
'stderrTruncated': value['stderrTruncated'],
|
|
122
|
+
'stdout': value['stdout'],
|
|
123
|
+
'stdoutTruncated': value['stdoutTruncated'],
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface ScratchpadOutputFile
|
|
20
|
+
*/
|
|
21
|
+
export interface ScratchpadOutputFile {
|
|
22
|
+
/**
|
|
23
|
+
* The file's content, base64-encoded.
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof ScratchpadOutputFile
|
|
26
|
+
*/
|
|
27
|
+
content: string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof ScratchpadOutputFile
|
|
32
|
+
*/
|
|
33
|
+
contentType?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Path relative to the output directory.
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof ScratchpadOutputFile
|
|
38
|
+
*/
|
|
39
|
+
path: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Check if a given object implements the ScratchpadOutputFile interface.
|
|
44
|
+
*/
|
|
45
|
+
export function instanceOfScratchpadOutputFile(value: object): value is ScratchpadOutputFile {
|
|
46
|
+
if (!('content' in value) || value['content'] === undefined) return false;
|
|
47
|
+
if (!('path' in value) || value['path'] === undefined) return false;
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function ScratchpadOutputFileFromJSON(json: any): ScratchpadOutputFile {
|
|
52
|
+
return ScratchpadOutputFileFromJSONTyped(json, false);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function ScratchpadOutputFileFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScratchpadOutputFile {
|
|
56
|
+
if (json == null) {
|
|
57
|
+
return json;
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
|
|
61
|
+
'content': json['content'],
|
|
62
|
+
'contentType': json['contentType'] == null ? undefined : json['contentType'],
|
|
63
|
+
'path': json['path'],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function ScratchpadOutputFileToJSON(json: any): ScratchpadOutputFile {
|
|
68
|
+
return ScratchpadOutputFileToJSONTyped(json, false);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function ScratchpadOutputFileToJSONTyped(value?: ScratchpadOutputFile | null, ignoreDiscriminator: boolean = false): any {
|
|
72
|
+
if (value == null) {
|
|
73
|
+
return value;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return {
|
|
77
|
+
|
|
78
|
+
'content': value['content'],
|
|
79
|
+
'contentType': value['contentType'],
|
|
80
|
+
'path': value['path'],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
@@ -0,0 +1,203 @@
|
|
|
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
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { ScratchpadOutput } from './ScratchpadOutput';
|
|
17
|
+
import {
|
|
18
|
+
ScratchpadOutputFromJSON,
|
|
19
|
+
ScratchpadOutputFromJSONTyped,
|
|
20
|
+
ScratchpadOutputToJSON,
|
|
21
|
+
ScratchpadOutputToJSONTyped,
|
|
22
|
+
} from './ScratchpadOutput';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface ScratchpadRun
|
|
28
|
+
*/
|
|
29
|
+
export interface ScratchpadRun {
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {number}
|
|
33
|
+
* @memberof ScratchpadRun
|
|
34
|
+
*/
|
|
35
|
+
durationMs?: number;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {Date}
|
|
39
|
+
* @memberof ScratchpadRun
|
|
40
|
+
*/
|
|
41
|
+
endedAt?: Date;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @type {number}
|
|
45
|
+
* @memberof ScratchpadRun
|
|
46
|
+
*/
|
|
47
|
+
exitCode: number;
|
|
48
|
+
/**
|
|
49
|
+
* When the run and its output are deleted.
|
|
50
|
+
* @type {Date}
|
|
51
|
+
* @memberof ScratchpadRun
|
|
52
|
+
*/
|
|
53
|
+
expiresAt?: Date;
|
|
54
|
+
/**
|
|
55
|
+
* The code that was run, keyed by path.
|
|
56
|
+
* @type {{ [key: string]: string; }}
|
|
57
|
+
* @memberof ScratchpadRun
|
|
58
|
+
*/
|
|
59
|
+
files: { [key: string]: string; };
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* @type {string}
|
|
63
|
+
* @memberof ScratchpadRun
|
|
64
|
+
*/
|
|
65
|
+
id: string;
|
|
66
|
+
/**
|
|
67
|
+
*
|
|
68
|
+
* @type {string}
|
|
69
|
+
* @memberof ScratchpadRun
|
|
70
|
+
*/
|
|
71
|
+
language: ScratchpadRunLanguageEnum;
|
|
72
|
+
/**
|
|
73
|
+
*
|
|
74
|
+
* @type {string}
|
|
75
|
+
* @memberof ScratchpadRun
|
|
76
|
+
*/
|
|
77
|
+
message?: string;
|
|
78
|
+
/**
|
|
79
|
+
* What the run produced. Absent while it is in progress.
|
|
80
|
+
* @type {ScratchpadOutput}
|
|
81
|
+
* @memberof ScratchpadRun
|
|
82
|
+
*/
|
|
83
|
+
output?: ScratchpadOutput;
|
|
84
|
+
/**
|
|
85
|
+
*
|
|
86
|
+
* @type {Date}
|
|
87
|
+
* @memberof ScratchpadRun
|
|
88
|
+
*/
|
|
89
|
+
queuedAt?: Date;
|
|
90
|
+
/**
|
|
91
|
+
*
|
|
92
|
+
* @type {Date}
|
|
93
|
+
* @memberof ScratchpadRun
|
|
94
|
+
*/
|
|
95
|
+
startedAt?: Date;
|
|
96
|
+
/**
|
|
97
|
+
* How long the sandbox took to start.
|
|
98
|
+
* @type {number}
|
|
99
|
+
* @memberof ScratchpadRun
|
|
100
|
+
*/
|
|
101
|
+
startupMs?: number;
|
|
102
|
+
/**
|
|
103
|
+
* queued or running while the run is in progress, then success, error, timeout, killed or quota_exceeded.
|
|
104
|
+
* @type {string}
|
|
105
|
+
* @memberof ScratchpadRun
|
|
106
|
+
*/
|
|
107
|
+
status: string;
|
|
108
|
+
/**
|
|
109
|
+
*
|
|
110
|
+
* @type {number}
|
|
111
|
+
* @memberof ScratchpadRun
|
|
112
|
+
*/
|
|
113
|
+
timeoutSeconds: number;
|
|
114
|
+
/**
|
|
115
|
+
* Whether the run used a sandbox that had already started.
|
|
116
|
+
* @type {boolean}
|
|
117
|
+
* @memberof ScratchpadRun
|
|
118
|
+
*/
|
|
119
|
+
warm: boolean;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* @export
|
|
125
|
+
*/
|
|
126
|
+
export const ScratchpadRunLanguageEnum = {
|
|
127
|
+
Python: 'python',
|
|
128
|
+
Javascript: 'javascript'
|
|
129
|
+
} as const;
|
|
130
|
+
export type ScratchpadRunLanguageEnum = typeof ScratchpadRunLanguageEnum[keyof typeof ScratchpadRunLanguageEnum];
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Check if a given object implements the ScratchpadRun interface.
|
|
135
|
+
*/
|
|
136
|
+
export function instanceOfScratchpadRun(value: object): value is ScratchpadRun {
|
|
137
|
+
if (!('exitCode' in value) || value['exitCode'] === undefined) return false;
|
|
138
|
+
if (!('files' in value) || value['files'] === undefined) return false;
|
|
139
|
+
if (!('id' in value) || value['id'] === undefined) return false;
|
|
140
|
+
if (!('language' in value) || value['language'] === undefined) return false;
|
|
141
|
+
if (!('status' in value) || value['status'] === undefined) return false;
|
|
142
|
+
if (!('timeoutSeconds' in value) || value['timeoutSeconds'] === undefined) return false;
|
|
143
|
+
if (!('warm' in value) || value['warm'] === undefined) return false;
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export function ScratchpadRunFromJSON(json: any): ScratchpadRun {
|
|
148
|
+
return ScratchpadRunFromJSONTyped(json, false);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export function ScratchpadRunFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScratchpadRun {
|
|
152
|
+
if (json == null) {
|
|
153
|
+
return json;
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
|
|
157
|
+
'durationMs': json['durationMs'] == null ? undefined : json['durationMs'],
|
|
158
|
+
'endedAt': json['endedAt'] == null ? undefined : (new Date(json['endedAt'])),
|
|
159
|
+
'exitCode': json['exitCode'],
|
|
160
|
+
'expiresAt': json['expiresAt'] == null ? undefined : (new Date(json['expiresAt'])),
|
|
161
|
+
'files': json['files'],
|
|
162
|
+
'id': json['id'],
|
|
163
|
+
'language': json['language'],
|
|
164
|
+
'message': json['message'] == null ? undefined : json['message'],
|
|
165
|
+
'output': json['output'] == null ? undefined : ScratchpadOutputFromJSON(json['output']),
|
|
166
|
+
'queuedAt': json['queuedAt'] == null ? undefined : (new Date(json['queuedAt'])),
|
|
167
|
+
'startedAt': json['startedAt'] == null ? undefined : (new Date(json['startedAt'])),
|
|
168
|
+
'startupMs': json['startupMs'] == null ? undefined : json['startupMs'],
|
|
169
|
+
'status': json['status'],
|
|
170
|
+
'timeoutSeconds': json['timeoutSeconds'],
|
|
171
|
+
'warm': json['warm'],
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export function ScratchpadRunToJSON(json: any): ScratchpadRun {
|
|
176
|
+
return ScratchpadRunToJSONTyped(json, false);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export function ScratchpadRunToJSONTyped(value?: ScratchpadRun | null, ignoreDiscriminator: boolean = false): any {
|
|
180
|
+
if (value == null) {
|
|
181
|
+
return value;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return {
|
|
185
|
+
|
|
186
|
+
'durationMs': value['durationMs'],
|
|
187
|
+
'endedAt': value['endedAt'] == null ? undefined : ((value['endedAt']).toISOString()),
|
|
188
|
+
'exitCode': value['exitCode'],
|
|
189
|
+
'expiresAt': value['expiresAt'] == null ? undefined : ((value['expiresAt']).toISOString()),
|
|
190
|
+
'files': value['files'],
|
|
191
|
+
'id': value['id'],
|
|
192
|
+
'language': value['language'],
|
|
193
|
+
'message': value['message'],
|
|
194
|
+
'output': ScratchpadOutputToJSON(value['output']),
|
|
195
|
+
'queuedAt': value['queuedAt'] == null ? undefined : ((value['queuedAt']).toISOString()),
|
|
196
|
+
'startedAt': value['startedAt'] == null ? undefined : ((value['startedAt']).toISOString()),
|
|
197
|
+
'startupMs': value['startupMs'],
|
|
198
|
+
'status': value['status'],
|
|
199
|
+
'timeoutSeconds': value['timeoutSeconds'],
|
|
200
|
+
'warm': value['warm'],
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
@@ -0,0 +1,99 @@
|
|
|
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
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface ScratchpadRunPostReqBody
|
|
20
|
+
*/
|
|
21
|
+
export interface ScratchpadRunPostReqBody {
|
|
22
|
+
/**
|
|
23
|
+
* Source files keyed by path. Python needs script.py defining handle(event, ctx) and JavaScript needs script.js exporting handle(event, ctx), as an integration script does, so the code can be saved as one unchanged.
|
|
24
|
+
* @type {{ [key: string]: string; }}
|
|
25
|
+
* @memberof ScratchpadRunPostReqBody
|
|
26
|
+
*/
|
|
27
|
+
files: { [key: string]: string; };
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {any}
|
|
31
|
+
* @memberof ScratchpadRunPostReqBody
|
|
32
|
+
*/
|
|
33
|
+
input?: any | null;
|
|
34
|
+
/**
|
|
35
|
+
* python or javascript. Go code has to be saved as a script, which builds it.
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof ScratchpadRunPostReqBody
|
|
38
|
+
*/
|
|
39
|
+
language: string;
|
|
40
|
+
/**
|
|
41
|
+
* Longest the code may run. Defaults to 30.
|
|
42
|
+
* @type {number}
|
|
43
|
+
* @memberof ScratchpadRunPostReqBody
|
|
44
|
+
*/
|
|
45
|
+
timeoutSeconds?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Longest to wait for the run to finish before responding. Defaults to 20.
|
|
48
|
+
* @type {number}
|
|
49
|
+
* @memberof ScratchpadRunPostReqBody
|
|
50
|
+
*/
|
|
51
|
+
waitSeconds?: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Check if a given object implements the ScratchpadRunPostReqBody interface.
|
|
56
|
+
*/
|
|
57
|
+
export function instanceOfScratchpadRunPostReqBody(value: object): value is ScratchpadRunPostReqBody {
|
|
58
|
+
if (!('files' in value) || value['files'] === undefined) return false;
|
|
59
|
+
if (!('language' in value) || value['language'] === undefined) return false;
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function ScratchpadRunPostReqBodyFromJSON(json: any): ScratchpadRunPostReqBody {
|
|
64
|
+
return ScratchpadRunPostReqBodyFromJSONTyped(json, false);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function ScratchpadRunPostReqBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScratchpadRunPostReqBody {
|
|
68
|
+
if (json == null) {
|
|
69
|
+
return json;
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
|
|
73
|
+
'files': json['files'],
|
|
74
|
+
'input': json['input'] == null ? undefined : json['input'],
|
|
75
|
+
'language': json['language'],
|
|
76
|
+
'timeoutSeconds': json['timeoutSeconds'] == null ? undefined : json['timeoutSeconds'],
|
|
77
|
+
'waitSeconds': json['waitSeconds'] == null ? undefined : json['waitSeconds'],
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function ScratchpadRunPostReqBodyToJSON(json: any): ScratchpadRunPostReqBody {
|
|
82
|
+
return ScratchpadRunPostReqBodyToJSONTyped(json, false);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function ScratchpadRunPostReqBodyToJSONTyped(value?: ScratchpadRunPostReqBody | null, ignoreDiscriminator: boolean = false): any {
|
|
86
|
+
if (value == null) {
|
|
87
|
+
return value;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
|
|
92
|
+
'files': value['files'],
|
|
93
|
+
'input': value['input'],
|
|
94
|
+
'language': value['language'],
|
|
95
|
+
'timeoutSeconds': value['timeoutSeconds'],
|
|
96
|
+
'waitSeconds': value['waitSeconds'],
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
package/src/models/index.ts
CHANGED
|
@@ -298,6 +298,10 @@ export * from './ScenarioListEntry';
|
|
|
298
298
|
export * from './ScenarioListRes';
|
|
299
299
|
export * from './ScenarioNotFoundDetail';
|
|
300
300
|
export * from './ScenarioPatch';
|
|
301
|
+
export * from './ScratchpadOutput';
|
|
302
|
+
export * from './ScratchpadOutputFile';
|
|
303
|
+
export * from './ScratchpadRun';
|
|
304
|
+
export * from './ScratchpadRunPostReqBody';
|
|
301
305
|
export * from './ScriptAuditEntry';
|
|
302
306
|
export * from './ScriptAuditResBody';
|
|
303
307
|
export * from './ScriptDetail';
|