@simbachain/simbats
Advanced tools
Comparing version 1.0.3 to 1.1.0
@@ -13,3 +13,3 @@ import Configstore from 'configstore'; | ||
SIMBA_HOME = "SIMBA_HOME", | ||
SIMBATS_LOG_LEVEL = "SIMBATS_LOG_LEVEL" | ||
SIMBA_LOG_LEVEL = "SIMBA_LOG_LEVEL" | ||
} | ||
@@ -37,2 +37,3 @@ declare enum SimbaEnvFiles { | ||
static simbaEnvVarFile: string | undefined; | ||
static envVars: Record<any, any>; | ||
/** | ||
@@ -44,2 +45,4 @@ * handles our auth / access token info | ||
* handles project info, contained in simba.json | ||
* simba.json is not currently used in SimbaTS, but | ||
* there may be a use case for storing project info in the future | ||
*/ | ||
@@ -55,22 +58,56 @@ static get ProjectConfigStore(): Configstore; | ||
static get logLevel(): LogLevel; | ||
/** | ||
* retrieves SIMBA_API_BASE_URL from env file | ||
*/ | ||
static get baseURL(): string; | ||
/** | ||
* for env vars, we search, in this order: | ||
* local project directory for: | ||
* - .simbachain.env | ||
* - simbachain.env | ||
* - .env | ||
* helper function for setting env vars, so we're not repeating loop code | ||
* @param dir | ||
* @param foundKeys | ||
* @returns | ||
*/ | ||
private static setEnvVarsFromDirectory; | ||
/** | ||
* this method only gets called once, when a process first tries to retrieve an env var | ||
* if SimbaConfig.envVars's values is zero length, then we call this method | ||
* | ||
* then we look for a SIMBA_HOME env var at the system level, | ||
* and within that directory, we search for: | ||
* - .simbachain.env | ||
* - simbachain.env | ||
* - .env | ||
* The code is a bit convoluted, so here's the process: | ||
* 1. iterate through file names of (.simbachain.env, simbachain.env, .env) in our project root | ||
* 2. we then loop through each of our SimbaEnvVarKeys until we find all of them, or | ||
* we have finished going through all files (not all env vars are necessary to be set) | ||
* 3. we then run through 1-4 again, but we use SIMBA_HOME instead of project root | ||
* 4. set as SimbaConfig.envVars once finished | ||
* @returns {Promise<Record<any, any>>} | ||
*/ | ||
static setEnvVars(): Record<any, any>; | ||
/** | ||
* retrieves value for env var key. looks for: | ||
* | ||
* @param envVarKey key of environment variable we want to retrieve value | ||
* if SimbaConfig.envVars values has zero length, we first call SimbaConfig.setEnvVars | ||
* @param SimbaEnvVarKeys | ||
* @returns | ||
*/ | ||
static retrieveEnvVar(envVarKey: SimbaEnvVarKeys): string; | ||
/** | ||
* sets auth token in authconfig.json | ||
* @param authToken | ||
* @returns | ||
*/ | ||
static setAuthToken(authToken: Record<any, any>): void; | ||
/** | ||
* retrieves auth token from authconfig.json | ||
* @returns {Record<any, any>} | ||
*/ | ||
static getAuthTokenFromConfig(): Record<any, any>; | ||
/** | ||
* takes in an auth token and adds new fields, such as retrieved_at and expires_at | ||
* @param authToken | ||
* @returns {Record<any, any>} | ||
*/ | ||
static parseExpiry(authToken: Record<any, any>): Record<any, any>; | ||
/** | ||
* parses auth token and sets it in authconfig.json | ||
* @param authToken | ||
* @returns {Record<any, any>} | ||
*/ | ||
static getAndSetParsedAuthToken(authToken: Record<any, any>): Record<any, any>; | ||
@@ -80,3 +117,3 @@ /** | ||
* idea is to check for bad token before http call, if possible | ||
* @returns | ||
* @returns {boolean} | ||
*/ | ||
@@ -90,5 +127,11 @@ static tokenExpired(): boolean; | ||
* access token for client creds does not have a refresh token | ||
* @returns {boolean} | ||
*/ | ||
refreshTokenExpired(): boolean; | ||
/** | ||
* set a field in auth token in authconfig.json | ||
* @param fieldKey | ||
* @param fieldVal | ||
* @returns | ||
*/ | ||
refreshTokenExpired(): boolean; | ||
static setAuthTokenField(fieldKey: string, fieldVal: any): void; | ||
@@ -95,0 +138,0 @@ } |
@@ -45,3 +45,3 @@ "use strict"; | ||
SimbaEnvVarKeys["SIMBA_HOME"] = "SIMBA_HOME"; | ||
SimbaEnvVarKeys["SIMBATS_LOG_LEVEL"] = "SIMBATS_LOG_LEVEL"; | ||
SimbaEnvVarKeys["SIMBA_LOG_LEVEL"] = "SIMBA_LOG_LEVEL"; | ||
})(SimbaEnvVarKeys = exports.SimbaEnvVarKeys || (exports.SimbaEnvVarKeys = {})); | ||
@@ -85,2 +85,4 @@ var SimbaEnvFiles; | ||
* handles project info, contained in simba.json | ||
* simba.json is not currently used in SimbaTS, but | ||
* there may be a use case for storing project info in the future | ||
*/ | ||
@@ -107,5 +109,5 @@ static get ProjectConfigStore() { | ||
static get logLevel() { | ||
const level = SimbaConfig.retrieveEnvVar(SimbaEnvVarKeys.SIMBATS_LOG_LEVEL); | ||
const level = SimbaConfig.retrieveEnvVar(SimbaEnvVarKeys.SIMBA_LOG_LEVEL); | ||
if (level && !Object.values(LogLevel).includes(level)) { | ||
console.error(`SimbaConfig.logLevel :: SIMBA : EXIT : unrecognized SIMBATS_LOG_LEVEL - ${level} set in ${SimbaConfig.simbaEnvVarFile} : ${level} : using level "info" instead. Please note that LOG_LEVEL can be one of ${Object.values(LogLevel)}`); | ||
console.error(`SimbaConfig.logLevel :: SIMBA : EXIT : unrecognized SIMBA_LOG_LEVEL - ${level} set in ${SimbaConfig.simbaEnvVarFile} : ${level} : using level "info" instead. Please note that LOG_LEVEL can be one of ${Object.values(LogLevel)}`); | ||
return LogLevel.INFO; | ||
@@ -116,4 +118,7 @@ } | ||
} | ||
return process.env[SimbaEnvVarKeys.SIMBATS_LOG_LEVEL]; | ||
return process.env[SimbaEnvVarKeys.SIMBA_LOG_LEVEL]; | ||
} | ||
/** | ||
* retrieves SIMBA_API_BASE_URL from env file | ||
*/ | ||
static get baseURL() { | ||
@@ -126,66 +131,84 @@ SimbaConfig.log.debug(`:: SIMBA : ENTER :`); | ||
/** | ||
* for env vars, we search, in this order: | ||
* local project directory for: | ||
* - .simbachain.env | ||
* - simbachain.env | ||
* - .env | ||
* | ||
* then we look for a SIMBA_HOME env var at the system level, | ||
* and within that directory, we search for: | ||
* - .simbachain.env | ||
* - simbachain.env | ||
* - .env | ||
* | ||
* @param envVarKey key of environment variable we want to retrieve value | ||
* helper function for setting env vars, so we're not repeating loop code | ||
* @param dir | ||
* @param foundKeys | ||
* @returns | ||
*/ | ||
static retrieveEnvVar(envVarKey) { | ||
if (envVarKey === SimbaEnvVarKeys.SIMBA_AUTH_ENDPOINT) { | ||
return DEFAULT_AUTH_ENDPOINT; | ||
static setEnvVarsFromDirectory(dir, foundKeys) { | ||
if (!foundKeys.length) { | ||
foundKeys.push(SimbaEnvVarKeys.SIMBA_AUTH_ENDPOINT); | ||
SimbaConfig.envVars[SimbaEnvVarKeys.SIMBA_AUTH_ENDPOINT] = DEFAULT_AUTH_ENDPOINT; | ||
} | ||
// if we've already configured process.env: | ||
if (SimbaConfig.simbaEnvVarFileConfigured) { | ||
const val = process.env[envVarKey]; | ||
if (val) { | ||
return val; | ||
for (let i = 0; i < exports.simbaEnvFilesArray.length; i++) { | ||
if (foundKeys.length === Object.values(SimbaEnvVarKeys).length) { | ||
SimbaConfig.log.debug(`:: EXIT : ${JSON.stringify(SimbaConfig.envVars)}`); | ||
return; | ||
} | ||
else { | ||
// we don't want to panic if we're just looking for log level - user shouldn't have to set that | ||
if (envVarKey === SimbaEnvVarKeys.SIMBATS_LOG_LEVEL) { | ||
return LogLevel.INFO; | ||
const fileName = exports.simbaEnvFilesArray[i]; | ||
dotenv.config({ | ||
override: true, | ||
path: path.resolve(dir, fileName), | ||
}); | ||
for (let j = 0; j < Object.values(SimbaEnvVarKeys).length; j++) { | ||
const envVarKey = Object.values(SimbaEnvVarKeys)[j]; | ||
if (foundKeys.includes(envVarKey)) { | ||
continue; | ||
} | ||
const message = `no value found for environment variable ${envVarKey}`; | ||
console.error(`SimbaConfig.retrieveEnvVar :: SIMBA : EXIT : ${message}`); | ||
throw (message); | ||
else { | ||
const simbaKey = Object.values(SimbaEnvVarKeys)[j]; | ||
const val = process.env[simbaKey]; | ||
if (val) { | ||
SimbaConfig.envVars[simbaKey] = val; | ||
foundKeys.push(envVarKey); | ||
} | ||
} | ||
} | ||
} | ||
// first check local directory | ||
for (let i = 0; i < exports.simbaEnvFilesArray.length; i++) { | ||
const fileName = exports.simbaEnvFilesArray[i]; | ||
dotenv.config({ path: path.resolve(process_1.cwd(), fileName) }); | ||
const val = process.env[envVarKey]; | ||
if (val) { | ||
SimbaConfig.simbaEnvVarFileConfigured = true; | ||
SimbaConfig.simbaEnvVarFile = path.join(process_1.cwd(), fileName); | ||
return val; | ||
} | ||
} | ||
/** | ||
* this method only gets called once, when a process first tries to retrieve an env var | ||
* if SimbaConfig.envVars's values is zero length, then we call this method | ||
* | ||
* The code is a bit convoluted, so here's the process: | ||
* 1. iterate through file names of (.simbachain.env, simbachain.env, .env) in our project root | ||
* 2. we then loop through each of our SimbaEnvVarKeys until we find all of them, or | ||
* we have finished going through all files (not all env vars are necessary to be set) | ||
* 3. we then run through 1-4 again, but we use SIMBA_HOME instead of project root | ||
* 4. set as SimbaConfig.envVars once finished | ||
* @returns {Promise<Record<any, any>>} | ||
*/ | ||
static setEnvVars() { | ||
const foundKeys = []; | ||
SimbaConfig.setEnvVarsFromDirectory(process_1.cwd(), foundKeys); | ||
SimbaConfig.setEnvVarsFromDirectory(SIMBA_HOME, foundKeys); | ||
return SimbaConfig.envVars; | ||
} | ||
/** | ||
* retrieves value for env var key. looks for: | ||
* | ||
* if SimbaConfig.envVars values has zero length, we first call SimbaConfig.setEnvVars | ||
* @param SimbaEnvVarKeys | ||
* @returns | ||
*/ | ||
static retrieveEnvVar(envVarKey) { | ||
let envVars; | ||
if (!Object.values(SimbaConfig.envVars).length) { | ||
envVars = SimbaConfig.setEnvVars(); | ||
} | ||
// now we check SIMBA_HOME directory | ||
for (let i = 0; i < exports.simbaEnvFilesArray.length; i++) { | ||
const fileName = exports.simbaEnvFilesArray[i]; | ||
dotenv.config({ path: path.resolve(SIMBA_HOME, fileName) }); | ||
const val = process.env[envVarKey]; | ||
if (val) { | ||
SimbaConfig.simbaEnvVarFileConfigured = true; | ||
SimbaConfig.simbaEnvVarFile = path.join(SIMBA_HOME, fileName); | ||
return val; | ||
} | ||
else { | ||
envVars = SimbaConfig.envVars; | ||
} | ||
// we don't want to panic if we're just looking for log level - user shouldn't have to set that | ||
if (envVarKey === SimbaEnvVarKeys.SIMBATS_LOG_LEVEL) { | ||
return LogLevel.INFO; | ||
const val = envVars[envVarKey]; | ||
if (val) { | ||
return val; | ||
} | ||
const message = `unable to find ${envVarKey} in local project or in your SIMBA_HOME directory. To solve, please make sure ${envVarKey} is set as an environment variable in ${SimbaEnvFiles.DOT_SIMBACHAIN_DOT_ENV}, ${SimbaEnvFiles.SIMBACHAIN_DOT_ENV}, or ${SimbaEnvFiles.DOT_ENV}. You can do this in either the top level of this project's directory, or in the directory that your system level SIMBA_HOME points to.`; | ||
console.error(`SimbaConfig.retrieveEnvVar :: SIMBA : EXIT : ${message}`); | ||
throw (message); | ||
const message = `Unable to find value for ${envVarKey}. You can set this in one of the following file names: .simbachain.env, simbachain.env, or .env; and these files can live in your local project root (best option) or in the directory that SIMBA_HOME points to in your system env vars.`; | ||
// SimbaConfig.log.error(`${chalk.redBright(`:: EXIT : ${message}`)}`); | ||
throw new Error(message); | ||
} | ||
/** | ||
* sets auth token in authconfig.json | ||
* @param authToken | ||
* @returns | ||
*/ | ||
static setAuthToken(authToken) { | ||
@@ -197,2 +220,6 @@ SimbaConfig.log.debug(`:: SIMBA : ENTER :`); | ||
} | ||
/** | ||
* retrieves auth token from authconfig.json | ||
* @returns {Record<any, any>} | ||
*/ | ||
static getAuthTokenFromConfig() { | ||
@@ -206,2 +233,7 @@ SimbaConfig.log.debug(`:: SIMBA : ENTER :`); | ||
} | ||
/** | ||
* takes in an auth token and adds new fields, such as retrieved_at and expires_at | ||
* @param authToken | ||
* @returns {Record<any, any>} | ||
*/ | ||
static parseExpiry(authToken) { | ||
@@ -224,2 +256,7 @@ SimbaConfig.log.debug(`:: SIMBA : ENTER :`); | ||
} | ||
/** | ||
* parses auth token and sets it in authconfig.json | ||
* @param authToken | ||
* @returns {Record<any, any>} | ||
*/ | ||
static getAndSetParsedAuthToken(authToken) { | ||
@@ -235,3 +272,3 @@ SimbaConfig.log.debug(`:: SIMBA : ENTER :`); | ||
* idea is to check for bad token before http call, if possible | ||
* @returns | ||
* @returns {boolean} | ||
*/ | ||
@@ -262,3 +299,3 @@ static tokenExpired() { | ||
* access token for client creds does not have a refresh token | ||
* @returns | ||
* @returns {boolean} | ||
*/ | ||
@@ -283,2 +320,8 @@ refreshTokenExpired() { | ||
} | ||
/** | ||
* set a field in auth token in authconfig.json | ||
* @param fieldKey | ||
* @param fieldVal | ||
* @returns | ||
*/ | ||
static setAuthTokenField(fieldKey, fieldVal) { | ||
@@ -301,2 +344,3 @@ const params = { | ||
SimbaConfig.simbaEnvVarFileConfigured = false; | ||
SimbaConfig.envVars = {}; | ||
//# sourceMappingURL=config.js.map |
@@ -14,9 +14,38 @@ /// <reference types="node" /> | ||
export declare class FileHandler { | ||
/** | ||
* transfer file from inputPath to outputPath | ||
* @param inputPath | ||
* @param outputPath | ||
* @param parseAsJson | ||
*/ | ||
static transferFile(inputPath: string, outputPath: string, parseAsJson?: boolean): Promise<void>; | ||
/** | ||
* | ||
* @param data | ||
* @param downloadLocation | ||
* @returns {Promise<any>} | ||
*/ | ||
static download(data: any, downloadLocation: string): Promise<any>; | ||
/** | ||
* | ||
* @param filePath | ||
* @returns {Promise<any>} | ||
*/ | ||
static parsedFile(filePath: string): Promise<any>; | ||
/** | ||
* creates directory recursively | ||
* @param filePath | ||
*/ | ||
static makeDirectory(filePath: string): void; | ||
/** | ||
* deletes a file | ||
* @param filePath | ||
*/ | ||
static removeFile(filePath: string): void; | ||
/** | ||
* deletes a directory | ||
* @param filePath | ||
*/ | ||
static removeDirectory(filePath: string): void; | ||
} | ||
//# sourceMappingURL=filehandler.d.ts.map |
@@ -41,2 +41,8 @@ "use strict"; | ||
class FileHandler { | ||
/** | ||
* transfer file from inputPath to outputPath | ||
* @param inputPath | ||
* @param outputPath | ||
* @param parseAsJson | ||
*/ | ||
static async transferFile(inputPath, outputPath, parseAsJson = true) { | ||
@@ -58,2 +64,8 @@ const buf = await exports.promisifiedReadFile(inputPath, { flag: 'r' }); | ||
} | ||
/** | ||
* | ||
* @param data | ||
* @param downloadLocation | ||
* @returns {Promise<any>} | ||
*/ | ||
static async download(data, downloadLocation) { | ||
@@ -73,2 +85,7 @@ FileHandler.makeDirectory(downloadLocation); | ||
} | ||
/** | ||
* | ||
* @param filePath | ||
* @returns {Promise<any>} | ||
*/ | ||
static async parsedFile(filePath) { | ||
@@ -78,2 +95,6 @@ const buf = await exports.promisifiedReadFile(filePath, { flag: 'r' }); | ||
} | ||
/** | ||
* creates directory recursively | ||
* @param filePath | ||
*/ | ||
static makeDirectory(filePath) { | ||
@@ -86,2 +107,6 @@ const dirName = path.dirname(filePath); | ||
} | ||
/** | ||
* deletes a file | ||
* @param filePath | ||
*/ | ||
static removeFile(filePath) { | ||
@@ -93,2 +118,6 @@ config_1.SimbaConfig.log.info(`:: deleting file ${filePath}`); | ||
} | ||
/** | ||
* deletes a directory | ||
* @param filePath | ||
*/ | ||
static removeDirectory(filePath) { | ||
@@ -95,0 +124,0 @@ try { |
import { RequestHandler } from "./request_handler"; | ||
/** | ||
* this class is used to check param types before making HTTP call for contract methods | ||
*/ | ||
declare class ParamCheckingContract { | ||
@@ -10,10 +13,58 @@ appName: string; | ||
constructor(appName: string, contractName: string, baseApiUrl: string, metadata?: Record<any, any>); | ||
/** | ||
* gives the true type of a variable, since pretty much everything in JS is just an "object" | ||
* @param someObject | ||
* @returns {string} | ||
*/ | ||
trueType(someObject: any): string; | ||
/** | ||
* retrieves metadata for this.contractName | ||
* @returns {Promise<Record<any, any>>} | ||
*/ | ||
getMetadata(): Promise<Record<any, any>>; | ||
/** | ||
* specifies whether a param is an array | ||
* @param param | ||
* @returns {boolean} | ||
*/ | ||
isArray(param: string): boolean; | ||
/** | ||
* specifies what variables are permitted as elements of an array | ||
* @param arrString | ||
* @returns {Record<number | string, string>} | ||
*/ | ||
arrayRestrictions(arrString: string): Record<number | string, string>; | ||
/** | ||
* returns number of dimensions for an array | ||
* @param param | ||
* @param dims | ||
* @returns {number} | ||
*/ | ||
getDimensions(param: string, dims?: number): number; | ||
/** | ||
* specifies all param restrictions for all contract methods | ||
* @returns {Promise<Record<any, any> | void>} | ||
*/ | ||
paramRestrictions(): Promise<Record<any, any> | void>; | ||
/** | ||
* returns true if passed array argument meets param restrictions | ||
* @param arr | ||
* @param paramName | ||
* @param paramRestrictionsObj | ||
* @param level | ||
* @returns {boolean | Error} | ||
*/ | ||
private checkArrayRestrictions; | ||
/** | ||
* returns true if a passed uint argument meets param restrictions | ||
* @param paramValue | ||
* @returns {boolean | Error} | ||
*/ | ||
private checkUintRestriction; | ||
/** | ||
* validates all passed arguments for a method call | ||
* @param methodName | ||
* @param inputs | ||
* @returns {Promise<boolean | Error>} | ||
*/ | ||
validateParams(methodName: string, inputs: Record<any, any> | null): Promise<boolean | Error>; | ||
@@ -20,0 +71,0 @@ } |
@@ -10,5 +10,5 @@ "use strict"; | ||
const request_handler_1 = require("./request_handler"); | ||
// this logic will need to look different in langX, | ||
// since we can't call "this" in constructor | ||
// to get metadata | ||
/** | ||
* this class is used to check param types before making HTTP call for contract methods | ||
*/ | ||
class ParamCheckingContract { | ||
@@ -25,5 +25,14 @@ constructor(appName, contractName, baseApiUrl, metadata) { | ||
} | ||
/** | ||
* gives the true type of a variable, since pretty much everything in JS is just an "object" | ||
* @param someObject | ||
* @returns {string} | ||
*/ | ||
trueType(someObject) { | ||
return Object.prototype.toString.call(someObject).slice(8, -1).toLowerCase(); | ||
} | ||
/** | ||
* retrieves metadata for this.contractName | ||
* @returns {Promise<Record<any, any>>} | ||
*/ | ||
async getMetadata() { | ||
@@ -60,5 +69,15 @@ config_1.SimbaConfig.log.debug(`:: SIMBA : ENTER :`); | ||
} | ||
/** | ||
* specifies whether a param is an array | ||
* @param param | ||
* @returns {boolean} | ||
*/ | ||
isArray(param) { | ||
return param.endsWith("]"); | ||
} | ||
/** | ||
* specifies what variables are permitted as elements of an array | ||
* @param arrString | ||
* @returns {Record<number | string, string>} | ||
*/ | ||
arrayRestrictions(arrString) { | ||
@@ -94,2 +113,8 @@ config_1.SimbaConfig.log.debug(`:: ENTER : ${arrString}`); | ||
} | ||
/** | ||
* returns number of dimensions for an array | ||
* @param param | ||
* @param dims | ||
* @returns {number} | ||
*/ | ||
getDimensions(param, dims = 0) { | ||
@@ -103,2 +128,6 @@ if (!param.includes("[")) { | ||
} | ||
/** | ||
* specifies all param restrictions for all contract methods | ||
* @returns {Promise<Record<any, any> | void>} | ||
*/ | ||
async paramRestrictions() { | ||
@@ -149,2 +178,10 @@ config_1.SimbaConfig.log.debug(`:: SIMBA : ENTER :`); | ||
} | ||
/** | ||
* returns true if passed array argument meets param restrictions | ||
* @param arr | ||
* @param paramName | ||
* @param paramRestrictionsObj | ||
* @param level | ||
* @returns {boolean | Error} | ||
*/ | ||
checkArrayRestrictions(arr, paramName, paramRestrictionsObj, level = 0) { | ||
@@ -211,2 +248,7 @@ const funcParams = { | ||
} | ||
/** | ||
* returns true if a passed uint argument meets param restrictions | ||
* @param paramValue | ||
* @returns {boolean | Error} | ||
*/ | ||
checkUintRestriction(paramValue) { | ||
@@ -227,2 +269,8 @@ config_1.SimbaConfig.log.debug(`:: ENTER : ${JSON.stringify(paramValue)}`); | ||
} | ||
/** | ||
* validates all passed arguments for a method call | ||
* @param methodName | ||
* @param inputs | ||
* @returns {Promise<boolean | Error>} | ||
*/ | ||
async validateParams(methodName, inputs) { | ||
@@ -229,0 +277,0 @@ const par = { |
@@ -9,25 +9,128 @@ import { AxiosResponse } from "axios"; | ||
} | ||
/** | ||
* class for making HTTP requests | ||
*/ | ||
export declare class RequestHandler { | ||
baseURL: string; | ||
constructor(baseURL?: string); | ||
/** | ||
* method for building a URL, accounting for redundant slashes, etc. | ||
* @param baseURL | ||
* @param endpoint | ||
* @returns {string} | ||
*/ | ||
buildURL(baseURL: string, endpoint: string): string; | ||
private doHTTPRequest; | ||
/** | ||
* general method for making HTTP requests. never gets called directly | ||
* @param url | ||
* @param method | ||
* @param options | ||
* @param data | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | Array<any>>} | ||
*/ | ||
doHTTPRequest(url: string, method: string, options: Record<any, any>, data?: Record<any, any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any> | Array<any>>; | ||
/** | ||
* do post request | ||
* @param url | ||
* @param options | ||
* @param data | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | Array<any>>} | ||
*/ | ||
doPostRequest(url: string, options: Record<any, any>, data?: Record<any, any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any> | Array<any>>; | ||
/** | ||
* do get request | ||
* @param url | ||
* @param options | ||
* @param parseDataFromResponse | ||
* @param responseType | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | Array<any>>} | ||
*/ | ||
doGetRequest(url: string, options: Record<any, any>, parseDataFromResponse?: boolean, responseType?: string): Promise<AxiosResponse<any> | Record<any, any> | Array<any>>; | ||
/** | ||
* do put request | ||
* @param url | ||
* @param options | ||
* @param data | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | Array<any>>} | ||
*/ | ||
doPutRequest(url: string, options: Record<any, any>, data?: Record<any, any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any> | Array<any>>; | ||
/** | ||
* do delete request | ||
* @param url | ||
* @param options | ||
* @param data | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | Array<any>>} | ||
*/ | ||
doDeleteRequest(url: string, options: Record<any, any>, data?: Record<any, any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any> | Array<any>>; | ||
/** | ||
* method for generating headers for form data | ||
* @param options | ||
* @param formData | ||
* @returns {Record<any, any>} | ||
*/ | ||
formDataHeaders(options: Record<any, any>, formData: FormData): Record<any, any>; | ||
/** | ||
* method for generating form data, by passing file paths and method inputs | ||
* @param inputs | ||
* @param filePaths | ||
* @returns {FormData} | ||
*/ | ||
formDataFromFilePathsAndInputs(inputs: Record<any, any>, filePaths: Array<string>): FormData; | ||
/** | ||
* do post or put request with form data | ||
* never gets called directly | ||
* @param url | ||
* @param method | ||
* @param formData | ||
* @param headers | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | Array<any>>} | ||
*/ | ||
private doPostOrPutRequestWithFormData; | ||
/** | ||
* do post request with form data | ||
* @param url | ||
* @param formData | ||
* @param headers | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | Array<any>>} | ||
*/ | ||
doPostRequestWithFormData(url: string, formData: FormData, headers: Record<any, any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any> | Array<any>>; | ||
/** | ||
* do put request with form data | ||
* @param url | ||
* @param formData | ||
* @param headers | ||
* @param parseDataFromResponse | ||
* @returns {Promise<Record<any, any>>} | ||
*/ | ||
doPutRequestWithFormData(url: string, formData: FormData, headers: Record<any, any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any> | Array<any>>; | ||
/** | ||
* generate auth token from client creds | ||
* @returns {Promise<Record<any, any>>} | ||
*/ | ||
getAuthTokenFromClientCreds(): Promise<Record<any, any>>; | ||
/** | ||
* generate auth token, then set in authconfig.json | ||
* @returns {Promise<Record<any, any>>} | ||
*/ | ||
setAndGetAuthToken(): Promise<Record<any, any>>; | ||
/** | ||
* returns headers with access token | ||
* @returns | ||
* @returns {Promise<Record<any, any>>} | ||
*/ | ||
accessTokenHeader(): Promise<Record<any, any>>; | ||
/** | ||
* generate headers with access token and other headers | ||
* @param contentType | ||
* @param queryParams | ||
* @param addContentType | ||
* @returns {Promise<Record<any, any>>} | ||
*/ | ||
getAuthAndOptions(contentType?: string, queryParams?: Record<any, any>, addContentType?: boolean): Promise<Record<any, any>>; | ||
} | ||
//# sourceMappingURL=request_handler.d.ts.map |
@@ -38,2 +38,5 @@ "use strict"; | ||
})(RequestMethods = exports.RequestMethods || (exports.RequestMethods = {})); | ||
/** | ||
* class for making HTTP requests | ||
*/ | ||
class RequestHandler { | ||
@@ -43,2 +46,8 @@ constructor(baseURL = config_1.SimbaConfig.baseURL) { | ||
} | ||
/** | ||
* method for building a URL, accounting for redundant slashes, etc. | ||
* @param baseURL | ||
* @param endpoint | ||
* @returns {string} | ||
*/ | ||
buildURL(baseURL, endpoint) { | ||
@@ -63,2 +72,11 @@ const params = { | ||
} | ||
/** | ||
* general method for making HTTP requests. never gets called directly | ||
* @param url | ||
* @param method | ||
* @param options | ||
* @param data | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | Array<any>>} | ||
*/ | ||
async doHTTPRequest(url, method, options, data, parseDataFromResponse = true) { | ||
@@ -118,2 +136,10 @@ const params = { | ||
} | ||
/** | ||
* do post request | ||
* @param url | ||
* @param options | ||
* @param data | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | Array<any>>} | ||
*/ | ||
async doPostRequest(url, options, data, parseDataFromResponse = true) { | ||
@@ -131,2 +157,10 @@ const params = { | ||
} | ||
/** | ||
* do get request | ||
* @param url | ||
* @param options | ||
* @param parseDataFromResponse | ||
* @param responseType | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | Array<any>>} | ||
*/ | ||
async doGetRequest(url, options, parseDataFromResponse = true, responseType) { | ||
@@ -146,2 +180,10 @@ const params = { | ||
} | ||
/** | ||
* do put request | ||
* @param url | ||
* @param options | ||
* @param data | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | Array<any>>} | ||
*/ | ||
async doPutRequest(url, options, data, parseDataFromResponse = true) { | ||
@@ -159,2 +201,10 @@ const params = { | ||
} | ||
/** | ||
* do delete request | ||
* @param url | ||
* @param options | ||
* @param data | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | Array<any>>} | ||
*/ | ||
async doDeleteRequest(url, options, data, parseDataFromResponse = true) { | ||
@@ -172,2 +222,8 @@ const params = { | ||
} | ||
/** | ||
* method for generating headers for form data | ||
* @param options | ||
* @param formData | ||
* @returns {Record<any, any>} | ||
*/ | ||
formDataHeaders(options, formData) { | ||
@@ -190,2 +246,8 @@ const params = { | ||
} | ||
/** | ||
* method for generating form data, by passing file paths and method inputs | ||
* @param inputs | ||
* @param filePaths | ||
* @returns {FormData} | ||
*/ | ||
formDataFromFilePathsAndInputs(inputs, filePaths) { | ||
@@ -208,2 +270,12 @@ const params = { | ||
} | ||
/** | ||
* do post or put request with form data | ||
* never gets called directly | ||
* @param url | ||
* @param method | ||
* @param formData | ||
* @param headers | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | Array<any>>} | ||
*/ | ||
async doPostOrPutRequestWithFormData(url, method, formData, headers, parseDataFromResponse = true) { | ||
@@ -244,2 +316,10 @@ const params = { | ||
} | ||
/** | ||
* do post request with form data | ||
* @param url | ||
* @param formData | ||
* @param headers | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | Array<any>>} | ||
*/ | ||
async doPostRequestWithFormData(url, formData, headers, parseDataFromResponse = true) { | ||
@@ -257,2 +337,10 @@ const params = { | ||
} | ||
/** | ||
* do put request with form data | ||
* @param url | ||
* @param formData | ||
* @param headers | ||
* @param parseDataFromResponse | ||
* @returns {Promise<Record<any, any>>} | ||
*/ | ||
async doPutRequestWithFormData(url, formData, headers, parseDataFromResponse = true) { | ||
@@ -270,2 +358,6 @@ const params = { | ||
} | ||
/** | ||
* generate auth token from client creds | ||
* @returns {Promise<Record<any, any>>} | ||
*/ | ||
async getAuthTokenFromClientCreds() { | ||
@@ -307,2 +399,6 @@ config_1.SimbaConfig.log.debug(`:: SIMBA : ENTER :`); | ||
} | ||
/** | ||
* generate auth token, then set in authconfig.json | ||
* @returns {Promise<Record<any, any>>} | ||
*/ | ||
async setAndGetAuthToken() { | ||
@@ -317,3 +413,3 @@ config_1.SimbaConfig.log.debug(`:: SIMBA : ENTER :`); | ||
* returns headers with access token | ||
* @returns | ||
* @returns {Promise<Record<any, any>>} | ||
*/ | ||
@@ -344,2 +440,9 @@ async accessTokenHeader() { | ||
} | ||
/** | ||
* generate headers with access token and other headers | ||
* @param contentType | ||
* @param queryParams | ||
* @param addContentType | ||
* @returns {Promise<Record<any, any>>} | ||
*/ | ||
async getAuthAndOptions(contentType, queryParams, addContentType = true) { | ||
@@ -346,0 +449,0 @@ const params = { |
@@ -5,2 +5,5 @@ import { SimbaContract } from "./simba_contract"; | ||
import { SimbaSync } from "./simba_sync"; | ||
/** | ||
* extends SimbaContract, for submitting synchronous contract methods | ||
*/ | ||
export declare class SimbaContractSync extends SimbaContract { | ||
@@ -16,4 +19,12 @@ baseApiUrl: string; | ||
constructor(baseApiUrl: string, appName: string, contractName: string); | ||
/** | ||
* submit method synchronously | ||
* @param methodName | ||
* @param inputs | ||
* @param filePaths | ||
* @param validateParams | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
submitMethod(methodName: string, inputs?: Record<any, any>, filePaths?: Array<string>, validateParams?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
} | ||
//# sourceMappingURL=simba_contract_sync.d.ts.map |
@@ -8,2 +8,5 @@ "use strict"; | ||
const simba_sync_1 = require("./simba_sync"); | ||
/** | ||
* extends SimbaContract, for submitting synchronous contract methods | ||
*/ | ||
class SimbaContractSync extends simba_contract_1.SimbaContract { | ||
@@ -19,2 +22,10 @@ constructor(baseApiUrl, appName, contractName) { | ||
} | ||
/** | ||
* submit method synchronously | ||
* @param methodName | ||
* @param inputs | ||
* @param filePaths | ||
* @param validateParams | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
async submitMethod(methodName, inputs, filePaths, validateParams = true) { | ||
@@ -21,0 +32,0 @@ const params = { |
@@ -5,2 +5,5 @@ import { AxiosResponse } from "axios"; | ||
import { Simba } from "./simba"; | ||
/** | ||
* Main class for submitting contract methods | ||
*/ | ||
export declare class SimbaContract extends ParamCheckingContract { | ||
@@ -17,11 +20,59 @@ baseApiURL: string; | ||
constructor(baseApiURL: string, appName: string, contractName: string); | ||
/** | ||
* returns past invocations of contract method calls for methodName | ||
* @param methodName | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
callMethod(methodName: string): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* invokes methodName | ||
* @param methodName | ||
* @param inputs | ||
* @param filePaths | ||
* @param validateParams | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
submitMethod(methodName: string, inputs?: Record<any, any>, filePaths?: Array<string>, validateParams?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* returns transactions for methodName | ||
* @param methodName | ||
* @param queryParams | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
getTransactionsByMethod(methodName: string, queryParams?: Record<any, any>): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* returns events for eventName | ||
* @param eventName | ||
* @param queryParams | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
getEvents(eventName: string, queryParams?: Record<any, any>): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* validate bundleHash | ||
* @param bundleHash | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | void>} | ||
*/ | ||
validateBundleHash(bundleHash: string): Promise<AxiosResponse<any> | Record<any, any> | void>; | ||
/** | ||
* get bundle from bundleHash | ||
* @param bundleHash | ||
* @param downloadLocation | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | void | unknown>} | ||
*/ | ||
getBundle(bundleHash: string, downloadLocation: string): Promise<AxiosResponse<any> | Record<any, any> | void | unknown>; | ||
/** | ||
* get file from bundleHash | ||
* @param bundleHash | ||
* @param fileName | ||
* @param downloadLocation | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | void | unknown>} | ||
*/ | ||
getBundleFile(bundleHash: string, fileName: string, downloadLocation: string): Promise<AxiosResponse<any> | Record<any, any> | void | unknown>; | ||
/** | ||
* get manifest from bundleHash | ||
* @param bundleHash | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | void>} | ||
*/ | ||
getManifestFromBundleHash(bundleHash: string): Promise<AxiosResponse<any> | Record<any, any> | void>; | ||
} | ||
//# sourceMappingURL=simba_contract.d.ts.map |
@@ -8,2 +8,5 @@ "use strict"; | ||
const simba_1 = require("./simba"); | ||
/** | ||
* Main class for submitting contract methods | ||
*/ | ||
class SimbaContract extends param_checking_contract_1.ParamCheckingContract { | ||
@@ -19,2 +22,7 @@ constructor(baseApiURL, appName, contractName) { | ||
} | ||
/** | ||
* returns past invocations of contract method calls for methodName | ||
* @param methodName | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
async callMethod(methodName) { | ||
@@ -29,2 +37,10 @@ const params = { | ||
} | ||
/** | ||
* invokes methodName | ||
* @param methodName | ||
* @param inputs | ||
* @param filePaths | ||
* @param validateParams | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
async submitMethod(methodName, inputs, filePaths, validateParams = true) { | ||
@@ -44,2 +60,8 @@ const params = { | ||
} | ||
/** | ||
* returns transactions for methodName | ||
* @param methodName | ||
* @param queryParams | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
async getTransactionsByMethod(methodName, queryParams) { | ||
@@ -54,2 +76,8 @@ const params = { | ||
} | ||
/** | ||
* returns events for eventName | ||
* @param eventName | ||
* @param queryParams | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
async getEvents(eventName, queryParams) { | ||
@@ -65,2 +93,7 @@ const params = { | ||
} | ||
/** | ||
* validate bundleHash | ||
* @param bundleHash | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | void>} | ||
*/ | ||
async validateBundleHash(bundleHash) { | ||
@@ -75,2 +108,8 @@ const params = { | ||
} | ||
/** | ||
* get bundle from bundleHash | ||
* @param bundleHash | ||
* @param downloadLocation | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | void | unknown>} | ||
*/ | ||
async getBundle(bundleHash, downloadLocation) { | ||
@@ -86,2 +125,9 @@ const params = { | ||
} | ||
/** | ||
* get file from bundleHash | ||
* @param bundleHash | ||
* @param fileName | ||
* @param downloadLocation | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | void | unknown>} | ||
*/ | ||
async getBundleFile(bundleHash, fileName, downloadLocation) { | ||
@@ -98,2 +144,7 @@ const params = { | ||
} | ||
/** | ||
* get manifest from bundleHash | ||
* @param bundleHash | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | void>} | ||
*/ | ||
async getManifestFromBundleHash(bundleHash) { | ||
@@ -100,0 +151,0 @@ const params = { |
@@ -5,2 +5,5 @@ import { AxiosResponse } from "axios"; | ||
import { SimbaContractSync } from "./simba_contract_sync"; | ||
/** | ||
* extends Simba object, for making synhronous method calls | ||
*/ | ||
export declare class SimbaSync extends Simba { | ||
@@ -10,5 +13,21 @@ baseApiUrl: string; | ||
constructor(baseApiUrl?: string, requestHandler?: RequestHandler); | ||
/** | ||
* returns synchronous version of SimbaContract (SimbaContractSync) | ||
* @param appName | ||
* @param contractName | ||
* @returns {SimbaContractSync} | ||
*/ | ||
getSimbaContract(appName: string, contractName: string): SimbaContractSync; | ||
/** | ||
* submit contract method synchronously | ||
* @param appName | ||
* @param contractName | ||
* @param methodName | ||
* @param inputs | ||
* @param filePaths | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
submitContractMethod(appName: string, contractName: string, methodName: string, inputs?: Record<any, any>, filePaths?: Array<any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
} | ||
//# sourceMappingURL=simba_sync.d.ts.map |
@@ -8,2 +8,5 @@ "use strict"; | ||
const simba_contract_sync_1 = require("./simba_contract_sync"); | ||
/** | ||
* extends Simba object, for making synhronous method calls | ||
*/ | ||
class SimbaSync extends simba_1.Simba { | ||
@@ -15,2 +18,8 @@ constructor(baseApiUrl = config_1.SimbaConfig.baseURL, requestHandler = new request_handler_1.RequestHandler()) { | ||
} | ||
/** | ||
* returns synchronous version of SimbaContract (SimbaContractSync) | ||
* @param appName | ||
* @param contractName | ||
* @returns {SimbaContractSync} | ||
*/ | ||
getSimbaContract(appName, contractName) { | ||
@@ -26,2 +35,12 @@ const params = { | ||
} | ||
/** | ||
* submit contract method synchronously | ||
* @param appName | ||
* @param contractName | ||
* @param methodName | ||
* @param inputs | ||
* @param filePaths | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
async submitContractMethod(appName, contractName, methodName, inputs, filePaths, parseDataFromResponse = true) { | ||
@@ -28,0 +47,0 @@ const params = { |
import { AxiosResponse } from "axios"; | ||
import { RequestHandler } from "./request_handler"; | ||
import { SimbaContract } from "./simba_contract"; | ||
/** | ||
* main class for interacting with SIMBA platform | ||
*/ | ||
export declare class Simba { | ||
@@ -8,48 +11,416 @@ baseApiUrl: string; | ||
constructor(baseApiUrl?: string, requestHandler?: RequestHandler); | ||
/** | ||
* generate SimbaContract class instance | ||
* @param appName | ||
* @param contractName | ||
* @returns {SimbaContract} | ||
*/ | ||
getSimbaContract(appName: string, contractName: string): SimbaContract; | ||
/** | ||
* return user information | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
whoAmI(parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* fund wallet | ||
* @param blockchain | ||
* @param address | ||
* @param amount | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
fund(blockchain: string, address: string, amount: string | number, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* get balance from wallet | ||
* @param blockchain | ||
* @param address | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
balance(blockchain: string, address: string, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* set wallet - admin perms required | ||
* @param userID | ||
* @param blockchain | ||
* @param pub | ||
* @param priv | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
adminSetWallet(userID: string | number, blockchain: string, pub: string, priv: string, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* set wallet - no admin perms required | ||
* @param blockchain | ||
* @param pub | ||
* @param priv | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
setWallet(blockchain: string, pub: string, priv: string, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* get wallet | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
getWallet(parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* create organisation | ||
* @param name | ||
* @param display | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
createOrg(name: string, display: string, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* | ||
* @param orgName | ||
* @param appName | ||
* @param display | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | void>} | ||
*/ | ||
createApp(orgName: string, appName: string, display: string, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any> | void>; | ||
getApplications(parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* get application | ||
* @param orgName | ||
* @param appName | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
getApplication(orgName: string, appName: string, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* get transactions for application | ||
* @param appName | ||
* @param queryParams | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
getApplicationTransactions(appName: string, queryParams?: Record<any, any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* get contract from application | ||
* @param appName | ||
* @param contractName | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
getApplicationContract(appName: string, contractName: string, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* get transactions for contract | ||
* @param appName | ||
* @param contractName | ||
* @param queryParams | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
getContractTransactions(appName: string, contractName: string, queryParams?: Record<any, any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* get contracts for application | ||
* @param appName | ||
* @param queryParams | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
getContracts(appName: string, queryParams?: Record<any, any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* validate bundleHash | ||
* @param appName | ||
* @param contractName | ||
* @param bundleHash | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
validateBundleHash(appName: string, contractName: string, bundleHash: string, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* get bundle from bundleHash and contractName and appName | ||
* @param appName | ||
* @param contractName | ||
* @param bundleHash | ||
* @param downloadLocation | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | unknown>} | ||
*/ | ||
getBundle(appName: string, contractName: string, bundleHash: string, downloadLocation: string, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any> | unknown>; | ||
/** | ||
* get file from fileName, bundleHash, contractName, and appName | ||
* @param appName | ||
* @param contractName | ||
* @param bundleHash | ||
* @param fileName | ||
* @param downloadLocation | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any> | unknown>} | ||
*/ | ||
getBundleFile(appName: string, contractName: string, bundleHash: string, fileName: string, downloadLocation: string, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any> | unknown>; | ||
/** | ||
* get manifest for bundle from bundleHash | ||
* @param appName | ||
* @param contractName | ||
* @param bundleHash | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
getManifestForBundleFromBundleHash(appName: string, contractName: string, bundleHash: string, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* get contract info from contractName and appName | ||
* @param appName | ||
* @param contractName | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
getContractInfo(appName: string, contractName: string, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* get events from appName, contractName, and eventName | ||
* @param appName | ||
* @param contractName | ||
* @param eventName | ||
* @param queryParams | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
getEvents(appName: string, contractName: string, eventName: string, queryParams?: Record<any, any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* get events - admin perms required | ||
* @param queryParams | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
adminGetEvents(queryParams?: Record<any, any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* get receipt from appName, contractName, and receiptHash | ||
* @param appName | ||
* @param contractName | ||
* @param receiptHash | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
getReceipt(appName: string, contractName: string, receiptHash: string, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* get transaction from appName, contractName, and transactionHash | ||
* @param appName | ||
* @param contractName | ||
* @param transactionHash | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
getTransaction(appName: string, contractName: string, transactionHash: string, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* get transactions by method | ||
* @param appName | ||
* @param contractName | ||
* @param methodName | ||
* @param queryParams | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
getTransactionsByMethod(appName: string, contractName: string, methodName: string, queryParams?: Record<any, any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* get transactions by contract | ||
* @param appName | ||
* @param contractName | ||
* @param queryParams | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
getTransactionsByContract(appName: string, contractName: string, queryParams?: Record<any, any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* submit contract method | ||
* @param appName | ||
* @param contractName | ||
* @param methodName | ||
* @param inputs | ||
* @param filePaths | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
submitContractMethod(appName: string, contractName: string, methodName: string, inputs?: Record<any, any>, filePaths?: Array<any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* submit contract method synchronously | ||
* @param appName | ||
* @param contractName | ||
* @param methodName | ||
* @param inputs | ||
* @param filePaths | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
submitContractMethodSync(appName: string, contractName: string, methodName: string, inputs?: Record<any, any>, filePaths?: Array<any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* returns previous invocations of contract method | ||
* @param appName | ||
* @param contractName | ||
* @param methodName | ||
* @param args | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
callContractMethod(appName: string, contractName: string, methodName: string, args?: Record<any, any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* submit signed transaction for contract method | ||
* @param appName | ||
* @param txnId | ||
* @param txn | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
submitSignedTransaction(appName: string, txnId: string, txn: Record<any, any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* save contract design to SIMBA platform | ||
* @param orgName | ||
* @param name | ||
* @param code | ||
* @param designID | ||
* @param targetContract | ||
* @param libraries | ||
* @param encode | ||
* @param model | ||
* @param binaryTargets | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
saveDesign(orgName: string, name: string, code: string, designID?: string, targetContract?: string, libraries?: Record<any, any>, encode?: boolean, model?: string, binaryTargets?: Array<string>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* wait for deployment to be COMPLETED state | ||
* @param orgName | ||
* @param uid | ||
* @param totalTime | ||
* @param maxTime | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
waitForDeployment(orgName: string, uid: string, totalTime?: number, maxTime?: number, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* deploy contract design | ||
* @param orgName | ||
* @param appName | ||
* @param apiName | ||
* @param designID | ||
* @param blockchain | ||
* @param storage | ||
* @param displayName | ||
* @param args | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
deployDesign(orgName: string, appName: string, apiName: string, designID: string, blockchain: string, storage?: string, displayName?: string, args?: Record<any, any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* deploy contract artifact | ||
* @param orgName | ||
* @param appName | ||
* @param apiName | ||
* @param artifactID | ||
* @param blockchain | ||
* @param storage | ||
* @param displayName | ||
* @param args | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
deployArtifact(orgName: string, appName: string, apiName: string, artifactID: string, blockchain: string, storage?: string, displayName?: string, args?: Record<any, any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* wait for contract design to be COMPLETED state | ||
* @param orgName | ||
* @param appName | ||
* @param designID | ||
* @param apiName | ||
* @param blockchain | ||
* @param storage | ||
* @param displayName | ||
* @param args | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
waitForDeployDesign(orgName: string, appName: string, designID: string, apiName: string, blockchain: string, storage?: string, displayName?: string, args?: Record<any, any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Array<any>>; | ||
/** | ||
* wait for contract artifact to be COMPLETED state | ||
* @param orgName | ||
* @param appName | ||
* @param artifactID | ||
* @param apiName | ||
* @param blockchain | ||
* @param storage | ||
* @param displayName | ||
* @param args | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
waitForDeployArtifact(orgName: string, appName: string, artifactID: string, apiName: string, blockchain: string, storage?: string, displayName?: string, args?: Record<any, any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Array<any>>; | ||
/** | ||
* wait for transaction to be COMPLETED state | ||
* @param orgName | ||
* @param uid | ||
* @param totalTime | ||
* @param maxTime | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
waitForOrgTransaction(orgName: string, uid: string, totalTime?: number, maxTime?: number, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* get contract designs | ||
* @param orgName | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
getDesigns(orgName: string, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* get blockchains for organisation | ||
* @param orgName | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
getBlockchains(orgName: string, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* get storages for organisation | ||
* @param orgName | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
getStorages(orgName: string, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* get contract artifacts for organisation | ||
* @param orgName | ||
* @param queryParams | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
getArtifacts(orgName: string, queryParams?: Record<any, any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* get contract artifact | ||
* @param orgName | ||
* @param artifactID | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
getArtifact(orgName: string, artifactID: string, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* create contract artifact for organisation | ||
* @param orgName | ||
* @param designID | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
createArtifact(orgName: string, designID: string, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* create subscription organisation | ||
* @param orgName | ||
* @param notificationEndpoint | ||
* @param contractAPI | ||
* @param txn | ||
* @param subscriptionType | ||
* @param authType | ||
* @param parseDataFromResponse | ||
* @returns {Promise<AxiosResponse<any> | Record<any, any>>} | ||
*/ | ||
subscribe(orgName: string, notificationEndpoint: string, contractAPI: string, txn: string, subscriptionType: string, authType?: string, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
/** | ||
* set notification config for organisation | ||
* @param orgName | ||
* @param scheme | ||
* @param authType | ||
* @param authInfo | ||
* @param parseDataFromResponse | ||
* @returns | ||
*/ | ||
setNotificationConfig(orgName: string, scheme: string, authType?: string, authInfo?: Record<any, any>, parseDataFromResponse?: boolean): Promise<AxiosResponse<any> | Record<any, any>>; | ||
} | ||
//# sourceMappingURL=simba.d.ts.map |
@@ -0,3 +1,13 @@ | ||
/** | ||
* parse address from a deployment object | ||
* @param deployment | ||
* @returns {string | undefined} | ||
*/ | ||
export declare function getAddress(deployment: Record<any, any>): string | undefined; | ||
export declare function getDeployedArtifactID(deployment: Record<any, any>): string | undefined; | ||
/** | ||
* get artifact ID from deployment object | ||
* @param deployment | ||
* @returns {string | undefined} | ||
*/ | ||
export declare function getArtifactID(deployment: Record<any, any>): string | undefined; | ||
//# sourceMappingURL=utils.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getDeployedArtifactID = exports.getAddress = void 0; | ||
exports.getArtifactID = exports.getAddress = void 0; | ||
const config_1 = require("./config"); | ||
/** | ||
* parse address from a deployment object | ||
* @param deployment | ||
* @returns {string | undefined} | ||
*/ | ||
function getAddress(deployment) { | ||
@@ -15,3 +20,8 @@ const params = { | ||
exports.getAddress = getAddress; | ||
function getDeployedArtifactID(deployment) { | ||
/** | ||
* get artifact ID from deployment object | ||
* @param deployment | ||
* @returns {string | undefined} | ||
*/ | ||
function getArtifactID(deployment) { | ||
const params = { | ||
@@ -21,7 +31,7 @@ deployment, | ||
config_1.SimbaConfig.log.debug(`:: SIMBA : ENTER : params : ${JSON.stringify(params)}`); | ||
const primary = deployment.primary; | ||
const primary = deployment.artifact_id; | ||
config_1.SimbaConfig.log.debug(`:: SIMBA : EXIT : primary: ${primary}`); | ||
return primary; | ||
} | ||
exports.getDeployedArtifactID = getDeployedArtifactID; | ||
exports.getArtifactID = getArtifactID; | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "@simbachain/simbats", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "TypeScript SDK for SIMBA Chain", | ||
@@ -18,8 +18,9 @@ "main": "index.js", | ||
"test": "npm run unit_test && npm run integration_test", | ||
"unit_test": "cd src/tests/ && env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha -r ts-node/register './unit/**/*.ts'", | ||
"integration_test": "cd src/tests/ && env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha -r ts-node/register './integration/**/*.ts'", | ||
"setup_test": "cd src/tests/tests_setup/ && ts-node setup.ts", | ||
"teardown_test": "cd src/tests/tests_setup/ && ts-node teardown.ts", | ||
"unit_test": "cd tests/ && env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha -r ts-node/register './unit/**/*.ts'", | ||
"integration_test": "cd tests/ && env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha -r ts-node/register './integration/**/*.ts'", | ||
"setup_test": "cd tests/tests_setup/ && ts-node setup.ts", | ||
"teardown_test": "cd tests/tests_setup/ && ts-node teardown.ts", | ||
"unit_test_with_setup": "npm run setup_test && npm run unit_test && npm run teardown_test", | ||
"integration_test_with_setup": "npm run setup_test && npm run integration_test && npm run teardown_test" | ||
"integration_test_with_setup": "npm run setup_test && npm run integration_test && npm run teardown_test", | ||
"all_test_with_setup": "npm run unit_test_with_setup && npm run integration_test_with_setup" | ||
}, | ||
@@ -36,2 +37,3 @@ "dependencies": { | ||
"path": "^0.12.7", | ||
"sinon": "^15.0.1", | ||
"tslog": "^3.3.1", | ||
@@ -45,2 +47,3 @@ "typescript": "3.9.7", | ||
"@types/mocha": "^9.1.1", | ||
"@types/sinon": "^10.0.13", | ||
"@types/utf8": "^3.0.1", | ||
@@ -47,0 +50,0 @@ "axios": "^0.25.0", |
@@ -43,3 +43,3 @@ # SimbaTS | ||
SimbaTS is the TypeScript SDK for SIMBA Chain. It contains functionality for interacting with the SIMBA platform in general, as well as for interacting with your deployed smart contracts in particular. We currently have a service, Polyglot, that is under construction, which will streamline the process of interacting with your deployed smart contracts If you are using SimbaTS to interact with your deployed smart contracts, then we highly recommend you integrate with our Polyglot service, which we explain in this documentation. | ||
SimbaTS is the TypeScript SDK for SIMBA Chain. It contains functionality for interacting with the SIMBA platform in general, as well as for interacting with your deployed smart contracts in particular. We currently have a service, Polyglot, that is under construction, which will streamline the process of interacting with your deployed smart contracts If you are using SimbaTS to interact with your deployed smart contracts, then we highly recommend you integrate with our Polyglot service, which we explain in this documentation. As of this writing (March 2023), Polyglot is still under construction. | ||
@@ -72,5 +72,5 @@ ## Installation | ||
Additionall, you can also set the log level for debugging purposes. So for instance, if you want to set the SimbaTS logger to debug, you would set: | ||
Additionally, you can also set the log level for debugging purposes. So for instance, if you want to set the SimbaTS logger to debug, you would set: | ||
``` | ||
SIMBATS_LOG_LEVEL="info" | ||
SIMBA_LOG_LEVEL="info" | ||
``` | ||
@@ -92,3 +92,3 @@ | ||
For env vars, we search, in this order: | ||
* local project directory (the top level of your project) for: | ||
* local project directory (the root of your project) for: | ||
- .simbachain.env | ||
@@ -286,6 +286,2 @@ - simbachain.env | ||
// Simba.getApplications | ||
const simba = new Simba(); | ||
const apps = await simba.getApplications() as Record<any, any>; | ||
// Simba.getApplication | ||
@@ -909,3 +905,3 @@ const simba = new Simba(); | ||
### Testing | ||
This section pertains to testing, if you have clonded SimbaTS. To run tests for SimbaTS, you'll want to have your SIMBA environment variables set in .simbachain.env at the top level of the /tests/ directory. So something like: | ||
This section pertains to testing, if you have cloned SimbaTS. To run tests for SimbaTS, you'll want to have your SIMBA environment variables set in .simbachain.env at the top level of the /tests/ directory. So something like: | ||
@@ -916,9 +912,9 @@ ``` | ||
SIMBA_AUTH_CLIENT_ID="Insert your client ID" | ||
SIMBA_AUTH_CLIENT_SECRET="Insert your clietn secret" | ||
SIMBA_AUTH_CLIENT_SECRET="Insert your client secret" | ||
``` | ||
Additionally, you can also configure SIMBATS_LOG_LEVEL, if you want tests to be run at a different log level. So if you want tests to be run at "debug" level, in .simbachain.env you would set: | ||
Additionally, you can also configure SIMBA_LOG_LEVEL, if you want tests to be run at a different log level. So if you want tests to be run at "debug" level, in .simbachain.env you would set: | ||
``` | ||
SIMBATS_LOG_LEVEL="info" | ||
SIMBA_LOG_LEVEL="info" | ||
``` | ||
@@ -925,0 +921,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
1096887
87
8894
8
13
9
932
2
+ Addedsinon@^15.0.1
+ Added@sinonjs/commons@3.0.1(transitive)
+ Added@sinonjs/fake-timers@10.3.011.3.1(transitive)
+ Added@sinonjs/samsam@8.0.2(transitive)
+ Added@sinonjs/text-encoding@0.7.3(transitive)
+ Addedjust-extend@6.2.0(transitive)
+ Addedlodash.get@4.4.2(transitive)
+ Addednise@5.1.9(transitive)
+ Addedpath-to-regexp@6.3.0(transitive)
+ Addedsinon@15.2.0(transitive)
+ Addedtype-detect@4.0.8(transitive)