@zyno-io/ts-server-foundation 26.1111.345 → 26.1111.744
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/src/app/base.d.ts.map +1 -1
- package/dist/src/app/base.js +2 -0
- package/dist/src/app/base.js.map +1 -1
- package/dist/src/database/mutation.js +2 -2
- package/dist/src/database/query.js +1 -1
- package/dist/src/di/container.js +1 -1
- package/dist/src/helpers/async/process.d.ts +5 -0
- package/dist/src/helpers/async/process.d.ts.map +1 -1
- package/dist/src/helpers/async/process.js +49 -5
- package/dist/src/helpers/async/process.js.map +1 -1
- package/dist/src/helpers/index.d.ts +1 -0
- package/dist/src/helpers/index.d.ts.map +1 -1
- package/dist/src/helpers/index.js +2 -1
- package/dist/src/helpers/index.js.map +1 -1
- package/dist/src/helpers/io/temporary-files.d.ts +47 -0
- package/dist/src/helpers/io/temporary-files.d.ts.map +1 -0
- package/dist/src/helpers/io/temporary-files.js +326 -0
- package/dist/src/helpers/io/temporary-files.js.map +1 -0
- package/dist/src/http/index.d.ts +1 -0
- package/dist/src/http/index.d.ts.map +1 -1
- package/dist/src/http/index.js +2 -1
- package/dist/src/http/index.js.map +1 -1
- package/dist/src/http/response.js +1 -1
- package/dist/src/http/router.js +1 -1
- package/dist/src/http/router.js.map +1 -1
- package/dist/src/http/temporary-workspace.d.ts +10 -0
- package/dist/src/http/temporary-workspace.d.ts.map +1 -0
- package/dist/src/http/temporary-workspace.js +52 -0
- package/dist/src/http/temporary-workspace.js.map +1 -0
- package/dist/src/http/uploads.d.ts +3 -0
- package/dist/src/http/uploads.d.ts.map +1 -1
- package/dist/src/http/uploads.js +20 -18
- package/dist/src/http/uploads.js.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/services/index.d.ts +1 -0
- package/dist/src/services/index.d.ts.map +1 -1
- package/dist/src/services/index.js +1 -0
- package/dist/src/services/index.js.map +1 -1
- package/dist/src/services/temporary-files.d.ts +9 -0
- package/dist/src/services/temporary-files.d.ts.map +1 -0
- package/dist/src/services/temporary-files.js +58 -0
- package/dist/src/services/temporary-files.js.map +1 -0
- package/docs/.vitepress/config.mts +1 -0
- package/docs/content/temporary-files.md +133 -0
- package/docs/content/uploads.md +4 -0
- package/package.json +2 -2
|
@@ -9,7 +9,7 @@ const sql_1 = require("./sql");
|
|
|
9
9
|
const entity_1 = require("./entity");
|
|
10
10
|
const metadata_1 = require("./metadata");
|
|
11
11
|
const values_1 = require("./values");
|
|
12
|
-
const __tsf_metadata_type = _a.createCompactMetadataRegistryV2("[2,[{\"kind\":18,\"typeName\":\"Record\",\"utilityType\":\"Record\",\"typeArguments\":[{\"kind\":6},{\"$tsfNode\":0}],\"index\":{\"$tsfNode\":0},\"types\":[],\"typeName\":\"FilterRecord\"},{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"keyof T\"},{\"kind\":6}]},{\"
|
|
12
|
+
const __tsf_metadata_type = _a.createCompactMetadataRegistryV2("[2,[{\"kind\":18,\"typeName\":\"Record\",\"utilityType\":\"Record\",\"typeArguments\":[{\"kind\":6},{\"$tsfNode\":0}],\"index\":{\"$tsfNode\":0},\"types\":[],\"typeName\":\"FilterRecord\"},{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"keyof T\"},{\"kind\":6}]},{\"$tsfNode\":0},{\"kind\":14,\"type\":{\"kind\":6}},{\"kind\":6},{\"$tsfNode\":1},{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":18,\"typeName\":\"Record\",\"utilityType\":\"Record\",\"typeArguments\":[{\"kind\":6},{\"$tsfNode\":1}],\"index\":{\"$tsfNode\":1},\"types\":[]}]},{\"kind\":7},{\"kind\":22,\"type\":{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"T\"}}},{\"kind\":2,\"typeName\":\"K\"},{\"kind\":22,\"type\":{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"T[K]\"}}},{\"kind\":22,\"type\":{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"T[K]\"},{\"kind\":4}]}},{\"kind\":22,\"type\":{\"kind\":2,\"typeName\":\"T[K]\"}},{\"kind\":22,\"type\":{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"T\"},{\"kind\":4}]}},{\"kind\":22,\"type\":{\"kind\":2,\"typeName\":\"T\"}},{\"kind\":22,\"type\":{\"kind\":8}},{\"kind\":22,\"type\":{\"kind\":7}},{\"kind\":18,\"typeName\":\"PatchRecord\\u003cT\\u003e\",\"index\":{\"kind\":1},\"types\":[]},{\"kind\":22,\"type\":{\"kind\":18,\"typeName\":\"QueryMutationResult\",\"types\":[{\"kind\":20,\"name\":\"affectedRows\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"modified\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"primaryKeys\",\"type\":{\"kind\":14,\"type\":{\"kind\":18,\"typeName\":\"Record\",\"utilityType\":\"Record\",\"typeArguments\":[{\"kind\":6},{\"kind\":2}],\"index\":{\"kind\":2},\"types\":[]}},\"optional\":false}]}},{\"kind\":18,\"typeName\":\"SqlQuery\",\"types\":[{\"kind\":20,\"name\":\"kind\",\"type\":{\"kind\":10,\"literal\":\"sql\"},\"optional\":false},{\"kind\":20,\"name\":\"chunks\",\"type\":{\"kind\":14,\"type\":{\"kind\":6}},\"optional\":false},{\"kind\":20,\"name\":\"values\",\"type\":{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"SqlValue\"}},\"optional\":false}]},{\"kind\":2,\"typeName\":\"EntityClass\",\"typeArguments\":[{\"kind\":2,\"typeName\":\"T\"}]}],[{\"kind\":12,\"types\":{\"$tsfNode\":2},\"typeName\":\"FilterValue\"},{\"kind\":12,\"types\":{\"$tsfNode\":3},\"typeName\":\"DirectionInput\"},[{\"kind\":2},{\"$tsfNode\":4}],[{\"$tsfNode\":5},{\"kind\":10,\"literal\":\"ASC\"},{\"kind\":10,\"literal\":\"DESC\"},{\"kind\":10,\"literal\":1},{\"kind\":10,\"literal\":-1}],{\"kind\":18,\"types\":{\"$tsfNode\":6}},{\"kind\":12,\"types\":[{\"kind\":10,\"literal\":\"asc\"},{\"kind\":10,\"literal\":\"desc\"}],\"typeName\":\"Direction\"},[{\"$tsfNode\":7},{\"$tsfNode\":8},{\"$tsfNode\":9},{\"$tsfNode\":10},{\"$tsfNode\":11},{\"$tsfNode\":12},{\"$tsfNode\":13},{\"$tsfNode\":14},{\"$tsfNode\":15}],{\"kind\":20,\"name\":\"$in\",\"type\":{\"$tsfNode\":16},\"optional\":true},{\"kind\":20,\"name\":\"$nin\",\"type\":{\"$tsfNode\":16},\"optional\":true},{\"kind\":20,\"name\":\"$ne\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"$gt\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"$gte\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"$lt\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"$lte\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"$like\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"$notLike\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2},{\"kind\":4}]},\"optional\":true},{\"kind\":12,\"types\":[{\"kind\":14,\"type\":{\"kind\":2}},{\"kind\":4}]}]]", []);
|
|
13
13
|
const MYSQL_OFFSET_ONLY_LIMIT = '18446744073709551615';
|
|
14
14
|
let _QueryBuilderMetadata_1;
|
|
15
15
|
class QueryBuilder {
|
package/dist/src/di/container.js
CHANGED
|
@@ -9,7 +9,7 @@ const types_1 = require("../types");
|
|
|
9
9
|
const errors_1 = require("./errors");
|
|
10
10
|
const provider_1 = require("./provider");
|
|
11
11
|
const module_1 = require("./module");
|
|
12
|
-
const __tsf_metadata_type = _a.createCompactMetadataRegistryV2("[2,[{\"kind\":2,\"typeName\":\"Token\",\"typeArguments\":[{\"kind\":2,\"typeName\":\"T\"}]},{\"kind\":2,\"typeName\":\"T\"},{\"kind\":2,\"typeName\":\"Token\"},{\"kind\":7},{\"kind\":8},{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"Token\"}},{\"kind\":2},{\"kind\":2,\"typeName\":\"ClassType\"},{\"kind\":14,\"type\":{\"kind\":18,\"types\":[{\"kind\":20,\"name\":\"token\",\"type\":{\"kind\":2,\"typeName\":\"Token\"},\"optional\":false},{\"kind\":20,\"name\":\"provider\",\"type\":{\"kind\":2,\"typeName\":\"Provider\"},\"optional\":false},{\"kind\":20,\"name\":\"moduleId\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"exported\",\"type\":{\"kind\":8},\"optional\":false}]}},{\"kind\":18,\"typeName\":\"ModuleDefinition\",\"types\":[{\"
|
|
12
|
+
const __tsf_metadata_type = _a.createCompactMetadataRegistryV2("[2,[{\"kind\":2,\"typeName\":\"Token\",\"typeArguments\":[{\"kind\":2,\"typeName\":\"T\"}]},{\"kind\":2,\"typeName\":\"T\"},{\"kind\":2,\"typeName\":\"Token\"},{\"kind\":7},{\"kind\":8},{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"Token\"}},{\"kind\":2},{\"kind\":2,\"typeName\":\"ClassType\"},{\"kind\":14,\"type\":{\"kind\":18,\"types\":[{\"kind\":20,\"name\":\"token\",\"type\":{\"kind\":2,\"typeName\":\"Token\"},\"optional\":false},{\"kind\":20,\"name\":\"provider\",\"type\":{\"kind\":2,\"typeName\":\"Provider\"},\"optional\":false},{\"kind\":20,\"name\":\"moduleId\",\"type\":{\"kind\":7},\"optional\":false},{\"kind\":20,\"name\":\"exported\",\"type\":{\"kind\":8},\"optional\":false}]}},{\"kind\":18,\"typeName\":\"ModuleDefinition\",\"types\":[{\"kind\":20,\"name\":\"config\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"new (...args: any[]) =\\u003e C\",\"typeName\":\"ClassType\"},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"defaultConfig\",\"type\":{\"kind\":12,\"types\":[{\"kind\":18,\"typeName\":\"Partial\",\"utilityType\":\"Partial\",\"typeArguments\":[{\"kind\":2,\"typeName\":\"C\"}],\"utilityKeys\":[],\"types\":[]},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"imports\",\"type\":{\"kind\":12,\"types\":[{\"kind\":14,\"type\":{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"ModuleDefinition\"},{\"kind\":2,\"typeName\":\"ClassType\"},{\"kind\":18,\"typeName\":\"ModuleInstance\",\"types\":[{\"kind\":20,\"name\":\"definition\",\"type\":{\"kind\":2,\"typeName\":\"ModuleDefinition\"},\"optional\":false}]}],\"typeName\":\"ModuleLike\"}},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"exports\",\"type\":{\"kind\":12,\"types\":[{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"Token\"}},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"providers\",\"type\":{\"kind\":12,\"types\":[{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"Provider\"}},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"controllers\",\"type\":{\"$tsfNode\":0},\"optional\":true},{\"kind\":20,\"name\":\"listeners\",\"type\":{\"$tsfNode\":0},\"optional\":true},{\"kind\":20,\"name\":\"commands\",\"type\":{\"$tsfNode\":0},\"optional\":true}],\"typeParameters\":[\"C\"]}],[{\"kind\":12,\"types\":{\"$tsfNode\":1}},[{\"kind\":14,\"type\":{\"kind\":2,\"typeName\":\"ClassType\"}},{\"kind\":4}]]]", []);
|
|
13
13
|
let _ContainerMetadata_1;
|
|
14
14
|
class Container {
|
|
15
15
|
modules = [];
|
|
@@ -6,6 +6,11 @@ export interface ExecProcessOptions {
|
|
|
6
6
|
onSpawn?: (proc: ChildProcess) => void;
|
|
7
7
|
shell?: boolean;
|
|
8
8
|
env?: NodeJS.ProcessEnv;
|
|
9
|
+
/** Abort waits for the child to close before rejecting, so callers can safely dispose its files. */
|
|
10
|
+
signal?: AbortSignal;
|
|
11
|
+
timeoutMs?: number;
|
|
12
|
+
/** Escalate an uncooperative direct child from SIGTERM to SIGKILL. */
|
|
13
|
+
killGraceMs?: number;
|
|
9
14
|
}
|
|
10
15
|
export interface ExecProcessResult {
|
|
11
16
|
code: number | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../../../src/helpers/async/process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIjF,MAAM,WAAW,kBAAkB;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../../../src/helpers/async/process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIjF,MAAM,WAAW,kBAAkB;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,oGAAoG;IACpG,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,SAAS,MAAM,EAAO,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAwFzI"}
|
|
@@ -7,6 +7,17 @@ const _a = tslib_1.__importStar(require("@zyno-io/ts-reflection/type-metadata-ru
|
|
|
7
7
|
const node_child_process_1 = require("node:child_process");
|
|
8
8
|
const error_1 = require("../utils/error");
|
|
9
9
|
async function execProcess(cmd, args = [], options = {}) {
|
|
10
|
+
if (options.timeoutMs !== undefined &&
|
|
11
|
+
(!Number.isSafeInteger(options.timeoutMs) || options.timeoutMs <= 0 || options.timeoutMs > 2_147_483_647)) {
|
|
12
|
+
throw new Error('Process timeout must be a positive timer duration');
|
|
13
|
+
}
|
|
14
|
+
const graceMs = options.killGraceMs ?? 1000;
|
|
15
|
+
if (!Number.isSafeInteger(graceMs) || graceMs < 0 || graceMs > 2_147_483_647)
|
|
16
|
+
throw new Error('Invalid process kill grace period');
|
|
17
|
+
const deadline = options.timeoutMs === undefined ? undefined : AbortSignal.timeout(options.timeoutMs);
|
|
18
|
+
const signal = options.signal && deadline ? AbortSignal.any([options.signal, deadline]) : (options.signal ?? deadline);
|
|
19
|
+
if (signal?.aborted)
|
|
20
|
+
throw processAbortError(signal.reason);
|
|
10
21
|
try {
|
|
11
22
|
return await new Promise((resolve, reject) => {
|
|
12
23
|
const stdout = [];
|
|
@@ -18,27 +29,55 @@ async function execProcess(cmd, args = [], options = {}) {
|
|
|
18
29
|
env: options.env
|
|
19
30
|
});
|
|
20
31
|
let settled = false;
|
|
32
|
+
let failure;
|
|
33
|
+
let abortError;
|
|
34
|
+
let killTimer;
|
|
21
35
|
const settle = (callback) => {
|
|
22
36
|
if (settled)
|
|
23
37
|
return;
|
|
24
38
|
settled = true;
|
|
39
|
+
signal?.removeEventListener('abort', abort);
|
|
40
|
+
clearTimeout(killTimer);
|
|
25
41
|
callback();
|
|
26
42
|
};
|
|
27
|
-
|
|
43
|
+
const terminate = () => {
|
|
44
|
+
if (proc.exitCode !== null || proc.signalCode !== null)
|
|
45
|
+
return;
|
|
46
|
+
proc.kill('SIGTERM');
|
|
47
|
+
killTimer ??= setTimeout(() => {
|
|
48
|
+
if (proc.exitCode === null && proc.signalCode === null)
|
|
49
|
+
proc.kill('SIGKILL');
|
|
50
|
+
}, graceMs);
|
|
51
|
+
killTimer.unref();
|
|
52
|
+
};
|
|
53
|
+
const abort = () => {
|
|
54
|
+
abortError ??= processAbortError(signal?.reason);
|
|
55
|
+
terminate();
|
|
56
|
+
};
|
|
57
|
+
signal?.addEventListener('abort', abort, { once: true });
|
|
58
|
+
if (signal?.aborted)
|
|
59
|
+
abort();
|
|
60
|
+
// Spawn failures and aborts still emit close. Do not release a caller's scope before that boundary.
|
|
61
|
+
proc.on('error', error => {
|
|
62
|
+
failure ??= error;
|
|
63
|
+
});
|
|
28
64
|
proc.on('spawn', () => {
|
|
29
65
|
try {
|
|
30
66
|
options.onSpawn?.(proc);
|
|
31
67
|
}
|
|
32
68
|
catch (error) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
settle(() => reject(error));
|
|
69
|
+
failure ??= error;
|
|
70
|
+
terminate();
|
|
36
71
|
}
|
|
37
72
|
});
|
|
38
73
|
proc.stdout?.on('data', data => stdout.push(Buffer.from(data)));
|
|
39
74
|
proc.stderr?.on('data', data => stderr.push(Buffer.from(data)));
|
|
40
75
|
proc.on('close', code => {
|
|
41
76
|
settle(() => {
|
|
77
|
+
if (abortError || failure) {
|
|
78
|
+
reject(abortError ?? failure);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
42
81
|
const result = {
|
|
43
82
|
code,
|
|
44
83
|
stdout: Buffer.concat(stdout),
|
|
@@ -54,11 +93,16 @@ async function execProcess(cmd, args = [], options = {}) {
|
|
|
54
93
|
});
|
|
55
94
|
}
|
|
56
95
|
catch (error) {
|
|
96
|
+
if (error instanceof Error && error.name === 'AbortError')
|
|
97
|
+
throw error;
|
|
57
98
|
throw (0, error_1.toError)(`Failure during execution of process with command: ${formatCommand(cmd, args)}`, error);
|
|
58
99
|
}
|
|
59
100
|
}
|
|
101
|
+
function processAbortError(reason) {
|
|
102
|
+
return Object.assign(new Error('Process aborted', { cause: reason }), { name: 'AbortError' });
|
|
103
|
+
}
|
|
60
104
|
function formatCommand(cmd, args) {
|
|
61
105
|
return [cmd, ...args.map(arg => (arg.includes(' ') ? `"${arg}"` : arg))].join(' ');
|
|
62
106
|
}
|
|
63
|
-
exports.__tsfTypeAliases = _a.decodeCompactMetadataV2("[2,{\"ExecProcessOptions\":{\"kind\":18,\"typeName\":\"ExecProcessOptions\",\"types\":[{\"kind\":20,\"name\":\"cwd\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"errorOnNonZero\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"stdio\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"SpawnOptions['stdio']\"},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"onSpawn\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"(proc: ChildProcess) =\\u003e void\"},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"shell\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"env\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"NodeJS.ProcessEnv\",\"classType\":{\"$tsf\":0}},{\"kind\":4}]},\"optional\":true}]},\"ExecProcessResult\":{\"kind\":18,\"typeName\":\"ExecProcessResult\",\"types\":[{\"kind\":20,\"name\":\"code\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":5}]},\"optional\":false},{\"kind\":20,\"name\":\"stdout\",\"type\":{\"$tsfNode\":0},\"optional\":false},{\"kind\":20,\"name\":\"stderr\",\"type\":{\"$tsfNode\":0},\"optional\":false}]}},[{\"kind\":16,\"typeName\":\"Buffer\",\"classType\":{\"$tsf\":
|
|
107
|
+
exports.__tsfTypeAliases = _a.decodeCompactMetadataV2("[2,{\"ExecProcessOptions\":{\"kind\":18,\"typeName\":\"ExecProcessOptions\",\"types\":[{\"kind\":20,\"name\":\"cwd\",\"type\":{\"kind\":12,\"types\":[{\"kind\":6},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"errorOnNonZero\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"stdio\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"SpawnOptions['stdio']\"},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"onSpawn\",\"type\":{\"kind\":12,\"types\":[{\"kind\":2,\"typeName\":\"(proc: ChildProcess) =\\u003e void\"},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"shell\",\"type\":{\"kind\":12,\"types\":[{\"kind\":8},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"env\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"NodeJS.ProcessEnv\",\"classType\":{\"$tsf\":0}},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"signal\",\"type\":{\"kind\":12,\"types\":[{\"kind\":16,\"typeName\":\"AbortSignal\",\"classType\":{\"$tsf\":1}},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"timeoutMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true},{\"kind\":20,\"name\":\"killGraceMs\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":4}]},\"optional\":true}]},\"ExecProcessResult\":{\"kind\":18,\"typeName\":\"ExecProcessResult\",\"types\":[{\"kind\":20,\"name\":\"code\",\"type\":{\"kind\":12,\"types\":[{\"kind\":7},{\"kind\":5}]},\"optional\":false},{\"kind\":20,\"name\":\"stdout\",\"type\":{\"$tsfNode\":0},\"optional\":false},{\"kind\":20,\"name\":\"stderr\",\"type\":{\"$tsfNode\":0},\"optional\":false}]}},[{\"kind\":16,\"typeName\":\"Buffer\",\"classType\":{\"$tsf\":2}}]]", [() => NodeJS.ProcessEnv, () => (typeof AbortSignal !== "undefined" ? AbortSignal : (typeof exports !== "undefined" ? exports.AbortSignal : undefined)), () => (typeof Buffer !== "undefined" ? Buffer : (typeof exports !== "undefined" ? exports.Buffer : undefined))]);
|
|
64
108
|
//# sourceMappingURL=process.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../../../src/helpers/async/process.ts"],"names":[],"mappings":";;;;;;AAAA,2DAAiF;AAEjF,0CAAyC;
|
|
1
|
+
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../../../src/helpers/async/process.ts"],"names":[],"mappings":";;;;;;AAAA,2DAAiF;AAEjF,0CAAyC;AAsBlC,KAAK,sBAAsB,GAAW,EAAE,IAAI,GAAsB,EAAE,EAAE,OAAO,GAAuB,EAAE;IACzG,IACI,OAAO,CAAC,SAAS,KAAK,SAAS;QAC/B,CAAC,CAAC,MAAM,CAAC,aAAa,CAA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AO,CAAC,MAAM,CAAC,CAAC;gBACpB,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY;YAAE,MAAM,KAAK,CAAC;QACvE,MAAM,IAAA,eAAO,EAAC,qDAAqD,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC1G,CAAC;AACL,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAe;IACtC,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,iBAAiB,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;AAClG,CAAC;AAED,SAAS,aAAa,CAAC,GAAW,EAAE,IAAuB;IACvD,OAAO,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACvF,CAAC"}
|
|
@@ -8,6 +8,7 @@ export * from './data/serialization';
|
|
|
8
8
|
export * from './data/transformer';
|
|
9
9
|
export * from './io/package';
|
|
10
10
|
export * from './io/stream';
|
|
11
|
+
export * from './io/temporary-files';
|
|
11
12
|
export * from './redis/availability';
|
|
12
13
|
export * from './redis/cache';
|
|
13
14
|
export * from './redis/broadcast';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,c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B,CAAC;AAClC,OAAO,EACH,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,SAAS,EACT,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,QAAQ,IAAI,cAAc,EAC/B,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EAC1B,MAAM,eAAe,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/D,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC"}
|
|
@@ -13,6 +13,7 @@ tslib_1.__exportStar(require("./data/serialization"), exports);
|
|
|
13
13
|
tslib_1.__exportStar(require("./data/transformer"), exports);
|
|
14
14
|
tslib_1.__exportStar(require("./io/package"), exports);
|
|
15
15
|
tslib_1.__exportStar(require("./io/stream"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./io/temporary-files"), exports);
|
|
16
17
|
tslib_1.__exportStar(require("./redis/availability"), exports);
|
|
17
18
|
tslib_1.__exportStar(require("./redis/cache"), exports);
|
|
18
19
|
tslib_1.__exportStar(require("./redis/broadcast"), exports);
|
|
@@ -32,5 +33,5 @@ tslib_1.__exportStar(require("./utils/date"), exports);
|
|
|
32
33
|
tslib_1.__exportStar(require("./utils/error"), exports);
|
|
33
34
|
tslib_1.__exportStar(require("./utils/timer"), exports);
|
|
34
35
|
tslib_1.__exportStar(require("./utils/uuid"), exports);
|
|
35
|
-
exports.__tsfTypeAliases = _a.decodeCompactMetadataV2("[2,{\"AvailabilityLogger\":{\"$tsfAlias\":[0,\"./availability.js\",\"AvailabilityLogger\",\"AvailabilityLogger\"]},\"AvailabilityMonitor\":{\"$tsfAlias\":[0,\"./availability.js\",\"AvailabilityMonitor\",\"AvailabilityMonitor\"]},\"AvailabilityMonitorOptions\":{\"$tsfAlias\":[0,\"./availability.js\",\"AvailabilityMonitorOptions\",\"AvailabilityMonitorOptions\"]},\"CacheRedisClient\":{\"$tsfAlias\":[0,\"./redis/cache.js\",\"CacheRedisClient\",\"CacheRedisClient\"]},\"CacheRedisProvider\":{\"$tsfAlias\":[0,\"./redis/cache.js\",\"CacheRedisProvider\",\"CacheRedisProvider\"]},\"CryptoOptions\":{\"$tsfAlias\":[0,\"./security/crypto.js\",\"CryptoOptions\",\"CryptoOptions\"]},\"DecoratedError\":{\"$tsfAlias\":[0,\"./utils/error.js\",\"DecoratedError\",\"DecoratedError\"]},\"ExecProcessOptions\":{\"$tsfAlias\":[0,\"./async/process.js\",\"ExecProcessOptions\",\"ExecProcessOptions\"]},\"ExecProcessResult\":{\"$tsfAlias\":[0,\"./async/process.js\",\"ExecProcessResult\",\"ExecProcessResult\"]},\"HelperMutexKey\":{\"$tsfAlias\":[0,\"./redis/mutex.js\",\"MutexKey\",\"HelperMutexKey\"]},\"IErrorContext\":{\"$tsfAlias\":[0,\"./utils/error.js\",\"IErrorContext\",\"IErrorContext\"]},\"MutexContext\":{\"$tsfAlias\":[0,\"./redis/mutex.js\",\"MutexContext\",\"MutexContext\"]},\"MutexObservation\":{\"$tsfAlias\":[0,\"./redis/mutex.js\",\"MutexObservation\",\"MutexObservation\"]},\"MutexObserver\":{\"$tsfAlias\":[0,\"./redis/mutex.js\",\"MutexObserver\",\"MutexObserver\"]},\"MutexOptions\":{\"$tsfAlias\":[0,\"./redis/mutex.js\",\"MutexOptions\",\"MutexOptions\"]},\"PackageJson\":{\"$tsfAlias\":[0,\"./io/package.js\",\"PackageJson\",\"PackageJson\"]},\"RedisAvailabilityClient\":{\"$tsfAlias\":[0,\"./redis/availability.js\",\"RedisAvailabilityClient\",\"RedisAvailabilityClient\"]},\"RedisAvailabilityMonitor\":{\"$tsfAlias\":[0,\"./redis/availability.js\",\"RedisAvailabilityMonitor\",\"RedisAvailabilityMonitor\"]},\"RedisAvailabilityMonitorOptions\":{\"$tsfAlias\":[0,\"./redis/availability.js\",\"RedisAvailabilityMonitorOptions\",\"RedisAvailabilityMonitorOptions\"]},\"RedisConnection\":{\"$tsfAlias\":[0,\"./redis/redis.js\",\"RedisConnection\",\"RedisConnection\"]},\"RedisMutexClient\":{\"$tsfAlias\":[0,\"./redis/mutex.js\",\"RedisMutexClient\",\"RedisMutexClient\"]},\"RedisMutexProvider\":{\"$tsfAlias\":[0,\"./redis/mutex.js\",\"RedisMutexProvider\",\"RedisMutexProvider\"]},\"Semaphore\":{\"$tsfAlias\":[0,\"./async/promise.js\",\"Semaphore\",\"Semaphore\"]},\"SimpleStore\":{\"$tsfAlias\":[0,\"./async/context.js\",\"SimpleStore\",\"SimpleStore\"]}},[]]", [require]);
|
|
36
|
+
exports.__tsfTypeAliases = _a.decodeCompactMetadataV2("[2,{\"AvailabilityLogger\":{\"$tsfAlias\":[0,\"./availability.js\",\"AvailabilityLogger\",\"AvailabilityLogger\"]},\"AvailabilityMonitor\":{\"$tsfAlias\":[0,\"./availability.js\",\"AvailabilityMonitor\",\"AvailabilityMonitor\"]},\"AvailabilityMonitorOptions\":{\"$tsfAlias\":[0,\"./availability.js\",\"AvailabilityMonitorOptions\",\"AvailabilityMonitorOptions\"]},\"CacheRedisClient\":{\"$tsfAlias\":[0,\"./redis/cache.js\",\"CacheRedisClient\",\"CacheRedisClient\"]},\"CacheRedisProvider\":{\"$tsfAlias\":[0,\"./redis/cache.js\",\"CacheRedisProvider\",\"CacheRedisProvider\"]},\"CryptoOptions\":{\"$tsfAlias\":[0,\"./security/crypto.js\",\"CryptoOptions\",\"CryptoOptions\"]},\"DecoratedError\":{\"$tsfAlias\":[0,\"./utils/error.js\",\"DecoratedError\",\"DecoratedError\"]},\"ExecProcessOptions\":{\"$tsfAlias\":[0,\"./async/process.js\",\"ExecProcessOptions\",\"ExecProcessOptions\"]},\"ExecProcessResult\":{\"$tsfAlias\":[0,\"./async/process.js\",\"ExecProcessResult\",\"ExecProcessResult\"]},\"HelperMutexKey\":{\"$tsfAlias\":[0,\"./redis/mutex.js\",\"MutexKey\",\"HelperMutexKey\"]},\"IErrorContext\":{\"$tsfAlias\":[0,\"./utils/error.js\",\"IErrorContext\",\"IErrorContext\"]},\"MutexContext\":{\"$tsfAlias\":[0,\"./redis/mutex.js\",\"MutexContext\",\"MutexContext\"]},\"MutexObservation\":{\"$tsfAlias\":[0,\"./redis/mutex.js\",\"MutexObservation\",\"MutexObservation\"]},\"MutexObserver\":{\"$tsfAlias\":[0,\"./redis/mutex.js\",\"MutexObserver\",\"MutexObserver\"]},\"MutexOptions\":{\"$tsfAlias\":[0,\"./redis/mutex.js\",\"MutexOptions\",\"MutexOptions\"]},\"PackageJson\":{\"$tsfAlias\":[0,\"./io/package.js\",\"PackageJson\",\"PackageJson\"]},\"RedisAvailabilityClient\":{\"$tsfAlias\":[0,\"./redis/availability.js\",\"RedisAvailabilityClient\",\"RedisAvailabilityClient\"]},\"RedisAvailabilityMonitor\":{\"$tsfAlias\":[0,\"./redis/availability.js\",\"RedisAvailabilityMonitor\",\"RedisAvailabilityMonitor\"]},\"RedisAvailabilityMonitorOptions\":{\"$tsfAlias\":[0,\"./redis/availability.js\",\"RedisAvailabilityMonitorOptions\",\"RedisAvailabilityMonitorOptions\"]},\"RedisConnection\":{\"$tsfAlias\":[0,\"./redis/redis.js\",\"RedisConnection\",\"RedisConnection\"]},\"RedisMutexClient\":{\"$tsfAlias\":[0,\"./redis/mutex.js\",\"RedisMutexClient\",\"RedisMutexClient\"]},\"RedisMutexProvider\":{\"$tsfAlias\":[0,\"./redis/mutex.js\",\"RedisMutexProvider\",\"RedisMutexProvider\"]},\"Semaphore\":{\"$tsfAlias\":[0,\"./async/promise.js\",\"Semaphore\",\"Semaphore\"]},\"SimpleStore\":{\"$tsfAlias\":[0,\"./async/context.js\",\"SimpleStore\",\"SimpleStore\"]},\"TemporaryFileCleanupResult\":{\"$tsfAlias\":[0,\"./io/temporary-files.js\",\"TemporaryFileCleanupResult\",\"TemporaryFileCleanupResult\"]},\"TemporaryWorkspaceOptions\":{\"$tsfAlias\":[0,\"./io/temporary-files.js\",\"TemporaryWorkspaceOptions\",\"TemporaryWorkspaceOptions\"]}},[]]", [require]);
|
|
36
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/index.ts"],"names":[],"mappings":";;;;;AAAA,yDAA+B;AAC/B,0DAAgC;AAChC,0DAAgC;AAChC,0DAAgC;AAChC,uDAA6B;AAC7B,yDAA+B;AAC/B,+DAAqC;AACrC,6DAAmC;AACnC,uDAA6B;AAC7B,sDAA4B;AAC5B,+DAAqC;AACrC,wDAA8B;AAC9B,4DAAkC;AAClC,uCAeuB;AAdnB,wGAAA,eAAe,OAAA;AACf,8GAAA,qBAAqB,OAAA;AACrB,8GAAA,qBAAqB,OAAA;AACrB,kHAAA,yBAAyB,OAAA;AACzB,kGAAA,SAAS,OAAA;AACT,oGAAA,WAAW,OAAA;AAUf,wDAA8B;AAC9B,6CAA+D;AAAtD,uHAAA,2BAA2B,OAAA;AACpC,4DAAkC;AAClC,gEAAsC;AACtC,uDAA6B;AAC7B,wDAA8B;AAC9B,wDAA8B;AAC9B,uDAA6B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/index.ts"],"names":[],"mappings":";;;;;AAAA,yDAA+B;AAC/B,0DAAgC;AAChC,0DAAgC;AAChC,0DAAgC;AAChC,uDAA6B;AAC7B,yDAA+B;AAC/B,+DAAqC;AACrC,6DAAmC;AACnC,uDAA6B;AAC7B,sDAA4B;AAC5B,+DAAqC;AACrC,+DAAqC;AACrC,wDAA8B;AAC9B,4DAAkC;AAClC,uCAeuB;AAdnB,wGAAA,eAAe,OAAA;AACf,8GAAA,qBAAqB,OAAA;AACrB,8GAAA,qBAAqB,OAAA;AACrB,kHAAA,yBAAyB,OAAA;AACzB,kGAAA,SAAS,OAAA;AACT,oGAAA,WAAW,OAAA;AAUf,wDAA8B;AAC9B,6CAA+D;AAAtD,uHAAA,2BAA2B,OAAA;AACpC,4DAAkC;AAClC,gEAAsC;AACtC,uDAA6B;AAC7B,wDAA8B;AAC9B,wDAA8B;AAC9B,uDAA6B"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Readable } from 'node:stream';
|
|
2
|
+
export interface TemporaryWorkspaceOptions {
|
|
3
|
+
/** Only opt in when a retained source permits replay after the creating process exits. */
|
|
4
|
+
replayable?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface TemporaryFileCleanupResult {
|
|
7
|
+
scanned: number;
|
|
8
|
+
removed: number;
|
|
9
|
+
retained: number;
|
|
10
|
+
failed: number;
|
|
11
|
+
}
|
|
12
|
+
/** Owns every generated file within a private directory. Dispose only after its users have settled. */
|
|
13
|
+
export declare class TemporaryWorkspace {
|
|
14
|
+
readonly directory: string;
|
|
15
|
+
private readonly files;
|
|
16
|
+
constructor(directory: string, files: TemporaryFiles);
|
|
17
|
+
/** Allocate a name before starting a writer; the writer may require a nonexistent output file. */
|
|
18
|
+
path(name?: string): string;
|
|
19
|
+
setReplayable(): Promise<void>;
|
|
20
|
+
dispose(): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
/** Process-local staging, never durable storage. Unknown and potentially sole-copy leftovers fail closed. */
|
|
23
|
+
export declare class TemporaryFiles {
|
|
24
|
+
private readonly root;
|
|
25
|
+
private directory?;
|
|
26
|
+
private sweeping?;
|
|
27
|
+
constructor(root?: string);
|
|
28
|
+
createWorkspace(options?: TemporaryWorkspaceOptions): Promise<TemporaryWorkspace>;
|
|
29
|
+
private allocateWorkspace;
|
|
30
|
+
withWorkspace<T>(fn: (workspace: TemporaryWorkspace) => Promise<T>, options?: TemporaryWorkspaceOptions): Promise<T>;
|
|
31
|
+
/** A reserved single-file workspace. Successful return transfers its lifetime to the caller. */
|
|
32
|
+
create(replayable?: boolean): Promise<string>;
|
|
33
|
+
/** Both pipeline ends settle before a failed/aborted partial output is released. */
|
|
34
|
+
fromStream(source: Readable, replayable?: boolean, signal?: AbortSignal): Promise<string>;
|
|
35
|
+
/** Explicit release by the caller, never a filename/age-based ownership inference. */
|
|
36
|
+
remove(path: string): Promise<void>;
|
|
37
|
+
releaseWorkspace(directory: string): Promise<void>;
|
|
38
|
+
markReplayable(directory: string): Promise<void>;
|
|
39
|
+
sweep(): Promise<TemporaryFileCleanupResult>;
|
|
40
|
+
close(): Promise<void>;
|
|
41
|
+
private ownsDirectory;
|
|
42
|
+
private sweepBatch;
|
|
43
|
+
private recoverableFiles;
|
|
44
|
+
}
|
|
45
|
+
export declare const temporaryFiles: TemporaryFiles;
|
|
46
|
+
export declare function withTemporaryWorkspace<T>(fn: (workspace: TemporaryWorkspace) => Promise<T>, options?: TemporaryWorkspaceOptions): Promise<T>;
|
|
47
|
+
//# sourceMappingURL=temporary-files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"temporary-files.d.ts","sourceRoot":"","sources":["../../../../src/helpers/io/temporary-files.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAa5C,MAAM,WAAW,yBAAyB;IACtC,0FAA0F;IAC1F,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,0BAA0B;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAClB;AAaD,uGAAuG;AACvG,qBAAa,kBAAkB;IAEvB,QAAQ,CAAC,SAAS,EAAE,MAAM;IAC1B,OAAO,CAAC,QAAQ,CAAC,KAAK;IAF1B,YACa,SAAS,EAAE,MAAM,EACT,KAAK,EAAE,cAAc,EACtC;IAEJ,kGAAkG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