@voidwalkers/void-functions
Advanced tools
Comparing version 0.1.7 to 0.1.8
{ | ||
"name": "@voidwalkers/void-functions", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "Functions for Void Walkers Void", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
@@ -9,4 +9,23 @@ import { | ||
let getConfigValueHandler = null; | ||
let registerHandler = null; | ||
export async function getConfigValue(key, defaultValue) { | ||
if (!getConfigValueHandler) { | ||
throw new Error('Get config value handler not set'); | ||
} | ||
const value = await getConfigValueHandler(key); | ||
if (value !== undefined) { | ||
return value; | ||
} | ||
if (defaultValue === undefined) { | ||
throw new Error(`Config value for "${key}" does not exist and no default value is specified`); | ||
} | ||
return defaultValue; | ||
} | ||
export function registerCallFunction(name, func, options) { | ||
@@ -28,2 +47,6 @@ if (!registerHandler) { | ||
export function setGetConfigValueHandler(handler) { | ||
getConfigValueHandler = handler; | ||
} | ||
export function setRegisterHandler(handler) { | ||
@@ -30,0 +53,0 @@ registerHandler = handler; |
@@ -25,3 +25,4 @@ export const FunctionSystemRole = { | ||
export const ProjectUserCredentialsType = { | ||
Custom: 'custom' | ||
Custom: 'custom', | ||
Email: 'email' | ||
}; |
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
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
3072
64