Lines 1-21javascript
2import{MEDPLUM_VERSION as ro,normalizeErrorString as nt}from"@medplum/core";import{CommanderError as nr,Option as so}from"commander";import oo from"dotenv";import{ContentType as cr,EMPTY as io,isOk as ao,isUUID as no,normalizeErrorString as co}from"@medplum/core";import{Option as Fe}from"commander";import{MedplumClient as lo}from"@medplum/core";import{ClientStorage as uo}from"@medplum/core";import{existsSync as Nt,mkdirSync as po,readFileSync as ho,writeFileSync as mo}from"node:fs";import{homedir as fo}from"node:os";import{resolve as Ct}from"node:path";import{ContentType as tt,encodeBase64 as ...
3${h.length} successful response(s):
HighChild Process
Package source references child process execution.
dist/esm/index.mjsView on unpkg · L1 HighSame File Env Network Execution
A single source file combines environment access, network access, and code or shell execution; review context before blocking.
dist/esm/index.mjsView on unpkg · L1 4`),i?h.length?i(h):console.info("No successful responses received"):console.table(h.length?h:"No successful responses received"),console.info(),f.length&&(console.info(`${f.length} failed response(s):`),console.info(),console.table(f))}async function kr(e,t,r){if(!(t||r.criteria))throw new Error("This command requires either an [agentId] or a --criteria <criteria> flag");if(t&&r.criteria)throw new Error("Ambiguous arguments and options combination; [agentId] arg and --criteria <criteria> flag are mutually exclusive");let s;if(t)s=t;else{Dr(r.criteria);let o=await e.search("Agent",`${r.criteria ...
5`)}function F(e){p(`
HighCommand Output Exfiltration
Source combines command execution, command-output handling, and outbound requests; review data flow before blocking.
dist/esm/index.mjsView on unpkg · L1 7`)}function J(e,t=""){return new Promise(r=>{Ge.question(e+(t?" ("+t+")":"")+" ",s=>{r(s||t.toString())})})}async function It(e,t,r=""){let s=e+" ["+t.map(o=>o===r?"("+o+")":o).join("|")+"]";for(;;){let o=await J(s)||r;if(t.includes(o))return o;p("Please choose one of the following options: "+t.join(", "))}}async function ye(e,t,r){return Number.parseInt(await It(e,t.map(s=>s.toString()),r.toString()),10)}async function pe(e){return(await It(e,["y","n"])).toLowerCase()==="y"}async function ut(e){if(!await pe(e))throw p("Exiting..."),new Error("User cancelled")}var Me=new Wr({}),aa=new Vi({regi ...
9Configuration values come from a file named **medplum.<tag>.config.server.json** where **<tag>** is the Medplum stack tag.
11`+Se.yellow("**Services must be restarted to apply changes.**"))).argument("<tag>","The Medplum stack tag").option("--file [file]",Gt("File to provide overrides for **apiPort**, **baseUrl**, **appDomainName** and **storageDomainName** values that appear in the config file.")).option("--dryrun","Displays the operations that would be performed using the specified command without actually running them.").option("--yes","Automatically confirm the update").action(sn),O(e,new T("update-server").alias("deploy-server").description("Update the server image").argument("<tag>","The Medplum stack tag").op ...
14 `)}`,{cause:o})}rs.description("Saves the bot").argument("<botName>").action(async(e,t)=>{let r=await x(t);await Ve(r,e)});ss.description("Deploy the bot to AWS").argument("<botName>").action(async(e,t)=>{let r=await x(t);await Ve(r,e,!0)});os.arguments("<botName> <projectId> <sourceFile> <distFile>").description("Creates and saves the bot").action(async(e,t,r,s,o)=>{let i=await x(o);await Rr(i,e,t,r,s)});var ns=new T("export"),cs=new T("import"),Tt=new T("bulk");O(Tt,ns);O(Tt,cs);ns.option("-e, --export-level <exportLevel>",'Optional export level. Defaults to system level export. "Group/: ...
15`))}finally{await o.close()}}),Wn=new T("listen").description("Starts an HL7 v2 MLLP server").argument("<port>").option("--encoding <encoding>","The encoding to use").action(async(e,t)=>{await new xn(r=>{r.addEventListener("message",({message:s})=>{console.log(s.toString().replaceAll("\r",`
16`)),r.send(s.buildAck())})}).start(Number.parseInt(e,10),t.encoding),console.log("Listening on port "+e)}),Pt=new T("hl7");O(Pt,Fn);O(Pt,Wn);function Hn(){let e=bn(new Date),t=Date.now().toString();return`MSH|^~\\&|ADTSYS|HOSPITAL|RECEIVER|DEST|${e}||ADT^A01|${t}|P|2.5|
18PID|1|12345|12345^^^HOSP^MR|123456|DOE^JOHN^MIDDLE^SUFFIX|19800101|M|||123 STREET^APT 4B^CITY^ST^12345-6789||555-555-5555||S|
19PV1|1|I|2000^2012^01||||12345^DOCTOR^DOC||||||||||1234567^DOCTOR^DOC||AMB|||||||||||||||||||||||||202309280900|`}var ps=new T("set"),ds=new T("remove"),hs=new T("list"),ms=new T("describe"),Te=new T("profile");O(Te,ps);O(Te,ds);O(Te,hs);O(Te,ms);ps.argument("<profileName>","Name of the profile").description("Create a new profile or replace it with the given name and its associated properties").action(async(e,t)=>{$r(e,t)});ds.argument("<profileName>","Name of the profile").description("Remove a profile by name").action(async e=>{new Ae(e).setObject("options",void 0),console.log(`${e} profile r ...
21`);console.log(t)}gs.description("Project you are currently on").action(async e=>{let t=(await x(e)).getActiveLogin();if(!t)throw new Error("Unauthenticated: run `npx medplum login` to login");console.log(`${t.project.display} (${t.project.reference})`)});ws.description("Switching to another project from the current one").argument("<projectId>").action(async(e,t)=>{let r=await x(t);await Xn(r,e)});ys.description("Invite a member to your current project (run npx medplum project current to confirm)").arguments("<firstName> <lastName> <email>").option("--send-email","If you want to send the email ...
Long lines were clipped for display.