@rnaga/wp-node
Version:
👉 **[View Full Documentation at rnaga.github.io/wp-node →](https://rnaga.github.io/wp-node/)**
14 lines (13 loc) • 438 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.rolesUpsert = void 0;
const zod_1 = require("zod");
const roleString = zod_1.z
.string()
.refine((v) => v.match(/^[a-z0-9]+[a-z0-9_]*[a-z0-9]+$/));
exports.rolesUpsert = zod_1.z.object({
name: zod_1.z.string().optional(),
role: roleString,
new_role: roleString.optional(),
capabilities: zod_1.z.array(roleString).optional(),
});