@osdk/maker-experimental 0.52.0 → 0.53.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @osdk/maker-experimental
2
2
 
3
+ ## 0.53.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 32cd3f8: Stop generating input shapes for spt-backed interface props
8
+
3
9
  ## 0.52.0
4
10
 
5
11
  ### Minor Changes
@@ -34,7 +34,7 @@ const apiNamespaceRegex = /^[a-z0-9-]+(\.[a-z0-9-]+)*\.$/u;
34
34
  const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/u;
35
35
  export default async function main(args = process.argv) {
36
36
  consola.log("Generating BlockGeneratorResult for ontology...");
37
- const commandLineOpts = await yargs(hideBin(args)).version("0.52.0" ?? "").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({
37
+ const commandLineOpts = await yargs(hideBin(args)).version("0.53.0" ?? "").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({
38
38
  input: {
39
39
  alias: "i",
40
40
  describe: "Input file",
@@ -201,9 +201,10 @@ function extractImportedInterfaceTypes(importedBlockData, ridGenerator, blockSha
201
201
  const properties = Object.values(interfaceType.propertiesV2 ?? {}).map(propEntry => ridGenerator.toBlockInternalId(ReadableIdGenerator.getForSpt(propEntry.sharedPropertyType.apiName)));
202
202
  const propertiesV2 = [];
203
203
  for (const [propertyRid, property] of Object.entries(interfaceType.propertiesV3 ?? {})) {
204
- const propReadableId = property.type === "sharedPropertyBasedPropertyType" ? ReadableIdGenerator.getForSptBackedInterfaceProperty(interfaceType.apiName, property.sharedPropertyBasedPropertyType.sharedPropertyType.apiName) : ridGenerator.getInterfacePropertyTypeRids().inverse().get(propertyRid);
204
+ if (property.type !== "interfaceDefinedPropertyType") continue;
205
+ const propReadableId = ridGenerator.getInterfacePropertyTypeRids().inverse().get(propertyRid);
205
206
  if (!propReadableId) {
206
- throw new Error(`Missing readable ID for interface property RID ${propertyRid} on interface ${interfaceType.apiName}`);
207
+ throw new Error(`Missing readable ID for interface-defined property RID ${propertyRid} on interface ${interfaceType.apiName}`);
207
208
  }
208
209
  propertiesV2.push(ridGenerator.toBlockInternalId(propReadableId));
209
210
  }
@@ -256,47 +257,28 @@ function extractImportedInterfaceTypes(importedBlockData, ridGenerator, blockSha
256
257
  });
257
258
  }
258
259
 
259
- // Generate interface property type input shapes
260
+ // Generate interface-defined property type input shapes. SPT-backed
261
+ // properties are represented by their shared property type input shapes.
260
262
  for (const [propertyRid, property] of Object.entries(interfaceType.propertiesV3 ?? {})) {
261
- let propReadableId;
262
- let propApiName;
263
- let propInputShape;
264
- if (property.type === "interfaceDefinedPropertyType") {
265
- const registeredReadableId = ridGenerator.getInterfacePropertyTypeRids().inverse().get(propertyRid);
266
- if (!registeredReadableId) {
267
- throw new Error(`Missing readable ID for interface-defined property RID ${propertyRid} on interface ${interfaceType.apiName}`);
268
- }
269
- propReadableId = registeredReadableId;
270
- propApiName = property.interfaceDefinedPropertyType.apiName;
271
- propInputShape = {
272
- about: createLocalizedAbout(property.interfaceDefinedPropertyType.displayMetadata.displayName, property.interfaceDefinedPropertyType.displayMetadata.description ?? ""),
273
- type: {
274
- type: "objectPropertyType",
275
- objectPropertyType: typeToMarketplaceObjectPropertyType(property.interfaceDefinedPropertyType.type)
276
- },
277
- interfaceType: ridGenerator.toBlockInternalId(interfaceReadableId),
278
- requireImplementation: property.interfaceDefinedPropertyType.constraints.requireImplementation
279
- };
280
- } else {
281
- const spt = property.sharedPropertyBasedPropertyType.sharedPropertyType;
282
- propReadableId = ReadableIdGenerator.getForSptBackedInterfaceProperty(interfaceType.apiName, spt.apiName);
283
- propApiName = spt.apiName;
284
- propInputShape = {
285
- about: createLocalizedAbout(spt.displayMetadata.displayName, spt.displayMetadata.description ?? ""),
286
- type: {
287
- type: "objectPropertyType",
288
- objectPropertyType: typeToMarketplaceObjectPropertyType(spt.type)
289
- },
290
- interfaceType: ridGenerator.toBlockInternalId(interfaceReadableId),
291
- requireImplementation: property.sharedPropertyBasedPropertyType.requireImplementation,
292
- sharedPropertyType: ridGenerator.toBlockInternalId(ReadableIdGenerator.getForSpt(spt.apiName))
293
- };
263
+ if (property.type !== "interfaceDefinedPropertyType") continue;
264
+ const propReadableId = ridGenerator.getInterfacePropertyTypeRids().inverse().get(propertyRid);
265
+ if (!propReadableId) {
266
+ throw new Error(`Missing readable ID for interface-defined property RID ${propertyRid} on interface ${interfaceType.apiName}`);
294
267
  }
268
+ const propInputShape = {
269
+ about: createLocalizedAbout(property.interfaceDefinedPropertyType.displayMetadata.displayName, property.interfaceDefinedPropertyType.displayMetadata.description ?? ""),
270
+ type: {
271
+ type: "objectPropertyType",
272
+ objectPropertyType: typeToMarketplaceObjectPropertyType(property.interfaceDefinedPropertyType.type)
273
+ },
274
+ interfaceType: ridGenerator.toBlockInternalId(interfaceReadableId),
275
+ requireImplementation: property.interfaceDefinedPropertyType.constraints.requireImplementation
276
+ };
295
277
  blockShapes.inputShapes.set(propReadableId, {
296
278
  type: "interfacePropertyType",
297
279
  interfacePropertyType: propInputShape
298
280
  });
299
- addApiNamePreset(blockShapes, propReadableId, propApiName);
281
+ addApiNamePreset(blockShapes, propReadableId, property.interfaceDefinedPropertyType.apiName);
300
282
  }
301
283
 
302
284
  // Generate interface link type input shapes
@@ -1 +1 @@
1
- {"version":3,"file":"ImportedShapeExtractor.js","names":["ReadableIdGenerator","typeToMarketplaceObjectPropertyType","extractValueTypeInputShapeIfPresent","createLocalizedAbout","fallbackTitle","fallbackDescription","localizedTitle","localizedDescription","getImportedShapes","importedBlockData","ridGenerator","linkTypeIdsByApiName","blockShapes","inputShapes","Map","inputPresets","outputShapes","inputShapeMetadata","inputMappings","extractImportedObjectTypes","extractImportedLinkTypes","extractImportedInterfaceTypes","extractImportedSharedPropertyTypes","extractImportedActionTypes","objectReadableIds","getObjectTypeRids","inverse","propertyReadableIds","getPropertyTypeRids","rid","objectType","Object","entries","objectTypes","readableId","get","propertyBlockIds","propertyRid","keys","propertyTypes","propReadableId","push","toBlockInternalId","inputShape","about","displayMetadata","displayName","description","editsSupport","objectsBackendVersion","set","type","addApiNamePreset","apiName","isOptional","isAccessedInReconcile","reconcileAccessRequirements","preallocateAccessRequirements","propertyType","sptReadableId","sharedPropertyTypeRid","getSharedPropertyTypeRids","undefined","propInputShape","objectPropertyType","sharedPropertyType","property","linkReadableIds","getLinkTypeRids","linkType","linkTypes","definition","linkInputShape","def","oneToMany","shape","oneToManyLinkMetadata","objectTypeShapeIdOneSide","getObjectTypeBlockId","objectTypeRidOneSide","objectTypeShapeIdManySide","objectTypeRidManySide","manyToOneLinkMetadata","cardinalityHint","manyToMany","objectTypeAToBLinkMetadata","objectTypeShapeIdA","objectTypeRidA","objectTypeShapeIdB","objectTypeRidB","objectTypeBToALinkMetadata","intermediary","objectTypeAShapeId","objectTypeBShapeId","intermediaryObjectTypeShapeId","intermediaryObjectTypeRid","aToIntermediaryLinkTypeShapeId","getLinkTypeBlockId","aToIntermediaryLinkTypeRid","intermediaryToBLinkTypeShapeId","intermediaryToBLinkTypeRid","linkTypeId","id","addPreset","linkTypeIdResolver","linkTypeIdWithoutOntologyPrefix","knownIdentifiers","_rid","interfaceTypeBlock","interfaceTypes","interfaceType","interfaceReadableId","getForInterface","properties","values","propertiesV2","map","propEntry","getForSpt","propertiesV3","getForSptBackedInterfaceProperty","sharedPropertyBasedPropertyType","getInterfacePropertyTypeRids","Error","links","ilt","iltId","interfaceLinkTypes","actionTypeConstraints","constraint","constraintId","interfaceActionTypeConstraints","_sptRid","spt","has","propApiName","registeredReadableId","interfaceDefinedPropertyType","requireImplementation","constraints","interfacePropertyType","interfaceLinkType","linkReadableId","getForInterfaceLinkType","metadata","linkedInterfaceRid","linkedEntityTypeId","linkedReadableId","getInterfaceRids","linkedEntityTypeRef","linkedEntityType","cardinality","required","actionTypeConstraint","constraintReadableId","getForInterfaceActionTypeConstraint","parameterConstraintRefs","parameters","paramRid","paramConstraint","paramDisplayApiName","getForInterfaceParameterConstraint","constraintInputShape","parameterConstraints","interfaceActionTypeConstraint","paramReadableId","paramInputShape","interfaceParameterConstraint","sptBlock","sharedPropertyTypes","valueType","actionTypeBlock","actionTypes","actionApiName","actionType","actionReadableId","getForActionType","parametersV2","parameterIds","_key","parameterId","getForParameter","actionShape","action","converter","ImportedBaseParameterTypeConverter","objectTypeIds","parameter","parameterShape","convert","actionParameter","apiNameResolver","resolver","value","fromSource","exportCompatibility","enforcement","isDefault","objectTypeRid","linkTypeRid","constructor","parameterType","pt","t","includes","objRef","blockId","objectTypeId","ifRef","interfaceTypeRid","dec","precision","scale"],"sources":["ImportedShapeExtractor.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionType,\n IntermediaryLinkDefinition,\n ManyToManyLinkDefinition,\n MarketplaceInterfaceLinkType,\n ObjectTypeRid,\n OntologyBlockDataV2,\n} from \"@osdk/client.unstable\";\nimport type {\n ActionTypeParameterShape,\n ActionTypeShape,\n BaseParameterType,\n InterfaceActionTypeConstraintShape,\n InterfaceLinkTypeInputShape,\n InterfaceParameterConstraintShape,\n InterfacePropertyTypeInputShape,\n InterfaceTypeInputShape,\n InputPreset,\n InputShapeResolver,\n LinkTypeInputShape,\n LinkTypeIntermediaryShape,\n LinkTypeManyToManyInputShape,\n LinkTypeOneToManyShape,\n LocalizedTitleAndDescription,\n ObjectTypeInputShape,\n PropertyInputShape,\n SharedPropertyTypeInputShape,\n} from \"@osdk/client.unstable/api\";\n\nimport type {\n BlockShapes,\n OntologyRidGenerator,\n ReadableId,\n} from \"../../../util/generateRid.js\";\nimport { ReadableIdGenerator } from \"../../../util/generateRid.js\";\nimport { typeToMarketplaceObjectPropertyType } from \"../typeVisitors.js\";\nimport { extractValueTypeInputShapeIfPresent } from \"./IrShapeExtractor.js\";\n\ninterface ImportedBlockShapes extends BlockShapes {\n inputPresets: Map<ReadableId, InputPreset>;\n}\n\nexport type LinkTypeIdsByApiName = Readonly<Record<string, string>>;\n\nfunction createLocalizedAbout(\n fallbackTitle: string,\n fallbackDescription: string = \"\",\n): LocalizedTitleAndDescription {\n return {\n fallbackTitle,\n fallbackDescription,\n localizedTitle: {},\n localizedDescription: {},\n };\n}\n\n/**\n * Extracts INPUT shapes from imported ontology block data.\n * Each imported entity becomes an input shape so the marketplace can wire it\n * from the block that originally defined it.\n */\nexport function getImportedShapes(\n importedBlockData: OntologyBlockDataV2,\n ridGenerator: OntologyRidGenerator,\n linkTypeIdsByApiName: LinkTypeIdsByApiName = {},\n): ImportedBlockShapes {\n const blockShapes: ImportedBlockShapes = {\n inputShapes: new Map(),\n inputPresets: new Map(),\n outputShapes: new Map(),\n inputShapeMetadata: new Map(),\n inputMappings: [],\n };\n\n extractImportedObjectTypes(importedBlockData, ridGenerator, blockShapes);\n extractImportedLinkTypes(\n importedBlockData,\n ridGenerator,\n blockShapes,\n linkTypeIdsByApiName,\n );\n extractImportedInterfaceTypes(importedBlockData, ridGenerator, blockShapes);\n extractImportedSharedPropertyTypes(\n importedBlockData,\n ridGenerator,\n blockShapes,\n );\n extractImportedActionTypes(importedBlockData, ridGenerator, blockShapes);\n\n return blockShapes;\n}\n\nfunction extractImportedObjectTypes(\n importedBlockData: OntologyBlockDataV2,\n ridGenerator: OntologyRidGenerator,\n blockShapes: ImportedBlockShapes,\n): void {\n const objectReadableIds = ridGenerator.getObjectTypeRids().inverse();\n const propertyReadableIds = ridGenerator.getPropertyTypeRids().inverse();\n\n for (const [rid, objectType] of Object.entries(\n importedBlockData.objectTypes,\n )) {\n const readableId = objectReadableIds.get(rid as ObjectTypeRid);\n if (!readableId) continue;\n\n const propertyBlockIds: string[] = [];\n for (const propertyRid of Object.keys(\n objectType.objectType.propertyTypes,\n )) {\n const propReadableId = propertyReadableIds.get(propertyRid);\n if (propReadableId) {\n propertyBlockIds.push(ridGenerator.toBlockInternalId(propReadableId));\n }\n }\n\n const inputShape: ObjectTypeInputShape = {\n about: createLocalizedAbout(\n objectType.objectType.displayMetadata.displayName,\n objectType.objectType.displayMetadata.description ?? \"\",\n ),\n editsSupport: \"ANY\",\n objectsBackendVersion: \"V2\",\n propertyTypes: propertyBlockIds,\n };\n\n blockShapes.inputShapes.set(readableId, {\n type: \"objectType\",\n objectType: inputShape,\n });\n addApiNamePreset(blockShapes, readableId, objectType.objectType.apiName!);\n\n blockShapes.inputShapeMetadata.set(readableId, {\n isOptional: false,\n isAccessedInReconcile: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n preallocateAccessRequirements: \"RESOURCE_PREALLOCATION_REQUIRED\",\n });\n\n // Generate property input shapes\n for (const [propertyRid, propertyType] of Object.entries(\n objectType.objectType.propertyTypes,\n )) {\n const propReadableId = propertyReadableIds.get(propertyRid);\n if (!propReadableId) continue;\n\n const sptReadableId = propertyType.sharedPropertyTypeRid\n ? ridGenerator\n .getSharedPropertyTypeRids()\n .inverse()\n .get(propertyType.sharedPropertyTypeRid)\n : undefined;\n\n const propInputShape: PropertyInputShape = {\n about: createLocalizedAbout(\n propertyType.displayMetadata.displayName,\n propertyType.displayMetadata.description ?? \"\",\n ),\n objectType: ridGenerator.toBlockInternalId(readableId),\n type: {\n type: \"objectPropertyType\",\n objectPropertyType: typeToMarketplaceObjectPropertyType(\n propertyType.type,\n ),\n },\n sharedPropertyType: sptReadableId\n ? ridGenerator.toBlockInternalId(sptReadableId)\n : undefined,\n };\n\n blockShapes.inputShapes.set(propReadableId, {\n type: \"property\",\n property: propInputShape,\n });\n addApiNamePreset(blockShapes, propReadableId, propertyType.apiName!);\n\n blockShapes.inputShapeMetadata.set(propReadableId, {\n isOptional: false,\n isAccessedInReconcile: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n preallocateAccessRequirements: \"RESOURCE_PREALLOCATION_REQUIRED\",\n });\n }\n }\n}\n\nfunction extractImportedLinkTypes(\n importedBlockData: OntologyBlockDataV2,\n ridGenerator: OntologyRidGenerator,\n blockShapes: ImportedBlockShapes,\n linkTypeIdsByApiName: LinkTypeIdsByApiName,\n): void {\n const linkReadableIds = ridGenerator.getLinkTypeRids().inverse();\n\n for (const [rid, linkType] of Object.entries(importedBlockData.linkTypes)) {\n const readableId = linkReadableIds.get(rid);\n if (!readableId) continue;\n\n const definition = linkType.linkType.definition;\n let linkInputShape: LinkTypeInputShape;\n\n switch (definition.type) {\n case \"oneToMany\": {\n const def = definition.oneToMany;\n const shape: LinkTypeOneToManyShape = {\n about: createLocalizedAbout(\n def.oneToManyLinkMetadata.displayMetadata.displayName,\n ),\n objectTypeShapeIdOneSide: getObjectTypeBlockId(\n ridGenerator,\n def.objectTypeRidOneSide,\n ),\n objectTypeShapeIdManySide: getObjectTypeBlockId(\n ridGenerator,\n def.objectTypeRidManySide,\n ),\n manyToOneLinkMetadata: createLocalizedAbout(\n def.manyToOneLinkMetadata.displayMetadata.displayName,\n ),\n oneToManyLinkMetadata: createLocalizedAbout(\n def.oneToManyLinkMetadata.displayMetadata.displayName,\n ),\n cardinalityHint:\n def.cardinalityHint === \"ONE_TO_ONE\" ? \"ONE_TO_ONE\" : \"ONE_TO_MANY\",\n };\n linkInputShape = { type: \"oneToMany\", oneToMany: shape };\n break;\n }\n case \"manyToMany\": {\n const def = definition.manyToMany as ManyToManyLinkDefinition;\n const shape: LinkTypeManyToManyInputShape = {\n about: createLocalizedAbout(\n def.objectTypeAToBLinkMetadata.displayMetadata.displayName,\n ),\n objectTypeShapeIdA: getObjectTypeBlockId(\n ridGenerator,\n def.objectTypeRidA,\n ),\n objectTypeShapeIdB: getObjectTypeBlockId(\n ridGenerator,\n def.objectTypeRidB,\n ),\n objectTypeAToBLinkMetadata: createLocalizedAbout(\n def.objectTypeAToBLinkMetadata.displayMetadata.displayName,\n ),\n objectTypeBToALinkMetadata: createLocalizedAbout(\n def.objectTypeBToALinkMetadata.displayMetadata.displayName,\n ),\n editsSupport: \"ANY\",\n objectsBackendVersion: \"V2\",\n };\n linkInputShape = { type: \"manyToMany\", manyToMany: shape };\n break;\n }\n case \"intermediary\": {\n const def = definition.intermediary as IntermediaryLinkDefinition;\n const shape: LinkTypeIntermediaryShape = {\n about: createLocalizedAbout(\n def.objectTypeAToBLinkMetadata.displayMetadata.displayName,\n ),\n objectTypeAToBLinkMetadata: createLocalizedAbout(\n def.objectTypeAToBLinkMetadata.displayMetadata.displayName,\n ),\n objectTypeBToALinkMetadata: createLocalizedAbout(\n def.objectTypeBToALinkMetadata.displayMetadata.displayName,\n ),\n objectTypeAShapeId: getObjectTypeBlockId(\n ridGenerator,\n def.objectTypeRidA,\n ),\n objectTypeBShapeId: getObjectTypeBlockId(\n ridGenerator,\n def.objectTypeRidB,\n ),\n intermediaryObjectTypeShapeId: getObjectTypeBlockId(\n ridGenerator,\n def.intermediaryObjectTypeRid,\n ),\n aToIntermediaryLinkTypeShapeId: getLinkTypeBlockId(\n ridGenerator,\n def.aToIntermediaryLinkTypeRid,\n ),\n intermediaryToBLinkTypeShapeId: getLinkTypeBlockId(\n ridGenerator,\n def.intermediaryToBLinkTypeRid,\n ),\n };\n linkInputShape = { type: \"intermediary\", intermediary: shape };\n break;\n }\n default:\n continue;\n }\n\n blockShapes.inputShapes.set(readableId, {\n type: \"linkType\",\n linkType: linkInputShape,\n });\n const linkTypeId = linkTypeIdsByApiName[linkType.linkType.id];\n if (linkTypeId !== undefined) {\n addPreset(blockShapes, readableId, {\n type: \"linkTypeIdResolver\",\n linkTypeIdResolver: {\n linkTypeIdWithoutOntologyPrefix: linkTypeId,\n },\n });\n }\n\n blockShapes.inputShapeMetadata.set(readableId, {\n isOptional: false,\n isAccessedInReconcile: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n preallocateAccessRequirements: \"RESOURCE_PREALLOCATION_REQUIRED\",\n });\n }\n}\n\nfunction extractImportedInterfaceTypes(\n importedBlockData: OntologyBlockDataV2,\n ridGenerator: OntologyRidGenerator,\n blockShapes: ImportedBlockShapes,\n): void {\n const knownIdentifiers = importedBlockData.knownIdentifiers;\n\n for (const [_rid, interfaceTypeBlock] of Object.entries(\n importedBlockData.interfaceTypes,\n )) {\n const interfaceType = interfaceTypeBlock.interfaceType;\n const interfaceReadableId = ReadableIdGenerator.getForInterface(\n interfaceType.apiName,\n );\n\n // Build properties list from propertiesV2 (SPT references as BlockInternalIds)\n const properties: string[] = Object.values(\n interfaceType.propertiesV2 ?? {},\n ).map((propEntry) =>\n ridGenerator.toBlockInternalId(\n ReadableIdGenerator.getForSpt(propEntry.sharedPropertyType.apiName),\n ),\n );\n\n const propertiesV2: string[] = [];\n for (const [propertyRid, property] of Object.entries(\n interfaceType.propertiesV3 ?? {},\n )) {\n const propReadableId =\n property.type === \"sharedPropertyBasedPropertyType\"\n ? ReadableIdGenerator.getForSptBackedInterfaceProperty(\n interfaceType.apiName,\n property.sharedPropertyBasedPropertyType.sharedPropertyType\n .apiName,\n )\n : ridGenerator\n .getInterfacePropertyTypeRids()\n .inverse()\n .get(propertyRid);\n if (!propReadableId) {\n throw new Error(\n `Missing readable ID for interface property RID ${propertyRid} on interface ${interfaceType.apiName}`,\n );\n }\n propertiesV2.push(ridGenerator.toBlockInternalId(propReadableId));\n }\n\n // Build links list\n const links: string[] = (interfaceType.links ?? []).map(\n (ilt: MarketplaceInterfaceLinkType) => {\n const iltId = knownIdentifiers.interfaceLinkTypes?.[ilt.rid];\n return iltId ?? ilt.rid;\n },\n );\n\n // Build actionTypeConstraints list\n const actionTypeConstraints: string[] = (\n interfaceType.actionTypeConstraints ?? []\n ).map((constraint) => {\n const constraintId =\n knownIdentifiers.interfaceActionTypeConstraints?.[constraint.rid];\n return constraintId ?? constraint.rid;\n });\n\n const inputShape: InterfaceTypeInputShape = {\n about: createLocalizedAbout(\n interfaceType.displayMetadata.displayName,\n interfaceType.displayMetadata.description ?? \"\",\n ),\n actionTypeConstraints,\n properties,\n propertiesV2,\n links,\n };\n\n blockShapes.inputShapes.set(interfaceReadableId, {\n type: \"interfaceType\",\n interfaceType: inputShape,\n });\n addApiNamePreset(blockShapes, interfaceReadableId, interfaceType.apiName);\n\n // Generate SPT input shapes\n for (const [_sptRid, propEntry] of Object.entries(\n interfaceType.propertiesV2 ?? {},\n )) {\n const spt = propEntry.sharedPropertyType;\n const sptReadableId = ReadableIdGenerator.getForSpt(spt.apiName);\n if (blockShapes.inputShapes.has(sptReadableId)) continue;\n\n blockShapes.inputShapes.set(sptReadableId, {\n type: \"sharedPropertyType\",\n sharedPropertyType: {\n about: createLocalizedAbout(\n spt.displayMetadata.displayName,\n spt.displayMetadata.description ?? \"\",\n ),\n type: {\n type: \"objectPropertyType\",\n objectPropertyType: typeToMarketplaceObjectPropertyType(spt.type),\n },\n },\n });\n addApiNamePreset(blockShapes, sptReadableId, spt.apiName);\n blockShapes.inputShapeMetadata.set(sptReadableId, {\n isOptional: false,\n isAccessedInReconcile: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n preallocateAccessRequirements: \"RESOURCE_PREALLOCATION_REQUIRED\",\n });\n }\n\n // Generate interface property type input shapes\n for (const [propertyRid, property] of Object.entries(\n interfaceType.propertiesV3 ?? {},\n )) {\n let propReadableId: ReadableId;\n let propApiName: string;\n let propInputShape: InterfacePropertyTypeInputShape;\n if (property.type === \"interfaceDefinedPropertyType\") {\n const registeredReadableId = ridGenerator\n .getInterfacePropertyTypeRids()\n .inverse()\n .get(propertyRid);\n if (!registeredReadableId) {\n throw new Error(\n `Missing readable ID for interface-defined property RID ${propertyRid} on interface ${interfaceType.apiName}`,\n );\n }\n propReadableId = registeredReadableId;\n propApiName = property.interfaceDefinedPropertyType.apiName;\n propInputShape = {\n about: createLocalizedAbout(\n property.interfaceDefinedPropertyType.displayMetadata.displayName,\n property.interfaceDefinedPropertyType.displayMetadata.description ??\n \"\",\n ),\n type: {\n type: \"objectPropertyType\",\n objectPropertyType: typeToMarketplaceObjectPropertyType(\n property.interfaceDefinedPropertyType.type,\n ),\n },\n interfaceType: ridGenerator.toBlockInternalId(interfaceReadableId),\n requireImplementation:\n property.interfaceDefinedPropertyType.constraints\n .requireImplementation,\n };\n } else {\n const spt = property.sharedPropertyBasedPropertyType.sharedPropertyType;\n propReadableId = ReadableIdGenerator.getForSptBackedInterfaceProperty(\n interfaceType.apiName,\n spt.apiName,\n );\n propApiName = spt.apiName;\n propInputShape = {\n about: createLocalizedAbout(\n spt.displayMetadata.displayName,\n spt.displayMetadata.description ?? \"\",\n ),\n type: {\n type: \"objectPropertyType\",\n objectPropertyType: typeToMarketplaceObjectPropertyType(spt.type),\n },\n interfaceType: ridGenerator.toBlockInternalId(interfaceReadableId),\n requireImplementation:\n property.sharedPropertyBasedPropertyType.requireImplementation,\n sharedPropertyType: ridGenerator.toBlockInternalId(\n ReadableIdGenerator.getForSpt(spt.apiName),\n ),\n };\n }\n blockShapes.inputShapes.set(propReadableId, {\n type: \"interfacePropertyType\",\n interfacePropertyType: propInputShape,\n });\n addApiNamePreset(blockShapes, propReadableId, propApiName);\n }\n\n // Generate interface link type input shapes\n for (const interfaceLinkType of interfaceType.links ?? []) {\n const linkReadableId = ReadableIdGenerator.getForInterfaceLinkType(\n interfaceType.apiName,\n interfaceLinkType.metadata.apiName,\n );\n\n const linkedInterfaceRid =\n interfaceLinkType.linkedEntityTypeId.type === \"interfaceType\"\n ? interfaceLinkType.linkedEntityTypeId.interfaceType\n : undefined;\n\n const linkedReadableId = linkedInterfaceRid\n ? ridGenerator.getInterfaceRids().inverse().get(linkedInterfaceRid)\n : undefined;\n\n const linkedEntityTypeRef = linkedReadableId\n ? {\n type: \"interfaceType\" as const,\n interfaceType: ridGenerator.toBlockInternalId(linkedReadableId),\n }\n : undefined;\n\n if (!linkedEntityTypeRef) continue;\n\n const linkInputShape: InterfaceLinkTypeInputShape = {\n about: createLocalizedAbout(\n interfaceLinkType.metadata.displayName,\n interfaceLinkType.metadata.description,\n ),\n interfaceType: ridGenerator.toBlockInternalId(interfaceReadableId),\n linkedEntityType: linkedEntityTypeRef,\n cardinality:\n interfaceLinkType.cardinality === \"SINGLE\" ? \"SINGLE\" : \"MANY\",\n required: interfaceLinkType.required,\n };\n\n blockShapes.inputShapes.set(linkReadableId, {\n type: \"interfaceLinkType\",\n interfaceLinkType: linkInputShape,\n });\n addApiNamePreset(\n blockShapes,\n linkReadableId,\n interfaceLinkType.metadata.apiName,\n );\n }\n\n // Generate interface action type constraint input shapes\n for (const actionTypeConstraint of interfaceType.actionTypeConstraints ??\n []) {\n const constraintReadableId =\n ReadableIdGenerator.getForInterfaceActionTypeConstraint(\n interfaceType.apiName,\n actionTypeConstraint.metadata.apiName,\n );\n\n const parameterConstraintRefs: string[] = Object.entries(\n actionTypeConstraint.parameters ?? {},\n ).map(([paramRid, paramConstraint]) => {\n const paramDisplayApiName = paramConstraint.displayMetadata.apiName!;\n return ridGenerator.toBlockInternalId(\n ReadableIdGenerator.getForInterfaceParameterConstraint(\n interfaceType.apiName,\n actionTypeConstraint.metadata.apiName,\n paramDisplayApiName,\n ),\n );\n });\n\n const constraintInputShape: InterfaceActionTypeConstraintShape = {\n about: createLocalizedAbout(\n actionTypeConstraint.metadata.displayName,\n actionTypeConstraint.metadata.description ??\n actionTypeConstraint.metadata.displayName,\n ),\n interfaceType: ridGenerator.toBlockInternalId(interfaceReadableId),\n parameterConstraints: parameterConstraintRefs,\n requireImplementation: actionTypeConstraint.requireImplementation,\n };\n\n blockShapes.inputShapes.set(constraintReadableId, {\n type: \"interfaceActionTypeConstraint\",\n interfaceActionTypeConstraint: constraintInputShape,\n });\n addApiNamePreset(\n blockShapes,\n constraintReadableId,\n actionTypeConstraint.metadata.apiName,\n );\n\n // Generate interface parameter constraint input shapes\n for (const [paramRid, paramConstraint] of Object.entries(\n actionTypeConstraint.parameters ?? {},\n )) {\n const paramDisplayApiName = paramConstraint.displayMetadata.apiName!;\n const paramReadableId =\n ReadableIdGenerator.getForInterfaceParameterConstraint(\n interfaceType.apiName,\n actionTypeConstraint.metadata.apiName,\n paramDisplayApiName,\n );\n\n const paramInputShape: InterfaceParameterConstraintShape = {\n about: createLocalizedAbout(\n paramConstraint.displayMetadata.displayName,\n paramConstraint.displayMetadata.displayName,\n ),\n actionTypeConstraint:\n ridGenerator.toBlockInternalId(constraintReadableId),\n requireImplementation: paramConstraint.requireImplementation,\n type: paramConstraint.type,\n };\n\n blockShapes.inputShapes.set(paramReadableId, {\n type: \"interfaceParameterConstraint\",\n interfaceParameterConstraint: paramInputShape,\n });\n addApiNamePreset(blockShapes, paramReadableId, paramDisplayApiName);\n }\n }\n }\n}\n\nfunction extractImportedSharedPropertyTypes(\n importedBlockData: OntologyBlockDataV2,\n ridGenerator: OntologyRidGenerator,\n blockShapes: ImportedBlockShapes,\n): void {\n for (const [_rid, sptBlock] of Object.entries(\n importedBlockData.sharedPropertyTypes,\n )) {\n const spt = sptBlock.sharedPropertyType;\n const readableId = ReadableIdGenerator.getForSpt(spt.apiName);\n\n const inputShape: SharedPropertyTypeInputShape = {\n about: createLocalizedAbout(\n spt.displayMetadata.displayName,\n spt.displayMetadata.description ?? \"\",\n ),\n type: {\n type: \"objectPropertyType\",\n objectPropertyType: typeToMarketplaceObjectPropertyType(spt.type),\n },\n };\n\n blockShapes.inputShapes.set(readableId, {\n type: \"sharedPropertyType\",\n sharedPropertyType: inputShape,\n });\n addApiNamePreset(blockShapes, readableId, spt.apiName);\n\n blockShapes.inputShapeMetadata.set(readableId, {\n isOptional: false,\n isAccessedInReconcile: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n preallocateAccessRequirements: \"RESOURCE_PREALLOCATION_REQUIRED\",\n });\n\n extractValueTypeInputShapeIfPresent(\n spt.valueType ?? undefined,\n spt.displayMetadata.displayName,\n spt.type,\n blockShapes,\n ridGenerator,\n );\n }\n}\n\nfunction extractImportedActionTypes(\n importedBlockData: OntologyBlockDataV2,\n ridGenerator: OntologyRidGenerator,\n blockShapes: ImportedBlockShapes,\n): void {\n for (const [_rid, actionTypeBlock] of Object.entries(\n importedBlockData.actionTypes ?? {},\n )) {\n const actionApiName = (actionTypeBlock.actionType as ActionType).metadata\n .apiName;\n const actionReadableId =\n ReadableIdGenerator.getForActionType(actionApiName);\n\n const parametersV2: string[] = Object.entries(\n actionTypeBlock.parameterIds ?? {},\n ).map(([_key, parameterId]) => {\n const paramReadableId = ReadableIdGenerator.getForParameter(\n actionApiName,\n parameterId,\n );\n return ridGenerator.toBlockInternalId(paramReadableId);\n });\n\n const actionShape: ActionTypeShape = {\n about: createLocalizedAbout(\n (actionTypeBlock.actionType as ActionType).metadata.displayMetadata\n .displayName,\n (actionTypeBlock.actionType as ActionType).metadata.displayMetadata\n .description,\n ),\n parameters: {},\n parametersV2,\n };\n\n blockShapes.inputShapes.set(actionReadableId, {\n type: \"action\",\n action: actionShape,\n });\n addApiNamePreset(blockShapes, actionReadableId, actionApiName);\n\n // Generate parameter input shapes\n const parameters = (actionTypeBlock.actionType as ActionType).metadata\n .parameters;\n if (parameters) {\n const converter = new ImportedBaseParameterTypeConverter(\n importedBlockData.knownIdentifiers.objectTypeIds,\n importedBlockData.knownIdentifiers.interfaceTypes,\n );\n\n for (const [parameterId, parameter] of Object.entries(parameters)) {\n const paramReadableId = ReadableIdGenerator.getForParameter(\n actionApiName,\n parameterId,\n );\n\n const parameterShape: ActionTypeParameterShape = {\n about: createLocalizedAbout(\n parameter.displayMetadata.displayName,\n parameter.displayMetadata.description,\n ),\n type: converter.convert(parameter.type),\n actionType: ridGenerator.toBlockInternalId(actionReadableId),\n };\n\n blockShapes.inputShapes.set(paramReadableId, {\n type: \"actionParameter\",\n actionParameter: parameterShape,\n });\n addApiNamePreset(blockShapes, paramReadableId, parameterId);\n }\n }\n }\n}\n\nfunction addApiNamePreset(\n blockShapes: ImportedBlockShapes,\n readableId: ReadableId,\n apiName: string,\n): void {\n addPreset(blockShapes, readableId, {\n type: \"apiNameResolver\",\n apiNameResolver: { apiName },\n });\n}\n\nfunction addPreset(\n blockShapes: ImportedBlockShapes,\n readableId: ReadableId,\n resolver: InputShapeResolver,\n): void {\n blockShapes.inputPresets.set(readableId, {\n value: {\n type: \"fromSource\",\n fromSource: { resolver },\n },\n exportCompatibility: \"COMPATIBLE\",\n enforcement: \"SUGGESTED\",\n isDefault: false,\n });\n}\n\nfunction getObjectTypeBlockId(\n ridGenerator: OntologyRidGenerator,\n objectTypeRid: ObjectTypeRid,\n): string {\n const readableId = ridGenerator\n .getObjectTypeRids()\n .inverse()\n .get(objectTypeRid);\n if (!readableId) {\n throw new Error(`Object type RID not found: ${objectTypeRid}`);\n }\n return ridGenerator.toBlockInternalId(readableId);\n}\n\nfunction getLinkTypeBlockId(\n ridGenerator: OntologyRidGenerator,\n linkTypeRid: string,\n): string {\n const readableId = ridGenerator.getLinkTypeRids().inverse().get(linkTypeRid);\n if (!readableId) {\n throw new Error(`Link type RID not found: ${linkTypeRid}`);\n }\n return ridGenerator.toBlockInternalId(readableId);\n}\n\n/**\n * Simplified parameter type converter for imported action types.\n * Mirrors BaseParameterTypeConverter from ActionTypeShapeExtractor.\n */\nclass ImportedBaseParameterTypeConverter {\n private readonly objectTypeIds: Record<string, string>;\n private readonly interfaceTypes: Record<string, string>;\n\n constructor(\n objectTypeIds?: Record<string, string>,\n interfaceTypes?: Record<string, string>,\n ) {\n this.objectTypeIds = objectTypeIds ?? {};\n this.interfaceTypes = interfaceTypes ?? {};\n }\n\n convert(parameterType: { type: string }): BaseParameterType {\n const pt = parameterType as Record<string, unknown> & { type: string };\n const t = pt.type;\n\n // Simple types\n const simpleTypes = [\n \"boolean\",\n \"booleanList\",\n \"integer\",\n \"integerList\",\n \"long\",\n \"longList\",\n \"double\",\n \"doubleList\",\n \"string\",\n \"stringList\",\n \"geohash\",\n \"geohashList\",\n \"geoshape\",\n \"geoshapeList\",\n \"timeSeriesReference\",\n \"timestamp\",\n \"timestampList\",\n \"date\",\n \"dateList\",\n \"attachment\",\n \"attachmentList\",\n \"marking\",\n \"markingList\",\n \"mediaReference\",\n \"objectTypeReference\",\n \"geotimeSeriesReference\",\n \"geotimeSeriesReferenceList\",\n ];\n\n if (simpleTypes.includes(t)) {\n return { type: t, [t]: {} } as unknown as BaseParameterType;\n }\n\n // Object reference types\n if (\n t === \"objectReference\" ||\n t === \"objectReferenceList\" ||\n t === \"objectSetRid\"\n ) {\n const objRef = pt[t] as { objectTypeId: string } | undefined;\n const blockId = objRef\n ? this.objectTypeIds[objRef.objectTypeId]\n : undefined;\n return {\n type: t,\n [t]: { objectTypeId: blockId ?? \"\" },\n } as unknown as BaseParameterType;\n }\n\n // Interface reference types\n if (\n t === \"interfaceReference\" ||\n t === \"interfaceReferenceList\" ||\n t === \"interfaceObjectSetRid\"\n ) {\n const ifRef = pt[t] as { interfaceTypeRid: string } | undefined;\n const blockId = ifRef\n ? this.interfaceTypes[ifRef.interfaceTypeRid]\n : undefined;\n return {\n type: t,\n [t]: { interfaceTypeRid: blockId ?? \"\" },\n } as unknown as BaseParameterType;\n }\n\n // Decimal types\n if (t === \"decimal\" || t === \"decimalList\") {\n const dec = pt[t] as { precision?: number; scale?: number } | undefined;\n return {\n type: t,\n [t]: { precision: dec?.precision, scale: dec?.scale },\n } as unknown as BaseParameterType;\n }\n\n return { type: t, [t]: {} } as unknown as BaseParameterType;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoCA,SAASA,mBAAmB,QAAQ,8BAA8B;AAClE,SAASC,mCAAmC,QAAQ,oBAAoB;AACx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,EACpB;MACA,MAAME,MAAM,GAAGH,EAAE,CAACC,CAAC,CAAyC;MAC5D,MAAMG,OAAO,GAAGD,MAAM,GAClB,IAAI,CAACnB,aAAa,CAACmB,MAAM,CAACE,YAAY,CAAC,GACvCjJ,SAAS;MACb,OAAO;QACLX,IAAI,EAAEwJ,CAAC;QACP,CAACA,CAAC,GAAG;UAAEI,YAAY,EAAED,OAAO,IAAI;QAAG;MACrC,CAAC;IACH;;IAEA;IACA,IACEH,CAAC,KAAK,oBAAoB,IAC1BA,CAAC,KAAK,wBAAwB,IAC9BA,CAAC,KAAK,uBAAuB,EAC7B;MACA,MAAMK,KAAK,GAAGN,EAAE,CAACC,CAAC,CAA6C;MAC/D,MAAMG,OAAO,GAAGE,KAAK,GACjB,IAAI,CAACnG,cAAc,CAACmG,KAAK,CAACC,gBAAgB,CAAC,GAC3CnJ,SAAS;MACb,OAAO;QACLX,IAAI,EAAEwJ,CAAC;QACP,CAACA,CAAC,GAAG;UAAEM,gBAAgB,EAAEH,OAAO,IAAI;QAAG;MACzC,CAAC;IACH;;IAEA;IACA,IAAIH,CAAC,KAAK,SAAS,IAAIA,CAAC,KAAK,aAAa,EAAE;MAC1C,MAAMO,GAAG,GAAGR,EAAE,CAACC,CAAC,CAAuD;MACvE,OAAO;QACLxJ,IAAI,EAAEwJ,CAAC;QACP,CAACA,CAAC,GAAG;UAAEQ,SAAS,EAAED,GAAG,EAAEC,SAAS;UAAEC,KAAK,EAAEF,GAAG,EAAEE;QAAM;MACtD,CAAC;IACH;IAEA,OAAO;MAAEjK,IAAI,EAAEwJ,CAAC;MAAE,CAACA,CAAC,GAAG,CAAC;IAAE,CAAC;EAC7B;AACF","ignoreList":[]}
1
+ {"version":3,"file":"ImportedShapeExtractor.js","names":["ReadableIdGenerator","typeToMarketplaceObjectPropertyType","extractValueTypeInputShapeIfPresent","createLocalizedAbout","fallbackTitle","fallbackDescription","localizedTitle","localizedDescription","getImportedShapes","importedBlockData","ridGenerator","linkTypeIdsByApiName","blockShapes","inputShapes","Map","inputPresets","outputShapes","inputShapeMetadata","inputMappings","extractImportedObjectTypes","extractImportedLinkTypes","extractImportedInterfaceTypes","extractImportedSharedPropertyTypes","extractImportedActionTypes","objectReadableIds","getObjectTypeRids","inverse","propertyReadableIds","getPropertyTypeRids","rid","objectType","Object","entries","objectTypes","readableId","get","propertyBlockIds","propertyRid","keys","propertyTypes","propReadableId","push","toBlockInternalId","inputShape","about","displayMetadata","displayName","description","editsSupport","objectsBackendVersion","set","type","addApiNamePreset","apiName","isOptional","isAccessedInReconcile","reconcileAccessRequirements","preallocateAccessRequirements","propertyType","sptReadableId","sharedPropertyTypeRid","getSharedPropertyTypeRids","undefined","propInputShape","objectPropertyType","sharedPropertyType","property","linkReadableIds","getLinkTypeRids","linkType","linkTypes","definition","linkInputShape","def","oneToMany","shape","oneToManyLinkMetadata","objectTypeShapeIdOneSide","getObjectTypeBlockId","objectTypeRidOneSide","objectTypeShapeIdManySide","objectTypeRidManySide","manyToOneLinkMetadata","cardinalityHint","manyToMany","objectTypeAToBLinkMetadata","objectTypeShapeIdA","objectTypeRidA","objectTypeShapeIdB","objectTypeRidB","objectTypeBToALinkMetadata","intermediary","objectTypeAShapeId","objectTypeBShapeId","intermediaryObjectTypeShapeId","intermediaryObjectTypeRid","aToIntermediaryLinkTypeShapeId","getLinkTypeBlockId","aToIntermediaryLinkTypeRid","intermediaryToBLinkTypeShapeId","intermediaryToBLinkTypeRid","linkTypeId","id","addPreset","linkTypeIdResolver","linkTypeIdWithoutOntologyPrefix","knownIdentifiers","_rid","interfaceTypeBlock","interfaceTypes","interfaceType","interfaceReadableId","getForInterface","properties","values","propertiesV2","map","propEntry","getForSpt","propertiesV3","getInterfacePropertyTypeRids","Error","links","ilt","iltId","interfaceLinkTypes","actionTypeConstraints","constraint","constraintId","interfaceActionTypeConstraints","_sptRid","spt","has","interfaceDefinedPropertyType","requireImplementation","constraints","interfacePropertyType","interfaceLinkType","linkReadableId","getForInterfaceLinkType","metadata","linkedInterfaceRid","linkedEntityTypeId","linkedReadableId","getInterfaceRids","linkedEntityTypeRef","linkedEntityType","cardinality","required","actionTypeConstraint","constraintReadableId","getForInterfaceActionTypeConstraint","parameterConstraintRefs","parameters","paramRid","paramConstraint","paramDisplayApiName","getForInterfaceParameterConstraint","constraintInputShape","parameterConstraints","interfaceActionTypeConstraint","paramReadableId","paramInputShape","interfaceParameterConstraint","sptBlock","sharedPropertyTypes","valueType","actionTypeBlock","actionTypes","actionApiName","actionType","actionReadableId","getForActionType","parametersV2","parameterIds","_key","parameterId","getForParameter","actionShape","action","converter","ImportedBaseParameterTypeConverter","objectTypeIds","parameter","parameterShape","convert","actionParameter","apiNameResolver","resolver","value","fromSource","exportCompatibility","enforcement","isDefault","objectTypeRid","linkTypeRid","constructor","parameterType","pt","t","includes","objRef","blockId","objectTypeId","ifRef","interfaceTypeRid","dec","precision","scale"],"sources":["ImportedShapeExtractor.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ActionType,\n IntermediaryLinkDefinition,\n ManyToManyLinkDefinition,\n MarketplaceInterfaceLinkType,\n ObjectTypeRid,\n OntologyBlockDataV2,\n} from \"@osdk/client.unstable\";\nimport type {\n ActionTypeParameterShape,\n ActionTypeShape,\n BaseParameterType,\n InterfaceActionTypeConstraintShape,\n InterfaceLinkTypeInputShape,\n InterfaceParameterConstraintShape,\n InterfacePropertyTypeInputShape,\n InterfaceTypeInputShape,\n InputPreset,\n InputShapeResolver,\n LinkTypeInputShape,\n LinkTypeIntermediaryShape,\n LinkTypeManyToManyInputShape,\n LinkTypeOneToManyShape,\n LocalizedTitleAndDescription,\n ObjectTypeInputShape,\n PropertyInputShape,\n SharedPropertyTypeInputShape,\n} from \"@osdk/client.unstable/api\";\n\nimport type {\n BlockShapes,\n OntologyRidGenerator,\n ReadableId,\n} from \"../../../util/generateRid.js\";\nimport { ReadableIdGenerator } from \"../../../util/generateRid.js\";\nimport { typeToMarketplaceObjectPropertyType } from \"../typeVisitors.js\";\nimport { extractValueTypeInputShapeIfPresent } from \"./IrShapeExtractor.js\";\n\ninterface ImportedBlockShapes extends BlockShapes {\n inputPresets: Map<ReadableId, InputPreset>;\n}\n\nexport type LinkTypeIdsByApiName = Readonly<Record<string, string>>;\n\nfunction createLocalizedAbout(\n fallbackTitle: string,\n fallbackDescription: string = \"\",\n): LocalizedTitleAndDescription {\n return {\n fallbackTitle,\n fallbackDescription,\n localizedTitle: {},\n localizedDescription: {},\n };\n}\n\n/**\n * Extracts INPUT shapes from imported ontology block data.\n * Each imported entity becomes an input shape so the marketplace can wire it\n * from the block that originally defined it.\n */\nexport function getImportedShapes(\n importedBlockData: OntologyBlockDataV2,\n ridGenerator: OntologyRidGenerator,\n linkTypeIdsByApiName: LinkTypeIdsByApiName = {},\n): ImportedBlockShapes {\n const blockShapes: ImportedBlockShapes = {\n inputShapes: new Map(),\n inputPresets: new Map(),\n outputShapes: new Map(),\n inputShapeMetadata: new Map(),\n inputMappings: [],\n };\n\n extractImportedObjectTypes(importedBlockData, ridGenerator, blockShapes);\n extractImportedLinkTypes(\n importedBlockData,\n ridGenerator,\n blockShapes,\n linkTypeIdsByApiName,\n );\n extractImportedInterfaceTypes(importedBlockData, ridGenerator, blockShapes);\n extractImportedSharedPropertyTypes(\n importedBlockData,\n ridGenerator,\n blockShapes,\n );\n extractImportedActionTypes(importedBlockData, ridGenerator, blockShapes);\n\n return blockShapes;\n}\n\nfunction extractImportedObjectTypes(\n importedBlockData: OntologyBlockDataV2,\n ridGenerator: OntologyRidGenerator,\n blockShapes: ImportedBlockShapes,\n): void {\n const objectReadableIds = ridGenerator.getObjectTypeRids().inverse();\n const propertyReadableIds = ridGenerator.getPropertyTypeRids().inverse();\n\n for (const [rid, objectType] of Object.entries(\n importedBlockData.objectTypes,\n )) {\n const readableId = objectReadableIds.get(rid as ObjectTypeRid);\n if (!readableId) continue;\n\n const propertyBlockIds: string[] = [];\n for (const propertyRid of Object.keys(\n objectType.objectType.propertyTypes,\n )) {\n const propReadableId = propertyReadableIds.get(propertyRid);\n if (propReadableId) {\n propertyBlockIds.push(ridGenerator.toBlockInternalId(propReadableId));\n }\n }\n\n const inputShape: ObjectTypeInputShape = {\n about: createLocalizedAbout(\n objectType.objectType.displayMetadata.displayName,\n objectType.objectType.displayMetadata.description ?? \"\",\n ),\n editsSupport: \"ANY\",\n objectsBackendVersion: \"V2\",\n propertyTypes: propertyBlockIds,\n };\n\n blockShapes.inputShapes.set(readableId, {\n type: \"objectType\",\n objectType: inputShape,\n });\n addApiNamePreset(blockShapes, readableId, objectType.objectType.apiName!);\n\n blockShapes.inputShapeMetadata.set(readableId, {\n isOptional: false,\n isAccessedInReconcile: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n preallocateAccessRequirements: \"RESOURCE_PREALLOCATION_REQUIRED\",\n });\n\n // Generate property input shapes\n for (const [propertyRid, propertyType] of Object.entries(\n objectType.objectType.propertyTypes,\n )) {\n const propReadableId = propertyReadableIds.get(propertyRid);\n if (!propReadableId) continue;\n\n const sptReadableId = propertyType.sharedPropertyTypeRid\n ? ridGenerator\n .getSharedPropertyTypeRids()\n .inverse()\n .get(propertyType.sharedPropertyTypeRid)\n : undefined;\n\n const propInputShape: PropertyInputShape = {\n about: createLocalizedAbout(\n propertyType.displayMetadata.displayName,\n propertyType.displayMetadata.description ?? \"\",\n ),\n objectType: ridGenerator.toBlockInternalId(readableId),\n type: {\n type: \"objectPropertyType\",\n objectPropertyType: typeToMarketplaceObjectPropertyType(\n propertyType.type,\n ),\n },\n sharedPropertyType: sptReadableId\n ? ridGenerator.toBlockInternalId(sptReadableId)\n : undefined,\n };\n\n blockShapes.inputShapes.set(propReadableId, {\n type: \"property\",\n property: propInputShape,\n });\n addApiNamePreset(blockShapes, propReadableId, propertyType.apiName!);\n\n blockShapes.inputShapeMetadata.set(propReadableId, {\n isOptional: false,\n isAccessedInReconcile: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n preallocateAccessRequirements: \"RESOURCE_PREALLOCATION_REQUIRED\",\n });\n }\n }\n}\n\nfunction extractImportedLinkTypes(\n importedBlockData: OntologyBlockDataV2,\n ridGenerator: OntologyRidGenerator,\n blockShapes: ImportedBlockShapes,\n linkTypeIdsByApiName: LinkTypeIdsByApiName,\n): void {\n const linkReadableIds = ridGenerator.getLinkTypeRids().inverse();\n\n for (const [rid, linkType] of Object.entries(importedBlockData.linkTypes)) {\n const readableId = linkReadableIds.get(rid);\n if (!readableId) continue;\n\n const definition = linkType.linkType.definition;\n let linkInputShape: LinkTypeInputShape;\n\n switch (definition.type) {\n case \"oneToMany\": {\n const def = definition.oneToMany;\n const shape: LinkTypeOneToManyShape = {\n about: createLocalizedAbout(\n def.oneToManyLinkMetadata.displayMetadata.displayName,\n ),\n objectTypeShapeIdOneSide: getObjectTypeBlockId(\n ridGenerator,\n def.objectTypeRidOneSide,\n ),\n objectTypeShapeIdManySide: getObjectTypeBlockId(\n ridGenerator,\n def.objectTypeRidManySide,\n ),\n manyToOneLinkMetadata: createLocalizedAbout(\n def.manyToOneLinkMetadata.displayMetadata.displayName,\n ),\n oneToManyLinkMetadata: createLocalizedAbout(\n def.oneToManyLinkMetadata.displayMetadata.displayName,\n ),\n cardinalityHint:\n def.cardinalityHint === \"ONE_TO_ONE\" ? \"ONE_TO_ONE\" : \"ONE_TO_MANY\",\n };\n linkInputShape = { type: \"oneToMany\", oneToMany: shape };\n break;\n }\n case \"manyToMany\": {\n const def = definition.manyToMany as ManyToManyLinkDefinition;\n const shape: LinkTypeManyToManyInputShape = {\n about: createLocalizedAbout(\n def.objectTypeAToBLinkMetadata.displayMetadata.displayName,\n ),\n objectTypeShapeIdA: getObjectTypeBlockId(\n ridGenerator,\n def.objectTypeRidA,\n ),\n objectTypeShapeIdB: getObjectTypeBlockId(\n ridGenerator,\n def.objectTypeRidB,\n ),\n objectTypeAToBLinkMetadata: createLocalizedAbout(\n def.objectTypeAToBLinkMetadata.displayMetadata.displayName,\n ),\n objectTypeBToALinkMetadata: createLocalizedAbout(\n def.objectTypeBToALinkMetadata.displayMetadata.displayName,\n ),\n editsSupport: \"ANY\",\n objectsBackendVersion: \"V2\",\n };\n linkInputShape = { type: \"manyToMany\", manyToMany: shape };\n break;\n }\n case \"intermediary\": {\n const def = definition.intermediary as IntermediaryLinkDefinition;\n const shape: LinkTypeIntermediaryShape = {\n about: createLocalizedAbout(\n def.objectTypeAToBLinkMetadata.displayMetadata.displayName,\n ),\n objectTypeAToBLinkMetadata: createLocalizedAbout(\n def.objectTypeAToBLinkMetadata.displayMetadata.displayName,\n ),\n objectTypeBToALinkMetadata: createLocalizedAbout(\n def.objectTypeBToALinkMetadata.displayMetadata.displayName,\n ),\n objectTypeAShapeId: getObjectTypeBlockId(\n ridGenerator,\n def.objectTypeRidA,\n ),\n objectTypeBShapeId: getObjectTypeBlockId(\n ridGenerator,\n def.objectTypeRidB,\n ),\n intermediaryObjectTypeShapeId: getObjectTypeBlockId(\n ridGenerator,\n def.intermediaryObjectTypeRid,\n ),\n aToIntermediaryLinkTypeShapeId: getLinkTypeBlockId(\n ridGenerator,\n def.aToIntermediaryLinkTypeRid,\n ),\n intermediaryToBLinkTypeShapeId: getLinkTypeBlockId(\n ridGenerator,\n def.intermediaryToBLinkTypeRid,\n ),\n };\n linkInputShape = { type: \"intermediary\", intermediary: shape };\n break;\n }\n default:\n continue;\n }\n\n blockShapes.inputShapes.set(readableId, {\n type: \"linkType\",\n linkType: linkInputShape,\n });\n const linkTypeId = linkTypeIdsByApiName[linkType.linkType.id];\n if (linkTypeId !== undefined) {\n addPreset(blockShapes, readableId, {\n type: \"linkTypeIdResolver\",\n linkTypeIdResolver: {\n linkTypeIdWithoutOntologyPrefix: linkTypeId,\n },\n });\n }\n\n blockShapes.inputShapeMetadata.set(readableId, {\n isOptional: false,\n isAccessedInReconcile: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n preallocateAccessRequirements: \"RESOURCE_PREALLOCATION_REQUIRED\",\n });\n }\n}\n\nfunction extractImportedInterfaceTypes(\n importedBlockData: OntologyBlockDataV2,\n ridGenerator: OntologyRidGenerator,\n blockShapes: ImportedBlockShapes,\n): void {\n const knownIdentifiers = importedBlockData.knownIdentifiers;\n\n for (const [_rid, interfaceTypeBlock] of Object.entries(\n importedBlockData.interfaceTypes,\n )) {\n const interfaceType = interfaceTypeBlock.interfaceType;\n const interfaceReadableId = ReadableIdGenerator.getForInterface(\n interfaceType.apiName,\n );\n\n // Build properties list from propertiesV2 (SPT references as BlockInternalIds)\n const properties: string[] = Object.values(\n interfaceType.propertiesV2 ?? {},\n ).map((propEntry) =>\n ridGenerator.toBlockInternalId(\n ReadableIdGenerator.getForSpt(propEntry.sharedPropertyType.apiName),\n ),\n );\n\n const propertiesV2: string[] = [];\n for (const [propertyRid, property] of Object.entries(\n interfaceType.propertiesV3 ?? {},\n )) {\n if (property.type !== \"interfaceDefinedPropertyType\") continue;\n const propReadableId = ridGenerator\n .getInterfacePropertyTypeRids()\n .inverse()\n .get(propertyRid);\n if (!propReadableId) {\n throw new Error(\n `Missing readable ID for interface-defined property RID ${propertyRid} on interface ${interfaceType.apiName}`,\n );\n }\n propertiesV2.push(ridGenerator.toBlockInternalId(propReadableId));\n }\n\n // Build links list\n const links: string[] = (interfaceType.links ?? []).map(\n (ilt: MarketplaceInterfaceLinkType) => {\n const iltId = knownIdentifiers.interfaceLinkTypes?.[ilt.rid];\n return iltId ?? ilt.rid;\n },\n );\n\n // Build actionTypeConstraints list\n const actionTypeConstraints: string[] = (\n interfaceType.actionTypeConstraints ?? []\n ).map((constraint) => {\n const constraintId =\n knownIdentifiers.interfaceActionTypeConstraints?.[constraint.rid];\n return constraintId ?? constraint.rid;\n });\n\n const inputShape: InterfaceTypeInputShape = {\n about: createLocalizedAbout(\n interfaceType.displayMetadata.displayName,\n interfaceType.displayMetadata.description ?? \"\",\n ),\n actionTypeConstraints,\n properties,\n propertiesV2,\n links,\n };\n\n blockShapes.inputShapes.set(interfaceReadableId, {\n type: \"interfaceType\",\n interfaceType: inputShape,\n });\n addApiNamePreset(blockShapes, interfaceReadableId, interfaceType.apiName);\n\n // Generate SPT input shapes\n for (const [_sptRid, propEntry] of Object.entries(\n interfaceType.propertiesV2 ?? {},\n )) {\n const spt = propEntry.sharedPropertyType;\n const sptReadableId = ReadableIdGenerator.getForSpt(spt.apiName);\n if (blockShapes.inputShapes.has(sptReadableId)) continue;\n\n blockShapes.inputShapes.set(sptReadableId, {\n type: \"sharedPropertyType\",\n sharedPropertyType: {\n about: createLocalizedAbout(\n spt.displayMetadata.displayName,\n spt.displayMetadata.description ?? \"\",\n ),\n type: {\n type: \"objectPropertyType\",\n objectPropertyType: typeToMarketplaceObjectPropertyType(spt.type),\n },\n },\n });\n addApiNamePreset(blockShapes, sptReadableId, spt.apiName);\n blockShapes.inputShapeMetadata.set(sptReadableId, {\n isOptional: false,\n isAccessedInReconcile: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n preallocateAccessRequirements: \"RESOURCE_PREALLOCATION_REQUIRED\",\n });\n }\n\n // Generate interface-defined property type input shapes. SPT-backed\n // properties are represented by their shared property type input shapes.\n for (const [propertyRid, property] of Object.entries(\n interfaceType.propertiesV3 ?? {},\n )) {\n if (property.type !== \"interfaceDefinedPropertyType\") continue;\n const propReadableId = ridGenerator\n .getInterfacePropertyTypeRids()\n .inverse()\n .get(propertyRid);\n if (!propReadableId) {\n throw new Error(\n `Missing readable ID for interface-defined property RID ${propertyRid} on interface ${interfaceType.apiName}`,\n );\n }\n const propInputShape: InterfacePropertyTypeInputShape = {\n about: createLocalizedAbout(\n property.interfaceDefinedPropertyType.displayMetadata.displayName,\n property.interfaceDefinedPropertyType.displayMetadata.description ??\n \"\",\n ),\n type: {\n type: \"objectPropertyType\",\n objectPropertyType: typeToMarketplaceObjectPropertyType(\n property.interfaceDefinedPropertyType.type,\n ),\n },\n interfaceType: ridGenerator.toBlockInternalId(interfaceReadableId),\n requireImplementation:\n property.interfaceDefinedPropertyType.constraints\n .requireImplementation,\n };\n blockShapes.inputShapes.set(propReadableId, {\n type: \"interfacePropertyType\",\n interfacePropertyType: propInputShape,\n });\n addApiNamePreset(\n blockShapes,\n propReadableId,\n property.interfaceDefinedPropertyType.apiName,\n );\n }\n\n // Generate interface link type input shapes\n for (const interfaceLinkType of interfaceType.links ?? []) {\n const linkReadableId = ReadableIdGenerator.getForInterfaceLinkType(\n interfaceType.apiName,\n interfaceLinkType.metadata.apiName,\n );\n\n const linkedInterfaceRid =\n interfaceLinkType.linkedEntityTypeId.type === \"interfaceType\"\n ? interfaceLinkType.linkedEntityTypeId.interfaceType\n : undefined;\n\n const linkedReadableId = linkedInterfaceRid\n ? ridGenerator.getInterfaceRids().inverse().get(linkedInterfaceRid)\n : undefined;\n\n const linkedEntityTypeRef = linkedReadableId\n ? {\n type: \"interfaceType\" as const,\n interfaceType: ridGenerator.toBlockInternalId(linkedReadableId),\n }\n : undefined;\n\n if (!linkedEntityTypeRef) continue;\n\n const linkInputShape: InterfaceLinkTypeInputShape = {\n about: createLocalizedAbout(\n interfaceLinkType.metadata.displayName,\n interfaceLinkType.metadata.description,\n ),\n interfaceType: ridGenerator.toBlockInternalId(interfaceReadableId),\n linkedEntityType: linkedEntityTypeRef,\n cardinality:\n interfaceLinkType.cardinality === \"SINGLE\" ? \"SINGLE\" : \"MANY\",\n required: interfaceLinkType.required,\n };\n\n blockShapes.inputShapes.set(linkReadableId, {\n type: \"interfaceLinkType\",\n interfaceLinkType: linkInputShape,\n });\n addApiNamePreset(\n blockShapes,\n linkReadableId,\n interfaceLinkType.metadata.apiName,\n );\n }\n\n // Generate interface action type constraint input shapes\n for (const actionTypeConstraint of interfaceType.actionTypeConstraints ??\n []) {\n const constraintReadableId =\n ReadableIdGenerator.getForInterfaceActionTypeConstraint(\n interfaceType.apiName,\n actionTypeConstraint.metadata.apiName,\n );\n\n const parameterConstraintRefs: string[] = Object.entries(\n actionTypeConstraint.parameters ?? {},\n ).map(([paramRid, paramConstraint]) => {\n const paramDisplayApiName = paramConstraint.displayMetadata.apiName!;\n return ridGenerator.toBlockInternalId(\n ReadableIdGenerator.getForInterfaceParameterConstraint(\n interfaceType.apiName,\n actionTypeConstraint.metadata.apiName,\n paramDisplayApiName,\n ),\n );\n });\n\n const constraintInputShape: InterfaceActionTypeConstraintShape = {\n about: createLocalizedAbout(\n actionTypeConstraint.metadata.displayName,\n actionTypeConstraint.metadata.description ??\n actionTypeConstraint.metadata.displayName,\n ),\n interfaceType: ridGenerator.toBlockInternalId(interfaceReadableId),\n parameterConstraints: parameterConstraintRefs,\n requireImplementation: actionTypeConstraint.requireImplementation,\n };\n\n blockShapes.inputShapes.set(constraintReadableId, {\n type: \"interfaceActionTypeConstraint\",\n interfaceActionTypeConstraint: constraintInputShape,\n });\n addApiNamePreset(\n blockShapes,\n constraintReadableId,\n actionTypeConstraint.metadata.apiName,\n );\n\n // Generate interface parameter constraint input shapes\n for (const [paramRid, paramConstraint] of Object.entries(\n actionTypeConstraint.parameters ?? {},\n )) {\n const paramDisplayApiName = paramConstraint.displayMetadata.apiName!;\n const paramReadableId =\n ReadableIdGenerator.getForInterfaceParameterConstraint(\n interfaceType.apiName,\n actionTypeConstraint.metadata.apiName,\n paramDisplayApiName,\n );\n\n const paramInputShape: InterfaceParameterConstraintShape = {\n about: createLocalizedAbout(\n paramConstraint.displayMetadata.displayName,\n paramConstraint.displayMetadata.displayName,\n ),\n actionTypeConstraint:\n ridGenerator.toBlockInternalId(constraintReadableId),\n requireImplementation: paramConstraint.requireImplementation,\n type: paramConstraint.type,\n };\n\n blockShapes.inputShapes.set(paramReadableId, {\n type: \"interfaceParameterConstraint\",\n interfaceParameterConstraint: paramInputShape,\n });\n addApiNamePreset(blockShapes, paramReadableId, paramDisplayApiName);\n }\n }\n }\n}\n\nfunction extractImportedSharedPropertyTypes(\n importedBlockData: OntologyBlockDataV2,\n ridGenerator: OntologyRidGenerator,\n blockShapes: ImportedBlockShapes,\n): void {\n for (const [_rid, sptBlock] of Object.entries(\n importedBlockData.sharedPropertyTypes,\n )) {\n const spt = sptBlock.sharedPropertyType;\n const readableId = ReadableIdGenerator.getForSpt(spt.apiName);\n\n const inputShape: SharedPropertyTypeInputShape = {\n about: createLocalizedAbout(\n spt.displayMetadata.displayName,\n spt.displayMetadata.description ?? \"\",\n ),\n type: {\n type: \"objectPropertyType\",\n objectPropertyType: typeToMarketplaceObjectPropertyType(spt.type),\n },\n };\n\n blockShapes.inputShapes.set(readableId, {\n type: \"sharedPropertyType\",\n sharedPropertyType: inputShape,\n });\n addApiNamePreset(blockShapes, readableId, spt.apiName);\n\n blockShapes.inputShapeMetadata.set(readableId, {\n isOptional: false,\n isAccessedInReconcile: true,\n reconcileAccessRequirements: \"RESOURCE_EXISTENCE_REQUIRED\",\n preallocateAccessRequirements: \"RESOURCE_PREALLOCATION_REQUIRED\",\n });\n\n extractValueTypeInputShapeIfPresent(\n spt.valueType ?? undefined,\n spt.displayMetadata.displayName,\n spt.type,\n blockShapes,\n ridGenerator,\n );\n }\n}\n\nfunction extractImportedActionTypes(\n importedBlockData: OntologyBlockDataV2,\n ridGenerator: OntologyRidGenerator,\n blockShapes: ImportedBlockShapes,\n): void {\n for (const [_rid, actionTypeBlock] of Object.entries(\n importedBlockData.actionTypes ?? {},\n )) {\n const actionApiName = (actionTypeBlock.actionType as ActionType).metadata\n .apiName;\n const actionReadableId =\n ReadableIdGenerator.getForActionType(actionApiName);\n\n const parametersV2: string[] = Object.entries(\n actionTypeBlock.parameterIds ?? {},\n ).map(([_key, parameterId]) => {\n const paramReadableId = ReadableIdGenerator.getForParameter(\n actionApiName,\n parameterId,\n );\n return ridGenerator.toBlockInternalId(paramReadableId);\n });\n\n const actionShape: ActionTypeShape = {\n about: createLocalizedAbout(\n (actionTypeBlock.actionType as ActionType).metadata.displayMetadata\n .displayName,\n (actionTypeBlock.actionType as ActionType).metadata.displayMetadata\n .description,\n ),\n parameters: {},\n parametersV2,\n };\n\n blockShapes.inputShapes.set(actionReadableId, {\n type: \"action\",\n action: actionShape,\n });\n addApiNamePreset(blockShapes, actionReadableId, actionApiName);\n\n // Generate parameter input shapes\n const parameters = (actionTypeBlock.actionType as ActionType).metadata\n .parameters;\n if (parameters) {\n const converter = new ImportedBaseParameterTypeConverter(\n importedBlockData.knownIdentifiers.objectTypeIds,\n importedBlockData.knownIdentifiers.interfaceTypes,\n );\n\n for (const [parameterId, parameter] of Object.entries(parameters)) {\n const paramReadableId = ReadableIdGenerator.getForParameter(\n actionApiName,\n parameterId,\n );\n\n const parameterShape: ActionTypeParameterShape = {\n about: createLocalizedAbout(\n parameter.displayMetadata.displayName,\n parameter.displayMetadata.description,\n ),\n type: converter.convert(parameter.type),\n actionType: ridGenerator.toBlockInternalId(actionReadableId),\n };\n\n blockShapes.inputShapes.set(paramReadableId, {\n type: \"actionParameter\",\n actionParameter: parameterShape,\n });\n addApiNamePreset(blockShapes, paramReadableId, parameterId);\n }\n }\n }\n}\n\nfunction addApiNamePreset(\n blockShapes: ImportedBlockShapes,\n readableId: ReadableId,\n apiName: string,\n): void {\n addPreset(blockShapes, readableId, {\n type: \"apiNameResolver\",\n apiNameResolver: { apiName },\n });\n}\n\nfunction addPreset(\n blockShapes: ImportedBlockShapes,\n readableId: ReadableId,\n resolver: InputShapeResolver,\n): void {\n blockShapes.inputPresets.set(readableId, {\n value: {\n type: \"fromSource\",\n fromSource: { resolver },\n },\n exportCompatibility: \"COMPATIBLE\",\n enforcement: \"SUGGESTED\",\n isDefault: false,\n });\n}\n\nfunction getObjectTypeBlockId(\n ridGenerator: OntologyRidGenerator,\n objectTypeRid: ObjectTypeRid,\n): string {\n const readableId = ridGenerator\n .getObjectTypeRids()\n .inverse()\n .get(objectTypeRid);\n if (!readableId) {\n throw new Error(`Object type RID not found: ${objectTypeRid}`);\n }\n return ridGenerator.toBlockInternalId(readableId);\n}\n\nfunction getLinkTypeBlockId(\n ridGenerator: OntologyRidGenerator,\n linkTypeRid: string,\n): string {\n const readableId = ridGenerator.getLinkTypeRids().inverse().get(linkTypeRid);\n if (!readableId) {\n throw new Error(`Link type RID not found: ${linkTypeRid}`);\n }\n return ridGenerator.toBlockInternalId(readableId);\n}\n\n/**\n * Simplified parameter type converter for imported action types.\n * Mirrors BaseParameterTypeConverter from ActionTypeShapeExtractor.\n */\nclass ImportedBaseParameterTypeConverter {\n private readonly objectTypeIds: Record<string, string>;\n private readonly interfaceTypes: Record<string, string>;\n\n constructor(\n objectTypeIds?: Record<string, string>,\n interfaceTypes?: Record<string, string>,\n ) {\n this.objectTypeIds = objectTypeIds ?? {};\n this.interfaceTypes = interfaceTypes ?? {};\n }\n\n convert(parameterType: { type: string }): BaseParameterType {\n const pt = parameterType as Record<string, unknown> & { type: string };\n const t = pt.type;\n\n // Simple types\n const simpleTypes = [\n \"boolean\",\n \"booleanList\",\n \"integer\",\n \"integerList\",\n \"long\",\n \"longList\",\n \"double\",\n \"doubleList\",\n \"string\",\n \"stringList\",\n \"geohash\",\n \"geohashList\",\n \"geoshape\",\n \"geoshapeList\",\n \"timeSeriesReference\",\n \"timestamp\",\n \"timestampList\",\n \"date\",\n \"dateList\",\n \"attachment\",\n \"attachmentList\",\n \"marking\",\n \"markingList\",\n \"mediaReference\",\n \"objectTypeReference\",\n \"geotimeSeriesReference\",\n \"geotimeSeriesReferenceList\",\n ];\n\n if (simpleTypes.includes(t)) {\n return { type: t, [t]: {} } as unknown as BaseParameterType;\n }\n\n // Object reference types\n if (\n t === \"objectReference\" ||\n t === \"objectReferenceList\" ||\n t === \"objectSetRid\"\n ) {\n const objRef = pt[t] as { objectTypeId: string } | undefined;\n const blockId = objRef\n ? this.objectTypeIds[objRef.objectTypeId]\n : undefined;\n return {\n type: t,\n [t]: { objectTypeId: blockId ?? \"\" },\n } as unknown as BaseParameterType;\n }\n\n // Interface reference types\n if (\n t === \"interfaceReference\" ||\n t === \"interfaceReferenceList\" ||\n t === \"interfaceObjectSetRid\"\n ) {\n const ifRef = pt[t] as { interfaceTypeRid: string } | undefined;\n const blockId = ifRef\n ? this.interfaceTypes[ifRef.interfaceTypeRid]\n : undefined;\n return {\n type: t,\n [t]: { interfaceTypeRid: blockId ?? \"\" },\n } as unknown as BaseParameterType;\n }\n\n // Decimal types\n if (t === \"decimal\" || t === \"decimalList\") {\n const dec = pt[t] as { precision?: number; scale?: number } | undefined;\n return {\n type: t,\n [t]: { precision: dec?.precision, scale: dec?.scale },\n } as unknown as BaseParameterType;\n }\n\n return { type: t, [t]: {} } as unknown as BaseParameterType;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoCA,SAASA,mBAAmB,QAAQ,8BAA8B;AAClE,SAASC,mCAAmC,QAAQ,oBAAoB;AACxE,SAASC,mCAAmC,QAAQ,uBAAuB;AAQ3E,SAASC,oBAAoBA,CAC3BC,aAAqB,EACrBC,mBAA2B,GAAG,EAAE,EACF;EAC9B,OAAO;IACLD,aAAa;IACbC,mBAAmB;IACnBC,cAAc,EAAE,CAAC,CAAC;IAClBC,oBAAoB,EAAE,CAAC;EACzB,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAC/BC,iBAAsC,EACtCC,YAAkC,EAClCC,oBAA0C,GAAG,CAAC,CAAC,EAC1B;EACrB,MAAMC,WAAgC,GAAG;IACvCC,WAAW,EAAE,IAAIC,GAAG,CAAC,CAAC;IACtBC,YAAY,EAAE,IAAID,GAAG,CAAC,CAAC;I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,CAAC;QACP,CAACA,CAAC,GAAG;UAAEI,YAAY,EAAED,OAAO,IAAI;QAAG;MACrC,CAAC;IACH;;IAEA;IACA,IACEH,CAAC,KAAK,oBAAoB,IAC1BA,CAAC,KAAK,wBAAwB,IAC9BA,CAAC,KAAK,uBAAuB,EAC7B;MACA,MAAMK,KAAK,GAAGN,EAAE,CAACC,CAAC,CAA6C;MAC/D,MAAMG,OAAO,GAAGE,KAAK,GACjB,IAAI,CAAC/F,cAAc,CAAC+F,KAAK,CAACC,gBAAgB,CAAC,GAC3C/I,SAAS;MACb,OAAO;QACLX,IAAI,EAAEoJ,CAAC;QACP,CAACA,CAAC,GAAG;UAAEM,gBAAgB,EAAEH,OAAO,IAAI;QAAG;MACzC,CAAC;IACH;;IAEA;IACA,IAAIH,CAAC,KAAK,SAAS,IAAIA,CAAC,KAAK,aAAa,EAAE;MAC1C,MAAMO,GAAG,GAAGR,EAAE,CAACC,CAAC,CAAuD;MACvE,OAAO;QACLpJ,IAAI,EAAEoJ,CAAC;QACP,CAACA,CAAC,GAAG;UAAEQ,SAAS,EAAED,GAAG,EAAEC,SAAS;UAAEC,KAAK,EAAEF,GAAG,EAAEE;QAAM;MACtD,CAAC;IACH;IAEA,OAAO;MAAE7J,IAAI,EAAEoJ,CAAC;MAAE,CAACA,CAAC,GAAG,CAAC;IAAE,CAAC;EAC7B;AACF","ignoreList":[]}
@@ -5056,9 +5056,10 @@ function extractImportedInterfaceTypes(importedBlockData, ridGenerator, blockSha
5056
5056
  const properties = Object.values(interfaceType.propertiesV2 ?? {}).map((propEntry) => ridGenerator.toBlockInternalId(chunkD3ZAJI7I_cjs.ReadableIdGenerator.getForSpt(propEntry.sharedPropertyType.apiName)));
5057
5057
  const propertiesV2 = [];
5058
5058
  for (const [propertyRid, property] of Object.entries(interfaceType.propertiesV3 ?? {})) {
5059
- const propReadableId = property.type === "sharedPropertyBasedPropertyType" ? chunkD3ZAJI7I_cjs.ReadableIdGenerator.getForSptBackedInterfaceProperty(interfaceType.apiName, property.sharedPropertyBasedPropertyType.sharedPropertyType.apiName) : ridGenerator.getInterfacePropertyTypeRids().inverse().get(propertyRid);
5059
+ if (property.type !== "interfaceDefinedPropertyType") continue;
5060
+ const propReadableId = ridGenerator.getInterfacePropertyTypeRids().inverse().get(propertyRid);
5060
5061
  if (!propReadableId) {
5061
- throw new Error(`Missing readable ID for interface property RID ${propertyRid} on interface ${interfaceType.apiName}`);
5062
+ throw new Error(`Missing readable ID for interface-defined property RID ${propertyRid} on interface ${interfaceType.apiName}`);
5062
5063
  }
5063
5064
  propertiesV2.push(ridGenerator.toBlockInternalId(propReadableId));
5064
5065
  }
@@ -5105,45 +5106,25 @@ function extractImportedInterfaceTypes(importedBlockData, ridGenerator, blockSha
5105
5106
  });
5106
5107
  }
5107
5108
  for (const [propertyRid, property] of Object.entries(interfaceType.propertiesV3 ?? {})) {
5108
- let propReadableId;
5109
- let propApiName;
5110
- let propInputShape;
5111
- if (property.type === "interfaceDefinedPropertyType") {
5112
- const registeredReadableId = ridGenerator.getInterfacePropertyTypeRids().inverse().get(propertyRid);
5113
- if (!registeredReadableId) {
5114
- throw new Error(`Missing readable ID for interface-defined property RID ${propertyRid} on interface ${interfaceType.apiName}`);
5115
- }
5116
- propReadableId = registeredReadableId;
5117
- propApiName = property.interfaceDefinedPropertyType.apiName;
5118
- propInputShape = {
5119
- about: createLocalizedAbout4(property.interfaceDefinedPropertyType.displayMetadata.displayName, property.interfaceDefinedPropertyType.displayMetadata.description ?? ""),
5120
- type: {
5121
- type: "objectPropertyType",
5122
- objectPropertyType: typeToMarketplaceObjectPropertyType(property.interfaceDefinedPropertyType.type)
5123
- },
5124
- interfaceType: ridGenerator.toBlockInternalId(interfaceReadableId),
5125
- requireImplementation: property.interfaceDefinedPropertyType.constraints.requireImplementation
5126
- };
5127
- } else {
5128
- const spt = property.sharedPropertyBasedPropertyType.sharedPropertyType;
5129
- propReadableId = chunkD3ZAJI7I_cjs.ReadableIdGenerator.getForSptBackedInterfaceProperty(interfaceType.apiName, spt.apiName);
5130
- propApiName = spt.apiName;
5131
- propInputShape = {
5132
- about: createLocalizedAbout4(spt.displayMetadata.displayName, spt.displayMetadata.description ?? ""),
5133
- type: {
5134
- type: "objectPropertyType",
5135
- objectPropertyType: typeToMarketplaceObjectPropertyType(spt.type)
5136
- },
5137
- interfaceType: ridGenerator.toBlockInternalId(interfaceReadableId),
5138
- requireImplementation: property.sharedPropertyBasedPropertyType.requireImplementation,
5139
- sharedPropertyType: ridGenerator.toBlockInternalId(chunkD3ZAJI7I_cjs.ReadableIdGenerator.getForSpt(spt.apiName))
5140
- };
5109
+ if (property.type !== "interfaceDefinedPropertyType") continue;
5110
+ const propReadableId = ridGenerator.getInterfacePropertyTypeRids().inverse().get(propertyRid);
5111
+ if (!propReadableId) {
5112
+ throw new Error(`Missing readable ID for interface-defined property RID ${propertyRid} on interface ${interfaceType.apiName}`);
5141
5113
  }
5114
+ const propInputShape = {
5115
+ about: createLocalizedAbout4(property.interfaceDefinedPropertyType.displayMetadata.displayName, property.interfaceDefinedPropertyType.displayMetadata.description ?? ""),
5116
+ type: {
5117
+ type: "objectPropertyType",
5118
+ objectPropertyType: typeToMarketplaceObjectPropertyType(property.interfaceDefinedPropertyType.type)
5119
+ },
5120
+ interfaceType: ridGenerator.toBlockInternalId(interfaceReadableId),
5121
+ requireImplementation: property.interfaceDefinedPropertyType.constraints.requireImplementation
5122
+ };
5142
5123
  blockShapes.inputShapes.set(propReadableId, {
5143
5124
  type: "interfacePropertyType",
5144
5125
  interfacePropertyType: propInputShape
5145
5126
  });
5146
- addApiNamePreset(blockShapes, propReadableId, propApiName);
5127
+ addApiNamePreset(blockShapes, propReadableId, property.interfaceDefinedPropertyType.apiName);
5147
5128
  }
5148
5129
  for (const interfaceLinkType of interfaceType.links ?? []) {
5149
5130
  const linkReadableId = chunkD3ZAJI7I_cjs.ReadableIdGenerator.getForInterfaceLinkType(interfaceType.apiName, interfaceLinkType.metadata.apiName);
@@ -5951,7 +5932,7 @@ var apiNamespaceRegex = /^[a-z0-9-]+(\.[a-z0-9-]+)*\.$/u;
5951
5932
  var uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/u;
5952
5933
  async function main(args = process.argv) {
5953
5934
  consola.consola.log("Generating BlockGeneratorResult for ontology...");
5954
- const commandLineOpts = await yargs__default.default(helpers.hideBin(args)).version("0.52.0").wrap(Math.min(150, yargs__default.default().terminalWidth())).strict().help().options({
5935
+ const commandLineOpts = await yargs__default.default(helpers.hideBin(args)).version("0.53.0").wrap(Math.min(150, yargs__default.default().terminalWidth())).strict().help().options({
5955
5936
  input: {
5956
5937
  alias: "i",
5957
5938
  describe: "Input file",