@fctc/interface-logic 4.2.7 → 4.2.9
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/dist/environment.d.mts +1 -0
- package/dist/environment.d.ts +1 -0
- package/dist/hooks.d.mts +4 -1
- package/dist/hooks.d.ts +4 -1
- package/dist/hooks.js +385 -5
- package/dist/hooks.mjs +383 -5
- package/dist/import-snapshot-Ds0gqFFm.d.mts +3 -0
- package/dist/import-snapshot-Ds0gqFFm.d.ts +3 -0
- package/dist/provider.d.mts +4 -1
- package/dist/provider.d.ts +4 -1
- package/dist/provider.js +387 -7
- package/dist/provider.mjs +386 -7
- package/dist/services.d.mts +8 -1
- package/dist/services.d.ts +8 -1
- package/dist/services.js +378 -5
- package/dist/services.mjs +376 -5
- package/dist/store.js +2 -1
- package/dist/store.mjs +2 -1
- package/package.json +91 -90
package/dist/hooks.mjs
CHANGED
|
@@ -1616,9 +1616,9 @@ function applyBinaryOp(ast, context) {
|
|
|
1616
1616
|
var DICT = {
|
|
1617
1617
|
get(...args) {
|
|
1618
1618
|
const { key, defValue } = parseArgs(args, ["key", "defValue"]);
|
|
1619
|
-
const
|
|
1620
|
-
if (key in
|
|
1621
|
-
return
|
|
1619
|
+
const self2 = this;
|
|
1620
|
+
if (key in self2) {
|
|
1621
|
+
return self2[key];
|
|
1622
1622
|
} else if (defValue !== void 0) {
|
|
1623
1623
|
return defValue;
|
|
1624
1624
|
}
|
|
@@ -2254,7 +2254,8 @@ var initialState2 = {
|
|
|
2254
2254
|
allowed_company_ids: [],
|
|
2255
2255
|
lang: "vi_VN",
|
|
2256
2256
|
tz: "Asia/Saigon"
|
|
2257
|
-
}
|
|
2257
|
+
},
|
|
2258
|
+
isLocalMode: false
|
|
2258
2259
|
};
|
|
2259
2260
|
var envSlice = createSlice2({
|
|
2260
2261
|
name: "env",
|
|
@@ -5796,7 +5797,226 @@ var handleClosingSessionService = (env) => {
|
|
|
5796
5797
|
|
|
5797
5798
|
// src/services/pos-service/load-data-pos-session.ts
|
|
5798
5799
|
import { useCallback as useCallback32 } from "react";
|
|
5800
|
+
|
|
5801
|
+
// src/services/filesystem-service/file-service.ts
|
|
5802
|
+
import { Directory, Encoding, Filesystem } from "@capacitor/filesystem";
|
|
5803
|
+
var fileService = {
|
|
5804
|
+
async read(path) {
|
|
5805
|
+
try {
|
|
5806
|
+
const res = await Filesystem.readFile({
|
|
5807
|
+
path,
|
|
5808
|
+
directory: Directory.Data,
|
|
5809
|
+
encoding: Encoding.UTF8
|
|
5810
|
+
});
|
|
5811
|
+
if (typeof res.data === "string") return res.data;
|
|
5812
|
+
if (res.data instanceof Blob) return await res.data.text();
|
|
5813
|
+
return null;
|
|
5814
|
+
} catch {
|
|
5815
|
+
return null;
|
|
5816
|
+
}
|
|
5817
|
+
},
|
|
5818
|
+
async write(path, data) {
|
|
5819
|
+
await Filesystem.writeFile({
|
|
5820
|
+
path,
|
|
5821
|
+
data,
|
|
5822
|
+
directory: Directory.Data,
|
|
5823
|
+
encoding: Encoding.UTF8,
|
|
5824
|
+
recursive: true
|
|
5825
|
+
});
|
|
5826
|
+
},
|
|
5827
|
+
async writeAtomic(path, data) {
|
|
5828
|
+
const tempPath = path + ".tmp";
|
|
5829
|
+
await Filesystem.writeFile({
|
|
5830
|
+
path: tempPath,
|
|
5831
|
+
data,
|
|
5832
|
+
directory: Directory.Data,
|
|
5833
|
+
encoding: Encoding.UTF8,
|
|
5834
|
+
recursive: true
|
|
5835
|
+
});
|
|
5836
|
+
try {
|
|
5837
|
+
await Filesystem.deleteFile({
|
|
5838
|
+
path,
|
|
5839
|
+
directory: Directory.Data
|
|
5840
|
+
});
|
|
5841
|
+
} catch {
|
|
5842
|
+
}
|
|
5843
|
+
await Filesystem.rename({
|
|
5844
|
+
from: tempPath,
|
|
5845
|
+
to: path,
|
|
5846
|
+
directory: Directory.Data
|
|
5847
|
+
});
|
|
5848
|
+
},
|
|
5849
|
+
async delete(path) {
|
|
5850
|
+
try {
|
|
5851
|
+
await Filesystem.deleteFile({
|
|
5852
|
+
path,
|
|
5853
|
+
directory: Directory.Data
|
|
5854
|
+
});
|
|
5855
|
+
} catch {
|
|
5856
|
+
}
|
|
5857
|
+
},
|
|
5858
|
+
async exists(path) {
|
|
5859
|
+
try {
|
|
5860
|
+
await Filesystem.stat({
|
|
5861
|
+
path,
|
|
5862
|
+
directory: Directory.Data
|
|
5863
|
+
});
|
|
5864
|
+
return true;
|
|
5865
|
+
} catch {
|
|
5866
|
+
return false;
|
|
5867
|
+
}
|
|
5868
|
+
},
|
|
5869
|
+
async mkdir(path) {
|
|
5870
|
+
try {
|
|
5871
|
+
await Filesystem.mkdir({
|
|
5872
|
+
path,
|
|
5873
|
+
directory: Directory.Data,
|
|
5874
|
+
recursive: true
|
|
5875
|
+
});
|
|
5876
|
+
} catch (e) {
|
|
5877
|
+
if (!String(e?.message).includes("Exists")) {
|
|
5878
|
+
throw e;
|
|
5879
|
+
}
|
|
5880
|
+
}
|
|
5881
|
+
},
|
|
5882
|
+
async list(path) {
|
|
5883
|
+
return Filesystem.readdir({
|
|
5884
|
+
path,
|
|
5885
|
+
directory: Directory.Data
|
|
5886
|
+
});
|
|
5887
|
+
},
|
|
5888
|
+
async getUri(path) {
|
|
5889
|
+
return Filesystem.getUri({
|
|
5890
|
+
path,
|
|
5891
|
+
directory: Directory.Data
|
|
5892
|
+
});
|
|
5893
|
+
}
|
|
5894
|
+
};
|
|
5895
|
+
|
|
5896
|
+
// src/services/filesystem-service/json-worker.ts
|
|
5897
|
+
self.addEventListener("message", async (ev) => {
|
|
5898
|
+
const { id, cmd, payload } = ev.data;
|
|
5899
|
+
try {
|
|
5900
|
+
if (cmd === "parse") {
|
|
5901
|
+
const parsed = JSON.parse(payload);
|
|
5902
|
+
self.postMessage({ id, ok: true, result: parsed });
|
|
5903
|
+
} else if (cmd === "stringify") {
|
|
5904
|
+
const str = JSON.stringify(payload);
|
|
5905
|
+
self.postMessage({ id, ok: true, result: str });
|
|
5906
|
+
}
|
|
5907
|
+
} catch (err) {
|
|
5908
|
+
self.postMessage({ id, ok: false, error: err?.message || String(err) });
|
|
5909
|
+
}
|
|
5910
|
+
});
|
|
5911
|
+
function spawnParseWorker(raw) {
|
|
5912
|
+
return new Promise((resolve, reject) => {
|
|
5913
|
+
const worker = new Worker(new URL("./json-worker.ts", import.meta.url), {
|
|
5914
|
+
type: "module"
|
|
5915
|
+
});
|
|
5916
|
+
const id = Math.random().toString(36).slice(2);
|
|
5917
|
+
worker.onmessage = (ev) => {
|
|
5918
|
+
const { ok, result, error } = ev.data;
|
|
5919
|
+
if (ok) {
|
|
5920
|
+
resolve(result);
|
|
5921
|
+
} else {
|
|
5922
|
+
reject(new Error(error));
|
|
5923
|
+
}
|
|
5924
|
+
worker.terminate();
|
|
5925
|
+
};
|
|
5926
|
+
worker.postMessage({ id, cmd: "parse", payload: raw });
|
|
5927
|
+
});
|
|
5928
|
+
}
|
|
5929
|
+
function spawnStringifyWorker(obj) {
|
|
5930
|
+
return new Promise((resolve, reject) => {
|
|
5931
|
+
const worker = new Worker(new URL("./json-worker.ts", import.meta.url), {
|
|
5932
|
+
type: "module"
|
|
5933
|
+
});
|
|
5934
|
+
worker.onmessage = (ev) => {
|
|
5935
|
+
const { ok, result, error } = ev.data;
|
|
5936
|
+
if (ok) resolve(result);
|
|
5937
|
+
else reject(new Error(error));
|
|
5938
|
+
worker.terminate();
|
|
5939
|
+
};
|
|
5940
|
+
worker.postMessage({ cmd: "stringify", payload: obj });
|
|
5941
|
+
});
|
|
5942
|
+
}
|
|
5943
|
+
|
|
5944
|
+
// src/services/filesystem-service/memory-cache.ts
|
|
5945
|
+
var MemoryCache = class {
|
|
5946
|
+
map = /* @__PURE__ */ new Map();
|
|
5947
|
+
get(k) {
|
|
5948
|
+
const e = this.map.get(k);
|
|
5949
|
+
if (!e) return null;
|
|
5950
|
+
if (e.ttl && Date.now() - e.t > e.ttl) {
|
|
5951
|
+
this.map.delete(k);
|
|
5952
|
+
return null;
|
|
5953
|
+
}
|
|
5954
|
+
return e.value;
|
|
5955
|
+
}
|
|
5956
|
+
set(k, v, ttl = 5 * 60 * 1e3) {
|
|
5957
|
+
this.map.set(k, { value: v, t: Date.now(), ttl });
|
|
5958
|
+
}
|
|
5959
|
+
del(k) {
|
|
5960
|
+
this.map.delete(k);
|
|
5961
|
+
}
|
|
5962
|
+
clear() {
|
|
5963
|
+
this.map.clear();
|
|
5964
|
+
}
|
|
5965
|
+
};
|
|
5966
|
+
var memoryCache = new MemoryCache();
|
|
5967
|
+
|
|
5968
|
+
// src/services/filesystem-service/model-loader.ts
|
|
5969
|
+
var MODELS_DIR = "pos/models";
|
|
5970
|
+
var MODELS_META_DIR = "pos/models_meta";
|
|
5971
|
+
async function loadData(includeMeta = true) {
|
|
5972
|
+
const exists = await fileService.exists(MODELS_DIR);
|
|
5973
|
+
if (!exists) {
|
|
5974
|
+
console.warn("[loadData] MODELS_DIR not exists:", MODELS_DIR);
|
|
5975
|
+
return {};
|
|
5976
|
+
}
|
|
5977
|
+
let listResult;
|
|
5978
|
+
try {
|
|
5979
|
+
listResult = await fileService.list(MODELS_DIR);
|
|
5980
|
+
} catch (e) {
|
|
5981
|
+
console.error("[loadData] list failed:", e);
|
|
5982
|
+
return {};
|
|
5983
|
+
}
|
|
5984
|
+
if (!listResult || !Array.isArray(listResult.files)) {
|
|
5985
|
+
return {};
|
|
5986
|
+
}
|
|
5987
|
+
const result = {};
|
|
5988
|
+
for (const file of listResult.files) {
|
|
5989
|
+
if (file.type !== "file") continue;
|
|
5990
|
+
if (!file.name.endsWith(".json")) continue;
|
|
5991
|
+
const modelName = file.name.replace(/\.json$/, "");
|
|
5992
|
+
const dataPath = `${MODELS_DIR}/${file.name}`;
|
|
5993
|
+
const metaPath = `${MODELS_META_DIR}/${encodeURIComponent(
|
|
5994
|
+
modelName
|
|
5995
|
+
)}.meta.json`;
|
|
5996
|
+
const rawData = await fileService.read(dataPath);
|
|
5997
|
+
if (!rawData) continue;
|
|
5998
|
+
const parsedData = await spawnParseWorker(rawData);
|
|
5999
|
+
const data = Array.isArray(parsedData) ? parsedData : [];
|
|
6000
|
+
if (!includeMeta) {
|
|
6001
|
+
result[modelName] = { data };
|
|
6002
|
+
continue;
|
|
6003
|
+
}
|
|
6004
|
+
const rawMeta = await fileService.read(metaPath);
|
|
6005
|
+
let fields = [];
|
|
6006
|
+
let relations = {};
|
|
6007
|
+
if (rawMeta) {
|
|
6008
|
+
const parsedMeta = await spawnParseWorker(rawMeta);
|
|
6009
|
+
fields = parsedMeta?.fields ?? [];
|
|
6010
|
+
relations = parsedMeta?.relations ?? {};
|
|
6011
|
+
}
|
|
6012
|
+
result[modelName] = { data, fields, relations };
|
|
6013
|
+
}
|
|
6014
|
+
return result;
|
|
6015
|
+
}
|
|
6016
|
+
|
|
6017
|
+
// src/services/pos-service/load-data-pos-session.ts
|
|
5799
6018
|
var loadDataPosSessionService = (env) => {
|
|
6019
|
+
const isLocalMode = env?.isLocalMode;
|
|
5800
6020
|
const loadDataPosSession = useCallback32(
|
|
5801
6021
|
({
|
|
5802
6022
|
model,
|
|
@@ -5807,6 +6027,14 @@ var loadDataPosSessionService = (env) => {
|
|
|
5807
6027
|
modelsToLoad = [],
|
|
5808
6028
|
searchParams
|
|
5809
6029
|
}) => {
|
|
6030
|
+
console.log("isLocalMode", isLocalMode);
|
|
6031
|
+
if (isLocalMode) {
|
|
6032
|
+
return loadData().then((localDb) => ({
|
|
6033
|
+
data: {
|
|
6034
|
+
data: localDb
|
|
6035
|
+
}
|
|
6036
|
+
}));
|
|
6037
|
+
}
|
|
5810
6038
|
const jsonData = {
|
|
5811
6039
|
model,
|
|
5812
6040
|
method: "load_data" /* LOAD_DATA */,
|
|
@@ -5833,7 +6061,7 @@ var loadDataPosSessionService = (env) => {
|
|
|
5833
6061
|
service
|
|
5834
6062
|
);
|
|
5835
6063
|
},
|
|
5836
|
-
[env]
|
|
6064
|
+
[env, isLocalMode]
|
|
5837
6065
|
);
|
|
5838
6066
|
return {
|
|
5839
6067
|
loadDataPosSession
|
|
@@ -6166,6 +6394,145 @@ var usePosService = () => {
|
|
|
6166
6394
|
return service;
|
|
6167
6395
|
};
|
|
6168
6396
|
|
|
6397
|
+
// src/services/filesystem-service/manifest.ts
|
|
6398
|
+
var MANIFEST_PATH = "pos/manifest.json";
|
|
6399
|
+
var MANIFEST_BAK_PATH = "pos/manifest.bak.json";
|
|
6400
|
+
async function writeManifest(manifest) {
|
|
6401
|
+
const oldRaw = await fileService.read(MANIFEST_PATH);
|
|
6402
|
+
if (oldRaw !== null) {
|
|
6403
|
+
await fileService.writeAtomic(MANIFEST_BAK_PATH, oldRaw);
|
|
6404
|
+
}
|
|
6405
|
+
await fileService.writeAtomic(MANIFEST_PATH, JSON.stringify(manifest));
|
|
6406
|
+
try {
|
|
6407
|
+
await fileService.delete(MANIFEST_BAK_PATH);
|
|
6408
|
+
} catch {
|
|
6409
|
+
}
|
|
6410
|
+
}
|
|
6411
|
+
|
|
6412
|
+
// src/services/filesystem-service/import-snapshot.ts
|
|
6413
|
+
var DATA_DIR = "pos";
|
|
6414
|
+
var MODELS_DIR2 = `${DATA_DIR}/models`;
|
|
6415
|
+
var MODELS_META_DIR2 = `${DATA_DIR}/models_meta`;
|
|
6416
|
+
var importSnapshot = async ({ data, onProgress }) => {
|
|
6417
|
+
onProgress?.(1, "Parsing snapshot");
|
|
6418
|
+
const parsed = await spawnParseWorker(data);
|
|
6419
|
+
const modelNames = Object.keys(parsed);
|
|
6420
|
+
const total = modelNames.length;
|
|
6421
|
+
const manifest = { version: (/* @__PURE__ */ new Date()).toISOString(), models: {} };
|
|
6422
|
+
const TMP_PREFIX = `pos/data/tmp_import_${Date.now()}`;
|
|
6423
|
+
await fileService.writeAtomic(`${TMP_PREFIX}/.marker`, "1");
|
|
6424
|
+
let i = 0;
|
|
6425
|
+
for (const model of modelNames) {
|
|
6426
|
+
i++;
|
|
6427
|
+
onProgress?.(
|
|
6428
|
+
Math.round(i / total * 100),
|
|
6429
|
+
`Processing ${model} (${i}/${total})`
|
|
6430
|
+
);
|
|
6431
|
+
const block = parsed[model];
|
|
6432
|
+
const dataPart = block?.data ?? block ?? [];
|
|
6433
|
+
const fields = block?.fields ?? [];
|
|
6434
|
+
const relations = block?.relations ?? {};
|
|
6435
|
+
const serialized = await spawnStringifyWorker(dataPart);
|
|
6436
|
+
const tmpModelPath = `${TMP_PREFIX}/${encodeURIComponent(model)}.json`;
|
|
6437
|
+
await fileService.writeAtomic(tmpModelPath, serialized);
|
|
6438
|
+
const meta = {
|
|
6439
|
+
fields,
|
|
6440
|
+
relations,
|
|
6441
|
+
count: Array.isArray(dataPart) ? dataPart.length : 0,
|
|
6442
|
+
writtenAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
6443
|
+
};
|
|
6444
|
+
const tmpMetaPath = `${TMP_PREFIX}/${encodeURIComponent(model)}.meta.json`;
|
|
6445
|
+
await fileService.writeAtomic(tmpMetaPath, JSON.stringify(meta));
|
|
6446
|
+
manifest.models[model] = {
|
|
6447
|
+
file: `${MODELS_DIR2}/${encodeURIComponent(model)}.json`,
|
|
6448
|
+
metaFile: `${MODELS_META_DIR2}/${encodeURIComponent(model)}.meta.json`,
|
|
6449
|
+
count: meta.count,
|
|
6450
|
+
updatedAt: meta.writtenAt
|
|
6451
|
+
};
|
|
6452
|
+
}
|
|
6453
|
+
onProgress?.(95, "Committing import (moving files)");
|
|
6454
|
+
for (const model of modelNames) {
|
|
6455
|
+
const tmpModelPath = `${TMP_PREFIX}/${encodeURIComponent(model)}.json`;
|
|
6456
|
+
const finalModelPath = `${MODELS_DIR2}/${encodeURIComponent(model)}.json`;
|
|
6457
|
+
const tmpMetaPath = `${TMP_PREFIX}/${encodeURIComponent(model)}.meta.json`;
|
|
6458
|
+
const finalMetaPath = `${MODELS_META_DIR2}/${encodeURIComponent(
|
|
6459
|
+
model
|
|
6460
|
+
)}.meta.json`;
|
|
6461
|
+
const tmpRaw = await fileService.read(tmpModelPath);
|
|
6462
|
+
if (tmpRaw !== null) await fileService.writeAtomic(finalModelPath, tmpRaw);
|
|
6463
|
+
const tmpMetaRaw = await fileService.read(tmpMetaPath);
|
|
6464
|
+
if (tmpMetaRaw !== null)
|
|
6465
|
+
await fileService.writeAtomic(finalMetaPath, tmpMetaRaw);
|
|
6466
|
+
onProgress?.(
|
|
6467
|
+
95 + Math.round(
|
|
6468
|
+
(Object.keys(manifest.models).indexOf(model) + 1) / modelNames.length * 5
|
|
6469
|
+
),
|
|
6470
|
+
`Committed ${model}`
|
|
6471
|
+
);
|
|
6472
|
+
}
|
|
6473
|
+
await writeManifest(manifest);
|
|
6474
|
+
try {
|
|
6475
|
+
for (const model of modelNames) {
|
|
6476
|
+
await fileService.delete(
|
|
6477
|
+
`${TMP_PREFIX}/${encodeURIComponent(model)}.json`
|
|
6478
|
+
);
|
|
6479
|
+
await fileService.delete(
|
|
6480
|
+
`${TMP_PREFIX}/${encodeURIComponent(model)}.meta.json`
|
|
6481
|
+
);
|
|
6482
|
+
}
|
|
6483
|
+
await fileService.delete(`${TMP_PREFIX}/.marker`);
|
|
6484
|
+
} catch (e) {
|
|
6485
|
+
console.log("Failed to cleanup tmp import files:", e);
|
|
6486
|
+
}
|
|
6487
|
+
onProgress?.(100, "Import complete");
|
|
6488
|
+
return manifest;
|
|
6489
|
+
};
|
|
6490
|
+
var import_snapshot_default = importSnapshot;
|
|
6491
|
+
|
|
6492
|
+
// src/services/filesystem-service/init-snapshot.ts
|
|
6493
|
+
var isSnapshotReady = async () => {
|
|
6494
|
+
try {
|
|
6495
|
+
const raw = await fileService.read("pos/manifest.json");
|
|
6496
|
+
if (!raw) return false;
|
|
6497
|
+
const manifest = JSON.parse(raw);
|
|
6498
|
+
if (!manifest.models || typeof manifest.models !== "object") {
|
|
6499
|
+
return false;
|
|
6500
|
+
}
|
|
6501
|
+
const modelEntries = Object.values(manifest.models);
|
|
6502
|
+
if (modelEntries.length === 0) return false;
|
|
6503
|
+
const firstModel = modelEntries[0];
|
|
6504
|
+
if (!firstModel.file) return false;
|
|
6505
|
+
const modelExists = await fileService.exists(firstModel.file);
|
|
6506
|
+
return modelExists;
|
|
6507
|
+
} catch {
|
|
6508
|
+
return false;
|
|
6509
|
+
}
|
|
6510
|
+
};
|
|
6511
|
+
async function initSnapshot(onProgress) {
|
|
6512
|
+
const ready = await isSnapshotReady();
|
|
6513
|
+
if (ready) {
|
|
6514
|
+
console.log("skip initialization.");
|
|
6515
|
+
return;
|
|
6516
|
+
}
|
|
6517
|
+
console.log("initializing from data.json...");
|
|
6518
|
+
const jsonData = await fetch("/data.json").then((r) => r.text());
|
|
6519
|
+
if (!jsonData) {
|
|
6520
|
+
console.error("cannot load data.json");
|
|
6521
|
+
return;
|
|
6522
|
+
}
|
|
6523
|
+
await import_snapshot_default({
|
|
6524
|
+
data: jsonData,
|
|
6525
|
+
onProgress
|
|
6526
|
+
});
|
|
6527
|
+
}
|
|
6528
|
+
|
|
6529
|
+
// src/services/filesystem-service/index.ts
|
|
6530
|
+
var useFileSystemService = () => {
|
|
6531
|
+
return {
|
|
6532
|
+
initSnapshot
|
|
6533
|
+
};
|
|
6534
|
+
};
|
|
6535
|
+
|
|
6169
6536
|
// src/hooks/auth/use-forgot-password.ts
|
|
6170
6537
|
var useForgotPassword = () => {
|
|
6171
6538
|
const { forgotPassword } = useAuthService();
|
|
@@ -8139,6 +8506,16 @@ var useUpdateOrderStatus = () => {
|
|
|
8139
8506
|
});
|
|
8140
8507
|
};
|
|
8141
8508
|
var use_update_order_status_default = useUpdateOrderStatus;
|
|
8509
|
+
|
|
8510
|
+
// src/hooks/pos/use-init-snapshot.ts
|
|
8511
|
+
import { useMutation as useMutation86 } from "@tanstack/react-query";
|
|
8512
|
+
var useInitSnapshot = () => {
|
|
8513
|
+
const fileSystem = useFileSystemService();
|
|
8514
|
+
return useMutation86({
|
|
8515
|
+
mutationFn: fileSystem.initSnapshot
|
|
8516
|
+
});
|
|
8517
|
+
};
|
|
8518
|
+
var use_init_snapshot_default = useInitSnapshot;
|
|
8142
8519
|
export {
|
|
8143
8520
|
use_add_entity_default as useAddEntity,
|
|
8144
8521
|
use_button_default as useButton,
|
|
@@ -8212,6 +8589,7 @@ export {
|
|
|
8212
8589
|
use_handle_close_session_default as useHandleCloseSession,
|
|
8213
8590
|
use_handle_closing_detail_session_default as useHandleClosingDetailSession,
|
|
8214
8591
|
use_handle_closing_session_default as useHandleClosingSession,
|
|
8592
|
+
use_init_snapshot_default as useInitSnapshot,
|
|
8215
8593
|
use_isvalid_token_default as useIsValidToken,
|
|
8216
8594
|
use_load_action_default as useLoadAction,
|
|
8217
8595
|
use_load_data_pos_session_default as useLoadDataPosSession,
|
package/dist/provider.d.mts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { L as LocalStorageUtilsType } from './local-storage-BPvoMGYJ.mjs';
|
|
4
|
-
import { useForgotPassword, useForgotPasswordSSO, useGetProvider, useIsValidToken, useLoginCredential, useLoginSocial, useResetPassword, useResetPasswordSSO, useUpdatePassword, useLogout, useGetAccessByCode, useValidateActionToken, useGetCompanyInfo, useGetCurrentCompany, useGetListCompany, useExecuteImport, useExportExcel, useGetFieldExport, useGetFileExcel, useParsePreview, useUploadFileExcel, useUploadIdFile, useChangeStatus, useDeleteComment, useGetComment, useGetFormView, useGetImage, useSendComment, useUploadImage, useDelete, useGetAll, useGetConversionRate, useGetCurrency, useGetDetail, useGetFieldOnChange, useGetListMyBankAccount, useModel, useOdooDataTransform, useOnChangeForm, useSave, useGetProfile, useGetUser, useSwitchLocale, useButton, useDuplicateRecord, useGet2FAMethods, useGetActionDetail, useGetCalendar, useGetGroups, useGetListData, useGetMenu, useGetPrintReport, useGetProGressBar, useGetResequence, useGetSelection, useGetView, useLoadAction, useLoadMessage, usePrint, useRemoveRow, useRunAction, useSignInSSO, useVerify2FA, useGrantAccess, useRemoveTotpSetup, useRequestSetupTotp, useSettingsWebRead2fa, useVerifyTotp, useUploadFile, useCreateEntity, useGetASession, useCreateSession, useDeleteEntity, useGetList, useGetPos, useHandleClosingSession, useManageSession, useUpdateClosedSession, useUpdateEntity, useLoadDataPosSession, useManageOnChange, useGenSerialNumber, useGetOrderLine, useGetProductImage, useAddEntity, useCheckPayment, useHandleCloseSession, useHandleClosingDetailSession, useCreatePosConfig, useSearchJournal, useGetTenantMapping, useGetToken, useGetPreparationDisplayData, useUpdateOrderStatus, useGetThreadData, useGetThreadMessages, useGetExternalTabs, useProcessOrder, useGeneratePaymentQrInfo, useSavePinCode, useGetPinCode, useReadGroup, useGetNotifications, useGetDataChart, useGetVersion, useCreateEInvoice, useGetCurrentUser, useGetWard, useGetCity, useGetCountry, useGetPartnerTitle, useChangeOrderPreparationState } from './hooks.mjs';
|
|
4
|
+
import { useForgotPassword, useForgotPasswordSSO, useGetProvider, useIsValidToken, useLoginCredential, useLoginSocial, useResetPassword, useResetPasswordSSO, useUpdatePassword, useLogout, useGetAccessByCode, useValidateActionToken, useGetCompanyInfo, useGetCurrentCompany, useGetListCompany, useExecuteImport, useExportExcel, useGetFieldExport, useGetFileExcel, useParsePreview, useUploadFileExcel, useUploadIdFile, useChangeStatus, useDeleteComment, useGetComment, useGetFormView, useGetImage, useSendComment, useUploadImage, useDelete, useGetAll, useGetConversionRate, useGetCurrency, useGetDetail, useGetFieldOnChange, useGetListMyBankAccount, useModel, useOdooDataTransform, useOnChangeForm, useSave, useGetProfile, useGetUser, useSwitchLocale, useButton, useDuplicateRecord, useGet2FAMethods, useGetActionDetail, useGetCalendar, useGetGroups, useGetListData, useGetMenu, useGetPrintReport, useGetProGressBar, useGetResequence, useGetSelection, useGetView, useLoadAction, useLoadMessage, usePrint, useRemoveRow, useRunAction, useSignInSSO, useVerify2FA, useGrantAccess, useRemoveTotpSetup, useRequestSetupTotp, useSettingsWebRead2fa, useVerifyTotp, useUploadFile, useCreateEntity, useGetASession, useCreateSession, useDeleteEntity, useGetList, useGetPos, useHandleClosingSession, useManageSession, useUpdateClosedSession, useUpdateEntity, useLoadDataPosSession, useManageOnChange, useGenSerialNumber, useGetOrderLine, useGetProductImage, useAddEntity, useCheckPayment, useHandleCloseSession, useHandleClosingDetailSession, useCreatePosConfig, useSearchJournal, useGetTenantMapping, useGetToken, useGetPreparationDisplayData, useUpdateOrderStatus, useGetThreadData, useGetThreadMessages, useGetExternalTabs, useProcessOrder, useGeneratePaymentQrInfo, useSavePinCode, useGetPinCode, useReadGroup, useGetNotifications, useGetDataChart, useGetVersion, useCreateEInvoice, useGetCurrentUser, useGetWard, useGetCity, useGetCountry, useGetPartnerTitle, useChangeOrderPreparationState, useInitSnapshot } from './hooks.mjs';
|
|
5
5
|
import '@tanstack/react-query';
|
|
6
6
|
import './view-type-CfcWWR0w.mjs';
|
|
7
7
|
import './base-model-type-DD8uZnDP.mjs';
|
|
8
8
|
import './models.mjs';
|
|
9
|
+
import './import-snapshot-Ds0gqFFm.mjs';
|
|
9
10
|
|
|
10
11
|
declare const MainProvider: ({ children }: {
|
|
11
12
|
children: ReactNode;
|
|
@@ -42,6 +43,7 @@ interface EnvConfig {
|
|
|
42
43
|
user?: any;
|
|
43
44
|
db?: string;
|
|
44
45
|
refreshTokenEndpoint?: string;
|
|
46
|
+
isLocalMode?: boolean;
|
|
45
47
|
localStorageUtils?: LocalStorageUtilsType;
|
|
46
48
|
sessionStorageUtils?: any;
|
|
47
49
|
envFile?: any;
|
|
@@ -179,6 +181,7 @@ interface ServiceContextType {
|
|
|
179
181
|
useGetCountry: typeof useGetCountry;
|
|
180
182
|
useGetPartnerTitle: typeof useGetPartnerTitle;
|
|
181
183
|
useChangeOrderPreparationState: typeof useChangeOrderPreparationState;
|
|
184
|
+
useInitSnapshot: typeof useInitSnapshot;
|
|
182
185
|
}
|
|
183
186
|
declare const ServiceProvider: ({ children, }: {
|
|
184
187
|
children: React.ReactNode;
|
package/dist/provider.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { L as LocalStorageUtilsType } from './local-storage-BPvoMGYJ.js';
|
|
4
|
-
import { useForgotPassword, useForgotPasswordSSO, useGetProvider, useIsValidToken, useLoginCredential, useLoginSocial, useResetPassword, useResetPasswordSSO, useUpdatePassword, useLogout, useGetAccessByCode, useValidateActionToken, useGetCompanyInfo, useGetCurrentCompany, useGetListCompany, useExecuteImport, useExportExcel, useGetFieldExport, useGetFileExcel, useParsePreview, useUploadFileExcel, useUploadIdFile, useChangeStatus, useDeleteComment, useGetComment, useGetFormView, useGetImage, useSendComment, useUploadImage, useDelete, useGetAll, useGetConversionRate, useGetCurrency, useGetDetail, useGetFieldOnChange, useGetListMyBankAccount, useModel, useOdooDataTransform, useOnChangeForm, useSave, useGetProfile, useGetUser, useSwitchLocale, useButton, useDuplicateRecord, useGet2FAMethods, useGetActionDetail, useGetCalendar, useGetGroups, useGetListData, useGetMenu, useGetPrintReport, useGetProGressBar, useGetResequence, useGetSelection, useGetView, useLoadAction, useLoadMessage, usePrint, useRemoveRow, useRunAction, useSignInSSO, useVerify2FA, useGrantAccess, useRemoveTotpSetup, useRequestSetupTotp, useSettingsWebRead2fa, useVerifyTotp, useUploadFile, useCreateEntity, useGetASession, useCreateSession, useDeleteEntity, useGetList, useGetPos, useHandleClosingSession, useManageSession, useUpdateClosedSession, useUpdateEntity, useLoadDataPosSession, useManageOnChange, useGenSerialNumber, useGetOrderLine, useGetProductImage, useAddEntity, useCheckPayment, useHandleCloseSession, useHandleClosingDetailSession, useCreatePosConfig, useSearchJournal, useGetTenantMapping, useGetToken, useGetPreparationDisplayData, useUpdateOrderStatus, useGetThreadData, useGetThreadMessages, useGetExternalTabs, useProcessOrder, useGeneratePaymentQrInfo, useSavePinCode, useGetPinCode, useReadGroup, useGetNotifications, useGetDataChart, useGetVersion, useCreateEInvoice, useGetCurrentUser, useGetWard, useGetCity, useGetCountry, useGetPartnerTitle, useChangeOrderPreparationState } from './hooks.js';
|
|
4
|
+
import { useForgotPassword, useForgotPasswordSSO, useGetProvider, useIsValidToken, useLoginCredential, useLoginSocial, useResetPassword, useResetPasswordSSO, useUpdatePassword, useLogout, useGetAccessByCode, useValidateActionToken, useGetCompanyInfo, useGetCurrentCompany, useGetListCompany, useExecuteImport, useExportExcel, useGetFieldExport, useGetFileExcel, useParsePreview, useUploadFileExcel, useUploadIdFile, useChangeStatus, useDeleteComment, useGetComment, useGetFormView, useGetImage, useSendComment, useUploadImage, useDelete, useGetAll, useGetConversionRate, useGetCurrency, useGetDetail, useGetFieldOnChange, useGetListMyBankAccount, useModel, useOdooDataTransform, useOnChangeForm, useSave, useGetProfile, useGetUser, useSwitchLocale, useButton, useDuplicateRecord, useGet2FAMethods, useGetActionDetail, useGetCalendar, useGetGroups, useGetListData, useGetMenu, useGetPrintReport, useGetProGressBar, useGetResequence, useGetSelection, useGetView, useLoadAction, useLoadMessage, usePrint, useRemoveRow, useRunAction, useSignInSSO, useVerify2FA, useGrantAccess, useRemoveTotpSetup, useRequestSetupTotp, useSettingsWebRead2fa, useVerifyTotp, useUploadFile, useCreateEntity, useGetASession, useCreateSession, useDeleteEntity, useGetList, useGetPos, useHandleClosingSession, useManageSession, useUpdateClosedSession, useUpdateEntity, useLoadDataPosSession, useManageOnChange, useGenSerialNumber, useGetOrderLine, useGetProductImage, useAddEntity, useCheckPayment, useHandleCloseSession, useHandleClosingDetailSession, useCreatePosConfig, useSearchJournal, useGetTenantMapping, useGetToken, useGetPreparationDisplayData, useUpdateOrderStatus, useGetThreadData, useGetThreadMessages, useGetExternalTabs, useProcessOrder, useGeneratePaymentQrInfo, useSavePinCode, useGetPinCode, useReadGroup, useGetNotifications, useGetDataChart, useGetVersion, useCreateEInvoice, useGetCurrentUser, useGetWard, useGetCity, useGetCountry, useGetPartnerTitle, useChangeOrderPreparationState, useInitSnapshot } from './hooks.js';
|
|
5
5
|
import '@tanstack/react-query';
|
|
6
6
|
import './view-type-CfcWWR0w.js';
|
|
7
7
|
import './base-model-type-DD8uZnDP.js';
|
|
8
8
|
import './models.js';
|
|
9
|
+
import './import-snapshot-Ds0gqFFm.js';
|
|
9
10
|
|
|
10
11
|
declare const MainProvider: ({ children }: {
|
|
11
12
|
children: ReactNode;
|
|
@@ -42,6 +43,7 @@ interface EnvConfig {
|
|
|
42
43
|
user?: any;
|
|
43
44
|
db?: string;
|
|
44
45
|
refreshTokenEndpoint?: string;
|
|
46
|
+
isLocalMode?: boolean;
|
|
45
47
|
localStorageUtils?: LocalStorageUtilsType;
|
|
46
48
|
sessionStorageUtils?: any;
|
|
47
49
|
envFile?: any;
|
|
@@ -179,6 +181,7 @@ interface ServiceContextType {
|
|
|
179
181
|
useGetCountry: typeof useGetCountry;
|
|
180
182
|
useGetPartnerTitle: typeof useGetPartnerTitle;
|
|
181
183
|
useChangeOrderPreparationState: typeof useChangeOrderPreparationState;
|
|
184
|
+
useInitSnapshot: typeof useInitSnapshot;
|
|
182
185
|
}
|
|
183
186
|
declare const ServiceProvider: ({ children, }: {
|
|
184
187
|
children: React.ReactNode;
|