@spaciv/sdk 0.1.1 → 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 (151) hide show
  1. package/.openapi-generator/FILES +23 -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/AuditLogApi.d.ts +1 -1
  6. package/dist/apis/AuthenticationApi.d.ts +8 -8
  7. package/dist/apis/AuthenticationApi.js +4 -4
  8. package/dist/apis/ScriptsApi.d.ts +383 -0
  9. package/dist/apis/ScriptsApi.js +559 -0
  10. package/dist/apis/UsersApi.d.ts +4 -4
  11. package/dist/apis/UsersApi.js +2 -2
  12. package/dist/apis/index.d.ts +1 -0
  13. package/dist/apis/index.js +1 -0
  14. package/dist/esm/apis/AccountsApi.d.ts +24 -24
  15. package/dist/esm/apis/AccountsApi.js +12 -12
  16. package/dist/esm/apis/AuditLogApi.d.ts +1 -1
  17. package/dist/esm/apis/AuthenticationApi.d.ts +8 -8
  18. package/dist/esm/apis/AuthenticationApi.js +4 -4
  19. package/dist/esm/apis/ScriptsApi.d.ts +383 -0
  20. package/dist/esm/apis/ScriptsApi.js +555 -0
  21. package/dist/esm/apis/UsersApi.d.ts +4 -4
  22. package/dist/esm/apis/UsersApi.js +2 -2
  23. package/dist/esm/apis/index.d.ts +1 -0
  24. package/dist/esm/apis/index.js +1 -0
  25. package/dist/esm/models/APIKey.d.ts +6 -0
  26. package/dist/esm/models/APIKey.js +2 -0
  27. package/dist/esm/models/ScriptAuditEntry.d.ts +67 -0
  28. package/dist/esm/models/ScriptAuditEntry.js +63 -0
  29. package/dist/esm/models/ScriptAuditResBody.d.ts +39 -0
  30. package/dist/esm/models/ScriptAuditResBody.js +46 -0
  31. package/dist/esm/models/ScriptDetail.d.ts +161 -0
  32. package/dist/esm/models/ScriptDetail.js +122 -0
  33. package/dist/esm/models/ScriptExport.d.ts +174 -0
  34. package/dist/esm/models/ScriptExport.js +129 -0
  35. package/dist/esm/models/ScriptExportResBody.d.ts +39 -0
  36. package/dist/esm/models/ScriptExportResBody.js +48 -0
  37. package/dist/esm/models/ScriptExportRun.d.ts +92 -0
  38. package/dist/esm/models/ScriptExportRun.js +73 -0
  39. package/dist/esm/models/ScriptKey.d.ts +64 -0
  40. package/dist/esm/models/ScriptKey.js +58 -0
  41. package/dist/esm/models/ScriptListResBody.d.ts +33 -0
  42. package/dist/esm/models/ScriptListResBody.js +44 -0
  43. package/dist/esm/models/ScriptLogLine.d.ts +38 -0
  44. package/dist/esm/models/ScriptLogLine.js +47 -0
  45. package/dist/esm/models/ScriptPatchReqBody.d.ts +98 -0
  46. package/dist/esm/models/ScriptPatchReqBody.js +70 -0
  47. package/dist/esm/models/ScriptPostReqBody.d.ts +113 -0
  48. package/dist/esm/models/ScriptPostReqBody.js +82 -0
  49. package/dist/esm/models/ScriptRun.d.ts +86 -0
  50. package/dist/esm/models/ScriptRun.js +69 -0
  51. package/dist/esm/models/ScriptRunLogsResBody.d.ts +39 -0
  52. package/dist/esm/models/ScriptRunLogsResBody.js +48 -0
  53. package/dist/esm/models/ScriptRunsResBody.d.ts +39 -0
  54. package/dist/esm/models/ScriptRunsResBody.js +46 -0
  55. package/dist/esm/models/ScriptRuntime.d.ts +62 -0
  56. package/dist/esm/models/ScriptRuntime.js +51 -0
  57. package/dist/esm/models/ScriptSchedule.d.ts +38 -0
  58. package/dist/esm/models/ScriptSchedule.js +43 -0
  59. package/dist/esm/models/ScriptSchedulePreviewReqBody.d.ts +44 -0
  60. package/dist/esm/models/ScriptSchedulePreviewReqBody.js +45 -0
  61. package/dist/esm/models/ScriptSchedulePreviewResBody.d.ts +44 -0
  62. package/dist/esm/models/ScriptSchedulePreviewResBody.js +49 -0
  63. package/dist/esm/models/ScriptSecretsReqBody.d.ts +40 -0
  64. package/dist/esm/models/ScriptSecretsReqBody.js +43 -0
  65. package/dist/esm/models/ScriptSecretsResBody.d.ts +134 -0
  66. package/dist/esm/models/ScriptSecretsResBody.js +111 -0
  67. package/dist/esm/models/ScriptSummary.d.ts +128 -0
  68. package/dist/esm/models/ScriptSummary.js +107 -0
  69. package/dist/esm/models/ScriptWebhookResBody.d.ts +32 -0
  70. package/dist/esm/models/ScriptWebhookResBody.js +43 -0
  71. package/dist/esm/models/index.d.ts +22 -0
  72. package/dist/esm/models/index.js +22 -0
  73. package/dist/models/APIKey.d.ts +6 -0
  74. package/dist/models/APIKey.js +2 -0
  75. package/dist/models/ScriptAuditEntry.d.ts +67 -0
  76. package/dist/models/ScriptAuditEntry.js +71 -0
  77. package/dist/models/ScriptAuditResBody.d.ts +39 -0
  78. package/dist/models/ScriptAuditResBody.js +53 -0
  79. package/dist/models/ScriptDetail.d.ts +161 -0
  80. package/dist/models/ScriptDetail.js +130 -0
  81. package/dist/models/ScriptExport.d.ts +174 -0
  82. package/dist/models/ScriptExport.js +137 -0
  83. package/dist/models/ScriptExportResBody.d.ts +39 -0
  84. package/dist/models/ScriptExportResBody.js +55 -0
  85. package/dist/models/ScriptExportRun.d.ts +92 -0
  86. package/dist/models/ScriptExportRun.js +80 -0
  87. package/dist/models/ScriptKey.d.ts +64 -0
  88. package/dist/models/ScriptKey.js +66 -0
  89. package/dist/models/ScriptListResBody.d.ts +33 -0
  90. package/dist/models/ScriptListResBody.js +51 -0
  91. package/dist/models/ScriptLogLine.d.ts +38 -0
  92. package/dist/models/ScriptLogLine.js +54 -0
  93. package/dist/models/ScriptPatchReqBody.d.ts +98 -0
  94. package/dist/models/ScriptPatchReqBody.js +78 -0
  95. package/dist/models/ScriptPostReqBody.d.ts +113 -0
  96. package/dist/models/ScriptPostReqBody.js +90 -0
  97. package/dist/models/ScriptRun.d.ts +86 -0
  98. package/dist/models/ScriptRun.js +76 -0
  99. package/dist/models/ScriptRunLogsResBody.d.ts +39 -0
  100. package/dist/models/ScriptRunLogsResBody.js +55 -0
  101. package/dist/models/ScriptRunsResBody.d.ts +39 -0
  102. package/dist/models/ScriptRunsResBody.js +53 -0
  103. package/dist/models/ScriptRuntime.d.ts +62 -0
  104. package/dist/models/ScriptRuntime.js +58 -0
  105. package/dist/models/ScriptSchedule.d.ts +38 -0
  106. package/dist/models/ScriptSchedule.js +50 -0
  107. package/dist/models/ScriptSchedulePreviewReqBody.d.ts +44 -0
  108. package/dist/models/ScriptSchedulePreviewReqBody.js +52 -0
  109. package/dist/models/ScriptSchedulePreviewResBody.d.ts +44 -0
  110. package/dist/models/ScriptSchedulePreviewResBody.js +56 -0
  111. package/dist/models/ScriptSecretsReqBody.d.ts +40 -0
  112. package/dist/models/ScriptSecretsReqBody.js +50 -0
  113. package/dist/models/ScriptSecretsResBody.d.ts +134 -0
  114. package/dist/models/ScriptSecretsResBody.js +119 -0
  115. package/dist/models/ScriptSummary.d.ts +128 -0
  116. package/dist/models/ScriptSummary.js +115 -0
  117. package/dist/models/ScriptWebhookResBody.d.ts +32 -0
  118. package/dist/models/ScriptWebhookResBody.js +50 -0
  119. package/dist/models/index.d.ts +22 -0
  120. package/dist/models/index.js +22 -0
  121. package/package.json +1 -1
  122. package/src/apis/AccountsApi.ts +24 -24
  123. package/src/apis/AuditLogApi.ts +1 -1
  124. package/src/apis/AuthenticationApi.ts +8 -8
  125. package/src/apis/ScriptsApi.ts +984 -0
  126. package/src/apis/UsersApi.ts +4 -4
  127. package/src/apis/index.ts +1 -0
  128. package/src/models/APIKey.ts +8 -0
  129. package/src/models/ScriptAuditEntry.ts +112 -0
  130. package/src/models/ScriptAuditResBody.ts +82 -0
  131. package/src/models/ScriptDetail.ts +265 -0
  132. package/src/models/ScriptExport.ts +289 -0
  133. package/src/models/ScriptExportResBody.ts +83 -0
  134. package/src/models/ScriptExportRun.ts +151 -0
  135. package/src/models/ScriptKey.ts +109 -0
  136. package/src/models/ScriptListResBody.ts +74 -0
  137. package/src/models/ScriptLogLine.ts +75 -0
  138. package/src/models/ScriptPatchReqBody.ts +158 -0
  139. package/src/models/ScriptPostReqBody.ts +176 -0
  140. package/src/models/ScriptRun.ts +142 -0
  141. package/src/models/ScriptRunLogsResBody.ts +83 -0
  142. package/src/models/ScriptRunsResBody.ts +82 -0
  143. package/src/models/ScriptRuntime.ts +105 -0
  144. package/src/models/ScriptSchedule.ts +73 -0
  145. package/src/models/ScriptSchedulePreviewReqBody.ts +81 -0
  146. package/src/models/ScriptSchedulePreviewResBody.ts +83 -0
  147. package/src/models/ScriptSecretsReqBody.ts +73 -0
  148. package/src/models/ScriptSecretsResBody.ts +225 -0
  149. package/src/models/ScriptSummary.ts +216 -0
  150. package/src/models/ScriptWebhookResBody.ts +66 -0
  151. package/src/models/index.ts +22 -0
@@ -0,0 +1,289 @@
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 { ScriptKey } from './ScriptKey';
17
+ import {
18
+ ScriptKeyFromJSON,
19
+ ScriptKeyFromJSONTyped,
20
+ ScriptKeyToJSON,
21
+ ScriptKeyToJSONTyped,
22
+ } from './ScriptKey';
23
+ import type { ScriptSchedule } from './ScriptSchedule';
24
+ import {
25
+ ScriptScheduleFromJSON,
26
+ ScriptScheduleFromJSONTyped,
27
+ ScriptScheduleToJSON,
28
+ ScriptScheduleToJSONTyped,
29
+ } from './ScriptSchedule';
30
+ import type { ScriptRuntime } from './ScriptRuntime';
31
+ import {
32
+ ScriptRuntimeFromJSON,
33
+ ScriptRuntimeFromJSONTyped,
34
+ ScriptRuntimeToJSON,
35
+ ScriptRuntimeToJSONTyped,
36
+ } from './ScriptRuntime';
37
+ import type { ScriptExportRun } from './ScriptExportRun';
38
+ import {
39
+ ScriptExportRunFromJSON,
40
+ ScriptExportRunFromJSONTyped,
41
+ ScriptExportRunToJSON,
42
+ ScriptExportRunToJSONTyped,
43
+ } from './ScriptExportRun';
44
+
45
+ /**
46
+ *
47
+ * @export
48
+ * @interface ScriptExport
49
+ */
50
+ export interface ScriptExport {
51
+ /**
52
+ *
53
+ * @type {Date}
54
+ * @memberof ScriptExport
55
+ */
56
+ createdAt: Date;
57
+ /**
58
+ *
59
+ * @type {number}
60
+ * @memberof ScriptExport
61
+ */
62
+ createdBy: number;
63
+ /**
64
+ *
65
+ * @type {string}
66
+ * @memberof ScriptExport
67
+ */
68
+ description?: string;
69
+ /**
70
+ *
71
+ * @type {boolean}
72
+ * @memberof ScriptExport
73
+ */
74
+ enabled: boolean;
75
+ /**
76
+ * Source files keyed by path.
77
+ * @type {{ [key: string]: string; }}
78
+ * @memberof ScriptExport
79
+ */
80
+ files: { [key: string]: string; };
81
+ /**
82
+ *
83
+ * @type {string}
84
+ * @memberof ScriptExport
85
+ */
86
+ id: string;
87
+ /**
88
+ *
89
+ * @type {ScriptKey}
90
+ * @memberof ScriptExport
91
+ */
92
+ key: ScriptKey;
93
+ /**
94
+ *
95
+ * @type {string}
96
+ * @memberof ScriptExport
97
+ */
98
+ language: ScriptExportLanguageEnum;
99
+ /**
100
+ * Dependency manifest: requirements.txt for Python, go.mod for Go, package.json for JavaScript.
101
+ * @type {string}
102
+ * @memberof ScriptExport
103
+ */
104
+ manifest?: string;
105
+ /**
106
+ *
107
+ * @type {string}
108
+ * @memberof ScriptExport
109
+ */
110
+ name: string;
111
+ /**
112
+ * Project the script's API key is scoped to. Absent when it acts across the account.
113
+ * @type {number}
114
+ * @memberof ScriptExport
115
+ */
116
+ project?: number;
117
+ /**
118
+ * Pass back when updating, so a concurrent change is reported rather than overwritten.
119
+ * @type {number}
120
+ * @memberof ScriptExport
121
+ */
122
+ revision: number;
123
+ /**
124
+ * Every build and run still kept, newest first.
125
+ * @type {Array<ScriptExportRun>}
126
+ * @memberof ScriptExport
127
+ */
128
+ runs: Array<ScriptExportRun>;
129
+ /**
130
+ * Set when the run history could not be read in full, in which case runs holds only the newest part that was read. Page through the script's runs endpoint for the rest.
131
+ * @type {string}
132
+ * @memberof ScriptExport
133
+ */
134
+ runsError?: string;
135
+ /**
136
+ * Live state from the runner; absent if the runner could not be reached.
137
+ * @type {ScriptRuntime}
138
+ * @memberof ScriptExport
139
+ */
140
+ runtime?: ScriptRuntime;
141
+ /**
142
+ *
143
+ * @type {ScriptSchedule}
144
+ * @memberof ScriptExport
145
+ */
146
+ schedule: ScriptSchedule;
147
+ /**
148
+ * Names of the secrets set on the script. Values are never returned.
149
+ * @type {Array<string>}
150
+ * @memberof ScriptExport
151
+ */
152
+ secretNames: Array<string>;
153
+ /**
154
+ * The handler signature the script implements.
155
+ * @type {string}
156
+ * @memberof ScriptExport
157
+ */
158
+ type: ScriptExportTypeEnum;
159
+ /**
160
+ *
161
+ * @type {Date}
162
+ * @memberof ScriptExport
163
+ */
164
+ updatedAt: Date;
165
+ /**
166
+ *
167
+ * @type {boolean}
168
+ * @memberof ScriptExport
169
+ */
170
+ webhook: boolean;
171
+ /**
172
+ * Returned only when a webhook URL is first issued; it cannot be retrieved later.
173
+ * @type {string}
174
+ * @memberof ScriptExport
175
+ */
176
+ webhookUrl?: string;
177
+ }
178
+
179
+
180
+ /**
181
+ * @export
182
+ */
183
+ export const ScriptExportLanguageEnum = {
184
+ Python: 'python',
185
+ Go: 'go',
186
+ Javascript: 'javascript'
187
+ } as const;
188
+ export type ScriptExportLanguageEnum = typeof ScriptExportLanguageEnum[keyof typeof ScriptExportLanguageEnum];
189
+
190
+ /**
191
+ * @export
192
+ */
193
+ export const ScriptExportTypeEnum = {
194
+ Integration: 'integration'
195
+ } as const;
196
+ export type ScriptExportTypeEnum = typeof ScriptExportTypeEnum[keyof typeof ScriptExportTypeEnum];
197
+
198
+
199
+ /**
200
+ * Check if a given object implements the ScriptExport interface.
201
+ */
202
+ export function instanceOfScriptExport(value: object): value is ScriptExport {
203
+ if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
204
+ if (!('createdBy' in value) || value['createdBy'] === undefined) return false;
205
+ if (!('enabled' in value) || value['enabled'] === undefined) return false;
206
+ if (!('files' in value) || value['files'] === undefined) return false;
207
+ if (!('id' in value) || value['id'] === undefined) return false;
208
+ if (!('key' in value) || value['key'] === undefined) return false;
209
+ if (!('language' in value) || value['language'] === undefined) return false;
210
+ if (!('name' in value) || value['name'] === undefined) return false;
211
+ if (!('revision' in value) || value['revision'] === undefined) return false;
212
+ if (!('runs' in value) || value['runs'] === undefined) return false;
213
+ if (!('schedule' in value) || value['schedule'] === undefined) return false;
214
+ if (!('secretNames' in value) || value['secretNames'] === undefined) return false;
215
+ if (!('type' in value) || value['type'] === undefined) return false;
216
+ if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
217
+ if (!('webhook' in value) || value['webhook'] === undefined) return false;
218
+ return true;
219
+ }
220
+
221
+ export function ScriptExportFromJSON(json: any): ScriptExport {
222
+ return ScriptExportFromJSONTyped(json, false);
223
+ }
224
+
225
+ export function ScriptExportFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScriptExport {
226
+ if (json == null) {
227
+ return json;
228
+ }
229
+ return {
230
+
231
+ 'createdAt': (new Date(json['createdAt'])),
232
+ 'createdBy': json['createdBy'],
233
+ 'description': json['description'] == null ? undefined : json['description'],
234
+ 'enabled': json['enabled'],
235
+ 'files': json['files'],
236
+ 'id': json['id'],
237
+ 'key': ScriptKeyFromJSON(json['key']),
238
+ 'language': json['language'],
239
+ 'manifest': json['manifest'] == null ? undefined : json['manifest'],
240
+ 'name': json['name'],
241
+ 'project': json['project'] == null ? undefined : json['project'],
242
+ 'revision': json['revision'],
243
+ 'runs': ((json['runs'] as Array<any>).map(ScriptExportRunFromJSON)),
244
+ 'runsError': json['runsError'] == null ? undefined : json['runsError'],
245
+ 'runtime': json['runtime'] == null ? undefined : ScriptRuntimeFromJSON(json['runtime']),
246
+ 'schedule': ScriptScheduleFromJSON(json['schedule']),
247
+ 'secretNames': json['secretNames'],
248
+ 'type': json['type'],
249
+ 'updatedAt': (new Date(json['updatedAt'])),
250
+ 'webhook': json['webhook'],
251
+ 'webhookUrl': json['webhookUrl'] == null ? undefined : json['webhookUrl'],
252
+ };
253
+ }
254
+
255
+ export function ScriptExportToJSON(json: any): ScriptExport {
256
+ return ScriptExportToJSONTyped(json, false);
257
+ }
258
+
259
+ export function ScriptExportToJSONTyped(value?: ScriptExport | null, ignoreDiscriminator: boolean = false): any {
260
+ if (value == null) {
261
+ return value;
262
+ }
263
+
264
+ return {
265
+
266
+ 'createdAt': ((value['createdAt']).toISOString()),
267
+ 'createdBy': value['createdBy'],
268
+ 'description': value['description'],
269
+ 'enabled': value['enabled'],
270
+ 'files': value['files'],
271
+ 'id': value['id'],
272
+ 'key': ScriptKeyToJSON(value['key']),
273
+ 'language': value['language'],
274
+ 'manifest': value['manifest'],
275
+ 'name': value['name'],
276
+ 'project': value['project'],
277
+ 'revision': value['revision'],
278
+ 'runs': ((value['runs'] as Array<any>).map(ScriptExportRunToJSON)),
279
+ 'runsError': value['runsError'],
280
+ 'runtime': ScriptRuntimeToJSON(value['runtime']),
281
+ 'schedule': ScriptScheduleToJSON(value['schedule']),
282
+ 'secretNames': value['secretNames'],
283
+ 'type': value['type'],
284
+ 'updatedAt': ((value['updatedAt']).toISOString()),
285
+ 'webhook': value['webhook'],
286
+ 'webhookUrl': value['webhookUrl'],
287
+ };
288
+ }
289
+
@@ -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 { ScriptExport } from './ScriptExport';
17
+ import {
18
+ ScriptExportFromJSON,
19
+ ScriptExportFromJSONTyped,
20
+ ScriptExportToJSON,
21
+ ScriptExportToJSONTyped,
22
+ } from './ScriptExport';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface ScriptExportResBody
28
+ */
29
+ export interface ScriptExportResBody {
30
+ /**
31
+ *
32
+ * @type {Date}
33
+ * @memberof ScriptExportResBody
34
+ */
35
+ exportedAt: Date;
36
+ /**
37
+ *
38
+ * @type {Array<ScriptExport>}
39
+ * @memberof ScriptExportResBody
40
+ */
41
+ scripts: Array<ScriptExport>;
42
+ }
43
+
44
+ /**
45
+ * Check if a given object implements the ScriptExportResBody interface.
46
+ */
47
+ export function instanceOfScriptExportResBody(value: object): value is ScriptExportResBody {
48
+ if (!('exportedAt' in value) || value['exportedAt'] === undefined) return false;
49
+ if (!('scripts' in value) || value['scripts'] === undefined) return false;
50
+ return true;
51
+ }
52
+
53
+ export function ScriptExportResBodyFromJSON(json: any): ScriptExportResBody {
54
+ return ScriptExportResBodyFromJSONTyped(json, false);
55
+ }
56
+
57
+ export function ScriptExportResBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScriptExportResBody {
58
+ if (json == null) {
59
+ return json;
60
+ }
61
+ return {
62
+
63
+ 'exportedAt': (new Date(json['exportedAt'])),
64
+ 'scripts': ((json['scripts'] as Array<any>).map(ScriptExportFromJSON)),
65
+ };
66
+ }
67
+
68
+ export function ScriptExportResBodyToJSON(json: any): ScriptExportResBody {
69
+ return ScriptExportResBodyToJSONTyped(json, false);
70
+ }
71
+
72
+ export function ScriptExportResBodyToJSONTyped(value?: ScriptExportResBody | null, ignoreDiscriminator: boolean = false): any {
73
+ if (value == null) {
74
+ return value;
75
+ }
76
+
77
+ return {
78
+
79
+ 'exportedAt': ((value['exportedAt']).toISOString()),
80
+ 'scripts': ((value['scripts'] as Array<any>).map(ScriptExportToJSON)),
81
+ };
82
+ }
83
+
@@ -0,0 +1,151 @@
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 ScriptExportRun
20
+ */
21
+ export interface ScriptExportRun {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof ScriptExportRun
26
+ */
27
+ durationMs?: number;
28
+ /**
29
+ *
30
+ * @type {Date}
31
+ * @memberof ScriptExportRun
32
+ */
33
+ endedAt?: Date;
34
+ /**
35
+ *
36
+ * @type {number}
37
+ * @memberof ScriptExportRun
38
+ */
39
+ exitCode: number;
40
+ /**
41
+ *
42
+ * @type {string}
43
+ * @memberof ScriptExportRun
44
+ */
45
+ id: string;
46
+ /**
47
+ * "build" for a dependency build, "run" for an execution.
48
+ * @type {string}
49
+ * @memberof ScriptExportRun
50
+ */
51
+ kind: string;
52
+ /**
53
+ * API path that returns the run's logs while the run is kept.
54
+ * @type {string}
55
+ * @memberof ScriptExportRun
56
+ */
57
+ logsPath: string;
58
+ /**
59
+ *
60
+ * @type {string}
61
+ * @memberof ScriptExportRun
62
+ */
63
+ message?: string;
64
+ /**
65
+ *
66
+ * @type {Date}
67
+ * @memberof ScriptExportRun
68
+ */
69
+ queuedAt?: Date;
70
+ /**
71
+ *
72
+ * @type {Date}
73
+ * @memberof ScriptExportRun
74
+ */
75
+ startedAt?: Date;
76
+ /**
77
+ *
78
+ * @type {string}
79
+ * @memberof ScriptExportRun
80
+ */
81
+ status: string;
82
+ /**
83
+ *
84
+ * @type {string}
85
+ * @memberof ScriptExportRun
86
+ */
87
+ trigger: string;
88
+ }
89
+
90
+ /**
91
+ * Check if a given object implements the ScriptExportRun interface.
92
+ */
93
+ export function instanceOfScriptExportRun(value: object): value is ScriptExportRun {
94
+ if (!('exitCode' in value) || value['exitCode'] === undefined) return false;
95
+ if (!('id' in value) || value['id'] === undefined) return false;
96
+ if (!('kind' in value) || value['kind'] === undefined) return false;
97
+ if (!('logsPath' in value) || value['logsPath'] === undefined) return false;
98
+ if (!('status' in value) || value['status'] === undefined) return false;
99
+ if (!('trigger' in value) || value['trigger'] === undefined) return false;
100
+ return true;
101
+ }
102
+
103
+ export function ScriptExportRunFromJSON(json: any): ScriptExportRun {
104
+ return ScriptExportRunFromJSONTyped(json, false);
105
+ }
106
+
107
+ export function ScriptExportRunFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScriptExportRun {
108
+ if (json == null) {
109
+ return json;
110
+ }
111
+ return {
112
+
113
+ 'durationMs': json['durationMs'] == null ? undefined : json['durationMs'],
114
+ 'endedAt': json['endedAt'] == null ? undefined : (new Date(json['endedAt'])),
115
+ 'exitCode': json['exitCode'],
116
+ 'id': json['id'],
117
+ 'kind': json['kind'],
118
+ 'logsPath': json['logsPath'],
119
+ 'message': json['message'] == null ? undefined : json['message'],
120
+ 'queuedAt': json['queuedAt'] == null ? undefined : (new Date(json['queuedAt'])),
121
+ 'startedAt': json['startedAt'] == null ? undefined : (new Date(json['startedAt'])),
122
+ 'status': json['status'],
123
+ 'trigger': json['trigger'],
124
+ };
125
+ }
126
+
127
+ export function ScriptExportRunToJSON(json: any): ScriptExportRun {
128
+ return ScriptExportRunToJSONTyped(json, false);
129
+ }
130
+
131
+ export function ScriptExportRunToJSONTyped(value?: ScriptExportRun | null, ignoreDiscriminator: boolean = false): any {
132
+ if (value == null) {
133
+ return value;
134
+ }
135
+
136
+ return {
137
+
138
+ 'durationMs': value['durationMs'],
139
+ 'endedAt': value['endedAt'] == null ? undefined : ((value['endedAt']).toISOString()),
140
+ 'exitCode': value['exitCode'],
141
+ 'id': value['id'],
142
+ 'kind': value['kind'],
143
+ 'logsPath': value['logsPath'],
144
+ 'message': value['message'],
145
+ 'queuedAt': value['queuedAt'] == null ? undefined : ((value['queuedAt']).toISOString()),
146
+ 'startedAt': value['startedAt'] == null ? undefined : ((value['startedAt']).toISOString()),
147
+ 'status': value['status'],
148
+ 'trigger': value['trigger'],
149
+ };
150
+ }
151
+
@@ -0,0 +1,109 @@
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 ScriptKey
20
+ */
21
+ export interface ScriptKey {
22
+ /**
23
+ *
24
+ * @type {Date}
25
+ * @memberof ScriptKey
26
+ */
27
+ expiresAt?: Date;
28
+ /**
29
+ * Why the last automatic rotation failed or why the key needs re-authorising.
30
+ * @type {string}
31
+ * @memberof ScriptKey
32
+ */
33
+ lastError?: string;
34
+ /**
35
+ * User whose permissions the key acts with.
36
+ * @type {number}
37
+ * @memberof ScriptKey
38
+ */
39
+ ownerUserId?: number;
40
+ /**
41
+ * When the key is next replaced automatically.
42
+ * @type {Date}
43
+ * @memberof ScriptKey
44
+ */
45
+ rotateAt?: Date;
46
+ /**
47
+ * Whether the script's Spaciv API key is usable. While "needs_reauthorisation", runs are paused until someone with *Manage my account* re-authorises it.
48
+ * @type {string}
49
+ * @memberof ScriptKey
50
+ */
51
+ status: ScriptKeyStatusEnum;
52
+ }
53
+
54
+
55
+ /**
56
+ * @export
57
+ */
58
+ export const ScriptKeyStatusEnum = {
59
+ Active: 'active',
60
+ NeedsReauthorisation: 'needs_reauthorisation'
61
+ } as const;
62
+ export type ScriptKeyStatusEnum = typeof ScriptKeyStatusEnum[keyof typeof ScriptKeyStatusEnum];
63
+
64
+
65
+ /**
66
+ * Check if a given object implements the ScriptKey interface.
67
+ */
68
+ export function instanceOfScriptKey(value: object): value is ScriptKey {
69
+ if (!('status' in value) || value['status'] === undefined) return false;
70
+ return true;
71
+ }
72
+
73
+ export function ScriptKeyFromJSON(json: any): ScriptKey {
74
+ return ScriptKeyFromJSONTyped(json, false);
75
+ }
76
+
77
+ export function ScriptKeyFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScriptKey {
78
+ if (json == null) {
79
+ return json;
80
+ }
81
+ return {
82
+
83
+ 'expiresAt': json['expiresAt'] == null ? undefined : (new Date(json['expiresAt'])),
84
+ 'lastError': json['lastError'] == null ? undefined : json['lastError'],
85
+ 'ownerUserId': json['ownerUserId'] == null ? undefined : json['ownerUserId'],
86
+ 'rotateAt': json['rotateAt'] == null ? undefined : (new Date(json['rotateAt'])),
87
+ 'status': json['status'],
88
+ };
89
+ }
90
+
91
+ export function ScriptKeyToJSON(json: any): ScriptKey {
92
+ return ScriptKeyToJSONTyped(json, false);
93
+ }
94
+
95
+ export function ScriptKeyToJSONTyped(value?: ScriptKey | null, ignoreDiscriminator: boolean = false): any {
96
+ if (value == null) {
97
+ return value;
98
+ }
99
+
100
+ return {
101
+
102
+ 'expiresAt': value['expiresAt'] == null ? undefined : ((value['expiresAt']).toISOString()),
103
+ 'lastError': value['lastError'],
104
+ 'ownerUserId': value['ownerUserId'],
105
+ 'rotateAt': value['rotateAt'] == null ? undefined : ((value['rotateAt']).toISOString()),
106
+ 'status': value['status'],
107
+ };
108
+ }
109
+