@azure-tools/typespec-ts 0.54.0 → 0.55.0-dev.6
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/README.md +0 -4
- package/dist/src/contextManager.d.ts +5 -5
- package/dist/src/contextManager.d.ts.map +1 -1
- package/dist/src/contextManager.js +3 -3
- package/dist/src/contextManager.js.map +1 -1
- package/dist/src/framework/declaration.d.ts +1 -1
- package/dist/src/framework/declaration.d.ts.map +1 -1
- package/dist/src/framework/declaration.js +2 -4
- package/dist/src/framework/declaration.js.map +1 -1
- package/dist/src/framework/dependency.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.d.ts +1 -1
- package/dist/src/framework/hooks/binder.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.js +31 -40
- package/dist/src/framework/hooks/binder.js.map +1 -1
- package/dist/src/framework/hooks/sdkTypes.d.ts +1 -1
- package/dist/src/framework/hooks/sdkTypes.d.ts.map +1 -1
- package/dist/src/framework/hooks/sdkTypes.js +8 -12
- package/dist/src/framework/hooks/sdkTypes.js.map +1 -1
- package/dist/src/framework/hooks/useDependencies.d.ts.map +1 -1
- package/dist/src/framework/hooks/useDependencies.js +1 -1
- package/dist/src/framework/hooks/useDependencies.js.map +1 -1
- package/dist/src/framework/load-static-helpers.d.ts +1 -1
- package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
- package/dist/src/framework/load-static-helpers.js +17 -31
- package/dist/src/framework/load-static-helpers.js.map +1 -1
- package/dist/src/framework/reference.d.ts.map +1 -1
- package/dist/src/framework/reference.js +2 -2
- package/dist/src/framework/reference.js.map +1 -1
- package/dist/src/framework/sample.js +8 -8
- package/dist/src/framework/sample.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +103 -92
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +1 -1
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +140 -140
- package/dist/src/lib.js.map +1 -1
- package/dist/src/metaTree.d.ts +1 -1
- package/dist/src/metaTree.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.d.ts +1 -1
- package/dist/src/modular/buildClassicalClient.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.js +60 -74
- package/dist/src/modular/buildClassicalClient.js.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.d.ts +2 -2
- package/dist/src/modular/buildClassicalOperationGroups.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.js +8 -10
- package/dist/src/modular/buildClassicalOperationGroups.js.map +1 -1
- package/dist/src/modular/buildClientContext.d.ts +2 -2
- package/dist/src/modular/buildClientContext.d.ts.map +1 -1
- package/dist/src/modular/buildClientContext.js +31 -38
- package/dist/src/modular/buildClientContext.js.map +1 -1
- package/dist/src/modular/buildModularOptions.d.ts +1 -1
- package/dist/src/modular/buildModularOptions.d.ts.map +1 -1
- package/dist/src/modular/buildModularOptions.js +5 -6
- package/dist/src/modular/buildModularOptions.js.map +1 -1
- package/dist/src/modular/buildOperations.d.ts +3 -3
- package/dist/src/modular/buildOperations.d.ts.map +1 -1
- package/dist/src/modular/buildOperations.js +23 -25
- package/dist/src/modular/buildOperations.js.map +1 -1
- package/dist/src/modular/buildProjectFiles.d.ts +1 -1
- package/dist/src/modular/buildProjectFiles.d.ts.map +1 -1
- package/dist/src/modular/buildProjectFiles.js +8 -11
- package/dist/src/modular/buildProjectFiles.js.map +1 -1
- package/dist/src/modular/buildRestorePoller.d.ts +1 -1
- package/dist/src/modular/buildRestorePoller.d.ts.map +1 -1
- package/dist/src/modular/buildRestorePoller.js +12 -13
- package/dist/src/modular/buildRestorePoller.js.map +1 -1
- package/dist/src/modular/buildRootIndex.d.ts +2 -2
- package/dist/src/modular/buildRootIndex.d.ts.map +1 -1
- package/dist/src/modular/buildRootIndex.js +36 -50
- package/dist/src/modular/buildRootIndex.js.map +1 -1
- package/dist/src/modular/buildSubpathIndex.d.ts.map +1 -1
- package/dist/src/modular/buildSubpathIndex.js +9 -18
- package/dist/src/modular/buildSubpathIndex.js.map +1 -1
- package/dist/src/modular/emitLoggerFile.d.ts.map +1 -1
- package/dist/src/modular/emitLoggerFile.js +4 -4
- package/dist/src/modular/emitLoggerFile.js.map +1 -1
- package/dist/src/modular/emitModels.d.ts +1 -1
- package/dist/src/modular/emitModels.d.ts.map +1 -1
- package/dist/src/modular/emitModels.js +81 -113
- package/dist/src/modular/emitModels.js.map +1 -1
- package/dist/src/modular/emitModelsOptions.d.ts +1 -1
- package/dist/src/modular/emitModelsOptions.d.ts.map +1 -1
- package/dist/src/modular/emitModelsOptions.js +7 -8
- package/dist/src/modular/emitModelsOptions.js.map +1 -1
- package/dist/src/modular/emitSamples.d.ts.map +1 -1
- package/dist/src/modular/emitSamples.js +69 -77
- package/dist/src/modular/emitSamples.js.map +1 -1
- package/dist/src/modular/emitTests.d.ts.map +1 -1
- package/dist/src/modular/emitTests.js +13 -18
- package/dist/src/modular/emitTests.js.map +1 -1
- package/dist/src/modular/external-dependencies.js +54 -54
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.js +59 -68
- package/dist/src/modular/helpers/classicalOperationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/clientHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.js +31 -54
- package/dist/src/modular/helpers/clientHelpers.js.map +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.js +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.js.map +1 -1
- package/dist/src/modular/helpers/exampleValueHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/exampleValueHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/exampleValueHelpers.js +72 -84
- package/dist/src/modular/helpers/exampleValueHelpers.js.map +1 -1
- package/dist/src/modular/helpers/namingHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/namingHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/namingHelpers.js +7 -10
- package/dist/src/modular/helpers/namingHelpers.js.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.js +204 -288
- package/dist/src/modular/helpers/operationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.js +4 -6
- package/dist/src/modular/helpers/typeHelpers.js.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.js +58 -67
- package/dist/src/modular/serialization/buildDeserializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.js +65 -75
- package/dist/src/modular/serialization/buildSerializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js +73 -90
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/serializeUtils.d.ts.map +1 -1
- package/dist/src/modular/serialization/serializeUtils.js +25 -33
- package/dist/src/modular/serialization/serializeUtils.js.map +1 -1
- package/dist/src/modular/static-helpers-metadata.js +60 -60
- package/dist/src/modular/type-expressions/get-credential-expression.js +1 -1
- package/dist/src/modular/type-expressions/get-credential-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.js +1 -2
- package/dist/src/modular/type-expressions/get-enum-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-model-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-model-expression.js +10 -13
- package/dist/src/modular/type-expressions/get-model-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.js +2 -3
- package/dist/src/modular/type-expressions/get-nullable-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.js +5 -11
- package/dist/src/modular/type-expressions/get-type-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.js.map +1 -1
- package/dist/src/rlc-common/buildClient.d.ts +1 -1
- package/dist/src/rlc-common/buildClient.d.ts.map +1 -1
- package/dist/src/rlc-common/buildClient.js +67 -89
- package/dist/src/rlc-common/buildClient.js.map +1 -1
- package/dist/src/rlc-common/buildClientDefinitions.d.ts.map +1 -1
- package/dist/src/rlc-common/buildClientDefinitions.js +28 -45
- package/dist/src/rlc-common/buildClientDefinitions.js.map +1 -1
- package/dist/src/rlc-common/buildIndexFile.d.ts.map +1 -1
- package/dist/src/rlc-common/buildIndexFile.js +59 -60
- package/dist/src/rlc-common/buildIndexFile.js.map +1 -1
- package/dist/src/rlc-common/buildIsUnexpectedHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js +37 -38
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js.map +1 -1
- package/dist/src/rlc-common/buildLogger.d.ts.map +1 -1
- package/dist/src/rlc-common/buildLogger.js +4 -5
- package/dist/src/rlc-common/buildLogger.js.map +1 -1
- package/dist/src/rlc-common/buildMethodShortcuts.d.ts.map +1 -1
- package/dist/src/rlc-common/buildMethodShortcuts.js +4 -4
- package/dist/src/rlc-common/buildMethodShortcuts.js.map +1 -1
- package/dist/src/rlc-common/buildObjectTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildObjectTypes.js +57 -96
- package/dist/src/rlc-common/buildObjectTypes.js.map +1 -1
- package/dist/src/rlc-common/buildPaginateHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildPaginateHelper.js +2 -2
- package/dist/src/rlc-common/buildPaginateHelper.js.map +1 -1
- package/dist/src/rlc-common/buildParameterTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildParameterTypes.js +71 -61
- package/dist/src/rlc-common/buildParameterTypes.js.map +1 -1
- package/dist/src/rlc-common/buildPollingHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildPollingHelper.js +9 -10
- package/dist/src/rlc-common/buildPollingHelper.js.map +1 -1
- package/dist/src/rlc-common/buildResponseTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildResponseTypes.js +23 -27
- package/dist/src/rlc-common/buildResponseTypes.js.map +1 -1
- package/dist/src/rlc-common/buildSamples.d.ts +1 -1
- package/dist/src/rlc-common/buildSamples.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSamples.js +2 -2
- package/dist/src/rlc-common/buildSchemaType.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSchemaType.js +31 -13
- package/dist/src/rlc-common/buildSchemaType.js.map +1 -1
- package/dist/src/rlc-common/buildSerializeHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSerializeHelper.js +4 -4
- package/dist/src/rlc-common/buildSerializeHelper.js.map +1 -1
- package/dist/src/rlc-common/buildTopLevelIndexFile.d.ts.map +1 -1
- package/dist/src/rlc-common/buildTopLevelIndexFile.js +9 -13
- package/dist/src/rlc-common/buildTopLevelIndexFile.js.map +1 -1
- package/dist/src/rlc-common/helpers/apiVersionUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/apiVersionUtil.js +6 -8
- package/dist/src/rlc-common/helpers/apiVersionUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/importsUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/importsUtil.js +32 -37
- package/dist/src/rlc-common/helpers/importsUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/nameConstructors.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/nameConstructors.js +2 -4
- package/dist/src/rlc-common/helpers/nameConstructors.js.map +1 -1
- package/dist/src/rlc-common/helpers/nameUtils.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/nameUtils.js +17 -23
- package/dist/src/rlc-common/helpers/nameUtils.js.map +1 -1
- package/dist/src/rlc-common/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/operationHelpers.js +16 -31
- package/dist/src/rlc-common/helpers/operationHelpers.js.map +1 -1
- package/dist/src/rlc-common/helpers/packageUtil.js +3 -6
- package/dist/src/rlc-common/helpers/packageUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/pathUtils.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/pathUtils.js +1 -3
- package/dist/src/rlc-common/helpers/pathUtils.js.map +1 -1
- package/dist/src/rlc-common/helpers/schemaHelpers.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/schemaHelpers.js +3 -7
- package/dist/src/rlc-common/helpers/schemaHelpers.js.map +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.js +2 -2
- package/dist/src/rlc-common/helpers/shortcutMethods.js.map +1 -1
- package/dist/src/rlc-common/helpers/typeUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/typeUtil.js +4 -9
- package/dist/src/rlc-common/helpers/typeUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js +7 -11
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js.map +1 -1
- package/dist/src/rlc-common/index.d.ts +28 -28
- package/dist/src/rlc-common/index.d.ts.map +1 -1
- package/dist/src/rlc-common/index.js +28 -28
- package/dist/src/rlc-common/index.js.map +1 -1
- package/dist/src/rlc-common/interfaces.d.ts.map +1 -1
- package/dist/src/rlc-common/interfaces.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js +14 -15
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildChangelogFile.js +2 -3
- package/dist/src/rlc-common/metadata/buildChangelogFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildESLintConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildESLintConfig.js +5 -8
- package/dist/src/rlc-common/metadata/buildESLintConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildLicenseFile.js +1 -1
- package/dist/src/rlc-common/metadata/buildPackageFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildPackageFile.js +33 -37
- package/dist/src/rlc-common/metadata/buildPackageFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildReadmeFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildReadmeFile.js +31 -39
- package/dist/src/rlc-common/metadata/buildReadmeFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildRollupConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildRollupConfig.js +4 -6
- package/dist/src/rlc-common/metadata/buildRollupConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js +3 -5
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildTestConfig.js +11 -12
- package/dist/src/rlc-common/metadata/buildTestConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildTsConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildTsConfig.js +28 -28
- package/dist/src/rlc-common/metadata/buildTsConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildVitestConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildVitestConfig.js +3 -5
- package/dist/src/rlc-common/metadata/buildVitestConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildWarpConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildWarpConfig.js +4 -5
- package/dist/src/rlc-common/metadata/buildWarpConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js +14 -14
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js +24 -29
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js +15 -16
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js +8 -8
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js +28 -31
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js.map +1 -1
- package/dist/src/rlc-common/metadata/utils.js +1 -2
- package/dist/src/rlc-common/metadata/utils.js.map +1 -1
- package/dist/src/rlc-common/test/buildKarmaConfig.js +1 -1
- package/dist/src/rlc-common/test/buildRecordedClient.js +4 -5
- package/dist/src/rlc-common/test/buildRecordedClient.js.map +1 -1
- package/dist/src/rlc-common/test/buildSampleTest.d.ts.map +1 -1
- package/dist/src/rlc-common/test/buildSampleTest.js +3 -4
- package/dist/src/rlc-common/test/buildSampleTest.js.map +1 -1
- package/dist/src/rlc-common/test/buildSnippets.d.ts.map +1 -1
- package/dist/src/rlc-common/test/buildSnippets.js +7 -10
- package/dist/src/rlc-common/test/buildSnippets.js.map +1 -1
- package/dist/src/rlc-common/transformSampleGroups.d.ts.map +1 -1
- package/dist/src/rlc-common/transformSampleGroups.js +41 -45
- package/dist/src/rlc-common/transformSampleGroups.js.map +1 -1
- package/dist/src/testing/index.d.ts.map +1 -1
- package/dist/src/testing/index.js +1 -1
- package/dist/src/testing/index.js.map +1 -1
- package/dist/src/transform/transform.d.ts +1 -1
- package/dist/src/transform/transform.d.ts.map +1 -1
- package/dist/src/transform/transform.js +28 -27
- package/dist/src/transform/transform.js.map +1 -1
- package/dist/src/transform/transformApiVersionInfo.d.ts +1 -1
- package/dist/src/transform/transformApiVersionInfo.d.ts.map +1 -1
- package/dist/src/transform/transformApiVersionInfo.js +12 -14
- package/dist/src/transform/transformApiVersionInfo.js.map +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.d.ts +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.d.ts.map +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.js +11 -14
- package/dist/src/transform/transformHelperFunctionDetails.js.map +1 -1
- package/dist/src/transform/transformParameters.d.ts +2 -2
- package/dist/src/transform/transformParameters.d.ts.map +1 -1
- package/dist/src/transform/transformParameters.js +32 -45
- package/dist/src/transform/transformParameters.js.map +1 -1
- package/dist/src/transform/transformPaths.d.ts +1 -1
- package/dist/src/transform/transformPaths.d.ts.map +1 -1
- package/dist/src/transform/transformPaths.js +19 -23
- package/dist/src/transform/transformPaths.js.map +1 -1
- package/dist/src/transform/transformResponses.d.ts +1 -1
- package/dist/src/transform/transformResponses.d.ts.map +1 -1
- package/dist/src/transform/transformResponses.js +21 -25
- package/dist/src/transform/transformResponses.js.map +1 -1
- package/dist/src/transform/transformSchemas.d.ts.map +1 -1
- package/dist/src/transform/transformSchemas.js +21 -32
- package/dist/src/transform/transformSchemas.js.map +1 -1
- package/dist/src/transform/transformTelemetryInfo.d.ts +1 -1
- package/dist/src/transform/transformTelemetryInfo.d.ts.map +1 -1
- package/dist/src/transform/transformTelemetryInfo.js +3 -3
- package/dist/src/transform/transformTelemetryInfo.js.map +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts.map +1 -1
- package/dist/src/transform/transfromRLCOptions.js +28 -39
- package/dist/src/transform/transfromRLCOptions.js.map +1 -1
- package/dist/src/utils/clientUtils.d.ts +1 -1
- package/dist/src/utils/clientUtils.d.ts.map +1 -1
- package/dist/src/utils/clientUtils.js +15 -23
- package/dist/src/utils/clientUtils.js.map +1 -1
- package/dist/src/utils/credentialUtils.d.ts +1 -1
- package/dist/src/utils/credentialUtils.d.ts.map +1 -1
- package/dist/src/utils/credentialUtils.js +4 -5
- package/dist/src/utils/credentialUtils.js.map +1 -1
- package/dist/src/utils/crossLanguageDef.d.ts.map +1 -1
- package/dist/src/utils/crossLanguageDef.js +11 -15
- package/dist/src/utils/crossLanguageDef.js.map +1 -1
- package/dist/src/utils/emitUtil.d.ts +1 -1
- package/dist/src/utils/emitUtil.d.ts.map +1 -1
- package/dist/src/utils/emitUtil.js +5 -7
- package/dist/src/utils/emitUtil.js.map +1 -1
- package/dist/src/utils/fileSystemUtils.d.ts +2 -0
- package/dist/src/utils/fileSystemUtils.d.ts.map +1 -1
- package/dist/src/utils/fileSystemUtils.js +26 -7
- package/dist/src/utils/fileSystemUtils.js.map +1 -1
- package/dist/src/utils/importHelper.d.ts.map +1 -1
- package/dist/src/utils/importHelper.js +3 -6
- package/dist/src/utils/importHelper.js.map +1 -1
- package/dist/src/utils/interfaces.d.ts +1 -1
- package/dist/src/utils/interfaces.d.ts.map +1 -1
- package/dist/src/utils/mediaTypes.d.ts.map +1 -1
- package/dist/src/utils/mediaTypes.js +7 -19
- package/dist/src/utils/mediaTypes.js.map +1 -1
- package/dist/src/utils/modelUtils.d.ts +5 -5
- package/dist/src/utils/modelUtils.d.ts.map +1 -1
- package/dist/src/utils/modelUtils.js +168 -257
- package/dist/src/utils/modelUtils.js.map +1 -1
- package/dist/src/utils/namespaceUtils.d.ts.map +1 -1
- package/dist/src/utils/namespaceUtils.js +6 -7
- package/dist/src/utils/namespaceUtils.js.map +1 -1
- package/dist/src/utils/operationUtil.d.ts +1 -1
- package/dist/src/utils/operationUtil.d.ts.map +1 -1
- package/dist/src/utils/operationUtil.js +60 -81
- package/dist/src/utils/operationUtil.js.map +1 -1
- package/dist/src/utils/parameterUtils.d.ts +1 -1
- package/dist/src/utils/parameterUtils.d.ts.map +1 -1
- package/dist/src/utils/parameterUtils.js +26 -33
- package/dist/src/utils/parameterUtils.js.map +1 -1
- package/dist/src/utils/resolve-project-root.js +2 -2
- package/dist/src/utils/resolve-project-root.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +38 -45
- package/src/contextManager.ts +6 -9
- package/src/framework/declaration.ts +18 -28
- package/src/framework/dependency.ts +1 -2
- package/src/framework/hooks/binder.ts +47 -120
- package/src/framework/hooks/sdkTypes.ts +27 -54
- package/src/framework/hooks/useDependencies.ts +2 -4
- package/src/framework/load-static-helpers.ts +28 -51
- package/src/framework/reference.ts +2 -5
- package/src/framework/sample.ts +9 -9
- package/src/index.ts +145 -185
- package/src/lib.ts +143 -158
- package/src/metaTree.ts +1 -1
- package/src/modular/buildClassicalClient.ts +83 -160
- package/src/modular/buildClassicalOperationGroups.ts +14 -39
- package/src/modular/buildClientContext.ts +54 -83
- package/src/modular/buildModularOptions.ts +4 -5
- package/src/modular/buildOperations.ts +46 -73
- package/src/modular/buildProjectFiles.ts +18 -47
- package/src/modular/buildRestorePoller.ts +27 -46
- package/src/modular/buildRootIndex.ts +86 -160
- package/src/modular/buildSubpathIndex.ts +35 -58
- package/src/modular/emitLoggerFile.ts +4 -9
- package/src/modular/emitModels.ts +136 -266
- package/src/modular/emitModelsOptions.ts +10 -16
- package/src/modular/emitSamples.ts +92 -180
- package/src/modular/emitTests.ts +28 -61
- package/src/modular/external-dependencies.ts +54 -54
- package/src/modular/helpers/classicalOperationHelpers.ts +73 -126
- package/src/modular/helpers/clientHelpers.ts +41 -88
- package/src/modular/helpers/clientOptionHelpers.ts +4 -11
- package/src/modular/helpers/exampleValueHelpers.ts +99 -215
- package/src/modular/helpers/namingHelpers.ts +12 -28
- package/src/modular/helpers/operationHelpers.ts +430 -757
- package/src/modular/helpers/typeHelpers.ts +11 -22
- package/src/modular/serialization/buildDeserializerFunction.ts +88 -122
- package/src/modular/serialization/buildSerializerFunction.ts +91 -129
- package/src/modular/serialization/buildXmlSerializerFunction.ts +104 -183
- package/src/modular/serialization/serializeUtils.ts +12 -22
- package/src/modular/static/rollup.test.config.js +11 -14
- package/src/modular/static/scripts/renameOutput.mjs +2 -2
- package/src/modular/static-helpers-metadata.ts +60 -60
- package/src/modular/type-expressions/get-credential-expression.ts +1 -1
- package/src/modular/type-expressions/get-enum-expression.ts +5 -10
- package/src/modular/type-expressions/get-model-expression.ts +13 -17
- package/src/modular/type-expressions/get-nullable-expression.ts +4 -5
- package/src/modular/type-expressions/get-type-expression.ts +8 -12
- package/src/modular/type-expressions/get-union-expression.ts +4 -4
- package/src/modular/type-expressions/utils.ts +1 -1
- package/src/rlc-common/buildClient.ts +70 -141
- package/src/rlc-common/buildClientDefinitions.ts +44 -87
- package/src/rlc-common/buildIndexFile.ts +78 -78
- package/src/rlc-common/buildIsUnexpectedHelper.ts +34 -41
- package/src/rlc-common/buildLogger.ts +7 -7
- package/src/rlc-common/buildMethodShortcuts.ts +9 -21
- package/src/rlc-common/buildObjectTypes.ts +79 -156
- package/src/rlc-common/buildPaginateHelper.ts +9 -12
- package/src/rlc-common/buildParameterTypes.ts +116 -137
- package/src/rlc-common/buildPollingHelper.ts +7 -7
- package/src/rlc-common/buildResponseTypes.ts +34 -57
- package/src/rlc-common/buildSamples.ts +3 -3
- package/src/rlc-common/buildSchemaType.ts +37 -29
- package/src/rlc-common/buildSerializeHelper.ts +5 -5
- package/src/rlc-common/buildTopLevelIndexFile.ts +12 -19
- package/src/rlc-common/helpers/apiVersionUtil.ts +5 -10
- package/src/rlc-common/helpers/importsUtil.ts +27 -30
- package/src/rlc-common/helpers/nameConstructors.ts +16 -50
- package/src/rlc-common/helpers/nameUtils.ts +19 -42
- package/src/rlc-common/helpers/operationHelpers.ts +14 -31
- package/src/rlc-common/helpers/pathUtils.ts +2 -7
- package/src/rlc-common/helpers/schemaHelpers.ts +4 -15
- package/src/rlc-common/helpers/shortcutMethods.ts +6 -15
- package/src/rlc-common/helpers/typeUtil.ts +4 -11
- package/src/rlc-common/helpers/valueGenerationUtil.ts +16 -39
- package/src/rlc-common/index.ts +28 -28
- package/src/rlc-common/interfaces.ts +3 -11
- package/src/rlc-common/metadata/buildApiExtractorConfig.ts +17 -24
- package/src/rlc-common/metadata/buildChangelogFile.ts +1 -1
- package/src/rlc-common/metadata/buildESLintConfig.ts +3 -5
- package/src/rlc-common/metadata/buildLicenseFile.ts +1 -1
- package/src/rlc-common/metadata/buildPackageFile.ts +27 -35
- package/src/rlc-common/metadata/buildReadmeFile.ts +16 -29
- package/src/rlc-common/metadata/buildRollupConfig.ts +5 -8
- package/src/rlc-common/metadata/buildSampleEnvFile.ts +2 -3
- package/src/rlc-common/metadata/buildTestConfig.ts +10 -10
- package/src/rlc-common/metadata/buildTsConfig.ts +32 -35
- package/src/rlc-common/metadata/buildVitestConfig.ts +4 -10
- package/src/rlc-common/metadata/buildWarpConfig.ts +3 -6
- package/src/rlc-common/metadata/packageJson/azurePackageCommon.ts +16 -25
- package/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.ts +29 -50
- package/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.ts +20 -31
- package/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.ts +11 -13
- package/src/rlc-common/metadata/packageJson/packageCommon.ts +32 -52
- package/src/rlc-common/test/buildKarmaConfig.ts +1 -1
- package/src/rlc-common/test/buildRecordedClient.ts +3 -3
- package/src/rlc-common/test/buildSampleTest.ts +3 -3
- package/src/rlc-common/test/buildSnippets.ts +6 -12
- package/src/rlc-common/transformSampleGroups.ts +54 -105
- package/src/testing/index.ts +2 -5
- package/src/transform/transform.ts +22 -34
- package/src/transform/transformApiVersionInfo.ts +17 -30
- package/src/transform/transformHelperFunctionDetails.ts +14 -26
- package/src/transform/transformParameters.ts +55 -105
- package/src/transform/transformPaths.ts +26 -43
- package/src/transform/transformResponses.ts +26 -33
- package/src/transform/transformSchemas.ts +15 -33
- package/src/transform/transformTelemetryInfo.ts +8 -14
- package/src/transform/transfromRLCOptions.ts +53 -116
- package/src/utils/clientUtils.ts +22 -41
- package/src/utils/credentialUtils.ts +8 -19
- package/src/utils/crossLanguageDef.ts +15 -34
- package/src/utils/emitUtil.ts +11 -17
- package/src/utils/fileSystemUtils.ts +30 -8
- package/src/utils/importHelper.ts +5 -10
- package/src/utils/interfaces.ts +1 -1
- package/src/utils/mediaTypes.ts +13 -34
- package/src/utils/modelUtils.ts +175 -384
- package/src/utils/namespaceUtils.ts +8 -24
- package/src/utils/operationUtil.ts +98 -190
- package/src/utils/parameterUtils.ts +31 -54
- package/src/utils/resolve-project-root.ts +3 -3
- package/static/static-helpers/cloudSettingHelpers.ts +4 -6
- package/static/static-helpers/multipartHelpers.ts +3 -3
- package/static/static-helpers/pagingHelpers.ts +28 -63
- package/static/static-helpers/pollingHelpers.ts +16 -29
- package/static/static-helpers/serialization/build-multi-collection.ts +1 -4
- package/static/static-helpers/serialization/check-prop-undefined.ts +1 -4
- package/static/static-helpers/serialization/get-binary-response-browser.mts +3 -1
- package/static/static-helpers/serialization/get-binary-response.ts +2 -2
- package/static/static-helpers/serialization/get-binary-stream-response-browser.mts +1 -3
- package/static/static-helpers/serialization/get-binary-stream-response.ts +2 -4
- package/static/static-helpers/serialization/serialize-record.ts +1 -1
- package/static/static-helpers/serialization/serializers.ts +4 -7
- package/static/static-helpers/serialization/xml-helpers.ts +42 -90
- package/static/static-helpers/simplePollerHelpers.ts +10 -19
- package/static/static-helpers/storageCompatResponse.ts +10 -27
- package/static/static-helpers/urlTemplate.ts +4 -7
- package/static/test-helpers/recordedClient.ts +5 -10
|
@@ -6,14 +6,11 @@ import {
|
|
|
6
6
|
OptionalKind,
|
|
7
7
|
PropertySignatureStructure,
|
|
8
8
|
StructureKind,
|
|
9
|
-
TypeAliasDeclarationStructure
|
|
9
|
+
TypeAliasDeclarationStructure,
|
|
10
10
|
} from "ts-morph";
|
|
11
|
+
import { getMultipartPartTypeName } from "./helpers/nameConstructors.js";
|
|
11
12
|
import { NameType, normalizeName } from "./helpers/nameUtils.js";
|
|
12
|
-
import {
|
|
13
|
-
isArraySchema,
|
|
14
|
-
isDictionarySchema,
|
|
15
|
-
isObjectSchema
|
|
16
|
-
} from "./helpers/schemaHelpers.js";
|
|
13
|
+
import { isArraySchema, isDictionarySchema, isObjectSchema } from "./helpers/schemaHelpers.js";
|
|
17
14
|
import {
|
|
18
15
|
ArraySchema,
|
|
19
16
|
ObjectSchema,
|
|
@@ -21,9 +18,8 @@ import {
|
|
|
21
18
|
Property,
|
|
22
19
|
RLCModel,
|
|
23
20
|
Schema,
|
|
24
|
-
SchemaContext
|
|
21
|
+
SchemaContext,
|
|
25
22
|
} from "./interfaces.js";
|
|
26
|
-
import { getMultipartPartTypeName } from "./helpers/nameConstructors.js";
|
|
27
23
|
|
|
28
24
|
/**
|
|
29
25
|
* Generates interfaces for ObjectSchemas
|
|
@@ -31,32 +27,22 @@ import { getMultipartPartTypeName } from "./helpers/nameConstructors.js";
|
|
|
31
27
|
export function buildObjectInterfaces(
|
|
32
28
|
model: RLCModel,
|
|
33
29
|
importedModels: Set<string>,
|
|
34
|
-
schemaUsage: SchemaContext[]
|
|
30
|
+
schemaUsage: SchemaContext[],
|
|
35
31
|
): InterfaceDeclarationStructure[] {
|
|
36
32
|
const objectSchemas: ObjectSchema[] = (model.schemas ?? []).filter(
|
|
37
|
-
(o) =>
|
|
38
|
-
isObjectSchema(o) &&
|
|
39
|
-
(o as ObjectSchema).usage?.some((u) => schemaUsage.includes(u))
|
|
33
|
+
(o) => isObjectSchema(o) && (o as ObjectSchema).usage?.some((u) => schemaUsage.includes(u)),
|
|
40
34
|
);
|
|
41
35
|
const objectInterfaces: InterfaceDeclarationStructure[] = [];
|
|
42
36
|
|
|
43
37
|
for (const objectSchema of objectSchemas) {
|
|
44
|
-
if (
|
|
45
|
-
objectSchema.alias ||
|
|
46
|
-
objectSchema.outputAlias ||
|
|
47
|
-
objectSchema.fromCore
|
|
48
|
-
) {
|
|
38
|
+
if (objectSchema.alias || objectSchema.outputAlias || objectSchema.fromCore) {
|
|
49
39
|
continue;
|
|
50
40
|
}
|
|
51
41
|
|
|
52
42
|
// FIXME: disabling new multipart generation for modular while we figure out the story
|
|
53
43
|
if (objectSchema.isMultipartBody && !model.options?.isModularLibrary) {
|
|
54
44
|
objectInterfaces.push(
|
|
55
|
-
...buildMultipartPartDefinitions(
|
|
56
|
-
objectSchema,
|
|
57
|
-
importedModels,
|
|
58
|
-
schemaUsage
|
|
59
|
-
)
|
|
45
|
+
...buildMultipartPartDefinitions(objectSchema, importedModels, schemaUsage),
|
|
60
46
|
);
|
|
61
47
|
continue;
|
|
62
48
|
}
|
|
@@ -67,7 +53,7 @@ export function buildObjectInterfaces(
|
|
|
67
53
|
baseName,
|
|
68
54
|
objectSchema,
|
|
69
55
|
schemaUsage,
|
|
70
|
-
importedModels
|
|
56
|
+
importedModels,
|
|
71
57
|
);
|
|
72
58
|
|
|
73
59
|
objectInterfaces.push(interfaceDeclaration);
|
|
@@ -75,24 +61,23 @@ export function buildObjectInterfaces(
|
|
|
75
61
|
return objectInterfaces;
|
|
76
62
|
}
|
|
77
63
|
|
|
78
|
-
const MULTIPART_FILE_METADATA_PROPERTIES: OptionalKind<PropertySignatureStructure>[] =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
];
|
|
64
|
+
const MULTIPART_FILE_METADATA_PROPERTIES: OptionalKind<PropertySignatureStructure>[] = [
|
|
65
|
+
{
|
|
66
|
+
name: "filename",
|
|
67
|
+
hasQuestionToken: true,
|
|
68
|
+
type: "string",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: "contentType",
|
|
72
|
+
hasQuestionToken: true,
|
|
73
|
+
type: "string",
|
|
74
|
+
},
|
|
75
|
+
];
|
|
91
76
|
|
|
92
77
|
function buildMultipartPartDefinitions(
|
|
93
78
|
schema: ObjectSchema,
|
|
94
79
|
importedModels: Set<string>,
|
|
95
|
-
schemaUsage: SchemaContext[]
|
|
80
|
+
schemaUsage: SchemaContext[],
|
|
96
81
|
): InterfaceDeclarationStructure[] {
|
|
97
82
|
if (!schema.isMultipartBody) {
|
|
98
83
|
return [];
|
|
@@ -103,7 +88,7 @@ function buildMultipartPartDefinitions(
|
|
|
103
88
|
schema.properties ?? {},
|
|
104
89
|
schemaUsage,
|
|
105
90
|
importedModels,
|
|
106
|
-
{ flattenBinaryArrays: true }
|
|
91
|
+
{ flattenBinaryArrays: true },
|
|
107
92
|
);
|
|
108
93
|
|
|
109
94
|
const structures: InterfaceDeclarationStructure[] = [];
|
|
@@ -124,8 +109,8 @@ function buildMultipartPartDefinitions(
|
|
|
124
109
|
getPropertySignature(
|
|
125
110
|
{ name: "filename", ...multipartOptions.filenameSchema },
|
|
126
111
|
[SchemaContext.Input],
|
|
127
|
-
importedModels
|
|
128
|
-
)
|
|
112
|
+
importedModels,
|
|
113
|
+
),
|
|
129
114
|
);
|
|
130
115
|
}
|
|
131
116
|
if (multipartOptions.contentTypeSchema) {
|
|
@@ -133,8 +118,8 @@ function buildMultipartPartDefinitions(
|
|
|
133
118
|
getPropertySignature(
|
|
134
119
|
{ name: "contentType", ...multipartOptions.contentTypeSchema },
|
|
135
120
|
[SchemaContext.Input],
|
|
136
|
-
importedModels
|
|
137
|
-
)
|
|
121
|
+
importedModels,
|
|
122
|
+
),
|
|
138
123
|
);
|
|
139
124
|
}
|
|
140
125
|
} else if (isFileUpload) {
|
|
@@ -149,14 +134,14 @@ function buildMultipartPartDefinitions(
|
|
|
149
134
|
properties: [
|
|
150
135
|
{
|
|
151
136
|
name: "name",
|
|
152
|
-
type: name
|
|
137
|
+
type: name,
|
|
153
138
|
},
|
|
154
139
|
{
|
|
155
140
|
name: "body",
|
|
156
|
-
type: signature.type
|
|
141
|
+
type: signature.type,
|
|
157
142
|
},
|
|
158
|
-
...additionalProperties
|
|
159
|
-
]
|
|
143
|
+
...additionalProperties,
|
|
144
|
+
],
|
|
160
145
|
});
|
|
161
146
|
}
|
|
162
147
|
|
|
@@ -166,12 +151,10 @@ function buildMultipartPartDefinitions(
|
|
|
166
151
|
export function buildObjectAliases(
|
|
167
152
|
model: RLCModel,
|
|
168
153
|
importedModels: Set<string>,
|
|
169
|
-
schemaUsage: SchemaContext[]
|
|
154
|
+
schemaUsage: SchemaContext[],
|
|
170
155
|
) {
|
|
171
156
|
const objectSchemas: ObjectSchema[] = (model.schemas ?? []).filter(
|
|
172
|
-
(o) =>
|
|
173
|
-
isObjectSchema(o) &&
|
|
174
|
-
(o as ObjectSchema).usage?.some((u) => schemaUsage.includes(u))
|
|
157
|
+
(o) => isObjectSchema(o) && (o as ObjectSchema).usage?.some((u) => schemaUsage.includes(u)),
|
|
175
158
|
);
|
|
176
159
|
const objectAliases: TypeAliasDeclarationStructure[] = [];
|
|
177
160
|
|
|
@@ -182,21 +165,21 @@ export function buildObjectAliases(
|
|
|
182
165
|
objectSchema.properties ?? {},
|
|
183
166
|
schemaUsage,
|
|
184
167
|
importedModels,
|
|
185
|
-
{ flattenBinaryArrays: true }
|
|
168
|
+
{ flattenBinaryArrays: true },
|
|
186
169
|
);
|
|
187
170
|
|
|
188
171
|
const objectTypeNames = propertySignatures.map((sig) =>
|
|
189
|
-
getMultipartPartTypeName(objectSchema.name, sig.name)
|
|
172
|
+
getMultipartPartTypeName(objectSchema.name, sig.name),
|
|
190
173
|
);
|
|
191
174
|
|
|
192
175
|
objectAliases.push({
|
|
193
176
|
kind: StructureKind.TypeAlias,
|
|
194
177
|
...(objectSchema.description && {
|
|
195
|
-
docs: [{ description: objectSchema.description }]
|
|
178
|
+
docs: [{ description: objectSchema.description }],
|
|
196
179
|
}),
|
|
197
180
|
name: objectSchema.typeName!,
|
|
198
181
|
type: `FormData | Array<${objectTypeNames.join("|") || "unknown"}>`,
|
|
199
|
-
isExported: true
|
|
182
|
+
isExported: true,
|
|
200
183
|
});
|
|
201
184
|
}
|
|
202
185
|
|
|
@@ -213,31 +196,22 @@ export function buildObjectAliases(
|
|
|
213
196
|
? `${objectSchema.alias}`
|
|
214
197
|
: `${objectSchema.outputAlias}`,
|
|
215
198
|
isExported: true,
|
|
216
|
-
docs: [description ?? "Alias for " + modelName]
|
|
199
|
+
docs: [description ?? "Alias for " + modelName],
|
|
217
200
|
});
|
|
218
201
|
}
|
|
219
202
|
}
|
|
220
203
|
return objectAliases;
|
|
221
204
|
}
|
|
222
205
|
|
|
223
|
-
export function buildPolymorphicAliases(
|
|
224
|
-
model: RLCModel,
|
|
225
|
-
schemaUsage: SchemaContext[]
|
|
226
|
-
) {
|
|
206
|
+
export function buildPolymorphicAliases(model: RLCModel, schemaUsage: SchemaContext[]) {
|
|
227
207
|
// We'll add aliases for polymorphic objects
|
|
228
208
|
const objectAliases: TypeAliasDeclarationStructure[] = [];
|
|
229
209
|
const objectSchemas: ObjectSchema[] = (model.schemas ?? []).filter(
|
|
230
|
-
(o) =>
|
|
231
|
-
isObjectSchema(o) &&
|
|
232
|
-
(o as ObjectSchema).usage?.some((u) => schemaUsage.includes(u))
|
|
210
|
+
(o) => isObjectSchema(o) && (o as ObjectSchema).usage?.some((u) => schemaUsage.includes(u)),
|
|
233
211
|
);
|
|
234
212
|
for (const objectSchema of objectSchemas) {
|
|
235
213
|
const baseName = getObjectBaseName(objectSchema, schemaUsage);
|
|
236
|
-
const typeAlias = getPolymorphicTypeAlias(
|
|
237
|
-
baseName,
|
|
238
|
-
objectSchema,
|
|
239
|
-
schemaUsage
|
|
240
|
-
);
|
|
214
|
+
const typeAlias = getPolymorphicTypeAlias(baseName, objectSchema, schemaUsage);
|
|
241
215
|
if (typeAlias) {
|
|
242
216
|
objectAliases.push(typeAlias);
|
|
243
217
|
}
|
|
@@ -249,16 +223,9 @@ export function buildPolymorphicAliases(
|
|
|
249
223
|
/**
|
|
250
224
|
* Gets a base name for an object schema this is tipically used with suffixes when building interface or type names
|
|
251
225
|
*/
|
|
252
|
-
function getObjectBaseName(
|
|
253
|
-
objectSchema: ObjectSchema,
|
|
254
|
-
schemaUsage: SchemaContext[]
|
|
255
|
-
) {
|
|
226
|
+
function getObjectBaseName(objectSchema: ObjectSchema, schemaUsage: SchemaContext[]) {
|
|
256
227
|
const nameSuffix = schemaUsage.includes(SchemaContext.Output) ? "Output" : "";
|
|
257
|
-
const name = normalizeName(
|
|
258
|
-
objectSchema.name,
|
|
259
|
-
NameType.Interface,
|
|
260
|
-
true /** guard name */
|
|
261
|
-
);
|
|
228
|
+
const name = normalizeName(objectSchema.name, NameType.Interface, true /** guard name */);
|
|
262
229
|
|
|
263
230
|
return `${name}${nameSuffix}`;
|
|
264
231
|
}
|
|
@@ -270,7 +237,7 @@ function getObjectBaseName(
|
|
|
270
237
|
function getPolymorphicTypeAlias(
|
|
271
238
|
baseName: string,
|
|
272
239
|
objectSchema: ObjectSchema,
|
|
273
|
-
schemaUsage: SchemaContext[]
|
|
240
|
+
schemaUsage: SchemaContext[],
|
|
274
241
|
): TypeAliasDeclarationStructure | undefined {
|
|
275
242
|
if (!isPolymorphicParent(objectSchema)) {
|
|
276
243
|
return undefined;
|
|
@@ -284,14 +251,8 @@ function getPolymorphicTypeAlias(
|
|
|
284
251
|
}
|
|
285
252
|
|
|
286
253
|
for (const child of objectSchema.children?.all ?? []) {
|
|
287
|
-
const nameSuffix = schemaUsage.includes(SchemaContext.Output)
|
|
288
|
-
|
|
289
|
-
: "";
|
|
290
|
-
const name = normalizeName(
|
|
291
|
-
child.name,
|
|
292
|
-
NameType.Interface,
|
|
293
|
-
true /** shouldGuard */
|
|
294
|
-
);
|
|
254
|
+
const nameSuffix = schemaUsage.includes(SchemaContext.Output) ? "Output" : "";
|
|
255
|
+
const name = normalizeName(child.name, NameType.Interface, true /** shouldGuard */);
|
|
295
256
|
|
|
296
257
|
unionTypes.push(`${name}${nameSuffix}`);
|
|
297
258
|
}
|
|
@@ -303,7 +264,7 @@ function getPolymorphicTypeAlias(
|
|
|
303
264
|
...(description && { docs: [{ description }] }),
|
|
304
265
|
name: `${baseName}`,
|
|
305
266
|
type: unionTypes.join(" | "),
|
|
306
|
-
isExported: true
|
|
267
|
+
isExported: true,
|
|
307
268
|
};
|
|
308
269
|
}
|
|
309
270
|
|
|
@@ -316,7 +277,7 @@ export function getObjectInterfaceDeclaration(
|
|
|
316
277
|
baseName: string,
|
|
317
278
|
objectSchema: ObjectSchema,
|
|
318
279
|
schemaUsage: SchemaContext[],
|
|
319
|
-
importedModels: Set<string
|
|
280
|
+
importedModels: Set<string>,
|
|
320
281
|
): InterfaceDeclarationStructure {
|
|
321
282
|
let interfaceName = `${baseName}`;
|
|
322
283
|
if (isPolymorphicParent(objectSchema)) {
|
|
@@ -325,18 +286,14 @@ export function getObjectInterfaceDeclaration(
|
|
|
325
286
|
|
|
326
287
|
const properties = objectSchema.properties ?? {};
|
|
327
288
|
|
|
328
|
-
let propertySignatures = getPropertySignatures(
|
|
329
|
-
properties,
|
|
330
|
-
schemaUsage,
|
|
331
|
-
importedModels
|
|
332
|
-
);
|
|
289
|
+
let propertySignatures = getPropertySignatures(properties, schemaUsage, importedModels);
|
|
333
290
|
|
|
334
291
|
// Add the polymorphic property if exists
|
|
335
292
|
propertySignatures = addDiscriminatorProperty(
|
|
336
293
|
model,
|
|
337
294
|
objectSchema,
|
|
338
295
|
propertySignatures,
|
|
339
|
-
schemaUsage
|
|
296
|
+
schemaUsage,
|
|
340
297
|
);
|
|
341
298
|
|
|
342
299
|
// Calculate the parents of the current object
|
|
@@ -349,7 +306,7 @@ export function getObjectInterfaceDeclaration(
|
|
|
349
306
|
name: interfaceName,
|
|
350
307
|
isExported: true,
|
|
351
308
|
properties: propertySignatures,
|
|
352
|
-
...(extendFrom && { extends: extendFrom })
|
|
309
|
+
...(extendFrom && { extends: extendFrom }),
|
|
353
310
|
};
|
|
354
311
|
}
|
|
355
312
|
|
|
@@ -361,21 +318,15 @@ function addDiscriminatorProperty(
|
|
|
361
318
|
model: RLCModel,
|
|
362
319
|
objectSchema: ObjectSchema,
|
|
363
320
|
properties: PropertySignatureStructure[],
|
|
364
|
-
schemaUsage: SchemaContext[]
|
|
321
|
+
schemaUsage: SchemaContext[],
|
|
365
322
|
): PropertySignatureStructure[] {
|
|
366
|
-
const polymorphicProperty = getDiscriminatorProperty(
|
|
367
|
-
model,
|
|
368
|
-
objectSchema,
|
|
369
|
-
schemaUsage
|
|
370
|
-
);
|
|
323
|
+
const polymorphicProperty = getDiscriminatorProperty(model, objectSchema, schemaUsage);
|
|
371
324
|
|
|
372
325
|
if (polymorphicProperty) {
|
|
373
326
|
// It is possible that the polymorphic property needs to override an existing property.
|
|
374
327
|
// This is usually the case on the top level parent where the property already has a type of string
|
|
375
328
|
// we need to replace it with the polymorphic values of its children
|
|
376
|
-
const filteredProperties = properties.filter(
|
|
377
|
-
(p) => p.name !== polymorphicProperty.name
|
|
378
|
-
);
|
|
329
|
+
const filteredProperties = properties.filter((p) => p.name !== polymorphicProperty.name);
|
|
379
330
|
return [...filteredProperties, polymorphicProperty];
|
|
380
331
|
}
|
|
381
332
|
|
|
@@ -388,7 +339,7 @@ function addDiscriminatorProperty(
|
|
|
388
339
|
function getDiscriminatorProperty(
|
|
389
340
|
model: RLCModel,
|
|
390
341
|
objectSchema: ObjectSchema,
|
|
391
|
-
schemaUsage: SchemaContext[]
|
|
342
|
+
schemaUsage: SchemaContext[],
|
|
392
343
|
): PropertySignatureStructure | undefined {
|
|
393
344
|
const discriminatorValue = objectSchema.discriminatorValue;
|
|
394
345
|
if (!discriminatorValue && !objectSchema.discriminator) {
|
|
@@ -401,11 +352,10 @@ function getDiscriminatorProperty(
|
|
|
401
352
|
if (discriminators) {
|
|
402
353
|
if (discriminatorPropertyName === undefined) {
|
|
403
354
|
throw new Error(
|
|
404
|
-
`getDiscriminatorProperty: Expected object ${objectSchema.name} to have a discriminator in its hierarchy but found none
|
|
355
|
+
`getDiscriminatorProperty: Expected object ${objectSchema.name} to have a discriminator in its hierarchy but found none`,
|
|
405
356
|
);
|
|
406
357
|
}
|
|
407
|
-
const inputTypeName =
|
|
408
|
-
objectSchema.discriminator?.typeName ?? objectSchema.discriminator?.type;
|
|
358
|
+
const inputTypeName = objectSchema.discriminator?.typeName ?? objectSchema.discriminator?.type;
|
|
409
359
|
return {
|
|
410
360
|
kind: StructureKind.PropertySignature,
|
|
411
361
|
name: `"${discriminatorPropertyName}"`,
|
|
@@ -414,7 +364,7 @@ function getDiscriminatorProperty(
|
|
|
414
364
|
? discriminators
|
|
415
365
|
: schemaUsage.includes(SchemaContext.Output)
|
|
416
366
|
? (objectSchema.discriminator?.outputTypeName ?? inputTypeName)
|
|
417
|
-
: inputTypeName
|
|
367
|
+
: inputTypeName,
|
|
418
368
|
};
|
|
419
369
|
}
|
|
420
370
|
|
|
@@ -468,13 +418,9 @@ function getDiscriminatorValue(objectSchema: ObjectSchema): string | undefined {
|
|
|
468
418
|
const allChildren = objectSchema.children?.all ?? [];
|
|
469
419
|
|
|
470
420
|
// Top level parents may not have a discriminator of their own.
|
|
471
|
-
const selfDiscriminator = discriminatorValue
|
|
472
|
-
? [`"${discriminatorValue}"`]
|
|
473
|
-
: [];
|
|
421
|
+
const selfDiscriminator = discriminatorValue ? [`"${discriminatorValue}"`] : [];
|
|
474
422
|
|
|
475
|
-
const childValues = getChildDiscriminatorValues(allChildren).map(
|
|
476
|
-
(v) => `"${v}"`
|
|
477
|
-
);
|
|
423
|
+
const childValues = getChildDiscriminatorValues(allChildren).map((v) => `"${v}"`);
|
|
478
424
|
|
|
479
425
|
return [...selfDiscriminator, ...childValues].join(" | ");
|
|
480
426
|
}
|
|
@@ -501,7 +447,7 @@ function getChildDiscriminatorValues(children: ObjectSchema[]): string[] {
|
|
|
501
447
|
*/
|
|
502
448
|
export function getImmediateParentsNames(
|
|
503
449
|
objectSchema: ObjectSchema,
|
|
504
|
-
schemaUsage: SchemaContext[]
|
|
450
|
+
schemaUsage: SchemaContext[],
|
|
505
451
|
): string[] {
|
|
506
452
|
if (!objectSchema.parents?.immediate) {
|
|
507
453
|
return [];
|
|
@@ -511,11 +457,7 @@ export function getImmediateParentsNames(
|
|
|
511
457
|
|
|
512
458
|
// If an immediate parent is an empty DictionarySchema, that means that the object has been marked
|
|
513
459
|
// with additional properties. We need to add Record<string, unknown> to the extend list and
|
|
514
|
-
if (
|
|
515
|
-
objectSchema.parents.immediate.find((im) =>
|
|
516
|
-
isDictionarySchema(im, { filterEmpty: true })
|
|
517
|
-
)
|
|
518
|
-
) {
|
|
460
|
+
if (objectSchema.parents.immediate.find((im) => isDictionarySchema(im, { filterEmpty: true }))) {
|
|
519
461
|
extendFrom.push("Record<string, unknown>");
|
|
520
462
|
}
|
|
521
463
|
|
|
@@ -523,17 +465,13 @@ export function getImmediateParentsNames(
|
|
|
523
465
|
const parents = objectSchema.parents.immediate
|
|
524
466
|
.filter((p) => !isDictionarySchema(p, { filterEmpty: true }))
|
|
525
467
|
.map((parent) => {
|
|
526
|
-
const nameSuffix = schemaUsage.includes(SchemaContext.Output)
|
|
527
|
-
? "Output"
|
|
528
|
-
: "";
|
|
468
|
+
const nameSuffix = schemaUsage.includes(SchemaContext.Output) ? "Output" : "";
|
|
529
469
|
const name = isDictionarySchema(parent)
|
|
530
470
|
? Object.entries(objectSchema.properties!)?.some((prop) => {
|
|
531
471
|
const typeName = prop[1].typeName ?? prop[1].type;
|
|
532
472
|
return (
|
|
533
473
|
`Record<string, ${typeName}>` !== parent.typeName &&
|
|
534
|
-
!(parent as any).additionalProperties?.typeName?.includes(
|
|
535
|
-
typeName
|
|
536
|
-
)
|
|
474
|
+
!(parent as any).additionalProperties?.typeName?.includes(typeName)
|
|
537
475
|
);
|
|
538
476
|
})
|
|
539
477
|
? schemaUsage.includes(SchemaContext.Output)
|
|
@@ -544,15 +482,9 @@ export function getImmediateParentsNames(
|
|
|
544
482
|
? parent.outputTypeName
|
|
545
483
|
: parent.typeName) ?? parent.name
|
|
546
484
|
}`
|
|
547
|
-
: `${normalizeName(
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
true /** shouldGuard */
|
|
551
|
-
)}${nameSuffix}`;
|
|
552
|
-
|
|
553
|
-
return isObjectSchema(parent) && isPolymorphicParent(parent)
|
|
554
|
-
? `${name}Parent`
|
|
555
|
-
: name;
|
|
485
|
+
: `${normalizeName(parent.name, NameType.Interface, true /** shouldGuard */)}${nameSuffix}`;
|
|
486
|
+
|
|
487
|
+
return isObjectSchema(parent) && isPolymorphicParent(parent) ? `${name}Parent` : name;
|
|
556
488
|
});
|
|
557
489
|
|
|
558
490
|
return [...parents, ...extendFrom];
|
|
@@ -566,7 +498,7 @@ function getPropertySignatures(
|
|
|
566
498
|
properties: { [key: string]: Property },
|
|
567
499
|
schemaUsage: SchemaContext[],
|
|
568
500
|
importedModels: Set<string>,
|
|
569
|
-
options: GetPropertySignatureOptions = {}
|
|
501
|
+
options: GetPropertySignatureOptions = {},
|
|
570
502
|
) {
|
|
571
503
|
let validProperties = Object.keys(properties);
|
|
572
504
|
const readOnlyFilter = (name: string) => {
|
|
@@ -587,7 +519,7 @@ function getPropertySignatures(
|
|
|
587
519
|
{ ...prop, name: p } as Schema,
|
|
588
520
|
schemaUsage,
|
|
589
521
|
importedModels,
|
|
590
|
-
options
|
|
522
|
+
options,
|
|
591
523
|
);
|
|
592
524
|
});
|
|
593
525
|
}
|
|
@@ -595,8 +527,8 @@ function getPropertySignatures(
|
|
|
595
527
|
function isBinaryArray(schema: Schema): boolean {
|
|
596
528
|
return Boolean(
|
|
597
529
|
isArraySchema(schema) &&
|
|
598
|
-
(schema.items?.typeName?.includes("
|
|
599
|
-
schema.items?.outputTypeName?.includes("
|
|
530
|
+
(schema.items?.typeName?.includes("NodeReadableStream") ||
|
|
531
|
+
schema.items?.outputTypeName?.includes("NodeReadableStream")),
|
|
600
532
|
);
|
|
601
533
|
}
|
|
602
534
|
|
|
@@ -610,13 +542,13 @@ export function getPropertySignature(
|
|
|
610
542
|
property: Property | Parameter,
|
|
611
543
|
schemaUsage: SchemaContext[],
|
|
612
544
|
importedModels: Set<string>,
|
|
613
|
-
options: GetPropertySignatureOptions = {}
|
|
545
|
+
options: GetPropertySignatureOptions = {},
|
|
614
546
|
): PropertySignatureStructure {
|
|
615
547
|
let schema: Schema;
|
|
616
548
|
if (options.flattenBinaryArrays && isBinaryArray(property)) {
|
|
617
549
|
schema = {
|
|
618
550
|
...((property as ArraySchema).items ?? property),
|
|
619
|
-
name: property.name
|
|
551
|
+
name: property.name,
|
|
620
552
|
};
|
|
621
553
|
} else {
|
|
622
554
|
schema = property;
|
|
@@ -626,23 +558,18 @@ export function getPropertySignature(
|
|
|
626
558
|
const description = schema.description;
|
|
627
559
|
let type;
|
|
628
560
|
const hasCoreInArray =
|
|
629
|
-
schema.type === "array" &&
|
|
630
|
-
(schema as any).items &&
|
|
631
|
-
(schema as any).items.fromCore;
|
|
561
|
+
schema.type === "array" && (schema as any).items && (schema as any).items.fromCore;
|
|
632
562
|
const hasCoreInRecord =
|
|
633
563
|
schema.type === "dictionary" &&
|
|
634
564
|
(schema as any).additionalProperties &&
|
|
635
565
|
(schema as any).additionalProperties.fromCore;
|
|
636
566
|
if (hasCoreInArray && schema.typeName) {
|
|
637
567
|
type = schema.typeName;
|
|
638
|
-
importedModels.add(
|
|
639
|
-
(schema as any).items.typeName ?? (schema as any).items.name
|
|
640
|
-
);
|
|
568
|
+
importedModels.add((schema as any).items.typeName ?? (schema as any).items.name);
|
|
641
569
|
} else if (hasCoreInRecord && schema.typeName) {
|
|
642
570
|
type = schema.typeName;
|
|
643
571
|
importedModels.add(
|
|
644
|
-
(schema as any).additionalProperties.typeName ??
|
|
645
|
-
(schema as any).additionalProperties.name
|
|
572
|
+
(schema as any).additionalProperties.typeName ?? (schema as any).additionalProperties.name,
|
|
646
573
|
);
|
|
647
574
|
} else {
|
|
648
575
|
type =
|
|
@@ -663,17 +590,13 @@ export function getPropertySignature(
|
|
|
663
590
|
hasQuestionToken: !schema.required,
|
|
664
591
|
isReadonly: generateForOutput(schemaUsage, schema.usage) && schema.readOnly,
|
|
665
592
|
type,
|
|
666
|
-
kind: StructureKind.PropertySignature
|
|
593
|
+
kind: StructureKind.PropertySignature,
|
|
667
594
|
};
|
|
668
595
|
}
|
|
669
596
|
|
|
670
|
-
function generateForOutput(
|
|
671
|
-
schemaUsage: SchemaContext[],
|
|
672
|
-
propertyUsage?: SchemaContext[]
|
|
673
|
-
) {
|
|
597
|
+
function generateForOutput(schemaUsage: SchemaContext[], propertyUsage?: SchemaContext[]) {
|
|
674
598
|
return (
|
|
675
|
-
(schemaUsage.includes(SchemaContext.Output) &&
|
|
676
|
-
propertyUsage?.includes(SchemaContext.Output)) ||
|
|
599
|
+
(schemaUsage.includes(SchemaContext.Output) && propertyUsage?.includes(SchemaContext.Output)) ||
|
|
677
600
|
(schemaUsage.includes(SchemaContext.Exception) &&
|
|
678
601
|
propertyUsage?.includes(SchemaContext.Exception))
|
|
679
602
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RLCModel } from "./interfaces.js";
|
|
2
1
|
import * as path from "path";
|
|
2
|
+
import { RLCModel } from "./interfaces.js";
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
4
4
|
// @ts-ignore: to fix the handlebars issue
|
|
5
5
|
import hbs from "handlebars";
|
|
@@ -12,23 +12,20 @@ export function buildPaginateHelper(model: RLCModel) {
|
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
hbs.registerHelper(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (Array.isArray(value)) {
|
|
19
|
-
return value.map((element) => `"${element}"`).join();
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return `"${value}"`;
|
|
15
|
+
hbs.registerHelper("quoteWrap", function (value: string | number | boolean | string[]) {
|
|
16
|
+
if (Array.isArray(value)) {
|
|
17
|
+
return value.map((element) => `"${element}"`).join();
|
|
23
18
|
}
|
|
24
|
-
|
|
19
|
+
|
|
20
|
+
return `"${value}"`;
|
|
21
|
+
});
|
|
25
22
|
|
|
26
23
|
const { srcPath } = model;
|
|
27
24
|
const paginateHelperContents = hbs.compile(paginateContent, {
|
|
28
|
-
noEscape: true
|
|
25
|
+
noEscape: true,
|
|
29
26
|
});
|
|
30
27
|
return {
|
|
31
28
|
path: path.join(srcPath, "paginateHelper.ts"),
|
|
32
|
-
content: paginateHelperContents(pagingInfo.pageDetails)
|
|
29
|
+
content: paginateHelperContents(pagingInfo.pageDetails),
|
|
33
30
|
};
|
|
34
31
|
}
|