@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,2 @@
|
|
|
1
|
+
export declare const pollingContent = "\nimport type { Client, HttpResponse } from \"@azure-rest/core-client\";\nimport type { AbortSignalLike } from \"@azure/abort-controller\";\nimport type {\n CancelOnProgress,\n CreateHttpPollerOptions,\n RunningOperation,\n OperationResponse,\n OperationState,\n} from \"@azure/core-lro\";\n import { createHttpPoller } from \"@azure/core-lro\";\n{{#if clientOverload}}\nimport type {\n {{#each importedResponses}}\n {{this}},\n {{/each}}\n} from \"./responses{{#if isEsm}}.js{{/if}}\";\n{{/if}}\n\n/**\n * A simple poller that can be used to poll a long running operation.\n */\nexport interface SimplePollerLike<\n TState extends OperationState<TResult>,\n TResult\n> {\n /**\n * Returns true if the poller has finished polling.\n */\n isDone(): boolean;\n /**\n * Returns the state of the operation.\n */\n getOperationState(): TState;\n /**\n * Returns the result value of the operation,\n * regardless of the state of the poller.\n * It can return undefined or an incomplete form of the final TResult value\n * depending on the implementation.\n */\n getResult(): TResult | undefined;\n /**\n * Returns a promise that will resolve once a single polling request finishes.\n * It does this by calling the update method of the Poller's operation.\n */\n poll(options?: { abortSignal?: AbortSignalLike }): Promise<TState>;\n /**\n * Returns a promise that will resolve once the underlying operation is completed.\n */\n pollUntilDone(pollOptions?: {\n abortSignal?: AbortSignalLike;\n }): Promise<TResult>;\n /**\n * Invokes the provided callback after each polling is completed,\n * sending the current state of the poller's operation.\n *\n * It returns a method that can be used to stop receiving updates on the given callback function.\n */\n onProgress(callback: (state: TState) => void): CancelOnProgress;\n\n /**\n * Returns a promise that could be used for serialized version of the poller's operation\n * by invoking the operation's serialize method.\n */\n serialize(): Promise<string>;\n\n /**\n * Wait the poller to be submitted.\n */\n submitted(): Promise<void>;\n\n /**\n * Returns a string representation of the poller's operation. Similar to serialize but returns a string.\n * @deprecated Use serialize() instead.\n */\n toString(): string;\n\n /**\n * Stops the poller from continuing to poll. Please note this will only stop the client-side polling\n * @deprecated Use abortSignal to stop polling instead.\n */\n stopPolling(): void;\n\n /**\n * Returns true if the poller is stopped.\n * @deprecated Use abortSignal status to track this instead.\n */\n isStopped(): boolean;\n}\n\n/**\n * Helper function that builds a Poller object to help polling a long running operation.\n * @param client - Client to use for sending the request to get additional pages.\n * @param initialResponse - The initial response.\n * @param options - Options to set a resume state or custom polling interval.\n * @returns - A poller object to poll for operation state updates and eventually get the final response.\n */\n{{#if clientOverload}}\n{{#each overloadMap}}\nexport async function getLongRunningPoller<\n TResult extends {{ this.finalResponses }}\n>(\n client: Client,\n initialResponse: {{ this.initialResponses }},\n options?: CreateHttpPollerOptions<TResult, OperationState<TResult>>\n): Promise<SimplePollerLike<OperationState<TResult>, TResult>>;\n{{/each}}\n{{/if}}\nexport async function getLongRunningPoller<TResult extends HttpResponse>(\n client: Client,\n initialResponse: TResult,\n options: CreateHttpPollerOptions<TResult, OperationState<TResult>> = {}\n ): Promise<SimplePollerLike<OperationState<TResult>, TResult>> { \n const abortController = new AbortController();\n const poller: RunningOperation<TResult> = {\n sendInitialRequest: async () => {\n // In the case of Rest Clients we are building the LRO poller object from a response that's the reason\n // we are not triggering the initial request here, just extracting the information from the\n // response we were provided.\n return getLroResponse(initialResponse);\n },\n sendPollRequest: async (\n path: string,\n pollOptions?: { abortSignal?: AbortSignalLike }\n ) => {\n // This is the callback that is going to be called to poll the service\n // to get the latest status. We use the client provided and the polling path\n // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location\n // depending on the lro pattern that the service implements. If non is provided we default to the initial path.\n function abortListener(): void {\n abortController.abort();\n }\n const inputAbortSignal = pollOptions?.abortSignal;\n const abortSignal = abortController.signal;\n if (inputAbortSignal?.aborted) {\n abortController.abort();\n } else if (!abortSignal.aborted) {\n inputAbortSignal?.addEventListener(\"abort\", abortListener, {\n once: true\n });\n }\n let response;\n try {\n response = await client\n .pathUnchecked(path ?? initialResponse.request.url)\n .get({ abortSignal });\n } finally {\n inputAbortSignal?.removeEventListener(\"abort\", abortListener);\n }\n const lroResponse = getLroResponse(response as TResult);\n lroResponse.rawResponse.headers[\"x-ms-original-url\"] =\n initialResponse.request.url;\n return lroResponse;\n }\n };\n\n options.resolveOnUnsuccessful = options.resolveOnUnsuccessful ?? true;\n const httpPoller = createHttpPoller(poller, options);\n const simplePoller: SimplePollerLike<OperationState<TResult>, TResult> = {\n isDone() {\n return httpPoller.isDone;\n },\n isStopped() {\n return abortController.signal.aborted;\n },\n getOperationState() {\n if (!httpPoller.operationState) {\n throw new Error(\n \"Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().\"\n );\n }\n return httpPoller.operationState;\n },\n getResult() {\n return httpPoller.result;\n },\n toString() {\n if (!httpPoller.operationState) {\n throw new Error(\n \"Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState().\"\n );\n }\n return JSON.stringify({\n state: httpPoller.operationState\n });\n },\n stopPolling() {\n abortController.abort();\n },\n onProgress: httpPoller.onProgress,\n poll: httpPoller.poll,\n pollUntilDone: httpPoller.pollUntilDone,\n serialize: httpPoller.serialize,\n submitted: httpPoller.submitted\n };\n return simplePoller;\n}\n\n/**\n * Converts a Rest Client response to a response that the LRO implementation understands\n * @param response - a rest client http response\n * @returns - An LRO response that the LRO implementation understands\n */\nfunction getLroResponse<TResult extends HttpResponse>(\n response: TResult\n): OperationResponse<TResult> {\n if (Number.isNaN(response.status)) {\n throw new TypeError(\n `Status code of the response is not a number. Value: ${response.status}`\n );\n }\n\n return {\n flatResponse: response,\n rawResponse: {\n ...response,\n statusCode: Number.parseInt(response.status),\n body: response.body\n }\n };\n}\n";
|
|
2
|
+
//# sourceMappingURL=pollingContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pollingContent.d.ts","sourceRoot":"","sources":["../../../../src/rlc-common/static/pollingContent.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,ygPA6N1B,CAAC"}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
export const pollingContent = `
|
|
4
|
+
import type { Client, HttpResponse } from "@azure-rest/core-client";
|
|
5
|
+
import type { AbortSignalLike } from "@azure/abort-controller";
|
|
6
|
+
import type {
|
|
7
|
+
CancelOnProgress,
|
|
8
|
+
CreateHttpPollerOptions,
|
|
9
|
+
RunningOperation,
|
|
10
|
+
OperationResponse,
|
|
11
|
+
OperationState,
|
|
12
|
+
} from "@azure/core-lro";
|
|
13
|
+
import { createHttpPoller } from "@azure/core-lro";
|
|
14
|
+
{{#if clientOverload}}
|
|
15
|
+
import type {
|
|
16
|
+
{{#each importedResponses}}
|
|
17
|
+
{{this}},
|
|
18
|
+
{{/each}}
|
|
19
|
+
} from "./responses{{#if isEsm}}.js{{/if}}";
|
|
20
|
+
{{/if}}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* A simple poller that can be used to poll a long running operation.
|
|
24
|
+
*/
|
|
25
|
+
export interface SimplePollerLike<
|
|
26
|
+
TState extends OperationState<TResult>,
|
|
27
|
+
TResult
|
|
28
|
+
> {
|
|
29
|
+
/**
|
|
30
|
+
* Returns true if the poller has finished polling.
|
|
31
|
+
*/
|
|
32
|
+
isDone(): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Returns the state of the operation.
|
|
35
|
+
*/
|
|
36
|
+
getOperationState(): TState;
|
|
37
|
+
/**
|
|
38
|
+
* Returns the result value of the operation,
|
|
39
|
+
* regardless of the state of the poller.
|
|
40
|
+
* It can return undefined or an incomplete form of the final TResult value
|
|
41
|
+
* depending on the implementation.
|
|
42
|
+
*/
|
|
43
|
+
getResult(): TResult | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Returns a promise that will resolve once a single polling request finishes.
|
|
46
|
+
* It does this by calling the update method of the Poller's operation.
|
|
47
|
+
*/
|
|
48
|
+
poll(options?: { abortSignal?: AbortSignalLike }): Promise<TState>;
|
|
49
|
+
/**
|
|
50
|
+
* Returns a promise that will resolve once the underlying operation is completed.
|
|
51
|
+
*/
|
|
52
|
+
pollUntilDone(pollOptions?: {
|
|
53
|
+
abortSignal?: AbortSignalLike;
|
|
54
|
+
}): Promise<TResult>;
|
|
55
|
+
/**
|
|
56
|
+
* Invokes the provided callback after each polling is completed,
|
|
57
|
+
* sending the current state of the poller's operation.
|
|
58
|
+
*
|
|
59
|
+
* It returns a method that can be used to stop receiving updates on the given callback function.
|
|
60
|
+
*/
|
|
61
|
+
onProgress(callback: (state: TState) => void): CancelOnProgress;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Returns a promise that could be used for serialized version of the poller's operation
|
|
65
|
+
* by invoking the operation's serialize method.
|
|
66
|
+
*/
|
|
67
|
+
serialize(): Promise<string>;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Wait the poller to be submitted.
|
|
71
|
+
*/
|
|
72
|
+
submitted(): Promise<void>;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Returns a string representation of the poller's operation. Similar to serialize but returns a string.
|
|
76
|
+
* @deprecated Use serialize() instead.
|
|
77
|
+
*/
|
|
78
|
+
toString(): string;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Stops the poller from continuing to poll. Please note this will only stop the client-side polling
|
|
82
|
+
* @deprecated Use abortSignal to stop polling instead.
|
|
83
|
+
*/
|
|
84
|
+
stopPolling(): void;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Returns true if the poller is stopped.
|
|
88
|
+
* @deprecated Use abortSignal status to track this instead.
|
|
89
|
+
*/
|
|
90
|
+
isStopped(): boolean;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Helper function that builds a Poller object to help polling a long running operation.
|
|
95
|
+
* @param client - Client to use for sending the request to get additional pages.
|
|
96
|
+
* @param initialResponse - The initial response.
|
|
97
|
+
* @param options - Options to set a resume state or custom polling interval.
|
|
98
|
+
* @returns - A poller object to poll for operation state updates and eventually get the final response.
|
|
99
|
+
*/
|
|
100
|
+
{{#if clientOverload}}
|
|
101
|
+
{{#each overloadMap}}
|
|
102
|
+
export async function getLongRunningPoller<
|
|
103
|
+
TResult extends {{ this.finalResponses }}
|
|
104
|
+
>(
|
|
105
|
+
client: Client,
|
|
106
|
+
initialResponse: {{ this.initialResponses }},
|
|
107
|
+
options?: CreateHttpPollerOptions<TResult, OperationState<TResult>>
|
|
108
|
+
): Promise<SimplePollerLike<OperationState<TResult>, TResult>>;
|
|
109
|
+
{{/each}}
|
|
110
|
+
{{/if}}
|
|
111
|
+
export async function getLongRunningPoller<TResult extends HttpResponse>(
|
|
112
|
+
client: Client,
|
|
113
|
+
initialResponse: TResult,
|
|
114
|
+
options: CreateHttpPollerOptions<TResult, OperationState<TResult>> = {}
|
|
115
|
+
): Promise<SimplePollerLike<OperationState<TResult>, TResult>> {
|
|
116
|
+
const abortController = new AbortController();
|
|
117
|
+
const poller: RunningOperation<TResult> = {
|
|
118
|
+
sendInitialRequest: async () => {
|
|
119
|
+
// In the case of Rest Clients we are building the LRO poller object from a response that's the reason
|
|
120
|
+
// we are not triggering the initial request here, just extracting the information from the
|
|
121
|
+
// response we were provided.
|
|
122
|
+
return getLroResponse(initialResponse);
|
|
123
|
+
},
|
|
124
|
+
sendPollRequest: async (
|
|
125
|
+
path: string,
|
|
126
|
+
pollOptions?: { abortSignal?: AbortSignalLike }
|
|
127
|
+
) => {
|
|
128
|
+
// This is the callback that is going to be called to poll the service
|
|
129
|
+
// to get the latest status. We use the client provided and the polling path
|
|
130
|
+
// which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location
|
|
131
|
+
// depending on the lro pattern that the service implements. If non is provided we default to the initial path.
|
|
132
|
+
function abortListener(): void {
|
|
133
|
+
abortController.abort();
|
|
134
|
+
}
|
|
135
|
+
const inputAbortSignal = pollOptions?.abortSignal;
|
|
136
|
+
const abortSignal = abortController.signal;
|
|
137
|
+
if (inputAbortSignal?.aborted) {
|
|
138
|
+
abortController.abort();
|
|
139
|
+
} else if (!abortSignal.aborted) {
|
|
140
|
+
inputAbortSignal?.addEventListener("abort", abortListener, {
|
|
141
|
+
once: true
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
let response;
|
|
145
|
+
try {
|
|
146
|
+
response = await client
|
|
147
|
+
.pathUnchecked(path ?? initialResponse.request.url)
|
|
148
|
+
.get({ abortSignal });
|
|
149
|
+
} finally {
|
|
150
|
+
inputAbortSignal?.removeEventListener("abort", abortListener);
|
|
151
|
+
}
|
|
152
|
+
const lroResponse = getLroResponse(response as TResult);
|
|
153
|
+
lroResponse.rawResponse.headers["x-ms-original-url"] =
|
|
154
|
+
initialResponse.request.url;
|
|
155
|
+
return lroResponse;
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
options.resolveOnUnsuccessful = options.resolveOnUnsuccessful ?? true;
|
|
160
|
+
const httpPoller = createHttpPoller(poller, options);
|
|
161
|
+
const simplePoller: SimplePollerLike<OperationState<TResult>, TResult> = {
|
|
162
|
+
isDone() {
|
|
163
|
+
return httpPoller.isDone;
|
|
164
|
+
},
|
|
165
|
+
isStopped() {
|
|
166
|
+
return abortController.signal.aborted;
|
|
167
|
+
},
|
|
168
|
+
getOperationState() {
|
|
169
|
+
if (!httpPoller.operationState) {
|
|
170
|
+
throw new Error(
|
|
171
|
+
"Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState()."
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
return httpPoller.operationState;
|
|
175
|
+
},
|
|
176
|
+
getResult() {
|
|
177
|
+
return httpPoller.result;
|
|
178
|
+
},
|
|
179
|
+
toString() {
|
|
180
|
+
if (!httpPoller.operationState) {
|
|
181
|
+
throw new Error(
|
|
182
|
+
"Operation state is not available. The poller may not have been started and you could await submitted() before calling getOperationState()."
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
return JSON.stringify({
|
|
186
|
+
state: httpPoller.operationState
|
|
187
|
+
});
|
|
188
|
+
},
|
|
189
|
+
stopPolling() {
|
|
190
|
+
abortController.abort();
|
|
191
|
+
},
|
|
192
|
+
onProgress: httpPoller.onProgress,
|
|
193
|
+
poll: httpPoller.poll,
|
|
194
|
+
pollUntilDone: httpPoller.pollUntilDone,
|
|
195
|
+
serialize: httpPoller.serialize,
|
|
196
|
+
submitted: httpPoller.submitted
|
|
197
|
+
};
|
|
198
|
+
return simplePoller;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Converts a Rest Client response to a response that the LRO implementation understands
|
|
203
|
+
* @param response - a rest client http response
|
|
204
|
+
* @returns - An LRO response that the LRO implementation understands
|
|
205
|
+
*/
|
|
206
|
+
function getLroResponse<TResult extends HttpResponse>(
|
|
207
|
+
response: TResult
|
|
208
|
+
): OperationResponse<TResult> {
|
|
209
|
+
if (Number.isNaN(response.status)) {
|
|
210
|
+
throw new TypeError(
|
|
211
|
+
\`Status code of the response is not a number. Value: \${response.status}\`
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
return {
|
|
216
|
+
flatResponse: response,
|
|
217
|
+
rawResponse: {
|
|
218
|
+
...response,
|
|
219
|
+
statusCode: Number.parseInt(response.status),
|
|
220
|
+
body: response.body
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
`;
|
|
225
|
+
//# sourceMappingURL=pollingContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pollingContent.js","sourceRoot":"","sources":["../../../../src/rlc-common/static/pollingContent.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6N7B,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const sampleTemplate = "\n{{#each importedTypes}}\n{{this}}\n{{/each}}\nimport \"dotenv/config\";\n\n{{#each samples}}\n/**\n * This sample demonstrates how to {{this.description}}\n *\n * @summary {{this.description}}\n {{#if this.originalFileLocation}}\n * x-ms-original-file: {{this.originalFileLocation}}\n {{/if}}\n */\nasync function {{name}}(): Promise<void> {\n {{#each this.clientParamAssignments}}\n {{this}}\n {{/each}}\n const client = {{this.defaultFactoryName}}({{this.clientParamNames}});\n {{#each this.pathParamAssignments}}\n {{this}}\n {{/each}}\n {{#each this.methodParamAssignments}}\n {{this}}\n {{/each}}\n {{#if this.isPaging}}\n const initialResponse = await client.path({{this.pathParamNames}}).{{method}}({{methodParamNames}});\n const pageData = paginate(client, initialResponse);\n const result = [];\n for await (const item of pageData) {\n result.push(item);\n }\n {{else if this.isLRO}}\n const initialResponse ={{#unless this.useLegacyLro}} await{{/unless}} client.path({{this.pathParamNames}}).{{method}}({{methodParamNames}});\n const poller = await getLongRunningPoller(client, initialResponse);\n const result = await poller.pollUntilDone();\n {{else}}\n const result = await client.path({{this.pathParamNames}}).{{method}}({{methodParamNames}});\n {{/if}}\n console.log(result);\n}\n\n{{/each}}\n\nasync function main(): Promise<void> {\n{{#each samples}}\n await {{this.name}}();\n{{/each}}\n}\n\nmain().catch(console.error);\n";
|
|
2
|
+
//# sourceMappingURL=sampleTemplate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampleTemplate.d.ts","sourceRoot":"","sources":["../../../../src/rlc-common/static/sampleTemplate.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,o8CAoD1B,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
export const sampleTemplate = `
|
|
4
|
+
{{#each importedTypes}}
|
|
5
|
+
{{this}}
|
|
6
|
+
{{/each}}
|
|
7
|
+
import "dotenv/config";
|
|
8
|
+
|
|
9
|
+
{{#each samples}}
|
|
10
|
+
/**
|
|
11
|
+
* This sample demonstrates how to {{this.description}}
|
|
12
|
+
*
|
|
13
|
+
* @summary {{this.description}}
|
|
14
|
+
{{#if this.originalFileLocation}}
|
|
15
|
+
* x-ms-original-file: {{this.originalFileLocation}}
|
|
16
|
+
{{/if}}
|
|
17
|
+
*/
|
|
18
|
+
async function {{name}}(): Promise<void> {
|
|
19
|
+
{{#each this.clientParamAssignments}}
|
|
20
|
+
{{this}}
|
|
21
|
+
{{/each}}
|
|
22
|
+
const client = {{this.defaultFactoryName}}({{this.clientParamNames}});
|
|
23
|
+
{{#each this.pathParamAssignments}}
|
|
24
|
+
{{this}}
|
|
25
|
+
{{/each}}
|
|
26
|
+
{{#each this.methodParamAssignments}}
|
|
27
|
+
{{this}}
|
|
28
|
+
{{/each}}
|
|
29
|
+
{{#if this.isPaging}}
|
|
30
|
+
const initialResponse = await client.path({{this.pathParamNames}}).{{method}}({{methodParamNames}});
|
|
31
|
+
const pageData = paginate(client, initialResponse);
|
|
32
|
+
const result = [];
|
|
33
|
+
for await (const item of pageData) {
|
|
34
|
+
result.push(item);
|
|
35
|
+
}
|
|
36
|
+
{{else if this.isLRO}}
|
|
37
|
+
const initialResponse ={{#unless this.useLegacyLro}} await{{/unless}} client.path({{this.pathParamNames}}).{{method}}({{methodParamNames}});
|
|
38
|
+
const poller = await getLongRunningPoller(client, initialResponse);
|
|
39
|
+
const result = await poller.pollUntilDone();
|
|
40
|
+
{{else}}
|
|
41
|
+
const result = await client.path({{this.pathParamNames}}).{{method}}({{methodParamNames}});
|
|
42
|
+
{{/if}}
|
|
43
|
+
console.log(result);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
{{/each}}
|
|
47
|
+
|
|
48
|
+
async function main(): Promise<void> {
|
|
49
|
+
{{#each samples}}
|
|
50
|
+
await {{this.name}}();
|
|
51
|
+
{{/each}}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
main().catch(console.error);
|
|
55
|
+
`;
|
|
56
|
+
//# sourceMappingURL=sampleTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampleTemplate.js","sourceRoot":"","sources":["../../../../src/rlc-common/static/sampleTemplate.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoD7B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const buildMultiCollectionContent = "\nexport function buildMultiCollection(\n items: string[],\n parameterName: string\n): string {\n return items\n .map((item, index) => {\n if (index === 0) {\n return item;\n }\n return `${parameterName}=${item}`;\n })\n .join(\"&\");\n}";
|
|
2
|
+
export declare const buildPipeCollectionContent = "\nexport function buildPipeCollection(items: string[] | number[]): string {\n return items.join(\"|\");\n}";
|
|
3
|
+
export declare const buildSsvCollectionContent = "\nexport function buildSsvCollection(items: string[] | number[]): string {\n return items.join(\" \");\n}";
|
|
4
|
+
export declare const buildTsvCollectionContent = "\nexport function buildTsvCollection(items: string[] | number[]): string {\n return items.join(\"\\t\");\n}";
|
|
5
|
+
export declare const buildCsvCollectionContent = "\nexport function buildCsvCollection(items: string[] | number[]): string {\n return items.join(\",\");\n}";
|
|
6
|
+
//# sourceMappingURL=serializeHelper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializeHelper.d.ts","sourceRoot":"","sources":["../../../../src/rlc-common/static/serializeHelper.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,oRAatC,CAAC;AAEH,eAAO,MAAM,0BAA0B,gHAGrC,CAAC;AAEH,eAAO,MAAM,yBAAyB,+GAGpC,CAAC;AAEH,eAAO,MAAM,yBAAyB,iHAGpC,CAAC;AAEH,eAAO,MAAM,yBAAyB,+GAGpC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export const buildMultiCollectionContent = `
|
|
2
|
+
export function buildMultiCollection(
|
|
3
|
+
items: string[],
|
|
4
|
+
parameterName: string
|
|
5
|
+
): string {
|
|
6
|
+
return items
|
|
7
|
+
.map((item, index) => {
|
|
8
|
+
if (index === 0) {
|
|
9
|
+
return item;
|
|
10
|
+
}
|
|
11
|
+
return \`\${parameterName}=\${item}\`;
|
|
12
|
+
})
|
|
13
|
+
.join("&");
|
|
14
|
+
}`;
|
|
15
|
+
export const buildPipeCollectionContent = `
|
|
16
|
+
export function buildPipeCollection(items: string[] | number[]): string {
|
|
17
|
+
return items.join("|");
|
|
18
|
+
}`;
|
|
19
|
+
export const buildSsvCollectionContent = `
|
|
20
|
+
export function buildSsvCollection(items: string[] | number[]): string {
|
|
21
|
+
return items.join(" ");
|
|
22
|
+
}`;
|
|
23
|
+
export const buildTsvCollectionContent = `
|
|
24
|
+
export function buildTsvCollection(items: string[] | number[]): string {
|
|
25
|
+
return items.join("\\t");
|
|
26
|
+
}`;
|
|
27
|
+
export const buildCsvCollectionContent = `
|
|
28
|
+
export function buildCsvCollection(items: string[] | number[]): string {
|
|
29
|
+
return items.join(",");
|
|
30
|
+
}`;
|
|
31
|
+
//# sourceMappingURL=serializeHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializeHelper.js","sourceRoot":"","sources":["../../../../src/rlc-common/static/serializeHelper.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;;;;;;;;;EAazC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG;;;EAGxC,CAAC;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;EAGvC,CAAC;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;EAGvC,CAAC;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;EAGvC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildKarmaConfig.d.ts","sourceRoot":"","sources":["../../../../src/rlc-common/test/buildKarmaConfig.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,QAAQ;;;EAKpD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
|
+
// @ts-ignore: to fix the handlebars issue
|
|
3
|
+
import hbs from "handlebars";
|
|
4
|
+
import { karmaConfig } from "./template.js";
|
|
5
|
+
export function buildKarmaConfigFile(_model) {
|
|
6
|
+
return {
|
|
7
|
+
path: "karma.conf.js",
|
|
8
|
+
content: hbs.compile(karmaConfig, { noEscape: true })({})
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=buildKarmaConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildKarmaConfig.js","sourceRoot":"","sources":["../../../../src/rlc-common/test/buildKarmaConfig.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,0CAA0C;AAC1C,OAAO,GAAG,MAAM,YAAY,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,UAAU,oBAAoB,CAAC,MAAgB;IACnD,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;KAC1D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildRecordedClient.d.ts","sourceRoot":"","sources":["../../../../src/rlc-common/test/buildRecordedClient.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,QAAQ;;;EAWtD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
|
+
// @ts-ignore: to fix the handlebars issue
|
|
3
|
+
import hbs from "handlebars";
|
|
4
|
+
import { recordedClientContent } from "./template.js";
|
|
5
|
+
export function buildRecordedClientFile(model) {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
const recordedClientFileContents = hbs.compile(recordedClientContent, {
|
|
8
|
+
noEscape: true
|
|
9
|
+
});
|
|
10
|
+
return {
|
|
11
|
+
path: "test/public/utils/recordedClient.ts",
|
|
12
|
+
content: recordedClientFileContents({
|
|
13
|
+
isEsm: ((_a = model.options) === null || _a === void 0 ? void 0 : _a.moduleKind) === "esm",
|
|
14
|
+
isCjs: ((_b = model.options) === null || _b === void 0 ? void 0 : _b.moduleKind) === "cjs"
|
|
15
|
+
})
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=buildRecordedClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildRecordedClient.js","sourceRoot":"","sources":["../../../../src/rlc-common/test/buildRecordedClient.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,0CAA0C;AAC1C,OAAO,GAAG,MAAM,YAAY,CAAC;AAE7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,MAAM,UAAU,uBAAuB,CAAC,KAAe;;IACrD,MAAM,0BAA0B,GAAG,GAAG,CAAC,OAAO,CAAC,qBAAqB,EAAE;QACpE,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;IACH,OAAO;QACL,IAAI,EAAE,qCAAqC;QAC3C,OAAO,EAAE,0BAA0B,CAAC;YAClC,KAAK,EAAE,CAAA,MAAA,KAAK,CAAC,OAAO,0CAAE,UAAU,MAAK,KAAK;YAC1C,KAAK,EAAE,CAAA,MAAA,KAAK,CAAC,OAAO,0CAAE,UAAU,MAAK,KAAK;SAC3C,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildSampleTest.d.ts","sourceRoot":"","sources":["../../../../src/rlc-common/test/buildSampleTest.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,wBAAgB,eAAe,CAAC,KAAK,EAAE,QAAQ;;;EAQ9C"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
|
+
// @ts-ignore: to fix the handlebars issue
|
|
3
|
+
import hbs from "handlebars";
|
|
4
|
+
import { sampleTestContent } from "./template.js";
|
|
5
|
+
export function buildSampleTest(model) {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
return {
|
|
8
|
+
path: "test/public/sampleTest.spec.ts",
|
|
9
|
+
content: hbs.compile(sampleTestContent, { noEscape: true })({
|
|
10
|
+
isEsm: ((_a = model.options) === null || _a === void 0 ? void 0 : _a.moduleKind) === "esm",
|
|
11
|
+
isCjs: ((_b = model.options) === null || _b === void 0 ? void 0 : _b.moduleKind) === "cjs"
|
|
12
|
+
})
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=buildSampleTest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildSampleTest.js","sourceRoot":"","sources":["../../../../src/rlc-common/test/buildSampleTest.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,0CAA0C;AAC1C,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGlD,MAAM,UAAU,eAAe,CAAC,KAAe;;IAC7C,OAAO;QACL,IAAI,EAAE,gCAAgC;QACtC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;YAC1D,KAAK,EAAE,CAAA,MAAA,KAAK,CAAC,OAAO,0CAAE,UAAU,MAAK,KAAK;YAC1C,KAAK,EAAE,CAAA,MAAA,KAAK,CAAC,OAAO,0CAAE,UAAU,MAAK,KAAK;SAC3C,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildSnippets.d.ts","sourceRoot":"","sources":["../../../../src/rlc-common/test/buildSnippets.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,wBAAgB,aAAa,CAC3B,KAAK,EAAE,QAAQ,EACf,UAAU,CAAC,EAAE,MAAM,EACnB,aAAa,CAAC,EAAE,OAAO;;;cAwBxB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
|
+
// @ts-ignore: to fix the handlebars issue
|
|
3
|
+
import hbs from "handlebars";
|
|
4
|
+
import { snippetsContent } from "./template.js";
|
|
5
|
+
import { getClientName } from "../helpers/nameConstructors.js";
|
|
6
|
+
export function buildSnippets(model, clientName, azureSdkForJs) {
|
|
7
|
+
var _a, _b, _c, _d, _e, _f;
|
|
8
|
+
const azureSdkForJsInfo = azureSdkForJs
|
|
9
|
+
? azureSdkForJs
|
|
10
|
+
: (_a = model.options) === null || _a === void 0 ? void 0 : _a.azureSdkForJs;
|
|
11
|
+
// to keep the same config for azure scope in buildReadmeFile.ts
|
|
12
|
+
if ((((_c = (_b = model === null || model === void 0 ? void 0 : model.options) === null || _b === void 0 ? void 0 : _b.packageDetails) === null || _c === void 0 ? void 0 : _c.scopeName) === "azure" ||
|
|
13
|
+
((_e = (_d = model === null || model === void 0 ? void 0 : model.options) === null || _d === void 0 ? void 0 : _d.packageDetails) === null || _e === void 0 ? void 0 : _e.scopeName) === "azure-rest") &&
|
|
14
|
+
model.options.addCredentials &&
|
|
15
|
+
azureSdkForJsInfo) {
|
|
16
|
+
return {
|
|
17
|
+
path: "test/snippets.spec.ts",
|
|
18
|
+
content: hbs.compile(snippetsContent, { noEscape: true })({
|
|
19
|
+
clientClassName: clientName ? clientName : getClientName(model),
|
|
20
|
+
azureArm: (_f = model.options) === null || _f === void 0 ? void 0 : _f.azureArm,
|
|
21
|
+
azureSdkForJs: azureSdkForJsInfo,
|
|
22
|
+
isModularLibrary: model.options.isModularLibrary,
|
|
23
|
+
hasSubscriptionId: model.options.hasSubscriptionId
|
|
24
|
+
})
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=buildSnippets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildSnippets.js","sourceRoot":"","sources":["../../../../src/rlc-common/test/buildSnippets.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,0CAA0C;AAC1C,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,MAAM,UAAU,aAAa,CAC3B,KAAe,EACf,UAAmB,EACnB,aAAuB;;IAEvB,MAAM,iBAAiB,GAAG,aAAa;QACrC,CAAC,CAAC,aAAa;QACf,CAAC,CAAC,MAAA,KAAK,CAAC,OAAO,0CAAE,aAAa,CAAC;IACjC,gEAAgE;IAChE,IACE,CAAC,CAAA,MAAA,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,0CAAE,cAAc,0CAAE,SAAS,MAAK,OAAO;QACpD,CAAA,MAAA,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,0CAAE,cAAc,0CAAE,SAAS,MAAK,YAAY,CAAC;QAC7D,KAAK,CAAC,OAAO,CAAC,cAAc;QAC5B,iBAAiB,EACjB,CAAC;QACD,OAAO;YACL,IAAI,EAAE,uBAAuB;YAC7B,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;gBACxD,eAAe,EAAE,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC;gBAC/D,QAAQ,EAAE,MAAA,KAAK,CAAC,OAAO,0CAAE,QAAQ;gBACjC,aAAa,EAAE,iBAAiB;gBAChC,gBAAgB,EAAE,KAAK,CAAC,OAAO,CAAC,gBAAgB;gBAChD,iBAAiB,EAAE,KAAK,CAAC,OAAO,CAAC,iBAAiB;aACnD,CAAC;SACH,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const karmaConfig = "\n// https://github.com/karma-runner/karma-chrome-launcher\nprocess.env.CHROME_BIN = require(\"puppeteer\").executablePath();\nrequire(\"dotenv\").config();\nconst { relativeRecordingsPath } = require(\"@azure-tools/test-recorder\");\nprocess.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath();\n\nmodule.exports = function (config) {\n config.set({\n // base path that will be used to resolve all patterns (eg. files, exclude)\n basePath: \"./\",\n\n // frameworks to use\n // available frameworks: https://npmjs.org/browse/keyword/karma-adapter\n frameworks: [\"source-map-support\", \"mocha\"],\n\n plugins: [\n \"karma-mocha\",\n \"karma-mocha-reporter\",\n \"karma-chrome-launcher\",\n \"karma-firefox-launcher\",\n \"karma-env-preprocessor\",\n \"karma-coverage\",\n \"karma-sourcemap-loader\",\n \"karma-junit-reporter\",\n \"karma-source-map-support\",\n ],\n\n // list of files / patterns to load in the browser\n files: [\n \"dist-test/index.browser.js\",\n { pattern: \"dist-test/index.browser.js.map\", type: \"html\", included: false, served: true },\n ],\n\n // list of files / patterns to exclude\n exclude: [],\n\n // preprocess matching files before serving them to the browser\n // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor\n preprocessors: {\n \"**/*.js\": [\"sourcemap\", \"env\"],\n // IMPORTANT: COMMENT following line if you want to debug in your browsers!!\n // Preprocess source file to calculate code coverage, however this will make source file unreadable\n // \"dist-test/index.js\": [\"coverage\"]\n },\n\n envPreprocessor: [\n \"TEST_MODE\",\n \"ENDPOINT\",\n \"AZURE_CLIENT_SECRET\",\n \"AZURE_CLIENT_ID\",\n \"AZURE_TENANT_ID\",\n \"SUBSCRIPTION_ID\",\n \"RECORDINGS_RELATIVE_PATH\",\n ],\n\n // test results reporter to use\n // possible values: 'dots', 'progress'\n // available reporters: https://npmjs.org/browse/keyword/karma-reporter\n reporters: [\"mocha\", \"coverage\", \"junit\"],\n\n coverageReporter: {\n // specify a common output directory\n dir: \"coverage-browser/\",\n reporters: [\n { type: \"json\", subdir: \".\", file: \"coverage.json\" },\n { type: \"lcovonly\", subdir: \".\", file: \"lcov.info\" },\n { type: \"html\", subdir: \"html\" },\n { type: \"cobertura\", subdir: \".\", file: \"cobertura-coverage.xml\" },\n ],\n },\n\n junitReporter: {\n outputDir: \"\", // results will be saved as $outputDir/$browserName.xml\n outputFile: \"test-results.browser.xml\", // if included, results will be saved as $outputDir/$browserName/$outputFile\n suite: \"\", // suite will become the package name attribute in xml testsuite element\n useBrowserName: false, // add browser name to report and classes names\n nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element\n classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element\n properties: {}, // key value pair of properties to add to the <properties> section of the report\n },\n\n // web server port\n port: 9876,\n\n // enable / disable colors in the output (reporters and logs)\n colors: true,\n\n // level of logging\n // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG\n logLevel: config.LOG_INFO,\n\n // enable / disable watching file and executing tests whenever any file changes\n autoWatch: false,\n\n // --no-sandbox allows our tests to run in Linux without having to change the system.\n // --disable-web-security allows us to authenticate from the browser without having to write tests using interactive auth, which would be far more complex.\n browsers: [\"ChromeHeadlessNoSandbox\"],\n customLaunchers: {\n ChromeHeadlessNoSandbox: {\n base: \"ChromeHeadless\",\n flags: [\"--no-sandbox\", \"--disable-web-security\"],\n },\n },\n\n // Continuous Integration mode\n // if true, Karma captures browsers, runs the tests and exits\n singleRun: false,\n\n // Concurrency level\n // how many browser should be started simultaneous\n concurrency: 1,\n\n browserNoActivityTimeout: 60000000,\n browserDisconnectTimeout: 10000,\n browserDisconnectTolerance: 3,\n\n client: {\n mocha: {\n // change Karma's debug.html to the mocha web reporter\n reporter: \"html\",\n timeout: \"600000\",\n },\n },\n });\n};\n";
|
|
2
|
+
export declare const recordedClientContent = "\n\n{{#if isEsm}}\nimport {\n Recorder,\n RecorderStartOptions,\n VitestTestContext,\n} from \"@azure-tools/test-recorder\";\n{{/if}}\n\n{{#if isCjs}}\nimport { Context } from \"mocha\";\nimport { Recorder, RecorderStartOptions } from \"@azure-tools/test-recorder\";\n{{/if}}\n\nconst replaceableVariables: Record<string, string> = {\n SUBSCRIPTION_ID: \"azure_subscription_id\"\n};\n\nconst recorderEnvSetup: RecorderStartOptions = {\n envSetupForPlayback: replaceableVariables,\n};\n\n/**\n * creates the recorder and reads the environment variables from the `.env` file.\n * Should be called first in the test suite to make sure environment variables are\n * read before they are being used.\n */\n{{#if isEsm}}\nexport async function createRecorder(context: VitestTestContext): Promise<Recorder> {\n const recorder = new Recorder(context);\n await recorder.start(recorderEnvSetup);\n return recorder;\n}\n{{/if}}\n\n{{#if isCjs}}\nexport async function createRecorder(context: Context): Promise<Recorder> {\n const recorder = new Recorder(context.currentTest);\n await recorder.start(recorderEnvSetup);\n return recorder;\n}\n{{/if}}\n";
|
|
3
|
+
export declare const sampleTestContent = "\n{{#if isEsm}}\n// import { Recorder } from \"@azure-tools/test-recorder\";\n// import { createRecorder } from \"./utils/recordedClient.js\";\nimport { assert, \n // beforeEach,\n // afterEach,\n it,\n describe\n} from \"vitest\";\n{{/if}}\n\n{{#if isCjs}}\n// import { Recorder } from \"@azure-tools/test-recorder\";\nimport { assert } from \"chai\";\n// import { createRecorder } from \"./utils/recordedClient{{#if isModularLibrary}}.js{{/if}}\";\n// import { Context } from \"mocha\";\n{{/if}}\n\ndescribe(\"My test\", () => {\n // let recorder: Recorder;\n\n // beforeEach(async function({{#if isCjs}}this: Context{{else}}ctx{{/if}}) {\n {{#if isEsm}}\n // recorder = await createRecorder(ctx);\n {{else}}\n // recorder = await createRecorder(this);\n {{/if}}\n // });\n\n // afterEach(async function() {\n // await recorder.stop();\n // });\n\n it(\"sample test\", async function() {\n assert.equal(1, 1);\n });\n});\n";
|
|
4
|
+
export declare const snippetsContent = "\n{{#if isModularLibrary}}\nimport { {{ clientClassName }} } from \"../src/index.js\";\nimport { DefaultAzureCredential, InteractiveBrowserCredential } from \"@azure/identity\";\n{{/if}}\nimport { setLogLevel } from \"@azure/logger\";\nimport { describe, it } from \"vitest\";\n\ndescribe(\"snippets\", () => {\n{{#if isModularLibrary}}\n it(\"ReadmeSampleCreateClient_Node\", async () => {\n {{#if azureArm}}\n {{#if hasSubscriptionId}}\n const subscriptionId = \"00000000-0000-0000-0000-000000000000\";\n const client = new {{ clientClassName }}(new DefaultAzureCredential(), subscriptionId);\n {{else}}\n const client = new {{ clientClassName }}(new DefaultAzureCredential());\n {{/if}}\n {{else}}\n const client = new {{ clientClassName }}(\"<endpoint>\", new DefaultAzureCredential());\n {{/if}}\n });\n\n it(\"ReadmeSampleCreateClient_Browser\", async () => {\n {{#if azureArm}}\n const credential = new InteractiveBrowserCredential({\n tenantId: \"<YOUR_TENANT_ID>\",\n clientId: \"<YOUR_CLIENT_ID>\",\n });\n {{#if hasSubscriptionId}}\n const subscriptionId = \"00000000-0000-0000-0000-000000000000\";\n const client = new {{ clientClassName }}(credential, subscriptionId);\n {{else}}\n const client = new {{ clientClassName }}(credential);\n {{/if}}\n {{else}}\n const credential = new InteractiveBrowserCredential({\n tenantId: \"<YOUR_TENANT_ID>\",\n clientId: \"<YOUR_CLIENT_ID>\",\n });\n const client = new {{ clientClassName }}(\"<endpoint>\", credential);\n {{/if}}\n });\n {{/if}}\n\n it(\"SetLogLevel\", async () => {\n setLogLevel(\"info\");\n });\n});\n";
|
|
5
|
+
//# sourceMappingURL=template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../../src/rlc-common/test/template.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,+oJA8HvB,CAAC;AAEF,eAAO,MAAM,qBAAqB,moCA2CjC,CAAC;AAEF,eAAO,MAAM,iBAAiB,69BAsC7B,CAAC;AAEF,eAAO,MAAM,eAAe,gpDAiD3B,CAAC"}
|