From 15e1b4e5eb1c6c74ba4a39d6e076af51a07d435c Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 15 Mar 2022 10:47:15 +0000 Subject: [PATCH] CodeGen from PR 18257 in Azure/azure-rest-api-specs Merge 069f1ee3f06cd37bee701d20eb93f317e0d70d05 into 6354ca8bf06ea064f4f0fef331a10c1baf62ac35 --- common/config/rush/pnpm-lock.yaml | 17 ++-- sdk/datafactory/arm-datafactory/README.md | 13 +--- sdk/datafactory/arm-datafactory/_meta.json | 7 +- sdk/datafactory/arm-datafactory/package.json | 24 ++---- .../arm-datafactory/rollup.config.js | 78 +++++++++++++++++-- .../src/dataFactoryManagementClient.ts | 2 +- sdk/datafactory/ci.mgmt.yml | 7 +- 7 files changed, 98 insertions(+), 50 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index b39ba0ca29b6..c875a19b8fa8 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -10308,28 +10308,27 @@ packages: dev: false file:projects/arm-datafactory.tgz: - resolution: {integrity: sha512-j+LTbRhHIaMJMaKmSs/ugOXWowAtP21BK0F8lThUcZ5lOlfbOxY9iU7phGtUPih0dn4HcjjTx8g2j4caUfE4vQ==, tarball: file:projects/arm-datafactory.tgz} + resolution: {integrity: sha512-ksoNY2/t0jVRVxTGQj7yRNisiFwkjZAyEP5bd0rsYeci5FkBVvk8cyquevVP7qPACN+koDjAyJEQG3cALJm7EA==, tarball: file:projects/arm-datafactory.tgz} name: '@rush-temp/arm-datafactory' version: 0.0.0 dependencies: '@azure-tools/test-recorder': 1.0.2 '@azure/identity': 2.0.4 '@microsoft/api-extractor': 7.19.4 - '@rollup/plugin-commonjs': 21.0.1_rollup@2.67.1 - '@rollup/plugin-json': 4.1.0_rollup@2.67.1 - '@rollup/plugin-multi-entry': 4.1.0_rollup@2.67.1 - '@rollup/plugin-node-resolve': 13.1.3_rollup@2.67.1 + '@rollup/plugin-commonjs': 11.0.2_rollup@1.32.1 + '@rollup/plugin-json': 4.1.0_rollup@1.32.1 + '@rollup/plugin-multi-entry': 3.0.1_rollup@1.32.1 + '@rollup/plugin-node-resolve': 8.4.0_rollup@1.32.1 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 - rollup: 2.67.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.67.1 + rollup: 1.32.1 + rollup-plugin-sourcemaps: 0.4.2_rollup@1.32.1 tslib: 2.3.1 typescript: 4.2.4 uglify-js: 3.15.1 transitivePeerDependencies: - - '@types/node' - debug - encoding - supports-color @@ -12457,7 +12456,7 @@ packages: dev: false file:projects/arm-rediscache.tgz: - resolution: {integrity: sha512-lRPMNQ6X2zNGHkn4+nUXsiXRde6JISO5YjFzhycdJL/3NCg9F4m94x+VbYyNtbvW5a7oVbGmyu4lW+I8qlqszQ==, tarball: file:projects/arm-rediscache.tgz} + resolution: {integrity: sha512-L96UyCle2mXUwU1QCXkofA0Yl4jBo8ElH3wdfGQBGHvDnDGkb1wNzcyuMsNncmPePr3fWsM50xCYuaMASfy0Ag==, tarball: file:projects/arm-rediscache.tgz} name: '@rush-temp/arm-rediscache' version: 0.0.0 dependencies: diff --git a/sdk/datafactory/arm-datafactory/README.md b/sdk/datafactory/arm-datafactory/README.md index ba364beeca3d..ebc8e47d01d4 100644 --- a/sdk/datafactory/arm-datafactory/README.md +++ b/sdk/datafactory/arm-datafactory/README.md @@ -6,7 +6,7 @@ The Azure Data Factory V2 management API provides a RESTful set of web services [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/datafactory/arm-datafactory) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-datafactory) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-datafactory) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-datafactory?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started @@ -16,8 +16,6 @@ The Azure Data Factory V2 management API provides a RESTful set of web services - [LTS versions of Node.js](https://nodejs.org/about/releases/) - Latest versions of Safari, Chrome, Edge and Firefox. -See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. - ### Prerequisites - An [Azure subscription][azure_sub]. @@ -51,17 +49,8 @@ For more information about how to create an Azure AD Application check out [this ```javascript const { DataFactoryManagementClient } = require("@azure/arm-datafactory"); const { DefaultAzureCredential } = require("@azure/identity"); -// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. - const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DataFactoryManagementClient(new DefaultAzureCredential(), subscriptionId); - -// For client-side applications running in the browser, use this code instead: -// const credential = new InteractiveBrowserCredential({ -// tenantId: "", -// clientId: "" -// }); -// const client = new DataFactoryManagementClient(credential, subscriptionId); ``` diff --git a/sdk/datafactory/arm-datafactory/_meta.json b/sdk/datafactory/arm-datafactory/_meta.json index 9c88399d14ad..ee73cc71e7f5 100644 --- a/sdk/datafactory/arm-datafactory/_meta.json +++ b/sdk/datafactory/arm-datafactory/_meta.json @@ -1,7 +1,8 @@ { - "commit": "bb9f1204f9a337404ff7e7b73b4c7b4ddde7f8f1", + "commit": "5fd3195f038f674be56db6a47ebfdd5c7bd4e984", "readme": "specification/datafactory/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/datafactory/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220218.1", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/datafactory/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "use": "@autorest/typescript@6.0.0-alpha.16.20220218.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.1.2", + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" } \ No newline at end of file diff --git a/sdk/datafactory/arm-datafactory/package.json b/sdk/datafactory/arm-datafactory/package.json index 1a689e46cf3e..3907b0ca930d 100644 --- a/sdk/datafactory/arm-datafactory/package.json +++ b/sdk/datafactory/arm-datafactory/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for DataFactoryManagementClient.", - "version": "10.2.1", + "version": "1.0.0-beta.1", "engines": { "node": ">=12.0.0" }, @@ -29,13 +29,13 @@ "types": "./types/arm-datafactory.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.18.11", - "@rollup/plugin-commonjs": "^21.0.1", - "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-multi-entry": "^4.1.0", - "@rollup/plugin-node-resolve": "^13.1.3", + "@rollup/plugin-commonjs": "11.0.2", + "@rollup/plugin-json": "^4.0.0", + "@rollup/plugin-multi-entry": "^3.0.0", + "@rollup/plugin-node-resolve": "^8.0.0", "mkdirp": "^1.0.4", - "rollup": "^2.66.1", - "rollup-plugin-sourcemaps": "^0.6.3", + "rollup": "^1.16.3", + "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", @@ -98,13 +98,5 @@ "docs": "echo skipped" }, "sideEffects": false, - "//metadata": { - "constantPaths": [ - { - "path": "src/dataFactoryManagementClient.ts", - "prefix": "packageDetails" - } - ] - }, "autoPublish": true -} +} \ No newline at end of file diff --git a/sdk/datafactory/arm-datafactory/rollup.config.js b/sdk/datafactory/arm-datafactory/rollup.config.js index 3f89d7309da5..9be1955eb7f1 100644 --- a/sdk/datafactory/arm-datafactory/rollup.config.js +++ b/sdk/datafactory/arm-datafactory/rollup.config.js @@ -14,14 +14,62 @@ import json from "@rollup/plugin-json"; import nodeBuiltins from "builtin-modules"; +/** + * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api. + * + * NOTE: this manual configuration is only needed because OpenTelemetry uses an + * __exportStar downleveled helper function to declare its exports which confuses + * rollup's automatic discovery mechanism. + * + * @returns an object reference that can be `...`'d into your cjs() configuration. + */ +export function openTelemetryCommonJs() { + const namedExports = {}; + + for (const key of [ + "@opentelemetry/api", + "@azure/core-tracing/node_modules/@opentelemetry/api" + ]) { + namedExports[key] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "SpanStatusCode", + "getSpanContext", + "setSpanContext" + ]; + } + + const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"]; + + for (const version of releasedOpenTelemetryVersions) { + namedExports[ + // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path. + `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js` + ] = [ + "SpanKind", + "TraceFlags", + "getSpan", + "setSpan", + "StatusCode", + "CanonicalCode", + "getSpanContext", + "setSpanContext" + ]; + } + + return namedExports; +} + // #region Warning Handler /** - * A function that can determine whether a rollup warning should be ignored. If + * A function that can determine whether a rollupwarning should be ignored. If * the function returns `true`, then the warning will not be displayed. */ -function ignoreNiseSinonEval(warning) { +function ignoreNiseSinonEvalWarnings(warning) { return ( warning.code === "EVAL" && warning.id && @@ -30,14 +78,17 @@ function ignoreNiseSinonEval(warning) { ); } -function ignoreChaiCircularDependency(warning) { +function ignoreChaiCircularDependencyWarnings(warning) { return ( warning.code === "CIRCULAR_DEPENDENCY" && warning.importer && warning.importer.includes("node_modules/chai") === true ); } -const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; +const warningInhibitors = [ + ignoreChaiCircularDependencyWarnings, + ignoreNiseSinonEvalWarnings +]; /** * Construct a warning handler for the shared rollup configuration @@ -71,7 +122,22 @@ function makeBrowserTestConfig() { nodeResolve({ mainFields: ["module", "browser"] }), - cjs(), + cjs({ + namedExports: { + // Chai's strange internal architecture makes it impossible to statically + // analyze its exports. + chai: [ + "version", + "use", + "util", + "config", + "expect", + "should", + "assert" + ], + ...openTelemetryCommonJs() + } + }), json(), sourcemaps() //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) @@ -107,7 +173,7 @@ export function makeConfig(pkg, options) { ], output: { file: "dist/index.js", format: "cjs", sourcemap: true }, preserveSymlinks: false, - plugins: [sourcemaps(), nodeResolve()] + plugins: [sourcemaps(), nodeResolve(), cjs()] }; const config = [baseConfig]; diff --git a/sdk/datafactory/arm-datafactory/src/dataFactoryManagementClient.ts b/sdk/datafactory/arm-datafactory/src/dataFactoryManagementClient.ts index 4900eb029b85..b79e3a288ec4 100644 --- a/sdk/datafactory/arm-datafactory/src/dataFactoryManagementClient.ts +++ b/sdk/datafactory/arm-datafactory/src/dataFactoryManagementClient.ts @@ -86,7 +86,7 @@ export class DataFactoryManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-datafactory/10.2.1`; + const packageDetails = `azsdk-js-arm-datafactory/1.0.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` diff --git a/sdk/datafactory/ci.mgmt.yml b/sdk/datafactory/ci.mgmt.yml index 14dbab376a10..16100e8989cf 100644 --- a/sdk/datafactory/ci.mgmt.yml +++ b/sdk/datafactory/ci.mgmt.yml @@ -1,5 +1,5 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: @@ -10,6 +10,7 @@ trigger: include: - sdk/datafactory/ci.mgmt.yml - sdk/datafactory/arm-datafactory/ + - sdk/datafactory/arm-datafactory pr: branches: include: @@ -23,11 +24,11 @@ pr: include: - sdk/datafactory/ci.mgmt.yml - sdk/datafactory/arm-datafactory/ - + - sdk/datafactory/arm-datafactory extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: datafactory Artifacts: - name: azure-arm-datafactory - safeName: azurearmdatafactory \ No newline at end of file + safeName: azurearmdatafactory