@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,74 @@
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 { ScriptSummary } from './ScriptSummary';
17
+ import {
18
+ ScriptSummaryFromJSON,
19
+ ScriptSummaryFromJSONTyped,
20
+ ScriptSummaryToJSON,
21
+ ScriptSummaryToJSONTyped,
22
+ } from './ScriptSummary';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface ScriptListResBody
28
+ */
29
+ export interface ScriptListResBody {
30
+ /**
31
+ *
32
+ * @type {Array<ScriptSummary>}
33
+ * @memberof ScriptListResBody
34
+ */
35
+ scripts: Array<ScriptSummary>;
36
+ }
37
+
38
+ /**
39
+ * Check if a given object implements the ScriptListResBody interface.
40
+ */
41
+ export function instanceOfScriptListResBody(value: object): value is ScriptListResBody {
42
+ if (!('scripts' in value) || value['scripts'] === undefined) return false;
43
+ return true;
44
+ }
45
+
46
+ export function ScriptListResBodyFromJSON(json: any): ScriptListResBody {
47
+ return ScriptListResBodyFromJSONTyped(json, false);
48
+ }
49
+
50
+ export function ScriptListResBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScriptListResBody {
51
+ if (json == null) {
52
+ return json;
53
+ }
54
+ return {
55
+
56
+ 'scripts': ((json['scripts'] as Array<any>).map(ScriptSummaryFromJSON)),
57
+ };
58
+ }
59
+
60
+ export function ScriptListResBodyToJSON(json: any): ScriptListResBody {
61
+ return ScriptListResBodyToJSONTyped(json, false);
62
+ }
63
+
64
+ export function ScriptListResBodyToJSONTyped(value?: ScriptListResBody | null, ignoreDiscriminator: boolean = false): any {
65
+ if (value == null) {
66
+ return value;
67
+ }
68
+
69
+ return {
70
+
71
+ 'scripts': ((value['scripts'] as Array<any>).map(ScriptSummaryToJSON)),
72
+ };
73
+ }
74
+
@@ -0,0 +1,75 @@
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 ScriptLogLine
20
+ */
21
+ export interface ScriptLogLine {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ScriptLogLine
26
+ */
27
+ message: string;
28
+ /**
29
+ *
30
+ * @type {Date}
31
+ * @memberof ScriptLogLine
32
+ */
33
+ timestamp: Date;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the ScriptLogLine interface.
38
+ */
39
+ export function instanceOfScriptLogLine(value: object): value is ScriptLogLine {
40
+ if (!('message' in value) || value['message'] === undefined) return false;
41
+ if (!('timestamp' in value) || value['timestamp'] === undefined) return false;
42
+ return true;
43
+ }
44
+
45
+ export function ScriptLogLineFromJSON(json: any): ScriptLogLine {
46
+ return ScriptLogLineFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function ScriptLogLineFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScriptLogLine {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'message': json['message'],
56
+ 'timestamp': (new Date(json['timestamp'])),
57
+ };
58
+ }
59
+
60
+ export function ScriptLogLineToJSON(json: any): ScriptLogLine {
61
+ return ScriptLogLineToJSONTyped(json, false);
62
+ }
63
+
64
+ export function ScriptLogLineToJSONTyped(value?: ScriptLogLine | null, ignoreDiscriminator: boolean = false): any {
65
+ if (value == null) {
66
+ return value;
67
+ }
68
+
69
+ return {
70
+
71
+ 'message': value['message'],
72
+ 'timestamp': ((value['timestamp']).toISOString()),
73
+ };
74
+ }
75
+
@@ -0,0 +1,158 @@
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 ScriptPatchReqBody
28
+ */
29
+ export interface ScriptPatchReqBody {
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof ScriptPatchReqBody
34
+ */
35
+ description?: string;
36
+ /**
37
+ *
38
+ * @type {boolean}
39
+ * @memberof ScriptPatchReqBody
40
+ */
41
+ enabled?: boolean;
42
+ /**
43
+ *
44
+ * @type {{ [key: string]: string; }}
45
+ * @memberof ScriptPatchReqBody
46
+ */
47
+ files?: { [key: string]: string; };
48
+ /**
49
+ *
50
+ * @type {string}
51
+ * @memberof ScriptPatchReqBody
52
+ */
53
+ language?: ScriptPatchReqBodyLanguageEnum;
54
+ /**
55
+ *
56
+ * @type {string}
57
+ * @memberof ScriptPatchReqBody
58
+ */
59
+ manifest?: string;
60
+ /**
61
+ *
62
+ * @type {string}
63
+ * @memberof ScriptPatchReqBody
64
+ */
65
+ name?: string;
66
+ /**
67
+ * 0 removes the project.
68
+ * @type {number}
69
+ * @memberof ScriptPatchReqBody
70
+ */
71
+ project?: number;
72
+ /**
73
+ * The revision last read; a different current revision is rejected with 409.
74
+ * @type {number}
75
+ * @memberof ScriptPatchReqBody
76
+ */
77
+ revision: number;
78
+ /**
79
+ *
80
+ * @type {ScriptSchedule}
81
+ * @memberof ScriptPatchReqBody
82
+ */
83
+ schedule?: ScriptSchedule;
84
+ /**
85
+ *
86
+ * @type {boolean}
87
+ * @memberof ScriptPatchReqBody
88
+ */
89
+ webhook?: boolean;
90
+ }
91
+
92
+
93
+ /**
94
+ * @export
95
+ */
96
+ export const ScriptPatchReqBodyLanguageEnum = {
97
+ Python: 'python',
98
+ Go: 'go',
99
+ Javascript: 'javascript'
100
+ } as const;
101
+ export type ScriptPatchReqBodyLanguageEnum = typeof ScriptPatchReqBodyLanguageEnum[keyof typeof ScriptPatchReqBodyLanguageEnum];
102
+
103
+
104
+ /**
105
+ * Check if a given object implements the ScriptPatchReqBody interface.
106
+ */
107
+ export function instanceOfScriptPatchReqBody(value: object): value is ScriptPatchReqBody {
108
+ if (!('revision' in value) || value['revision'] === undefined) return false;
109
+ return true;
110
+ }
111
+
112
+ export function ScriptPatchReqBodyFromJSON(json: any): ScriptPatchReqBody {
113
+ return ScriptPatchReqBodyFromJSONTyped(json, false);
114
+ }
115
+
116
+ export function ScriptPatchReqBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScriptPatchReqBody {
117
+ if (json == null) {
118
+ return json;
119
+ }
120
+ return {
121
+
122
+ 'description': json['description'] == null ? undefined : json['description'],
123
+ 'enabled': json['enabled'] == null ? undefined : json['enabled'],
124
+ 'files': json['files'] == null ? undefined : json['files'],
125
+ 'language': json['language'] == null ? undefined : json['language'],
126
+ 'manifest': json['manifest'] == null ? undefined : json['manifest'],
127
+ 'name': json['name'] == null ? undefined : json['name'],
128
+ 'project': json['project'] == null ? undefined : json['project'],
129
+ 'revision': json['revision'],
130
+ 'schedule': json['schedule'] == null ? undefined : ScriptScheduleFromJSON(json['schedule']),
131
+ 'webhook': json['webhook'] == null ? undefined : json['webhook'],
132
+ };
133
+ }
134
+
135
+ export function ScriptPatchReqBodyToJSON(json: any): ScriptPatchReqBody {
136
+ return ScriptPatchReqBodyToJSONTyped(json, false);
137
+ }
138
+
139
+ export function ScriptPatchReqBodyToJSONTyped(value?: ScriptPatchReqBody | null, ignoreDiscriminator: boolean = false): any {
140
+ if (value == null) {
141
+ return value;
142
+ }
143
+
144
+ return {
145
+
146
+ 'description': value['description'],
147
+ 'enabled': value['enabled'],
148
+ 'files': value['files'],
149
+ 'language': value['language'],
150
+ 'manifest': value['manifest'],
151
+ 'name': value['name'],
152
+ 'project': value['project'],
153
+ 'revision': value['revision'],
154
+ 'schedule': ScriptScheduleToJSON(value['schedule']),
155
+ 'webhook': value['webhook'],
156
+ };
157
+ }
158
+
@@ -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
+