Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/swift-mice-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@osdk/maker-experimental": patch
---

Bug fixes
Original file line number Diff line number Diff line change
Expand Up @@ -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
? [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ function convertPropertySecurityGroups(
groups: [
{
properties: propertyRids,
rid: ridGenerator.generateRid("defaultObjectSecurityPolicy"),
rid: ridGenerator.generatePropertySecurityGroupRid(
"defaultObjectSecurityPolicy",
),
security: {
type: "granular",
granular: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export function convertObjectPropertyType(
property.type,
ridGenerator,
property.apiName,
false,
),
reducers: [],
},
Expand All @@ -82,7 +81,6 @@ export function convertObjectPropertyType(
property.type,
ridGenerator,
property.apiName,
false,
),
typeClasses:
property.typeClasses ??
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand All @@ -51,7 +50,6 @@ export function propertyTypeTypeToOntologyIrType(
fieldTypeDefinition,
ridGenerator,
propertyApiName,
undefined,
),
};
} else {
Expand All @@ -67,7 +65,6 @@ export function propertyTypeTypeToOntologyIrType(
fieldTypeDefinition.fieldType,
ridGenerator,
propertyApiName,
undefined,
),
displayMetadata: fieldTypeDefinition.displayMetadata ?? {
displayName: key,
Expand All @@ -89,7 +86,6 @@ export function propertyTypeTypeToOntologyIrType(
fieldTypeDefinition,
ridGenerator,
propertyApiName,
undefined,
),
};
}
Expand All @@ -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 {
Expand Down
Loading