diff --git a/build/lib/interfaces.js.map b/build/lib/interfaces.js.map index 220aca6..5474b05 100644 --- a/build/lib/interfaces.js.map +++ b/build/lib/interfaces.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../../src/lib/interfaces.ts"], - "sourcesContent": ["export interface IDevice {\n name: string; // e.g. \"Tablet Hallway Entry\"\n id: string; // e.g. \"Tablet-Hallway-Entry\" (meets ioBroker state convention)\n ip: string;\n restProtocol: 'http' | 'https';\n restPort: number;\n restPassword: string;\n lastSeen: number; // timestamp\n isAlive: true | false;\n mqttInfoObjectsCreated: true | false; // Set to true once first time creation initiated\n mqttInfoKeys: string[]; // Info keys from MQTT info, like 'batteryLevel', 'deviceID', ...\n}\n\nexport interface ICmds {\n readonly id: string;\n readonly name: string;\n readonly type: 'number' | 'boolean' | 'string';\n readonly cmdOn?: string;\n readonly cmdOff?: string;\n readonly mqttOn?: string;\n readonly mqttOff?: string;\n}\n\nexport interface IMqttDevice {\n ip?: string;\n lastTimeActive?: number;\n mqttFirstReceived?: true | false;\n isActive?: true | false;\n timeoutNoUpdate?: ioBroker.Timeout | null;\n previousInfoPublishTime?: number;\n}\n\nexport interface IConst {\n readonly mqttEvents: string[];\n readonly cmds: ICmds[];\n readonly cmdsSwitches: ICmds[];\n}\n"], + "sourcesContent": ["export interface IDevice {\r\n name: string; // e.g. \"Tablet Hallway Entry\"\r\n id: string; // e.g. \"Tablet-Hallway-Entry\" (meets ioBroker state convention)\r\n ip: string;\r\n restProtocol: 'http' | 'https';\r\n restPort: number;\r\n restPassword: string;\r\n lastSeen: number; // timestamp\r\n isAlive: true | false;\r\n mqttInfoObjectsCreated: true | false; // Set to true once first time creation initiated\r\n mqttInfoKeys: string[]; // Info keys from MQTT info, like 'batteryLevel', 'deviceID', ...\r\n}\r\n\r\nexport interface ICmds {\r\n readonly id: string;\r\n readonly name: string;\r\n readonly type: 'number' | 'boolean' | 'string';\r\n readonly cmdOn?: string;\r\n readonly cmdOff?: string;\r\n readonly mqttOn?: string;\r\n readonly mqttOff?: string;\r\n}\r\n\r\nexport interface IMqttDevice {\r\n ip?: string;\r\n lastTimeActive?: number;\r\n mqttFirstReceived?: true | false;\r\n isActive?: true | false;\r\n timeoutNoUpdate?: ioBroker.Timeout | null;\r\n previousInfoPublishTime?: number;\r\n}\r\n\r\nexport interface IConst {\r\n readonly mqttEvents: string[];\r\n readonly cmds: ICmds[];\r\n readonly cmdsSwitches: ICmds[];\r\n}\r\n"], "mappings": ";;;;;;;;;;;;;AAAA;AAAA;", "names": [] } diff --git a/build/lib/restApi.js.map b/build/lib/restApi.js.map index 69a4678..ca73ea4 100644 --- a/build/lib/restApi.js.map +++ b/build/lib/restApi.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../../src/lib/restApi.ts"], - "sourcesContent": ["/**\n * REST API Class\n * Purpose: sending commands to Fully, since sending via MQTT is not supported by Fully.\n */\n\nimport axios from 'axios';\nimport { FullyMqtt } from '../main';\nimport { IDevice } from './interfaces';\n\n/**\n * @class RestApi\n * @desc To send commands via REST API to Fully Browser\n */\nexport class RestApiFully {\n /**\n * Constants and Variables\n */\n private readonly adapter: FullyMqtt;\n\n /**\n * Class Constructor\n * @param adapter - ioBroker adapter instance object\n */\n public constructor(adapter: FullyMqtt) {\n this.adapter = adapter;\n }\n\n /**\n * Get Info Object from Fully\n * @param ip - IP Address\n * @returns info object, or false in case of error\n */\n /* ----- NO LONGER USED since v0.1.0 ---\n public async getInfo(ip: string): Promise<{ [k: string]: any } | false> {\n try {\n const device = this.adapter.fullys[ip];\n const result = await this.axiosGetInfoOrSendCmd(device, 'getInfo');\n if (result.status && result.infoObj !== undefined) {\n return result.infoObj;\n } else {\n return false;\n }\n } catch (e) {\n this.adapter.log.error(`[REST] ${this.adapter.fullys[ip].name}: ${this.adapter.err2Str(e)}`);\n return false;\n }\n }\n */\n\n /**\n * Send a command to Fully\n * @param device - device object\n * @param cmd - 'loadStartURL', 'screenOn', etc.\n * @param val - state value\n * @returns true if successful, false if not\n */\n public async sendCmd(device: IDevice, cmd: string, val: any): Promise {\n try {\n interface ISendCmd {\n urlParameter: string;\n cleanSpaces?: true;\n encode?: true;\n }\n const cmds: { [k: string]: ISendCmd } = {\n textToSpeech: { urlParameter: 'cmd=textToSpeech&text=', cleanSpaces: true, encode: true },\n loadURL: { urlParameter: 'cmd=loadURL&url=', cleanSpaces: true, encode: true },\n startApplication: { urlParameter: 'cmd=startApplication&package=', cleanSpaces: true },\n screenBrightness: { urlParameter: 'cmd=setStringSetting&key=screenBrightness&value=' },\n setAudioVolume: { urlParameter: 'cmd=setAudioVolume&stream=3&level=' },\n };\n let finalUrlParam = '';\n if (cmd in cmds) {\n if (cmds[cmd].cleanSpaces) {\n val = val.toString().trim();\n val = val.replace(/\\s+/g, ' ');\n }\n if (cmds[cmd].encode) {\n val = val.toString().trim();\n val = encodeURIComponent(val);\n }\n finalUrlParam = cmds[cmd].urlParameter + val;\n } else {\n finalUrlParam = 'cmd=' + cmd;\n }\n\n const result = await this.axiosGetInfoOrSendCmd(device, 'sendCmd', cmd, finalUrlParam);\n return result.status;\n } catch (e) {\n this.adapter.log.error(`[REST] ${device.name}: ${this.adapter.err2Str(e)}`);\n return false;\n }\n }\n\n /**\n * Axios: Get Device Info or Send Command\n * @param device - device object\n * @param what - 'getInfo' to get device info or 'sendCmd' to send a command\n * @param cmd - if 'sendCmd': Command like \"screenOff\"\n * @param urlParam - if 'sendCmd': URL parameter like \"cmd=screenOff\"\n * @returns if what='getInfo': false if error, device info object if true\n * if what='sendCmd': false if error, true if successful\n *\n * TODO: Remove 'getInfo' since no longer used from version 0.1.0\n *\n */\n private async axiosGetInfoOrSendCmd(device: IDevice, what: 'getInfo' | 'sendCmd', cmd?: string, urlParam?: string): Promise<{ status: true | false; infoObj?: { [k: string]: any } }> {\n // Base URL\n const baseUrl = `${device.restProtocol}://${device.ip}:${device.restPort}/?password=${this.encodePassword(device.restPassword)}&type=json`;\n let finalUrl = '';\n if (what === 'getInfo') {\n finalUrl = baseUrl + '&cmd=deviceInfo';\n } else {\n finalUrl = baseUrl + '&' + urlParam;\n }\n\n // Axios config\n const config = {\n method: 'get',\n timeout: this.adapter.config.restTimeout,\n };\n\n try {\n // Log\n let urlHiddenPassword = finalUrl;\n urlHiddenPassword = urlHiddenPassword.replace(/password=.*&type/g, 'password=(hidden)&type');\n this.adapter.log.debug(`[REST] ${device.name}: Start ${what} ${what === 'sendCmd' ? '\"' + cmd + '\"' : ''}, URL: ${urlHiddenPassword}`);\n\n // Axios: Send command\n const response = await axios.get(finalUrl, config);\n\n // Errors\n if (response.status !== 200) {\n this.adapter.log.error(`[REST] ${device.name}: ${what} ${what === 'sendCmd' ? cmd : ''} failed: ${response.status} - ${response.statusText}`);\n this.adapter.onAliveChange('REST', device.ip, false, '${response.status} - ${response.statusText}'); // Update isAlive\n return { status: false };\n }\n if (!('status' in response)) {\n this.adapter.log.error(`[REST] ${device.name}: ${what} ${what === 'sendCmd' ? cmd : ''} failed: Response received but it does not have key 'status'`);\n this.adapter.onAliveChange('REST', device.ip, false, 'response without status key'); // Update isAlive\n return { status: false };\n }\n if (!('data' in response)) {\n this.adapter.log.error(`[REST] ${device.name}: ${what} ${what === 'sendCmd' ? cmd : ''} failed: Response received but it does not have key 'data'`);\n this.adapter.onAliveChange('REST', device.ip, false, 'response without data key'); // Update isAlive\n return { status: false };\n }\n this.adapter.log.debug(`[REST] ${device.name}: ${what} response.data: ${JSON.stringify(response.data)}`);\n\n // Handle Device Info\n if (what === 'getInfo') {\n this.adapter.onAliveChange('REST', device.ip, true, 'information successfully received'); // Update isAlive\n if (!('deviceName' in response.data)) {\n // we check if info object is ok by checking for deviceName, could also use any other key like screenOn etc.\n this.adapter.log.error(`[REST] ${device.name}: getInfo failed: Response data received, but data does not have key 'deviceName'`);\n return { status: false };\n }\n this.adapter.log.debug(`[REST] ${device.name}: getInfo was successful: Response = ${response.status} - ${response.statusText}`);\n return { status: true, infoObj: response.data };\n }\n\n // Handle all other commands\n if (!('status' in response.data)) {\n this.adapter.onAliveChange('REST', device.ip, false, 'response.data without status key'); // Update isAlive\n this.adapter.log.error(`[REST] ${device.name}: Sending ${what} failed: Response received but response.data does not have key 'status'`);\n return { status: false };\n }\n switch (response.data.status) {\n case 'OK':\n this.adapter.log.debug(`[REST] ${device.name}: Sending ${what} successful: - Status = \"${response.data.status}\", Message = \"${response.data.statustext}\"`);\n this.adapter.onAliveChange('REST', device.ip, true, 'successfully received response'); // Update isAlive\n return { status: true };\n case 'Error':\n if (response.data.statustext === 'Please login') {\n this.adapter.log.error(`[REST] ${device.name}: Error: Remote Admin Password seems to be incorrect. Sending ${what} failed.`);\n this.adapter.onAliveChange('REST', device.ip, false, 'incorrect Remote Admin password'); // Update isAlive\n } else {\n this.adapter.log.error(`[REST] ${device.name}: Error: Sending cmd ${what} failed, received status text: ${response.data.statustext}`);\n this.adapter.onAliveChange('REST', device.ip, false, `sending cmd ${what} failed`); // Update isAlive\n }\n return { status: false };\n default:\n // Unexpected\n this.adapter.log.error(`[REST] ${device.name}: Undefined response.data.status = \"${response.data.status}\" when sending cmd ${what}: ${response.status} - ${response.statusText}`);\n this.adapter.onAliveChange('REST', device.ip, false, 'received undefined response.data.status');\n return { status: false };\n }\n } catch (err) {\n const errTxt = `[REST] ${device.name}: Sending ${what} failed`;\n this.adapter.onAliveChange('REST', device.ip, false, `sending ${what} failed`); // Update isAlive\n if (axios.isAxiosError(err)) {\n if (!err?.response) {\n this.adapter.log.warn(`${errTxt}: No response`);\n } else if (err.response?.status === 400) {\n this.adapter.log.error('${errTxt}: Login Failed - Error 400 - ' + err.response?.statusText);\n } else if (err.response?.status) {\n this.adapter.log.error(`${errTxt}: ${err.response.status} - ${err.response.statusText}`);\n } else {\n this.adapter.log.error(`${errTxt}: General Error`);\n }\n } else {\n this.adapter.log.error(`[REST] ${device.name} Error: ${this.adapter.err2Str(err)}`);\n }\n return { status: false };\n }\n }\n\n /**\n * To encode a password to be sent to web server\n * Source: fixedEncodeURIComponent() from https://github.com/arteck/ioBroker.fullybrowser/blob/master/main.js\n * @param pw Password\n * @returns Encoded password\n */\n private encodePassword(pw: string): string {\n return encodeURIComponent(pw).replace(/[!'()*]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`);\n }\n}\n"], + "sourcesContent": ["/**\r\n * REST API Class\r\n * Purpose: sending commands to Fully, since sending via MQTT is not supported by Fully.\r\n */\r\n\r\nimport axios from 'axios';\r\nimport { FullyMqtt } from '../main';\r\nimport { IDevice } from './interfaces';\r\n\r\n/**\r\n * @class RestApi\r\n * @desc To send commands via REST API to Fully Browser\r\n */\r\nexport class RestApiFully {\r\n /**\r\n * Constants and Variables\r\n */\r\n private readonly adapter: FullyMqtt;\r\n\r\n /**\r\n * Class Constructor\r\n * @param adapter - ioBroker adapter instance object\r\n */\r\n public constructor(adapter: FullyMqtt) {\r\n this.adapter = adapter;\r\n }\r\n\r\n /**\r\n * Get Info Object from Fully\r\n * @param ip - IP Address\r\n * @returns info object, or false in case of error\r\n */\r\n /* ----- NO LONGER USED since v0.1.0 ---\r\n public async getInfo(ip: string): Promise<{ [k: string]: any } | false> {\r\n try {\r\n const device = this.adapter.fullys[ip];\r\n const result = await this.axiosGetInfoOrSendCmd(device, 'getInfo');\r\n if (result.status && result.infoObj !== undefined) {\r\n return result.infoObj;\r\n } else {\r\n return false;\r\n }\r\n } catch (e) {\r\n this.adapter.log.error(`[REST] ${this.adapter.fullys[ip].name}: ${this.adapter.err2Str(e)}`);\r\n return false;\r\n }\r\n }\r\n */\r\n\r\n /**\r\n * Send a command to Fully\r\n * @param device - device object\r\n * @param cmd - 'loadStartURL', 'screenOn', etc.\r\n * @param val - state value\r\n * @returns true if successful, false if not\r\n */\r\n public async sendCmd(device: IDevice, cmd: string, val: any): Promise {\r\n try {\r\n interface ISendCmd {\r\n urlParameter: string;\r\n cleanSpaces?: true;\r\n encode?: true;\r\n }\r\n const cmds: { [k: string]: ISendCmd } = {\r\n textToSpeech: { urlParameter: 'cmd=textToSpeech&text=', cleanSpaces: true, encode: true },\r\n loadURL: { urlParameter: 'cmd=loadURL&url=', cleanSpaces: true, encode: true },\r\n startApplication: { urlParameter: 'cmd=startApplication&package=', cleanSpaces: true },\r\n screenBrightness: { urlParameter: 'cmd=setStringSetting&key=screenBrightness&value=' },\r\n setAudioVolume: { urlParameter: 'cmd=setAudioVolume&stream=3&level=' },\r\n };\r\n let finalUrlParam = '';\r\n if (cmd in cmds) {\r\n if (cmds[cmd].cleanSpaces) {\r\n val = val.toString().trim();\r\n val = val.replace(/\\s+/g, ' ');\r\n }\r\n if (cmds[cmd].encode) {\r\n val = val.toString().trim();\r\n val = encodeURIComponent(val);\r\n }\r\n finalUrlParam = cmds[cmd].urlParameter + val;\r\n } else {\r\n finalUrlParam = 'cmd=' + cmd;\r\n }\r\n\r\n const result = await this.axiosGetInfoOrSendCmd(device, 'sendCmd', cmd, finalUrlParam);\r\n return result.status;\r\n } catch (e) {\r\n this.adapter.log.error(`[REST] ${device.name}: ${this.adapter.err2Str(e)}`);\r\n return false;\r\n }\r\n }\r\n\r\n /**\r\n * Axios: Get Device Info or Send Command\r\n * @param device - device object\r\n * @param what - 'getInfo' to get device info or 'sendCmd' to send a command\r\n * @param cmd - if 'sendCmd': Command like \"screenOff\"\r\n * @param urlParam - if 'sendCmd': URL parameter like \"cmd=screenOff\"\r\n * @returns if what='getInfo': false if error, device info object if true\r\n * if what='sendCmd': false if error, true if successful\r\n *\r\n * TODO: Remove 'getInfo' since no longer used from version 0.1.0\r\n *\r\n */\r\n private async axiosGetInfoOrSendCmd(device: IDevice, what: 'getInfo' | 'sendCmd', cmd?: string, urlParam?: string): Promise<{ status: true | false; infoObj?: { [k: string]: any } }> {\r\n // Base URL\r\n const baseUrl = `${device.restProtocol}://${device.ip}:${device.restPort}/?password=${this.encodePassword(device.restPassword)}&type=json`;\r\n let finalUrl = '';\r\n if (what === 'getInfo') {\r\n finalUrl = baseUrl + '&cmd=deviceInfo';\r\n } else {\r\n finalUrl = baseUrl + '&' + urlParam;\r\n }\r\n\r\n // Axios config\r\n const config = {\r\n method: 'get',\r\n timeout: this.adapter.config.restTimeout,\r\n };\r\n\r\n try {\r\n // Log\r\n let urlHiddenPassword = finalUrl;\r\n urlHiddenPassword = urlHiddenPassword.replace(/password=.*&type/g, 'password=(hidden)&type');\r\n this.adapter.log.debug(`[REST] ${device.name}: Start ${what} ${what === 'sendCmd' ? '\"' + cmd + '\"' : ''}, URL: ${urlHiddenPassword}`);\r\n\r\n // Axios: Send command\r\n const response = await axios.get(finalUrl, config);\r\n\r\n // Errors\r\n if (response.status !== 200) {\r\n this.adapter.log.error(`[REST] ${device.name}: ${what} ${what === 'sendCmd' ? cmd : ''} failed: ${response.status} - ${response.statusText}`);\r\n this.adapter.onAliveChange('REST', device.ip, false, '${response.status} - ${response.statusText}'); // Update isAlive\r\n return { status: false };\r\n }\r\n if (!('status' in response)) {\r\n this.adapter.log.error(`[REST] ${device.name}: ${what} ${what === 'sendCmd' ? cmd : ''} failed: Response received but it does not have key 'status'`);\r\n this.adapter.onAliveChange('REST', device.ip, false, 'response without status key'); // Update isAlive\r\n return { status: false };\r\n }\r\n if (!('data' in response)) {\r\n this.adapter.log.error(`[REST] ${device.name}: ${what} ${what === 'sendCmd' ? cmd : ''} failed: Response received but it does not have key 'data'`);\r\n this.adapter.onAliveChange('REST', device.ip, false, 'response without data key'); // Update isAlive\r\n return { status: false };\r\n }\r\n this.adapter.log.debug(`[REST] ${device.name}: ${what} response.data: ${JSON.stringify(response.data)}`);\r\n\r\n // Handle Device Info\r\n if (what === 'getInfo') {\r\n this.adapter.onAliveChange('REST', device.ip, true, 'information successfully received'); // Update isAlive\r\n if (!('deviceName' in response.data)) {\r\n // we check if info object is ok by checking for deviceName, could also use any other key like screenOn etc.\r\n this.adapter.log.error(`[REST] ${device.name}: getInfo failed: Response data received, but data does not have key 'deviceName'`);\r\n return { status: false };\r\n }\r\n this.adapter.log.debug(`[REST] ${device.name}: getInfo was successful: Response = ${response.status} - ${response.statusText}`);\r\n return { status: true, infoObj: response.data };\r\n }\r\n\r\n // Handle all other commands\r\n if (!('status' in response.data)) {\r\n this.adapter.onAliveChange('REST', device.ip, false, 'response.data without status key'); // Update isAlive\r\n this.adapter.log.error(`[REST] ${device.name}: Sending ${what} failed: Response received but response.data does not have key 'status'`);\r\n return { status: false };\r\n }\r\n switch (response.data.status) {\r\n case 'OK':\r\n this.adapter.log.debug(`[REST] ${device.name}: Sending ${what} successful: - Status = \"${response.data.status}\", Message = \"${response.data.statustext}\"`);\r\n this.adapter.onAliveChange('REST', device.ip, true, 'successfully received response'); // Update isAlive\r\n return { status: true };\r\n case 'Error':\r\n if (response.data.statustext === 'Please login') {\r\n this.adapter.log.error(`[REST] ${device.name}: Error: Remote Admin Password seems to be incorrect. Sending ${what} failed.`);\r\n this.adapter.onAliveChange('REST', device.ip, false, 'incorrect Remote Admin password'); // Update isAlive\r\n } else {\r\n this.adapter.log.error(`[REST] ${device.name}: Error: Sending cmd ${what} failed, received status text: ${response.data.statustext}`);\r\n this.adapter.onAliveChange('REST', device.ip, false, `sending cmd ${what} failed`); // Update isAlive\r\n }\r\n return { status: false };\r\n default:\r\n // Unexpected\r\n this.adapter.log.error(`[REST] ${device.name}: Undefined response.data.status = \"${response.data.status}\" when sending cmd ${what}: ${response.status} - ${response.statusText}`);\r\n this.adapter.onAliveChange('REST', device.ip, false, 'received undefined response.data.status');\r\n return { status: false };\r\n }\r\n } catch (err) {\r\n const errTxt = `[REST] ${device.name}: Sending ${what} failed`;\r\n this.adapter.onAliveChange('REST', device.ip, false, `sending ${what} failed`); // Update isAlive\r\n if (axios.isAxiosError(err)) {\r\n if (!err?.response) {\r\n this.adapter.log.warn(`${errTxt}: No response`);\r\n } else if (err.response?.status === 400) {\r\n this.adapter.log.error('${errTxt}: Login Failed - Error 400 - ' + err.response?.statusText);\r\n } else if (err.response?.status) {\r\n this.adapter.log.error(`${errTxt}: ${err.response.status} - ${err.response.statusText}`);\r\n } else {\r\n this.adapter.log.error(`${errTxt}: General Error`);\r\n }\r\n } else {\r\n this.adapter.log.error(`[REST] ${device.name} Error: ${this.adapter.err2Str(err)}`);\r\n }\r\n return { status: false };\r\n }\r\n }\r\n\r\n /**\r\n * To encode a password to be sent to web server\r\n * Source: fixedEncodeURIComponent() from https://github.com/arteck/ioBroker.fullybrowser/blob/master/main.js\r\n * @param pw Password\r\n * @returns Encoded password\r\n */\r\n private encodePassword(pw: string): string {\r\n return encodeURIComponent(pw).replace(/[!'()*]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`);\r\n }\r\n}\r\n"], "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,mBAAkB;AAQX,MAAM,aAAa;AAAA,EAUf,YAAY,SAAoB;AACnC,SAAK,UAAU;AAAA,EACnB;AAAA,EA+BA,MAAa,QAAQ,QAAiB,KAAa,KAA4B;AAC3E,QAAI;AAMA,YAAM,OAAkC;AAAA,QACpC,cAAc,EAAE,cAAc,0BAA0B,aAAa,MAAM,QAAQ,KAAK;AAAA,QACxF,SAAS,EAAE,cAAc,oBAAoB,aAAa,MAAM,QAAQ,KAAK;AAAA,QAC7E,kBAAkB,EAAE,cAAc,iCAAiC,aAAa,KAAK;AAAA,QACrF,kBAAkB,EAAE,cAAc,mDAAmD;AAAA,QACrF,gBAAgB,EAAE,cAAc,qCAAqC;AAAA,MACzE;AACA,UAAI,gBAAgB;AACpB,UAAI,OAAO,MAAM;AACb,YAAI,KAAK,KAAK,aAAa;AACvB,gBAAM,IAAI,SAAS,EAAE,KAAK;AAC1B,gBAAM,IAAI,QAAQ,QAAQ,GAAG;AAAA,QACjC;AACA,YAAI,KAAK,KAAK,QAAQ;AAClB,gBAAM,IAAI,SAAS,EAAE,KAAK;AAC1B,gBAAM,mBAAmB,GAAG;AAAA,QAChC;AACA,wBAAgB,KAAK,KAAK,eAAe;AAAA,MAC7C,OAAO;AACH,wBAAgB,SAAS;AAAA,MAC7B;AAEA,YAAM,S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