Node.js and client documentation

And for those who like doing things faster.. looks like we can run the APIs in parralel by grouping all of the requests into one promise and waiting for them all to finish.

Here is the same code above modified to get the deals and line items in parallel and using map to process each found:

 let deals = await getDeals(companyId).catch(e => { showError(e) });
 // TODO: handle retrieving more than one page of deals via deals.status;
 if (deals.results.length > 0) {
 let dealList = deals.results[0];
 if (dealList.to) {
 await Promise.all(dealList.to.map(async (dealInfo) => {
 if (dealInfo.id) {
 const lineItems = await getLineItems(dealInfo.id);
 if (lineItems.results.length > 0) {
 let lineItemList = lineItems.results[0];
 if (lineItemList.to) {
 await Promise.all(lineItemList.to.map(async (lineItemInfo) => {
 if (lineItemInfo.id) {
 let lineItem = await getLineItem(lineItemInfo.id).catch(e => { showError(e) });
 if (lineItem.hs_product_id) {
 let product = await getProduct(lineItem.hs_product_id).catch(e => { showError(e) });