mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat(templates): add username and email generation using faker
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import { faker } from "@faker-js/faker";
|
||||||
import type { Schema } from "./index";
|
import type { Schema } from "./index";
|
||||||
import {
|
import {
|
||||||
generateBase64,
|
generateBase64,
|
||||||
@@ -117,6 +118,14 @@ function processValue(
|
|||||||
return generateJwt(length);
|
return generateJwt(length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (varName === "username") {
|
||||||
|
return faker.internet.userName().toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (varName === "email") {
|
||||||
|
return faker.internet.email().toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
// If not a utility function, try to get from variables
|
// If not a utility function, try to get from variables
|
||||||
return variables[varName] || match;
|
return variables[varName] || match;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user