Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
ActionParameterV2,
ActionTypeV2,
} from "@osdk/internal.foundry.core";
import { consola } from "consola";
import { getModifiedEntityTypes } from "./getEditedEntities.js";

export function wireActionTypeV2ToSdkActionMetadata(
Expand Down Expand Up @@ -50,17 +51,17 @@
): ActionMetadata.Parameter<any> {
return {
multiplicity: value.dataType.type === "array",
type: actionPropertyToSdkPropertyDefinition(

Check failure on line 54 in packages/generator-converters/src/wireActionTypeV2ToSdkActionMetadata.ts

View workflow job for this annotation

GitHub Actions / E2E Tests

Object is possibly 'undefined'.

Check failure on line 54 in packages/generator-converters/src/wireActionTypeV2ToSdkActionMetadata.ts

View workflow job for this annotation

GitHub Actions / Build and Test (22)

Object is possibly 'undefined'.
value.dataType.type === "array" ? value.dataType.subType : value.dataType,
),
).filter((value) => value != null),

Check failure on line 56 in packages/generator-converters/src/wireActionTypeV2ToSdkActionMetadata.ts

View workflow job for this annotation

GitHub Actions / E2E Tests

Property 'filter' does not exist on type 'ValidBaseActionParameterTypes | Object<any> | ObjectSet<any>'.

Check failure on line 56 in packages/generator-converters/src/wireActionTypeV2ToSdkActionMetadata.ts

View workflow job for this annotation

GitHub Actions / E2E Tests

Parameter 'value' implicitly has an 'any' type.

Check failure on line 56 in packages/generator-converters/src/wireActionTypeV2ToSdkActionMetadata.ts

View workflow job for this annotation

GitHub Actions / Build and Test (22)

Property 'filter' does not exist on type 'ValidBaseActionParameterTypes | Object<any> | ObjectSet<any>'.

Check failure on line 56 in packages/generator-converters/src/wireActionTypeV2ToSdkActionMetadata.ts

View workflow job for this annotation

GitHub Actions / Build and Test (22)

Parameter 'value' implicitly has an 'any' type.
nullable: !value.required,
description: value.description,
};
}

function actionPropertyToSdkPropertyDefinition(
parameterType: ActionParameterType,
): ActionMetadata.Parameter["type"] {
): ActionMetadata.Parameter["type"] | undefined {
switch (parameterType.type) {
case "string":
case "boolean":
Expand All @@ -80,9 +81,12 @@
case "array":
return actionPropertyToSdkPropertyDefinition(parameterType.subType);
default:
throw new Error(
`Unsupported action parameter type: ${parameterType.type}`,
consola.info(
`${
JSON.stringify(parameterType.type)
} is not a supported action parameter type`,
);
return undefined;
}
}

Expand Down
Loading