inital commit
This commit is contained in:
15
packages/utils/src/envVariables.ts
Normal file
15
packages/utils/src/envVariables.ts
Normal file
@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Checks if all environment variables are set
|
||||
*
|
||||
* @param variables the environment variables to check
|
||||
* @returns true if all variables are set, false otherwise
|
||||
*/
|
||||
export function checkEnvironmentVariables(...variables: string[]): boolean {
|
||||
let allVariablesSet = true;
|
||||
variables.forEach((variable) => {
|
||||
if (!process.env[variable]) {
|
||||
throw new Error(`${variable} not set in environment variables`);
|
||||
}
|
||||
});
|
||||
return allVariablesSet;
|
||||
}
|
2
packages/utils/src/index.ts
Normal file
2
packages/utils/src/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
export * from "./envVariables";
|
||||
export * from "./secrets";
|
16
packages/utils/src/secrets.ts
Normal file
16
packages/utils/src/secrets.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import InfisicalClient from "infisical-node";
|
||||
|
||||
/**
|
||||
* Create an infisical client
|
||||
*
|
||||
* @param token the infisical token
|
||||
* @returns the infisical client
|
||||
*/
|
||||
function createInfisicalClient(token: string) {
|
||||
return new InfisicalClient({
|
||||
token,
|
||||
siteURL: "https://secrets.fascinated.cc",
|
||||
});
|
||||
}
|
||||
|
||||
export { createInfisicalClient };
|
Reference in New Issue
Block a user