Skip to content

Commit 8263c6f

Browse files
committed
feat: use new types
1 parent 319d67d commit 8263c6f

File tree

2 files changed

+67
-40
lines changed

2 files changed

+67
-40
lines changed

src/lib/api/types/crossplane/listManagedResources.ts

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,10 @@
1+
import { ManagedResourceItem } from '../../../shared/types';
12
import { Resource } from '../resource';
23

3-
export type ManagedResourcesResponse = [
4-
{
5-
items: [
6-
{
7-
kind: string;
8-
metadata: {
9-
name: string;
10-
creationTimestamp: string;
11-
labels: [];
12-
};
13-
status?: {
14-
conditions?: [
15-
{
16-
type: 'Ready' | 'Synced' | unknown;
17-
status: 'True' | 'False';
18-
lastTransitionTime: string;
19-
message?: string;
20-
reason?: string;
21-
},
22-
];
23-
};
24-
},
25-
];
26-
},
27-
];
4+
export type ManagedResourcesResponse = {
5+
items: [ManagedResourceItem];
6+
}
7+
288

299
export const ManagedResourcesRequest: Resource<ManagedResourcesResponse> = {
3010
path: '/managed',

src/lib/shared/types.ts

Lines changed: 62 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,66 @@ export type ProviderConfigsDataForRequest = {
1616

1717
export type ProviderConfigs = {
1818
provider: string;
19-
items: [
20-
{
21-
kind: string;
22-
metadata: {
23-
provider: string;
24-
name: string;
25-
usage: string;
26-
creationTimestamp: string;
27-
};
28-
status: {
29-
count: string;
30-
users: string;
31-
};
32-
},
33-
];
19+
items: [ProviderConfigItem];
3420
};
21+
22+
export interface ProviderConfigItem {
23+
kind: string;
24+
metadata: {
25+
provider: string;
26+
name: string;
27+
usage: string;
28+
creationTimestamp: string;
29+
};
30+
status: {
31+
count: string;
32+
users: string;
33+
};
34+
apiVersion?: string;
35+
}
36+
37+
export type Condition = {
38+
type: 'Ready' | 'Synced' | unknown;
39+
status: 'True' | 'False';
40+
lastTransitionTime: string;
41+
reason?: string;
42+
message?: string;
43+
};
44+
45+
export type ManagedResourceGroup = {
46+
items: ManagedResourceItem[];
47+
};
48+
49+
export type ManagedResourceItem = {
50+
kind: string;
51+
metadata: {
52+
name: string;
53+
creationTimestamp: string;
54+
labels: [];
55+
};
56+
apiVersion?: string;
57+
spec?: {
58+
providerConfigRef?: { name: string };
59+
forProvider?: {
60+
subaccountRef?: { name?: string };
61+
serviceManagerRef?: { name?: string };
62+
spaceRef?: { name?: string };
63+
orgRef?: { name?: string };
64+
directoryRef?: { name?: string };
65+
entitlementRef?: { name?: string };
66+
globalAccountRef?: { name?: string };
67+
orgRoleRef?: { name?: string };
68+
spaceMembersRef?: { name?: string };
69+
cloudFoundryEnvironmentRef?: { name?: string };
70+
kymaEnvironmentRef?: { name?: string };
71+
roleCollectionRef?: { name?: string };
72+
roleCollectionAssignmentRef?: { name?: string };
73+
subaccountTrustConfigurationRef?: { name?: string };
74+
globalaccountTrustConfigurationRef?: { name?: string };
75+
};
76+
cloudManagementRef?: { name: string };
77+
};
78+
status?: {
79+
conditions?: Condition[];
80+
};
81+
};

0 commit comments

Comments
 (0)