@spaciv/sdk 0.1.5 → 0.1.6
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.
- package/.openapi-generator/FILES +6 -0
- package/README.md +2 -2
- package/dist/apis/AccountsApi.d.ts +4 -4
- package/dist/apis/AccountsApi.js +2 -2
- package/dist/apis/InternalApi.d.ts +57 -1
- package/dist/apis/InternalApi.js +83 -0
- package/dist/apis/ScriptsApi.d.ts +32 -9
- package/dist/apis/ScriptsApi.js +39 -4
- package/dist/esm/apis/AccountsApi.d.ts +4 -4
- package/dist/esm/apis/AccountsApi.js +2 -2
- package/dist/esm/apis/InternalApi.d.ts +57 -1
- package/dist/esm/apis/InternalApi.js +84 -1
- package/dist/esm/apis/ScriptsApi.d.ts +32 -9
- package/dist/esm/apis/ScriptsApi.js +40 -5
- package/dist/esm/models/AccountCalculationUsageDay.d.ts +6 -0
- package/dist/esm/models/AccountCalculationUsageDay.js +4 -0
- package/dist/esm/models/ScriptLimitOverrides.d.ts +62 -0
- package/dist/esm/models/ScriptLimitOverrides.js +51 -0
- package/dist/esm/models/ScriptLimitValues.d.ts +62 -0
- package/dist/esm/models/ScriptLimitValues.js +63 -0
- package/dist/esm/models/ScriptLimits.d.ts +62 -0
- package/dist/esm/models/ScriptLimits.js +63 -0
- package/dist/esm/models/ScriptLimitsResBody.d.ts +46 -0
- package/dist/esm/models/ScriptLimitsResBody.js +53 -0
- package/dist/esm/models/ScriptUsage.d.ts +50 -0
- package/dist/esm/models/ScriptUsage.js +55 -0
- package/dist/esm/models/ScriptUsageResBody.d.ts +103 -0
- package/dist/esm/models/ScriptUsageResBody.js +93 -0
- package/dist/esm/models/index.d.ts +6 -0
- package/dist/esm/models/index.js +6 -0
- package/dist/models/AccountCalculationUsageDay.d.ts +6 -0
- package/dist/models/AccountCalculationUsageDay.js +4 -0
- package/dist/models/ScriptLimitOverrides.d.ts +62 -0
- package/dist/models/ScriptLimitOverrides.js +58 -0
- package/dist/models/ScriptLimitValues.d.ts +62 -0
- package/dist/models/ScriptLimitValues.js +70 -0
- package/dist/models/ScriptLimits.d.ts +62 -0
- package/dist/models/ScriptLimits.js +70 -0
- package/dist/models/ScriptLimitsResBody.d.ts +46 -0
- package/dist/models/ScriptLimitsResBody.js +60 -0
- package/dist/models/ScriptUsage.d.ts +50 -0
- package/dist/models/ScriptUsage.js +62 -0
- package/dist/models/ScriptUsageResBody.d.ts +103 -0
- package/dist/models/ScriptUsageResBody.js +101 -0
- package/dist/models/index.d.ts +6 -0
- package/dist/models/index.js +6 -0
- package/package.json +1 -1
- package/src/apis/AccountsApi.ts +4 -4
- package/src/apis/InternalApi.ts +152 -0
- package/src/apis/ScriptsApi.ts +65 -8
- package/src/models/AccountCalculationUsageDay.ts +9 -0
- package/src/models/ScriptLimitOverrides.ts +105 -0
- package/src/models/ScriptLimitValues.ts +111 -0
- package/src/models/ScriptLimits.ts +111 -0
- package/src/models/ScriptLimitsResBody.ts +99 -0
- package/src/models/ScriptUsage.ts +93 -0
- package/src/models/ScriptUsageResBody.ts +183 -0
- package/src/models/index.ts +6 -0
|
@@ -0,0 +1,93 @@
|
|
|
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 ScriptUsage
|
|
20
|
+
*/
|
|
21
|
+
export interface ScriptUsage {
|
|
22
|
+
/**
|
|
23
|
+
* Runs that ended in error, timeout or killed.
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @memberof ScriptUsage
|
|
26
|
+
*/
|
|
27
|
+
failedRuns: number;
|
|
28
|
+
/**
|
|
29
|
+
* Runs that did not start because a limit was reached.
|
|
30
|
+
* @type {number}
|
|
31
|
+
* @memberof ScriptUsage
|
|
32
|
+
*/
|
|
33
|
+
quotaExceededRuns: number;
|
|
34
|
+
/**
|
|
35
|
+
* Runs that were not refused by a limit, whatever their outcome, including runs that failed before their sandbox started.
|
|
36
|
+
* @type {number}
|
|
37
|
+
* @memberof ScriptUsage
|
|
38
|
+
*/
|
|
39
|
+
runs: number;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof ScriptUsage
|
|
44
|
+
*/
|
|
45
|
+
scriptId: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Check if a given object implements the ScriptUsage interface.
|
|
50
|
+
*/
|
|
51
|
+
export function instanceOfScriptUsage(value: object): value is ScriptUsage {
|
|
52
|
+
if (!('failedRuns' in value) || value['failedRuns'] === undefined) return false;
|
|
53
|
+
if (!('quotaExceededRuns' in value) || value['quotaExceededRuns'] === undefined) return false;
|
|
54
|
+
if (!('runs' in value) || value['runs'] === undefined) return false;
|
|
55
|
+
if (!('scriptId' in value) || value['scriptId'] === undefined) return false;
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function ScriptUsageFromJSON(json: any): ScriptUsage {
|
|
60
|
+
return ScriptUsageFromJSONTyped(json, false);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function ScriptUsageFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScriptUsage {
|
|
64
|
+
if (json == null) {
|
|
65
|
+
return json;
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
|
|
69
|
+
'failedRuns': json['failedRuns'],
|
|
70
|
+
'quotaExceededRuns': json['quotaExceededRuns'],
|
|
71
|
+
'runs': json['runs'],
|
|
72
|
+
'scriptId': json['scriptId'],
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function ScriptUsageToJSON(json: any): ScriptUsage {
|
|
77
|
+
return ScriptUsageToJSONTyped(json, false);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function ScriptUsageToJSONTyped(value?: ScriptUsage | null, ignoreDiscriminator: boolean = false): any {
|
|
81
|
+
if (value == null) {
|
|
82
|
+
return value;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return {
|
|
86
|
+
|
|
87
|
+
'failedRuns': value['failedRuns'],
|
|
88
|
+
'quotaExceededRuns': value['quotaExceededRuns'],
|
|
89
|
+
'runs': value['runs'],
|
|
90
|
+
'scriptId': value['scriptId'],
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
@@ -0,0 +1,183 @@
|
|
|
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 { ScriptLimits } from './ScriptLimits';
|
|
17
|
+
import {
|
|
18
|
+
ScriptLimitsFromJSON,
|
|
19
|
+
ScriptLimitsFromJSONTyped,
|
|
20
|
+
ScriptLimitsToJSON,
|
|
21
|
+
ScriptLimitsToJSONTyped,
|
|
22
|
+
} from './ScriptLimits';
|
|
23
|
+
import type { ScriptUsage } from './ScriptUsage';
|
|
24
|
+
import {
|
|
25
|
+
ScriptUsageFromJSON,
|
|
26
|
+
ScriptUsageFromJSONTyped,
|
|
27
|
+
ScriptUsageToJSON,
|
|
28
|
+
ScriptUsageToJSONTyped,
|
|
29
|
+
} from './ScriptUsage';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @export
|
|
34
|
+
* @interface ScriptUsageResBody
|
|
35
|
+
*/
|
|
36
|
+
export interface ScriptUsageResBody {
|
|
37
|
+
/**
|
|
38
|
+
* near from 80% of maxCreditsPerMonth; reached once they are used, after which runs are recorded as quota_exceeded until the month ends.
|
|
39
|
+
* @type {string}
|
|
40
|
+
* @memberof ScriptUsageResBody
|
|
41
|
+
*/
|
|
42
|
+
creditState: ScriptUsageResBodyCreditStateEnum;
|
|
43
|
+
/**
|
|
44
|
+
* Credits the account's script runs were charged this month: the scripts figure the account Usage tab shows.
|
|
45
|
+
* @type {number}
|
|
46
|
+
* @memberof ScriptUsageResBody
|
|
47
|
+
*/
|
|
48
|
+
creditsUsed: number;
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @type {number}
|
|
52
|
+
* @memberof ScriptUsageResBody
|
|
53
|
+
*/
|
|
54
|
+
enabledScripts: number;
|
|
55
|
+
/**
|
|
56
|
+
* Runs that ended in error, timeout or killed.
|
|
57
|
+
* @type {number}
|
|
58
|
+
* @memberof ScriptUsageResBody
|
|
59
|
+
*/
|
|
60
|
+
failedRuns: number;
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @type {ScriptLimits}
|
|
64
|
+
* @memberof ScriptUsageResBody
|
|
65
|
+
*/
|
|
66
|
+
limits: ScriptLimits;
|
|
67
|
+
/**
|
|
68
|
+
* The calendar month (UTC) the usage covers.
|
|
69
|
+
* @type {string}
|
|
70
|
+
* @memberof ScriptUsageResBody
|
|
71
|
+
*/
|
|
72
|
+
period: string;
|
|
73
|
+
/**
|
|
74
|
+
*
|
|
75
|
+
* @type {Date}
|
|
76
|
+
* @memberof ScriptUsageResBody
|
|
77
|
+
*/
|
|
78
|
+
periodEnd: Date;
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
* @type {Date}
|
|
82
|
+
* @memberof ScriptUsageResBody
|
|
83
|
+
*/
|
|
84
|
+
periodStart: Date;
|
|
85
|
+
/**
|
|
86
|
+
* Runs that did not start because a limit was reached.
|
|
87
|
+
* @type {number}
|
|
88
|
+
* @memberof ScriptUsageResBody
|
|
89
|
+
*/
|
|
90
|
+
quotaExceededRuns: number;
|
|
91
|
+
/**
|
|
92
|
+
* Runs that were not refused by a limit, whatever their outcome, including runs that failed before their sandbox started.
|
|
93
|
+
* @type {number}
|
|
94
|
+
* @memberof ScriptUsageResBody
|
|
95
|
+
*/
|
|
96
|
+
runs: number;
|
|
97
|
+
/**
|
|
98
|
+
* Usage of each script that has run this month, deleted scripts included, sorted by scriptId.
|
|
99
|
+
* @type {Array<ScriptUsage>}
|
|
100
|
+
* @memberof ScriptUsageResBody
|
|
101
|
+
*/
|
|
102
|
+
scripts: Array<ScriptUsage>;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @export
|
|
108
|
+
*/
|
|
109
|
+
export const ScriptUsageResBodyCreditStateEnum = {
|
|
110
|
+
Ok: 'ok',
|
|
111
|
+
Near: 'near',
|
|
112
|
+
Reached: 'reached'
|
|
113
|
+
} as const;
|
|
114
|
+
export type ScriptUsageResBodyCreditStateEnum = typeof ScriptUsageResBodyCreditStateEnum[keyof typeof ScriptUsageResBodyCreditStateEnum];
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Check if a given object implements the ScriptUsageResBody interface.
|
|
119
|
+
*/
|
|
120
|
+
export function instanceOfScriptUsageResBody(value: object): value is ScriptUsageResBody {
|
|
121
|
+
if (!('creditState' in value) || value['creditState'] === undefined) return false;
|
|
122
|
+
if (!('creditsUsed' in value) || value['creditsUsed'] === undefined) return false;
|
|
123
|
+
if (!('enabledScripts' in value) || value['enabledScripts'] === undefined) return false;
|
|
124
|
+
if (!('failedRuns' in value) || value['failedRuns'] === undefined) return false;
|
|
125
|
+
if (!('limits' in value) || value['limits'] === undefined) return false;
|
|
126
|
+
if (!('period' in value) || value['period'] === undefined) return false;
|
|
127
|
+
if (!('periodEnd' in value) || value['periodEnd'] === undefined) return false;
|
|
128
|
+
if (!('periodStart' in value) || value['periodStart'] === undefined) return false;
|
|
129
|
+
if (!('quotaExceededRuns' in value) || value['quotaExceededRuns'] === undefined) return false;
|
|
130
|
+
if (!('runs' in value) || value['runs'] === undefined) return false;
|
|
131
|
+
if (!('scripts' in value) || value['scripts'] === undefined) return false;
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export function ScriptUsageResBodyFromJSON(json: any): ScriptUsageResBody {
|
|
136
|
+
return ScriptUsageResBodyFromJSONTyped(json, false);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function ScriptUsageResBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScriptUsageResBody {
|
|
140
|
+
if (json == null) {
|
|
141
|
+
return json;
|
|
142
|
+
}
|
|
143
|
+
return {
|
|
144
|
+
|
|
145
|
+
'creditState': json['creditState'],
|
|
146
|
+
'creditsUsed': json['creditsUsed'],
|
|
147
|
+
'enabledScripts': json['enabledScripts'],
|
|
148
|
+
'failedRuns': json['failedRuns'],
|
|
149
|
+
'limits': ScriptLimitsFromJSON(json['limits']),
|
|
150
|
+
'period': json['period'],
|
|
151
|
+
'periodEnd': (new Date(json['periodEnd'])),
|
|
152
|
+
'periodStart': (new Date(json['periodStart'])),
|
|
153
|
+
'quotaExceededRuns': json['quotaExceededRuns'],
|
|
154
|
+
'runs': json['runs'],
|
|
155
|
+
'scripts': ((json['scripts'] as Array<any>).map(ScriptUsageFromJSON)),
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export function ScriptUsageResBodyToJSON(json: any): ScriptUsageResBody {
|
|
160
|
+
return ScriptUsageResBodyToJSONTyped(json, false);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export function ScriptUsageResBodyToJSONTyped(value?: ScriptUsageResBody | null, ignoreDiscriminator: boolean = false): any {
|
|
164
|
+
if (value == null) {
|
|
165
|
+
return value;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return {
|
|
169
|
+
|
|
170
|
+
'creditState': value['creditState'],
|
|
171
|
+
'creditsUsed': value['creditsUsed'],
|
|
172
|
+
'enabledScripts': value['enabledScripts'],
|
|
173
|
+
'failedRuns': value['failedRuns'],
|
|
174
|
+
'limits': ScriptLimitsToJSON(value['limits']),
|
|
175
|
+
'period': value['period'],
|
|
176
|
+
'periodEnd': ((value['periodEnd']).toISOString()),
|
|
177
|
+
'periodStart': ((value['periodStart']).toISOString()),
|
|
178
|
+
'quotaExceededRuns': value['quotaExceededRuns'],
|
|
179
|
+
'runs': value['runs'],
|
|
180
|
+
'scripts': ((value['scripts'] as Array<any>).map(ScriptUsageToJSON)),
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
package/src/models/index.ts
CHANGED
|
@@ -301,6 +301,10 @@ export * from './ScriptExport';
|
|
|
301
301
|
export * from './ScriptExportResBody';
|
|
302
302
|
export * from './ScriptExportRun';
|
|
303
303
|
export * from './ScriptKey';
|
|
304
|
+
export * from './ScriptLimitOverrides';
|
|
305
|
+
export * from './ScriptLimitValues';
|
|
306
|
+
export * from './ScriptLimits';
|
|
307
|
+
export * from './ScriptLimitsResBody';
|
|
304
308
|
export * from './ScriptListResBody';
|
|
305
309
|
export * from './ScriptLogLine';
|
|
306
310
|
export * from './ScriptPatchReqBody';
|
|
@@ -315,6 +319,8 @@ export * from './ScriptSchedulePreviewResBody';
|
|
|
315
319
|
export * from './ScriptSecretsReqBody';
|
|
316
320
|
export * from './ScriptSecretsResBody';
|
|
317
321
|
export * from './ScriptSummary';
|
|
322
|
+
export * from './ScriptUsage';
|
|
323
|
+
export * from './ScriptUsageResBody';
|
|
318
324
|
export * from './ScriptWebhookResBody';
|
|
319
325
|
export * from './SendPasswordPutReqBody';
|
|
320
326
|
export * from './SerializedEvent';
|