@stack-spot/portal-network 0.67.0 → 0.68.1
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/CHANGELOG.md +14 -0
- package/dist/api/cloudPlatformHorizon.d.ts +107 -2
- package/dist/api/cloudPlatformHorizon.d.ts.map +1 -1
- package/dist/api/cloudPlatformHorizon.js +24 -0
- package/dist/api/cloudPlatformHorizon.js.map +1 -1
- package/dist/client/cloud-platform-horizon.d.ts +16 -0
- package/dist/client/cloud-platform-horizon.d.ts.map +1 -1
- package/dist/client/cloud-platform-horizon.js +28 -1
- package/dist/client/cloud-platform-horizon.js.map +1 -1
- package/package.json +1 -1
- package/src/api/cloudPlatformHorizon.ts +214 -4
- package/src/client/cloud-platform-horizon.ts +13 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.68.1](https://github.com/stack-spot/portal-commons/compare/portal-network@v0.68.0...portal-network@v0.68.1) (2024-12-27)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* update swagger ([4c66352](https://github.com/stack-spot/portal-commons/commit/4c663526a5d6f43b3c065f3ac57ff898a0eab343))
|
|
9
|
+
|
|
10
|
+
## [0.68.0](https://github.com/stack-spot/portal-commons/compare/portal-network@v0.67.0...portal-network@v0.68.0) (2024-12-27)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add queries in horizon client ([36c9444](https://github.com/stack-spot/portal-commons/commit/36c9444e08ebb6cb9f9d688afb3dca3397e3e702))
|
|
16
|
+
|
|
3
17
|
## [0.67.0](https://github.com/stack-spot/portal-commons/compare/portal-network@v0.66.0...portal-network@v0.67.0) (2024-12-27)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -10,10 +10,10 @@ export declare const servers: {
|
|
|
10
10
|
generatedServerUrl: string;
|
|
11
11
|
};
|
|
12
12
|
export type ManifestoResource = {
|
|
13
|
-
|
|
13
|
+
apiVersion: string;
|
|
14
14
|
kind: string;
|
|
15
15
|
metadata: {
|
|
16
|
-
[key: string]:
|
|
16
|
+
[key: string]: object;
|
|
17
17
|
};
|
|
18
18
|
spec: {
|
|
19
19
|
[key: string]: object;
|
|
@@ -31,10 +31,115 @@ export type ErrorBody = {
|
|
|
31
31
|
validationDetails: ValidationDetails[];
|
|
32
32
|
};
|
|
33
33
|
export type StatusType = number;
|
|
34
|
+
export type NameValuePair = {
|
|
35
|
+
name: string;
|
|
36
|
+
value: string;
|
|
37
|
+
};
|
|
38
|
+
export type Metadata = {
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
tags: NameValuePair[];
|
|
42
|
+
labels: NameValuePair[];
|
|
43
|
+
};
|
|
44
|
+
export type Runtime = {
|
|
45
|
+
name: string;
|
|
46
|
+
id: string;
|
|
47
|
+
"kube-version": string;
|
|
48
|
+
status: string;
|
|
49
|
+
tags: NameValuePair[];
|
|
50
|
+
labels: NameValuePair[];
|
|
51
|
+
};
|
|
52
|
+
export type ControlPlaneStatus = {
|
|
53
|
+
health: string;
|
|
54
|
+
control: string;
|
|
55
|
+
};
|
|
56
|
+
export type Addon = {
|
|
57
|
+
name: string;
|
|
58
|
+
};
|
|
59
|
+
export type ControlPlane = {
|
|
60
|
+
id: string;
|
|
61
|
+
version: string;
|
|
62
|
+
status: ControlPlaneStatus;
|
|
63
|
+
addons: Addon[];
|
|
64
|
+
};
|
|
65
|
+
export type TenantStatus = {
|
|
66
|
+
runtimes: Runtime[];
|
|
67
|
+
"control-plane": ControlPlane[];
|
|
68
|
+
};
|
|
69
|
+
export type TenantResource = {
|
|
70
|
+
apiVersion: string;
|
|
71
|
+
kind: string;
|
|
72
|
+
metadata: Metadata;
|
|
73
|
+
status: TenantStatus;
|
|
74
|
+
};
|
|
75
|
+
export type ApplicationDeployment = {
|
|
76
|
+
name: string;
|
|
77
|
+
id: string;
|
|
78
|
+
"app-version": string;
|
|
79
|
+
status: string;
|
|
80
|
+
tags: NameValuePair[];
|
|
81
|
+
labels: NameValuePair[];
|
|
82
|
+
};
|
|
83
|
+
export type Kube = {
|
|
84
|
+
status: string;
|
|
85
|
+
id: string;
|
|
86
|
+
version: string;
|
|
87
|
+
addons: Addon[];
|
|
88
|
+
};
|
|
89
|
+
export type RuntimeStatus = {
|
|
90
|
+
"application-deployments": ApplicationDeployment[];
|
|
91
|
+
kube: Kube;
|
|
92
|
+
};
|
|
93
|
+
export type RuntimeResource = {
|
|
94
|
+
apiVersion: string;
|
|
95
|
+
kind: string;
|
|
96
|
+
metadata: Metadata;
|
|
97
|
+
status: RuntimeStatus;
|
|
98
|
+
};
|
|
99
|
+
export type TenantControlPlane = {
|
|
100
|
+
status: string;
|
|
101
|
+
version: string;
|
|
102
|
+
};
|
|
103
|
+
export type TenantWithControlPlane = {
|
|
104
|
+
name: string;
|
|
105
|
+
id: string;
|
|
106
|
+
"control-plane": TenantControlPlane;
|
|
107
|
+
};
|
|
108
|
+
export type ControlPlaneWithStatus = {
|
|
109
|
+
id: string;
|
|
110
|
+
version: string;
|
|
111
|
+
status: ControlPlaneStatus;
|
|
112
|
+
};
|
|
113
|
+
export type OrganizationStatus = {
|
|
114
|
+
tenants: TenantWithControlPlane[];
|
|
115
|
+
"control-planes": ControlPlaneWithStatus[];
|
|
116
|
+
};
|
|
117
|
+
export type OrganizationResource = {
|
|
118
|
+
apiVersion: string;
|
|
119
|
+
kind: string;
|
|
120
|
+
metadata: Metadata;
|
|
121
|
+
status: OrganizationStatus;
|
|
122
|
+
};
|
|
34
123
|
/**
|
|
35
124
|
* Applies a manifesto to the control plane.
|
|
36
125
|
*/
|
|
37
126
|
export declare function apply({ manifestoResource }: {
|
|
38
127
|
manifestoResource: ManifestoResource;
|
|
39
128
|
}, opts?: Oazapfts.RequestOpts): Promise<unknown>;
|
|
129
|
+
/**
|
|
130
|
+
* Retrieves the tenant details.
|
|
131
|
+
*/
|
|
132
|
+
export declare function getTenant({ id }: {
|
|
133
|
+
id: string;
|
|
134
|
+
}, opts?: Oazapfts.RequestOpts): Promise<TenantResource>;
|
|
135
|
+
/**
|
|
136
|
+
* Applies a manifesto to the control plane.
|
|
137
|
+
*/
|
|
138
|
+
export declare function getRuntime({ id }: {
|
|
139
|
+
id: string;
|
|
140
|
+
}, opts?: Oazapfts.RequestOpts): Promise<RuntimeResource>;
|
|
141
|
+
/**
|
|
142
|
+
* Retrieves the organization details.
|
|
143
|
+
*/
|
|
144
|
+
export declare function getOrganization(opts?: Oazapfts.RequestOpts): Promise<OrganizationResource>;
|
|
40
145
|
//# sourceMappingURL=cloudPlatformHorizon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudPlatformHorizon.d.ts","sourceRoot":"","sources":["../../src/api/cloudPlatformHorizon.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAG9D,CAAC;AAEF,eAAO,MAAM,OAAO;;CAEnB,CAAC;AACF,MAAM,MAAM,iBAAiB,GAAG;IAC5B,
|
|
1
|
+
{"version":3,"file":"cloudPlatformHorizon.d.ts","sourceRoot":"","sources":["../../src/api/cloudPlatformHorizon.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAG9D,CAAC;AAEF,eAAO,MAAM,OAAO;;CAEnB,CAAC;AACF,MAAM,MAAM,iBAAiB,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE;QACN,CAAC,GAAG,EAAE,MAAM,G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Ae,EAAE,kBAAkB,CAAC;CACvC,CAAC;AACF,MAAM,MAAM,sBAAsB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,kBAAkB,CAAC;CAC9B,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG;IAC7B,OAAO,EAAE,sBAAsB,EAAE,CAAC;IAClC,gBAAgB,EAAE,sBAAsB,EAAE,CAAC;CAC9C,CAAC;AACF,MAAM,MAAM,oBAAoB,GAAG;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,kBAAkB,CAAC;CAC9B,CAAC;AACF;;GAEG;AACH,wBAAgB,KAAK,CAAC,EAAE,iBAAiB,EAAE,EAAE;IACzC,iBAAiB,EAAE,iBAAiB,CAAC;CACxC,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,WAAW,oBAmC7B;AACD;;GAEG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE;IAC9B,EAAE,EAAE,MAAM,CAAC;CACd,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,WAAW,2BAkC7B;AACD;;GAEG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,EAAE,EAAE;IAC/B,EAAE,EAAE,MAAM,CAAC;CACd,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,WAAW,4BAkC7B;AACD;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,WAAW,iCAqC1D"}
|
|
@@ -23,4 +23,28 @@ export function apply({ manifestoResource }, opts) {
|
|
|
23
23
|
body: manifestoResource
|
|
24
24
|
})));
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves the tenant details.
|
|
28
|
+
*/
|
|
29
|
+
export function getTenant({ id }, opts) {
|
|
30
|
+
return oazapfts.ok(oazapfts.fetchJson(`/v1/tenants/${encodeURIComponent(id)}`, {
|
|
31
|
+
...opts
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Applies a manifesto to the control plane.
|
|
36
|
+
*/
|
|
37
|
+
export function getRuntime({ id }, opts) {
|
|
38
|
+
return oazapfts.ok(oazapfts.fetchJson(`/v1/runtimes/${encodeURIComponent(id)}`, {
|
|
39
|
+
...opts
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Retrieves the organization details.
|
|
44
|
+
*/
|
|
45
|
+
export function getOrganization(opts) {
|
|
46
|
+
return oazapfts.ok(oazapfts.fetchJson("/v1/organizations", {
|
|
47
|
+
...opts
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
26
50
|
//# sourceMappingURL=cloudPlatformHorizon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudPlatformHorizon.js","sourceRoot":"","sources":["../../src/api/cloudPlatformHorizon.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAE9C,MAAM,CAAC,MAAM,QAAQ,GAA8C;IAC/D,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,kDAAkD;CAC9D,CAAC;AACF,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5C,MAAM,CAAC,MAAM,OAAO,GAAG;IACnB,kBAAkB,EAAE,kDAAkD;CACzE,CAAC;
|
|
1
|
+
{"version":3,"file":"cloudPlatformHorizon.js","sourceRoot":"","sources":["../../src/api/cloudPlatformHorizon.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAE9C,MAAM,CAAC,MAAM,QAAQ,GAA8C;IAC/D,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,kDAAkD;CAC9D,CAAC;AACF,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5C,MAAM,CAAC,MAAM,OAAO,GAAG;IACnB,kBAAkB,EAAE,kDAAkD;CACzE,CAAC;AAgHF;;GAEG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,iBAAiB,EAExC,EAAE,IAA2B;IAC1B,OAAO,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CA6BlC,+BAA+B,EAAE,QAAQ,CAAC,IAAI,CAAC;QAC9C,GAAG,IAAI;QACP,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,iBAAiB;KAC1B,CAAC,CAAC,CAAC,CAAC;AACT,CAAC;AACD;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,EAAE,EAE7B,EAAE,IAA2B;IAC1B,OAAO,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CA8BlC,eAAe,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE;QACxC,GAAG,IAAI;KACV,CAAC,CAAC,CAAC;AACR,CAAC;AACD;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,EAAE,EAE9B,EAAE,IAA2B;IAC1B,OAAO,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CA8BlC,gBAAgB,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE;QACzC,GAAG,IAAI;KACV,CAAC,CAAC,CAAC;AACR,CAAC;AACD;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,IAA2B;IACvD,OAAO,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CAiClC,mBAAmB,EAAE;QACpB,GAAG,IAAI;KACV,CAAC,CAAC,CAAC;AACR,CAAC"}
|
|
@@ -10,6 +10,22 @@ declare class CloudPlatformHorizonClient extends ReactQueryNetworkClient {
|
|
|
10
10
|
apply: import("../network/types.js").MutationObject<Omit<{
|
|
11
11
|
manifestoResource: import("../api/cloudPlatformHorizon.js").ManifestoResource;
|
|
12
12
|
}, "authorization" | "jwtToken"> & {}, unknown>;
|
|
13
|
+
/**
|
|
14
|
+
* Get details of an organization
|
|
15
|
+
*/
|
|
16
|
+
getOrganization: import("../network/types.js").QueryObject<Omit<import("@oazapfts/runtime").RequestOpts | undefined, "authorization" | "jwtToken"> & {}, import("../api/cloudPlatformHorizon.js").OrganizationResource>;
|
|
17
|
+
/**
|
|
18
|
+
* Get details of an tenant
|
|
19
|
+
*/
|
|
20
|
+
getTenantById: import("../network/types.js").QueryObject<Omit<{
|
|
21
|
+
id: string;
|
|
22
|
+
}, "authorization" | "jwtToken"> & {}, import("../api/cloudPlatformHorizon.js").TenantResource>;
|
|
23
|
+
/**
|
|
24
|
+
* Get details of an runtime
|
|
25
|
+
*/
|
|
26
|
+
getRuntimeById: import("../network/types.js").QueryObject<Omit<{
|
|
27
|
+
id: string;
|
|
28
|
+
}, "authorization" | "jwtToken"> & {}, import("../api/cloudPlatformHorizon.js").RuntimeResource>;
|
|
13
29
|
}
|
|
14
30
|
export declare const cloudPlatformHorizonClient: CloudPlatformHorizonClient;
|
|
15
31
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud-platform-horizon.d.ts","sourceRoot":"","sources":["../../src/client/cloud-platform-horizon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAI7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAK5E,cAAM,0BAA2B,SAAQ,uBAAuB;;IAK9D,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB;IAGlE;;OAEG;IACH,KAAK;;oDAAiD;
|
|
1
|
+
{"version":3,"file":"cloud-platform-horizon.d.ts","sourceRoot":"","sources":["../../src/client/cloud-platform-horizon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAI7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAK5E,cAAM,0BAA2B,SAAQ,uBAAuB;;IAK9D,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB;IAGlE;;OAEG;IACH,KAAK;;oDAAiD;IACtD;;OAEG;IACH,eAAe,mMAAuD;IACtE;;OAEG;IACH,aAAa;;iGAAiD;IAC9D;;OAEG;IACH,cAAc;;kGAAkD;CACjE;AAED,eAAO,MAAM,0BAA0B,4BAAmC,CAAA"}
|
|
@@ -2,7 +2,7 @@ import apis from '../apis.json';
|
|
|
2
2
|
import { DefaultAPIError } from '../error/DefaultAPIError.js';
|
|
3
3
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
|
|
4
4
|
import { removeAuthorizationParam } from '../utils/remove-authorization-param.js';
|
|
5
|
-
import { apply, defaults } from '../api/cloudPlatformHorizon.js';
|
|
5
|
+
import { apply, defaults, getOrganization, getRuntime, getTenant } from '../api/cloudPlatformHorizon.js';
|
|
6
6
|
import { baseDictionary } from '../error/dictionary/base.js';
|
|
7
7
|
class CloudPlatformHorizonClient extends ReactQueryNetworkClient {
|
|
8
8
|
constructor() {
|
|
@@ -16,6 +16,33 @@ class CloudPlatformHorizonClient extends ReactQueryNetworkClient {
|
|
|
16
16
|
writable: true,
|
|
17
17
|
value: this.mutation(removeAuthorizationParam(apply))
|
|
18
18
|
});
|
|
19
|
+
/**
|
|
20
|
+
* Get details of an organization
|
|
21
|
+
*/
|
|
22
|
+
Object.defineProperty(this, "getOrganization", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
configurable: true,
|
|
25
|
+
writable: true,
|
|
26
|
+
value: this.query(removeAuthorizationParam(getOrganization))
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Get details of an tenant
|
|
30
|
+
*/
|
|
31
|
+
Object.defineProperty(this, "getTenantById", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
configurable: true,
|
|
34
|
+
writable: true,
|
|
35
|
+
value: this.query(removeAuthorizationParam(getTenant))
|
|
36
|
+
});
|
|
37
|
+
/**
|
|
38
|
+
* Get details of an runtime
|
|
39
|
+
*/
|
|
40
|
+
Object.defineProperty(this, "getRuntimeById", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
configurable: true,
|
|
43
|
+
writable: true,
|
|
44
|
+
value: this.query(removeAuthorizationParam(getRuntime))
|
|
45
|
+
});
|
|
19
46
|
}
|
|
20
47
|
buildStackSpotError(error) {
|
|
21
48
|
return new DefaultAPIError(error.data, error.status, baseDictionary, error.headers);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud-platform-horizon.js","sourceRoot":"","sources":["../../src/client/cloud-platform-horizon.ts"],"names":[],"mappings":"AAEA,OAAO,IAAI,MAAM,cAAc,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAA;AAC9E,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"cloud-platform-horizon.js","sourceRoot":"","sources":["../../src/client/cloud-platform-horizon.ts"],"names":[],"mappings":"AAEA,OAAO,IAAI,MAAM,cAAc,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAA;AAC9E,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AACrG,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAEzD,MAAM,0BAA2B,SAAQ,uBAAuB;IAC9D;QACE,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;QAMhD;;WAEG;QACH;;;;mBAAQ,IAAI,CAAC,QAAQ,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;WAAA;QACtD;;WAEG;QACH;;;;mBAAiB,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,eAAe,CAAC,CAAC;WAAA;QACtE;;WAEG;QACH;;;;mBAAe,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC;WAAA;QAC9D;;WAEG;QACH;;;;mBAAgB,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC;WAAA;IApBhE,CAAC;IAES,mBAAmB,CAAC,KAAgB;QAC5C,OAAO,IAAI,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;IACrF,CAAC;CAiBF;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,0BAA0B,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -15,10 +15,10 @@ export const servers = {
|
|
|
15
15
|
generatedServerUrl: "https://cloud-platform-horizon.dev.stackspot.com"
|
|
16
16
|
};
|
|
17
17
|
export type ManifestoResource = {
|
|
18
|
-
|
|
18
|
+
apiVersion: string;
|
|
19
19
|
kind: string;
|
|
20
20
|
metadata: {
|
|
21
|
-
[key: string]:
|
|
21
|
+
[key: string]: object;
|
|
22
22
|
};
|
|
23
23
|
spec: {
|
|
24
24
|
[key: string]: object;
|
|
@@ -36,6 +36,95 @@ export type ErrorBody = {
|
|
|
36
36
|
validationDetails: ValidationDetails[];
|
|
37
37
|
};
|
|
38
38
|
export type StatusType = number;
|
|
39
|
+
export type NameValuePair = {
|
|
40
|
+
name: string;
|
|
41
|
+
value: string;
|
|
42
|
+
};
|
|
43
|
+
export type Metadata = {
|
|
44
|
+
id: string;
|
|
45
|
+
name: string;
|
|
46
|
+
tags: NameValuePair[];
|
|
47
|
+
labels: NameValuePair[];
|
|
48
|
+
};
|
|
49
|
+
export type Runtime = {
|
|
50
|
+
name: string;
|
|
51
|
+
id: string;
|
|
52
|
+
"kube-version": string;
|
|
53
|
+
status: string;
|
|
54
|
+
tags: NameValuePair[];
|
|
55
|
+
labels: NameValuePair[];
|
|
56
|
+
};
|
|
57
|
+
export type ControlPlaneStatus = {
|
|
58
|
+
health: string;
|
|
59
|
+
control: string;
|
|
60
|
+
};
|
|
61
|
+
export type Addon = {
|
|
62
|
+
name: string;
|
|
63
|
+
};
|
|
64
|
+
export type ControlPlane = {
|
|
65
|
+
id: string;
|
|
66
|
+
version: string;
|
|
67
|
+
status: ControlPlaneStatus;
|
|
68
|
+
addons: Addon[];
|
|
69
|
+
};
|
|
70
|
+
export type TenantStatus = {
|
|
71
|
+
runtimes: Runtime[];
|
|
72
|
+
"control-plane": ControlPlane[];
|
|
73
|
+
};
|
|
74
|
+
export type TenantResource = {
|
|
75
|
+
apiVersion: string;
|
|
76
|
+
kind: string;
|
|
77
|
+
metadata: Metadata;
|
|
78
|
+
status: TenantStatus;
|
|
79
|
+
};
|
|
80
|
+
export type ApplicationDeployment = {
|
|
81
|
+
name: string;
|
|
82
|
+
id: string;
|
|
83
|
+
"app-version": string;
|
|
84
|
+
status: string;
|
|
85
|
+
tags: NameValuePair[];
|
|
86
|
+
labels: NameValuePair[];
|
|
87
|
+
};
|
|
88
|
+
export type Kube = {
|
|
89
|
+
status: string;
|
|
90
|
+
id: string;
|
|
91
|
+
version: string;
|
|
92
|
+
addons: Addon[];
|
|
93
|
+
};
|
|
94
|
+
export type RuntimeStatus = {
|
|
95
|
+
"application-deployments": ApplicationDeployment[];
|
|
96
|
+
kube: Kube;
|
|
97
|
+
};
|
|
98
|
+
export type RuntimeResource = {
|
|
99
|
+
apiVersion: string;
|
|
100
|
+
kind: string;
|
|
101
|
+
metadata: Metadata;
|
|
102
|
+
status: RuntimeStatus;
|
|
103
|
+
};
|
|
104
|
+
export type TenantControlPlane = {
|
|
105
|
+
status: string;
|
|
106
|
+
version: string;
|
|
107
|
+
};
|
|
108
|
+
export type TenantWithControlPlane = {
|
|
109
|
+
name: string;
|
|
110
|
+
id: string;
|
|
111
|
+
"control-plane": TenantControlPlane;
|
|
112
|
+
};
|
|
113
|
+
export type ControlPlaneWithStatus = {
|
|
114
|
+
id: string;
|
|
115
|
+
version: string;
|
|
116
|
+
status: ControlPlaneStatus;
|
|
117
|
+
};
|
|
118
|
+
export type OrganizationStatus = {
|
|
119
|
+
tenants: TenantWithControlPlane[];
|
|
120
|
+
"control-planes": ControlPlaneWithStatus[];
|
|
121
|
+
};
|
|
122
|
+
export type OrganizationResource = {
|
|
123
|
+
apiVersion: string;
|
|
124
|
+
kind: string;
|
|
125
|
+
metadata: Metadata;
|
|
126
|
+
status: OrganizationStatus;
|
|
127
|
+
};
|
|
39
128
|
/**
|
|
40
129
|
* Applies a manifesto to the control plane.
|
|
41
130
|
*/
|
|
@@ -55,9 +144,9 @@ export function apply({ manifestoResource }: {
|
|
|
55
144
|
parameters?: {
|
|
56
145
|
[key: string]: object;
|
|
57
146
|
};
|
|
58
|
-
detail?: string;
|
|
59
147
|
title?: string;
|
|
60
148
|
status?: StatusType;
|
|
149
|
+
detail?: string;
|
|
61
150
|
};
|
|
62
151
|
} | {
|
|
63
152
|
status: 500;
|
|
@@ -67,9 +156,9 @@ export function apply({ manifestoResource }: {
|
|
|
67
156
|
parameters?: {
|
|
68
157
|
[key: string]: object;
|
|
69
158
|
};
|
|
70
|
-
detail?: string;
|
|
71
159
|
title?: string;
|
|
72
160
|
status?: StatusType;
|
|
161
|
+
detail?: string;
|
|
73
162
|
};
|
|
74
163
|
}>("/v1/admin/control-plane/apply", oazapfts.json({
|
|
75
164
|
...opts,
|
|
@@ -77,3 +166,124 @@ export function apply({ manifestoResource }: {
|
|
|
77
166
|
body: manifestoResource
|
|
78
167
|
})));
|
|
79
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* Retrieves the tenant details.
|
|
171
|
+
*/
|
|
172
|
+
export function getTenant({ id }: {
|
|
173
|
+
id: string;
|
|
174
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
175
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
176
|
+
status: 200;
|
|
177
|
+
data: TenantResource;
|
|
178
|
+
} | {
|
|
179
|
+
status: 403;
|
|
180
|
+
data: ErrorBody;
|
|
181
|
+
} | {
|
|
182
|
+
status: 422;
|
|
183
|
+
data: {
|
|
184
|
+
instance?: string;
|
|
185
|
+
"type"?: string;
|
|
186
|
+
parameters?: {
|
|
187
|
+
[key: string]: object;
|
|
188
|
+
};
|
|
189
|
+
title?: string;
|
|
190
|
+
status?: StatusType;
|
|
191
|
+
detail?: string;
|
|
192
|
+
};
|
|
193
|
+
} | {
|
|
194
|
+
status: 500;
|
|
195
|
+
data: {
|
|
196
|
+
instance?: string;
|
|
197
|
+
"type"?: string;
|
|
198
|
+
parameters?: {
|
|
199
|
+
[key: string]: object;
|
|
200
|
+
};
|
|
201
|
+
title?: string;
|
|
202
|
+
status?: StatusType;
|
|
203
|
+
detail?: string;
|
|
204
|
+
};
|
|
205
|
+
}>(`/v1/tenants/${encodeURIComponent(id)}`, {
|
|
206
|
+
...opts
|
|
207
|
+
}));
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Applies a manifesto to the control plane.
|
|
211
|
+
*/
|
|
212
|
+
export function getRuntime({ id }: {
|
|
213
|
+
id: string;
|
|
214
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
215
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
216
|
+
status: 200;
|
|
217
|
+
data: RuntimeResource;
|
|
218
|
+
} | {
|
|
219
|
+
status: 403;
|
|
220
|
+
data: ErrorBody;
|
|
221
|
+
} | {
|
|
222
|
+
status: 422;
|
|
223
|
+
data: {
|
|
224
|
+
instance?: string;
|
|
225
|
+
"type"?: string;
|
|
226
|
+
parameters?: {
|
|
227
|
+
[key: string]: object;
|
|
228
|
+
};
|
|
229
|
+
title?: string;
|
|
230
|
+
status?: StatusType;
|
|
231
|
+
detail?: string;
|
|
232
|
+
};
|
|
233
|
+
} | {
|
|
234
|
+
status: 500;
|
|
235
|
+
data: {
|
|
236
|
+
instance?: string;
|
|
237
|
+
"type"?: string;
|
|
238
|
+
parameters?: {
|
|
239
|
+
[key: string]: object;
|
|
240
|
+
};
|
|
241
|
+
title?: string;
|
|
242
|
+
status?: StatusType;
|
|
243
|
+
detail?: string;
|
|
244
|
+
};
|
|
245
|
+
}>(`/v1/runtimes/${encodeURIComponent(id)}`, {
|
|
246
|
+
...opts
|
|
247
|
+
}));
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Retrieves the organization details.
|
|
251
|
+
*/
|
|
252
|
+
export function getOrganization(opts?: Oazapfts.RequestOpts) {
|
|
253
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
254
|
+
status: 200;
|
|
255
|
+
data: OrganizationResource;
|
|
256
|
+
} | {
|
|
257
|
+
status: 403;
|
|
258
|
+
data: ErrorBody;
|
|
259
|
+
} | {
|
|
260
|
+
status: 404;
|
|
261
|
+
data: ErrorBody;
|
|
262
|
+
} | {
|
|
263
|
+
status: 422;
|
|
264
|
+
data: {
|
|
265
|
+
instance?: string;
|
|
266
|
+
"type"?: string;
|
|
267
|
+
parameters?: {
|
|
268
|
+
[key: string]: object;
|
|
269
|
+
};
|
|
270
|
+
title?: string;
|
|
271
|
+
status?: StatusType;
|
|
272
|
+
detail?: string;
|
|
273
|
+
};
|
|
274
|
+
} | {
|
|
275
|
+
status: 500;
|
|
276
|
+
data: {
|
|
277
|
+
instance?: string;
|
|
278
|
+
"type"?: string;
|
|
279
|
+
parameters?: {
|
|
280
|
+
[key: string]: object;
|
|
281
|
+
};
|
|
282
|
+
title?: string;
|
|
283
|
+
status?: StatusType;
|
|
284
|
+
detail?: string;
|
|
285
|
+
};
|
|
286
|
+
}>("/v1/organizations", {
|
|
287
|
+
...opts
|
|
288
|
+
}));
|
|
289
|
+
}
|
|
@@ -5,7 +5,7 @@ import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
|
5
5
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
6
6
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
7
7
|
import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
8
|
-
import { apply, defaults } from '../api/cloudPlatformHorizon'
|
|
8
|
+
import { apply, defaults, getOrganization, getRuntime, getTenant } from '../api/cloudPlatformHorizon'
|
|
9
9
|
import { baseDictionary } from '../error/dictionary/base'
|
|
10
10
|
|
|
11
11
|
class CloudPlatformHorizonClient extends ReactQueryNetworkClient {
|
|
@@ -20,6 +20,18 @@ class CloudPlatformHorizonClient extends ReactQueryNetworkClient {
|
|
|
20
20
|
* Apply manifesto resource
|
|
21
21
|
*/
|
|
22
22
|
apply = this.mutation(removeAuthorizationParam(apply))
|
|
23
|
+
/**
|
|
24
|
+
* Get details of an organization
|
|
25
|
+
*/
|
|
26
|
+
getOrganization= this.query(removeAuthorizationParam(getOrganization))
|
|
27
|
+
/**
|
|
28
|
+
* Get details of an tenant
|
|
29
|
+
*/
|
|
30
|
+
getTenantById= this.query(removeAuthorizationParam(getTenant))
|
|
31
|
+
/**
|
|
32
|
+
* Get details of an runtime
|
|
33
|
+
*/
|
|
34
|
+
getRuntimeById= this.query(removeAuthorizationParam(getRuntime))
|
|
23
35
|
}
|
|
24
36
|
|
|
25
37
|
export const cloudPlatformHorizonClient = new CloudPlatformHorizonClient()
|