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

microsoft / botbuilder-js / 11579379955

29 Oct 2024 05:34PM UTC coverage: 84.703% (-0.5%) from 85.23%
11579379955

push

github

web-flow
refactor: [#4684] Replace browserify with tsup (#4774)

* Replace browserify with tsup in adaptive-expressions

* Remove remaining browserify packages

* Fix streaming tests

* Fix yarn.lock

* fix depcheck

8186 of 10820 branches covered (75.66%)

Branch coverage included in aggregate %.

2 of 2 new or added lines in 1 file covered. (100.0%)

23 existing lines in 13 files now uncovered.

20514 of 23063 relevant lines covered (88.95%)

7296.87 hits per line

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

77.78
/libraries/botframework-streaming/src/disassemblers/responseDisassembler.ts
1
/**
8✔
2
 * @module botframework-streaming
3
 */
4
/**
5
 * Copyright (c) Microsoft Corporation. All rights reserved.
6
 * Licensed under the MIT License.
7
 */
8
import { PayloadTypes } from '../payloads/payloadTypes';
2✔
9
import { PayloadSender } from '../payloadTransport/payloadSender';
10
import { StreamingResponse } from '../streamingResponse';
11
import { PayloadDisassembler } from './payloadDisassembler';
2✔
12
import { IResponsePayload, IStreamWrapper } from '../interfaces';
13

14
/**
15
 * Streaming response disassembler.
16
 */
17
export class ResponseDisassembler extends PayloadDisassembler {
2✔
18
    readonly response: StreamingResponse;
19
    readonly payloadType: PayloadTypes = PayloadTypes.response;
14✔
20

21
    /**
22
     * Initializes a new instance of the [ResponseDisassembler](xref:botframework-streaming.ResponseDisassembler) class.
23
     *
24
     * @param sender The [PayloadSender](xref:botframework-streaming.PayloadSender) to send the disassembled data to.
25
     * @param id The ID of this disassembler.
26
     * @param response The response to be disassembled.
27
     */
28
    constructor(sender: PayloadSender, id: string, response: StreamingResponse) {
29
        super(sender, id);
14✔
30
        this.response = response;
14✔
31
    }
32

33
    /**
34
     * Gets the stream this disassembler is operating on.
35
     *
36
     * @returns An [IStreamWrapper](xref:botframework-streaming.IStreamWrapper) with a Subscribable Stream.
37
     */
UNCOV
38
    async getStream(): Promise<IStreamWrapper> {
×
39
        const payload: IResponsePayload = { statusCode: this.response.statusCode, streams: [] };
14✔
40

41
        this.response.streams?.forEach(({ description }) => {
14!
42
            payload.streams.push({
16✔
43
                id: description.id,
44
                contentType: description.type,
45
                length: description.length,
46
            });
47
        });
48

49
        return PayloadDisassembler.serialize(payload);
14✔
50
    }
51
}
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