diff --git a/queries/FetchStoreOffersQuery.graphql b/queries/FetchStoreOffersQuery.graphql index e87749067a5079..4f7ac240a30970 100644 --- a/queries/FetchStoreOffersQuery.graphql +++ b/queries/FetchStoreOffersQuery.graphql @@ -9,50 +9,79 @@ query catalogQuery($locale:String, $count:Int, $start:Int, $country: String!, $s sortDir: $sortDir ) { elements { - isFeatured - collectionOfferIds - effectiveDate - creationDate - lastModifiedDate - viewableDate - productSlug - developer - ignoreOrder - freeDays - - title id namespace + title description longDescription status - keyImages { - type - url - } + productSlug + urlSlug + creationDate + lastModifiedDate + effectiveDate + viewableDate + + developer seller { id name } - items { + linkedOfferId + isFeatured + ignoreOrder + freeDays + collectionOfferIds + technicalDetails + recurrence + + categories { + path + } + + tags { id + name namespace - developer + aliases + operator + created + updated + status + referenceCount + comment } + customAttributes { key value } - categories { - path + + keyImages { + type + url + md5 + size + uploadedDate + width + height } - linkedOfferId - linkedOffer { - customAttributes { - key - value - } + + items { + id + } + + catalogNs { + name } + + # linkedOffer { + # customAttributes { + # key + # value + # } + # } + } paging { count diff --git a/update.js b/update.js index 5cbc679e004ae3..ba58c2fd8e342a 100644 --- a/update.js +++ b/update.js @@ -70,6 +70,7 @@ class Main { const namespaces = {}; const titles = {}; const list = []; + const tags = {}; const offersPath = `${this.databasePath}/offers`; Fs.readdirSync(offersPath).forEach((fileName) => { @@ -84,6 +85,7 @@ class Main { } } titles[offer.id] = offer.title; + (offer.tags || []).forEach(tag => tags[tag.id] = tag); const thumbnailImage = Array.isArray(offer.keyImages) && offer.keyImages.find(img => img.type === 'Thumbnail'); list.push([ offer.id, @@ -104,6 +106,7 @@ class Main { Fs.writeFileSync(`${this.databasePath}/namespaces.json`, JSON.stringify(namespaces, null, 2)); Fs.writeFileSync(`${this.databasePath}/titles.json`, JSON.stringify(titles, null, 2)); Fs.writeFileSync(`${this.databasePath}/list.json`, JSON.stringify(list, null, 2)); + Fs.writeFileSync(`${this.databasePath}/tags.json`, JSON.stringify(tags, null, 2)); } async sync () {