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

microsoft / botbuilder-js / 11579384597

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

push

github

web-flow
chore(deps): bump http-proxy-middleware from 2.0.6 to 2.0.7 (#4778)

Bumps [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) from 2.0.6 to 2.0.7.
- [Release notes](https://github.com/chimurai/http-proxy-middleware/releases)
- [Changelog](https://github.com/chimurai/http-proxy-middleware/blob/v2.0.7/CHANGELOG.md)
- [Commits](https://github.com/chimurai/http-proxy-middleware/compare/v2.0.6...v2.0.7)

---
updated-dependencies:
- dependency-name: http-proxy-middleware
  dependency-type: indirect
...

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

8186 of 10820 branches covered (75.66%)

Branch coverage included in aggregate %.

20514 of 23063 relevant lines covered (88.95%)

7283.44 hits per line

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

87.5
/libraries/botframework-streaming/src/disassemblers/payloadDisassembler.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';
9
import { PayloadSender } from '../payloadTransport';
10
import { SubscribableStream } from '../subscribableStream';
2✔
11
import { IStreamWrapper } from '../interfaces';
12

13
/**
14
 * Base class streaming payload disassembling.
15
 */
16
export abstract class PayloadDisassembler {
2✔
17
    abstract payloadType: PayloadTypes;
18
    private stream: SubscribableStream;
19
    private streamLength?: number;
20

21
    /**
22
     * Initializes a new instance of the [PayloadDisassembler](xref:botframework-streaming.PayloadDisassembler) class.
23
     *
24
     * @param sender The [PayloadSender](xref:botframework-streaming.PayloadSender) used to send the disassembled payload chunks.
25
     * @param id The ID of this disassembler.
26
     */
27
    constructor(private readonly sender: PayloadSender, private readonly id: string) {}
74✔
28

29
    /**
30
     * Serializes the item into the [IStreamWrapper](xref:botframework-streaming.IStreamWrapper) that exposes the stream and length of the result.
31
     *
32
     * @param item The item to be serialized.
33
     * @returns The stream containing the serialized item and the length of the stream.
34
     */
35
    protected static serialize<T>(item: T): IStreamWrapper {
36
        const stream: SubscribableStream = new SubscribableStream();
38✔
37

38
        stream.write(JSON.stringify(item));
38✔
39
        stream.end();
38✔
40

41
        return { stream, streamLength: stream.length };
38✔
42
    }
43

44
    /**
45
     * Gets the stream this disassembler is operating on.
46
     *
47
     * @returns An [IStreamWrapper](xref:botframework-streaming.IStreamWrapper) with a Subscribable Stream.
48
     */
49
    abstract getStream(): Promise<IStreamWrapper>;
50

51
    /**
52
     * Begins the process of disassembling a payload and sending the resulting chunks to the [PayloadSender](xref:botframework-streaming.PayloadSender) to dispatch over the transport.
53
     *
54
     * @returns A completed Promise after the disassembled payload has been sent.
55
     */
56
    async disassemble(): Promise<void> {
×
57
        const { stream, streamLength } = await this.getStream();
72✔
58

59
        this.stream = stream;
72✔
60
        this.streamLength = streamLength;
72✔
61

62
        return this.send();
72✔
63
    }
64

65
    /**
66
     * Begins the process of disassembling a payload and signals the [PayloadSender](xref:botframework-streaming.PayloadSender).
67
     */
68
    private async send(): Promise<void> {
×
69
        const header = {
72✔
70
            payloadType: this.payloadType,
71
            payloadLength: this.streamLength,
72
            id: this.id,
73
            end: true,
74
        };
75
        this.sender.sendPayload(header, this.stream);
72✔
76
    }
77
}
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