@spaciv/sdk 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/.openapi-generator/FILES +26 -0
  2. package/README.md +2 -2
  3. package/dist/apis/AccountsApi.d.ts +24 -24
  4. package/dist/apis/AccountsApi.js +12 -12
  5. package/dist/apis/AssistantApi.d.ts +28 -1
  6. package/dist/apis/AssistantApi.js +39 -0
  7. package/dist/apis/AuditLogApi.d.ts +1 -1
  8. package/dist/apis/AuthenticationApi.d.ts +8 -8
  9. package/dist/apis/AuthenticationApi.js +4 -4
  10. package/dist/apis/ScriptsApi.d.ts +383 -0
  11. package/dist/apis/ScriptsApi.js +559 -0
  12. package/dist/apis/UsersApi.d.ts +4 -4
  13. package/dist/apis/UsersApi.js +2 -2
  14. package/dist/apis/index.d.ts +1 -0
  15. package/dist/apis/index.js +1 -0
  16. package/dist/esm/apis/AccountsApi.d.ts +24 -24
  17. package/dist/esm/apis/AccountsApi.js +12 -12
  18. package/dist/esm/apis/AssistantApi.d.ts +28 -1
  19. package/dist/esm/apis/AssistantApi.js +40 -1
  20. package/dist/esm/apis/AuditLogApi.d.ts +1 -1
  21. package/dist/esm/apis/AuthenticationApi.d.ts +8 -8
  22. package/dist/esm/apis/AuthenticationApi.js +4 -4
  23. package/dist/esm/apis/ScriptsApi.d.ts +383 -0
  24. package/dist/esm/apis/ScriptsApi.js +555 -0
  25. package/dist/esm/apis/UsersApi.d.ts +4 -4
  26. package/dist/esm/apis/UsersApi.js +2 -2
  27. package/dist/esm/apis/index.d.ts +1 -0
  28. package/dist/esm/apis/index.js +1 -0
  29. package/dist/esm/models/APIKey.d.ts +6 -0
  30. package/dist/esm/models/APIKey.js +2 -0
  31. package/dist/esm/models/AssistantTranscriptBody.d.ts +45 -0
  32. package/dist/esm/models/AssistantTranscriptBody.js +52 -0
  33. package/dist/esm/models/AssistantTranscriptMessage.d.ts +98 -0
  34. package/dist/esm/models/AssistantTranscriptMessage.js +90 -0
  35. package/dist/esm/models/AssistantTranscriptToolCall.d.ts +44 -0
  36. package/dist/esm/models/AssistantTranscriptToolCall.js +51 -0
  37. package/dist/esm/models/ScriptAuditEntry.d.ts +67 -0
  38. package/dist/esm/models/ScriptAuditEntry.js +63 -0
  39. package/dist/esm/models/ScriptAuditResBody.d.ts +39 -0
  40. package/dist/esm/models/ScriptAuditResBody.js +46 -0
  41. package/dist/esm/models/ScriptDetail.d.ts +161 -0
  42. package/dist/esm/models/ScriptDetail.js +122 -0
  43. package/dist/esm/models/ScriptExport.d.ts +174 -0
  44. package/dist/esm/models/ScriptExport.js +129 -0
  45. package/dist/esm/models/ScriptExportResBody.d.ts +39 -0
  46. package/dist/esm/models/ScriptExportResBody.js +48 -0
  47. package/dist/esm/models/ScriptExportRun.d.ts +92 -0
  48. package/dist/esm/models/ScriptExportRun.js +73 -0
  49. package/dist/esm/models/ScriptKey.d.ts +64 -0
  50. package/dist/esm/models/ScriptKey.js +58 -0
  51. package/dist/esm/models/ScriptListResBody.d.ts +33 -0
  52. package/dist/esm/models/ScriptListResBody.js +44 -0
  53. package/dist/esm/models/ScriptLogLine.d.ts +38 -0
  54. package/dist/esm/models/ScriptLogLine.js +47 -0
  55. package/dist/esm/models/ScriptPatchReqBody.d.ts +98 -0
  56. package/dist/esm/models/ScriptPatchReqBody.js +70 -0
  57. package/dist/esm/models/ScriptPostReqBody.d.ts +113 -0
  58. package/dist/esm/models/ScriptPostReqBody.js +82 -0
  59. package/dist/esm/models/ScriptRun.d.ts +86 -0
  60. package/dist/esm/models/ScriptRun.js +69 -0
  61. package/dist/esm/models/ScriptRunLogsResBody.d.ts +39 -0
  62. package/dist/esm/models/ScriptRunLogsResBody.js +48 -0
  63. package/dist/esm/models/ScriptRunsResBody.d.ts +39 -0
  64. package/dist/esm/models/ScriptRunsResBody.js +46 -0
  65. package/dist/esm/models/ScriptRuntime.d.ts +62 -0
  66. package/dist/esm/models/ScriptRuntime.js +51 -0
  67. package/dist/esm/models/ScriptSchedule.d.ts +38 -0
  68. package/dist/esm/models/ScriptSchedule.js +43 -0
  69. package/dist/esm/models/ScriptSchedulePreviewReqBody.d.ts +44 -0
  70. package/dist/esm/models/ScriptSchedulePreviewReqBody.js +45 -0
  71. package/dist/esm/models/ScriptSchedulePreviewResBody.d.ts +44 -0
  72. package/dist/esm/models/ScriptSchedulePreviewResBody.js +49 -0
  73. package/dist/esm/models/ScriptSecretsReqBody.d.ts +40 -0
  74. package/dist/esm/models/ScriptSecretsReqBody.js +43 -0
  75. package/dist/esm/models/ScriptSecretsResBody.d.ts +134 -0
  76. package/dist/esm/models/ScriptSecretsResBody.js +111 -0
  77. package/dist/esm/models/ScriptSummary.d.ts +128 -0
  78. package/dist/esm/models/ScriptSummary.js +107 -0
  79. package/dist/esm/models/ScriptWebhookResBody.d.ts +32 -0
  80. package/dist/esm/models/ScriptWebhookResBody.js +43 -0
  81. package/dist/esm/models/index.d.ts +25 -0
  82. package/dist/esm/models/index.js +25 -0
  83. package/dist/models/APIKey.d.ts +6 -0
  84. package/dist/models/APIKey.js +2 -0
  85. package/dist/models/AssistantTranscriptBody.d.ts +45 -0
  86. package/dist/models/AssistantTranscriptBody.js +59 -0
  87. package/dist/models/AssistantTranscriptMessage.d.ts +98 -0
  88. package/dist/models/AssistantTranscriptMessage.js +98 -0
  89. package/dist/models/AssistantTranscriptToolCall.d.ts +44 -0
  90. package/dist/models/AssistantTranscriptToolCall.js +58 -0
  91. package/dist/models/ScriptAuditEntry.d.ts +67 -0
  92. package/dist/models/ScriptAuditEntry.js +71 -0
  93. package/dist/models/ScriptAuditResBody.d.ts +39 -0
  94. package/dist/models/ScriptAuditResBody.js +53 -0
  95. package/dist/models/ScriptDetail.d.ts +161 -0
  96. package/dist/models/ScriptDetail.js +130 -0
  97. package/dist/models/ScriptExport.d.ts +174 -0
  98. package/dist/models/ScriptExport.js +137 -0
  99. package/dist/models/ScriptExportResBody.d.ts +39 -0
  100. package/dist/models/ScriptExportResBody.js +55 -0
  101. package/dist/models/ScriptExportRun.d.ts +92 -0
  102. package/dist/models/ScriptExportRun.js +80 -0
  103. package/dist/models/ScriptKey.d.ts +64 -0
  104. package/dist/models/ScriptKey.js +66 -0
  105. package/dist/models/ScriptListResBody.d.ts +33 -0
  106. package/dist/models/ScriptListResBody.js +51 -0
  107. package/dist/models/ScriptLogLine.d.ts +38 -0
  108. package/dist/models/ScriptLogLine.js +54 -0
  109. package/dist/models/ScriptPatchReqBody.d.ts +98 -0
  110. package/dist/models/ScriptPatchReqBody.js +78 -0
  111. package/dist/models/ScriptPostReqBody.d.ts +113 -0
  112. package/dist/models/ScriptPostReqBody.js +90 -0
  113. package/dist/models/ScriptRun.d.ts +86 -0
  114. package/dist/models/ScriptRun.js +76 -0
  115. package/dist/models/ScriptRunLogsResBody.d.ts +39 -0
  116. package/dist/models/ScriptRunLogsResBody.js +55 -0
  117. package/dist/models/ScriptRunsResBody.d.ts +39 -0
  118. package/dist/models/ScriptRunsResBody.js +53 -0
  119. package/dist/models/ScriptRuntime.d.ts +62 -0
  120. package/dist/models/ScriptRuntime.js +58 -0
  121. package/dist/models/ScriptSchedule.d.ts +38 -0
  122. package/dist/models/ScriptSchedule.js +50 -0
  123. package/dist/models/ScriptSchedulePreviewReqBody.d.ts +44 -0
  124. package/dist/models/ScriptSchedulePreviewReqBody.js +52 -0
  125. package/dist/models/ScriptSchedulePreviewResBody.d.ts +44 -0
  126. package/dist/models/ScriptSchedulePreviewResBody.js +56 -0
  127. package/dist/models/ScriptSecretsReqBody.d.ts +40 -0
  128. package/dist/models/ScriptSecretsReqBody.js +50 -0
  129. package/dist/models/ScriptSecretsResBody.d.ts +134 -0
  130. package/dist/models/ScriptSecretsResBody.js +119 -0
  131. package/dist/models/ScriptSummary.d.ts +128 -0
  132. package/dist/models/ScriptSummary.js +115 -0
  133. package/dist/models/ScriptWebhookResBody.d.ts +32 -0
  134. package/dist/models/ScriptWebhookResBody.js +50 -0
  135. package/dist/models/index.d.ts +25 -0
  136. package/dist/models/index.js +25 -0
  137. package/package.json +1 -1
  138. package/src/apis/AccountsApi.ts +24 -24
  139. package/src/apis/AssistantApi.ts +70 -0
  140. package/src/apis/AuditLogApi.ts +1 -1
  141. package/src/apis/AuthenticationApi.ts +8 -8
  142. package/src/apis/ScriptsApi.ts +984 -0
  143. package/src/apis/UsersApi.ts +4 -4
  144. package/src/apis/index.ts +1 -0
  145. package/src/models/APIKey.ts +8 -0
  146. package/src/models/AssistantTranscriptBody.ts +92 -0
  147. package/src/models/AssistantTranscriptMessage.ts +175 -0
  148. package/src/models/AssistantTranscriptToolCall.ts +84 -0
  149. package/src/models/ScriptAuditEntry.ts +112 -0
  150. package/src/models/ScriptAuditResBody.ts +82 -0
  151. package/src/models/ScriptDetail.ts +265 -0
  152. package/src/models/ScriptExport.ts +289 -0
  153. package/src/models/ScriptExportResBody.ts +83 -0
  154. package/src/models/ScriptExportRun.ts +151 -0
  155. package/src/models/ScriptKey.ts +109 -0
  156. package/src/models/ScriptListResBody.ts +74 -0
  157. package/src/models/ScriptLogLine.ts +75 -0
  158. package/src/models/ScriptPatchReqBody.ts +158 -0
  159. package/src/models/ScriptPostReqBody.ts +176 -0
  160. package/src/models/ScriptRun.ts +142 -0
  161. package/src/models/ScriptRunLogsResBody.ts +83 -0
  162. package/src/models/ScriptRunsResBody.ts +82 -0
  163. package/src/models/ScriptRuntime.ts +105 -0
  164. package/src/models/ScriptSchedule.ts +73 -0
  165. package/src/models/ScriptSchedulePreviewReqBody.ts +81 -0
  166. package/src/models/ScriptSchedulePreviewResBody.ts +83 -0
  167. package/src/models/ScriptSecretsReqBody.ts +73 -0
  168. package/src/models/ScriptSecretsResBody.ts +225 -0
  169. package/src/models/ScriptSummary.ts +216 -0
  170. package/src/models/ScriptWebhookResBody.ts +66 -0
  171. package/src/models/index.ts +25 -0
@@ -0,0 +1,176 @@
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 { ScriptSchedule } from './ScriptSchedule';
17
+ import {
18
+ ScriptScheduleFromJSON,
19
+ ScriptScheduleFromJSONTyped,
20
+ ScriptScheduleToJSON,
21
+ ScriptScheduleToJSONTyped,
22
+ } from './ScriptSchedule';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface ScriptPostReqBody
28
+ */
29
+ export interface ScriptPostReqBody {
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof ScriptPostReqBody
34
+ */
35
+ description?: string;
36
+ /**
37
+ * Whether schedules and webhooks start runs.
38
+ * @type {boolean}
39
+ * @memberof ScriptPostReqBody
40
+ */
41
+ enabled?: boolean;
42
+ /**
43
+ * Source files keyed by path. Python needs script.py defining handle(event, ctx), JavaScript needs script.js exporting handle(event, ctx), and Go needs script.go in a non-main package exporting Handle(ctx context.Context, event handler.Event, hc handler.Context) (any, error) from spaciv/handler.
44
+ * @type {{ [key: string]: string; }}
45
+ * @memberof ScriptPostReqBody
46
+ */
47
+ files: { [key: string]: string; };
48
+ /**
49
+ *
50
+ * @type {string}
51
+ * @memberof ScriptPostReqBody
52
+ */
53
+ language: ScriptPostReqBodyLanguageEnum;
54
+ /**
55
+ * Dependency manifest: requirements.txt for Python, go.mod for Go, package.json for JavaScript.
56
+ * @type {string}
57
+ * @memberof ScriptPostReqBody
58
+ */
59
+ manifest?: string;
60
+ /**
61
+ *
62
+ * @type {string}
63
+ * @memberof ScriptPostReqBody
64
+ */
65
+ name: string;
66
+ /**
67
+ * Optional project to scope the script's API key to, for example to update its dashboards. Omit for account-wide access.
68
+ * @type {number}
69
+ * @memberof ScriptPostReqBody
70
+ */
71
+ project?: number;
72
+ /**
73
+ *
74
+ * @type {ScriptSchedule}
75
+ * @memberof ScriptPostReqBody
76
+ */
77
+ schedule?: ScriptSchedule;
78
+ /**
79
+ * Secrets exposed to the script as environment variables. Names must be upper case and must not start with SPACIV_.
80
+ * @type {{ [key: string]: string; }}
81
+ * @memberof ScriptPostReqBody
82
+ */
83
+ secrets?: { [key: string]: string; };
84
+ /**
85
+ * The handler signature the script implements; defaults to integration and cannot be changed. An integration handles each run as handle(event, ctx), where event has the trigger and, for webhook runs, the request, and ctx has the account, project, API key and secrets.
86
+ * @type {string}
87
+ * @memberof ScriptPostReqBody
88
+ */
89
+ type?: ScriptPostReqBodyTypeEnum;
90
+ /**
91
+ * Whether the script can be triggered by an HTTP POST to its webhook URL.
92
+ * @type {boolean}
93
+ * @memberof ScriptPostReqBody
94
+ */
95
+ webhook?: boolean;
96
+ }
97
+
98
+
99
+ /**
100
+ * @export
101
+ */
102
+ export const ScriptPostReqBodyLanguageEnum = {
103
+ Python: 'python',
104
+ Go: 'go',
105
+ Javascript: 'javascript'
106
+ } as const;
107
+ export type ScriptPostReqBodyLanguageEnum = typeof ScriptPostReqBodyLanguageEnum[keyof typeof ScriptPostReqBodyLanguageEnum];
108
+
109
+ /**
110
+ * @export
111
+ */
112
+ export const ScriptPostReqBodyTypeEnum = {
113
+ Integration: 'integration'
114
+ } as const;
115
+ export type ScriptPostReqBodyTypeEnum = typeof ScriptPostReqBodyTypeEnum[keyof typeof ScriptPostReqBodyTypeEnum];
116
+
117
+
118
+ /**
119
+ * Check if a given object implements the ScriptPostReqBody interface.
120
+ */
121
+ export function instanceOfScriptPostReqBody(value: object): value is ScriptPostReqBody {
122
+ if (!('files' in value) || value['files'] === undefined) return false;
123
+ if (!('language' in value) || value['language'] === undefined) return false;
124
+ if (!('name' in value) || value['name'] === undefined) return false;
125
+ return true;
126
+ }
127
+
128
+ export function ScriptPostReqBodyFromJSON(json: any): ScriptPostReqBody {
129
+ return ScriptPostReqBodyFromJSONTyped(json, false);
130
+ }
131
+
132
+ export function ScriptPostReqBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScriptPostReqBody {
133
+ if (json == null) {
134
+ return json;
135
+ }
136
+ return {
137
+
138
+ 'description': json['description'] == null ? undefined : json['description'],
139
+ 'enabled': json['enabled'] == null ? undefined : json['enabled'],
140
+ 'files': json['files'],
141
+ 'language': json['language'],
142
+ 'manifest': json['manifest'] == null ? undefined : json['manifest'],
143
+ 'name': json['name'],
144
+ 'project': json['project'] == null ? undefined : json['project'],
145
+ 'schedule': json['schedule'] == null ? undefined : ScriptScheduleFromJSON(json['schedule']),
146
+ 'secrets': json['secrets'] == null ? undefined : json['secrets'],
147
+ 'type': json['type'] == null ? undefined : json['type'],
148
+ 'webhook': json['webhook'] == null ? undefined : json['webhook'],
149
+ };
150
+ }
151
+
152
+ export function ScriptPostReqBodyToJSON(json: any): ScriptPostReqBody {
153
+ return ScriptPostReqBodyToJSONTyped(json, false);
154
+ }
155
+
156
+ export function ScriptPostReqBodyToJSONTyped(value?: ScriptPostReqBody | null, ignoreDiscriminator: boolean = false): any {
157
+ if (value == null) {
158
+ return value;
159
+ }
160
+
161
+ return {
162
+
163
+ 'description': value['description'],
164
+ 'enabled': value['enabled'],
165
+ 'files': value['files'],
166
+ 'language': value['language'],
167
+ 'manifest': value['manifest'],
168
+ 'name': value['name'],
169
+ 'project': value['project'],
170
+ 'schedule': ScriptScheduleToJSON(value['schedule']),
171
+ 'secrets': value['secrets'],
172
+ 'type': value['type'],
173
+ 'webhook': value['webhook'],
174
+ };
175
+ }
176
+
@@ -0,0 +1,142 @@
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 ScriptRun
20
+ */
21
+ export interface ScriptRun {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof ScriptRun
26
+ */
27
+ durationMs?: number;
28
+ /**
29
+ *
30
+ * @type {Date}
31
+ * @memberof ScriptRun
32
+ */
33
+ endedAt?: Date;
34
+ /**
35
+ *
36
+ * @type {number}
37
+ * @memberof ScriptRun
38
+ */
39
+ exitCode: number;
40
+ /**
41
+ *
42
+ * @type {string}
43
+ * @memberof ScriptRun
44
+ */
45
+ id: string;
46
+ /**
47
+ * "build" for a dependency build, "run" for an execution.
48
+ * @type {string}
49
+ * @memberof ScriptRun
50
+ */
51
+ kind: string;
52
+ /**
53
+ *
54
+ * @type {string}
55
+ * @memberof ScriptRun
56
+ */
57
+ message?: string;
58
+ /**
59
+ *
60
+ * @type {Date}
61
+ * @memberof ScriptRun
62
+ */
63
+ queuedAt?: Date;
64
+ /**
65
+ *
66
+ * @type {Date}
67
+ * @memberof ScriptRun
68
+ */
69
+ startedAt?: Date;
70
+ /**
71
+ *
72
+ * @type {string}
73
+ * @memberof ScriptRun
74
+ */
75
+ status: string;
76
+ /**
77
+ *
78
+ * @type {string}
79
+ * @memberof ScriptRun
80
+ */
81
+ trigger: string;
82
+ }
83
+
84
+ /**
85
+ * Check if a given object implements the ScriptRun interface.
86
+ */
87
+ export function instanceOfScriptRun(value: object): value is ScriptRun {
88
+ if (!('exitCode' in value) || value['exitCode'] === undefined) return false;
89
+ if (!('id' in value) || value['id'] === undefined) return false;
90
+ if (!('kind' in value) || value['kind'] === undefined) return false;
91
+ if (!('status' in value) || value['status'] === undefined) return false;
92
+ if (!('trigger' in value) || value['trigger'] === undefined) return false;
93
+ return true;
94
+ }
95
+
96
+ export function ScriptRunFromJSON(json: any): ScriptRun {
97
+ return ScriptRunFromJSONTyped(json, false);
98
+ }
99
+
100
+ export function ScriptRunFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScriptRun {
101
+ if (json == null) {
102
+ return json;
103
+ }
104
+ return {
105
+
106
+ 'durationMs': json['durationMs'] == null ? undefined : json['durationMs'],
107
+ 'endedAt': json['endedAt'] == null ? undefined : (new Date(json['endedAt'])),
108
+ 'exitCode': json['exitCode'],
109
+ 'id': json['id'],
110
+ 'kind': json['kind'],
111
+ 'message': json['message'] == null ? undefined : json['message'],
112
+ 'queuedAt': json['queuedAt'] == null ? undefined : (new Date(json['queuedAt'])),
113
+ 'startedAt': json['startedAt'] == null ? undefined : (new Date(json['startedAt'])),
114
+ 'status': json['status'],
115
+ 'trigger': json['trigger'],
116
+ };
117
+ }
118
+
119
+ export function ScriptRunToJSON(json: any): ScriptRun {
120
+ return ScriptRunToJSONTyped(json, false);
121
+ }
122
+
123
+ export function ScriptRunToJSONTyped(value?: ScriptRun | null, ignoreDiscriminator: boolean = false): any {
124
+ if (value == null) {
125
+ return value;
126
+ }
127
+
128
+ return {
129
+
130
+ 'durationMs': value['durationMs'],
131
+ 'endedAt': value['endedAt'] == null ? undefined : ((value['endedAt']).toISOString()),
132
+ 'exitCode': value['exitCode'],
133
+ 'id': value['id'],
134
+ 'kind': value['kind'],
135
+ 'message': value['message'],
136
+ 'queuedAt': value['queuedAt'] == null ? undefined : ((value['queuedAt']).toISOString()),
137
+ 'startedAt': value['startedAt'] == null ? undefined : ((value['startedAt']).toISOString()),
138
+ 'status': value['status'],
139
+ 'trigger': value['trigger'],
140
+ };
141
+ }
142
+
@@ -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
+ import type { ScriptLogLine } from './ScriptLogLine';
17
+ import {
18
+ ScriptLogLineFromJSON,
19
+ ScriptLogLineFromJSONTyped,
20
+ ScriptLogLineToJSON,
21
+ ScriptLogLineToJSONTyped,
22
+ } from './ScriptLogLine';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface ScriptRunLogsResBody
28
+ */
29
+ export interface ScriptRunLogsResBody {
30
+ /**
31
+ *
32
+ * @type {Array<ScriptLogLine>}
33
+ * @memberof ScriptRunLogsResBody
34
+ */
35
+ lines: Array<ScriptLogLine>;
36
+ /**
37
+ * Set when the run wrote more output than is kept, so some of it is missing.
38
+ * @type {boolean}
39
+ * @memberof ScriptRunLogsResBody
40
+ */
41
+ truncated: boolean;
42
+ }
43
+
44
+ /**
45
+ * Check if a given object implements the ScriptRunLogsResBody interface.
46
+ */
47
+ export function instanceOfScriptRunLogsResBody(value: object): value is ScriptRunLogsResBody {
48
+ if (!('lines' in value) || value['lines'] === undefined) return false;
49
+ if (!('truncated' in value) || value['truncated'] === undefined) return false;
50
+ return true;
51
+ }
52
+
53
+ export function ScriptRunLogsResBodyFromJSON(json: any): ScriptRunLogsResBody {
54
+ return ScriptRunLogsResBodyFromJSONTyped(json, false);
55
+ }
56
+
57
+ export function ScriptRunLogsResBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScriptRunLogsResBody {
58
+ if (json == null) {
59
+ return json;
60
+ }
61
+ return {
62
+
63
+ 'lines': ((json['lines'] as Array<any>).map(ScriptLogLineFromJSON)),
64
+ 'truncated': json['truncated'],
65
+ };
66
+ }
67
+
68
+ export function ScriptRunLogsResBodyToJSON(json: any): ScriptRunLogsResBody {
69
+ return ScriptRunLogsResBodyToJSONTyped(json, false);
70
+ }
71
+
72
+ export function ScriptRunLogsResBodyToJSONTyped(value?: ScriptRunLogsResBody | null, ignoreDiscriminator: boolean = false): any {
73
+ if (value == null) {
74
+ return value;
75
+ }
76
+
77
+ return {
78
+
79
+ 'lines': ((value['lines'] as Array<any>).map(ScriptLogLineToJSON)),
80
+ 'truncated': value['truncated'],
81
+ };
82
+ }
83
+
@@ -0,0 +1,82 @@
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 { ScriptRun } from './ScriptRun';
17
+ import {
18
+ ScriptRunFromJSON,
19
+ ScriptRunFromJSONTyped,
20
+ ScriptRunToJSON,
21
+ ScriptRunToJSONTyped,
22
+ } from './ScriptRun';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface ScriptRunsResBody
28
+ */
29
+ export interface ScriptRunsResBody {
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof ScriptRunsResBody
34
+ */
35
+ nextCursor?: string;
36
+ /**
37
+ *
38
+ * @type {Array<ScriptRun>}
39
+ * @memberof ScriptRunsResBody
40
+ */
41
+ runs: Array<ScriptRun>;
42
+ }
43
+
44
+ /**
45
+ * Check if a given object implements the ScriptRunsResBody interface.
46
+ */
47
+ export function instanceOfScriptRunsResBody(value: object): value is ScriptRunsResBody {
48
+ if (!('runs' in value) || value['runs'] === undefined) return false;
49
+ return true;
50
+ }
51
+
52
+ export function ScriptRunsResBodyFromJSON(json: any): ScriptRunsResBody {
53
+ return ScriptRunsResBodyFromJSONTyped(json, false);
54
+ }
55
+
56
+ export function ScriptRunsResBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScriptRunsResBody {
57
+ if (json == null) {
58
+ return json;
59
+ }
60
+ return {
61
+
62
+ 'nextCursor': json['nextCursor'] == null ? undefined : json['nextCursor'],
63
+ 'runs': ((json['runs'] as Array<any>).map(ScriptRunFromJSON)),
64
+ };
65
+ }
66
+
67
+ export function ScriptRunsResBodyToJSON(json: any): ScriptRunsResBody {
68
+ return ScriptRunsResBodyToJSONTyped(json, false);
69
+ }
70
+
71
+ export function ScriptRunsResBodyToJSONTyped(value?: ScriptRunsResBody | null, ignoreDiscriminator: boolean = false): any {
72
+ if (value == null) {
73
+ return value;
74
+ }
75
+
76
+ return {
77
+
78
+ 'nextCursor': value['nextCursor'],
79
+ 'runs': ((value['runs'] as Array<any>).map(ScriptRunToJSON)),
80
+ };
81
+ }
82
+
@@ -0,0 +1,105 @@
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 ScriptRuntime
20
+ */
21
+ export interface ScriptRuntime {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ScriptRuntime
26
+ */
27
+ buildRunId?: string;
28
+ /**
29
+ * State of the latest dependency build.
30
+ * @type {string}
31
+ * @memberof ScriptRuntime
32
+ */
33
+ buildState?: string;
34
+ /**
35
+ * vCPU units per run (1024 = 1 vCPU).
36
+ * @type {number}
37
+ * @memberof ScriptRuntime
38
+ */
39
+ cpu?: number;
40
+ /**
41
+ *
42
+ * @type {number}
43
+ * @memberof ScriptRuntime
44
+ */
45
+ memoryMb?: number;
46
+ /**
47
+ *
48
+ * @type {Date}
49
+ * @memberof ScriptRuntime
50
+ */
51
+ nextRunAt?: Date;
52
+ /**
53
+ *
54
+ * @type {number}
55
+ * @memberof ScriptRuntime
56
+ */
57
+ timeoutSeconds?: number;
58
+ }
59
+
60
+ /**
61
+ * Check if a given object implements the ScriptRuntime interface.
62
+ */
63
+ export function instanceOfScriptRuntime(value: object): value is ScriptRuntime {
64
+ return true;
65
+ }
66
+
67
+ export function ScriptRuntimeFromJSON(json: any): ScriptRuntime {
68
+ return ScriptRuntimeFromJSONTyped(json, false);
69
+ }
70
+
71
+ export function ScriptRuntimeFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScriptRuntime {
72
+ if (json == null) {
73
+ return json;
74
+ }
75
+ return {
76
+
77
+ 'buildRunId': json['buildRunId'] == null ? undefined : json['buildRunId'],
78
+ 'buildState': json['buildState'] == null ? undefined : json['buildState'],
79
+ 'cpu': json['cpu'] == null ? undefined : json['cpu'],
80
+ 'memoryMb': json['memoryMb'] == null ? undefined : json['memoryMb'],
81
+ 'nextRunAt': json['nextRunAt'] == null ? undefined : (new Date(json['nextRunAt'])),
82
+ 'timeoutSeconds': json['timeoutSeconds'] == null ? undefined : json['timeoutSeconds'],
83
+ };
84
+ }
85
+
86
+ export function ScriptRuntimeToJSON(json: any): ScriptRuntime {
87
+ return ScriptRuntimeToJSONTyped(json, false);
88
+ }
89
+
90
+ export function ScriptRuntimeToJSONTyped(value?: ScriptRuntime | null, ignoreDiscriminator: boolean = false): any {
91
+ if (value == null) {
92
+ return value;
93
+ }
94
+
95
+ return {
96
+
97
+ 'buildRunId': value['buildRunId'],
98
+ 'buildState': value['buildState'],
99
+ 'cpu': value['cpu'],
100
+ 'memoryMb': value['memoryMb'],
101
+ 'nextRunAt': value['nextRunAt'] == null ? undefined : ((value['nextRunAt']).toISOString()),
102
+ 'timeoutSeconds': value['timeoutSeconds'],
103
+ };
104
+ }
105
+
@@ -0,0 +1,73 @@
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 ScriptSchedule
20
+ */
21
+ export interface ScriptSchedule {
22
+ /**
23
+ * Five-field cron expression (minute, hour, day of month, month, day of week). Empty means the script only runs from its webhook.
24
+ * @type {string}
25
+ * @memberof ScriptSchedule
26
+ */
27
+ cron?: string;
28
+ /**
29
+ * IANA time zone the cron expression is evaluated in. Defaults to UTC.
30
+ * @type {string}
31
+ * @memberof ScriptSchedule
32
+ */
33
+ timezone?: string;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the ScriptSchedule interface.
38
+ */
39
+ export function instanceOfScriptSchedule(value: object): value is ScriptSchedule {
40
+ return true;
41
+ }
42
+
43
+ export function ScriptScheduleFromJSON(json: any): ScriptSchedule {
44
+ return ScriptScheduleFromJSONTyped(json, false);
45
+ }
46
+
47
+ export function ScriptScheduleFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScriptSchedule {
48
+ if (json == null) {
49
+ return json;
50
+ }
51
+ return {
52
+
53
+ 'cron': json['cron'] == null ? undefined : json['cron'],
54
+ 'timezone': json['timezone'] == null ? undefined : json['timezone'],
55
+ };
56
+ }
57
+
58
+ export function ScriptScheduleToJSON(json: any): ScriptSchedule {
59
+ return ScriptScheduleToJSONTyped(json, false);
60
+ }
61
+
62
+ export function ScriptScheduleToJSONTyped(value?: ScriptSchedule | null, ignoreDiscriminator: boolean = false): any {
63
+ if (value == null) {
64
+ return value;
65
+ }
66
+
67
+ return {
68
+
69
+ 'cron': value['cron'],
70
+ 'timezone': value['timezone'],
71
+ };
72
+ }
73
+