@tsplc/build 0.5.10 → 0.5.13
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/cli.js +18 -9
- package/dist/cli.js.map +6 -6
- package/dist/index.js +26 -16
- package/dist/index.js.map +6 -6
- package/package.json +4 -4
- package/python/codesys_login.py +3 -2
- package/src/controller-online.ts +41 -10
- package/src/controller-protocol.ts +28 -12
- package/src/controller-session.ts +117 -14
- package/src/index.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -1068,13 +1068,24 @@ var controllerCredentialsSchema = z6.strictObject({
|
|
|
1068
1068
|
username: z6.string().nonempty(),
|
|
1069
1069
|
password: z6.string().nonempty()
|
|
1070
1070
|
});
|
|
1071
|
-
var
|
|
1072
|
-
|
|
1071
|
+
var resetKindSchema = z6.enum(["Warm", "Cold"]);
|
|
1072
|
+
var warmRequest = {
|
|
1073
1073
|
operationId: z6.uuid(),
|
|
1074
1074
|
request: z6.string().nonempty(),
|
|
1075
|
-
initializeUser: z6.boolean(),
|
|
1076
1075
|
credentials: controllerCredentialsSchema.optional()
|
|
1077
|
-
}
|
|
1076
|
+
};
|
|
1077
|
+
var warmOperationSchema = z6.discriminatedUnion("operation", [
|
|
1078
|
+
z6.strictObject({
|
|
1079
|
+
operation: z6.enum(["download", "online-change", "review"]),
|
|
1080
|
+
...warmRequest,
|
|
1081
|
+
initializeUser: z6.boolean()
|
|
1082
|
+
}),
|
|
1083
|
+
z6.strictObject({
|
|
1084
|
+
operation: z6.literal("restart"),
|
|
1085
|
+
...warmRequest,
|
|
1086
|
+
reset: resetKindSchema
|
|
1087
|
+
})
|
|
1088
|
+
]);
|
|
1078
1089
|
var tracebackFailure = (traceback) => {
|
|
1079
1090
|
const text = traceback.trim();
|
|
1080
1091
|
const lastFrame = text.lastIndexOf(`
|
|
@@ -1111,6 +1122,7 @@ class DownloadRequiredError extends Error {
|
|
|
1111
1122
|
this.messages = options.messages ?? [];
|
|
1112
1123
|
}
|
|
1113
1124
|
}
|
|
1125
|
+
var restartReplySchema = z6.strictObject({ state: z6.string() });
|
|
1114
1126
|
var reviewReplySchema = z6.strictObject({
|
|
1115
1127
|
findings: z6.array(onlineChangeFindingSchema)
|
|
1116
1128
|
});
|
|
@@ -1151,10 +1163,7 @@ var loginCommandSchema = z6.discriminatedUnion("command", [
|
|
|
1151
1163
|
restore: z6.boolean()
|
|
1152
1164
|
}),
|
|
1153
1165
|
z6.strictObject({ command: z6.enum(["start", "stop"]) }),
|
|
1154
|
-
z6.strictObject({
|
|
1155
|
-
command: z6.literal("reset"),
|
|
1156
|
-
kind: z6.enum(["Warm", "Cold"])
|
|
1157
|
-
})
|
|
1166
|
+
z6.strictObject({ command: z6.literal("reset"), kind: resetKindSchema })
|
|
1158
1167
|
]);
|
|
1159
1168
|
var loginResultSchema = z6.union([
|
|
1160
1169
|
z6.strictObject({ values: z6.record(z6.string(), z6.string()) }),
|
|
@@ -2085,10 +2094,9 @@ var warmOperation = async (config, name, operation, options) => {
|
|
|
2085
2094
|
const stopFollowing = options.onProgress ? followProgress(jobProgressLog(config.outDir, operationId), options.onProgress) : async () => {};
|
|
2086
2095
|
try {
|
|
2087
2096
|
const result = await callContainer(name, warmPort, "POST", {
|
|
2088
|
-
operation,
|
|
2097
|
+
...operation,
|
|
2089
2098
|
operationId,
|
|
2090
2099
|
request,
|
|
2091
|
-
initializeUser: options.initializeUser,
|
|
2092
2100
|
credentials: options.credentials
|
|
2093
2101
|
}).catch((error) => {
|
|
2094
2102
|
const message = `${failureReason(error)}. Inspect ${diagnostics} for diagnostics`;
|
|
@@ -2110,10 +2118,7 @@ var warmOperation = async (config, name, operation, options) => {
|
|
|
2110
2118
|
};
|
|
2111
2119
|
var reviewWarmController = async (config, name, options) => {
|
|
2112
2120
|
try {
|
|
2113
|
-
const { result } = await warmOperation(config, name, "review",
|
|
2114
|
-
...options,
|
|
2115
|
-
initializeUser: false
|
|
2116
|
-
});
|
|
2121
|
+
const { result } = await warmOperation(config, name, { operation: "review", initializeUser: false }, options);
|
|
2117
2122
|
return {
|
|
2118
2123
|
possible: true,
|
|
2119
2124
|
findings: reviewReplySchema.parse(result).findings,
|
|
@@ -2131,8 +2136,12 @@ var reviewWarmController = async (config, name, options) => {
|
|
|
2131
2136
|
};
|
|
2132
2137
|
}
|
|
2133
2138
|
};
|
|
2139
|
+
var restartWarmController = async (config, name, reset, options) => {
|
|
2140
|
+
const { result } = await warmOperation(config, name, { operation: "restart", reset }, options);
|
|
2141
|
+
return restartReplySchema.parse(result);
|
|
2142
|
+
};
|
|
2134
2143
|
var updateWarmController = async (config, name, operation, options = {}) => {
|
|
2135
|
-
const { result, connection, operationId, diagnostics } = await warmOperation(config, name,
|
|
2144
|
+
const { result, connection, operationId, diagnostics } = await warmOperation(config, name, { operation, initializeUser: options.initializeUser ?? false }, options);
|
|
2136
2145
|
return checkReceipt(controllerResultSchema.parse(result), {
|
|
2137
2146
|
operationId,
|
|
2138
2147
|
operation,
|
|
@@ -2479,6 +2488,7 @@ export {
|
|
|
2479
2488
|
readBuild,
|
|
2480
2489
|
requiresDownload,
|
|
2481
2490
|
resolveConfig3 as resolveConfig,
|
|
2491
|
+
restartWarmController,
|
|
2482
2492
|
reviewWarmController,
|
|
2483
2493
|
rollbackSchema,
|
|
2484
2494
|
runProject,
|
|
@@ -2492,5 +2502,5 @@ export {
|
|
|
2492
2502
|
workerScriptsDigest
|
|
2493
2503
|
};
|
|
2494
2504
|
|
|
2495
|
-
//# debugId=
|
|
2505
|
+
//# debugId=A33BB6F2C62569F164756E2164756E21
|
|
2496
2506
|
//# sourceMappingURL=index.js.map
|