How to change entities with sdk

0
Hello, I have done the  ‘Create Your First Script’ example and want to add some new entities into the created project. So this is the Code From the Example (script.ts): import { MendixSdkClient, OnlineWorkingCopy } from 'mendixplatformsdk'; import { domainmodels } from 'mendixmodelsdk'; const username = 'richard.ford51@example.com'; const apikey = '364fbe6d-c34d-4568-bb7c-1baa5ecdf9d1'; const client = new MendixSdkClient(username, apikey); async function main() {     const project = await client.platform().createNewApp(`NewApp-${Date.now()}`);     const workingCopy = await project.createWorkingCopy();     const domainModel = await loadDomainModel(workingCopy);     const entity = domainmodels.Entity.createIn(domainModel);     entity.name = `NewEntity_${Date.now()}`;     entity.location = { x: 100, y: 100 };     try {         const revision = await workingCopy.commit();         console.log(`Successfully committed revision: ${revision.num()}. Done.`)     } catch (error) {         console.error('Something went wrong:', error);     } } function loadDomainModel(workingCopy: OnlineWorkingCopy): Promise<domainmodels.DomainModel> {     const dm = workingCopy.model().allDomainModels().filter(dm => dm.containerAsModule.name === 'MyFirstModule')[0];     return dm.load(); } main();     and this is the code I want to add: const domainModel = await loadDomainModel(workingCopy); const customer = domainmodels.Entity.createIn(domainModel); customer.name = `Customer`; customer.location = { x: 100, y: 100 }; const invoice = domainmodels.Entity.createIn(domainModel); invoice.name = `Invoice`; invoice.location = { x: 400, y: 100 }; My Question: Do I have to create a new .ts script for editing my created project?    
asked
0 answers