@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
|
@@ -0,0 +1,247 @@
|
|
|
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 { cleanAndValidateLinkTypeId, getOntologyDefinition, OntologyEntityTypeEnum } from "@osdk/maker";
|
|
18
|
+
import invariant from "tiny-invariant";
|
|
19
|
+
import { convertCardinality } from "./convertCardinality.js";
|
|
20
|
+
export function convertLink(linkType, ridGenerator) {
|
|
21
|
+
validateLink(linkType);
|
|
22
|
+
let definition;
|
|
23
|
+
let datasource = undefined;
|
|
24
|
+
if ("one" in linkType) {
|
|
25
|
+
const {
|
|
26
|
+
apiName: oneObjectApiName,
|
|
27
|
+
object: oneObject
|
|
28
|
+
} = getObject(linkType.one.object);
|
|
29
|
+
const {
|
|
30
|
+
apiName: toManyObjectApiName,
|
|
31
|
+
object: toManyObject
|
|
32
|
+
} = getObject(linkType.toMany.object);
|
|
33
|
+
const oneObjectRid = ridGenerator.generateRidForObjectType(oneObjectApiName);
|
|
34
|
+
const toManyObjectRid = ridGenerator.generateRidForObjectType(toManyObjectApiName);
|
|
35
|
+
const onePkRid = ridGenerator.generatePropertyRid(oneObject.primaryKeyPropertyApiName, oneObjectApiName);
|
|
36
|
+
const manyFkRid = ridGenerator.generatePropertyRid(linkType.manyForeignKeyProperty, toManyObjectApiName);
|
|
37
|
+
definition = {
|
|
38
|
+
type: "oneToMany",
|
|
39
|
+
oneToMany: {
|
|
40
|
+
cardinalityHint: convertCardinality(linkType.cardinality),
|
|
41
|
+
manyToOneLinkMetadata: linkType.toMany.metadata,
|
|
42
|
+
objectTypeRidManySide: toManyObjectRid,
|
|
43
|
+
objectTypeRidOneSide: oneObjectRid,
|
|
44
|
+
oneToManyLinkMetadata: linkType.one.metadata,
|
|
45
|
+
// TODO: Convert property mappings to use RIDs as keys and values
|
|
46
|
+
oneSidePrimaryKeyToManySidePropertyMapping: {
|
|
47
|
+
[onePkRid]: manyFkRid
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
} else if ("intermediaryObjectType" in linkType) {
|
|
52
|
+
const {
|
|
53
|
+
apiName: manyObjectApiName,
|
|
54
|
+
object: manyObject
|
|
55
|
+
} = getObject(linkType.many.object);
|
|
56
|
+
const {
|
|
57
|
+
apiName: toManyObjectApiName,
|
|
58
|
+
object: toManyObject
|
|
59
|
+
} = getObject(linkType.toMany.object);
|
|
60
|
+
const {
|
|
61
|
+
apiName: intermediaryObjectApiName
|
|
62
|
+
} = getObject(linkType.intermediaryObjectType);
|
|
63
|
+
definition = {
|
|
64
|
+
type: "intermediary",
|
|
65
|
+
intermediary: {
|
|
66
|
+
objectTypeAToBLinkMetadata: linkType.many.metadata,
|
|
67
|
+
objectTypeBToALinkMetadata: linkType.toMany.metadata,
|
|
68
|
+
objectTypeRidA: ridGenerator.generateRidForObjectType(manyObjectApiName),
|
|
69
|
+
objectTypeRidB: ridGenerator.generateRidForObjectType(toManyObjectApiName),
|
|
70
|
+
intermediaryObjectTypeRid: ridGenerator.generateRidForObjectType(intermediaryObjectApiName),
|
|
71
|
+
aToIntermediaryLinkTypeRid: ridGenerator.generateRidForLinkType(cleanAndValidateLinkTypeId(linkType.many.linkToIntermediary.apiName)),
|
|
72
|
+
intermediaryToBLinkTypeRid: ridGenerator.generateRidForLinkType(cleanAndValidateLinkTypeId(linkType.toMany.linkToIntermediary.apiName))
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
} else {
|
|
76
|
+
const {
|
|
77
|
+
apiName: manyObjectApiName,
|
|
78
|
+
object: manyObject
|
|
79
|
+
} = getObject(linkType.many.object);
|
|
80
|
+
const {
|
|
81
|
+
apiName: toManyObjectApiName,
|
|
82
|
+
object: toManyObject
|
|
83
|
+
} = getObject(linkType.toMany.object);
|
|
84
|
+
const manyObjectRidA = ridGenerator.generateRidForObjectType(manyObjectApiName);
|
|
85
|
+
const manyObjectRidB = ridGenerator.generateRidForObjectType(toManyObjectApiName);
|
|
86
|
+
const manyPkRidA = ridGenerator.generatePropertyRid(manyObject.primaryKeyPropertyApiName, manyObjectApiName);
|
|
87
|
+
const manyPkRidB = ridGenerator.generatePropertyRid(toManyObject.primaryKeyPropertyApiName, toManyObjectApiName);
|
|
88
|
+
definition = {
|
|
89
|
+
type: "manyToMany",
|
|
90
|
+
manyToMany: {
|
|
91
|
+
objectTypeAToBLinkMetadata: linkType.many.metadata,
|
|
92
|
+
objectTypeBToALinkMetadata: linkType.toMany.metadata,
|
|
93
|
+
objectTypeRidA: manyObjectRidA,
|
|
94
|
+
objectTypeRidB: manyObjectRidB,
|
|
95
|
+
peeringMetadata: undefined,
|
|
96
|
+
// TODO: Convert property mappings to use RIDs as keys and values
|
|
97
|
+
objectTypeAPrimaryKeyPropertyMapping: {
|
|
98
|
+
[manyPkRidA]: manyPkRidA
|
|
99
|
+
},
|
|
100
|
+
objectTypeBPrimaryKeyPropertyMapping: {
|
|
101
|
+
[manyPkRidB]: manyPkRidB
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
datasource = {
|
|
106
|
+
rid: ridGenerator.generateRid(`datasource.link.${linkType.apiName}`),
|
|
107
|
+
datasource: {
|
|
108
|
+
type: "dataset",
|
|
109
|
+
dataset: {
|
|
110
|
+
// TODO: Add proper branchId from link configuration
|
|
111
|
+
branchId: "main",
|
|
112
|
+
datasetRid: ridGenerator.generateRid(`link.dataset.${linkType.apiName}`),
|
|
113
|
+
writebackDatasetRid: undefined,
|
|
114
|
+
// TODO: Convert property mappings to use property RIDs as keys
|
|
115
|
+
objectTypeAPrimaryKeyMapping: {
|
|
116
|
+
[manyPkRidA]: manyObject.primaryKeyPropertyApiName
|
|
117
|
+
},
|
|
118
|
+
objectTypeBPrimaryKeyMapping: {
|
|
119
|
+
[manyPkRidB]: toManyObject.primaryKeyPropertyApiName
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
editsConfiguration: {
|
|
124
|
+
onlyAllowPrivilegedEdits: false
|
|
125
|
+
},
|
|
126
|
+
redacted: linkType.redacted
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
const linkTypeId = cleanAndValidateLinkTypeId(linkType.apiName);
|
|
130
|
+
return {
|
|
131
|
+
linkType: {
|
|
132
|
+
definition: definition,
|
|
133
|
+
rid: ridGenerator.generateRidForLinkType(linkTypeId),
|
|
134
|
+
id: cleanAndValidateLinkTypeId(linkType.apiName),
|
|
135
|
+
status: convertLinkStatus(linkType.status, ridGenerator),
|
|
136
|
+
redacted: linkType.redacted ?? false
|
|
137
|
+
},
|
|
138
|
+
datasources: datasource !== undefined ? [datasource] : [],
|
|
139
|
+
entityMetadata: {
|
|
140
|
+
arePatchesEnabled: linkType.editsEnabled ?? false,
|
|
141
|
+
entityConfig: {
|
|
142
|
+
objectDbTypeConfigs: {
|
|
143
|
+
highbury: {
|
|
144
|
+
objectDbConfigs: {
|
|
145
|
+
"ri.highbury.main.cluster.1": {
|
|
146
|
+
configValue: "{}"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
targetStorageBackend: {
|
|
153
|
+
type: "objectStorageV2",
|
|
154
|
+
objectStorageV2: {}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
function validateLink(linkDefinition) {
|
|
160
|
+
if ("one" in linkDefinition) {
|
|
161
|
+
const {
|
|
162
|
+
apiName: oneObjectApiName,
|
|
163
|
+
object: oneObject
|
|
164
|
+
} = getObject(linkDefinition.one.object);
|
|
165
|
+
const {
|
|
166
|
+
apiName: toManyObjectApiName,
|
|
167
|
+
object: toManyObject
|
|
168
|
+
} = getObject(linkDefinition.toMany.object);
|
|
169
|
+
const foreignKey = toManyObject.properties?.find(p => p.apiName === linkDefinition.manyForeignKeyProperty);
|
|
170
|
+
!(foreignKey !== undefined) ? process.env.NODE_ENV !== "production" ? invariant(false, `Foreign key ${linkDefinition.manyForeignKeyProperty} on link ${linkDefinition.apiName} does not exist on object ${toManyObjectApiName}`) : invariant(false) : void 0;
|
|
171
|
+
!/([a-z][a-z0-9\\-]*)/.test(linkDefinition.apiName) ? process.env.NODE_ENV !== "production" ? invariant(false, `Top level link api names are expected to match the regex pattern ([a-z][a-z0-9\\-]*) ${linkDefinition.apiName} does not match`) : invariant(false) : void 0;
|
|
172
|
+
const typesMatch = foreignKey.type === oneObject.properties?.find(p => p.apiName === oneObject.primaryKeyPropertyApiName)?.type;
|
|
173
|
+
!typesMatch ? process.env.NODE_ENV !== "production" ? invariant(false, `Link ${linkDefinition.apiName} has type mismatch between the one side's primary key and the foreign key on the many side`) : invariant(false) : void 0;
|
|
174
|
+
}
|
|
175
|
+
if ("intermediaryObjectType" in linkDefinition) {
|
|
176
|
+
const {
|
|
177
|
+
apiName: intermediaryObjectTypeApiName,
|
|
178
|
+
object: intermediaryObjectType
|
|
179
|
+
} = getObject(linkDefinition.intermediaryObjectType);
|
|
180
|
+
const {
|
|
181
|
+
apiName: manyObjectApiName,
|
|
182
|
+
object: manyObject
|
|
183
|
+
} = getObject(linkDefinition.many.object);
|
|
184
|
+
const {
|
|
185
|
+
apiName: toManyObjectApiName,
|
|
186
|
+
object: toManyObject
|
|
187
|
+
} = getObject(linkDefinition.toMany.object);
|
|
188
|
+
const {
|
|
189
|
+
apiName: manyIntermediaryOneObjectApiName,
|
|
190
|
+
object: manyIntermediaryOneObject
|
|
191
|
+
} = getObject(linkDefinition.many.linkToIntermediary.one.object);
|
|
192
|
+
const {
|
|
193
|
+
apiName: manyIntermediaryToManyObjectApiName,
|
|
194
|
+
object: manyIntermediaryToManyObject
|
|
195
|
+
} = getObject(linkDefinition.many.linkToIntermediary.toMany.object);
|
|
196
|
+
!("one" in linkDefinition.many.linkToIntermediary && manyIntermediaryOneObjectApiName === manyObject.apiName && manyIntermediaryToManyObjectApiName === intermediaryObjectTypeApiName) ? process.env.NODE_ENV !== "production" ? invariant(false, `LinkTypeA ${linkDefinition.many.linkToIntermediary.apiName} must be a many to one link from intermediary object ${intermediaryObjectTypeApiName} to objectA ${manyObjectApiName}`) : invariant(false) : void 0;
|
|
197
|
+
const {
|
|
198
|
+
apiName: toManyIntermediaryOneObjectApiName,
|
|
199
|
+
object: toManyIntermediaryOneObject
|
|
200
|
+
} = getObject(linkDefinition.toMany.linkToIntermediary.one.object);
|
|
201
|
+
const {
|
|
202
|
+
apiName: toManyIntermediaryToManyObjectApiName,
|
|
203
|
+
object: toManyIntermediaryToManyObject
|
|
204
|
+
} = getObject(linkDefinition.toMany.linkToIntermediary.toMany.object);
|
|
205
|
+
!("one" in linkDefinition.toMany.linkToIntermediary && toManyIntermediaryOneObjectApiName === toManyObjectApiName && toManyIntermediaryToManyObjectApiName === intermediaryObjectTypeApiName) ? process.env.NODE_ENV !== "production" ? invariant(false, `LinkTypeB ${linkDefinition.toMany.linkToIntermediary.apiName} must be a many to one link from intermediary object ${intermediaryObjectTypeApiName} to objectB ${toManyObjectApiName}`) : invariant(false) : void 0;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
export function getObject(object) {
|
|
209
|
+
const objectApiName = typeof object === "string" ? object : object.apiName;
|
|
210
|
+
const fullObject = getOntologyDefinition()[OntologyEntityTypeEnum.OBJECT_TYPE][objectApiName];
|
|
211
|
+
!(fullObject !== undefined) ? process.env.NODE_ENV !== "production" ? invariant(false, `Object ${objectApiName} is not defined`) : invariant(false) : void 0;
|
|
212
|
+
return {
|
|
213
|
+
apiName: objectApiName,
|
|
214
|
+
object: fullObject
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
export function convertLinkStatus(status, ridGenerator) {
|
|
218
|
+
if (typeof status === "object" && "type" in status && status.type === "deprecated") {
|
|
219
|
+
return {
|
|
220
|
+
type: "deprecated",
|
|
221
|
+
deprecated: {
|
|
222
|
+
message: status.message,
|
|
223
|
+
deadline: status.deadline,
|
|
224
|
+
replacedBy: status.replacedBy ? ridGenerator.generateRidForLinkType(cleanAndValidateLinkTypeId(status.replacedBy)) : undefined
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
switch (status) {
|
|
229
|
+
case "experimental":
|
|
230
|
+
return {
|
|
231
|
+
type: "experimental",
|
|
232
|
+
experimental: {}
|
|
233
|
+
};
|
|
234
|
+
case "example":
|
|
235
|
+
return {
|
|
236
|
+
type: "example",
|
|
237
|
+
example: {}
|
|
238
|
+
};
|
|
239
|
+
case "active":
|
|
240
|
+
default:
|
|
241
|
+
return {
|
|
242
|
+
type: "active",
|
|
243
|
+
active: {}
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
//# sourceMappingURL=convertLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertLink.js","names":["cleanAndValidateLinkTypeId","getOntologyDefinition","OntologyEntityTypeEnum","invariant","convertCardinality","convertLink","linkType","ridGenerator","validateLink","definition","datasource","undefined","apiName","oneObjectApiName","object","oneObject","getObject","one","toManyObjectApiName","toManyObject","toMany","oneObjectRid","generateRidForObjectType","toManyObjectRid","onePkRid","generatePropertyRid","primaryKeyPropertyApiName","manyFkRid","manyForeignKeyProperty","type","oneToMany","cardinalityHint","cardinality","manyToOneLinkMetadata","metadata","objectTypeRidManySide","objectTypeRidOneSide","oneToManyLinkMetadata","oneSidePrimaryKeyToManySidePropertyMapping","manyObjectApiName","manyObject","many","intermediaryObjectApiName","intermediaryObjectType","intermediary","objectTypeAToBLinkMetadata","objectTypeBToALinkMetadata","objectTypeRidA","objectTypeRidB","intermediaryObjectTypeRid","aToIntermediaryLinkTypeRid","generateRidForLinkType","linkToIntermediary","intermediaryToBLinkTypeRid","manyObjectRidA","manyObjectRidB","manyPkRidA","manyPkRidB","manyToMany","peeringMetadata","objectTypeAPrimaryKeyPropertyMapping","objectTypeBPrimaryKeyPropertyMapping","rid","generateRid","dataset","branchId","datasetRid","writebackDatasetRid","objectTypeAPrimaryKeyMapping","objectTypeBPrimaryKeyMapping","editsConfiguration","onlyAllowPrivilegedEdits","redacted","linkTypeId","id","status","convertLinkStatus","datasources","entityMetadata","arePatchesEnabled","editsEnabled","entityConfig","objectDbTypeConfigs","highbury","objectDbConfigs","configValue","targetStorageBackend","objectStorageV2","linkDefinition","foreignKey","properties","find","p","process","env","NODE_ENV","test","typesMatch","intermediaryObjectTypeApiName","manyIntermediaryOneObjectApiName","manyIntermediaryOneObject","manyIntermediaryToManyObjectApiName","manyIntermediaryToManyObject","toManyIntermediaryOneObjectApiName","toManyIntermediaryOneObject","toManyIntermediaryToManyObjectApiName","toManyIntermediaryToManyObject","objectApiName","fullObject","OBJECT_TYPE","deprecated","message","deadline","replacedBy","experimental","example","active"],"sources":["convertLink.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 LinkDefinition,\n LinkTypeBlockDataV2,\n LinkTypeStatus,\n ManyToManyLinkTypeDatasource,\n} from \"@osdk/client.unstable\";\nimport type {\n LinkType,\n ObjectType,\n ObjectTypeDefinition,\n UserLinkTypeStatus,\n} from \"@osdk/maker\";\nimport {\n cleanAndValidateLinkTypeId,\n getOntologyDefinition,\n OntologyEntityTypeEnum,\n} from \"@osdk/maker\";\nimport invariant from \"tiny-invariant\";\nimport type { OntologyRidGenerator } from \"../../util/generateRid.js\";\nimport { convertCardinality } from \"./convertCardinality.js\";\n\nexport function convertLink(\n linkType: LinkType,\n ridGenerator: OntologyRidGenerator,\n): LinkTypeBlockDataV2 {\n validateLink(linkType);\n let definition: LinkDefinition;\n let datasource: ManyToManyLinkTypeDatasource | undefined = undefined;\n if (\"one\" in linkType) {\n const { apiName: oneObjectApiName, object: oneObject } = getObject(\n linkType.one.object,\n );\n const { apiName: toManyObjectApiName, object: toManyObject } = getObject(\n linkType.toMany.object,\n );\n const oneObjectRid = ridGenerator.generateRidForObjectType(\n oneObjectApiName,\n );\n const toManyObjectRid = ridGenerator.generateRidForObjectType(\n toManyObjectApiName,\n );\n const onePkRid = ridGenerator.generatePropertyRid(\n oneObject.primaryKeyPropertyApiName,\n oneObjectApiName,\n );\n const manyFkRid = ridGenerator.generatePropertyRid(\n linkType.manyForeignKeyProperty,\n toManyObjectApiName,\n );\n\n definition = {\n type: \"oneToMany\",\n oneToMany: {\n cardinalityHint: convertCardinality(linkType.cardinality),\n manyToOneLinkMetadata: linkType.toMany.metadata,\n objectTypeRidManySide: toManyObjectRid,\n objectTypeRidOneSide: oneObjectRid,\n oneToManyLinkMetadata: linkType.one.metadata,\n // TODO: Convert property mappings to use RIDs as keys and values\n oneSidePrimaryKeyToManySidePropertyMapping: {\n [onePkRid]: manyFkRid,\n },\n },\n };\n } else if (\"intermediaryObjectType\" in linkType) {\n const { apiName: manyObjectApiName, object: manyObject } = getObject(\n linkType.many.object,\n );\n const { apiName: toManyObjectApiName, object: toManyObject } = getObject(\n linkType.toMany.object,\n );\n const { apiName: intermediaryObjectApiName } = getObject(\n linkType.intermediaryObjectType,\n );\n definition = {\n type: \"intermediary\",\n intermediary: {\n objectTypeAToBLinkMetadata: linkType.many.metadata,\n objectTypeBToALinkMetadata: linkType.toMany.metadata,\n objectTypeRidA: ridGenerator.generateRidForObjectType(\n manyObjectApiName,\n ),\n objectTypeRidB: ridGenerator.generateRidForObjectType(\n toManyObjectApiName,\n ),\n intermediaryObjectTypeRid: ridGenerator.generateRidForObjectType(\n intermediaryObjectApiName,\n ),\n aToIntermediaryLinkTypeRid: ridGenerator.generateRidForLinkType(\n cleanAndValidateLinkTypeId(linkType.many.linkToIntermediary.apiName),\n ),\n intermediaryToBLinkTypeRid: ridGenerator.generateRidForLinkType(\n cleanAndValidateLinkTypeId(\n linkType.toMany.linkToIntermediary.apiName,\n ),\n ),\n },\n };\n } else {\n const { apiName: manyObjectApiName, object: manyObject } = getObject(\n linkType.many.object,\n );\n const { apiName: toManyObjectApiName, object: toManyObject } = getObject(\n linkType.toMany.object,\n );\n const manyObjectRidA = ridGenerator.generateRidForObjectType(\n manyObjectApiName,\n );\n const manyObjectRidB = ridGenerator.generateRidForObjectType(\n toManyObjectApiName,\n );\n const manyPkRidA = ridGenerator.generatePropertyRid(\n manyObject.primaryKeyPropertyApiName,\n manyObjectApiName,\n );\n const manyPkRidB = ridGenerator.generatePropertyRid(\n toManyObject.primaryKeyPropertyApiName,\n toManyObjectApiName,\n );\n\n definition = {\n type: \"manyToMany\",\n manyToMany: {\n objectTypeAToBLinkMetadata: linkType.many.metadata,\n objectTypeBToALinkMetadata: linkType.toMany.metadata,\n objectTypeRidA: manyObjectRidA,\n objectTypeRidB: manyObjectRidB,\n peeringMetadata: undefined,\n // TODO: Convert property mappings to use RIDs as keys and values\n objectTypeAPrimaryKeyPropertyMapping: {\n [manyPkRidA]: manyPkRidA,\n },\n objectTypeBPrimaryKeyPropertyMapping: {\n [manyPkRidB]: manyPkRidB,\n },\n },\n };\n\n datasource = {\n rid: ridGenerator.generateRid(`datasource.link.${linkType.apiName}`),\n datasource: {\n type: \"dataset\",\n dataset: {\n // TODO: Add proper branchId from link configuration\n branchId: \"main\",\n datasetRid: ridGenerator.generateRid(\n `link.dataset.${linkType.apiName}`,\n ),\n writebackDatasetRid: undefined,\n // TODO: Convert property mappings to use property RIDs as keys\n objectTypeAPrimaryKeyMapping: {\n [manyPkRidA]: manyObject.primaryKeyPropertyApiName,\n },\n objectTypeBPrimaryKeyMapping: {\n [manyPkRidB]: toManyObject.primaryKeyPropertyApiName,\n },\n },\n },\n editsConfiguration: {\n onlyAllowPrivilegedEdits: false,\n },\n redacted: linkType.redacted,\n };\n }\n\n const linkTypeId = cleanAndValidateLinkTypeId(linkType.apiName);\n\n return {\n linkType: {\n definition: definition,\n rid: ridGenerator.generateRidForLinkType(linkTypeId),\n id: cleanAndValidateLinkTypeId(linkType.apiName),\n status: convertLinkStatus(linkType.status, ridGenerator),\n redacted: linkType.redacted ?? false,\n },\n datasources: datasource !== undefined ? [datasource] : [],\n entityMetadata: {\n arePatchesEnabled: linkType.editsEnabled ?? false,\n entityConfig: {\n objectDbTypeConfigs: {\n highbury: {\n objectDbConfigs: {\n \"ri.highbury.main.cluster.1\": { configValue: \"{}\" },\n },\n },\n },\n },\n targetStorageBackend: { type: \"objectStorageV2\", objectStorageV2: {} },\n },\n };\n}\nfunction validateLink(linkDefinition: LinkType) {\n if (\"one\" in linkDefinition) {\n const { apiName: oneObjectApiName, object: oneObject } = getObject(\n linkDefinition.one.object,\n );\n const { apiName: toManyObjectApiName, object: toManyObject } = getObject(\n linkDefinition.toMany.object,\n );\n const foreignKey = toManyObject.properties?.find(p =>\n p.apiName === linkDefinition.manyForeignKeyProperty\n );\n invariant(\n foreignKey !== undefined,\n `Foreign key ${linkDefinition.manyForeignKeyProperty} on link ${linkDefinition.apiName} does not exist on object ${toManyObjectApiName}`,\n );\n\n invariant(\n /([a-z][a-z0-9\\\\-]*)/.test(linkDefinition.apiName),\n `Top level link api names are expected to match the regex pattern ([a-z][a-z0-9\\\\-]*) ${linkDefinition.apiName} does not match`,\n );\n\n const typesMatch = foreignKey.type\n === oneObject.properties?.find(p =>\n p.apiName === oneObject.primaryKeyPropertyApiName\n )?.type;\n invariant(\n typesMatch,\n `Link ${linkDefinition.apiName} has type mismatch between the one side's primary key and the foreign key on the many side`,\n );\n }\n if (\"intermediaryObjectType\" in linkDefinition) {\n const {\n apiName: intermediaryObjectTypeApiName,\n object: intermediaryObjectType,\n } = getObject(linkDefinition.intermediaryObjectType);\n const { apiName: manyObjectApiName, object: manyObject } = getObject(\n linkDefinition.many.object,\n );\n const { apiName: toManyObjectApiName, object: toManyObject } = getObject(\n linkDefinition.toMany.object,\n );\n\n const {\n apiName: manyIntermediaryOneObjectApiName,\n object: manyIntermediaryOneObject,\n } = getObject((linkDefinition.many.linkToIntermediary as any).one.object);\n const {\n apiName: manyIntermediaryToManyObjectApiName,\n object: manyIntermediaryToManyObject,\n } = getObject(linkDefinition.many.linkToIntermediary.toMany.object);\n invariant(\n \"one\" in linkDefinition.many.linkToIntermediary\n && manyIntermediaryOneObjectApiName\n === manyObject.apiName\n && manyIntermediaryToManyObjectApiName\n === intermediaryObjectTypeApiName,\n `LinkTypeA ${linkDefinition.many.linkToIntermediary.apiName} must be a many to one link from intermediary object ${intermediaryObjectTypeApiName} to objectA ${manyObjectApiName}`,\n );\n\n const {\n apiName: toManyIntermediaryOneObjectApiName,\n object: toManyIntermediaryOneObject,\n } = getObject((linkDefinition.toMany.linkToIntermediary as any).one.object);\n const {\n apiName: toManyIntermediaryToManyObjectApiName,\n object: toManyIntermediaryToManyObject,\n } = getObject(linkDefinition.toMany.linkToIntermediary.toMany.object);\n invariant(\n \"one\" in linkDefinition.toMany.linkToIntermediary\n && toManyIntermediaryOneObjectApiName\n === toManyObjectApiName\n && toManyIntermediaryToManyObjectApiName\n === intermediaryObjectTypeApiName,\n `LinkTypeB ${linkDefinition.toMany.linkToIntermediary.apiName} must be a many to one link from intermediary object ${intermediaryObjectTypeApiName} to objectB ${toManyObjectApiName}`,\n );\n }\n}\n\nexport function getObject(\n object: string | ObjectTypeDefinition,\n): { apiName: string; object: ObjectType } {\n const objectApiName = typeof object === \"string\" ? object : object.apiName;\n const fullObject =\n getOntologyDefinition()[OntologyEntityTypeEnum.OBJECT_TYPE][objectApiName];\n invariant(\n fullObject !== undefined,\n `Object ${objectApiName} is not defined`,\n );\n return { apiName: objectApiName, object: fullObject };\n}\n\nexport function convertLinkStatus(\n status: UserLinkTypeStatus | undefined,\n ridGenerator: OntologyRidGenerator,\n): LinkTypeStatus {\n if (\n typeof status === \"object\" && \"type\" in status\n && status.type === \"deprecated\"\n ) {\n return {\n type: \"deprecated\",\n deprecated: {\n message: status.message,\n deadline: status.deadline,\n replacedBy: status.replacedBy\n ? ridGenerator.generateRidForLinkType(\n cleanAndValidateLinkTypeId(status.replacedBy),\n )\n : undefined,\n },\n };\n }\n switch (status) {\n case \"experimental\":\n return { type: \"experimental\", experimental: {} };\n case \"example\":\n return { type: \"example\", example: {} };\n case \"active\":\n default:\n return { type: \"active\", active: {} };\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA,SACEA,0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C,IAAI,EAAE,cAAc;QAAEqF,YAAY,EAAE,CAAC;MAAE,CAAC;IACnD,KAAK,SAAS;MACZ,OAAO;QAAErF,IAAI,EAAE,SAAS;QAAEsF,OAAO,EAAE,CAAC;MAAE,CAAC;IACzC,KAAK,QAAQ;IACb;MACE,OAAO;QAAEtF,IAAI,EAAE,QAAQ;QAAEuF,MAAM,EAAE,CAAC;MAAE,CAAC;EACzC;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,76 @@
|
|
|
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 { randomUUID } from "crypto";
|
|
18
|
+
export function convertInterfacePropertyMappingValue(value) {
|
|
19
|
+
switch (value.type) {
|
|
20
|
+
case "uuid":
|
|
21
|
+
return {
|
|
22
|
+
type: "logicRuleValue",
|
|
23
|
+
logicRuleValue: {
|
|
24
|
+
type: "uniqueIdentifier",
|
|
25
|
+
uniqueIdentifier: {
|
|
26
|
+
linkId: value.linkId ?? randomUUID()
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
case "currentTime":
|
|
31
|
+
return {
|
|
32
|
+
type: "logicRuleValue",
|
|
33
|
+
logicRuleValue: {
|
|
34
|
+
type: "currentTime",
|
|
35
|
+
currentTime: {}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
case "currentUser":
|
|
39
|
+
return {
|
|
40
|
+
type: "logicRuleValue",
|
|
41
|
+
logicRuleValue: {
|
|
42
|
+
type: "currentUser",
|
|
43
|
+
currentUser: {}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
default:
|
|
47
|
+
return {
|
|
48
|
+
type: "logicRuleValue",
|
|
49
|
+
logicRuleValue: value
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export function convertMappingValue(value) {
|
|
54
|
+
switch (value.type) {
|
|
55
|
+
case "uuid":
|
|
56
|
+
return {
|
|
57
|
+
type: "uniqueIdentifier",
|
|
58
|
+
uniqueIdentifier: {
|
|
59
|
+
linkId: value.linkId ?? randomUUID()
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
case "currentTime":
|
|
63
|
+
return {
|
|
64
|
+
type: "currentTime",
|
|
65
|
+
currentTime: {}
|
|
66
|
+
};
|
|
67
|
+
case "currentUser":
|
|
68
|
+
return {
|
|
69
|
+
type: "currentUser",
|
|
70
|
+
currentUser: {}
|
|
71
|
+
};
|
|
72
|
+
default:
|
|
73
|
+
return value;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=convertMappingValue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertMappingValue.js","names":["randomUUID","convertInterfacePropertyMappingValue","value","type","logicRuleValue","uniqueIdentifier","linkId","currentTime","currentUser","convertMappingValue"],"sources":["convertMappingValue.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 OntologyIrInterfacePropertyLogicRuleValue,\n OntologyIrLogicRuleValue,\n} from \"@osdk/client.unstable\";\nimport type { MappingValue } from \"@osdk/maker\";\nimport { randomUUID } from \"crypto\";\n\nexport function convertInterfacePropertyMappingValue(\n value: MappingValue,\n): OntologyIrInterfacePropertyLogicRuleValue {\n switch (value.type) {\n case \"uuid\":\n return {\n type: \"logicRuleValue\",\n logicRuleValue: {\n type: \"uniqueIdentifier\",\n uniqueIdentifier: {\n linkId: value.linkId ?? randomUUID(),\n },\n },\n };\n case \"currentTime\":\n return {\n type: \"logicRuleValue\",\n logicRuleValue: {\n type: \"currentTime\",\n currentTime: {},\n },\n };\n case \"currentUser\":\n return {\n type: \"logicRuleValue\",\n logicRuleValue: {\n type: \"currentUser\",\n currentUser: {},\n },\n };\n default:\n return {\n type: \"logicRuleValue\",\n logicRuleValue: value,\n };\n }\n}\n\nexport function convertMappingValue(\n value: MappingValue,\n): OntologyIrLogicRuleValue {\n switch (value.type) {\n case \"uuid\":\n return {\n type: \"uniqueIdentifier\",\n uniqueIdentifier: {\n linkId: value.linkId ?? randomUUID(),\n },\n };\n case \"currentTime\":\n return {\n type: \"currentTime\",\n currentTime: {},\n };\n case \"currentUser\":\n return {\n type: \"currentUser\",\n currentUser: {},\n };\n default:\n return value;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA,SAASA,UAAU,QAAQ,QAAQ;AAEnC,OAAO,SAASC,oCAAoCA,CAClDC,KAAmB,EACwB;EAC3C,QAAQA,KAAK,CAACC,IAAI;IAChB,KAAK,MAAM;MACT,OAAO;QACLA,IAAI,EAAE,gBAAgB;QACtBC,cAAc,EAAE;UACdD,IAAI,EAAE,kBAAkB;UACxBE,gBAAgB,EAAE;YAChBC,MAAM,EAAEJ,KAAK,CAACI,MAAM,IAAIN,UAAU,CAAC;UACrC;QACF;MACF,CAAC;IACH,KAAK,aAAa;MAChB,OAAO;QACLG,IAAI,EAAE,gBAAgB;QACtBC,cAAc,EAAE;UACdD,IAAI,EAAE,aAAa;UACnBI,WAAW,EAAE,CAAC;QAChB;MACF,CAAC;IACH,KAAK,aAAa;MAChB,OAAO;QACLJ,IAAI,EAAE,gBAAgB;QACtBC,cAAc,EAAE;UACdD,IAAI,EAAE,aAAa;UACnBK,WAAW,EAAE,CAAC;QAChB;MACF,CAAC;IACH;MACE,OAAO;QACLL,IAAI,EAAE,gBAAgB;QACtBC,cAAc,EAAEF;MAClB,CAAC;EACL;AACF;AAEA,OAAO,SAASO,mBAAmBA,CACjCP,KAAmB,EACO;EAC1B,QAAQA,KAAK,CAACC,IAAI;IAChB,KAAK,MAAM;MACT,OAAO;QACLA,IAAI,EAAE,kBAAkB;QACxBE,gBAAgB,EAAE;UAChBC,MAAM,EAAEJ,KAAK,CAACI,MAAM,IAAIN,UAAU,CAAC;QACrC;MACF,CAAC;IACH,KAAK,aAAa;MAChB,OAAO;QACLG,IAAI,EAAE,aAAa;QACnBI,WAAW,EAAE,CAAC;MAChB,CAAC;IACH,KAAK,aAAa;MAChB,OAAO;QACLJ,IAAI,EAAE,aAAa;QACnBK,WAAW,EAAE,CAAC;MAChB,CAAC;IACH;MACE,OAAON,KAAK;EAChB;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
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 invariant from "tiny-invariant";
|
|
18
|
+
export function convertNullabilityToDataConstraint(prop) {
|
|
19
|
+
if (typeof prop.type === "object" && prop.type.type === "marking") {
|
|
20
|
+
if (prop.nullability === undefined) {
|
|
21
|
+
return {
|
|
22
|
+
propertyTypeConstraints: [],
|
|
23
|
+
nullability: undefined,
|
|
24
|
+
nullabilityV2: {
|
|
25
|
+
noNulls: true
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
!prop.nullability?.noNulls ? process.env.NODE_ENV !== "production" ? invariant(false, "Marking property type has noNulls set to false, marking properties must not be nullable") : invariant(false) : void 0;
|
|
30
|
+
return {
|
|
31
|
+
propertyTypeConstraints: [],
|
|
32
|
+
nullability: undefined,
|
|
33
|
+
nullabilityV2: prop.nullability
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return prop.nullability === undefined ? undefined : {
|
|
37
|
+
propertyTypeConstraints: [],
|
|
38
|
+
nullability: undefined,
|
|
39
|
+
nullabilityV2: prop.nullability
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=convertNullabilityToDataConstraint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertNullabilityToDataConstraint.js","names":["invariant","convertNullabilityToDataConstraint","prop","type","nullability","undefined","propertyTypeConstraints","nullabilityV2","noNulls","process","env","NODE_ENV"],"sources":["convertNullabilityToDataConstraint.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 { DataConstraints } from \"@osdk/client.unstable\";\nimport type { Nullability, PropertyTypeType } from \"@osdk/maker\";\nimport invariant from \"tiny-invariant\";\n\nexport function convertNullabilityToDataConstraint(\n prop: { type: PropertyTypeType; nullability?: Nullability },\n): DataConstraints | undefined {\n if (typeof prop.type === \"object\" && prop.type.type === \"marking\") {\n if (prop.nullability === undefined) {\n return {\n propertyTypeConstraints: [],\n nullability: undefined,\n nullabilityV2: { noNulls: true },\n };\n }\n invariant(\n prop.nullability?.noNulls,\n \"Marking property type has noNulls set to false, marking properties must not be nullable\",\n );\n return {\n propertyTypeConstraints: [],\n nullability: undefined,\n nullabilityV2: prop.nullability,\n };\n }\n return prop.nullability === undefined ? undefined : {\n propertyTypeConstraints: [],\n nullability: undefined,\n nullabilityV2: prop.nullability,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAOA,SAAS,MAAM,gBAAgB;AAEtC,OAAO,SAASC,kCAAkCA,CAChDC,IAA2D,EAC9B;EAC7B,IAAI,OAAOA,IAAI,CAACC,IAAI,KAAK,QAAQ,IAAID,IAAI,CAACC,IAAI,CAACA,IAAI,KAAK,SAAS,EAAE;IACjE,IAAID,IAAI,CAACE,WAAW,KAAKC,SAAS,EAAE;MAClC,OAAO;QACLC,uBAAuB,EAAE,EAAE;QAC3BF,WAAW,EAAEC,SAAS;QACtBE,aAAa,EAAE;UAAEC,OAAO,EAAE;QAAK;MACjC,CAAC;IACH;IACA,CACEN,IAAI,CAACE,WAAW,EAAEI,OAAO,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAD3BX,SAAS,QAEP,yFAAyF,IAF3FA,SAAS;IAIT,OAAO;MACLM,uBAAuB,EAAE,EAAE;MAC3BF,WAAW,EAAEC,SAAS;MACtBE,aAAa,EAAEL,IAAI,CAACE;IACtB,CAAC;EACH;EACA,OAAOF,IAAI,CAACE,WAAW,KAAKC,SAAS,GAAGA,SAAS,GAAG;IAClDC,uBAAuB,EAAE,EAAE;IAC3BF,WAAW,EAAEC,SAAS;IACtBE,aAAa,EAAEL,IAAI,CAACE;EACtB,CAAC;AACH","ignoreList":[]}
|