@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,441 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
export interface RLCModel {
|
|
4
|
+
libraryName: string;
|
|
5
|
+
srcPath: string;
|
|
6
|
+
paths: Paths;
|
|
7
|
+
importInfo: ImportInfo;
|
|
8
|
+
options?: RLCOptions;
|
|
9
|
+
schemas: Schema[];
|
|
10
|
+
apiVersionInfo?: ApiVersionInfo;
|
|
11
|
+
parameters?: OperationParameter[];
|
|
12
|
+
responses?: OperationResponse[];
|
|
13
|
+
helperDetails?: HelperFunctionDetails;
|
|
14
|
+
urlInfo?: UrlInfo;
|
|
15
|
+
telemetryOptions?: TelemetryInfo;
|
|
16
|
+
sampleGroups?: RLCSampleGroup[];
|
|
17
|
+
rlcSourceDir?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ImportInfo {
|
|
21
|
+
internalImports: Imports;
|
|
22
|
+
runtimeImports: Imports;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type Imports = Record<ImportType, ImportMetadata>;
|
|
26
|
+
|
|
27
|
+
export type ImportType =
|
|
28
|
+
/**inner models' imports for parameter and response */
|
|
29
|
+
| "parameter"
|
|
30
|
+
| "response"
|
|
31
|
+
| "rlcIndex"
|
|
32
|
+
| "modularModel"
|
|
33
|
+
| "rlcClientFactory"
|
|
34
|
+
| "rlcClientDefinition"
|
|
35
|
+
/**common third party imports */
|
|
36
|
+
| "restClient"
|
|
37
|
+
| "coreAuth"
|
|
38
|
+
| "restPipeline"
|
|
39
|
+
| "coreUtil"
|
|
40
|
+
| "coreLogger"
|
|
41
|
+
// this is a fallback import if above imports are not available
|
|
42
|
+
// mainly used in non-branded scope
|
|
43
|
+
| "commonFallback"
|
|
44
|
+
/**azure specific imports */
|
|
45
|
+
| "azureEslintPlugin"
|
|
46
|
+
| "azureTestRecorder"
|
|
47
|
+
| "azureDevTool"
|
|
48
|
+
| "azureAbortController"
|
|
49
|
+
| "azureCoreLro"
|
|
50
|
+
| "azureCorePaging"
|
|
51
|
+
/**Internal helper imports */
|
|
52
|
+
| "serializerHelpers";
|
|
53
|
+
|
|
54
|
+
export interface ImportMetadata {
|
|
55
|
+
type: ImportType;
|
|
56
|
+
specifier?: string;
|
|
57
|
+
version?: string;
|
|
58
|
+
importsSet?: Set<string>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* A group of samples in operation_id level and they are used to generate in a sample file
|
|
63
|
+
*/
|
|
64
|
+
export interface RLCSampleGroup {
|
|
65
|
+
filename: string;
|
|
66
|
+
clientPackageName: string;
|
|
67
|
+
defaultFactoryName: string;
|
|
68
|
+
samples: RLCSampleDetail[];
|
|
69
|
+
importedTypes?: string[];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* An independent sample detail and it will be wrapped as a func
|
|
74
|
+
*/
|
|
75
|
+
export interface RLCSampleDetail {
|
|
76
|
+
/**
|
|
77
|
+
* metadata for comments
|
|
78
|
+
*/
|
|
79
|
+
description: string;
|
|
80
|
+
originalFileLocation?: string;
|
|
81
|
+
name: string;
|
|
82
|
+
path: string;
|
|
83
|
+
defaultFactoryName: string;
|
|
84
|
+
clientParamAssignments: string[];
|
|
85
|
+
pathParamAssignments: string[];
|
|
86
|
+
methodParamAssignments: string[];
|
|
87
|
+
clientParamNames: string;
|
|
88
|
+
pathParamNames: string;
|
|
89
|
+
methodParamNames: "options" | "" | string;
|
|
90
|
+
method: string;
|
|
91
|
+
isLRO: boolean;
|
|
92
|
+
isPaging: boolean;
|
|
93
|
+
useLegacyLro: boolean;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface TelemetryInfo {
|
|
97
|
+
customRequestIdHeaderName?: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface PathTemplateApiVersion {
|
|
101
|
+
value: string;
|
|
102
|
+
templateName: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface UrlInfo {
|
|
106
|
+
endpoint?: string;
|
|
107
|
+
urlParameters?: PathParameter[];
|
|
108
|
+
apiVersionInfo?: ApiVersionInfo;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface ApiVersionInfo {
|
|
112
|
+
definedPosition?: ApiVersionPosition;
|
|
113
|
+
defaultValue?: string;
|
|
114
|
+
isCrossedVersion?: boolean;
|
|
115
|
+
required?: boolean;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export type ApiVersionPosition =
|
|
119
|
+
| "path"
|
|
120
|
+
| "query"
|
|
121
|
+
| "baseurl"
|
|
122
|
+
| "duplicate"
|
|
123
|
+
| "none";
|
|
124
|
+
export interface HelperFunctionDetails {
|
|
125
|
+
hasPaging?: boolean;
|
|
126
|
+
hasLongRunning?: boolean;
|
|
127
|
+
clientLroOverload?: boolean;
|
|
128
|
+
pageDetails?: PagingDetails;
|
|
129
|
+
hasMultiCollection?: boolean;
|
|
130
|
+
hasPipeCollection?: boolean;
|
|
131
|
+
hasSsvCollection?: boolean;
|
|
132
|
+
hasTsvCollection?: boolean;
|
|
133
|
+
hasCsvCollection?: boolean;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface PagingDetails {
|
|
137
|
+
itemNames: string[];
|
|
138
|
+
nextLinkNames: string[];
|
|
139
|
+
isComplexPaging: boolean;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export type Methods = {
|
|
143
|
+
// could be more than one method if overloading
|
|
144
|
+
[key: string]: OperationMethod[];
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export interface ResponseTypes {
|
|
148
|
+
success: string[];
|
|
149
|
+
error: string[];
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface OperationMethod {
|
|
153
|
+
optionsName: string;
|
|
154
|
+
description: string;
|
|
155
|
+
hasOptionalOptions: boolean;
|
|
156
|
+
returnType: string;
|
|
157
|
+
successStatus: string[];
|
|
158
|
+
responseTypes: ResponseTypes;
|
|
159
|
+
operationName: string;
|
|
160
|
+
operationHelperDetail?: OperationHelperDetail;
|
|
161
|
+
}
|
|
162
|
+
export interface PathMetadata {
|
|
163
|
+
name: string;
|
|
164
|
+
pathParameters: PathParameter[];
|
|
165
|
+
methods: Methods;
|
|
166
|
+
operationGroupName: string;
|
|
167
|
+
description: string;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export type Paths = Record<string, PathMetadata>;
|
|
171
|
+
|
|
172
|
+
export type PathParameter = {
|
|
173
|
+
oriName?: string;
|
|
174
|
+
name: string;
|
|
175
|
+
documentName?: string;
|
|
176
|
+
type: string;
|
|
177
|
+
description?: string;
|
|
178
|
+
value?: string | number | boolean;
|
|
179
|
+
wrapperType?: Schema;
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
export interface OperationHelperDetail {
|
|
183
|
+
lroDetails?: OperationLroDetail;
|
|
184
|
+
isPaging?: boolean;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export const OPERATION_LRO_HIGH_PRIORITY = 0,
|
|
188
|
+
OPERATION_LRO_LOW_PRIORITY = 1;
|
|
189
|
+
export interface OperationLroDetail {
|
|
190
|
+
isLongRunning?: boolean;
|
|
191
|
+
logicalResponseTypes?: ResponseTypes;
|
|
192
|
+
operationLroOverload?: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* This is used to sort the overload order, sorted in descending order
|
|
195
|
+
*/
|
|
196
|
+
precedence?: number;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Flavor of the package to generate. If "azure", an Azure-branded package should be generated. If left undefined, a package without Azure branding will be generated.
|
|
201
|
+
*/
|
|
202
|
+
export type PackageFlavor = "azure" | undefined;
|
|
203
|
+
|
|
204
|
+
export interface RLCOptions {
|
|
205
|
+
/**
|
|
206
|
+
* Whether to include response headers in the generated response types. If true, the generated response types will include headers as properties.
|
|
207
|
+
*/
|
|
208
|
+
includeHeadersInResponse?: boolean;
|
|
209
|
+
includeShortcuts?: boolean;
|
|
210
|
+
multiClient?: boolean;
|
|
211
|
+
batch?: any[];
|
|
212
|
+
packageDetails?: PackageDetails;
|
|
213
|
+
addCredentials?: boolean;
|
|
214
|
+
/** Three possiblie values:
|
|
215
|
+
* - undefined, no credentialScopes and relevant settings would be generated
|
|
216
|
+
* - [], which means we would generate TokenCredential but no credentialScopes and relevant settings
|
|
217
|
+
* - ["..."], which means we would generate credentialScopes and relevant settings with the given values
|
|
218
|
+
*/
|
|
219
|
+
credentialScopes?: string[];
|
|
220
|
+
credentialKeyHeaderName?: string;
|
|
221
|
+
customHttpAuthHeaderName?: string;
|
|
222
|
+
customHttpAuthSharedKeyPrefix?: string;
|
|
223
|
+
/**
|
|
224
|
+
* Three possible values:
|
|
225
|
+
* - undefined, the default behavior which means we would generate metadata if the package.json file is absent
|
|
226
|
+
* - true, which means we would always generate new files or override existing files
|
|
227
|
+
* - false, which means we would not generate any files no matter there exists or not
|
|
228
|
+
*/
|
|
229
|
+
generateMetadata?: boolean;
|
|
230
|
+
/**
|
|
231
|
+
* Three possible values:
|
|
232
|
+
* - undefined, the default behavior which means we would generate test if there is no `test` folder
|
|
233
|
+
* - true, which means we would always generate new files or override existing files
|
|
234
|
+
* - false, which means we would not generate any files no matter there exists or not
|
|
235
|
+
*/
|
|
236
|
+
generateTest?: boolean;
|
|
237
|
+
generateSample?: boolean;
|
|
238
|
+
azureSdkForJs?: boolean;
|
|
239
|
+
azureOutputDirectory?: string;
|
|
240
|
+
isTypeSpecTest?: boolean;
|
|
241
|
+
title?: string;
|
|
242
|
+
dependencyInfo?: DependencyInfo;
|
|
243
|
+
productDocLink?: string;
|
|
244
|
+
serviceInfo?: ServiceInfo;
|
|
245
|
+
azureArm?: boolean;
|
|
246
|
+
sourceFrom?: "TypeSpec" | "Swagger";
|
|
247
|
+
isModularLibrary?: boolean;
|
|
248
|
+
moduleKind?: "esm" | "cjs";
|
|
249
|
+
enableOperationGroup?: boolean;
|
|
250
|
+
flavor?: PackageFlavor;
|
|
251
|
+
enableModelNamespace?: boolean;
|
|
252
|
+
hierarchyClient?: boolean;
|
|
253
|
+
compatibilityMode?: boolean;
|
|
254
|
+
experimentalExtensibleEnums?: boolean;
|
|
255
|
+
clearOutputFolder?: boolean;
|
|
256
|
+
ignorePropertyNameNormalize?: boolean;
|
|
257
|
+
ignoreEnumMemberNameNormalize?: boolean;
|
|
258
|
+
compatibilityQueryMultiFormat?: boolean;
|
|
259
|
+
typespecTitleMap?: Record<string, string>;
|
|
260
|
+
hasSubscriptionId?: boolean;
|
|
261
|
+
compatibilityLro?: boolean;
|
|
262
|
+
ignoreNullableOnOptional?: boolean;
|
|
263
|
+
isMultiService?: boolean;
|
|
264
|
+
/**
|
|
265
|
+
* When set to true, non-model return types (arrays, scalars, enums, bytes with binary content type)
|
|
266
|
+
* will be wrapped in an XxxResponse type to maintain backward compatibility with HLC.
|
|
267
|
+
* This option defaults to true for Azure flavor and to false otherwise, unless explicitly set.
|
|
268
|
+
*/
|
|
269
|
+
wrapNonModelReturn?: boolean;
|
|
270
|
+
/**
|
|
271
|
+
* When enabled, every regular (non-LRO, non-paging) operation return type is augmented with a
|
|
272
|
+
* `_response` property containing `rawResponse`, `parsedBody`, and `parsedHeaders`.
|
|
273
|
+
*/
|
|
274
|
+
enableStorageCompat?: boolean;
|
|
275
|
+
/**
|
|
276
|
+
* When set to true, TypeSpec `unknown` type will be translated to `Record<string, unknown>`
|
|
277
|
+
* instead of `any` in the generated Modular SDK. This is useful when migrating from HLC
|
|
278
|
+
* where `unknown` in swagger mapped to `Record<string, unknown>`.
|
|
279
|
+
*/
|
|
280
|
+
treatUnknownAsRecord?: boolean;
|
|
281
|
+
/**
|
|
282
|
+
* When set to true, generates React Native build targets (tsconfig, warp target, package.json exports).
|
|
283
|
+
* Defaults to false. Only applicable when azureSdkForJs is true.
|
|
284
|
+
*/
|
|
285
|
+
generateReactNativeTarget?: boolean;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export interface ServiceInfo {
|
|
289
|
+
title?: string;
|
|
290
|
+
description?: string;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export interface DependencyInfo {
|
|
294
|
+
link: string;
|
|
295
|
+
description: string;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export interface File {
|
|
299
|
+
path: string;
|
|
300
|
+
content: string;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export enum SchemaContext {
|
|
304
|
+
/** Schema is used as an input to an operation. */
|
|
305
|
+
Input = "input",
|
|
306
|
+
/** Schema is used as an output from an operation. */
|
|
307
|
+
Output = "output",
|
|
308
|
+
/** Schema is used as an exception from an operation. */
|
|
309
|
+
Exception = "exception"
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export interface Schema {
|
|
313
|
+
name: string;
|
|
314
|
+
type: string;
|
|
315
|
+
typeName?: string;
|
|
316
|
+
outputTypeName?: string;
|
|
317
|
+
description?: string;
|
|
318
|
+
required?: boolean;
|
|
319
|
+
default?: any;
|
|
320
|
+
readOnly?: boolean;
|
|
321
|
+
usage?: SchemaContext[];
|
|
322
|
+
alias?: string;
|
|
323
|
+
outputAlias?: string;
|
|
324
|
+
fromCore?: boolean;
|
|
325
|
+
enum?: any[];
|
|
326
|
+
isConstant?: boolean;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export interface ObjectSchema extends Schema {
|
|
330
|
+
properties?: Record<string, Schema>;
|
|
331
|
+
discriminatorValue?: string;
|
|
332
|
+
discriminator?: Schema;
|
|
333
|
+
isPolyParent?: boolean;
|
|
334
|
+
isMultipartBody?: boolean;
|
|
335
|
+
children?: {
|
|
336
|
+
all?: ObjectSchema[];
|
|
337
|
+
immediate?: ObjectSchema[];
|
|
338
|
+
};
|
|
339
|
+
parents?: {
|
|
340
|
+
all?: ObjectSchema[];
|
|
341
|
+
immediate?: ObjectSchema[];
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
export interface DictionarySchema extends Schema {
|
|
346
|
+
valueTypeName?: string;
|
|
347
|
+
outputValueTypeName?: string;
|
|
348
|
+
additionalProperties?: Schema;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export interface ArraySchema extends Schema {
|
|
352
|
+
items?: Schema;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export type Property = Schema;
|
|
356
|
+
|
|
357
|
+
export type Parameter = Schema;
|
|
358
|
+
|
|
359
|
+
export interface PackageDetails {
|
|
360
|
+
name: string;
|
|
361
|
+
scopeName?: string;
|
|
362
|
+
nameWithoutScope?: string;
|
|
363
|
+
description?: string;
|
|
364
|
+
version?: string;
|
|
365
|
+
isVersionUserProvided?: boolean;
|
|
366
|
+
}
|
|
367
|
+
export interface OperationParameter {
|
|
368
|
+
operationGroup: string;
|
|
369
|
+
operationName: string;
|
|
370
|
+
/**
|
|
371
|
+
* An operation with multiple request parameters means that
|
|
372
|
+
* the operation can get different values for content-type and each value
|
|
373
|
+
* may have a different type associated to it.
|
|
374
|
+
*/
|
|
375
|
+
parameters: ParameterMetadatas[];
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export interface ParameterMetadatas {
|
|
379
|
+
parameters?: ParameterMetadata[];
|
|
380
|
+
body?: ParameterBodyMetadata;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export interface ParameterBodyMetadata {
|
|
384
|
+
/**
|
|
385
|
+
* In case of formData we'd get multiple properties in body marked as partialBody
|
|
386
|
+
* If yes, rlc-common would prepare the whole part shape;
|
|
387
|
+
* usually false in typespec source because rlc-common doesn't have to prepare the whole part shape
|
|
388
|
+
*/
|
|
389
|
+
isPartialBody?: boolean;
|
|
390
|
+
body?: ParameterBodySchema[];
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export interface ParameterBodySchema extends Schema {
|
|
394
|
+
oriSchema?: Schema;
|
|
395
|
+
}
|
|
396
|
+
export interface ParameterMetadata {
|
|
397
|
+
type: "query" | "path" | "header";
|
|
398
|
+
name: string;
|
|
399
|
+
param: ParameterSchema;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export interface ParameterSchema extends Schema {
|
|
403
|
+
// the detailed wrapper type for the parameter and codegen needs to build this type directly
|
|
404
|
+
wrapperType?: Schema;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
export interface OperationResponse {
|
|
408
|
+
operationGroup: string;
|
|
409
|
+
operationName: string;
|
|
410
|
+
path: string;
|
|
411
|
+
responses: ResponseMetadata[];
|
|
412
|
+
// Check if the default response is one of superset of non-default responses
|
|
413
|
+
isDefaultSupersetOfOthers?: boolean;
|
|
414
|
+
}
|
|
415
|
+
export interface ResponseMetadata {
|
|
416
|
+
statusCode: string;
|
|
417
|
+
description?: string;
|
|
418
|
+
headers?: ResponseHeaderSchema[];
|
|
419
|
+
body?: ResponseBodySchema;
|
|
420
|
+
predefinedName?: string;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
export type ResponseHeaderSchema = Schema;
|
|
424
|
+
export type ResponseBodySchema = Schema;
|
|
425
|
+
|
|
426
|
+
export type ContentBuilder = {
|
|
427
|
+
(model: RLCModel): File | File[] | undefined;
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
export type SampleParameterPosition = "client" | "path" | "method";
|
|
431
|
+
|
|
432
|
+
export type SampleParameters = Record<
|
|
433
|
+
SampleParameterPosition,
|
|
434
|
+
SampleParameter[]
|
|
435
|
+
>;
|
|
436
|
+
|
|
437
|
+
export interface SampleParameter {
|
|
438
|
+
name: string;
|
|
439
|
+
assignment?: string;
|
|
440
|
+
value?: string;
|
|
441
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import { Project } from "ts-morph";
|
|
5
|
+
import { RLCModel } from "../interfaces.js";
|
|
6
|
+
|
|
7
|
+
export function buildApiExtractorConfig(model: RLCModel) {
|
|
8
|
+
const { packageDetails, isModularLibrary, generateTest, azureSdkForJs } =
|
|
9
|
+
model.options || {};
|
|
10
|
+
const project = new Project();
|
|
11
|
+
|
|
12
|
+
let mainEntryPointFilePath = "dist/esm/index.d.ts";
|
|
13
|
+
|
|
14
|
+
if (model.options?.moduleKind === "cjs") {
|
|
15
|
+
mainEntryPointFilePath = `./types${
|
|
16
|
+
generateTest || isModularLibrary ? "/src" : ""
|
|
17
|
+
}/index.d.ts`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const config = azureSdkForJs
|
|
21
|
+
? {
|
|
22
|
+
extends: "../../../api-extractor-base.json"
|
|
23
|
+
}
|
|
24
|
+
: {
|
|
25
|
+
$schema:
|
|
26
|
+
"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
27
|
+
mainEntryPointFilePath,
|
|
28
|
+
docModel: {
|
|
29
|
+
enabled: true
|
|
30
|
+
},
|
|
31
|
+
apiReport: {
|
|
32
|
+
enabled: true,
|
|
33
|
+
reportFolder: "./review"
|
|
34
|
+
},
|
|
35
|
+
dtsRollup: {
|
|
36
|
+
enabled: true,
|
|
37
|
+
untrimmedFilePath: "",
|
|
38
|
+
publicTrimmedFilePath: `dist/${
|
|
39
|
+
packageDetails?.nameWithoutScope ?? packageDetails?.name
|
|
40
|
+
}.d.ts`
|
|
41
|
+
},
|
|
42
|
+
messages: {
|
|
43
|
+
tsdocMessageReporting: {
|
|
44
|
+
default: {
|
|
45
|
+
logLevel: "none"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
extractorMessageReporting: {
|
|
49
|
+
"ae-missing-release-tag": {
|
|
50
|
+
logLevel: "none"
|
|
51
|
+
},
|
|
52
|
+
"ae-unresolved-link": {
|
|
53
|
+
logLevel: "none"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const filePath = "api-extractor.json";
|
|
60
|
+
const configFile = project.createSourceFile(
|
|
61
|
+
filePath,
|
|
62
|
+
JSON.stringify(config),
|
|
63
|
+
{
|
|
64
|
+
overwrite: true
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
return {
|
|
68
|
+
path: filePath,
|
|
69
|
+
content: configFile.getFullText()
|
|
70
|
+
};
|
|
71
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import { RLCModel } from "../interfaces.js";
|
|
5
|
+
|
|
6
|
+
function getPackageVersion(model: RLCModel): string {
|
|
7
|
+
return model.options?.packageDetails?.version ?? "1.0.0-beta.1";
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function buildChangelogFile(model: RLCModel) {
|
|
11
|
+
const version = getPackageVersion(model);
|
|
12
|
+
const content = `# Release History
|
|
13
|
+
|
|
14
|
+
## ${version} (Unreleased)
|
|
15
|
+
|
|
16
|
+
### Features Added
|
|
17
|
+
|
|
18
|
+
### Breaking Changes
|
|
19
|
+
|
|
20
|
+
### Bugs Fixed
|
|
21
|
+
|
|
22
|
+
### Other Changes
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
path: "CHANGELOG.md",
|
|
27
|
+
content
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import { Project } from "ts-morph";
|
|
5
|
+
import { RLCModel } from "../interfaces.js";
|
|
6
|
+
|
|
7
|
+
const eslintConfig = `import azsdkEslint from "@azure/eslint-plugin-azure-sdk";
|
|
8
|
+
|
|
9
|
+
export default azsdkEslint.config([
|
|
10
|
+
{
|
|
11
|
+
rules: {
|
|
12
|
+
"@azure/azure-sdk/ts-modules-only-named": "warn",
|
|
13
|
+
"@azure/azure-sdk/ts-package-json-types": "warn",
|
|
14
|
+
"@azure/azure-sdk/ts-package-json-engine-is-present": "warn",
|
|
15
|
+
"tsdoc/syntax": "warn"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
]);
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
const esLintConfigEsm = `import azsdkEslint from "@azure/eslint-plugin-azure-sdk";
|
|
22
|
+
|
|
23
|
+
export default azsdkEslint.config([
|
|
24
|
+
{
|
|
25
|
+
rules: {
|
|
26
|
+
"@azure/azure-sdk/ts-modules-only-named": "warn",
|
|
27
|
+
"@azure/azure-sdk/ts-package-json-types": "warn",
|
|
28
|
+
"@azure/azure-sdk/ts-package-json-engine-is-present": "warn",
|
|
29
|
+
"@azure/azure-sdk/ts-package-json-files-required": "off",
|
|
30
|
+
"@azure/azure-sdk/ts-package-json-main-is-cjs": "off",
|
|
31
|
+
"tsdoc/syntax": "warn"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
]);
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
const esLintConfigEsmAzureSdk = `import azsdkEslint from "@azure/eslint-plugin-azure-sdk";
|
|
38
|
+
|
|
39
|
+
export default [
|
|
40
|
+
...azsdkEslint.config([
|
|
41
|
+
{
|
|
42
|
+
rules: {
|
|
43
|
+
"@azure/azure-sdk/ts-modules-only-named": "warn",
|
|
44
|
+
"@azure/azure-sdk/ts-package-json-types": "warn",
|
|
45
|
+
"@azure/azure-sdk/ts-package-json-engine-is-present": "warn",
|
|
46
|
+
"@azure/azure-sdk/ts-package-json-files-required": "off",
|
|
47
|
+
"@azure/azure-sdk/ts-package-json-main-is-cjs": "off",
|
|
48
|
+
"tsdoc/syntax": "warn"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
]),
|
|
52
|
+
{
|
|
53
|
+
files: ["src/**/*.ts", "src/**/*.mts", "test/**/*.ts"],
|
|
54
|
+
languageOptions: {
|
|
55
|
+
parserOptions: {
|
|
56
|
+
projectService: false,
|
|
57
|
+
project: "./config/tsconfig.lint.json",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
`;
|
|
63
|
+
|
|
64
|
+
export function buildEsLintConfig(model: RLCModel) {
|
|
65
|
+
if (model.options?.flavor !== "azure") {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const project = new Project();
|
|
69
|
+
const filePath = "eslint.config.mjs";
|
|
70
|
+
|
|
71
|
+
let template: string;
|
|
72
|
+
if (model.options?.moduleKind === "esm") {
|
|
73
|
+
template = model.options?.azureSdkForJs
|
|
74
|
+
? esLintConfigEsmAzureSdk
|
|
75
|
+
: esLintConfigEsm;
|
|
76
|
+
} else {
|
|
77
|
+
template = eslintConfig;
|
|
78
|
+
}
|
|
79
|
+
const configFile = project.createSourceFile("eslint.config.mjs", template, {
|
|
80
|
+
overwrite: true
|
|
81
|
+
});
|
|
82
|
+
return {
|
|
83
|
+
path: filePath,
|
|
84
|
+
content: configFile.getFullText()
|
|
85
|
+
};
|
|
86
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
const mitLicenseText = `
|
|
5
|
+
Copyright (c) Microsoft Corporation.
|
|
6
|
+
|
|
7
|
+
MIT License
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
export function buildLicenseFile() {
|
|
29
|
+
return {
|
|
30
|
+
path: "LICENSE",
|
|
31
|
+
content: mitLicenseText.trim()
|
|
32
|
+
};
|
|
33
|
+
}
|