From e0564f5be6b89d83ff1d8e084a5c41fc8385e710 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 23 Apr 2019 20:48:41 +0000 Subject: [PATCH] Generated from 27030d9b0643ea8befec88bb6f2d277d85c46fe5 Add v3.0-preview APIs --- .../cognitiveservices-luis-runtime/README.md | 7 +- .../lib/lUISRuntimeClient.ts | 42 +++ .../lib/lUISRuntimeClientContext.ts | 51 +++ .../lib/models/index.ts | 261 +++++++++++++++ .../lib/models/mappers.ts | 312 ++++++++++++++++++ .../lib/models/parameters.ts | 106 ++++++ .../lib/models/predictionMappers.ts | 22 ++ .../lib/operations/index.ts | 11 + .../lib/operations/prediction.ts | 102 ++++++ .../package.json | 10 +- .../tsconfig.json | 2 +- 11 files changed, 914 insertions(+), 12 deletions(-) create mode 100644 sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/lUISRuntimeClient.ts create mode 100644 sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/lUISRuntimeClientContext.ts create mode 100644 sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/models/index.ts create mode 100644 sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/models/mappers.ts create mode 100644 sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/models/parameters.ts create mode 100644 sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/models/predictionMappers.ts create mode 100644 sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/operations/index.ts create mode 100644 sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/operations/prediction.ts diff --git a/sdk/cognitiveservices/cognitiveservices-luis-runtime/README.md b/sdk/cognitiveservices/cognitiveservices-luis-runtime/README.md index 745872081dad..8d534b7a804e 100644 --- a/sdk/cognitiveservices/cognitiveservices-luis-runtime/README.md +++ b/sdk/cognitiveservices/cognitiveservices-luis-runtime/README.md @@ -33,7 +33,7 @@ const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; msRestNodeAuth.interactiveLogin().then((creds) => { const client = new LUISRuntimeClient(creds, subscriptionId); - const appId = "testappId"; + const appId = ec7b1657-199d-4d8a-bbb2-89a11a42e02a; const query = "testquery"; const timezoneOffset = 1.01; const verbose = true; @@ -83,7 +83,7 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to authManager.login(); } const client = new Azure.CognitiveservicesLuisRuntime.LUISRuntimeClient(res.creds, subscriptionId); - const appId = "testappId"; + const appId = ec7b1657-199d-4d8a-bbb2-89a11a42e02a; const query = "testquery"; const timezoneOffset = 1.01; const verbose = true; @@ -108,6 +108,3 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to ## Related projects - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/cognitiveservices/cognitiveservices-luis-runtime/README.png) diff --git a/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/lUISRuntimeClient.ts b/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/lUISRuntimeClient.ts new file mode 100644 index 000000000000..b7d545732afc --- /dev/null +++ b/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/lUISRuntimeClient.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "./models"; +import * as Mappers from "./models/mappers"; +import * as operations from "./operations"; +import { LUISRuntimeClientContext } from "./lUISRuntimeClientContext"; + +class LUISRuntimeClient extends LUISRuntimeClientContext { + // Operation groups + prediction: operations.Prediction; + + /** + * Initializes a new instance of the LUISRuntimeClient class. + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://westus.api.cognitive.microsoft.com). + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param [options] The parameter options + */ + constructor(endpoint: string, credentials: msRest.ServiceClientCredentials, options?: msRest.ServiceClientOptions) { + super(endpoint, credentials, options); + this.prediction = new operations.Prediction(this); + } +} + +// Operation Specifications + +export { + LUISRuntimeClient, + LUISRuntimeClientContext, + Models as LUISRuntimeModels, + Mappers as LUISRuntimeMappers +}; +export * from "./operations"; diff --git a/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/lUISRuntimeClientContext.ts b/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/lUISRuntimeClientContext.ts new file mode 100644 index 000000000000..fa047d17b901 --- /dev/null +++ b/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/lUISRuntimeClientContext.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; + +const packageName = "@azure/cognitiveservices-luis-runtime"; +const packageVersion = "2.0.0"; + +export class LUISRuntimeClientContext extends msRest.ServiceClient { + endpoint: string; + credentials: msRest.ServiceClientCredentials; + + /** + * Initializes a new instance of the LUISRuntimeClientContext class. + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://westus.api.cognitive.microsoft.com). + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param [options] The parameter options + */ + constructor(endpoint: string, credentials: msRest.ServiceClientCredentials, options?: msRest.ServiceClientOptions) { + if (endpoint === null || endpoint === undefined) { + throw new Error('\'endpoint\' cannot be null.'); + } + if (credentials === null || credentials === undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + + if (!options) { + options = {}; + } + if(!options.userAgent) { + const defaultUserAgent = msRest.getDefaultUserAgentValue(); + options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; + } + + super(credentials, options); + + this.baseUri = "{Endpoint}"; + this.requestContentType = "application/json; charset=utf-8"; + this.endpoint = endpoint; + this.credentials = credentials; + + } +} diff --git a/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/models/index.ts b/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/models/index.ts new file mode 100644 index 000000000000..bf39b3267796 --- /dev/null +++ b/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/models/index.ts @@ -0,0 +1,261 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * 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. + */ + +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. + */ + intent?: string; + /** + * @member {number} [score] 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. + */ + entity: string; + /** + * @member {string} type 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. + */ + startIndex: number; + /** + * @member {number} endIndex 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. + */ + [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: string; + /** + * @member {string} value 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. + */ + parentType: string; + /** + * @member {string} value Value for composite entity extracted by LUIS. + */ + value: string; + /** + * @member {CompositeChildModel[]} children 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. + */ + label?: string; + /** + * @member {number} [score] 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. + */ + query?: string; + /** + * @member {string} [alteredQuery] 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. + */ + intents?: IntentModel[]; + /** + * @member {EntityModel[]} [entities] The entities extracted from the + * utterance. + */ + entities?: EntityModel[]; + /** + * @member {CompositeEntityModel[]} [compositeEntities] 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). + */ + 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: any; +} + +/** + * @interface + * An interface representing APIError. + * Error information returned by the API + * + */ +export interface APIError { + /** + * @member {string} [statusCode] HTTP Status code + */ + statusCode?: string; + /** + * @member {string} [message] 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. + */ + timezoneOffset?: number; + /** + * @member {boolean} [verbose] If true, return all intents instead of just + * the top scoring intent. + */ + verbose?: boolean; + /** + * @member {boolean} [staging] Use the staging endpoint slot. + */ + staging?: boolean; + /** + * @member {boolean} [spellCheck] Enable spell checking. + */ + spellCheck?: boolean; + /** + * @member {string} [bingSpellCheckSubscriptionKey] The subscription key to + * use when enabling Bing spell check + */ + bingSpellCheckSubscriptionKey?: string; + /** + * @member {boolean} [log] Log query (default is true) + */ + log?: boolean; +} + +/** + * Contains response data for the resolve operation. + */ +export type PredictionResolveResponse = LuisResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: LuisResult; + }; +}; diff --git a/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/models/mappers.ts b/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/models/mappers.ts new file mode 100644 index 000000000000..adfb6e94ce82 --- /dev/null +++ b/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/models/mappers.ts @@ -0,0 +1,312 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; + + +export const IntentModel: msRest.CompositeMapper = { + serializedName: "IntentModel", + type: { + name: "Composite", + className: "IntentModel", + modelProperties: { + intent: { + serializedName: "intent", + type: { + name: "String" + } + }, + score: { + serializedName: "score", + constraints: { + InclusiveMaximum: 1, + InclusiveMinimum: 0 + }, + type: { + name: "Number" + } + } + } + } +}; + +export const EntityModel: msRest.CompositeMapper = { + serializedName: "EntityModel", + type: { + name: "Composite", + className: "EntityModel", + modelProperties: { + entity: { + required: true, + serializedName: "entity", + type: { + name: "String" + } + }, + type: { + required: true, + serializedName: "type", + type: { + name: "String" + } + }, + startIndex: { + required: true, + serializedName: "startIndex", + type: { + name: "Number" + } + }, + endIndex: { + required: true, + serializedName: "endIndex", + type: { + name: "Number" + } + } + }, + additionalProperties: { + type: { + name: "Object" + } + } + } +}; + +export const CompositeChildModel: msRest.CompositeMapper = { + serializedName: "CompositeChildModel", + type: { + name: "Composite", + className: "CompositeChildModel", + modelProperties: { + type: { + required: true, + serializedName: "type", + type: { + name: "String" + } + }, + value: { + required: true, + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const CompositeEntityModel: msRest.CompositeMapper = { + serializedName: "CompositeEntityModel", + type: { + name: "Composite", + className: "CompositeEntityModel", + modelProperties: { + parentType: { + required: true, + serializedName: "parentType", + type: { + name: "String" + } + }, + value: { + required: true, + serializedName: "value", + type: { + name: "String" + } + }, + children: { + required: true, + serializedName: "children", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CompositeChildModel" + } + } + } + } + } + } +}; + +export const Sentiment: msRest.CompositeMapper = { + serializedName: "Sentiment", + type: { + name: "Composite", + className: "Sentiment", + modelProperties: { + label: { + serializedName: "label", + type: { + name: "String" + } + }, + score: { + serializedName: "score", + type: { + name: "Number" + } + } + } + } +}; + +export const LuisResult: msRest.CompositeMapper = { + serializedName: "LuisResult", + type: { + name: "Composite", + className: "LuisResult", + modelProperties: { + query: { + serializedName: "query", + type: { + name: "String" + } + }, + alteredQuery: { + serializedName: "alteredQuery", + type: { + name: "String" + } + }, + topScoringIntent: { + serializedName: "topScoringIntent", + type: { + name: "Composite", + className: "IntentModel" + } + }, + intents: { + serializedName: "intents", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IntentModel" + } + } + } + }, + entities: { + serializedName: "entities", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "EntityModel", + additionalProperties: { + type: { + name: "Object" + } + } + } + } + } + }, + compositeEntities: { + serializedName: "compositeEntities", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CompositeEntityModel" + } + } + } + }, + sentimentAnalysis: { + serializedName: "sentimentAnalysis", + type: { + name: "Composite", + className: "Sentiment" + } + }, + connectedServiceResult: { + serializedName: "connectedServiceResult", + type: { + name: "Composite", + className: "LuisResult" + } + } + } + } +}; + +export const EntityWithScore: msRest.CompositeMapper = { + serializedName: "EntityWithScore", + type: { + name: "Composite", + className: "EntityWithScore", + modelProperties: { + ...EntityModel.type.modelProperties, + score: { + required: true, + serializedName: "score", + constraints: { + InclusiveMaximum: 1, + InclusiveMinimum: 0 + }, + type: { + name: "Number" + } + } + }, + additionalProperties: EntityModel.type.additionalProperties + } +}; + +export const EntityWithResolution: msRest.CompositeMapper = { + serializedName: "EntityWithResolution", + type: { + name: "Composite", + className: "EntityWithResolution", + modelProperties: { + ...EntityModel.type.modelProperties, + resolution: { + required: true, + serializedName: "resolution", + type: { + name: "Object" + } + } + }, + additionalProperties: EntityModel.type.additionalProperties + } +}; + +export const APIError: msRest.CompositeMapper = { + serializedName: "APIError", + type: { + name: "Composite", + className: "APIError", + modelProperties: { + statusCode: { + serializedName: "statusCode", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/models/parameters.ts b/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/models/parameters.ts new file mode 100644 index 000000000000..22e9463631ec --- /dev/null +++ b/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/models/parameters.ts @@ -0,0 +1,106 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; + +export const appId: msRest.OperationURLParameter = { + parameterPath: "appId", + mapper: { + required: true, + serializedName: "appId", + type: { + name: "Uuid" + } + } +}; +export const bingSpellCheckSubscriptionKey: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "bingSpellCheckSubscriptionKey" + ], + mapper: { + serializedName: "bing-spell-check-subscription-key", + type: { + name: "String" + } + } +}; +export const endpoint: msRest.OperationURLParameter = { + parameterPath: "endpoint", + mapper: { + required: true, + serializedName: "Endpoint", + defaultValue: '', + type: { + name: "String" + } + }, + skipEncoding: true +}; +export const log: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "log" + ], + mapper: { + serializedName: "log", + type: { + name: "Boolean" + } + } +}; +export const spellCheck: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "spellCheck" + ], + mapper: { + serializedName: "spellCheck", + type: { + name: "Boolean" + } + } +}; +export const staging: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "staging" + ], + mapper: { + serializedName: "staging", + type: { + name: "Boolean" + } + } +}; +export const timezoneOffset: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "timezoneOffset" + ], + mapper: { + serializedName: "timezoneOffset", + type: { + name: "Number" + } + } +}; +export const verbose: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "verbose" + ], + mapper: { + serializedName: "verbose", + type: { + name: "Boolean" + } + } +}; diff --git a/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/models/predictionMappers.ts b/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/models/predictionMappers.ts new file mode 100644 index 000000000000..811d97c4ce62 --- /dev/null +++ b/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/models/predictionMappers.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * 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. + */ + +export { + LuisResult, + IntentModel, + EntityModel, + CompositeEntityModel, + CompositeChildModel, + Sentiment, + APIError, + EntityWithScore, + EntityWithResolution +} from "../models/mappers"; + diff --git a/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/operations/index.ts b/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/operations/index.ts new file mode 100644 index 000000000000..2cae6665995d --- /dev/null +++ b/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/operations/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * 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. + */ + +export * from "./prediction"; diff --git a/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/operations/prediction.ts b/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/operations/prediction.ts new file mode 100644 index 000000000000..6826d7a0b6b0 --- /dev/null +++ b/sdk/cognitiveservices/cognitiveservices-luis-runtime/lib/operations/prediction.ts @@ -0,0 +1,102 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/predictionMappers"; +import * as Parameters from "../models/parameters"; +import { LUISRuntimeClientContext } from "../lUISRuntimeClientContext"; + +/** Class representing a Prediction. */ +export class Prediction { + private readonly client: LUISRuntimeClientContext; + + /** + * Create a Prediction. + * @param {LUISRuntimeClientContext} client Reference to the service client. + */ + constructor(client: LUISRuntimeClientContext) { + this.client = client; + } + + /** + * Gets predictions for a given utterance, in the form of intents and entities. The current maximum + * query size is 500 characters. + * @param appId The LUIS application ID (Guid). + * @param query The utterance to predict. + * @param [options] The optional parameters + * @returns Promise + */ + resolve(appId: string, query: string, options?: Models.PredictionResolveOptionalParams): Promise; + /** + * @param appId The LUIS application ID (Guid). + * @param query The utterance to predict. + * @param callback The callback + */ + resolve(appId: string, query: string, callback: msRest.ServiceCallback): void; + /** + * @param appId The LUIS application ID (Guid). + * @param query The utterance to predict. + * @param options The optional parameters + * @param callback The callback + */ + resolve(appId: string, query: string, options: Models.PredictionResolveOptionalParams, callback: msRest.ServiceCallback): void; + resolve(appId: string, query: string, options?: Models.PredictionResolveOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + appId, + query, + options + }, + resolveOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const resolveOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "apps/{appId}", + urlParameters: [ + Parameters.endpoint, + Parameters.appId + ], + queryParameters: [ + Parameters.timezoneOffset, + Parameters.verbose, + Parameters.staging, + Parameters.spellCheck, + Parameters.bingSpellCheckSubscriptionKey, + Parameters.log + ], + requestBody: { + parameterPath: "query", + mapper: { + required: true, + serializedName: "query", + constraints: { + MaxLength: 500 + }, + type: { + name: "String" + } + } + }, + responses: { + 200: { + bodyMapper: Mappers.LuisResult + }, + default: { + bodyMapper: Mappers.APIError + } + }, + serializer +}; diff --git a/sdk/cognitiveservices/cognitiveservices-luis-runtime/package.json b/sdk/cognitiveservices/cognitiveservices-luis-runtime/package.json index b0056960d3f8..044ac42ec7e5 100644 --- a/sdk/cognitiveservices/cognitiveservices-luis-runtime/package.json +++ b/sdk/cognitiveservices/cognitiveservices-luis-runtime/package.json @@ -4,7 +4,7 @@ "description": "LUISRuntimeClient Library with typescript type definitions for node.js and browser.", "version": "2.0.0", "dependencies": { - "@azure/ms-rest-js": "^1.6.0", + "@azure/ms-rest-js": "^1.2.0", "tslib": "^1.9.3" }, "keywords": [ @@ -25,7 +25,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.4.9" }, - "homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/cognitiveservices/cognitiveservices-luis-runtime", + "homepage": "https://github.com/azure/azure-sdk-for-js", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-js.git" @@ -42,8 +42,7 @@ "esm/**/*.js.map", "esm/**/*.d.ts", "esm/**/*.d.ts.map", - "src/**/*.ts", - "README.md", + "lib/**/*.ts", "rollup.config.js", "tsconfig.json" ], @@ -52,6 +51,5 @@ "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/cognitiveservices-luis-runtime.js.map'\" -o ./dist/cognitiveservices-luis-runtime.min.js ./dist/cognitiveservices-luis-runtime.js", "prepack": "npm install && npm run build" }, - "sideEffects": false, - "autoPublish": true + "sideEffects": false } diff --git a/sdk/cognitiveservices/cognitiveservices-luis-runtime/tsconfig.json b/sdk/cognitiveservices/cognitiveservices-luis-runtime/tsconfig.json index 87bbf5b5fa49..51ea90961ce5 100644 --- a/sdk/cognitiveservices/cognitiveservices-luis-runtime/tsconfig.json +++ b/sdk/cognitiveservices/cognitiveservices-luis-runtime/tsconfig.json @@ -14,6 +14,6 @@ "outDir": "./esm", "importHelpers": true }, - "include": ["./src/**/*.ts"], + "include": ["./lib/**/*.ts"], "exclude": ["node_modules"] }