Skip to content

Commit

Permalink
CodeGen from PR 24951 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
[Hub Generated] Review request for Microsoft.DevHub to add version stable/2023-08-01 (Azure#24951)

* Adds base for updating Microsoft.DevHub from version preview/2022-10-11-preview to version 2023-08-01

* Updates readme

* Updates API version in new specs and examples
  • Loading branch information
SDKAuto committed Oct 19, 2023
1 parent bee878f commit 3602046
Show file tree
Hide file tree
Showing 10 changed files with 388 additions and 122 deletions.
222 changes: 193 additions & 29 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

62 changes: 2 additions & 60 deletions sdk/devhub/arm-devhub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,5 @@
# Release History

## 1.0.0-beta.4 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes

## 1.0.0-beta.3 (2023-05-29)

**Features**

- Added Interface ArtifactGenerationProperties
- Added Interface GeneratePreviewArtifactsOptionalParams
- Added Type Alias AuthorizationStatus
- Added Type Alias DockerfileGenerationMode
- Added Type Alias GeneratePreviewArtifactsResponse
- Added Type Alias GenerationLanguage
- Added Type Alias GenerationManifestType
- Added Type Alias ManifestGenerationMode
- Added Type Alias WorkflowRunStatus
- Interface Workflow has a new optional parameter appName
- Interface Workflow has a new optional parameter builderVersion
- Interface Workflow has a new optional parameter dockerfileGenerationMode
- Interface Workflow has a new optional parameter dockerfileOutputDirectory
- Interface Workflow has a new optional parameter generationLanguage
- Interface Workflow has a new optional parameter imageName
- Interface Workflow has a new optional parameter imageTag
- Interface Workflow has a new optional parameter languageVersion
- Interface Workflow has a new optional parameter manifestGenerationMode
- Interface Workflow has a new optional parameter manifestOutputDirectory
- Interface Workflow has a new optional parameter manifestType
- Interface Workflow has a new optional parameter namespacePropertiesArtifactGenerationPropertiesNamespace
- Interface Workflow has a new optional parameter namespacePropertiesGithubWorkflowProfileNamespace
- Interface Workflow has a new optional parameter port
- Interface WorkflowRun has a new optional parameter workflowRunStatus
- Added Enum KnownAuthorizationStatus
- Added Enum KnownDockerfileGenerationMode
- Added Enum KnownGenerationLanguage
- Added Enum KnownGenerationManifestType
- Added Enum KnownManifestGenerationMode
- Added Enum KnownWorkflowRunStatus

**Breaking Changes**

- Interface Workflow no longer has parameter namespace
- Type of parameter authStatus of interface Workflow is changed from ManifestType to AuthorizationStatus


## 1.0.0-beta.2 (2023-01-04)

**Features**

- Interface WorkflowListByResourceGroupNextOptionalParams no longer has parameter managedClusterResource


## 1.0.0-beta.1 (2022-10-18)
## 1.0.0 (2023-10-19)

The package of @azure/arm-devhub is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ).
The package of @azure/arm-devhub is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).
2 changes: 1 addition & 1 deletion sdk/devhub/arm-devhub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The AKS Developer Hub Service Client

[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/devhub/arm-devhub) |
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-devhub) |
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-devhub?view=azure-node-preview) |
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-devhub) |
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)

## Getting started
Expand Down
8 changes: 4 additions & 4 deletions sdk/devhub/arm-devhub/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "5595c3c7082fe447f32e637f06191f67fa8cfab2",
"commit": "ae7273f53995b3ca67efcfa9b01014f94f880543",
"readme": "specification/developerhub/resource-manager/readme.md",
"autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=F:\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\developerhub\\resource-manager\\readme.md --use=@autorest/[email protected].2 --generate-sample=true",
"autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/developerhub/resource-manager/readme.md --use=@autorest/typescript@^6.0.11",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/[email protected].0",
"use": "@autorest/[email protected].2"
"release_tool": "@azure-tools/[email protected].2",
"use": "@autorest/typescript@^6.0.11"
}
35 changes: 18 additions & 17 deletions sdk/devhub/arm-devhub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for DeveloperHubServiceClient.",
"version": "1.0.0-beta.4",
"version": "1.0.0",
"engines": {
"node": ">=16.0.0"
},
"dependencies": {
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.7.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.8.0",
"@azure/core-rest-pipeline": "^1.12.0",
"tslib": "^2.2.0"
},
"keywords": [
Expand All @@ -27,21 +27,29 @@
"types": "./types/arm-devhub.d.ts",
"devDependencies": {
"@microsoft/api-extractor": "^7.31.1",
"@rollup/plugin-commonjs": "^24.0.0",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-multi-entry": "^6.0.0",
"@rollup/plugin-node-resolve": "^13.1.3",
"mkdirp": "^2.1.2",
"rollup": "^2.66.1",
"rollup-plugin-sourcemaps": "^0.6.3",
"typescript": "~5.0.0",
"uglify-js": "^3.4.9",
"rimraf": "^3.0.0",
"rimraf": "^5.0.0",
"dotenv": "^16.0.0",
"@azure/identity": "^3.3.0",
"@azure-tools/test-recorder": "^3.0.0",
"@azure-tools/test-credential": "^1.0.0",
"mocha": "^10.0.0",
"@types/mocha": "^10.0.0",
"esm": "^3.2.18",
"@types/chai": "^4.2.8",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"@types/node": "^16.0.0",
"@azure/dev-tool": "^1.0.0",
"ts-node": "^10.0.0"
"ts-node": "^10.0.0",
"@azure/dev-tool": "^1.0.0"
},
"repository": {
"type": "git",
Expand All @@ -62,20 +70,21 @@
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
"CHANGELOG.md",
"types/*"
],
"scripts": {
"build": "npm run clean && tsc && dev-tool run bundle && npm run minify && mkdirp ./review && npm run extract-api",
"build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api",
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
"prepack": "npm run build",
"pack": "npm pack 2>&1",
"extract-api": "api-extractor run --local",
"lint": "echo skipped",
"audit": "echo skipped",
"clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"build:node": "echo skipped",
"build:browser": "echo skipped",
"build:test": "echo skipped",
Expand Down Expand Up @@ -103,13 +112,5 @@
]
},
"autoPublish": true,
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/devhub/arm-devhub",
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-devhub?view=azure-node-preview"
}
}
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/devhub/arm-devhub"
}
122 changes: 122 additions & 0 deletions sdk/devhub/arm-devhub/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

import nodeResolve from "@rollup/plugin-node-resolve";
import cjs from "@rollup/plugin-commonjs";
import sourcemaps from "rollup-plugin-sourcemaps";
import multiEntry from "@rollup/plugin-multi-entry";
import json from "@rollup/plugin-json";

import nodeBuiltins from "builtin-modules";

// #region Warning Handler

/**
* A function that can determine whether a rollup warning should be ignored. If
* the function returns `true`, then the warning will not be displayed.
*/

function ignoreNiseSinonEval(warning) {
return (
warning.code === "EVAL" &&
warning.id &&
(warning.id.includes("node_modules/nise") ||
warning.id.includes("node_modules/sinon")) === true
);
}

function ignoreChaiCircularDependency(warning) {
return (
warning.code === "CIRCULAR_DEPENDENCY" &&
warning.importer && warning.importer.includes("node_modules/chai") === true
);
}

const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval];

/**
* Construct a warning handler for the shared rollup configuration
* that ignores certain warnings that are not relevant to testing.
*/
function makeOnWarnForTesting() {
return (warning, warn) => {
// If every inhibitor returns false (i.e. no inhibitors), then show the warning
if (warningInhibitors.every((inhib) => !inhib(warning))) {
warn(warning);
}
};
}

// #endregion

function makeBrowserTestConfig() {
const config = {
input: {
include: ["dist-esm/test/**/*.spec.js"],
exclude: ["dist-esm/test/**/node/**"]
},
output: {
file: `dist-test/index.browser.js`,
format: "umd",
sourcemap: true
},
preserveSymlinks: false,
plugins: [
multiEntry({ exports: false }),
nodeResolve({
mainFields: ["module", "browser"]
}),
cjs(),
json(),
sourcemaps()
//viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
],
onwarn: makeOnWarnForTesting(),
// Disable tree-shaking of test code. In [email protected],
// rollup started respecting the "sideEffects" field in package.json. Since
// our package.json sets "sideEffects=false", this also applies to test
// code, which causes all tests to be removed by tree-shaking.
treeshake: false
};

return config;
}

const defaultConfigurationOptions = {
disableBrowserBundle: false
};

export function makeConfig(pkg, options) {
options = {
...defaultConfigurationOptions,
...(options || {})
};

const baseConfig = {
// Use the package's module field if it has one
input: pkg["module"] || "dist-esm/src/index.js",
external: [
...nodeBuiltins,
...Object.keys(pkg.dependencies),
...Object.keys(pkg.devDependencies)
],
output: { file: "dist/index.js", format: "cjs", sourcemap: true },
preserveSymlinks: false,
plugins: [sourcemaps(), nodeResolve()]
};

const config = [baseConfig];

if (!options.disableBrowserBundle) {
config.push(makeBrowserTestConfig());
}

return config;
}

export default makeConfig(require("./package.json"));
4 changes: 2 additions & 2 deletions sdk/devhub/arm-devhub/src/developerHubServiceClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class DeveloperHubServiceClient extends coreClient.ServiceClient {
credential: credentials
};

const packageDetails = `azsdk-js-arm-devhub/1.0.0-beta.4`;
const packageDetails = `azsdk-js-arm-devhub/1.0.0`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
Expand Down Expand Up @@ -116,7 +116,7 @@ export class DeveloperHubServiceClient extends coreClient.ServiceClient {

// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
this.apiVersion = options.apiVersion || "2022-10-11-preview";
this.apiVersion = options.apiVersion || "2023-08-01";
this.operations = new OperationsImpl(this);
this.workflowOperations = new WorkflowOperationsImpl(this);
this.addCustomApiVersionPolicy(options.apiVersion);
Expand Down
2 changes: 1 addition & 1 deletion sdk/devhub/arm-devhub/src/models/parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const $host: OperationURLParameter = {
export const apiVersion: OperationQueryParameter = {
parameterPath: "apiVersion",
mapper: {
defaultValue: "2022-10-11-preview",
defaultValue: "2023-08-01",
isConstant: true,
serializedName: "api-version",
type: {
Expand Down
43 changes: 43 additions & 0 deletions sdk/devhub/arm-devhub/test/sampleTest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

import {
Recorder,
RecorderStartOptions,
env
} from "@azure-tools/test-recorder";
import { assert } from "chai";
import { Context } from "mocha";

const replaceableVariables: Record<string, string> = {
AZURE_CLIENT_ID: "azure_client_id",
AZURE_CLIENT_SECRET: "azure_client_secret",
AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888",
SUBSCRIPTION_ID: "azure_subscription_id"
};

const recorderOptions: RecorderStartOptions = {
envSetupForPlayback: replaceableVariables
};

describe("My test", () => {
let recorder: Recorder;

beforeEach(async function(this: Context) {
recorder = new Recorder(this.currentTest);
await recorder.start(recorderOptions);
});

afterEach(async function() {
await recorder.stop();
});

it("sample test", async function() {
console.log("Hi, I'm a test!");
});
});
10 changes: 2 additions & 8 deletions sdk/devhub/arm-devhub/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,11 @@
],
"declaration": true,
"outDir": "./dist-esm",
"importHelpers": true,
"paths": {
"@azure/arm-devhub": [
"./src/index"
]
}
"importHelpers": true
},
"include": [
"./src/**/*.ts",
"./test/**/*.ts",
"samples-dev/**/*.ts"
"./test/**/*.ts"
],
"exclude": [
"node_modules"
Expand Down

0 comments on commit 3602046

Please sign in to comment.