@stack-spot/portal-network 0.67.0 → 0.68.0

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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.68.0](https://github.com/stack-spot/portal-commons/compare/portal-network@v0.67.0...portal-network@v0.68.0) (2024-12-27)
4
+
5
+
6
+ ### Features
7
+
8
+ * add queries in horizon client ([36c9444](https://github.com/stack-spot/portal-commons/commit/36c9444e08ebb6cb9f9d688afb3dca3397e3e702))
9
+
3
10
  ## [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
11
 
5
12
 
@@ -10,7 +10,7 @@ export declare const servers: {
10
10
  generatedServerUrl: string;
11
11
  };
12
12
  export type ManifestoResource = {
13
- schemaVersion: string;
13
+ apiVersion: string;
14
14
  kind: string;
15
15
  metadata: {
16
16
  [key: string]: string;
@@ -31,10 +31,123 @@ export type ErrorBody = {
31
31
  validationDetails: ValidationDetails[];
32
32
  };
33
33
  export type StatusType = number;
34
+ export type Metadata = {
35
+ id: string;
36
+ name: string;
37
+ tags: {
38
+ [key: string]: string;
39
+ };
40
+ labels: {
41
+ [key: string]: string;
42
+ };
43
+ };
44
+ export type Runtime = {
45
+ name: string;
46
+ id: string;
47
+ "kube-version": string;
48
+ status: string;
49
+ tags: {
50
+ [key: string]: string;
51
+ };
52
+ labels: {
53
+ [key: string]: string;
54
+ }[];
55
+ };
56
+ export type ControlPlaneStatus = {
57
+ health: string;
58
+ control: string;
59
+ };
60
+ export type Addon = {
61
+ name: string;
62
+ };
63
+ export type ControlPlane = {
64
+ id: string;
65
+ version: string;
66
+ status: ControlPlaneStatus;
67
+ addons: Addon[];
68
+ };
69
+ export type TenantStatus = {
70
+ runtimes: Runtime[];
71
+ "control-plane": ControlPlane[];
72
+ };
73
+ export type TenantResource = {
74
+ apiVersion: string;
75
+ kind: string;
76
+ metadata: Metadata;
77
+ status: TenantStatus;
78
+ };
79
+ export type ApplicationDeployment = {
80
+ name: string;
81
+ id: string;
82
+ "app-version": string;
83
+ status: string;
84
+ tags: {
85
+ [key: string]: string;
86
+ };
87
+ labels: {
88
+ [key: string]: string;
89
+ }[];
90
+ };
91
+ export type Kube = {
92
+ status: string;
93
+ id: string;
94
+ version: string;
95
+ addons: Addon[];
96
+ };
97
+ export type RuntimeStatus = {
98
+ "application-deployments": ApplicationDeployment[];
99
+ kube: Kube;
100
+ };
101
+ export type RuntimeResource = {
102
+ apiVersion: string;
103
+ kind: string;
104
+ metadata: Metadata;
105
+ status: RuntimeStatus;
106
+ };
107
+ export type TenantControlPlane = {
108
+ status: string;
109
+ version: string;
110
+ };
111
+ export type TenantWithControlPlane = {
112
+ name: string;
113
+ id: string;
114
+ "control-plane": TenantControlPlane;
115
+ };
116
+ export type ControlPlaneWithStatus = {
117
+ id: string;
118
+ version: string;
119
+ status: ControlPlaneStatus;
120
+ };
121
+ export type OrganizationStatus = {
122
+ tenants: TenantWithControlPlane[];
123
+ "control-planes": ControlPlaneWithStatus[];
124
+ };
125
+ export type OrganizationResource = {
126
+ apiVersion: string;
127
+ kind: string;
128
+ metadata: Metadata;
129
+ status: OrganizationStatus;
130
+ };
34
131
  /**
35
132
  * Applies a manifesto to the control plane.
36
133
  */
37
134
  export declare function apply({ manifestoResource }: {
38
135
  manifestoResource: ManifestoResource;
39
136
  }, opts?: Oazapfts.RequestOpts): Promise<unknown>;
137
+ /**
138
+ * Retrieves the tenant details.
139
+ */
140
+ export declare function getTenant({ id }: {
141
+ id: string;
142
+ }, opts?: Oazapfts.RequestOpts): Promise<TenantResource>;
143
+ /**
144
+ * Applies a manifesto to the control plane.
145
+ */
146
+ export declare function getRuntime({ id }: {
147
+ id: string;
148
+ }, opts?: Oazapfts.RequestOpts): Promise<RuntimeResource>;
149
+ /**
150
+ * Retrieves the organization details.
151
+ */
152
+ export declare function getOrganization(opts?: Oazapfts.RequestOpts): Promise<OrganizationResource>;
40
153
  //# 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,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE;QACN,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACzB,CAAC;IACF,IAAI,EAAE;QACF,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACzB,CAAC;CACL,CAAC;AACF,MAAM,MAAM,iBAAiB,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AACF,MAAM,MAAM,SAAS,GAAG;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,iBAAiB,EAAE,CAAC;CAC1C,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAChC;;GAEG;AACH,wBAAgB,KAAK,CAAC,EAAE,iBAAiB,EAAE,EAAE;IACzC,iBAAiB,EAAE,iBAAiB,CAAC;CACxC,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,WAAW,oBAmC7B"}
1
+ {"version":3,"file":"cloudPlatformHorizon.d.ts","sourceRoot":"","sources":["../../src/api/cloudPlatformHorizon.ts"],"names":[],"mappings":"AAAA;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AC,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;AAuBF;;GAEG;AAC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AU,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;CACvD;AAED,eAAO,MAAM,0BAA0B,4BAAmC,CAAA"}
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;AAC7D,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;IARtD,CAAC;IAES,mBAAmB,CAAC,KAAgB;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,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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stack-spot/portal-network",
3
- "version": "0.67.0",
3
+ "version": "0.68.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,7 +15,7 @@ export const servers = {
15
15
  generatedServerUrl: "https://cloud-platform-horizon.dev.stackspot.com"
16
16
  };
17
17
  export type ManifestoResource = {
18
- schemaVersion: string;
18
+ apiVersion: string;
19
19
  kind: string;
20
20
  metadata: {
21
21
  [key: string]: string;
@@ -36,6 +36,103 @@ export type ErrorBody = {
36
36
  validationDetails: ValidationDetails[];
37
37
  };
38
38
  export type StatusType = number;
39
+ export type Metadata = {
40
+ id: string;
41
+ name: string;
42
+ tags: {
43
+ [key: string]: string;
44
+ };
45
+ labels: {
46
+ [key: string]: string;
47
+ };
48
+ };
49
+ export type Runtime = {
50
+ name: string;
51
+ id: string;
52
+ "kube-version": string;
53
+ status: string;
54
+ tags: {
55
+ [key: string]: string;
56
+ };
57
+ labels: {
58
+ [key: string]: string;
59
+ }[];
60
+ };
61
+ export type ControlPlaneStatus = {
62
+ health: string;
63
+ control: string;
64
+ };
65
+ export type Addon = {
66
+ name: string;
67
+ };
68
+ export type ControlPlane = {
69
+ id: string;
70
+ version: string;
71
+ status: ControlPlaneStatus;
72
+ addons: Addon[];
73
+ };
74
+ export type TenantStatus = {
75
+ runtimes: Runtime[];
76
+ "control-plane": ControlPlane[];
77
+ };
78
+ export type TenantResource = {
79
+ apiVersion: string;
80
+ kind: string;
81
+ metadata: Metadata;
82
+ status: TenantStatus;
83
+ };
84
+ export type ApplicationDeployment = {
85
+ name: string;
86
+ id: string;
87
+ "app-version": string;
88
+ status: string;
89
+ tags: {
90
+ [key: string]: string;
91
+ };
92
+ labels: {
93
+ [key: string]: string;
94
+ }[];
95
+ };
96
+ export type Kube = {
97
+ status: string;
98
+ id: string;
99
+ version: string;
100
+ addons: Addon[];
101
+ };
102
+ export type RuntimeStatus = {
103
+ "application-deployments": ApplicationDeployment[];
104
+ kube: Kube;
105
+ };
106
+ export type RuntimeResource = {
107
+ apiVersion: string;
108
+ kind: string;
109
+ metadata: Metadata;
110
+ status: RuntimeStatus;
111
+ };
112
+ export type TenantControlPlane = {
113
+ status: string;
114
+ version: string;
115
+ };
116
+ export type TenantWithControlPlane = {
117
+ name: string;
118
+ id: string;
119
+ "control-plane": TenantControlPlane;
120
+ };
121
+ export type ControlPlaneWithStatus = {
122
+ id: string;
123
+ version: string;
124
+ status: ControlPlaneStatus;
125
+ };
126
+ export type OrganizationStatus = {
127
+ tenants: TenantWithControlPlane[];
128
+ "control-planes": ControlPlaneWithStatus[];
129
+ };
130
+ export type OrganizationResource = {
131
+ apiVersion: string;
132
+ kind: string;
133
+ metadata: Metadata;
134
+ status: OrganizationStatus;
135
+ };
39
136
  /**
40
137
  * Applies a manifesto to the control plane.
41
138
  */
@@ -55,9 +152,9 @@ export function apply({ manifestoResource }: {
55
152
  parameters?: {
56
153
  [key: string]: object;
57
154
  };
58
- detail?: string;
59
155
  title?: string;
60
156
  status?: StatusType;
157
+ detail?: string;
61
158
  };
62
159
  } | {
63
160
  status: 500;
@@ -67,9 +164,9 @@ export function apply({ manifestoResource }: {
67
164
  parameters?: {
68
165
  [key: string]: object;
69
166
  };
70
- detail?: string;
71
167
  title?: string;
72
168
  status?: StatusType;
169
+ detail?: string;
73
170
  };
74
171
  }>("/v1/admin/control-plane/apply", oazapfts.json({
75
172
  ...opts,
@@ -77,3 +174,124 @@ export function apply({ manifestoResource }: {
77
174
  body: manifestoResource
78
175
  })));
79
176
  }
177
+ /**
178
+ * Retrieves the tenant details.
179
+ */
180
+ export function getTenant({ id }: {
181
+ id: string;
182
+ }, opts?: Oazapfts.RequestOpts) {
183
+ return oazapfts.ok(oazapfts.fetchJson<{
184
+ status: 200;
185
+ data: TenantResource;
186
+ } | {
187
+ status: 403;
188
+ data: ErrorBody;
189
+ } | {
190
+ status: 422;
191
+ data: {
192
+ instance?: string;
193
+ "type"?: string;
194
+ parameters?: {
195
+ [key: string]: object;
196
+ };
197
+ title?: string;
198
+ status?: StatusType;
199
+ detail?: string;
200
+ };
201
+ } | {
202
+ status: 500;
203
+ data: {
204
+ instance?: string;
205
+ "type"?: string;
206
+ parameters?: {
207
+ [key: string]: object;
208
+ };
209
+ title?: string;
210
+ status?: StatusType;
211
+ detail?: string;
212
+ };
213
+ }>(`/v1/tenants/${encodeURIComponent(id)}`, {
214
+ ...opts
215
+ }));
216
+ }
217
+ /**
218
+ * Applies a manifesto to the control plane.
219
+ */
220
+ export function getRuntime({ id }: {
221
+ id: string;
222
+ }, opts?: Oazapfts.RequestOpts) {
223
+ return oazapfts.ok(oazapfts.fetchJson<{
224
+ status: 200;
225
+ data: RuntimeResource;
226
+ } | {
227
+ status: 403;
228
+ data: ErrorBody;
229
+ } | {
230
+ status: 422;
231
+ data: {
232
+ instance?: string;
233
+ "type"?: string;
234
+ parameters?: {
235
+ [key: string]: object;
236
+ };
237
+ title?: string;
238
+ status?: StatusType;
239
+ detail?: string;
240
+ };
241
+ } | {
242
+ status: 500;
243
+ data: {
244
+ instance?: string;
245
+ "type"?: string;
246
+ parameters?: {
247
+ [key: string]: object;
248
+ };
249
+ title?: string;
250
+ status?: StatusType;
251
+ detail?: string;
252
+ };
253
+ }>(`/v1/runtimes/${encodeURIComponent(id)}`, {
254
+ ...opts
255
+ }));
256
+ }
257
+ /**
258
+ * Retrieves the organization details.
259
+ */
260
+ export function getOrganization(opts?: Oazapfts.RequestOpts) {
261
+ return oazapfts.ok(oazapfts.fetchJson<{
262
+ status: 200;
263
+ data: OrganizationResource;
264
+ } | {
265
+ status: 403;
266
+ data: ErrorBody;
267
+ } | {
268
+ status: 404;
269
+ data: ErrorBody;
270
+ } | {
271
+ status: 422;
272
+ data: {
273
+ instance?: string;
274
+ "type"?: string;
275
+ parameters?: {
276
+ [key: string]: object;
277
+ };
278
+ title?: string;
279
+ status?: StatusType;
280
+ detail?: string;
281
+ };
282
+ } | {
283
+ status: 500;
284
+ data: {
285
+ instance?: string;
286
+ "type"?: string;
287
+ parameters?: {
288
+ [key: string]: object;
289
+ };
290
+ title?: string;
291
+ status?: StatusType;
292
+ detail?: string;
293
+ };
294
+ }>("/v1/organizations", {
295
+ ...opts
296
+ }));
297
+ }
@@ -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()