@spaciv/sdk 0.1.4 → 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.
Files changed (68) hide show
  1. package/.openapi-generator/FILES +6 -0
  2. package/README.md +2 -2
  3. package/dist/apis/AccountsApi.d.ts +4 -4
  4. package/dist/apis/AccountsApi.js +2 -2
  5. package/dist/apis/InternalApi.d.ts +57 -1
  6. package/dist/apis/InternalApi.js +83 -0
  7. package/dist/apis/ScriptsApi.d.ts +32 -9
  8. package/dist/apis/ScriptsApi.js +39 -4
  9. package/dist/esm/apis/AccountsApi.d.ts +4 -4
  10. package/dist/esm/apis/AccountsApi.js +2 -2
  11. package/dist/esm/apis/InternalApi.d.ts +57 -1
  12. package/dist/esm/apis/InternalApi.js +84 -1
  13. package/dist/esm/apis/ScriptsApi.d.ts +32 -9
  14. package/dist/esm/apis/ScriptsApi.js +40 -5
  15. package/dist/esm/models/AccountCalculationUsageDay.d.ts +6 -0
  16. package/dist/esm/models/AccountCalculationUsageDay.js +4 -0
  17. package/dist/esm/models/AssistantChatPollBody.d.ts +6 -0
  18. package/dist/esm/models/AssistantChatPollBody.js +4 -0
  19. package/dist/esm/models/AssistantChatPollMessage.d.ts +6 -0
  20. package/dist/esm/models/AssistantChatPollMessage.js +4 -0
  21. package/dist/esm/models/ScriptLimitOverrides.d.ts +62 -0
  22. package/dist/esm/models/ScriptLimitOverrides.js +51 -0
  23. package/dist/esm/models/ScriptLimitValues.d.ts +62 -0
  24. package/dist/esm/models/ScriptLimitValues.js +63 -0
  25. package/dist/esm/models/ScriptLimits.d.ts +62 -0
  26. package/dist/esm/models/ScriptLimits.js +63 -0
  27. package/dist/esm/models/ScriptLimitsResBody.d.ts +46 -0
  28. package/dist/esm/models/ScriptLimitsResBody.js +53 -0
  29. package/dist/esm/models/ScriptUsage.d.ts +50 -0
  30. package/dist/esm/models/ScriptUsage.js +55 -0
  31. package/dist/esm/models/ScriptUsageResBody.d.ts +103 -0
  32. package/dist/esm/models/ScriptUsageResBody.js +93 -0
  33. package/dist/esm/models/index.d.ts +6 -0
  34. package/dist/esm/models/index.js +6 -0
  35. package/dist/models/AccountCalculationUsageDay.d.ts +6 -0
  36. package/dist/models/AccountCalculationUsageDay.js +4 -0
  37. package/dist/models/AssistantChatPollBody.d.ts +6 -0
  38. package/dist/models/AssistantChatPollBody.js +4 -0
  39. package/dist/models/AssistantChatPollMessage.d.ts +6 -0
  40. package/dist/models/AssistantChatPollMessage.js +4 -0
  41. package/dist/models/ScriptLimitOverrides.d.ts +62 -0
  42. package/dist/models/ScriptLimitOverrides.js +58 -0
  43. package/dist/models/ScriptLimitValues.d.ts +62 -0
  44. package/dist/models/ScriptLimitValues.js +70 -0
  45. package/dist/models/ScriptLimits.d.ts +62 -0
  46. package/dist/models/ScriptLimits.js +70 -0
  47. package/dist/models/ScriptLimitsResBody.d.ts +46 -0
  48. package/dist/models/ScriptLimitsResBody.js +60 -0
  49. package/dist/models/ScriptUsage.d.ts +50 -0
  50. package/dist/models/ScriptUsage.js +62 -0
  51. package/dist/models/ScriptUsageResBody.d.ts +103 -0
  52. package/dist/models/ScriptUsageResBody.js +101 -0
  53. package/dist/models/index.d.ts +6 -0
  54. package/dist/models/index.js +6 -0
  55. package/package.json +1 -1
  56. package/src/apis/AccountsApi.ts +4 -4
  57. package/src/apis/InternalApi.ts +152 -0
  58. package/src/apis/ScriptsApi.ts +65 -8
  59. package/src/models/AccountCalculationUsageDay.ts +9 -0
  60. package/src/models/AssistantChatPollBody.ts +9 -0
  61. package/src/models/AssistantChatPollMessage.ts +9 -0
  62. package/src/models/ScriptLimitOverrides.ts +105 -0
  63. package/src/models/ScriptLimitValues.ts +111 -0
  64. package/src/models/ScriptLimits.ts +111 -0
  65. package/src/models/ScriptLimitsResBody.ts +99 -0
  66. package/src/models/ScriptUsage.ts +93 -0
  67. package/src/models/ScriptUsageResBody.ts +183 -0
  68. package/src/models/index.ts +6 -0
@@ -0,0 +1,46 @@
1
+ /**
2
+ * spaciv API
3
+ * 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.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@spaciv.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { ScriptLimitValues } from './ScriptLimitValues';
13
+ import type { ScriptLimitOverrides } from './ScriptLimitOverrides';
14
+ /**
15
+ *
16
+ * @export
17
+ * @interface ScriptLimitsResBody
18
+ */
19
+ export interface ScriptLimitsResBody {
20
+ /**
21
+ * The code defaults for scripts.
22
+ * @type {ScriptLimitValues}
23
+ * @memberof ScriptLimitsResBody
24
+ */
25
+ defaults: ScriptLimitValues;
26
+ /**
27
+ * The limits that apply to the account.
28
+ * @type {ScriptLimitValues}
29
+ * @memberof ScriptLimitsResBody
30
+ */
31
+ effective: ScriptLimitValues;
32
+ /**
33
+ * This account's overrides; an absent field uses the default.
34
+ * @type {ScriptLimitOverrides}
35
+ * @memberof ScriptLimitsResBody
36
+ */
37
+ overrides: ScriptLimitOverrides;
38
+ }
39
+ /**
40
+ * Check if a given object implements the ScriptLimitsResBody interface.
41
+ */
42
+ export declare function instanceOfScriptLimitsResBody(value: object): value is ScriptLimitsResBody;
43
+ export declare function ScriptLimitsResBodyFromJSON(json: any): ScriptLimitsResBody;
44
+ export declare function ScriptLimitsResBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScriptLimitsResBody;
45
+ export declare function ScriptLimitsResBodyToJSON(json: any): ScriptLimitsResBody;
46
+ export declare function ScriptLimitsResBodyToJSONTyped(value?: ScriptLimitsResBody | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * spaciv API
6
+ * 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.
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: support@spaciv.com
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfScriptLimitsResBody = instanceOfScriptLimitsResBody;
17
+ exports.ScriptLimitsResBodyFromJSON = ScriptLimitsResBodyFromJSON;
18
+ exports.ScriptLimitsResBodyFromJSONTyped = ScriptLimitsResBodyFromJSONTyped;
19
+ exports.ScriptLimitsResBodyToJSON = ScriptLimitsResBodyToJSON;
20
+ exports.ScriptLimitsResBodyToJSONTyped = ScriptLimitsResBodyToJSONTyped;
21
+ const ScriptLimitValues_1 = require("./ScriptLimitValues");
22
+ const ScriptLimitOverrides_1 = require("./ScriptLimitOverrides");
23
+ /**
24
+ * Check if a given object implements the ScriptLimitsResBody interface.
25
+ */
26
+ function instanceOfScriptLimitsResBody(value) {
27
+ if (!('defaults' in value) || value['defaults'] === undefined)
28
+ return false;
29
+ if (!('effective' in value) || value['effective'] === undefined)
30
+ return false;
31
+ if (!('overrides' in value) || value['overrides'] === undefined)
32
+ return false;
33
+ return true;
34
+ }
35
+ function ScriptLimitsResBodyFromJSON(json) {
36
+ return ScriptLimitsResBodyFromJSONTyped(json, false);
37
+ }
38
+ function ScriptLimitsResBodyFromJSONTyped(json, ignoreDiscriminator) {
39
+ if (json == null) {
40
+ return json;
41
+ }
42
+ return {
43
+ 'defaults': (0, ScriptLimitValues_1.ScriptLimitValuesFromJSON)(json['defaults']),
44
+ 'effective': (0, ScriptLimitValues_1.ScriptLimitValuesFromJSON)(json['effective']),
45
+ 'overrides': (0, ScriptLimitOverrides_1.ScriptLimitOverridesFromJSON)(json['overrides']),
46
+ };
47
+ }
48
+ function ScriptLimitsResBodyToJSON(json) {
49
+ return ScriptLimitsResBodyToJSONTyped(json, false);
50
+ }
51
+ function ScriptLimitsResBodyToJSONTyped(value, ignoreDiscriminator = false) {
52
+ if (value == null) {
53
+ return value;
54
+ }
55
+ return {
56
+ 'defaults': (0, ScriptLimitValues_1.ScriptLimitValuesToJSON)(value['defaults']),
57
+ 'effective': (0, ScriptLimitValues_1.ScriptLimitValuesToJSON)(value['effective']),
58
+ 'overrides': (0, ScriptLimitOverrides_1.ScriptLimitOverridesToJSON)(value['overrides']),
59
+ };
60
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * spaciv API
3
+ * 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.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@spaciv.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface ScriptUsage
16
+ */
17
+ export interface ScriptUsage {
18
+ /**
19
+ * Runs that ended in error, timeout or killed.
20
+ * @type {number}
21
+ * @memberof ScriptUsage
22
+ */
23
+ failedRuns: number;
24
+ /**
25
+ * Runs that did not start because a limit was reached.
26
+ * @type {number}
27
+ * @memberof ScriptUsage
28
+ */
29
+ quotaExceededRuns: number;
30
+ /**
31
+ * Runs that were not refused by a limit, whatever their outcome, including runs that failed before their sandbox started.
32
+ * @type {number}
33
+ * @memberof ScriptUsage
34
+ */
35
+ runs: number;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof ScriptUsage
40
+ */
41
+ scriptId: string;
42
+ }
43
+ /**
44
+ * Check if a given object implements the ScriptUsage interface.
45
+ */
46
+ export declare function instanceOfScriptUsage(value: object): value is ScriptUsage;
47
+ export declare function ScriptUsageFromJSON(json: any): ScriptUsage;
48
+ export declare function ScriptUsageFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScriptUsage;
49
+ export declare function ScriptUsageToJSON(json: any): ScriptUsage;
50
+ export declare function ScriptUsageToJSONTyped(value?: ScriptUsage | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * spaciv API
6
+ * 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.
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: support@spaciv.com
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfScriptUsage = instanceOfScriptUsage;
17
+ exports.ScriptUsageFromJSON = ScriptUsageFromJSON;
18
+ exports.ScriptUsageFromJSONTyped = ScriptUsageFromJSONTyped;
19
+ exports.ScriptUsageToJSON = ScriptUsageToJSON;
20
+ exports.ScriptUsageToJSONTyped = ScriptUsageToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the ScriptUsage interface.
23
+ */
24
+ function instanceOfScriptUsage(value) {
25
+ if (!('failedRuns' in value) || value['failedRuns'] === undefined)
26
+ return false;
27
+ if (!('quotaExceededRuns' in value) || value['quotaExceededRuns'] === undefined)
28
+ return false;
29
+ if (!('runs' in value) || value['runs'] === undefined)
30
+ return false;
31
+ if (!('scriptId' in value) || value['scriptId'] === undefined)
32
+ return false;
33
+ return true;
34
+ }
35
+ function ScriptUsageFromJSON(json) {
36
+ return ScriptUsageFromJSONTyped(json, false);
37
+ }
38
+ function ScriptUsageFromJSONTyped(json, ignoreDiscriminator) {
39
+ if (json == null) {
40
+ return json;
41
+ }
42
+ return {
43
+ 'failedRuns': json['failedRuns'],
44
+ 'quotaExceededRuns': json['quotaExceededRuns'],
45
+ 'runs': json['runs'],
46
+ 'scriptId': json['scriptId'],
47
+ };
48
+ }
49
+ function ScriptUsageToJSON(json) {
50
+ return ScriptUsageToJSONTyped(json, false);
51
+ }
52
+ function ScriptUsageToJSONTyped(value, ignoreDiscriminator = false) {
53
+ if (value == null) {
54
+ return value;
55
+ }
56
+ return {
57
+ 'failedRuns': value['failedRuns'],
58
+ 'quotaExceededRuns': value['quotaExceededRuns'],
59
+ 'runs': value['runs'],
60
+ 'scriptId': value['scriptId'],
61
+ };
62
+ }
@@ -0,0 +1,103 @@
1
+ /**
2
+ * spaciv API
3
+ * 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.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@spaciv.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { ScriptLimits } from './ScriptLimits';
13
+ import type { ScriptUsage } from './ScriptUsage';
14
+ /**
15
+ *
16
+ * @export
17
+ * @interface ScriptUsageResBody
18
+ */
19
+ export interface ScriptUsageResBody {
20
+ /**
21
+ * near from 80% of maxCreditsPerMonth; reached once they are used, after which runs are recorded as quota_exceeded until the month ends.
22
+ * @type {string}
23
+ * @memberof ScriptUsageResBody
24
+ */
25
+ creditState: ScriptUsageResBodyCreditStateEnum;
26
+ /**
27
+ * Credits the account's script runs were charged this month: the scripts figure the account Usage tab shows.
28
+ * @type {number}
29
+ * @memberof ScriptUsageResBody
30
+ */
31
+ creditsUsed: number;
32
+ /**
33
+ *
34
+ * @type {number}
35
+ * @memberof ScriptUsageResBody
36
+ */
37
+ enabledScripts: number;
38
+ /**
39
+ * Runs that ended in error, timeout or killed.
40
+ * @type {number}
41
+ * @memberof ScriptUsageResBody
42
+ */
43
+ failedRuns: number;
44
+ /**
45
+ *
46
+ * @type {ScriptLimits}
47
+ * @memberof ScriptUsageResBody
48
+ */
49
+ limits: ScriptLimits;
50
+ /**
51
+ * The calendar month (UTC) the usage covers.
52
+ * @type {string}
53
+ * @memberof ScriptUsageResBody
54
+ */
55
+ period: string;
56
+ /**
57
+ *
58
+ * @type {Date}
59
+ * @memberof ScriptUsageResBody
60
+ */
61
+ periodEnd: Date;
62
+ /**
63
+ *
64
+ * @type {Date}
65
+ * @memberof ScriptUsageResBody
66
+ */
67
+ periodStart: Date;
68
+ /**
69
+ * Runs that did not start because a limit was reached.
70
+ * @type {number}
71
+ * @memberof ScriptUsageResBody
72
+ */
73
+ quotaExceededRuns: number;
74
+ /**
75
+ * Runs that were not refused by a limit, whatever their outcome, including runs that failed before their sandbox started.
76
+ * @type {number}
77
+ * @memberof ScriptUsageResBody
78
+ */
79
+ runs: number;
80
+ /**
81
+ * Usage of each script that has run this month, deleted scripts included, sorted by scriptId.
82
+ * @type {Array<ScriptUsage>}
83
+ * @memberof ScriptUsageResBody
84
+ */
85
+ scripts: Array<ScriptUsage>;
86
+ }
87
+ /**
88
+ * @export
89
+ */
90
+ export declare const ScriptUsageResBodyCreditStateEnum: {
91
+ readonly Ok: "ok";
92
+ readonly Near: "near";
93
+ readonly Reached: "reached";
94
+ };
95
+ export type ScriptUsageResBodyCreditStateEnum = typeof ScriptUsageResBodyCreditStateEnum[keyof typeof ScriptUsageResBodyCreditStateEnum];
96
+ /**
97
+ * Check if a given object implements the ScriptUsageResBody interface.
98
+ */
99
+ export declare function instanceOfScriptUsageResBody(value: object): value is ScriptUsageResBody;
100
+ export declare function ScriptUsageResBodyFromJSON(json: any): ScriptUsageResBody;
101
+ export declare function ScriptUsageResBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScriptUsageResBody;
102
+ export declare function ScriptUsageResBodyToJSON(json: any): ScriptUsageResBody;
103
+ export declare function ScriptUsageResBodyToJSONTyped(value?: ScriptUsageResBody | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * spaciv API
6
+ * 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.
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: support@spaciv.com
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.ScriptUsageResBodyCreditStateEnum = void 0;
17
+ exports.instanceOfScriptUsageResBody = instanceOfScriptUsageResBody;
18
+ exports.ScriptUsageResBodyFromJSON = ScriptUsageResBodyFromJSON;
19
+ exports.ScriptUsageResBodyFromJSONTyped = ScriptUsageResBodyFromJSONTyped;
20
+ exports.ScriptUsageResBodyToJSON = ScriptUsageResBodyToJSON;
21
+ exports.ScriptUsageResBodyToJSONTyped = ScriptUsageResBodyToJSONTyped;
22
+ const ScriptLimits_1 = require("./ScriptLimits");
23
+ const ScriptUsage_1 = require("./ScriptUsage");
24
+ /**
25
+ * @export
26
+ */
27
+ exports.ScriptUsageResBodyCreditStateEnum = {
28
+ Ok: 'ok',
29
+ Near: 'near',
30
+ Reached: 'reached'
31
+ };
32
+ /**
33
+ * Check if a given object implements the ScriptUsageResBody interface.
34
+ */
35
+ function instanceOfScriptUsageResBody(value) {
36
+ if (!('creditState' in value) || value['creditState'] === undefined)
37
+ return false;
38
+ if (!('creditsUsed' in value) || value['creditsUsed'] === undefined)
39
+ return false;
40
+ if (!('enabledScripts' in value) || value['enabledScripts'] === undefined)
41
+ return false;
42
+ if (!('failedRuns' in value) || value['failedRuns'] === undefined)
43
+ return false;
44
+ if (!('limits' in value) || value['limits'] === undefined)
45
+ return false;
46
+ if (!('period' in value) || value['period'] === undefined)
47
+ return false;
48
+ if (!('periodEnd' in value) || value['periodEnd'] === undefined)
49
+ return false;
50
+ if (!('periodStart' in value) || value['periodStart'] === undefined)
51
+ return false;
52
+ if (!('quotaExceededRuns' in value) || value['quotaExceededRuns'] === undefined)
53
+ return false;
54
+ if (!('runs' in value) || value['runs'] === undefined)
55
+ return false;
56
+ if (!('scripts' in value) || value['scripts'] === undefined)
57
+ return false;
58
+ return true;
59
+ }
60
+ function ScriptUsageResBodyFromJSON(json) {
61
+ return ScriptUsageResBodyFromJSONTyped(json, false);
62
+ }
63
+ function ScriptUsageResBodyFromJSONTyped(json, ignoreDiscriminator) {
64
+ if (json == null) {
65
+ return json;
66
+ }
67
+ return {
68
+ 'creditState': json['creditState'],
69
+ 'creditsUsed': json['creditsUsed'],
70
+ 'enabledScripts': json['enabledScripts'],
71
+ 'failedRuns': json['failedRuns'],
72
+ 'limits': (0, ScriptLimits_1.ScriptLimitsFromJSON)(json['limits']),
73
+ 'period': json['period'],
74
+ 'periodEnd': (new Date(json['periodEnd'])),
75
+ 'periodStart': (new Date(json['periodStart'])),
76
+ 'quotaExceededRuns': json['quotaExceededRuns'],
77
+ 'runs': json['runs'],
78
+ 'scripts': (json['scripts'].map(ScriptUsage_1.ScriptUsageFromJSON)),
79
+ };
80
+ }
81
+ function ScriptUsageResBodyToJSON(json) {
82
+ return ScriptUsageResBodyToJSONTyped(json, false);
83
+ }
84
+ function ScriptUsageResBodyToJSONTyped(value, ignoreDiscriminator = false) {
85
+ if (value == null) {
86
+ return value;
87
+ }
88
+ return {
89
+ 'creditState': value['creditState'],
90
+ 'creditsUsed': value['creditsUsed'],
91
+ 'enabledScripts': value['enabledScripts'],
92
+ 'failedRuns': value['failedRuns'],
93
+ 'limits': (0, ScriptLimits_1.ScriptLimitsToJSON)(value['limits']),
94
+ 'period': value['period'],
95
+ 'periodEnd': ((value['periodEnd']).toISOString()),
96
+ 'periodStart': ((value['periodStart']).toISOString()),
97
+ 'quotaExceededRuns': value['quotaExceededRuns'],
98
+ 'runs': value['runs'],
99
+ 'scripts': (value['scripts'].map(ScriptUsage_1.ScriptUsageToJSON)),
100
+ };
101
+ }
@@ -299,6 +299,10 @@ export * from './ScriptExport';
299
299
  export * from './ScriptExportResBody';
300
300
  export * from './ScriptExportRun';
301
301
  export * from './ScriptKey';
302
+ export * from './ScriptLimitOverrides';
303
+ export * from './ScriptLimitValues';
304
+ export * from './ScriptLimits';
305
+ export * from './ScriptLimitsResBody';
302
306
  export * from './ScriptListResBody';
303
307
  export * from './ScriptLogLine';
304
308
  export * from './ScriptPatchReqBody';
@@ -313,6 +317,8 @@ export * from './ScriptSchedulePreviewResBody';
313
317
  export * from './ScriptSecretsReqBody';
314
318
  export * from './ScriptSecretsResBody';
315
319
  export * from './ScriptSummary';
320
+ export * from './ScriptUsage';
321
+ export * from './ScriptUsageResBody';
316
322
  export * from './ScriptWebhookResBody';
317
323
  export * from './SendPasswordPutReqBody';
318
324
  export * from './SerializedEvent';
@@ -317,6 +317,10 @@ __exportStar(require("./ScriptExport"), exports);
317
317
  __exportStar(require("./ScriptExportResBody"), exports);
318
318
  __exportStar(require("./ScriptExportRun"), exports);
319
319
  __exportStar(require("./ScriptKey"), exports);
320
+ __exportStar(require("./ScriptLimitOverrides"), exports);
321
+ __exportStar(require("./ScriptLimitValues"), exports);
322
+ __exportStar(require("./ScriptLimits"), exports);
323
+ __exportStar(require("./ScriptLimitsResBody"), exports);
320
324
  __exportStar(require("./ScriptListResBody"), exports);
321
325
  __exportStar(require("./ScriptLogLine"), exports);
322
326
  __exportStar(require("./ScriptPatchReqBody"), exports);
@@ -331,6 +335,8 @@ __exportStar(require("./ScriptSchedulePreviewResBody"), exports);
331
335
  __exportStar(require("./ScriptSecretsReqBody"), exports);
332
336
  __exportStar(require("./ScriptSecretsResBody"), exports);
333
337
  __exportStar(require("./ScriptSummary"), exports);
338
+ __exportStar(require("./ScriptUsage"), exports);
339
+ __exportStar(require("./ScriptUsageResBody"), exports);
334
340
  __exportStar(require("./ScriptWebhookResBody"), exports);
335
341
  __exportStar(require("./SendPasswordPutReqBody"), exports);
336
342
  __exportStar(require("./SerializedEvent"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spaciv/sdk",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "OpenAPI client for @spaciv/sdk",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -312,7 +312,7 @@ export interface AccountsApiInterface {
312
312
  listAuthOptions(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AccountGetAuthOptionsResBody>;
313
313
 
314
314
  /**
315
- * Returns the credits the account used on each of the last `days` days, split into building layer data, aggregating it and the AI assistant. A piece of calculation work is charged once however many times it is computed, and a result already cached costs nothing. Credits are the same unit the rest of the account\'s usage is counted in. Requires the *Manage my account* permission. Returns `500` if the usage cannot be read.
315
+ * Returns the credits the account used on each of the last `days` days, split into building layer data, aggregating it, the AI assistant and running scripts. A piece of calculation work is charged once however many times it is computed, and a result already cached costs nothing. A script run is charged once, when it ends. Credits are the same unit the rest of the account\'s usage is counted in. Requires the *Manage my account* permission. Returns `500` if the usage cannot be read.
316
316
  * @summary Get the account\'s credit usage
317
317
  * @param {30 | 90 | 365} [days] How many days of usage to return, ending today (UTC).
318
318
  * @param {*} [options] Override http request option.
@@ -322,7 +322,7 @@ export interface AccountsApiInterface {
322
322
  listUsageCalculationCreditsRaw(requestParameters: AccountsApiListUsageCalculationCreditsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AccountCalculationUsageBody>>;
323
323
 
324
324
  /**
325
- * Returns the credits the account used on each of the last `days` days, split into building layer data, aggregating it and the AI assistant. A piece of calculation work is charged once however many times it is computed, and a result already cached costs nothing. Credits are the same unit the rest of the account\'s usage is counted in. Requires the *Manage my account* permission. Returns `500` if the usage cannot be read.
325
+ * Returns the credits the account used on each of the last `days` days, split into building layer data, aggregating it, the AI assistant and running scripts. A piece of calculation work is charged once however many times it is computed, and a result already cached costs nothing. A script run is charged once, when it ends. Credits are the same unit the rest of the account\'s usage is counted in. Requires the *Manage my account* permission. Returns `500` if the usage cannot be read.
326
326
  * Get the account\'s credit usage
327
327
  */
328
328
  listUsageCalculationCredits(requestParameters: AccountsApiListUsageCalculationCreditsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AccountCalculationUsageBody>;
@@ -939,7 +939,7 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface
939
939
  }
940
940
 
941
941
  /**
942
- * Returns the credits the account used on each of the last `days` days, split into building layer data, aggregating it and the AI assistant. A piece of calculation work is charged once however many times it is computed, and a result already cached costs nothing. Credits are the same unit the rest of the account\'s usage is counted in. Requires the *Manage my account* permission. Returns `500` if the usage cannot be read.
942
+ * Returns the credits the account used on each of the last `days` days, split into building layer data, aggregating it, the AI assistant and running scripts. A piece of calculation work is charged once however many times it is computed, and a result already cached costs nothing. A script run is charged once, when it ends. Credits are the same unit the rest of the account\'s usage is counted in. Requires the *Manage my account* permission. Returns `500` if the usage cannot be read.
943
943
  * Get the account\'s credit usage
944
944
  */
945
945
  async listUsageCalculationCreditsRaw(requestParameters: AccountsApiListUsageCalculationCreditsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AccountCalculationUsageBody>> {
@@ -973,7 +973,7 @@ export class AccountsApi extends runtime.BaseAPI implements AccountsApiInterface
973
973
  }
974
974
 
975
975
  /**
976
- * Returns the credits the account used on each of the last `days` days, split into building layer data, aggregating it and the AI assistant. A piece of calculation work is charged once however many times it is computed, and a result already cached costs nothing. Credits are the same unit the rest of the account\'s usage is counted in. Requires the *Manage my account* permission. Returns `500` if the usage cannot be read.
976
+ * Returns the credits the account used on each of the last `days` days, split into building layer data, aggregating it, the AI assistant and running scripts. A piece of calculation work is charged once however many times it is computed, and a result already cached costs nothing. A script run is charged once, when it ends. Credits are the same unit the rest of the account\'s usage is counted in. Requires the *Manage my account* permission. Returns `500` if the usage cannot be read.
977
977
  * Get the account\'s credit usage
978
978
  */
979
979
  async listUsageCalculationCredits(requestParameters: AccountsApiListUsageCalculationCreditsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AccountCalculationUsageBody> {