@spaciv/sdk 0.1.1 → 0.1.3

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 (191) hide show
  1. package/.openapi-generator/FILES +25 -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/VariableData.d.ts +2 -1
  72. package/dist/esm/models/VariableData.js +7 -0
  73. package/dist/esm/models/VariableDataOneOf2.d.ts +3 -3
  74. package/dist/esm/models/VariableDataOneOf2.js +4 -4
  75. package/dist/esm/models/VariableDataOneOf3.d.ts +3 -3
  76. package/dist/esm/models/VariableDataOneOf3.js +4 -4
  77. package/dist/esm/models/VariableDataOneOf4.d.ts +3 -3
  78. package/dist/esm/models/VariableDataOneOf4.js +4 -4
  79. package/dist/esm/models/VariableDataOneOf5.d.ts +3 -2
  80. package/dist/esm/models/VariableDataOneOf5.js +4 -3
  81. package/dist/esm/models/VariableDataOneOf6.d.ts +1 -1
  82. package/dist/esm/models/VariableDataOneOf6.js +3 -3
  83. package/dist/esm/models/VariableDataOneOf7.d.ts +32 -0
  84. package/dist/esm/models/VariableDataOneOf7.js +43 -0
  85. package/dist/esm/models/VariableDate.d.ts +50 -0
  86. package/dist/esm/models/VariableDate.js +55 -0
  87. package/dist/esm/models/index.d.ts +24 -0
  88. package/dist/esm/models/index.js +24 -0
  89. package/dist/models/APIKey.d.ts +6 -0
  90. package/dist/models/APIKey.js +2 -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/VariableData.d.ts +2 -1
  136. package/dist/models/VariableData.js +7 -0
  137. package/dist/models/VariableDataOneOf2.d.ts +3 -3
  138. package/dist/models/VariableDataOneOf2.js +4 -4
  139. package/dist/models/VariableDataOneOf3.d.ts +3 -3
  140. package/dist/models/VariableDataOneOf3.js +4 -4
  141. package/dist/models/VariableDataOneOf4.d.ts +3 -3
  142. package/dist/models/VariableDataOneOf4.js +4 -4
  143. package/dist/models/VariableDataOneOf5.d.ts +3 -2
  144. package/dist/models/VariableDataOneOf5.js +4 -3
  145. package/dist/models/VariableDataOneOf6.d.ts +1 -1
  146. package/dist/models/VariableDataOneOf6.js +3 -3
  147. package/dist/models/VariableDataOneOf7.d.ts +32 -0
  148. package/dist/models/VariableDataOneOf7.js +50 -0
  149. package/dist/models/VariableDate.d.ts +50 -0
  150. package/dist/models/VariableDate.js +62 -0
  151. package/dist/models/index.d.ts +24 -0
  152. package/dist/models/index.js +24 -0
  153. package/package.json +1 -1
  154. package/src/apis/AccountsApi.ts +24 -24
  155. package/src/apis/AuditLogApi.ts +1 -1
  156. package/src/apis/AuthenticationApi.ts +8 -8
  157. package/src/apis/ScriptsApi.ts +984 -0
  158. package/src/apis/UsersApi.ts +4 -4
  159. package/src/apis/index.ts +1 -0
  160. package/src/models/APIKey.ts +8 -0
  161. package/src/models/ScriptAuditEntry.ts +112 -0
  162. package/src/models/ScriptAuditResBody.ts +82 -0
  163. package/src/models/ScriptDetail.ts +265 -0
  164. package/src/models/ScriptExport.ts +289 -0
  165. package/src/models/ScriptExportResBody.ts +83 -0
  166. package/src/models/ScriptExportRun.ts +151 -0
  167. package/src/models/ScriptKey.ts +109 -0
  168. package/src/models/ScriptListResBody.ts +74 -0
  169. package/src/models/ScriptLogLine.ts +75 -0
  170. package/src/models/ScriptPatchReqBody.ts +158 -0
  171. package/src/models/ScriptPostReqBody.ts +176 -0
  172. package/src/models/ScriptRun.ts +142 -0
  173. package/src/models/ScriptRunLogsResBody.ts +83 -0
  174. package/src/models/ScriptRunsResBody.ts +82 -0
  175. package/src/models/ScriptRuntime.ts +105 -0
  176. package/src/models/ScriptSchedule.ts +73 -0
  177. package/src/models/ScriptSchedulePreviewReqBody.ts +81 -0
  178. package/src/models/ScriptSchedulePreviewResBody.ts +83 -0
  179. package/src/models/ScriptSecretsReqBody.ts +73 -0
  180. package/src/models/ScriptSecretsResBody.ts +225 -0
  181. package/src/models/ScriptSummary.ts +216 -0
  182. package/src/models/ScriptWebhookResBody.ts +66 -0
  183. package/src/models/VariableData.ts +14 -1
  184. package/src/models/VariableDataOneOf2.ts +11 -11
  185. package/src/models/VariableDataOneOf3.ts +11 -11
  186. package/src/models/VariableDataOneOf4.ts +11 -11
  187. package/src/models/VariableDataOneOf5.ts +13 -5
  188. package/src/models/VariableDataOneOf6.ts +4 -4
  189. package/src/models/VariableDataOneOf7.ts +66 -0
  190. package/src/models/VariableDate.ts +93 -0
  191. package/src/models/index.ts +24 -0
@@ -98,7 +98,7 @@ export interface UsersApiInterface {
98
98
  createImport(requestParameters: UsersApiCreateImportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
99
99
 
100
100
  /**
101
- * Permanently deletes the authenticated user\'s own account and all associated data. Requires the *Edit my user profile* permission. This action is irreversible.
101
+ * Permanently deletes the authenticated user\'s own account and all associated data. Requires the *Edit my user profile* permission. This action is irreversible. A script\'s own API key cannot delete its user.
102
102
  * @summary Delete the current user\'s account
103
103
  * @param {*} [options] Override http request option.
104
104
  * @throws {RequiredError}
@@ -107,7 +107,7 @@ export interface UsersApiInterface {
107
107
  deleteRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
108
108
 
109
109
  /**
110
- * Permanently deletes the authenticated user\'s own account and all associated data. Requires the *Edit my user profile* permission. This action is irreversible.
110
+ * Permanently deletes the authenticated user\'s own account and all associated data. Requires the *Edit my user profile* permission. This action is irreversible. A script\'s own API key cannot delete its user.
111
111
  * Delete the current user\'s account
112
112
  */
113
113
  delete(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
@@ -317,7 +317,7 @@ export class UsersApi extends runtime.BaseAPI implements UsersApiInterface {
317
317
  }
318
318
 
319
319
  /**
320
- * Permanently deletes the authenticated user\'s own account and all associated data. Requires the *Edit my user profile* permission. This action is irreversible.
320
+ * Permanently deletes the authenticated user\'s own account and all associated data. Requires the *Edit my user profile* permission. This action is irreversible. A script\'s own API key cannot delete its user.
321
321
  * Delete the current user\'s account
322
322
  */
323
323
  async deleteRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
@@ -347,7 +347,7 @@ export class UsersApi extends runtime.BaseAPI implements UsersApiInterface {
347
347
  }
348
348
 
349
349
  /**
350
- * Permanently deletes the authenticated user\'s own account and all associated data. Requires the *Edit my user profile* permission. This action is irreversible.
350
+ * Permanently deletes the authenticated user\'s own account and all associated data. Requires the *Edit my user profile* permission. This action is irreversible. A script\'s own API key cannot delete its user.
351
351
  * Delete the current user\'s account
352
352
  */
353
353
  async delete(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
package/src/apis/index.ts CHANGED
@@ -22,6 +22,7 @@ export * from './ProjectsApi';
22
22
  export * from './PropertiesApi';
23
23
  export * from './ReportsApi';
24
24
  export * from './ScenariosApi';
25
+ export * from './ScriptsApi';
25
26
  export * from './ServiceApi';
26
27
  export * from './SpaceRulesetsApi';
27
28
  export * from './TemplateProjectsApi';
@@ -67,6 +67,12 @@ export interface APIKey {
67
67
  * @memberof APIKey
68
68
  */
69
69
  projectId: number;
70
+ /**
71
+ * Set when the key is created and rotated by a script; it can't be revoked here.
72
+ * @type {string}
73
+ * @memberof APIKey
74
+ */
75
+ scriptId?: string;
70
76
  }
71
77
 
72
78
  /**
@@ -101,6 +107,7 @@ export function APIKeyFromJSONTyped(json: any, ignoreDiscriminator: boolean): AP
101
107
  'name': json['name'],
102
108
  'prefix': json['prefix'],
103
109
  'projectId': json['projectId'],
110
+ 'scriptId': json['scriptId'] == null ? undefined : json['scriptId'],
104
111
  };
105
112
  }
106
113
 
@@ -123,6 +130,7 @@ export function APIKeyToJSONTyped(value?: APIKey | null, ignoreDiscriminator: bo
123
130
  'name': value['name'],
124
131
  'prefix': value['prefix'],
125
132
  'projectId': value['projectId'],
133
+ 'scriptId': value['scriptId'],
126
134
  };
127
135
  }
128
136
 
@@ -0,0 +1,112 @@
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 ScriptAuditEntry
20
+ */
21
+ export interface ScriptAuditEntry {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ScriptAuditEntry
26
+ */
27
+ actorType: ScriptAuditEntryActorTypeEnum;
28
+ /**
29
+ * What changed, for example created, updated, api-key-rotated or needs-reauthorisation.
30
+ * @type {string}
31
+ * @memberof ScriptAuditEntry
32
+ */
33
+ kind: string;
34
+ /**
35
+ *
36
+ * @type {Date}
37
+ * @memberof ScriptAuditEntry
38
+ */
39
+ modifiedAt: Date;
40
+ /**
41
+ * User who made the change, when actorType is user.
42
+ * @type {number}
43
+ * @memberof ScriptAuditEntry
44
+ */
45
+ modifiedBy?: number;
46
+ /**
47
+ *
48
+ * @type {{ [key: string]: string; }}
49
+ * @memberof ScriptAuditEntry
50
+ */
51
+ params?: { [key: string]: string; };
52
+ }
53
+
54
+
55
+ /**
56
+ * @export
57
+ */
58
+ export const ScriptAuditEntryActorTypeEnum = {
59
+ User: 'user',
60
+ System: 'system',
61
+ Anonymous: 'anonymous'
62
+ } as const;
63
+ export type ScriptAuditEntryActorTypeEnum = typeof ScriptAuditEntryActorTypeEnum[keyof typeof ScriptAuditEntryActorTypeEnum];
64
+
65
+
66
+ /**
67
+ * Check if a given object implements the ScriptAuditEntry interface.
68
+ */
69
+ export function instanceOfScriptAuditEntry(value: object): value is ScriptAuditEntry {
70
+ if (!('actorType' in value) || value['actorType'] === undefined) return false;
71
+ if (!('kind' in value) || value['kind'] === undefined) return false;
72
+ if (!('modifiedAt' in value) || value['modifiedAt'] === undefined) return false;
73
+ return true;
74
+ }
75
+
76
+ export function ScriptAuditEntryFromJSON(json: any): ScriptAuditEntry {
77
+ return ScriptAuditEntryFromJSONTyped(json, false);
78
+ }
79
+
80
+ export function ScriptAuditEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScriptAuditEntry {
81
+ if (json == null) {
82
+ return json;
83
+ }
84
+ return {
85
+
86
+ 'actorType': json['actorType'],
87
+ 'kind': json['kind'],
88
+ 'modifiedAt': (new Date(json['modifiedAt'])),
89
+ 'modifiedBy': json['modifiedBy'] == null ? undefined : json['modifiedBy'],
90
+ 'params': json['params'] == null ? undefined : json['params'],
91
+ };
92
+ }
93
+
94
+ export function ScriptAuditEntryToJSON(json: any): ScriptAuditEntry {
95
+ return ScriptAuditEntryToJSONTyped(json, false);
96
+ }
97
+
98
+ export function ScriptAuditEntryToJSONTyped(value?: ScriptAuditEntry | null, ignoreDiscriminator: boolean = false): any {
99
+ if (value == null) {
100
+ return value;
101
+ }
102
+
103
+ return {
104
+
105
+ 'actorType': value['actorType'],
106
+ 'kind': value['kind'],
107
+ 'modifiedAt': ((value['modifiedAt']).toISOString()),
108
+ 'modifiedBy': value['modifiedBy'],
109
+ 'params': value['params'],
110
+ };
111
+ }
112
+
@@ -0,0 +1,82 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * spaciv API
5
+ * The spaciv API powers workplace planning: modelling how many people an organisation has, how they work, and how much space that requires. ## Getting started 1. Exchange credentials for an access token using one of the operations under **Authentication**. 2. Send that token on every subsequent request as `Authorization: Bearer <token>`. 3. Access tokens are short lived. Call `POST /v1/auth/refresh-token` to obtain a new one before the old one expires. ## Conventions Every operation is versioned under `/v1`. Collections are plural (`GET /v1/dashboards` lists, `POST /v1/dashboards` creates) and individual records live beneath them (`/v1/dashboards/{id}`). Singular paths such as `/v1/account`, `/v1/project` and `/v1/user` refer to the record the access token was issued for. Request and response bodies are JSON. Timestamps are RFC 3339. Identifiers are opaque strings unless documented otherwise, and collection operations return the records visible to the account the token was issued for. Failures return an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem document with a `detail` field describing what went wrong.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@spaciv.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { ScriptAuditEntry } from './ScriptAuditEntry';
17
+ import {
18
+ ScriptAuditEntryFromJSON,
19
+ ScriptAuditEntryFromJSONTyped,
20
+ ScriptAuditEntryToJSON,
21
+ ScriptAuditEntryToJSONTyped,
22
+ } from './ScriptAuditEntry';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface ScriptAuditResBody
28
+ */
29
+ export interface ScriptAuditResBody {
30
+ /**
31
+ *
32
+ * @type {Array<ScriptAuditEntry>}
33
+ * @memberof ScriptAuditResBody
34
+ */
35
+ entries: Array<ScriptAuditEntry>;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof ScriptAuditResBody
40
+ */
41
+ nextCursor?: string;
42
+ }
43
+
44
+ /**
45
+ * Check if a given object implements the ScriptAuditResBody interface.
46
+ */
47
+ export function instanceOfScriptAuditResBody(value: object): value is ScriptAuditResBody {
48
+ if (!('entries' in value) || value['entries'] === undefined) return false;
49
+ return true;
50
+ }
51
+
52
+ export function ScriptAuditResBodyFromJSON(json: any): ScriptAuditResBody {
53
+ return ScriptAuditResBodyFromJSONTyped(json, false);
54
+ }
55
+
56
+ export function ScriptAuditResBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScriptAuditResBody {
57
+ if (json == null) {
58
+ return json;
59
+ }
60
+ return {
61
+
62
+ 'entries': ((json['entries'] as Array<any>).map(ScriptAuditEntryFromJSON)),
63
+ 'nextCursor': json['nextCursor'] == null ? undefined : json['nextCursor'],
64
+ };
65
+ }
66
+
67
+ export function ScriptAuditResBodyToJSON(json: any): ScriptAuditResBody {
68
+ return ScriptAuditResBodyToJSONTyped(json, false);
69
+ }
70
+
71
+ export function ScriptAuditResBodyToJSONTyped(value?: ScriptAuditResBody | null, ignoreDiscriminator: boolean = false): any {
72
+ if (value == null) {
73
+ return value;
74
+ }
75
+
76
+ return {
77
+
78
+ 'entries': ((value['entries'] as Array<any>).map(ScriptAuditEntryToJSON)),
79
+ 'nextCursor': value['nextCursor'],
80
+ };
81
+ }
82
+
@@ -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
+