uploadQScript: Upload a QScript file to Displayr drive or collate many JS...

View source: R/DataMart.R

uploadQScriptR Documentation

Upload a QScript file to Displayr drive or collate many JS files.

Description

Take an arbitrary number of js files and either upload them as a custom qscript via Displayr Drive or save them locally as a single file.

Usage

uploadQScript(
  ...,
  filename = NULL,
  check.include.web = TRUE,
  upload = TRUE,
  api.root = Sys.getenv("API_ROOT"),
  company.secret = Sys.getenv("COMPANY_SECRET"),
  client.id = Sys.getenv("CLIENT_ID"),
  send.to = ""
)

Arguments

...

An arbitrary number of strings that contain the paths to js files to construct the QScript.

filename

Name of the output file QScript. If only a single file is provided then it is deduced by the input file name by default. Otherwise the filename argument must be provided.

check.include.web

A logical to remove any includeWeb calls if the input files are used in the construction. E.g. if testing a Calculation feature the script might use a custom QScript Functions for Calculations.js and then call one of those functions with includeWeb. If any matches are found like this, then the line with the includeWeb is omitted.

upload

A logical whether to upload the script or not (useful to check the script is good before upload).

api.root

API root URL obtained by running flipAPI:::getApiRoot() in a Calculation in Displayr

company.secret

A string containing the appropriate company secret to access the required Displayr drive

client.id

Client ID obtained by running flipAPI:::getApiRoot() in a Calculation in Displayr

send.to

Character string the can be used to more conveniently specify an alternative company (i.e. api.root, company.secret, and client.id) to upload the QScript to. See the Details.

Details

If the send.to argument is provided, the inputs for api.root, company.secret, and client.id are ignored and it is assumed that the user has additional environment variables setup that are used instead. For example, if send.to = "JANE", then the function uses Sys.getenv("COMPANY_SECRET_JANE") for company.secret (and similarly for client.id and api.root).


Displayr/flipAPI documentation built on April 17, 2024, 9:42 a.m.