• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

microsoft / botbuilder-js / 5623363648

pending completion
5623363648

push

github

web-flow
chore(deps): bump word-wrap (#4507)

Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

9840 of 12825 branches covered (76.73%)

Branch coverage included in aggregate %.

20125 of 22483 relevant lines covered (89.51%)

7228.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

20.0
/libraries/botbuilder-dialogs-adaptive/src/actions/sendHandoffActivity.ts
1
// Copyright (c) Microsoft Corporation.
2
// Licensed under the MIT License.
3

4
/**
5
 * @module botbuilder-dialogs-adaptive
6
 */
7

8
import { EventFactory, ResourceResponse, Transcript } from 'botbuilder';
2✔
9
import { ObjectExpression, ObjectExpressionConverter } from 'adaptive-expressions';
2✔
10
import { ObjectProperty } from '../properties';
11

12
import {
2✔
13
    Converter,
14
    ConverterFactory,
15
    Dialog,
16
    DialogConfiguration,
17
    DialogContext,
18
    DialogTurnResult,
19
} from 'botbuilder-dialogs';
20

21
export interface SendHandoffActivityConfiguration extends DialogConfiguration {
22
    context?: ObjectProperty<Record<string, unknown>>;
23
    transcript?: ObjectProperty<Transcript>;
24
}
25

26
/**
27
 * Sends a handoff activity. Note that this is a single turn/step dialog (i.e. it calls
28
 * this.endDialog).
29
 */
30
export class SendHandoffActivity extends Dialog implements SendHandoffActivityConfiguration {
2✔
31
    static $kind = 'Microsoft.SendHandoffActivity';
2✔
32

33
    /**
34
     * Context to send with handoff activity
35
     */
36
    context: ObjectExpression<Record<string, unknown>>;
37

38
    /**
39
     * Transcript to send with handoff activity
40
     */
41
    transcript: ObjectExpression<Transcript>;
42

43
    /**
44
     * @param property The key of the conditional selector configuration.
45
     * @returns The converter for the selector configuration.
46
     */
47
    getConverter(property: keyof SendHandoffActivityConfiguration): Converter | ConverterFactory {
48
        switch (property) {
×
49
            case 'context':
×
50
                return new ObjectExpressionConverter<Record<string, unknown>>();
×
51
            case 'transcript':
52
                return new ObjectExpressionConverter<Transcript>();
×
53
            default:
54
                return super.getConverter(property);
×
55
        }
56
    }
57

58
    /**
59
     * Starts a new [Dialog](xref:botbuilder-dialogs.Dialog) and pushes it onto the dialog stack.
60
     *
61
     * @param {DialogContext} dc dialog context
62
     * @returns {Promise<DialogTurnResult<ResourceResponse>>} result of sending handoff activity
63
     */
64
    async beginDialog(dc: DialogContext): Promise<DialogTurnResult<ResourceResponse>> {
65
        const context = this.context?.getValue(dc.state);
×
66
        const transcript = this.transcript?.getValue(dc.state);
×
67

68
        const activity = EventFactory.createHandoffInitiation(dc.context, context, transcript);
×
69
        const response = await dc.context.sendActivity(activity);
×
70

71
        return dc.endDialog(response);
×
72
    }
73
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc