@osdk/generator 2.1.0-beta.9 → 2.2.0-beta.1
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 +238 -0
- package/build/browser/GenerateContext/EnhanceCommon.js +0 -15
- package/build/browser/GenerateContext/EnhanceCommon.js.map +1 -1
- package/build/browser/GenerateContext/EnhancedAction.js +1 -1
- package/build/browser/GenerateContext/EnhancedAction.js.map +1 -1
- package/build/browser/GenerateContext/EnhancedBase.js +2 -7
- package/build/browser/GenerateContext/EnhancedBase.js.map +1 -1
- package/build/browser/GenerateContext/EnhancedInterfaceType.js +1 -1
- package/build/browser/GenerateContext/EnhancedInterfaceType.js.map +1 -1
- package/build/browser/GenerateContext/EnhancedObjectType.js +2 -2
- package/build/browser/GenerateContext/EnhancedObjectType.js.map +1 -1
- package/build/browser/GenerateContext/EnhancedOntologyDefinition.js +1 -8
- package/build/browser/GenerateContext/EnhancedOntologyDefinition.js.map +1 -1
- package/build/browser/GenerateContext/EnhancedQuery.js +2 -2
- package/build/browser/GenerateContext/EnhancedQuery.js.map +1 -1
- package/build/browser/GenerateContext/EnhancedSharedPropertyType.js +1 -1
- package/build/browser/GenerateContext/EnhancedSharedPropertyType.js.map +1 -1
- package/build/browser/GenerateContext/ForeignType.js +1 -1
- package/build/browser/GenerateContext/ForeignType.js.map +1 -1
- package/build/browser/GenerateContext/GenerateContext.js +0 -15
- package/build/browser/GenerateContext/GenerateContext.js.map +1 -1
- package/build/browser/GenerateContext/enhanceOntology.js +1 -0
- package/build/browser/GenerateContext/enhanceOntology.js.map +1 -1
- package/build/browser/MinimalFs.js +0 -15
- package/build/browser/MinimalFs.js.map +1 -1
- package/build/browser/WireOntologyDefinition.js +0 -15
- package/build/browser/WireOntologyDefinition.js.map +1 -1
- package/build/browser/generateClientSdkPackage.js +5 -3
- package/build/browser/generateClientSdkPackage.js.map +1 -1
- package/build/browser/generateClientSdkPackage.test.js +1 -0
- package/build/browser/generateClientSdkPackage.test.js.map +1 -1
- package/build/browser/index.js +1 -0
- package/build/browser/index.js.map +1 -1
- package/build/browser/shared/apiNamespaces/startsWithApiNamespace.js +1 -0
- package/build/browser/shared/apiNamespaces/startsWithApiNamespace.js.map +1 -1
- package/build/browser/shared/apiNamespaces/startsWithApiNamespace.test.js +1 -0
- package/build/browser/shared/apiNamespaces/startsWithApiNamespace.test.js.map +1 -1
- package/build/browser/shared/getObjectImports.js +1 -0
- package/build/browser/shared/getObjectImports.js.map +1 -1
- package/build/browser/shared/getObjectTypeApiNamesFromQuery.js +1 -0
- package/build/browser/shared/getObjectTypeApiNamesFromQuery.js.map +1 -1
- package/build/browser/shared/getObjectTypesFromQueryDataType.js +1 -0
- package/build/browser/shared/getObjectTypesFromQueryDataType.js.map +1 -1
- package/build/browser/shared/propertyJsdoc.js +1 -0
- package/build/browser/shared/propertyJsdoc.js.map +1 -1
- package/build/browser/shared/sanitizeMetadata.js +9 -0
- package/build/browser/shared/sanitizeMetadata.js.map +1 -1
- package/build/browser/shared/sanitizeMetadata.test.js +1 -0
- package/build/browser/shared/sanitizeMetadata.test.js.map +1 -1
- package/build/browser/util/InMemoryFs.js +1 -0
- package/build/browser/util/InMemoryFs.js.map +1 -1
- package/build/browser/util/commaSeparatedIdentifiers.js +1 -0
- package/build/browser/util/commaSeparatedIdentifiers.js.map +1 -1
- package/build/browser/util/commaSeparatedTypeIdentifiers.js +1 -0
- package/build/browser/util/commaSeparatedTypeIdentifiers.js.map +1 -1
- package/build/browser/util/deleteUndefineds.js +1 -0
- package/build/browser/util/deleteUndefineds.js.map +1 -1
- package/build/browser/util/reservedKeywords.js +1 -0
- package/build/browser/util/reservedKeywords.js.map +1 -1
- package/build/browser/util/stringUnionFrom.js +1 -0
- package/build/browser/util/stringUnionFrom.js.map +1 -1
- package/build/browser/util/stringify.js +16 -0
- package/build/browser/util/stringify.js.map +1 -1
- package/build/browser/util/test/TodoWireOntology.js +24 -5
- package/build/browser/util/test/TodoWireOntology.js.map +1 -1
- package/build/browser/util/test/compileThis.js +1 -0
- package/build/browser/util/test/compileThis.js.map +1 -1
- package/build/browser/util/test/createMockMinimalFiles.js +1 -0
- package/build/browser/util/test/createMockMinimalFiles.js.map +1 -1
- package/build/browser/util/test/formatTs.js +1 -0
- package/build/browser/util/test/formatTs.js.map +1 -1
- package/build/browser/util/verifyOutDir.js +1 -0
- package/build/browser/util/verifyOutDir.js.map +1 -1
- package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js +4 -1
- package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js.map +1 -1
- package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js +10 -1
- package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js.map +1 -1
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.js +4 -1
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.js.map +1 -1
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.js +672 -628
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.js.map +1 -1
- package/build/browser/v2.0/generateMetadata.js +4 -1
- package/build/browser/v2.0/generateMetadata.js.map +1 -1
- package/build/browser/v2.0/generatePerActionDataFiles.js +30 -8
- package/build/browser/v2.0/generatePerActionDataFiles.js.map +1 -1
- package/build/browser/v2.0/generatePerActionDataFiles.test.js +1 -0
- package/build/browser/v2.0/generatePerActionDataFiles.test.js.map +1 -1
- package/build/browser/v2.0/generatePerInterfaceDataFiles.js +2 -0
- package/build/browser/v2.0/generatePerInterfaceDataFiles.js.map +1 -1
- package/build/browser/v2.0/generatePerObjectDataFiles.js +1 -0
- package/build/browser/v2.0/generatePerObjectDataFiles.js.map +1 -1
- package/build/browser/v2.0/generatePerQueryDataFiles.js +10 -4
- package/build/browser/v2.0/generatePerQueryDataFiles.js.map +1 -1
- package/build/browser/v2.0/generatePerQueryDataFiles.test.js +2 -0
- package/build/browser/v2.0/generatePerQueryDataFiles.test.js.map +1 -1
- package/build/browser/v2.0/generateRootIndexTsFile.js +3 -1
- package/build/browser/v2.0/generateRootIndexTsFile.js.map +1 -1
- package/build/browser/v2.0/getDescriptionIfPresent.js +1 -0
- package/build/browser/v2.0/getDescriptionIfPresent.js.map +1 -1
- package/build/browser/v2.0/wireObjectTypeV2ToSdkObjectConstV2.js +13 -4
- package/build/browser/v2.0/wireObjectTypeV2ToSdkObjectConstV2.js.map +1 -1
- package/build/browser/validateWireOntologyAssumptions.js +1 -0
- package/build/browser/validateWireOntologyAssumptions.js.map +1 -1
- package/build/cjs/chunk-XOCES5YA.cjs +978 -0
- package/build/cjs/chunk-XOCES5YA.cjs.map +1 -0
- package/build/cjs/index.cjs +1392 -0
- package/build/cjs/index.cjs.map +1 -0
- package/build/cjs/index.d.cts +31 -0
- package/build/cjs/prompt-YMFYYBNJ.cjs +860 -0
- package/build/cjs/prompt-YMFYYBNJ.cjs.map +1 -0
- package/build/esm/GenerateContext/EnhanceCommon.js +0 -15
- package/build/esm/GenerateContext/EnhanceCommon.js.map +1 -1
- package/build/esm/GenerateContext/EnhancedAction.js +1 -1
- package/build/esm/GenerateContext/EnhancedAction.js.map +1 -1
- package/build/esm/GenerateContext/EnhancedBase.js +2 -7
- package/build/esm/GenerateContext/EnhancedBase.js.map +1 -1
- package/build/esm/GenerateContext/EnhancedInterfaceType.js +1 -1
- package/build/esm/GenerateContext/EnhancedInterfaceType.js.map +1 -1
- package/build/esm/GenerateContext/EnhancedObjectType.js +2 -2
- package/build/esm/GenerateContext/EnhancedObjectType.js.map +1 -1
- package/build/esm/GenerateContext/EnhancedOntologyDefinition.js +1 -8
- package/build/esm/GenerateContext/EnhancedOntologyDefinition.js.map +1 -1
- package/build/esm/GenerateContext/EnhancedQuery.js +2 -2
- package/build/esm/GenerateContext/EnhancedQuery.js.map +1 -1
- package/build/esm/GenerateContext/EnhancedSharedPropertyType.js +1 -1
- package/build/esm/GenerateContext/EnhancedSharedPropertyType.js.map +1 -1
- package/build/esm/GenerateContext/ForeignType.js +1 -1
- package/build/esm/GenerateContext/ForeignType.js.map +1 -1
- package/build/esm/GenerateContext/GenerateContext.js +0 -15
- package/build/esm/GenerateContext/GenerateContext.js.map +1 -1
- package/build/esm/GenerateContext/enhanceOntology.js +1 -0
- package/build/esm/GenerateContext/enhanceOntology.js.map +1 -1
- package/build/esm/MinimalFs.js +0 -15
- package/build/esm/MinimalFs.js.map +1 -1
- package/build/esm/WireOntologyDefinition.js +0 -15
- package/build/esm/WireOntologyDefinition.js.map +1 -1
- package/build/esm/generateClientSdkPackage.js +5 -3
- package/build/esm/generateClientSdkPackage.js.map +1 -1
- package/build/esm/generateClientSdkPackage.test.js +1 -0
- package/build/esm/generateClientSdkPackage.test.js.map +1 -1
- package/build/esm/index.js +1 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/shared/apiNamespaces/startsWithApiNamespace.js +1 -0
- package/build/esm/shared/apiNamespaces/startsWithApiNamespace.js.map +1 -1
- package/build/esm/shared/apiNamespaces/startsWithApiNamespace.test.js +1 -0
- package/build/esm/shared/apiNamespaces/startsWithApiNamespace.test.js.map +1 -1
- package/build/esm/shared/getObjectImports.js +1 -0
- package/build/esm/shared/getObjectImports.js.map +1 -1
- package/build/esm/shared/getObjectTypeApiNamesFromQuery.js +1 -0
- package/build/esm/shared/getObjectTypeApiNamesFromQuery.js.map +1 -1
- package/build/esm/shared/getObjectTypesFromQueryDataType.js +1 -0
- package/build/esm/shared/getObjectTypesFromQueryDataType.js.map +1 -1
- package/build/esm/shared/propertyJsdoc.js +1 -0
- package/build/esm/shared/propertyJsdoc.js.map +1 -1
- package/build/esm/shared/sanitizeMetadata.js +9 -0
- package/build/esm/shared/sanitizeMetadata.js.map +1 -1
- package/build/esm/shared/sanitizeMetadata.test.js +1 -0
- package/build/esm/shared/sanitizeMetadata.test.js.map +1 -1
- package/build/esm/util/InMemoryFs.js +1 -0
- package/build/esm/util/InMemoryFs.js.map +1 -1
- package/build/esm/util/commaSeparatedIdentifiers.js +1 -0
- package/build/esm/util/commaSeparatedIdentifiers.js.map +1 -1
- package/build/esm/util/commaSeparatedTypeIdentifiers.js +1 -0
- package/build/esm/util/commaSeparatedTypeIdentifiers.js.map +1 -1
- package/build/esm/util/deleteUndefineds.js +1 -0
- package/build/esm/util/deleteUndefineds.js.map +1 -1
- package/build/esm/util/reservedKeywords.js +1 -0
- package/build/esm/util/reservedKeywords.js.map +1 -1
- package/build/esm/util/stringUnionFrom.js +1 -0
- package/build/esm/util/stringUnionFrom.js.map +1 -1
- package/build/esm/util/stringify.js +16 -0
- package/build/esm/util/stringify.js.map +1 -1
- package/build/esm/util/test/TodoWireOntology.js +24 -5
- package/build/esm/util/test/TodoWireOntology.js.map +1 -1
- package/build/esm/util/test/compileThis.js +1 -0
- package/build/esm/util/test/compileThis.js.map +1 -1
- package/build/esm/util/test/createMockMinimalFiles.js +1 -0
- package/build/esm/util/test/createMockMinimalFiles.js.map +1 -1
- package/build/esm/util/test/formatTs.js +1 -0
- package/build/esm/util/test/formatTs.js.map +1 -1
- package/build/esm/util/verifyOutDir.js +1 -0
- package/build/esm/util/verifyOutDir.js.map +1 -1
- package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js +4 -1
- package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js.map +1 -1
- package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js +10 -1
- package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js.map +1 -1
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.js +4 -1
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.js.map +1 -1
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.js +672 -628
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.js.map +1 -1
- package/build/esm/v2.0/generateMetadata.js +4 -1
- package/build/esm/v2.0/generateMetadata.js.map +1 -1
- package/build/esm/v2.0/generatePerActionDataFiles.js +30 -8
- package/build/esm/v2.0/generatePerActionDataFiles.js.map +1 -1
- package/build/esm/v2.0/generatePerActionDataFiles.test.js +1 -0
- package/build/esm/v2.0/generatePerActionDataFiles.test.js.map +1 -1
- package/build/esm/v2.0/generatePerInterfaceDataFiles.js +2 -0
- package/build/esm/v2.0/generatePerInterfaceDataFiles.js.map +1 -1
- package/build/esm/v2.0/generatePerObjectDataFiles.js +1 -0
- package/build/esm/v2.0/generatePerObjectDataFiles.js.map +1 -1
- package/build/esm/v2.0/generatePerQueryDataFiles.js +10 -4
- package/build/esm/v2.0/generatePerQueryDataFiles.js.map +1 -1
- package/build/esm/v2.0/generatePerQueryDataFiles.test.js +2 -0
- package/build/esm/v2.0/generatePerQueryDataFiles.test.js.map +1 -1
- package/build/esm/v2.0/generateRootIndexTsFile.js +3 -1
- package/build/esm/v2.0/generateRootIndexTsFile.js.map +1 -1
- package/build/esm/v2.0/getDescriptionIfPresent.js +1 -0
- package/build/esm/v2.0/getDescriptionIfPresent.js.map +1 -1
- package/build/esm/v2.0/wireObjectTypeV2ToSdkObjectConstV2.js +13 -4
- package/build/esm/v2.0/wireObjectTypeV2ToSdkObjectConstV2.js.map +1 -1
- package/build/esm/validateWireOntologyAssumptions.js +1 -0
- package/build/esm/validateWireOntologyAssumptions.js.map +1 -1
- package/build/types/GenerateContext/EnhanceCommon.d.ts +6 -0
- package/build/types/GenerateContext/EnhanceCommon.d.ts.map +1 -0
- package/build/types/GenerateContext/EnhancedAction.d.ts +13 -0
- package/build/types/GenerateContext/EnhancedAction.d.ts.map +1 -0
- package/build/types/GenerateContext/EnhancedBase.d.ts +20 -0
- package/build/types/GenerateContext/EnhancedBase.d.ts.map +1 -0
- package/build/types/GenerateContext/EnhancedInterfaceType.d.ts +12 -0
- package/build/types/GenerateContext/EnhancedInterfaceType.d.ts.map +1 -0
- package/build/types/GenerateContext/EnhancedObjectType.d.ts +11 -0
- package/build/types/GenerateContext/EnhancedObjectType.d.ts.map +1 -0
- package/build/types/GenerateContext/EnhancedOntologyDefinition.d.ts +28 -0
- package/build/types/GenerateContext/EnhancedOntologyDefinition.d.ts.map +1 -0
- package/build/types/GenerateContext/EnhancedQuery.d.ts +13 -0
- package/build/types/GenerateContext/EnhancedQuery.d.ts.map +1 -0
- package/build/types/GenerateContext/EnhancedSharedPropertyType.d.ts +7 -0
- package/build/types/GenerateContext/EnhancedSharedPropertyType.d.ts.map +1 -0
- package/build/types/GenerateContext/ForeignType.d.ts +8 -0
- package/build/types/GenerateContext/ForeignType.d.ts.map +1 -0
- package/build/types/GenerateContext/GenerateContext.d.ts +13 -0
- package/build/types/GenerateContext/GenerateContext.d.ts.map +1 -0
- package/build/types/GenerateContext/enhanceOntology.d.ts +9 -0
- package/build/types/GenerateContext/enhanceOntology.d.ts.map +1 -0
- package/build/types/MinimalFs.d.ts +9 -0
- package/build/types/MinimalFs.d.ts.map +1 -0
- package/build/types/WireOntologyDefinition.d.ts +2 -0
- package/build/types/WireOntologyDefinition.d.ts.map +1 -0
- package/build/types/generateClientSdkPackage.d.ts +33 -0
- package/build/types/generateClientSdkPackage.d.ts.map +1 -0
- package/build/types/generateClientSdkPackage.test.d.ts +1 -0
- package/build/types/generateClientSdkPackage.test.d.ts.map +1 -0
- package/build/types/index.d.ts +4 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/{browser → types}/shared/apiNamespaces/startsWithApiNamespace.d.ts +0 -1
- package/build/types/shared/apiNamespaces/startsWithApiNamespace.d.ts.map +1 -0
- package/build/types/shared/apiNamespaces/startsWithApiNamespace.test.d.ts +1 -0
- package/build/types/shared/apiNamespaces/startsWithApiNamespace.test.d.ts.map +1 -0
- package/build/{browser → types}/shared/getObjectImports.d.ts +2 -2
- package/build/types/shared/getObjectImports.d.ts.map +1 -0
- package/build/{browser → types}/shared/getObjectTypeApiNamesFromQuery.d.ts +1 -2
- package/build/types/shared/getObjectTypeApiNamesFromQuery.d.ts.map +1 -0
- package/build/types/shared/getObjectTypesFromQueryDataType.d.ts +2 -0
- package/build/types/shared/getObjectTypesFromQueryDataType.d.ts.map +1 -0
- package/build/{browser → types}/shared/propertyJsdoc.d.ts +2 -3
- package/build/types/shared/propertyJsdoc.d.ts.map +1 -0
- package/build/types/shared/sanitizeMetadata.d.ts +1 -0
- package/build/types/shared/sanitizeMetadata.d.ts.map +1 -0
- package/build/types/shared/sanitizeMetadata.test.d.ts +1 -0
- package/build/types/shared/sanitizeMetadata.test.d.ts.map +1 -0
- package/build/{browser → types}/util/InMemoryFs.d.ts +2 -3
- package/build/types/util/InMemoryFs.d.ts.map +1 -0
- package/build/{browser → types}/util/commaSeparatedIdentifiers.d.ts +0 -1
- package/build/types/util/commaSeparatedIdentifiers.d.ts.map +1 -0
- package/build/{browser → types}/util/commaSeparatedTypeIdentifiers.d.ts +0 -1
- package/build/types/util/commaSeparatedTypeIdentifiers.d.ts.map +1 -0
- package/build/{browser → types}/util/deleteUndefineds.d.ts +0 -1
- package/build/types/util/deleteUndefineds.d.ts.map +1 -0
- package/build/{browser → types}/util/reservedKeywords.d.ts +0 -1
- package/build/types/util/reservedKeywords.d.ts.map +1 -0
- package/build/{browser → types}/util/stringUnionFrom.d.ts +0 -1
- package/build/types/util/stringUnionFrom.d.ts.map +1 -0
- package/build/types/util/stringify.d.ts +20 -0
- package/build/types/util/stringify.d.ts.map +1 -0
- package/build/types/util/test/TodoWireOntology.d.ts +2 -0
- package/build/types/util/test/TodoWireOntology.d.ts.map +1 -0
- package/build/{browser → types}/util/test/compileThis.d.ts +0 -1
- package/build/types/util/test/compileThis.d.ts.map +1 -0
- package/build/types/util/test/createMockMinimalFiles.d.ts +12 -0
- package/build/types/util/test/createMockMinimalFiles.d.ts.map +1 -0
- package/build/{browser → types}/util/test/formatTs.d.ts +0 -1
- package/build/types/util/test/formatTs.d.ts.map +1 -0
- package/build/types/util/verifyOutDir.d.ts +8 -0
- package/build/types/util/verifyOutDir.d.ts.map +1 -0
- package/build/types/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.d.ts +1 -0
- package/build/types/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.d.ts.map +1 -0
- package/build/types/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts +1 -0
- package/build/types/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts.map +1 -0
- package/build/{esm → types}/v2.0/generateClientSdkVersionTwoPointZero.d.ts +0 -1
- package/build/types/v2.0/generateClientSdkVersionTwoPointZero.d.ts.map +1 -0
- package/build/types/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts +1 -0
- package/build/types/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts.map +1 -0
- package/build/{browser → types}/v2.0/generateMetadata.d.ts +0 -1
- package/build/types/v2.0/generateMetadata.d.ts.map +1 -0
- package/build/types/v2.0/generatePerActionDataFiles.d.ts +2 -0
- package/build/types/v2.0/generatePerActionDataFiles.d.ts.map +1 -0
- package/build/types/v2.0/generatePerActionDataFiles.test.d.ts +1 -0
- package/build/types/v2.0/generatePerActionDataFiles.test.d.ts.map +1 -0
- package/build/types/v2.0/generatePerInterfaceDataFiles.d.ts +1 -0
- package/build/types/v2.0/generatePerInterfaceDataFiles.d.ts.map +1 -0
- package/build/{esm → types}/v2.0/generatePerObjectDataFiles.d.ts +0 -1
- package/build/types/v2.0/generatePerObjectDataFiles.d.ts.map +1 -0
- package/build/{browser → types}/v2.0/generatePerQueryDataFiles.d.ts +2 -3
- package/build/types/v2.0/generatePerQueryDataFiles.d.ts.map +1 -0
- package/build/types/v2.0/generatePerQueryDataFiles.test.d.ts +1 -0
- package/build/types/v2.0/generatePerQueryDataFiles.test.d.ts.map +1 -0
- package/build/{esm → types}/v2.0/generateRootIndexTsFile.d.ts +0 -1
- package/build/types/v2.0/generateRootIndexTsFile.d.ts.map +1 -0
- package/build/{browser → types}/v2.0/getDescriptionIfPresent.d.ts +0 -1
- package/build/types/v2.0/getDescriptionIfPresent.d.ts.map +1 -0
- package/build/{browser → types}/v2.0/wireObjectTypeV2ToSdkObjectConstV2.d.ts +4 -6
- package/build/types/v2.0/wireObjectTypeV2ToSdkObjectConstV2.d.ts.map +1 -0
- package/build/{browser → types}/validateWireOntologyAssumptions.d.ts +0 -1
- package/build/types/validateWireOntologyAssumptions.d.ts.map +1 -0
- package/package.json +27 -13
- package/build/browser/GenerateContext/EnhanceCommon.d.ts +0 -7
- package/build/browser/GenerateContext/EnhanceCommon.d.ts.map +0 -1
- package/build/browser/GenerateContext/EnhancedAction.d.ts +0 -14
- package/build/browser/GenerateContext/EnhancedAction.d.ts.map +0 -1
- package/build/browser/GenerateContext/EnhancedBase.d.ts +0 -21
- package/build/browser/GenerateContext/EnhancedBase.d.ts.map +0 -1
- package/build/browser/GenerateContext/EnhancedInterfaceType.d.ts +0 -13
- package/build/browser/GenerateContext/EnhancedInterfaceType.d.ts.map +0 -1
- package/build/browser/GenerateContext/EnhancedObjectType.d.ts +0 -12
- package/build/browser/GenerateContext/EnhancedObjectType.d.ts.map +0 -1
- package/build/browser/GenerateContext/EnhancedOntologyDefinition.d.ts +0 -27
- package/build/browser/GenerateContext/EnhancedOntologyDefinition.d.ts.map +0 -1
- package/build/browser/GenerateContext/EnhancedQuery.d.ts +0 -14
- package/build/browser/GenerateContext/EnhancedQuery.d.ts.map +0 -1
- package/build/browser/GenerateContext/EnhancedSharedPropertyType.d.ts +0 -8
- package/build/browser/GenerateContext/EnhancedSharedPropertyType.d.ts.map +0 -1
- package/build/browser/GenerateContext/ForeignType.d.ts +0 -9
- package/build/browser/GenerateContext/ForeignType.d.ts.map +0 -1
- package/build/browser/GenerateContext/GenerateContext.d.ts +0 -14
- package/build/browser/GenerateContext/GenerateContext.d.ts.map +0 -1
- package/build/browser/GenerateContext/enhanceOntology.d.ts +0 -10
- package/build/browser/GenerateContext/enhanceOntology.d.ts.map +0 -1
- package/build/browser/MinimalFs.d.ts +0 -10
- package/build/browser/MinimalFs.d.ts.map +0 -1
- package/build/browser/WireOntologyDefinition.d.ts +0 -4
- package/build/browser/WireOntologyDefinition.d.ts.map +0 -1
- package/build/browser/generateClientSdkPackage.d.ts +0 -47
- package/build/browser/generateClientSdkPackage.d.ts.map +0 -1
- package/build/browser/generateClientSdkPackage.test.d.ts +0 -2
- package/build/browser/generateClientSdkPackage.test.d.ts.map +0 -1
- package/build/browser/index.d.ts +0 -5
- package/build/browser/index.d.ts.map +0 -1
- package/build/browser/shared/apiNamespaces/startsWithApiNamespace.d.ts.map +0 -1
- package/build/browser/shared/apiNamespaces/startsWithApiNamespace.test.d.ts +0 -2
- package/build/browser/shared/apiNamespaces/startsWithApiNamespace.test.d.ts.map +0 -1
- package/build/browser/shared/getObjectImports.d.ts.map +0 -1
- package/build/browser/shared/getObjectTypeApiNamesFromQuery.d.ts.map +0 -1
- package/build/browser/shared/getObjectTypesFromQueryDataType.d.ts +0 -3
- package/build/browser/shared/getObjectTypesFromQueryDataType.d.ts.map +0 -1
- package/build/browser/shared/propertyJsdoc.d.ts.map +0 -1
- package/build/browser/shared/sanitizeMetadata.d.ts +0 -2
- package/build/browser/shared/sanitizeMetadata.d.ts.map +0 -1
- package/build/browser/shared/sanitizeMetadata.test.d.ts +0 -2
- package/build/browser/shared/sanitizeMetadata.test.d.ts.map +0 -1
- package/build/browser/util/InMemoryFs.d.ts.map +0 -1
- package/build/browser/util/commaSeparatedIdentifiers.d.ts.map +0 -1
- package/build/browser/util/commaSeparatedTypeIdentifiers.d.ts.map +0 -1
- package/build/browser/util/deleteUndefineds.d.ts.map +0 -1
- package/build/browser/util/reservedKeywords.d.ts.map +0 -1
- package/build/browser/util/stringUnionFrom.d.ts.map +0 -1
- package/build/browser/util/stringify.d.ts +0 -20
- package/build/browser/util/stringify.d.ts.map +0 -1
- package/build/browser/util/test/TodoWireOntology.d.ts +0 -217
- package/build/browser/util/test/TodoWireOntology.d.ts.map +0 -1
- package/build/browser/util/test/compileThis.d.ts.map +0 -1
- package/build/browser/util/test/createMockMinimalFiles.d.ts +0 -13
- package/build/browser/util/test/createMockMinimalFiles.d.ts.map +0 -1
- package/build/browser/util/test/formatTs.d.ts.map +0 -1
- package/build/browser/util/verifyOutDir.d.ts +0 -9
- package/build/browser/util/verifyOutDir.d.ts.map +0 -1
- package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.d.ts +0 -2
- package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.d.ts.map +0 -1
- package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts +0 -2
- package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts.map +0 -1
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.d.ts +0 -4
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.d.ts.map +0 -1
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts +0 -2
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts.map +0 -1
- package/build/browser/v2.0/generateMetadata.d.ts.map +0 -1
- package/build/browser/v2.0/generatePerActionDataFiles.d.ts +0 -3
- package/build/browser/v2.0/generatePerActionDataFiles.d.ts.map +0 -1
- package/build/browser/v2.0/generatePerActionDataFiles.test.d.ts +0 -2
- package/build/browser/v2.0/generatePerActionDataFiles.test.d.ts.map +0 -1
- package/build/browser/v2.0/generatePerInterfaceDataFiles.d.ts +0 -2
- package/build/browser/v2.0/generatePerInterfaceDataFiles.d.ts.map +0 -1
- package/build/browser/v2.0/generatePerObjectDataFiles.d.ts +0 -3
- package/build/browser/v2.0/generatePerObjectDataFiles.d.ts.map +0 -1
- package/build/browser/v2.0/generatePerQueryDataFiles.d.ts.map +0 -1
- package/build/browser/v2.0/generatePerQueryDataFiles.test.d.ts +0 -2
- package/build/browser/v2.0/generatePerQueryDataFiles.test.d.ts.map +0 -1
- package/build/browser/v2.0/generateRootIndexTsFile.d.ts +0 -3
- package/build/browser/v2.0/generateRootIndexTsFile.d.ts.map +0 -1
- package/build/browser/v2.0/getDescriptionIfPresent.d.ts.map +0 -1
- package/build/browser/v2.0/wireObjectTypeV2ToSdkObjectConstV2.d.ts.map +0 -1
- package/build/browser/validateWireOntologyAssumptions.d.ts.map +0 -1
- package/build/esm/GenerateContext/EnhanceCommon.d.ts +0 -7
- package/build/esm/GenerateContext/EnhanceCommon.d.ts.map +0 -1
- package/build/esm/GenerateContext/EnhancedAction.d.ts +0 -14
- package/build/esm/GenerateContext/EnhancedAction.d.ts.map +0 -1
- package/build/esm/GenerateContext/EnhancedBase.d.ts +0 -21
- package/build/esm/GenerateContext/EnhancedBase.d.ts.map +0 -1
- package/build/esm/GenerateContext/EnhancedInterfaceType.d.ts +0 -13
- package/build/esm/GenerateContext/EnhancedInterfaceType.d.ts.map +0 -1
- package/build/esm/GenerateContext/EnhancedObjectType.d.ts +0 -12
- package/build/esm/GenerateContext/EnhancedObjectType.d.ts.map +0 -1
- package/build/esm/GenerateContext/EnhancedOntologyDefinition.d.ts +0 -27
- package/build/esm/GenerateContext/EnhancedOntologyDefinition.d.ts.map +0 -1
- package/build/esm/GenerateContext/EnhancedQuery.d.ts +0 -14
- package/build/esm/GenerateContext/EnhancedQuery.d.ts.map +0 -1
- package/build/esm/GenerateContext/EnhancedSharedPropertyType.d.ts +0 -8
- package/build/esm/GenerateContext/EnhancedSharedPropertyType.d.ts.map +0 -1
- package/build/esm/GenerateContext/ForeignType.d.ts +0 -9
- package/build/esm/GenerateContext/ForeignType.d.ts.map +0 -1
- package/build/esm/GenerateContext/GenerateContext.d.ts +0 -14
- package/build/esm/GenerateContext/GenerateContext.d.ts.map +0 -1
- package/build/esm/GenerateContext/enhanceOntology.d.ts +0 -10
- package/build/esm/GenerateContext/enhanceOntology.d.ts.map +0 -1
- package/build/esm/MinimalFs.d.ts +0 -10
- package/build/esm/MinimalFs.d.ts.map +0 -1
- package/build/esm/WireOntologyDefinition.d.ts +0 -4
- package/build/esm/WireOntologyDefinition.d.ts.map +0 -1
- package/build/esm/generateClientSdkPackage.d.ts +0 -47
- package/build/esm/generateClientSdkPackage.d.ts.map +0 -1
- package/build/esm/generateClientSdkPackage.test.d.ts +0 -2
- package/build/esm/generateClientSdkPackage.test.d.ts.map +0 -1
- package/build/esm/index.d.ts +0 -5
- package/build/esm/index.d.ts.map +0 -1
- package/build/esm/shared/apiNamespaces/startsWithApiNamespace.d.ts +0 -2
- package/build/esm/shared/apiNamespaces/startsWithApiNamespace.d.ts.map +0 -1
- package/build/esm/shared/apiNamespaces/startsWithApiNamespace.test.d.ts +0 -2
- package/build/esm/shared/apiNamespaces/startsWithApiNamespace.test.d.ts.map +0 -1
- package/build/esm/shared/getObjectImports.d.ts +0 -4
- package/build/esm/shared/getObjectImports.d.ts.map +0 -1
- package/build/esm/shared/getObjectTypeApiNamesFromQuery.d.ts +0 -4
- package/build/esm/shared/getObjectTypeApiNamesFromQuery.d.ts.map +0 -1
- package/build/esm/shared/getObjectTypesFromQueryDataType.d.ts +0 -3
- package/build/esm/shared/getObjectTypesFromQueryDataType.d.ts.map +0 -1
- package/build/esm/shared/propertyJsdoc.d.ts +0 -6
- package/build/esm/shared/propertyJsdoc.d.ts.map +0 -1
- package/build/esm/shared/sanitizeMetadata.d.ts +0 -2
- package/build/esm/shared/sanitizeMetadata.d.ts.map +0 -1
- package/build/esm/shared/sanitizeMetadata.test.d.ts +0 -2
- package/build/esm/shared/sanitizeMetadata.test.d.ts.map +0 -1
- package/build/esm/util/InMemoryFs.d.ts +0 -7
- package/build/esm/util/InMemoryFs.d.ts.map +0 -1
- package/build/esm/util/commaSeparatedIdentifiers.d.ts +0 -2
- package/build/esm/util/commaSeparatedIdentifiers.d.ts.map +0 -1
- package/build/esm/util/commaSeparatedTypeIdentifiers.d.ts +0 -2
- package/build/esm/util/commaSeparatedTypeIdentifiers.d.ts.map +0 -1
- package/build/esm/util/deleteUndefineds.d.ts +0 -2
- package/build/esm/util/deleteUndefineds.d.ts.map +0 -1
- package/build/esm/util/reservedKeywords.d.ts +0 -2
- package/build/esm/util/reservedKeywords.d.ts.map +0 -1
- package/build/esm/util/stringUnionFrom.d.ts +0 -2
- package/build/esm/util/stringUnionFrom.d.ts.map +0 -1
- package/build/esm/util/stringify.d.ts +0 -20
- package/build/esm/util/stringify.d.ts.map +0 -1
- package/build/esm/util/test/TodoWireOntology.d.ts +0 -217
- package/build/esm/util/test/TodoWireOntology.d.ts.map +0 -1
- package/build/esm/util/test/compileThis.d.ts +0 -3
- package/build/esm/util/test/compileThis.d.ts.map +0 -1
- package/build/esm/util/test/createMockMinimalFiles.d.ts +0 -13
- package/build/esm/util/test/createMockMinimalFiles.d.ts.map +0 -1
- package/build/esm/util/test/formatTs.d.ts +0 -2
- package/build/esm/util/test/formatTs.d.ts.map +0 -1
- package/build/esm/util/verifyOutDir.d.ts +0 -9
- package/build/esm/util/verifyOutDir.d.ts.map +0 -1
- package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.d.ts +0 -2
- package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.d.ts.map +0 -1
- package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts +0 -2
- package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts.map +0 -1
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.d.ts.map +0 -1
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts +0 -2
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts.map +0 -1
- package/build/esm/v2.0/generateMetadata.d.ts +0 -3
- package/build/esm/v2.0/generateMetadata.d.ts.map +0 -1
- package/build/esm/v2.0/generatePerActionDataFiles.d.ts +0 -3
- package/build/esm/v2.0/generatePerActionDataFiles.d.ts.map +0 -1
- package/build/esm/v2.0/generatePerActionDataFiles.test.d.ts +0 -2
- package/build/esm/v2.0/generatePerActionDataFiles.test.d.ts.map +0 -1
- package/build/esm/v2.0/generatePerInterfaceDataFiles.d.ts +0 -2
- package/build/esm/v2.0/generatePerInterfaceDataFiles.d.ts.map +0 -1
- package/build/esm/v2.0/generatePerObjectDataFiles.d.ts.map +0 -1
- package/build/esm/v2.0/generatePerQueryDataFiles.d.ts +0 -9
- package/build/esm/v2.0/generatePerQueryDataFiles.d.ts.map +0 -1
- package/build/esm/v2.0/generatePerQueryDataFiles.test.d.ts +0 -2
- package/build/esm/v2.0/generatePerQueryDataFiles.test.d.ts.map +0 -1
- package/build/esm/v2.0/generateRootIndexTsFile.d.ts.map +0 -1
- package/build/esm/v2.0/getDescriptionIfPresent.d.ts +0 -2
- package/build/esm/v2.0/getDescriptionIfPresent.d.ts.map +0 -1
- package/build/esm/v2.0/wireObjectTypeV2ToSdkObjectConstV2.d.ts +0 -12
- package/build/esm/v2.0/wireObjectTypeV2ToSdkObjectConstV2.d.ts.map +0 -1
- package/build/esm/validateWireOntologyAssumptions.d.ts +0 -3
- package/build/esm/validateWireOntologyAssumptions.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stringUnionFrom.js","names":["stringUnionFrom","values","length","map","v","join"],"sources":["stringUnionFrom.
|
|
1
|
+
{"version":3,"file":"stringUnionFrom.js","names":["stringUnionFrom","values","length","map","v","join"],"sources":["stringUnionFrom.ts"],"sourcesContent":["/*\n * Copyright 2024 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 stringUnionFrom(values: ReadonlyArray<string>): string {\n if (values.length === 0) {\n return \"never\";\n } else {\n return values.map(v => `\"${v}\"`).join(\"|\");\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASA,eAAeA,CAACC,MAA6B,EAAU;EACrE,IAAIA,MAAM,CAACC,MAAM,KAAK,CAAC,EAAE;IACvB,OAAO,OAAO;EAChB,CAAC,MAAM;IACL,OAAOD,MAAM,CAACE,GAAG,CAACC,CAAC,IAAI,IAAIA,CAAC,GAAG,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;EAC5C;AACF","ignoreList":[]}
|
|
@@ -13,6 +13,22 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A function for changing the stringified key/value pairs of an object.
|
|
19
|
+
*
|
|
20
|
+
* @param value The value of the key/value pair.
|
|
21
|
+
* @param defaultValueFormatter The function that would be called if this customizer wasn't used
|
|
22
|
+
* @param key The key of the key/value pair.
|
|
23
|
+
* @param defaultKeyFormatter The function that would be called if this customizer wasn't used
|
|
24
|
+
*
|
|
25
|
+
* @returns A string, a tuple of strings, or undefined.
|
|
26
|
+
* If a string is returned, it will be used as the value of the key/value pair.
|
|
27
|
+
* If a tuple of strings is returned, the first string will be used as the key of the key/value pair
|
|
28
|
+
* and the second string will be used as the value of the key/value pair.
|
|
29
|
+
* If undefined is returned, the pair will be removed
|
|
30
|
+
*/
|
|
31
|
+
|
|
16
32
|
const defaultCustomizer = (value, defaultValueFormatter, key, defaultKeyFormatter) => {
|
|
17
33
|
return [defaultKeyFormatter(key), defaultValueFormatter(value)];
|
|
18
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stringify.js","names":["defaultCustomizer","value","defaultValueFormatter","key","defaultKeyFormatter","stringify","obj","customizer","separator","JSON","entries","sortedKeys","Object","keys","sort","a","b","localeCompare","res","push","join"],"sources":["stringify.
|
|
1
|
+
{"version":3,"file":"stringify.js","names":["defaultCustomizer","value","defaultValueFormatter","key","defaultKeyFormatter","stringify","obj","customizer","separator","JSON","entries","sortedKeys","Object","keys","sort","a","b","localeCompare","res","push","join"],"sources":["stringify.ts"],"sourcesContent":["/*\n * Copyright 2023 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 * A function for changing the stringified key/value pairs of an object.\n *\n * @param value The value of the key/value pair.\n * @param defaultValueFormatter The function that would be called if this customizer wasn't used\n * @param key The key of the key/value pair.\n * @param defaultKeyFormatter The function that would be called if this customizer wasn't used\n *\n * @returns A string, a tuple of strings, or undefined.\n * If a string is returned, it will be used as the value of the key/value pair.\n * If a tuple of strings is returned, the first string will be used as the key of the key/value pair\n * and the second string will be used as the value of the key/value pair.\n * If undefined is returned, the pair will be removed\n */\ntype Customizer<K extends string | symbol | number, V extends {}> = (\n value: V,\n defaultValueFormatter: (value: any) => string,\n key: K extends \"*\" ? string : K,\n defaultKeyFormatter: (key: string) => string,\n) => [string, string] | string | undefined;\nconst defaultCustomizer: Customizer<string, any> = (\n value,\n defaultValueFormatter,\n key,\n defaultKeyFormatter,\n) => {\n return [defaultKeyFormatter(key), defaultValueFormatter(value)];\n};\n\nexport function stringify<T extends Record<string, any>>(\n obj: T,\n customizer: {\n [K in keyof T | \"*\"]?: Customizer<K, T[K]>;\n } = {},\n separator = \",\\n\",\n): string {\n const defaultKeyFormatter = (key: string) => `${JSON.stringify(key)}`;\n const entries: Array<string> = [];\n\n const sortedKeys = Object.keys(obj).sort((a, b) => a.localeCompare(b));\n\n for (const key of sortedKeys) {\n const value = obj[key];\n const res =\n (customizer[key as keyof T] ?? customizer[\"*\"] ?? defaultCustomizer)(\n value,\n (value) => JSON.stringify(value, null, 2),\n key as any,\n defaultKeyFormatter,\n );\n\n if (res) {\n if (typeof res === \"string\") {\n entries.push(`${defaultKeyFormatter(key)}: ${res}`);\n } else {\n entries.push(`${res[0]}: ${res[1]}`);\n }\n }\n }\n return entries.join(separator);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA,MAAMA,iBAA0C,GAAGA,CACjDC,KAAK,EACLC,qBAAqB,EACrBC,GAAG,EACHC,mBAAmB,KAChB;EACH,OAAO,CAACA,mBAAmB,CAACD,GAAG,CAAC,EAAED,qBAAqB,CAACD,KAAK,CAAC,CAAC;AACjE,CAAC;AAED,OAAO,SAASI,SAASA,CACvBC,GAAM,EACNC,UAEC,GAAG,CAAC,CAAC,EACNC,SAAS,GAAG,KAAK,EACT;EACR,MAAMJ,mBAAmB,GAAID,GAAW,IAAK,GAAGM,IAAI,CAACJ,SAAS,CAACF,GAAG,CAAC,EAAE;EACrE,MAAMO,OAAsB,GAAG,EAAE;EAEjC,MAAMC,UAAU,GAAGC,MAAM,CAACC,IAAI,CAACP,GAAG,CAAC,CAACQ,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,CAACE,aAAa,CAACD,CAAC,CAAC,CAAC;EAEtE,KAAK,MAAMb,GAAG,IAAIQ,UAAU,EAAE;IAC5B,MAAMV,KAAK,GAAGK,GAAG,CAACH,GAAG,CAAC;IACtB,MAAMe,GAAG,GACP,CAACX,UAAU,CAACJ,GAAG,CAAY,IAAII,UAAU,CAAC,GAAG,CAAC,IAAIP,iBAAiB,EACjEC,KAAK,EACJA,KAAK,IAAKQ,IAAI,CAACJ,SAAS,CAACJ,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,EACzCE,GAAG,EACHC,mBACF,CAAC;IAEH,IAAIc,GAAG,EAAE;MACP,IAAI,OAAOA,GAAG,KAAK,QAAQ,EAAE;QAC3BR,OAAO,CAACS,IAAI,CAAC,GAAGf,mBAAmB,CAACD,GAAG,CAAC,KAAKe,GAAG,EAAE,CAAC;MACrD,CAAC,MAAM;QACLR,OAAO,CAACS,IAAI,CAAC,GAAGD,GAAG,CAAC,CAAC,CAAC,KAAKA,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;MACtC;IACF;EACF;EACA,OAAOR,OAAO,CAACU,IAAI,CAACZ,SAAS,CAAC;AAChC","ignoreList":[]}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
|
|
16
17
|
export const TodoWireOntology = {
|
|
17
18
|
ontology: {
|
|
18
19
|
rid: "ridHere",
|
|
@@ -85,19 +86,22 @@ export const TodoWireOntology = {
|
|
|
85
86
|
id: {
|
|
86
87
|
dataType: {
|
|
87
88
|
type: "integer"
|
|
88
|
-
}
|
|
89
|
+
},
|
|
90
|
+
rid: "rid"
|
|
89
91
|
},
|
|
90
92
|
body: {
|
|
91
93
|
dataType: {
|
|
92
94
|
type: "string"
|
|
93
95
|
},
|
|
94
96
|
description: "The text of the todo",
|
|
95
|
-
displayName: "Body"
|
|
97
|
+
displayName: "Body",
|
|
98
|
+
rid: "rid"
|
|
96
99
|
},
|
|
97
100
|
complete: {
|
|
98
101
|
dataType: {
|
|
99
102
|
type: "boolean"
|
|
100
|
-
}
|
|
103
|
+
},
|
|
104
|
+
rid: "rid"
|
|
101
105
|
}
|
|
102
106
|
},
|
|
103
107
|
status: "ACTIVE",
|
|
@@ -139,7 +143,8 @@ export const TodoWireOntology = {
|
|
|
139
143
|
email: {
|
|
140
144
|
dataType: {
|
|
141
145
|
type: "string"
|
|
142
|
-
}
|
|
146
|
+
},
|
|
147
|
+
rid: "rid"
|
|
143
148
|
}
|
|
144
149
|
},
|
|
145
150
|
rid: "ridForPerson",
|
|
@@ -214,7 +219,21 @@ export const TodoWireOntology = {
|
|
|
214
219
|
rid: "idk",
|
|
215
220
|
displayName: "Sum Interface",
|
|
216
221
|
extendsInterfaces: [],
|
|
217
|
-
links: {}
|
|
222
|
+
links: {},
|
|
223
|
+
implementedByObjectTypes: [],
|
|
224
|
+
allProperties: {
|
|
225
|
+
"SomeProperty": {
|
|
226
|
+
apiName: "SomeProperty",
|
|
227
|
+
description: "Some property",
|
|
228
|
+
displayName: "Sum Property",
|
|
229
|
+
dataType: {
|
|
230
|
+
type: "string"
|
|
231
|
+
},
|
|
232
|
+
rid: "idk2"
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
allExtendsInterfaces: [],
|
|
236
|
+
allLinks: {}
|
|
218
237
|
}
|
|
219
238
|
},
|
|
220
239
|
sharedPropertyTypes: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TodoWireOntology.js","names":["TodoWireOntology","ontology","rid","apiName","displayName","description","actionTypes","parameters","object","dataType","type","objectApiName","objectTypeApiName","required","operations","status","objectTypes","Todo","objectType","primaryKey","pluralDisplayName","icon","name","color","titleProperty","properties","id","body","complete","linkTypes","cardinality","foreignKeyPropertyApiName","linkTypeRid","implementsInterfaces","implementsInterfaces2","sharedPropertyTypeMapping","Person","email","queryTypes","output","completed","version","someTodo","interfaceTypes","SomeInterface","extendsInterfaces","links","sharedPropertyTypes","SomeProperty"],"sources":["TodoWireOntology.js"],"sourcesContent":["/*\n * Copyright 2023 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 */\nexport const TodoWireOntology = {\n ontology: {\n rid: \"ridHere\",\n apiName: \"OntologyApiName\",\n displayName: \"\",\n description: \"\",\n },\n actionTypes: {\n \"markTodoCompleted\": {\n apiName: \"markTodoCompleted\",\n description: \"An action which takes different types of parameters\",\n parameters: {\n object: {\n description: \"A Todo to mark completed\",\n dataType: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n required: false,\n },\n },\n rid: \"ri.ontology.main.action-type.9f84017d-cf17-4fa8-84c3-8e01e5d594f2\",\n operations: [{\n type: \"modifyObject\",\n objectTypeApiName: \"Todo\",\n }],\n status: \"ACTIVE\",\n },\n \"deleteTodos\": {\n apiName: \"deleteTodos\",\n description: \"An action which takes in an array of objects\",\n parameters: {\n object: {\n description: \"Todo(s) to be deleted\",\n \"dataType\": {\n \"type\": \"array\",\n \"subType\": {\n \"type\": \"object\",\n \"objectApiName\": \"Todo\",\n \"objectTypeApiName\": \"Todo\",\n },\n },\n required: false,\n },\n },\n rid: \"ri.ontology.main.action-type.8f94017d-cf17-4fa8-84c3-8e01e5d594f2\",\n operations: [{\n type: \"deleteObject\",\n objectTypeApiName: \"Todo\",\n }],\n status: \"ACTIVE\",\n },\n },\n objectTypes: {\n Todo: {\n objectType: {\n apiName: \"Todo\",\n primaryKey: \"id\",\n displayName: \"AwesomeTodoDisplayname\",\n pluralDisplayName: \"AwesomeTodoDisplayNames\",\n icon: { type: \"blueprint\", name: \"document\", color: \"blue\" },\n description: \"Its a todo item.\",\n titleProperty: \"body\",\n properties: {\n id: {\n dataType: {\n type: \"integer\",\n },\n },\n body: {\n dataType: {\n type: \"string\",\n },\n description: \"The text of the todo\",\n displayName: \"Body\",\n },\n complete: {\n dataType: {\n type: \"boolean\",\n },\n },\n },\n status: \"ACTIVE\",\n rid: \"ridForTodo\",\n },\n linkTypes: [{\n apiName: \"Assignee\",\n cardinality: \"ONE\",\n displayName: \"Assignee\",\n objectTypeApiName: \"Person\",\n status: \"ACTIVE\",\n foreignKeyPropertyApiName: \"email\",\n linkTypeRid: \"\",\n }],\n implementsInterfaces: [\"SomeInterface\"],\n implementsInterfaces2: {\n \"SomeInterface\": {\n properties: {\n \"SomeProperty\": \"body\",\n },\n },\n },\n sharedPropertyTypeMapping: {},\n },\n Person: {\n objectType: {\n apiName: \"Person\",\n primaryKey: \"email\",\n displayName: \"Person\",\n pluralDisplayName: \"Persons\",\n icon: { type: \"blueprint\", name: \"document\", color: \"blue\" },\n description: \"A person\",\n titleProperty: \"email\",\n properties: {\n email: {\n dataType: {\n type: \"string\",\n },\n },\n },\n rid: \"ridForPerson\",\n status: \"ACTIVE\",\n },\n linkTypes: [{\n apiName: \"Todos\",\n cardinality: \"MANY\",\n displayName: \"Todos\",\n objectTypeApiName: \"Todo\",\n status: \"ACTIVE\",\n foreignKeyPropertyApiName: \"id\",\n linkTypeRid: \"\",\n }],\n implementsInterfaces: [],\n implementsInterfaces2: {},\n sharedPropertyTypeMapping: {},\n },\n },\n queryTypes: {\n \"getCount\": {\n apiName: \"getCount\",\n output: {\n type: \"integer\",\n },\n parameters: {\n completed: { dataType: { type: \"boolean\" } },\n },\n rid: \"rid.query.1\",\n version: \"0\",\n },\n \"returnsTodo\": {\n apiName: \"returnsTodo\",\n output: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n parameters: {\n someTodo: {\n description: \"Random desc so we test jsdoc\",\n dataType: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n },\n },\n rid: \"rid.query.2\",\n version: \"0\",\n },\n },\n interfaceTypes: {\n SomeInterface: {\n apiName: \"SomeInterface\",\n description: \"Some interface\",\n properties: {\n \"SomeProperty\": {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n },\n },\n rid: \"idk\",\n displayName: \"Sum Interface\",\n extendsInterfaces: [],\n links: {},\n },\n },\n sharedPropertyTypes: {\n SomeProperty: {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n },\n },\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,gBAAgB,GAAG;EAC5BC,QAAQ,EAAE;IACNC,GAAG,EAAE,SAAS;IACdC,OAAO,EAAE,iBAAiB;IAC1BC,WAAW,EAAE,EAAE;IACfC,WAAW,EAAE;EACjB,CAAC;EACDC,WAAW,EAAE;IACT,mBAAmB,EAAE;MACjBH,OAAO,EAAE,mBAAmB;MAC5BE,WAAW,EAAE,qDAAqD;MAClEE,UAAU,EAAE;QACRC,MAAM,EAAE;UACJH,WAAW,EAAE,0BAA0B;UACvCI,QAAQ,EAAE;YACNC,IAAI,EAAE,QAAQ;YACdC,aAAa,EAAE,MAAM;YACrBC,iBAAiB,EAAE;UACvB,CAAC;UACDC,QAAQ,EAAE;QACd;MACJ,CAAC;MACDX,GAAG,EAAE,mEAAmE;MACxEY,UAAU,EAAE,CAAC;QACLJ,IAAI,EAAE,cAAc;QACpBE,iBAAiB,EAAE;MACvB,CAAC,CAAC;MACNG,MAAM,EAAE;IACZ,CAAC;IACD,aAAa,EAAE;MACXZ,OAAO,EAAE,aAAa;MACtBE,WAAW,EAAE,8CAA8C;MAC3DE,UAAU,EAAE;QACRC,MAAM,EAAE;UACJH,WAAW,EAAE,uBAAuB;UACpC,UAAU,EAAE;YACR,MAAM,EAAE,OAAO;YACf,SAAS,EAAE;cACP,MAAM,EAAE,QAAQ;cAChB,eAAe,EAAE,MAAM;cACvB,mBAAmB,EAAE;YACzB;UACJ,CAAC;UACDQ,QAAQ,EAAE;QACd;MACJ,C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QACRmC,QAAQ,EAAE;UACNrC,WAAW,EAAE,8BAA8B;UAC3CI,QAAQ,EAAE;YACNC,IAAI,EAAE,QAAQ;YACdC,aAAa,EAAE,MAAM;YACrBC,iBAAiB,EAAE;UACvB;QACJ;MACJ,CAAC;MACDV,GAAG,EAAE,aAAa;MAClBuC,OAAO,EAAE;IACb;EACJ,CAAC;EACDE,cAAc,EAAE;IACZC,aAAa,EAAE;MACXzC,OAAO,EAAE,eAAe;MACxBE,WAAW,EAAE,gBAAgB;MAC7BoB,UAAU,EAAE;QACR,cAAc,EAAE;UACZtB,OAAO,EAAE,cAAc;UACvBE,WAAW,EAAE,eAAe;UAC5BD,WAAW,EAAE,cAAc;UAC3BK,QAAQ,EAAE;YACNC,IAAI,EAAE;UACV,CAAC;UACDR,GAAG,EAAE;QACT;MACJ,CAAC;MACDA,GAAG,EAAE,KAAK;MACVE,WAAW,EAAE,eAAe;MAC5ByC,iBAAiB,EAAE,EAAE;MACrBC,KAAK,EAAE,CAAC;IACZ;EACJ,CAAC;EACDC,mBAAmB,EAAE;IACjBC,YAAY,EAAE;MACV7C,OAAO,EAAE,cAAc;MACvBE,WAAW,EAAE,eAAe;MAC5BD,WAAW,EAAE,cAAc;MAC3BK,QAAQ,EAAE;QACNC,IAAI,EAAE;MACV,CAAC;MACDR,GAAG,EAAE;IACT;EACJ;AACJ,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"TodoWireOntology.js","names":["TodoWireOntology","ontology","rid","apiName","displayName","description","actionTypes","parameters","object","dataType","type","objectApiName","objectTypeApiName","required","operations","status","objectTypes","Todo","objectType","primaryKey","pluralDisplayName","icon","name","color","titleProperty","properties","id","body","complete","linkTypes","cardinality","foreignKeyPropertyApiName","linkTypeRid","implementsInterfaces","implementsInterfaces2","sharedPropertyTypeMapping","Person","email","queryTypes","output","completed","version","someTodo","interfaceTypes","SomeInterface","extendsInterfaces","links","implementedByObjectTypes","allProperties","allExtendsInterfaces","allLinks","sharedPropertyTypes","SomeProperty"],"sources":["TodoWireOntology.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { WireOntologyDefinition } from \"../../WireOntologyDefinition.js\";\n\nexport const TodoWireOntology: WireOntologyDefinition = {\n ontology: {\n rid: \"ridHere\",\n apiName: \"OntologyApiName\",\n displayName: \"\",\n description: \"\",\n },\n actionTypes: {\n \"markTodoCompleted\": {\n apiName: \"markTodoCompleted\",\n description: \"An action which takes different types of parameters\",\n parameters: {\n object: {\n description: \"A Todo to mark completed\",\n dataType: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n required: false,\n },\n },\n rid: \"ri.ontology.main.action-type.9f84017d-cf17-4fa8-84c3-8e01e5d594f2\",\n operations: [{\n type: \"modifyObject\",\n objectTypeApiName: \"Todo\",\n }],\n status: \"ACTIVE\",\n },\n \"deleteTodos\": {\n apiName: \"deleteTodos\",\n description: \"An action which takes in an array of objects\",\n parameters: {\n object: {\n description: \"Todo(s) to be deleted\",\n \"dataType\": {\n \"type\": \"array\",\n\n \"subType\": {\n \"type\": \"object\",\n \"objectApiName\": \"Todo\",\n \"objectTypeApiName\": \"Todo\",\n },\n },\n required: false,\n },\n },\n rid: \"ri.ontology.main.action-type.8f94017d-cf17-4fa8-84c3-8e01e5d594f2\",\n operations: [{\n type: \"deleteObject\",\n objectTypeApiName: \"Todo\",\n }],\n status: \"ACTIVE\",\n },\n },\n objectTypes: {\n Todo: {\n objectType: {\n apiName: \"Todo\",\n primaryKey: \"id\",\n displayName: \"AwesomeTodoDisplayname\",\n pluralDisplayName: \"AwesomeTodoDisplayNames\",\n icon: { type: \"blueprint\", name: \"document\", color: \"blue\" },\n description: \"Its a todo item.\",\n titleProperty: \"body\",\n properties: {\n id: {\n dataType: {\n type: \"integer\",\n },\n rid: \"rid\",\n },\n body: {\n dataType: {\n type: \"string\",\n },\n description: \"The text of the todo\",\n displayName: \"Body\",\n rid: \"rid\",\n },\n complete: {\n dataType: {\n type: \"boolean\",\n },\n rid: \"rid\",\n },\n },\n status: \"ACTIVE\",\n rid: \"ridForTodo\",\n },\n linkTypes: [{\n apiName: \"Assignee\",\n cardinality: \"ONE\",\n displayName: \"Assignee\",\n objectTypeApiName: \"Person\",\n status: \"ACTIVE\",\n foreignKeyPropertyApiName: \"email\",\n linkTypeRid: \"\",\n }],\n implementsInterfaces: [\"SomeInterface\"],\n implementsInterfaces2: {\n \"SomeInterface\": {\n properties: {\n \"SomeProperty\": \"body\",\n },\n },\n },\n sharedPropertyTypeMapping: {},\n },\n Person: {\n objectType: {\n apiName: \"Person\",\n primaryKey: \"email\",\n displayName: \"Person\",\n pluralDisplayName: \"Persons\",\n icon: { type: \"blueprint\", name: \"document\", color: \"blue\" },\n description: \"A person\",\n titleProperty: \"email\",\n properties: {\n email: {\n dataType: {\n type: \"string\",\n },\n rid: \"rid\",\n },\n },\n\n rid: \"ridForPerson\",\n status: \"ACTIVE\",\n },\n linkTypes: [{\n apiName: \"Todos\",\n cardinality: \"MANY\",\n displayName: \"Todos\",\n objectTypeApiName: \"Todo\",\n status: \"ACTIVE\",\n foreignKeyPropertyApiName: \"id\",\n linkTypeRid: \"\",\n }],\n implementsInterfaces: [],\n implementsInterfaces2: {},\n sharedPropertyTypeMapping: {},\n },\n },\n queryTypes: {\n \"getCount\": {\n apiName: \"getCount\",\n output: {\n type: \"integer\",\n },\n parameters: {\n completed: { dataType: { type: \"boolean\" } },\n },\n rid: \"rid.query.1\",\n version: \"0\",\n },\n \"returnsTodo\": {\n apiName: \"returnsTodo\",\n output: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n parameters: {\n someTodo: {\n description: \"Random desc so we test jsdoc\",\n dataType: {\n type: \"object\",\n objectApiName: \"Todo\",\n objectTypeApiName: \"Todo\",\n },\n },\n },\n rid: \"rid.query.2\",\n version: \"0\",\n },\n },\n interfaceTypes: {\n SomeInterface: {\n apiName: \"SomeInterface\",\n description: \"Some interface\",\n properties: {\n \"SomeProperty\": {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n },\n },\n rid: \"idk\",\n displayName: \"Sum Interface\",\n extendsInterfaces: [],\n links: {},\n implementedByObjectTypes: [],\n allProperties: {\n \"SomeProperty\": {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n },\n },\n allExtendsInterfaces: [],\n allLinks: {},\n },\n },\n sharedPropertyTypes: {\n SomeProperty: {\n apiName: \"SomeProperty\",\n description: \"Some property\",\n displayName: \"Sum Property\",\n dataType: {\n type: \"string\",\n },\n rid: \"idk2\",\n },\n },\n} as const satisfies WireOntologyDefinition;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,OAAO,MAAMA,gBAAwC,GAAG;EACtDC,QAAQ,EAAE;IACRC,GAAG,EAAE,SAAS;IACdC,OAAO,EAAE,iBAAiB;IAC1BC,WAAW,EAAE,EAAE;IACfC,WAAW,EAAE;EACf,CAAC;EACDC,WAAW,EAAE;IACX,mBAAmB,EAAE;MACnBH,OAAO,EAAE,mBAAmB;MAC5BE,WAAW,EAAE,qDAAqD;MAClEE,UAAU,EAAE;QACVC,MAAM,EAAE;UACNH,WAAW,EAAE,0BAA0B;UACvCI,QAAQ,EAAE;YACRC,IAAI,EAAE,QAAQ;YACdC,aAAa,EAAE,MAA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C,wBAAwB,EAAE,EAAE;MAC5BC,aAAa,EAAE;QACb,cAAc,EAAE;UACd7C,OAAO,EAAE,cAAc;UACvBE,WAAW,EAAE,eAAe;UAC5BD,WAAW,EAAE,cAAc;UAC3BK,QAAQ,EAAE;YACRC,IAAI,EAAE;UACR,CAAC;UACDR,GAAG,EAAE;QACP;MACF,CAAC;MACD+C,oBAAoB,EAAE,EAAE;MACxBC,QAAQ,EAAE,CAAC;IACb;EACF,CAAC;EACDC,mBAAmB,EAAE;IACnBC,YAAY,EAAE;MACZjD,OAAO,EAAE,cAAc;MACvBE,WAAW,EAAE,eAAe;MAC5BD,WAAW,EAAE,cAAc;MAC3BK,QAAQ,EAAE;QACRC,IAAI,EAAE;MACR,CAAC;MACDR,GAAG,EAAE;IACP;EACF;AACF,CAA2C","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compileThis.js","names":["ts","compileThis","files","basePath","compilerOptions","noEmit","target","ScriptTarget","ES2020","host","createCompilerHost","originalReadFile","readFile","filename","startsWith","writeFile","Error","program","createProgram","options","rootNames","getPreEmitDiagnostics"],"sources":["compileThis.
|
|
1
|
+
{"version":3,"file":"compileThis.js","names":["ts","compileThis","files","basePath","compilerOptions","noEmit","target","ScriptTarget","ES2020","host","createCompilerHost","originalReadFile","readFile","filename","startsWith","writeFile","Error","program","createProgram","options","rootNames","getPreEmitDiagnostics"],"sources":["compileThis.ts"],"sourcesContent":["/*\n * Copyright 2023 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 * as ts from \"typescript\";\n\nexport function compileThis(\n files: Record<string, string>,\n basePath: string,\n): readonly ts.Diagnostic[] {\n const compilerOptions: ts.CompilerOptions = {\n noEmit: true,\n target: ts.ScriptTarget.ES2020,\n };\n\n const host = ts.createCompilerHost(compilerOptions);\n const originalReadFile = host.readFile;\n host.readFile = (filename) => {\n if (filename.startsWith(basePath)) {\n return files[filename];\n } else {\n return originalReadFile(filename);\n }\n };\n host.writeFile = () => {\n throw new Error(\"File writes not allowed\");\n };\n\n const program = ts.createProgram({\n options: compilerOptions,\n host,\n rootNames: [\"/foo/index.ts\"],\n });\n\n return ts.getPreEmitDiagnostics(program);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,EAAE,MAAM,YAAY;AAEhC,OAAO,SAASC,WAAWA,CACzBC,KAA6B,EAC7BC,QAAgB,EACU;EAC1B,MAAMC,eAAmC,GAAG;IAC1CC,MAAM,EAAE,IAAI;IACZC,MAAM,EAAEN,EAAE,CAACO,YAAY,CAACC;EAC1B,CAAC;EAED,MAAMC,IAAI,GAAGT,EAAE,CAACU,kBAAkB,CAACN,eAAe,CAAC;EACnD,MAAMO,gBAAgB,GAAGF,IAAI,CAACG,QAAQ;EACtCH,IAAI,CAACG,QAAQ,GAAIC,QAAQ,IAAK;IAC5B,IAAIA,QAAQ,CAACC,UAAU,CAACX,QAAQ,CAAC,EAAE;MACjC,OAAOD,KAAK,CAACW,QAAQ,CAAC;IACxB,CAAC,MAAM;MACL,OAAOF,gBAAgB,CAACE,QAAQ,CAAC;IACnC;EACF,CAAC;EACDJ,IAAI,CAACM,SAAS,GAAG,MAAM;IACrB,MAAM,IAAIC,KAAK,CAAC,yBAAyB,CAAC;EAC5C,CAAC;EAED,MAAMC,OAAO,GAAGjB,EAAE,CAACkB,aAAa,CAAC;IAC/BC,OAAO,EAAEf,eAAe;IACxBK,IAAI;IACJW,SAAS,EAAE,CAAC,eAAe;EAC7B,CAAC,CAAC;EAEF,OAAOpB,EAAE,CAACqB,qBAAqB,CAACJ,OAAO,CAAC;AAC1C","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMockMinimalFiles.js","names":["vi","createMockMinimalFiles","writeFile","fn","Promise","resolve","getFiles","Object","fromEntries","mock","calls","readdir","minimalFiles","mkdir","dumpFilesToConsole","path","contents","entries","console","group","log","groupEnd"],"sources":["createMockMinimalFiles.
|
|
1
|
+
{"version":3,"file":"createMockMinimalFiles.js","names":["vi","createMockMinimalFiles","writeFile","fn","Promise","resolve","getFiles","Object","fromEntries","mock","calls","readdir","minimalFiles","mkdir","dumpFilesToConsole","path","contents","entries","console","group","log","groupEnd"],"sources":["createMockMinimalFiles.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { vi } from \"vitest\";\nimport type { ReaddirFn, WriteFileFn } from \"../../MinimalFs.js\";\n\nexport function createMockMinimalFiles(): {\n minimalFiles: {\n writeFile: WriteFileFn;\n mkdir: () => Promise<void>;\n readdir: ReaddirFn;\n };\n getFiles: () => {\n [k: string]: string;\n };\n dumpFilesToConsole: () => void;\n} {\n const writeFile = vi.fn<WriteFileFn>(\n () => Promise.resolve(),\n );\n const getFiles = () => Object.fromEntries(writeFile.mock.calls);\n\n const readdir = vi.fn<ReaddirFn>(\n () => Promise.resolve([]),\n );\n\n return {\n minimalFiles: {\n writeFile: writeFile as WriteFileFn,\n mkdir: () => Promise.resolve(),\n readdir: readdir as ReaddirFn,\n },\n getFiles,\n dumpFilesToConsole: () => {\n for (const [path, contents] of Object.entries(getFiles())) {\n console.group(path);\n console.log(contents);\n console.groupEnd();\n }\n },\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,EAAE,QAAQ,QAAQ;AAG3B,OAAO,SAASC,sBAAsBA,CAAA,EAUpC;EACA,MAAMC,SAAS,GAAGF,EAAE,CAACG,EAAE,CACrB,MAAMC,OAAO,CAACC,OAAO,CAAC,CACxB,CAAC;EACD,MAAMC,QAAQ,GAAGA,CAAA,KAAMC,MAAM,CAACC,WAAW,CAACN,SAAS,CAACO,IAAI,CAACC,KAAK,CAAC;EAE/D,MAAMC,OAAO,GAAGX,EAAE,CAACG,EAAE,CACnB,MAAMC,OAAO,CAACC,OAAO,CAAC,EAAE,CAC1B,CAAC;EAED,OAAO;IACLO,YAAY,EAAE;MACZV,SAAS,EAAEA,SAAwB;MACnCW,KAAK,EAAEA,CAAA,KAAMT,OAAO,CAACC,OAAO,CAAC,CAAC;MAC9BM,OAAO,EAAEA;IACX,CAAC;IACDL,QAAQ;IACRQ,kBAAkB,EAAEA,CAAA,KAAM;MACxB,KAAK,MAAM,CAACC,IAAI,EAAEC,QAAQ,CAAC,IAAIT,MAAM,CAACU,OAAO,CAACX,QAAQ,CAAC,CAAC,CAAC,EAAE;QACzDY,OAAO,CAACC,KAAK,CAACJ,IAAI,CAAC;QACnBG,OAAO,CAACE,GAAG,CAACJ,QAAQ,CAAC;QACrBE,OAAO,CAACG,QAAQ,CAAC,CAAC;MACpB;IACF;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatTs.js","names":["format","formatTs","contents","parser","singleQuote","trailingComma","tabWidth","printWidth","e","console","error","log"],"sources":["formatTs.
|
|
1
|
+
{"version":3,"file":"formatTs.js","names":["format","formatTs","contents","parser","singleQuote","trailingComma","tabWidth","printWidth","e","console","error","log"],"sources":["formatTs.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { format } from \"prettier\";\n\nexport function formatTs(contents: string): string | Promise<string> {\n try {\n return format(contents, {\n parser: \"typescript\",\n singleQuote: true,\n trailingComma: \"all\",\n tabWidth: 2,\n printWidth: 120,\n });\n } catch (e) {\n console.error(\"Failed to format file\", e);\n console.log(contents);\n return contents;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,UAAU;AAEjC,OAAO,SAASC,QAAQA,CAACC,QAAgB,EAA4B;EACnE,IAAI;IACF,OAAOF,MAAM,CAACE,QAAQ,EAAE;MACtBC,MAAM,EAAE,YAAY;MACpBC,WAAW,EAAE,IAAI;MACjBC,aAAa,EAAE,KAAK;MACpBC,QAAQ,EAAE,CAAC;MACXC,UAAU,EAAE;IACd,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOC,CAAC,EAAE;IACVC,OAAO,CAACC,KAAK,CAAC,uBAAuB,EAAEF,CAAC,CAAC;IACzCC,OAAO,CAACE,GAAG,CAACT,QAAQ,CAAC;IACrB,OAAOA,QAAQ;EACjB;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verifyOutDir.js","names":["verifyOutDir","outDir","fs","contents","readdir","length","Error","e","code"],"sources":["verifyOutDir.
|
|
1
|
+
{"version":3,"file":"verifyOutDir.js","names":["verifyOutDir","outDir","fs","contents","readdir","length","Error","e","code"],"sources":["verifyOutDir.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { MinimalFs } from \"../MinimalFs.js\";\n\n/**\n * Verify that the target outDir does not yet exist OR is empty.\n *\n * Re-generating an ontology on top of itself is not supported and may leave old\n * files around or refuse to update files with new contents in some cases.\n */\nexport async function verifyOutDir(\n outDir: string,\n fs: MinimalFs,\n): Promise<void> {\n // if outDir exists and is not empty, we cannot proceed with the generation\n try {\n const contents = await fs.readdir(outDir);\n if (contents.length !== 0) {\n throw new Error(\n `outDir ${outDir} is not empty, please delete its contents and try again`,\n );\n }\n } catch (e) {\n if ((e as { code: string }).code === \"ENOENT\") {\n // acceptable, we'll create the directory ourselves\n } else {\n throw e;\n }\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeA,YAAYA,CAChCC,MAAc,EACdC,EAAa,EACE;EACf;EACA,IAAI;IACF,MAAMC,QAAQ,GAAG,MAAMD,EAAE,CAACE,OAAO,CAACH,MAAM,CAAC;IACzC,IAAIE,QAAQ,CAACE,MAAM,KAAK,CAAC,EAAE;MACzB,MAAM,IAAIC,KAAK,CACb,UAAUL,MAAM,yDAClB,CAAC;IACH;EACF,CAAC,CAAC,OAAOM,CAAC,EAAE;IACV,MAAKA,CAAC,CAAsBC,IAAI,KAAK,QAAQ,GAEtC;MACL,MAAMD,CAAC;IACT,CAAC,CAHC;EAIJ;AACF","ignoreList":[]}
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
|
|
16
17
|
import { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from "@osdk/generator-converters";
|
|
18
|
+
import consola from "consola";
|
|
17
19
|
import fastDeepEqual from "fast-deep-equal";
|
|
18
20
|
import invariant from "tiny-invariant";
|
|
19
21
|
import { extractNamespace } from "../GenerateContext/EnhancedBase.js";
|
|
@@ -21,6 +23,7 @@ import { EnhancedInterfaceType } from "../GenerateContext/EnhancedInterfaceType.
|
|
|
21
23
|
import { deleteUndefineds } from "../util/deleteUndefineds.js";
|
|
22
24
|
import { stringify } from "../util/stringify.js";
|
|
23
25
|
import { createDefinition, createObjectSet, createOsdkObject, createPropertyKeys, createProps } from "./wireObjectTypeV2ToSdkObjectConstV2.js";
|
|
26
|
+
|
|
24
27
|
/** @internal */
|
|
25
28
|
export function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(interfaceDef, ontology, v2 = false, forInternalUse = false) {
|
|
26
29
|
const definition = deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceDef.raw, v2));
|
|
@@ -28,7 +31,7 @@ export function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(interfaceDef, ont
|
|
|
28
31
|
const parents = definition.implements?.map(p => {
|
|
29
32
|
const parent = ontology.requireInterfaceType(p, true);
|
|
30
33
|
if (parent instanceof EnhancedInterfaceType) {
|
|
31
|
-
const it = deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(parent.raw, v2));
|
|
34
|
+
const it = deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(parent.raw, v2, consola));
|
|
32
35
|
return it;
|
|
33
36
|
}
|
|
34
37
|
}) ?? [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js","names":["__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","fastDeepEqual","invariant","extractNamespace","EnhancedInterfaceType","deleteUndefineds","stringify","createDefinition","createObjectSet","createOsdkObject","createPropertyKeys","createProps","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst","interfaceDef","ontology","v2","forInternalUse","definition","raw","objectDefIdentifier","getDefinitionIdentifier","parents","implements","map","p","parent","requireInterfaceType","it","mergedProperties","properties","apiName","Object","keys","process","env","NODE_ENV","objectSetIdentifier","shortApiName","propertyKeysIdentifier","osdkObjectPropsIdentifier","osdkObjectStrictPropsIdentifier","osdkObjectLinksIdentifier","osdkObjectIdentifier","ids","apiNamespace","badProperties","filter","length","Error","fullApiName","join","links","linkTarget","requireObjectType","targetType","getImportedDefinitionIdentifier","multiplicity"],"sources":["UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js"],"sourcesContent":["/*\n * Copyright 2023 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 */\nimport { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from \"@osdk/generator-converters\";\nimport fastDeepEqual from \"fast-deep-equal\";\nimport invariant from \"tiny-invariant\";\nimport { extractNamespace } from \"../GenerateContext/EnhancedBase.js\";\nimport { EnhancedInterfaceType } from \"../GenerateContext/EnhancedInterfaceType.js\";\nimport { deleteUndefineds } from \"../util/deleteUndefineds.js\";\nimport { stringify } from \"../util/stringify.js\";\nimport { createDefinition, createObjectSet, createOsdkObject, createPropertyKeys, createProps, } from \"./wireObjectTypeV2ToSdkObjectConstV2.js\";\n/** @internal */\nexport function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(interfaceDef, ontology, v2 = false, forInternalUse = false) {\n const definition = deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceDef.raw, v2));\n const objectDefIdentifier = interfaceDef.getDefinitionIdentifier(v2);\n const parents = definition.implements?.map(p => {\n const parent = ontology.requireInterfaceType(p, true);\n if (parent instanceof EnhancedInterfaceType) {\n const it = deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(parent.raw, v2));\n return it;\n }\n }) ?? [];\n const mergedProperties = { ...definition.properties };\n for (const parent of parents) {\n if (parent == null) {\n // came from a foreign type and we cannot merge properties yet\n // so if they weren't listed on the interface its over\n continue;\n }\n for (const apiName of Object.keys(parent.properties)) {\n if (definition.properties[apiName] != null) {\n invariant(fastDeepEqual(definition.properties[apiName], parent.properties[apiName]), `Interface ${definition.apiName} redefines property '${apiName}' from parent '${parent.apiName}' but the properties do not match`);\n }\n else if (mergedProperties[apiName] != null) {\n invariant(fastDeepEqual(mergedProperties[apiName], parent.properties[apiName]), `Some interface defines a conflicting property '${apiName}' that does not match property from parent '${parent.apiName}'`);\n }\n mergedProperties[apiName] = parent.properties[apiName];\n }\n }\n definition.properties = mergedProperties;\n const objectSetIdentifier = `${interfaceDef.shortApiName}.ObjectSet`;\n const propertyKeysIdentifier = `${interfaceDef.shortApiName}.PropertyKeys`;\n // const osdkObjectPropsIdentifier = `OsdkObjectProps$${objectDefIdentifier}`;\n const osdkObjectPropsIdentifier = `${interfaceDef.shortApiName}.Props`;\n const osdkObjectStrictPropsIdentifier = `${interfaceDef.shortApiName}.StrictProps`;\n const osdkObjectLinksIdentifier = `OsdkObjectLinks$${objectDefIdentifier}`;\n const osdkObjectIdentifier = `${interfaceDef.shortApiName}.OsdkObject`;\n const ids = {\n objectDefIdentifier: interfaceDef.shortApiName,\n osdkObjectLinksIdentifier,\n osdkObjectPropsIdentifier,\n osdkObjectStrictPropsIdentifier,\n objectSetIdentifier,\n osdkObjectIdentifier,\n propertyKeysIdentifier,\n };\n if (interfaceDef.apiNamespace) {\n const badProperties = Object.keys(definition.properties).filter(apiName => extractNamespace(apiName)[0] == null);\n if (badProperties.length > 0) {\n throw new Error(`Interfaces with fully qualified api names MUST NOT have any properties with an unqualified api name. Interface: ${interfaceDef.fullApiName}, properties: ${badProperties.join(\", \")}`);\n }\n }\n function getV2Types(forInternalUse = false) {\n return `import type {\n InterfaceDefinition as $InterfaceDefinition,\n ObjectSet as $ObjectSet, \n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"${forInternalUse ? \"@osdk/api\" : \"@osdk/client\"}\";\n \n ${Object.keys(definition.links).length === 0\n ? `export type ${osdkObjectLinksIdentifier} = {};`\n : `\n export interface ${osdkObjectLinksIdentifier} {\n${stringify(definition.links, {\n \"*\": (definition) => {\n const linkTarget = ontology.requireObjectType(definition.targetType)\n .getImportedDefinitionIdentifier(v2);\n return `${definition.multiplicity\n ? `${linkTarget}[\"objectSet\"]`\n : `SingleLinkAccessor<${linkTarget}>`}\n `;\n },\n })}\n }\n `}\n\n export namespace ${interfaceDef.shortApiName} {\n\n ${createPropertyKeys(interfaceDef)}\n\n\n ${createProps(interfaceDef, \"Props\", false)}\n ${createProps(interfaceDef, \"StrictProps\", true)}\n\n\n ${createObjectSet(interfaceDef, ids)}\n\n ${createOsdkObject(interfaceDef, \"OsdkInstance\", ids)}\n \n } \n\n ${createDefinition(interfaceDef, ontology, interfaceDef.shortApiName, ids)}\n\n`;\n }\n // FIXME: We need to fill in the imports\n // if we want links to work\n const imports = [];\n definition;\n return `${imports.join(\"\\n\")}\n ${v2 ? getV2Types(forInternalUse) : \"\"}\n\n export const ${interfaceDef.shortApiName}: ${interfaceDef.shortApiName} = {\n type: \"interface\",\n apiName: \"${interfaceDef.fullApiName}\",\n osdkMetadata: $osdkMetadata,\n };`;\n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WAAW;MACK;IACJ,CAAC,CAAC;AACd;AACA,KAAK;AACL;AACA,uBAAuBvC,YAAY,CAACwB,YAAY;AAChD;AACA,QAAQ3B,kBAAkB,CAACG,YAAY,CAAC;AACxC;AACA;AACA,QAAQF,WAAW,CAACE,YAAY,EAAE,OAAO,EAAE,KAAK,CAAC;AACjD,QAAQF,WAAW,CAACE,YAAY,EAAE,aAAa,EAAE,IAAI,CAAC;AACtD;AACA;AACA,QAAQL,eAAe,CAACK,YAAY,EAAE8B,GAAG,CAAC;AAC1C;AACA,QAAQlC,gBAAgB,CAACI,YAAY,EAAE,cAAc,EAAE8B,GAAG,CAAC;AAC3D;AACA;AACA;AACA,MAAMpC,gBAAgB,CAACM,YAAY,EAAEC,QAAQ,EAAED,YAAY,CAACwB,YAAY,EAAEM,GAAG,CAAC;AAC9E;AACA,CAAC;EACG,CAAC,CAMiB3B,cAAc,CAAC,GAAG,EAAE;AAC1C;AACA,mBAAmBH,YAAY,CAACwB,YAAY,KAAKxB,YAAY,CAACwB,YAAY;AAC1E;AACA,kBAAkBxB,YAAY,CAACoC,WAAW;AAC1C;AACA,UAAU;AACV","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js","names":["__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","consola","fastDeepEqual","invariant","extractNamespace","EnhancedInterfaceType","deleteUndefineds","stringify","createDefinition","createObjectSet","createOsdkObject","createPropertyKeys","createProps","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst","interfaceDef","ontology","v2","forInternalUse","definition","raw","objectDefIdentifier","getDefinitionIdentifier","parents","implements","map","p","parent","requireInterfaceType","it","mergedProperties","properties","apiName","Object","keys","process","env","NODE_ENV","objectSetIdentifier","shortApiName","propertyKeysIdentifier","osdkObjectPropsIdentifier","osdkObjectStrictPropsIdentifier","osdkObjectLinksIdentifier","osdkObjectIdentifier","ids","apiNamespace","badProperties","filter","length","Error","fullApiName","join","links","linkTarget","requireObjectType","targetType","getImportedDefinitionIdentifier","multiplicity"],"sources":["UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from \"@osdk/generator-converters\";\nimport consola from \"consola\";\nimport fastDeepEqual from \"fast-deep-equal\";\nimport invariant from \"tiny-invariant\";\nimport { extractNamespace } from \"../GenerateContext/EnhancedBase.js\";\nimport { EnhancedInterfaceType } from \"../GenerateContext/EnhancedInterfaceType.js\";\nimport type { EnhancedOntologyDefinition } from \"../GenerateContext/EnhancedOntologyDefinition.js\";\nimport { deleteUndefineds } from \"../util/deleteUndefineds.js\";\nimport { stringify } from \"../util/stringify.js\";\nimport type { Identifiers } from \"./wireObjectTypeV2ToSdkObjectConstV2.js\";\nimport {\n createDefinition,\n createObjectSet,\n createOsdkObject,\n createPropertyKeys,\n createProps,\n} from \"./wireObjectTypeV2ToSdkObjectConstV2.js\";\n\n/** @internal */\nexport function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(\n interfaceDef: EnhancedInterfaceType,\n ontology: EnhancedOntologyDefinition,\n v2: boolean = false,\n forInternalUse: boolean = false,\n) {\n const definition = deleteUndefineds(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(\n interfaceDef.raw,\n v2,\n ),\n );\n\n const objectDefIdentifier = interfaceDef.getDefinitionIdentifier(v2);\n\n const parents = definition.implements?.map(p => {\n const parent = ontology.requireInterfaceType(p, true);\n if (parent instanceof EnhancedInterfaceType) {\n const it = deleteUndefineds(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(\n parent.raw,\n v2,\n consola,\n ),\n );\n return it;\n }\n }) ?? [];\n\n const mergedProperties = { ...definition.properties };\n for (const parent of parents) {\n if (parent == null) {\n // came from a foreign type and we cannot merge properties yet\n // so if they weren't listed on the interface its over\n continue;\n }\n for (const apiName of Object.keys(parent.properties)) {\n if (definition.properties[apiName] != null) {\n invariant(\n fastDeepEqual(\n definition.properties[apiName],\n parent.properties[apiName],\n ),\n `Interface ${definition.apiName} redefines property '${apiName}' from parent '${parent.apiName}' but the properties do not match`,\n );\n } else if (mergedProperties[apiName] != null) {\n invariant(\n fastDeepEqual(\n mergedProperties[apiName],\n parent.properties[apiName],\n ),\n `Some interface defines a conflicting property '${apiName}' that does not match property from parent '${parent.apiName}'`,\n );\n }\n mergedProperties[apiName] = parent.properties[apiName];\n }\n }\n\n definition.properties = mergedProperties;\n\n const objectSetIdentifier = `${interfaceDef.shortApiName}.ObjectSet`;\n const propertyKeysIdentifier = `${interfaceDef.shortApiName}.PropertyKeys`;\n // const osdkObjectPropsIdentifier = `OsdkObjectProps$${objectDefIdentifier}`;\n const osdkObjectPropsIdentifier = `${interfaceDef.shortApiName}.Props`;\n const osdkObjectStrictPropsIdentifier =\n `${interfaceDef.shortApiName}.StrictProps`;\n const osdkObjectLinksIdentifier = `OsdkObjectLinks$${objectDefIdentifier}`;\n const osdkObjectIdentifier = `${interfaceDef.shortApiName}.OsdkObject`;\n\n const ids: Identifiers = {\n objectDefIdentifier: interfaceDef.shortApiName,\n osdkObjectLinksIdentifier,\n osdkObjectPropsIdentifier,\n osdkObjectStrictPropsIdentifier,\n objectSetIdentifier,\n osdkObjectIdentifier,\n propertyKeysIdentifier,\n };\n\n if (interfaceDef.apiNamespace) {\n const badProperties = Object.keys(definition.properties).filter(apiName =>\n extractNamespace(apiName)[0] == null\n );\n if (badProperties.length > 0) {\n throw new Error(\n `Interfaces with fully qualified api names MUST NOT have any properties with an unqualified api name. Interface: ${interfaceDef.fullApiName}, properties: ${\n badProperties.join(\", \")\n }`,\n );\n }\n }\n\n function getV2Types(forInternalUse: boolean = false) {\n return `import type {\n InterfaceDefinition as $InterfaceDefinition,\n ObjectSet as $ObjectSet, \n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"${forInternalUse ? \"@osdk/api\" : \"@osdk/client\"}\";\n \n ${\n Object.keys(definition.links).length === 0\n ? `export type ${osdkObjectLinksIdentifier} = {};`\n : `\n export interface ${osdkObjectLinksIdentifier} {\n${\n stringify(definition.links, {\n \"*\": (definition) => {\n const linkTarget = ontology.requireObjectType(\n definition.targetType,\n )\n .getImportedDefinitionIdentifier(v2);\n\n return `${\n definition.multiplicity\n ? `${linkTarget}[\"objectSet\"]`\n : `SingleLinkAccessor<${linkTarget}>`\n }\n `;\n },\n })\n }\n }\n `\n }\n\n export namespace ${interfaceDef.shortApiName} {\n\n ${createPropertyKeys(interfaceDef)}\n\n\n ${createProps(interfaceDef, \"Props\", false)}\n ${createProps(interfaceDef, \"StrictProps\", true)}\n\n\n ${createObjectSet(interfaceDef, ids)}\n\n ${createOsdkObject(interfaceDef, \"OsdkInstance\", ids)}\n \n } \n\n ${createDefinition(interfaceDef, ontology, interfaceDef.shortApiName, ids)}\n\n`;\n }\n\n // FIXME: We need to fill in the imports\n // if we want links to work\n const imports: string[] = [];\n definition;\n return `${imports.join(\"\\n\")}\n ${v2 ? getV2Types(forInternalUse) : \"\"}\n\n export const ${interfaceDef.shortApiName}: ${interfaceDef.shortApiName} = {\n type: \"interface\",\n apiName: \"${interfaceDef.fullApiName}\",\n osdkMetadata: $osdkMetadata,\n };`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,mDAAmD,QAAQ,4BAA4B;AAChG,OAAOC,OAAO,MAAM,SAAS;AAC7B,OAAO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AAC;AACxC;AACA;AACA,QAAQF,WAAW,CAACE,YAAY,EAAE,OAAO,EAAE,KAAK,CAAC;AACjD,QAAQF,WAAW,CAACE,YAAY,EAAE,aAAa,EAAE,IAAI,CAAC;AACtD;AACA;AACA,QAAQL,eAAe,CAACK,YAAY,EAAE8B,GAAG,CAAC;AAC1C;AACA,QAAQlC,gBAAgB,CAACI,YAAY,EAAE,cAAc,EAAE8B,GAAG,CAAC;AAC3D;AACA;AACA;AACA,MAAMpC,gBAAgB,CAACM,YAAY,EAAEC,QAAQ,EAAED,YAAY,CAACwB,YAAY,EAAEM,GAAG,CAAC;AAC9E;AACA,CAAC;EACC,CAAC,CAOmB3B,cAAc,CAAC,GAAG,EAAE;AAC1C;AACA,mBAAmBH,YAAY,CAACwB,YAAY,KAAKxB,YAAY,CAACwB,YAAY;AAC1E;AACA,kBAAkBxB,YAAY,CAACoC,WAAW;AAC1C;AACA,UAAU;AACV","ignoreList":[]}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
|
|
16
17
|
import { format } from "prettier";
|
|
17
18
|
import { describe, expect, it } from "vitest";
|
|
18
19
|
import { EnhancedInterfaceType } from "../GenerateContext/EnhancedInterfaceType.js";
|
|
@@ -39,7 +40,11 @@ function simpleInterface(apiName, spts, parents, metadataLevel = 2) {
|
|
|
39
40
|
description: metadataLevel >= 2 ? `${apiName} interface desc` : undefined,
|
|
40
41
|
extendsInterfaces: parents,
|
|
41
42
|
links: {},
|
|
42
|
-
properties
|
|
43
|
+
properties,
|
|
44
|
+
implementedByObjectTypes: [],
|
|
45
|
+
allExtendsInterfaces: parents,
|
|
46
|
+
allLinks: {},
|
|
47
|
+
allProperties: properties
|
|
43
48
|
};
|
|
44
49
|
}
|
|
45
50
|
function simpleOntology(apiName, interfaces) {
|
|
@@ -66,6 +71,7 @@ describe(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst, () => {
|
|
|
66
71
|
importExt: ""
|
|
67
72
|
});
|
|
68
73
|
expect(ontology.interfaceTypes.Bar instanceof EnhancedInterfaceType).toBe(true);
|
|
74
|
+
|
|
69
75
|
// type guard for below
|
|
70
76
|
if (ontology.interfaceTypes.Bar instanceof ForeignType) {
|
|
71
77
|
throw new Error("Expected Bar to be an EnhancedInterfaceType");
|
|
@@ -117,6 +123,7 @@ describe(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst, () => {
|
|
|
117
123
|
strictProps: Bar.StrictProps;
|
|
118
124
|
apiName: "Bar";
|
|
119
125
|
displayName: "Bar";
|
|
126
|
+
implementedBy: [];
|
|
120
127
|
implements: [];
|
|
121
128
|
links: {};
|
|
122
129
|
properties: {
|
|
@@ -192,6 +199,7 @@ describe(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst, () => {
|
|
|
192
199
|
apiName: "Foo";
|
|
193
200
|
description: "Foo interface desc";
|
|
194
201
|
displayName: "Foo interface dn";
|
|
202
|
+
implementedBy: [];
|
|
195
203
|
implements: ["Parent"];
|
|
196
204
|
links: {};
|
|
197
205
|
properties: {
|
|
@@ -269,6 +277,7 @@ describe(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst, () => {
|
|
|
269
277
|
apiName: "Foo";
|
|
270
278
|
description: "Foo interface desc";
|
|
271
279
|
displayName: "Foo interface dn";
|
|
280
|
+
implementedBy: [];
|
|
272
281
|
implements: ["Parent"];
|
|
273
282
|
links: {};
|
|
274
283
|
properties: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js","names":["format","describe","expect","it","EnhancedInterfaceType","enhanceOntology","ForeignType","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst","simpleSpt","apiName","metadataLevel","dataType","type","rid","displayName","description","undefined","simpleInterface","spts","parents","properties","Object","fromEntries","map","spt","extendsInterfaces","links","simpleOntology","interfaces","interfaceTypes","i","sharedPropertyTypes","flatMap","entries","actionTypes","objectTypes","ontology","queryTypes","sanitized","importExt","Bar","toBe","Error","formattedCode","parser","printWidth","toMatchInlineSnapshot","fooSpt","barSpt","Foo"],"sources":["UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport { format } from \"prettier\";\nimport { describe, expect, it } from \"vitest\";\nimport { EnhancedInterfaceType } from \"../GenerateContext/EnhancedInterfaceType.js\";\nimport { enhanceOntology } from \"../GenerateContext/enhanceOntology.js\";\nimport { ForeignType } from \"../GenerateContext/ForeignType.js\";\nimport { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst } from \"./UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js\";\nfunction simpleSpt(apiName, metadataLevel = 2) {\n return {\n apiName,\n dataType: {\n type: \"integer\",\n },\n rid: `${apiName}Rid`,\n displayName: metadataLevel >= 1 ? `${apiName} property dn` : apiName,\n description: metadataLevel >= 2 ? `${apiName} property desc` : undefined,\n };\n}\nfunction simpleInterface(apiName, spts, parents, metadataLevel = 2) {\n const properties = Object.fromEntries(spts.map(spt => [spt.apiName, spt]));\n return {\n apiName,\n rid: `${apiName}Rid`,\n displayName: metadataLevel >= 1 ? `${apiName} interface dn` : apiName,\n description: metadataLevel >= 2 ? `${apiName} interface desc` : undefined,\n extendsInterfaces: parents,\n links: {},\n properties,\n };\n}\nfunction simpleOntology(apiName, interfaces) {\n const interfaceTypes = Object\n .fromEntries(interfaces.map(i => [i.apiName, i]));\n const sharedPropertyTypes = Object\n .fromEntries(interfaces.flatMap(i => Object.entries(i.properties)));\n return {\n actionTypes: {},\n interfaceTypes,\n objectTypes: {},\n ontology: {\n apiName,\n description: `${apiName} ontology desc`,\n displayName: `${apiName} ontology dn`,\n rid: `${apiName} ontology rid`,\n },\n queryTypes: {},\n sharedPropertyTypes,\n };\n}\ndescribe(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst, () => {\n it(\"Does not say (inherited) on properties locally defined\", async () => {\n const ontology = enhanceOntology({\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Bar\", [simpleSpt(\"bar\", 0)], [], 0),\n ]),\n importExt: \"\",\n });\n expect(ontology.interfaceTypes.Bar instanceof EnhancedInterfaceType).toBe(true);\n // type guard for below\n if (ontology.interfaceTypes.Bar instanceof ForeignType) {\n throw new Error(\"Expected Bar to be an EnhancedInterfaceType\");\n }\n const formattedCode = await format(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(ontology.interfaceTypes.Bar, ontology, true, true), {\n parser: \"typescript\",\n printWidth: 100,\n });\n expect(formattedCode).toMatchInlineSnapshot(`\n \"import type {\n InterfaceDefinition as $InterfaceDefinition,\n ObjectSet as $ObjectSet,\n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"@osdk/api\";\n\n export type OsdkObjectLinks$Bar = {};\n\n export namespace Bar {\n export type PropertyKeys = \"bar\";\n\n export interface Props {\n readonly bar: $PropType[\"integer\"] | undefined;\n }\n export type StrictProps = Props;\n\n export interface ObjectSet extends $ObjectSet<Bar, Bar.ObjectSet> {}\n\n export type OsdkInstance<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Bar.Props = keyof Bar.Props,\n > = $Osdk.Instance<Bar, OPTIONS, K>;\n\n /** @deprecated use OsdkInstance */\n export type OsdkObject<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Bar.Props = keyof Bar.Props,\n > = OsdkInstance<OPTIONS, K>;\n }\n\n export interface Bar extends $InterfaceDefinition {\n osdkMetadata: typeof $osdkMetadata;\n type: \"interface\";\n apiName: \"Bar\";\n __DefinitionMetadata?: {\n objectSet: Bar.ObjectSet;\n props: Bar.Props;\n linksType: OsdkObjectLinks$Bar;\n strictProps: Bar.StrictProps;\n apiName: \"Bar\";\n displayName: \"Bar\";\n implements: [];\n links: {};\n properties: {\n /**\n * (no ontology metadata)\n */\n bar: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n };\n rid: \"BarRid\";\n type: \"interface\";\n };\n }\n\n export const Bar: Bar = {\n type: \"interface\",\n apiName: \"Bar\",\n osdkMetadata: $osdkMetadata,\n };\n \"\n `);\n });\n it(\"Generates properties for inherited SPTs\", async () => {\n const fooSpt = simpleSpt(\"foo\");\n const barSpt = simpleSpt(\"bar\");\n const ontology = enhanceOntology({\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Foo\", [fooSpt], [\"Parent\"]),\n simpleInterface(\"Parent\", [barSpt], []),\n ]),\n importExt: \"\",\n });\n const formattedCode = await format(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(ontology.interfaceTypes.Foo, ontology, true, true), {\n parser: \"typescript\",\n });\n expect(formattedCode).toMatchInlineSnapshot(`\n \"import type {\n InterfaceDefinition as $InterfaceDefinition,\n ObjectSet as $ObjectSet,\n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"@osdk/api\";\n\n export type OsdkObjectLinks$Foo = {};\n\n export namespace Foo {\n export type PropertyKeys = \"foo\";\n\n export interface Props {\n readonly foo: $PropType[\"integer\"] | undefined;\n }\n export type StrictProps = Props;\n\n export interface ObjectSet extends $ObjectSet<Foo, Foo.ObjectSet> {}\n\n export type OsdkInstance<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = $Osdk.Instance<Foo, OPTIONS, K>;\n\n /** @deprecated use OsdkInstance */\n export type OsdkObject<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = OsdkInstance<OPTIONS, K>;\n }\n\n export interface Foo extends $InterfaceDefinition {\n osdkMetadata: typeof $osdkMetadata;\n type: \"interface\";\n apiName: \"Foo\";\n __DefinitionMetadata?: {\n objectSet: Foo.ObjectSet;\n props: Foo.Props;\n linksType: OsdkObjectLinks$Foo;\n strictProps: Foo.StrictProps;\n apiName: \"Foo\";\n description: \"Foo interface desc\";\n displayName: \"Foo interface dn\";\n implements: [\"Parent\"];\n links: {};\n properties: {\n /**\n * display name: 'foo property dn',\n * description: foo property desc\n */\n foo: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n };\n rid: \"FooRid\";\n type: \"interface\";\n };\n }\n\n export const Foo: Foo = {\n type: \"interface\",\n apiName: \"Foo\",\n osdkMetadata: $osdkMetadata,\n };\n \"\n `);\n });\n it(\"allows for SPT reuse if the same\", async () => {\n const fooSpt = simpleSpt(\"foo\");\n const barSpt = simpleSpt(\"bar\");\n const ontology = enhanceOntology({\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Foo\", [fooSpt, barSpt], [\"Parent\"]),\n simpleInterface(\"Parent\", [barSpt], []),\n ]),\n importExt: \"\",\n });\n const formattedCode = await format(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(ontology.interfaceTypes.Foo, ontology, true, true), {\n parser: \"typescript\",\n });\n expect(formattedCode).toMatchInlineSnapshot(`\n \"import type {\n InterfaceDefinition as $InterfaceDefinition,\n ObjectSet as $ObjectSet,\n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"@osdk/api\";\n\n export type OsdkObjectLinks$Foo = {};\n\n export namespace Foo {\n export type PropertyKeys = \"foo\" | \"bar\";\n\n export interface Props {\n readonly bar: $PropType[\"integer\"] | undefined;\n readonly foo: $PropType[\"integer\"] | undefined;\n }\n export type StrictProps = Props;\n\n export interface ObjectSet extends $ObjectSet<Foo, Foo.ObjectSet> {}\n\n export type OsdkInstance<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = $Osdk.Instance<Foo, OPTIONS, K>;\n\n /** @deprecated use OsdkInstance */\n export type OsdkObject<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = OsdkInstance<OPTIONS, K>;\n }\n\n export interface Foo extends $InterfaceDefinition {\n osdkMetadata: typeof $osdkMetadata;\n type: \"interface\";\n apiName: \"Foo\";\n __DefinitionMetadata?: {\n objectSet: Foo.ObjectSet;\n props: Foo.Props;\n linksType: OsdkObjectLinks$Foo;\n strictProps: Foo.StrictProps;\n apiName: \"Foo\";\n description: \"Foo interface desc\";\n displayName: \"Foo interface dn\";\n implements: [\"Parent\"];\n links: {};\n properties: {\n /**\n * display name: 'bar property dn',\n * description: bar property desc\n */\n bar: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n /**\n * display name: 'foo property dn',\n * description: foo property desc\n */\n foo: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n };\n rid: \"FooRid\";\n type: \"interface\";\n };\n }\n\n export const Foo: Foo = {\n type: \"interface\",\n apiName: \"Foo\",\n osdkMetadata: $osdkMetadata,\n };\n \"\n `);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,UAAU;AACjC,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,qBAAqB,QAAQ,6CAA6C;AACnF,SAASC,eAAe,QAAQ,uCAAuC;AACvE,SAASC,WAAW,QAAQ,mCAAmC;AAC/D,SAASC,8CAA8C,QAAQ,mDAAmD;AAClH,SAASC,SAASA,CAACC,OAAO,EAAEC,aAAa,GAAG,CAAC,EAAE;EAC3C,OAAO;IACHD,OAAO;IACPE,QAAQ,EAAE;MACNC,IAAI,EAAE;IACV,CAAC;IACDC,GAAG,EAAE,GAAGJ,OAAO,KAAK;IACpBK,WAAW,EAAEJ,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EAAEX,cAAc,CAAC,UAAU,EAAE,CAClCV,eAAe,CAAC,KAAK,EAAE,CAAC8B,MAAM,EAAEC,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,EACpD/B,eAAe,CAAC,QAAQ,EAAE,CAAC+B,MAAM,CAAC,EAAE,EAAE,CAAC,CAC1C,CAAC;MACFT,SAAS,EAAE;IACf,CAAC,CAAC;IACF,MAAMI,aAAa,GAAG,MAAM3C,MAAM,CAACO,8CAA8C,CAAC6B,QAAQ,CAACP,cAAc,CAACoB,GAAG,EAAEb,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;MAClIQ,MAAM,EAAE;IACZ,CAAC,CAAC;IACF1C,MAAM,CAACyC,aAAa,CAAC,CAACG,qBAAqB,CAAC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACF,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js","names":["format","describe","expect","it","EnhancedInterfaceType","enhanceOntology","ForeignType","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst","simpleSpt","apiName","metadataLevel","dataType","type","rid","displayName","description","undefined","simpleInterface","spts","parents","properties","Object","fromEntries","map","spt","extendsInterfaces","links","implementedByObjectTypes","allExtendsInterfaces","allLinks","allProperties","simpleOntology","interfaces","interfaceTypes","i","sharedPropertyTypes","flatMap","entries","actionTypes","objectTypes","ontology","queryTypes","sanitized","importExt","Bar","toBe","Error","formattedCode","parser","printWidth","toMatchInlineSnapshot","fooSpt","barSpt","Foo"],"sources":["UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.ts"],"sourcesContent":["/*\n * Copyright 2024 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 InterfaceType,\n SharedPropertyType,\n} from \"@osdk/foundry.ontologies\";\nimport { format } from \"prettier\";\nimport { describe, expect, it } from \"vitest\";\nimport { EnhancedInterfaceType } from \"../GenerateContext/EnhancedInterfaceType.js\";\nimport { enhanceOntology } from \"../GenerateContext/enhanceOntology.js\";\nimport { ForeignType } from \"../GenerateContext/ForeignType.js\";\nimport type { WireOntologyDefinition } from \"../WireOntologyDefinition.js\";\nimport { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst } from \"./UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js\";\n\nfunction simpleSpt<T extends string>(apiName: T, metadataLevel: 0 | 1 | 2 = 2) {\n return {\n apiName,\n dataType: {\n type: \"integer\",\n },\n rid: `${apiName}Rid`,\n displayName: metadataLevel >= 1 ? `${apiName} property dn` : apiName,\n description: metadataLevel >= 2 ? `${apiName} property desc` : undefined,\n } as const satisfies SharedPropertyType;\n}\n\nfunction simpleInterface<T extends string, Q extends SharedPropertyType>(\n apiName: T,\n spts: Q[],\n parents: string[],\n metadataLevel: 0 | 1 | 2 = 2,\n) {\n const properties = Object.fromEntries(spts.map(spt => [spt.apiName, spt]));\n\n return {\n apiName,\n rid: `${apiName}Rid`,\n displayName: metadataLevel >= 1 ? `${apiName} interface dn` : apiName,\n description: metadataLevel >= 2 ? `${apiName} interface desc` : undefined,\n extendsInterfaces: parents,\n links: {},\n properties,\n implementedByObjectTypes: [],\n allExtendsInterfaces: parents,\n allLinks: {},\n allProperties: properties,\n } as const satisfies InterfaceType;\n}\n\nfunction simpleOntology<I extends InterfaceType>(\n apiName: string,\n interfaces: I[],\n) {\n const interfaceTypes: Record<I[\"apiName\"], I> = Object\n .fromEntries(\n interfaces.map(i => [i.apiName, i]),\n ) as Record<string, I>;\n\n const sharedPropertyTypes: Record<string, I[\"properties\"][string]> = Object\n .fromEntries(\n interfaces.flatMap(i => Object.entries(i.properties)),\n ) as Record<string, I[\"properties\"][string]>;\n\n return {\n actionTypes: {},\n interfaceTypes,\n objectTypes: {},\n ontology: {\n apiName,\n description: `${apiName} ontology desc`,\n displayName: `${apiName} ontology dn`,\n rid: `${apiName} ontology rid`,\n },\n queryTypes: {},\n sharedPropertyTypes,\n } as const satisfies WireOntologyDefinition;\n}\n\ndescribe(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst, () => {\n it(\"Does not say (inherited) on properties locally defined\", async () => {\n const ontology = enhanceOntology({\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Bar\", [simpleSpt(\"bar\", 0)], [], 0),\n ]),\n importExt: \"\",\n });\n\n expect(ontology.interfaceTypes.Bar instanceof EnhancedInterfaceType).toBe(\n true,\n );\n\n // type guard for below\n if (ontology.interfaceTypes.Bar instanceof ForeignType) {\n throw new Error(\"Expected Bar to be an EnhancedInterfaceType\");\n }\n\n const formattedCode = await format(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(\n ontology.interfaceTypes.Bar,\n ontology,\n true,\n true,\n ),\n {\n parser: \"typescript\",\n printWidth: 100,\n },\n );\n expect(formattedCode).toMatchInlineSnapshot(`\n \"import type {\n InterfaceDefinition as $InterfaceDefinition,\n ObjectSet as $ObjectSet,\n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"@osdk/api\";\n\n export type OsdkObjectLinks$Bar = {};\n\n export namespace Bar {\n export type PropertyKeys = \"bar\";\n\n export interface Props {\n readonly bar: $PropType[\"integer\"] | undefined;\n }\n export type StrictProps = Props;\n\n export interface ObjectSet extends $ObjectSet<Bar, Bar.ObjectSet> {}\n\n export type OsdkInstance<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Bar.Props = keyof Bar.Props,\n > = $Osdk.Instance<Bar, OPTIONS, K>;\n\n /** @deprecated use OsdkInstance */\n export type OsdkObject<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Bar.Props = keyof Bar.Props,\n > = OsdkInstance<OPTIONS, K>;\n }\n\n export interface Bar extends $InterfaceDefinition {\n osdkMetadata: typeof $osdkMetadata;\n type: \"interface\";\n apiName: \"Bar\";\n __DefinitionMetadata?: {\n objectSet: Bar.ObjectSet;\n props: Bar.Props;\n linksType: OsdkObjectLinks$Bar;\n strictProps: Bar.StrictProps;\n apiName: \"Bar\";\n displayName: \"Bar\";\n implementedBy: [];\n implements: [];\n links: {};\n properties: {\n /**\n * (no ontology metadata)\n */\n bar: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n };\n rid: \"BarRid\";\n type: \"interface\";\n };\n }\n\n export const Bar: Bar = {\n type: \"interface\",\n apiName: \"Bar\",\n osdkMetadata: $osdkMetadata,\n };\n \"\n `);\n });\n\n it(\"Generates properties for inherited SPTs\", async () => {\n const fooSpt = simpleSpt(\"foo\");\n const barSpt = simpleSpt(\"bar\");\n\n const ontology = enhanceOntology(\n {\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Foo\", [fooSpt], [\"Parent\"]),\n simpleInterface(\"Parent\", [barSpt], []),\n ]),\n\n importExt: \"\",\n },\n );\n\n const formattedCode = await format(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(\n ontology.interfaceTypes.Foo as EnhancedInterfaceType,\n ontology,\n true,\n true,\n ),\n {\n parser: \"typescript\",\n },\n );\n expect(formattedCode).toMatchInlineSnapshot(`\n \"import type {\n InterfaceDefinition as $InterfaceDefinition,\n ObjectSet as $ObjectSet,\n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"@osdk/api\";\n\n export type OsdkObjectLinks$Foo = {};\n\n export namespace Foo {\n export type PropertyKeys = \"foo\";\n\n export interface Props {\n readonly foo: $PropType[\"integer\"] | undefined;\n }\n export type StrictProps = Props;\n\n export interface ObjectSet extends $ObjectSet<Foo, Foo.ObjectSet> {}\n\n export type OsdkInstance<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = $Osdk.Instance<Foo, OPTIONS, K>;\n\n /** @deprecated use OsdkInstance */\n export type OsdkObject<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = OsdkInstance<OPTIONS, K>;\n }\n\n export interface Foo extends $InterfaceDefinition {\n osdkMetadata: typeof $osdkMetadata;\n type: \"interface\";\n apiName: \"Foo\";\n __DefinitionMetadata?: {\n objectSet: Foo.ObjectSet;\n props: Foo.Props;\n linksType: OsdkObjectLinks$Foo;\n strictProps: Foo.StrictProps;\n apiName: \"Foo\";\n description: \"Foo interface desc\";\n displayName: \"Foo interface dn\";\n implementedBy: [];\n implements: [\"Parent\"];\n links: {};\n properties: {\n /**\n * display name: 'foo property dn',\n * description: foo property desc\n */\n foo: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n };\n rid: \"FooRid\";\n type: \"interface\";\n };\n }\n\n export const Foo: Foo = {\n type: \"interface\",\n apiName: \"Foo\",\n osdkMetadata: $osdkMetadata,\n };\n \"\n `);\n });\n\n it(\"allows for SPT reuse if the same\", async () => {\n const fooSpt = simpleSpt(\"foo\");\n const barSpt = simpleSpt(\"bar\");\n\n const ontology = enhanceOntology(\n {\n sanitized: simpleOntology(\"ontology\", [\n simpleInterface(\"Foo\", [fooSpt, barSpt], [\"Parent\"]),\n simpleInterface(\"Parent\", [barSpt], []),\n ]),\n importExt: \"\",\n },\n );\n\n const formattedCode = await format(\n __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(\n ontology.interfaceTypes.Foo as EnhancedInterfaceType,\n ontology,\n true,\n true,\n ),\n {\n parser: \"typescript\",\n },\n );\n expect(formattedCode).toMatchInlineSnapshot(`\n \"import type {\n InterfaceDefinition as $InterfaceDefinition,\n ObjectSet as $ObjectSet,\n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"@osdk/api\";\n\n export type OsdkObjectLinks$Foo = {};\n\n export namespace Foo {\n export type PropertyKeys = \"foo\" | \"bar\";\n\n export interface Props {\n readonly bar: $PropType[\"integer\"] | undefined;\n readonly foo: $PropType[\"integer\"] | undefined;\n }\n export type StrictProps = Props;\n\n export interface ObjectSet extends $ObjectSet<Foo, Foo.ObjectSet> {}\n\n export type OsdkInstance<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = $Osdk.Instance<Foo, OPTIONS, K>;\n\n /** @deprecated use OsdkInstance */\n export type OsdkObject<\n OPTIONS extends never | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = OsdkInstance<OPTIONS, K>;\n }\n\n export interface Foo extends $InterfaceDefinition {\n osdkMetadata: typeof $osdkMetadata;\n type: \"interface\";\n apiName: \"Foo\";\n __DefinitionMetadata?: {\n objectSet: Foo.ObjectSet;\n props: Foo.Props;\n linksType: OsdkObjectLinks$Foo;\n strictProps: Foo.StrictProps;\n apiName: \"Foo\";\n description: \"Foo interface desc\";\n displayName: \"Foo interface dn\";\n implementedBy: [];\n implements: [\"Parent\"];\n links: {};\n properties: {\n /**\n * display name: 'bar property dn',\n * description: bar property desc\n */\n bar: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n /**\n * display name: 'foo property dn',\n * description: foo property desc\n */\n foo: $PropertyDef<\"integer\", \"nullable\", \"single\">;\n };\n rid: \"FooRid\";\n type: \"interface\";\n };\n }\n\n export const Foo: Foo = {\n type: \"interface\",\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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
|
|
16
17
|
import { enhanceOntology } from "../GenerateContext/enhanceOntology.js";
|
|
17
18
|
import { sanitizeMetadata } from "../shared/sanitizeMetadata.js";
|
|
18
19
|
import { verifyOutDir } from "../util/verifyOutDir.js";
|
|
@@ -23,9 +24,11 @@ import { generatePerObjectDataFiles } from "./generatePerObjectDataFiles.js";
|
|
|
23
24
|
import { generatePerQueryDataFilesV2 } from "./generatePerQueryDataFiles.js";
|
|
24
25
|
import { generateRootIndexTsFile } from "./generateRootIndexTsFile.js";
|
|
25
26
|
export async function generateClientSdkVersionTwoPointZero(ontology, userAgent, fs, outDir, packageType = "commonjs", externalObjects = new Map(), externalInterfaces = new Map(), externalSpts = new Map(), forInternalUse = false) {
|
|
26
|
-
const importExt =
|
|
27
|
+
const importExt = ".js"; // turns out you can always use the extension
|
|
28
|
+
|
|
27
29
|
// Structurally, we need to have multiple ontologies read in
|
|
28
30
|
// with one per package.
|
|
31
|
+
|
|
29
32
|
await verifyOutDir(outDir, fs);
|
|
30
33
|
const sanitizedOntology = sanitizeMetadata(ontology);
|
|
31
34
|
await fs.mkdir(outDir, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateClientSdkVersionTwoPointZero.js","names":["enhanceOntology","sanitizeMetadata","verifyOutDir","generateOntologyMetadataFile","generatePerActionDataFiles","generatePerInterfaceDataFiles","generatePerObjectDataFiles","generatePerQueryDataFilesV2","generateRootIndexTsFile","generateClientSdkVersionTwoPointZero","ontology","userAgent","fs","outDir","packageType","externalObjects","Map","externalInterfaces","externalSpts","forInternalUse","importExt","sanitizedOntology","mkdir","recursive","enhancedOntology","sanitized","ctx"],"sources":["generateClientSdkVersionTwoPointZero.
|
|
1
|
+
{"version":3,"file":"generateClientSdkVersionTwoPointZero.js","names":["enhanceOntology","sanitizeMetadata","verifyOutDir","generateOntologyMetadataFile","generatePerActionDataFiles","generatePerInterfaceDataFiles","generatePerObjectDataFiles","generatePerQueryDataFilesV2","generateRootIndexTsFile","generateClientSdkVersionTwoPointZero","ontology","userAgent","fs","outDir","packageType","externalObjects","Map","externalInterfaces","externalSpts","forInternalUse","importExt","sanitizedOntology","mkdir","recursive","enhancedOntology","sanitized","ctx"],"sources":["generateClientSdkVersionTwoPointZero.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { enhanceOntology } from \"../GenerateContext/enhanceOntology.js\";\nimport type { GenerateContext } from \"../GenerateContext/GenerateContext.js\";\nimport type { MinimalFs } from \"../MinimalFs.js\";\nimport { sanitizeMetadata } from \"../shared/sanitizeMetadata.js\";\nimport { verifyOutDir } from \"../util/verifyOutDir.js\";\nimport type { WireOntologyDefinition } from \"../WireOntologyDefinition.js\";\nimport { generateOntologyMetadataFile } from \"./generateMetadata.js\";\nimport { generatePerActionDataFiles } from \"./generatePerActionDataFiles.js\";\nimport { generatePerInterfaceDataFiles } from \"./generatePerInterfaceDataFiles.js\";\nimport { generatePerObjectDataFiles } from \"./generatePerObjectDataFiles.js\";\nimport { generatePerQueryDataFilesV2 } from \"./generatePerQueryDataFiles.js\";\nimport { generateRootIndexTsFile } from \"./generateRootIndexTsFile.js\";\n\nexport async function generateClientSdkVersionTwoPointZero(\n ontology: WireOntologyDefinition,\n userAgent: string,\n fs: MinimalFs,\n outDir: string,\n packageType: \"module\" | \"commonjs\" = \"commonjs\",\n externalObjects: Map<string, string> = new Map(),\n externalInterfaces: Map<string, string> = new Map(),\n externalSpts: Map<string, string> = new Map(),\n forInternalUse: boolean = false,\n): Promise<void> {\n const importExt = \".js\"; // turns out you can always use the extension\n\n // Structurally, we need to have multiple ontologies read in\n // with one per package.\n\n await verifyOutDir(outDir, fs);\n\n const sanitizedOntology = sanitizeMetadata(ontology);\n\n await fs.mkdir(outDir, { recursive: true });\n const enhancedOntology = enhanceOntology({\n sanitized: sanitizedOntology,\n importExt,\n externalObjects,\n externalInterfaces,\n externalSpts,\n });\n\n const ctx: GenerateContext = {\n sanitizedOntology,\n ontology: enhancedOntology,\n importExt,\n fs,\n outDir,\n forInternalUse,\n };\n\n await generateRootIndexTsFile(ctx);\n await generateOntologyMetadataFile(ctx, userAgent);\n await generatePerObjectDataFiles(ctx);\n await generatePerInterfaceDataFiles(ctx);\n await generatePerActionDataFiles(ctx);\n await generatePerQueryDataFilesV2(ctx, true);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,eAAe,QAAQ,uCAAuC;AAGvE,SAASC,gBAAgB,QAAQ,+BAA+B;AAChE,SAASC,YAAY,QAAQ,yBAAyB;AAEtD,SAASC,4BAA4B,QAAQ,uBAAuB;AACpE,SAASC,0BAA0B,QAAQ,iCAAiC;AAC5E,SAASC,6BAA6B,QAAQ,oCAAoC;AAClF,SAASC,0BA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