Skip to content

Latest commit

 

History

History
119 lines (89 loc) · 3.75 KB

API.md

File metadata and controls

119 lines (89 loc) · 3.75 KB

Functions

execute(email, key, project, query, service, params)

executes a query using Google Bigquery API

authFastly(token, service)

authenticates token and service with Fastly

loadQuery(query)

reads a query file and loads it into memory

cleanQueryParams(query, params)

strips params object of helix query parameters

queryReplace(query, params)

replaces helix query parameter placeholders denoted by ^param in a query with value in param object. Example; SELECT * FROM ^tablename ^tabename is the query parameter; so it's expected that the params object contains {tablename: 'some-value'}

getExtraParameters(query)

processes additional parameters to be passed into request for example; --- Cache-Control: max-age: 300.

cleanRequestParams(params)

removes used up parameters from request

execute(email, key, project, query, service, params)

executes a query using Google Bigquery API

Kind: global function

Param Type Description
email string email address of the Google service account
key string private key of the global Google service account
project string the Google project ID
query string the name of a .sql file in queries directory
service string the serviceid of the published site
params object parameters for substitution into query

authFastly(token, service)

authenticates token and service with Fastly

Kind: global function

Param Type Description
token string Fastly Authentication Token
service string serviceid for a helix-project

loadQuery(query)

reads a query file and loads it into memory

Kind: global function

Param Type Description
query string name of the query file

cleanQueryParams(query, params)

strips params object of helix query parameters

Kind: global function

Param Type Description
query string the content read from a query file
params object query parameters, that are inserted into query

queryReplace(query, params)

replaces helix query parameter placeholders denoted by ^param in a query with value in param object. Example; SELECT * FROM ^tablename ^tabename is the query parameter; so it's expected that the params object contains {tablename: 'some-value'}

Kind: global function

Param Type Description
query string the content read from a query file
params * query parameters, that are inserted into query

getExtraParameters(query)

processes additional parameters to be passed into request for example; --- Cache-Control: max-age: 300.

Kind: global function

Param Type Description
query string the content read from a query file

cleanRequestParams(params)

removes used up parameters from request

Kind: global function

Param Type Description
params object all parameters contained in a request