Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,247 changes: 1,049 additions & 1,198 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions sdk/healthbot/arm-healthbot/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Release History

## 2.0.1 (2022-04-26)

## 2.1.0 (2022-08-10)
**Features**

- Bug fix

- Added Interface HealthBot
- Added Interface TrackedResource


## 2.0.0 (2022-01-13)

The package of @azure/arm-healthbot is using our next generation design principles since version 2.0.0, which contains breaking changes.
Expand Down
12 changes: 6 additions & 6 deletions sdk/healthbot/arm-healthbot/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "1f1d5b0b9ce6cc94605b2fd619dce374fb6e033a",
"readme": "specification\\healthbot\\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:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\healthbot\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true",
"commit": "f964ff84b1f38801363af1eb69cf90e068a916ba",
"readme": "specification/healthbot/resource-manager/readme.md",
"autorest_command": "",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/js-sdk-release-tools@2.2.6",
"use": "@autorest/typescript@6.0.0-alpha.19.20220408.1"
}
"release_tool": "@azure-tools/js-sdk-release-tools@2.4.1",
"use": "@autorest/typescript@6.0.0-rc.1"
}
27 changes: 11 additions & 16 deletions sdk/healthbot/arm-healthbot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for HealthbotClient.",
"version": "2.0.1",
"version": "2.1.0",
"engines": {
"node": ">=12.0.0"
},
Expand Down Expand Up @@ -40,9 +40,13 @@
"uglify-js": "^3.4.9",
"rimraf": "^3.0.0",
"@azure/identity": "^2.0.1",
"@azure-tools/test-recorder": "^1.0.0",
"@azure-tools/test-recorder": "^2.0.0",
"@azure-tools/test-credential": "^1.0.0",
"mocha": "^7.1.1",
"cross-env": "^7.0.2"
"@types/chai": "^4.2.8",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"@azure/dev-tool": "^1.0.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/healthbot/arm-healthbot",
"repository": {
Expand Down Expand Up @@ -93,9 +97,8 @@
"unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
"unit-test:browser": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js",
"integration-test:browser": "echo skipped",
"docs": "echo skipped"
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
"integration-test:browser": "echo skipped"
},
"sideEffects": false,
"//metadata": {
Expand All @@ -106,13 +109,5 @@
}
]
},
"autoPublish": true,
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-healthbot?view=azure-node-preview"
}
}
"autoPublish": true
}
16 changes: 6 additions & 10 deletions sdk/healthbot/arm-healthbot/review/arm-healthbot.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ export interface ErrorModel {
}

// @public
export type HealthBot = TrackedResource & {
sku: Sku;
export interface HealthBot extends TrackedResource {
identity?: Identity;
properties?: HealthBotProperties;
};
sku: Sku;
}

// @public (undocumented)
export class HealthbotClient extends coreClient.ServiceClient {
Expand Down Expand Up @@ -172,13 +172,9 @@ export type IdentityType = string;

// @public
export enum KnownIdentityType {
// (undocumented)
Application = "Application",
// (undocumented)
Key = "Key",
// (undocumented)
ManagedIdentity = "ManagedIdentity",
// (undocumented)
User = "User"
}

Expand Down Expand Up @@ -248,12 +244,12 @@ export interface SystemData {
}

// @public
export type TrackedResource = Resource & {
export interface TrackedResource extends Resource {
location: string;
tags?: {
[propertyName: string]: string;
};
location: string;
};
}

// @public
export interface UserAssignedIdentity {
Expand Down
36 changes: 35 additions & 1 deletion sdk/healthbot/arm-healthbot/src/healthbotClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

import * as coreClient from "@azure/core-client";
import * as coreRestPipeline from "@azure/core-rest-pipeline";
import {
PipelineRequest,
PipelineResponse,
SendRequest
} from "@azure/core-rest-pipeline";
import * as coreAuth from "@azure/core-auth";
import { BotsImpl, OperationsImpl } from "./operations";
import { Bots, Operations } from "./operationsInterfaces";
Expand Down Expand Up @@ -45,7 +50,7 @@ export class HealthbotClient extends coreClient.ServiceClient {
credential: credentials
};

const packageDetails = `azsdk-js-arm-healthbot/2.0.1`;
const packageDetails = `azsdk-js-arm-healthbot/2.1.0`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
Expand Down Expand Up @@ -95,6 +100,35 @@ export class HealthbotClient extends coreClient.ServiceClient {
this.apiVersion = options.apiVersion || "2021-06-10";
this.bots = new BotsImpl(this);
this.operations = new OperationsImpl(this);
this.addCustomApiVersionPolicy(options.apiVersion);
}

/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
private addCustomApiVersionPolicy(apiVersion?: string) {
if (!apiVersion) {
return;
}
const apiVersionPolicy = {
name: "CustomApiVersionPolicy",
async sendRequest(
request: PipelineRequest,
next: SendRequest
): Promise<PipelineResponse> {
const param = request.url.split("?");
if (param.length > 1) {
const newParams = param[1].split("&").map((item) => {
if (item.indexOf("api-version") > -1) {
return "api-version=" + apiVersion;
} else {
return item;
}
});
request.url = param[0] + "?" + newParams.join("&");
}
return next(request);
}
};
this.pipeline.addPolicy(apiVersionPolicy);
}

bots: Bots;
Expand Down
12 changes: 8 additions & 4 deletions sdk/healthbot/arm-healthbot/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,28 +222,32 @@ export interface ValidationResult {
}

/** The resource model definition for a ARM tracked top level resource */
export type TrackedResource = Resource & {
export interface TrackedResource extends Resource {
/** Resource tags. */
tags?: { [propertyName: string]: string };
/** The geo-location where the resource lives */
location: string;
};
}

/** Azure Health Bot resource definition */
export type HealthBot = TrackedResource & {
export interface HealthBot extends TrackedResource {
/** SKU of the Azure Health Bot. */
sku: Sku;
/** The identity of the Azure Health Bot. */
identity?: Identity;
/** The set of properties specific to Azure Health Bot resource. */
properties?: HealthBotProperties;
};
}

/** Known values of {@link IdentityType} that the service accepts. */
export enum KnownIdentityType {
/** User */
User = "User",
/** Application */
Application = "Application",
/** ManagedIdentity */
ManagedIdentity = "ManagedIdentity",
/** Key */
Key = "Key"
}

Expand Down
39 changes: 17 additions & 22 deletions sdk/healthbot/arm-healthbot/test/sampleTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,30 @@
*/

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

const recorderEnvSetup: RecorderEnvironmentSetup = {
replaceableVariables: {
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"
},
customizationsOnRecordings: [
(recording: any): any =>
recording.replace(
/"access_token":"[^"]*"/g,
`"access_token":"access_token"`
)
],
queryParametersToSkip: []
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() {
recorder = record(this, recorderEnvSetup);
beforeEach(async function(this: Context) {
recorder = new Recorder(this.currentTest);
await recorder.start(recorderOptions);
});

afterEach(async function() {
Expand Down
10 changes: 2 additions & 8 deletions sdk/healthbot/arm-healthbot/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-healthbot": [
"./src/index"
]
}
"importHelpers": true
},
"include": [
"./src/**/*.ts",
"./test/**/*.ts",
"samples-dev/**/*.ts"
"./test/**/*.ts"
],
"exclude": [
"node_modules"
Expand Down