feat(numbers): add number sequences store; restrict companysetting keys
- Add `numbers` store module with `list` and `update` methods backed by the `numbers` table (prefix, padding, next) per company. - Add sql queries LIST_BY_COMPANY, GET_BY_COMPANY_AND_ID, UPDATE_... - Regenerate and wire API docs for `numbers`. companysetting: - Remove the `delete` endpoint (settings are now upsert/read only). - Restrict `set` to a fixed allow-list of keys: ui.theme, keys.tavily, keys.openrouter, labelprinter.addr, labelprinter.type. - Drop DELETE_BY_COMPANY_AND_KEY sql and the delete store file. Docs: update README, API.md, API.companysetting.md, API.numbers.md.
This commit is contained in:
@@ -35,7 +35,6 @@ 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';
|
||||
@@ -104,6 +103,8 @@ import googleAuthSetSelectedCompany from './store/google_auth/setSelectedCompany
|
||||
import googleAuthSetProfile from './store/google_auth/setProfile.js';
|
||||
import picGetImageByHash from './store/pic/getImageByHash.js';
|
||||
import picGetThumbByHash from './store/pic/getThumbByHash.js';
|
||||
import numbersList from './store/numbers/list.js';
|
||||
import numbersUpdate from './store/numbers/update.js';
|
||||
import storePurge from './store/purge.js';
|
||||
import storeInitialize from './store/initialize.js';
|
||||
|
||||
@@ -179,7 +180,6 @@ export default class LibDashStore {
|
||||
list: companysettingList(pool),
|
||||
get: companysettingGet(pool),
|
||||
set: companysettingSet(pool),
|
||||
delete: companysettingDelete(pool),
|
||||
};
|
||||
|
||||
this.brand = {
|
||||
@@ -277,6 +277,11 @@ export default class LibDashStore {
|
||||
getThumbByHash: picGetThumbByHash(pool),
|
||||
};
|
||||
|
||||
this.numbers = {
|
||||
list: numbersList(pool),
|
||||
update: numbersUpdate(pool),
|
||||
};
|
||||
|
||||
this.purge = storePurge(pool);
|
||||
this.initialize = storeInitialize(pool);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user