@osdk/maker-experimental 0.6.0-beta.2 → 0.6.0-beta.4
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 +27 -0
- package/bin/maker-experimental.mjs +6 -0
- package/build/browser/api/defineOntologyV2.js +35 -0
- package/build/browser/api/defineOntologyV2.js.map +1 -0
- package/build/browser/cli/main.js +120 -0
- package/build/browser/cli/main.js.map +1 -0
- package/build/browser/cli/marketplaceSerialization/BlockGeneratorResult.js +2 -0
- package/build/browser/cli/marketplaceSerialization/BlockGeneratorResult.js.map +1 -0
- package/build/browser/cli/marketplaceSerialization/CodeBlockSetSpec.js +2 -0
- package/build/browser/cli/marketplaceSerialization/CodeBlockSetSpec.js.map +1 -0
- package/build/browser/cli/marketplaceSerialization/CodeBlockSpec.js +53 -0
- package/build/browser/cli/marketplaceSerialization/CodeBlockSpec.js.map +1 -0
- package/build/browser/cli/marketplaceSerialization/StoreManifestEntry.js +2 -0
- package/build/browser/cli/marketplaceSerialization/StoreManifestEntry.js.map +1 -0
- package/build/browser/cli/marketplaceSerialization/index.js +2 -0
- package/build/browser/cli/marketplaceSerialization/index.js.map +1 -0
- package/build/browser/cli/marketplaceSerialization/specGenerators.js +70 -0
- package/build/browser/cli/marketplaceSerialization/specGenerators.js.map +1 -0
- package/build/browser/cli/marketplaceSerialization/supportingTypes.js +2 -0
- package/build/browser/cli/marketplaceSerialization/supportingTypes.js.map +1 -0
- package/build/browser/conversion/toConjure/distributeTypeHelper.js +23 -0
- package/build/browser/conversion/toConjure/distributeTypeHelper.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertActionHelpers.js +469 -0
- package/build/browser/conversion/toMarketplace/convertActionHelpers.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertActionParameterConditionalOverride.js +96 -0
- package/build/browser/conversion/toMarketplace/convertActionParameterConditionalOverride.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertActionParameters.js +81 -0
- package/build/browser/conversion/toMarketplace/convertActionParameters.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertActionSections.js +45 -0
- package/build/browser/conversion/toMarketplace/convertActionSections.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertActionValidation.js +160 -0
- package/build/browser/conversion/toMarketplace/convertActionValidation.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertActionVisibility.js +41 -0
- package/build/browser/conversion/toMarketplace/convertActionVisibility.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertCardinality.js +23 -0
- package/build/browser/conversion/toMarketplace/convertCardinality.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertConditionDefinition.js +88 -0
- package/build/browser/conversion/toMarketplace/convertConditionDefinition.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertDataConstraintToDataConstraints.js +26 -0
- package/build/browser/conversion/toMarketplace/convertDataConstraintToDataConstraints.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertDatasourceDefinition.js +352 -0
- package/build/browser/conversion/toMarketplace/convertDatasourceDefinition.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertInterface.js +75 -0
- package/build/browser/conversion/toMarketplace/convertInterface.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertInterfacePropertyType.js +62 -0
- package/build/browser/conversion/toMarketplace/convertInterfacePropertyType.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertLink.js +247 -0
- package/build/browser/conversion/toMarketplace/convertLink.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertMappingValue.js +76 -0
- package/build/browser/conversion/toMarketplace/convertMappingValue.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertNullabilityToDataConstraint.js +42 -0
- package/build/browser/conversion/toMarketplace/convertNullabilityToDataConstraint.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertObject.js +262 -0
- package/build/browser/conversion/toMarketplace/convertObject.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertObjectPropertyType.js +59 -0
- package/build/browser/conversion/toMarketplace/convertObjectPropertyType.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertOntologyDefinition.js +29 -0
- package/build/browser/conversion/toMarketplace/convertOntologyDefinition.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertOntologyDefinitionToWireBlockData.js +236 -0
- package/build/browser/conversion/toMarketplace/convertOntologyDefinitionToWireBlockData.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertOntologyToValueTypeIr.js +24 -0
- package/build/browser/conversion/toMarketplace/convertOntologyToValueTypeIr.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertSectionConditionalOverride.js +35 -0
- package/build/browser/conversion/toMarketplace/convertSectionConditionalOverride.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertSpt.js +65 -0
- package/build/browser/conversion/toMarketplace/convertSpt.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertValueType.js +20 -0
- package/build/browser/conversion/toMarketplace/convertValueType.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertValueTypeDataConstraints.js +30 -0
- package/build/browser/conversion/toMarketplace/convertValueTypeDataConstraints.js.map +1 -0
- package/build/browser/conversion/toMarketplace/convertValueTypesToIr.js +34 -0
- package/build/browser/conversion/toMarketplace/convertValueTypesToIr.js.map +1 -0
- package/build/browser/conversion/toMarketplace/dataConstraintToPropertyTypeDataConstraint.js +83 -0
- package/build/browser/conversion/toMarketplace/dataConstraintToPropertyTypeDataConstraint.js.map +1 -0
- package/build/browser/conversion/toMarketplace/getFormContentOrdering.js +39 -0
- package/build/browser/conversion/toMarketplace/getFormContentOrdering.js.map +1 -0
- package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js +146 -0
- package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js.map +1 -0
- package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js +156 -0
- package/build/browser/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js.map +1 -0
- package/build/browser/conversion/toMarketplace/shapeExtractors/ActionTypeShapeExtractor.js +442 -0
- package/build/browser/conversion/toMarketplace/shapeExtractors/ActionTypeShapeExtractor.js.map +1 -0
- package/build/browser/conversion/toMarketplace/shapeExtractors/ActionTypeShapeExtractor.test.js +562 -0
- package/build/browser/conversion/toMarketplace/shapeExtractors/ActionTypeShapeExtractor.test.js.map +1 -0
- package/build/browser/conversion/toMarketplace/shapeExtractors/IrShapeExtractor.js +513 -0
- package/build/browser/conversion/toMarketplace/shapeExtractors/IrShapeExtractor.js.map +1 -0
- package/build/browser/conversion/toMarketplace/shapeExtractors/LinkTypeShapeExtractor.js +274 -0
- package/build/browser/conversion/toMarketplace/shapeExtractors/LinkTypeShapeExtractor.js.map +1 -0
- package/build/browser/conversion/toMarketplace/shapeExtractors/ObjectTypeShapeExtractor.js +425 -0
- package/build/browser/conversion/toMarketplace/shapeExtractors/ObjectTypeShapeExtractor.js.map +1 -0
- package/build/browser/conversion/toMarketplace/shapeExtractors/ObjectTypeShapeExtractor.test.js +677 -0
- package/build/browser/conversion/toMarketplace/shapeExtractors/ObjectTypeShapeExtractor.test.js.map +1 -0
- package/build/browser/conversion/toMarketplace/typeVisitors.js +615 -0
- package/build/browser/conversion/toMarketplace/typeVisitors.js.map +1 -0
- package/build/browser/index.js +2 -0
- package/build/browser/index.js.map +1 -1
- package/build/browser/util/generateRid.js +476 -0
- package/build/browser/util/generateRid.js.map +1 -0
- package/build/cjs/ActionTypeShapeExtractor-5IVLHAPH.cjs +395 -0
- package/build/cjs/ActionTypeShapeExtractor-5IVLHAPH.cjs.map +1 -0
- package/build/cjs/chunk-AWYOBJ25.cjs +440 -0
- package/build/cjs/chunk-AWYOBJ25.cjs.map +1 -0
- package/build/cjs/index.cjs +3965 -2663
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +103 -1
- package/build/esm/api/defineOntologyV2.js +35 -0
- package/build/esm/api/defineOntologyV2.js.map +1 -0
- package/build/esm/cli/main.js +120 -0
- package/build/esm/cli/main.js.map +1 -0
- package/build/esm/cli/marketplaceSerialization/BlockGeneratorResult.js +2 -0
- package/build/esm/cli/marketplaceSerialization/BlockGeneratorResult.js.map +1 -0
- package/build/esm/cli/marketplaceSerialization/CodeBlockSetSpec.js +2 -0
- package/build/esm/cli/marketplaceSerialization/CodeBlockSetSpec.js.map +1 -0
- package/build/esm/cli/marketplaceSerialization/CodeBlockSpec.js +53 -0
- package/build/esm/cli/marketplaceSerialization/CodeBlockSpec.js.map +1 -0
- package/build/esm/cli/marketplaceSerialization/StoreManifestEntry.js +2 -0
- package/build/esm/cli/marketplaceSerialization/StoreManifestEntry.js.map +1 -0
- package/build/esm/cli/marketplaceSerialization/index.js +2 -0
- package/build/esm/cli/marketplaceSerialization/index.js.map +1 -0
- package/build/esm/cli/marketplaceSerialization/specGenerators.js +70 -0
- package/build/esm/cli/marketplaceSerialization/specGenerators.js.map +1 -0
- package/build/esm/cli/marketplaceSerialization/supportingTypes.js +2 -0
- package/build/esm/cli/marketplaceSerialization/supportingTypes.js.map +1 -0
- package/build/esm/conversion/toConjure/distributeTypeHelper.js +23 -0
- package/build/esm/conversion/toConjure/distributeTypeHelper.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertActionHelpers.js +469 -0
- package/build/esm/conversion/toMarketplace/convertActionHelpers.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertActionParameterConditionalOverride.js +96 -0
- package/build/esm/conversion/toMarketplace/convertActionParameterConditionalOverride.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertActionParameters.js +81 -0
- package/build/esm/conversion/toMarketplace/convertActionParameters.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertActionSections.js +45 -0
- package/build/esm/conversion/toMarketplace/convertActionSections.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertActionValidation.js +160 -0
- package/build/esm/conversion/toMarketplace/convertActionValidation.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertActionVisibility.js +41 -0
- package/build/esm/conversion/toMarketplace/convertActionVisibility.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertCardinality.js +23 -0
- package/build/esm/conversion/toMarketplace/convertCardinality.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertConditionDefinition.js +88 -0
- package/build/esm/conversion/toMarketplace/convertConditionDefinition.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertDataConstraintToDataConstraints.js +26 -0
- package/build/esm/conversion/toMarketplace/convertDataConstraintToDataConstraints.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertDatasourceDefinition.js +352 -0
- package/build/esm/conversion/toMarketplace/convertDatasourceDefinition.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertInterface.js +75 -0
- package/build/esm/conversion/toMarketplace/convertInterface.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertInterfacePropertyType.js +62 -0
- package/build/esm/conversion/toMarketplace/convertInterfacePropertyType.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertLink.js +247 -0
- package/build/esm/conversion/toMarketplace/convertLink.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertMappingValue.js +76 -0
- package/build/esm/conversion/toMarketplace/convertMappingValue.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertNullabilityToDataConstraint.js +42 -0
- package/build/esm/conversion/toMarketplace/convertNullabilityToDataConstraint.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertObject.js +262 -0
- package/build/esm/conversion/toMarketplace/convertObject.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertObjectPropertyType.js +59 -0
- package/build/esm/conversion/toMarketplace/convertObjectPropertyType.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertOntologyDefinition.js +29 -0
- package/build/esm/conversion/toMarketplace/convertOntologyDefinition.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertOntologyDefinitionToWireBlockData.js +236 -0
- package/build/esm/conversion/toMarketplace/convertOntologyDefinitionToWireBlockData.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertOntologyToValueTypeIr.js +24 -0
- package/build/esm/conversion/toMarketplace/convertOntologyToValueTypeIr.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertSectionConditionalOverride.js +35 -0
- package/build/esm/conversion/toMarketplace/convertSectionConditionalOverride.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertSpt.js +65 -0
- package/build/esm/conversion/toMarketplace/convertSpt.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertValueType.js +20 -0
- package/build/esm/conversion/toMarketplace/convertValueType.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertValueTypeDataConstraints.js +30 -0
- package/build/esm/conversion/toMarketplace/convertValueTypeDataConstraints.js.map +1 -0
- package/build/esm/conversion/toMarketplace/convertValueTypesToIr.js +34 -0
- package/build/esm/conversion/toMarketplace/convertValueTypesToIr.js.map +1 -0
- package/build/esm/conversion/toMarketplace/dataConstraintToPropertyTypeDataConstraint.js +83 -0
- package/build/esm/conversion/toMarketplace/dataConstraintToPropertyTypeDataConstraint.js.map +1 -0
- package/build/esm/conversion/toMarketplace/getFormContentOrdering.js +39 -0
- package/build/esm/conversion/toMarketplace/getFormContentOrdering.js.map +1 -0
- package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js +146 -0
- package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.js.map +1 -0
- package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js +156 -0
- package/build/esm/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.js.map +1 -0
- package/build/esm/conversion/toMarketplace/shapeExtractors/ActionTypeShapeExtractor.js +442 -0
- package/build/esm/conversion/toMarketplace/shapeExtractors/ActionTypeShapeExtractor.js.map +1 -0
- package/build/esm/conversion/toMarketplace/shapeExtractors/ActionTypeShapeExtractor.test.js +562 -0
- package/build/esm/conversion/toMarketplace/shapeExtractors/ActionTypeShapeExtractor.test.js.map +1 -0
- package/build/esm/conversion/toMarketplace/shapeExtractors/IrShapeExtractor.js +513 -0
- package/build/esm/conversion/toMarketplace/shapeExtractors/IrShapeExtractor.js.map +1 -0
- package/build/esm/conversion/toMarketplace/shapeExtractors/LinkTypeShapeExtractor.js +274 -0
- package/build/esm/conversion/toMarketplace/shapeExtractors/LinkTypeShapeExtractor.js.map +1 -0
- package/build/esm/conversion/toMarketplace/shapeExtractors/ObjectTypeShapeExtractor.js +425 -0
- package/build/esm/conversion/toMarketplace/shapeExtractors/ObjectTypeShapeExtractor.js.map +1 -0
- package/build/esm/conversion/toMarketplace/shapeExtractors/ObjectTypeShapeExtractor.test.js +677 -0
- package/build/esm/conversion/toMarketplace/shapeExtractors/ObjectTypeShapeExtractor.test.js.map +1 -0
- package/build/esm/conversion/toMarketplace/typeVisitors.js +615 -0
- package/build/esm/conversion/toMarketplace/typeVisitors.js.map +1 -0
- package/build/esm/index.js +2 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/util/generateRid.js +476 -0
- package/build/esm/util/generateRid.js.map +1 -0
- package/build/types/api/defineOntologyV2.d.ts +3 -0
- package/build/types/api/defineOntologyV2.d.ts.map +1 -0
- package/build/types/cli/main.d.ts +1 -0
- package/build/types/cli/main.d.ts.map +1 -0
- package/build/types/cli/marketplaceSerialization/BlockGeneratorResult.d.ts +69 -0
- package/build/types/cli/marketplaceSerialization/BlockGeneratorResult.d.ts.map +1 -0
- package/build/types/cli/marketplaceSerialization/CodeBlockSetSpec.d.ts +60 -0
- package/build/types/cli/marketplaceSerialization/CodeBlockSetSpec.d.ts.map +1 -0
- package/build/types/cli/marketplaceSerialization/CodeBlockSpec.d.ts +48 -0
- package/build/types/cli/marketplaceSerialization/CodeBlockSpec.d.ts.map +1 -0
- package/build/types/cli/marketplaceSerialization/StoreManifestEntry.d.ts +13 -0
- package/build/types/cli/marketplaceSerialization/StoreManifestEntry.d.ts.map +1 -0
- package/build/types/cli/marketplaceSerialization/index.d.ts +11 -0
- package/build/types/cli/marketplaceSerialization/index.d.ts.map +1 -0
- package/build/types/cli/marketplaceSerialization/specGenerators.d.ts +10 -0
- package/build/types/cli/marketplaceSerialization/specGenerators.d.ts.map +1 -0
- package/build/types/cli/marketplaceSerialization/supportingTypes.d.ts +31 -0
- package/build/types/cli/marketplaceSerialization/supportingTypes.d.ts.map +1 -0
- package/build/types/conversion/toConjure/distributeTypeHelper.d.ts +3 -0
- package/build/types/conversion/toConjure/distributeTypeHelper.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertActionHelpers.d.ts +7 -0
- package/build/types/conversion/toMarketplace/convertActionHelpers.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertActionParameterConditionalOverride.d.ts +4 -0
- package/build/types/conversion/toMarketplace/convertActionParameterConditionalOverride.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertActionParameters.d.ts +4 -0
- package/build/types/conversion/toMarketplace/convertActionParameters.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertActionSections.d.ts +4 -0
- package/build/types/conversion/toMarketplace/convertActionSections.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertActionValidation.d.ts +4 -0
- package/build/types/conversion/toMarketplace/convertActionValidation.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertActionVisibility.d.ts +2 -0
- package/build/types/conversion/toMarketplace/convertActionVisibility.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertCardinality.d.ts +3 -0
- package/build/types/conversion/toMarketplace/convertCardinality.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertConditionDefinition.d.ts +3 -0
- package/build/types/conversion/toMarketplace/convertConditionDefinition.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertDataConstraintToDataConstraints.d.ts +2 -0
- package/build/types/conversion/toMarketplace/convertDataConstraintToDataConstraints.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertDatasourceDefinition.d.ts +4 -0
- package/build/types/conversion/toMarketplace/convertDatasourceDefinition.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertInterface.d.ts +4 -0
- package/build/types/conversion/toMarketplace/convertInterface.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertInterfacePropertyType.d.ts +4 -0
- package/build/types/conversion/toMarketplace/convertInterfacePropertyType.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertLink.d.ts +9 -0
- package/build/types/conversion/toMarketplace/convertLink.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertMappingValue.d.ts +4 -0
- package/build/types/conversion/toMarketplace/convertMappingValue.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertNullabilityToDataConstraint.d.ts +6 -0
- package/build/types/conversion/toMarketplace/convertNullabilityToDataConstraint.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertObject.d.ts +10 -0
- package/build/types/conversion/toMarketplace/convertObject.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertObjectPropertyType.d.ts +4 -0
- package/build/types/conversion/toMarketplace/convertObjectPropertyType.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertOntologyDefinition.d.ts +4 -0
- package/build/types/conversion/toMarketplace/convertOntologyDefinition.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertOntologyDefinitionToWireBlockData.d.ts +4 -0
- package/build/types/conversion/toMarketplace/convertOntologyDefinitionToWireBlockData.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertOntologyToValueTypeIr.d.ts +3 -0
- package/build/types/conversion/toMarketplace/convertOntologyToValueTypeIr.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertSectionConditionalOverride.d.ts +3 -0
- package/build/types/conversion/toMarketplace/convertSectionConditionalOverride.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertSpt.d.ts +4 -0
- package/build/types/conversion/toMarketplace/convertSpt.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertValueType.d.ts +4 -0
- package/build/types/conversion/toMarketplace/convertValueType.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertValueTypeDataConstraints.d.ts +2 -0
- package/build/types/conversion/toMarketplace/convertValueTypeDataConstraints.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/convertValueTypesToIr.d.ts +3 -0
- package/build/types/conversion/toMarketplace/convertValueTypesToIr.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/dataConstraintToPropertyTypeDataConstraint.d.ts +2 -0
- package/build/types/conversion/toMarketplace/dataConstraintToPropertyTypeDataConstraint.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/getFormContentOrdering.d.ts +3 -0
- package/build/types/conversion/toMarketplace/getFormContentOrdering.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.d.ts +4 -0
- package/build/types/conversion/toMarketplace/propertyTypeTypeToOntologyIrInterfaceType.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.d.ts +4 -0
- package/build/types/conversion/toMarketplace/propertyTypeTypeToOntologyIrType.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/shapeExtractors/ActionTypeShapeExtractor.d.ts +13 -0
- package/build/types/conversion/toMarketplace/shapeExtractors/ActionTypeShapeExtractor.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/shapeExtractors/ActionTypeShapeExtractor.test.d.ts +1 -0
- package/build/types/conversion/toMarketplace/shapeExtractors/ActionTypeShapeExtractor.test.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/shapeExtractors/IrShapeExtractor.d.ts +11 -0
- package/build/types/conversion/toMarketplace/shapeExtractors/IrShapeExtractor.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/shapeExtractors/LinkTypeShapeExtractor.d.ts +43 -0
- package/build/types/conversion/toMarketplace/shapeExtractors/LinkTypeShapeExtractor.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/shapeExtractors/ObjectTypeShapeExtractor.d.ts +28 -0
- package/build/types/conversion/toMarketplace/shapeExtractors/ObjectTypeShapeExtractor.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/shapeExtractors/ObjectTypeShapeExtractor.test.d.ts +1 -0
- package/build/types/conversion/toMarketplace/shapeExtractors/ObjectTypeShapeExtractor.test.d.ts.map +1 -0
- package/build/types/conversion/toMarketplace/typeVisitors.d.ts +17 -0
- package/build/types/conversion/toMarketplace/typeVisitors.d.ts.map +1 -0
- package/build/types/index.d.ts +3 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/util/generateRid.d.ts +216 -0
- package/build/types/util/generateRid.d.ts.map +1 -0
- package/package.json +10 -4
- package/build/cjs/chunk-ZPP374PZ.cjs +0 -17
- package/build/cjs/chunk-ZPP374PZ.cjs.map +0 -1
- package/build/cjs/prompt-VSXFWPU4.cjs +0 -955
- package/build/cjs/prompt-VSXFWPU4.cjs.map +0 -1
package/build/cjs/index.d.cts
CHANGED
|
@@ -1,5 +1,107 @@
|
|
|
1
|
+
import { ValueTypeReference, OntologyIrV2 } from '@osdk/client.unstable';
|
|
2
|
+
import { InputShape, OutputShape, InputShapeMetadata, ActionTypeRid, InterfaceTypeRid, SharedPropertyTypeRid, InterfaceLinkTypeRid, InterfacePropertyTypeRid, PropertyTypeRid, DatasourceLocator, FilesDatasourceLocator, GeotimeSeriesIntegrationRid, TimeSeriesSyncRid, ResolvedDatasourceColumnShape, ObjectTypeRid, LinkTypeRid, GroupId, StructFieldRid } from '@osdk/client.unstable/api';
|
|
1
3
|
import { PropertyTypeType, ObjectType } from '@osdk/maker';
|
|
2
4
|
|
|
5
|
+
declare function main(args?: string[]): Promise<void>;
|
|
6
|
+
|
|
7
|
+
type ParameterRid = string;
|
|
8
|
+
type ReadableId = string & {
|
|
9
|
+
__brand: "ReadableId";
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Placeholder interface for OntologyRidGenerator
|
|
13
|
+
* This should be filled in with actual implementation
|
|
14
|
+
*/
|
|
15
|
+
interface DatasetDatasourceLocator {
|
|
16
|
+
rid: string;
|
|
17
|
+
branchId: string;
|
|
18
|
+
}
|
|
19
|
+
interface StreamLocator {
|
|
20
|
+
streamLocatorRid: string;
|
|
21
|
+
branchId: string;
|
|
22
|
+
}
|
|
23
|
+
interface RestrictedViewLocator {
|
|
24
|
+
rid: string;
|
|
25
|
+
}
|
|
26
|
+
interface MediaSetViewLocator {
|
|
27
|
+
mediaSetRid: string;
|
|
28
|
+
mediaSetViewRid: string;
|
|
29
|
+
mediaSetBranchRid: string;
|
|
30
|
+
}
|
|
31
|
+
interface OntologyRidGenerator {
|
|
32
|
+
getActionTypeRids(): BiMap<ReadableId, ActionTypeRid>;
|
|
33
|
+
getParameterRidAndIds(): Map<string, BiMap<ReadableId, ParameterRidAndId>>;
|
|
34
|
+
getInterfaceRids(): BiMap<ReadableId, InterfaceTypeRid>;
|
|
35
|
+
getSharedPropertyTypeRids(): BiMap<ReadableId, SharedPropertyTypeRid>;
|
|
36
|
+
getInterfaceLinkTypeRids(): BiMap<ReadableId, InterfaceLinkTypeRid>;
|
|
37
|
+
getInterfacePropertyTypeRids(): BiMap<ReadableId, InterfacePropertyTypeRid>;
|
|
38
|
+
getPropertyTypeRids(): BiMap<ReadableId, PropertyTypeRid>;
|
|
39
|
+
getDatasourceLocators(): BiMap<ReadableId, DatasourceLocator>;
|
|
40
|
+
getFilesDatasourceLocators(): BiMap<ReadableId, FilesDatasourceLocator>;
|
|
41
|
+
getGeotimeSeriesIntegrationRids(): BiMap<ReadableId, GeotimeSeriesIntegrationRid>;
|
|
42
|
+
getTimeSeriesSyncs(): BiMap<ReadableId, TimeSeriesSyncRid>;
|
|
43
|
+
getColumnShapes(): BiMap<ReadableId, ResolvedDatasourceColumnShape>;
|
|
44
|
+
getObjectTypeRids(): BiMap<ReadableId, ObjectTypeRid>;
|
|
45
|
+
getLinkTypeRids(): BiMap<ReadableId, LinkTypeRid>;
|
|
46
|
+
getGroupIds(): BiMap<ReadableId, GroupId>;
|
|
47
|
+
getConsumedValueTypeReferences(): BiMap<ReadableId, ValueTypeReference>;
|
|
48
|
+
getProducedValueTypeReferences(): Map<ValueTypeReference, ReadableId>;
|
|
49
|
+
valueTypeMappingForReference(valueTypeReference: ValueTypeReference): {
|
|
50
|
+
input: ReadableId;
|
|
51
|
+
output: ReadableId;
|
|
52
|
+
};
|
|
53
|
+
hashString(input: string): string;
|
|
54
|
+
generateRid(key: string): string;
|
|
55
|
+
generateDatasourceRid(datasourceName: string): string;
|
|
56
|
+
generateValidationRuleRid(actionTypeApiName: string, index: number): string;
|
|
57
|
+
generateSectionRid(sectionId: string): string;
|
|
58
|
+
generatePropertySecurityGroupRid(groupName: string): string;
|
|
59
|
+
generateRidForInterface(apiName: string): InterfaceTypeRid;
|
|
60
|
+
generateRidForInterfaceLinkType(apiName: string, interfaceTypeApiName: string): InterfaceLinkTypeRid;
|
|
61
|
+
generateRidForObjectType(apiName: string): ObjectTypeRid;
|
|
62
|
+
generateRidForValueType(apiName: string, version: string): ValueTypeReference;
|
|
63
|
+
generateRidForTimeSeriesSync(name: string): TimeSeriesSyncRid;
|
|
64
|
+
generateRidForLinkType(linkTypeId: string): LinkTypeRid;
|
|
65
|
+
generateRidForGeotimeSeriesIntegration(name: string): GeotimeSeriesIntegrationRid;
|
|
66
|
+
generateRidForActionType(apiName: string): ActionTypeRid;
|
|
67
|
+
generateRidForParameter(actionTypeApiName: string, parameterId: string): ParameterRid;
|
|
68
|
+
generateSptRid(apiName: string): SharedPropertyTypeRid;
|
|
69
|
+
generatePropertyRid(apiName: string, objectTypeApiName: string): PropertyTypeRid;
|
|
70
|
+
generateInterfacePropertyTypeRid(apiName: string, interfaceTypeApiName: string): InterfacePropertyTypeRid;
|
|
71
|
+
generateStructFieldRid(propertyApiName: string, apiName: string): StructFieldRid;
|
|
72
|
+
generateLocator(dataSetName: string, columnNames: Set<string>): DatasetDatasourceLocator;
|
|
73
|
+
generateStreamLocator(streamName: string, columnNames: Set<string>): StreamLocator;
|
|
74
|
+
generateRestrictedViewLocator(restrictedViewName: string, columnNames: Set<string>): RestrictedViewLocator;
|
|
75
|
+
generateMediaSetViewLocator(mediaSetViewName: string): MediaSetViewLocator;
|
|
76
|
+
toBlockInternalId(readableId: ReadableId): string;
|
|
77
|
+
generateObjectTypeId(objectTypeApiName: string): string;
|
|
78
|
+
getObjectTypeIds(): BiMap<ReadableId, string>;
|
|
79
|
+
}
|
|
80
|
+
interface ParameterRidAndId {
|
|
81
|
+
rid: ParameterRid;
|
|
82
|
+
id: string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Simple BiMap interface (placeholder)
|
|
86
|
+
*/
|
|
87
|
+
interface BiMap<K, V> {
|
|
88
|
+
get(key: K): V | undefined;
|
|
89
|
+
put(key: K, value: V): void;
|
|
90
|
+
asMap(): Map<K, V>;
|
|
91
|
+
inverse(): BiMap<V, K>;
|
|
92
|
+
entries(): IterableIterator<[K, V]>;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* BlockShapes container for input and output shapes
|
|
96
|
+
*/
|
|
97
|
+
interface BlockShapes {
|
|
98
|
+
inputShapes: Map<ReadableId, InputShape>;
|
|
99
|
+
outputShapes: Map<ReadableId, OutputShape>;
|
|
100
|
+
inputShapeMetadata: Map<ReadableId, InputShapeMetadata>;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
declare function defineOntologyV2(ns: string, body: () => void | Promise<void>, randomnessKey?: string): Promise<[OntologyIrV2, BlockShapes]>;
|
|
104
|
+
|
|
3
105
|
type ImportObjectDefinition = {
|
|
4
106
|
apiName: string;
|
|
5
107
|
properties: Record<string, ImportPropertyTypeDefinition>;
|
|
@@ -15,4 +117,4 @@ type ImportPropertyTypeDefinition = {
|
|
|
15
117
|
|
|
16
118
|
declare function defineImportObject(objectDef: ImportObjectDefinition): ObjectType;
|
|
17
119
|
|
|
18
|
-
export { type ImportObjectDefinition, type ImportPropertyTypeDefinition, defineImportObject };
|
|
120
|
+
export { type BlockShapes, type ImportObjectDefinition, type ImportPropertyTypeDefinition, type OntologyRidGenerator, main as default, defineImportObject, defineOntologyV2 };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { getOntologyDefinition, initializeOntologyState } from "@osdk/maker";
|
|
18
|
+
import { convertOntologyDefinition } from "../conversion/toMarketplace/convertOntologyDefinition.js";
|
|
19
|
+
import { getShapes } from "../conversion/toMarketplace/shapeExtractors/IrShapeExtractor.js";
|
|
20
|
+
import { OntologyRidGeneratorImpl } from "../util/generateRid.js";
|
|
21
|
+
export async function defineOntologyV2(ns, body, randomnessKey) {
|
|
22
|
+
initializeOntologyState(ns);
|
|
23
|
+
try {
|
|
24
|
+
await body();
|
|
25
|
+
} catch (e) {
|
|
26
|
+
// eslint-disable-next-line no-console
|
|
27
|
+
console.error("Unexpected error while processing the body of the ontology", e);
|
|
28
|
+
throw e;
|
|
29
|
+
}
|
|
30
|
+
const ridGenerator = new OntologyRidGeneratorImpl();
|
|
31
|
+
const ontDef = convertOntologyDefinition(getOntologyDefinition(), ridGenerator, randomnessKey);
|
|
32
|
+
const shapes = await getShapes(ontDef.ontology, ridGenerator, randomnessKey);
|
|
33
|
+
return [ontDef, shapes];
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=defineOntologyV2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defineOntologyV2.js","names":["getOntologyDefinition","initializeOntologyState","convertOntologyDefinition","getShapes","OntologyRidGeneratorImpl","defineOntologyV2","ns","body","randomnessKey","e","console","error","ridGenerator","ontDef","shapes","ontology"],"sources":["defineOntologyV2.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 { OntologyIrV2 } from \"@osdk/client.unstable\";\nimport { getOntologyDefinition, initializeOntologyState } from \"@osdk/maker\";\nimport { convertOntologyDefinition } from \"../conversion/toMarketplace/convertOntologyDefinition.js\";\nimport { getShapes } from \"../conversion/toMarketplace/shapeExtractors/IrShapeExtractor.js\";\nimport type { BlockShapes } from \"../util/generateRid.js\";\nimport { OntologyRidGeneratorImpl } from \"../util/generateRid.js\";\n\nexport async function defineOntologyV2(\n ns: string,\n body: () => void | Promise<void>,\n randomnessKey?: string,\n): Promise<[OntologyIrV2, BlockShapes]> {\n initializeOntologyState(ns);\n\n try {\n await body();\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error(\n \"Unexpected error while processing the body of the ontology\",\n e,\n );\n throw e;\n }\n\n const ridGenerator = new OntologyRidGeneratorImpl();\n const ontDef = convertOntologyDefinition(\n getOntologyDefinition(),\n ridGenerator,\n randomnessKey,\n );\n\n const shapes = await getShapes(\n ontDef.ontology,\n ridGenerator,\n randomnessKey,\n );\n\n return [ontDef, shapes];\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,qBAAqB,EAAEC,uBAAuB,QAAQ,aAAa;AAC5E,SAASC,yBAAyB,QAAQ,0DAA0D;AACpG,SAASC,SAAS,QAAQ,iEAAiE;AAE3F,SAASC,wBAAwB,QAAQ,wBAAwB;AAEjE,OAAO,eAAeC,gBAAgBA,CACpCC,EAAU,EACVC,IAAgC,EAChCC,aAAsB,EACgB;EACtCP,uBAAuB,CAACK,EAAE,CAAC;EAE3B,IAAI;IACF,MAAMC,IAAI,CAAC,CAAC;EACd,CAAC,CAAC,OAAOE,CAAC,EAAE;IACV;IACAC,OAAO,CAACC,KAAK,CACX,4DAA4D,EAC5DF,CACF,CAAC;IACD,MAAMA,CAAC;EACT;EAEA,MAAMG,YAAY,GAAG,IAAIR,wBAAwB,CAAC,CAAC;EACnD,MAAMS,MAAM,GAAGX,yBAAyB,CACtCF,qBAAqB,CAAC,CAAC,EACvBY,YAAY,EACZJ,aACF,CAAC;EAED,MAAMM,MAAM,GAAG,MAAMX,SAAS,CAC5BU,MAAM,CAACE,QAAQ,EACfH,YAAY,EACZJ,aACF,CAAC;EAED,OAAO,CAACK,MAAM,EAAEC,MAAM,CAAC;AACzB","ignoreList":[]}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { consola } from "consola";
|
|
18
|
+
import { createJiti } from "jiti";
|
|
19
|
+
import * as fs from "node:fs";
|
|
20
|
+
import * as path from "node:path";
|
|
21
|
+
import invariant from "tiny-invariant";
|
|
22
|
+
import yargs from "yargs";
|
|
23
|
+
import { hideBin } from "yargs/helpers";
|
|
24
|
+
import { defineOntologyV2 } from "../api/defineOntologyV2.js";
|
|
25
|
+
const apiNamespaceRegex = /^[a-z0-9-]+(\.[a-z0-9-]+)*\.$/;
|
|
26
|
+
const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
27
|
+
export default async function main(args = process.argv) {
|
|
28
|
+
consola.log("Generating BlockGeneratorResult for ontology...");
|
|
29
|
+
const commandLineOpts = await yargs(hideBin(args)).version("0.6.0-beta.4" ?? "").wrap(Math.min(150, yargs().terminalWidth())).strict().help().options({
|
|
30
|
+
input: {
|
|
31
|
+
alias: "i",
|
|
32
|
+
describe: "Input file",
|
|
33
|
+
type: "string",
|
|
34
|
+
default: ".ontology/ontology.ts",
|
|
35
|
+
coerce: path.resolve
|
|
36
|
+
},
|
|
37
|
+
output: {
|
|
38
|
+
alias: "o",
|
|
39
|
+
describe: "Output file for BlockGeneratorResult JSON",
|
|
40
|
+
type: "string",
|
|
41
|
+
default: "build/block_generator_result.json",
|
|
42
|
+
coerce: path.resolve
|
|
43
|
+
},
|
|
44
|
+
apiNamespace: {
|
|
45
|
+
describe: "Api name prefix for namespaced ontology types",
|
|
46
|
+
type: "string",
|
|
47
|
+
default: ""
|
|
48
|
+
},
|
|
49
|
+
buildDir: {
|
|
50
|
+
alias: "b",
|
|
51
|
+
describe: "Directory for build files",
|
|
52
|
+
type: "string",
|
|
53
|
+
default: "build/",
|
|
54
|
+
coerce: path.resolve
|
|
55
|
+
},
|
|
56
|
+
randomnessKey: {
|
|
57
|
+
describe: "Value used to assure uniqueness of entities",
|
|
58
|
+
type: "string",
|
|
59
|
+
coerce: path.resolve
|
|
60
|
+
}
|
|
61
|
+
}).parseAsync();
|
|
62
|
+
let apiNamespace = "";
|
|
63
|
+
if (commandLineOpts.apiNamespace.length !== 0) {
|
|
64
|
+
apiNamespace = commandLineOpts.apiNamespace.slice(-1) !== "." ? commandLineOpts.apiNamespace + "." : commandLineOpts.apiNamespace;
|
|
65
|
+
!(apiNamespace.length < 1024) ? process.env.NODE_ENV !== "production" ? invariant(false, "API namespace is too long.") : invariant(false) : void 0;
|
|
66
|
+
!apiNamespaceRegex.test(apiNamespace) ? process.env.NODE_ENV !== "production" ? invariant(false, "API namespace is invalid! It is expected to conform to ^[a-z0-9-]+(\.[a-z0-9-]+)*\.$") : invariant(false) : void 0;
|
|
67
|
+
}
|
|
68
|
+
consola.info(`Loading ontology from ${commandLineOpts.input}`);
|
|
69
|
+
if (commandLineOpts.randomnessKey !== undefined) {
|
|
70
|
+
!uuidRegex.test(commandLineOpts.randomnessKey) ? process.env.NODE_ENV !== "production" ? invariant(false, "Supplied randomness key is not a uuid and shouldn't be used as a uniqueness guarantee") : invariant(false) : void 0;
|
|
71
|
+
}
|
|
72
|
+
const [ontologyBlockDataV2, shapes] = await loadOntology(commandLineOpts.input, apiNamespace, commandLineOpts.randomnessKey);
|
|
73
|
+
|
|
74
|
+
// Create temp directory for block data
|
|
75
|
+
const blockDataDir = path.join(commandLineOpts.buildDir, "temp_block_data");
|
|
76
|
+
if (!fs.existsSync(blockDataDir)) {
|
|
77
|
+
await fs.promises.mkdir(blockDataDir, {
|
|
78
|
+
recursive: true
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Write ontology.json to the block data directory
|
|
83
|
+
const ontologyJsonPath = path.join(blockDataDir, "ontology.json");
|
|
84
|
+
const ontologyJson = JSON.stringify(ontologyBlockDataV2.ontology, null, 2);
|
|
85
|
+
await fs.promises.writeFile(ontologyJsonPath, ontologyJson);
|
|
86
|
+
consola.info(`Wrote ontology.json to ${ontologyJsonPath}`);
|
|
87
|
+
|
|
88
|
+
// Create BlockGeneratorResult
|
|
89
|
+
const blockGeneratorResult = {
|
|
90
|
+
block_identifier: "ontology",
|
|
91
|
+
block_data_directory: blockDataDir,
|
|
92
|
+
oci_block_data_metadata: undefined,
|
|
93
|
+
maven_block_data_metadata: undefined,
|
|
94
|
+
inputs: Object.fromEntries(shapes.inputShapes),
|
|
95
|
+
outputs: Object.fromEntries(shapes.outputShapes),
|
|
96
|
+
input_mapping_entries: [],
|
|
97
|
+
external_recommendations: [],
|
|
98
|
+
add_on_override: undefined,
|
|
99
|
+
input_shape_metadata: Object.fromEntries(shapes.inputShapeMetadata),
|
|
100
|
+
block_type: "ONTOLOGY"
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
// Write BlockGeneratorResult to output file
|
|
104
|
+
const blockGeneratorResultJson = JSON.stringify(blockGeneratorResult, null, 2);
|
|
105
|
+
await fs.promises.writeFile(commandLineOpts.output, blockGeneratorResultJson);
|
|
106
|
+
consola.success(`BlockGeneratorResult written to ${commandLineOpts.output}`);
|
|
107
|
+
consola.info(`Block data directory: ${blockDataDir}`);
|
|
108
|
+
}
|
|
109
|
+
async function loadOntology(input, apiNamespace, randomnessKey) {
|
|
110
|
+
const ontologyIr = await defineOntologyV2(apiNamespace, async () => {
|
|
111
|
+
const jiti = createJiti(import.meta.filename, {
|
|
112
|
+
moduleCache: true,
|
|
113
|
+
debug: false,
|
|
114
|
+
importMeta: import.meta
|
|
115
|
+
});
|
|
116
|
+
await jiti.import(input);
|
|
117
|
+
}, randomnessKey);
|
|
118
|
+
return ontologyIr;
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","names":["consola","createJiti","fs","path","invariant","yargs","hideBin","defineOntologyV2","apiNamespaceRegex","uuidRegex","main","args","process","argv","log","commandLineOpts","version","wrap","Math","min","terminalWidth","strict","help","options","input","alias","describe","type","default","coerce","resolve","output","apiNamespace","buildDir","randomnessKey","parseAsync","length","slice","env","NODE_ENV","test","info","undefined","ontologyBlockDataV2","shapes","loadOntology","blockDataDir","join","existsSync","promises","mkdir","recursive","ontologyJsonPath","ontologyJson","JSON","stringify","ontology","writeFile","blockGeneratorResult","block_identifier","block_data_directory","oci_block_data_metadata","maven_block_data_metadata","inputs","Object","fromEntries","inputShapes","outputs","outputShapes","input_mapping_entries","external_recommendations","add_on_override","input_shape_metadata","inputShapeMetadata","block_type","blockGeneratorResultJson","success","ontologyIr","jiti","import","meta","filename","moduleCache","debug","importMeta"],"sources":["main.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 { consola } from \"consola\";\nimport { createJiti } from \"jiti\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport invariant from \"tiny-invariant\";\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\nimport { defineOntologyV2 } from \"../api/defineOntologyV2.js\";\nimport type { BlockGeneratorResult } from \"./marketplaceSerialization/BlockGeneratorResult.js\";\n\nconst apiNamespaceRegex = /^[a-z0-9-]+(\\.[a-z0-9-]+)*\\.$/;\nconst uuidRegex =\n /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;\n\nexport default async function main(\n args: string[] = process.argv,\n): Promise<void> {\n consola.log(\"Generating BlockGeneratorResult for ontology...\");\n\n const commandLineOpts: {\n input: string;\n output: string;\n apiNamespace: string;\n buildDir: string;\n randomnessKey?: string;\n } = await yargs(hideBin(args))\n .version(process.env.PACKAGE_VERSION ?? \"\")\n .wrap(Math.min(150, yargs().terminalWidth()))\n .strict()\n .help()\n .options({\n input: {\n alias: \"i\",\n describe: \"Input file\",\n type: \"string\",\n default: \".ontology/ontology.ts\",\n coerce: path.resolve,\n },\n output: {\n alias: \"o\",\n describe: \"Output file for BlockGeneratorResult JSON\",\n type: \"string\",\n default: \"build/block_generator_result.json\",\n coerce: path.resolve,\n },\n apiNamespace: {\n describe: \"Api name prefix for namespaced ontology types\",\n type: \"string\",\n default: \"\",\n },\n buildDir: {\n alias: \"b\",\n describe: \"Directory for build files\",\n type: \"string\",\n default: \"build/\",\n coerce: path.resolve,\n },\n randomnessKey: {\n describe: \"Value used to assure uniqueness of entities\",\n type: \"string\",\n coerce: path.resolve,\n },\n })\n .parseAsync();\n\n let apiNamespace = \"\";\n if (commandLineOpts.apiNamespace.length !== 0) {\n apiNamespace = (commandLineOpts.apiNamespace.slice(-1) !== \".\")\n ? commandLineOpts.apiNamespace + \".\"\n : commandLineOpts.apiNamespace;\n invariant(apiNamespace.length < 1024, \"API namespace is too long.\");\n invariant(\n apiNamespaceRegex.test(apiNamespace),\n \"API namespace is invalid! It is expected to conform to ^[a-z0-9-]+(\\.[a-z0-9-]+)*\\.$\",\n );\n }\n consola.info(`Loading ontology from ${commandLineOpts.input}`);\n\n if (commandLineOpts.randomnessKey !== undefined) {\n invariant(\n uuidRegex.test(commandLineOpts.randomnessKey),\n \"Supplied randomness key is not a uuid and shouldn't be used as a uniqueness guarantee\",\n );\n }\n\n const [ontologyBlockDataV2, shapes] = await loadOntology(\n commandLineOpts.input,\n apiNamespace,\n commandLineOpts.randomnessKey,\n );\n\n // Create temp directory for block data\n const blockDataDir = path.join(commandLineOpts.buildDir, \"temp_block_data\");\n if (!fs.existsSync(blockDataDir)) {\n await fs.promises.mkdir(blockDataDir, { recursive: true });\n }\n\n // Write ontology.json to the block data directory\n const ontologyJsonPath = path.join(blockDataDir, \"ontology.json\");\n const ontologyJson = JSON.stringify(ontologyBlockDataV2.ontology, null, 2);\n await fs.promises.writeFile(ontologyJsonPath, ontologyJson);\n consola.info(`Wrote ontology.json to ${ontologyJsonPath}`);\n\n // Create BlockGeneratorResult\n const blockGeneratorResult: BlockGeneratorResult = {\n block_identifier: \"ontology\",\n block_data_directory: blockDataDir,\n oci_block_data_metadata: undefined,\n maven_block_data_metadata: undefined,\n inputs: Object.fromEntries(shapes.inputShapes),\n outputs: Object.fromEntries(shapes.outputShapes),\n input_mapping_entries: [],\n external_recommendations: [],\n add_on_override: undefined,\n input_shape_metadata: Object.fromEntries(shapes.inputShapeMetadata),\n block_type: \"ONTOLOGY\",\n };\n\n // Write BlockGeneratorResult to output file\n const blockGeneratorResultJson = JSON.stringify(\n blockGeneratorResult,\n null,\n 2,\n );\n await fs.promises.writeFile(\n commandLineOpts.output,\n blockGeneratorResultJson,\n );\n consola.success(\n `BlockGeneratorResult written to ${commandLineOpts.output}`,\n );\n consola.info(\n `Block data directory: ${blockDataDir}`,\n );\n}\n\nasync function loadOntology(\n input: string,\n apiNamespace: string,\n randomnessKey?: string,\n) {\n const ontologyIr = await defineOntologyV2(\n apiNamespace,\n async () => {\n const jiti = createJiti(import.meta.filename, {\n moduleCache: true,\n debug: false,\n importMeta: import.meta,\n });\n const module = await jiti.import(input);\n },\n randomnessKey,\n );\n return ontologyIr;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,SAAS;AACjC,SAASC,UAAU,QAAQ,MAAM;AACjC,OAAO,KAAKC,EAAE,MAAM,SAAS;AAC7B,OAAO,KAAKC,IAAI,MAAM,WAAW;AACjC,OAAOC,SAAS,MAAM,gBAAgB;AACtC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,eAAe;AACvC,SAASC,gBAAgB,QAAQ,4BAA4B;AAG7D,MAAMC,iBAAiB,GAAG,+BAA+B;AACzD,MAAMC,SAAS,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,CACvCyB,YAAY,EACZ,YAAY;IACV,MAAM8C,IAAI,GAAG7E,UAAU,CAAC8E,MAAM,CAACC,IAAI,CAACC,QAAQ,EAAE;MAC5CC,WAAW,EAAE,IAAI;MACjBC,KAAK,EAAE,KAAK;MACZC,UAAU,EAAEL,MAAM,CAACC;IACrB,CAAC,CAAC;IACa,MAAMF,IAAI,CAACC,MAAM,CAACvD,KAAK,CAAC;EACzC,CAAC,EACDU,aACF,CAAC;EACD,OAAO2C,UAAU;AACnB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockGeneratorResult.js","names":[],"sources":["BlockGeneratorResult.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 BlockType,\n InputShape,\n InputShapeMetadata,\n OutputShape,\n} from \"@osdk/client.unstable/api\";\nimport type { ReadableId } from \"../../util/generateRid.js\";\nimport type {\n GeneratedBlockExternalRecommendations,\n InputMappingEntry,\n} from \"./supportingTypes.js\";\n\n/**\n * Result from generating a block.\n * This matches the Rust BlockGeneratorResult interface and Java's BlockGeneratorResult.\n *\n * This is the output that will be consumed by the Rust bundling tooling to create\n * the final marketplace product.\n */\nexport interface BlockGeneratorResult {\n /**\n * Identifier for this block (e.g., \"ontology\")\n */\n block_identifier: \"ontology\";\n\n /**\n * Absolute path to the directory containing block data files.\n * For ontology blocks, this directory should contain ontology.json\n */\n block_data_directory: string;\n\n /**\n * Optional OCI block data metadata\n */\n oci_block_data_metadata?: OciBlockDataMetadata;\n\n /**\n * Optional Maven block data metadata\n */\n maven_block_data_metadata?: MavenBlockDataMetadata;\n\n /**\n * Map of input shapes keyed by ReadableId\n */\n inputs: Record<ReadableId, InputShape>;\n\n /**\n * Map of output shapes keyed by ReadableId\n */\n outputs: Record<ReadableId, OutputShape>;\n\n /**\n * List of input mapping entries that provide hints for how to connect blocks\n */\n input_mapping_entries: InputMappingEntry[];\n\n /**\n * External recommendations for connecting this block to upstream packages\n */\n external_recommendations: GeneratedBlockExternalRecommendations[];\n\n /**\n * Optional override for the block data add-on\n */\n add_on_override?: unknown;\n\n /**\n * Metadata about each input shape\n */\n input_shape_metadata: Record<ReadableId, InputShapeMetadata>;\n\n /**\n * The type of this block (e.g., ONTOLOGY, FUNCTIONS, etc.)\n */\n block_type: BlockType;\n}\n\n/**\n * Metadata for OCI block data\n */\nexport interface OciBlockDataMetadata {\n oci_directory: string;\n}\n\n/**\n * Metadata for Maven block data\n */\nexport interface MavenBlockDataMetadata {\n maven_directory: string;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlockSetSpec.js","names":[],"sources":["CodeBlockSetSpec.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 BlockSetVersion,\n Changelog,\n CreationTimestamp,\n InstallationMode,\n LocalizedTitleAndDescription,\n} from \"@osdk/client.unstable/api\";\nimport type { CodeBlockSpec } from \"./CodeBlockSpec.js\";\nimport type { SemverVersion } from \"./specGenerators.js\";\n\n/**\n * The spec for a blockset created from code blocks. This is transported as a marketplace product artifact.\n *\n * This TypeScript interface mirrors the Java CodeBlockSetSpec class and is designed\n * to be JSON serialization-compatible.\n */\nexport interface CodeBlockSetSpec {\n /**\n * Use this for more deterministic import logic. If you add a default for example.\n * Optional schema version number.\n */\n specSchemaVersion?: number;\n\n /**\n * The package name for this block set (e.g., \"com.example.my-package\").\n * This should only be optional if there is a parent rid!\n */\n packageName?: string;\n\n /**\n * The semantic version of this block set (e.g., \"1.0.0\").\n */\n version: SemverVersion;\n\n /**\n * ISO timestamp of when this block set version was created.\n */\n creationTimestamp: CreationTimestamp;\n\n /**\n * Localized title and description for this block set.\n * Includes fallback title/description and locale-specific translations.\n */\n about: LocalizedTitleAndDescription;\n\n /**\n * Map of generated blocks keyed by UUID.\n * Each UUID is a unique identifier for a block within this block set.\n */\n generatedBlocks: Record<string, CodeBlockSpec>;\n\n /**\n * The installation mode for this block set.\n * Can be \"bootstrap\", \"production\", or \"singleton\".\n */\n installMode?: InstallationMode;\n\n /**\n * Optional changelog describing what changed in this version.\n * Currently supports markdown format.\n */\n changelog?: Changelog;\n\n /**\n * Optional reference to the last known version before a breaking change.\n * Used for version compatibility tracking.\n */\n lastKnownVersionBeforeBreak?: BlockSetVersion;\n\n /**\n * MUST be the same as the one in the block spec.\n * Optional UUID used as a salt for deterministic RID generation.\n * This enables reproducible builds across environments.\n */\n randomnessKey?: string;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import crypto, { createHash } from "crypto";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The spec for a code block. This is transported as a marketplace product artifact.
|
|
21
|
+
*
|
|
22
|
+
* This TypeScript interface mirrors the Java CodeBlockSpec class and is designed
|
|
23
|
+
* to be JSON serialization-compatible.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
export function getBlockVersionId(blockSpec, blockSetVersion, randomnessKey) {
|
|
27
|
+
let mergedString = `${blockSpec.blockMavenCoordinate}_${blockSetVersion}`;
|
|
28
|
+
if (randomnessKey) {
|
|
29
|
+
mergedString = `${blockSpec.blockMavenCoordinate}_${blockSetVersion}_${randomnessKey}`;
|
|
30
|
+
}
|
|
31
|
+
return generateUUIDFromStr(mergedString);
|
|
32
|
+
}
|
|
33
|
+
function generateUUIDFromStr(input) {
|
|
34
|
+
const md5Bytes = crypto.createHash("md5").update(input).digest();
|
|
35
|
+
md5Bytes[6] &= 0x0f; /* clear version */
|
|
36
|
+
md5Bytes[6] |= 0x30; /* set to version 3 */
|
|
37
|
+
md5Bytes[8] &= 0x3f; /* clear variant */
|
|
38
|
+
md5Bytes[8] |= 0x80; /* set to IETF variant */
|
|
39
|
+
const hex = md5Bytes.toString("hex");
|
|
40
|
+
const uuid = hex.replace(/(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})/, "$1-$2-$3-$4-$5");
|
|
41
|
+
return uuid;
|
|
42
|
+
}
|
|
43
|
+
export function toBlockShapeId(readableId, salt) {
|
|
44
|
+
let toHash = readableId;
|
|
45
|
+
if (salt) {
|
|
46
|
+
toHash = readableId + salt;
|
|
47
|
+
}
|
|
48
|
+
const digest = createHash("sha256");
|
|
49
|
+
digest.update(toHash, "utf8");
|
|
50
|
+
const encodedHash = digest.digest();
|
|
51
|
+
return generateUUIDFromStr(encodedHash);
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=CodeBlockSpec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlockSpec.js","names":["crypto","createHash","getBlockVersionId","blockSpec","blockSetVersion","randomnessKey","mergedString","blockMavenCoordinate","generateUUIDFromStr","input","md5Bytes","update","digest","hex","toString","uuid","replace","toBlockShapeId","readableId","salt","toHash","encodedHash"],"sources":["CodeBlockSpec.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 BlockType,\n InputShape,\n InputShapeMetadata,\n OutputShape,\n SerializedDataLocator,\n} from \"@osdk/client.unstable/api\";\nimport type { UUID } from \"crypto\";\nimport crypto, { createHash } from \"crypto\";\nimport type { ReadableId } from \"../../util/generateRid.js\";\nimport type { SemverVersion } from \"./specGenerators.js\";\nimport type {\n GeneratedBlockExternalRecommendations,\n InputMappingEntry,\n} from \"./supportingTypes.js\";\n\n/**\n * The spec for a code block. This is transported as a marketplace product artifact.\n *\n * This TypeScript interface mirrors the Java CodeBlockSpec class and is designed\n * to be JSON serialization-compatible.\n */\nexport interface CodeBlockSpec {\n /** Maven coordinate identifying this block (e.g., \"com.example:my-block\") */\n blockMavenCoordinate: string;\n\n /**\n * Map of input shapes keyed by ReadableId.\n * These define what inputs this block requires.\n */\n inputs: Record<ReadableId, InputShape>;\n\n /**\n * Map of output shapes keyed by ReadableId.\n * These define what outputs this block provides.\n */\n outputs: Record<ReadableId, OutputShape>;\n\n /**\n * List of serialized data locators pointing to the actual block implementation artifacts.\n * Can include maven, npm, pypi, conda, files, etc.\n */\n blockData: SerializedDataLocator[];\n\n /** The type of this block (e.g., ONTOLOGY, FUNCTIONS, EDDIE_PIPELINE, etc.) */\n blockType: BlockType;\n\n /**\n * List of input mapping entries that provide hints for how to connect blocks.\n * Each entry maps an input ReadableId to an output ReadableId.\n */\n inputMappingEntries: InputMappingEntry[];\n\n /**\n * External recommendations for connecting this block to upstream packages.\n */\n externalRecommendations: GeneratedBlockExternalRecommendations[];\n\n /**\n * Metadata about each input shape, keyed by ReadableId.\n * Includes information like whether the input is optional, accessed in reconcile, etc.\n */\n inputShapeMetadata: Record<ReadableId, InputShapeMetadata>;\n}\n\nexport function getBlockVersionId(\n blockSpec: CodeBlockSpec,\n blockSetVersion: SemverVersion,\n randomnessKey?: string,\n): UUID {\n let mergedString = `${blockSpec.blockMavenCoordinate}_${blockSetVersion}`;\n if (randomnessKey) {\n mergedString =\n `${blockSpec.blockMavenCoordinate}_${blockSetVersion}_${randomnessKey}`;\n }\n\n return generateUUIDFromStr(mergedString);\n}\n\nfunction generateUUIDFromStr(input: crypto.BinaryLike): UUID {\n const md5Bytes = crypto.createHash(\"md5\").update(input).digest();\n md5Bytes[6] &= 0x0f; /* clear version */\n md5Bytes[6] |= 0x30; /* set to version 3 */\n md5Bytes[8] &= 0x3f; /* clear variant */\n md5Bytes[8] |= 0x80; /* set to IETF variant */\n const hex = md5Bytes.toString(\"hex\");\n const uuid = hex.replace(\n /(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})/,\n \"$1-$2-$3-$4-$5\",\n );\n return uuid as UUID;\n}\n\nexport function toBlockShapeId(readableId: string, salt?: string): string {\n let toHash = readableId;\n if (salt) {\n toHash = readableId + salt;\n }\n const digest = createHash(\"sha256\");\n digest.update(toHash, \"utf8\");\n const encodedHash = digest.digest();\n return generateUUIDFromStr(encodedHash);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA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AM,CAACS,MAAM,EAAE,MAAM,CAAC;EAC7B,MAAMC,WAAW,GAAGT,MAAM,CAACA,MAAM,CAAC,CAAC;EACnC,OAAOJ,mBAAmB,CAACa,WAAW,CAAC;AACzC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StoreManifestEntry.js","names":[],"sources":["StoreManifestEntry.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 { UUID } from \"crypto\";\nimport type { SemverVersion } from \"./specGenerators.js\";\n\nexport interface MarketplaceBundleManifestEntry {\n blockSetVersionId: UUID;\n\n blockSetVersion: SemverVersion;\n\n titleAndDescription: {\n localizedTitle: {};\n localizedDescription: {};\n fallbackTitle: string;\n fallbackDescription: string;\n };\n\n mavenProductId: string | undefined;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["index.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\n/**\n * TypeScript serialization types for Marketplace Code Block specifications.\n *\n * These types mirror the Java classes in marketplace-foundry-as-code-api and are\n * designed to be JSON-serialization compatible for interop between TypeScript and Java.\n *\n * @module marketplaceSerialization\n */\n\n// Main spec types\nexport type { CodeBlockSetSpec } from \"./CodeBlockSetSpec.js\";\nexport type { CodeBlockSpec } from \"./CodeBlockSpec.js\";\n\n// Supporting types defined locally\nexport type {\n GeneratedBlockExternalRecommendations,\n InputMappingEntry,\n ReadableIdMappingPair,\n} from \"./supportingTypes.js\";\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { getShapes } from "../../conversion/toMarketplace/shapeExtractors/IrShapeExtractor.js";
|
|
18
|
+
import { OntologyRidGeneratorImpl } from "../../util/generateRid.js";
|
|
19
|
+
const ADD_ON_FILE_LOCATOR = {
|
|
20
|
+
type: "files",
|
|
21
|
+
files: {
|
|
22
|
+
path: "marketplace_internal_block_add_on"
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
export function isSemver(maybeSemver) {
|
|
26
|
+
return /^\d+\.\d+\.\d+$/.test(maybeSemver);
|
|
27
|
+
}
|
|
28
|
+
export function generateBlockSetSpec(version, productName, productDesc, packageName, codeBlocks) {
|
|
29
|
+
return {
|
|
30
|
+
version: version,
|
|
31
|
+
creationTimestamp: new Date().toISOString(),
|
|
32
|
+
about: {
|
|
33
|
+
fallbackDescription: productName,
|
|
34
|
+
fallbackTitle: productDesc,
|
|
35
|
+
localizedDescription: {},
|
|
36
|
+
localizedTitle: {}
|
|
37
|
+
},
|
|
38
|
+
generatedBlocks: codeBlocks,
|
|
39
|
+
packageName
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export function generateStoreManifest(blockSetSpecs) {
|
|
43
|
+
return Object.entries(blockSetSpecs).map(([fileName, spec]) => {
|
|
44
|
+
return {
|
|
45
|
+
blockSetVersionId: fileName,
|
|
46
|
+
blockSetVersion: spec.version,
|
|
47
|
+
titleAndDescription: spec.about,
|
|
48
|
+
mavenProductId: spec.packageName
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
export async function generateOntologyBlockSpec(mavenGroup, ontologyBlockDataV2, randomnessKey) {
|
|
53
|
+
const shapes = await getShapes(ontologyBlockDataV2.ontology, new OntologyRidGeneratorImpl(), randomnessKey);
|
|
54
|
+
return {
|
|
55
|
+
blockMavenCoordinate: `${mavenGroup}:ontology`,
|
|
56
|
+
inputs: Object.fromEntries(shapes.inputShapes),
|
|
57
|
+
outputs: Object.fromEntries(shapes.outputShapes),
|
|
58
|
+
blockData: [{
|
|
59
|
+
type: "files",
|
|
60
|
+
files: {
|
|
61
|
+
path: "ontology.json"
|
|
62
|
+
}
|
|
63
|
+
}],
|
|
64
|
+
blockType: "ONTOLOGY",
|
|
65
|
+
inputMappingEntries: [],
|
|
66
|
+
externalRecommendations: [],
|
|
67
|
+
inputShapeMetadata: Object.fromEntries(shapes.inputShapeMetadata)
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=specGenerators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specGenerators.js","names":["getShapes","OntologyRidGeneratorImpl","ADD_ON_FILE_LOCATOR","type","files","path","isSemver","maybeSemver","test","generateBlockSetSpec","version","productName","productDesc","packageName","codeBlocks","creationTimestamp","Date","toISOString","about","fallbackDescription","fallbackTitle","localizedDescription","localizedTitle","generatedBlocks","generateStoreManifest","blockSetSpecs","Object","entries","map","fileName","spec","blockSetVersionId","blockSetVersion","titleAndDescription","mavenProductId","generateOntologyBlockSpec","mavenGroup","ontologyBlockDataV2","randomnessKey","shapes","ontology","blockMavenCoordinate","inputs","fromEntries","inputShapes","outputs","outputShapes","blockData","blockType","inputMappingEntries","externalRecommendations","inputShapeMetadata"],"sources":["specGenerators.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 { OntologyIrV2 } from \"@osdk/client.unstable\";\nimport type { SerializedDataLocator } from \"@osdk/client.unstable/api\";\nimport type { UUID } from \"crypto\";\nimport { getShapes } from \"../../conversion/toMarketplace/shapeExtractors/IrShapeExtractor.js\";\nimport { OntologyRidGeneratorImpl } from \"../../util/generateRid.js\";\nimport type { CodeBlockSetSpec } from \"./CodeBlockSetSpec.js\";\nimport type { CodeBlockSpec } from \"./CodeBlockSpec.js\";\nimport type { MarketplaceBundleManifestEntry } from \"./StoreManifestEntry.js\";\n\nconst ADD_ON_FILE_LOCATOR: SerializedDataLocator = {\n type: \"files\",\n files: {\n path: \"marketplace_internal_block_add_on\",\n },\n};\n\nexport type SemverVersion = `${number}.${number}.${number}`;\n\nexport function isSemver(maybeSemver: string): maybeSemver is SemverVersion {\n const semverRegex = /^\\d+\\.\\d+\\.\\d+$/;\n return semverRegex.test(maybeSemver);\n}\n\nexport function generateBlockSetSpec(\n version: SemverVersion,\n productName: string,\n productDesc: string,\n packageName: string,\n codeBlocks: Record<UUID, CodeBlockSpec>,\n): CodeBlockSetSpec {\n return {\n version: version,\n creationTimestamp: new Date().toISOString(),\n about: {\n fallbackDescription: productName,\n fallbackTitle: productDesc,\n localizedDescription: {},\n localizedTitle: {},\n },\n generatedBlocks: codeBlocks,\n packageName,\n };\n}\n\nexport function generateStoreManifest(\n blockSetSpecs: Record<UUID, CodeBlockSetSpec>,\n): MarketplaceBundleManifestEntry[] {\n return Object.entries(blockSetSpecs).map(([fileName, spec]) => {\n return {\n blockSetVersionId: fileName as UUID,\n blockSetVersion: spec.version,\n titleAndDescription: spec.about,\n mavenProductId: spec.packageName,\n };\n });\n}\n\nexport async function generateOntologyBlockSpec(\n mavenGroup: string,\n ontologyBlockDataV2: OntologyIrV2,\n randomnessKey?: string,\n): Promise<CodeBlockSpec> {\n const shapes = await getShapes(\n ontologyBlockDataV2.ontology,\n new OntologyRidGeneratorImpl(),\n randomnessKey,\n );\n return {\n blockMavenCoordinate: `${mavenGroup}:ontology`,\n inputs: Object.fromEntries(shapes.inputShapes),\n outputs: Object.fromEntries(shapes.outputShapes),\n blockData: [{\n type: \"files\",\n files: {\n path: \"ontology.json\",\n },\n }],\n blockType: \"ONTOLOGY\",\n inputMappingEntries: [],\n externalRecommendations: [],\n inputShapeMetadata: Object.fromEntries(shapes.inputShapeMetadata),\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,SAASA,SAAS,QAAQ,oEAAoE;AAC9F,SAASC,wBAAwB,QAAQ,2BAA2B;AAKpE,MAAMC,mBAA0C,GAAG;EACjDC,IAAI,EAAE,OAAO;EACbC,KAAK,EAAE;IACLC,IAAI,EAAE;EACR;AACF,CAAC;AAID,OAAO,SAASC,QAAQA,CAACC,WAAmB,EAAgC;EAE1E,OADoB,iBAAiB,CAClBC,IAAI,CAACD,W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AAO;MACbC,KAAK,EAAE;QACLC,IAAI,EAAE;MACR;IACF,CAAC,CAAC;IACF2C,SAAS,EAAE,UAAU;IACrBC,mBAAmB,EAAE,EAAE;IACvBC,uBAAuB,EAAE,EAAE;IAC3BC,kBAAkB,EAAEzB,MAAM,CAACiB,WAAW,CAACJ,MAAM,CAACY,kBAAkB;EAClE,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supportingTypes.js","names":[],"sources":["supportingTypes.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 { BlockSetVersionRange } from \"@osdk/client.unstable/api\";\nimport type { ReadableId } from \"../../util/generateRid.js\";\n\n/**\n * Description of an install hint for code blocks.\n * Maps an input ReadableId to an output ReadableId to indicate how blocks can be connected.\n */\nexport interface InputMappingEntry {\n input: ReadableId;\n output: ReadableId;\n}\n\n/**\n * A mapping pair within external recommendations, linking upstream outputs to target inputs.\n */\nexport interface ReadableIdMappingPair {\n upstreamOutputReadableId: ReadableId;\n targetInputReadableId: ReadableId;\n}\n\n/**\n * External block set recommendations for generated blocks.\n * Describes how this block can be connected to upstream packages.\n */\nexport interface GeneratedBlockExternalRecommendations {\n /** The package name of the upstream block set */\n upstreamPackageName: string;\n\n /** The version range of the upstream block set this is compatible with */\n upstreamVersionCompatibility: BlockSetVersionRange;\n\n /** Mappings from upstream outputs to this block's inputs */\n mappings: ReadableIdMappingPair[];\n\n /** Optional randomness key for deterministic UUID generation in the upstream package */\n upstreamRandomnessKey?: string;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export function distributeTypeHelper(type) {
|
|
18
|
+
return {
|
|
19
|
+
type,
|
|
20
|
+
[type]: {}
|
|
21
|
+
}; // any cast to match conditional return type
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=distributeTypeHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"distributeTypeHelper.js","names":["distributeTypeHelper","type"],"sources":["distributeTypeHelper.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\nexport function distributeTypeHelper<T extends string>(\n type: T,\n): T extends any ?\n & { type: T }\n & {\n [K in T]: {};\n }\n : never\n{\n return { type, [type]: {} } as any; // any cast to match conditional return type\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASA,oBAAoBA,CAClCC,IAAO,EAOT;EACE,OAAO;IAAEA,IAAI;IAAE,CAACA,IAAI,GAAG,CAAC;EAAE,CAAC,CAAQ,CAAC;AACtC","ignoreList":[]}
|