Adding contacts directly with the pure package

I created a valid JSON file, editing my contacts from the response I got with npm run command request '{"endpoint":7,"method":1}' from the pure package in the Mudita Center repo.

I backed-up and removed my contacts from Mudita Center. I closed the program and then tried to add contacts with the command below (npm run was causing trouble escaping quotes). This is done with my modified branch of pure package. The shell is zsh.

$ cd mudita-center/packages/pure
$ npx ts-node scripts/index.ts "request" "$(<~/Private/contacts.json|tr -d '[:space:]')"
request:  {"endpoint":7,"method":3,"body":{"entries":[{...}]}
response:  {"endpoint":7,"status":500,"uuid":7045}

I made sure that all “id” values were unique and strings. The Jacek Ziemniak example in the readme also returns with a 500 response.

I just wanted to check with the devs if I’m doing something obvious wrong. Is there a way to add a JSON like this, or should I give up and transcribe them to VCF and import them through the GUI? thanks

edit: ah, upon restoring the contacts by importing them from the SIM card, it says that they are all duplicates, even though the contacts interface showed no contacts. So, where they actually removed from the storage/database (assuming it’s a database)?

2 Likes

I look forward to testing your fix. I still couldn’t import contacts using VCF on the Mudita Center.

1 Like