@azure-tools/typespec-ts 0.54.0-dev.6 → 0.54.0-dev.7
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/dist/src/contextManager.d.ts +5 -5
- package/dist/src/contextManager.d.ts.map +1 -1
- package/dist/src/contextManager.js.map +1 -1
- package/dist/src/framework/declaration.d.ts +1 -1
- package/dist/src/framework/declaration.d.ts.map +1 -1
- package/dist/src/framework/declaration.js +2 -4
- package/dist/src/framework/declaration.js.map +1 -1
- package/dist/src/framework/dependency.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.d.ts +1 -1
- package/dist/src/framework/hooks/binder.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.js +12 -20
- package/dist/src/framework/hooks/binder.js.map +1 -1
- package/dist/src/framework/hooks/sdkTypes.d.ts +1 -1
- package/dist/src/framework/hooks/sdkTypes.d.ts.map +1 -1
- package/dist/src/framework/hooks/sdkTypes.js +8 -11
- package/dist/src/framework/hooks/sdkTypes.js.map +1 -1
- package/dist/src/framework/hooks/useDependencies.d.ts.map +1 -1
- package/dist/src/framework/hooks/useDependencies.js +1 -1
- package/dist/src/framework/hooks/useDependencies.js.map +1 -1
- package/dist/src/framework/load-static-helpers.d.ts +1 -1
- package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
- package/dist/src/framework/load-static-helpers.js +12 -25
- package/dist/src/framework/load-static-helpers.js.map +1 -1
- package/dist/src/framework/reference.d.ts.map +1 -1
- package/dist/src/framework/reference.js +1 -1
- package/dist/src/framework/reference.js.map +1 -1
- package/dist/src/framework/sample.js +8 -8
- package/dist/src/framework/sample.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +47 -48
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +1 -1
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +140 -140
- package/dist/src/lib.js.map +1 -1
- package/dist/src/metaTree.d.ts +1 -1
- package/dist/src/metaTree.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.d.ts +1 -1
- package/dist/src/modular/buildClassicalClient.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.js +49 -62
- package/dist/src/modular/buildClassicalClient.js.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.d.ts +2 -2
- package/dist/src/modular/buildClassicalOperationGroups.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.js +4 -7
- package/dist/src/modular/buildClassicalOperationGroups.js.map +1 -1
- package/dist/src/modular/buildClientContext.d.ts +2 -2
- package/dist/src/modular/buildClientContext.d.ts.map +1 -1
- package/dist/src/modular/buildClientContext.js +30 -36
- package/dist/src/modular/buildClientContext.js.map +1 -1
- package/dist/src/modular/buildModularOptions.d.ts +1 -1
- package/dist/src/modular/buildModularOptions.d.ts.map +1 -1
- package/dist/src/modular/buildModularOptions.js +2 -2
- package/dist/src/modular/buildModularOptions.js.map +1 -1
- package/dist/src/modular/buildOperations.d.ts +3 -3
- package/dist/src/modular/buildOperations.d.ts.map +1 -1
- package/dist/src/modular/buildOperations.js +22 -23
- package/dist/src/modular/buildOperations.js.map +1 -1
- package/dist/src/modular/buildProjectFiles.d.ts +1 -1
- package/dist/src/modular/buildProjectFiles.d.ts.map +1 -1
- package/dist/src/modular/buildProjectFiles.js +7 -9
- package/dist/src/modular/buildProjectFiles.js.map +1 -1
- package/dist/src/modular/buildRestorePoller.d.ts +1 -1
- package/dist/src/modular/buildRestorePoller.d.ts.map +1 -1
- package/dist/src/modular/buildRestorePoller.js +11 -11
- package/dist/src/modular/buildRestorePoller.js.map +1 -1
- package/dist/src/modular/buildRootIndex.d.ts +2 -2
- package/dist/src/modular/buildRootIndex.d.ts.map +1 -1
- package/dist/src/modular/buildRootIndex.js +30 -39
- package/dist/src/modular/buildRootIndex.js.map +1 -1
- package/dist/src/modular/buildSubpathIndex.d.ts.map +1 -1
- package/dist/src/modular/buildSubpathIndex.js +9 -17
- package/dist/src/modular/buildSubpathIndex.js.map +1 -1
- package/dist/src/modular/emitLoggerFile.d.ts.map +1 -1
- package/dist/src/modular/emitLoggerFile.js +2 -2
- package/dist/src/modular/emitLoggerFile.js.map +1 -1
- package/dist/src/modular/emitModels.d.ts +1 -1
- package/dist/src/modular/emitModels.d.ts.map +1 -1
- package/dist/src/modular/emitModels.js +54 -72
- package/dist/src/modular/emitModels.js.map +1 -1
- package/dist/src/modular/emitModelsOptions.d.ts +1 -1
- package/dist/src/modular/emitModelsOptions.d.ts.map +1 -1
- package/dist/src/modular/emitModelsOptions.js +6 -7
- package/dist/src/modular/emitModelsOptions.js.map +1 -1
- package/dist/src/modular/emitSamples.d.ts.map +1 -1
- package/dist/src/modular/emitSamples.js +40 -52
- package/dist/src/modular/emitSamples.js.map +1 -1
- package/dist/src/modular/emitTests.d.ts.map +1 -1
- package/dist/src/modular/emitTests.js +9 -12
- package/dist/src/modular/emitTests.js.map +1 -1
- package/dist/src/modular/external-dependencies.js +54 -54
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.js +27 -36
- package/dist/src/modular/helpers/classicalOperationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/clientHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.js +20 -38
- package/dist/src/modular/helpers/clientHelpers.js.map +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.js.map +1 -1
- package/dist/src/modular/helpers/exampleValueHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/exampleValueHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/exampleValueHelpers.js +39 -58
- 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 +4 -5
- package/dist/src/modular/helpers/namingHelpers.js.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.js +136 -196
- package/dist/src/modular/helpers/operationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.js +1 -1
- package/dist/src/modular/helpers/typeHelpers.js.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.js +50 -56
- package/dist/src/modular/serialization/buildDeserializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.js +52 -59
- package/dist/src/modular/serialization/buildSerializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js +43 -51
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/serializeUtils.d.ts.map +1 -1
- package/dist/src/modular/serialization/serializeUtils.js +4 -11
- package/dist/src/modular/serialization/serializeUtils.js.map +1 -1
- package/dist/src/modular/static-helpers-metadata.js +60 -60
- package/dist/src/modular/type-expressions/get-credential-expression.js +1 -1
- package/dist/src/modular/type-expressions/get-credential-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.js +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-model-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-model-expression.js +7 -9
- package/dist/src/modular/type-expressions/get-model-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.js +4 -8
- package/dist/src/modular/type-expressions/get-type-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.js.map +1 -1
- package/dist/src/rlc-common/buildClient.d.ts +1 -1
- package/dist/src/rlc-common/buildClient.d.ts.map +1 -1
- package/dist/src/rlc-common/buildClient.js +48 -66
- package/dist/src/rlc-common/buildClient.js.map +1 -1
- package/dist/src/rlc-common/buildClientDefinitions.d.ts.map +1 -1
- package/dist/src/rlc-common/buildClientDefinitions.js +24 -42
- package/dist/src/rlc-common/buildClientDefinitions.js.map +1 -1
- package/dist/src/rlc-common/buildIndexFile.d.ts.map +1 -1
- package/dist/src/rlc-common/buildIndexFile.js +57 -57
- package/dist/src/rlc-common/buildIndexFile.js.map +1 -1
- package/dist/src/rlc-common/buildIsUnexpectedHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js +32 -35
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js.map +1 -1
- package/dist/src/rlc-common/buildLogger.d.ts.map +1 -1
- package/dist/src/rlc-common/buildLogger.js +3 -3
- package/dist/src/rlc-common/buildLogger.js.map +1 -1
- package/dist/src/rlc-common/buildMethodShortcuts.d.ts.map +1 -1
- package/dist/src/rlc-common/buildMethodShortcuts.js +3 -3
- package/dist/src/rlc-common/buildMethodShortcuts.js.map +1 -1
- package/dist/src/rlc-common/buildObjectTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildObjectTypes.js +29 -46
- package/dist/src/rlc-common/buildObjectTypes.js.map +1 -1
- package/dist/src/rlc-common/buildPaginateHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildPaginateHelper.js +2 -2
- package/dist/src/rlc-common/buildPaginateHelper.js.map +1 -1
- package/dist/src/rlc-common/buildParameterTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildParameterTypes.js +42 -50
- package/dist/src/rlc-common/buildParameterTypes.js.map +1 -1
- package/dist/src/rlc-common/buildPollingHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildPollingHelper.js +5 -5
- package/dist/src/rlc-common/buildPollingHelper.js.map +1 -1
- package/dist/src/rlc-common/buildResponseTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildResponseTypes.js +19 -22
- package/dist/src/rlc-common/buildResponseTypes.js.map +1 -1
- package/dist/src/rlc-common/buildSamples.d.ts +1 -1
- package/dist/src/rlc-common/buildSamples.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSamples.js +2 -2
- package/dist/src/rlc-common/buildSchemaType.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSchemaType.js +9 -13
- package/dist/src/rlc-common/buildSchemaType.js.map +1 -1
- package/dist/src/rlc-common/buildSerializeHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSerializeHelper.js +4 -4
- package/dist/src/rlc-common/buildSerializeHelper.js.map +1 -1
- package/dist/src/rlc-common/buildTopLevelIndexFile.d.ts.map +1 -1
- package/dist/src/rlc-common/buildTopLevelIndexFile.js +9 -13
- package/dist/src/rlc-common/buildTopLevelIndexFile.js.map +1 -1
- package/dist/src/rlc-common/helpers/apiVersionUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/apiVersionUtil.js +2 -3
- package/dist/src/rlc-common/helpers/apiVersionUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/importsUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/importsUtil.js +23 -25
- package/dist/src/rlc-common/helpers/importsUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/nameConstructors.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/nameConstructors.js.map +1 -1
- package/dist/src/rlc-common/helpers/nameUtils.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/nameUtils.js +8 -13
- package/dist/src/rlc-common/helpers/nameUtils.js.map +1 -1
- package/dist/src/rlc-common/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/operationHelpers.js +8 -12
- package/dist/src/rlc-common/helpers/operationHelpers.js.map +1 -1
- package/dist/src/rlc-common/helpers/pathUtils.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/pathUtils.js +1 -3
- package/dist/src/rlc-common/helpers/pathUtils.js.map +1 -1
- package/dist/src/rlc-common/helpers/schemaHelpers.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/schemaHelpers.js +1 -1
- package/dist/src/rlc-common/helpers/schemaHelpers.js.map +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.js +2 -2
- package/dist/src/rlc-common/helpers/shortcutMethods.js.map +1 -1
- package/dist/src/rlc-common/helpers/typeUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/typeUtil.js +1 -2
- package/dist/src/rlc-common/helpers/typeUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js +3 -4
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js.map +1 -1
- package/dist/src/rlc-common/index.d.ts +28 -28
- package/dist/src/rlc-common/index.d.ts.map +1 -1
- package/dist/src/rlc-common/index.js +28 -28
- package/dist/src/rlc-common/index.js.map +1 -1
- package/dist/src/rlc-common/interfaces.d.ts.map +1 -1
- package/dist/src/rlc-common/interfaces.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js +13 -13
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildChangelogFile.js +1 -1
- package/dist/src/rlc-common/metadata/buildESLintConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildESLintConfig.js +3 -5
- package/dist/src/rlc-common/metadata/buildESLintConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildLicenseFile.js +1 -1
- package/dist/src/rlc-common/metadata/buildPackageFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildPackageFile.js +16 -16
- package/dist/src/rlc-common/metadata/buildPackageFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildReadmeFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildReadmeFile.js +10 -18
- package/dist/src/rlc-common/metadata/buildReadmeFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildRollupConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildRollupConfig.js +3 -4
- package/dist/src/rlc-common/metadata/buildRollupConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js +2 -3
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildTestConfig.js +8 -8
- package/dist/src/rlc-common/metadata/buildTsConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildTsConfig.js +23 -21
- package/dist/src/rlc-common/metadata/buildTsConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildVitestConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildVitestConfig.js +3 -4
- package/dist/src/rlc-common/metadata/buildVitestConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildWarpConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildWarpConfig.js +2 -2
- package/dist/src/rlc-common/metadata/buildWarpConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js +13 -13
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js +22 -26
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js +15 -16
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js +8 -8
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js +26 -29
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js.map +1 -1
- package/dist/src/rlc-common/test/buildKarmaConfig.js +1 -1
- package/dist/src/rlc-common/test/buildRecordedClient.js +3 -3
- package/dist/src/rlc-common/test/buildSampleTest.d.ts.map +1 -1
- package/dist/src/rlc-common/test/buildSampleTest.js +2 -2
- package/dist/src/rlc-common/test/buildSampleTest.js.map +1 -1
- package/dist/src/rlc-common/test/buildSnippets.d.ts.map +1 -1
- package/dist/src/rlc-common/test/buildSnippets.js +4 -6
- package/dist/src/rlc-common/test/buildSnippets.js.map +1 -1
- package/dist/src/rlc-common/transformSampleGroups.d.ts.map +1 -1
- package/dist/src/rlc-common/transformSampleGroups.js +19 -23
- package/dist/src/rlc-common/transformSampleGroups.js.map +1 -1
- package/dist/src/testing/index.d.ts.map +1 -1
- package/dist/src/testing/index.js +1 -1
- package/dist/src/testing/index.js.map +1 -1
- package/dist/src/transform/transform.d.ts +1 -1
- package/dist/src/transform/transform.d.ts.map +1 -1
- package/dist/src/transform/transform.js +10 -11
- 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 +8 -10
- package/dist/src/transform/transformApiVersionInfo.js.map +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.d.ts +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.d.ts.map +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.js +9 -11
- package/dist/src/transform/transformHelperFunctionDetails.js.map +1 -1
- package/dist/src/transform/transformParameters.d.ts +2 -2
- package/dist/src/transform/transformParameters.d.ts.map +1 -1
- package/dist/src/transform/transformParameters.js +22 -28
- 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 +11 -12
- 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 +12 -12
- package/dist/src/transform/transformResponses.js.map +1 -1
- package/dist/src/transform/transformSchemas.d.ts.map +1 -1
- package/dist/src/transform/transformSchemas.js +9 -15
- package/dist/src/transform/transformSchemas.js.map +1 -1
- package/dist/src/transform/transformTelemetryInfo.d.ts +1 -1
- package/dist/src/transform/transformTelemetryInfo.d.ts.map +1 -1
- package/dist/src/transform/transformTelemetryInfo.js +3 -3
- package/dist/src/transform/transformTelemetryInfo.js.map +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts.map +1 -1
- package/dist/src/transform/transfromRLCOptions.js +14 -26
- package/dist/src/transform/transfromRLCOptions.js.map +1 -1
- package/dist/src/utils/clientUtils.d.ts +1 -1
- package/dist/src/utils/clientUtils.d.ts.map +1 -1
- package/dist/src/utils/clientUtils.js +11 -14
- package/dist/src/utils/clientUtils.js.map +1 -1
- package/dist/src/utils/credentialUtils.d.ts +1 -1
- package/dist/src/utils/credentialUtils.d.ts.map +1 -1
- package/dist/src/utils/credentialUtils.js +3 -3
- package/dist/src/utils/credentialUtils.js.map +1 -1
- package/dist/src/utils/crossLanguageDef.d.ts.map +1 -1
- package/dist/src/utils/crossLanguageDef.js +8 -12
- 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 +4 -6
- package/dist/src/utils/emitUtil.js.map +1 -1
- package/dist/src/utils/fileSystemUtils.d.ts.map +1 -1
- package/dist/src/utils/fileSystemUtils.js +2 -2
- package/dist/src/utils/fileSystemUtils.js.map +1 -1
- package/dist/src/utils/importHelper.d.ts.map +1 -1
- package/dist/src/utils/importHelper.js +2 -4
- package/dist/src/utils/importHelper.js.map +1 -1
- package/dist/src/utils/interfaces.d.ts +1 -1
- package/dist/src/utils/interfaces.d.ts.map +1 -1
- package/dist/src/utils/mediaTypes.d.ts.map +1 -1
- package/dist/src/utils/mediaTypes.js +7 -19
- package/dist/src/utils/mediaTypes.js.map +1 -1
- package/dist/src/utils/modelUtils.d.ts +2 -2
- package/dist/src/utils/modelUtils.d.ts.map +1 -1
- package/dist/src/utils/modelUtils.js +107 -170
- package/dist/src/utils/modelUtils.js.map +1 -1
- package/dist/src/utils/namespaceUtils.d.ts.map +1 -1
- package/dist/src/utils/namespaceUtils.js +2 -2
- package/dist/src/utils/namespaceUtils.js.map +1 -1
- package/dist/src/utils/operationUtil.d.ts +1 -1
- package/dist/src/utils/operationUtil.d.ts.map +1 -1
- package/dist/src/utils/operationUtil.js +29 -42
- 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 +19 -22
- package/dist/src/utils/parameterUtils.js.map +1 -1
- package/dist/src/utils/resolve-project-root.js +2 -2
- package/dist/src/utils/resolve-project-root.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -3
- package/src/contextManager.ts +6 -9
- package/src/framework/declaration.ts +18 -28
- package/src/framework/dependency.ts +1 -2
- package/src/framework/hooks/binder.ts +47 -120
- package/src/framework/hooks/sdkTypes.ts +27 -54
- package/src/framework/hooks/useDependencies.ts +2 -4
- package/src/framework/load-static-helpers.ts +28 -51
- package/src/framework/reference.ts +2 -5
- package/src/framework/sample.ts +9 -9
- package/src/index.ts +111 -180
- package/src/lib.ts +143 -158
- package/src/metaTree.ts +1 -1
- package/src/modular/buildClassicalClient.ts +83 -160
- package/src/modular/buildClassicalOperationGroups.ts +14 -39
- package/src/modular/buildClientContext.ts +54 -83
- package/src/modular/buildModularOptions.ts +4 -5
- package/src/modular/buildOperations.ts +46 -73
- package/src/modular/buildProjectFiles.ts +18 -47
- package/src/modular/buildRestorePoller.ts +27 -46
- package/src/modular/buildRootIndex.ts +86 -159
- package/src/modular/buildSubpathIndex.ts +35 -58
- package/src/modular/emitLoggerFile.ts +4 -9
- package/src/modular/emitModels.ts +136 -266
- package/src/modular/emitModelsOptions.ts +10 -16
- package/src/modular/emitSamples.ts +91 -177
- package/src/modular/emitTests.ts +28 -61
- package/src/modular/external-dependencies.ts +54 -54
- package/src/modular/helpers/classicalOperationHelpers.ts +73 -126
- package/src/modular/helpers/clientHelpers.ts +41 -88
- package/src/modular/helpers/clientOptionHelpers.ts +4 -11
- package/src/modular/helpers/exampleValueHelpers.ts +97 -209
- package/src/modular/helpers/namingHelpers.ts +12 -28
- package/src/modular/helpers/operationHelpers.ts +430 -757
- package/src/modular/helpers/typeHelpers.ts +11 -22
- package/src/modular/serialization/buildDeserializerFunction.ts +88 -122
- package/src/modular/serialization/buildSerializerFunction.ts +91 -129
- package/src/modular/serialization/buildXmlSerializerFunction.ts +104 -183
- package/src/modular/serialization/serializeUtils.ts +12 -21
- package/src/modular/static/rollup.test.config.js +11 -14
- package/src/modular/static/scripts/renameOutput.mjs +2 -2
- package/src/modular/static-helpers-metadata.ts +60 -60
- package/src/modular/type-expressions/get-credential-expression.ts +1 -1
- package/src/modular/type-expressions/get-enum-expression.ts +5 -10
- package/src/modular/type-expressions/get-model-expression.ts +13 -17
- package/src/modular/type-expressions/get-nullable-expression.ts +4 -5
- package/src/modular/type-expressions/get-type-expression.ts +8 -12
- package/src/modular/type-expressions/get-union-expression.ts +4 -4
- package/src/modular/type-expressions/utils.ts +1 -1
- package/src/rlc-common/buildClient.ts +70 -141
- package/src/rlc-common/buildClientDefinitions.ts +43 -87
- package/src/rlc-common/buildIndexFile.ts +78 -78
- package/src/rlc-common/buildIsUnexpectedHelper.ts +34 -41
- package/src/rlc-common/buildLogger.ts +7 -7
- package/src/rlc-common/buildMethodShortcuts.ts +9 -21
- package/src/rlc-common/buildObjectTypes.ts +78 -155
- package/src/rlc-common/buildPaginateHelper.ts +9 -12
- package/src/rlc-common/buildParameterTypes.ts +92 -137
- package/src/rlc-common/buildPollingHelper.ts +7 -7
- package/src/rlc-common/buildResponseTypes.ts +34 -57
- package/src/rlc-common/buildSamples.ts +3 -3
- package/src/rlc-common/buildSchemaType.ts +12 -29
- package/src/rlc-common/buildSerializeHelper.ts +5 -5
- package/src/rlc-common/buildTopLevelIndexFile.ts +12 -19
- package/src/rlc-common/helpers/apiVersionUtil.ts +5 -10
- package/src/rlc-common/helpers/importsUtil.ts +27 -30
- package/src/rlc-common/helpers/nameConstructors.ts +16 -50
- package/src/rlc-common/helpers/nameUtils.ts +19 -42
- package/src/rlc-common/helpers/operationHelpers.ts +14 -31
- package/src/rlc-common/helpers/pathUtils.ts +2 -7
- package/src/rlc-common/helpers/schemaHelpers.ts +4 -15
- package/src/rlc-common/helpers/shortcutMethods.ts +6 -15
- package/src/rlc-common/helpers/typeUtil.ts +4 -11
- package/src/rlc-common/helpers/valueGenerationUtil.ts +16 -39
- package/src/rlc-common/index.ts +28 -28
- package/src/rlc-common/interfaces.ts +3 -11
- package/src/rlc-common/metadata/buildApiExtractorConfig.ts +17 -24
- package/src/rlc-common/metadata/buildChangelogFile.ts +1 -1
- package/src/rlc-common/metadata/buildESLintConfig.ts +3 -5
- package/src/rlc-common/metadata/buildLicenseFile.ts +1 -1
- package/src/rlc-common/metadata/buildPackageFile.ts +27 -35
- package/src/rlc-common/metadata/buildReadmeFile.ts +16 -29
- package/src/rlc-common/metadata/buildRollupConfig.ts +5 -8
- package/src/rlc-common/metadata/buildSampleEnvFile.ts +2 -3
- package/src/rlc-common/metadata/buildTestConfig.ts +10 -10
- package/src/rlc-common/metadata/buildTsConfig.ts +32 -35
- package/src/rlc-common/metadata/buildVitestConfig.ts +4 -10
- package/src/rlc-common/metadata/buildWarpConfig.ts +3 -6
- package/src/rlc-common/metadata/packageJson/azurePackageCommon.ts +16 -25
- package/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.ts +29 -50
- package/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.ts +20 -31
- package/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.ts +11 -13
- package/src/rlc-common/metadata/packageJson/packageCommon.ts +32 -52
- package/src/rlc-common/test/buildKarmaConfig.ts +1 -1
- package/src/rlc-common/test/buildRecordedClient.ts +3 -3
- package/src/rlc-common/test/buildSampleTest.ts +3 -3
- package/src/rlc-common/test/buildSnippets.ts +6 -12
- package/src/rlc-common/transformSampleGroups.ts +54 -105
- package/src/testing/index.ts +2 -5
- package/src/transform/transform.ts +22 -34
- package/src/transform/transformApiVersionInfo.ts +17 -30
- package/src/transform/transformHelperFunctionDetails.ts +14 -26
- package/src/transform/transformParameters.ts +55 -105
- package/src/transform/transformPaths.ts +26 -43
- package/src/transform/transformResponses.ts +26 -33
- package/src/transform/transformSchemas.ts +15 -33
- package/src/transform/transformTelemetryInfo.ts +8 -14
- package/src/transform/transfromRLCOptions.ts +53 -115
- package/src/utils/clientUtils.ts +22 -41
- package/src/utils/credentialUtils.ts +8 -19
- package/src/utils/crossLanguageDef.ts +15 -34
- package/src/utils/emitUtil.ts +11 -17
- package/src/utils/fileSystemUtils.ts +4 -6
- package/src/utils/importHelper.ts +5 -10
- package/src/utils/interfaces.ts +1 -1
- package/src/utils/mediaTypes.ts +13 -34
- package/src/utils/modelUtils.ts +174 -383
- package/src/utils/namespaceUtils.ts +8 -24
- package/src/utils/operationUtil.ts +98 -190
- package/src/utils/parameterUtils.ts +31 -54
- package/src/utils/resolve-project-root.ts +3 -3
- package/static/static-helpers/cloudSettingHelpers.ts +4 -6
- package/static/static-helpers/multipartHelpers.ts +3 -3
- package/static/static-helpers/pagingHelpers.ts +28 -63
- package/static/static-helpers/pollingHelpers.ts +15 -28
- package/static/static-helpers/serialization/build-multi-collection.ts +1 -4
- package/static/static-helpers/serialization/check-prop-undefined.ts +1 -4
- package/static/static-helpers/serialization/get-binary-response.ts +2 -2
- package/static/static-helpers/serialization/get-binary-stream-response.ts +2 -4
- package/static/static-helpers/serialization/serialize-record.ts +1 -1
- package/static/static-helpers/serialization/serializers.ts +4 -7
- package/static/static-helpers/serialization/xml-helpers.ts +41 -89
- package/static/static-helpers/simplePollerHelpers.ts +9 -18
- package/static/static-helpers/storageCompatResponse.ts +10 -27
- package/static/static-helpers/urlTemplate.ts +4 -7
- package/static/test-helpers/recordedClient.ts +5 -10
package/src/rlc-common/index.ts
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
export * from "./
|
|
4
|
+
export * from "./buildClient.js";
|
|
5
5
|
export * from "./buildClientDefinitions.js";
|
|
6
|
+
export * from "./buildIndexFile.js";
|
|
7
|
+
export * from "./buildIsUnexpectedHelper.js";
|
|
8
|
+
export * from "./buildLogger.js";
|
|
9
|
+
export * from "./buildPaginateHelper.js";
|
|
10
|
+
export * from "./buildParameterTypes.js";
|
|
11
|
+
export * from "./buildPollingHelper.js";
|
|
12
|
+
export * from "./buildResponseTypes.js";
|
|
13
|
+
export * from "./buildSamples.js";
|
|
6
14
|
export * from "./buildSchemaType.js";
|
|
7
|
-
export * from "./
|
|
15
|
+
export * from "./buildSerializeHelper.js";
|
|
16
|
+
export * from "./buildTopLevelIndexFile.js";
|
|
17
|
+
export * from "./helpers/apiVersionUtil.js";
|
|
18
|
+
export * from "./helpers/importsUtil.js";
|
|
8
19
|
export * from "./helpers/nameConstructors.js";
|
|
9
|
-
export * from "./buildResponseTypes.js";
|
|
10
|
-
export * from "./helpers/shortcutMethods.js";
|
|
11
20
|
export * from "./helpers/nameUtils.js";
|
|
12
21
|
export * from "./helpers/operationHelpers.js";
|
|
13
|
-
export * from "./helpers/
|
|
22
|
+
export * from "./helpers/packageUtil.js";
|
|
14
23
|
export * from "./helpers/schemaHelpers.js";
|
|
15
|
-
export * from "./
|
|
16
|
-
export * from "./
|
|
17
|
-
export * from "./
|
|
18
|
-
export * from "./buildIndexFile.js";
|
|
19
|
-
export * from "./buildPaginateHelper.js";
|
|
20
|
-
export * from "./buildPollingHelper.js";
|
|
21
|
-
export * from "./test/buildKarmaConfig.js";
|
|
22
|
-
export * from "./test/buildRecordedClient.js";
|
|
23
|
-
export * from "./test/buildSampleTest.js";
|
|
24
|
-
export * from "./test/buildSnippets.js";
|
|
25
|
-
export * from "./metadata/buildReadmeFile.js";
|
|
24
|
+
export * from "./helpers/shortcutMethods.js";
|
|
25
|
+
export * from "./helpers/valueGenerationUtil.js";
|
|
26
|
+
export * from "./interfaces.js";
|
|
26
27
|
export * from "./metadata/buildApiExtractorConfig.js";
|
|
28
|
+
export * from "./metadata/buildChangelogFile.js";
|
|
29
|
+
export * from "./metadata/buildESLintConfig.js";
|
|
30
|
+
export * from "./metadata/buildLicenseFile.js";
|
|
27
31
|
export * from "./metadata/buildPackageFile.js";
|
|
32
|
+
export * from "./metadata/buildReadmeFile.js";
|
|
28
33
|
export * from "./metadata/buildRollupConfig.js";
|
|
34
|
+
export * from "./metadata/buildSampleEnvFile.js";
|
|
35
|
+
export * from "./metadata/buildTestConfig.js";
|
|
29
36
|
export * from "./metadata/buildTsConfig.js";
|
|
30
|
-
export * from "./metadata/buildWarpConfig.js";
|
|
31
|
-
export * from "./metadata/buildESLintConfig.js";
|
|
32
|
-
export * from "./metadata/buildLicenseFile.js";
|
|
33
|
-
export * from "./metadata/buildChangelogFile.js";
|
|
34
37
|
export * from "./metadata/buildVitestConfig.js";
|
|
35
|
-
export * from "./metadata/
|
|
36
|
-
export * from "./
|
|
37
|
-
export * from "./
|
|
38
|
-
export * from "./
|
|
39
|
-
export * from "./
|
|
38
|
+
export * from "./metadata/buildWarpConfig.js";
|
|
39
|
+
export * from "./test/buildKarmaConfig.js";
|
|
40
|
+
export * from "./test/buildRecordedClient.js";
|
|
41
|
+
export * from "./test/buildSampleTest.js";
|
|
42
|
+
export * from "./test/buildSnippets.js";
|
|
40
43
|
export * from "./transformSampleGroups.js";
|
|
41
|
-
export * from "./helpers/importsUtil.js";
|
|
42
|
-
export * from "./metadata/buildTestConfig.js";
|
|
43
|
-
export * from "./helpers/packageUtil.js";
|
|
@@ -115,12 +115,7 @@ export interface ApiVersionInfo {
|
|
|
115
115
|
required?: boolean;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
export type ApiVersionPosition =
|
|
119
|
-
| "path"
|
|
120
|
-
| "query"
|
|
121
|
-
| "baseurl"
|
|
122
|
-
| "duplicate"
|
|
123
|
-
| "none";
|
|
118
|
+
export type ApiVersionPosition = "path" | "query" | "baseurl" | "duplicate" | "none";
|
|
124
119
|
export interface HelperFunctionDetails {
|
|
125
120
|
hasPaging?: boolean;
|
|
126
121
|
hasLongRunning?: boolean;
|
|
@@ -306,7 +301,7 @@ export enum SchemaContext {
|
|
|
306
301
|
/** Schema is used as an output from an operation. */
|
|
307
302
|
Output = "output",
|
|
308
303
|
/** Schema is used as an exception from an operation. */
|
|
309
|
-
Exception = "exception"
|
|
304
|
+
Exception = "exception",
|
|
310
305
|
}
|
|
311
306
|
|
|
312
307
|
export interface Schema {
|
|
@@ -429,10 +424,7 @@ export type ContentBuilder = {
|
|
|
429
424
|
|
|
430
425
|
export type SampleParameterPosition = "client" | "path" | "method";
|
|
431
426
|
|
|
432
|
-
export type SampleParameters = Record<
|
|
433
|
-
SampleParameterPosition,
|
|
434
|
-
SampleParameter[]
|
|
435
|
-
>;
|
|
427
|
+
export type SampleParameters = Record<SampleParameterPosition, SampleParameter[]>;
|
|
436
428
|
|
|
437
429
|
export interface SampleParameter {
|
|
438
430
|
name: string;
|
|
@@ -5,67 +5,60 @@ import { Project } from "ts-morph";
|
|
|
5
5
|
import { RLCModel } from "../interfaces.js";
|
|
6
6
|
|
|
7
7
|
export function buildApiExtractorConfig(model: RLCModel) {
|
|
8
|
-
const { packageDetails, isModularLibrary, generateTest, azureSdkForJs } =
|
|
9
|
-
model.options || {};
|
|
8
|
+
const { packageDetails, isModularLibrary, generateTest, azureSdkForJs } = model.options || {};
|
|
10
9
|
const project = new Project();
|
|
11
10
|
|
|
12
11
|
let mainEntryPointFilePath = "dist/esm/index.d.ts";
|
|
13
12
|
|
|
14
13
|
if (model.options?.moduleKind === "cjs") {
|
|
15
|
-
mainEntryPointFilePath = `./types${
|
|
16
|
-
generateTest || isModularLibrary ? "/src" : ""
|
|
17
|
-
}/index.d.ts`;
|
|
14
|
+
mainEntryPointFilePath = `./types${generateTest || isModularLibrary ? "/src" : ""}/index.d.ts`;
|
|
18
15
|
}
|
|
19
16
|
|
|
20
17
|
const config = azureSdkForJs
|
|
21
18
|
? {
|
|
22
|
-
extends: "../../../api-extractor-base.json"
|
|
19
|
+
extends: "../../../api-extractor-base.json",
|
|
23
20
|
}
|
|
24
21
|
: {
|
|
25
22
|
$schema:
|
|
26
23
|
"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
27
24
|
mainEntryPointFilePath,
|
|
28
25
|
docModel: {
|
|
29
|
-
enabled: true
|
|
26
|
+
enabled: true,
|
|
30
27
|
},
|
|
31
28
|
apiReport: {
|
|
32
29
|
enabled: true,
|
|
33
|
-
reportFolder: "./review"
|
|
30
|
+
reportFolder: "./review",
|
|
34
31
|
},
|
|
35
32
|
dtsRollup: {
|
|
36
33
|
enabled: true,
|
|
37
34
|
untrimmedFilePath: "",
|
|
38
35
|
publicTrimmedFilePath: `dist/${
|
|
39
36
|
packageDetails?.nameWithoutScope ?? packageDetails?.name
|
|
40
|
-
}.d.ts
|
|
37
|
+
}.d.ts`,
|
|
41
38
|
},
|
|
42
39
|
messages: {
|
|
43
40
|
tsdocMessageReporting: {
|
|
44
41
|
default: {
|
|
45
|
-
logLevel: "none"
|
|
46
|
-
}
|
|
42
|
+
logLevel: "none",
|
|
43
|
+
},
|
|
47
44
|
},
|
|
48
45
|
extractorMessageReporting: {
|
|
49
46
|
"ae-missing-release-tag": {
|
|
50
|
-
logLevel: "none"
|
|
47
|
+
logLevel: "none",
|
|
51
48
|
},
|
|
52
49
|
"ae-unresolved-link": {
|
|
53
|
-
logLevel: "none"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
50
|
+
logLevel: "none",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
57
54
|
};
|
|
58
55
|
|
|
59
56
|
const filePath = "api-extractor.json";
|
|
60
|
-
const configFile = project.createSourceFile(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
{
|
|
64
|
-
overwrite: true
|
|
65
|
-
}
|
|
66
|
-
);
|
|
57
|
+
const configFile = project.createSourceFile(filePath, JSON.stringify(config), {
|
|
58
|
+
overwrite: true,
|
|
59
|
+
});
|
|
67
60
|
return {
|
|
68
61
|
path: filePath,
|
|
69
|
-
content: configFile.getFullText()
|
|
62
|
+
content: configFile.getFullText(),
|
|
70
63
|
};
|
|
71
64
|
}
|
|
@@ -70,17 +70,15 @@ export function buildEsLintConfig(model: RLCModel) {
|
|
|
70
70
|
|
|
71
71
|
let template: string;
|
|
72
72
|
if (model.options?.moduleKind === "esm") {
|
|
73
|
-
template = model.options?.azureSdkForJs
|
|
74
|
-
? esLintConfigEsmAzureSdk
|
|
75
|
-
: esLintConfigEsm;
|
|
73
|
+
template = model.options?.azureSdkForJs ? esLintConfigEsmAzureSdk : esLintConfigEsm;
|
|
76
74
|
} else {
|
|
77
75
|
template = eslintConfig;
|
|
78
76
|
}
|
|
79
77
|
const configFile = project.createSourceFile("eslint.config.mjs", template, {
|
|
80
|
-
overwrite: true
|
|
78
|
+
overwrite: true,
|
|
81
79
|
});
|
|
82
80
|
return {
|
|
83
81
|
path: filePath,
|
|
84
|
-
content: configFile.getFullText()
|
|
82
|
+
content: configFile.getFullText(),
|
|
85
83
|
};
|
|
86
84
|
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
+
import { Project, SourceFile } from "ts-morph";
|
|
4
5
|
import { NameType, normalizeName } from "../helpers/nameUtils.js";
|
|
5
6
|
import { hasPollingOperations } from "../helpers/operationHelpers.js";
|
|
6
7
|
import {
|
|
7
8
|
isAzureMonorepoPackage,
|
|
8
9
|
isAzurePackage,
|
|
9
|
-
isAzureStandalonePackage
|
|
10
|
+
isAzureStandalonePackage,
|
|
10
11
|
} from "../helpers/packageUtil.js";
|
|
11
|
-
import {
|
|
12
|
-
PackageCommonInfoConfig,
|
|
13
|
-
getTshyConfig,
|
|
14
|
-
resolveWarpExports
|
|
15
|
-
} from "./packageJson/packageCommon.js";
|
|
16
|
-
import { Project, SourceFile } from "ts-morph";
|
|
12
|
+
import { getRelativePartFromSrcPath } from "../helpers/pathUtils.js";
|
|
17
13
|
import { RLCModel } from "../interfaces.js";
|
|
18
14
|
import { buildAzureMonorepoPackage } from "./packageJson/buildAzureMonorepoPackage.js";
|
|
19
15
|
import { buildAzureStandalonePackage } from "./packageJson/buildAzureStandalonePackage.js";
|
|
20
16
|
import { buildFlavorlessPackage } from "./packageJson/buildFlavorlessPackage.js";
|
|
21
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
PackageCommonInfoConfig,
|
|
19
|
+
getTshyConfig,
|
|
20
|
+
resolveWarpExports,
|
|
21
|
+
} from "./packageJson/packageCommon.js";
|
|
22
22
|
import { getPackageName } from "./utils.js";
|
|
23
23
|
|
|
24
24
|
interface PackageFileOptions {
|
|
@@ -29,7 +29,7 @@ interface PackageFileOptions {
|
|
|
29
29
|
|
|
30
30
|
export function buildPackageFile(
|
|
31
31
|
model: RLCModel,
|
|
32
|
-
{ exports, dependencies, clientContextPaths }: PackageFileOptions = {}
|
|
32
|
+
{ exports, dependencies, clientContextPaths }: PackageFileOptions = {},
|
|
33
33
|
) {
|
|
34
34
|
const config: PackageCommonInfoConfig = {
|
|
35
35
|
description: getDescription(model),
|
|
@@ -43,7 +43,7 @@ export function buildPackageFile(
|
|
|
43
43
|
azureArm: model.options?.azureArm,
|
|
44
44
|
isModularLibrary: model.options?.isModularLibrary ?? false,
|
|
45
45
|
azureSdkForJs: model.options?.azureSdkForJs,
|
|
46
|
-
generateReactNativeTarget: model.options?.generateReactNativeTarget
|
|
46
|
+
generateReactNativeTarget: model.options?.generateReactNativeTarget,
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
let packageInfo: Record<string, any> = buildFlavorlessPackage(config);
|
|
@@ -55,7 +55,7 @@ export function buildPackageFile(
|
|
|
55
55
|
monorepoPackageDirectory: model.options?.azureOutputDirectory,
|
|
56
56
|
specSource: model.options?.sourceFrom ?? "TypeSpec",
|
|
57
57
|
dependencies,
|
|
58
|
-
clientContextPaths
|
|
58
|
+
clientContextPaths,
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
if (isAzureMonorepoPackage(model)) {
|
|
@@ -73,16 +73,12 @@ export function buildPackageFile(
|
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
const packageFile = project.createSourceFile(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
{
|
|
80
|
-
overwrite: true
|
|
81
|
-
}
|
|
82
|
-
);
|
|
76
|
+
const packageFile = project.createSourceFile(filePath, JSON.stringify(packageInfo, null, 2), {
|
|
77
|
+
overwrite: true,
|
|
78
|
+
});
|
|
83
79
|
return {
|
|
84
80
|
path: filePath,
|
|
85
|
-
content: packageFile.getFullText()
|
|
81
|
+
content: packageFile.getFullText(),
|
|
86
82
|
};
|
|
87
83
|
}
|
|
88
84
|
|
|
@@ -98,14 +94,13 @@ export function buildPackageFile(
|
|
|
98
94
|
export function updatePackageFile(
|
|
99
95
|
model: RLCModel,
|
|
100
96
|
existingFilePathOrContent: string | Record<string, any>,
|
|
101
|
-
{ exports, clientContextPaths }: PackageFileOptions = {}
|
|
97
|
+
{ exports, clientContextPaths }: PackageFileOptions = {},
|
|
102
98
|
) {
|
|
103
99
|
const hasLro = hasPollingOperations(model);
|
|
104
100
|
const isAzure = isAzurePackage(model);
|
|
105
101
|
const needsLroUpdate = isAzure && hasLro;
|
|
106
102
|
const needsExportsUpdate = exports;
|
|
107
|
-
const needsConstantPathsUpdate =
|
|
108
|
-
clientContextPaths && clientContextPaths.length > 0;
|
|
103
|
+
const needsConstantPathsUpdate = clientContextPaths && clientContextPaths.length > 0;
|
|
109
104
|
const needsPlatformImportsUpdate =
|
|
110
105
|
model.options?.azureSdkForJs && model.options?.moduleKind === "esm";
|
|
111
106
|
|
|
@@ -151,7 +146,7 @@ export function updatePackageFile(
|
|
|
151
146
|
if (needsPlatformImportsUpdate) {
|
|
152
147
|
const platformImports: Record<string, string> = {
|
|
153
148
|
browser: "./src/*-browser.mts",
|
|
154
|
-
default: "./src/*.ts"
|
|
149
|
+
default: "./src/*.ts",
|
|
155
150
|
};
|
|
156
151
|
if (model.options?.generateReactNativeTarget) {
|
|
157
152
|
// Insert `react-native` before `default` so Node's conditional
|
|
@@ -160,12 +155,12 @@ export function updatePackageFile(
|
|
|
160
155
|
"#platform/*": {
|
|
161
156
|
browser: platformImports["browser"],
|
|
162
157
|
"react-native": "./src/*-react-native.mts",
|
|
163
|
-
default: platformImports["default"]
|
|
164
|
-
}
|
|
158
|
+
default: platformImports["default"],
|
|
159
|
+
},
|
|
165
160
|
};
|
|
166
161
|
} else {
|
|
167
162
|
packageInfo.imports = {
|
|
168
|
-
"#platform/*": platformImports
|
|
163
|
+
"#platform/*": platformImports,
|
|
169
164
|
};
|
|
170
165
|
}
|
|
171
166
|
}
|
|
@@ -174,16 +169,13 @@ export function updatePackageFile(
|
|
|
174
169
|
if (needsExportsUpdate) {
|
|
175
170
|
if (model.options?.azureSdkForJs) {
|
|
176
171
|
// Warp: update resolved exports in package.json
|
|
177
|
-
packageInfo.exports = resolveWarpExports(
|
|
178
|
-
exports,
|
|
179
|
-
model.options?.generateReactNativeTarget
|
|
180
|
-
);
|
|
172
|
+
packageInfo.exports = resolveWarpExports(exports, model.options?.generateReactNativeTarget);
|
|
181
173
|
} else if (packageInfo.tshy) {
|
|
182
174
|
// Tshy: update tshy.exports in package.json
|
|
183
175
|
const newTshy = getTshyConfig({
|
|
184
176
|
exports,
|
|
185
177
|
azureSdkForJs: model.options?.azureSdkForJs,
|
|
186
|
-
generateReactNativeTarget: model.options?.generateReactNativeTarget
|
|
178
|
+
generateReactNativeTarget: model.options?.generateReactNativeTarget,
|
|
187
179
|
} as PackageCommonInfoConfig);
|
|
188
180
|
packageInfo.tshy["exports"] = newTshy["exports"];
|
|
189
181
|
}
|
|
@@ -203,7 +195,7 @@ export function updatePackageFile(
|
|
|
203
195
|
packageInfo.dependencies = {
|
|
204
196
|
...packageInfo.dependencies,
|
|
205
197
|
"@azure/core-lro": "^3.1.0",
|
|
206
|
-
"@azure/abort-controller": "^2.1.2"
|
|
198
|
+
"@azure/abort-controller": "^2.1.2",
|
|
207
199
|
};
|
|
208
200
|
}
|
|
209
201
|
|
|
@@ -212,19 +204,19 @@ export function updatePackageFile(
|
|
|
212
204
|
const metadata = packageInfo["//metadata"];
|
|
213
205
|
// Filter out existing userAgentInfo entries
|
|
214
206
|
const nonUserAgentPaths = (metadata.constantPaths || []).filter(
|
|
215
|
-
(item: any) => item.prefix !== "userAgentInfo"
|
|
207
|
+
(item: any) => item.prefix !== "userAgentInfo",
|
|
216
208
|
);
|
|
217
209
|
// Add new userAgentInfo entries from clientContextPaths
|
|
218
210
|
const newUserAgentPaths = clientContextPaths!.map((path) => ({
|
|
219
211
|
path: path,
|
|
220
|
-
prefix: "userAgentInfo"
|
|
212
|
+
prefix: "userAgentInfo",
|
|
221
213
|
}));
|
|
222
214
|
metadata.constantPaths = [...nonUserAgentPaths, ...newUserAgentPaths];
|
|
223
215
|
}
|
|
224
216
|
|
|
225
217
|
return {
|
|
226
218
|
path: "package.json",
|
|
227
|
-
content: JSON.stringify(packageInfo, null, 2)
|
|
219
|
+
content: JSON.stringify(packageInfo, null, 2),
|
|
228
220
|
};
|
|
229
221
|
}
|
|
230
222
|
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
import { RLCModel } from "../interfaces.js";
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
6
|
// @ts-ignore: to fix the handlebars issue
|
|
7
|
+
import { readFileSync } from "fs";
|
|
7
8
|
import hbs from "handlebars";
|
|
9
|
+
import { getClientName } from "../helpers/nameConstructors.js";
|
|
8
10
|
import { NameType, normalizeName } from "../helpers/nameUtils.js";
|
|
9
11
|
import { isAzurePackage } from "../helpers/packageUtil.js";
|
|
10
|
-
import { getClientName } from "../helpers/nameConstructors.js";
|
|
11
|
-
import { readFileSync } from "fs";
|
|
12
12
|
|
|
13
13
|
const azureReadmeRLCTemplate = `# {{ clientDescriptiveName }} library for JavaScript
|
|
14
14
|
|
|
@@ -355,22 +355,19 @@ export function buildReadmeFile(model: RLCModel) {
|
|
|
355
355
|
? azureReadmeModularTemplate
|
|
356
356
|
: azureReadmeRLCTemplate
|
|
357
357
|
: nonBrandedReadmeTemplate,
|
|
358
|
-
{ noEscape: true }
|
|
358
|
+
{ noEscape: true },
|
|
359
359
|
);
|
|
360
360
|
return {
|
|
361
361
|
path: "README.md",
|
|
362
|
-
content: readmeFileContents(metadata)
|
|
362
|
+
content: readmeFileContents(metadata),
|
|
363
363
|
};
|
|
364
364
|
}
|
|
365
365
|
|
|
366
|
-
export function hasClientNameChanged(
|
|
367
|
-
model: RLCModel,
|
|
368
|
-
existingReadmeFilePath: string
|
|
369
|
-
): boolean {
|
|
366
|
+
export function hasClientNameChanged(model: RLCModel, existingReadmeFilePath: string): boolean {
|
|
370
367
|
try {
|
|
371
368
|
const existingContent = readFileSync(existingReadmeFilePath, "utf8");
|
|
372
369
|
const importMatch = existingContent.match(
|
|
373
|
-
/import\s*\{\s*([A-Za-z0-9_]+)\s*\}\s*from\s*["'][^"']*["']
|
|
370
|
+
/import\s*\{\s*([A-Za-z0-9_]+)\s*\}\s*from\s*["'][^"']*["']/,
|
|
374
371
|
);
|
|
375
372
|
const existingClientName = importMatch?.[1];
|
|
376
373
|
const newClientName = getClientName(model);
|
|
@@ -382,15 +379,13 @@ export function hasClientNameChanged(
|
|
|
382
379
|
|
|
383
380
|
export function updateReadmeFile(
|
|
384
381
|
model: RLCModel,
|
|
385
|
-
existingReadmeFilePath: string
|
|
382
|
+
existingReadmeFilePath: string,
|
|
386
383
|
): { path: string; content: string } | undefined {
|
|
387
384
|
try {
|
|
388
385
|
const existingContent = readFileSync(existingReadmeFilePath, "utf8");
|
|
389
386
|
const metadata = createMetadata(model) ?? {};
|
|
390
387
|
|
|
391
|
-
const newApiRefLink = hbs
|
|
392
|
-
.compile(apiReferenceTemplate, { noEscape: true })(metadata)
|
|
393
|
-
.trim();
|
|
388
|
+
const newApiRefLink = hbs.compile(apiReferenceTemplate, { noEscape: true })(metadata).trim();
|
|
394
389
|
|
|
395
390
|
if (!newApiRefLink) {
|
|
396
391
|
return { path: "README.md", content: existingContent };
|
|
@@ -399,7 +394,7 @@ export function updateReadmeFile(
|
|
|
399
394
|
const apiRefRegex =
|
|
400
395
|
/^- \[API reference documentation\]\(https:\/\/learn\.microsoft\.com\/javascript\/api\/[^)]+\)$/m;
|
|
401
396
|
const updatedContent = existingContent.replace(apiRefRegex, (match) =>
|
|
402
|
-
match ? newApiRefLink : match
|
|
397
|
+
match ? newApiRefLink : match,
|
|
403
398
|
);
|
|
404
399
|
|
|
405
400
|
return { path: "README.md", content: updatedContent };
|
|
@@ -426,27 +421,21 @@ function createMetadata(model: RLCModel): Metadata | undefined {
|
|
|
426
421
|
multiClient,
|
|
427
422
|
batch,
|
|
428
423
|
serviceInfo,
|
|
429
|
-
isTypeSpecTest
|
|
424
|
+
isTypeSpecTest,
|
|
430
425
|
} = model.options;
|
|
431
426
|
|
|
432
427
|
const azureHuh =
|
|
433
|
-
packageDetails?.scopeName === "azure" ||
|
|
434
|
-
packageDetails?.scopeName === "azure-rest";
|
|
428
|
+
packageDetails?.scopeName === "azure" || packageDetails?.scopeName === "azure-rest";
|
|
435
429
|
const repoURL = "https://github.com/Azure/azure-sdk-for-js";
|
|
436
430
|
const relativePackageSourcePath = azureOutputDirectory;
|
|
437
431
|
const packageSourceURL =
|
|
438
|
-
relativePackageSourcePath &&
|
|
439
|
-
repoURL &&
|
|
440
|
-
`${repoURL}/tree/main/${relativePackageSourcePath}`;
|
|
432
|
+
relativePackageSourcePath && repoURL && `${repoURL}/tree/main/${relativePackageSourcePath}`;
|
|
441
433
|
|
|
442
434
|
const clientPackageName = packageDetails?.name;
|
|
443
435
|
const clientClassName = getClientName(model);
|
|
444
436
|
const serviceName = getServiceName(model);
|
|
445
437
|
let apiRefUrlQueryParameter: string = "";
|
|
446
|
-
if (
|
|
447
|
-
!packageDetails?.isVersionUserProvided &&
|
|
448
|
-
model.apiVersionInfo?.defaultValue
|
|
449
|
-
) {
|
|
438
|
+
if (!packageDetails?.isVersionUserProvided && model.apiVersionInfo?.defaultValue) {
|
|
450
439
|
if (model.apiVersionInfo?.defaultValue?.toLowerCase().includes("preview")) {
|
|
451
440
|
apiRefUrlQueryParameter = "?view=azure-node-preview";
|
|
452
441
|
}
|
|
@@ -469,9 +458,7 @@ function createMetadata(model: RLCModel): Metadata | undefined {
|
|
|
469
458
|
packageSourceURL: packageSourceURL,
|
|
470
459
|
packageNPMURL: `https://www.npmjs.com/package/${clientPackageName}`,
|
|
471
460
|
samplesURL:
|
|
472
|
-
model.options.generateSample && packageSourceURL
|
|
473
|
-
? `${packageSourceURL}/samples`
|
|
474
|
-
: undefined,
|
|
461
|
+
model.options.generateSample && packageSourceURL ? `${packageSourceURL}/samples` : undefined,
|
|
475
462
|
apiRefURL: azureHuh
|
|
476
463
|
? `https://learn.microsoft.com/javascript/api/${clientPackageName}${apiRefUrlQueryParameter}`
|
|
477
464
|
: undefined,
|
|
@@ -488,7 +475,7 @@ function createMetadata(model: RLCModel): Metadata | undefined {
|
|
|
488
475
|
contributingGuideURL: repoURL && `${repoURL}/blob/main/CONTRIBUTING.md`,
|
|
489
476
|
azureSdkForJs: model.options.azureSdkForJs,
|
|
490
477
|
generateTest: model.options.generateTest,
|
|
491
|
-
hasSubscriptionId: model.options.hasSubscriptionId
|
|
478
|
+
hasSubscriptionId: model.options.hasSubscriptionId,
|
|
492
479
|
};
|
|
493
480
|
}
|
|
494
481
|
|
|
@@ -506,7 +493,7 @@ function getServiceName(model: RLCModel) {
|
|
|
506
493
|
batch && batch.length > 1
|
|
507
494
|
? normalizeName(
|
|
508
495
|
packageDetails!.nameWithoutScope ?? packageDetails?.name ?? "",
|
|
509
|
-
NameType.Class
|
|
496
|
+
NameType.Class,
|
|
510
497
|
)
|
|
511
498
|
: normalizeName(serviceTitle, NameType.Class);
|
|
512
499
|
simpleServiceName =
|
|
@@ -2,23 +2,20 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
4
|
import { Project } from "ts-morph";
|
|
5
|
-
import { RLCModel } from "../interfaces.js";
|
|
6
5
|
import { isAzurePackage } from "../helpers/packageUtil.js";
|
|
6
|
+
import { RLCModel } from "../interfaces.js";
|
|
7
7
|
|
|
8
8
|
export function buildRollupConfig(model: RLCModel) {
|
|
9
9
|
const azureSdkForJs = Boolean(model.options?.azureSdkForJs);
|
|
10
10
|
// Only generate the file when it is not in sdk repo
|
|
11
|
-
if (
|
|
12
|
-
isAzurePackage(model) &&
|
|
13
|
-
(azureSdkForJs === true || azureSdkForJs === undefined)
|
|
14
|
-
) {
|
|
11
|
+
if (isAzurePackage(model) && (azureSdkForJs === true || azureSdkForJs === undefined)) {
|
|
15
12
|
return;
|
|
16
13
|
}
|
|
17
14
|
|
|
18
15
|
const project = new Project();
|
|
19
16
|
const filePath = "rollup.config.js";
|
|
20
17
|
const rollupFile = project.createSourceFile(filePath, undefined, {
|
|
21
|
-
overwrite: true
|
|
18
|
+
overwrite: true,
|
|
22
19
|
});
|
|
23
20
|
|
|
24
21
|
rollupFile.addStatements(
|
|
@@ -140,11 +137,11 @@ export function buildRollupConfig(model: RLCModel) {
|
|
|
140
137
|
return config;
|
|
141
138
|
}
|
|
142
139
|
|
|
143
|
-
export default makeConfig(require("./package.json"))
|
|
140
|
+
export default makeConfig(require("./package.json"));`,
|
|
144
141
|
);
|
|
145
142
|
|
|
146
143
|
return {
|
|
147
144
|
path: filePath,
|
|
148
|
-
content: rollupFile.getFullText()
|
|
145
|
+
content: rollupFile.getFullText(),
|
|
149
146
|
};
|
|
150
147
|
}
|
|
@@ -8,14 +8,13 @@ const sampleEnvText = `
|
|
|
8
8
|
|
|
9
9
|
export function buildSampleEnvFile(model: RLCModel) {
|
|
10
10
|
if (
|
|
11
|
-
(model.options?.generateMetadata === true ||
|
|
12
|
-
model.options?.generateSample === true) &&
|
|
11
|
+
(model.options?.generateMetadata === true || model.options?.generateSample === true) &&
|
|
13
12
|
model.options?.flavor === "azure"
|
|
14
13
|
) {
|
|
15
14
|
const filePath = "sample.env";
|
|
16
15
|
return {
|
|
17
16
|
path: filePath,
|
|
18
|
-
content: sampleEnvText.trim()
|
|
17
|
+
content: sampleEnvText.trim(),
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
20
|
return undefined;
|
|
@@ -32,13 +32,13 @@ export function buildTestBrowserTsConfig(model: RLCModel) {
|
|
|
32
32
|
paths: {
|
|
33
33
|
[name]: ["../src/index.ts"],
|
|
34
34
|
[`${name}/*`]: ["../src/*"],
|
|
35
|
-
"$internal/*": ["../src/*"]
|
|
36
|
-
}
|
|
37
|
-
}
|
|
35
|
+
"$internal/*": ["../src/*"],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
38
|
},
|
|
39
39
|
null,
|
|
40
|
-
2
|
|
41
|
-
)
|
|
40
|
+
2,
|
|
41
|
+
),
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -61,12 +61,12 @@ export function buildTestNodeTsConfig(model: RLCModel) {
|
|
|
61
61
|
paths: {
|
|
62
62
|
[name]: ["../src/index.ts"],
|
|
63
63
|
[`${name}/*`]: ["../src/*"],
|
|
64
|
-
"$internal/*": ["../src/*"]
|
|
65
|
-
}
|
|
66
|
-
}
|
|
64
|
+
"$internal/*": ["../src/*"],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
67
|
},
|
|
68
68
|
null,
|
|
69
|
-
2
|
|
70
|
-
)
|
|
69
|
+
2,
|
|
70
|
+
),
|
|
71
71
|
};
|
|
72
72
|
}
|