tv-app-core-types 1.0.0

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.
@@ -0,0 +1,90 @@
1
+ export declare enum ControlCommands {
2
+ VOLUME_UP = "VOLUME_UP",
3
+ VOLUME_DOWN = "VOLUME_DOWN",
4
+ VOLUME_MUTE_UNMUTE = "VOLUME_MUTE_UNMUTE",
5
+ SET_VOLUME = "SET_VOLUME",
6
+ CHANNEL_UP = "CHANNEL_UP",
7
+ CHANNEL_DOWN = "CHANNEL_DOWN",
8
+ SET_CHANNEL = "SET_CHANNEL",
9
+ STOP_UDP = "STOP_UDP",
10
+ GET_POWER = "GET_POWER",
11
+ POWER_ON = "POWER_ON",
12
+ POWER_OFF = "POWER_OFF",
13
+ GET_SOURCE = "GET_SOURCE",
14
+ SET_SOURCE = "SET_SOURCE",
15
+ GET_ALL_CHANNELS = "GET_ALL_CHANNELS",
16
+ LOCAL_CHANNEL_UP = "LOCAL_CHANNEL_UP",
17
+ LOCAL_CHANNEL_DOWN = "LOCAL_CHANNEL_DOWN",
18
+ GET_VERSION = "GET_VERSION",
19
+ HIDE_APPLICATION = "HIDE_APPLICATION",
20
+ POWER_STANDBY = "POWER_STANDBY",
21
+ UPDATE_FEED = "UPDATE_FEED",
22
+ GET_STATUS = "GET_STATUS",
23
+ UPDATE_FEED_NOTIFICATION = "UPDATE_FEED_NOTIFICATION",
24
+ LAUNCH_INBUILT_APPS = "LAUNCH_INBUILT_APPS"
25
+ }
26
+ export declare enum IdentifierStrings {
27
+ IP_CHANNEL_URL = "ipChannelUrl",
28
+ CHANNELS_PROFILE = "channelsProfile",
29
+ CHANNEL_IP_INDEX = "channelIpIndex",
30
+ IS_HIDDEN = "isHidden"
31
+ }
32
+ export declare enum Requests {
33
+ VOLUME_LEVEL = "volumeLevel"
34
+ }
35
+ export declare enum TvOperations {
36
+ CHANGE_VIEW = "changeview",
37
+ TV_ON_OFF = "tvonoff",
38
+ SET_VOLUME = "setvolume",
39
+ VOLUME_UP = "volumeUp",
40
+ VOLUME_DOWN = "volumeDown",
41
+ VOLUME_UP_BY_LEVEL = "volumeUpByLevel",
42
+ VOLUME_DOWN_BY_LEVEL = "volumeDownByLevel",
43
+ MUTE = "mute",
44
+ UNMUTE = "unmute",
45
+ SHIFT_SOURCE = "shiftSource",
46
+ CHANNEL_UP = "channelUp",
47
+ CHANNEL_DOWN = "channelDown",
48
+ PLAY_CHANNEL_ID = "playChannelId",
49
+ TV_OFF = "tvoff",
50
+ HIDE_APP = "hideApp",
51
+ STOP_UDP = "stopudp",
52
+ GET_SOURCE = "getSource",
53
+ TV_ON = "tvon",
54
+ POWER_STANDBY = "PowerStandby",
55
+ GET_VERSION = "getVersion",
56
+ GET_POWER = "getPower",
57
+ UPDATE_FEED = "updateFeed",
58
+ GET_STATUS = "getStatus",
59
+ UPDATE_FEED_NOTIFICATION = "updateFeedNotification",
60
+ LAUNCH_APP = "launch",
61
+ CHECK_OUT = "checkout",
62
+ CHECK_IN = "checkin",
63
+ AIRPLAY = "AirPlay",
64
+ REBOOT = "reboot",
65
+ GET_CURRENT_INPUT_SOURCE = "getCurrentInputSource",
66
+ PLAY_ENCRYPTED_CHANNEL = "playEncryptedChannel",
67
+ TV_APP_PUSH_UPDATE = "tvAppPushUpdate",
68
+ DEFAULT_CONFIGURATION = "defaultConfiguration"
69
+ }
70
+ export declare enum FileConsts {
71
+ GLOBAL = "global",
72
+ ENVIRONMENT_VARS_APC = "environmentVarsAPC",
73
+ PUBLIC_KEY = "publicKey",
74
+ SESSION_KEY = "sessionKey",
75
+ SERVER_DETAILS = "serverDetails",
76
+ TV_DATA = "tvData",
77
+ TV_REGISTERED = "tvRegistered",
78
+ WELCOME_LETTER_DETAILS = "welcomeLetterDetails",
79
+ IP_CHANNELS = "ipChannels",
80
+ IP_CHANNELS_VERSION = "ipChannelsVersion",
81
+ IS_ROOM_CHECKED_IN = "isRoomCheckedIn",
82
+ GUEST_INFO = "guestInfo",
83
+ APP_CONFIG_DATA = "appConfigData",
84
+ FIRST_INSTALLATION = "firstInstallation",
85
+ DEFAULT_CONFIGURATION = "defaultConfiguration",
86
+ APP_DETAILS = "appDetails",
87
+ AIRPLAY_QR_DATA = "airplayQRData",
88
+ LOGGING_LEVEL = "loggingLevel",
89
+ CURRENT_CHANNEL = "currentChannel"
90
+ }
@@ -0,0 +1,95 @@
1
+ export var ControlCommands;
2
+ (function (ControlCommands) {
3
+ ControlCommands["VOLUME_UP"] = "VOLUME_UP";
4
+ ControlCommands["VOLUME_DOWN"] = "VOLUME_DOWN";
5
+ ControlCommands["VOLUME_MUTE_UNMUTE"] = "VOLUME_MUTE_UNMUTE";
6
+ ControlCommands["SET_VOLUME"] = "SET_VOLUME";
7
+ ControlCommands["CHANNEL_UP"] = "CHANNEL_UP";
8
+ ControlCommands["CHANNEL_DOWN"] = "CHANNEL_DOWN";
9
+ ControlCommands["SET_CHANNEL"] = "SET_CHANNEL";
10
+ ControlCommands["STOP_UDP"] = "STOP_UDP";
11
+ ControlCommands["GET_POWER"] = "GET_POWER";
12
+ ControlCommands["POWER_ON"] = "POWER_ON";
13
+ ControlCommands["POWER_OFF"] = "POWER_OFF";
14
+ ControlCommands["GET_SOURCE"] = "GET_SOURCE";
15
+ ControlCommands["SET_SOURCE"] = "SET_SOURCE";
16
+ ControlCommands["GET_ALL_CHANNELS"] = "GET_ALL_CHANNELS";
17
+ ControlCommands["LOCAL_CHANNEL_UP"] = "LOCAL_CHANNEL_UP";
18
+ ControlCommands["LOCAL_CHANNEL_DOWN"] = "LOCAL_CHANNEL_DOWN";
19
+ ControlCommands["GET_VERSION"] = "GET_VERSION";
20
+ ControlCommands["HIDE_APPLICATION"] = "HIDE_APPLICATION";
21
+ ControlCommands["POWER_STANDBY"] = "POWER_STANDBY";
22
+ ControlCommands["UPDATE_FEED"] = "UPDATE_FEED";
23
+ ControlCommands["GET_STATUS"] = "GET_STATUS";
24
+ ControlCommands["UPDATE_FEED_NOTIFICATION"] = "UPDATE_FEED_NOTIFICATION";
25
+ ControlCommands["LAUNCH_INBUILT_APPS"] = "LAUNCH_INBUILT_APPS";
26
+ })(ControlCommands || (ControlCommands = {}));
27
+ export var IdentifierStrings;
28
+ (function (IdentifierStrings) {
29
+ IdentifierStrings["IP_CHANNEL_URL"] = "ipChannelUrl";
30
+ IdentifierStrings["CHANNELS_PROFILE"] = "channelsProfile";
31
+ IdentifierStrings["CHANNEL_IP_INDEX"] = "channelIpIndex";
32
+ IdentifierStrings["IS_HIDDEN"] = "isHidden";
33
+ })(IdentifierStrings || (IdentifierStrings = {}));
34
+ export var Requests;
35
+ (function (Requests) {
36
+ Requests["VOLUME_LEVEL"] = "volumeLevel";
37
+ })(Requests || (Requests = {}));
38
+ export var TvOperations;
39
+ (function (TvOperations) {
40
+ TvOperations["CHANGE_VIEW"] = "changeview";
41
+ TvOperations["TV_ON_OFF"] = "tvonoff";
42
+ TvOperations["SET_VOLUME"] = "setvolume";
43
+ TvOperations["VOLUME_UP"] = "volumeUp";
44
+ TvOperations["VOLUME_DOWN"] = "volumeDown";
45
+ TvOperations["VOLUME_UP_BY_LEVEL"] = "volumeUpByLevel";
46
+ TvOperations["VOLUME_DOWN_BY_LEVEL"] = "volumeDownByLevel";
47
+ TvOperations["MUTE"] = "mute";
48
+ TvOperations["UNMUTE"] = "unmute";
49
+ TvOperations["SHIFT_SOURCE"] = "shiftSource";
50
+ TvOperations["CHANNEL_UP"] = "channelUp";
51
+ TvOperations["CHANNEL_DOWN"] = "channelDown";
52
+ TvOperations["PLAY_CHANNEL_ID"] = "playChannelId";
53
+ TvOperations["TV_OFF"] = "tvoff";
54
+ TvOperations["HIDE_APP"] = "hideApp";
55
+ TvOperations["STOP_UDP"] = "stopudp";
56
+ TvOperations["GET_SOURCE"] = "getSource";
57
+ TvOperations["TV_ON"] = "tvon";
58
+ TvOperations["POWER_STANDBY"] = "PowerStandby";
59
+ TvOperations["GET_VERSION"] = "getVersion";
60
+ TvOperations["GET_POWER"] = "getPower";
61
+ TvOperations["UPDATE_FEED"] = "updateFeed";
62
+ TvOperations["GET_STATUS"] = "getStatus";
63
+ TvOperations["UPDATE_FEED_NOTIFICATION"] = "updateFeedNotification";
64
+ TvOperations["LAUNCH_APP"] = "launch";
65
+ TvOperations["CHECK_OUT"] = "checkout";
66
+ TvOperations["CHECK_IN"] = "checkin";
67
+ TvOperations["AIRPLAY"] = "AirPlay";
68
+ TvOperations["REBOOT"] = "reboot";
69
+ TvOperations["GET_CURRENT_INPUT_SOURCE"] = "getCurrentInputSource";
70
+ TvOperations["PLAY_ENCRYPTED_CHANNEL"] = "playEncryptedChannel";
71
+ TvOperations["TV_APP_PUSH_UPDATE"] = "tvAppPushUpdate";
72
+ TvOperations["DEFAULT_CONFIGURATION"] = "defaultConfiguration";
73
+ })(TvOperations || (TvOperations = {}));
74
+ export var FileConsts;
75
+ (function (FileConsts) {
76
+ FileConsts["GLOBAL"] = "global";
77
+ FileConsts["ENVIRONMENT_VARS_APC"] = "environmentVarsAPC";
78
+ FileConsts["PUBLIC_KEY"] = "publicKey";
79
+ FileConsts["SESSION_KEY"] = "sessionKey";
80
+ FileConsts["SERVER_DETAILS"] = "serverDetails";
81
+ FileConsts["TV_DATA"] = "tvData";
82
+ FileConsts["TV_REGISTERED"] = "tvRegistered";
83
+ FileConsts["WELCOME_LETTER_DETAILS"] = "welcomeLetterDetails";
84
+ FileConsts["IP_CHANNELS"] = "ipChannels";
85
+ FileConsts["IP_CHANNELS_VERSION"] = "ipChannelsVersion";
86
+ FileConsts["IS_ROOM_CHECKED_IN"] = "isRoomCheckedIn";
87
+ FileConsts["GUEST_INFO"] = "guestInfo";
88
+ FileConsts["APP_CONFIG_DATA"] = "appConfigData";
89
+ FileConsts["FIRST_INSTALLATION"] = "firstInstallation";
90
+ FileConsts["DEFAULT_CONFIGURATION"] = "defaultConfiguration";
91
+ FileConsts["APP_DETAILS"] = "appDetails";
92
+ FileConsts["AIRPLAY_QR_DATA"] = "airplayQRData";
93
+ FileConsts["LOGGING_LEVEL"] = "loggingLevel";
94
+ FileConsts["CURRENT_CHANNEL"] = "currentChannel";
95
+ })(FileConsts || (FileConsts = {}));
@@ -0,0 +1,6 @@
1
+ export * from './interfaces/tv-controller-interface';
2
+ export * from './constants/consts';
3
+ export * from './interfaces/mqtt-interface';
4
+ export * from './interfaces/tv-data-interface';
5
+ export * from './interfaces/utils-interface';
6
+ export * from './interfaces/logs-interface';
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ export * from './interfaces/tv-controller-interface';
2
+ export * from './constants/consts';
3
+ export * from './interfaces/mqtt-interface';
4
+ export * from './interfaces/tv-data-interface';
5
+ export * from './interfaces/utils-interface';
6
+ export * from './interfaces/logs-interface';
@@ -0,0 +1,16 @@
1
+ export interface ILogDataStream {
2
+ streams: [
3
+ {
4
+ stream: {
5
+ hotel_name: string;
6
+ component: string;
7
+ detected_level: string;
8
+ room_number: string;
9
+ room_type: string;
10
+ tv_id: string;
11
+ level: string;
12
+ };
13
+ values: Array<Array<string>>;
14
+ }
15
+ ];
16
+ }
@@ -0,0 +1,2 @@
1
+ ;
2
+ export {};
@@ -0,0 +1,62 @@
1
+ export interface ILastWillMessage {
2
+ method: string;
3
+ params: {};
4
+ payload: {
5
+ timestamp: Number;
6
+ response: [
7
+ {
8
+ details: {
9
+ metaData: {
10
+ displayMessage: string;
11
+ isDeviceConnected: boolean;
12
+ };
13
+ };
14
+ tvid: string;
15
+ feature: string;
16
+ }
17
+ ];
18
+ };
19
+ deviceID: string;
20
+ identifier: string;
21
+ }
22
+ export interface MqttData {
23
+ mqtt_ip: string;
24
+ mqtt_package_port: string;
25
+ mqtt_password: string;
26
+ mqtt_tv_port: string;
27
+ mqtt_user: string;
28
+ }
29
+ export interface MqttBrokerTopicsHeader {
30
+ request_topic_header: string;
31
+ response_topic_header: string;
32
+ service_request_topic_header: string;
33
+ }
34
+ export interface IMqttResponse {
35
+ method: string;
36
+ params: {};
37
+ payload: {
38
+ timestamp: number;
39
+ response: [
40
+ {
41
+ details: {
42
+ isDeviceMute: boolean;
43
+ isDeviceOn: boolean;
44
+ source: string | null;
45
+ application: string | null;
46
+ isRoomCheckedIn: boolean;
47
+ volumeLevel: number | void;
48
+ isChromecastStreaming: boolean;
49
+ channelFeedVersion: string | boolean;
50
+ channelId: string | null;
51
+ isChannelPlayerActive: boolean;
52
+ channelName: string | null;
53
+ isWelcomeLetterOpen: boolean;
54
+ };
55
+ feature: string;
56
+ tvid: string;
57
+ }
58
+ ];
59
+ };
60
+ deviceID: string;
61
+ identifier: string;
62
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,30 @@
1
+ export interface ITVController {
2
+ setPowerOn(): void;
3
+ setPowerOff(): void;
4
+ reboot(): void;
5
+ getVolume(): void;
6
+ setVolume(volume: number): void;
7
+ volumeUp(): void;
8
+ volumeDown(): void;
9
+ isMute(): void;
10
+ setMute(mute?: boolean): void;
11
+ setInputSource(source: string): void;
12
+ getInputSource(): string | null;
13
+ playIPChannel(ip: string, port: string): void;
14
+ playEncrypted(ip: string, port: string): void;
15
+ launchApplication(appId: string): void;
16
+ getPowerState(): boolean;
17
+ getAVPlayerState(): string | boolean;
18
+ }
19
+ export interface IRequestHandler {
20
+ tvOnOperation(): void;
21
+ tvOffOperation(): void;
22
+ volumeDownOperation(): void;
23
+ volumeUpOperation(): void;
24
+ muteOperation(): void;
25
+ unmuteOperation(): void;
26
+ rebootOperation(): void;
27
+ setVolumeOperation(details: any): void;
28
+ shiftSourceOperation(details: any): void;
29
+ playChannelIdOperation(details: any): void;
30
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,93 @@
1
+ import { MqttBrokerTopicsHeader } from "./mqtt-interface";
2
+ export interface TvData {
3
+ display_name: string;
4
+ in_room_device_id: string;
5
+ device_type_id: string;
6
+ key_id: string;
7
+ number: string;
8
+ via_dvc: string;
9
+ room_type_id: string;
10
+ room_type: string;
11
+ ip: string;
12
+ unique_id: string;
13
+ is_registered: string;
14
+ is_deregistering: string;
15
+ is_online: string;
16
+ is_active: string;
17
+ mqtt: string;
18
+ topics_identifier: string;
19
+ airplayBroker_details: string;
20
+ hotelWifiSSID: string;
21
+ hotelCode: string;
22
+ device_category: string;
23
+ dvs_device_id: string;
24
+ }
25
+ export interface AppConfigData {
26
+ apc_server: ApcServer;
27
+ mqtt_broker: MqttBrokerTopicsHeader;
28
+ proidiom: ProIdiom;
29
+ airplay: AirplayConfig;
30
+ chromecast: Chromecast;
31
+ procentric: Procentric;
32
+ property_details: PropertyDetails;
33
+ }
34
+ export interface AppConfigData {
35
+ apc_server: ApcServer;
36
+ mqtt_broker: MqttBrokerTopicsHeader;
37
+ proidiom: ProIdiom;
38
+ airplay: AirplayConfig;
39
+ chromecast: Chromecast;
40
+ procentric: Procentric;
41
+ property_details: PropertyDetails;
42
+ }
43
+ export interface ApcServer {
44
+ fqdn: string;
45
+ get_environment_endpoint: string;
46
+ get_public_key_endpoint: string;
47
+ exchange_session_key: string;
48
+ get_server_details: string;
49
+ device_token: string;
50
+ iv: string;
51
+ }
52
+ export interface PropertyDetails {
53
+ property_name: string;
54
+ component: string;
55
+ }
56
+ export interface AirplayConfig {
57
+ x_api_key: string;
58
+ is_airplay_configured: string;
59
+ }
60
+ export interface Procentric {
61
+ protocol: string;
62
+ non_dvc: boolean;
63
+ loki_url: string;
64
+ }
65
+ export interface Chromecast {
66
+ default_source: string;
67
+ }
68
+ export interface ProIdiom {
69
+ proidiom_session_id: string;
70
+ }
71
+ export interface TvChannelDetail {
72
+ alexaCallSignCode: string;
73
+ channelName: string;
74
+ channelType: string;
75
+ directCable: string;
76
+ epgCode: string;
77
+ filters: Object;
78
+ hls: boolean;
79
+ iptv: IpTvDetail;
80
+ "isEncrypted": boolean;
81
+ "language": string;
82
+ "pid": string;
83
+ "primaryImage": string;
84
+ "stb": string;
85
+ "translation": string;
86
+ "tvChannelSensonicId": string;
87
+ "positionIndex": number;
88
+ }
89
+ export interface IpTvDetail {
90
+ ipAddress: string;
91
+ port: number;
92
+ protocol: string;
93
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,38 @@
1
+ import { ILogDataStream } from "./logs-interface";
2
+ import { TvChannelDetail } from "./tv-data-interface";
3
+ export interface IUtils {
4
+ getPublicIP(): Promise<string> | string;
5
+ getSystemIP(): Promise<string | null>;
6
+ getDeviceMac(): Promise<string | null>;
7
+ getDeviceDetails(): Promise<string> | string;
8
+ getSerialNo(): string | boolean;
9
+ getModelNo(): string | null;
10
+ fetchEnvironmentFromAPC(): Promise<object>;
11
+ getPublicKey(): Promise<string>;
12
+ exchangeSessionKey(): void;
13
+ fetchServerDetails(): void;
14
+ fetchDeviceDetailsFromDVS(): void;
15
+ generateKongToken(): void;
16
+ generateSessionKey(): void;
17
+ encryptSessionKey(sessionKey: string): Promise<string | boolean>;
18
+ getAppConfig(): void;
19
+ waitUntilCallbackNotResolved(cb: Function, conditionFn: Function, onError: Function, pollingInterval: number): void;
20
+ isTvRegistered(): void;
21
+ fetchIPChannels(): void;
22
+ addRegisteredTv(isRegistered: boolean, isFailed: boolean): void;
23
+ getCurrentChannel(): Promise<TvChannelDetail | boolean>;
24
+ getChannelVersion(): Promise<string | boolean>;
25
+ getTizenAppVersion(): void;
26
+ getCpuUsage(): void;
27
+ createLogData(logType: string, detectedLevel: string): Promise<ILogDataStream>;
28
+ postLogs(logData: Array<any>): void;
29
+ ipChannelUp(): void;
30
+ ipChannelDown(): void;
31
+ getCustomAppServerIP(): void;
32
+ getTvData(): void;
33
+ getServerInfo(): void;
34
+ fetchWelcomeLetter(): void;
35
+ setMinVolume(): void;
36
+ setMaxVolume(): void;
37
+ getCurrentScreen(): string | boolean;
38
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "tv-app-core-types",
3
+ "version": "1.0.0",
4
+ "description": "DigiValet TV App package for common utilities, functions and interfaces.",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "test": "echo \"Error: no test specified\" && exit 1",
9
+ "build": "tsc"
10
+ },
11
+ "author": "",
12
+ "license": "ISC",
13
+ "devDependencies": {
14
+ "@types/node": "^22.13.9",
15
+ "typescript": "^5.8.2"
16
+ },
17
+ "files": [
18
+ "dist"
19
+ ]
20
+ }