@newpeak/barista-cli 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +714 -0
- package/README.ja.md +708 -0
- package/README.md +68 -0
- package/README.vi.md +714 -0
- package/dist/commands/liberica/calendar/index.d.ts +3 -0
- package/dist/commands/liberica/calendar/index.d.ts.map +1 -0
- package/dist/commands/liberica/calendar/index.js +11 -0
- package/dist/commands/liberica/calendar/index.js.map +1 -0
- package/dist/commands/liberica/calendar/list.d.ts +3 -0
- package/dist/commands/liberica/calendar/list.d.ts.map +1 -0
- package/dist/commands/liberica/calendar/list.js +181 -0
- package/dist/commands/liberica/calendar/list.js.map +1 -0
- package/dist/commands/liberica/calendar/set.d.ts +3 -0
- package/dist/commands/liberica/calendar/set.d.ts.map +1 -0
- package/dist/commands/liberica/calendar/set.js +120 -0
- package/dist/commands/liberica/calendar/set.js.map +1 -0
- package/dist/commands/liberica/client-contacts/create.d.ts +3 -0
- package/dist/commands/liberica/client-contacts/create.d.ts.map +1 -0
- package/dist/commands/liberica/client-contacts/create.js +132 -0
- package/dist/commands/liberica/client-contacts/create.js.map +1 -0
- package/dist/commands/liberica/client-contacts/delete.d.ts +3 -0
- package/dist/commands/liberica/client-contacts/delete.d.ts.map +1 -0
- package/dist/commands/liberica/client-contacts/delete.js +139 -0
- package/dist/commands/liberica/client-contacts/delete.js.map +1 -0
- package/dist/commands/liberica/client-contacts/get.d.ts +3 -0
- package/dist/commands/liberica/client-contacts/get.d.ts.map +1 -0
- package/dist/commands/liberica/client-contacts/get.js +92 -0
- package/dist/commands/liberica/client-contacts/get.js.map +1 -0
- package/dist/commands/liberica/client-contacts/index.d.ts +3 -0
- package/dist/commands/liberica/client-contacts/index.d.ts.map +1 -0
- package/dist/commands/liberica/client-contacts/index.js +17 -0
- package/dist/commands/liberica/client-contacts/index.js.map +1 -0
- package/dist/commands/liberica/client-contacts/list.d.ts +3 -0
- package/dist/commands/liberica/client-contacts/list.d.ts.map +1 -0
- package/dist/commands/liberica/client-contacts/list.js +92 -0
- package/dist/commands/liberica/client-contacts/list.js.map +1 -0
- package/dist/commands/liberica/client-contacts/update.d.ts +3 -0
- package/dist/commands/liberica/client-contacts/update.d.ts.map +1 -0
- package/dist/commands/liberica/client-contacts/update.js +156 -0
- package/dist/commands/liberica/client-contacts/update.js.map +1 -0
- package/dist/commands/liberica/dict-types/get.d.ts +3 -0
- package/dist/commands/liberica/dict-types/get.d.ts.map +1 -0
- package/dist/commands/liberica/dict-types/get.js +62 -0
- package/dist/commands/liberica/dict-types/get.js.map +1 -0
- package/dist/commands/liberica/dict-types/index.d.ts +3 -0
- package/dist/commands/liberica/dict-types/index.d.ts.map +1 -0
- package/dist/commands/liberica/dict-types/index.js +13 -0
- package/dist/commands/liberica/dict-types/index.js.map +1 -0
- package/dist/commands/liberica/dict-types/list.d.ts +3 -0
- package/dist/commands/liberica/dict-types/list.d.ts.map +1 -0
- package/dist/commands/liberica/dict-types/list.js +91 -0
- package/dist/commands/liberica/dict-types/list.js.map +1 -0
- package/dist/commands/liberica/dict-types/update.d.ts +3 -0
- package/dist/commands/liberica/dict-types/update.d.ts.map +1 -0
- package/dist/commands/liberica/dict-types/update.js +127 -0
- package/dist/commands/liberica/dict-types/update.js.map +1 -0
- package/dist/commands/liberica/dicts/create.d.ts +3 -0
- package/dist/commands/liberica/dicts/create.d.ts.map +1 -0
- package/dist/commands/liberica/dicts/create.js +157 -0
- package/dist/commands/liberica/dicts/create.js.map +1 -0
- package/dist/commands/liberica/dicts/delete.d.ts +3 -0
- package/dist/commands/liberica/dicts/delete.d.ts.map +1 -0
- package/dist/commands/liberica/dicts/delete.js +106 -0
- package/dist/commands/liberica/dicts/delete.js.map +1 -0
- package/dist/commands/liberica/dicts/get.d.ts +3 -0
- package/dist/commands/liberica/dicts/get.d.ts.map +1 -0
- package/dist/commands/liberica/dicts/get.js +69 -0
- package/dist/commands/liberica/dicts/get.js.map +1 -0
- package/dist/commands/liberica/dicts/index.d.ts +3 -0
- package/dist/commands/liberica/dicts/index.d.ts.map +1 -0
- package/dist/commands/liberica/dicts/index.js +17 -0
- package/dist/commands/liberica/dicts/index.js.map +1 -0
- package/dist/commands/liberica/dicts/list.d.ts +3 -0
- package/dist/commands/liberica/dicts/list.d.ts.map +1 -0
- package/dist/commands/liberica/dicts/list.js +88 -0
- package/dist/commands/liberica/dicts/list.js.map +1 -0
- package/dist/commands/liberica/dicts/update.d.ts +3 -0
- package/dist/commands/liberica/dicts/update.d.ts.map +1 -0
- package/dist/commands/liberica/dicts/update.js +112 -0
- package/dist/commands/liberica/dicts/update.js.map +1 -0
- package/dist/commands/liberica/index.d.ts.map +1 -1
- package/dist/commands/liberica/index.js +22 -0
- package/dist/commands/liberica/index.js.map +1 -1
- package/dist/commands/liberica/materials/create.d.ts.map +1 -1
- package/dist/commands/liberica/materials/create.js +35 -9
- package/dist/commands/liberica/materials/create.js.map +1 -1
- package/dist/commands/liberica/operations/active.d.ts +3 -0
- package/dist/commands/liberica/operations/active.d.ts.map +1 -0
- package/dist/commands/liberica/operations/active.js +152 -0
- package/dist/commands/liberica/operations/active.js.map +1 -0
- package/dist/commands/liberica/operations/batch-delete.d.ts +3 -0
- package/dist/commands/liberica/operations/batch-delete.d.ts.map +1 -0
- package/dist/commands/liberica/operations/batch-delete.js +130 -0
- package/dist/commands/liberica/operations/batch-delete.js.map +1 -0
- package/dist/commands/liberica/operations/copy.d.ts +3 -0
- package/dist/commands/liberica/operations/copy.d.ts.map +1 -0
- package/dist/commands/liberica/operations/copy.js +137 -0
- package/dist/commands/liberica/operations/copy.js.map +1 -0
- package/dist/commands/liberica/operations/create.d.ts +3 -0
- package/dist/commands/liberica/operations/create.d.ts.map +1 -0
- package/dist/commands/liberica/operations/create.js +212 -0
- package/dist/commands/liberica/operations/create.js.map +1 -0
- package/dist/commands/liberica/operations/deactive.d.ts +3 -0
- package/dist/commands/liberica/operations/deactive.d.ts.map +1 -0
- package/dist/commands/liberica/operations/deactive.js +152 -0
- package/dist/commands/liberica/operations/deactive.js.map +1 -0
- package/dist/commands/liberica/operations/delete.d.ts +3 -0
- package/dist/commands/liberica/operations/delete.d.ts.map +1 -0
- package/dist/commands/liberica/operations/delete.js +128 -0
- package/dist/commands/liberica/operations/delete.js.map +1 -0
- package/dist/commands/liberica/operations/get.d.ts +3 -0
- package/dist/commands/liberica/operations/get.d.ts.map +1 -0
- package/dist/commands/liberica/operations/get.js +93 -0
- package/dist/commands/liberica/operations/get.js.map +1 -0
- package/dist/commands/liberica/operations/index.d.ts +3 -0
- package/dist/commands/liberica/operations/index.d.ts.map +1 -0
- package/dist/commands/liberica/operations/index.js +25 -0
- package/dist/commands/liberica/operations/index.js.map +1 -0
- package/dist/commands/liberica/operations/list.d.ts +3 -0
- package/dist/commands/liberica/operations/list.d.ts.map +1 -0
- package/dist/commands/liberica/operations/list.js +141 -0
- package/dist/commands/liberica/operations/list.js.map +1 -0
- package/dist/commands/liberica/operations/update.d.ts +3 -0
- package/dist/commands/liberica/operations/update.d.ts.map +1 -0
- package/dist/commands/liberica/operations/update.js +208 -0
- package/dist/commands/liberica/operations/update.js.map +1 -0
- package/dist/commands/liberica/orgs/index.d.ts.map +1 -1
- package/dist/commands/liberica/orgs/index.js.map +1 -1
- package/dist/commands/liberica/stock/__tests__/ledger.test.d.ts +2 -0
- package/dist/commands/liberica/stock/__tests__/ledger.test.d.ts.map +1 -0
- package/dist/commands/liberica/stock/__tests__/ledger.test.js +41 -0
- package/dist/commands/liberica/stock/__tests__/ledger.test.js.map +1 -0
- package/dist/commands/liberica/stock/__tests__/list.test.d.ts +2 -0
- package/dist/commands/liberica/stock/__tests__/list.test.d.ts.map +1 -0
- package/dist/commands/liberica/stock/__tests__/list.test.js +39 -0
- package/dist/commands/liberica/stock/__tests__/list.test.js.map +1 -0
- package/dist/commands/liberica/stock/index.d.ts +3 -0
- package/dist/commands/liberica/stock/index.d.ts.map +1 -0
- package/dist/commands/liberica/stock/index.js +11 -0
- package/dist/commands/liberica/stock/index.js.map +1 -0
- package/dist/commands/liberica/stock/ledger.d.ts +3 -0
- package/dist/commands/liberica/stock/ledger.d.ts.map +1 -0
- package/dist/commands/liberica/stock/ledger.js +154 -0
- package/dist/commands/liberica/stock/ledger.js.map +1 -0
- package/dist/commands/liberica/stock/list.d.ts +3 -0
- package/dist/commands/liberica/stock/list.d.ts.map +1 -0
- package/dist/commands/liberica/stock/list.js +127 -0
- package/dist/commands/liberica/stock/list.js.map +1 -0
- package/dist/commands/liberica/supplier-contacts/create.d.ts +3 -0
- package/dist/commands/liberica/supplier-contacts/create.d.ts.map +1 -0
- package/dist/commands/liberica/supplier-contacts/create.js +129 -0
- package/dist/commands/liberica/supplier-contacts/create.js.map +1 -0
- package/dist/commands/liberica/supplier-contacts/delete.d.ts +3 -0
- package/dist/commands/liberica/supplier-contacts/delete.d.ts.map +1 -0
- package/dist/commands/liberica/supplier-contacts/delete.js +88 -0
- package/dist/commands/liberica/supplier-contacts/delete.js.map +1 -0
- package/dist/commands/liberica/supplier-contacts/get.d.ts +3 -0
- package/dist/commands/liberica/supplier-contacts/get.d.ts.map +1 -0
- package/dist/commands/liberica/supplier-contacts/get.js +84 -0
- package/dist/commands/liberica/supplier-contacts/get.js.map +1 -0
- package/dist/commands/liberica/supplier-contacts/index.d.ts +3 -0
- package/dist/commands/liberica/supplier-contacts/index.d.ts.map +1 -0
- package/dist/commands/liberica/supplier-contacts/index.js +17 -0
- package/dist/commands/liberica/supplier-contacts/index.js.map +1 -0
- package/dist/commands/liberica/supplier-contacts/list.d.ts +3 -0
- package/dist/commands/liberica/supplier-contacts/list.d.ts.map +1 -0
- package/dist/commands/liberica/supplier-contacts/list.js +98 -0
- package/dist/commands/liberica/supplier-contacts/list.js.map +1 -0
- package/dist/commands/liberica/supplier-contacts/update.d.ts +3 -0
- package/dist/commands/liberica/supplier-contacts/update.d.ts.map +1 -0
- package/dist/commands/liberica/supplier-contacts/update.js +136 -0
- package/dist/commands/liberica/supplier-contacts/update.js.map +1 -0
- package/dist/commands/liberica/users/create.d.ts.map +1 -1
- package/dist/commands/liberica/users/create.js +1 -0
- package/dist/commands/liberica/users/create.js.map +1 -1
- package/dist/commands/liberica/warehouses/create.d.ts +3 -0
- package/dist/commands/liberica/warehouses/create.d.ts.map +1 -0
- package/dist/commands/liberica/warehouses/create.js +196 -0
- package/dist/commands/liberica/warehouses/create.js.map +1 -0
- package/dist/commands/liberica/warehouses/delete.d.ts +3 -0
- package/dist/commands/liberica/warehouses/delete.d.ts.map +1 -0
- package/dist/commands/liberica/warehouses/delete.js +111 -0
- package/dist/commands/liberica/warehouses/delete.js.map +1 -0
- package/dist/commands/liberica/warehouses/disable.d.ts +3 -0
- package/dist/commands/liberica/warehouses/disable.d.ts.map +1 -0
- package/dist/commands/liberica/warehouses/disable.js +173 -0
- package/dist/commands/liberica/warehouses/disable.js.map +1 -0
- package/dist/commands/liberica/warehouses/enable.d.ts +3 -0
- package/dist/commands/liberica/warehouses/enable.d.ts.map +1 -0
- package/dist/commands/liberica/warehouses/enable.js +173 -0
- package/dist/commands/liberica/warehouses/enable.js.map +1 -0
- package/dist/commands/liberica/warehouses/get.d.ts +3 -0
- package/dist/commands/liberica/warehouses/get.d.ts.map +1 -0
- package/dist/commands/liberica/warehouses/get.js +90 -0
- package/dist/commands/liberica/warehouses/get.js.map +1 -0
- package/dist/commands/liberica/warehouses/index.d.ts +3 -0
- package/dist/commands/liberica/warehouses/index.d.ts.map +1 -0
- package/dist/commands/liberica/warehouses/index.js +23 -0
- package/dist/commands/liberica/warehouses/index.js.map +1 -0
- package/dist/commands/liberica/warehouses/list.d.ts +3 -0
- package/dist/commands/liberica/warehouses/list.d.ts.map +1 -0
- package/dist/commands/liberica/warehouses/list.js +101 -0
- package/dist/commands/liberica/warehouses/list.js.map +1 -0
- package/dist/commands/liberica/warehouses/locations/create.d.ts +3 -0
- package/dist/commands/liberica/warehouses/locations/create.d.ts.map +1 -0
- package/dist/commands/liberica/warehouses/locations/create.js +199 -0
- package/dist/commands/liberica/warehouses/locations/create.js.map +1 -0
- package/dist/commands/liberica/warehouses/locations/delete.d.ts +3 -0
- package/dist/commands/liberica/warehouses/locations/delete.d.ts.map +1 -0
- package/dist/commands/liberica/warehouses/locations/delete.js +115 -0
- package/dist/commands/liberica/warehouses/locations/delete.js.map +1 -0
- package/dist/commands/liberica/warehouses/locations/disable.d.ts +3 -0
- package/dist/commands/liberica/warehouses/locations/disable.d.ts.map +1 -0
- package/dist/commands/liberica/warehouses/locations/disable.js +173 -0
- package/dist/commands/liberica/warehouses/locations/disable.js.map +1 -0
- package/dist/commands/liberica/warehouses/locations/enable.d.ts +3 -0
- package/dist/commands/liberica/warehouses/locations/enable.d.ts.map +1 -0
- package/dist/commands/liberica/warehouses/locations/enable.js +173 -0
- package/dist/commands/liberica/warehouses/locations/enable.js.map +1 -0
- package/dist/commands/liberica/warehouses/locations/get.d.ts +3 -0
- package/dist/commands/liberica/warehouses/locations/get.d.ts.map +1 -0
- package/dist/commands/liberica/warehouses/locations/get.js +73 -0
- package/dist/commands/liberica/warehouses/locations/get.js.map +1 -0
- package/dist/commands/liberica/warehouses/locations/index.d.ts +3 -0
- package/dist/commands/liberica/warehouses/locations/index.d.ts.map +1 -0
- package/dist/commands/liberica/warehouses/locations/index.js +21 -0
- package/dist/commands/liberica/warehouses/locations/index.js.map +1 -0
- package/dist/commands/liberica/warehouses/locations/list.d.ts +3 -0
- package/dist/commands/liberica/warehouses/locations/list.d.ts.map +1 -0
- package/dist/commands/liberica/warehouses/locations/list.js +104 -0
- package/dist/commands/liberica/warehouses/locations/list.js.map +1 -0
- package/dist/commands/liberica/warehouses/locations/update.d.ts +3 -0
- package/dist/commands/liberica/warehouses/locations/update.d.ts.map +1 -0
- package/dist/commands/liberica/warehouses/locations/update.js +128 -0
- package/dist/commands/liberica/warehouses/locations/update.js.map +1 -0
- package/dist/commands/liberica/warehouses/update.d.ts +3 -0
- package/dist/commands/liberica/warehouses/update.d.ts.map +1 -0
- package/dist/commands/liberica/warehouses/update.js +143 -0
- package/dist/commands/liberica/warehouses/update.js.map +1 -0
- package/dist/core/api/client.d.ts +62 -0
- package/dist/core/api/client.d.ts.map +1 -1
- package/dist/core/api/client.js +1203 -104
- package/dist/core/api/client.js.map +1 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/types/calendar.d.ts +28 -0
- package/dist/types/calendar.d.ts.map +1 -0
- package/dist/types/calendar.js +2 -0
- package/dist/types/calendar.js.map +1 -0
- package/dist/types/client-contact.d.ts +65 -0
- package/dist/types/client-contact.d.ts.map +1 -0
- package/dist/types/client-contact.js +4 -0
- package/dist/types/client-contact.js.map +1 -0
- package/dist/types/dict.d.ts +97 -0
- package/dist/types/dict.d.ts.map +1 -0
- package/dist/types/dict.js +2 -0
- package/dist/types/dict.js.map +1 -0
- package/dist/types/index.d.ts +9 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/location.d.ts +53 -0
- package/dist/types/location.d.ts.map +1 -0
- package/dist/types/location.js +2 -0
- package/dist/types/location.js.map +1 -0
- package/dist/types/operation.d.ts +66 -0
- package/dist/types/operation.d.ts.map +1 -0
- package/dist/types/operation.js +2 -0
- package/dist/types/operation.js.map +1 -0
- package/dist/types/stock.d.ts +133 -0
- package/dist/types/stock.d.ts.map +1 -0
- package/dist/types/stock.js +3 -0
- package/dist/types/stock.js.map +1 -0
- package/dist/types/supplier-contact.d.ts +65 -0
- package/dist/types/supplier-contact.d.ts.map +1 -0
- package/dist/types/supplier-contact.js +4 -0
- package/dist/types/supplier-contact.js.map +1 -0
- package/dist/types/warehouse.d.ts +68 -0
- package/dist/types/warehouse.d.ts.map +1 -0
- package/dist/types/warehouse.js +2 -0
- package/dist/types/warehouse.js.map +1 -0
- package/docs/commands/REFERENCE.md +24 -4
- package/docs/commands/liberica/calendar/DESIGN.md +333 -0
- package/docs/commands/liberica/client-contacts/create.md +152 -0
- package/docs/commands/liberica/client-contacts/delete.md +123 -0
- package/docs/commands/liberica/client-contacts/get.md +133 -0
- package/docs/commands/liberica/client-contacts/list.md +143 -0
- package/docs/commands/liberica/client-contacts/update.md +158 -0
- package/docs/commands/liberica/locations/create.md +195 -0
- package/docs/commands/liberica/locations/list.md +171 -0
- package/docs/commands/liberica/stock/ledger.md +209 -0
- package/docs/commands/liberica/stock/list.md +165 -0
- package/docs/commands/liberica/supplier-contacts/create.md +152 -0
- package/docs/commands/liberica/supplier-contacts/delete.md +123 -0
- package/docs/commands/liberica/supplier-contacts/get.md +133 -0
- package/docs/commands/liberica/supplier-contacts/list.md +143 -0
- package/docs/commands/liberica/supplier-contacts/update.md +158 -0
- package/docs/commands/liberica/warehouses/create.md +222 -0
- package/docs/commands/liberica/warehouses/list.md +184 -0
- package/package.json +1 -1
- package/src/commands/liberica/calendar/index.ts +13 -0
- package/src/commands/liberica/calendar/list.ts +214 -0
- package/src/commands/liberica/calendar/set.ts +130 -0
- package/src/commands/liberica/client-contacts/create.ts +115 -0
- package/src/commands/liberica/client-contacts/delete.ts +140 -0
- package/src/commands/liberica/client-contacts/get.ts +103 -0
- package/src/commands/liberica/client-contacts/index.ts +19 -0
- package/src/commands/liberica/client-contacts/list.ts +118 -0
- package/src/commands/liberica/client-contacts/update.ts +137 -0
- package/src/commands/liberica/dict-types/get.ts +74 -0
- package/src/commands/liberica/dict-types/index.ts +15 -0
- package/src/commands/liberica/dict-types/list.ts +118 -0
- package/src/commands/liberica/dict-types/update.ts +134 -0
- package/src/commands/liberica/dicts/create.ts +175 -0
- package/src/commands/liberica/dicts/delete.ts +107 -0
- package/src/commands/liberica/dicts/get.ts +80 -0
- package/src/commands/liberica/dicts/index.ts +19 -0
- package/src/commands/liberica/dicts/list.ts +114 -0
- package/src/commands/liberica/dicts/update.ts +116 -0
- package/src/commands/liberica/index.ts +22 -0
- package/src/commands/liberica/materials/create.ts +32 -9
- package/src/commands/liberica/operations/active.ts +153 -0
- package/src/commands/liberica/operations/batch-delete.ts +131 -0
- package/src/commands/liberica/operations/copy.ts +138 -0
- package/src/commands/liberica/operations/create.ts +223 -0
- package/src/commands/liberica/operations/deactive.ts +152 -0
- package/src/commands/liberica/operations/delete.ts +128 -0
- package/src/commands/liberica/operations/design.md +587 -0
- package/src/commands/liberica/operations/get.ts +112 -0
- package/src/commands/liberica/operations/index.ts +27 -0
- package/src/commands/liberica/operations/list.ts +180 -0
- package/src/commands/liberica/operations/update.ts +218 -0
- package/src/commands/liberica/orgs/index.ts +0 -1
- package/src/commands/liberica/stock/index.ts +13 -0
- package/src/commands/liberica/stock/ledger.ts +159 -0
- package/src/commands/liberica/stock/list.ts +128 -0
- package/src/commands/liberica/supplier-contacts/create.ts +120 -0
- package/src/commands/liberica/supplier-contacts/delete.ts +88 -0
- package/src/commands/liberica/supplier-contacts/get.ts +94 -0
- package/src/commands/liberica/supplier-contacts/index.ts +19 -0
- package/src/commands/liberica/supplier-contacts/list.ts +130 -0
- package/src/commands/liberica/supplier-contacts/update.ts +127 -0
- package/src/commands/liberica/users/create.ts +1 -0
- package/src/commands/liberica/warehouses/create.ts +204 -0
- package/src/commands/liberica/warehouses/delete.ts +112 -0
- package/src/commands/liberica/warehouses/disable.ts +174 -0
- package/src/commands/liberica/warehouses/enable.ts +174 -0
- package/src/commands/liberica/warehouses/get.ts +101 -0
- package/src/commands/liberica/warehouses/index.ts +25 -0
- package/src/commands/liberica/warehouses/list.ts +136 -0
- package/src/commands/liberica/warehouses/locations/create.ts +209 -0
- package/src/commands/liberica/warehouses/locations/delete.ts +116 -0
- package/src/commands/liberica/warehouses/locations/disable.ts +174 -0
- package/src/commands/liberica/warehouses/locations/enable.ts +174 -0
- package/src/commands/liberica/warehouses/locations/get.ts +84 -0
- package/src/commands/liberica/warehouses/locations/index.ts +23 -0
- package/src/commands/liberica/warehouses/locations/list.ts +140 -0
- package/src/commands/liberica/warehouses/locations/update.ts +135 -0
- package/src/commands/liberica/warehouses/update.ts +142 -0
- package/src/core/api/client.ts +1493 -78
- package/src/index.ts +1 -3
- package/src/types/calendar.ts +36 -0
- package/src/types/client-contact.ts +78 -0
- package/src/types/dict.ts +121 -0
- package/src/types/index.ts +9 -4
- package/src/types/location.ts +66 -0
- package/src/types/operation.ts +72 -0
- package/src/types/stock.ts +161 -0
- package/src/types/supplier-contact.ts +78 -0
- package/src/types/warehouse.ts +82 -0
package/README.vi.md
ADDED
|
@@ -0,0 +1,714 @@
|
|
|
1
|
+
# ☕ Barista CLI
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="./README.md"><img src="https://img.shields.io/badge/-简体中文-green?style=flat-square" alt="简体中文"></a>
|
|
5
|
+
<a href="./README.en.md"><img src="https://img.shields.io/badge/-English-blue?style=flat-square" alt="English"></a>
|
|
6
|
+
<a href="./README.ja.md"><img src="https://img.shields.io/badge/-日本語-red?style=flat-square" alt="日本語"></a>
|
|
7
|
+
<a href="./README.vi.md"><img src="https://img.shields.io/badge/-Tiếng%20Việt-green?style=flat-square" alt="Tiếng Việt"></a>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<img src="https://img.shields.io/badge/AI--Native-CLI-blue?style=flat-square" alt="AI-Native">
|
|
12
|
+
<img src="https://img.shields.io/badge/Liberica-Production%20SaaS-green?style=flat-square" alt="Liberica">
|
|
13
|
+
<img src="https://img.shields.io/badge/Arabica-Sales%20Platform-orange?style=flat-square" alt="Arabica">
|
|
14
|
+
<img src="https://img.shields.io/badge/Node.js-18%2B-brightgreen?style=flat-square" alt="Node.js 18+">
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
<p align="center">
|
|
18
|
+
<strong>Công cụ CLI AI-Native</strong> - Kết nối liền mạch giữa Liberica SaaS Quản lý Sản xuất và Nền tảng Bán hàng Arabica
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 📋 Mục lục
|
|
24
|
+
|
|
25
|
+
- [Giới thiệu Dự án](#giới-thiệu-dự-án)
|
|
26
|
+
- [Bắt đầu Nhanh](#bắt-đầu-nhanh)
|
|
27
|
+
- [Thiết kế Kiến trúc](#thiết-kế-kiến-trúc)
|
|
28
|
+
- [Tài liệu Lệnh](#tài-liệu-lệnh)
|
|
29
|
+
- [Tính năng Nâng cao](#tính-năng-nâng-cao)
|
|
30
|
+
- [Cấu hình](#cấu-hình)
|
|
31
|
+
- [Tích hợp AI](#tích-hợp-ai)
|
|
32
|
+
- [Hướng dẫn Phát triển](#hướng-dẫn-phát-triển)
|
|
33
|
+
- [Hướng dẫn Đóng góp](#hướng-dẫn-đóng-góp)
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Giới thiệu Dự án
|
|
38
|
+
|
|
39
|
+
Barista CLI là công cụ dòng lệnh AI-Native được thiết kế đặc biệt cho hệ sinh thái Newpeak. Nó cung cấp giao diện thống nhất để quản lý Liberica SaaS Quản lý Sản xuất và Nền tảng Bán hàng Arabica.
|
|
40
|
+
|
|
41
|
+
### Tính năng Cốt lõi
|
|
42
|
+
|
|
43
|
+
| Tính năng | Mô tả |
|
|
44
|
+
|-----------|-------|
|
|
45
|
+
| 🌍 **Hỗ trợ Đa Môi trường** | Chuyển đổi liền mạch giữa 4 môi trường dev, test, prod-cn, và prod-jp |
|
|
46
|
+
| 🏢 **Kiến trúc Đa Ngưới thuê** | Hỗ trợ cấu hình và cách ly môi trường đa ngưới thuê |
|
|
47
|
+
| 🔐 **Xác thực Token** | Lưu trữ an toàn trong chuỗi khóa hệ thống, cách ly môi trường |
|
|
48
|
+
| 🧪 **Chế độ Dry-Run** | Tất cả thao tác ghi đều hỗ trợ xem trước để tránh lỗi |
|
|
49
|
+
| 🤖 **Tích hợp AI** | Định dạng đầu ra JSON được tối ưu hóa cho Claude Code |
|
|
50
|
+
| 🔄 **Thao tác Liên dịch vụ** | Đồng bộ dữ liệu giữa Liberica và Arabica |
|
|
51
|
+
|
|
52
|
+
### Các trường hợp Sử dụng
|
|
53
|
+
|
|
54
|
+
- **Quản lý Kế hoạch Sản xuất**: Tạo, truy vấn và hủy đơn hàng sản xuất
|
|
55
|
+
- **Quản lý Dữ liệu Sản phẩm**: Tìm kiếm sản phẩm đa nền tảng, đồng bộ thông tin
|
|
56
|
+
- **Thao tác Khách hàng**: Truy vấn thông tin khách hàng và tạo báo giá
|
|
57
|
+
- **Tự động hóa AI**: Tự động hóa quy trình kinh doanh thông qua Claude Code
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Bắt đầu Nhanh
|
|
62
|
+
|
|
63
|
+
### Cài đặt
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# Cài đặt qua npm
|
|
67
|
+
npm install -g @newpeak/barista-cli
|
|
68
|
+
|
|
69
|
+
# Hoặc qua yarn
|
|
70
|
+
yarn global add @newpeak/barista-cli
|
|
71
|
+
|
|
72
|
+
# Xác minh cài đặt
|
|
73
|
+
barista --version
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Cấu hình Ban đầu
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# 1. Khởi tạo thư mục cấu hình
|
|
80
|
+
barista init
|
|
81
|
+
|
|
82
|
+
# 2. Cấu hình môi trường (chọn môi trường mặc định)
|
|
83
|
+
barista context use-env dev
|
|
84
|
+
|
|
85
|
+
# 3. Cấu hình ngưới thuê
|
|
86
|
+
barista context use-tenant your-tenant
|
|
87
|
+
|
|
88
|
+
# 4. Đăng nhập để lấy Token
|
|
89
|
+
barista auth login --service liberica --env dev
|
|
90
|
+
|
|
91
|
+
# 5. Xác minh trạng thái đăng nhập
|
|
92
|
+
barista auth status
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Ví dụ Sử dụng Cơ bản
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Xem ngữ cảnh hiện tại
|
|
99
|
+
barista context show
|
|
100
|
+
|
|
101
|
+
# Liệt kê tất cả đơn hàng (Liberica)
|
|
102
|
+
barista liberica orders list
|
|
103
|
+
|
|
104
|
+
# Tìm kiếm sản phẩm (hỗ trợ tìm kiếm mờ)
|
|
105
|
+
barista liberica products search --keyword "máy cà phê"
|
|
106
|
+
|
|
107
|
+
# Xem danh mục sản phẩm Arabica
|
|
108
|
+
barista arabica products public-catalog
|
|
109
|
+
|
|
110
|
+
# Tạo đơn hàng sản xuất (chế độ xem trước dry-run)
|
|
111
|
+
barista liberica orders create --product-id 123 --quantity 100 --dry-run
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Thiết kế Kiến trúc
|
|
117
|
+
|
|
118
|
+
### Ánh xạ Môi trường
|
|
119
|
+
|
|
120
|
+
#### Liberica (SaaS Quản lý Sản xuất)
|
|
121
|
+
|
|
122
|
+
| Môi trường | Định dạng Tên miền | Mô tả |
|
|
123
|
+
|------------|-------------------|-------|
|
|
124
|
+
| dev | `{tenant}-dev.newpeaksh.com` | Môi trường Phát triển |
|
|
125
|
+
| test | `{tenant}-test.newpeaksh.com` | Môi trường Kiểm thử |
|
|
126
|
+
| prod-cn | `{tenant}.newpeaksh.com` | Môi trường Sản xuất Trung Quốc |
|
|
127
|
+
| prod-jp | `{tenant}.newpeakjp.com` | Môi trường Sản xuất Nhật Bản |
|
|
128
|
+
|
|
129
|
+
#### Arabica (Nền tảng Bán hàng)
|
|
130
|
+
|
|
131
|
+
| Môi trường | Tên miền | Mô tả |
|
|
132
|
+
|------------|----------|-------|
|
|
133
|
+
| dev | `arabica-dev.newpeaksh.com` | Môi trường Phát triển |
|
|
134
|
+
| test | `arabica-test.newpeaksh.com` | Môi trường Kiểm thử |
|
|
135
|
+
| prod-cn | `www.newpeaksh.com` | Môi trường Sản xuất Trung Quốc |
|
|
136
|
+
| prod-jp | `members.newpeakjp.com` | Môi trường Sản xuất Nhật Bản |
|
|
137
|
+
|
|
138
|
+
### Cơ chế Xác thực
|
|
139
|
+
|
|
140
|
+
Barista CLI sử dụng cơ chế xác thực dựa trên Token:
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
|
|
144
|
+
│ Barista CLI │────▶│ Auth Server │────▶│ API Servers │
|
|
145
|
+
│ │ │ │ │ │
|
|
146
|
+
│ • Yêu cầu ĐN │ │ • Xác minh TT │ │ • Xác minh Token│
|
|
147
|
+
│ • Lưu Token │◀────│ • Cấp JWT │◀────│ • Trả dữ liệu │
|
|
148
|
+
│ (Chuỗi khóa) │ │ │ │ │
|
|
149
|
+
└─────────────────┘ └──────────────────┘ └─────────────────┘
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**Tính năng Bảo mật:**
|
|
153
|
+
|
|
154
|
+
- **Lưu trữ Chuỗi khóa**: Token được lưu trữ an toàn trong chuỗi khóa hệ thống (macOS Keychain, Windows Credential, Linux Secret Service)
|
|
155
|
+
- **Tự động Bỏ qua Xác thực**: Các giao diện công khai (như truy vấn danh mục sản phẩm) không cần xác thực
|
|
156
|
+
- **Cách ly Môi trường**: Mỗi môi trường và ngưới thuê sử dụng Token độc lập
|
|
157
|
+
- **Làm mới Token**: Hỗ trợ tự động làm mới Token sắp hết hạn
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Tài liệu Lệnh
|
|
162
|
+
|
|
163
|
+
> **Tham chiếu Lệnh Đầy đủ**: Để xem tham chiếu đầy đủ về tất cả các lệnh (bao gồm đã triển khai và đang phát triển), vui lòng xem [Tham chiếu Lệnh](./docs/commands/REFERENCE.md).
|
|
164
|
+
|
|
165
|
+
### Cấu trúc Lệnh
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
barista <service> <resource> <action> [options]
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**Ví dụ:**
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
barista liberica orders list --page 1 --size 20
|
|
175
|
+
barista arabica quotes calculate --product-id 123 --quantity 10
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Tùy chọn Toàn cục
|
|
179
|
+
|
|
180
|
+
| Tùy chọn | Mô tả | Ví dụ |
|
|
181
|
+
|----------|-------|-------|
|
|
182
|
+
| `--env` | Chỉ định môi trường | `--env prod-cn` |
|
|
183
|
+
| `--tenant` | Chỉ định ngưới thuê | `--tenant electionjp` |
|
|
184
|
+
| `--service` | Chỉ định dịch vụ | `--service liberica` |
|
|
185
|
+
| `--dry-run` | Chế độ xem trước | `--dry-run` |
|
|
186
|
+
| `--json` | Đầu ra JSON | `--json` |
|
|
187
|
+
| `--help` | Hiển thị trợ giúp | `--help` |
|
|
188
|
+
|
|
189
|
+
### Quản lý Ngữ cảnh
|
|
190
|
+
|
|
191
|
+
Quản lý ngữ cảnh được sử dụng để chuyển đổi nhanh môi trường làm việc, tránh phải chỉ định tham số môi trường cho mỗi lệnh.
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
# Xem ngữ cảnh hiện tại
|
|
195
|
+
barista context show
|
|
196
|
+
|
|
197
|
+
# Ví dụ đầu ra:
|
|
198
|
+
# ┌─────────────┬─────────────────┐
|
|
199
|
+
# │ Thuộc tính │ Giá trị │
|
|
200
|
+
# ├─────────────┼─────────────────┤
|
|
201
|
+
# │ Môi trường │ dev │
|
|
202
|
+
# │ Ngưới thuê │ electionjp │
|
|
203
|
+
# │ Dịch vụ │ liberica │
|
|
204
|
+
# │ Trạng thái │ Đã đăng nhập │
|
|
205
|
+
# │ Hết hạn │ 2024-12-31 │
|
|
206
|
+
# └─────────────┴─────────────────┘
|
|
207
|
+
|
|
208
|
+
# Chuyển đổi môi trường
|
|
209
|
+
barista context use-env [dev|test|prod-cn|prod-jp]
|
|
210
|
+
|
|
211
|
+
# Chuyển đổi ngưới thuê
|
|
212
|
+
barista context use-tenant <tenant-name>
|
|
213
|
+
|
|
214
|
+
# Chuyển đổi dịch vụ mặc định
|
|
215
|
+
barista context use-service [liberica|arabica]
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Quản lý Xác thực
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
# Đăng nhập để lấy Token
|
|
222
|
+
barista auth login --service <service> --env <env> [--tenant <tenant>]
|
|
223
|
+
|
|
224
|
+
# Ví dụ: Đăng nhập môi trường phát triển Liberica
|
|
225
|
+
barista auth login --service liberica --env dev --tenant electionjp
|
|
226
|
+
|
|
227
|
+
# Kiểm tra trạng thái đăng nhập
|
|
228
|
+
barista auth status
|
|
229
|
+
|
|
230
|
+
# Ví dụ đầu ra:
|
|
231
|
+
# ✓ Liberica (dev) - Đã đăng nhập (Hết hạn: 2024-12-31)
|
|
232
|
+
# ✗ Liberica (test) - Chưa đăng nhập
|
|
233
|
+
# ✓ Arabica (prod-cn) - Đã đăng nhập (Hết hạn: 2024-12-30)
|
|
234
|
+
|
|
235
|
+
# Đăng xuất (xóa Token)
|
|
236
|
+
barista auth logout --service <service> --env <env>
|
|
237
|
+
|
|
238
|
+
# Đăng xuất tất cả môi trường
|
|
239
|
+
barista auth logout --all
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Lệnh Liberica
|
|
243
|
+
|
|
244
|
+
#### Quản lý Đơn hàng
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
# Liệt kê đơn hàng (phân trang)
|
|
248
|
+
barista liberica orders list [--page <n>] [--size <n>] [--status <status>]
|
|
249
|
+
|
|
250
|
+
# Lấy chi tiết đơn hàng
|
|
251
|
+
barista liberica orders get <order-id>
|
|
252
|
+
|
|
253
|
+
# Tạo đơn hàng
|
|
254
|
+
barista liberica orders create \
|
|
255
|
+
--product-id <id> \
|
|
256
|
+
--quantity <n> \
|
|
257
|
+
[--delivery-date <date>] \
|
|
258
|
+
[--note <text>]
|
|
259
|
+
|
|
260
|
+
# Hủy đơn hàng
|
|
261
|
+
barista liberica orders cancel <order-id> [--reason <text>]
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
#### Quản lý Sản phẩm
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
# Tìm kiếm sản phẩm
|
|
268
|
+
barista liberica products search --keyword <keyword> [--category <id>]
|
|
269
|
+
|
|
270
|
+
# Lấy chi tiết sản phẩm
|
|
271
|
+
barista liberica products get <product-id>
|
|
272
|
+
|
|
273
|
+
# Lấy danh sách sản phẩm công khai (không cần xác thực)
|
|
274
|
+
barista liberica products public-list [--category <id>] [--page <n>]
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
#### Kế hoạch Sản xuất
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
# Xem lịch sản xuất
|
|
281
|
+
barista liberica production schedule [--start-date <date>] [--end-date <date>]
|
|
282
|
+
|
|
283
|
+
# Lên lịch lại
|
|
284
|
+
barista liberica production reschedule <order-id> --new-date <date> [--dry-run]
|
|
285
|
+
|
|
286
|
+
# Truy vấn công suất
|
|
287
|
+
barista liberica production capacity [--date <date>] [--line <line-id>]
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### Lệnh Arabica
|
|
291
|
+
|
|
292
|
+
#### Quản lý Sản phẩm
|
|
293
|
+
|
|
294
|
+
```bash
|
|
295
|
+
# Liệt kê sản phẩm
|
|
296
|
+
barista arabica products list [--page <n>] [--size <n>] [--category <id>]
|
|
297
|
+
|
|
298
|
+
# Tìm kiếm sản phẩm
|
|
299
|
+
barista arabica products search --keyword <keyword>
|
|
300
|
+
|
|
301
|
+
# Lấy danh mục sản phẩm (giao diện công khai)
|
|
302
|
+
barista arabica products public-catalog [--lang <zh|jp|en>]
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
#### Quản lý Báo giá
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
# Tính báo giá
|
|
309
|
+
barista arabica quotes calculate \
|
|
310
|
+
--product-id <id> \
|
|
311
|
+
--quantity <n> \
|
|
312
|
+
[--options <json>]
|
|
313
|
+
|
|
314
|
+
# Tạo báo giá
|
|
315
|
+
barista arabica quotes create \
|
|
316
|
+
--customer-id <id> \
|
|
317
|
+
--items <json> \
|
|
318
|
+
[--valid-days <n>]
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
#### Quản lý Khách hàng
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
# Tìm kiếm khách hàng
|
|
325
|
+
barista arabica customers search --keyword <keyword> [--type <type>]
|
|
326
|
+
|
|
327
|
+
# Lấy chi tiết khách hàng
|
|
328
|
+
barista arabica customers get <customer-id>
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### Lệnh Liên dịch vụ
|
|
332
|
+
|
|
333
|
+
Các lệnh liên dịch vụ cho phép đồng bộ dữ liệu và kết nối quy trình kinh doanh giữa Liberica và Arabica.
|
|
334
|
+
|
|
335
|
+
```bash
|
|
336
|
+
# Tạo báo giá từ đơn hàng
|
|
337
|
+
barista cross quote-from-order <order-id> [--target-service arabica]
|
|
338
|
+
|
|
339
|
+
# Ví dụ đầu ra:
|
|
340
|
+
# ✓ Đã tạo báo giá
|
|
341
|
+
# ┌──────────┬────────────┐
|
|
342
|
+
# │ Thuộc tính│ Giá trị │
|
|
343
|
+
# ├──────────┼────────────┤
|
|
344
|
+
# │ ID ĐH │ 12345 │
|
|
345
|
+
# │ ID Báo giá│ QT-2024-001│
|
|
346
|
+
# │ Số tiền │ ¥50,000 │
|
|
347
|
+
# │ Hiệu lực │ 30 ngày │
|
|
348
|
+
# └──────────┴────────────┘
|
|
349
|
+
|
|
350
|
+
# Đồng bộ trạng thái đơn hàng sang Arabica
|
|
351
|
+
barista cross sync-order <order-id> [--direction liberica-to-arabica]
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
## Tính năng Nâng cao
|
|
357
|
+
|
|
358
|
+
### Chế độ Dry-Run
|
|
359
|
+
|
|
360
|
+
Chế độ Dry-Run cho phép bạn xem trước tác động của thao tác ghi trước khi thực hiện, tránh lỗi.
|
|
361
|
+
|
|
362
|
+
```bash
|
|
363
|
+
# Tất cả thao tác ghi đều hỗ trợ tùy chọn --dry-run
|
|
364
|
+
barista liberica orders create --product-id 123 --quantity 100 --dry-run
|
|
365
|
+
|
|
366
|
+
# Ví dụ đầu ra:
|
|
367
|
+
# 🔍 Chế độ Dry-Run: Thao tác sẽ không được thực thi
|
|
368
|
+
# ┌─────────────────┬──────────────────────┐
|
|
369
|
+
# │ Thao tác │ Tạo đơn hàng │
|
|
370
|
+
# ├─────────────────┼──────────────────────┤
|
|
371
|
+
# │ Sản phẩm │ Máy cà phê Pro (ID: 123) │
|
|
372
|
+
# │ Số lượng │ 100 │
|
|
373
|
+
# │ Số tiền dự kiến │ ¥50,000 │
|
|
374
|
+
# │ Ngày giao dự kiến│ 2024-12-31 │
|
|
375
|
+
# │ Tác động │ Thêm 1 bản ghi đơn hàng │
|
|
376
|
+
# └─────────────────┴──────────────────────┘
|
|
377
|
+
#
|
|
378
|
+
# ⚠️ Xác nhận thực hiện? Thêm tùy chọn --confirm hoặc xóa --dry-run
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
**Thao tác Dry-Run Mặc định:**
|
|
382
|
+
|
|
383
|
+
Các thao tác phá hủy sau có chế độ Dry-Run được bật mặc định và yêu cầu xác nhận rõ ràng:
|
|
384
|
+
|
|
385
|
+
- Hủy đơn hàng
|
|
386
|
+
- Xóa sản phẩm
|
|
387
|
+
- Cập nhật hàng loạt
|
|
388
|
+
|
|
389
|
+
### Định dạng Đầu ra JSON
|
|
390
|
+
|
|
391
|
+
Barista CLI hỗ trợ đầu ra JSON để xử lý script và tích hợp AI:
|
|
392
|
+
|
|
393
|
+
```bash
|
|
394
|
+
barista liberica orders list --json
|
|
395
|
+
|
|
396
|
+
# Ví dụ đầu ra:
|
|
397
|
+
{
|
|
398
|
+
"success": true,
|
|
399
|
+
"data": {
|
|
400
|
+
"items": [
|
|
401
|
+
{
|
|
402
|
+
"id": "12345",
|
|
403
|
+
"productName": "Máy cà phê Pro",
|
|
404
|
+
"quantity": 100,
|
|
405
|
+
"status": "in_production",
|
|
406
|
+
"createdAt": "2024-01-15T10:30:00Z"
|
|
407
|
+
}
|
|
408
|
+
],
|
|
409
|
+
"pagination": {
|
|
410
|
+
"page": 1,
|
|
411
|
+
"size": 20,
|
|
412
|
+
"total": 150
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
---
|
|
419
|
+
|
|
420
|
+
## Cấu hình
|
|
421
|
+
|
|
422
|
+
### Tệp Cấu hình
|
|
423
|
+
|
|
424
|
+
Tệp cấu hình nằm tại `~/.barista/config.yaml`:
|
|
425
|
+
|
|
426
|
+
```yaml
|
|
427
|
+
# Tệp cấu hình Barista CLI
|
|
428
|
+
|
|
429
|
+
# Cài đặt ngữ cảnh mặc định
|
|
430
|
+
defaults:
|
|
431
|
+
env: dev
|
|
432
|
+
tenant: electionjp
|
|
433
|
+
service: liberica
|
|
434
|
+
|
|
435
|
+
# Cấu hình môi trường
|
|
436
|
+
environments:
|
|
437
|
+
dev:
|
|
438
|
+
liberica:
|
|
439
|
+
baseUrl: "https://{tenant}-dev.newpeaksh.com"
|
|
440
|
+
timeout: 30000
|
|
441
|
+
arabica:
|
|
442
|
+
baseUrl: "https://arabica-dev.newpeaksh.com"
|
|
443
|
+
timeout: 30000
|
|
444
|
+
|
|
445
|
+
test:
|
|
446
|
+
liberica:
|
|
447
|
+
baseUrl: "https://{tenant}-test.newpeaksh.com"
|
|
448
|
+
timeout: 30000
|
|
449
|
+
arabica:
|
|
450
|
+
baseUrl: "https://arabica-test.newpeaksh.com"
|
|
451
|
+
timeout: 30000
|
|
452
|
+
|
|
453
|
+
prod-cn:
|
|
454
|
+
liberica:
|
|
455
|
+
baseUrl: "https://{tenant}.newpeaksh.com"
|
|
456
|
+
timeout: 60000
|
|
457
|
+
arabica:
|
|
458
|
+
baseUrl: "https://www.newpeaksh.com"
|
|
459
|
+
timeout: 60000
|
|
460
|
+
|
|
461
|
+
prod-jp:
|
|
462
|
+
liberica:
|
|
463
|
+
baseUrl: "https://{tenant}.newpeakjp.com"
|
|
464
|
+
timeout: 60000
|
|
465
|
+
arabica:
|
|
466
|
+
baseUrl: "https://members.newpeakjp.com"
|
|
467
|
+
timeout: 60000
|
|
468
|
+
|
|
469
|
+
# Cấu hình đầu ra
|
|
470
|
+
output:
|
|
471
|
+
format: table # table | json
|
|
472
|
+
color: true
|
|
473
|
+
timestamp: true
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
### Cấu hình Đa ngưới thuê
|
|
477
|
+
|
|
478
|
+
Hỗ trợ cấu hình nhiều ngưới thuê để chuyển đổi nhanh:
|
|
479
|
+
|
|
480
|
+
```bash
|
|
481
|
+
# Thêm cấu hình ngưới thuê
|
|
482
|
+
barista config add-tenant \
|
|
483
|
+
--name customer-a \
|
|
484
|
+
--liberica-id customer-a-id \
|
|
485
|
+
--arabica-id customer-a-arabica-id
|
|
486
|
+
|
|
487
|
+
# Liệt kê ngưới thuê đã cấu hình
|
|
488
|
+
barista config list-tenants
|
|
489
|
+
|
|
490
|
+
# Chuyển đổi ngưới thuê nhanh
|
|
491
|
+
barista context use-tenant customer-a
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
---
|
|
495
|
+
|
|
496
|
+
## Tích hợp AI
|
|
497
|
+
|
|
498
|
+
Barista CLI được tối ưu hóa cho trợ lý lập trình AI, đặc biệt là Claude Code.
|
|
499
|
+
|
|
500
|
+
### Ví dụ Sử dụng Claude Code
|
|
501
|
+
|
|
502
|
+
```typescript
|
|
503
|
+
// Sử dụng Barista CLI trong Claude Code
|
|
504
|
+
// Ví dụ: Lấy danh sách đơn hàng và phân tích
|
|
505
|
+
|
|
506
|
+
const result = await $`barista liberica orders list --json --page 1 --size 10`;
|
|
507
|
+
const orders = JSON.parse(result.stdout);
|
|
508
|
+
|
|
509
|
+
// Phân tích dữ liệu đơn hàng
|
|
510
|
+
const analysis = orders.data.items.map(order => ({
|
|
511
|
+
id: order.id,
|
|
512
|
+
status: order.status,
|
|
513
|
+
amount: order.amount
|
|
514
|
+
}));
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
### Tệp Skills
|
|
518
|
+
|
|
519
|
+
Barista CLI cung cấp các tệp Claude Code Skills, nằm tại:
|
|
520
|
+
|
|
521
|
+
```
|
|
522
|
+
~/.barista/claude/skills/
|
|
523
|
+
├── orders.md # Kỹ năng quản lý đơn hàng
|
|
524
|
+
├── products.md # Kỹ năng quản lý sản phẩm
|
|
525
|
+
├── quotes.md # Kỹ năng quản lý báo giá
|
|
526
|
+
└── customers.md # Kỹ năng quản lý khách hàng
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
**Ví dụ Tệp Skills:**
|
|
530
|
+
|
|
531
|
+
```markdown
|
|
532
|
+
# Kỹ năng Quản lý Đơn hàng
|
|
533
|
+
|
|
534
|
+
## Liệt kê Đơn hàng Chờ xử lý
|
|
535
|
+
|
|
536
|
+
Khi ngưới dùng hỏi về đơn hàng chờ xử lý:
|
|
537
|
+
|
|
538
|
+
1. Thực thi lệnh: barista liberica orders list --status pending --json
|
|
539
|
+
2. Phân tích JSON trả về
|
|
540
|
+
3. Tóm tắt số lượng đơn hàng và tổng số tiền
|
|
541
|
+
4. Liệt kê thông tin quan trọng của 5 đơn hàng đầu tiên
|
|
542
|
+
|
|
543
|
+
## Tạo Đơn hàng Mới
|
|
544
|
+
|
|
545
|
+
Khi ngưới dùng cần tạo đơn hàng:
|
|
546
|
+
|
|
547
|
+
1. Xác nhận ID sản phẩm và số lượng
|
|
548
|
+
2. Sử dụng dry-run để xem trước: barista liberica orders create --dry-run ...
|
|
549
|
+
3. Thực thi lệnh thực sau khi ngưới dùng xác nhận
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
### Đầu ra Thân thiện với AI
|
|
553
|
+
|
|
554
|
+
Tất cả lệnh đều hỗ trợ tùy chọn `--json`, trả về dữ liệu JSON có cấu trúc:
|
|
555
|
+
|
|
556
|
+
```bash
|
|
557
|
+
# Truy vấn với đầu ra có cấu trúc
|
|
558
|
+
barista liberica orders get 12345 --json
|
|
559
|
+
|
|
560
|
+
{
|
|
561
|
+
"success": true,
|
|
562
|
+
"data": {
|
|
563
|
+
"id": "12345",
|
|
564
|
+
"status": "in_production",
|
|
565
|
+
"product": {
|
|
566
|
+
"id": "100",
|
|
567
|
+
"name": "Máy cà phê Pro"
|
|
568
|
+
},
|
|
569
|
+
"quantity": 100,
|
|
570
|
+
"amount": 50000,
|
|
571
|
+
"timeline": {
|
|
572
|
+
"created": "2024-01-15T10:30:00Z",
|
|
573
|
+
"delivery": "2024-02-15"
|
|
574
|
+
}
|
|
575
|
+
},
|
|
576
|
+
"meta": {
|
|
577
|
+
"requestId": "req-abc123",
|
|
578
|
+
"timestamp": "2024-01-15T10:30:00Z"
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
---
|
|
584
|
+
|
|
585
|
+
## Hướng dẫn Phát triển
|
|
586
|
+
|
|
587
|
+
### Cấu trúc Dự án
|
|
588
|
+
|
|
589
|
+
```
|
|
590
|
+
coffee-barista-cli/
|
|
591
|
+
├── bin/
|
|
592
|
+
│ └── barista.js # Tệp khởi đầu
|
|
593
|
+
├── src/
|
|
594
|
+
│ ├── commands/ # Triển khai lệnh
|
|
595
|
+
│ │ ├── context/ # Lệnh quản lý ngữ cảnh
|
|
596
|
+
│ │ ├── auth/ # Lệnh xác thực
|
|
597
|
+
│ │ ├── liberica/ # Lệnh dịch vụ Liberica
|
|
598
|
+
│ │ │ ├── orders.js
|
|
599
|
+
│ │ │ ├── products.js
|
|
600
|
+
│ │ │ └── production.js
|
|
601
|
+
│ │ ├── arabica/ # Lệnh dịch vụ Arabica
|
|
602
|
+
│ │ │ ├── products.js
|
|
603
|
+
│ │ │ ├── quotes.js
|
|
604
|
+
│ │ │ └── customers.js
|
|
605
|
+
│ │ └── cross/ # Lệnh liên dịch vụ
|
|
606
|
+
│ ├── core/ # Mô-đun cốt lõi
|
|
607
|
+
│ │ ├── auth.js # Quản lý xác thực
|
|
608
|
+
│ │ ├── config.js # Quản lý cấu hình
|
|
609
|
+
│ │ ├── context.js # Quản lý ngữ cảnh
|
|
610
|
+
│ │ └── api-client.js # Client API
|
|
611
|
+
│ ├── utils/ # Hàm tiện ích
|
|
612
|
+
│ │ ├── formatter.js # Định dạng đầu ra
|
|
613
|
+
│ │ ├── validator.js # Xác thực tham số
|
|
614
|
+
│ │ └── keychain.js # Thao tác chuỗi khóa
|
|
615
|
+
│ └── templates/ # Tệp mẫu
|
|
616
|
+
├── skills/ # Claude Code Skills
|
|
617
|
+
├── tests/ # Tệp kiểm thử
|
|
618
|
+
├── package.json
|
|
619
|
+
└── README.md
|
|
620
|
+
```
|
|
621
|
+
|
|
622
|
+
### Phát triển Local
|
|
623
|
+
|
|
624
|
+
```bash
|
|
625
|
+
# 1. Clone kho lưu trữ
|
|
626
|
+
git clone https://gitlab.newpeaksh.com/coffee/coffee-barista-cli.git
|
|
627
|
+
cd coffee-barista-cli
|
|
628
|
+
|
|
629
|
+
# 2. Cài đặt phụ thuộc
|
|
630
|
+
npm install
|
|
631
|
+
|
|
632
|
+
# 3. Liên kết toàn cục (chế độ phát triển)
|
|
633
|
+
npm link
|
|
634
|
+
|
|
635
|
+
# 4. Xác minh liên kết
|
|
636
|
+
barista --version
|
|
637
|
+
|
|
638
|
+
# 5. Chạy kiểm thử
|
|
639
|
+
npm test
|
|
640
|
+
|
|
641
|
+
# 6. Kiểm tra mã
|
|
642
|
+
npm run lint
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
### Thêm Lệnh Mới
|
|
646
|
+
|
|
647
|
+
**Quan trọng**: Lệnh mới phải tuân theo [Đặc tả Thiết kế Lệnh](./docs/COMMAND_DESIGN_SPEC.md), bao gồm viết tài liệu thiết kế, đánh giá kỹ thuật và các quy trình hoàn chỉnh khác.
|
|
648
|
+
|
|
649
|
+
Tham khảo chi tiết tại:
|
|
650
|
+
- [Tham chiếu Lệnh Đầy đủ](./docs/commands/REFERENCE.md) - Danh sách tất cả lệnh và ưu tiên phát triển
|
|
651
|
+
- [Tài liệu Đặc tả Thiết kế Lệnh](./docs/COMMAND_DESIGN_SPEC.md#5-quy-trình-phát-triển-lệnh)
|
|
652
|
+
- [Hướng dẫn Phát triển Lệnh](./docs/COMMANDS.md)
|
|
653
|
+
|
|
654
|
+
---
|
|
655
|
+
|
|
656
|
+
## Hướng dẫn Đóng góp
|
|
657
|
+
|
|
658
|
+
Chúng tôi hoan nghênh mọi hình thức đóng góp, bao gồm nhưng không giới hạn ở:
|
|
659
|
+
|
|
660
|
+
- 🐛 Báo cáo lỗi
|
|
661
|
+
- 💡 Đề xuất tính năng mới
|
|
662
|
+
- 📝 Cải thiện tài liệu
|
|
663
|
+
- 🔧 Gửi bản sửa lỗi
|
|
664
|
+
- ✨ Thêm tính năng mới
|
|
665
|
+
|
|
666
|
+
### Quy ước Commit
|
|
667
|
+
|
|
668
|
+
Vui lòng tuân theo quy chuẩn [Conventional Commits](https://www.conventionalcommits.org/):
|
|
669
|
+
|
|
670
|
+
```bash
|
|
671
|
+
# Sửa lỗi
|
|
672
|
+
fix: sửa lỗi phân trang danh sách đơn hàng
|
|
673
|
+
|
|
674
|
+
# Thêm tính năng
|
|
675
|
+
feat: thêm lệnh truy vấn tồn kho
|
|
676
|
+
|
|
677
|
+
# Cập nhật tài liệu
|
|
678
|
+
docs: cập nhật ánh xạ môi trường trong README
|
|
679
|
+
|
|
680
|
+
# Tái cấu trúc mã
|
|
681
|
+
refactor: tái cấu trúc xử lý lỗi client API
|
|
682
|
+
```
|
|
683
|
+
|
|
684
|
+
### Quy trình Phát triển
|
|
685
|
+
|
|
686
|
+
1. Fork kho lưu trữ này
|
|
687
|
+
2. Tạo nhánh tính năng: `git checkout -b feature/my-feature`
|
|
688
|
+
3. Commit thay đổi: `git commit -m 'feat: add some feature'`
|
|
689
|
+
4. Push nhánh: `git push origin feature/my-feature`
|
|
690
|
+
5. Tạo Pull Request
|
|
691
|
+
|
|
692
|
+
---
|
|
693
|
+
|
|
694
|
+
## Dự án Liên quan
|
|
695
|
+
|
|
696
|
+
| Dự án | Mô tả | Liên kết |
|
|
697
|
+
|-------|-------|----------|
|
|
698
|
+
| ☕ Liberica Backend | Backend SaaS Quản lý Sản xuất | [coffee-liberica-end](https://gitlab.newpeaksh.com/coffee/coffee-liberica-end) |
|
|
699
|
+
| 🖥️ Liberica Frontend | Frontend Web Quản lý Sản xuất | [coffee-liberica-front](https://gitlab.newpeaksh.com/coffee/coffee-liberica-front) |
|
|
700
|
+
| 📱 Liberica Mobile | Di động Quản lý Sản xuất | [coffee-liberica-mobile-front](https://gitlab.newpeaksh.com/coffee/coffee-liberica-mobile-front) |
|
|
701
|
+
| 🛒 Arabica Backend | Backend Nền tảng Bán hàng | [coffee-arabica-end](https://gitlab.newpeaksh.com/coffee/coffee-arabica-end) |
|
|
702
|
+
| 🌐 Arabica Frontend | Frontend Nền tảng Bán hàng | [coffee-arabica-front](https://gitlab.newpeaksh.com/coffee/coffee-arabica-front) |
|
|
703
|
+
|
|
704
|
+
---
|
|
705
|
+
|
|
706
|
+
## Giấy phép
|
|
707
|
+
|
|
708
|
+
[MIT](LICENSE) © Newpeak Technology
|
|
709
|
+
|
|
710
|
+
---
|
|
711
|
+
|
|
712
|
+
<p align="center">
|
|
713
|
+
Được cung cấp bởi ☕
|
|
714
|
+
</p>
|