Files
dashlibstorage/src/index.js

197 lines
7.9 KiB
JavaScript

import companyuserGetByEmail from './store/companyuser/getByEmail.js';
import companyuserAdd from './store/companyuser/add.js';
import companyuserDelete from './store/companyuser/delete.js';
import companyCreate from './store/company/create.js';
import companyUpdate from './store/company/update.js';
import companyDelete from './store/company/delete.js';
import companyList from './store/company/list.js';
import categoryGetTreeForCompany from './store/category/getTreeForCompany.js';
import categoryGetCategoryArticles from './store/category/getCategoryArticles.js';
import categoryCreateUnderParent from './store/category/createUnderParent.js';
import categoryRename from './store/category/rename.js';
import categoryMove from './store/category/move.js';
import categoryOrder from './store/category/order.js';
import categoryDelete from './store/category/delete.js';
import categoryAddImage from './store/category/addImage.js';
import categoryDeleteImage from './store/category/deleteImage.js';
import articleDelete from './store/article/delete.js';
import articleDeleteImage from './store/article/deleteImage.js';
import articleOrderImages from './store/article/orderImages.js';
import articleAddImage from './store/article/addImage.js';
import articleCreateUnderParent from './store/article/createUnderParent.js';
import articleGetBySku from './store/article/getBySku.js';
import articleGetHistoryBySku from './store/article/getHistoryBySku.js';
import articleListSearchIndex from './store/article/listSearchIndex.js';
import articleListExport from './store/article/listExport.js';
import articleUpdateBySku from './store/article/updateBySku.js';
import articleSetPricesBySku from './store/article/setPricesBySku.js';
import articleSetEansBySku from './store/article/setEansBySku.js';
import articleSetBrandIdBySku from './store/article/setBrandIdBySku.js';
import articleSetWeightBySku from './store/article/setWeightBySku.js';
import articleSetCategoryIdsBySku from './store/article/setCategoryIdsBySku.js';
import unitList from './store/unit/list.js';
import unitUpsert from './store/unit/upsert.js';
import unitDelete from './store/unit/delete.js';
import companysettingList from './store/companysetting/list.js';
import companysettingGet from './store/companysetting/get.js';
import companysettingSet from './store/companysetting/set.js';
import companysettingDelete from './store/companysetting/delete.js';
import brandList from './store/brand/list.js';
import brandUpsert from './store/brand/upsert.js';
import brandDelete from './store/brand/delete.js';
import supplierList from './store/supplier/list.js';
import supplierCreate from './store/supplier/create.js';
import supplierUpdate from './store/supplier/update.js';
import supplierDelete from './store/supplier/delete.js';
import posterminalList from './store/posterminal/list.js';
import posterminalUpsert from './store/posterminal/upsert.js';
import posterminalDelete from './store/posterminal/delete.js';
import posterminalSetOn from './store/posterminal/setOn.js';
import posterminalSetOff from './store/posterminal/setOff.js';
import posterminalSetOnAll from './store/posterminal/setOnAll.js';
import posterminalSetOffAll from './store/posterminal/setOffAll.js';
import posterminalGetCategoryPosterminalIds from './store/posterminal/getCategoryPosterminalIds.js';
import langCreate from './store/lang/create.js';
import langDelete from './store/lang/delete.js';
import langList from './store/lang/list.js';
import langGetByIso639 from './store/lang/getByIso639.js';
import langEnsure from './store/lang/ensure.js';
import taxCreate from './store/tax/create.js';
import taxGetByRate from './store/tax/getByRate.js';
import taxEnsure from './store/tax/ensure.js';
import taxList from './store/tax/list.js';
import googleAuthAdd from './store/google_auth/add.js';
import googleAuthGetByEmail from './store/google_auth/getByEmail.js';
import googleAuthGetById from './store/google_auth/getById.js';
import googleAuthListAllowedEmails from './store/google_auth/listAllowedEmails.js';
import googleAuthRemoveAllowedEmail from './store/google_auth/removeAllowedEmail.js';
import googleAuthSetSelectedCompany from './store/google_auth/setSelectedCompany.js';
import googleAuthSetProfile from './store/google_auth/setProfile.js';
import picGetImageByHash from './store/pic/getImageByHash.js';
import picGetThumbByHash from './store/pic/getThumbByHash.js';
import storePurge from './store/purge.js';
import storeInitialize from './store/initialize.js';
export default class LibDashStore {
constructor(pool) {
this.pool = pool;
this.companyuser = {
getByEmail: companyuserGetByEmail(pool),
add: companyuserAdd(pool),
delete: companyuserDelete(pool),
};
this.company = {
create: companyCreate(pool),
update: companyUpdate(pool),
delete: companyDelete(pool),
list: companyList(pool),
};
this.category = {
getTreeForCompany: categoryGetTreeForCompany(pool),
getCategoryArticles: categoryGetCategoryArticles(pool),
createUnderParent: categoryCreateUnderParent(pool),
rename: categoryRename(pool),
move: categoryMove(pool),
order: categoryOrder(pool),
delete: categoryDelete(pool),
addImage: categoryAddImage(pool),
deleteImage: categoryDeleteImage(pool),
};
this.article = {
createUnderParent: articleCreateUnderParent(pool),
getBySku: articleGetBySku(pool),
getHistoryBySku: articleGetHistoryBySku(pool),
listSearchIndex: articleListSearchIndex(pool),
listExport: articleListExport(pool),
updateBySku: articleUpdateBySku(pool),
setPricesBySku: articleSetPricesBySku(pool),
setEansBySku: articleSetEansBySku(pool),
setBrandIdBySku: articleSetBrandIdBySku(pool),
setWeightBySku: articleSetWeightBySku(pool),
setCategoryIdsBySku: articleSetCategoryIdsBySku(pool),
addImage: articleAddImage(pool),
deleteImage: articleDeleteImage(pool),
orderImages: articleOrderImages(pool),
delete: articleDelete(pool),
};
this.lang = {
create: langCreate(pool),
getByIso639: langGetByIso639(pool),
ensure: langEnsure(pool),
delete: langDelete(pool),
list: langList(pool),
};
this.tax = {
create: taxCreate(pool),
getByRate: taxGetByRate(pool),
ensure: taxEnsure(pool),
list: taxList(pool),
};
this.unit = {
list: unitList(pool),
upsert: unitUpsert(pool),
delete: unitDelete(pool),
};
this.companysetting = {
list: companysettingList(pool),
get: companysettingGet(pool),
set: companysettingSet(pool),
delete: companysettingDelete(pool),
};
this.brand = {
list: brandList(pool),
upsert: brandUpsert(pool),
delete: brandDelete(pool),
};
this.supplier = {
list: supplierList(pool),
create: supplierCreate(pool),
update: supplierUpdate(pool),
delete: supplierDelete(pool),
};
this.posterminal = {
list: posterminalList(pool),
upsert: posterminalUpsert(pool),
delete: posterminalDelete(pool),
setOn: posterminalSetOn(pool),
setOff: posterminalSetOff(pool),
setOnAll: posterminalSetOnAll(pool),
setOffAll: posterminalSetOffAll(pool),
getCategoryPosterminalIds: posterminalGetCategoryPosterminalIds(pool),
};
this.google_auth = {
add: googleAuthAdd(pool),
getByEmail: googleAuthGetByEmail(pool),
getById: googleAuthGetById(pool),
listAllowedEmails: googleAuthListAllowedEmails(pool),
removeAllowedEmail: googleAuthRemoveAllowedEmail(pool),
setSelectedCompany: googleAuthSetSelectedCompany(pool),
setProfile: googleAuthSetProfile(pool),
};
this.pic = {
getImageByHash: picGetImageByHash(pool),
getThumbByHash: picGetThumbByHash(pool),
};
this.purge = storePurge(pool);
this.initialize = storeInitialize(pool);
return this.initialize().then(() => this);
}
}
export { SCHEMA_SCRIPTS } from './schema.js';