Skip to content

Commit 42e366d

Browse files
DanieladuStevenic
andauthored
API naming for LG (#1883)
* rename lg * rename templates property to items * rename * rename * Updated Templates to look like a collection * Fixed unit tests Co-authored-by: Steven Ickman <stevenic@microsoft.com>
1 parent 4d5b305 commit 42e366d

35 files changed

+1586
-1542
lines changed

libraries/botbuilder-core/src/activityFactory.ts

Lines changed: 618 additions & 0 deletions
Large diffs are not rendered by default.

libraries/botbuilder-core/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88

99
export * from 'botframework-schema';
10+
export * from './activityFactory';
1011
export * from './appCredentials';
1112
export * from './activityHandler';
1213
export * from './activityHandlerBase';

libraries/botbuilder-lg/README.MD

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,19 @@ For NodeJS, add botbuilder-lg
9494
Load the template manager with your .lg file
9595

9696
```typescript
97-
let lgFile = new LGParser.parseFile(filePath, importResolver?, expressionParser?);
97+
let templates = new Templates.parseFile(filePath, importResolver?, expressionParser?);
9898
```
9999
100-
When you need template expansion, call the LGFile and pass in the relevant template name
100+
When you need template expansion, call the templates and pass in the relevant template name
101101
102102
```typescript
103-
await turnContext.sendActivity(lgFile.evaluateTemplate("<TemplateName>", entitiesCollection));
103+
await turnContext.sendActivity(templates.evaluate("<TemplateName>", entitiesCollection));
104104
```
105105
106106
If your template needs specific entity values to be passed for resolution/ expansion, you can pass them in on the call to `evaluateTemplate`
107107
108108
```typescript
109-
await turnContext.sendActivity(lgFile.evaluateTemplate("WordGameReply", { GameName = "MarcoPolo" } ));
109+
await turnContext.sendActivity(templates.evaluate("WordGameReply", { GameName = "MarcoPolo" } ));
110110
```
111111
112112
[1]:https://github.com/Microsoft/BotBuilder/blob/master/specs/botframework-activity/botframework-activity.md

libraries/botbuilder-lg/src/activityChecker.ts

Lines changed: 0 additions & 320 deletions
This file was deleted.

0 commit comments

Comments
 (0)