Closed ioslife closed 8 months ago
Hello,
Since this project is just a wrapper of Actual NodeJS api, this feature needs to be requested on Actual NodeJS api GitHub project, as a feature request.
You can request it an hope it gets prioritized by the team, or you can submit the change yourself. It seems to be a small change in the component mapping the internal representation of the categories to the external representation: here for categories, and here for category groups.
Example of change:
export const categoryModel = {
...models.categoryModel,
toExternal(category) {
return {
id: category.id,
name: category.name,
is_income: category.is_income ? true : false,
hidden: category.hidden ? true : false,
group_id: category.cat_group,
};
},
fromExternal(category) {
const { group_id: _, ...result } = category;
if ('is_income' in category) {
result.is_income = category.is_income ? 1 : 0;
}
if ('hidden' in category) {
result.hidden = category.hidden ? 1 : 0;
}
if ('group_id' in category) {
result.cat_group = category.group_id;
}
return result;
},
};
export const categoryGroupModel = {
...models.categoryGroupModel,
toExternal(group) {
return {
id: group.id,
name: group.name,
is_income: group.is_income ? true : false,
hidden: group.hidden ? true : false,
categories: group.categories.map(categoryModel.toExternal),
};
},
fromExternal(group) {
const result = { ...group };
if ('is_income' in group) {
result.is_income = group.is_income ? 1 : 0;
}
if ('hidden' in group) {
result.hidden = group.hidden ? 1 : 0;
}
if ('categories' in group) {
result.categories = group.categories.map(categoryModel.fromExternal);
}
return result;
},
};
Once the feature is applied and released, I can update this project to reflect the changes.
Made a PR this morning – https://github.com/actualbudget/actual/pull/2062
@jhonderson merged! https://github.com/actualbudget/actual/pull/2062#pullrequestreview-1784678031
Great! I’ll update this once they release the new version of their nodejs library
@ioslife I just released a new version which should include your changes. Feel free to close once you confirm this.
Nice! Thanks! I think it works, though now I can't get the whole local server working properly to verify hah. Swagger looks good though.
Unknown error while interacting with Actual Api. See server logs for more information Error: This file is encrypted with an old unsupported key style. Recreate the key on a device where the file is available, or use an older version of Actual to download it.
I have seen this error before when interacting with an encrypted budget without providing an encryption password, or when interacting with a unencrypted budget while providing an encryption password. Please try with a new unencrypted budget to see how it goes
Hmmmmm. My budget isn't currently encrypted and I didn't set any encryption key
Got it, could you please share the curl command ? Swagger can generate it
Hah! I figured it out. Postman was sending
oops.
Looks good! Closing!
If a category is hidden, there should be a boolean that is returned stating so.