diff --git a/.changeset/swift-mice-call.md b/.changeset/swift-mice-call.md new file mode 100644 index 0000000000..089ed51a91 --- /dev/null +++ b/.changeset/swift-mice-call.md @@ -0,0 +1,5 @@ +--- +"@osdk/maker-experimental": patch +--- + +Bug fixes diff --git a/packages/maker-experimental/src/conversion/toMarketplace/convertActionHelpers.ts b/packages/maker-experimental/src/conversion/toMarketplace/convertActionHelpers.ts index e0cc091931..6764394261 100644 --- a/packages/maker-experimental/src/conversion/toMarketplace/convertActionHelpers.ts +++ b/packages/maker-experimental/src/conversion/toMarketplace/convertActionHelpers.ts @@ -617,6 +617,10 @@ function buildActionMetadata( }, description: action.description ?? "", displayName: action.displayName, + icon: { + type: "blueprint" as const, + blueprint: action.icon ?? { locator: "edit", color: "#000000" }, + }, applyingMessage: [] as Array<{ type: string; message: string }>, successMessage: action.submissionMetadata?.successMessage ? [ diff --git a/packages/maker-experimental/src/conversion/toMarketplace/convertDatasourceDefinition.ts b/packages/maker-experimental/src/conversion/toMarketplace/convertDatasourceDefinition.ts index 9f478d7858..a9cffe2451 100644 --- a/packages/maker-experimental/src/conversion/toMarketplace/convertDatasourceDefinition.ts +++ b/packages/maker-experimental/src/conversion/toMarketplace/convertDatasourceDefinition.ts @@ -228,7 +228,9 @@ function convertPropertySecurityGroups( groups: [ { properties: propertyRids, - rid: ridGenerator.generateRid("defaultObjectSecurityPolicy"), + rid: ridGenerator.generatePropertySecurityGroupRid( + "defaultObjectSecurityPolicy", + ), security: { type: "granular", granular: { diff --git a/packages/maker-experimental/src/conversion/toMarketplace/convertObjectPropertyType.ts b/packages/maker-experimental/src/conversion/toMarketplace/convertObjectPropertyType.ts index 48c2483665..8d2e8869e8 100644 --- a/packages/maker-experimental/src/conversion/toMarketplace/convertObjectPropertyType.ts +++ b/packages/maker-experimental/src/conversion/toMarketplace/convertObjectPropertyType.ts @@ -73,7 +73,6 @@ export function convertObjectPropertyType( property.type, ridGenerator, property.apiName, - false, ), reducers: [], }, @@ -82,7 +81,6 @@ export function convertObjectPropertyType( property.type, ridGenerator, property.apiName, - false, ), typeClasses: property.typeClasses ?? diff --git a/packages/maker-experimental/src/conversion/toMarketplace/convertSpt.ts b/packages/maker-experimental/src/conversion/toMarketplace/convertSpt.ts index d4cb2e14f5..77a4951ac8 100644 --- a/packages/maker-experimental/src/conversion/toMarketplace/convertSpt.ts +++ b/packages/maker-experimental/src/conversion/toMarketplace/convertSpt.ts @@ -61,12 +61,11 @@ export function convertSpt( type, ridGenerator, apiName, - true, ), reducers: [], }, } - : propertyTypeTypeToOntologyIrType(type, ridGenerator, apiName, true), + : propertyTypeTypeToOntologyIrType(type, ridGenerator, apiName), aliases: aliases ?? [], baseFormatter, dataConstraints: dataConstraint, diff --git a/packages/maker-experimental/src/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.ts b/packages/maker-experimental/src/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.ts index 4bcbe67161..ef9d78bad2 100644 --- a/packages/maker-experimental/src/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.ts +++ b/packages/maker-experimental/src/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.ts @@ -24,7 +24,6 @@ export function propertyTypeTypeToOntologyIrType( type: PropertyTypeType, ridGenerator: OntologyRidGenerator, propertyApiName?: string, - includeMainValue?: boolean, ): Type { switch (true) { case typeof type === "object" && type.type === "marking": @@ -51,7 +50,6 @@ export function propertyTypeTypeToOntologyIrType( fieldTypeDefinition, ridGenerator, propertyApiName, - undefined, ), }; } else { @@ -67,7 +65,6 @@ export function propertyTypeTypeToOntologyIrType( fieldTypeDefinition.fieldType, ridGenerator, propertyApiName, - undefined, ), displayMetadata: fieldTypeDefinition.displayMetadata ?? { displayName: key, @@ -89,7 +86,6 @@ export function propertyTypeTypeToOntologyIrType( fieldTypeDefinition, ridGenerator, propertyApiName, - undefined, ), }; } @@ -98,15 +94,25 @@ export function propertyTypeTypeToOntologyIrType( structFields.push(field); } - // Build mainValue from the first struct field (matches Java behavior) - // Only SPTs get mainValue populated; object property structs have mainValue: null - const mainValue = includeMainValue - ? structFields[0] - ? { - type: structFields[0].fieldType, - fields: [structFields[0].structFieldRid], - } - : undefined + const mainValue = type.mainValue + ? { + type: propertyTypeTypeToOntologyIrType( + type.mainValue.type, + ridGenerator, + propertyApiName, + ), + fields: (Array.isArray(type.mainValue.fields) + ? type.mainValue.fields + : [type.mainValue.fields] + ).map((fieldApiName) => + propertyApiName + ? ridGenerator.generateStructFieldRid( + propertyApiName, + fieldApiName, + ) + : ridGenerator.generateRid(`structfield.${fieldApiName}`), + ), + } : undefined; return {