Skip to content

Commit 7c0f24c

Browse files
Merge pull request #210 from watson-developer-cloud/dep-ups
build: update dependencies
2 parents 7dd9798 + 8990edd commit 7c0f24c

31 files changed

+5353
-4382
lines changed

.eslintignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
lib
2-
examples
2+
examples
3+
coverage
4+
test

lib/index.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/index.d.ts

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
* Copyright 2016-2019 IBM Corp. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
import Botkit = require('botkit');
17+
import AssistantV1 = require('ibm-watson/assistant/v1');
18+
import { MessageParams, MessageResponse } from 'ibm-watson/assistant/v1';
19+
import { Context } from 'ibm-watson/assistant/v1';
20+
import { BotkitMessage } from 'botkit';
21+
export interface WatsonMiddlewareConfig extends AssistantV1.Options {
22+
workspace_id: string;
23+
minimum_confidence?: number;
24+
}
25+
/**
26+
* @deprecated please use AssistantV1.MessageParams instead
27+
*/
28+
export declare type Payload = MessageParams;
29+
export declare type BotkitWatsonMessage = BotkitMessage & {
30+
watsonData?: MessageResponse;
31+
watsonError?: string;
32+
};
33+
export interface ContextDelta {
34+
[index: string]: any;
35+
}
36+
export declare class WatsonMiddleware {
37+
private readonly config;
38+
private conversation;
39+
private storage;
40+
private readonly minimumConfidence;
41+
private readonly ignoreType;
42+
constructor(config: WatsonMiddlewareConfig);
43+
hear(patterns: string[], message: Botkit.BotkitMessage): boolean;
44+
before(message: Botkit.BotkitMessage, payload: MessageParams): Promise<MessageParams>;
45+
after(message: Botkit.BotkitMessage, response: MessageResponse): Promise<MessageResponse>;
46+
sendToWatson(bot: Botkit.BotWorker, message: Botkit.BotkitMessage, contextDelta: ContextDelta): Promise<void>;
47+
receive(bot: Botkit.BotWorker, message: Botkit.BotkitMessage): Promise<void>;
48+
interpret(bot: Botkit.BotWorker, message: Botkit.BotkitMessage): Promise<void>;
49+
readContext(user: string): Promise<Context>;
50+
updateContext(user: string, context: Context): Promise<{
51+
context: Context;
52+
}>;
53+
deleteUserData(customerId: string): Promise<void>;
54+
}

lib/src/index.js

Lines changed: 175 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)