Files
dashback/src/db/article.js
2026-10-03 23:13:36 +02:00

124 lines
4.0 KiB
JavaScript

import { getStore } from './store.js';
export async function createUnderParent({ googleAuthId, parentId, name, track_stock, sku }) {
const store = await getStore();
return store.article.createUnderParent({ googleAuthId, parentId, name, track_stock, sku });
}
export async function getBySku(googleAuthId, sku) {
const store = await getStore();
return store.article.getBySku(googleAuthId, sku);
}
export async function getHistoryBySku(googleAuthId, sku, opts) {
const store = await getStore();
return store.article.getHistoryBySku(googleAuthId, sku, opts);
}
export async function updateBySku(googleAuthId, sku, data) {
const store = await getStore();
return store.article.updateBySku(googleAuthId, sku, data);
}
export async function addImage(googleAuthId, sku, imageBuffer) {
const store = await getStore();
return store.article.addImage(googleAuthId, sku, imageBuffer);
}
export async function deleteImage(googleAuthId, sku, fullHash) {
const store = await getStore();
return store.article.deleteImage(googleAuthId, sku, fullHash);
}
export async function orderImages(googleAuthId, sku, data) {
const store = await getStore();
return store.article.orderImages(googleAuthId, sku, data);
}
export async function remove(googleAuthId, sku, options) {
const store = await getStore();
return store.article.delete(googleAuthId, sku, options);
}
export async function setPricesBySku(googleAuthId, sku, prices) {
const store = await getStore();
return store.article.setPricesBySku(googleAuthId, sku, prices);
}
export async function setEansBySku(googleAuthId, sku, eans) {
const store = await getStore();
return store.article.setEansBySku(googleAuthId, sku, eans);
}
export async function setBrandIdBySku(googleAuthId, sku, brandId) {
const store = await getStore();
return store.article.setBrandIdBySku(googleAuthId, sku, brandId);
}
export async function setWeightBySku(googleAuthId, sku, weight) {
const store = await getStore();
return store.article.setWeightBySku(googleAuthId, sku, weight);
}
export async function setTrackStockBySku(googleAuthId, sku, trackStock) {
const store = await getStore();
return store.article.setTrackStockBySku(googleAuthId, sku, trackStock);
}
export async function setCategoryIdsBySku(googleAuthId, sku, categoryIds) {
const store = await getStore();
return store.article.setCategoryIdsBySku(googleAuthId, sku, categoryIds);
}
export async function listSearchIndex(googleAuthId) {
const store = await getStore();
return store.article.listSearchIndex(googleAuthId);
}
export async function listExport(googleAuthId, categoryId) {
const store = await getStore();
return store.article.listExport(googleAuthId, categoryId);
}
export async function toggleFather(googleAuthId, sku, options) {
const store = await getStore();
return store.article.toggleFather(googleAuthId, sku, options);
}
export async function addChild(googleAuthId, sku, options) {
const store = await getStore();
return store.article.addChild(googleAuthId, sku, options);
}
export async function removeChild(googleAuthId, sku, childSku, options) {
const store = await getStore();
return store.article.removeChild(googleAuthId, sku, childSku, options);
}
export async function listChildren(googleAuthId, sku) {
const store = await getStore();
return store.article.listChildren(googleAuthId, sku);
}
export async function getArticlelist(googleAuthId, sku) {
const store = await getStore();
return store.article.getArticlelist(googleAuthId, sku);
}
export async function setArticlelist(googleAuthId, sku, items) {
const store = await getStore();
return store.article.setArticlelist(googleAuthId, sku, items);
}
export async function getOptionslist(googleAuthId, sku) {
const store = await getStore();
return store.article.getOptionslist(googleAuthId, sku);
}
export async function setOptionslist(googleAuthId, sku, options) {
const store = await getStore();
return store.article.setOptionslist(googleAuthId, sku, options);
}