This commit is contained in:
Alan Mosko
2023-01-11 23:58:29 -03:00
parent 5041be776e
commit 78f04d8714
18 changed files with 405 additions and 253 deletions

View File

@@ -7,14 +7,7 @@ import { getStream, getUrlFromDirectPath, toReadable } from './messages-media'
export const parseCatalogNode = (node: BinaryNode) => {
const catalogNode = getBinaryNodeChild(node, 'product_catalog')
const products = getBinaryNodeChildren(catalogNode, 'product').map(parseProductNode)
const paging = getBinaryNodeChild(catalogNode, 'paging')
return {
products,
nextPageCursor: paging
? getBinaryNodeChildString(paging, 'after')
: undefined
}
return { products }
}
export const parseCollectionsNode = (node: BinaryNode) => {