camstreamerlib 4.0.0-beta.2 → 4.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/CamOverlayAPI.js +176 -0
- package/cjs/CamOverlayDrawingAPI.js +235 -0
- package/cjs/CamOverlayPainter/Frame.js +301 -0
- package/{CamOverlayPainter → cjs/CamOverlayPainter}/Painter.d.ts +14 -3
- package/cjs/CamOverlayPainter/Painter.js +171 -0
- package/cjs/CamOverlayPainter/ResourceManager.js +46 -0
- package/cjs/CamScripterAPI.js +70 -0
- package/cjs/CamScripterAPICameraEventsGenerator.js +162 -0
- package/cjs/CamStreamerAPI.js +65 -0
- package/{CamSwitcherAPI.d.ts → cjs/CamSwitcherAPI.d.ts} +3 -3
- package/cjs/CamSwitcherAPI.js +350 -0
- package/{CamSwitcherEvents.d.ts → cjs/CamSwitcherEvents.d.ts} +1 -1
- package/cjs/CamSwitcherEvents.js +67 -0
- package/cjs/CreatePackage.js +106 -0
- package/{VapixAPI.d.ts → cjs/VapixAPI.d.ts} +9 -9
- package/cjs/VapixAPI.js +462 -0
- package/cjs/VapixEvents.js +88 -0
- package/cjs/errors/errors.js +79 -0
- package/cjs/events/AxisCameraStationEvents.js +48 -0
- package/cjs/events/GenetecAgent.js +123 -0
- package/cjs/index.d.ts +11 -0
- package/cjs/index.js +31 -0
- package/cjs/internal/Digest.js +42 -0
- package/cjs/internal/ProxyClient.js +44 -0
- package/{internal → cjs/internal}/common.d.ts +0 -1
- package/cjs/internal/common.js +27 -0
- package/cjs/internal/constants.js +4 -0
- package/cjs/internal/transformers.js +32 -0
- package/cjs/internal/utils.js +46 -0
- package/cjs/internal/versionCompare.js +53 -0
- package/cjs/node/DefaultClient.js +54 -0
- package/cjs/node/HttpRequestSender.js +89 -0
- package/cjs/node/HttpServer.js +96 -0
- package/cjs/node/WsClient.js +149 -0
- package/cjs/node/WsEventClient.js +22 -0
- package/cjs/node/index.d.ts +2 -0
- package/cjs/node/index.js +7 -0
- package/cjs/types/CamOverlayAPI.js +47 -0
- package/cjs/types/CamScripterAPI.js +20 -0
- package/cjs/types/CamStreamerAPI.js +28 -0
- package/cjs/types/CamSwitcherAPI.js +137 -0
- package/cjs/types/CamSwitcherEvents.js +62 -0
- package/{types → cjs/types}/VapixAPI.d.ts +40 -61
- package/cjs/types/VapixAPI.js +130 -0
- package/cjs/types/common.js +14 -0
- package/cjs/web/DefaultClient.js +20 -0
- package/cjs/web/WsClient.js +62 -0
- package/cjs/web/index.d.ts +2 -0
- package/cjs/web/index.js +7 -0
- package/esm/CamOverlayAPI.d.ts +31 -0
- package/esm/CamOverlayDrawingAPI.d.ts +86 -0
- package/{CamOverlayDrawingAPI.js → esm/CamOverlayDrawingAPI.js} +6 -3
- package/esm/CamOverlayPainter/Frame.d.ts +96 -0
- package/esm/CamOverlayPainter/Painter.d.ts +48 -0
- package/{CamOverlayPainter → esm/CamOverlayPainter}/Painter.js +4 -1
- package/esm/CamOverlayPainter/ResourceManager.d.ts +14 -0
- package/{CamOverlayPainter → esm/CamOverlayPainter}/ResourceManager.js +6 -10
- package/esm/CamScripterAPI.d.ts +19 -0
- package/esm/CamScripterAPICameraEventsGenerator.d.ts +74 -0
- package/{CamScripterAPICameraEventsGenerator.js → esm/CamScripterAPICameraEventsGenerator.js} +6 -3
- package/esm/CamStreamerAPI.d.ts +16 -0
- package/esm/CamSwitcherAPI.d.ts +48 -0
- package/{CamSwitcherAPI.js → esm/CamSwitcherAPI.js} +19 -23
- package/esm/CamSwitcherEvents.d.ts +18 -0
- package/{CamSwitcherEvents.js → esm/CamSwitcherEvents.js} +1 -1
- package/esm/CreatePackage.d.ts +1 -0
- package/esm/VapixAPI.d.ts +66 -0
- package/{VapixAPI.js → esm/VapixAPI.js} +20 -16
- package/esm/VapixEvents.d.ts +43 -0
- package/{VapixEvents.js → esm/VapixEvents.js} +3 -3
- package/esm/errors/errors.d.ts +34 -0
- package/esm/events/AxisCameraStationEvents.d.ts +9 -0
- package/esm/events/GenetecAgent.d.ts +174 -0
- package/esm/index.d.ts +11 -0
- package/esm/index.js +11 -0
- package/esm/internal/Digest.d.ts +4 -0
- package/{internal → esm/internal}/Digest.js +6 -6
- package/esm/internal/ProxyClient.d.ts +11 -0
- package/esm/internal/common.d.ts +39 -0
- package/{internal → esm/internal}/common.js +0 -3
- package/esm/internal/constants.d.ts +1 -0
- package/esm/internal/transformers.d.ts +5 -0
- package/esm/internal/utils.d.ts +11 -0
- package/esm/internal/versionCompare.d.ts +6 -0
- package/esm/node/DefaultClient.d.ts +15 -0
- package/{node → esm/node}/DefaultClient.js +1 -1
- package/esm/node/HttpRequestSender.d.ts +28 -0
- package/esm/node/HttpServer.d.ts +21 -0
- package/{node → esm/node}/HttpServer.js +1 -1
- package/esm/node/WsClient.d.ts +39 -0
- package/esm/node/WsEventClient.d.ts +13 -0
- package/esm/node/index.d.ts +2 -0
- package/esm/node/index.js +2 -0
- package/esm/types/CamOverlayAPI.d.ts +188 -0
- package/esm/types/CamScripterAPI.d.ts +67 -0
- package/esm/types/CamStreamerAPI.d.ts +139 -0
- package/esm/types/CamSwitcherAPI.d.ts +814 -0
- package/esm/types/CamSwitcherEvents.d.ts +491 -0
- package/esm/types/VapixAPI.d.ts +1683 -0
- package/{types → esm/types}/VapixAPI.js +10 -12
- package/esm/types/common.d.ts +37 -0
- package/esm/web/DefaultClient.d.ts +6 -0
- package/esm/web/WsClient.d.ts +13 -0
- package/esm/web/index.d.ts +2 -0
- package/esm/web/index.js +2 -0
- package/package.json +6 -5
- package/README.md +0 -97
- /package/{CamOverlayAPI.d.ts → cjs/CamOverlayAPI.d.ts} +0 -0
- /package/{CamOverlayDrawingAPI.d.ts → cjs/CamOverlayDrawingAPI.d.ts} +0 -0
- /package/{CamOverlayPainter → cjs/CamOverlayPainter}/Frame.d.ts +0 -0
- /package/{CamOverlayPainter → cjs/CamOverlayPainter}/ResourceManager.d.ts +0 -0
- /package/{CamScripterAPI.d.ts → cjs/CamScripterAPI.d.ts} +0 -0
- /package/{CamScripterAPICameraEventsGenerator.d.ts → cjs/CamScripterAPICameraEventsGenerator.d.ts} +0 -0
- /package/{CamStreamerAPI.d.ts → cjs/CamStreamerAPI.d.ts} +0 -0
- /package/{CreatePackage.d.ts → cjs/CreatePackage.d.ts} +0 -0
- /package/{VapixEvents.d.ts → cjs/VapixEvents.d.ts} +0 -0
- /package/{errors → cjs/errors}/errors.d.ts +0 -0
- /package/{events → cjs/events}/AxisCameraStationEvents.d.ts +0 -0
- /package/{events → cjs/events}/GenetecAgent.d.ts +0 -0
- /package/{internal → cjs/internal}/Digest.d.ts +0 -0
- /package/{internal → cjs/internal}/ProxyClient.d.ts +0 -0
- /package/{internal → cjs/internal}/constants.d.ts +0 -0
- /package/{internal → cjs/internal}/transformers.d.ts +0 -0
- /package/{internal → cjs/internal}/utils.d.ts +0 -0
- /package/{internal → cjs/internal}/versionCompare.d.ts +0 -0
- /package/{node → cjs/node}/DefaultClient.d.ts +0 -0
- /package/{node → cjs/node}/HttpRequestSender.d.ts +0 -0
- /package/{node → cjs/node}/HttpServer.d.ts +0 -0
- /package/{node → cjs/node}/WsClient.d.ts +0 -0
- /package/{node → cjs/node}/WsEventClient.d.ts +0 -0
- /package/{types → cjs/types}/CamOverlayAPI.d.ts +0 -0
- /package/{types → cjs/types}/CamScripterAPI.d.ts +0 -0
- /package/{types → cjs/types}/CamStreamerAPI.d.ts +0 -0
- /package/{types → cjs/types}/CamSwitcherAPI.d.ts +0 -0
- /package/{types/CamswitcherEvents.d.ts → cjs/types/CamSwitcherEvents.d.ts} +0 -0
- /package/{types → cjs/types}/common.d.ts +0 -0
- /package/{web → cjs/web}/DefaultClient.d.ts +0 -0
- /package/{web → cjs/web}/WsClient.d.ts +0 -0
- /package/{CamOverlayAPI.js → esm/CamOverlayAPI.js} +0 -0
- /package/{CamOverlayPainter → esm/CamOverlayPainter}/Frame.js +0 -0
- /package/{CamScripterAPI.js → esm/CamScripterAPI.js} +0 -0
- /package/{CamStreamerAPI.js → esm/CamStreamerAPI.js} +0 -0
- /package/{CreatePackage.js → esm/CreatePackage.js} +0 -0
- /package/{errors → esm/errors}/errors.js +0 -0
- /package/{events → esm/events}/AxisCameraStationEvents.js +0 -0
- /package/{events → esm/events}/GenetecAgent.js +0 -0
- /package/{internal → esm/internal}/ProxyClient.js +0 -0
- /package/{internal → esm/internal}/constants.js +0 -0
- /package/{internal → esm/internal}/transformers.js +0 -0
- /package/{internal → esm/internal}/utils.js +0 -0
- /package/{internal → esm/internal}/versionCompare.js +0 -0
- /package/{node → esm/node}/HttpRequestSender.js +0 -0
- /package/{node → esm/node}/WsClient.js +0 -0
- /package/{node → esm/node}/WsEventClient.js +0 -0
- /package/{types → esm/types}/CamOverlayAPI.js +0 -0
- /package/{types → esm/types}/CamScripterAPI.js +0 -0
- /package/{types → esm/types}/CamStreamerAPI.js +0 -0
- /package/{types → esm/types}/CamSwitcherAPI.js +0 -0
- /package/{types/CamswitcherEvents.js → esm/types/CamSwitcherEvents.js} +0 -0
- /package/{types → esm/types}/common.js +0 -0
- /package/{web → esm/web}/DefaultClient.js +0 -0
- /package/{web → esm/web}/WsClient.js +0 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cswEventsSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const cswEventsDataSchema = zod_1.z.discriminatedUnion('type', [
|
|
6
|
+
zod_1.z.object({ type: zod_1.z.literal('authorization'), state: zod_1.z.string() }),
|
|
7
|
+
zod_1.z.object({
|
|
8
|
+
type: zod_1.z.literal('PlaylistSwitch'),
|
|
9
|
+
playlist_name: zod_1.z.string(),
|
|
10
|
+
}),
|
|
11
|
+
zod_1.z.object({
|
|
12
|
+
type: zod_1.z.literal('StreamAvailable'),
|
|
13
|
+
stream_name: zod_1.z.string(),
|
|
14
|
+
state: zod_1.z.boolean(),
|
|
15
|
+
}),
|
|
16
|
+
zod_1.z.object({
|
|
17
|
+
type: zod_1.z.literal('StreamSwitchAudio'),
|
|
18
|
+
stream_name: zod_1.z.string().optional(),
|
|
19
|
+
clip_name: zod_1.z.string().optional(),
|
|
20
|
+
master_audio: zod_1.z.boolean(),
|
|
21
|
+
}),
|
|
22
|
+
zod_1.z.object({
|
|
23
|
+
type: zod_1.z.literal('StreamSwitchAudioError'),
|
|
24
|
+
stream_name: zod_1.z.string().optional(),
|
|
25
|
+
clip_name: zod_1.z.string().optional(),
|
|
26
|
+
master_audio: zod_1.z.boolean(),
|
|
27
|
+
}),
|
|
28
|
+
zod_1.z.object({
|
|
29
|
+
type: zod_1.z.literal('StreamSwitchVideo'),
|
|
30
|
+
playlist_active_stream: zod_1.z.number(),
|
|
31
|
+
stream_name: zod_1.z.string().optional(),
|
|
32
|
+
playlist_name: zod_1.z.string().optional(),
|
|
33
|
+
clip_name: zod_1.z.string().optional(),
|
|
34
|
+
}),
|
|
35
|
+
zod_1.z.object({
|
|
36
|
+
type: zod_1.z.literal('PlaylistQueueChange'),
|
|
37
|
+
queue: zod_1.z.array(zod_1.z.string()),
|
|
38
|
+
}),
|
|
39
|
+
zod_1.z.object({
|
|
40
|
+
type: zod_1.z.literal('ClipUpload'),
|
|
41
|
+
clip_name: zod_1.z.string().optional(),
|
|
42
|
+
}),
|
|
43
|
+
zod_1.z.object({
|
|
44
|
+
type: zod_1.z.literal('SwitcherStop'),
|
|
45
|
+
default_playlist_id: zod_1.z.string().optional(),
|
|
46
|
+
}),
|
|
47
|
+
zod_1.z.object({
|
|
48
|
+
type: zod_1.z.literal('SwitcherStart'),
|
|
49
|
+
default_playlist_id: zod_1.z.string().optional(),
|
|
50
|
+
}),
|
|
51
|
+
zod_1.z.object({
|
|
52
|
+
type: zod_1.z.literal('MediaServerStarted'),
|
|
53
|
+
}),
|
|
54
|
+
zod_1.z.object({
|
|
55
|
+
type: zod_1.z.literal('ClipRemove'),
|
|
56
|
+
clip_name: zod_1.z.string(),
|
|
57
|
+
}),
|
|
58
|
+
]);
|
|
59
|
+
exports.cswEventsSchema = zod_1.z.discriminatedUnion('type', [
|
|
60
|
+
zod_1.z.object({ type: zod_1.z.literal('init'), data: cswEventsDataSchema }),
|
|
61
|
+
...cswEventsDataSchema.options,
|
|
62
|
+
]);
|
|
@@ -1509,7 +1509,7 @@ export declare const audioDeviceRequestSchema: z.ZodObject<{
|
|
|
1509
1509
|
}>;
|
|
1510
1510
|
export type TAudioDeviceFromRequest = z.infer<typeof audioDeviceFromRequestSchema>;
|
|
1511
1511
|
export declare const maxFpsResponseSchema: z.ZodObject<{
|
|
1512
|
-
data: z.ZodArray<z.ZodObject<{
|
|
1512
|
+
data: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1513
1513
|
channel: z.ZodNumber;
|
|
1514
1514
|
captureMode: z.ZodArray<z.ZodObject<{
|
|
1515
1515
|
enabled: z.ZodBoolean;
|
|
@@ -1533,23 +1533,23 @@ export declare const maxFpsResponseSchema: z.ZodObject<{
|
|
|
1533
1533
|
enabled: boolean;
|
|
1534
1534
|
maxFPS?: number | undefined;
|
|
1535
1535
|
}[];
|
|
1536
|
-
}>, "many"
|
|
1536
|
+
}>, "many">>;
|
|
1537
1537
|
}, "strip", z.ZodTypeAny, {
|
|
1538
|
-
data
|
|
1538
|
+
data?: {
|
|
1539
1539
|
channel: number;
|
|
1540
1540
|
captureMode: {
|
|
1541
1541
|
enabled: boolean;
|
|
1542
1542
|
maxFPS?: number | undefined;
|
|
1543
1543
|
}[];
|
|
1544
|
-
}[];
|
|
1544
|
+
}[] | undefined;
|
|
1545
1545
|
}, {
|
|
1546
|
-
data
|
|
1546
|
+
data?: {
|
|
1547
1547
|
channel: number;
|
|
1548
1548
|
captureMode: {
|
|
1549
1549
|
enabled: boolean;
|
|
1550
1550
|
maxFPS?: number | undefined;
|
|
1551
1551
|
}[];
|
|
1552
|
-
}[];
|
|
1552
|
+
}[] | undefined;
|
|
1553
1553
|
}>;
|
|
1554
1554
|
export declare const dateTimeinfoSchema: z.ZodObject<{
|
|
1555
1555
|
data: z.ZodObject<{
|
|
@@ -1590,8 +1590,8 @@ export declare const dateTimeinfoSchema: z.ZodObject<{
|
|
|
1590
1590
|
}>;
|
|
1591
1591
|
export declare const audioSampleRatesResponseSchema: z.ZodObject<{
|
|
1592
1592
|
data: z.ZodObject<{
|
|
1593
|
-
encoders: z.
|
|
1594
|
-
aac: z.ZodArray<z.ZodObject<{
|
|
1593
|
+
encoders: z.ZodObject<{
|
|
1594
|
+
aac: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1595
1595
|
sample_rate: z.ZodNumber;
|
|
1596
1596
|
bit_rates: z.ZodArray<z.ZodNumber, "many">;
|
|
1597
1597
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1600,22 +1600,8 @@ export declare const audioSampleRatesResponseSchema: z.ZodObject<{
|
|
|
1600
1600
|
}, {
|
|
1601
1601
|
sample_rate: number;
|
|
1602
1602
|
bit_rates: number[];
|
|
1603
|
-
}>, "many"
|
|
1604
|
-
AAC: z.
|
|
1605
|
-
}, "strip", z.ZodTypeAny, {
|
|
1606
|
-
aac: {
|
|
1607
|
-
sample_rate: number;
|
|
1608
|
-
bit_rates: number[];
|
|
1609
|
-
}[];
|
|
1610
|
-
AAC?: undefined;
|
|
1611
|
-
}, {
|
|
1612
|
-
aac: {
|
|
1613
|
-
sample_rate: number;
|
|
1614
|
-
bit_rates: number[];
|
|
1615
|
-
}[];
|
|
1616
|
-
AAC?: undefined;
|
|
1617
|
-
}>, z.ZodObject<{
|
|
1618
|
-
AAC: z.ZodArray<z.ZodObject<{
|
|
1603
|
+
}>, "many">>;
|
|
1604
|
+
AAC: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1619
1605
|
sample_rate: z.ZodNumber;
|
|
1620
1606
|
bit_rates: z.ZodArray<z.ZodNumber, "many">;
|
|
1621
1607
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1624,80 +1610,73 @@ export declare const audioSampleRatesResponseSchema: z.ZodObject<{
|
|
|
1624
1610
|
}, {
|
|
1625
1611
|
sample_rate: number;
|
|
1626
1612
|
bit_rates: number[];
|
|
1627
|
-
}>, "many"
|
|
1628
|
-
aac: z.ZodUndefined;
|
|
1613
|
+
}>, "many">>;
|
|
1629
1614
|
}, "strip", z.ZodTypeAny, {
|
|
1630
|
-
|
|
1615
|
+
aac?: {
|
|
1631
1616
|
sample_rate: number;
|
|
1632
1617
|
bit_rates: number[];
|
|
1633
|
-
}[];
|
|
1634
|
-
|
|
1618
|
+
}[] | undefined;
|
|
1619
|
+
AAC?: {
|
|
1620
|
+
sample_rate: number;
|
|
1621
|
+
bit_rates: number[];
|
|
1622
|
+
}[] | undefined;
|
|
1635
1623
|
}, {
|
|
1636
|
-
|
|
1624
|
+
aac?: {
|
|
1637
1625
|
sample_rate: number;
|
|
1638
1626
|
bit_rates: number[];
|
|
1639
|
-
}[];
|
|
1640
|
-
|
|
1641
|
-
|
|
1627
|
+
}[] | undefined;
|
|
1628
|
+
AAC?: {
|
|
1629
|
+
sample_rate: number;
|
|
1630
|
+
bit_rates: number[];
|
|
1631
|
+
}[] | undefined;
|
|
1632
|
+
}>;
|
|
1642
1633
|
}, "strip", z.ZodTypeAny, {
|
|
1643
1634
|
encoders: {
|
|
1644
|
-
aac
|
|
1635
|
+
aac?: {
|
|
1645
1636
|
sample_rate: number;
|
|
1646
1637
|
bit_rates: number[];
|
|
1647
|
-
}[];
|
|
1648
|
-
AAC?:
|
|
1649
|
-
} | {
|
|
1650
|
-
AAC: {
|
|
1638
|
+
}[] | undefined;
|
|
1639
|
+
AAC?: {
|
|
1651
1640
|
sample_rate: number;
|
|
1652
1641
|
bit_rates: number[];
|
|
1653
|
-
}[];
|
|
1654
|
-
aac?: undefined;
|
|
1642
|
+
}[] | undefined;
|
|
1655
1643
|
};
|
|
1656
1644
|
}, {
|
|
1657
1645
|
encoders: {
|
|
1658
|
-
aac
|
|
1646
|
+
aac?: {
|
|
1659
1647
|
sample_rate: number;
|
|
1660
1648
|
bit_rates: number[];
|
|
1661
|
-
}[];
|
|
1662
|
-
AAC?:
|
|
1663
|
-
} | {
|
|
1664
|
-
AAC: {
|
|
1649
|
+
}[] | undefined;
|
|
1650
|
+
AAC?: {
|
|
1665
1651
|
sample_rate: number;
|
|
1666
1652
|
bit_rates: number[];
|
|
1667
|
-
}[];
|
|
1668
|
-
aac?: undefined;
|
|
1653
|
+
}[] | undefined;
|
|
1669
1654
|
};
|
|
1670
1655
|
}>;
|
|
1671
1656
|
}, "strip", z.ZodTypeAny, {
|
|
1672
1657
|
data: {
|
|
1673
1658
|
encoders: {
|
|
1674
|
-
aac
|
|
1659
|
+
aac?: {
|
|
1675
1660
|
sample_rate: number;
|
|
1676
1661
|
bit_rates: number[];
|
|
1677
|
-
}[];
|
|
1678
|
-
AAC?:
|
|
1679
|
-
} | {
|
|
1680
|
-
AAC: {
|
|
1662
|
+
}[] | undefined;
|
|
1663
|
+
AAC?: {
|
|
1681
1664
|
sample_rate: number;
|
|
1682
1665
|
bit_rates: number[];
|
|
1683
|
-
}[];
|
|
1684
|
-
aac?: undefined;
|
|
1666
|
+
}[] | undefined;
|
|
1685
1667
|
};
|
|
1686
1668
|
};
|
|
1687
1669
|
}, {
|
|
1688
1670
|
data: {
|
|
1689
1671
|
encoders: {
|
|
1690
|
-
aac
|
|
1672
|
+
aac?: {
|
|
1691
1673
|
sample_rate: number;
|
|
1692
1674
|
bit_rates: number[];
|
|
1693
|
-
}[];
|
|
1694
|
-
AAC?:
|
|
1695
|
-
} | {
|
|
1696
|
-
AAC: {
|
|
1675
|
+
}[] | undefined;
|
|
1676
|
+
AAC?: {
|
|
1697
1677
|
sample_rate: number;
|
|
1698
1678
|
bit_rates: number[];
|
|
1699
|
-
}[];
|
|
1700
|
-
aac?: undefined;
|
|
1679
|
+
}[] | undefined;
|
|
1701
1680
|
};
|
|
1702
1681
|
};
|
|
1703
1682
|
}>;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.audioSampleRatesResponseSchema = exports.dateTimeinfoSchema = exports.maxFpsResponseSchema = exports.audioDeviceRequestSchema = exports.audioDeviceSchema = exports.audioDeviceInputOutputSchema = exports.audioDeviceConnectionTypeSchema = exports.audioDeviceSignalingTypeSchema = exports.audioDeviceSignalingChannelTypeSchema = exports.cameraPTZItemSchema = exports.cameraPTZItemDataSchema = exports.PtzOverviewSchema = exports.sdCardWatchedStatuses = exports.guardTourSchema = exports.applicationListSchema = exports.APP_IDS = exports.applicationSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const transformers_1 = require("../internal/transformers");
|
|
6
|
+
exports.applicationSchema = zod_1.z.object({
|
|
7
|
+
Name: zod_1.z.string(),
|
|
8
|
+
NiceName: zod_1.z.string(),
|
|
9
|
+
Vendor: zod_1.z.string(),
|
|
10
|
+
Version: zod_1.z.string(),
|
|
11
|
+
ApplicationID: zod_1.z.string().optional(),
|
|
12
|
+
License: zod_1.z.string(),
|
|
13
|
+
Status: zod_1.z.string(),
|
|
14
|
+
ConfigurationPage: zod_1.z.string().optional(),
|
|
15
|
+
VendorHomePage: zod_1.z.string().optional(),
|
|
16
|
+
LicenseName: zod_1.z.string().optional(),
|
|
17
|
+
});
|
|
18
|
+
exports.APP_IDS = [
|
|
19
|
+
'CamStreamer',
|
|
20
|
+
'CamSwitcher',
|
|
21
|
+
'CamOverlay',
|
|
22
|
+
'CamScripter',
|
|
23
|
+
'PlaneTracker',
|
|
24
|
+
'Ndihxplugin',
|
|
25
|
+
];
|
|
26
|
+
exports.applicationListSchema = zod_1.z.object({
|
|
27
|
+
reply: zod_1.z.object({
|
|
28
|
+
$: zod_1.z.object({ result: zod_1.z.string() }),
|
|
29
|
+
application: zod_1.z.array(zod_1.z.object({
|
|
30
|
+
$: exports.applicationSchema,
|
|
31
|
+
})),
|
|
32
|
+
}),
|
|
33
|
+
});
|
|
34
|
+
exports.guardTourSchema = zod_1.z.object({
|
|
35
|
+
id: zod_1.z.string(),
|
|
36
|
+
camNbr: zod_1.z.unknown(),
|
|
37
|
+
name: zod_1.z.string(),
|
|
38
|
+
randomEnabled: zod_1.z.unknown(),
|
|
39
|
+
running: zod_1.z.string(),
|
|
40
|
+
timeBetweenSequences: zod_1.z.unknown(),
|
|
41
|
+
tour: zod_1.z.array(zod_1.z.object({
|
|
42
|
+
moveSpeed: zod_1.z.unknown(),
|
|
43
|
+
position: zod_1.z.unknown(),
|
|
44
|
+
presetNbr: zod_1.z.unknown(),
|
|
45
|
+
waitTime: zod_1.z.unknown(),
|
|
46
|
+
waitTimeViewType: zod_1.z.unknown(),
|
|
47
|
+
})),
|
|
48
|
+
});
|
|
49
|
+
const audioSampleRatesSchema = zod_1.z.object({
|
|
50
|
+
sample_rate: zod_1.z.number(),
|
|
51
|
+
bit_rates: zod_1.z.array(zod_1.z.number()),
|
|
52
|
+
});
|
|
53
|
+
const audioSampleRatesOutSchema = audioSampleRatesSchema.transform(transformers_1.toCamelCaseDeep);
|
|
54
|
+
exports.sdCardWatchedStatuses = ['OK', 'connected', 'disconnected'];
|
|
55
|
+
exports.PtzOverviewSchema = zod_1.z.record(zod_1.z.number(), zod_1.z.array(zod_1.z.object({ id: zod_1.z.number(), name: zod_1.z.string() })));
|
|
56
|
+
exports.cameraPTZItemDataSchema = zod_1.z.object({
|
|
57
|
+
pan: zod_1.z.number().optional(),
|
|
58
|
+
tilt: zod_1.z.number().optional(),
|
|
59
|
+
zoom: zod_1.z.number().optional(),
|
|
60
|
+
});
|
|
61
|
+
exports.cameraPTZItemSchema = zod_1.z.object({
|
|
62
|
+
name: zod_1.z.string(),
|
|
63
|
+
id: zod_1.z.number(),
|
|
64
|
+
data: exports.cameraPTZItemDataSchema,
|
|
65
|
+
});
|
|
66
|
+
exports.audioDeviceSignalingChannelTypeSchema = zod_1.z.object({
|
|
67
|
+
id: zod_1.z.string(),
|
|
68
|
+
gain: zod_1.z.number(),
|
|
69
|
+
mute: zod_1.z.boolean(),
|
|
70
|
+
});
|
|
71
|
+
exports.audioDeviceSignalingTypeSchema = zod_1.z.object({
|
|
72
|
+
id: zod_1.z.string(),
|
|
73
|
+
powerType: zod_1.z.string(),
|
|
74
|
+
channels: zod_1.z.array(exports.audioDeviceSignalingChannelTypeSchema),
|
|
75
|
+
});
|
|
76
|
+
exports.audioDeviceConnectionTypeSchema = zod_1.z.object({
|
|
77
|
+
id: zod_1.z.string(),
|
|
78
|
+
signalingTypeSelected: zod_1.z.string(),
|
|
79
|
+
signalingTypes: zod_1.z.array(exports.audioDeviceSignalingTypeSchema),
|
|
80
|
+
});
|
|
81
|
+
exports.audioDeviceInputOutputSchema = zod_1.z.object({
|
|
82
|
+
id: zod_1.z.string(),
|
|
83
|
+
name: zod_1.z.string(),
|
|
84
|
+
enabled: zod_1.z.boolean(),
|
|
85
|
+
connectionTypes: zod_1.z.array(exports.audioDeviceConnectionTypeSchema),
|
|
86
|
+
connectionTypeSelected: zod_1.z.string(),
|
|
87
|
+
});
|
|
88
|
+
exports.audioDeviceSchema = zod_1.z.object({
|
|
89
|
+
id: zod_1.z.string(),
|
|
90
|
+
name: zod_1.z.string(),
|
|
91
|
+
inputs: zod_1.z.array(exports.audioDeviceInputOutputSchema),
|
|
92
|
+
outputs: zod_1.z.array(exports.audioDeviceInputOutputSchema),
|
|
93
|
+
});
|
|
94
|
+
const audioDeviceFromRequestSchema = zod_1.z.object({
|
|
95
|
+
id: zod_1.z.string(),
|
|
96
|
+
name: zod_1.z.string(),
|
|
97
|
+
inputs: zod_1.z.array(exports.audioDeviceInputOutputSchema).optional(),
|
|
98
|
+
outputs: zod_1.z.array(exports.audioDeviceInputOutputSchema).optional(),
|
|
99
|
+
});
|
|
100
|
+
exports.audioDeviceRequestSchema = zod_1.z.object({ devices: zod_1.z.array(audioDeviceFromRequestSchema) });
|
|
101
|
+
exports.maxFpsResponseSchema = zod_1.z.object({
|
|
102
|
+
data: zod_1.z
|
|
103
|
+
.array(zod_1.z.object({
|
|
104
|
+
channel: zod_1.z.number(),
|
|
105
|
+
captureMode: zod_1.z.array(zod_1.z.object({
|
|
106
|
+
enabled: zod_1.z.boolean(),
|
|
107
|
+
maxFPS: zod_1.z.number().optional(),
|
|
108
|
+
})),
|
|
109
|
+
}))
|
|
110
|
+
.optional(),
|
|
111
|
+
});
|
|
112
|
+
exports.dateTimeinfoSchema = zod_1.z.object({
|
|
113
|
+
data: zod_1.z.object({
|
|
114
|
+
dateTime: zod_1.z.string(),
|
|
115
|
+
dstEnabled: zod_1.z.boolean(),
|
|
116
|
+
localDateTime: zod_1.z.string(),
|
|
117
|
+
posixTimeZone: zod_1.z.string(),
|
|
118
|
+
timeZone: zod_1.z.string(),
|
|
119
|
+
}),
|
|
120
|
+
});
|
|
121
|
+
exports.audioSampleRatesResponseSchema = zod_1.z.object({
|
|
122
|
+
data: zod_1.z.object({
|
|
123
|
+
encoders: zod_1.z
|
|
124
|
+
.object({
|
|
125
|
+
aac: zod_1.z.array(audioSampleRatesSchema),
|
|
126
|
+
AAC: zod_1.z.array(audioSampleRatesSchema),
|
|
127
|
+
})
|
|
128
|
+
.partial(),
|
|
129
|
+
}),
|
|
130
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.keyboardShortcutsSchema = exports.keyboardShortcutSchema = exports.networkCameraListSchema = exports.storageTypeSchema = exports.h264ProfileSchema = exports.audioChannelCountSchema = exports.audioChannelSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.audioChannelSchema = zod_1.z.union([zod_1.z.literal('mono'), zod_1.z.literal('stereo')]);
|
|
6
|
+
exports.audioChannelCountSchema = zod_1.z.union([zod_1.z.literal(1), zod_1.z.literal(2)]);
|
|
7
|
+
exports.h264ProfileSchema = zod_1.z.union([zod_1.z.literal('high'), zod_1.z.literal('main'), zod_1.z.literal('baseline')]);
|
|
8
|
+
exports.storageTypeSchema = zod_1.z.union([zod_1.z.literal('SD_DISK'), zod_1.z.literal('FLASH')]);
|
|
9
|
+
exports.networkCameraListSchema = zod_1.z.array(zod_1.z.object({
|
|
10
|
+
name: zod_1.z.string(),
|
|
11
|
+
ip: zod_1.z.string(),
|
|
12
|
+
}));
|
|
13
|
+
exports.keyboardShortcutSchema = zod_1.z.string().nullable();
|
|
14
|
+
exports.keyboardShortcutsSchema = zod_1.z.record(exports.keyboardShortcutSchema);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DefaultClient = void 0;
|
|
4
|
+
const utils_1 = require("../internal/utils");
|
|
5
|
+
class DefaultClient {
|
|
6
|
+
get(url, parameters, headers) {
|
|
7
|
+
return fetch((0, utils_1.addParametersToPath)(url, parameters), {
|
|
8
|
+
method: 'GET',
|
|
9
|
+
headers: headers,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
post(url, data, parameters, headers) {
|
|
13
|
+
return fetch((0, utils_1.addParametersToPath)(url, parameters), {
|
|
14
|
+
method: 'POST',
|
|
15
|
+
body: data,
|
|
16
|
+
headers: headers,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.DefaultClient = DefaultClient;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WsClient = void 0;
|
|
4
|
+
const REFRESH_TIMEOUT = 5_000;
|
|
5
|
+
class WsClient {
|
|
6
|
+
getUrl;
|
|
7
|
+
getAuthToken;
|
|
8
|
+
isDestroyed = false;
|
|
9
|
+
ws = null;
|
|
10
|
+
restartTimeout = null;
|
|
11
|
+
constructor(getUrl, getAuthToken) {
|
|
12
|
+
this.getUrl = getUrl;
|
|
13
|
+
this.getAuthToken = getAuthToken;
|
|
14
|
+
}
|
|
15
|
+
init() {
|
|
16
|
+
if (this.isDestroyed) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
this.destroyWebsocket();
|
|
20
|
+
const ws = new WebSocket(this.getUrl(), 'events');
|
|
21
|
+
ws.onopen = async () => {
|
|
22
|
+
try {
|
|
23
|
+
const token = await this.getAuthToken();
|
|
24
|
+
ws.send(JSON.stringify({ authorization: token }));
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
console.error('Error sending auth token:', error);
|
|
28
|
+
ws.close();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
ws.onmessage = (e) => this.onmessage(e);
|
|
32
|
+
ws.onclose = () => {
|
|
33
|
+
this.restartTimeout = setTimeout(() => this.init(), REFRESH_TIMEOUT);
|
|
34
|
+
};
|
|
35
|
+
this.ws = ws;
|
|
36
|
+
}
|
|
37
|
+
send = (msg) => {
|
|
38
|
+
this.ws?.send(msg);
|
|
39
|
+
};
|
|
40
|
+
onmessage = (_) => { };
|
|
41
|
+
destroy = () => {
|
|
42
|
+
this.isDestroyed = true;
|
|
43
|
+
this.destroyWebsocket();
|
|
44
|
+
};
|
|
45
|
+
destroyWebsocket() {
|
|
46
|
+
if (this.restartTimeout) {
|
|
47
|
+
clearTimeout(this.restartTimeout);
|
|
48
|
+
this.restartTimeout = null;
|
|
49
|
+
}
|
|
50
|
+
if (!this.ws) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
this.ws.onmessage = null;
|
|
54
|
+
this.ws.onopen = null;
|
|
55
|
+
this.ws.onclose = null;
|
|
56
|
+
if (this.ws.readyState === this.ws.OPEN) {
|
|
57
|
+
this.ws.close();
|
|
58
|
+
}
|
|
59
|
+
this.ws = null;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.WsClient = WsClient;
|
package/cjs/web/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WsClient = exports.DefaultClient = void 0;
|
|
4
|
+
var DefaultClient_1 = require("./DefaultClient");
|
|
5
|
+
Object.defineProperty(exports, "DefaultClient", { enumerable: true, get: function () { return DefaultClient_1.DefaultClient; } });
|
|
6
|
+
var WsClient_1 = require("./WsClient");
|
|
7
|
+
Object.defineProperty(exports, "WsClient", { enumerable: true, get: function () { return WsClient_1.WsClient; } });
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { IClient } from './internal/common';
|
|
3
|
+
import { CamOverlayOptions, ImageType, TCoordinates, TField, TFile, TFileList, TFileType, TService, TServiceList, TStorage } from './types/CamOverlayAPI';
|
|
4
|
+
import { TNetworkCamera } from './types/common';
|
|
5
|
+
export declare class CamOverlayAPI {
|
|
6
|
+
private client;
|
|
7
|
+
constructor(options?: CamOverlayOptions | IClient);
|
|
8
|
+
checkCameraTime(): Promise<boolean>;
|
|
9
|
+
getNetworkCameraList(): Promise<TNetworkCamera[]>;
|
|
10
|
+
wsAutoratization(): Promise<string>;
|
|
11
|
+
getMjpegStreamImage(mjpegUrl: string): Promise<Blob>;
|
|
12
|
+
listFiles(fileType: TFileType): Promise<TFileList>;
|
|
13
|
+
uploadFile(fileType: TFileType, file: Blob, fileName: string): Promise<void>;
|
|
14
|
+
removeFile(fileType: TFileType, file: TFile): Promise<void>;
|
|
15
|
+
getFileStorage(fileType: TFileType): Promise<TStorage>;
|
|
16
|
+
updateInfoticker(serviceID: number, text: string): Promise<void>;
|
|
17
|
+
setEnabled(serviceID: number, enabled: boolean): Promise<void>;
|
|
18
|
+
isEnabled(serviceID: number): Promise<boolean>;
|
|
19
|
+
getSingleService(serviceId: number): Promise<TService>;
|
|
20
|
+
getServices(): Promise<TService[]>;
|
|
21
|
+
updateSingleService(serviceId: number, serviceJson: TService): Promise<void>;
|
|
22
|
+
updateServices(servicesJson: TServiceList): Promise<void>;
|
|
23
|
+
updateCGText(serviceID: number, fields: TField[]): Promise<void>;
|
|
24
|
+
updateCGImagePos(serviceID: number, coordinates?: TCoordinates, x?: number, y?: number): Promise<void>;
|
|
25
|
+
updateCGImage(serviceID: number, path: string, coordinates?: TCoordinates, x?: number, y?: number): Promise<void>;
|
|
26
|
+
updateCGImageFromData(serviceID: number, imageType: ImageType, imageData: Buffer, coordinates?: TCoordinates, x?: number, y?: number): Promise<void>;
|
|
27
|
+
private promiseCGUpdate;
|
|
28
|
+
private get;
|
|
29
|
+
private post;
|
|
30
|
+
private parseBlobResponse;
|
|
31
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import * as EventEmitter from 'events';
|
|
4
|
+
import { WsOptions } from './internal/common';
|
|
5
|
+
export type CamOverlayDrawingOptions = WsOptions & {
|
|
6
|
+
camera?: number | number[];
|
|
7
|
+
zIndex?: number;
|
|
8
|
+
};
|
|
9
|
+
export type TCairoResponse = {
|
|
10
|
+
message: string;
|
|
11
|
+
call_id: number;
|
|
12
|
+
};
|
|
13
|
+
export type TCairoCreateResponse = {
|
|
14
|
+
var: string;
|
|
15
|
+
call_id: number;
|
|
16
|
+
};
|
|
17
|
+
export type TUploadImageResponse = {
|
|
18
|
+
var: string;
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
call_id: number;
|
|
22
|
+
};
|
|
23
|
+
export type TErrorResponse = {
|
|
24
|
+
error: string;
|
|
25
|
+
call_id?: number;
|
|
26
|
+
};
|
|
27
|
+
export type TService = {
|
|
28
|
+
id: number;
|
|
29
|
+
enabled: number;
|
|
30
|
+
schedule: string;
|
|
31
|
+
name: string;
|
|
32
|
+
identifier: string;
|
|
33
|
+
cameraList: number[];
|
|
34
|
+
};
|
|
35
|
+
export type TServiceList = {
|
|
36
|
+
services: TService[];
|
|
37
|
+
};
|
|
38
|
+
export type TAlign = 'A_RIGHT' | 'A_LEFT' | 'A_CENTER';
|
|
39
|
+
export type TextFit = 'TFM_SCALE' | 'TFM_TRUNCATE' | 'TFM_OVERFLOW';
|
|
40
|
+
export type TWriteTextParams = [string, string, number, number, number, number, TAlign, TextFit?];
|
|
41
|
+
export interface CamOverlayDrawingAPI {
|
|
42
|
+
on(event: 'open', listener: () => void): this;
|
|
43
|
+
on(event: 'close', listener: () => void): this;
|
|
44
|
+
on(event: 'error', listener: (err: Error) => void): this;
|
|
45
|
+
on(event: 'message', listener: (msg: string) => void): this;
|
|
46
|
+
emit(event: 'open'): boolean;
|
|
47
|
+
emit(event: 'close'): boolean;
|
|
48
|
+
emit(event: 'error', err: Error): boolean;
|
|
49
|
+
emit(event: 'message', msg: string): boolean;
|
|
50
|
+
}
|
|
51
|
+
export declare class CamOverlayDrawingAPI extends EventEmitter {
|
|
52
|
+
private tls;
|
|
53
|
+
private tlsInsecure;
|
|
54
|
+
private ip;
|
|
55
|
+
private port;
|
|
56
|
+
private user;
|
|
57
|
+
private pass;
|
|
58
|
+
private cameraList;
|
|
59
|
+
private zIndex;
|
|
60
|
+
private callId;
|
|
61
|
+
private sendMessages;
|
|
62
|
+
private timeoutCheckTimer;
|
|
63
|
+
private wsConnected;
|
|
64
|
+
private ws;
|
|
65
|
+
constructor(options?: CamOverlayDrawingOptions);
|
|
66
|
+
connect(): void;
|
|
67
|
+
disconnect(): void;
|
|
68
|
+
isConnected(): boolean;
|
|
69
|
+
cairo(command: string, ...params: unknown[]): Promise<TCairoResponse | TCairoCreateResponse>;
|
|
70
|
+
writeText(...params: TWriteTextParams): Promise<TCairoResponse>;
|
|
71
|
+
uploadImageData(imgBuffer: Buffer): Promise<TUploadImageResponse>;
|
|
72
|
+
uploadFontData(fontBuffer: Buffer): Promise<TCairoCreateResponse>;
|
|
73
|
+
showCairoImage(cairoImage: string, posX: number, posY: number): Promise<TCairoResponse>;
|
|
74
|
+
showCairoImageAbsolute(cairoImage: string, posX: number, posY: number, width: number, height: number): Promise<TCairoResponse>;
|
|
75
|
+
removeImage(): Promise<TCairoResponse>;
|
|
76
|
+
private createWsClient;
|
|
77
|
+
private incomingWsMessageHandler;
|
|
78
|
+
private sendMessage;
|
|
79
|
+
private sendBinaryMessage;
|
|
80
|
+
private startMsgsTimeoutCheck;
|
|
81
|
+
private stopMsgsTimeoutCheck;
|
|
82
|
+
private reconnectWithError;
|
|
83
|
+
private reportMessage;
|
|
84
|
+
private reportError;
|
|
85
|
+
private reportClose;
|
|
86
|
+
}
|
|
@@ -121,10 +121,10 @@ export class CamOverlayDrawingAPI extends EventEmitter {
|
|
|
121
121
|
}
|
|
122
122
|
if (dataJSON.call_id !== undefined) {
|
|
123
123
|
if (errorResponse !== undefined) {
|
|
124
|
-
this.sendMessages[dataJSON.call_id]
|
|
124
|
+
this.sendMessages[dataJSON.call_id]?.reject(new Error(errorResponse.error));
|
|
125
125
|
}
|
|
126
126
|
else {
|
|
127
|
-
this.sendMessages[dataJSON.call_id]
|
|
127
|
+
this.sendMessages[dataJSON.call_id]?.resolve(dataJSON);
|
|
128
128
|
}
|
|
129
129
|
delete this.sendMessages[dataJSON.call_id];
|
|
130
130
|
}
|
|
@@ -194,6 +194,9 @@ export class CamOverlayDrawingAPI extends EventEmitter {
|
|
|
194
194
|
const now = Date.now();
|
|
195
195
|
for (const callId in this.sendMessages) {
|
|
196
196
|
const msg = this.sendMessages[callId];
|
|
197
|
+
if (!msg) {
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
197
200
|
if (now - msg.sentTimestamp > 10000) {
|
|
198
201
|
reconnect = true;
|
|
199
202
|
msg.reject(new Error('Message timeout'));
|
|
@@ -220,7 +223,7 @@ export class CamOverlayDrawingAPI extends EventEmitter {
|
|
|
220
223
|
}
|
|
221
224
|
reportClose() {
|
|
222
225
|
for (const callId in this.sendMessages) {
|
|
223
|
-
this.sendMessages[callId]
|
|
226
|
+
this.sendMessages[callId]?.reject(new Error('Connection lost'));
|
|
224
227
|
}
|
|
225
228
|
this.sendMessages = {};
|
|
226
229
|
this.emit('close');
|