@intentius/chant-lexicon-k8s 0.35.0 → 0.36.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.
@@ -1 +1 @@
1
- {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/codegen/docs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAqHH;;GAEG;AACH,wBAAsB,YAAY,CAAC,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA0hC9E"}
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/codegen/docs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAqHH;;GAEG;AACH,wBAAsB,YAAY,CAAC,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAiiC9E"}
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "d7f9bbb835f960e74357927b1af2b24fccd73296d30ce4bd0a5a5875831dfb22",
4
+ "manifest.json": "10863db859a23c3912bd6111da456bd0dc124d729d10c2aa81e55f1c0c044bc9",
5
5
  "meta.json": "c75f736c0e08376e1d57fb70e71a41263ae6925064bf394a2a5eb52380084ca3",
6
- "types/index.d.ts": "344342be58fe6c455b749c0495b62d65e3cfeeb0d4b51588910e7ee377b3b9c6",
6
+ "types/index.d.ts": "117b26c20b082d249258c8a98f3357a0329030f14d32e9969b6a891cce98d0a6",
7
7
  "rules/argo-appset-single-project.ts": "afa9f310753aa2d475f35012b13135b2dfaebed2a35d44edbe185ebc07673674",
8
8
  "rules/argo-ast.ts": "f57b7d84fef9c9cd326a7cad0dff290914e01299415d64bdab48e2f6eb4181c3",
9
9
  "rules/argo-automated-prune.ts": "176ac5441c3ccb7106a194abab3abe22fd8a29f976716761c66c243b72d57b14",
@@ -50,5 +50,5 @@
50
50
  "skills/chant-k8s-aks.md": "e18f0e2b055f72cd7a37deaf258d7027c2d4d3e286e8fd4975b27a1f981a3ad9",
51
51
  "skills/chant-k8s-argo.md": "b1a0b826559d8c5033a479c5781efaf650320f0aee4419d8841170bd3393cea5"
52
52
  },
53
- "composite": "850473d372f2eafeb966dc4624f03f4f7bd693da6a53d4e4c9fb77d0c7736de0"
53
+ "composite": "cd09d4fe6a458e2bb7f35d74570daae75d395166a4d3def722436768658739ea"
54
54
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "k8s",
3
- "version": "0.35.0",
3
+ "version": "0.36.0",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "K8s",
6
6
  "intrinsics": [],
@@ -4,7 +4,8 @@
4
4
 
5
5
  export declare class Alert {
6
6
  constructor(props: {
7
- metadata?: Record<string, unknown>;
7
+ /** Standard object's metadata. */
8
+ metadata?: ObjectMeta;
8
9
  /** AlertSpec defines an alerting rule for events involving a list of objects. */
9
10
  spec?: Record<string, unknown>;
10
11
  });
@@ -89,9 +90,10 @@ export declare class APIVersions {
89
90
 
90
91
  export declare class Application {
91
92
  constructor(props: {
92
- metadata: Record<string, unknown>;
93
93
  /** ApplicationSpec represents desired application state. Contains link to repository with application definition and additional parameters link definition revision. */
94
94
  spec: Record<string, unknown>;
95
+ /** Standard object's metadata. */
96
+ metadata?: ObjectMeta;
95
97
  /** Operation contains information about a requested or running operation */
96
98
  operation?: Record<string, unknown>;
97
99
  });
@@ -103,8 +105,9 @@ export declare class Application {
103
105
 
104
106
  export declare class ApplicationSet {
105
107
  constructor(props: {
106
- metadata: Record<string, unknown>;
107
108
  spec: Record<string, unknown>;
109
+ /** Standard object's metadata. */
110
+ metadata?: ObjectMeta;
108
111
  });
109
112
  readonly name: string;
110
113
  readonly namespace: string;
@@ -114,9 +117,10 @@ export declare class ApplicationSet {
114
117
 
115
118
  export declare class AppProject {
116
119
  constructor(props: {
117
- metadata: Record<string, unknown>;
118
120
  /** AppProjectSpec is the specification of an AppProject */
119
121
  spec: Record<string, unknown>;
122
+ /** Standard object's metadata. */
123
+ metadata?: ObjectMeta;
120
124
  });
121
125
  readonly name: string;
122
126
  readonly namespace: string;
@@ -150,7 +154,8 @@ export declare class Binding {
150
154
 
151
155
  export declare class Bucket {
152
156
  constructor(props: {
153
- metadata?: Record<string, unknown>;
157
+ /** Standard object's metadata. */
158
+ metadata?: ObjectMeta;
154
159
  /** BucketSpec specifies the required configuration to produce an Artifact for
155
160
  an object storage bucket. */
156
161
  spec?: Record<string, unknown>;
@@ -163,7 +168,8 @@ an object storage bucket. */
163
168
 
164
169
  export declare class Certificate {
165
170
  constructor(props: {
166
- metadata?: Record<string, unknown>;
171
+ /** Standard object's metadata. */
172
+ metadata?: ObjectMeta;
167
173
  /** Specification of the desired state of the Certificate resource.
168
174
  https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status */
169
175
  spec?: Record<string, unknown>;
@@ -176,7 +182,8 @@ https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions
176
182
 
177
183
  export declare class CertificateRequest {
178
184
  constructor(props: {
179
- metadata?: Record<string, unknown>;
185
+ /** Standard object's metadata. */
186
+ metadata?: ObjectMeta;
180
187
  /** Specification of the desired state of the CertificateRequest resource.
181
188
  https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status */
182
189
  spec?: Record<string, unknown>;
@@ -211,8 +218,9 @@ export declare class CertificateSigningRequestList {
211
218
 
212
219
  export declare class Challenge {
213
220
  constructor(props: {
214
- metadata: Record<string, unknown>;
215
221
  spec: Record<string, unknown>;
222
+ /** Standard object's metadata. */
223
+ metadata?: ObjectMeta;
216
224
  });
217
225
  readonly name: string;
218
226
  readonly namespace: string;
@@ -224,7 +232,8 @@ export declare class ClusterIssuer {
224
232
  constructor(props: {
225
233
  /** Desired state of the ClusterIssuer resource. */
226
234
  spec: Record<string, unknown>;
227
- metadata?: Record<string, unknown>;
235
+ /** Standard object's metadata. */
236
+ metadata?: ObjectMeta;
228
237
  });
229
238
  readonly name: string;
230
239
  readonly namespace: string;
@@ -416,7 +425,8 @@ export declare class CoreEventList {
416
425
 
417
426
  export declare class CrdbCluster {
418
427
  constructor(props: {
419
- metadata?: Record<string, unknown>;
428
+ /** Standard object's metadata. */
429
+ metadata?: ObjectMeta;
420
430
  /** CrdbClusterSpec defines the desired state of a CockroachDB Cluster that the operator maintains. */
421
431
  spec?: Record<string, unknown>;
422
432
  });
@@ -884,7 +894,8 @@ export declare class FlowSchemaList {
884
894
 
885
895
  export declare class FluxInstance {
886
896
  constructor(props: {
887
- metadata?: Record<string, unknown>;
897
+ /** Standard object's metadata. */
898
+ metadata?: ObjectMeta;
888
899
  /** FluxInstanceSpec defines the desired state of FluxInstance */
889
900
  spec?: Record<string, unknown>;
890
901
  });
@@ -896,7 +907,8 @@ export declare class FluxInstance {
896
907
 
897
908
  export declare class FluxReport {
898
909
  constructor(props: {
899
- metadata?: Record<string, unknown>;
910
+ /** Standard object's metadata. */
911
+ metadata?: ObjectMeta;
900
912
  /** FluxReportSpec defines the observed state of a Flux installation. */
901
913
  spec?: Record<string, unknown>;
902
914
  });
@@ -910,7 +922,8 @@ export declare class Gateway {
910
922
  constructor(props: {
911
923
  /** Spec defines the desired state of Gateway. */
912
924
  spec: Record<string, unknown>;
913
- metadata?: Record<string, unknown>;
925
+ /** Standard object's metadata. */
926
+ metadata?: ObjectMeta;
914
927
  });
915
928
  readonly name: string;
916
929
  readonly namespace: string;
@@ -922,7 +935,8 @@ export declare class GatewayClass {
922
935
  constructor(props: {
923
936
  /** Spec defines the desired state of GatewayClass. */
924
937
  spec: Record<string, unknown>;
925
- metadata?: Record<string, unknown>;
938
+ /** Standard object's metadata. */
939
+ metadata?: ObjectMeta;
926
940
  });
927
941
  readonly name: string;
928
942
  readonly namespace: string;
@@ -932,7 +946,8 @@ export declare class GatewayClass {
932
946
 
933
947
  export declare class GitRepository {
934
948
  constructor(props: {
935
- metadata?: Record<string, unknown>;
949
+ /** Standard object's metadata. */
950
+ metadata?: ObjectMeta;
936
951
  /** GitRepositorySpec specifies the required configuration to produce an
937
952
  Artifact for a Git repository. */
938
953
  spec?: Record<string, unknown>;
@@ -945,7 +960,8 @@ Artifact for a Git repository. */
945
960
 
946
961
  export declare class GRPCRoute {
947
962
  constructor(props: {
948
- metadata?: Record<string, unknown>;
963
+ /** Standard object's metadata. */
964
+ metadata?: ObjectMeta;
949
965
  /** Spec defines the desired state of GRPCRoute. */
950
966
  spec?: Record<string, unknown>;
951
967
  });
@@ -957,7 +973,8 @@ export declare class GRPCRoute {
957
973
 
958
974
  export declare class HelmChart {
959
975
  constructor(props: {
960
- metadata?: Record<string, unknown>;
976
+ /** Standard object's metadata. */
977
+ metadata?: ObjectMeta;
961
978
  /** HelmChartSpec specifies the desired state of a Helm chart. */
962
979
  spec?: Record<string, unknown>;
963
980
  });
@@ -969,7 +986,8 @@ export declare class HelmChart {
969
986
 
970
987
  export declare class HelmRelease {
971
988
  constructor(props: {
972
- metadata?: Record<string, unknown>;
989
+ /** Standard object's metadata. */
990
+ metadata?: ObjectMeta;
973
991
  /** HelmReleaseSpec defines the desired state of a Helm release. */
974
992
  spec?: Record<string, unknown>;
975
993
  });
@@ -981,7 +999,8 @@ export declare class HelmRelease {
981
999
 
982
1000
  export declare class HelmRepository {
983
1001
  constructor(props: {
984
- metadata?: Record<string, unknown>;
1002
+ /** Standard object's metadata. */
1003
+ metadata?: ObjectMeta;
985
1004
  /** HelmRepositorySpec specifies the required configuration to produce an
986
1005
  Artifact for a Helm repository index YAML. */
987
1006
  spec?: Record<string, unknown>;
@@ -1032,7 +1051,8 @@ export declare class HTTPRoute {
1032
1051
  constructor(props: {
1033
1052
  /** Spec defines the desired state of HTTPRoute. */
1034
1053
  spec: Record<string, unknown>;
1035
- metadata?: Record<string, unknown>;
1054
+ /** Standard object's metadata. */
1055
+ metadata?: ObjectMeta;
1036
1056
  });
1037
1057
  readonly name: string;
1038
1058
  readonly namespace: string;
@@ -1042,7 +1062,8 @@ export declare class HTTPRoute {
1042
1062
 
1043
1063
  export declare class ImagePolicy {
1044
1064
  constructor(props: {
1045
- metadata?: Record<string, unknown>;
1065
+ /** Standard object's metadata. */
1066
+ metadata?: ObjectMeta;
1046
1067
  /** ImagePolicySpec defines the parameters for calculating the
1047
1068
  ImagePolicy. */
1048
1069
  spec?: Record<string, unknown>;
@@ -1055,7 +1076,8 @@ ImagePolicy. */
1055
1076
 
1056
1077
  export declare class ImageRepository {
1057
1078
  constructor(props: {
1058
- metadata?: Record<string, unknown>;
1079
+ /** Standard object's metadata. */
1080
+ metadata?: ObjectMeta;
1059
1081
  /** ImageRepositorySpec defines the parameters for scanning an image
1060
1082
  repository, e.g., `fluxcd/flux`. */
1061
1083
  spec?: Record<string, unknown>;
@@ -1068,7 +1090,8 @@ repository, e.g., `fluxcd/flux`. */
1068
1090
 
1069
1091
  export declare class ImageUpdateAutomation {
1070
1092
  constructor(props: {
1071
- metadata?: Record<string, unknown>;
1093
+ /** Standard object's metadata. */
1094
+ metadata?: ObjectMeta;
1072
1095
  /** ImageUpdateAutomationSpec defines the desired state of ImageUpdateAutomation */
1073
1096
  spec?: Record<string, unknown>;
1074
1097
  });
@@ -1166,7 +1189,8 @@ export declare class Issuer {
1166
1189
  constructor(props: {
1167
1190
  /** Desired state of the Issuer resource. */
1168
1191
  spec: Record<string, unknown>;
1169
- metadata?: Record<string, unknown>;
1192
+ /** Standard object's metadata. */
1193
+ metadata?: ObjectMeta;
1170
1194
  });
1171
1195
  readonly name: string;
1172
1196
  readonly namespace: string;
@@ -1200,7 +1224,8 @@ export declare class JobList {
1200
1224
 
1201
1225
  export declare class Kustomization {
1202
1226
  constructor(props: {
1203
- metadata?: Record<string, unknown>;
1227
+ /** Standard object's metadata. */
1228
+ metadata?: ObjectMeta;
1204
1229
  /** KustomizationSpec defines the configuration to calculate the desired state
1205
1230
  from a Source using Kustomize. */
1206
1231
  spec?: Record<string, unknown>;
@@ -1297,6 +1322,8 @@ export declare class LocalSubjectAccessReview {
1297
1322
 
1298
1323
  export declare class MicroVM {
1299
1324
  constructor(props: {
1325
+ /** Standard object's metadata. */
1326
+ metadata?: ObjectMeta;
1300
1327
  spec?: Record<string, unknown>;
1301
1328
  });
1302
1329
  readonly name: string;
@@ -1307,6 +1334,8 @@ export declare class MicroVM {
1307
1334
 
1308
1335
  export declare class MicroVMClass {
1309
1336
  constructor(props: {
1337
+ /** Standard object's metadata. */
1338
+ metadata?: ObjectMeta;
1310
1339
  spec?: Record<string, unknown>;
1311
1340
  });
1312
1341
  readonly name: string;
@@ -1316,6 +1345,8 @@ export declare class MicroVMClass {
1316
1345
 
1317
1346
  export declare class MicroVMImage {
1318
1347
  constructor(props: {
1348
+ /** Standard object's metadata. */
1349
+ metadata?: ObjectMeta;
1319
1350
  spec?: Record<string, unknown>;
1320
1351
  });
1321
1352
  readonly name: string;
@@ -1326,6 +1357,8 @@ export declare class MicroVMImage {
1326
1357
 
1327
1358
  export declare class MicroVMNetwork {
1328
1359
  constructor(props: {
1360
+ /** Standard object's metadata. */
1361
+ metadata?: ObjectMeta;
1329
1362
  spec?: Record<string, unknown>;
1330
1363
  });
1331
1364
  readonly name: string;
@@ -1336,6 +1369,8 @@ export declare class MicroVMNetwork {
1336
1369
 
1337
1370
  export declare class MicroVMReplicaSet {
1338
1371
  constructor(props: {
1372
+ /** Standard object's metadata. */
1373
+ metadata?: ObjectMeta;
1339
1374
  spec?: Record<string, unknown>;
1340
1375
  });
1341
1376
  readonly name: string;
@@ -1514,7 +1549,8 @@ export declare class NS {
1514
1549
 
1515
1550
  export declare class OCIRepository {
1516
1551
  constructor(props: {
1517
- metadata?: Record<string, unknown>;
1552
+ /** Standard object's metadata. */
1553
+ metadata?: ObjectMeta;
1518
1554
  /** OCIRepositorySpec defines the desired state of OCIRepository */
1519
1555
  spec?: Record<string, unknown>;
1520
1556
  });
@@ -1526,8 +1562,9 @@ export declare class OCIRepository {
1526
1562
 
1527
1563
  export declare class Order {
1528
1564
  constructor(props: {
1529
- metadata: Record<string, unknown>;
1530
1565
  spec: Record<string, unknown>;
1566
+ /** Standard object's metadata. */
1567
+ metadata?: ObjectMeta;
1531
1568
  });
1532
1569
  readonly name: string;
1533
1570
  readonly namespace: string;
@@ -1749,7 +1786,8 @@ export declare class PrometheusRule {
1749
1786
  constructor(props: {
1750
1787
  /** Specification of desired alerting rule definitions for Prometheus. */
1751
1788
  spec: Record<string, unknown>;
1752
- metadata?: Record<string, unknown>;
1789
+ /** Standard object's metadata. */
1790
+ metadata?: ObjectMeta;
1753
1791
  });
1754
1792
  readonly name: string;
1755
1793
  readonly namespace: string;
@@ -1758,7 +1796,8 @@ export declare class PrometheusRule {
1758
1796
 
1759
1797
  export declare class Provider {
1760
1798
  constructor(props: {
1761
- metadata?: Record<string, unknown>;
1799
+ /** Standard object's metadata. */
1800
+ metadata?: ObjectMeta;
1762
1801
  /** ProviderSpec defines the desired state of the Provider. */
1763
1802
  spec?: Record<string, unknown>;
1764
1803
  });
@@ -1793,7 +1832,8 @@ export declare class PVC {
1793
1832
 
1794
1833
  export declare class RayCluster {
1795
1834
  constructor(props: {
1796
- metadata?: Record<string, unknown>;
1835
+ /** Standard object's metadata. */
1836
+ metadata?: ObjectMeta;
1797
1837
  spec?: Record<string, unknown>;
1798
1838
  });
1799
1839
  readonly name: string;
@@ -1804,7 +1844,8 @@ export declare class RayCluster {
1804
1844
 
1805
1845
  export declare class RayJob {
1806
1846
  constructor(props: {
1807
- metadata?: Record<string, unknown>;
1847
+ /** Standard object's metadata. */
1848
+ metadata?: ObjectMeta;
1808
1849
  spec?: Record<string, unknown>;
1809
1850
  });
1810
1851
  readonly name: string;
@@ -1815,7 +1856,8 @@ export declare class RayJob {
1815
1856
 
1816
1857
  export declare class RayService {
1817
1858
  constructor(props: {
1818
- metadata?: Record<string, unknown>;
1859
+ /** Standard object's metadata. */
1860
+ metadata?: ObjectMeta;
1819
1861
  spec?: Record<string, unknown>;
1820
1862
  });
1821
1863
  readonly name: string;
@@ -1826,7 +1868,8 @@ export declare class RayService {
1826
1868
 
1827
1869
  export declare class Receiver {
1828
1870
  constructor(props: {
1829
- metadata?: Record<string, unknown>;
1871
+ /** Standard object's metadata. */
1872
+ metadata?: ObjectMeta;
1830
1873
  /** ReceiverSpec defines the desired state of the Receiver. */
1831
1874
  spec?: Record<string, unknown>;
1832
1875
  });
@@ -1838,7 +1881,8 @@ export declare class Receiver {
1838
1881
 
1839
1882
  export declare class ReferenceGrant {
1840
1883
  constructor(props: {
1841
- metadata?: Record<string, unknown>;
1884
+ /** Standard object's metadata. */
1885
+ metadata?: ObjectMeta;
1842
1886
  /** Spec defines the desired state of ReferenceGrant. */
1843
1887
  spec?: Record<string, unknown>;
1844
1888
  });
@@ -1971,7 +2015,8 @@ export declare class ResourceQuotaList {
1971
2015
 
1972
2016
  export declare class ResourceSet {
1973
2017
  constructor(props: {
1974
- metadata?: Record<string, unknown>;
2018
+ /** Standard object's metadata. */
2019
+ metadata?: ObjectMeta;
1975
2020
  /** ResourceSetSpec defines the desired state of ResourceSet */
1976
2021
  spec?: Record<string, unknown>;
1977
2022
  });
@@ -1983,7 +2028,8 @@ export declare class ResourceSet {
1983
2028
 
1984
2029
  export declare class ResourceSetInputProvider {
1985
2030
  constructor(props: {
1986
- metadata?: Record<string, unknown>;
2031
+ /** Standard object's metadata. */
2032
+ metadata?: ObjectMeta;
1987
2033
  /** ResourceSetInputProviderSpec defines the desired state of ResourceSetInputProvider */
1988
2034
  spec?: Record<string, unknown>;
1989
2035
  });
@@ -2289,7 +2335,8 @@ export declare class ServiceMonitor {
2289
2335
  /** Specification of desired Service selection for target discovery by
2290
2336
  Prometheus. */
2291
2337
  spec: Record<string, unknown>;
2292
- metadata?: Record<string, unknown>;
2338
+ /** Standard object's metadata. */
2339
+ metadata?: ObjectMeta;
2293
2340
  });
2294
2341
  readonly name: string;
2295
2342
  readonly namespace: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-k8s",
3
- "version": "0.35.0",
3
+ "version": "0.36.0",
4
4
  "description": "Kubernetes lexicon for chant — declarative IaC in TypeScript",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://intentius.io/chant",
@@ -1151,6 +1151,13 @@ The lexicon also provides MCP (Model Context Protocol) tools and resources:
1151
1151
  ],
1152
1152
  basePath: "/chant/lexicons/k8s/",
1153
1153
  sidebarExtra: [
1154
+ {
1155
+ label: "Live Cluster",
1156
+ items: [
1157
+ { label: "The API Client", slug: "api-client" },
1158
+ { label: "chant kube", slug: "kube" },
1159
+ ],
1160
+ },
1154
1161
  { label: "CRD-Generated Classes", slug: "crd-classes" },
1155
1162
  { label: "Argo CD Composites", slug: "argo-composites" },
1156
1163
  {
@@ -201,6 +201,63 @@ describe("parseCRDSpec", () => {
201
201
  expect(props.some((p) => p.name === "metadata")).toBe(true);
202
202
  });
203
203
 
204
+ test("emits metadata even when the schema declares only spec and status", () => {
205
+ // The shape the Fabric8 CRDGenerator produces, and what KubeMicroVM's five
206
+ // CRDs ship — no `metadata` in openAPIV3Schema at all. Without this the
207
+ // generated class had no way to set a name or a namespace.
208
+ const spec = {
209
+ group: "lambda.aws.amazon.com",
210
+ names: { kind: "MicroVM", plural: "microvms" },
211
+ scope: "Namespaced" as const,
212
+ versions: [
213
+ {
214
+ name: "v1alpha1",
215
+ served: true,
216
+ storage: true,
217
+ schema: {
218
+ openAPIV3Schema: {
219
+ type: "object",
220
+ properties: {
221
+ spec: { type: "object", properties: { imageRef: { type: "string" } } },
222
+ status: { type: "object", properties: { state: { type: "string" } } },
223
+ },
224
+ },
225
+ },
226
+ },
227
+ ],
228
+ };
229
+
230
+ const props = parseCRDSpec(spec)[0].resource.properties;
231
+ const metadata = props.find((p) => p.name === "metadata");
232
+ expect(metadata?.tsType).toBe("ObjectMeta");
233
+ expect(metadata?.required).toBe(false);
234
+ });
235
+
236
+ test("a schema-declared metadata does not produce a duplicate", () => {
237
+ const spec = {
238
+ group: "cert-manager.io",
239
+ names: { kind: "Certificate", plural: "certificates" },
240
+ scope: "Namespaced" as const,
241
+ versions: [
242
+ {
243
+ name: "v1",
244
+ served: true,
245
+ storage: true,
246
+ schema: {
247
+ openAPIV3Schema: {
248
+ type: "object",
249
+ properties: { metadata: { type: "object" }, spec: { type: "object" } },
250
+ },
251
+ },
252
+ },
253
+ ],
254
+ };
255
+
256
+ const metadataProps = parseCRDSpec(spec)[0].resource.properties.filter((p) => p.name === "metadata");
257
+ expect(metadataProps.length).toBe(1);
258
+ expect(metadataProps[0].tsType).toBe("ObjectMeta");
259
+ });
260
+
204
261
  test("normalizeGroupName converts cert-manager.io to CertManager", () => {
205
262
  const spec = {
206
263
  group: "cert-manager.io",
package/src/crd/parser.ts CHANGED
@@ -181,8 +181,25 @@ function extractProperties(schema: OpenAPISchema): ParsedProperty[] {
181
181
  const topProps = schema.properties ?? {};
182
182
  const topRequired = new Set<string>(schema.required ?? []);
183
183
 
184
- // Skip apiVersion, kind, status — same pattern as core parser
185
- const skipProps = new Set(["apiVersion", "kind", "status"]);
184
+ // Skip apiVersion, kind, status — same pattern as core parser. `metadata` is
185
+ // skipped here too and re-added below: every custom resource carries the full
186
+ // ObjectMeta whatever its own schema says, and most CRD schemas say nothing.
187
+ const skipProps = new Set(["apiVersion", "kind", "metadata", "status"]);
188
+
189
+ // A CRD's openAPIV3Schema describes what the *controller* reads, so authors
190
+ // routinely declare only `spec` and `status` — the Fabric8 CRDGenerator emits
191
+ // exactly that, and so do most hand-written CRDs. The API server still accepts
192
+ // (and requires) the standard `metadata`, so deriving the constructor surface
193
+ // from the schema alone produced a class with no way to set a name or
194
+ // namespace, and every call site needed an `as any` to get one on. Emit it
195
+ // unconditionally, typed the same as every built-in kind's.
196
+ result.push({
197
+ name: "metadata",
198
+ tsType: "ObjectMeta",
199
+ required: false,
200
+ description: "Standard object's metadata.",
201
+ constraints: {},
202
+ });
186
203
 
187
204
  for (const [name, prop] of Object.entries(topProps)) {
188
205
  if (skipProps.has(name)) continue;
@@ -4,7 +4,8 @@
4
4
 
5
5
  export declare class Alert {
6
6
  constructor(props: {
7
- metadata?: Record<string, unknown>;
7
+ /** Standard object's metadata. */
8
+ metadata?: ObjectMeta;
8
9
  /** AlertSpec defines an alerting rule for events involving a list of objects. */
9
10
  spec?: Record<string, unknown>;
10
11
  });
@@ -89,9 +90,10 @@ export declare class APIVersions {
89
90
 
90
91
  export declare class Application {
91
92
  constructor(props: {
92
- metadata: Record<string, unknown>;
93
93
  /** ApplicationSpec represents desired application state. Contains link to repository with application definition and additional parameters link definition revision. */
94
94
  spec: Record<string, unknown>;
95
+ /** Standard object's metadata. */
96
+ metadata?: ObjectMeta;
95
97
  /** Operation contains information about a requested or running operation */
96
98
  operation?: Record<string, unknown>;
97
99
  });
@@ -103,8 +105,9 @@ export declare class Application {
103
105
 
104
106
  export declare class ApplicationSet {
105
107
  constructor(props: {
106
- metadata: Record<string, unknown>;
107
108
  spec: Record<string, unknown>;
109
+ /** Standard object's metadata. */
110
+ metadata?: ObjectMeta;
108
111
  });
109
112
  readonly name: string;
110
113
  readonly namespace: string;
@@ -114,9 +117,10 @@ export declare class ApplicationSet {
114
117
 
115
118
  export declare class AppProject {
116
119
  constructor(props: {
117
- metadata: Record<string, unknown>;
118
120
  /** AppProjectSpec is the specification of an AppProject */
119
121
  spec: Record<string, unknown>;
122
+ /** Standard object's metadata. */
123
+ metadata?: ObjectMeta;
120
124
  });
121
125
  readonly name: string;
122
126
  readonly namespace: string;
@@ -150,7 +154,8 @@ export declare class Binding {
150
154
 
151
155
  export declare class Bucket {
152
156
  constructor(props: {
153
- metadata?: Record<string, unknown>;
157
+ /** Standard object's metadata. */
158
+ metadata?: ObjectMeta;
154
159
  /** BucketSpec specifies the required configuration to produce an Artifact for
155
160
  an object storage bucket. */
156
161
  spec?: Record<string, unknown>;
@@ -163,7 +168,8 @@ an object storage bucket. */
163
168
 
164
169
  export declare class Certificate {
165
170
  constructor(props: {
166
- metadata?: Record<string, unknown>;
171
+ /** Standard object's metadata. */
172
+ metadata?: ObjectMeta;
167
173
  /** Specification of the desired state of the Certificate resource.
168
174
  https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status */
169
175
  spec?: Record<string, unknown>;
@@ -176,7 +182,8 @@ https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions
176
182
 
177
183
  export declare class CertificateRequest {
178
184
  constructor(props: {
179
- metadata?: Record<string, unknown>;
185
+ /** Standard object's metadata. */
186
+ metadata?: ObjectMeta;
180
187
  /** Specification of the desired state of the CertificateRequest resource.
181
188
  https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status */
182
189
  spec?: Record<string, unknown>;
@@ -211,8 +218,9 @@ export declare class CertificateSigningRequestList {
211
218
 
212
219
  export declare class Challenge {
213
220
  constructor(props: {
214
- metadata: Record<string, unknown>;
215
221
  spec: Record<string, unknown>;
222
+ /** Standard object's metadata. */
223
+ metadata?: ObjectMeta;
216
224
  });
217
225
  readonly name: string;
218
226
  readonly namespace: string;
@@ -224,7 +232,8 @@ export declare class ClusterIssuer {
224
232
  constructor(props: {
225
233
  /** Desired state of the ClusterIssuer resource. */
226
234
  spec: Record<string, unknown>;
227
- metadata?: Record<string, unknown>;
235
+ /** Standard object's metadata. */
236
+ metadata?: ObjectMeta;
228
237
  });
229
238
  readonly name: string;
230
239
  readonly namespace: string;
@@ -416,7 +425,8 @@ export declare class CoreEventList {
416
425
 
417
426
  export declare class CrdbCluster {
418
427
  constructor(props: {
419
- metadata?: Record<string, unknown>;
428
+ /** Standard object's metadata. */
429
+ metadata?: ObjectMeta;
420
430
  /** CrdbClusterSpec defines the desired state of a CockroachDB Cluster that the operator maintains. */
421
431
  spec?: Record<string, unknown>;
422
432
  });
@@ -884,7 +894,8 @@ export declare class FlowSchemaList {
884
894
 
885
895
  export declare class FluxInstance {
886
896
  constructor(props: {
887
- metadata?: Record<string, unknown>;
897
+ /** Standard object's metadata. */
898
+ metadata?: ObjectMeta;
888
899
  /** FluxInstanceSpec defines the desired state of FluxInstance */
889
900
  spec?: Record<string, unknown>;
890
901
  });
@@ -896,7 +907,8 @@ export declare class FluxInstance {
896
907
 
897
908
  export declare class FluxReport {
898
909
  constructor(props: {
899
- metadata?: Record<string, unknown>;
910
+ /** Standard object's metadata. */
911
+ metadata?: ObjectMeta;
900
912
  /** FluxReportSpec defines the observed state of a Flux installation. */
901
913
  spec?: Record<string, unknown>;
902
914
  });
@@ -910,7 +922,8 @@ export declare class Gateway {
910
922
  constructor(props: {
911
923
  /** Spec defines the desired state of Gateway. */
912
924
  spec: Record<string, unknown>;
913
- metadata?: Record<string, unknown>;
925
+ /** Standard object's metadata. */
926
+ metadata?: ObjectMeta;
914
927
  });
915
928
  readonly name: string;
916
929
  readonly namespace: string;
@@ -922,7 +935,8 @@ export declare class GatewayClass {
922
935
  constructor(props: {
923
936
  /** Spec defines the desired state of GatewayClass. */
924
937
  spec: Record<string, unknown>;
925
- metadata?: Record<string, unknown>;
938
+ /** Standard object's metadata. */
939
+ metadata?: ObjectMeta;
926
940
  });
927
941
  readonly name: string;
928
942
  readonly namespace: string;
@@ -932,7 +946,8 @@ export declare class GatewayClass {
932
946
 
933
947
  export declare class GitRepository {
934
948
  constructor(props: {
935
- metadata?: Record<string, unknown>;
949
+ /** Standard object's metadata. */
950
+ metadata?: ObjectMeta;
936
951
  /** GitRepositorySpec specifies the required configuration to produce an
937
952
  Artifact for a Git repository. */
938
953
  spec?: Record<string, unknown>;
@@ -945,7 +960,8 @@ Artifact for a Git repository. */
945
960
 
946
961
  export declare class GRPCRoute {
947
962
  constructor(props: {
948
- metadata?: Record<string, unknown>;
963
+ /** Standard object's metadata. */
964
+ metadata?: ObjectMeta;
949
965
  /** Spec defines the desired state of GRPCRoute. */
950
966
  spec?: Record<string, unknown>;
951
967
  });
@@ -957,7 +973,8 @@ export declare class GRPCRoute {
957
973
 
958
974
  export declare class HelmChart {
959
975
  constructor(props: {
960
- metadata?: Record<string, unknown>;
976
+ /** Standard object's metadata. */
977
+ metadata?: ObjectMeta;
961
978
  /** HelmChartSpec specifies the desired state of a Helm chart. */
962
979
  spec?: Record<string, unknown>;
963
980
  });
@@ -969,7 +986,8 @@ export declare class HelmChart {
969
986
 
970
987
  export declare class HelmRelease {
971
988
  constructor(props: {
972
- metadata?: Record<string, unknown>;
989
+ /** Standard object's metadata. */
990
+ metadata?: ObjectMeta;
973
991
  /** HelmReleaseSpec defines the desired state of a Helm release. */
974
992
  spec?: Record<string, unknown>;
975
993
  });
@@ -981,7 +999,8 @@ export declare class HelmRelease {
981
999
 
982
1000
  export declare class HelmRepository {
983
1001
  constructor(props: {
984
- metadata?: Record<string, unknown>;
1002
+ /** Standard object's metadata. */
1003
+ metadata?: ObjectMeta;
985
1004
  /** HelmRepositorySpec specifies the required configuration to produce an
986
1005
  Artifact for a Helm repository index YAML. */
987
1006
  spec?: Record<string, unknown>;
@@ -1032,7 +1051,8 @@ export declare class HTTPRoute {
1032
1051
  constructor(props: {
1033
1052
  /** Spec defines the desired state of HTTPRoute. */
1034
1053
  spec: Record<string, unknown>;
1035
- metadata?: Record<string, unknown>;
1054
+ /** Standard object's metadata. */
1055
+ metadata?: ObjectMeta;
1036
1056
  });
1037
1057
  readonly name: string;
1038
1058
  readonly namespace: string;
@@ -1042,7 +1062,8 @@ export declare class HTTPRoute {
1042
1062
 
1043
1063
  export declare class ImagePolicy {
1044
1064
  constructor(props: {
1045
- metadata?: Record<string, unknown>;
1065
+ /** Standard object's metadata. */
1066
+ metadata?: ObjectMeta;
1046
1067
  /** ImagePolicySpec defines the parameters for calculating the
1047
1068
  ImagePolicy. */
1048
1069
  spec?: Record<string, unknown>;
@@ -1055,7 +1076,8 @@ ImagePolicy. */
1055
1076
 
1056
1077
  export declare class ImageRepository {
1057
1078
  constructor(props: {
1058
- metadata?: Record<string, unknown>;
1079
+ /** Standard object's metadata. */
1080
+ metadata?: ObjectMeta;
1059
1081
  /** ImageRepositorySpec defines the parameters for scanning an image
1060
1082
  repository, e.g., `fluxcd/flux`. */
1061
1083
  spec?: Record<string, unknown>;
@@ -1068,7 +1090,8 @@ repository, e.g., `fluxcd/flux`. */
1068
1090
 
1069
1091
  export declare class ImageUpdateAutomation {
1070
1092
  constructor(props: {
1071
- metadata?: Record<string, unknown>;
1093
+ /** Standard object's metadata. */
1094
+ metadata?: ObjectMeta;
1072
1095
  /** ImageUpdateAutomationSpec defines the desired state of ImageUpdateAutomation */
1073
1096
  spec?: Record<string, unknown>;
1074
1097
  });
@@ -1166,7 +1189,8 @@ export declare class Issuer {
1166
1189
  constructor(props: {
1167
1190
  /** Desired state of the Issuer resource. */
1168
1191
  spec: Record<string, unknown>;
1169
- metadata?: Record<string, unknown>;
1192
+ /** Standard object's metadata. */
1193
+ metadata?: ObjectMeta;
1170
1194
  });
1171
1195
  readonly name: string;
1172
1196
  readonly namespace: string;
@@ -1200,7 +1224,8 @@ export declare class JobList {
1200
1224
 
1201
1225
  export declare class Kustomization {
1202
1226
  constructor(props: {
1203
- metadata?: Record<string, unknown>;
1227
+ /** Standard object's metadata. */
1228
+ metadata?: ObjectMeta;
1204
1229
  /** KustomizationSpec defines the configuration to calculate the desired state
1205
1230
  from a Source using Kustomize. */
1206
1231
  spec?: Record<string, unknown>;
@@ -1297,6 +1322,8 @@ export declare class LocalSubjectAccessReview {
1297
1322
 
1298
1323
  export declare class MicroVM {
1299
1324
  constructor(props: {
1325
+ /** Standard object's metadata. */
1326
+ metadata?: ObjectMeta;
1300
1327
  spec?: Record<string, unknown>;
1301
1328
  });
1302
1329
  readonly name: string;
@@ -1307,6 +1334,8 @@ export declare class MicroVM {
1307
1334
 
1308
1335
  export declare class MicroVMClass {
1309
1336
  constructor(props: {
1337
+ /** Standard object's metadata. */
1338
+ metadata?: ObjectMeta;
1310
1339
  spec?: Record<string, unknown>;
1311
1340
  });
1312
1341
  readonly name: string;
@@ -1316,6 +1345,8 @@ export declare class MicroVMClass {
1316
1345
 
1317
1346
  export declare class MicroVMImage {
1318
1347
  constructor(props: {
1348
+ /** Standard object's metadata. */
1349
+ metadata?: ObjectMeta;
1319
1350
  spec?: Record<string, unknown>;
1320
1351
  });
1321
1352
  readonly name: string;
@@ -1326,6 +1357,8 @@ export declare class MicroVMImage {
1326
1357
 
1327
1358
  export declare class MicroVMNetwork {
1328
1359
  constructor(props: {
1360
+ /** Standard object's metadata. */
1361
+ metadata?: ObjectMeta;
1329
1362
  spec?: Record<string, unknown>;
1330
1363
  });
1331
1364
  readonly name: string;
@@ -1336,6 +1369,8 @@ export declare class MicroVMNetwork {
1336
1369
 
1337
1370
  export declare class MicroVMReplicaSet {
1338
1371
  constructor(props: {
1372
+ /** Standard object's metadata. */
1373
+ metadata?: ObjectMeta;
1339
1374
  spec?: Record<string, unknown>;
1340
1375
  });
1341
1376
  readonly name: string;
@@ -1514,7 +1549,8 @@ export declare class NS {
1514
1549
 
1515
1550
  export declare class OCIRepository {
1516
1551
  constructor(props: {
1517
- metadata?: Record<string, unknown>;
1552
+ /** Standard object's metadata. */
1553
+ metadata?: ObjectMeta;
1518
1554
  /** OCIRepositorySpec defines the desired state of OCIRepository */
1519
1555
  spec?: Record<string, unknown>;
1520
1556
  });
@@ -1526,8 +1562,9 @@ export declare class OCIRepository {
1526
1562
 
1527
1563
  export declare class Order {
1528
1564
  constructor(props: {
1529
- metadata: Record<string, unknown>;
1530
1565
  spec: Record<string, unknown>;
1566
+ /** Standard object's metadata. */
1567
+ metadata?: ObjectMeta;
1531
1568
  });
1532
1569
  readonly name: string;
1533
1570
  readonly namespace: string;
@@ -1749,7 +1786,8 @@ export declare class PrometheusRule {
1749
1786
  constructor(props: {
1750
1787
  /** Specification of desired alerting rule definitions for Prometheus. */
1751
1788
  spec: Record<string, unknown>;
1752
- metadata?: Record<string, unknown>;
1789
+ /** Standard object's metadata. */
1790
+ metadata?: ObjectMeta;
1753
1791
  });
1754
1792
  readonly name: string;
1755
1793
  readonly namespace: string;
@@ -1758,7 +1796,8 @@ export declare class PrometheusRule {
1758
1796
 
1759
1797
  export declare class Provider {
1760
1798
  constructor(props: {
1761
- metadata?: Record<string, unknown>;
1799
+ /** Standard object's metadata. */
1800
+ metadata?: ObjectMeta;
1762
1801
  /** ProviderSpec defines the desired state of the Provider. */
1763
1802
  spec?: Record<string, unknown>;
1764
1803
  });
@@ -1793,7 +1832,8 @@ export declare class PVC {
1793
1832
 
1794
1833
  export declare class RayCluster {
1795
1834
  constructor(props: {
1796
- metadata?: Record<string, unknown>;
1835
+ /** Standard object's metadata. */
1836
+ metadata?: ObjectMeta;
1797
1837
  spec?: Record<string, unknown>;
1798
1838
  });
1799
1839
  readonly name: string;
@@ -1804,7 +1844,8 @@ export declare class RayCluster {
1804
1844
 
1805
1845
  export declare class RayJob {
1806
1846
  constructor(props: {
1807
- metadata?: Record<string, unknown>;
1847
+ /** Standard object's metadata. */
1848
+ metadata?: ObjectMeta;
1808
1849
  spec?: Record<string, unknown>;
1809
1850
  });
1810
1851
  readonly name: string;
@@ -1815,7 +1856,8 @@ export declare class RayJob {
1815
1856
 
1816
1857
  export declare class RayService {
1817
1858
  constructor(props: {
1818
- metadata?: Record<string, unknown>;
1859
+ /** Standard object's metadata. */
1860
+ metadata?: ObjectMeta;
1819
1861
  spec?: Record<string, unknown>;
1820
1862
  });
1821
1863
  readonly name: string;
@@ -1826,7 +1868,8 @@ export declare class RayService {
1826
1868
 
1827
1869
  export declare class Receiver {
1828
1870
  constructor(props: {
1829
- metadata?: Record<string, unknown>;
1871
+ /** Standard object's metadata. */
1872
+ metadata?: ObjectMeta;
1830
1873
  /** ReceiverSpec defines the desired state of the Receiver. */
1831
1874
  spec?: Record<string, unknown>;
1832
1875
  });
@@ -1838,7 +1881,8 @@ export declare class Receiver {
1838
1881
 
1839
1882
  export declare class ReferenceGrant {
1840
1883
  constructor(props: {
1841
- metadata?: Record<string, unknown>;
1884
+ /** Standard object's metadata. */
1885
+ metadata?: ObjectMeta;
1842
1886
  /** Spec defines the desired state of ReferenceGrant. */
1843
1887
  spec?: Record<string, unknown>;
1844
1888
  });
@@ -1971,7 +2015,8 @@ export declare class ResourceQuotaList {
1971
2015
 
1972
2016
  export declare class ResourceSet {
1973
2017
  constructor(props: {
1974
- metadata?: Record<string, unknown>;
2018
+ /** Standard object's metadata. */
2019
+ metadata?: ObjectMeta;
1975
2020
  /** ResourceSetSpec defines the desired state of ResourceSet */
1976
2021
  spec?: Record<string, unknown>;
1977
2022
  });
@@ -1983,7 +2028,8 @@ export declare class ResourceSet {
1983
2028
 
1984
2029
  export declare class ResourceSetInputProvider {
1985
2030
  constructor(props: {
1986
- metadata?: Record<string, unknown>;
2031
+ /** Standard object's metadata. */
2032
+ metadata?: ObjectMeta;
1987
2033
  /** ResourceSetInputProviderSpec defines the desired state of ResourceSetInputProvider */
1988
2034
  spec?: Record<string, unknown>;
1989
2035
  });
@@ -2289,7 +2335,8 @@ export declare class ServiceMonitor {
2289
2335
  /** Specification of desired Service selection for target discovery by
2290
2336
  Prometheus. */
2291
2337
  spec: Record<string, unknown>;
2292
- metadata?: Record<string, unknown>;
2338
+ /** Standard object's metadata. */
2339
+ metadata?: ObjectMeta;
2293
2340
  });
2294
2341
  readonly name: string;
2295
2342
  readonly namespace: string;