import { Gateway } from "@gateway-dao/sdk";
const gateway = new Gateway({
// your configuration here
});
const dataModel = await gateway.dataModel.create({
title: "Employee Profile",
description: "Standard employee information schema",
tags: ["HR", "Employee", "Profile"],
schema: {
title: "Employee",
type: "object",
required: ["firstName", "email", "department"],
properties: {
firstName: {
type: "string",
title: "First Name",
description: "Employee's first name",
minLength: 2,
},
lastName: {
type: "string",
title: "Last Name",
description: "Employee's last name",
minLength: 2,
},
email: {
type: "string",
title: "Email",
description: "Corporate email address",
format: "email",
},
department: {
type: "string",
title: "Department",
description: "Employee's department",
},
profilePhoto: {
type: "string",
title: "Profile Photo",
description: "Employee's profile picture",
contentMediaType: "image/png",
},
skills: {
type: "array",
title: "Skills",
description: "Professional skills and competencies",
items: {
type: "string",
},
},
},
additionalProperties: false,
},
});
console.log("Created Data Model with ID:", dataModel.id);