@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
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
|
|
17
|
+
import { consola } from "consola";
|
|
16
18
|
import { mkdir, readdir, rmdir, writeFile } from "fs/promises";
|
|
17
19
|
import * as immer from "immer";
|
|
18
20
|
import { beforeEach, describe, expect, it, test, vi } from "vitest";
|
|
@@ -66,16 +68,19 @@ function changeNames(ontology, newNames) {
|
|
|
66
68
|
changeEachEntry(draft.sharedPropertyTypes, newNames.spts, (draft, oldSptName, newSptName) => {
|
|
67
69
|
changeValue(draft, "apiName", oldSptName, newSptName);
|
|
68
70
|
}, true);
|
|
71
|
+
|
|
69
72
|
// Handle query renames
|
|
70
73
|
changeEachEntry(draft.queryTypes, newNames.queries, (draft, oldActionName, newActionName) => {
|
|
71
74
|
if (draft.apiName === oldActionName) {
|
|
72
75
|
draft.apiName = newActionName;
|
|
73
76
|
}
|
|
74
77
|
}, true);
|
|
78
|
+
|
|
75
79
|
// Handle action renames
|
|
76
80
|
changeEachEntry(draft.actionTypes, newNames.actions, (draft, oldActionName, newActionName) => {
|
|
77
81
|
changeValue(draft, "apiName", oldActionName, newActionName);
|
|
78
82
|
}, true);
|
|
83
|
+
|
|
79
84
|
// Handle interface renames
|
|
80
85
|
changeEachEntry(draft.interfaceTypes, newNames.interfaces, (ifaceType, oldIfaceName, newIfaceName) => {
|
|
81
86
|
changeValue(ifaceType, "apiName", oldIfaceName, newIfaceName);
|
|
@@ -88,6 +93,7 @@ function changeNames(ontology, newNames) {
|
|
|
88
93
|
changeArrayEntry(objectType.implementsInterfaces, oldIfaceName, newIfaceName);
|
|
89
94
|
changeKey(objectType.implementsInterfaces2, oldIfaceName, newIfaceName);
|
|
90
95
|
});
|
|
96
|
+
|
|
91
97
|
// Handle object renames
|
|
92
98
|
changeEachEntry(draft.queryTypes, newNames.objects, (queryType, oldObjectName, newObjectName) => {
|
|
93
99
|
changeDataType(queryType.output, oldObjectName, newObjectName);
|
|
@@ -153,12 +159,20 @@ const referencedOntology = {
|
|
|
153
159
|
"taskId": {
|
|
154
160
|
"dataType": {
|
|
155
161
|
"type": "string"
|
|
156
|
-
}
|
|
162
|
+
},
|
|
163
|
+
"rid": "ridForTaskId"
|
|
157
164
|
},
|
|
158
165
|
"body": {
|
|
159
166
|
"dataType": {
|
|
160
167
|
"type": "string"
|
|
161
|
-
}
|
|
168
|
+
},
|
|
169
|
+
"rid": "ridForBody"
|
|
170
|
+
},
|
|
171
|
+
"shouldBeIgnored": {
|
|
172
|
+
"dataType": {
|
|
173
|
+
"type": "futureUnknownType"
|
|
174
|
+
},
|
|
175
|
+
"rid": "ridForShouldBeIgnored"
|
|
162
176
|
}
|
|
163
177
|
},
|
|
164
178
|
"status": "ACTIVE",
|
|
@@ -184,7 +198,20 @@ const referencedOntology = {
|
|
|
184
198
|
rid: "idk"
|
|
185
199
|
}
|
|
186
200
|
},
|
|
187
|
-
|
|
201
|
+
implementedByObjectTypes: [],
|
|
202
|
+
links: {},
|
|
203
|
+
allExtendsInterfaces: [],
|
|
204
|
+
allLinks: {},
|
|
205
|
+
allProperties: {
|
|
206
|
+
"com.example.dep.spt": {
|
|
207
|
+
apiName: "com.example.dep.spt",
|
|
208
|
+
dataType: {
|
|
209
|
+
type: "string"
|
|
210
|
+
},
|
|
211
|
+
displayName: "Some Property",
|
|
212
|
+
rid: "idk"
|
|
213
|
+
}
|
|
214
|
+
}
|
|
188
215
|
}
|
|
189
216
|
},
|
|
190
217
|
"sharedPropertyTypes": {
|
|
@@ -256,12 +283,14 @@ const referencingOntology = {
|
|
|
256
283
|
"id": {
|
|
257
284
|
dataType: {
|
|
258
285
|
type: "integer"
|
|
259
|
-
}
|
|
286
|
+
},
|
|
287
|
+
rid: "rid"
|
|
260
288
|
},
|
|
261
289
|
"body": {
|
|
262
290
|
dataType: {
|
|
263
291
|
type: "string"
|
|
264
|
-
}
|
|
292
|
+
},
|
|
293
|
+
"rid": "rid"
|
|
265
294
|
}
|
|
266
295
|
},
|
|
267
296
|
rid: "ridForThing",
|
|
@@ -288,12 +317,14 @@ const referencingOntology = {
|
|
|
288
317
|
"id": {
|
|
289
318
|
dataType: {
|
|
290
319
|
type: "integer"
|
|
291
|
-
}
|
|
320
|
+
},
|
|
321
|
+
rid: "rid"
|
|
292
322
|
},
|
|
293
323
|
"body": {
|
|
294
324
|
dataType: {
|
|
295
325
|
type: "string"
|
|
296
|
-
}
|
|
326
|
+
},
|
|
327
|
+
rid: "rid"
|
|
297
328
|
}
|
|
298
329
|
},
|
|
299
330
|
rid: "theRid",
|
|
@@ -354,7 +385,9 @@ describe("generator", () => {
|
|
|
354
385
|
beforeEach(async () => {
|
|
355
386
|
helper = createMockMinimalFiles();
|
|
356
387
|
});
|
|
357
|
-
test("should be able to generate a project",
|
|
388
|
+
test("should be able to generate a project", {
|
|
389
|
+
timeout: 20_000
|
|
390
|
+
}, async () => {
|
|
358
391
|
await generateClientSdkVersionTwoPointZero(TodoWireOntology, "typescript-sdk/0.0.0 osdk-cli/0.0.0", helper.minimalFiles, BASE_PATH);
|
|
359
392
|
const files = helper.getFiles();
|
|
360
393
|
expect(files).toMatchObject({
|
|
@@ -364,595 +397,16 @@ describe("generator", () => {
|
|
|
364
397
|
});
|
|
365
398
|
const diagnostics = compileThis(helper.getFiles(), BASE_PATH);
|
|
366
399
|
for (const q of diagnostics) {
|
|
367
|
-
console.error(`${q.file?.fileName}:${q.file?.getLineStarts()}
|
|
400
|
+
console.error(`${q.file?.fileName}:${q.file?.getLineStarts()}`, q.messageText);
|
|
368
401
|
}
|
|
402
|
+
|
|
369
403
|
// TODO: Certain errors are expected since we can't resolve the static code, but we should fix them.
|
|
370
404
|
const errors = diagnostics.filter(q => q.code !== 2792);
|
|
371
405
|
expect(errors).toHaveLength(0);
|
|
372
|
-
expect(tweakedFilesForSnapshotConsistency(helper.getFiles())).toMatchInlineSnapshot(`
|
|
373
|
-
{
|
|
374
|
-
"/foo/OntologyMetadata.ts": "export type $ExpectedClientVersion = 'PLACEHOLDER';
|
|
375
|
-
export const $osdkMetadata = { extraUserAgent: 'typescript-sdk/0.0.0 osdk-cli/0.0.0' };
|
|
376
|
-
|
|
377
|
-
export const $ontologyRid = 'ridHere';
|
|
378
|
-
",
|
|
379
|
-
"/foo/index.ts": "export { deleteTodos, markTodoCompleted } from './ontology/actions';
|
|
380
|
-
export * as $Actions from './ontology/actions';
|
|
381
|
-
export { SomeInterface } from './ontology/interfaces';
|
|
382
|
-
export * as $Interfaces from './ontology/interfaces';
|
|
383
|
-
export { Person, Todo } from './ontology/objects';
|
|
384
|
-
export * as $Objects from './ontology/objects';
|
|
385
|
-
export { getCount, returnsTodo } from './ontology/queries';
|
|
386
|
-
export * as $Queries from './ontology/queries';
|
|
387
|
-
export { $ontologyRid } from './OntologyMetadata';
|
|
388
|
-
",
|
|
389
|
-
"/foo/ontology/actions.ts": "export { deleteTodos } from './actions/deleteTodos';
|
|
390
|
-
export { markTodoCompleted } from './actions/markTodoCompleted';
|
|
391
|
-
",
|
|
392
|
-
"/foo/ontology/actions/deleteTodos.ts": "import type {
|
|
393
|
-
ActionDefinition,
|
|
394
|
-
ActionMetadata,
|
|
395
|
-
ActionParam,
|
|
396
|
-
ActionReturnTypeForOptions,
|
|
397
|
-
ApplyActionOptions,
|
|
398
|
-
ApplyBatchActionOptions,
|
|
399
|
-
} from '@osdk/client';
|
|
400
|
-
import { $osdkMetadata } from '../../OntologyMetadata';
|
|
401
|
-
import type { Todo } from '../objects/Todo';
|
|
402
|
-
|
|
403
|
-
export namespace deleteTodos {
|
|
404
|
-
// Represents the definition of the parameters for the action
|
|
405
|
-
export type ParamsDefinition = {
|
|
406
|
-
object: {
|
|
407
|
-
description: 'Todo(s) to be deleted';
|
|
408
|
-
multiplicity: true;
|
|
409
|
-
nullable: true;
|
|
410
|
-
type: ActionMetadata.DataType.Object<Todo>;
|
|
411
|
-
};
|
|
412
|
-
};
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* An action which takes in an array of objects
|
|
416
|
-
*/
|
|
417
|
-
export interface Params {
|
|
418
|
-
/**
|
|
419
|
-
* Todo(s) to be deleted
|
|
420
|
-
*/
|
|
421
|
-
readonly object?: ReadonlyArray<ActionParam.ObjectType<Todo>>;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
// Represents a fqn of the action
|
|
425
|
-
export interface Signatures {
|
|
426
|
-
/**
|
|
427
|
-
* An action which takes in an array of objects
|
|
428
|
-
*/
|
|
429
|
-
applyAction<P extends deleteTodos.Params, OP extends ApplyActionOptions>(
|
|
430
|
-
args: P,
|
|
431
|
-
options?: OP,
|
|
432
|
-
): Promise<ActionReturnTypeForOptions<OP>>;
|
|
433
|
-
|
|
434
|
-
batchApplyAction<P extends ReadonlyArray<deleteTodos.Params>, OP extends ApplyBatchActionOptions>(
|
|
435
|
-
args: P,
|
|
436
|
-
options?: OP,
|
|
437
|
-
): Promise<ActionReturnTypeForOptions<OP>>;
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
/**
|
|
442
|
-
* An action which takes in an array of objects
|
|
443
|
-
* @param {ActionParam.ObjectType<Todo>} [object] Todo(s) to be deleted
|
|
444
|
-
*/
|
|
445
|
-
export interface deleteTodos extends ActionDefinition<deleteTodos.Signatures> {
|
|
446
|
-
__DefinitionMetadata?: {
|
|
447
|
-
apiName: 'deleteTodos';
|
|
448
|
-
description: 'An action which takes in an array of objects';
|
|
449
|
-
modifiedEntities: {};
|
|
450
|
-
parameters: deleteTodos.ParamsDefinition;
|
|
451
|
-
rid: 'ri.ontology.main.action-type.8f94017d-cf17-4fa8-84c3-8e01e5d594f2';
|
|
452
|
-
status: 'ACTIVE';
|
|
453
|
-
type: 'action';
|
|
454
|
-
|
|
455
|
-
signatures: deleteTodos.Signatures;
|
|
456
|
-
};
|
|
457
|
-
apiName: 'deleteTodos';
|
|
458
|
-
type: 'action';
|
|
459
|
-
osdkMetadata: typeof $osdkMetadata;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
export const deleteTodos: deleteTodos = {
|
|
463
|
-
apiName: 'deleteTodos',
|
|
464
|
-
type: 'action',
|
|
465
|
-
osdkMetadata: $osdkMetadata,
|
|
466
|
-
};
|
|
467
|
-
",
|
|
468
|
-
"/foo/ontology/actions/markTodoCompleted.ts": "import type {
|
|
469
|
-
ActionDefinition,
|
|
470
|
-
ActionMetadata,
|
|
471
|
-
ActionParam,
|
|
472
|
-
ActionReturnTypeForOptions,
|
|
473
|
-
ApplyActionOptions,
|
|
474
|
-
ApplyBatchActionOptions,
|
|
475
|
-
} from '@osdk/client';
|
|
476
|
-
import { $osdkMetadata } from '../../OntologyMetadata';
|
|
477
|
-
import type { Todo } from '../objects/Todo';
|
|
478
|
-
|
|
479
|
-
export namespace markTodoCompleted {
|
|
480
|
-
// Represents the definition of the parameters for the action
|
|
481
|
-
export type ParamsDefinition = {
|
|
482
|
-
object: {
|
|
483
|
-
description: 'A Todo to mark completed';
|
|
484
|
-
multiplicity: false;
|
|
485
|
-
nullable: true;
|
|
486
|
-
type: ActionMetadata.DataType.Object<Todo>;
|
|
487
|
-
};
|
|
488
|
-
};
|
|
489
|
-
|
|
490
|
-
/**
|
|
491
|
-
* An action which takes different types of parameters
|
|
492
|
-
*/
|
|
493
|
-
export interface Params {
|
|
494
|
-
/**
|
|
495
|
-
* A Todo to mark completed
|
|
496
|
-
*/
|
|
497
|
-
readonly object?: ActionParam.ObjectType<Todo>;
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
// Represents a fqn of the action
|
|
501
|
-
export interface Signatures {
|
|
502
|
-
/**
|
|
503
|
-
* An action which takes different types of parameters
|
|
504
|
-
*/
|
|
505
|
-
applyAction<P extends markTodoCompleted.Params, OP extends ApplyActionOptions>(
|
|
506
|
-
args: P,
|
|
507
|
-
options?: OP,
|
|
508
|
-
): Promise<ActionReturnTypeForOptions<OP>>;
|
|
509
|
-
|
|
510
|
-
batchApplyAction<P extends ReadonlyArray<markTodoCompleted.Params>, OP extends ApplyBatchActionOptions>(
|
|
511
|
-
args: P,
|
|
512
|
-
options?: OP,
|
|
513
|
-
): Promise<ActionReturnTypeForOptions<OP>>;
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
/**
|
|
518
|
-
* An action which takes different types of parameters
|
|
519
|
-
* @param {ActionParam.ObjectType<Todo>} [object] A Todo to mark completed
|
|
520
|
-
*/
|
|
521
|
-
export interface markTodoCompleted extends ActionDefinition<markTodoCompleted.Signatures> {
|
|
522
|
-
__DefinitionMetadata?: {
|
|
523
|
-
apiName: 'markTodoCompleted';
|
|
524
|
-
description: 'An action which takes different types of parameters';
|
|
525
|
-
modifiedEntities: {
|
|
526
|
-
Todo: {
|
|
527
|
-
created: false;
|
|
528
|
-
modified: true;
|
|
529
|
-
};
|
|
530
|
-
};
|
|
531
|
-
parameters: markTodoCompleted.ParamsDefinition;
|
|
532
|
-
rid: 'ri.ontology.main.action-type.9f84017d-cf17-4fa8-84c3-8e01e5d594f2';
|
|
533
|
-
status: 'ACTIVE';
|
|
534
|
-
type: 'action';
|
|
535
|
-
|
|
536
|
-
signatures: markTodoCompleted.Signatures;
|
|
537
|
-
};
|
|
538
|
-
apiName: 'markTodoCompleted';
|
|
539
|
-
type: 'action';
|
|
540
|
-
osdkMetadata: typeof $osdkMetadata;
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
export const markTodoCompleted: markTodoCompleted = {
|
|
544
|
-
apiName: 'markTodoCompleted',
|
|
545
|
-
type: 'action',
|
|
546
|
-
osdkMetadata: $osdkMetadata,
|
|
547
|
-
};
|
|
548
|
-
",
|
|
549
|
-
"/foo/ontology/interfaces.ts": "export { SomeInterface } from './interfaces/SomeInterface';
|
|
550
|
-
",
|
|
551
|
-
"/foo/ontology/interfaces/SomeInterface.ts": "import type { PropertyDef as $PropertyDef } from '@osdk/client';
|
|
552
|
-
import { $osdkMetadata } from '../../OntologyMetadata';
|
|
553
|
-
|
|
554
|
-
import type {
|
|
555
|
-
InterfaceDefinition as $InterfaceDefinition,
|
|
556
|
-
ObjectSet as $ObjectSet,
|
|
557
|
-
Osdk as $Osdk,
|
|
558
|
-
PropertyValueWireToClient as $PropType,
|
|
559
|
-
} from '@osdk/client';
|
|
560
|
-
|
|
561
|
-
export type OsdkObjectLinks$SomeInterface = {};
|
|
562
|
-
|
|
563
|
-
export namespace SomeInterface {
|
|
564
|
-
export type PropertyKeys = 'SomeProperty';
|
|
565
|
-
|
|
566
|
-
export interface Props {
|
|
567
|
-
readonly SomeProperty: $PropType['string'] | undefined;
|
|
568
|
-
}
|
|
569
|
-
export type StrictProps = Props;
|
|
570
|
-
|
|
571
|
-
export interface ObjectSet extends $ObjectSet<SomeInterface, SomeInterface.ObjectSet> {}
|
|
572
|
-
|
|
573
|
-
export type OsdkInstance<
|
|
574
|
-
OPTIONS extends never | '$rid' = never,
|
|
575
|
-
K extends keyof SomeInterface.Props = keyof SomeInterface.Props,
|
|
576
|
-
> = $Osdk.Instance<SomeInterface, OPTIONS, K>;
|
|
577
|
-
|
|
578
|
-
/** @deprecated use OsdkInstance */
|
|
579
|
-
export type OsdkObject<
|
|
580
|
-
OPTIONS extends never | '$rid' = never,
|
|
581
|
-
K extends keyof SomeInterface.Props = keyof SomeInterface.Props,
|
|
582
|
-
> = OsdkInstance<OPTIONS, K>;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
export interface SomeInterface extends $InterfaceDefinition {
|
|
586
|
-
osdkMetadata: typeof $osdkMetadata;
|
|
587
|
-
type: 'interface';
|
|
588
|
-
apiName: 'SomeInterface';
|
|
589
|
-
__DefinitionMetadata?: {
|
|
590
|
-
objectSet: SomeInterface.ObjectSet;
|
|
591
|
-
props: SomeInterface.Props;
|
|
592
|
-
linksType: OsdkObjectLinks$SomeInterface;
|
|
593
|
-
strictProps: SomeInterface.StrictProps;
|
|
594
|
-
apiName: 'SomeInterface';
|
|
595
|
-
description: 'Some interface';
|
|
596
|
-
displayName: 'Sum Interface';
|
|
597
|
-
implements: [];
|
|
598
|
-
links: {};
|
|
599
|
-
properties: {
|
|
600
|
-
/**
|
|
601
|
-
* display name: 'Sum Property',
|
|
602
|
-
* description: Some property
|
|
603
|
-
*/
|
|
604
|
-
SomeProperty: $PropertyDef<'string', 'nullable', 'single'>;
|
|
605
|
-
};
|
|
606
|
-
rid: 'idk';
|
|
607
|
-
type: 'interface';
|
|
608
|
-
};
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
export const SomeInterface: SomeInterface = {
|
|
612
|
-
type: 'interface',
|
|
613
|
-
apiName: 'SomeInterface',
|
|
614
|
-
osdkMetadata: $osdkMetadata,
|
|
615
|
-
};
|
|
616
|
-
",
|
|
617
|
-
"/foo/ontology/objects.ts": "export { Person } from './objects/Person';
|
|
618
|
-
export { Todo } from './objects/Todo';
|
|
619
|
-
",
|
|
620
|
-
"/foo/ontology/objects/Person.ts": "import type { PropertyDef as $PropertyDef } from '@osdk/client';
|
|
621
|
-
import { $osdkMetadata } from '../../OntologyMetadata';
|
|
622
|
-
import type { $ExpectedClientVersion } from '../../OntologyMetadata';
|
|
623
|
-
import type { Todo } from './Todo';
|
|
624
|
-
import type {
|
|
625
|
-
PropertyKeys as $PropertyKeys,
|
|
626
|
-
ObjectTypeDefinition as $ObjectTypeDefinition,
|
|
627
|
-
ObjectMetadata as $ObjectMetadata,
|
|
628
|
-
} from '@osdk/client';
|
|
629
|
-
import type {
|
|
630
|
-
ObjectSet as $ObjectSet,
|
|
631
|
-
Osdk as $Osdk,
|
|
632
|
-
OsdkObject as $OsdkObject,
|
|
633
|
-
PropertyValueWireToClient as $PropType,
|
|
634
|
-
SingleLinkAccessor as $SingleLinkAccessor,
|
|
635
|
-
} from '@osdk/client';
|
|
636
|
-
|
|
637
|
-
export namespace Person {
|
|
638
|
-
export type PropertyKeys = 'email';
|
|
639
|
-
|
|
640
|
-
export interface Links {
|
|
641
|
-
readonly Todos: Todo.ObjectSet;
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
export interface Props {
|
|
645
|
-
readonly email: $PropType['string'];
|
|
646
|
-
}
|
|
647
|
-
export type StrictProps = Props;
|
|
648
|
-
|
|
649
|
-
export interface ObjectSet extends $ObjectSet<Person, Person.ObjectSet> {}
|
|
650
|
-
|
|
651
|
-
export type OsdkInstance<
|
|
652
|
-
OPTIONS extends never | '$rid' = never,
|
|
653
|
-
K extends keyof Person.Props = keyof Person.Props,
|
|
654
|
-
> = $Osdk.Instance<Person, OPTIONS, K>;
|
|
655
|
-
|
|
656
|
-
/** @deprecated use OsdkInstance */
|
|
657
|
-
export type OsdkObject<
|
|
658
|
-
OPTIONS extends never | '$rid' = never,
|
|
659
|
-
K extends keyof Person.Props = keyof Person.Props,
|
|
660
|
-
> = OsdkInstance<OPTIONS, K>;
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
export interface Person extends $ObjectTypeDefinition {
|
|
664
|
-
osdkMetadata: typeof $osdkMetadata;
|
|
665
|
-
type: 'object';
|
|
666
|
-
apiName: 'Person';
|
|
667
|
-
__DefinitionMetadata?: {
|
|
668
|
-
objectSet: Person.ObjectSet;
|
|
669
|
-
props: Person.Props;
|
|
670
|
-
linksType: Person.Links;
|
|
671
|
-
strictProps: Person.StrictProps;
|
|
672
|
-
apiName: 'Person';
|
|
673
|
-
description: 'A person';
|
|
674
|
-
displayName: 'Person';
|
|
675
|
-
icon: {
|
|
676
|
-
type: 'blueprint';
|
|
677
|
-
name: 'document';
|
|
678
|
-
color: 'blue';
|
|
679
|
-
};
|
|
680
|
-
implements: [];
|
|
681
|
-
interfaceMap: {};
|
|
682
|
-
inverseInterfaceMap: {};
|
|
683
|
-
links: {
|
|
684
|
-
Todos: $ObjectMetadata.Link<Todo, true>;
|
|
685
|
-
};
|
|
686
|
-
pluralDisplayName: 'Persons';
|
|
687
|
-
primaryKeyApiName: 'email';
|
|
688
|
-
primaryKeyType: 'string';
|
|
689
|
-
properties: {
|
|
690
|
-
/**
|
|
691
|
-
* (no ontology metadata)
|
|
692
|
-
*/
|
|
693
|
-
email: $PropertyDef<'string', 'non-nullable', 'single'>;
|
|
694
|
-
};
|
|
695
|
-
rid: 'ridForPerson';
|
|
696
|
-
status: 'ACTIVE';
|
|
697
|
-
titleProperty: 'email';
|
|
698
|
-
type: 'object';
|
|
699
|
-
};
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
export const Person: Person = {
|
|
703
|
-
type: 'object',
|
|
704
|
-
apiName: 'Person',
|
|
705
|
-
osdkMetadata: $osdkMetadata,
|
|
706
|
-
};
|
|
707
|
-
",
|
|
708
|
-
"/foo/ontology/objects/Todo.ts": "import type { PropertyDef as $PropertyDef } from '@osdk/client';
|
|
709
|
-
import { $osdkMetadata } from '../../OntologyMetadata';
|
|
710
|
-
import type { $ExpectedClientVersion } from '../../OntologyMetadata';
|
|
711
|
-
import type { Person } from './Person';
|
|
712
|
-
import type {
|
|
713
|
-
PropertyKeys as $PropertyKeys,
|
|
714
|
-
ObjectTypeDefinition as $ObjectTypeDefinition,
|
|
715
|
-
ObjectMetadata as $ObjectMetadata,
|
|
716
|
-
} from '@osdk/client';
|
|
717
|
-
import type {
|
|
718
|
-
ObjectSet as $ObjectSet,
|
|
719
|
-
Osdk as $Osdk,
|
|
720
|
-
OsdkObject as $OsdkObject,
|
|
721
|
-
PropertyValueWireToClient as $PropType,
|
|
722
|
-
SingleLinkAccessor as $SingleLinkAccessor,
|
|
723
|
-
} from '@osdk/client';
|
|
724
|
-
|
|
725
|
-
export namespace Todo {
|
|
726
|
-
export type PropertyKeys = 'id' | 'body' | 'complete';
|
|
727
|
-
|
|
728
|
-
export interface Links {
|
|
729
|
-
readonly Assignee: $SingleLinkAccessor<Person>;
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
export interface Props {
|
|
733
|
-
readonly body: $PropType['string'] | undefined;
|
|
734
|
-
readonly complete: $PropType['boolean'] | undefined;
|
|
735
|
-
readonly id: $PropType['integer'];
|
|
736
|
-
}
|
|
737
|
-
export type StrictProps = Props;
|
|
738
|
-
|
|
739
|
-
export interface ObjectSet extends $ObjectSet<Todo, Todo.ObjectSet> {}
|
|
740
|
-
|
|
741
|
-
export type OsdkInstance<
|
|
742
|
-
OPTIONS extends never | '$rid' = never,
|
|
743
|
-
K extends keyof Todo.Props = keyof Todo.Props,
|
|
744
|
-
> = $Osdk.Instance<Todo, OPTIONS, K>;
|
|
745
|
-
|
|
746
|
-
/** @deprecated use OsdkInstance */
|
|
747
|
-
export type OsdkObject<
|
|
748
|
-
OPTIONS extends never | '$rid' = never,
|
|
749
|
-
K extends keyof Todo.Props = keyof Todo.Props,
|
|
750
|
-
> = OsdkInstance<OPTIONS, K>;
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
export interface Todo extends $ObjectTypeDefinition {
|
|
754
|
-
osdkMetadata: typeof $osdkMetadata;
|
|
755
|
-
type: 'object';
|
|
756
|
-
apiName: 'Todo';
|
|
757
|
-
__DefinitionMetadata?: {
|
|
758
|
-
objectSet: Todo.ObjectSet;
|
|
759
|
-
props: Todo.Props;
|
|
760
|
-
linksType: Todo.Links;
|
|
761
|
-
strictProps: Todo.StrictProps;
|
|
762
|
-
apiName: 'Todo';
|
|
763
|
-
description: 'Its a todo item.';
|
|
764
|
-
displayName: 'AwesomeTodoDisplayname';
|
|
765
|
-
icon: {
|
|
766
|
-
type: 'blueprint';
|
|
767
|
-
name: 'document';
|
|
768
|
-
color: 'blue';
|
|
769
|
-
};
|
|
770
|
-
implements: ['SomeInterface'];
|
|
771
|
-
interfaceMap: {
|
|
772
|
-
SomeInterface: {
|
|
773
|
-
SomeProperty: 'body';
|
|
774
|
-
};
|
|
775
|
-
};
|
|
776
|
-
inverseInterfaceMap: {
|
|
777
|
-
SomeInterface: {
|
|
778
|
-
body: 'SomeProperty';
|
|
779
|
-
};
|
|
780
|
-
};
|
|
781
|
-
links: {
|
|
782
|
-
Assignee: $ObjectMetadata.Link<Person, false>;
|
|
783
|
-
};
|
|
784
|
-
pluralDisplayName: 'AwesomeTodoDisplayNames';
|
|
785
|
-
primaryKeyApiName: 'id';
|
|
786
|
-
primaryKeyType: 'integer';
|
|
787
|
-
properties: {
|
|
788
|
-
/**
|
|
789
|
-
* display name: 'Body',
|
|
790
|
-
* description: The text of the todo
|
|
791
|
-
*/
|
|
792
|
-
body: $PropertyDef<'string', 'nullable', 'single'>;
|
|
793
|
-
/**
|
|
794
|
-
* (no ontology metadata)
|
|
795
|
-
*/
|
|
796
|
-
complete: $PropertyDef<'boolean', 'nullable', 'single'>;
|
|
797
|
-
/**
|
|
798
|
-
* (no ontology metadata)
|
|
799
|
-
*/
|
|
800
|
-
id: $PropertyDef<'integer', 'non-nullable', 'single'>;
|
|
801
|
-
};
|
|
802
|
-
rid: 'ridForTodo';
|
|
803
|
-
status: 'ACTIVE';
|
|
804
|
-
titleProperty: 'body';
|
|
805
|
-
type: 'object';
|
|
806
|
-
};
|
|
807
|
-
}
|
|
808
|
-
|
|
809
|
-
export const Todo: Todo = {
|
|
810
|
-
type: 'object',
|
|
811
|
-
apiName: 'Todo',
|
|
812
|
-
osdkMetadata: $osdkMetadata,
|
|
813
|
-
};
|
|
814
|
-
",
|
|
815
|
-
"/foo/ontology/queries.ts": "export { getCount } from './queries/getCount';
|
|
816
|
-
export { returnsTodo } from './queries/returnsTodo';
|
|
817
|
-
",
|
|
818
|
-
"/foo/ontology/queries/getCount.ts": "import type { QueryDefinition, QueryParam, QueryResult, VersionBound } from '@osdk/client';
|
|
819
|
-
import type { $ExpectedClientVersion } from '../../OntologyMetadata';
|
|
820
|
-
import { $osdkMetadata } from '../../OntologyMetadata';
|
|
821
|
-
|
|
822
|
-
export namespace getCount {
|
|
823
|
-
export interface Signature {
|
|
824
|
-
(query: getCount.Parameters): Promise<getCount.ReturnType>;
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
export interface Parameters {
|
|
828
|
-
/**
|
|
829
|
-
* (no ontology metadata)
|
|
830
|
-
*/
|
|
831
|
-
readonly completed: QueryParam.PrimitiveType<'boolean'>;
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
export type ReturnType = QueryResult.PrimitiveType<'integer'>;
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
export interface getCount extends QueryDefinition<getCount.Signature>, VersionBound<$ExpectedClientVersion> {
|
|
838
|
-
__DefinitionMetadata?: {
|
|
839
|
-
apiName: 'getCount';
|
|
840
|
-
rid: 'rid.query.1';
|
|
841
|
-
type: 'query';
|
|
842
|
-
version: '0';
|
|
843
|
-
parameters: {
|
|
844
|
-
/**
|
|
845
|
-
* (no ontology metadata)
|
|
846
|
-
*/
|
|
847
|
-
completed: {
|
|
848
|
-
nullable: false;
|
|
849
|
-
type: 'boolean';
|
|
850
|
-
};
|
|
851
|
-
};
|
|
852
|
-
output: {
|
|
853
|
-
nullable: false;
|
|
854
|
-
type: 'integer';
|
|
855
|
-
};
|
|
856
|
-
signature: getCount.Signature;
|
|
857
|
-
};
|
|
858
|
-
apiName: 'getCount';
|
|
859
|
-
type: 'query';
|
|
860
|
-
version: '0';
|
|
861
|
-
osdkMetadata: typeof $osdkMetadata;
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
export const getCount: getCount = {
|
|
865
|
-
apiName: 'getCount',
|
|
866
|
-
type: 'query',
|
|
867
|
-
version: '0',
|
|
868
|
-
osdkMetadata: $osdkMetadata,
|
|
869
|
-
};
|
|
870
|
-
",
|
|
871
|
-
"/foo/ontology/queries/returnsTodo.ts": "import type { QueryDefinition, QueryParam, QueryResult, VersionBound } from '@osdk/client';
|
|
872
|
-
import type { $ExpectedClientVersion } from '../../OntologyMetadata';
|
|
873
|
-
import { $osdkMetadata } from '../../OntologyMetadata';
|
|
874
|
-
import type { Todo } from '../objects/Todo';
|
|
875
|
-
|
|
876
|
-
export namespace returnsTodo {
|
|
877
|
-
export interface Signature {
|
|
878
|
-
(query: returnsTodo.Parameters): Promise<returnsTodo.ReturnType>;
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
export interface Parameters {
|
|
882
|
-
/**
|
|
883
|
-
* description: Random desc so we test jsdoc
|
|
884
|
-
*/
|
|
885
|
-
readonly someTodo: QueryParam.ObjectType<Todo>;
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
export type ReturnType = QueryResult.ObjectType<Todo>;
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
export interface returnsTodo extends QueryDefinition<returnsTodo.Signature>, VersionBound<$ExpectedClientVersion> {
|
|
892
|
-
__DefinitionMetadata?: {
|
|
893
|
-
apiName: 'returnsTodo';
|
|
894
|
-
rid: 'rid.query.2';
|
|
895
|
-
type: 'query';
|
|
896
|
-
version: '0';
|
|
897
|
-
parameters: {
|
|
898
|
-
/**
|
|
899
|
-
* description: Random desc so we test jsdoc
|
|
900
|
-
*/
|
|
901
|
-
someTodo: {
|
|
902
|
-
description: 'Random desc so we test jsdoc';
|
|
903
|
-
nullable: false;
|
|
904
|
-
object: 'Todo';
|
|
905
|
-
type: 'object';
|
|
906
|
-
__OsdkTargetType?: Todo;
|
|
907
|
-
};
|
|
908
|
-
};
|
|
909
|
-
output: {
|
|
910
|
-
nullable: false;
|
|
911
|
-
object: 'Todo';
|
|
912
|
-
type: 'object';
|
|
913
|
-
__OsdkTargetType?: Todo;
|
|
914
|
-
};
|
|
915
|
-
signature: returnsTodo.Signature;
|
|
916
|
-
};
|
|
917
|
-
apiName: 'returnsTodo';
|
|
918
|
-
type: 'query';
|
|
919
|
-
version: '0';
|
|
920
|
-
osdkMetadata: typeof $osdkMetadata;
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
export const returnsTodo: returnsTodo = {
|
|
924
|
-
apiName: 'returnsTodo',
|
|
925
|
-
type: 'query',
|
|
926
|
-
version: '0',
|
|
927
|
-
osdkMetadata: $osdkMetadata,
|
|
928
|
-
};
|
|
929
|
-
",
|
|
930
|
-
}
|
|
931
|
-
`);
|
|
932
|
-
});
|
|
933
|
-
test("throws an error when target destination is not empty", async () => {
|
|
934
|
-
helper.minimalFiles.readdir = vi.fn(async () => ["file"]);
|
|
935
|
-
await expect(async () => {
|
|
936
|
-
await expect(generateClientSdkVersionTwoPointZero(TodoWireOntology, "typescript-sdk/0.0.0 osdk-cli/0.0.0", helper.minimalFiles, BASE_PATH)).rejects.toThrow();
|
|
937
|
-
});
|
|
938
|
-
});
|
|
939
|
-
it("throws an error if a namespace is provided that all top levels do not use", async () => {
|
|
940
|
-
await expect(generateClientSdkVersionTwoPointZero({
|
|
941
|
-
...TodoWireOntology
|
|
942
|
-
}, "", helper.minimalFiles, BASE_PATH, "module", undefined, undefined, undefined, true));
|
|
943
|
-
// Disabled for now since we can't really enforce it from dev console at the moment
|
|
944
|
-
// .rejects.toThrowErrorMatchingInlineSnapshot(
|
|
945
|
-
// `[Error: Found type { ns:'undefined', shortName: 'Todo'} but it is not in the generation namespace 'foo.bar'. This violates the contract of the generator.]`,
|
|
946
|
-
// );
|
|
947
|
-
});
|
|
948
|
-
it("does not throw an error if a namespace is provided that all top levels use", async () => {
|
|
949
|
-
await expect(generateClientSdkVersionTwoPointZero(fooBarTodoWireOntology, "", helper.minimalFiles, BASE_PATH, "module", undefined, undefined, undefined, true)).resolves.toMatchInlineSnapshot(`undefined`);
|
|
950
|
-
expect(helper.getFiles()["/foo/ontology/objects/foo.bar.Todo.ts"]).toBeUndefined();
|
|
951
|
-
expect(helper.getFiles()["/foo/ontology/objects/Todo.ts"]).not.toBeUndefined();
|
|
952
406
|
expect(tweakedFilesForSnapshotConsistency(helper.getFiles())).toMatchInlineSnapshot(`
|
|
953
407
|
{
|
|
954
408
|
"/foo/OntologyMetadata.ts": "export type $ExpectedClientVersion = 'PLACEHOLDER';
|
|
955
|
-
export const $osdkMetadata = { extraUserAgent: '' };
|
|
409
|
+
export const $osdkMetadata = { extraUserAgent: 'typescript-sdk/0.0.0 osdk-cli/0.0.0' };
|
|
956
410
|
|
|
957
411
|
export const $ontologyRid = 'ridHere';
|
|
958
412
|
",
|
|
@@ -964,6 +418,7 @@ describe("generator", () => {
|
|
|
964
418
|
export * as $Objects from './ontology/objects.js';
|
|
965
419
|
export { getCount, returnsTodo } from './ontology/queries.js';
|
|
966
420
|
export * as $Queries from './ontology/queries.js';
|
|
421
|
+
export { $osdkMetadata } from './OntologyMetadata.js';
|
|
967
422
|
export { $ontologyRid } from './OntologyMetadata.js';
|
|
968
423
|
",
|
|
969
424
|
"/foo/ontology/actions.ts": "export { deleteTodos } from './actions/deleteTodos.js';
|
|
@@ -976,7 +431,7 @@ describe("generator", () => {
|
|
|
976
431
|
ActionReturnTypeForOptions,
|
|
977
432
|
ApplyActionOptions,
|
|
978
433
|
ApplyBatchActionOptions,
|
|
979
|
-
} from '@osdk/
|
|
434
|
+
} from '@osdk/client';
|
|
980
435
|
import { $osdkMetadata } from '../../OntologyMetadata.js';
|
|
981
436
|
import type { Todo } from '../objects/Todo.js';
|
|
982
437
|
|
|
@@ -1024,7 +479,7 @@ describe("generator", () => {
|
|
|
1024
479
|
*/
|
|
1025
480
|
export interface deleteTodos extends ActionDefinition<deleteTodos.Signatures> {
|
|
1026
481
|
__DefinitionMetadata?: {
|
|
1027
|
-
apiName: '
|
|
482
|
+
apiName: 'deleteTodos';
|
|
1028
483
|
description: 'An action which takes in an array of objects';
|
|
1029
484
|
modifiedEntities: {};
|
|
1030
485
|
parameters: deleteTodos.ParamsDefinition;
|
|
@@ -1034,13 +489,13 @@ describe("generator", () => {
|
|
|
1034
489
|
|
|
1035
490
|
signatures: deleteTodos.Signatures;
|
|
1036
491
|
};
|
|
1037
|
-
apiName: '
|
|
492
|
+
apiName: 'deleteTodos';
|
|
1038
493
|
type: 'action';
|
|
1039
494
|
osdkMetadata: typeof $osdkMetadata;
|
|
1040
495
|
}
|
|
1041
496
|
|
|
1042
497
|
export const deleteTodos: deleteTodos = {
|
|
1043
|
-
apiName: '
|
|
498
|
+
apiName: 'deleteTodos',
|
|
1044
499
|
type: 'action',
|
|
1045
500
|
osdkMetadata: $osdkMetadata,
|
|
1046
501
|
};
|
|
@@ -1052,7 +507,7 @@ describe("generator", () => {
|
|
|
1052
507
|
ActionReturnTypeForOptions,
|
|
1053
508
|
ApplyActionOptions,
|
|
1054
509
|
ApplyBatchActionOptions,
|
|
1055
|
-
} from '@osdk/
|
|
510
|
+
} from '@osdk/client';
|
|
1056
511
|
import { $osdkMetadata } from '../../OntologyMetadata.js';
|
|
1057
512
|
import type { Todo } from '../objects/Todo.js';
|
|
1058
513
|
|
|
@@ -1100,10 +555,10 @@ describe("generator", () => {
|
|
|
1100
555
|
*/
|
|
1101
556
|
export interface markTodoCompleted extends ActionDefinition<markTodoCompleted.Signatures> {
|
|
1102
557
|
__DefinitionMetadata?: {
|
|
1103
|
-
apiName: '
|
|
558
|
+
apiName: 'markTodoCompleted';
|
|
1104
559
|
description: 'An action which takes different types of parameters';
|
|
1105
560
|
modifiedEntities: {
|
|
1106
|
-
|
|
561
|
+
Todo: {
|
|
1107
562
|
created: false;
|
|
1108
563
|
modified: true;
|
|
1109
564
|
};
|
|
@@ -1115,20 +570,20 @@ describe("generator", () => {
|
|
|
1115
570
|
|
|
1116
571
|
signatures: markTodoCompleted.Signatures;
|
|
1117
572
|
};
|
|
1118
|
-
apiName: '
|
|
573
|
+
apiName: 'markTodoCompleted';
|
|
1119
574
|
type: 'action';
|
|
1120
575
|
osdkMetadata: typeof $osdkMetadata;
|
|
1121
576
|
}
|
|
1122
577
|
|
|
1123
578
|
export const markTodoCompleted: markTodoCompleted = {
|
|
1124
|
-
apiName: '
|
|
579
|
+
apiName: 'markTodoCompleted',
|
|
1125
580
|
type: 'action',
|
|
1126
581
|
osdkMetadata: $osdkMetadata,
|
|
1127
582
|
};
|
|
1128
583
|
",
|
|
1129
584
|
"/foo/ontology/interfaces.ts": "export { SomeInterface } from './interfaces/SomeInterface.js';
|
|
1130
585
|
",
|
|
1131
|
-
"/foo/ontology/interfaces/SomeInterface.ts": "import type { PropertyDef as $PropertyDef } from '@osdk/
|
|
586
|
+
"/foo/ontology/interfaces/SomeInterface.ts": "import type { PropertyDef as $PropertyDef } from '@osdk/client';
|
|
1132
587
|
import { $osdkMetadata } from '../../OntologyMetadata.js';
|
|
1133
588
|
|
|
1134
589
|
import type {
|
|
@@ -1136,7 +591,7 @@ describe("generator", () => {
|
|
|
1136
591
|
ObjectSet as $ObjectSet,
|
|
1137
592
|
Osdk as $Osdk,
|
|
1138
593
|
PropertyValueWireToClient as $PropType,
|
|
1139
|
-
} from '@osdk/
|
|
594
|
+
} from '@osdk/client';
|
|
1140
595
|
|
|
1141
596
|
export type OsdkObjectLinks$SomeInterface = {};
|
|
1142
597
|
|
|
@@ -1165,15 +620,16 @@ describe("generator", () => {
|
|
|
1165
620
|
export interface SomeInterface extends $InterfaceDefinition {
|
|
1166
621
|
osdkMetadata: typeof $osdkMetadata;
|
|
1167
622
|
type: 'interface';
|
|
1168
|
-
apiName: '
|
|
623
|
+
apiName: 'SomeInterface';
|
|
1169
624
|
__DefinitionMetadata?: {
|
|
1170
625
|
objectSet: SomeInterface.ObjectSet;
|
|
1171
626
|
props: SomeInterface.Props;
|
|
1172
627
|
linksType: OsdkObjectLinks$SomeInterface;
|
|
1173
628
|
strictProps: SomeInterface.StrictProps;
|
|
1174
|
-
apiName: '
|
|
629
|
+
apiName: 'SomeInterface';
|
|
1175
630
|
description: 'Some interface';
|
|
1176
631
|
displayName: 'Sum Interface';
|
|
632
|
+
implementedBy: [];
|
|
1177
633
|
implements: [];
|
|
1178
634
|
links: {};
|
|
1179
635
|
properties: {
|
|
@@ -1190,14 +646,14 @@ describe("generator", () => {
|
|
|
1190
646
|
|
|
1191
647
|
export const SomeInterface: SomeInterface = {
|
|
1192
648
|
type: 'interface',
|
|
1193
|
-
apiName: '
|
|
649
|
+
apiName: 'SomeInterface',
|
|
1194
650
|
osdkMetadata: $osdkMetadata,
|
|
1195
651
|
};
|
|
1196
652
|
",
|
|
1197
653
|
"/foo/ontology/objects.ts": "export { Person } from './objects/Person.js';
|
|
1198
654
|
export { Todo } from './objects/Todo.js';
|
|
1199
655
|
",
|
|
1200
|
-
"/foo/ontology/objects/Person.ts": "import type { PropertyDef as $PropertyDef } from '@osdk/
|
|
656
|
+
"/foo/ontology/objects/Person.ts": "import type { PropertyDef as $PropertyDef } from '@osdk/client';
|
|
1201
657
|
import { $osdkMetadata } from '../../OntologyMetadata.js';
|
|
1202
658
|
import type { $ExpectedClientVersion } from '../../OntologyMetadata.js';
|
|
1203
659
|
import type { Todo } from './Todo.js';
|
|
@@ -1205,14 +661,14 @@ describe("generator", () => {
|
|
|
1205
661
|
PropertyKeys as $PropertyKeys,
|
|
1206
662
|
ObjectTypeDefinition as $ObjectTypeDefinition,
|
|
1207
663
|
ObjectMetadata as $ObjectMetadata,
|
|
1208
|
-
} from '@osdk/
|
|
664
|
+
} from '@osdk/client';
|
|
1209
665
|
import type {
|
|
1210
666
|
ObjectSet as $ObjectSet,
|
|
1211
667
|
Osdk as $Osdk,
|
|
1212
668
|
OsdkObject as $OsdkObject,
|
|
1213
669
|
PropertyValueWireToClient as $PropType,
|
|
1214
670
|
SingleLinkAccessor as $SingleLinkAccessor,
|
|
1215
|
-
} from '@osdk/
|
|
671
|
+
} from '@osdk/client';
|
|
1216
672
|
|
|
1217
673
|
export namespace Person {
|
|
1218
674
|
export type PropertyKeys = 'email';
|
|
@@ -1243,13 +699,13 @@ describe("generator", () => {
|
|
|
1243
699
|
export interface Person extends $ObjectTypeDefinition {
|
|
1244
700
|
osdkMetadata: typeof $osdkMetadata;
|
|
1245
701
|
type: 'object';
|
|
1246
|
-
apiName: '
|
|
702
|
+
apiName: 'Person';
|
|
1247
703
|
__DefinitionMetadata?: {
|
|
1248
704
|
objectSet: Person.ObjectSet;
|
|
1249
705
|
props: Person.Props;
|
|
1250
706
|
linksType: Person.Links;
|
|
1251
707
|
strictProps: Person.StrictProps;
|
|
1252
|
-
apiName: '
|
|
708
|
+
apiName: 'Person';
|
|
1253
709
|
description: 'A person';
|
|
1254
710
|
displayName: 'Person';
|
|
1255
711
|
icon: {
|
|
@@ -1281,11 +737,11 @@ describe("generator", () => {
|
|
|
1281
737
|
|
|
1282
738
|
export const Person: Person = {
|
|
1283
739
|
type: 'object',
|
|
1284
|
-
apiName: '
|
|
740
|
+
apiName: 'Person',
|
|
1285
741
|
osdkMetadata: $osdkMetadata,
|
|
1286
742
|
};
|
|
1287
743
|
",
|
|
1288
|
-
"/foo/ontology/objects/Todo.ts": "import type { PropertyDef as $PropertyDef } from '@osdk/
|
|
744
|
+
"/foo/ontology/objects/Todo.ts": "import type { PropertyDef as $PropertyDef } from '@osdk/client';
|
|
1289
745
|
import { $osdkMetadata } from '../../OntologyMetadata.js';
|
|
1290
746
|
import type { $ExpectedClientVersion } from '../../OntologyMetadata.js';
|
|
1291
747
|
import type { Person } from './Person.js';
|
|
@@ -1293,14 +749,14 @@ describe("generator", () => {
|
|
|
1293
749
|
PropertyKeys as $PropertyKeys,
|
|
1294
750
|
ObjectTypeDefinition as $ObjectTypeDefinition,
|
|
1295
751
|
ObjectMetadata as $ObjectMetadata,
|
|
1296
|
-
} from '@osdk/
|
|
752
|
+
} from '@osdk/client';
|
|
1297
753
|
import type {
|
|
1298
754
|
ObjectSet as $ObjectSet,
|
|
1299
755
|
Osdk as $Osdk,
|
|
1300
756
|
OsdkObject as $OsdkObject,
|
|
1301
757
|
PropertyValueWireToClient as $PropType,
|
|
1302
758
|
SingleLinkAccessor as $SingleLinkAccessor,
|
|
1303
|
-
} from '@osdk/
|
|
759
|
+
} from '@osdk/client';
|
|
1304
760
|
|
|
1305
761
|
export namespace Todo {
|
|
1306
762
|
export type PropertyKeys = 'id' | 'body' | 'complete';
|
|
@@ -1333,13 +789,13 @@ describe("generator", () => {
|
|
|
1333
789
|
export interface Todo extends $ObjectTypeDefinition {
|
|
1334
790
|
osdkMetadata: typeof $osdkMetadata;
|
|
1335
791
|
type: 'object';
|
|
1336
|
-
apiName: '
|
|
792
|
+
apiName: 'Todo';
|
|
1337
793
|
__DefinitionMetadata?: {
|
|
1338
794
|
objectSet: Todo.ObjectSet;
|
|
1339
795
|
props: Todo.Props;
|
|
1340
796
|
linksType: Todo.Links;
|
|
1341
797
|
strictProps: Todo.StrictProps;
|
|
1342
|
-
apiName: '
|
|
798
|
+
apiName: 'Todo';
|
|
1343
799
|
description: 'Its a todo item.';
|
|
1344
800
|
displayName: 'AwesomeTodoDisplayname';
|
|
1345
801
|
icon: {
|
|
@@ -1347,14 +803,14 @@ describe("generator", () => {
|
|
|
1347
803
|
name: 'document';
|
|
1348
804
|
color: 'blue';
|
|
1349
805
|
};
|
|
1350
|
-
implements: ['
|
|
806
|
+
implements: ['SomeInterface'];
|
|
1351
807
|
interfaceMap: {
|
|
1352
|
-
|
|
808
|
+
SomeInterface: {
|
|
1353
809
|
SomeProperty: 'body';
|
|
1354
810
|
};
|
|
1355
811
|
};
|
|
1356
812
|
inverseInterfaceMap: {
|
|
1357
|
-
|
|
813
|
+
SomeInterface: {
|
|
1358
814
|
body: 'SomeProperty';
|
|
1359
815
|
};
|
|
1360
816
|
};
|
|
@@ -1388,14 +844,14 @@ describe("generator", () => {
|
|
|
1388
844
|
|
|
1389
845
|
export const Todo: Todo = {
|
|
1390
846
|
type: 'object',
|
|
1391
|
-
apiName: '
|
|
847
|
+
apiName: 'Todo',
|
|
1392
848
|
osdkMetadata: $osdkMetadata,
|
|
1393
849
|
};
|
|
1394
850
|
",
|
|
1395
851
|
"/foo/ontology/queries.ts": "export { getCount } from './queries/getCount.js';
|
|
1396
852
|
export { returnsTodo } from './queries/returnsTodo.js';
|
|
1397
853
|
",
|
|
1398
|
-
"/foo/ontology/queries/getCount.ts": "import type { QueryDefinition, QueryParam, QueryResult, VersionBound } from '@osdk/
|
|
854
|
+
"/foo/ontology/queries/getCount.ts": "import type { QueryDefinition, QueryParam, QueryResult, VersionBound } from '@osdk/client';
|
|
1399
855
|
import type { $ExpectedClientVersion } from '../../OntologyMetadata.js';
|
|
1400
856
|
import { $osdkMetadata } from '../../OntologyMetadata.js';
|
|
1401
857
|
|
|
@@ -1416,7 +872,7 @@ describe("generator", () => {
|
|
|
1416
872
|
|
|
1417
873
|
export interface getCount extends QueryDefinition<getCount.Signature>, VersionBound<$ExpectedClientVersion> {
|
|
1418
874
|
__DefinitionMetadata?: {
|
|
1419
|
-
apiName: '
|
|
875
|
+
apiName: 'getCount';
|
|
1420
876
|
rid: 'rid.query.1';
|
|
1421
877
|
type: 'query';
|
|
1422
878
|
version: '0';
|
|
@@ -1435,20 +891,20 @@ describe("generator", () => {
|
|
|
1435
891
|
};
|
|
1436
892
|
signature: getCount.Signature;
|
|
1437
893
|
};
|
|
1438
|
-
apiName: '
|
|
894
|
+
apiName: 'getCount';
|
|
1439
895
|
type: 'query';
|
|
1440
896
|
version: '0';
|
|
1441
897
|
osdkMetadata: typeof $osdkMetadata;
|
|
1442
898
|
}
|
|
1443
899
|
|
|
1444
900
|
export const getCount: getCount = {
|
|
1445
|
-
apiName: '
|
|
901
|
+
apiName: 'getCount',
|
|
1446
902
|
type: 'query',
|
|
1447
903
|
version: '0',
|
|
1448
904
|
osdkMetadata: $osdkMetadata,
|
|
1449
905
|
};
|
|
1450
906
|
",
|
|
1451
|
-
"/foo/ontology/queries/returnsTodo.ts": "import type { QueryDefinition, QueryParam, QueryResult, VersionBound } from '@osdk/
|
|
907
|
+
"/foo/ontology/queries/returnsTodo.ts": "import type { QueryDefinition, QueryParam, QueryResult, VersionBound } from '@osdk/client';
|
|
1452
908
|
import type { $ExpectedClientVersion } from '../../OntologyMetadata.js';
|
|
1453
909
|
import { $osdkMetadata } from '../../OntologyMetadata.js';
|
|
1454
910
|
import type { Todo } from '../objects/Todo.js';
|
|
@@ -1470,7 +926,7 @@ describe("generator", () => {
|
|
|
1470
926
|
|
|
1471
927
|
export interface returnsTodo extends QueryDefinition<returnsTodo.Signature>, VersionBound<$ExpectedClientVersion> {
|
|
1472
928
|
__DefinitionMetadata?: {
|
|
1473
|
-
apiName: '
|
|
929
|
+
apiName: 'returnsTodo';
|
|
1474
930
|
rid: 'rid.query.2';
|
|
1475
931
|
type: 'query';
|
|
1476
932
|
version: '0';
|
|
@@ -1481,20 +937,603 @@ describe("generator", () => {
|
|
|
1481
937
|
someTodo: {
|
|
1482
938
|
description: 'Random desc so we test jsdoc';
|
|
1483
939
|
nullable: false;
|
|
1484
|
-
object: '
|
|
940
|
+
object: 'Todo';
|
|
1485
941
|
type: 'object';
|
|
1486
942
|
__OsdkTargetType?: Todo;
|
|
1487
943
|
};
|
|
1488
944
|
};
|
|
1489
945
|
output: {
|
|
1490
946
|
nullable: false;
|
|
1491
|
-
object: '
|
|
947
|
+
object: 'Todo';
|
|
1492
948
|
type: 'object';
|
|
1493
949
|
__OsdkTargetType?: Todo;
|
|
1494
950
|
};
|
|
1495
951
|
signature: returnsTodo.Signature;
|
|
1496
952
|
};
|
|
1497
|
-
apiName: '
|
|
953
|
+
apiName: 'returnsTodo';
|
|
954
|
+
type: 'query';
|
|
955
|
+
version: '0';
|
|
956
|
+
osdkMetadata: typeof $osdkMetadata;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
export const returnsTodo: returnsTodo = {
|
|
960
|
+
apiName: 'returnsTodo',
|
|
961
|
+
type: 'query',
|
|
962
|
+
version: '0',
|
|
963
|
+
osdkMetadata: $osdkMetadata,
|
|
964
|
+
};
|
|
965
|
+
",
|
|
966
|
+
}
|
|
967
|
+
`);
|
|
968
|
+
});
|
|
969
|
+
test("throws an error when target destination is not empty", async () => {
|
|
970
|
+
helper.minimalFiles.readdir = vi.fn(async () => ["file"]);
|
|
971
|
+
await expect(async () => {
|
|
972
|
+
await expect(generateClientSdkVersionTwoPointZero(TodoWireOntology, "typescript-sdk/0.0.0 osdk-cli/0.0.0", helper.minimalFiles, BASE_PATH)).rejects.toThrow();
|
|
973
|
+
});
|
|
974
|
+
});
|
|
975
|
+
it("throws an error if a namespace is provided that all top levels do not use", async () => {
|
|
976
|
+
await expect(generateClientSdkVersionTwoPointZero({
|
|
977
|
+
...TodoWireOntology
|
|
978
|
+
}, "", helper.minimalFiles, BASE_PATH, "module", undefined, undefined, undefined, true));
|
|
979
|
+
|
|
980
|
+
// Disabled for now since we can't really enforce it from dev console at the moment
|
|
981
|
+
// .rejects.toThrowErrorMatchingInlineSnapshot(
|
|
982
|
+
// `[Error: Found type { ns:'undefined', shortName: 'Todo'} but it is not in the generation namespace 'foo.bar'. This violates the contract of the generator.]`,
|
|
983
|
+
// );
|
|
984
|
+
});
|
|
985
|
+
it("does not throw an error if a namespace is provided that all top levels use", async () => {
|
|
986
|
+
await expect(generateClientSdkVersionTwoPointZero(fooBarTodoWireOntology, "", helper.minimalFiles, BASE_PATH, "module", undefined, undefined, undefined, true)).resolves.toMatchInlineSnapshot(`undefined`);
|
|
987
|
+
expect(helper.getFiles()["/foo/ontology/objects/foo.bar.Todo.ts"]).toBeUndefined();
|
|
988
|
+
expect(helper.getFiles()["/foo/ontology/objects/Todo.ts"]).not.toBeUndefined();
|
|
989
|
+
expect(tweakedFilesForSnapshotConsistency(helper.getFiles())).toMatchInlineSnapshot(`
|
|
990
|
+
{
|
|
991
|
+
"/foo/OntologyMetadata.ts": "export type $ExpectedClientVersion = 'PLACEHOLDER';
|
|
992
|
+
export const $osdkMetadata = { extraUserAgent: '' };
|
|
993
|
+
|
|
994
|
+
export const $ontologyRid = 'ridHere';
|
|
995
|
+
",
|
|
996
|
+
"/foo/index.ts": "export { deleteTodos, markTodoCompleted } from './ontology/actions.js';
|
|
997
|
+
export * as $Actions from './ontology/actions.js';
|
|
998
|
+
export { SomeInterface } from './ontology/interfaces.js';
|
|
999
|
+
export * as $Interfaces from './ontology/interfaces.js';
|
|
1000
|
+
export { Person, Todo } from './ontology/objects.js';
|
|
1001
|
+
export * as $Objects from './ontology/objects.js';
|
|
1002
|
+
export { getCount, returnsTodo } from './ontology/queries.js';
|
|
1003
|
+
export * as $Queries from './ontology/queries.js';
|
|
1004
|
+
export { $osdkMetadata } from './OntologyMetadata.js';
|
|
1005
|
+
export { $ontologyRid } from './OntologyMetadata.js';
|
|
1006
|
+
",
|
|
1007
|
+
"/foo/ontology/actions.ts": "export { deleteTodos } from './actions/deleteTodos.js';
|
|
1008
|
+
export { markTodoCompleted } from './actions/markTodoCompleted.js';
|
|
1009
|
+
",
|
|
1010
|
+
"/foo/ontology/actions/deleteTodos.ts": "import type {
|
|
1011
|
+
ActionDefinition,
|
|
1012
|
+
ActionMetadata,
|
|
1013
|
+
ActionParam,
|
|
1014
|
+
ActionReturnTypeForOptions,
|
|
1015
|
+
ApplyActionOptions,
|
|
1016
|
+
ApplyBatchActionOptions,
|
|
1017
|
+
} from '@osdk/api';
|
|
1018
|
+
import { $osdkMetadata } from '../../OntologyMetadata.js';
|
|
1019
|
+
import type { Todo } from '../objects/Todo.js';
|
|
1020
|
+
|
|
1021
|
+
export namespace deleteTodos {
|
|
1022
|
+
// Represents the definition of the parameters for the action
|
|
1023
|
+
export type ParamsDefinition = {
|
|
1024
|
+
object: {
|
|
1025
|
+
description: 'Todo(s) to be deleted';
|
|
1026
|
+
multiplicity: true;
|
|
1027
|
+
nullable: true;
|
|
1028
|
+
type: ActionMetadata.DataType.Object<Todo>;
|
|
1029
|
+
};
|
|
1030
|
+
};
|
|
1031
|
+
|
|
1032
|
+
/**
|
|
1033
|
+
* An action which takes in an array of objects
|
|
1034
|
+
*/
|
|
1035
|
+
export interface Params {
|
|
1036
|
+
/**
|
|
1037
|
+
* Todo(s) to be deleted
|
|
1038
|
+
*/
|
|
1039
|
+
readonly object?: ReadonlyArray<ActionParam.ObjectType<Todo>>;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
// Represents a fqn of the action
|
|
1043
|
+
export interface Signatures {
|
|
1044
|
+
/**
|
|
1045
|
+
* An action which takes in an array of objects
|
|
1046
|
+
*/
|
|
1047
|
+
applyAction<P extends deleteTodos.Params, OP extends ApplyActionOptions>(
|
|
1048
|
+
args: P,
|
|
1049
|
+
options?: OP,
|
|
1050
|
+
): Promise<ActionReturnTypeForOptions<OP>>;
|
|
1051
|
+
|
|
1052
|
+
batchApplyAction<P extends ReadonlyArray<deleteTodos.Params>, OP extends ApplyBatchActionOptions>(
|
|
1053
|
+
args: P,
|
|
1054
|
+
options?: OP,
|
|
1055
|
+
): Promise<ActionReturnTypeForOptions<OP>>;
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
/**
|
|
1060
|
+
* An action which takes in an array of objects
|
|
1061
|
+
* @param {ActionParam.ObjectType<Todo>} [object] Todo(s) to be deleted
|
|
1062
|
+
*/
|
|
1063
|
+
export interface deleteTodos extends ActionDefinition<deleteTodos.Signatures> {
|
|
1064
|
+
__DefinitionMetadata?: {
|
|
1065
|
+
apiName: 'foo.bar.deleteTodos';
|
|
1066
|
+
description: 'An action which takes in an array of objects';
|
|
1067
|
+
modifiedEntities: {};
|
|
1068
|
+
parameters: deleteTodos.ParamsDefinition;
|
|
1069
|
+
rid: 'ri.ontology.main.action-type.8f94017d-cf17-4fa8-84c3-8e01e5d594f2';
|
|
1070
|
+
status: 'ACTIVE';
|
|
1071
|
+
type: 'action';
|
|
1072
|
+
|
|
1073
|
+
signatures: deleteTodos.Signatures;
|
|
1074
|
+
};
|
|
1075
|
+
apiName: 'foo.bar.deleteTodos';
|
|
1076
|
+
type: 'action';
|
|
1077
|
+
osdkMetadata: typeof $osdkMetadata;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
export const deleteTodos: deleteTodos = {
|
|
1081
|
+
apiName: 'foo.bar.deleteTodos',
|
|
1082
|
+
type: 'action',
|
|
1083
|
+
osdkMetadata: $osdkMetadata,
|
|
1084
|
+
};
|
|
1085
|
+
",
|
|
1086
|
+
"/foo/ontology/actions/markTodoCompleted.ts": "import type {
|
|
1087
|
+
ActionDefinition,
|
|
1088
|
+
ActionMetadata,
|
|
1089
|
+
ActionParam,
|
|
1090
|
+
ActionReturnTypeForOptions,
|
|
1091
|
+
ApplyActionOptions,
|
|
1092
|
+
ApplyBatchActionOptions,
|
|
1093
|
+
} from '@osdk/api';
|
|
1094
|
+
import { $osdkMetadata } from '../../OntologyMetadata.js';
|
|
1095
|
+
import type { Todo } from '../objects/Todo.js';
|
|
1096
|
+
|
|
1097
|
+
export namespace markTodoCompleted {
|
|
1098
|
+
// Represents the definition of the parameters for the action
|
|
1099
|
+
export type ParamsDefinition = {
|
|
1100
|
+
object: {
|
|
1101
|
+
description: 'A Todo to mark completed';
|
|
1102
|
+
multiplicity: false;
|
|
1103
|
+
nullable: true;
|
|
1104
|
+
type: ActionMetadata.DataType.Object<Todo>;
|
|
1105
|
+
};
|
|
1106
|
+
};
|
|
1107
|
+
|
|
1108
|
+
/**
|
|
1109
|
+
* An action which takes different types of parameters
|
|
1110
|
+
*/
|
|
1111
|
+
export interface Params {
|
|
1112
|
+
/**
|
|
1113
|
+
* A Todo to mark completed
|
|
1114
|
+
*/
|
|
1115
|
+
readonly object?: ActionParam.ObjectType<Todo>;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
// Represents a fqn of the action
|
|
1119
|
+
export interface Signatures {
|
|
1120
|
+
/**
|
|
1121
|
+
* An action which takes different types of parameters
|
|
1122
|
+
*/
|
|
1123
|
+
applyAction<P extends markTodoCompleted.Params, OP extends ApplyActionOptions>(
|
|
1124
|
+
args: P,
|
|
1125
|
+
options?: OP,
|
|
1126
|
+
): Promise<ActionReturnTypeForOptions<OP>>;
|
|
1127
|
+
|
|
1128
|
+
batchApplyAction<P extends ReadonlyArray<markTodoCompleted.Params>, OP extends ApplyBatchActionOptions>(
|
|
1129
|
+
args: P,
|
|
1130
|
+
options?: OP,
|
|
1131
|
+
): Promise<ActionReturnTypeForOptions<OP>>;
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
/**
|
|
1136
|
+
* An action which takes different types of parameters
|
|
1137
|
+
* @param {ActionParam.ObjectType<Todo>} [object] A Todo to mark completed
|
|
1138
|
+
*/
|
|
1139
|
+
export interface markTodoCompleted extends ActionDefinition<markTodoCompleted.Signatures> {
|
|
1140
|
+
__DefinitionMetadata?: {
|
|
1141
|
+
apiName: 'foo.bar.markTodoCompleted';
|
|
1142
|
+
description: 'An action which takes different types of parameters';
|
|
1143
|
+
modifiedEntities: {
|
|
1144
|
+
'foo.bar.Todo': {
|
|
1145
|
+
created: false;
|
|
1146
|
+
modified: true;
|
|
1147
|
+
};
|
|
1148
|
+
};
|
|
1149
|
+
parameters: markTodoCompleted.ParamsDefinition;
|
|
1150
|
+
rid: 'ri.ontology.main.action-type.9f84017d-cf17-4fa8-84c3-8e01e5d594f2';
|
|
1151
|
+
status: 'ACTIVE';
|
|
1152
|
+
type: 'action';
|
|
1153
|
+
|
|
1154
|
+
signatures: markTodoCompleted.Signatures;
|
|
1155
|
+
};
|
|
1156
|
+
apiName: 'foo.bar.markTodoCompleted';
|
|
1157
|
+
type: 'action';
|
|
1158
|
+
osdkMetadata: typeof $osdkMetadata;
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
export const markTodoCompleted: markTodoCompleted = {
|
|
1162
|
+
apiName: 'foo.bar.markTodoCompleted',
|
|
1163
|
+
type: 'action',
|
|
1164
|
+
osdkMetadata: $osdkMetadata,
|
|
1165
|
+
};
|
|
1166
|
+
",
|
|
1167
|
+
"/foo/ontology/interfaces.ts": "export { SomeInterface } from './interfaces/SomeInterface.js';
|
|
1168
|
+
",
|
|
1169
|
+
"/foo/ontology/interfaces/SomeInterface.ts": "import type { PropertyDef as $PropertyDef } from '@osdk/api';
|
|
1170
|
+
import { $osdkMetadata } from '../../OntologyMetadata.js';
|
|
1171
|
+
|
|
1172
|
+
import type {
|
|
1173
|
+
InterfaceDefinition as $InterfaceDefinition,
|
|
1174
|
+
ObjectSet as $ObjectSet,
|
|
1175
|
+
Osdk as $Osdk,
|
|
1176
|
+
PropertyValueWireToClient as $PropType,
|
|
1177
|
+
} from '@osdk/api';
|
|
1178
|
+
|
|
1179
|
+
export type OsdkObjectLinks$SomeInterface = {};
|
|
1180
|
+
|
|
1181
|
+
export namespace SomeInterface {
|
|
1182
|
+
export type PropertyKeys = 'SomeProperty';
|
|
1183
|
+
|
|
1184
|
+
export interface Props {
|
|
1185
|
+
readonly SomeProperty: $PropType['string'] | undefined;
|
|
1186
|
+
}
|
|
1187
|
+
export type StrictProps = Props;
|
|
1188
|
+
|
|
1189
|
+
export interface ObjectSet extends $ObjectSet<SomeInterface, SomeInterface.ObjectSet> {}
|
|
1190
|
+
|
|
1191
|
+
export type OsdkInstance<
|
|
1192
|
+
OPTIONS extends never | '$rid' = never,
|
|
1193
|
+
K extends keyof SomeInterface.Props = keyof SomeInterface.Props,
|
|
1194
|
+
> = $Osdk.Instance<SomeInterface, OPTIONS, K>;
|
|
1195
|
+
|
|
1196
|
+
/** @deprecated use OsdkInstance */
|
|
1197
|
+
export type OsdkObject<
|
|
1198
|
+
OPTIONS extends never | '$rid' = never,
|
|
1199
|
+
K extends keyof SomeInterface.Props = keyof SomeInterface.Props,
|
|
1200
|
+
> = OsdkInstance<OPTIONS, K>;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
export interface SomeInterface extends $InterfaceDefinition {
|
|
1204
|
+
osdkMetadata: typeof $osdkMetadata;
|
|
1205
|
+
type: 'interface';
|
|
1206
|
+
apiName: 'foo.bar.SomeInterface';
|
|
1207
|
+
__DefinitionMetadata?: {
|
|
1208
|
+
objectSet: SomeInterface.ObjectSet;
|
|
1209
|
+
props: SomeInterface.Props;
|
|
1210
|
+
linksType: OsdkObjectLinks$SomeInterface;
|
|
1211
|
+
strictProps: SomeInterface.StrictProps;
|
|
1212
|
+
apiName: 'foo.bar.SomeInterface';
|
|
1213
|
+
description: 'Some interface';
|
|
1214
|
+
displayName: 'Sum Interface';
|
|
1215
|
+
implementedBy: [];
|
|
1216
|
+
implements: [];
|
|
1217
|
+
links: {};
|
|
1218
|
+
properties: {
|
|
1219
|
+
/**
|
|
1220
|
+
* display name: 'Sum Property',
|
|
1221
|
+
* description: Some property
|
|
1222
|
+
*/
|
|
1223
|
+
SomeProperty: $PropertyDef<'string', 'nullable', 'single'>;
|
|
1224
|
+
};
|
|
1225
|
+
rid: 'idk';
|
|
1226
|
+
type: 'interface';
|
|
1227
|
+
};
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
export const SomeInterface: SomeInterface = {
|
|
1231
|
+
type: 'interface',
|
|
1232
|
+
apiName: 'foo.bar.SomeInterface',
|
|
1233
|
+
osdkMetadata: $osdkMetadata,
|
|
1234
|
+
};
|
|
1235
|
+
",
|
|
1236
|
+
"/foo/ontology/objects.ts": "export { Person } from './objects/Person.js';
|
|
1237
|
+
export { Todo } from './objects/Todo.js';
|
|
1238
|
+
",
|
|
1239
|
+
"/foo/ontology/objects/Person.ts": "import type { PropertyDef as $PropertyDef } from '@osdk/api';
|
|
1240
|
+
import { $osdkMetadata } from '../../OntologyMetadata.js';
|
|
1241
|
+
import type { $ExpectedClientVersion } from '../../OntologyMetadata.js';
|
|
1242
|
+
import type { Todo } from './Todo.js';
|
|
1243
|
+
import type {
|
|
1244
|
+
PropertyKeys as $PropertyKeys,
|
|
1245
|
+
ObjectTypeDefinition as $ObjectTypeDefinition,
|
|
1246
|
+
ObjectMetadata as $ObjectMetadata,
|
|
1247
|
+
} from '@osdk/api';
|
|
1248
|
+
import type {
|
|
1249
|
+
ObjectSet as $ObjectSet,
|
|
1250
|
+
Osdk as $Osdk,
|
|
1251
|
+
OsdkObject as $OsdkObject,
|
|
1252
|
+
PropertyValueWireToClient as $PropType,
|
|
1253
|
+
SingleLinkAccessor as $SingleLinkAccessor,
|
|
1254
|
+
} from '@osdk/api';
|
|
1255
|
+
|
|
1256
|
+
export namespace Person {
|
|
1257
|
+
export type PropertyKeys = 'email';
|
|
1258
|
+
|
|
1259
|
+
export interface Links {
|
|
1260
|
+
readonly Todos: Todo.ObjectSet;
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
export interface Props {
|
|
1264
|
+
readonly email: $PropType['string'];
|
|
1265
|
+
}
|
|
1266
|
+
export type StrictProps = Props;
|
|
1267
|
+
|
|
1268
|
+
export interface ObjectSet extends $ObjectSet<Person, Person.ObjectSet> {}
|
|
1269
|
+
|
|
1270
|
+
export type OsdkInstance<
|
|
1271
|
+
OPTIONS extends never | '$rid' = never,
|
|
1272
|
+
K extends keyof Person.Props = keyof Person.Props,
|
|
1273
|
+
> = $Osdk.Instance<Person, OPTIONS, K>;
|
|
1274
|
+
|
|
1275
|
+
/** @deprecated use OsdkInstance */
|
|
1276
|
+
export type OsdkObject<
|
|
1277
|
+
OPTIONS extends never | '$rid' = never,
|
|
1278
|
+
K extends keyof Person.Props = keyof Person.Props,
|
|
1279
|
+
> = OsdkInstance<OPTIONS, K>;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
export interface Person extends $ObjectTypeDefinition {
|
|
1283
|
+
osdkMetadata: typeof $osdkMetadata;
|
|
1284
|
+
type: 'object';
|
|
1285
|
+
apiName: 'foo.bar.Person';
|
|
1286
|
+
__DefinitionMetadata?: {
|
|
1287
|
+
objectSet: Person.ObjectSet;
|
|
1288
|
+
props: Person.Props;
|
|
1289
|
+
linksType: Person.Links;
|
|
1290
|
+
strictProps: Person.StrictProps;
|
|
1291
|
+
apiName: 'foo.bar.Person';
|
|
1292
|
+
description: 'A person';
|
|
1293
|
+
displayName: 'Person';
|
|
1294
|
+
icon: {
|
|
1295
|
+
type: 'blueprint';
|
|
1296
|
+
name: 'document';
|
|
1297
|
+
color: 'blue';
|
|
1298
|
+
};
|
|
1299
|
+
implements: [];
|
|
1300
|
+
interfaceMap: {};
|
|
1301
|
+
inverseInterfaceMap: {};
|
|
1302
|
+
links: {
|
|
1303
|
+
Todos: $ObjectMetadata.Link<Todo, true>;
|
|
1304
|
+
};
|
|
1305
|
+
pluralDisplayName: 'Persons';
|
|
1306
|
+
primaryKeyApiName: 'email';
|
|
1307
|
+
primaryKeyType: 'string';
|
|
1308
|
+
properties: {
|
|
1309
|
+
/**
|
|
1310
|
+
* (no ontology metadata)
|
|
1311
|
+
*/
|
|
1312
|
+
email: $PropertyDef<'string', 'non-nullable', 'single'>;
|
|
1313
|
+
};
|
|
1314
|
+
rid: 'ridForPerson';
|
|
1315
|
+
status: 'ACTIVE';
|
|
1316
|
+
titleProperty: 'email';
|
|
1317
|
+
type: 'object';
|
|
1318
|
+
};
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
export const Person: Person = {
|
|
1322
|
+
type: 'object',
|
|
1323
|
+
apiName: 'foo.bar.Person',
|
|
1324
|
+
osdkMetadata: $osdkMetadata,
|
|
1325
|
+
};
|
|
1326
|
+
",
|
|
1327
|
+
"/foo/ontology/objects/Todo.ts": "import type { PropertyDef as $PropertyDef } from '@osdk/api';
|
|
1328
|
+
import { $osdkMetadata } from '../../OntologyMetadata.js';
|
|
1329
|
+
import type { $ExpectedClientVersion } from '../../OntologyMetadata.js';
|
|
1330
|
+
import type { Person } from './Person.js';
|
|
1331
|
+
import type {
|
|
1332
|
+
PropertyKeys as $PropertyKeys,
|
|
1333
|
+
ObjectTypeDefinition as $ObjectTypeDefinition,
|
|
1334
|
+
ObjectMetadata as $ObjectMetadata,
|
|
1335
|
+
} from '@osdk/api';
|
|
1336
|
+
import type {
|
|
1337
|
+
ObjectSet as $ObjectSet,
|
|
1338
|
+
Osdk as $Osdk,
|
|
1339
|
+
OsdkObject as $OsdkObject,
|
|
1340
|
+
PropertyValueWireToClient as $PropType,
|
|
1341
|
+
SingleLinkAccessor as $SingleLinkAccessor,
|
|
1342
|
+
} from '@osdk/api';
|
|
1343
|
+
|
|
1344
|
+
export namespace Todo {
|
|
1345
|
+
export type PropertyKeys = 'id' | 'body' | 'complete';
|
|
1346
|
+
|
|
1347
|
+
export interface Links {
|
|
1348
|
+
readonly Assignee: $SingleLinkAccessor<Person>;
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
export interface Props {
|
|
1352
|
+
readonly body: $PropType['string'] | undefined;
|
|
1353
|
+
readonly complete: $PropType['boolean'] | undefined;
|
|
1354
|
+
readonly id: $PropType['integer'];
|
|
1355
|
+
}
|
|
1356
|
+
export type StrictProps = Props;
|
|
1357
|
+
|
|
1358
|
+
export interface ObjectSet extends $ObjectSet<Todo, Todo.ObjectSet> {}
|
|
1359
|
+
|
|
1360
|
+
export type OsdkInstance<
|
|
1361
|
+
OPTIONS extends never | '$rid' = never,
|
|
1362
|
+
K extends keyof Todo.Props = keyof Todo.Props,
|
|
1363
|
+
> = $Osdk.Instance<Todo, OPTIONS, K>;
|
|
1364
|
+
|
|
1365
|
+
/** @deprecated use OsdkInstance */
|
|
1366
|
+
export type OsdkObject<
|
|
1367
|
+
OPTIONS extends never | '$rid' = never,
|
|
1368
|
+
K extends keyof Todo.Props = keyof Todo.Props,
|
|
1369
|
+
> = OsdkInstance<OPTIONS, K>;
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
export interface Todo extends $ObjectTypeDefinition {
|
|
1373
|
+
osdkMetadata: typeof $osdkMetadata;
|
|
1374
|
+
type: 'object';
|
|
1375
|
+
apiName: 'foo.bar.Todo';
|
|
1376
|
+
__DefinitionMetadata?: {
|
|
1377
|
+
objectSet: Todo.ObjectSet;
|
|
1378
|
+
props: Todo.Props;
|
|
1379
|
+
linksType: Todo.Links;
|
|
1380
|
+
strictProps: Todo.StrictProps;
|
|
1381
|
+
apiName: 'foo.bar.Todo';
|
|
1382
|
+
description: 'Its a todo item.';
|
|
1383
|
+
displayName: 'AwesomeTodoDisplayname';
|
|
1384
|
+
icon: {
|
|
1385
|
+
type: 'blueprint';
|
|
1386
|
+
name: 'document';
|
|
1387
|
+
color: 'blue';
|
|
1388
|
+
};
|
|
1389
|
+
implements: ['foo.bar.SomeInterface'];
|
|
1390
|
+
interfaceMap: {
|
|
1391
|
+
'foo.bar.SomeInterface': {
|
|
1392
|
+
SomeProperty: 'body';
|
|
1393
|
+
};
|
|
1394
|
+
};
|
|
1395
|
+
inverseInterfaceMap: {
|
|
1396
|
+
'foo.bar.SomeInterface': {
|
|
1397
|
+
body: 'SomeProperty';
|
|
1398
|
+
};
|
|
1399
|
+
};
|
|
1400
|
+
links: {
|
|
1401
|
+
Assignee: $ObjectMetadata.Link<Person, false>;
|
|
1402
|
+
};
|
|
1403
|
+
pluralDisplayName: 'AwesomeTodoDisplayNames';
|
|
1404
|
+
primaryKeyApiName: 'id';
|
|
1405
|
+
primaryKeyType: 'integer';
|
|
1406
|
+
properties: {
|
|
1407
|
+
/**
|
|
1408
|
+
* display name: 'Body',
|
|
1409
|
+
* description: The text of the todo
|
|
1410
|
+
*/
|
|
1411
|
+
body: $PropertyDef<'string', 'nullable', 'single'>;
|
|
1412
|
+
/**
|
|
1413
|
+
* (no ontology metadata)
|
|
1414
|
+
*/
|
|
1415
|
+
complete: $PropertyDef<'boolean', 'nullable', 'single'>;
|
|
1416
|
+
/**
|
|
1417
|
+
* (no ontology metadata)
|
|
1418
|
+
*/
|
|
1419
|
+
id: $PropertyDef<'integer', 'non-nullable', 'single'>;
|
|
1420
|
+
};
|
|
1421
|
+
rid: 'ridForTodo';
|
|
1422
|
+
status: 'ACTIVE';
|
|
1423
|
+
titleProperty: 'body';
|
|
1424
|
+
type: 'object';
|
|
1425
|
+
};
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
export const Todo: Todo = {
|
|
1429
|
+
type: 'object',
|
|
1430
|
+
apiName: 'foo.bar.Todo',
|
|
1431
|
+
osdkMetadata: $osdkMetadata,
|
|
1432
|
+
};
|
|
1433
|
+
",
|
|
1434
|
+
"/foo/ontology/queries.ts": "export { getCount } from './queries/getCount.js';
|
|
1435
|
+
export { returnsTodo } from './queries/returnsTodo.js';
|
|
1436
|
+
",
|
|
1437
|
+
"/foo/ontology/queries/getCount.ts": "import type { QueryDefinition, QueryParam, QueryResult, VersionBound } from '@osdk/api';
|
|
1438
|
+
import type { $ExpectedClientVersion } from '../../OntologyMetadata.js';
|
|
1439
|
+
import { $osdkMetadata } from '../../OntologyMetadata.js';
|
|
1440
|
+
|
|
1441
|
+
export namespace getCount {
|
|
1442
|
+
export interface Signature {
|
|
1443
|
+
(query: getCount.Parameters): Promise<getCount.ReturnType>;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
export interface Parameters {
|
|
1447
|
+
/**
|
|
1448
|
+
* (no ontology metadata)
|
|
1449
|
+
*/
|
|
1450
|
+
readonly completed: QueryParam.PrimitiveType<'boolean'>;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
export type ReturnType = QueryResult.PrimitiveType<'integer'>;
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
export interface getCount extends QueryDefinition<getCount.Signature>, VersionBound<$ExpectedClientVersion> {
|
|
1457
|
+
__DefinitionMetadata?: {
|
|
1458
|
+
apiName: 'foo.bar.getCount';
|
|
1459
|
+
rid: 'rid.query.1';
|
|
1460
|
+
type: 'query';
|
|
1461
|
+
version: '0';
|
|
1462
|
+
parameters: {
|
|
1463
|
+
/**
|
|
1464
|
+
* (no ontology metadata)
|
|
1465
|
+
*/
|
|
1466
|
+
completed: {
|
|
1467
|
+
nullable: false;
|
|
1468
|
+
type: 'boolean';
|
|
1469
|
+
};
|
|
1470
|
+
};
|
|
1471
|
+
output: {
|
|
1472
|
+
nullable: false;
|
|
1473
|
+
type: 'integer';
|
|
1474
|
+
};
|
|
1475
|
+
signature: getCount.Signature;
|
|
1476
|
+
};
|
|
1477
|
+
apiName: 'foo.bar.getCount';
|
|
1478
|
+
type: 'query';
|
|
1479
|
+
version: '0';
|
|
1480
|
+
osdkMetadata: typeof $osdkMetadata;
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
export const getCount: getCount = {
|
|
1484
|
+
apiName: 'foo.bar.getCount',
|
|
1485
|
+
type: 'query',
|
|
1486
|
+
version: '0',
|
|
1487
|
+
osdkMetadata: $osdkMetadata,
|
|
1488
|
+
};
|
|
1489
|
+
",
|
|
1490
|
+
"/foo/ontology/queries/returnsTodo.ts": "import type { QueryDefinition, QueryParam, QueryResult, VersionBound } from '@osdk/api';
|
|
1491
|
+
import type { $ExpectedClientVersion } from '../../OntologyMetadata.js';
|
|
1492
|
+
import { $osdkMetadata } from '../../OntologyMetadata.js';
|
|
1493
|
+
import type { Todo } from '../objects/Todo.js';
|
|
1494
|
+
|
|
1495
|
+
export namespace returnsTodo {
|
|
1496
|
+
export interface Signature {
|
|
1497
|
+
(query: returnsTodo.Parameters): Promise<returnsTodo.ReturnType>;
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
export interface Parameters {
|
|
1501
|
+
/**
|
|
1502
|
+
* description: Random desc so we test jsdoc
|
|
1503
|
+
*/
|
|
1504
|
+
readonly someTodo: QueryParam.ObjectType<Todo>;
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
export type ReturnType = QueryResult.ObjectType<Todo>;
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
export interface returnsTodo extends QueryDefinition<returnsTodo.Signature>, VersionBound<$ExpectedClientVersion> {
|
|
1511
|
+
__DefinitionMetadata?: {
|
|
1512
|
+
apiName: 'foo.bar.returnsTodo';
|
|
1513
|
+
rid: 'rid.query.2';
|
|
1514
|
+
type: 'query';
|
|
1515
|
+
version: '0';
|
|
1516
|
+
parameters: {
|
|
1517
|
+
/**
|
|
1518
|
+
* description: Random desc so we test jsdoc
|
|
1519
|
+
*/
|
|
1520
|
+
someTodo: {
|
|
1521
|
+
description: 'Random desc so we test jsdoc';
|
|
1522
|
+
nullable: false;
|
|
1523
|
+
object: 'foo.bar.Todo';
|
|
1524
|
+
type: 'object';
|
|
1525
|
+
__OsdkTargetType?: Todo;
|
|
1526
|
+
};
|
|
1527
|
+
};
|
|
1528
|
+
output: {
|
|
1529
|
+
nullable: false;
|
|
1530
|
+
object: 'foo.bar.Todo';
|
|
1531
|
+
type: 'object';
|
|
1532
|
+
__OsdkTargetType?: Todo;
|
|
1533
|
+
};
|
|
1534
|
+
signature: returnsTodo.Signature;
|
|
1535
|
+
};
|
|
1536
|
+
apiName: 'foo.bar.returnsTodo';
|
|
1498
1537
|
type: 'query';
|
|
1499
1538
|
version: '0';
|
|
1500
1539
|
osdkMetadata: typeof $osdkMetadata;
|
|
@@ -1545,6 +1584,7 @@ describe("generator", () => {
|
|
|
1545
1584
|
describe("$ontologyRid", () => {
|
|
1546
1585
|
it("does not exist when an ontology api name is provided", async () => {
|
|
1547
1586
|
await expect(generateClientSdkVersionTwoPointZero(fooBarTodoWireOntology, "", helper.minimalFiles, "/foo", "module", new Map())).resolves.toMatchInlineSnapshot(`undefined`);
|
|
1587
|
+
|
|
1548
1588
|
// expect(helper.getFiles()["/foo/index.ts"]).not.toContain(
|
|
1549
1589
|
// "$ontologyRid",
|
|
1550
1590
|
// );
|
|
@@ -1798,7 +1838,9 @@ describe("generator", () => {
|
|
|
1798
1838
|
});
|
|
1799
1839
|
});
|
|
1800
1840
|
it("can generate an sdk package that is entirely a library", async () => {
|
|
1841
|
+
const mockConsola = vi.spyOn(consola, "info");
|
|
1801
1842
|
await expect(generateClientSdkVersionTwoPointZero(referencedOntology, "", helper.minimalFiles, BASE_PATH, "module")).resolves.toMatchInlineSnapshot(`undefined`);
|
|
1843
|
+
expect(mockConsola).toHaveBeenCalledWith(`{"type":"futureUnknownType"} is not a supported propertyType`);
|
|
1802
1844
|
expect(tweakedFilesForSnapshotConsistency(helper.getFiles())).toMatchInlineSnapshot(`
|
|
1803
1845
|
{
|
|
1804
1846
|
"/foo/OntologyMetadata.ts": "export type $ExpectedClientVersion = 'PLACEHOLDER';
|
|
@@ -1814,6 +1856,7 @@ describe("generator", () => {
|
|
|
1814
1856
|
export * as $Objects from './ontology/objects.js';
|
|
1815
1857
|
export {} from './ontology/queries.js';
|
|
1816
1858
|
export * as $Queries from './ontology/queries.js';
|
|
1859
|
+
export { $osdkMetadata } from './OntologyMetadata.js';
|
|
1817
1860
|
export { $ontologyRid } from './OntologyMetadata.js';
|
|
1818
1861
|
",
|
|
1819
1862
|
"/foo/ontology/actions.ts": "export {};
|
|
@@ -1865,6 +1908,7 @@ describe("generator", () => {
|
|
|
1865
1908
|
strictProps: SomeInterface.StrictProps;
|
|
1866
1909
|
apiName: 'com.example.dep.SomeInterface';
|
|
1867
1910
|
displayName: 'Sum Interface';
|
|
1911
|
+
implementedBy: [];
|
|
1868
1912
|
implements: [];
|
|
1869
1913
|
links: {};
|
|
1870
1914
|
properties: {
|