@prorobotech/openapi-k8s-toolkit 1.1.0-alpha.12 → 1.1.0-alpha.13

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.
@@ -38395,6 +38395,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
38395
38395
  keysToForcedLabel,
38396
38396
  forcedRelatedValuePath,
38397
38397
  jsonPathToArrayOfRefs,
38398
+ forcedApiVersion,
38398
38399
  forcedNamespace,
38399
38400
  baseFactoryNamespacedAPIKey,
38400
38401
  baseFactoryClusterSceopedAPIKey,
@@ -38414,6 +38415,16 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
38414
38415
  template: clusterNamePartOfUrl,
38415
38416
  replaceValues
38416
38417
  });
38418
+ const preparedForcedApiVersion = forcedApiVersion ? forcedApiVersion.map(({ kind, apiVersion }) => ({
38419
+ kind: prepareTemplate({
38420
+ template: kind,
38421
+ replaceValues
38422
+ }),
38423
+ apiVersion: prepareTemplate({
38424
+ template: apiVersion,
38425
+ replaceValues
38426
+ })
38427
+ })) : void 0;
38417
38428
  const preparedForcedNamespace = forcedNamespace ? prepareTemplate({
38418
38429
  template: forcedNamespace,
38419
38430
  replaceValues
@@ -38422,17 +38433,24 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
38422
38433
  if (jsonRoot === void 0) {
38423
38434
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: errorText });
38424
38435
  }
38425
- const refsArr = jp.query(jsonRoot, `$${jsonPathToArrayOfRefs}`)[0];
38436
+ const refsArr = jp.query(jsonRoot, `$${jsonPathToArrayOfRefs}`).flat();
38426
38437
  if (!Array.isArray(refsArr)) {
38427
38438
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: notArrayErrorText });
38428
38439
  }
38429
38440
  if (refsArr.length === 0) {
38430
38441
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: emptyArrayErrorText });
38431
38442
  }
38432
- if (refsArr.some((el) => !isOwnerReference(el))) {
38443
+ const refsArrWithForcedApiVersion = refsArr.map((el) => {
38444
+ const forceFound = preparedForcedApiVersion?.find((force) => force.kind === el.kind);
38445
+ if (forceFound) {
38446
+ return { ...el, apiVersion: forceFound.apiVersion };
38447
+ }
38448
+ return el;
38449
+ });
38450
+ if (refsArrWithForcedApiVersion.some((el) => !isOwnerReference(el))) {
38433
38451
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: isNotRefsArrayErrorText });
38434
38452
  }
38435
- const guardedRefsArr = refsArr;
38453
+ const guardedRefsArr = refsArrWithForcedApiVersion;
38436
38454
  if (isMultiqueryLoading) {
38437
38455
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
38438
38456
  }
@@ -38850,6 +38868,9 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
38850
38868
  }) => {
38851
38869
  if (possibleCustomTypeWithProps) {
38852
38870
  const { type, customProps } = possibleCustomTypeWithProps;
38871
+ if (type === "factory") {
38872
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(TableFactory, { record, customProps, theme });
38873
+ }
38853
38874
  if (value === void 0 && possibleUndefinedValue) {
38854
38875
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ShortenedTextWithTooltip, { trimLength: possibleTrimLength, text: possibleUndefinedValue });
38855
38876
  }
@@ -38887,9 +38908,6 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
38887
38908
  }
38888
38909
  return /* @__PURE__ */ jsxRuntimeExports.jsx(TrimmedTags, { tags, trimLength: possibleTrimLength });
38889
38910
  }
38890
- if (type === "factory") {
38891
- return /* @__PURE__ */ jsxRuntimeExports.jsx(TableFactory, { record, customProps, theme });
38892
- }
38893
38911
  }
38894
38912
  if (value === null) {
38895
38913
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "null" });