Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

style: remove trailing white space #332

Merged
merged 1 commit into from
Aug 20, 2018
Merged
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
4 changes: 2 additions & 2 deletions src/AzureFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import * as Request from 'request'
Expand All @@ -19,7 +19,7 @@ export class AzureFunctions {
return new Promise((resolve, reject) => {
const requestData = {
url: azureFunctionsUrl + funcName + '/' + args,
/* TODO - auth
/* TODO - auth
headers: {
'Cookie' : this.credentials.Cookiestring(),
},*/
Expand Down
24 changes: 12 additions & 12 deletions src/CLClient.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import * as models from '@conversationlearner/models'
Expand Down Expand Up @@ -67,25 +67,25 @@ export class CLClient {
// check if request is bypassing cognitive services APIM
if(!this.options.CONVERSATION_LEARNER_SERVICE_URI.includes('api.cognitive.microsoft.com'))
{
// In this case we are not chaning the serviceUrl and it stays the same,
// In this case we are not chaning the serviceUrl and it stays the same,
// for example: https://localhost:37936/api/v1/ -> https://localhost:37936/api/v1/
return this.MakeURL(apiPath, query)
}

// The base uri for session API in cognitive services APIM is in the form of '<service url>/conversationlearner/session/v1.0/'
// Session API are the following api:
// Session API are the following api:
// 1) POST /app/<appId>/session
// 2) PUT /app/<appId>/session/extract
// 3) PUT /app/<appId>/session/score
// 4) DELETE /app/<appId>/session
let baseUri = this.options.CONVERSATION_LEARNER_SERVICE_URI.endsWith('/') ?
this.options.CONVERSATION_LEARNER_SERVICE_URI :
let baseUri = this.options.CONVERSATION_LEARNER_SERVICE_URI.endsWith('/') ?
this.options.CONVERSATION_LEARNER_SERVICE_URI :
`${this.options.CONVERSATION_LEARNER_SERVICE_URI}/`
const apimVersionSuffix = '/v1.0/'
if(baseUri.endsWith(apimVersionSuffix))
{
// In this case, serviceurl has api version information in it; "session" will be inserted before /v1.0
// this means that https://westus.api.cognitive.microsoft.com/conversationlearner/v1.0/ becomes
// this means that https://westus.api.cognitive.microsoft.com/conversationlearner/v1.0/ becomes
// https://westus.api.cognitive.microsoft.com/conversationlearner/session/v1.0/
baseUri = `${baseUri.substring(0, baseUri.lastIndexOf(apimVersionSuffix))}/session${apimVersionSuffix}`
}
Expand Down Expand Up @@ -118,7 +118,7 @@ export class CLClient {
if(!requestMethod) {
throw new Error(`Request method not found for http verb: ${method}`)
}

requestMethod(requestData, (error, response, responseBody) => {
if (error) {
reject(error)
Expand All @@ -134,7 +134,7 @@ export class CLClient {
//==============================================================================
// App
//=============================================================================
/**
/**
* Retrieve information about a specific application
* If the app ID isn't found in the set of (non-archived) apps,
* returns 404 error ("not found")
Expand All @@ -161,7 +161,7 @@ export class CLClient {
return this.send('POST', this.MakeURL(apiPath))
}

/**
/**
* Archive an existing application
* Note: "deleting" an application doesn't destroy it, but rather archives
* it for a period (eg 30 days). During the archive period, the application
Expand All @@ -173,7 +173,7 @@ export class CLClient {
return this.send('DELETE', this.MakeURL(apiPath))
}

/**
/**
* Create a new application
*/
// TODO: Fix API to return full object
Expand Down Expand Up @@ -278,7 +278,7 @@ export class CLClient {
/** End a session. */
public EndSession(appId: string, sessionId: string): Promise<string> {
let apiPath = `app/${appId}/session/${sessionId}`
//TODO: remove this when redundant query parameter is removed
//TODO: remove this when redundant query parameter is removed
let query = 'saveDialog=false'
return this.send('DELETE', this.MakeSessionURL(apiPath, query))
}
Expand Down
2 changes: 1 addition & 1 deletion src/CLDebug.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { Utils } from './Utils'
Expand Down
6 changes: 3 additions & 3 deletions src/CLMemory.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import * as BB from 'botbuilder'
Expand Down Expand Up @@ -38,7 +38,7 @@ export class CLMemory {
if (!user.id) {
throw new Error(`Attempted to initialize memory, but user.id was not provided which is required for use as memory key.`)
}

let memory = new CLMemory(user.id)
await memory.BotState.SetConversationReference(conversationReference)
return memory
Expand All @@ -52,7 +52,7 @@ export class CLMemory {
if (!CLMemory.memoryStorage) {
throw new Error('Memory storage not found')
}

let key = this.Key(datakey)
let cacheData = this.memCache[key]
if (cacheData) {
Expand Down
2 changes: 1 addition & 1 deletion src/CLOptions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
export interface ICLOptions {
Expand Down
2 changes: 1 addition & 1 deletion src/CLRecognizeResult.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { CLMemory } from './CLMemory'
Expand Down
Loading