botbuilder-core
Advanced tools
Comparing version 4.10.0-rc0 to 4.11.0-dev.20200812.fa3e1c9
@@ -266,2 +266,26 @@ /** | ||
/** | ||
* Registers an activity event handler for the _installationupdate add_ activity. | ||
* | ||
* @param handler The event handler. | ||
* | ||
* @remarks | ||
* Returns a reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. | ||
* | ||
* To handle a InstallationUpdateAdd event, use the | ||
* [onInstallationUpdateAdd](xref:botbuilder-core.ActivityHandler.onInstallationUpdateAdd) type-specific event handler. | ||
*/ | ||
onInstallationUpdateAdd(handler: BotHandler): this; | ||
/** | ||
* Registers an activity event handler for the _installationupdate remove_ activity. | ||
* | ||
* @param handler The event handler. | ||
* | ||
* @remarks | ||
* Returns a reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. | ||
* | ||
* To handle a InstallationUpdateRemove event, use the | ||
* [onInstallationUpdateRemove](xref:botbuilder-core.ActivityHandler.onInstallationUpdateRemove) type-specific event handler. | ||
*/ | ||
onInstallationUpdateRemove(handler: BotHandler): this; | ||
/** | ||
* Registers an activity event handler for the _tokens-response_ event, emitted for any incoming | ||
@@ -404,2 +428,43 @@ * `tokens/response` event activity. These are generated as part of the OAuth authentication flow. | ||
/** | ||
* Runs the _installation update_ sub-type handlers, as appropriate, and then continues the event emission process. | ||
* | ||
* @param context The context object for the current turn. | ||
* | ||
* @remarks | ||
* Overwrite this method to support channel-specific behavior across multiple channels or to add | ||
* custom conversation update sub-type events. | ||
* | ||
* The default logic is: | ||
* - If any members were added, call handlers registered via [onMembersAdded](xref:botbuilder-core.ActivityHandler.onMembersAdded). | ||
* - If any members were removed, call handlers registered via [onMembersRemoved](xref:botbuilder-core.ActivityHandler.onMembersRemoved). | ||
* - Continue by calling [defaultNextEvent](xref:botbuilder-core.ActivityHandler.defaultNextEvent). | ||
*/ | ||
protected dispatchInstallationUpdateActivity(context: TurnContext): Promise<void>; | ||
/** | ||
* Runs all registered _installation update add_ handlers and then continues the event emission process. | ||
* | ||
* @param context The context object for the current turn. | ||
* | ||
* @remarks | ||
* Overwrite this method to support channel-specific behavior across multiple channels. | ||
* | ||
* The default logic is to call any handlers registered via | ||
* [onInstallationUpdateAdd](xref:botbuilder-core.ActivityHandler.onInstallationUpdateAdd), | ||
* and then continue by calling [defaultNextEvent](xref:botbuilder-core.ActivityHandler.defaultNextEvent). | ||
*/ | ||
protected onInstallationUpdateAddActivity(context: TurnContext): Promise<void>; | ||
/** | ||
* Runs all registered _installation update remove_ handlers and then continues the event emission process. | ||
* | ||
* @param context The context object for the current turn. | ||
* | ||
* @remarks | ||
* Overwrite this method to support channel-specific behavior across multiple channels. | ||
* | ||
* The default logic is to call any handlers registered via | ||
* [onInstallationUpdateRemove](xref:botbuilder-core.ActivityHandler.onInstallationUpdateRemove), | ||
* and then continue by calling [defaultNextEvent](xref:botbuilder-core.ActivityHandler.defaultNextEvent). | ||
*/ | ||
protected onInstallationUpdateRemoveActivity(context: TurnContext): Promise<void>; | ||
/** | ||
* Runs all registered _unrecognized activity type_ handlers and then continues the event emission process. | ||
@@ -406,0 +471,0 @@ * |
@@ -279,2 +279,30 @@ "use strict"; | ||
/** | ||
* Registers an activity event handler for the _installationupdate add_ activity. | ||
* | ||
* @param handler The event handler. | ||
* | ||
* @remarks | ||
* Returns a reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. | ||
* | ||
* To handle a InstallationUpdateAdd event, use the | ||
* [onInstallationUpdateAdd](xref:botbuilder-core.ActivityHandler.onInstallationUpdateAdd) type-specific event handler. | ||
*/ | ||
onInstallationUpdateAdd(handler) { | ||
return this.on('InstallationUpdateAdd', handler); | ||
} | ||
/** | ||
* Registers an activity event handler for the _installationupdate remove_ activity. | ||
* | ||
* @param handler The event handler. | ||
* | ||
* @remarks | ||
* Returns a reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. | ||
* | ||
* To handle a InstallationUpdateRemove event, use the | ||
* [onInstallationUpdateRemove](xref:botbuilder-core.ActivityHandler.onInstallationUpdateRemove) type-specific event handler. | ||
*/ | ||
onInstallationUpdateRemove(handler) { | ||
return this.on('InstallationUpdateRemove', handler); | ||
} | ||
/** | ||
* Registers an activity event handler for the _tokens-response_ event, emitted for any incoming | ||
@@ -516,6 +544,69 @@ * `tokens/response` event activity. These are generated as part of the OAuth authentication flow. | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield this.handle(context, 'InstallationUpdate', this.defaultNextEvent(context)); | ||
yield this.handle(context, 'InstallationUpdate', () => __awaiter(this, void 0, void 0, function* () { | ||
yield this.dispatchInstallationUpdateActivity(context); | ||
})); | ||
}); | ||
} | ||
/** | ||
* Runs the _installation update_ sub-type handlers, as appropriate, and then continues the event emission process. | ||
* | ||
* @param context The context object for the current turn. | ||
* | ||
* @remarks | ||
* Overwrite this method to support channel-specific behavior across multiple channels or to add | ||
* custom conversation update sub-type events. | ||
* | ||
* The default logic is: | ||
* - If any members were added, call handlers registered via [onMembersAdded](xref:botbuilder-core.ActivityHandler.onMembersAdded). | ||
* - If any members were removed, call handlers registered via [onMembersRemoved](xref:botbuilder-core.ActivityHandler.onMembersRemoved). | ||
* - Continue by calling [defaultNextEvent](xref:botbuilder-core.ActivityHandler.defaultNextEvent). | ||
*/ | ||
dispatchInstallationUpdateActivity(context) { | ||
const _super = Object.create(null, { | ||
onInstallationUpdateActivity: { get: () => super.onInstallationUpdateActivity } | ||
}); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (context.activity.action == 'add' || context.activity.action == 'remove') { | ||
yield _super.onInstallationUpdateActivity.call(this, context); | ||
} | ||
else { | ||
yield this.defaultNextEvent(context)(); | ||
} | ||
}); | ||
} | ||
/** | ||
* Runs all registered _installation update add_ handlers and then continues the event emission process. | ||
* | ||
* @param context The context object for the current turn. | ||
* | ||
* @remarks | ||
* Overwrite this method to support channel-specific behavior across multiple channels. | ||
* | ||
* The default logic is to call any handlers registered via | ||
* [onInstallationUpdateAdd](xref:botbuilder-core.ActivityHandler.onInstallationUpdateAdd), | ||
* and then continue by calling [defaultNextEvent](xref:botbuilder-core.ActivityHandler.defaultNextEvent). | ||
*/ | ||
onInstallationUpdateAddActivity(context) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield this.handle(context, 'InstallationUpdateAdd', this.defaultNextEvent(context)); | ||
}); | ||
} | ||
/** | ||
* Runs all registered _installation update remove_ handlers and then continues the event emission process. | ||
* | ||
* @param context The context object for the current turn. | ||
* | ||
* @remarks | ||
* Overwrite this method to support channel-specific behavior across multiple channels. | ||
* | ||
* The default logic is to call any handlers registered via | ||
* [onInstallationUpdateRemove](xref:botbuilder-core.ActivityHandler.onInstallationUpdateRemove), | ||
* and then continue by calling [defaultNextEvent](xref:botbuilder-core.ActivityHandler.defaultNextEvent). | ||
*/ | ||
onInstallationUpdateRemoveActivity(context) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield this.handle(context, 'InstallationUpdateRemove', this.defaultNextEvent(context)); | ||
}); | ||
} | ||
/** | ||
* Runs all registered _unrecognized activity type_ handlers and then continues the event emission process. | ||
@@ -522,0 +613,0 @@ * |
@@ -140,2 +140,22 @@ /** | ||
/** | ||
* Provides a hook for emitting the _installationupdateadd_ event. | ||
* | ||
* @param context The context object for the current turn. | ||
* | ||
* @remarks | ||
* Overwrite this method to run registered _installationupdateadd_ handlers and then continue the event | ||
* emission process. | ||
*/ | ||
protected onInstallationUpdateAddActivity(context: TurnContext): Promise<void>; | ||
/** | ||
* Provides a hook for emitting the _installationupdateremove_ event. | ||
* | ||
* @param context The context object for the current turn. | ||
* | ||
* @remarks | ||
* Overwrite this method to run registered _installationupdateremove_ handlers and then continue the event | ||
* emission process. | ||
*/ | ||
protected onInstallationUpdateRemoveActivity(context: TurnContext): Promise<void>; | ||
/** | ||
* Provides a hook for emitting the _unrecognized_ event. | ||
@@ -142,0 +162,0 @@ * |
@@ -230,2 +230,23 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
switch (context.activity.action) { | ||
case 'add': | ||
yield this.onInstallationUpdateAddActivity(context); | ||
return; | ||
case 'remove': | ||
yield this.onInstallationUpdateRemoveActivity(context); | ||
return; | ||
} | ||
}); | ||
} | ||
/** | ||
* Provides a hook for emitting the _installationupdateadd_ event. | ||
* | ||
* @param context The context object for the current turn. | ||
* | ||
* @remarks | ||
* Overwrite this method to run registered _installationupdateadd_ handlers and then continue the event | ||
* emission process. | ||
*/ | ||
onInstallationUpdateAddActivity(context) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return; | ||
@@ -235,2 +256,16 @@ }); | ||
/** | ||
* Provides a hook for emitting the _installationupdateremove_ event. | ||
* | ||
* @param context The context object for the current turn. | ||
* | ||
* @remarks | ||
* Overwrite this method to run registered _installationupdateremove_ handlers and then continue the event | ||
* emission process. | ||
*/ | ||
onInstallationUpdateRemoveActivity(context) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return; | ||
}); | ||
} | ||
/** | ||
* Provides a hook for emitting the _unrecognized_ event. | ||
@@ -237,0 +272,0 @@ * |
@@ -5,3 +5,3 @@ { | ||
"description": "Core components for Microsoft Bot Builder. Components in this library can run either in a browser or on the server.", | ||
"version": "4.10.0-rc0", | ||
"version": "4.11.0-dev.20200812.fa3e1c9", | ||
"license": "MIT", | ||
@@ -25,3 +25,3 @@ "keywords": [ | ||
"assert": "^1.4.1", | ||
"botframework-schema": "4.10.0-rc0" | ||
"botframework-schema": "4.11.0-dev.20200812.fa3e1c9" | ||
}, | ||
@@ -44,3 +44,3 @@ "devDependencies": { | ||
"clean": "erase /q /s .\\lib", | ||
"set-version": "npm version --allow-same-version 4.10.0-rc0", | ||
"set-version": "npm version --allow-same-version 4.11.0-dev.20200812.fa3e1c9", | ||
"test": "tsc && nyc mocha tests/", | ||
@@ -47,0 +47,0 @@ "test:compat": "api-extractor run --verbose" |
@@ -306,2 +306,32 @@ /** | ||
/** | ||
* Registers an activity event handler for the _installationupdate add_ activity. | ||
* | ||
* @param handler The event handler. | ||
* | ||
* @remarks | ||
* Returns a reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. | ||
* | ||
* To handle a InstallationUpdateAdd event, use the | ||
* [onInstallationUpdateAdd](xref:botbuilder-core.ActivityHandler.onInstallationUpdateAdd) type-specific event handler. | ||
*/ | ||
public onInstallationUpdateAdd(handler: BotHandler): this { | ||
return this.on('InstallationUpdateAdd', handler); | ||
} | ||
/** | ||
* Registers an activity event handler for the _installationupdate remove_ activity. | ||
* | ||
* @param handler The event handler. | ||
* | ||
* @remarks | ||
* Returns a reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object. | ||
* | ||
* To handle a InstallationUpdateRemove event, use the | ||
* [onInstallationUpdateRemove](xref:botbuilder-core.ActivityHandler.onInstallationUpdateRemove) type-specific event handler. | ||
*/ | ||
public onInstallationUpdateRemove(handler: BotHandler): this { | ||
return this.on('InstallationUpdateRemove', handler); | ||
} | ||
/** | ||
* Registers an activity event handler for the _tokens-response_ event, emitted for any incoming | ||
@@ -530,6 +560,62 @@ * `tokens/response` event activity. These are generated as part of the OAuth authentication flow. | ||
protected async onInstallationUpdateActivity(context: TurnContext): Promise<void> { | ||
await this.handle(context, 'InstallationUpdate', this.defaultNextEvent(context)); | ||
await this.handle(context, 'InstallationUpdate', async () => { | ||
await this.dispatchInstallationUpdateActivity(context); | ||
}); | ||
} | ||
/** | ||
* Runs the _installation update_ sub-type handlers, as appropriate, and then continues the event emission process. | ||
* | ||
* @param context The context object for the current turn. | ||
* | ||
* @remarks | ||
* Overwrite this method to support channel-specific behavior across multiple channels or to add | ||
* custom conversation update sub-type events. | ||
* | ||
* The default logic is: | ||
* - If any members were added, call handlers registered via [onMembersAdded](xref:botbuilder-core.ActivityHandler.onMembersAdded). | ||
* - If any members were removed, call handlers registered via [onMembersRemoved](xref:botbuilder-core.ActivityHandler.onMembersRemoved). | ||
* - Continue by calling [defaultNextEvent](xref:botbuilder-core.ActivityHandler.defaultNextEvent). | ||
*/ | ||
protected async dispatchInstallationUpdateActivity(context: TurnContext): Promise<void> { | ||
if (context.activity.action == 'add' || context.activity.action == 'remove') { | ||
await super.onInstallationUpdateActivity(context); | ||
} else { | ||
await this.defaultNextEvent(context)(); | ||
} | ||
} | ||
/** | ||
* Runs all registered _installation update add_ handlers and then continues the event emission process. | ||
* | ||
* @param context The context object for the current turn. | ||
* | ||
* @remarks | ||
* Overwrite this method to support channel-specific behavior across multiple channels. | ||
* | ||
* The default logic is to call any handlers registered via | ||
* [onInstallationUpdateAdd](xref:botbuilder-core.ActivityHandler.onInstallationUpdateAdd), | ||
* and then continue by calling [defaultNextEvent](xref:botbuilder-core.ActivityHandler.defaultNextEvent). | ||
*/ | ||
protected async onInstallationUpdateAddActivity(context: TurnContext): Promise<void> { | ||
await this.handle(context, 'InstallationUpdateAdd', this.defaultNextEvent(context)); | ||
} | ||
/** | ||
* Runs all registered _installation update remove_ handlers and then continues the event emission process. | ||
* | ||
* @param context The context object for the current turn. | ||
* | ||
* @remarks | ||
* Overwrite this method to support channel-specific behavior across multiple channels. | ||
* | ||
* The default logic is to call any handlers registered via | ||
* [onInstallationUpdateRemove](xref:botbuilder-core.ActivityHandler.onInstallationUpdateRemove), | ||
* and then continue by calling [defaultNextEvent](xref:botbuilder-core.ActivityHandler.defaultNextEvent). | ||
*/ | ||
protected async onInstallationUpdateRemoveActivity(context: TurnContext): Promise<void> { | ||
await this.handle(context, 'InstallationUpdateRemove', this.defaultNextEvent(context)); | ||
} | ||
/** | ||
* Runs all registered _unrecognized activity type_ handlers and then continues the event emission process. | ||
@@ -536,0 +622,0 @@ * |
@@ -216,2 +216,22 @@ /** | ||
protected async onInstallationUpdateActivity(context: TurnContext): Promise<void> { | ||
switch (context.activity.action) { | ||
case 'add': | ||
await this.onInstallationUpdateAddActivity(context); | ||
return; | ||
case 'remove': | ||
await this.onInstallationUpdateRemoveActivity(context); | ||
return | ||
} | ||
} | ||
/** | ||
* Provides a hook for emitting the _installationupdateadd_ event. | ||
* | ||
* @param context The context object for the current turn. | ||
* | ||
* @remarks | ||
* Overwrite this method to run registered _installationupdateadd_ handlers and then continue the event | ||
* emission process. | ||
*/ | ||
protected async onInstallationUpdateAddActivity(context: TurnContext): Promise<void> { | ||
return; | ||
@@ -221,2 +241,15 @@ } | ||
/** | ||
* Provides a hook for emitting the _installationupdateremove_ event. | ||
* | ||
* @param context The context object for the current turn. | ||
* | ||
* @remarks | ||
* Overwrite this method to run registered _installationupdateremove_ handlers and then continue the event | ||
* emission process. | ||
*/ | ||
protected async onInstallationUpdateRemoveActivity(context: TurnContext): Promise<void> { | ||
return; | ||
} | ||
/** | ||
* Provides a hook for emitting the _unrecognized_ event. | ||
@@ -223,0 +256,0 @@ * |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
810663
15866
+ Addedbotframework-schema@4.11.0-dev.20200812.fa3e1c9(transitive)
- Removedbotframework-schema@4.10.0-rc0(transitive)