From 23df83504753ad823d60a2ec692f6e11741c8526 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 29 Jan 2019 08:36:08 -0800 Subject: [PATCH 1/3] Generated from 59e0c9edb7b7859abb45c76c118343b7998eb5c0 (#1001) Add dispatch child to LUIS Runtime response --- .../LICENSE.txt | 2 +- .../cognitiveservices-luis-runtime/README.md | 8 +++---- .../lib/models/index.ts | 6 ++++- .../lib/models/mappers.ts | 7 ++++++ .../package.json | 3 ++- .../rollup.config.js | 22 ++++++++++++------- 6 files changed, 33 insertions(+), 15 deletions(-) diff --git a/packages/@azure/cognitiveservices-luis-runtime/LICENSE.txt b/packages/@azure/cognitiveservices-luis-runtime/LICENSE.txt index 5431ba98b936..8f3d856145c5 100644 --- a/packages/@azure/cognitiveservices-luis-runtime/LICENSE.txt +++ b/packages/@azure/cognitiveservices-luis-runtime/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2019 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/@azure/cognitiveservices-luis-runtime/README.md b/packages/@azure/cognitiveservices-luis-runtime/README.md index d54e65122cec..552d47a0d747 100644 --- a/packages/@azure/cognitiveservices-luis-runtime/README.md +++ b/packages/@azure/cognitiveservices-luis-runtime/README.md @@ -9,7 +9,7 @@ This package contains an isomorphic SDK for LUISRuntimeClient. ### How to Install -``` +```bash npm install @azure/cognitiveservices-luis-runtime ``` @@ -19,13 +19,13 @@ npm install @azure/cognitiveservices-luis-runtime ##### Install @azure/ms-rest-nodeauth -``` +```bash npm install @azure/ms-rest-nodeauth ``` ##### Sample code -```ts +```typescript import * as msRest from "@azure/ms-rest-js"; import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; import { LUISRuntimeClient, LUISRuntimeModels, LUISRuntimeMappers } from "@azure/cognitiveservices-luis-runtime"; @@ -54,7 +54,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => { ##### Install @azure/ms-rest-browserauth -``` +```bash npm install @azure/ms-rest-browserauth ``` diff --git a/packages/@azure/cognitiveservices-luis-runtime/lib/models/index.ts b/packages/@azure/cognitiveservices-luis-runtime/lib/models/index.ts index a2714ea251cd..572380deb27f 100644 --- a/packages/@azure/cognitiveservices-luis-runtime/lib/models/index.ts +++ b/packages/@azure/cognitiveservices-luis-runtime/lib/models/index.ts @@ -126,7 +126,7 @@ export interface Sentiment { */ export interface LuisResult { /** - * @member {string} [query] The input utterance that was analized. + * @member {string} [query] The input utterance that was analyzed. */ query?: string; /** @@ -157,6 +157,10 @@ export interface LuisResult { * @member {Sentiment} [sentimentAnalysis] */ sentimentAnalysis?: Sentiment; + /** + * @member {LuisResult} [connectedServiceResult] + */ + connectedServiceResult?: LuisResult; } /** diff --git a/packages/@azure/cognitiveservices-luis-runtime/lib/models/mappers.ts b/packages/@azure/cognitiveservices-luis-runtime/lib/models/mappers.ts index db19d170b934..adfb6e94ce82 100644 --- a/packages/@azure/cognitiveservices-luis-runtime/lib/models/mappers.ts +++ b/packages/@azure/cognitiveservices-luis-runtime/lib/models/mappers.ts @@ -235,6 +235,13 @@ export const LuisResult: msRest.CompositeMapper = { name: "Composite", className: "Sentiment" } + }, + connectedServiceResult: { + serializedName: "connectedServiceResult", + type: { + name: "Composite", + className: "LuisResult" + } } } } diff --git a/packages/@azure/cognitiveservices-luis-runtime/package.json b/packages/@azure/cognitiveservices-luis-runtime/package.json index 47df6e8c4ba9..68b4d2df77fa 100644 --- a/packages/@azure/cognitiveservices-luis-runtime/package.json +++ b/packages/@azure/cognitiveservices-luis-runtime/package.json @@ -4,7 +4,7 @@ "description": "LUISRuntimeClient Library with typescript type definitions for node.js and browser.", "version": "0.1.0", "dependencies": { - "@azure/ms-rest-js": "^1.1.0", + "@azure/ms-rest-js": "^1.2.0", "tslib": "^1.9.3" }, "keywords": [ @@ -22,6 +22,7 @@ "typescript": "^3.1.1", "rollup": "^0.66.2", "rollup-plugin-node-resolve": "^3.4.0", + "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.4.9" }, "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/packages/@azure/cognitiveservices-luis-runtime", diff --git a/packages/@azure/cognitiveservices-luis-runtime/rollup.config.js b/packages/@azure/cognitiveservices-luis-runtime/rollup.config.js index 3f361759ba07..ceb7313a16bd 100644 --- a/packages/@azure/cognitiveservices-luis-runtime/rollup.config.js +++ b/packages/@azure/cognitiveservices-luis-runtime/rollup.config.js @@ -1,10 +1,16 @@ +import rollup from "rollup"; import nodeResolve from "rollup-plugin-node-resolve"; +import sourcemaps from "rollup-plugin-sourcemaps"; + /** - * @type {import('rollup').RollupFileOptions} + * @type {rollup.RollupFileOptions} */ const config = { - input: './esm/lUISRuntimeClient.js', - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], + input: "./esm/lUISRuntimeClient.js", + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], output: { file: "./dist/cognitiveservices-luis-runtime.js", format: "umd", @@ -16,16 +22,16 @@ const config = { }, banner: `/* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */` }, plugins: [ - nodeResolve({ module: true }) + nodeResolve({ module: true }), + sourcemaps() ] }; + export default config; From 12c38ecdc8c7d8543841ad0c9e415d204026cc3d Mon Sep 17 00:00:00 2001 From: Kamil Pajdzik Date: Fri, 8 Feb 2019 08:42:34 -0800 Subject: [PATCH 2/3] Regenerate @azure/cognitiveservices-luis-runtime package --- .../lib/lUISRuntimeClientContext.ts | 2 +- .../lib/models/index.ts | 118 +++++------------- .../lib/models/mappers.ts | 6 +- .../lib/models/predictionMappers.ts | 21 ++-- .../package.json | 5 +- 5 files changed, 48 insertions(+), 104 deletions(-) diff --git a/packages/@azure/cognitiveservices-luis-runtime/lib/lUISRuntimeClientContext.ts b/packages/@azure/cognitiveservices-luis-runtime/lib/lUISRuntimeClientContext.ts index bb5c5139266f..f10e1629cac6 100644 --- a/packages/@azure/cognitiveservices-luis-runtime/lib/lUISRuntimeClientContext.ts +++ b/packages/@azure/cognitiveservices-luis-runtime/lib/lUISRuntimeClientContext.ts @@ -11,7 +11,7 @@ import * as msRest from "@azure/ms-rest-js"; const packageName = "@azure/cognitiveservices-luis-runtime"; -const packageVersion = "0.1.0"; +const packageVersion = "1.1.1"; export class LUISRuntimeClientContext extends msRest.ServiceClient { endpoint: string; diff --git a/packages/@azure/cognitiveservices-luis-runtime/lib/models/index.ts b/packages/@azure/cognitiveservices-luis-runtime/lib/models/index.ts index 572380deb27f..93de9ea9fd06 100644 --- a/packages/@azure/cognitiveservices-luis-runtime/lib/models/index.ts +++ b/packages/@azure/cognitiveservices-luis-runtime/lib/models/index.ts @@ -1,242 +1,189 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as msRest from "@azure/ms-rest-js"; +import * as msRest from "@azure/ms-rest-js"; /** - * @interface - * An interface representing IntentModel. * An intent detected from the utterance. - * */ export interface IntentModel { /** - * @member {string} [intent] Name of the intent, as defined in LUIS. + * Name of the intent, as defined in LUIS. */ intent?: string; /** - * @member {number} [score] Associated prediction score for the intent - * (float). + * Associated prediction score for the intent (float). */ score?: number; } /** - * @interface - * An interface representing EntityModel. * An entity extracted from the utterance. - * */ export interface EntityModel { /** - * @member {string} entity Name of the entity, as defined in LUIS. + * Name of the entity, as defined in LUIS. */ entity: string; /** - * @member {string} type Type of the entity, as defined in LUIS. + * Type of the entity, as defined in LUIS. */ type: string; /** - * @member {number} startIndex The position of the first character of the - * matched entity within the utterance. + * The position of the first character of the matched entity within the utterance. */ startIndex: number; /** - * @member {number} endIndex The position of the last character of the - * matched entity within the utterance. + * The position of the last character of the matched entity within the utterance. */ endIndex: number; /** - * @property Describes unknown properties. The value of an unknown property - * can be of "any" type. + * Describes unknown properties. The value of an unknown property can be of "any" type. */ [property: string]: any; } /** - * @interface - * An interface representing CompositeChildModel. * Child entity in a LUIS Composite Entity. - * */ export interface CompositeChildModel { /** - * @member {string} type Type of child entity. + * Type of child entity. */ type: string; /** - * @member {string} value Value extracted by LUIS. + * Value extracted by LUIS. */ value: string; } /** - * @interface - * An interface representing CompositeEntityModel. * LUIS Composite Entity. - * */ export interface CompositeEntityModel { /** - * @member {string} parentType Type/name of parent entity. + * Type/name of parent entity. */ parentType: string; /** - * @member {string} value Value for composite entity extracted by LUIS. + * Value for composite entity extracted by LUIS. */ value: string; /** - * @member {CompositeChildModel[]} children Child entities. + * Child entities. */ children: CompositeChildModel[]; } /** - * @interface - * An interface representing Sentiment. * Sentiment of the input utterance. - * */ export interface Sentiment { /** - * @member {string} [label] The polarity of the sentiment, can be positive, - * neutral or negative. + * The polarity of the sentiment, can be positive, neutral or negative. */ label?: string; /** - * @member {number} [score] Score of the sentiment, ranges from 0 (most - * negative) to 1 (most positive). + * Score of the sentiment, ranges from 0 (most negative) to 1 (most positive). */ score?: number; } /** - * @interface - * An interface representing LuisResult. * Prediction, based on the input query, containing intent(s) and entities. - * */ export interface LuisResult { /** - * @member {string} [query] The input utterance that was analyzed. + * The input utterance that was analyzed. */ query?: string; /** - * @member {string} [alteredQuery] The corrected utterance (when spell - * checking was enabled). + * The corrected utterance (when spell checking was enabled). */ alteredQuery?: string; - /** - * @member {IntentModel} [topScoringIntent] - */ topScoringIntent?: IntentModel; /** - * @member {IntentModel[]} [intents] All the intents (and their score) that - * were detected from utterance. + * All the intents (and their score) that were detected from utterance. */ intents?: IntentModel[]; /** - * @member {EntityModel[]} [entities] The entities extracted from the - * utterance. + * The entities extracted from the utterance. */ entities?: EntityModel[]; /** - * @member {CompositeEntityModel[]} [compositeEntities] The composite - * entities extracted from the utterance. + * The composite entities extracted from the utterance. */ compositeEntities?: CompositeEntityModel[]; - /** - * @member {Sentiment} [sentimentAnalysis] - */ sentimentAnalysis?: Sentiment; - /** - * @member {LuisResult} [connectedServiceResult] - */ connectedServiceResult?: LuisResult; } /** - * @interface * An interface representing EntityWithScore. - * @extends EntityModel */ export interface EntityWithScore extends EntityModel { /** - * @member {number} score Associated prediction score for the intent (float). + * Associated prediction score for the intent (float). */ score: number; } /** - * @interface * An interface representing EntityWithResolution. - * @extends EntityModel */ export interface EntityWithResolution extends EntityModel { /** - * @member {any} resolution Resolution values for pre-built LUIS entities. + * Resolution values for pre-built LUIS entities. */ resolution: any; } /** - * @interface - * An interface representing APIError. * Error information returned by the API - * */ export interface APIError { /** - * @member {string} [statusCode] HTTP Status code + * HTTP Status code */ statusCode?: string; /** - * @member {string} [message] Cause of the error. + * Cause of the error. */ message?: string; } /** - * @interface - * An interface representing PredictionResolveOptionalParams. * Optional Parameters. - * - * @extends RequestOptionsBase */ export interface PredictionResolveOptionalParams extends msRest.RequestOptionsBase { /** - * @member {number} [timezoneOffset] The timezone offset for the location of - * the request. + * The timezone offset for the location of the request. */ timezoneOffset?: number; /** - * @member {boolean} [verbose] If true, return all intents instead of just - * the top scoring intent. + * If true, return all intents instead of just the top scoring intent. */ verbose?: boolean; /** - * @member {boolean} [staging] Use the staging endpoint slot. + * Use the staging endpoint slot. */ staging?: boolean; /** - * @member {boolean} [spellCheck] Enable spell checking. + * Enable spell checking. */ spellCheck?: boolean; /** - * @member {string} [bingSpellCheckSubscriptionKey] The subscription key to - * use when enabling bing spell check + * The subscription key to use when enabling bing spell check */ bingSpellCheckSubscriptionKey?: string; /** - * @member {boolean} [log] Log query (default is true) + * Log query (default is true) */ log?: boolean; } @@ -253,6 +200,7 @@ export type PredictionResolveResponse = LuisResult & { * The response body as text (string format) */ bodyAsText: string; + /** * The response body as parsed JSON or XML */ diff --git a/packages/@azure/cognitiveservices-luis-runtime/lib/models/mappers.ts b/packages/@azure/cognitiveservices-luis-runtime/lib/models/mappers.ts index adfb6e94ce82..fce7171486fd 100644 --- a/packages/@azure/cognitiveservices-luis-runtime/lib/models/mappers.ts +++ b/packages/@azure/cognitiveservices-luis-runtime/lib/models/mappers.ts @@ -1,11 +1,9 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ import * as msRest from "@azure/ms-rest-js"; diff --git a/packages/@azure/cognitiveservices-luis-runtime/lib/models/predictionMappers.ts b/packages/@azure/cognitiveservices-luis-runtime/lib/models/predictionMappers.ts index 811d97c4ce62..51a31d9f8896 100644 --- a/packages/@azure/cognitiveservices-luis-runtime/lib/models/predictionMappers.ts +++ b/packages/@azure/cognitiveservices-luis-runtime/lib/models/predictionMappers.ts @@ -1,22 +1,19 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ export { - LuisResult, - IntentModel, - EntityModel, - CompositeEntityModel, - CompositeChildModel, - Sentiment, APIError, + CompositeChildModel, + CompositeEntityModel, + EntityModel, + EntityWithResolution, EntityWithScore, - EntityWithResolution + IntentModel, + LuisResult, + Sentiment } from "../models/mappers"; - diff --git a/packages/@azure/cognitiveservices-luis-runtime/package.json b/packages/@azure/cognitiveservices-luis-runtime/package.json index 9690e273eb6d..a373d9aafbc4 100644 --- a/packages/@azure/cognitiveservices-luis-runtime/package.json +++ b/packages/@azure/cognitiveservices-luis-runtime/package.json @@ -4,7 +4,7 @@ "description": "LUISRuntimeClient Library with typescript type definitions for node.js and browser.", "version": "1.1.1", "dependencies": { - "@azure/ms-rest-js": "^1.2.0", + "@azure/ms-rest-js": "^1.6.0", "tslib": "^1.9.3" }, "keywords": [ @@ -43,6 +43,7 @@ "esm/**/*.d.ts", "esm/**/*.d.ts.map", "lib/**/*.ts", + "README.md", "rollup.config.js", "tsconfig.json" ], @@ -52,5 +53,5 @@ "prepack": "npm install && npm run build" }, "sideEffects": false, - "authPublish": true + "autoPublish": true } From 9b101d1e6ac939bd4ab5ba655285bae3d1944f63 Mon Sep 17 00:00:00 2001 From: Kamil Pajdzik Date: Fri, 8 Feb 2019 08:58:45 -0800 Subject: [PATCH 3/3] Regenerate @azure/cognitiveservices-luis-runtime package --- .../lib/lUISRuntimeClientContext.ts | 2 +- packages/@azure/cognitiveservices-luis-runtime/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@azure/cognitiveservices-luis-runtime/lib/lUISRuntimeClientContext.ts b/packages/@azure/cognitiveservices-luis-runtime/lib/lUISRuntimeClientContext.ts index f10e1629cac6..5ee0275bbb3a 100644 --- a/packages/@azure/cognitiveservices-luis-runtime/lib/lUISRuntimeClientContext.ts +++ b/packages/@azure/cognitiveservices-luis-runtime/lib/lUISRuntimeClientContext.ts @@ -11,7 +11,7 @@ import * as msRest from "@azure/ms-rest-js"; const packageName = "@azure/cognitiveservices-luis-runtime"; -const packageVersion = "1.1.1"; +const packageVersion = "1.2.0"; export class LUISRuntimeClientContext extends msRest.ServiceClient { endpoint: string; diff --git a/packages/@azure/cognitiveservices-luis-runtime/package.json b/packages/@azure/cognitiveservices-luis-runtime/package.json index a373d9aafbc4..f01e72acca16 100644 --- a/packages/@azure/cognitiveservices-luis-runtime/package.json +++ b/packages/@azure/cognitiveservices-luis-runtime/package.json @@ -2,7 +2,7 @@ "name": "@azure/cognitiveservices-luis-runtime", "author": "Microsoft Corporation", "description": "LUISRuntimeClient Library with typescript type definitions for node.js and browser.", - "version": "1.1.1", + "version": "1.2.0", "dependencies": { "@azure/ms-rest-js": "^1.6.0", "tslib": "^1.9.3"