openc3-cosmos-tool-cmdtlmserver 5.16.2 → 5.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/tools/cmdtlmserver/js/348.js.map +1 -1
- data/tools/cmdtlmserver/js/59.js +2 -0
- data/tools/cmdtlmserver/js/59.js.map +1 -0
- data/tools/cmdtlmserver/js/904.js +1 -1
- data/tools/cmdtlmserver/js/904.js.map +1 -1
- data/tools/cmdtlmserver/js/app.js +1 -1
- data/tools/cmdtlmserver/js/app.js.map +1 -1
- metadata +4 -4
- data/tools/cmdtlmserver/js/950.js +0 -2
- data/tools/cmdtlmserver/js/950.js.map +0 -1
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";(self["webpackChunk_openc3_cosmos_tool_cmdtlmserver"]=self["webpackChunk_openc3_cosmos_tool_cmdtlmserver"]||[]).push([[904],{2904:(e,t,r)=>{r.d(t,{x:()=>o});var s=r(814),n=(r(7107),r(2482),r(7067),r(4147),r(2682),r(785),r(8357),r(6196),r(821),r(6554),r(8472),r(7404),r(5803),r(3912),r(7010),r(
|
1
|
+
"use strict";(self["webpackChunk_openc3_cosmos_tool_cmdtlmserver"]=self["webpackChunk_openc3_cosmos_tool_cmdtlmserver"]||[]).push([[904],{2904:(e,t,r)=>{r.d(t,{x:()=>o});var s=r(814),n=(r(7107),r(2482),r(7067),r(4147),r(2682),r(785),r(8357),r(6196),r(821),r(6554),r(8472),r(7404),r(5803),r(3912),r(7010),r(3816)),_=r(1649);const c=new _["default"],i=n.A.create({baseURL:location.origin,timeout:6e4,params:{}});i.interceptors.response.use((e=>e),(e=>{if(e.response){var t,r,s,n,_;if(401===e.response.status&&OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity,!0).then((function(e){e&&OpenC3Auth.setTokens()})),e.response.config.headers["Ignore-Errors"]&&e.response.config.headers["Ignore-Errors"].includes(e.response.status.toString()))return Promise.reject(e);let a=`HTTP ${e.response.status} - `;if(null!==(t=e.response)&&void 0!==t&&t.statusText&&(a+=`${e.response.statusText} `),null!==(r=e.response)&&void 0!==r&&null!==(r=r.config)&&void 0!==r&&r.data&&(a+=`${e.response.config.data} `),null!==(s=e.response)&&void 0!==s&&null!==(s=s.data)&&void 0!==s&&s.message)a+=`${e.response.data.message}`;else if(null!==(n=e.response)&&void 0!==n&&null!==(n=n.data)&&void 0!==n&&n.exception)a+=`${e.response.data.exception}`;else if(null!==(_=e.response)&&void 0!==_&&null!==(_=_.data)&&void 0!==_&&null!==(_=_.error)&&void 0!==_&&_.message)e.response.data.error.class&&(a+=`${e.response.data.error.class} `),a+=`${e.response.data.error.message}`;else{var i;a+=`${null===(i=e.response)||void 0===i?void 0:i.data}`}throw c.$notify&&c.$notify.serious({title:"Network error",body:a}),e}throw e}));const a=i;class o{constructor(){(0,s.A)(this,"id",1)}async exec(e,t,r={},s={},n=6e4){try{let e=await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity);e&&OpenC3Auth.setTokens()}catch(c){OpenC3Auth.login()}this.id=this.id+1;try{r["scope"]=window.openc3Scope;const _=await a.post("/openc3-api/api",{jsonrpc:"2.0",method:e,params:t,id:this.id,keyword_params:r},{headers:{Authorization:localStorage.openc3Token,"Content-Type":"application/json-rpc",...s},timeout:n});return _.data.result}catch(c){var _=new Error;throw c.response?(_.name=c.response.data.error.data.class,_.message=c.response.data.error.data.message):c.request?(_.name="Request error",_.message="Request error, no response received"):_.name="Unknown error",_}}decode_openc3_type(e){if(null!==e&&"object"===typeof e&&"Float"==e.json_class&&e.raw){if("NaN"==e.raw)return NaN;if("Infinity"==e.raw)return 1/0;if("-Infinity"==e.raw)return-1/0}return null}encode_openc3_type(e){return Number.isNaN(e)?{json_class:"Float",raw:"NaN"}:e==Number.POSITIVE_INFINITY?{json_class:"Float",raw:"Infinity"}:e==Number.NEGATIVE_INFINITY?{json_class:"Float",raw:"-Infinity"}:null}ensure_offline_access(){this.offline_access_needed().then((e=>{e&&(localStorage.openc3OfflineToken?this.set_offline_access(localStorage.openc3OfflineToken).then((()=>{delete localStorage.openc3OfflineToken})):OpenC3Auth.getOfflineAccess())}))}offline_access_needed(){return this.exec("offline_access_needed",[])}set_offline_access(e){return this.exec("set_offline_access",[e])}get_all_interface_info(){return this.exec("get_all_interface_info",[])}map_target_to_interface(e,t){return this.exec("map_target_to_interface",[e,t])}connect_interface(e,...t){return t.length>0?this.exec("connect_interface",[e,...t]):this.exec("connect_interface",[e])}disconnect_interface(e){return this.exec("disconnect_interface",[e])}interface_cmd(e,t,...r){return this.exec("interface_cmd",[e,t,...r])}get_all_router_info(){return this.exec("get_all_router_info",[])}connect_router(e){return this.exec("connect_router",[e])}disconnect_router(e){return this.exec("disconnect_router",[e])}get_target_interfaces(){return this.exec("get_target_interfaces",[])}get_all_target_info(){return this.exec("get_all_target_info",[])}get_tlm_cnts(e){return this.exec("get_tlm_cnts",[e])}get_item(e,t,r){return this.exec("get_item",[e,t,r])}get_param(e,t,r){return this.exec("get_param",[e,t,r])}get_parameter(e,t,r){return this.exec("get_parameter",[e,t,r])}get_limits_sets(){return this.exec("get_limits_sets",[])}get_limits_set(){return this.exec("get_limits_set",[])}set_limits_set(e){return this.exec("set_limits_set",[e])}get_target(e){return this.exec("get_target",[e])}get_target_names(){return this.exec("get_target_names",[])}get_target_list(){return this.exec("get_target_list",[])}get_tlm(e,t){return this.exec("get_tlm",[e,t])}get_telemetry(e,t){return this.exec("get_telemetry",[e,t])}get_all_tlm(e){return this.exec("get_all_tlm",[e])}get_all_telemetry(e){return this.exec("get_all_telemetry",[e])}get_all_tlm_names(e){return this.exec("get_all_tlm_names",[e])}get_all_telemetry_names(e){return this.exec("get_all_telemetry_names",[e])}async get_tlm_packet(e,t,r,s=30){const n=await this.exec("get_tlm_packet",[e,t],{type:r,stale_time:s});if(null!=n)for(var _=n.length,c=null,i=0;i<_;i++)c=this.decode_openc3_type(n[i][1]),null!==c&&(n[i][1]=c);return n}get_packet_derived_items(e,t){return this.exec("get_packet_derived_items",[e,t])}get_tlm_buffer(e,t){return this.exec("get_tlm_buffer",[e,t])}async get_tlm_values(e,t=30,r=null){let s={stale_time:t};null!==r&&(s["cache_timeout"]=r);const n=await this.exec("get_tlm_values",[e],s,{},1e4);for(var _=n[0].length,c=null,i=0;i<_;i++)c=this.decode_openc3_type(n[0][i]),null!==c&&(n[0][i]=c);return n}get_limits(e,t,r){return this.exec("get_limits",[e,t,r])}async tlm(e,t,r,s="CONVERTED"){let n=null;if(void 0===t)n=await this.exec("tlm",[e]);else if(void 0===r){if(!["RAW","CONVERTED","FORMATTED","WITH_UNITS"].includes(t)){var _=new Error;throw _.name="TypeError",_.message=`Invalid data type ${t}. Valid options are RAW, CONVERTED, FORMATTED, and WITH_UNITS.`,_}n=await this.exec("tlm",[e],{type:t})}else n=await this.exec("tlm",[e,t,r],{type:s});var c=this.decode_openc3_type(n);return null!==c&&(n=c),n}async inject_tlm(e,t,r=null,s="CONVERTED"){data=await this.exec("inject_tlm",[e,t,r],{type:s})}set_tlm(e,t,r,s){return this.exec("set_tlm",[e,t,r],{type:s})}override_tlm(e,t,r,s){return this.exec("override_tlm",[e,t,r],{type:s})}get_overrides(){return this.exec("get_overrides")}normalize_tlm(e,t,r,s){return this.exec("normalize_tlm",[e,t,r],{type:s})}get_all_cmds(e){return this.exec("get_all_cmds",[e])}get_all_commands(e){return this.exec("get_all_commands",[e])}get_all_cmd_names(e){return this.exec("get_all_cmd_names",[e])}get_all_command_names(e){return this.exec("get_all_command_names",[e])}get_cmd(e,t){return this.exec("get_cmd",[e,t])}get_command(e,t){return this.exec("get_command",[e,t])}get_cmd_cnts(e){return this.exec("get_cmd_cnts",[e])}get_cmd_value(e,t,r,s="CONVERTED"){return this.exec("get_cmd_value",[e,t,r,s])}get_cmd_buffer(e,t){return this.exec("get_cmd_buffer",[e,t])}_cmd(e,t,r,s,n){var _=null;for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(_=this.encode_openc3_type(s[c]),null!==_&&(s[c]=_));return this.exec(e,[t,r,s],{},n)}get_cmd_hazardous(e,t,r){return void 0===t?this.exec("get_cmd_hazardous",e):this._cmd("get_cmd_hazardous",e,t,r)}cmd(e,t,r,s={}){return void 0===t?this.exec("cmd",e,{},s):this._cmd("cmd",e,t,r,s)}cmd_no_range_check(e,t,r){return void 0===t?this.exec("cmd_no_range_check",e):this._cmd("cmd_no_range_check",e,t,r)}cmd_raw(e,t,r){return void 0===t?this.exec("cmd_raw",e):this._cmd("cmd_raw",e,t,r)}cmd_raw_no_range_check(e,t,r){return void 0===t?this.exec("cmd_raw_no_range_check",e):this._cmd("cmd_raw_no_range_check",e,t,r)}cmd_no_hazardous_check(e,t,r){return void 0===t?this.exec("cmd_no_hazardous_check",e):this._cmd("cmd_no_hazardous_check",e,t,r)}cmd_no_checks(e,t,r){return void 0===t?this.exec("cmd_no_checks",e):this._cmd("cmd_no_checks",e,t,r)}cmd_raw_no_hazardous_check(e,t,r){return void 0===t?this.exec("cmd_raw_no_hazardous_check",e):this._cmd("cmd_raw_no_hazardous_check",e,t,r)}cmd_raw_no_checks(e,t,r){return void 0===t?this.exec("cmd_raw_no_checks",e):this._cmd("cmd_raw_no_checks",e,t,r)}build_cmd(e,t,r){return void 0===t?this.exec("build_cmd",e):this._cmd("build_cmd",e,t,r)}build_command(e,t,r){return void 0===t?this.exec("build_command",e):this._cmd("build_command",e,t,r)}get_interface_names(){return this.exec("get_interface_names",[])}send_raw(e,t){return this.exec("send_raw",[e,t])}list_configs(e){return this.exec("list_configs",[e])}load_config(e,t){return this.exec("load_config",[e,t])}save_config(e,t,r){return this.exec("save_config",[e,t,r])}delete_config(e,t){return this.exec("delete_config",[e,t])}enable_limits(e,t,r){return this.exec("enable_limits",[e,t,r])}disable_limits(e,t,r){return this.exec("disable_limits",[e,t,r])}get_out_of_limits(){return this.exec("get_out_of_limits",[])}get_overall_limits_state(e){return this.exec("get_overall_limits_state",[e])}list_settings(){return this.exec("list_settings",[])}get_all_settings(){return this.exec("get_all_settings",[])}get_setting(e){return this.exec("get_setting",[e])}get_settings(e){return this.exec("get_settings",e)}set_setting(e,t){return this.exec("set_setting",[e,t])}save_setting(e,t){return this.exec("save_setting",[e,t])}get_metrics(){return this.exec("get_metrics",[])}async hashString(e){if(window.isSecureContext){const t=(new TextEncoder).encode(e),r=await crypto.subtle.digest("SHA-256",t),s=new Uint8Array(r);return Array.from(s).map((e=>e.toString(16).padStart(2,"0"))).join("")}}}}}]);
|
2
2
|
//# sourceMappingURL=904.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"js/904.js","mappings":"mUAyBA,MAAMA,EAAc,IAAIC,EAAAA,WAElBC,EAAgBC,EAAAA,EAAMC,OAAO,CACjCC,QAASC,SAASC,OAClBC,QAAS,IACTC,OAAQ,CAAC,IAGXP,EAAcQ,aAAaC,SAASC,KACjCD,GAAaA,IACbE,IACC,GAAIA,EAAMF,SAAU,KAAAG,EAAAC,EAAAC,EAAAC,EAAAC,EAkBlB,GAjB8B,MAA1BL,EAAMF,SAASQ,QACjBC,WAAWC,YAAYD,WAAWE,oBAAoB,GAAMC,MAC1D,SAAUC,GACJA,GACFJ,WAAWK,WAEf,IAYFZ,EAAMF,SAASe,OAAOC,QAAQ,kBAC9Bd,EAAMF,SAASe,OAAOC,QAAQ,iBAAiBC,SAC7Cf,EAAMF,SAASQ,OAAOU,YAGxB,OAAOC,QAAQC,OAAOlB,GAExB,IAAImB,EAAQ,QAAOnB,EAAMF,SAASQ,YAOlC,GANkB,QAAlBL,EAAID,EAAMF,gBAAQ,IAAAG,GAAdA,EAAgBmB,aAClBD,GAAS,GAAEnB,EAAMF,SAASsB,eAEV,QAAlBlB,EAAIF,EAAMF,gBAAQ,IAAAI,GAAQ,QAARA,EAAdA,EAAgBW,cAAM,IAAAX,GAAtBA,EAAwBmB,OAC1BF,GAAS,GAAEnB,EAAMF,SAASe,OAAOQ,SAEjB,QAAlBlB,EAAIH,EAAMF,gBAAQ,IAAAK,GAAM,QAANA,EAAdA,EAAgBkB,YAAI,IAAAlB,GAApBA,EAAsBmB,QACxBH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B,CAAC0D,EAAQC,EAAQC,GACrD,CAEA4E,cAAAA,CAAe9E,EAAQC,EAAQC,GAC7B,OAAOvD,KAAKL,KAAK,iBAAkB,CAAC0D,EAAQC,EAAQC,GACtD,CAEA6E,iBAAAA,GACE,OAAOpI,KAAKL,KAAK,oBAAqB,GACxC,CAEA0I,wBAAAA,CAAyBC,GACvB,OAAOtI,KAAKL,KAAK,2BAA4B,CAAC2I,GAChD,CAEAC,aAAAA,GACE,OAAOvI,KAAKL,KAAK,gBAAiB,GACpC,CAEA6I,gBAAAA,GACE,OAAOxI,KAAKL,KAAK,mBAAoB,GACvC,CAEA8I,WAAAA,CAAY5H,GACV,OAAOb,KAAKL,KAAK,cAAe,CAACkB,GACnC,CAEA6H,YAAAA,CAAaC,GACX,OAAO3I,KAAKL,KAAK,eAAgBgJ,EACnC,CAEAC,WAAAA,CAAY/H,EAAM7B,GAChB,OAAOgB,KAAKL,KAAK,cAAe,CAACkB,EAAM7B,GACzC,CAGA6J,YAAAA,CAAahI,EAAM7B,GACjB,OAAOgB,KAAKL,KAAK,eAAgB,CAACkB,EAAM7B,GAC1C,CAEA8J,WAAAA,GACE,OAAO9I,KAAKL,KAAK,cAAe,GAClC,CAGA,gBAAMoJ,CAAWC,GACf,GAAI9I,OAAO+I,gBAAiB,CAE1B,MAAMC,GAAc,IAAIC,aAAcC,OAAOJ,GAGvCK,QAA0BC,OAAOC,OAAOC,OAC5C,UACAN,GAIIO,EAAkB,IAAIC,WAAWL,GAGvC,OAAOM,MAAMC,KAAKH,GACfI,KAAKC,GAAMA,EAAEnL,SAAS,IAAIoL,SAAS,EAAG,OACtCC,KAAK,GACV,CAEF,E","sources":["webpack://@openc3/cosmos-tool-cmdtlmserver/../openc3-tool-common/src/services/axios.js","webpack://@openc3/cosmos-tool-cmdtlmserver/../openc3-tool-common/src/services/openc3-api.js"],"sourcesContent":["/*\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2022, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n*/\n\nimport axios from 'axios'\nimport Vue from 'vue'\n\nconst vueInstance = new Vue()\n\nconst axiosInstance = axios.create({\n baseURL: location.origin,\n timeout: 60000,\n params: {},\n})\n\naxiosInstance.interceptors.response.use(\n (response) => response,\n (error) => {\n if (error.response) {\n if (error.response.status === 401) {\n OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity, true).then(\n function (refreshed) {\n if (refreshed) {\n OpenC3Auth.setTokens()\n }\n },\n )\n }\n // Individual tools can set 'Ignore-Errors' to an error code\n // they potentially expect, e.g. '500', in which case we ignore it\n // For example in CommandSender.vue:\n // obs = this.api.cmd(targetName, commandName, paramList, {\n // headers: {\n // 'Ignore-Errors': '404',\n // },\n // })\n if (\n error.response.config.headers['Ignore-Errors'] &&\n error.response.config.headers['Ignore-Errors'].includes(\n error.response.status.toString(),\n )\n ) {\n return Promise.reject(error)\n }\n let body = `HTTP ${error.response.status} - `\n if (error.response?.statusText) {\n body += `${error.response.statusText} `\n }\n if (error.response?.config?.data) {\n body += `${error.response.config.data} `\n }\n if (error.response?.data?.message) {\n body += `${error.response.data.message}`\n } else if (error.response?.data?.exception) {\n body += `${error.response.data.exception}`\n } else if (error.response?.data?.error?.message) {\n if (error.response.data.error.class) {\n body += `${error.response.data.error.class} `\n }\n body += `${error.response.data.error.message}`\n } else {\n body += `${error.response?.data}`\n }\n if (vueInstance.$notify) {\n vueInstance.$notify.serious({\n title: 'Network error',\n body,\n })\n }\n throw error\n } else {\n throw error\n }\n },\n)\n\nexport default axiosInstance\n","/*\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2024, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n*/\n\nimport axios from './axios.js'\n\nexport class OpenC3Api {\n id = 1\n\n constructor() {}\n\n async exec(\n method,\n params,\n kwparams = {},\n headerOptions = {},\n timeout = 60000\n ) {\n try {\n let refreshed = await OpenC3Auth.updateToken(\n OpenC3Auth.defaultMinValidity\n )\n if (refreshed) {\n OpenC3Auth.setTokens()\n }\n } catch (error) {\n OpenC3Auth.login()\n }\n this.id = this.id + 1\n try {\n kwparams['scope'] = window.openc3Scope\n const response = await axios.post(\n '/openc3-api/api',\n {\n jsonrpc: '2.0',\n method: method,\n params: params,\n id: this.id,\n keyword_params: kwparams,\n },\n {\n headers: {\n Authorization: localStorage.openc3Token,\n 'Content-Type': 'application/json-rpc',\n ...headerOptions,\n },\n timeout: timeout,\n }\n )\n // var data = response.data\n // if (data.error) {\n // var err = new Error()\n // err.name = data.error.data.class\n // err.message = data.error.data.message\n // console.log(data.error.data.backtrace.join('\\n'))\n // throw err\n // }\n return response.data.result\n } catch (error) {\n var err = new Error()\n if (error.response) {\n // The request was made and the server responded with a\n // status code that falls out of the range of 2xx\n err.name = error.response.data.error.data.class\n err.message = error.response.data.error.data.message\n } else if (error.request) {\n // The request was made but no response was received, `error.request`\n // is an instance of XMLHttpRequest in the browser and an instance\n // of http.ClientRequest in Node.js\n err.name = 'Request error'\n // NOTE: Openc3Screen.vue uses this specific message to determine\n // if the CmdTlmApi server is down. Don't change unless also changing there.\n err.message = 'Request error, no response received'\n } else {\n // Something happened in setting up the request and triggered an Error\n err.name = 'Unknown error'\n }\n throw err\n }\n }\n\n decode_openc3_type(val) {\n if (val !== null && typeof val === 'object') {\n if (val.json_class == 'Float' && val.raw) {\n if (val.raw == 'NaN') {\n return NaN\n } else if (val.raw == 'Infinity') {\n return Infinity\n } else if (val.raw == '-Infinity') {\n return -Infinity\n }\n }\n }\n return null\n }\n\n encode_openc3_type(val) {\n if (Number.isNaN(val)) {\n return { json_class: 'Float', raw: 'NaN' }\n } else if (val == Number.POSITIVE_INFINITY) {\n return { json_class: 'Float', raw: 'Infinity' }\n } else if (val == Number.NEGATIVE_INFINITY) {\n return { json_class: 'Float', raw: '-Infinity' }\n }\n return null\n }\n\n ensure_offline_access() {\n this.offline_access_needed().then((needed) => {\n if (needed) {\n if (localStorage.openc3OfflineToken) {\n this.set_offline_access(localStorage.openc3OfflineToken).then(() => {\n delete localStorage.openc3OfflineToken\n })\n } else {\n OpenC3Auth.getOfflineAccess()\n }\n }\n })\n }\n\n // ***********************************************\n // The following APIs are used by the CmdTlmServer\n // ***********************************************\n\n offline_access_needed() {\n return this.exec('offline_access_needed', [])\n }\n\n set_offline_access(offline_access_token) {\n return this.exec('set_offline_access', [offline_access_token])\n }\n\n get_all_interface_info() {\n return this.exec('get_all_interface_info', [])\n }\n\n map_target_to_interface(target_name, interface_name) {\n return this.exec('map_target_to_interface', [target_name, interface_name])\n }\n\n connect_interface(interface_name, ...interface_params) {\n if (interface_params.length > 0) {\n return this.exec('connect_interface', [\n interface_name,\n ...interface_params,\n ])\n } else {\n return this.exec('connect_interface', [interface_name])\n }\n }\n\n disconnect_interface(interface_name) {\n return this.exec('disconnect_interface', [interface_name])\n }\n\n interface_cmd(interface_name, command_name, ...command_params) {\n return this.exec('interface_cmd', [\n interface_name,\n command_name,\n ...command_params,\n ])\n }\n\n get_all_router_info() {\n return this.exec('get_all_router_info', [])\n }\n\n connect_router(router_name) {\n return this.exec('connect_router', [router_name])\n }\n\n disconnect_router(router_name) {\n return this.exec('disconnect_router', [router_name])\n }\n\n get_target_interfaces() {\n return this.exec('get_target_interfaces', [])\n }\n\n // DEPRECATED\n get_all_target_info() {\n return this.exec('get_all_target_info', [])\n }\n\n get_tlm_cnts(target_commands) {\n return this.exec('get_tlm_cnts', [target_commands])\n }\n\n get_item(target, packet, item) {\n return this.exec('get_item', [target, packet, item])\n }\n\n get_param(target, packet, item) {\n return this.exec('get_param', [target, packet, item])\n }\n // DEPRECATED for get_param\n get_parameter(target, packet, item) {\n return this.exec('get_parameter', [target, packet, item])\n }\n\n get_limits_sets() {\n return this.exec('get_limits_sets', [])\n }\n\n get_limits_set() {\n return this.exec('get_limits_set', [])\n }\n\n set_limits_set(limits_set) {\n return this.exec('set_limits_set', [limits_set])\n }\n\n // ***********************************************\n // End CmdTlmServer APIs\n // ***********************************************\n\n get_target(target_name) {\n return this.exec('get_target', [target_name])\n }\n\n get_target_names() {\n return this.exec('get_target_names', [])\n }\n // DEPRECATED\n get_target_list() {\n return this.exec('get_target_list', [])\n }\n\n get_tlm(target_name, packet_name) {\n return this.exec('get_tlm', [target_name, packet_name])\n }\n // DEPRECATED\n get_telemetry(target_name, packet_name) {\n return this.exec('get_telemetry', [target_name, packet_name])\n }\n\n get_all_tlm(target_name) {\n return this.exec('get_all_tlm', [target_name])\n }\n // DEPREACTE\n get_all_telemetry(target_name) {\n return this.exec('get_all_telemetry', [target_name])\n }\n\n get_all_tlm_names(target_name) {\n return this.exec('get_all_tlm_names', [target_name])\n }\n // DEPRECATED\n get_all_telemetry_names(target_name) {\n return this.exec('get_all_telemetry_names', [target_name])\n }\n\n async get_tlm_packet(target_name, packet_name, value_type, stale_time = 30) {\n const data = await this.exec('get_tlm_packet', [target_name, packet_name], {\n type: value_type,\n stale_time: stale_time,\n })\n // Make sure data isn't null or undefined. Note this is the only valid use of == or !=\n if (data != null) {\n var len = data.length\n var converted = null\n for (var i = 0; i < len; i++) {\n converted = this.decode_openc3_type(data[i][1])\n if (converted !== null) {\n data[i][1] = converted\n }\n }\n }\n return data\n }\n\n get_packet_derived_items(target_name, packet_name) {\n return this.exec('get_packet_derived_items', [target_name, packet_name])\n }\n\n get_tlm_buffer(target_name, packet_name) {\n return this.exec('get_tlm_buffer', [target_name, packet_name])\n }\n\n async get_tlm_values(items, stale_time = 30, cache_timeout = null) {\n let kw_args = {\n stale_time: stale_time,\n }\n if (cache_timeout !== null) {\n kw_args['cache_timeout'] = cache_timeout\n }\n const data = await this.exec(\n 'get_tlm_values',\n [items],\n kw_args,\n {},\n 10000 // 10s timeout ... should never be this long\n )\n var len = data[0].length\n var converted = null\n for (var i = 0; i < len; i++) {\n converted = this.decode_openc3_type(data[0][i])\n if (converted !== null) {\n data[0][i] = converted\n }\n }\n return data\n }\n\n get_limits(target_name, packet_name, item_name) {\n return this.exec('get_limits', [target_name, packet_name, item_name])\n }\n\n async tlm(target_name, packet_name, item_name, value_type = 'CONVERTED') {\n let data = null\n // Check for the single string syntax: tlm(\"TGT PKT ITEM\")\n if (packet_name === undefined) {\n data = await this.exec('tlm', [target_name])\n // Check for the single string syntax with type: tlm(\"TGT PKT ITEM\", \"RAW\")\n } else if (item_name === undefined) {\n if (\n ['RAW', 'CONVERTED', 'FORMATTED', 'WITH_UNITS'].includes(packet_name)\n ) {\n data = await this.exec('tlm', [target_name], { type: packet_name })\n } else {\n var err = new Error()\n err.name = 'TypeError'\n err.message = `Invalid data type ${packet_name}. Valid options are RAW, CONVERTED, FORMATTED, and WITH_UNITS.`\n throw err\n }\n } else {\n data = await this.exec('tlm', [target_name, packet_name, item_name], {\n type: value_type,\n })\n }\n var converted = this.decode_openc3_type(data)\n if (converted !== null) {\n data = converted\n }\n return data\n }\n\n async inject_tlm(\n target_name,\n packet_name,\n item_hash = null,\n value_type = 'CONVERTED'\n ) {\n data = await this.exec(\n 'inject_tlm',\n [target_name, packet_name, item_hash],\n {\n type: value_type,\n }\n )\n }\n\n set_tlm(target_name, packet_name, item_name, value_type) {\n return this.exec('set_tlm', [target_name, packet_name, item_name], {\n type: value_type,\n })\n }\n\n override_tlm(target_name, packet_name, item_name, value_type) {\n return this.exec('override_tlm', [target_name, packet_name, item_name], {\n type: value_type,\n })\n }\n\n get_overrides() {\n return this.exec('get_overrides')\n }\n\n normalize_tlm(target_name, packet_name, item_name, value_type) {\n return this.exec('normalize_tlm', [target_name, packet_name, item_name], {\n type: value_type,\n })\n }\n\n get_all_cmds(target_name) {\n return this.exec('get_all_cmds', [target_name])\n }\n // DEPRECATED for get_all_cmds\n get_all_commands(target_name) {\n return this.exec('get_all_commands', [target_name])\n }\n\n get_all_cmd_names(target_name) {\n return this.exec('get_all_cmd_names', [target_name])\n }\n // DEPRECATED for get_all_cmd_names\n get_all_command_names(target_name) {\n return this.exec('get_all_command_names', [target_name])\n }\n\n get_cmd(target_name, command_name) {\n return this.exec('get_cmd', [target_name, command_name])\n }\n // DEPRECATED for get_cmd\n get_command(target_name, command_name) {\n return this.exec('get_command', [target_name, command_name])\n }\n\n get_cmd_cnts(target_commands) {\n return this.exec('get_cmd_cnts', [target_commands])\n }\n\n get_cmd_value(\n target_name,\n packet_name,\n parameter_name,\n value_type = 'CONVERTED'\n ) {\n return this.exec('get_cmd_value', [\n target_name,\n packet_name,\n parameter_name,\n value_type,\n ])\n }\n\n get_cmd_buffer(target_name, packet_name) {\n return this.exec('get_cmd_buffer', [target_name, packet_name])\n }\n\n // Implementation of functionality shared by cmd methods with param_lists.\n _cmd(method, target_name, command_name, param_list, headerOptions) {\n var converted = null\n for (var key in param_list) {\n if (Object.prototype.hasOwnProperty.call(param_list, key)) {\n converted = this.encode_openc3_type(param_list[key])\n if (converted !== null) {\n param_list[key] = converted\n }\n }\n }\n return this.exec(\n method,\n [target_name, command_name, param_list],\n {},\n headerOptions\n )\n }\n\n get_cmd_hazardous(target_name, command_name, param_list) {\n if (command_name === undefined) {\n return this.exec('get_cmd_hazardous', target_name)\n } else {\n return this._cmd(\n 'get_cmd_hazardous',\n target_name,\n command_name,\n param_list\n )\n }\n }\n\n cmd(target_name, command_name, param_list, headerOptions = {}) {\n if (command_name === undefined) {\n return this.exec('cmd', target_name, {}, headerOptions)\n } else {\n return this._cmd(\n 'cmd',\n target_name,\n command_name,\n param_list,\n headerOptions\n )\n }\n }\n\n cmd_no_range_check(target_name, command_name, param_list) {\n if (command_name === undefined) {\n return this.exec('cmd_no_range_check', target_name)\n } else {\n return this._cmd(\n 'cmd_no_range_check',\n target_name,\n command_name,\n param_list\n )\n }\n }\n\n cmd_raw(target_name, command_name, param_list) {\n if (command_name === undefined) {\n return this.exec('cmd_raw', target_name)\n } else {\n return this._cmd('cmd_raw', target_name, command_name, param_list)\n }\n }\n\n cmd_raw_no_range_check(target_name, command_name, param_list) {\n if (command_name === undefined) {\n return this.exec('cmd_raw_no_range_check', target_name)\n } else {\n return this._cmd(\n 'cmd_raw_no_range_check',\n target_name,\n command_name,\n param_list\n )\n }\n }\n\n cmd_no_hazardous_check(target_name, command_name, param_list) {\n if (command_name === undefined) {\n return this.exec('cmd_no_hazardous_check', target_name)\n } else {\n return this._cmd(\n 'cmd_no_hazardous_check',\n target_name,\n command_name,\n param_list\n )\n }\n }\n\n cmd_no_checks(target_name, command_name, param_list) {\n if (command_name === undefined) {\n return this.exec('cmd_no_checks', target_name)\n } else {\n return this._cmd('cmd_no_checks', target_name, command_name, param_list)\n }\n }\n\n cmd_raw_no_hazardous_check(target_name, command_name, param_list) {\n if (command_name === undefined) {\n return this.exec('cmd_raw_no_hazardous_check', target_name)\n } else {\n return this._cmd(\n 'cmd_raw_no_hazardous_check',\n target_name,\n command_name,\n param_list\n )\n }\n }\n\n cmd_raw_no_checks(target_name, command_name, param_list) {\n if (command_name === undefined) {\n return this.exec('cmd_raw_no_checks', target_name)\n } else {\n return this._cmd(\n 'cmd_raw_no_checks',\n target_name,\n command_name,\n param_list\n )\n }\n }\n\n build_cmd(target_name, command_name, param_list) {\n if (command_name === undefined) {\n return this.exec('build_cmd', target_name)\n } else {\n return this._cmd('build_cmd', target_name, command_name, param_list)\n }\n }\n // DEPRECATED for build_cmd\n build_command(target_name, command_name, param_list) {\n if (command_name === undefined) {\n return this.exec('build_command', target_name)\n } else {\n return this._cmd('build_command', target_name, command_name, param_list)\n }\n }\n\n get_interface_names() {\n return this.exec('get_interface_names', [])\n }\n\n send_raw(interface_name, data) {\n return this.exec('send_raw', [interface_name, data])\n }\n\n list_configs(tool) {\n return this.exec('list_configs', [tool])\n }\n\n load_config(tool, name) {\n return this.exec('load_config', [tool, name])\n }\n\n save_config(tool, name, data) {\n return this.exec('save_config', [tool, name, data])\n }\n\n delete_config(tool, name) {\n return this.exec('delete_config', [tool, name])\n }\n\n enable_limits(target, packet, item) {\n return this.exec('enable_limits', [target, packet, item])\n }\n\n disable_limits(target, packet, item) {\n return this.exec('disable_limits', [target, packet, item])\n }\n\n get_out_of_limits() {\n return this.exec('get_out_of_limits', [])\n }\n\n get_overall_limits_state(ignored) {\n return this.exec('get_overall_limits_state', [ignored])\n }\n\n list_settings() {\n return this.exec('list_settings', [])\n }\n\n get_all_settings() {\n return this.exec('get_all_settings', [])\n }\n\n get_setting(name) {\n return this.exec('get_setting', [name])\n }\n\n get_settings(array) {\n return this.exec('get_settings', array)\n }\n\n set_setting(name, data) {\n return this.exec('set_setting', [name, data])\n }\n\n // DEPRECATED\n save_setting(name, data) {\n return this.exec('save_setting', [name, data])\n }\n\n get_metrics() {\n return this.exec('get_metrics', [])\n }\n\n // TODO: Currently unused but seemed like a useful function\n async hashString(string) {\n if (window.isSecureContext) {\n // Encode the string as an arrayBuffer which the subtle crypto API uses\n const arrayBuffer = new TextEncoder().encode(string)\n // Use the subtle crypto API to perform a SHA256 Sum of the array buffer\n // The resulting hash is stored in an array buffer\n const hashAsArrayBuffer = await crypto.subtle.digest(\n 'SHA-256',\n arrayBuffer\n )\n // To create a string we will get the hexadecimal value of each byte of the array buffer\n // This gets us an array where each byte of the array buffer becomes one item in the array\n const uint8ViewOfHash = new Uint8Array(hashAsArrayBuffer)\n // We then convert it to a regular array so we can convert each item to hexadecimal strings\n // Where to characters of 0-9 or a-f represent a number between 0 and 16, containing 4 bits of information, so 2 of them is 8 bits (1 byte).\n return Array.from(uint8ViewOfHash)\n .map((b) => b.toString(16).padStart(2, '0'))\n .join('')\n }\n // else ?\n }\n}\n"],"names":["vueInstance","Vue","axiosInstance","axios","create","baseURL","location","origin","timeout","params","interceptors","response","use","error","_error$response","_error$response2","_error$response3","_error$response4","_error$response5","status","OpenC3Auth","updateToken","defaultMinValidity","then","refreshed","setTokens","config","headers","includes","toString","Promise","reject","body","statusText","data","message","exception","class","_error$response6","$notify","serious","title","OpenC3Api","constructor","_defineProperty","exec","method","kwparams","headerOptions","login","this","id","window","openc3Scope","post","jsonrpc","keyword_params","Authorization","localStorage","openc3Token","result","err","Error","name","request","decode_openc3_type","val","json_class","raw","NaN","Infinity","encode_openc3_type","Number","isNaN","POSITIVE_INFINITY","NEGATIVE_INFINITY","ensure_offline_access","offline_access_needed","needed","openc3OfflineToken","set_offline_access","getOfflineAccess","offline_access_token","get_all_interface_info","map_target_to_interface","target_name","interface_name","connect_interface","interface_params","length","disconnect_interface","interface_cmd","command_name","command_params","get_all_router_info","connect_router","router_name","disconnect_router","get_target_interfaces","get_all_target_info","get_tlm_cnts","target_commands","get_item","target","packet","item","get_param","get_parameter","get_limits_sets","get_limits_set","set_limits_set","limits_set","get_target","get_target_names","get_target_list","get_tlm","packet_name","get_telemetry","get_all_tlm","get_all_telemetry","get_all_tlm_names","get_all_telemetry_names","get_tlm_packet","value_type","stale_time","type","len","converted","i","get_packet_derived_items","get_tlm_buffer","get_tlm_values","items","cache_timeout","kw_args","get_limits","item_name","tlm","undefined","inject_tlm","item_hash","set_tlm","override_tlm","get_overrides","normalize_tlm","get_all_cmds","get_all_commands","get_all_cmd_names","get_all_command_names","get_cmd","get_command","get_cmd_cnts","get_cmd_value","parameter_name","get_cmd_buffer","_cmd","param_list","key","Object","prototype","hasOwnProperty","call","get_cmd_hazardous","cmd","cmd_no_range_check","cmd_raw","cmd_raw_no_range_check","cmd_no_hazardous_check","cmd_no_checks","cmd_raw_no_hazardous_check","cmd_raw_no_checks","build_cmd","build_command","get_interface_names","send_raw","list_configs","tool","load_config","save_config","delete_config","enable_limits","disable_limits","get_out_of_limits","get_overall_limits_state","ignored","list_settings","get_all_settings","get_setting","get_settings","array","set_setting","save_setting","get_metrics","hashString","string","isSecureContext","arrayBuffer","TextEncoder","encode","hashAsArrayBuffer","crypto","subtle","digest","uint8ViewOfHash","Uint8Array","Array","from","map","b","padStart","join"],"sourceRoot":""}
|
1
|
+
{"version":3,"file":"js/904.js","mappings":"mUAyBA,MAAMA,EAAc,IAAIC,EAAAA,WAElBC,EAAgBC,EAAAA,EAAMC,OAAO,CACjCC,QAASC,SAASC,OAClBC,QAAS,IACTC,OAAQ,CAAC,IAGXP,EAAcQ,aAAaC,SAASC,KACjCD,GAAaA,IACbE,IACC,GAAIA,EAAMF,SAAU,KAAAG,EAAAC,EAAAC,EAAAC,EAAAC,EAkBlB,GAjB8B,MAA1BL,EAAMF,SAASQ,QACjBC,WAAWC,YAAYD,WAAWE,oBAAoB,GAAMC,MAC1D,SAAUC,GACJA,GACFJ,WAAWK,WAEf,IAYFZ,EAAMF,SAASe,OAAOC,QAAQ,kBAC9Bd,EAAMF,SAASe,OAAOC,QAAQ,iBAAiBC,SAC7Cf,EAAMF,SAASQ,OAAOU,YAGxB,OAAOC,QAAQC,OAAOlB,GAExB,IAAImB,EAAO,QAAQnB,EAAMF,SAASQ,YAOlC,GANkB,QAAlBL,EAAID,EAAMF,gBAAQ,IAAAG,GAAdA,EAAgBmB,aAClBD,GAAQ,GAAGnB,EAAMF,SAASsB,eAEV,QAAlBlB,EAAIF,EAAMF,gBAAQ,IAAAI,GAAQ,QAARA,EAAdA,EAAgBW,cAAM,IAAAX,GAAtBA,EAAwBmB,OAC1BF,GAAQ,GA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js","webpack://@openc3/cosmos-tool-cmdtlmserver/../openc3-tool-common/src/services/openc3-api.js"],"sourcesContent":["/*\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2022, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n*/\n\nimport axios from 'axios'\nimport Vue from 'vue'\n\nconst vueInstance = new Vue()\n\nconst axiosInstance = axios.create({\n baseURL: location.origin,\n timeout: 60000,\n params: {},\n})\n\naxiosInstance.interceptors.response.use(\n (response) => response,\n (error) => {\n if (error.response) {\n if (error.response.status === 401) {\n OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity, true).then(\n function (refreshed) {\n if (refreshed) {\n OpenC3Auth.setTokens()\n }\n },\n )\n }\n // Individual tools can set 'Ignore-Errors' to an error code\n // they potentially expect, e.g. '500', in which case we ignore it\n // For example in CommandSender.vue:\n // obs = this.api.cmd(targetName, commandName, paramList, {\n // headers: {\n // 'Ignore-Errors': '404',\n // },\n // })\n if (\n error.response.config.headers['Ignore-Errors'] &&\n error.response.config.headers['Ignore-Errors'].includes(\n error.response.status.toString(),\n )\n ) {\n return Promise.reject(error)\n }\n let body = `HTTP ${error.response.status} - `\n if (error.response?.statusText) {\n body += `${error.response.statusText} `\n }\n if (error.response?.config?.data) {\n body += `${error.response.config.data} `\n }\n if (error.response?.data?.message) {\n body += `${error.response.data.message}`\n } else if (error.response?.data?.exception) {\n body += `${error.response.data.exception}`\n } else if (error.response?.data?.error?.message) {\n if (error.response.data.error.class) {\n body += `${error.response.data.error.class} `\n }\n body += `${error.response.data.error.message}`\n } else {\n body += `${error.response?.data}`\n }\n if (vueInstance.$notify) {\n vueInstance.$notify.serious({\n title: 'Network error',\n body,\n })\n }\n throw error\n } else {\n throw error\n }\n },\n)\n\nexport default axiosInstance\n","/*\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2024, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n*/\n\nimport axios from './axios.js'\n\nexport class OpenC3Api {\n id = 1\n\n constructor() {}\n\n async exec(\n method,\n params,\n kwparams = {},\n headerOptions = {},\n timeout = 60000\n ) {\n try {\n let refreshed = await OpenC3Auth.updateToken(\n OpenC3Auth.defaultMinValidity\n )\n if (refreshed) {\n OpenC3Auth.setTokens()\n }\n } catch (error) {\n OpenC3Auth.login()\n }\n this.id = this.id + 1\n try {\n kwparams['scope'] = window.openc3Scope\n const response = await axios.post(\n '/openc3-api/api',\n {\n jsonrpc: '2.0',\n method: method,\n params: params,\n id: this.id,\n keyword_params: kwparams,\n },\n {\n headers: {\n Authorization: localStorage.openc3Token,\n 'Content-Type': 'application/json-rpc',\n ...headerOptions,\n },\n timeout: timeout,\n }\n )\n // var data = response.data\n // if (data.error) {\n // var err = new Error()\n // err.name = data.error.data.class\n // err.message = data.error.data.message\n // console.log(data.error.data.backtrace.join('\\n'))\n // throw err\n // }\n return response.data.result\n } catch (error) {\n var err = new Error()\n if (error.response) {\n // The request was made and the server responded with a\n // status code that falls out of the range of 2xx\n err.name = error.response.data.error.data.class\n err.message = error.response.data.error.data.message\n } else if (error.request) {\n // The request was made but no response was received, `error.request`\n // is an instance of XMLHttpRequest in the browser and an instance\n // of http.ClientRequest in Node.js\n err.name = 'Request error'\n // NOTE: Openc3Screen.vue uses this specific message to determine\n // if the CmdTlmApi server is down. Don't change unless also changing there.\n err.message = 'Request error, no response received'\n } else {\n // Something happened in setting up the request and triggered an Error\n err.name = 'Unknown error'\n }\n throw err\n }\n }\n\n decode_openc3_type(val) {\n if (val !== null && typeof val === 'object') {\n if (val.json_class == 'Float' && val.raw) {\n if (val.raw == 'NaN') {\n return NaN\n } else if (val.raw == 'Infinity') {\n return Infinity\n } else if (val.raw == '-Infinity') {\n return -Infinity\n }\n }\n }\n return null\n }\n\n encode_openc3_type(val) {\n if (Number.isNaN(val)) {\n return { json_class: 'Float', raw: 'NaN' }\n } else if (val == Number.POSITIVE_INFINITY) {\n return { json_class: 'Float', raw: 'Infinity' }\n } else if (val == Number.NEGATIVE_INFINITY) {\n return { json_class: 'Float', raw: '-Infinity' }\n }\n return null\n }\n\n ensure_offline_access() {\n this.offline_access_needed().then((needed) => {\n if (needed) {\n if (localStorage.openc3OfflineToken) {\n this.set_offline_access(localStorage.openc3OfflineToken).then(() => {\n delete localStorage.openc3OfflineToken\n })\n } else {\n OpenC3Auth.getOfflineAccess()\n }\n }\n })\n }\n\n // ***********************************************\n // The following APIs are used by the CmdTlmServer\n // ***********************************************\n\n offline_access_needed() {\n return this.exec('offline_access_needed', [])\n }\n\n set_offline_access(offline_access_token) {\n return this.exec('set_offline_access', [offline_access_token])\n }\n\n get_all_interface_info() {\n return this.exec('get_all_interface_info', [])\n }\n\n map_target_to_interface(target_name, interface_name) {\n return this.exec('map_target_to_interface', [target_name, interface_name])\n }\n\n connect_interface(interface_name, ...interface_params) {\n if (interface_params.length > 0) {\n return this.exec('connect_interface', [\n interface_name,\n ...interface_params,\n ])\n } else {\n return this.exec('connect_interface', [interface_name])\n }\n }\n\n disconnect_interface(interface_name) {\n return this.exec('disconnect_interface', [interface_name])\n }\n\n interface_cmd(interface_name, command_name, ...command_params) {\n return this.exec('interface_cmd', [\n interface_name,\n command_name,\n ...command_params,\n ])\n }\n\n get_all_router_info() {\n return this.exec('get_all_router_info', [])\n }\n\n connect_router(router_name) {\n return this.exec('connect_router', [router_name])\n }\n\n disconnect_router(router_name) {\n return this.exec('disconnect_router', [router_name])\n }\n\n get_target_interfaces() {\n return this.exec('get_target_interfaces', [])\n }\n\n // DEPRECATED\n get_all_target_info() {\n return this.exec('get_all_target_info', [])\n }\n\n get_tlm_cnts(target_commands) {\n return this.exec('get_tlm_cnts', [target_commands])\n }\n\n get_item(target, packet, item) {\n return this.exec('get_item', [target, packet, item])\n }\n\n get_param(target, packet, item) {\n return this.exec('get_param', [target, packet, item])\n }\n // DEPRECATED for get_param\n get_parameter(target, packet, item) {\n return this.exec('get_parameter', [target, packet, item])\n }\n\n get_limits_sets() {\n return this.exec('get_limits_sets', [])\n }\n\n get_limits_set() {\n return this.exec('get_limits_set', [])\n }\n\n set_limits_set(limits_set) {\n return this.exec('set_limits_set', [limits_set])\n }\n\n // ***********************************************\n // End CmdTlmServer APIs\n // ***********************************************\n\n get_target(target_name) {\n return this.exec('get_target', [target_name])\n }\n\n get_target_names() {\n return this.exec('get_target_names', [])\n }\n // DEPRECATED\n get_target_list() {\n return this.exec('get_target_list', [])\n }\n\n get_tlm(target_name, packet_name) {\n return this.exec('get_tlm', [target_name, packet_name])\n }\n // DEPRECATED\n get_telemetry(target_name, packet_name) {\n return this.exec('get_telemetry', [target_name, packet_name])\n }\n\n get_all_tlm(target_name) {\n return this.exec('get_all_tlm', [target_name])\n }\n // DEPREACTE\n get_all_telemetry(target_name) {\n return this.exec('get_all_telemetry', [target_name])\n }\n\n get_all_tlm_names(target_name) {\n return this.exec('get_all_tlm_names', [target_name])\n }\n // DEPRECATED\n get_all_telemetry_names(target_name) {\n return this.exec('get_all_telemetry_names', [target_name])\n }\n\n async get_tlm_packet(target_name, packet_name, value_type, stale_time = 30) {\n const data = await this.exec('get_tlm_packet', [target_name, packet_name], {\n type: value_type,\n stale_time: stale_time,\n })\n // Make sure data isn't null or undefined. Note this is the only valid use of == or !=\n if (data != null) {\n var len = data.length\n var converted = null\n for (var i = 0; i < len; i++) {\n converted = this.decode_openc3_type(data[i][1])\n if (converted !== null) {\n data[i][1] = converted\n }\n }\n }\n return data\n }\n\n get_packet_derived_items(target_name, packet_name) {\n return this.exec('get_packet_derived_items', [target_name, packet_name])\n }\n\n get_tlm_buffer(target_name, packet_name) {\n return this.exec('get_tlm_buffer', [target_name, packet_name])\n }\n\n async get_tlm_values(items, stale_time = 30, cache_timeout = null) {\n let kw_args = {\n stale_time: stale_time,\n }\n if (cache_timeout !== null) {\n kw_args['cache_timeout'] = cache_timeout\n }\n const data = await this.exec(\n 'get_tlm_values',\n [items],\n kw_args,\n {},\n 10000 // 10s timeout ... should never be this long\n )\n var len = data[0].length\n var converted = null\n for (var i = 0; i < len; i++) {\n converted = this.decode_openc3_type(data[0][i])\n if (converted !== null) {\n data[0][i] = converted\n }\n }\n return data\n }\n\n get_limits(target_name, packet_name, item_name) {\n return this.exec('get_limits', [target_name, packet_name, item_name])\n }\n\n async tlm(target_name, packet_name, item_name, value_type = 'CONVERTED') {\n let data = null\n // Check for the single string syntax: tlm(\"TGT PKT ITEM\")\n if (packet_name === undefined) {\n data = await this.exec('tlm', [target_name])\n // Check for the single string syntax with type: tlm(\"TGT PKT ITEM\", \"RAW\")\n } else if (item_name === undefined) {\n if (\n ['RAW', 'CONVERTED', 'FORMATTED', 'WITH_UNITS'].includes(packet_name)\n ) {\n data = await this.exec('tlm', [target_name], { type: packet_name })\n } else {\n var err = new Error()\n err.name = 'TypeError'\n err.message = `Invalid data type ${packet_name}. Valid options are RAW, CONVERTED, FORMATTED, and WITH_UNITS.`\n throw err\n }\n } else {\n data = await this.exec('tlm', [target_name, packet_name, item_name], {\n type: value_type,\n })\n }\n var converted = this.decode_openc3_type(data)\n if (converted !== null) {\n data = converted\n }\n return data\n }\n\n async inject_tlm(\n target_name,\n packet_name,\n item_hash = null,\n value_type = 'CONVERTED'\n ) {\n data = await this.exec(\n 'inject_tlm',\n [target_name, packet_name, item_hash],\n {\n type: value_type,\n }\n )\n }\n\n set_tlm(target_name, packet_name, item_name, value_type) {\n return this.exec('set_tlm', [target_name, packet_name, item_name], {\n type: value_type,\n })\n }\n\n override_tlm(target_name, packet_name, item_name, value_type) {\n return this.exec('override_tlm', [target_name, packet_name, item_name], {\n type: value_type,\n })\n }\n\n get_overrides() {\n return this.exec('get_overrides')\n }\n\n normalize_tlm(target_name, packet_name, item_name, value_type) {\n return this.exec('normalize_tlm', [target_name, packet_name, item_name], {\n type: value_type,\n })\n }\n\n get_all_cmds(target_name) {\n return this.exec('get_all_cmds', [target_name])\n }\n // DEPRECATED for get_all_cmds\n get_all_commands(target_name) {\n return this.exec('get_all_commands', [target_name])\n }\n\n get_all_cmd_names(target_name) {\n return this.exec('get_all_cmd_names', [target_name])\n }\n // DEPRECATED for get_all_cmd_names\n get_all_command_names(target_name) {\n return this.exec('get_all_command_names', [target_name])\n }\n\n get_cmd(target_name, command_name) {\n return this.exec('get_cmd', [target_name, command_name])\n }\n // DEPRECATED for get_cmd\n get_command(target_name, command_name) {\n return this.exec('get_command', [target_name, command_name])\n }\n\n get_cmd_cnts(target_commands) {\n return this.exec('get_cmd_cnts', [target_commands])\n }\n\n get_cmd_value(\n target_name,\n packet_name,\n parameter_name,\n value_type = 'CONVERTED'\n ) {\n return this.exec('get_cmd_value', [\n target_name,\n packet_name,\n parameter_name,\n value_type,\n ])\n }\n\n get_cmd_buffer(target_name, packet_name) {\n return this.exec('get_cmd_buffer', [target_name, packet_name])\n }\n\n // Implementation of functionality shared by cmd methods with param_lists.\n _cmd(method, target_name, command_name, param_list, headerOptions) {\n var converted = null\n for (var key in param_list) {\n if (Object.prototype.hasOwnProperty.call(param_list, key)) {\n converted = this.encode_openc3_type(param_list[key])\n if (converted !== null) {\n param_list[key] = converted\n }\n }\n }\n return this.exec(\n method,\n [target_name, command_name, param_list],\n {},\n headerOptions\n )\n }\n\n get_cmd_hazardous(target_name, command_name, param_list) {\n if (command_name === undefined) {\n return this.exec('get_cmd_hazardous', target_name)\n } else {\n return this._cmd(\n 'get_cmd_hazardous',\n target_name,\n command_name,\n param_list\n )\n }\n }\n\n cmd(target_name, command_name, param_list, headerOptions = {}) {\n if (command_name === undefined) {\n return this.exec('cmd', target_name, {}, headerOptions)\n } else {\n return this._cmd(\n 'cmd',\n target_name,\n command_name,\n param_list,\n headerOptions\n )\n }\n }\n\n cmd_no_range_check(target_name, command_name, param_list) {\n if (command_name === undefined) {\n return this.exec('cmd_no_range_check', target_name)\n } else {\n return this._cmd(\n 'cmd_no_range_check',\n target_name,\n command_name,\n param_list\n )\n }\n }\n\n cmd_raw(target_name, command_name, param_list) {\n if (command_name === undefined) {\n return this.exec('cmd_raw', target_name)\n } else {\n return this._cmd('cmd_raw', target_name, command_name, param_list)\n }\n }\n\n cmd_raw_no_range_check(target_name, command_name, param_list) {\n if (command_name === undefined) {\n return this.exec('cmd_raw_no_range_check', target_name)\n } else {\n return this._cmd(\n 'cmd_raw_no_range_check',\n target_name,\n command_name,\n param_list\n )\n }\n }\n\n cmd_no_hazardous_check(target_name, command_name, param_list) {\n if (command_name === undefined) {\n return this.exec('cmd_no_hazardous_check', target_name)\n } else {\n return this._cmd(\n 'cmd_no_hazardous_check',\n target_name,\n command_name,\n param_list\n )\n }\n }\n\n cmd_no_checks(target_name, command_name, param_list) {\n if (command_name === undefined) {\n return this.exec('cmd_no_checks', target_name)\n } else {\n return this._cmd('cmd_no_checks', target_name, command_name, param_list)\n }\n }\n\n cmd_raw_no_hazardous_check(target_name, command_name, param_list) {\n if (command_name === undefined) {\n return this.exec('cmd_raw_no_hazardous_check', target_name)\n } else {\n return this._cmd(\n 'cmd_raw_no_hazardous_check',\n target_name,\n command_name,\n param_list\n )\n }\n }\n\n cmd_raw_no_checks(target_name, command_name, param_list) {\n if (command_name === undefined) {\n return this.exec('cmd_raw_no_checks', target_name)\n } else {\n return this._cmd(\n 'cmd_raw_no_checks',\n target_name,\n command_name,\n param_list\n )\n }\n }\n\n build_cmd(target_name, command_name, param_list) {\n if (command_name === undefined) {\n return this.exec('build_cmd', target_name)\n } else {\n return this._cmd('build_cmd', target_name, command_name, param_list)\n }\n }\n // DEPRECATED for build_cmd\n build_command(target_name, command_name, param_list) {\n if (command_name === undefined) {\n return this.exec('build_command', target_name)\n } else {\n return this._cmd('build_command', target_name, command_name, param_list)\n }\n }\n\n get_interface_names() {\n return this.exec('get_interface_names', [])\n }\n\n send_raw(interface_name, data) {\n return this.exec('send_raw', [interface_name, data])\n }\n\n list_configs(tool) {\n return this.exec('list_configs', [tool])\n }\n\n load_config(tool, name) {\n return this.exec('load_config', [tool, name])\n }\n\n save_config(tool, name, data) {\n return this.exec('save_config', [tool, name, data])\n }\n\n delete_config(tool, name) {\n return this.exec('delete_config', [tool, name])\n }\n\n enable_limits(target, packet, item) {\n return this.exec('enable_limits', [target, packet, item])\n }\n\n disable_limits(target, packet, item) {\n return this.exec('disable_limits', [target, packet, item])\n }\n\n get_out_of_limits() {\n return this.exec('get_out_of_limits', [])\n }\n\n get_overall_limits_state(ignored) {\n return this.exec('get_overall_limits_state', [ignored])\n }\n\n list_settings() {\n return this.exec('list_settings', [])\n }\n\n get_all_settings() {\n return this.exec('get_all_settings', [])\n }\n\n get_setting(name) {\n return this.exec('get_setting', [name])\n }\n\n get_settings(array) {\n return this.exec('get_settings', array)\n }\n\n set_setting(name, data) {\n return this.exec('set_setting', [name, data])\n }\n\n // DEPRECATED\n save_setting(name, data) {\n return this.exec('save_setting', [name, data])\n }\n\n get_metrics() {\n return this.exec('get_metrics', [])\n }\n\n // TODO: Currently unused but seemed like a useful function\n async hashString(string) {\n if (window.isSecureContext) {\n // Encode the string as an arrayBuffer which the subtle crypto API uses\n const arrayBuffer = new TextEncoder().encode(string)\n // Use the subtle crypto API to perform a SHA256 Sum of the array buffer\n // The resulting hash is stored in an array buffer\n const hashAsArrayBuffer = await crypto.subtle.digest(\n 'SHA-256',\n arrayBuffer\n )\n // To create a string we will get the hexadecimal value of each byte of the array buffer\n // This gets us an array where each byte of the array buffer becomes one item in the array\n const uint8ViewOfHash = new Uint8Array(hashAsArrayBuffer)\n // We then convert it to a regular array so we can convert each item to hexadecimal strings\n // Where to characters of 0-9 or a-f represent a number between 0 and 16, containing 4 bits of information, so 2 of them is 8 bits (1 byte).\n return Array.from(uint8ViewOfHash)\n .map((b) => b.toString(16).padStart(2, '0'))\n .join('')\n }\n // else ?\n }\n}\n"],"names":["vueInstance","Vue","axiosInstance","axios","create","baseURL","location","origin","timeout","params","interceptors","response","use","error","_error$response","_error$response2","_error$response3","_error$response4","_error$response5","status","OpenC3Auth","updateToken","defaultMinValidity","then","refreshed","setTokens","config","headers","includes","toString","Promise","reject","body","statusText","data","message","exception","class","_error$response6","$notify","serious","title","OpenC3Api","constructor","_defineProperty","exec","method","kwparams","headerOptions","login","this","id","window","openc3Scope","post","jsonrpc","keyword_params","Authorization","localStorage","openc3Token","result","err","Error","name","request","decode_openc3_type","val","json_class","raw","NaN","Infinity","encode_openc3_type","Number","isNaN","POSITIVE_INFINITY","NEGATIVE_INFINITY","ensure_offline_access","offline_access_needed","needed","openc3OfflineToken","set_offline_access","getOfflineAccess","offline_access_token","get_all_interface_info","map_target_to_interface","target_name","interface_name","connect_interface","interface_params","length","disconnect_interface","interface_cmd","command_name","command_params","get_all_router_info","connect_router","router_name","disconnect_router","get_target_interfaces","get_all_target_info","get_tlm_cnts","target_commands","get_item","target","packet","item","get_param","get_parameter","get_limits_sets","get_limits_set","set_limits_set","limits_set","get_target","get_target_names","get_target_list","get_tlm","packet_name","get_telemetry","get_all_tlm","get_all_telemetry","get_all_tlm_names","get_all_telemetry_names","get_tlm_packet","value_type","stale_time","type","len","converted","i","get_packet_derived_items","get_tlm_buffer","get_tlm_values","items","cache_timeout","kw_args","get_limits","item_name","tlm","undefined","inject_tlm","item_hash","set_tlm","override_tlm","get_overrides","normalize_tlm","get_all_cmds","get_all_commands","get_all_cmd_names","get_all_command_names","get_cmd","get_command","get_cmd_cnts","get_cmd_value","parameter_name","get_cmd_buffer","_cmd","param_list","key","Object","prototype","hasOwnProperty","call","get_cmd_hazardous","cmd","cmd_no_range_check","cmd_raw","cmd_raw_no_range_check","cmd_no_hazardous_check","cmd_no_checks","cmd_raw_no_hazardous_check","cmd_raw_no_checks","build_cmd","build_command","get_interface_names","send_raw","list_configs","tool","load_config","save_config","delete_config","enable_limits","disable_limits","get_out_of_limits","get_overall_limits_state","ignored","list_settings","get_all_settings","get_setting","get_settings","array","set_setting","save_setting","get_metrics","hashString","string","isSecureContext","arrayBuffer","TextEncoder","encode","hashAsArrayBuffer","crypto","subtle","digest","uint8ViewOfHash","Uint8Array","Array","from","map","b","padStart","join"],"sourceRoot":""}
|