@azure-tools/typespec-ts 0.53.3 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/src/framework/hooks/binder.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.js +102 -44
- package/dist/src/framework/hooks/binder.js.map +1 -1
- package/dist/src/framework/hooks/sdkTypes.js +1 -1
- package/dist/src/framework/hooks/sdkTypes.js.map +1 -1
- package/dist/src/framework/load-static-helpers.js +1 -1
- package/dist/src/framework/load-static-helpers.js.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +1 -10
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +0 -5
- 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.js +1 -1
- package/dist/src/modular/buildClassicalClient.js.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.js +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.js.map +1 -1
- package/dist/src/modular/buildClientContext.js +1 -1
- package/dist/src/modular/buildClientContext.js.map +1 -1
- package/dist/src/modular/buildOperations.js +1 -1
- package/dist/src/modular/buildOperations.js.map +1 -1
- package/dist/src/modular/buildProjectFiles.js +1 -1
- package/dist/src/modular/buildProjectFiles.js.map +1 -1
- package/dist/src/modular/buildRestorePoller.js +1 -1
- package/dist/src/modular/buildRestorePoller.js.map +1 -1
- package/dist/src/modular/buildRootIndex.js +1 -1
- package/dist/src/modular/buildRootIndex.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 +1 -1
- package/dist/src/modular/emitModels.js.map +1 -1
- package/dist/src/modular/emitModelsOptions.js +1 -1
- package/dist/src/modular/emitModelsOptions.js.map +1 -1
- package/dist/src/modular/emitSamples.js +1 -1
- package/dist/src/modular/emitSamples.js.map +1 -1
- package/dist/src/modular/emitTests.js +1 -1
- package/dist/src/modular/emitTests.js.map +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.js +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.js +1 -1
- package/dist/src/modular/helpers/clientHelpers.js.map +1 -1
- package/dist/src/modular/helpers/exampleValueHelpers.js +1 -1
- 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 +1 -1
- package/dist/src/modular/helpers/namingHelpers.js.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.js +53 -34
- package/dist/src/modular/helpers/operationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.js +1 -1
- package/dist/src/modular/helpers/typeHelpers.js.map +1 -1
- package/dist/src/modular/interfaces.d.ts +1 -1
- package/dist/src/modular/interfaces.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.js +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.js +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js.map +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.js +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.js.map +1 -1
- package/dist/src/rlc-common/buildClient.d.ts +9 -0
- package/dist/src/rlc-common/buildClient.d.ts.map +1 -0
- package/dist/src/rlc-common/buildClient.js +413 -0
- package/dist/src/rlc-common/buildClient.js.map +1 -0
- package/dist/src/rlc-common/buildClientDefinitions.d.ts +6 -0
- package/dist/src/rlc-common/buildClientDefinitions.d.ts.map +1 -0
- package/dist/src/rlc-common/buildClientDefinitions.js +174 -0
- package/dist/src/rlc-common/buildClientDefinitions.js.map +1 -0
- package/dist/src/rlc-common/buildIndexFile.d.ts +6 -0
- package/dist/src/rlc-common/buildIndexFile.d.ts.map +1 -0
- package/dist/src/rlc-common/buildIndexFile.js +242 -0
- package/dist/src/rlc-common/buildIndexFile.js.map +1 -0
- package/dist/src/rlc-common/buildIsUnexpectedHelper.d.ts +6 -0
- package/dist/src/rlc-common/buildIsUnexpectedHelper.d.ts.map +1 -0
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js +224 -0
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js.map +1 -0
- package/dist/src/rlc-common/buildLogger.d.ts +6 -0
- package/dist/src/rlc-common/buildLogger.d.ts.map +1 -0
- package/dist/src/rlc-common/buildLogger.js +32 -0
- package/dist/src/rlc-common/buildLogger.js.map +1 -0
- package/dist/src/rlc-common/buildMethodShortcuts.d.ts +5 -0
- package/dist/src/rlc-common/buildMethodShortcuts.d.ts.map +1 -0
- package/dist/src/rlc-common/buildMethodShortcuts.js +54 -0
- package/dist/src/rlc-common/buildMethodShortcuts.js.map +1 -0
- package/dist/src/rlc-common/buildObjectTypes.d.ts +29 -0
- package/dist/src/rlc-common/buildObjectTypes.d.ts.map +1 -0
- package/dist/src/rlc-common/buildObjectTypes.js +451 -0
- package/dist/src/rlc-common/buildObjectTypes.js.map +1 -0
- package/dist/src/rlc-common/buildPaginateHelper.d.ts +6 -0
- package/dist/src/rlc-common/buildPaginateHelper.d.ts.map +1 -0
- package/dist/src/rlc-common/buildPaginateHelper.js +27 -0
- package/dist/src/rlc-common/buildPaginateHelper.js.map +1 -0
- package/dist/src/rlc-common/buildParameterTypes.d.ts +14 -0
- package/dist/src/rlc-common/buildParameterTypes.d.ts.map +1 -0
- package/dist/src/rlc-common/buildParameterTypes.js +381 -0
- package/dist/src/rlc-common/buildParameterTypes.js.map +1 -0
- package/dist/src/rlc-common/buildPollingHelper.d.ts +6 -0
- package/dist/src/rlc-common/buildPollingHelper.d.ts.map +1 -0
- package/dist/src/rlc-common/buildPollingHelper.js +62 -0
- package/dist/src/rlc-common/buildPollingHelper.js.map +1 -0
- package/dist/src/rlc-common/buildResponseTypes.d.ts +6 -0
- package/dist/src/rlc-common/buildResponseTypes.d.ts.map +1 -0
- package/dist/src/rlc-common/buildResponseTypes.js +147 -0
- package/dist/src/rlc-common/buildResponseTypes.js.map +1 -0
- package/dist/src/rlc-common/buildSamples.d.ts +3 -0
- package/dist/src/rlc-common/buildSamples.d.ts.map +1 -0
- package/dist/src/rlc-common/buildSamples.js +30 -0
- package/dist/src/rlc-common/buildSamples.js.map +1 -0
- package/dist/src/rlc-common/buildSchemaType.d.ts +20 -0
- package/dist/src/rlc-common/buildSchemaType.d.ts.map +1 -0
- package/dist/src/rlc-common/buildSchemaType.js +53 -0
- package/dist/src/rlc-common/buildSchemaType.js.map +1 -0
- package/dist/src/rlc-common/buildSerializeHelper.d.ts +6 -0
- package/dist/src/rlc-common/buildSerializeHelper.d.ts.map +1 -0
- package/dist/src/rlc-common/buildSerializeHelper.js +36 -0
- package/dist/src/rlc-common/buildSerializeHelper.js.map +1 -0
- package/dist/src/rlc-common/buildTopLevelIndexFile.d.ts +6 -0
- package/dist/src/rlc-common/buildTopLevelIndexFile.d.ts.map +1 -0
- package/dist/src/rlc-common/buildTopLevelIndexFile.js +52 -0
- package/dist/src/rlc-common/buildTopLevelIndexFile.js.map +1 -0
- package/dist/src/rlc-common/helpers/apiVersionUtil.d.ts +17 -0
- package/dist/src/rlc-common/helpers/apiVersionUtil.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/apiVersionUtil.js +45 -0
- package/dist/src/rlc-common/helpers/apiVersionUtil.js.map +1 -0
- package/dist/src/rlc-common/helpers/importsUtil.d.ts +18 -0
- package/dist/src/rlc-common/helpers/importsUtil.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/importsUtil.js +169 -0
- package/dist/src/rlc-common/helpers/importsUtil.js.map +1 -0
- package/dist/src/rlc-common/helpers/nameConstructors.d.ts +42 -0
- package/dist/src/rlc-common/helpers/nameConstructors.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/nameConstructors.js +63 -0
- package/dist/src/rlc-common/helpers/nameConstructors.js.map +1 -0
- package/dist/src/rlc-common/helpers/nameUtils.d.ts +37 -0
- package/dist/src/rlc-common/helpers/nameUtils.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/nameUtils.js +246 -0
- package/dist/src/rlc-common/helpers/nameUtils.js.map +1 -0
- package/dist/src/rlc-common/helpers/operationHelpers.d.ts +16 -0
- package/dist/src/rlc-common/helpers/operationHelpers.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/operationHelpers.js +119 -0
- package/dist/src/rlc-common/helpers/operationHelpers.js.map +1 -0
- package/dist/src/rlc-common/helpers/packageUtil.d.ts +7 -0
- package/dist/src/rlc-common/helpers/packageUtil.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/packageUtil.js +13 -0
- package/dist/src/rlc-common/helpers/packageUtil.js.map +1 -0
- package/dist/src/rlc-common/helpers/pathUtils.d.ts +2 -0
- package/dist/src/rlc-common/helpers/pathUtils.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/pathUtils.js +12 -0
- package/dist/src/rlc-common/helpers/pathUtils.js.map +1 -0
- package/dist/src/rlc-common/helpers/schemaHelpers.d.ts +10 -0
- package/dist/src/rlc-common/helpers/schemaHelpers.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/schemaHelpers.js +41 -0
- package/dist/src/rlc-common/helpers/schemaHelpers.js.map +1 -0
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts +4 -0
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/shortcutMethods.js +49 -0
- package/dist/src/rlc-common/helpers/shortcutMethods.js.map +1 -0
- package/dist/src/rlc-common/helpers/typeUtil.d.ts +32 -0
- package/dist/src/rlc-common/helpers/typeUtil.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/typeUtil.js +167 -0
- package/dist/src/rlc-common/helpers/typeUtil.js.map +1 -0
- package/dist/src/rlc-common/helpers/valueGenerationUtil.d.ts +12 -0
- package/dist/src/rlc-common/helpers/valueGenerationUtil.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js +165 -0
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js.map +1 -0
- package/dist/src/rlc-common/index.d.ts +41 -0
- package/dist/src/rlc-common/index.d.ts.map +1 -0
- package/dist/src/rlc-common/index.js +43 -0
- package/dist/src/rlc-common/index.js.map +1 -0
- package/dist/src/rlc-common/interfaces.d.ts +369 -0
- package/dist/src/rlc-common/interfaces.d.ts.map +1 -0
- package/dist/src/rlc-common/interfaces.js +11 -0
- package/dist/src/rlc-common/interfaces.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.d.ts +6 -0
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js +56 -0
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildChangelogFile.d.ts +6 -0
- package/dist/src/rlc-common/metadata/buildChangelogFile.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildChangelogFile.js +26 -0
- package/dist/src/rlc-common/metadata/buildChangelogFile.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildESLintConfig.d.ts +6 -0
- package/dist/src/rlc-common/metadata/buildESLintConfig.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildESLintConfig.js +82 -0
- package/dist/src/rlc-common/metadata/buildESLintConfig.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildLicenseFile.d.ts +5 -0
- package/dist/src/rlc-common/metadata/buildLicenseFile.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildLicenseFile.js +32 -0
- package/dist/src/rlc-common/metadata/buildLicenseFile.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildPackageFile.d.ts +25 -0
- package/dist/src/rlc-common/metadata/buildPackageFile.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildPackageFile.js +201 -0
- package/dist/src/rlc-common/metadata/buildPackageFile.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildReadmeFile.d.ts +11 -0
- package/dist/src/rlc-common/metadata/buildReadmeFile.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildReadmeFile.js +426 -0
- package/dist/src/rlc-common/metadata/buildReadmeFile.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildRollupConfig.d.ts +6 -0
- package/dist/src/rlc-common/metadata/buildRollupConfig.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildRollupConfig.js +142 -0
- package/dist/src/rlc-common/metadata/buildRollupConfig.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.d.ts +6 -0
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js +17 -0
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildTestConfig.d.ts +16 -0
- package/dist/src/rlc-common/metadata/buildTestConfig.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildTestConfig.js +55 -0
- package/dist/src/rlc-common/metadata/buildTestConfig.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildTsConfig.d.ts +61 -0
- package/dist/src/rlc-common/metadata/buildTsConfig.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildTsConfig.js +170 -0
- package/dist/src/rlc-common/metadata/buildTsConfig.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildVitestConfig.d.ts +6 -0
- package/dist/src/rlc-common/metadata/buildVitestConfig.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildVitestConfig.js +28 -0
- package/dist/src/rlc-common/metadata/buildVitestConfig.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildWarpConfig.d.ts +20 -0
- package/dist/src/rlc-common/metadata/buildWarpConfig.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildWarpConfig.js +77 -0
- package/dist/src/rlc-common/metadata/buildWarpConfig.js.map +1 -0
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts +51 -0
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js +121 -0
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js.map +1 -0
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.d.ts +242 -0
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js +176 -0
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js.map +1 -0
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.d.ts +8 -0
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js +102 -0
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js.map +1 -0
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.d.ts +57 -0
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js +53 -0
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js.map +1 -0
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.d.ts +64 -0
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js +183 -0
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js.map +1 -0
- package/dist/src/rlc-common/metadata/utils.d.ts +3 -0
- package/dist/src/rlc-common/metadata/utils.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/utils.js +7 -0
- package/dist/src/rlc-common/metadata/utils.js.map +1 -0
- package/dist/src/rlc-common/static/paginateContent.d.ts +2 -0
- package/dist/src/rlc-common/static/paginateContent.d.ts.map +1 -0
- package/dist/src/rlc-common/static/paginateContent.js +345 -0
- package/dist/src/rlc-common/static/paginateContent.js.map +1 -0
- package/dist/src/rlc-common/static/pollingContent.d.ts +2 -0
- package/dist/src/rlc-common/static/pollingContent.d.ts.map +1 -0
- package/dist/src/rlc-common/static/pollingContent.js +225 -0
- package/dist/src/rlc-common/static/pollingContent.js.map +1 -0
- package/dist/src/rlc-common/static/sampleTemplate.d.ts +2 -0
- package/dist/src/rlc-common/static/sampleTemplate.d.ts.map +1 -0
- package/dist/src/rlc-common/static/sampleTemplate.js +56 -0
- package/dist/src/rlc-common/static/sampleTemplate.js.map +1 -0
- package/dist/src/rlc-common/static/serializeHelper.d.ts +6 -0
- package/dist/src/rlc-common/static/serializeHelper.d.ts.map +1 -0
- package/dist/src/rlc-common/static/serializeHelper.js +31 -0
- package/dist/src/rlc-common/static/serializeHelper.js.map +1 -0
- package/dist/src/rlc-common/test/buildKarmaConfig.d.ts +6 -0
- package/dist/src/rlc-common/test/buildKarmaConfig.d.ts.map +1 -0
- package/dist/src/rlc-common/test/buildKarmaConfig.js +11 -0
- package/dist/src/rlc-common/test/buildKarmaConfig.js.map +1 -0
- package/dist/src/rlc-common/test/buildRecordedClient.d.ts +6 -0
- package/dist/src/rlc-common/test/buildRecordedClient.d.ts.map +1 -0
- package/dist/src/rlc-common/test/buildRecordedClient.js +18 -0
- package/dist/src/rlc-common/test/buildRecordedClient.js.map +1 -0
- package/dist/src/rlc-common/test/buildSampleTest.d.ts +6 -0
- package/dist/src/rlc-common/test/buildSampleTest.d.ts.map +1 -0
- package/dist/src/rlc-common/test/buildSampleTest.js +15 -0
- package/dist/src/rlc-common/test/buildSampleTest.js.map +1 -0
- package/dist/src/rlc-common/test/buildSnippets.d.ts +6 -0
- package/dist/src/rlc-common/test/buildSnippets.d.ts.map +1 -0
- package/dist/src/rlc-common/test/buildSnippets.js +29 -0
- package/dist/src/rlc-common/test/buildSnippets.js.map +1 -0
- package/dist/src/rlc-common/test/template.d.ts +5 -0
- package/dist/src/rlc-common/test/template.d.ts.map +1 -0
- package/dist/src/rlc-common/test/template.js +261 -0
- package/dist/src/rlc-common/test/template.js.map +1 -0
- package/dist/src/rlc-common/transformSampleGroups.d.ts +9 -0
- package/dist/src/rlc-common/transformSampleGroups.d.ts.map +1 -0
- package/dist/src/rlc-common/transformSampleGroups.js +317 -0
- package/dist/src/rlc-common/transformSampleGroups.js.map +1 -0
- 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 +1 -1
- 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 +1 -1
- 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/transformParameters.d.ts +1 -1
- package/dist/src/transform/transformParameters.d.ts.map +1 -1
- package/dist/src/transform/transformParameters.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/src/transform/transformResponses.js.map +1 -1
- package/dist/src/transform/transformSchemas.js +1 -1
- 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/transfromRLCOptions.d.ts +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts.map +1 -1
- package/dist/src/transform/transfromRLCOptions.js +1 -3
- package/dist/src/transform/transfromRLCOptions.js.map +1 -1
- package/dist/src/utils/clientUtils.js +1 -1
- package/dist/src/utils/clientUtils.js.map +1 -1
- package/dist/src/utils/crossLanguageDef.js +1 -1
- 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 +1 -1
- package/dist/src/utils/emitUtil.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/modelUtils.d.ts +1 -1
- package/dist/src/utils/modelUtils.d.ts.map +1 -1
- package/dist/src/utils/modelUtils.js +1 -1
- package/dist/src/utils/modelUtils.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 +1 -1
- 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 +1 -1
- package/dist/src/utils/parameterUtils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/framework/hooks/binder.ts +142 -51
- package/src/framework/hooks/sdkTypes.ts +1 -1
- package/src/framework/load-static-helpers.ts +1 -1
- package/src/index.ts +5 -1
- package/src/lib.ts +1 -16
- package/src/metaTree.ts +1 -1
- package/src/modular/buildClassicalClient.ts +1 -1
- package/src/modular/buildClassicalOperationGroups.ts +1 -1
- package/src/modular/buildClientContext.ts +1 -1
- package/src/modular/buildOperations.ts +1 -1
- package/src/modular/buildProjectFiles.ts +1 -1
- package/src/modular/buildRestorePoller.ts +1 -1
- package/src/modular/buildRootIndex.ts +1 -1
- package/src/modular/emitModels.ts +1 -1
- package/src/modular/emitModelsOptions.ts +1 -1
- package/src/modular/emitSamples.ts +1 -1
- package/src/modular/emitTests.ts +1 -1
- package/src/modular/helpers/classicalOperationHelpers.ts +1 -1
- package/src/modular/helpers/clientHelpers.ts +1 -1
- package/src/modular/helpers/exampleValueHelpers.ts +1 -1
- package/src/modular/helpers/namingHelpers.ts +1 -1
- package/src/modular/helpers/operationHelpers.ts +65 -42
- package/src/modular/helpers/typeHelpers.ts +1 -1
- package/src/modular/interfaces.ts +1 -1
- package/src/modular/serialization/buildDeserializerFunction.ts +1 -1
- package/src/modular/serialization/buildSerializerFunction.ts +1 -1
- package/src/modular/serialization/buildXmlSerializerFunction.ts +1 -1
- package/src/modular/type-expressions/get-type-expression.ts +1 -1
- package/src/rlc-common/buildClient.ts +561 -0
- package/src/rlc-common/buildClientDefinitions.ts +278 -0
- package/src/rlc-common/buildIndexFile.ts +344 -0
- package/src/rlc-common/buildIsUnexpectedHelper.ts +255 -0
- package/src/rlc-common/buildLogger.ts +43 -0
- package/src/rlc-common/buildMethodShortcuts.ts +83 -0
- package/src/rlc-common/buildObjectTypes.ts +680 -0
- package/src/rlc-common/buildPaginateHelper.ts +34 -0
- package/src/rlc-common/buildParameterTypes.ts +575 -0
- package/src/rlc-common/buildPollingHelper.ts +83 -0
- package/src/rlc-common/buildResponseTypes.ts +203 -0
- package/src/rlc-common/buildSamples.ts +32 -0
- package/src/rlc-common/buildSchemaType.ts +81 -0
- package/src/rlc-common/buildSerializeHelper.ts +49 -0
- package/src/rlc-common/buildTopLevelIndexFile.ts +65 -0
- package/src/rlc-common/helpers/apiVersionUtil.ts +53 -0
- package/src/rlc-common/helpers/importsUtil.ts +187 -0
- package/src/rlc-common/helpers/nameConstructors.ts +144 -0
- package/src/rlc-common/helpers/nameUtils.ts +319 -0
- package/src/rlc-common/helpers/operationHelpers.ts +155 -0
- package/src/rlc-common/helpers/packageUtil.ts +13 -0
- package/src/rlc-common/helpers/pathUtils.ts +15 -0
- package/src/rlc-common/helpers/schemaHelpers.ts +61 -0
- package/src/rlc-common/helpers/shortcutMethods.ts +67 -0
- package/src/rlc-common/helpers/typeUtil.ts +173 -0
- package/src/rlc-common/helpers/valueGenerationUtil.ts +257 -0
- package/src/rlc-common/index.ts +43 -0
- package/src/rlc-common/interfaces.ts +441 -0
- package/src/rlc-common/metadata/buildApiExtractorConfig.ts +71 -0
- package/src/rlc-common/metadata/buildChangelogFile.ts +29 -0
- package/src/rlc-common/metadata/buildESLintConfig.ts +86 -0
- package/src/rlc-common/metadata/buildLicenseFile.ts +33 -0
- package/src/rlc-common/metadata/buildPackageFile.ts +250 -0
- package/src/rlc-common/metadata/buildReadmeFile.ts +528 -0
- package/src/rlc-common/metadata/buildRollupConfig.ts +150 -0
- package/src/rlc-common/metadata/buildSampleEnvFile.ts +22 -0
- package/src/rlc-common/metadata/buildTestConfig.ts +72 -0
- package/src/rlc-common/metadata/buildTsConfig.ts +222 -0
- package/src/rlc-common/metadata/buildVitestConfig.ts +36 -0
- package/src/rlc-common/metadata/buildWarpConfig.ts +94 -0
- package/src/rlc-common/metadata/packageJson/azurePackageCommon.ts +161 -0
- package/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.ts +220 -0
- package/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.ts +134 -0
- package/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.ts +70 -0
- package/src/rlc-common/metadata/packageJson/packageCommon.ts +255 -0
- package/src/rlc-common/metadata/utils.ts +8 -0
- package/src/rlc-common/static/paginateContent.ts +345 -0
- package/src/rlc-common/static/pollingContent.ts +225 -0
- package/src/rlc-common/static/sampleTemplate.ts +56 -0
- package/src/rlc-common/static/serializeHelper.ts +34 -0
- package/src/rlc-common/test/buildKarmaConfig.ts +12 -0
- package/src/rlc-common/test/buildRecordedClient.ts +18 -0
- package/src/rlc-common/test/buildSampleTest.ts +15 -0
- package/src/rlc-common/test/buildSnippets.ts +35 -0
- package/src/rlc-common/test/template.ts +263 -0
- package/src/rlc-common/transformSampleGroups.ts +458 -0
- package/src/transform/transform.ts +1 -1
- package/src/transform/transformApiVersionInfo.ts +1 -1
- package/src/transform/transformHelperFunctionDetails.ts +1 -1
- package/src/transform/transformParameters.ts +1 -1
- package/src/transform/transformPaths.ts +1 -1
- package/src/transform/transformResponses.ts +1 -1
- package/src/transform/transformSchemas.ts +1 -1
- package/src/transform/transformTelemetryInfo.ts +1 -1
- package/src/transform/transfromRLCOptions.ts +1 -3
- package/src/utils/clientUtils.ts +1 -1
- package/src/utils/crossLanguageDef.ts +1 -1
- package/src/utils/emitUtil.ts +1 -1
- package/src/utils/interfaces.ts +1 -1
- package/src/utils/modelUtils.ts +1 -1
- package/src/utils/operationUtil.ts +1 -1
- package/src/utils/parameterUtils.ts +1 -1
- package/LICENSE +0 -21
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
CallSignatureDeclarationStructure,
|
|
6
|
+
InterfaceDeclarationStructure,
|
|
7
|
+
OptionalKind,
|
|
8
|
+
Project,
|
|
9
|
+
SourceFile,
|
|
10
|
+
StructureKind,
|
|
11
|
+
Writers
|
|
12
|
+
} from "ts-morph";
|
|
13
|
+
import * as path from "path";
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
buildMethodDefinitions,
|
|
17
|
+
getGeneratedWrapperTypes,
|
|
18
|
+
getPathParamDefinitions
|
|
19
|
+
} from "./helpers/operationHelpers.js";
|
|
20
|
+
import { PathMetadata, Paths, RLCModel } from "./interfaces.js";
|
|
21
|
+
import { generateMethodShortcuts } from "./helpers/shortcutMethods.js";
|
|
22
|
+
import { REST_CLIENT_RESERVED } from "./buildMethodShortcuts.js";
|
|
23
|
+
import {
|
|
24
|
+
CasingConvention,
|
|
25
|
+
NameType,
|
|
26
|
+
normalizeName
|
|
27
|
+
} from "./helpers/nameUtils.js";
|
|
28
|
+
import { pascalCase } from "./helpers/nameUtils.js";
|
|
29
|
+
import {
|
|
30
|
+
getClientName,
|
|
31
|
+
getImportModuleName
|
|
32
|
+
} from "./helpers/nameConstructors.js";
|
|
33
|
+
import { getImportSpecifier } from "./helpers/importsUtil.js";
|
|
34
|
+
|
|
35
|
+
export function buildClientDefinitions(model: RLCModel) {
|
|
36
|
+
const options = {
|
|
37
|
+
importedParameters: new Set<string>(),
|
|
38
|
+
importedResponses: new Set<string>(),
|
|
39
|
+
clientImports: new Set<string>()
|
|
40
|
+
};
|
|
41
|
+
const project = new Project();
|
|
42
|
+
const srcPath = model.srcPath;
|
|
43
|
+
const filePath = path.join(srcPath, `clientDefinitions.ts`);
|
|
44
|
+
const clientDefinitionsFile = project.createSourceFile(filePath, undefined, {
|
|
45
|
+
overwrite: true
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// Get all paths
|
|
49
|
+
const pathDictionary = model.paths;
|
|
50
|
+
let shortcuts: OptionalKind<InterfaceDeclarationStructure>[] = [];
|
|
51
|
+
// There may be operations without an operation group, those shortcut
|
|
52
|
+
// methods need to be handled differently.
|
|
53
|
+
let shortcutsInOperationGroup: { name: string; type: string }[] = [];
|
|
54
|
+
|
|
55
|
+
if (model.options?.includeShortcuts) {
|
|
56
|
+
shortcuts = generateMethodShortcuts(model.paths);
|
|
57
|
+
clientDefinitionsFile.addInterfaces(shortcuts);
|
|
58
|
+
shortcutsInOperationGroup = shortcuts
|
|
59
|
+
.filter((s) => s.name !== "ClientOperations")
|
|
60
|
+
.map((s) => getShortcutName(s.name));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
clientDefinitionsFile.addInterface({
|
|
64
|
+
name: "Routes",
|
|
65
|
+
isExported: true,
|
|
66
|
+
callSignatures: getPathFirstRoutesInterfaceDefinition(
|
|
67
|
+
pathDictionary,
|
|
68
|
+
clientDefinitionsFile,
|
|
69
|
+
options
|
|
70
|
+
)
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const clientInterfaceName = getClientName(model);
|
|
74
|
+
clientDefinitionsFile.addTypeAlias({
|
|
75
|
+
isExported: true,
|
|
76
|
+
name: clientInterfaceName,
|
|
77
|
+
type: Writers.intersectionType(
|
|
78
|
+
"Client",
|
|
79
|
+
Writers.objectType({
|
|
80
|
+
properties: [
|
|
81
|
+
{ name: "path", type: "Routes" },
|
|
82
|
+
...shortcutsInOperationGroup
|
|
83
|
+
]
|
|
84
|
+
}),
|
|
85
|
+
// If the length of shortcuts in operation group and all shortcutsInOperationGroup
|
|
86
|
+
// is the same, then we don't have any operations at the client level
|
|
87
|
+
// Otherwise we need to make the client interface name an union with the
|
|
88
|
+
// definition of all client level shortcut methods
|
|
89
|
+
...(shortcutsInOperationGroup.length !== shortcuts.length
|
|
90
|
+
? [`ClientOperations`]
|
|
91
|
+
: [])
|
|
92
|
+
)
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
if (options.importedParameters.size) {
|
|
96
|
+
clientDefinitionsFile.addImportDeclaration({
|
|
97
|
+
isTypeOnly: true,
|
|
98
|
+
namedImports: [...options.importedParameters],
|
|
99
|
+
moduleSpecifier: getImportModuleName(
|
|
100
|
+
{ cjsName: "./parameters", esModulesName: "./parameters.js" },
|
|
101
|
+
model
|
|
102
|
+
)
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (options.importedResponses.size) {
|
|
107
|
+
clientDefinitionsFile.addImportDeclaration({
|
|
108
|
+
isTypeOnly: true,
|
|
109
|
+
namedImports: [...options.importedResponses],
|
|
110
|
+
moduleSpecifier: getImportModuleName(
|
|
111
|
+
{ cjsName: "./responses", esModulesName: "./responses.js" },
|
|
112
|
+
model
|
|
113
|
+
)
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (
|
|
118
|
+
(model.importInfo.internalImports.rlcClientDefinition.importsSet?.size ??
|
|
119
|
+
0) > 0
|
|
120
|
+
) {
|
|
121
|
+
clientDefinitionsFile.addImportDeclaration({
|
|
122
|
+
isTypeOnly: true,
|
|
123
|
+
namedImports: Array.from(
|
|
124
|
+
model.importInfo.internalImports.rlcClientDefinition.importsSet!
|
|
125
|
+
),
|
|
126
|
+
moduleSpecifier: getImportModuleName(
|
|
127
|
+
{ cjsName: "./models", esModulesName: "./models.js" },
|
|
128
|
+
model
|
|
129
|
+
)
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
options.clientImports.add("Client");
|
|
134
|
+
options.clientImports.add("StreamableMethod");
|
|
135
|
+
clientDefinitionsFile.addImportDeclarations([
|
|
136
|
+
{
|
|
137
|
+
isTypeOnly: true,
|
|
138
|
+
namedImports: [...options.clientImports],
|
|
139
|
+
moduleSpecifier: getImportSpecifier(
|
|
140
|
+
"restClient",
|
|
141
|
+
model.importInfo.runtimeImports
|
|
142
|
+
)
|
|
143
|
+
}
|
|
144
|
+
]);
|
|
145
|
+
|
|
146
|
+
return { path: filePath, content: clientDefinitionsFile.getFullText() };
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function getPathFirstRoutesInterfaceDefinition(
|
|
150
|
+
paths: Paths,
|
|
151
|
+
sourcefile: SourceFile,
|
|
152
|
+
options: {
|
|
153
|
+
importedParameters: Set<string>;
|
|
154
|
+
importedResponses: Set<string>;
|
|
155
|
+
clientImports: Set<string>;
|
|
156
|
+
}
|
|
157
|
+
): CallSignatureDeclarationStructure[] {
|
|
158
|
+
const operationGroupCount = getOperationGroupCount(paths);
|
|
159
|
+
|
|
160
|
+
const signatures: CallSignatureDeclarationStructure[] = [];
|
|
161
|
+
for (const key of Object.keys(paths)) {
|
|
162
|
+
const pathMetadata = paths[key];
|
|
163
|
+
if (!pathMetadata) {
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
for (const verb of Object.keys(pathMetadata.methods)) {
|
|
167
|
+
const methods = pathMetadata.methods[verb];
|
|
168
|
+
if (!methods) {
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
for (const method of methods) {
|
|
172
|
+
options.importedParameters.add(method.optionsName);
|
|
173
|
+
method.returnType
|
|
174
|
+
.split(" | ")
|
|
175
|
+
.forEach((item) => options.importedResponses.add(item));
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
generatePathFirstRouteMethodsDefinition(
|
|
179
|
+
pathMetadata,
|
|
180
|
+
operationGroupCount,
|
|
181
|
+
sourcefile
|
|
182
|
+
);
|
|
183
|
+
const pathParams = pathMetadata.pathParameters;
|
|
184
|
+
getGeneratedWrapperTypes(pathParams).forEach((p) =>
|
|
185
|
+
options.importedParameters.add(p.name ?? p.type)
|
|
186
|
+
);
|
|
187
|
+
signatures.push({
|
|
188
|
+
docs: [
|
|
189
|
+
`Resource for '${key
|
|
190
|
+
.replace(/}/g, "\\}")
|
|
191
|
+
.replace(
|
|
192
|
+
/{/g,
|
|
193
|
+
"\\{"
|
|
194
|
+
)}' has methods for the following verbs: ${Object.keys(
|
|
195
|
+
pathMetadata.methods
|
|
196
|
+
).join(", ")}`
|
|
197
|
+
],
|
|
198
|
+
parameters: [
|
|
199
|
+
{ name: "path", type: `"${key}"` },
|
|
200
|
+
...getPathParamDefinitions(pathParams)
|
|
201
|
+
],
|
|
202
|
+
returnType: getOperationReturnTypeName(
|
|
203
|
+
pathMetadata,
|
|
204
|
+
getOperationGroupCount(paths)
|
|
205
|
+
),
|
|
206
|
+
kind: StructureKind.CallSignature
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
return signatures;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function getOperationGroupCount(paths: Paths) {
|
|
213
|
+
const operationGroups = Object.keys(paths)
|
|
214
|
+
.map((p) => paths[p]?.operationGroupName)
|
|
215
|
+
.filter((p) => p && p !== "Client");
|
|
216
|
+
const uniqueNames = new Set(operationGroups);
|
|
217
|
+
|
|
218
|
+
return uniqueNames.size;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function getOperationReturnTypeName(
|
|
222
|
+
{ operationGroupName, name }: PathMetadata,
|
|
223
|
+
operationGroupCount: number
|
|
224
|
+
) {
|
|
225
|
+
if (
|
|
226
|
+
operationGroupCount > 1 &&
|
|
227
|
+
operationGroupName &&
|
|
228
|
+
operationGroupName !== "Client"
|
|
229
|
+
) {
|
|
230
|
+
return normalizeName(
|
|
231
|
+
`${pascalCase(operationGroupName)}${pascalCase(name)}`,
|
|
232
|
+
NameType.Interface
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return pascalCase(name);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function generatePathFirstRouteMethodsDefinition(
|
|
240
|
+
path: PathMetadata,
|
|
241
|
+
operationGroupCount: number,
|
|
242
|
+
file: SourceFile
|
|
243
|
+
): void {
|
|
244
|
+
const methodDefinitions = buildMethodDefinitions(path.methods);
|
|
245
|
+
const interfaceDef = {
|
|
246
|
+
methods: methodDefinitions,
|
|
247
|
+
name: getOperationReturnTypeName(path, operationGroupCount),
|
|
248
|
+
isExported: true
|
|
249
|
+
};
|
|
250
|
+
file.addInterface(interfaceDef);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
function getShortcutName(interfaceName: string) {
|
|
254
|
+
const endIndex = shouldKeepSuffix(interfaceName)
|
|
255
|
+
? undefined
|
|
256
|
+
: interfaceName.length - "Operations".length;
|
|
257
|
+
const clientProperty = normalizeName(
|
|
258
|
+
interfaceName.substring(0, endIndex),
|
|
259
|
+
NameType.OperationGroup,
|
|
260
|
+
true,
|
|
261
|
+
REST_CLIENT_RESERVED,
|
|
262
|
+
CasingConvention.Camel
|
|
263
|
+
);
|
|
264
|
+
|
|
265
|
+
return {
|
|
266
|
+
name: clientProperty,
|
|
267
|
+
type: interfaceName
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function shouldKeepSuffix(name: string) {
|
|
272
|
+
const reservedNames = [
|
|
273
|
+
"pipelineOperations",
|
|
274
|
+
"pathOperations",
|
|
275
|
+
"pathUncheckedOperations"
|
|
276
|
+
];
|
|
277
|
+
return reservedNames.some((r) => r.toLowerCase() === name.toLowerCase());
|
|
278
|
+
}
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import { Project, SourceFile } from "ts-morph";
|
|
5
|
+
import { NameType, normalizeName } from "./helpers/nameUtils.js";
|
|
6
|
+
import {
|
|
7
|
+
hasCsvCollection,
|
|
8
|
+
hasInputModels,
|
|
9
|
+
hasMultiCollection,
|
|
10
|
+
hasOutputModels,
|
|
11
|
+
hasPagingOperations,
|
|
12
|
+
hasPipeCollection,
|
|
13
|
+
hasPollingOperations,
|
|
14
|
+
hasSsvCollection,
|
|
15
|
+
hasTsvCollection,
|
|
16
|
+
hasUnexpectedHelper
|
|
17
|
+
} from "./helpers/operationHelpers.js";
|
|
18
|
+
import { isAzurePackage } from "./helpers/packageUtil.js";
|
|
19
|
+
import { RLCModel } from "./interfaces.js";
|
|
20
|
+
import * as path from "path";
|
|
21
|
+
import { getImportModuleName } from "./helpers/nameConstructors.js";
|
|
22
|
+
|
|
23
|
+
export function buildIndexFile(model: RLCModel) {
|
|
24
|
+
const multiClient = Boolean(model.options?.multiClient),
|
|
25
|
+
batch = model.options?.batch;
|
|
26
|
+
const project = new Project();
|
|
27
|
+
const { srcPath } = model;
|
|
28
|
+
const filePath = path.join(srcPath, `index.ts`);
|
|
29
|
+
const indexFile = project.createSourceFile(filePath, undefined, {
|
|
30
|
+
overwrite: true
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
if (!multiClient || !batch || batch?.length === 1) {
|
|
34
|
+
// if we are generate single client package for RLC
|
|
35
|
+
generateRLCIndex(indexFile, model);
|
|
36
|
+
} else {
|
|
37
|
+
generateRLCIndexForMultiClient(indexFile, model);
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
path: filePath,
|
|
41
|
+
content: indexFile.getFullText()
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// to generate a index.ts for each single module inside the multi client RLC package
|
|
46
|
+
function generateRLCIndexForMultiClient(file: SourceFile, model: RLCModel) {
|
|
47
|
+
const clientName = model.libraryName;
|
|
48
|
+
const createClientFuncName = `createClient`;
|
|
49
|
+
const moduleName = normalizeName(clientName, NameType.File);
|
|
50
|
+
|
|
51
|
+
file.addImportDeclaration({
|
|
52
|
+
namespaceImport: "Parameters",
|
|
53
|
+
moduleSpecifier: getImportModuleName(
|
|
54
|
+
{ cjsName: "./parameters", esModulesName: "./parameters.js" },
|
|
55
|
+
model
|
|
56
|
+
)
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
file.addImportDeclaration({
|
|
60
|
+
namespaceImport: "Responses",
|
|
61
|
+
moduleSpecifier: getImportModuleName(
|
|
62
|
+
{ cjsName: "./responses", esModulesName: "./responses.js" },
|
|
63
|
+
model
|
|
64
|
+
)
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
file.addImportDeclaration({
|
|
68
|
+
namespaceImport: "Client",
|
|
69
|
+
moduleSpecifier: getImportModuleName(
|
|
70
|
+
{
|
|
71
|
+
cjsName: "./clientDefinitions",
|
|
72
|
+
esModulesName: "./clientDefinitions.js"
|
|
73
|
+
},
|
|
74
|
+
model
|
|
75
|
+
)
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
const exports = ["Parameters", "Responses", "Client"];
|
|
79
|
+
if (hasInputModels(model)) {
|
|
80
|
+
file.addImportDeclaration({
|
|
81
|
+
namespaceImport: "Models",
|
|
82
|
+
moduleSpecifier: getImportModuleName(
|
|
83
|
+
{
|
|
84
|
+
cjsName: "./models",
|
|
85
|
+
esModulesName: "./models.js"
|
|
86
|
+
},
|
|
87
|
+
model
|
|
88
|
+
)
|
|
89
|
+
});
|
|
90
|
+
exports.push("Models");
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (hasOutputModels(model)) {
|
|
94
|
+
file.addImportDeclaration({
|
|
95
|
+
namespaceImport: "OutputModels",
|
|
96
|
+
moduleSpecifier: getImportModuleName(
|
|
97
|
+
{
|
|
98
|
+
cjsName: "./outputModels",
|
|
99
|
+
esModulesName: "./outputModels.js"
|
|
100
|
+
},
|
|
101
|
+
model
|
|
102
|
+
)
|
|
103
|
+
});
|
|
104
|
+
exports.push("OutputModels");
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (hasPagingOperations(model)) {
|
|
108
|
+
file.addImportDeclaration({
|
|
109
|
+
namespaceImport: "PaginateHelper",
|
|
110
|
+
moduleSpecifier: getImportModuleName(
|
|
111
|
+
{
|
|
112
|
+
cjsName: "./paginateHelper",
|
|
113
|
+
esModulesName: "./paginateHelper.js"
|
|
114
|
+
},
|
|
115
|
+
model
|
|
116
|
+
)
|
|
117
|
+
});
|
|
118
|
+
exports.push("PaginateHelper");
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (hasUnexpectedHelper(model)) {
|
|
122
|
+
file.addImportDeclaration({
|
|
123
|
+
namespaceImport: "UnexpectedHelper",
|
|
124
|
+
moduleSpecifier: getImportModuleName(
|
|
125
|
+
{
|
|
126
|
+
cjsName: "./isUnexpected",
|
|
127
|
+
esModulesName: "./isUnexpected.js"
|
|
128
|
+
},
|
|
129
|
+
model
|
|
130
|
+
)
|
|
131
|
+
});
|
|
132
|
+
exports.push("UnexpectedHelper");
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (hasPollingOperations(model)) {
|
|
136
|
+
file.addImportDeclaration({
|
|
137
|
+
namespaceImport: "PollingHelper",
|
|
138
|
+
moduleSpecifier: getImportModuleName(
|
|
139
|
+
{
|
|
140
|
+
cjsName: "./pollingHelper",
|
|
141
|
+
esModulesName: "./pollingHelper.js"
|
|
142
|
+
},
|
|
143
|
+
model
|
|
144
|
+
)
|
|
145
|
+
});
|
|
146
|
+
exports.push("PollingHelper");
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (
|
|
150
|
+
hasMultiCollection(model) ||
|
|
151
|
+
hasSsvCollection(model) ||
|
|
152
|
+
hasPipeCollection(model) ||
|
|
153
|
+
hasTsvCollection(model) ||
|
|
154
|
+
hasCsvCollection(model)
|
|
155
|
+
) {
|
|
156
|
+
file.addImportDeclaration({
|
|
157
|
+
namespaceImport: "SerializeHelper",
|
|
158
|
+
moduleSpecifier: getImportModuleName(
|
|
159
|
+
{
|
|
160
|
+
cjsName: "./serializeHelper",
|
|
161
|
+
esModulesName: "./serializeHelper.js"
|
|
162
|
+
},
|
|
163
|
+
model
|
|
164
|
+
)
|
|
165
|
+
});
|
|
166
|
+
exports.push("SerializeHelper");
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
file.addExportDeclarations([
|
|
170
|
+
{
|
|
171
|
+
moduleSpecifier: getImportModuleName(
|
|
172
|
+
{
|
|
173
|
+
cjsName: `./${moduleName}`,
|
|
174
|
+
esModulesName: `./${moduleName}.js`
|
|
175
|
+
},
|
|
176
|
+
model
|
|
177
|
+
),
|
|
178
|
+
namedExports: [`${createClientFuncName}`, `${clientName}ClientOptions`]
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
namedExports: [...exports]
|
|
182
|
+
}
|
|
183
|
+
]);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function generateRLCIndex(file: SourceFile, model: RLCModel) {
|
|
187
|
+
const clientName = model.libraryName;
|
|
188
|
+
const createClientFuncName = `${clientName}`;
|
|
189
|
+
const moduleName = normalizeName(clientName, NameType.File);
|
|
190
|
+
|
|
191
|
+
file.addImportDeclaration({
|
|
192
|
+
moduleSpecifier: getImportModuleName(
|
|
193
|
+
{
|
|
194
|
+
cjsName: `./${moduleName}`,
|
|
195
|
+
esModulesName: `./${moduleName}.js`
|
|
196
|
+
},
|
|
197
|
+
model
|
|
198
|
+
),
|
|
199
|
+
defaultImport: createClientFuncName
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
file.addExportDeclarations([
|
|
203
|
+
{
|
|
204
|
+
moduleSpecifier: getImportModuleName(
|
|
205
|
+
{
|
|
206
|
+
cjsName: `./${moduleName}`,
|
|
207
|
+
esModulesName: `./${moduleName}.js`
|
|
208
|
+
},
|
|
209
|
+
model
|
|
210
|
+
)
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
moduleSpecifier: getImportModuleName(
|
|
214
|
+
{
|
|
215
|
+
cjsName: `./parameters`,
|
|
216
|
+
esModulesName: `./parameters.js`
|
|
217
|
+
},
|
|
218
|
+
model
|
|
219
|
+
)
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
moduleSpecifier: getImportModuleName(
|
|
223
|
+
{
|
|
224
|
+
cjsName: `./responses`,
|
|
225
|
+
esModulesName: `./responses.js`
|
|
226
|
+
},
|
|
227
|
+
model
|
|
228
|
+
)
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
moduleSpecifier: getImportModuleName(
|
|
232
|
+
{
|
|
233
|
+
cjsName: `./clientDefinitions`,
|
|
234
|
+
esModulesName: `./clientDefinitions.js`
|
|
235
|
+
},
|
|
236
|
+
model
|
|
237
|
+
)
|
|
238
|
+
}
|
|
239
|
+
]);
|
|
240
|
+
|
|
241
|
+
if (hasUnexpectedHelper(model)) {
|
|
242
|
+
file.addExportDeclarations([
|
|
243
|
+
{
|
|
244
|
+
moduleSpecifier: getImportModuleName(
|
|
245
|
+
{
|
|
246
|
+
cjsName: `./isUnexpected`,
|
|
247
|
+
esModulesName: `./isUnexpected.js`
|
|
248
|
+
},
|
|
249
|
+
model
|
|
250
|
+
)
|
|
251
|
+
}
|
|
252
|
+
]);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
if (hasInputModels(model)) {
|
|
256
|
+
file.addExportDeclarations([
|
|
257
|
+
{
|
|
258
|
+
moduleSpecifier: getImportModuleName(
|
|
259
|
+
{
|
|
260
|
+
cjsName: `./models`,
|
|
261
|
+
esModulesName: `./models.js`
|
|
262
|
+
},
|
|
263
|
+
model
|
|
264
|
+
)
|
|
265
|
+
}
|
|
266
|
+
]);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
if (hasOutputModels(model)) {
|
|
270
|
+
file.addExportDeclarations([
|
|
271
|
+
{
|
|
272
|
+
moduleSpecifier: getImportModuleName(
|
|
273
|
+
{
|
|
274
|
+
cjsName: `./outputModels`,
|
|
275
|
+
esModulesName: `./outputModels.js`
|
|
276
|
+
},
|
|
277
|
+
model
|
|
278
|
+
)
|
|
279
|
+
}
|
|
280
|
+
]);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
if (hasPagingOperations(model)) {
|
|
284
|
+
file.addExportDeclarations([
|
|
285
|
+
{
|
|
286
|
+
moduleSpecifier: getImportModuleName(
|
|
287
|
+
{
|
|
288
|
+
cjsName: `./paginateHelper`,
|
|
289
|
+
esModulesName: `./paginateHelper.js`
|
|
290
|
+
},
|
|
291
|
+
model
|
|
292
|
+
)
|
|
293
|
+
}
|
|
294
|
+
]);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (hasPollingOperations(model)) {
|
|
298
|
+
file.addExportDeclarations([
|
|
299
|
+
{
|
|
300
|
+
moduleSpecifier: getImportModuleName(
|
|
301
|
+
{
|
|
302
|
+
cjsName: `./pollingHelper`,
|
|
303
|
+
esModulesName: `./pollingHelper.js`
|
|
304
|
+
},
|
|
305
|
+
model
|
|
306
|
+
)
|
|
307
|
+
}
|
|
308
|
+
]);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
if (
|
|
312
|
+
hasMultiCollection(model) ||
|
|
313
|
+
hasSsvCollection(model) ||
|
|
314
|
+
hasPipeCollection(model) ||
|
|
315
|
+
hasTsvCollection(model) ||
|
|
316
|
+
hasCsvCollection(model)
|
|
317
|
+
) {
|
|
318
|
+
file.addExportDeclarations([
|
|
319
|
+
{
|
|
320
|
+
moduleSpecifier: getImportModuleName(
|
|
321
|
+
{
|
|
322
|
+
cjsName: `./serializeHelper`,
|
|
323
|
+
esModulesName: `./serializeHelper.js`
|
|
324
|
+
},
|
|
325
|
+
model
|
|
326
|
+
)
|
|
327
|
+
}
|
|
328
|
+
]);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (isAzurePackage(model)) {
|
|
332
|
+
file.addExportDeclarations([
|
|
333
|
+
{
|
|
334
|
+
moduleSpecifier: "@azure/core-rest-pipeline",
|
|
335
|
+
namedExports: ["RestError", "isRestError"]
|
|
336
|
+
}
|
|
337
|
+
]);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
file.addExportAssignment({
|
|
341
|
+
expression: createClientFuncName,
|
|
342
|
+
isExportEquals: false
|
|
343
|
+
});
|
|
344
|
+
}
|