forked from bimbus/api-client-akeneo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
28 lines (22 loc) · 792 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { params } from './config/params'
import { AkeneoClient } from './src/common/akeneo'
const client = new AkeneoClient(params)
client.authenticate().then(() => {
const product = client.product('SAA002A')
product.fetch().then(() => {
// get label value for default locale
console.log(product.attribute('label'))
// get label value for es_ES locale (w/fallback to default)
console.log(product.attribute('label'), 'es_ES')
})
// const cursor = client.cursor('products')
// cursor.get().then(() => {
// console.log(cursor.getItems(), cursor.page)
// cursor.next().then((items) => {
// console.log(cursor.getItems(), cursor.page)
// cursor.prev().then(() => {
// console.log(cursor.getItems(), cursor.page)
// })
// })
// })
})