@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,265 @@
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
+
38
+ /**
39
+ *
40
+ * @export
41
+ * @interface ScriptDetail
42
+ */
43
+ export interface ScriptDetail {
44
+ /**
45
+ *
46
+ * @type {Date}
47
+ * @memberof ScriptDetail
48
+ */
49
+ createdAt: Date;
50
+ /**
51
+ *
52
+ * @type {number}
53
+ * @memberof ScriptDetail
54
+ */
55
+ createdBy: number;
56
+ /**
57
+ *
58
+ * @type {string}
59
+ * @memberof ScriptDetail
60
+ */
61
+ description?: string;
62
+ /**
63
+ *
64
+ * @type {boolean}
65
+ * @memberof ScriptDetail
66
+ */
67
+ enabled: boolean;
68
+ /**
69
+ * Source files keyed by path.
70
+ * @type {{ [key: string]: string; }}
71
+ * @memberof ScriptDetail
72
+ */
73
+ files: { [key: string]: string; };
74
+ /**
75
+ *
76
+ * @type {string}
77
+ * @memberof ScriptDetail
78
+ */
79
+ id: string;
80
+ /**
81
+ *
82
+ * @type {ScriptKey}
83
+ * @memberof ScriptDetail
84
+ */
85
+ key: ScriptKey;
86
+ /**
87
+ *
88
+ * @type {string}
89
+ * @memberof ScriptDetail
90
+ */
91
+ language: ScriptDetailLanguageEnum;
92
+ /**
93
+ * Dependency manifest: requirements.txt for Python, go.mod for Go, package.json for JavaScript.
94
+ * @type {string}
95
+ * @memberof ScriptDetail
96
+ */
97
+ manifest?: string;
98
+ /**
99
+ *
100
+ * @type {string}
101
+ * @memberof ScriptDetail
102
+ */
103
+ name: string;
104
+ /**
105
+ * Project the script's API key is scoped to. Absent when it acts across the account.
106
+ * @type {number}
107
+ * @memberof ScriptDetail
108
+ */
109
+ project?: number;
110
+ /**
111
+ * Pass back when updating, so a concurrent change is reported rather than overwritten.
112
+ * @type {number}
113
+ * @memberof ScriptDetail
114
+ */
115
+ revision: number;
116
+ /**
117
+ * Live state from the runner; absent if the runner could not be reached.
118
+ * @type {ScriptRuntime}
119
+ * @memberof ScriptDetail
120
+ */
121
+ runtime?: ScriptRuntime;
122
+ /**
123
+ *
124
+ * @type {ScriptSchedule}
125
+ * @memberof ScriptDetail
126
+ */
127
+ schedule: ScriptSchedule;
128
+ /**
129
+ * Names of the secrets set on the script. Values are never returned.
130
+ * @type {Array<string>}
131
+ * @memberof ScriptDetail
132
+ */
133
+ secretNames: Array<string>;
134
+ /**
135
+ * The handler signature the script implements.
136
+ * @type {string}
137
+ * @memberof ScriptDetail
138
+ */
139
+ type: ScriptDetailTypeEnum;
140
+ /**
141
+ *
142
+ * @type {Date}
143
+ * @memberof ScriptDetail
144
+ */
145
+ updatedAt: Date;
146
+ /**
147
+ *
148
+ * @type {boolean}
149
+ * @memberof ScriptDetail
150
+ */
151
+ webhook: boolean;
152
+ /**
153
+ * Returned only when a webhook URL is first issued; it cannot be retrieved later.
154
+ * @type {string}
155
+ * @memberof ScriptDetail
156
+ */
157
+ webhookUrl?: string;
158
+ }
159
+
160
+
161
+ /**
162
+ * @export
163
+ */
164
+ export const ScriptDetailLanguageEnum = {
165
+ Python: 'python',
166
+ Go: 'go',
167
+ Javascript: 'javascript'
168
+ } as const;
169
+ export type ScriptDetailLanguageEnum = typeof ScriptDetailLanguageEnum[keyof typeof ScriptDetailLanguageEnum];
170
+
171
+ /**
172
+ * @export
173
+ */
174
+ export const ScriptDetailTypeEnum = {
175
+ Integration: 'integration'
176
+ } as const;
177
+ export type ScriptDetailTypeEnum = typeof ScriptDetailTypeEnum[keyof typeof ScriptDetailTypeEnum];
178
+
179
+
180
+ /**
181
+ * Check if a given object implements the ScriptDetail interface.
182
+ */
183
+ export function instanceOfScriptDetail(value: object): value is ScriptDetail {
184
+ if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
185
+ if (!('createdBy' in value) || value['createdBy'] === undefined) return false;
186
+ if (!('enabled' in value) || value['enabled'] === undefined) return false;
187
+ if (!('files' in value) || value['files'] === undefined) return false;
188
+ if (!('id' in value) || value['id'] === undefined) return false;
189
+ if (!('key' in value) || value['key'] === undefined) return false;
190
+ if (!('language' in value) || value['language'] === undefined) return false;
191
+ if (!('name' in value) || value['name'] === undefined) return false;
192
+ if (!('revision' in value) || value['revision'] === undefined) return false;
193
+ if (!('schedule' in value) || value['schedule'] === undefined) return false;
194
+ if (!('secretNames' in value) || value['secretNames'] === undefined) return false;
195
+ if (!('type' in value) || value['type'] === undefined) return false;
196
+ if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
197
+ if (!('webhook' in value) || value['webhook'] === undefined) return false;
198
+ return true;
199
+ }
200
+
201
+ export function ScriptDetailFromJSON(json: any): ScriptDetail {
202
+ return ScriptDetailFromJSONTyped(json, false);
203
+ }
204
+
205
+ export function ScriptDetailFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScriptDetail {
206
+ if (json == null) {
207
+ return json;
208
+ }
209
+ return {
210
+
211
+ 'createdAt': (new Date(json['createdAt'])),
212
+ 'createdBy': json['createdBy'],
213
+ 'description': json['description'] == null ? undefined : json['description'],
214
+ 'enabled': json['enabled'],
215
+ 'files': json['files'],
216
+ 'id': json['id'],
217
+ 'key': ScriptKeyFromJSON(json['key']),
218
+ 'language': json['language'],
219
+ 'manifest': json['manifest'] == null ? undefined : json['manifest'],
220
+ 'name': json['name'],
221
+ 'project': json['project'] == null ? undefined : json['project'],
222
+ 'revision': json['revision'],
223
+ 'runtime': json['runtime'] == null ? undefined : ScriptRuntimeFromJSON(json['runtime']),
224
+ 'schedule': ScriptScheduleFromJSON(json['schedule']),
225
+ 'secretNames': json['secretNames'],
226
+ 'type': json['type'],
227
+ 'updatedAt': (new Date(json['updatedAt'])),
228
+ 'webhook': json['webhook'],
229
+ 'webhookUrl': json['webhookUrl'] == null ? undefined : json['webhookUrl'],
230
+ };
231
+ }
232
+
233
+ export function ScriptDetailToJSON(json: any): ScriptDetail {
234
+ return ScriptDetailToJSONTyped(json, false);
235
+ }
236
+
237
+ export function ScriptDetailToJSONTyped(value?: ScriptDetail | null, ignoreDiscriminator: boolean = false): any {
238
+ if (value == null) {
239
+ return value;
240
+ }
241
+
242
+ return {
243
+
244
+ 'createdAt': ((value['createdAt']).toISOString()),
245
+ 'createdBy': value['createdBy'],
246
+ 'description': value['description'],
247
+ 'enabled': value['enabled'],
248
+ 'files': value['files'],
249
+ 'id': value['id'],
250
+ 'key': ScriptKeyToJSON(value['key']),
251
+ 'language': value['language'],
252
+ 'manifest': value['manifest'],
253
+ 'name': value['name'],
254
+ 'project': value['project'],
255
+ 'revision': value['revision'],
256
+ 'runtime': ScriptRuntimeToJSON(value['runtime']),
257
+ 'schedule': ScriptScheduleToJSON(value['schedule']),
258
+ 'secretNames': value['secretNames'],
259
+ 'type': value['type'],
260
+ 'updatedAt': ((value['updatedAt']).toISOString()),
261
+ 'webhook': value['webhook'],
262
+ 'webhookUrl': value['webhookUrl'],
263
+ };
264
+ }
265
+
@@ -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
+