@osdk/generator 2.0.0-beta.8 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +212 -0
- package/build/{cjs/GenerateContext/EnhanceCommon.d.cts → browser/GenerateContext/EnhanceCommon.d.ts} +1 -1
- package/build/browser/GenerateContext/EnhanceCommon.js +17 -0
- package/build/browser/GenerateContext/EnhanceCommon.js.map +1 -0
- package/build/{cjs/GenerateContext/EnhancedAction.d.cts → browser/GenerateContext/EnhancedAction.d.ts} +2 -2
- package/build/browser/GenerateContext/EnhancedAction.js +42 -0
- package/build/browser/GenerateContext/EnhancedAction.js.map +1 -0
- package/build/{cjs/GenerateContext/EnhancedBase.d.cts → browser/GenerateContext/EnhancedBase.d.ts} +1 -1
- package/build/{cjs → browser}/GenerateContext/EnhancedBase.d.ts.map +1 -1
- package/build/browser/GenerateContext/EnhancedBase.js +72 -0
- package/build/browser/GenerateContext/EnhancedBase.js.map +1 -0
- package/build/{cjs/GenerateContext/EnhancedInterfaceType.d.cts → browser/GenerateContext/EnhancedInterfaceType.d.ts} +4 -4
- package/build/{cjs → browser}/GenerateContext/EnhancedInterfaceType.d.ts.map +1 -1
- package/build/browser/GenerateContext/EnhancedInterfaceType.js +38 -0
- package/build/browser/GenerateContext/EnhancedInterfaceType.js.map +1 -0
- package/build/{cjs/GenerateContext/EnhancedObjectType.d.cts → browser/GenerateContext/EnhancedObjectType.d.ts} +4 -4
- package/build/browser/GenerateContext/EnhancedObjectType.d.ts.map +1 -0
- package/build/browser/GenerateContext/EnhancedObjectType.js +35 -0
- package/build/browser/GenerateContext/EnhancedObjectType.js.map +1 -0
- package/build/{cjs/GenerateContext/EnhancedOntologyDefinition.d.cts → browser/GenerateContext/EnhancedOntologyDefinition.d.ts} +8 -8
- package/build/browser/GenerateContext/EnhancedOntologyDefinition.js +77 -0
- package/build/browser/GenerateContext/EnhancedOntologyDefinition.js.map +1 -0
- package/build/{cjs/GenerateContext/EnhancedQuery.d.cts → browser/GenerateContext/EnhancedQuery.d.ts} +2 -2
- package/build/browser/GenerateContext/EnhancedQuery.js +42 -0
- package/build/browser/GenerateContext/EnhancedQuery.js.map +1 -0
- package/build/{cjs/GenerateContext/EnhancedSharedPropertyType.d.cts → browser/GenerateContext/EnhancedSharedPropertyType.d.ts} +2 -2
- package/build/browser/GenerateContext/EnhancedSharedPropertyType.js +24 -0
- package/build/browser/GenerateContext/EnhancedSharedPropertyType.js.map +1 -0
- package/build/{cjs/GenerateContext/ForeignType.d.cts → browser/GenerateContext/ForeignType.d.ts} +2 -2
- package/build/browser/GenerateContext/ForeignType.js +36 -0
- package/build/browser/GenerateContext/ForeignType.js.map +1 -0
- package/build/{cjs/GenerateContext/GenerateContext.d.cts → browser/GenerateContext/GenerateContext.d.ts} +3 -3
- package/build/browser/GenerateContext/GenerateContext.js +17 -0
- package/build/browser/GenerateContext/GenerateContext.js.map +1 -0
- package/build/{cjs/GenerateContext/enhanceOntology.d.cts → browser/GenerateContext/enhanceOntology.d.ts} +2 -2
- package/build/browser/GenerateContext/enhanceOntology.js +20 -0
- package/build/browser/GenerateContext/enhanceOntology.js.map +1 -0
- package/build/browser/MinimalFs.js +17 -0
- package/build/browser/MinimalFs.js.map +1 -0
- package/build/browser/WireOntologyDefinition.js +17 -0
- package/build/browser/WireOntologyDefinition.js.map +1 -0
- package/build/{cjs/generateClientSdkPackage.d.cts → browser/generateClientSdkPackage.d.ts} +3 -8
- package/build/{cjs → browser}/generateClientSdkPackage.d.ts.map +1 -1
- package/build/browser/generateClientSdkPackage.js +126 -0
- package/build/browser/generateClientSdkPackage.js.map +1 -0
- package/build/browser/generateClientSdkPackage.test.js +67 -0
- package/build/browser/generateClientSdkPackage.test.js.map +1 -0
- package/build/{cjs/index.d.cts → browser/index.d.ts} +4 -4
- package/build/browser/index.js +17 -1553
- package/build/browser/index.js.map +1 -1
- package/build/browser/shared/apiNamespaces/startsWithApiNamespace.js +23 -0
- package/build/browser/shared/apiNamespaces/startsWithApiNamespace.js.map +1 -0
- package/build/browser/shared/apiNamespaces/startsWithApiNamespace.test.js +46 -0
- package/build/browser/shared/apiNamespaces/startsWithApiNamespace.test.js.map +1 -0
- package/build/{cjs/shared/getObjectImports.d.cts → browser/shared/getObjectImports.d.ts} +2 -2
- package/build/browser/shared/getObjectImports.js +24 -0
- package/build/browser/shared/getObjectImports.js.map +1 -0
- package/build/{cjs/shared/getObjectTypeApiNamesFromQuery.d.cts → browser/shared/getObjectTypeApiNamesFromQuery.d.ts} +1 -1
- package/build/browser/shared/getObjectTypeApiNamesFromQuery.js +27 -0
- package/build/browser/shared/getObjectTypeApiNamesFromQuery.js.map +1 -0
- package/build/browser/shared/getObjectTypesFromQueryDataType.js +57 -0
- package/build/browser/shared/getObjectTypesFromQueryDataType.js.map +1 -0
- package/build/browser/shared/propertyJsdoc.d.ts +6 -0
- package/build/browser/shared/propertyJsdoc.d.ts.map +1 -0
- package/build/browser/shared/propertyJsdoc.js +38 -0
- package/build/browser/shared/propertyJsdoc.js.map +1 -0
- package/build/browser/shared/sanitizeMetadata.js +33 -0
- package/build/browser/shared/sanitizeMetadata.js.map +1 -0
- package/build/browser/shared/sanitizeMetadata.test.js +44 -0
- package/build/browser/shared/sanitizeMetadata.test.js.map +1 -0
- package/build/{cjs/util/InMemoryFs.d.cts → browser/util/InMemoryFs.d.ts} +1 -1
- package/build/browser/util/InMemoryFs.js +30 -0
- package/build/browser/util/InMemoryFs.js.map +1 -0
- package/build/browser/util/commaSeparatedIdentifiers.js +25 -0
- package/build/browser/util/commaSeparatedIdentifiers.js.map +1 -0
- package/build/browser/util/commaSeparatedTypeIdentifiers.js +19 -0
- package/build/browser/util/commaSeparatedTypeIdentifiers.js.map +1 -0
- package/build/browser/util/deleteUndefineds.js +19 -0
- package/build/browser/util/deleteUndefineds.js.map +1 -0
- package/build/browser/util/reservedKeywords.js +21 -0
- package/build/browser/util/reservedKeywords.js.map +1 -0
- package/build/browser/util/stringUnionFrom.js +23 -0
- package/build/browser/util/stringUnionFrom.js.map +1 -0
- package/build/browser/util/stringify.js +36 -0
- package/build/browser/util/stringify.js.map +1 -0
- package/build/browser/util/test/TodoWireOntology.js +232 -0
- package/build/browser/util/test/TodoWireOntology.js.map +1 -0
- package/build/browser/util/test/compileThis.js +41 -0
- package/build/browser/util/test/compileThis.js.map +1 -0
- package/build/{cjs/util/test/createMockMinimalFiles.d.cts → browser/util/test/createMockMinimalFiles.d.ts} +1 -1
- package/build/browser/util/test/createMockMinimalFiles.js +37 -0
- package/build/browser/util/test/createMockMinimalFiles.js.map +1 -0
- package/build/browser/util/test/formatTs.js +32 -0
- package/build/browser/util/test/formatTs.js.map +1 -0
- package/build/{cjs/util/verifyOutDir.d.cts → browser/util/verifyOutDir.d.ts} +1 -1
- package/build/browser/util/verifyOutDir.js +35 -0
- package/build/browser/util/verifyOutDir.js.map +1 -0
- package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js +114 -0
- package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js.map +1 -0
- package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js +273 -0
- package/build/browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js.map +1 -0
- package/build/{cjs/v2.0/generateClientSdkVersionTwoPointZero.d.cts → browser/v2.0/generateClientSdkVersionTwoPointZero.d.ts} +2 -2
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.js +119 -0
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.js.map +1 -0
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.js +1939 -0
- package/build/browser/v2.0/generateClientSdkVersionTwoPointZero.test.js.map +1 -0
- package/build/{cjs/v2.0/generateMetadata.d.cts → browser/v2.0/generateMetadata.d.ts} +1 -1
- package/build/browser/v2.0/generateMetadata.js +35 -0
- package/build/browser/v2.0/generateMetadata.js.map +1 -0
- package/build/{cjs/v2.0/generatePerActionDataFiles.d.cts → browser/v2.0/generatePerActionDataFiles.d.ts} +1 -1
- package/build/{cjs → browser}/v2.0/generatePerActionDataFiles.d.ts.map +1 -1
- package/build/browser/v2.0/generatePerActionDataFiles.js +240 -0
- package/build/browser/v2.0/generatePerActionDataFiles.js.map +1 -0
- package/build/browser/v2.0/generatePerActionDataFiles.test.js +51 -0
- package/build/browser/v2.0/generatePerActionDataFiles.test.js.map +1 -0
- package/build/{cjs/v2.0/generatePerQueryDataFiles.d.cts → browser/v2.0/generatePerQueryDataFiles.d.ts} +3 -3
- package/build/{cjs → browser}/v2.0/generatePerQueryDataFiles.d.ts.map +1 -1
- package/build/browser/v2.0/generatePerQueryDataFiles.js +192 -0
- package/build/browser/v2.0/generatePerQueryDataFiles.js.map +1 -0
- package/build/browser/v2.0/generatePerQueryDataFiles.test.js +195 -0
- package/build/browser/v2.0/generatePerQueryDataFiles.test.js.map +1 -0
- package/build/browser/v2.0/getDescriptionIfPresent.js +24 -0
- package/build/browser/v2.0/getDescriptionIfPresent.js.map +1 -0
- package/build/{cjs/v2.0/wireObjectTypeV2ToSdkObjectConstV2.d.cts → browser/v2.0/wireObjectTypeV2ToSdkObjectConstV2.d.ts} +3 -3
- package/build/{cjs → browser}/v2.0/wireObjectTypeV2ToSdkObjectConstV2.d.ts.map +1 -1
- package/build/browser/v2.0/wireObjectTypeV2ToSdkObjectConstV2.js +205 -0
- package/build/browser/v2.0/wireObjectTypeV2ToSdkObjectConstV2.js.map +1 -0
- package/build/{cjs/validateWireOntologyAssumptions.d.cts → browser/validateWireOntologyAssumptions.d.ts} +1 -1
- package/build/browser/validateWireOntologyAssumptions.js +33 -0
- package/build/browser/validateWireOntologyAssumptions.js.map +1 -0
- package/build/esm/GenerateContext/EnhanceCommon.js +17 -0
- package/build/esm/GenerateContext/EnhanceCommon.js.map +1 -0
- package/build/esm/GenerateContext/EnhancedAction.js +42 -0
- package/build/esm/GenerateContext/EnhancedAction.js.map +1 -0
- package/build/esm/GenerateContext/EnhancedBase.d.ts.map +1 -1
- package/build/esm/GenerateContext/EnhancedBase.js +72 -0
- package/build/esm/GenerateContext/EnhancedBase.js.map +1 -0
- package/build/esm/GenerateContext/EnhancedInterfaceType.d.ts +2 -2
- package/build/esm/GenerateContext/EnhancedInterfaceType.d.ts.map +1 -1
- package/build/esm/GenerateContext/EnhancedInterfaceType.js +38 -0
- package/build/esm/GenerateContext/EnhancedInterfaceType.js.map +1 -0
- package/build/esm/GenerateContext/EnhancedObjectType.d.ts +2 -2
- package/build/esm/GenerateContext/EnhancedObjectType.d.ts.map +1 -1
- package/build/esm/GenerateContext/EnhancedObjectType.js +35 -0
- package/build/esm/GenerateContext/EnhancedObjectType.js.map +1 -0
- package/build/esm/GenerateContext/EnhancedOntologyDefinition.js +77 -0
- package/build/esm/GenerateContext/EnhancedOntologyDefinition.js.map +1 -0
- package/build/esm/GenerateContext/EnhancedQuery.js +42 -0
- package/build/esm/GenerateContext/EnhancedQuery.js.map +1 -0
- package/build/esm/GenerateContext/EnhancedSharedPropertyType.js +24 -0
- package/build/esm/GenerateContext/EnhancedSharedPropertyType.js.map +1 -0
- package/build/esm/GenerateContext/ForeignType.js +36 -0
- package/build/esm/GenerateContext/ForeignType.js.map +1 -0
- package/build/esm/GenerateContext/GenerateContext.js +17 -0
- package/build/esm/GenerateContext/GenerateContext.js.map +1 -0
- package/build/esm/GenerateContext/enhanceOntology.js +20 -0
- package/build/esm/GenerateContext/enhanceOntology.js.map +1 -0
- package/build/esm/MinimalFs.js +17 -0
- package/build/esm/MinimalFs.js.map +1 -0
- package/build/esm/WireOntologyDefinition.js +17 -0
- package/build/esm/WireOntologyDefinition.js.map +1 -0
- package/build/esm/generateClientSdkPackage.d.ts +1 -6
- package/build/esm/generateClientSdkPackage.d.ts.map +1 -1
- package/build/esm/generateClientSdkPackage.js +126 -0
- package/build/esm/generateClientSdkPackage.js.map +1 -0
- package/build/esm/generateClientSdkPackage.test.js +67 -0
- package/build/esm/generateClientSdkPackage.test.js.map +1 -0
- package/build/esm/index.js +17 -1553
- package/build/esm/index.js.map +1 -1
- package/build/esm/shared/apiNamespaces/startsWithApiNamespace.js +23 -0
- package/build/esm/shared/apiNamespaces/startsWithApiNamespace.js.map +1 -0
- package/build/esm/shared/apiNamespaces/startsWithApiNamespace.test.js +46 -0
- package/build/esm/shared/apiNamespaces/startsWithApiNamespace.test.js.map +1 -0
- package/build/esm/shared/getObjectImports.js +24 -0
- package/build/esm/shared/getObjectImports.js.map +1 -0
- package/build/esm/shared/getObjectTypeApiNamesFromQuery.js +27 -0
- package/build/esm/shared/getObjectTypeApiNamesFromQuery.js.map +1 -0
- package/build/esm/shared/getObjectTypesFromQueryDataType.js +57 -0
- package/build/esm/shared/getObjectTypesFromQueryDataType.js.map +1 -0
- package/build/esm/shared/propertyJsdoc.d.ts +2 -2
- package/build/esm/shared/propertyJsdoc.d.ts.map +1 -1
- package/build/esm/shared/propertyJsdoc.js +38 -0
- package/build/esm/shared/propertyJsdoc.js.map +1 -0
- package/build/esm/shared/sanitizeMetadata.js +33 -0
- package/build/esm/shared/sanitizeMetadata.js.map +1 -0
- package/build/esm/shared/sanitizeMetadata.test.js +44 -0
- package/build/esm/shared/sanitizeMetadata.test.js.map +1 -0
- package/build/esm/util/InMemoryFs.js +30 -0
- package/build/esm/util/InMemoryFs.js.map +1 -0
- package/build/esm/util/commaSeparatedIdentifiers.js +25 -0
- package/build/esm/util/commaSeparatedIdentifiers.js.map +1 -0
- package/build/esm/util/commaSeparatedTypeIdentifiers.js +19 -0
- package/build/esm/util/commaSeparatedTypeIdentifiers.js.map +1 -0
- package/build/esm/util/deleteUndefineds.js +19 -0
- package/build/esm/util/deleteUndefineds.js.map +1 -0
- package/build/esm/util/reservedKeywords.js +21 -0
- package/build/esm/util/reservedKeywords.js.map +1 -0
- package/build/esm/util/stringUnionFrom.js +23 -0
- package/build/esm/util/stringUnionFrom.js.map +1 -0
- package/build/esm/util/stringify.js +36 -0
- package/build/esm/util/stringify.js.map +1 -0
- package/build/esm/util/test/TodoWireOntology.js +232 -0
- package/build/esm/util/test/TodoWireOntology.js.map +1 -0
- package/build/esm/util/test/compileThis.js +41 -0
- package/build/esm/util/test/compileThis.js.map +1 -0
- package/build/esm/util/test/createMockMinimalFiles.js +37 -0
- package/build/esm/util/test/createMockMinimalFiles.js.map +1 -0
- package/build/esm/util/test/formatTs.js +32 -0
- package/build/esm/util/test/formatTs.js.map +1 -0
- package/build/esm/util/verifyOutDir.js +35 -0
- package/build/esm/util/verifyOutDir.js.map +1 -0
- package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js +114 -0
- package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js.map +1 -0
- package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js +273 -0
- package/build/esm/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js.map +1 -0
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.js +119 -0
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.js.map +1 -0
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.js +1939 -0
- package/build/esm/v2.0/generateClientSdkVersionTwoPointZero.test.js.map +1 -0
- package/build/esm/v2.0/generateMetadata.js +35 -0
- package/build/esm/v2.0/generateMetadata.js.map +1 -0
- package/build/esm/v2.0/generatePerActionDataFiles.d.ts.map +1 -1
- package/build/esm/v2.0/generatePerActionDataFiles.js +240 -0
- package/build/esm/v2.0/generatePerActionDataFiles.js.map +1 -0
- package/build/esm/v2.0/generatePerActionDataFiles.test.js +51 -0
- package/build/esm/v2.0/generatePerActionDataFiles.test.js.map +1 -0
- package/build/esm/v2.0/generatePerQueryDataFiles.d.ts +1 -1
- package/build/esm/v2.0/generatePerQueryDataFiles.d.ts.map +1 -1
- package/build/esm/v2.0/generatePerQueryDataFiles.js +192 -0
- package/build/esm/v2.0/generatePerQueryDataFiles.js.map +1 -0
- package/build/esm/v2.0/generatePerQueryDataFiles.test.js +195 -0
- package/build/esm/v2.0/generatePerQueryDataFiles.test.js.map +1 -0
- package/build/esm/v2.0/getDescriptionIfPresent.js +24 -0
- package/build/esm/v2.0/getDescriptionIfPresent.js.map +1 -0
- package/build/esm/v2.0/wireObjectTypeV2ToSdkObjectConstV2.d.ts.map +1 -1
- package/build/esm/v2.0/wireObjectTypeV2ToSdkObjectConstV2.js +205 -0
- package/build/esm/v2.0/wireObjectTypeV2ToSdkObjectConstV2.js.map +1 -0
- package/build/esm/validateWireOntologyAssumptions.js +33 -0
- package/build/esm/validateWireOntologyAssumptions.js.map +1 -0
- package/package.json +9 -14
- package/build/cjs/GenerateContext/EnhancedObjectType.d.ts.map +0 -1
- package/build/cjs/index.cjs +0 -1582
- package/build/cjs/index.cjs.map +0 -1
- package/build/cjs/shared/getEditedEntities.d.cts +0 -7
- package/build/cjs/shared/getEditedEntities.d.ts.map +0 -1
- package/build/cjs/shared/isNullableQueryDataType.d.cts +0 -3
- package/build/cjs/shared/isNullableQueryDataType.d.ts.map +0 -1
- package/build/cjs/shared/propertyJsdoc.d.cts +0 -6
- package/build/cjs/shared/propertyJsdoc.d.ts.map +0 -1
- package/build/cjs/shared/wireActionTypeV2ToSdkActionDefinition.d.cts +0 -4
- package/build/cjs/shared/wireActionTypeV2ToSdkActionDefinition.d.ts.map +0 -1
- package/build/cjs/shared/wireQueryDataTypeToQueryDataTypeDefinition.d.cts +0 -4
- package/build/cjs/shared/wireQueryDataTypeToQueryDataTypeDefinition.d.ts.map +0 -1
- package/build/cjs/shared/wireQueryTypeV2ToSdkQueryDefinition.d.cts +0 -12
- package/build/cjs/shared/wireQueryTypeV2ToSdkQueryDefinition.d.ts.map +0 -1
- package/build/esm/shared/getEditedEntities.d.ts +0 -7
- package/build/esm/shared/getEditedEntities.d.ts.map +0 -1
- package/build/esm/shared/isNullableQueryDataType.d.ts +0 -3
- package/build/esm/shared/isNullableQueryDataType.d.ts.map +0 -1
- package/build/esm/shared/wireActionTypeV2ToSdkActionDefinition.d.ts +0 -4
- package/build/esm/shared/wireActionTypeV2ToSdkActionDefinition.d.ts.map +0 -1
- package/build/esm/shared/wireQueryDataTypeToQueryDataTypeDefinition.d.ts +0 -4
- package/build/esm/shared/wireQueryDataTypeToQueryDataTypeDefinition.d.ts.map +0 -1
- package/build/esm/shared/wireQueryTypeV2ToSdkQueryDefinition.d.ts +0 -12
- package/build/esm/shared/wireQueryTypeV2ToSdkQueryDefinition.d.ts.map +0 -1
- /package/build/{cjs → browser}/GenerateContext/EnhanceCommon.d.ts.map +0 -0
- /package/build/{cjs → browser}/GenerateContext/EnhancedAction.d.ts.map +0 -0
- /package/build/{cjs → browser}/GenerateContext/EnhancedOntologyDefinition.d.ts.map +0 -0
- /package/build/{cjs → browser}/GenerateContext/EnhancedQuery.d.ts.map +0 -0
- /package/build/{cjs → browser}/GenerateContext/EnhancedSharedPropertyType.d.ts.map +0 -0
- /package/build/{cjs → browser}/GenerateContext/ForeignType.d.ts.map +0 -0
- /package/build/{cjs → browser}/GenerateContext/GenerateContext.d.ts.map +0 -0
- /package/build/{cjs → browser}/GenerateContext/enhanceOntology.d.ts.map +0 -0
- /package/build/{cjs/MinimalFs.d.cts → browser/MinimalFs.d.ts} +0 -0
- /package/build/{cjs → browser}/MinimalFs.d.ts.map +0 -0
- /package/build/{cjs/WireOntologyDefinition.d.cts → browser/WireOntologyDefinition.d.ts} +0 -0
- /package/build/{cjs → browser}/WireOntologyDefinition.d.ts.map +0 -0
- /package/build/{cjs/generateClientSdkPackage.test.d.cts → browser/generateClientSdkPackage.test.d.ts} +0 -0
- /package/build/{cjs → browser}/generateClientSdkPackage.test.d.ts.map +0 -0
- /package/build/{cjs → browser}/index.d.ts.map +0 -0
- /package/build/{cjs/shared/apiNamespaces/startsWithApiNamespace.d.cts → browser/shared/apiNamespaces/startsWithApiNamespace.d.ts} +0 -0
- /package/build/{cjs → browser}/shared/apiNamespaces/startsWithApiNamespace.d.ts.map +0 -0
- /package/build/{cjs/shared/apiNamespaces/startsWithApiNamespace.test.d.cts → browser/shared/apiNamespaces/startsWithApiNamespace.test.d.ts} +0 -0
- /package/build/{cjs → browser}/shared/apiNamespaces/startsWithApiNamespace.test.d.ts.map +0 -0
- /package/build/{cjs → browser}/shared/getObjectImports.d.ts.map +0 -0
- /package/build/{cjs → browser}/shared/getObjectTypeApiNamesFromQuery.d.ts.map +0 -0
- /package/build/{cjs/shared/getObjectTypesFromQueryDataType.d.cts → browser/shared/getObjectTypesFromQueryDataType.d.ts} +0 -0
- /package/build/{cjs → browser}/shared/getObjectTypesFromQueryDataType.d.ts.map +0 -0
- /package/build/{cjs/shared/sanitizeMetadata.d.cts → browser/shared/sanitizeMetadata.d.ts} +0 -0
- /package/build/{cjs → browser}/shared/sanitizeMetadata.d.ts.map +0 -0
- /package/build/{cjs/shared/sanitizeMetadata.test.d.cts → browser/shared/sanitizeMetadata.test.d.ts} +0 -0
- /package/build/{cjs → browser}/shared/sanitizeMetadata.test.d.ts.map +0 -0
- /package/build/{cjs → browser}/util/InMemoryFs.d.ts.map +0 -0
- /package/build/{cjs/util/commaSeparatedIdentifiers.d.cts → browser/util/commaSeparatedIdentifiers.d.ts} +0 -0
- /package/build/{cjs → browser}/util/commaSeparatedIdentifiers.d.ts.map +0 -0
- /package/build/{cjs/util/commaSeparatedTypeIdentifiers.d.cts → browser/util/commaSeparatedTypeIdentifiers.d.ts} +0 -0
- /package/build/{cjs → browser}/util/commaSeparatedTypeIdentifiers.d.ts.map +0 -0
- /package/build/{cjs/util/deleteUndefineds.d.cts → browser/util/deleteUndefineds.d.ts} +0 -0
- /package/build/{cjs → browser}/util/deleteUndefineds.d.ts.map +0 -0
- /package/build/{cjs/util/reservedKeywords.d.cts → browser/util/reservedKeywords.d.ts} +0 -0
- /package/build/{cjs → browser}/util/reservedKeywords.d.ts.map +0 -0
- /package/build/{cjs/util/stringUnionFrom.d.cts → browser/util/stringUnionFrom.d.ts} +0 -0
- /package/build/{cjs → browser}/util/stringUnionFrom.d.ts.map +0 -0
- /package/build/{cjs/util/stringify.d.cts → browser/util/stringify.d.ts} +0 -0
- /package/build/{cjs → browser}/util/stringify.d.ts.map +0 -0
- /package/build/{cjs/util/test/TodoWireOntology.d.cts → browser/util/test/TodoWireOntology.d.ts} +0 -0
- /package/build/{cjs → browser}/util/test/TodoWireOntology.d.ts.map +0 -0
- /package/build/{cjs/util/test/compileThis.d.cts → browser/util/test/compileThis.d.ts} +0 -0
- /package/build/{cjs → browser}/util/test/compileThis.d.ts.map +0 -0
- /package/build/{cjs → browser}/util/test/createMockMinimalFiles.d.ts.map +0 -0
- /package/build/{cjs/util/test/formatTs.d.cts → browser/util/test/formatTs.d.ts} +0 -0
- /package/build/{cjs → browser}/util/test/formatTs.d.ts.map +0 -0
- /package/build/{cjs → browser}/util/verifyOutDir.d.ts.map +0 -0
- /package/build/{cjs/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.d.cts → browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.d.ts} +0 -0
- /package/build/{cjs → browser}/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.d.ts.map +0 -0
- /package/build/{cjs/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.cts → browser/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts} +0 -0
- /package/build/{cjs → browser}/v2.0/UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.d.ts.map +0 -0
- /package/build/{cjs → browser}/v2.0/generateClientSdkVersionTwoPointZero.d.ts.map +0 -0
- /package/build/{cjs/v2.0/generateClientSdkVersionTwoPointZero.test.d.cts → browser/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts} +0 -0
- /package/build/{cjs → browser}/v2.0/generateClientSdkVersionTwoPointZero.test.d.ts.map +0 -0
- /package/build/{cjs → browser}/v2.0/generateMetadata.d.ts.map +0 -0
- /package/build/{cjs/v2.0/generatePerActionDataFiles.test.d.cts → browser/v2.0/generatePerActionDataFiles.test.d.ts} +0 -0
- /package/build/{cjs → browser}/v2.0/generatePerActionDataFiles.test.d.ts.map +0 -0
- /package/build/{cjs/v2.0/generatePerQueryDataFiles.test.d.cts → browser/v2.0/generatePerQueryDataFiles.test.d.ts} +0 -0
- /package/build/{cjs → browser}/v2.0/generatePerQueryDataFiles.test.d.ts.map +0 -0
- /package/build/{cjs/v2.0/getDescriptionIfPresent.d.cts → browser/v2.0/getDescriptionIfPresent.d.ts} +0 -0
- /package/build/{cjs → browser}/v2.0/getDescriptionIfPresent.d.ts.map +0 -0
- /package/build/{cjs → browser}/validateWireOntologyAssumptions.d.ts.map +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import * as ts from "typescript";
|
|
17
|
+
export function compileThis(files, basePath) {
|
|
18
|
+
const compilerOptions = {
|
|
19
|
+
noEmit: true,
|
|
20
|
+
target: ts.ScriptTarget.ES2020
|
|
21
|
+
};
|
|
22
|
+
const host = ts.createCompilerHost(compilerOptions);
|
|
23
|
+
const originalReadFile = host.readFile;
|
|
24
|
+
host.readFile = filename => {
|
|
25
|
+
if (filename.startsWith(basePath)) {
|
|
26
|
+
return files[filename];
|
|
27
|
+
} else {
|
|
28
|
+
return originalReadFile(filename);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
host.writeFile = () => {
|
|
32
|
+
throw new Error("File writes not allowed");
|
|
33
|
+
};
|
|
34
|
+
const program = ts.createProgram({
|
|
35
|
+
options: compilerOptions,
|
|
36
|
+
host,
|
|
37
|
+
rootNames: ["/foo/index.ts"]
|
|
38
|
+
});
|
|
39
|
+
return ts.getPreEmitDiagnostics(program);
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=compileThis.js.map
|
|
@@ -0,0 +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.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 * as ts from \"typescript\";\nexport function compileThis(files, basePath) {\n const compilerOptions = {\n noEmit: true,\n target: ts.ScriptTarget.ES2020,\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 }\n else {\n return originalReadFile(filename);\n }\n };\n host.writeFile = () => {\n throw new Error(\"File writes not allowed\");\n };\n const program = ts.createProgram({\n options: compilerOptions,\n host,\n rootNames: [\"/foo/index.ts\"],\n });\n return ts.getPreEmitDiagnostics(program);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKA,EAAE,MAAM,YAAY;AAChC,OAAO,SAASC,WAAWA,CAACC,KAAK,EAAEC,QAAQ,EAAE;EACzC,MAAMC,eAAe,GAAG;IACpBC,MAAM,EAAE,IAAI;IACZC,MAAM,EAAEN,EAAE,CAACO,YAAY,CAACC;EAC5B,CAAC;EACD,MAAMC,IAAI,GAAGT,EAAE,CAACU,kBAAkB,CAACN,eAAe,CAAC;EACnD,MAAMO,gBAAgB,GAAGF,IAAI,CAACG,QAAQ;EACtCH,IAAI,CAACG,QAAQ,GAAIC,QAAQ,IAAK;IAC1B,IAAIA,QAAQ,CAACC,UAAU,CAACX,QAAQ,CAAC,EAAE;MAC/B,OAAOD,KAAK,CAACW,QAAQ,CAAC;IAC1B,CAAC,MACI;MACD,OAAOF,gBAAgB,CAACE,QAAQ,CAAC;IACrC;EACJ,CAAC;EACDJ,IAAI,CAACM,SAAS,GAAG,MAAM;IACnB,MAAM,IAAIC,KAAK,CAAC,yBAAyB,CAAC;EAC9C,CAAC;EACD,MAAMC,OAAO,GAAGjB,EAAE,CAACkB,aAAa,CAAC;IAC7BC,OAAO,EAAEf,eAAe;IACxBK,IAAI;IACJW,SAAS,EAAE,CAAC,eAAe;EAC/B,CAAC,CAAC;EACF,OAAOpB,EAAE,CAACqB,qBAAqB,CAACJ,OAAO,CAAC;AAC5C","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { vi } from "vitest";
|
|
17
|
+
export function createMockMinimalFiles() {
|
|
18
|
+
const writeFile = vi.fn(() => Promise.resolve());
|
|
19
|
+
const getFiles = () => Object.fromEntries(writeFile.mock.calls);
|
|
20
|
+
const readdir = vi.fn(() => Promise.resolve([]));
|
|
21
|
+
return {
|
|
22
|
+
minimalFiles: {
|
|
23
|
+
writeFile: writeFile,
|
|
24
|
+
mkdir: () => Promise.resolve(),
|
|
25
|
+
readdir: readdir
|
|
26
|
+
},
|
|
27
|
+
getFiles,
|
|
28
|
+
dumpFilesToConsole: () => {
|
|
29
|
+
for (const [path, contents] of Object.entries(getFiles())) {
|
|
30
|
+
console.group(path);
|
|
31
|
+
console.log(contents);
|
|
32
|
+
console.groupEnd();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=createMockMinimalFiles.js.map
|
|
@@ -0,0 +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.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 { vi } from \"vitest\";\nexport function createMockMinimalFiles() {\n const writeFile = vi.fn(() => Promise.resolve());\n const getFiles = () => Object.fromEntries(writeFile.mock.calls);\n const readdir = vi.fn(() => Promise.resolve([]));\n return {\n minimalFiles: {\n writeFile: writeFile,\n mkdir: () => Promise.resolve(),\n readdir: readdir,\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;AACA,SAASA,EAAE,QAAQ,QAAQ;AAC3B,OAAO,SAASC,sBAAsBA,CAAA,EAAG;EACrC,MAAMC,SAAS,GAAGF,EAAE,CAACG,EAAE,CAAC,MAAMC,OAAO,CAACC,OAAO,CAAC,CAAC,CAAC;EAChD,MAAMC,QAAQ,GAAGA,CAAA,KAAMC,MAAM,CAACC,WAAW,CAACN,SAAS,CAACO,IAAI,CAACC,KAAK,CAAC;EAC/D,MAAMC,OAAO,GAAGX,EAAE,CAACG,EAAE,CAAC,MAAMC,OAAO,CAACC,OAAO,CAAC,EAAE,CAAC,CAAC;EAChD,OAAO;IACHO,YAAY,EAAE;MACVV,SAAS,EAAEA,SAAS;MACpBW,KAAK,EAAEA,CAAA,KAAMT,OAAO,CAACC,OAAO,CAAC,CAAC;MAC9BM,OAAO,EAAEA;IACb,CAAC;IACDL,QAAQ;IACRQ,kBAAkB,EAAEA,CAAA,KAAM;MACtB,KAAK,MAAM,CAACC,IAAI,EAAEC,QAAQ,CAAC,IAAIT,MAAM,CAACU,OAAO,CAACX,QAAQ,CAAC,CAAC,CAAC,EAAE;QACvDY,OAAO,CAACC,KAAK,CAACJ,IAAI,CAAC;QACnBG,OAAO,CAACE,GAAG,CAACJ,QAAQ,CAAC;QACrBE,OAAO,CAACG,QAAQ,CAAC,CAAC;MACtB;IACJ;EACJ,CAAC;AACL","ignoreList":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { format } from "prettier";
|
|
17
|
+
export function formatTs(contents) {
|
|
18
|
+
try {
|
|
19
|
+
return format(contents, {
|
|
20
|
+
parser: "typescript",
|
|
21
|
+
singleQuote: true,
|
|
22
|
+
trailingComma: "all",
|
|
23
|
+
tabWidth: 2,
|
|
24
|
+
printWidth: 120
|
|
25
|
+
});
|
|
26
|
+
} catch (e) {
|
|
27
|
+
console.error("Failed to format file", e);
|
|
28
|
+
console.log(contents);
|
|
29
|
+
return contents;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=formatTs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatTs.js","names":["format","formatTs","contents","parser","singleQuote","trailingComma","tabWidth","printWidth","e","console","error","log"],"sources":["formatTs.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 { format } from \"prettier\";\nexport function formatTs(contents) {\n try {\n return format(contents, {\n parser: \"typescript\",\n singleQuote: true,\n trailingComma: \"all\",\n tabWidth: 2,\n printWidth: 120,\n });\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;AACA,SAASA,MAAM,QAAQ,UAAU;AACjC,OAAO,SAASC,QAAQA,CAACC,QAAQ,EAAE;EAC/B,IAAI;IACA,OAAOF,MAAM,CAACE,QAAQ,EAAE;MACpBC,MAAM,EAAE,YAAY;MACpBC,WAAW,EAAE,IAAI;MACjBC,aAAa,EAAE,KAAK;MACpBC,QAAQ,EAAE,CAAC;MACXC,UAAU,EAAE;IAChB,CAAC,CAAC;EACN,CAAC,CACD,OAAOC,CAAC,EAAE;IACNC,OAAO,CAACC,KAAK,CAAC,uBAAuB,EAAEF,CAAC,CAAC;IACzCC,OAAO,CAACE,GAAG,CAACT,QAAQ,CAAC;IACrB,OAAOA,QAAQ;EACnB;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Verify that the target outDir does not yet exist OR is empty.
|
|
18
|
+
*
|
|
19
|
+
* Re-generating an ontology on top of itself is not supported and may leave old
|
|
20
|
+
* files around or refuse to update files with new contents in some cases.
|
|
21
|
+
*/
|
|
22
|
+
export async function verifyOutDir(outDir, fs) {
|
|
23
|
+
// if outDir exists and is not empty, we cannot proceed with the generation
|
|
24
|
+
try {
|
|
25
|
+
const contents = await fs.readdir(outDir);
|
|
26
|
+
if (contents.length !== 0) {
|
|
27
|
+
throw new Error(`outDir ${outDir} is not empty, please delete its contents and try again`);
|
|
28
|
+
}
|
|
29
|
+
} catch (e) {
|
|
30
|
+
if (!(e.code === "ENOENT")) {
|
|
31
|
+
throw e;
|
|
32
|
+
} // acceptable, we'll create the directory ourselves
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=verifyOutDir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifyOutDir.js","names":["verifyOutDir","outDir","fs","contents","readdir","length","Error","e","code"],"sources":["verifyOutDir.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 */\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(outDir, fs) {\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(`outDir ${outDir} is not empty, please delete its contents and try again`);\n }\n }\n catch (e) {\n if (e.code === \"ENOENT\") {\n // acceptable, we'll create the directory ourselves\n }\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;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeA,YAAYA,CAACC,MAAM,EAAEC,EAAE,EAAE;EAC3C;EACA,IAAI;IACA,MAAMC,QAAQ,GAAG,MAAMD,EAAE,CAACE,OAAO,CAACH,MAAM,CAAC;IACzC,IAAIE,QAAQ,CAACE,MAAM,KAAK,CAAC,EAAE;MACvB,MAAM,IAAIC,KAAK,CAAC,UAAUL,MAAM,yDAAyD,CAAC;IAC9F;EACJ,CAAC,CACD,OAAOM,CAAC,EAAE;IACN,MAAIA,CAAC,CAACC,IAAI,KAAK,QAAQ,GAGlB;MACD,MAAMD,CAAC;IACX,CAAC,CAJG;EAKR;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition } from "@osdk/generator-converters";
|
|
17
|
+
import fastDeepEqual from "fast-deep-equal";
|
|
18
|
+
import invariant from "tiny-invariant";
|
|
19
|
+
import { propertyJsdoc } from "../shared/propertyJsdoc.js";
|
|
20
|
+
import { deleteUndefineds } from "../util/deleteUndefineds.js";
|
|
21
|
+
import { stringify } from "../util/stringify.js";
|
|
22
|
+
import { createDefinition, createObjectSet, createOsdkObject, createPropertyKeys, createProps } from "./wireObjectTypeV2ToSdkObjectConstV2.js";
|
|
23
|
+
/** @internal */
|
|
24
|
+
export function __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(interfaceDef, ontology, v2 = false) {
|
|
25
|
+
const definition = deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceDef.raw, v2));
|
|
26
|
+
const objectDefIdentifier = interfaceDef.getDefinitionIdentifier(v2);
|
|
27
|
+
const parents = definition.implements?.map(p => {
|
|
28
|
+
!(ontology.interfaceTypes[p] != null) ? invariant(false, `Expected to find a parent interface named ${p} in the ontology and did not.`) : void 0;
|
|
29
|
+
const it = deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(ontology.requireInterfaceType(p, true).raw, v2));
|
|
30
|
+
return it;
|
|
31
|
+
}) ?? [];
|
|
32
|
+
const mergedProperties = {
|
|
33
|
+
...definition.properties
|
|
34
|
+
};
|
|
35
|
+
for (const parent of parents) {
|
|
36
|
+
for (const apiName of Object.keys(parent.properties)) {
|
|
37
|
+
if (definition.properties[apiName] != null) {
|
|
38
|
+
!fastDeepEqual(definition.properties[apiName], parent.properties[apiName]) ? invariant(false, `Interface ${definition.apiName} redefines property '${apiName}' from parent '${parent.apiName}' but the properties do not match`) : void 0;
|
|
39
|
+
} else if (mergedProperties[apiName] != null) {
|
|
40
|
+
!fastDeepEqual(mergedProperties[apiName], parent.properties[apiName]) ? invariant(false, `Some interface defines a conflicting property '${apiName}' that does not match property from parent '${parent.apiName}'`) : void 0;
|
|
41
|
+
}
|
|
42
|
+
mergedProperties[apiName] = parent.properties[apiName];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const ogProperties = definition.properties;
|
|
46
|
+
definition.properties = mergedProperties;
|
|
47
|
+
const objectSetIdentifier = `${interfaceDef.shortApiName}.ObjectSet`;
|
|
48
|
+
const propertyKeysIdentifier = `${interfaceDef.shortApiName}.PropertyKeys`;
|
|
49
|
+
// const osdkObjectPropsIdentifier = `OsdkObjectProps$${objectDefIdentifier}`;
|
|
50
|
+
const osdkObjectPropsIdentifier = `${interfaceDef.shortApiName}.Props`;
|
|
51
|
+
const osdkObjectStrictPropsIdentifier = `${interfaceDef.shortApiName}.StrictProps`;
|
|
52
|
+
const osdkObjectLinksIdentifier = `OsdkObjectLinks$${objectDefIdentifier}`;
|
|
53
|
+
const osdkObjectIdentifier = `${interfaceDef.shortApiName}.OsdkObject`;
|
|
54
|
+
const ids = {
|
|
55
|
+
objectDefIdentifier: interfaceDef.shortApiName,
|
|
56
|
+
osdkObjectLinksIdentifier,
|
|
57
|
+
osdkObjectPropsIdentifier,
|
|
58
|
+
osdkObjectStrictPropsIdentifier,
|
|
59
|
+
objectSetIdentifier,
|
|
60
|
+
osdkObjectIdentifier,
|
|
61
|
+
propertyKeysIdentifier
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// FIXME: We need to fill in the imports
|
|
65
|
+
// if we want links to work
|
|
66
|
+
|
|
67
|
+
return `${[].join("\n")}
|
|
68
|
+
${v2 ? function () {
|
|
69
|
+
return `import type {
|
|
70
|
+
InterfaceDefinition as $InterfaceDefinition,
|
|
71
|
+
ObjectSet as $ObjectSet,
|
|
72
|
+
Osdk as $Osdk,
|
|
73
|
+
PropertyValueWireToClient as $PropType,
|
|
74
|
+
} from "@osdk/api";
|
|
75
|
+
|
|
76
|
+
${Object.keys(definition.links).length === 0 ? `export type ${osdkObjectLinksIdentifier} = {};` : `
|
|
77
|
+
export interface ${osdkObjectLinksIdentifier} {
|
|
78
|
+
${stringify(definition.links, {
|
|
79
|
+
"*": definition => {
|
|
80
|
+
const linkTarget = ontology.requireObjectType(definition.targetType).getImportedDefinitionIdentifier(v2);
|
|
81
|
+
return `${definition.multiplicity ? `${linkTarget}["objectSet"]` : `SingleLinkAccessor<${linkTarget}>`}
|
|
82
|
+
`;
|
|
83
|
+
}
|
|
84
|
+
})}
|
|
85
|
+
}
|
|
86
|
+
`}
|
|
87
|
+
|
|
88
|
+
export namespace ${interfaceDef.shortApiName} {
|
|
89
|
+
|
|
90
|
+
${createPropertyKeys(interfaceDef)}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
${createProps(interfaceDef, "Props", false)}
|
|
94
|
+
${createProps(interfaceDef, "StrictProps", true)}
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
${createObjectSet(interfaceDef, ids)}
|
|
98
|
+
|
|
99
|
+
${createOsdkObject(interfaceDef, "OsdkObject", ids)}
|
|
100
|
+
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
${createDefinition(interfaceDef, ontology, interfaceDef.shortApiName, ids)}
|
|
104
|
+
|
|
105
|
+
`;
|
|
106
|
+
}() : ""}
|
|
107
|
+
|
|
108
|
+
export const ${interfaceDef.shortApiName}: ${interfaceDef.shortApiName} = {
|
|
109
|
+
type: "interface",
|
|
110
|
+
apiName: "${interfaceDef.fullApiName}",
|
|
111
|
+
osdkMetadata: $osdkMetadata,
|
|
112
|
+
};`;
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js","names":["__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition","fastDeepEqual","invariant","propertyJsdoc","deleteUndefineds","stringify","createDefinition","createObjectSet","createOsdkObject","createPropertyKeys","createProps","__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst","interfaceDef","ontology","v2","definition","raw","objectDefIdentifier","getDefinitionIdentifier","parents","implements","map","p","interfaceTypes","it","requireInterfaceType","mergedProperties","properties","parent","apiName","Object","keys","ogProperties","objectSetIdentifier","shortApiName","propertyKeysIdentifier","osdkObjectPropsIdentifier","osdkObjectStrictPropsIdentifier","osdkObjectLinksIdentifier","osdkObjectIdentifier","ids","join","links","length","linkTarget","requireObjectType","targetType","getImportedDefinitionIdentifier","multiplicity","fullApiName"],"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 { propertyJsdoc } from \"../shared/propertyJsdoc.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) {\n const definition = deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(interfaceDef.raw, v2));\n const objectDefIdentifier = interfaceDef.getDefinitionIdentifier(v2);\n const parents = definition.implements?.map(p => {\n invariant(ontology.interfaceTypes[p] != null, `Expected to find a parent interface named ${p} in the ontology and did not.`);\n const it = deleteUndefineds(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectDefinition(ontology.requireInterfaceType(p, true).raw, v2));\n return it;\n }) ?? [];\n const mergedProperties = { ...definition.properties };\n for (const parent of parents) {\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 const ogProperties = definition.properties;\n definition.properties = mergedProperties;\n function localPropertyJsdoc(apiName) {\n const property = definition.properties[apiName];\n const isInherited = ogProperties[apiName] == null;\n return propertyJsdoc(property, { isInherited, apiName });\n }\n function maybeStripNamespace(q) {\n if (interfaceDef.apiNamespace && q.startsWith(`${interfaceDef.apiNamespace}.`)) {\n return q.slice(interfaceDef.apiNamespace.length + 1);\n }\n else {\n return q;\n }\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 = `${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 function getV2Types() {\n return `import type {\n InterfaceDefinition as $InterfaceDefinition,\n ObjectSet as $ObjectSet, \n Osdk as $Osdk,\n PropertyValueWireToClient as $PropType,\n } from \"@osdk/api\";\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, \"OsdkObject\", 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() : \"\"}\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;AACA,SAASA,mDAAmD,QAAQ,4BAA4B;AAChG,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,SAAS,MAAM,gBAAgB;AACtC,SAASC,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,SAAS,QAAQ,sBAAsB;AAChD,SAASC,gBAAgB,EAAEC,eAAe,EAAEC,gBAAgB,EAAEC,kBAAkB,EAAEC,WAAW,QAAS,yCAAyC;AAC/I;AACA,OAAO,SAASC,8CAA8CA,CAACC,YAAY,EAA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AiB,CAAC9B,UAAU,CAAC+B,UAAU,CAAC,CAC/DC,+BAA+B,CAACjC,EAAE,CAAC;QACxC,OAAO,GAAGC,UAAU,CAACiC,YAAY,GAC3B,GAAGJ,UAAU,eAAe,GAC5B,sBAAsBA,UAAU,GAAG;AAC7D,WAAW;MACK;IACJ,CAAC,CAAC;AACd;AACA,KAAK;AACL;AACA,uBAAuBhC,YAAY,CAACsB,YAAY;AAChD;AACA,QAAQzB,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,EAAE4B,GAAG,CAAC;AAC1C;AACA,QAAQhC,gBAAgB,CAACI,YAAY,EAAE,YAAY,EAAE4B,GAAG,CAAC;AACzD;AACA;AACA;AACA,MAAMlC,gBAAgB,CAACM,YAAY,EAAEC,QAAQ,EAAED,YAAY,CAACsB,YAAY,EAAEM,GAAG,CAAC;AAC9E;AACA,CAAC;EACG,CAAC,CAMiB,CAAC,GAAG,EAAE;AAC5B;AACA,mBAAmB5B,YAAY,CAACsB,YAAY,KAAKtB,YAAY,CAACsB,YAAY;AAC1E;AACA,kBAAkBtB,YAAY,CAACqC,WAAW;AAC1C;AACA,UAAU;AACV","ignoreList":[]}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { format } from "prettier";
|
|
17
|
+
import { describe, expect, it } from "vitest";
|
|
18
|
+
import { enhanceOntology } from "../GenerateContext/enhanceOntology.js";
|
|
19
|
+
import { __UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst } from "./UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.js";
|
|
20
|
+
function simpleSpt(apiName, metadataLevel = 2) {
|
|
21
|
+
return {
|
|
22
|
+
apiName,
|
|
23
|
+
dataType: {
|
|
24
|
+
type: "integer"
|
|
25
|
+
},
|
|
26
|
+
rid: `${apiName}Rid`,
|
|
27
|
+
displayName: metadataLevel >= 1 ? `${apiName} property dn` : apiName,
|
|
28
|
+
description: metadataLevel >= 2 ? `${apiName} property desc` : undefined
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function simpleInterface(apiName, spts, parents, metadataLevel = 2) {
|
|
32
|
+
const properties = Object.fromEntries(spts.map(spt => [spt.apiName, spt]));
|
|
33
|
+
return {
|
|
34
|
+
apiName,
|
|
35
|
+
rid: `${apiName}Rid`,
|
|
36
|
+
displayName: metadataLevel >= 1 ? `${apiName} interface dn` : apiName,
|
|
37
|
+
description: metadataLevel >= 2 ? `${apiName} interface desc` : undefined,
|
|
38
|
+
extendsInterfaces: parents,
|
|
39
|
+
links: {},
|
|
40
|
+
properties
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function simpleOntology(apiName, interfaces) {
|
|
44
|
+
const interfaceTypes = Object.fromEntries(interfaces.map(i => [i.apiName, i]));
|
|
45
|
+
const sharedPropertyTypes = Object.fromEntries(interfaces.flatMap(i => Object.entries(i.properties)));
|
|
46
|
+
return {
|
|
47
|
+
actionTypes: {},
|
|
48
|
+
interfaceTypes,
|
|
49
|
+
objectTypes: {},
|
|
50
|
+
ontology: {
|
|
51
|
+
apiName,
|
|
52
|
+
description: `${apiName} ontology desc`,
|
|
53
|
+
displayName: `${apiName} ontology dn`,
|
|
54
|
+
rid: `${apiName} ontology rid`
|
|
55
|
+
},
|
|
56
|
+
queryTypes: {},
|
|
57
|
+
sharedPropertyTypes
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
describe(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst, () => {
|
|
61
|
+
it("Does not say (inherited) on properties locally defined", async () => {
|
|
62
|
+
const ontology = enhanceOntology(simpleOntology("ontology", [simpleInterface("Bar", [simpleSpt("bar", 0)], [], 0)]), undefined, new Map(), "");
|
|
63
|
+
const formattedCode = await format(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(ontology.interfaceTypes.Bar, ontology, true), {
|
|
64
|
+
parser: "typescript",
|
|
65
|
+
printWidth: 100
|
|
66
|
+
});
|
|
67
|
+
expect(formattedCode).toMatchInlineSnapshot(`
|
|
68
|
+
"import type {
|
|
69
|
+
InterfaceDefinition as $InterfaceDefinition,
|
|
70
|
+
ObjectSet as $ObjectSet,
|
|
71
|
+
Osdk as $Osdk,
|
|
72
|
+
PropertyValueWireToClient as $PropType,
|
|
73
|
+
} from "@osdk/api";
|
|
74
|
+
|
|
75
|
+
export type OsdkObjectLinks$Bar = {};
|
|
76
|
+
|
|
77
|
+
export namespace Bar {
|
|
78
|
+
export type PropertyKeys = "bar";
|
|
79
|
+
|
|
80
|
+
export interface Props {
|
|
81
|
+
readonly bar: $PropType["integer"] | undefined;
|
|
82
|
+
}
|
|
83
|
+
export interface StrictProps {
|
|
84
|
+
readonly bar: $PropType["integer"] | undefined;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface ObjectSet extends $ObjectSet<Bar, Bar.ObjectSet> {}
|
|
88
|
+
|
|
89
|
+
export type OsdkObject<
|
|
90
|
+
OPTIONS extends never | "$notStrict" | "$rid" = never,
|
|
91
|
+
K extends keyof Bar.Props = keyof Bar.Props,
|
|
92
|
+
> = $Osdk<Bar, K | OPTIONS>;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface Bar extends $InterfaceDefinition {
|
|
96
|
+
osdkMetadata: typeof $osdkMetadata;
|
|
97
|
+
type: "interface";
|
|
98
|
+
apiName: "Bar";
|
|
99
|
+
__DefinitionMetadata?: {
|
|
100
|
+
objectSet: Bar.ObjectSet;
|
|
101
|
+
props: Bar.Props;
|
|
102
|
+
linksType: OsdkObjectLinks$Bar;
|
|
103
|
+
strictProps: Bar.StrictProps;
|
|
104
|
+
apiName: "Bar";
|
|
105
|
+
displayName: "Bar";
|
|
106
|
+
implements: [];
|
|
107
|
+
links: {};
|
|
108
|
+
properties: {
|
|
109
|
+
/**
|
|
110
|
+
* (no ontology metadata)
|
|
111
|
+
*/
|
|
112
|
+
bar: $PropertyDef<"integer", "nullable", "single">;
|
|
113
|
+
};
|
|
114
|
+
rid: "BarRid";
|
|
115
|
+
type: "interface";
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export const Bar: Bar = {
|
|
120
|
+
type: "interface",
|
|
121
|
+
apiName: "Bar",
|
|
122
|
+
osdkMetadata: $osdkMetadata,
|
|
123
|
+
};
|
|
124
|
+
"
|
|
125
|
+
`);
|
|
126
|
+
});
|
|
127
|
+
it("Generates properties for inherited SPTs", async () => {
|
|
128
|
+
const fooSpt = simpleSpt("foo");
|
|
129
|
+
const barSpt = simpleSpt("bar");
|
|
130
|
+
const ontology = enhanceOntology(simpleOntology("ontology", [simpleInterface("Foo", [fooSpt], ["Parent"]), simpleInterface("Parent", [barSpt], [])]), undefined, new Map(), "");
|
|
131
|
+
const formattedCode = await format(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(ontology.interfaceTypes.Foo, ontology, true), {
|
|
132
|
+
parser: "typescript"
|
|
133
|
+
});
|
|
134
|
+
expect(formattedCode).toMatchInlineSnapshot(`
|
|
135
|
+
"import type {
|
|
136
|
+
InterfaceDefinition as $InterfaceDefinition,
|
|
137
|
+
ObjectSet as $ObjectSet,
|
|
138
|
+
Osdk as $Osdk,
|
|
139
|
+
PropertyValueWireToClient as $PropType,
|
|
140
|
+
} from "@osdk/api";
|
|
141
|
+
|
|
142
|
+
export type OsdkObjectLinks$Foo = {};
|
|
143
|
+
|
|
144
|
+
export namespace Foo {
|
|
145
|
+
export type PropertyKeys = "foo";
|
|
146
|
+
|
|
147
|
+
export interface Props {
|
|
148
|
+
readonly foo: $PropType["integer"] | undefined;
|
|
149
|
+
}
|
|
150
|
+
export interface StrictProps {
|
|
151
|
+
readonly foo: $PropType["integer"] | undefined;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface ObjectSet extends $ObjectSet<Foo, Foo.ObjectSet> {}
|
|
155
|
+
|
|
156
|
+
export type OsdkObject<
|
|
157
|
+
OPTIONS extends never | "$notStrict" | "$rid" = never,
|
|
158
|
+
K extends keyof Foo.Props = keyof Foo.Props,
|
|
159
|
+
> = $Osdk<Foo, K | OPTIONS>;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export interface Foo extends $InterfaceDefinition {
|
|
163
|
+
osdkMetadata: typeof $osdkMetadata;
|
|
164
|
+
type: "interface";
|
|
165
|
+
apiName: "Foo";
|
|
166
|
+
__DefinitionMetadata?: {
|
|
167
|
+
objectSet: Foo.ObjectSet;
|
|
168
|
+
props: Foo.Props;
|
|
169
|
+
linksType: OsdkObjectLinks$Foo;
|
|
170
|
+
strictProps: Foo.StrictProps;
|
|
171
|
+
apiName: "Foo";
|
|
172
|
+
description: "Foo interface desc";
|
|
173
|
+
displayName: "Foo interface dn";
|
|
174
|
+
implements: ["Parent"];
|
|
175
|
+
links: {};
|
|
176
|
+
properties: {
|
|
177
|
+
/**
|
|
178
|
+
* display name: 'foo property dn',
|
|
179
|
+
* description: foo property desc
|
|
180
|
+
*/
|
|
181
|
+
foo: $PropertyDef<"integer", "nullable", "single">;
|
|
182
|
+
};
|
|
183
|
+
rid: "FooRid";
|
|
184
|
+
type: "interface";
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export const Foo: Foo = {
|
|
189
|
+
type: "interface",
|
|
190
|
+
apiName: "Foo",
|
|
191
|
+
osdkMetadata: $osdkMetadata,
|
|
192
|
+
};
|
|
193
|
+
"
|
|
194
|
+
`);
|
|
195
|
+
});
|
|
196
|
+
it("allows for SPT reuse if the same", async () => {
|
|
197
|
+
const fooSpt = simpleSpt("foo");
|
|
198
|
+
const barSpt = simpleSpt("bar");
|
|
199
|
+
const ontology = enhanceOntology(simpleOntology("ontology", [simpleInterface("Foo", [fooSpt, barSpt], ["Parent"]), simpleInterface("Parent", [barSpt], [])]), undefined, new Map(), "");
|
|
200
|
+
const formattedCode = await format(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(ontology.interfaceTypes.Foo, ontology, true), {
|
|
201
|
+
parser: "typescript"
|
|
202
|
+
});
|
|
203
|
+
expect(formattedCode).toMatchInlineSnapshot(`
|
|
204
|
+
"import type {
|
|
205
|
+
InterfaceDefinition as $InterfaceDefinition,
|
|
206
|
+
ObjectSet as $ObjectSet,
|
|
207
|
+
Osdk as $Osdk,
|
|
208
|
+
PropertyValueWireToClient as $PropType,
|
|
209
|
+
} from "@osdk/api";
|
|
210
|
+
|
|
211
|
+
export type OsdkObjectLinks$Foo = {};
|
|
212
|
+
|
|
213
|
+
export namespace Foo {
|
|
214
|
+
export type PropertyKeys = "foo" | "bar";
|
|
215
|
+
|
|
216
|
+
export interface Props {
|
|
217
|
+
readonly bar: $PropType["integer"] | undefined;
|
|
218
|
+
readonly foo: $PropType["integer"] | undefined;
|
|
219
|
+
}
|
|
220
|
+
export interface StrictProps {
|
|
221
|
+
readonly bar: $PropType["integer"] | undefined;
|
|
222
|
+
readonly foo: $PropType["integer"] | undefined;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export interface ObjectSet extends $ObjectSet<Foo, Foo.ObjectSet> {}
|
|
226
|
+
|
|
227
|
+
export type OsdkObject<
|
|
228
|
+
OPTIONS extends never | "$notStrict" | "$rid" = never,
|
|
229
|
+
K extends keyof Foo.Props = keyof Foo.Props,
|
|
230
|
+
> = $Osdk<Foo, K | OPTIONS>;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export interface Foo extends $InterfaceDefinition {
|
|
234
|
+
osdkMetadata: typeof $osdkMetadata;
|
|
235
|
+
type: "interface";
|
|
236
|
+
apiName: "Foo";
|
|
237
|
+
__DefinitionMetadata?: {
|
|
238
|
+
objectSet: Foo.ObjectSet;
|
|
239
|
+
props: Foo.Props;
|
|
240
|
+
linksType: OsdkObjectLinks$Foo;
|
|
241
|
+
strictProps: Foo.StrictProps;
|
|
242
|
+
apiName: "Foo";
|
|
243
|
+
description: "Foo interface desc";
|
|
244
|
+
displayName: "Foo interface dn";
|
|
245
|
+
implements: ["Parent"];
|
|
246
|
+
links: {};
|
|
247
|
+
properties: {
|
|
248
|
+
/**
|
|
249
|
+
* display name: 'bar property dn',
|
|
250
|
+
* description: bar property desc
|
|
251
|
+
*/
|
|
252
|
+
bar: $PropertyDef<"integer", "nullable", "single">;
|
|
253
|
+
/**
|
|
254
|
+
* display name: 'foo property dn',
|
|
255
|
+
* description: foo property desc
|
|
256
|
+
*/
|
|
257
|
+
foo: $PropertyDef<"integer", "nullable", "single">;
|
|
258
|
+
};
|
|
259
|
+
rid: "FooRid";
|
|
260
|
+
type: "interface";
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export const Foo: Foo = {
|
|
265
|
+
type: "interface",
|
|
266
|
+
apiName: "Foo",
|
|
267
|
+
osdkMetadata: $osdkMetadata,
|
|
268
|
+
};
|
|
269
|
+
"
|
|
270
|
+
`);
|
|
271
|
+
});
|
|
272
|
+
});
|
|
273
|
+
//# sourceMappingURL=UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst.test.js","names":["format","describe","expect","it","enhanceOntology","__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","Map","formattedCode","Bar","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 { enhanceOntology } from \"../GenerateContext/enhanceOntology.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(simpleOntology(\"ontology\", [\n simpleInterface(\"Bar\", [simpleSpt(\"bar\", 0)], [], 0),\n ]), undefined, new Map(), \"\");\n const formattedCode = await format(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(ontology.interfaceTypes.Bar, ontology, 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 interface StrictProps {\n readonly bar: $PropType[\"integer\"] | undefined;\n }\n\n export interface ObjectSet extends $ObjectSet<Bar, Bar.ObjectSet> {}\n\n export type OsdkObject<\n OPTIONS extends never | \"$notStrict\" | \"$rid\" = never,\n K extends keyof Bar.Props = keyof Bar.Props,\n > = $Osdk<Bar, K | OPTIONS>;\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(simpleOntology(\"ontology\", [\n simpleInterface(\"Foo\", [fooSpt], [\"Parent\"]),\n simpleInterface(\"Parent\", [barSpt], []),\n ]), undefined, new Map(), \"\");\n const formattedCode = await format(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(ontology.interfaceTypes.Foo, ontology, 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 interface StrictProps {\n readonly foo: $PropType[\"integer\"] | undefined;\n }\n\n export interface ObjectSet extends $ObjectSet<Foo, Foo.ObjectSet> {}\n\n export type OsdkObject<\n OPTIONS extends never | \"$notStrict\" | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = $Osdk<Foo, K | OPTIONS>;\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(simpleOntology(\"ontology\", [\n simpleInterface(\"Foo\", [fooSpt, barSpt], [\"Parent\"]),\n simpleInterface(\"Parent\", [barSpt], []),\n ]), undefined, new Map(), \"\");\n const formattedCode = await format(__UNSTABLE_wireInterfaceTypeV2ToSdkObjectConst(ontology.interfaceTypes.Foo, ontology, 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 interface StrictProps {\n readonly bar: $PropType[\"integer\"] | undefined;\n readonly foo: $PropType[\"integer\"] | undefined;\n }\n\n export interface ObjectSet extends $ObjectSet<Foo, Foo.ObjectSet> {}\n\n export type OsdkObject<\n OPTIONS extends never | \"$notStrict\" | \"$rid\" = never,\n K extends keyof Foo.Props = keyof Foo.Props,\n > = $Osdk<Foo, K | OPTIONS>;\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,eAAe,QAAQ,uCAAuC;AACvE,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,aAAa,IAAI,CAAC,GAAG,GAAGD,OAAO,cAAc,GAAGA,OAAO;IACpEM,WAAW,EAAEL,aAAa,IAAI,CAAC,GAAG,GAAGD,OAAO,gBAAgB,GAAGO;EACnE,CAAC;AACL;AACA,SAASC,eAAeA,CAACR,OAAO,EAAES,IAAI,EAAEC,OAAO,EAAET,aAAa,GAAG,CAAC,EAAE;EAChE,MAAMU,UAAU,GAAGC,MAAM,CAACC,WAAW,CAACJ,IAAI,CAACK,GAAG,CAACC,GAAG,IAAI,CAACA,GAAG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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,KAAK,CAAC;EACF,CAAC,CAAC;AACN,CAAC,CAAC","ignoreList":[]}
|