Smartling / api-sdk-nodejs

3 stars 9 forks source link

CustomFieldDto is missing fieldValue #72

Closed kyle-heddon closed 2 years ago

kyle-heddon commented 2 years ago

I get typescript errors when trying to access a customField's fieldValue:

const jobDetails = await jobsApi.getJob(projectId, translationJobUid);
const customField = jobDetails.customFields.find(findMyCustomFieldByFieldUid);
if (customField) {
  const value = customField.fieldValue; // TS2339: Property 'fieldValue' does not exist on type 'CustomFieldDto'.
  console.log({value});
}

This happens because the CustomFieldDto interface is missing fieldValue.

While you can work around the issue with a @ts-ignore comment, it doesn't help with discoverability.

PavelLoparev commented 2 years ago

Hi @kyle-heddon, thanks for the PR. Released https://www.npmjs.com/package/smartling-api-sdk-nodejs

kyle-heddon commented 2 years ago

Thanks for the quick turnaround!