chofex-cli 0.1.112 → 0.1.113
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/index.js +10 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -58642,8 +58642,8 @@ var ChallengeSlugSchema = exports_Schema.Literals([
|
|
|
58642
58642
|
"agent-arena"
|
|
58643
58643
|
]);
|
|
58644
58644
|
var ShipmentSchema = exports_Schema.Struct({
|
|
58645
|
-
distanceKm: exports_Schema.
|
|
58646
|
-
weightKg: exports_Schema.
|
|
58645
|
+
distanceKm: exports_Schema.Int.pipe(exports_Schema.check(exports_Schema.isBetween({ minimum: 1, maximum: 2000 }))),
|
|
58646
|
+
weightKg: exports_Schema.Int.pipe(exports_Schema.check(exports_Schema.isBetween({ minimum: 1, maximum: 500 }))),
|
|
58647
58647
|
hour: exports_Schema.Int.pipe(exports_Schema.check(exports_Schema.isBetween({ minimum: 0, maximum: 23 }))),
|
|
58648
58648
|
fragile: exports_Schema.Boolean,
|
|
58649
58649
|
express: exports_Schema.Boolean
|
|
@@ -59589,19 +59589,19 @@ var javascriptSourceFromPath = (path4) => {
|
|
|
59589
59589
|
}
|
|
59590
59590
|
return readTextFile(path4).pipe(exports_Effect.map((source) => ({ kind: "javascript_source", source })));
|
|
59591
59591
|
};
|
|
59592
|
-
var
|
|
59592
|
+
var requiredInteger = (message) => exports_Prompt.text({
|
|
59593
59593
|
message,
|
|
59594
59594
|
validate: (value3) => {
|
|
59595
|
-
if (value3.trim() === "" || Number.
|
|
59596
|
-
return exports_Effect.fail("Must be a number");
|
|
59595
|
+
if (value3.trim() === "" || !Number.isInteger(Number(value3))) {
|
|
59596
|
+
return exports_Effect.fail("Must be a whole number");
|
|
59597
59597
|
}
|
|
59598
59598
|
return exports_Effect.succeed(value3);
|
|
59599
59599
|
}
|
|
59600
59600
|
});
|
|
59601
59601
|
var interactiveShipment = () => exports_Prompt.run(exports_Prompt.all({
|
|
59602
|
-
distanceKm:
|
|
59603
|
-
weightKg:
|
|
59604
|
-
hour:
|
|
59602
|
+
distanceKm: requiredInteger("Distance (whole km)"),
|
|
59603
|
+
weightKg: requiredInteger("Weight (whole kg)"),
|
|
59604
|
+
hour: requiredInteger("Hour (0-23)"),
|
|
59605
59605
|
fragile: exports_Prompt.confirm({ message: "Fragile?" }),
|
|
59606
59606
|
express: exports_Prompt.confirm({ message: "Express?" })
|
|
59607
59607
|
})).pipe(exports_Effect.map((input) => ({
|
|
@@ -60236,8 +60236,8 @@ var showCommand = exports_Command.make("show", { challenge: challengeFlag }, exp
|
|
|
60236
60236
|
var queryCommand = exports_Command.make("query", {
|
|
60237
60237
|
challenge: challengeFlag,
|
|
60238
60238
|
input: inputFlag,
|
|
60239
|
-
distance: optionalString("distance", "Shipment distance in km"),
|
|
60240
|
-
weight: optionalString("weight", "Shipment weight in kg"),
|
|
60239
|
+
distance: optionalString("distance", "Shipment distance in whole km"),
|
|
60240
|
+
weight: optionalString("weight", "Shipment weight in whole kg"),
|
|
60241
60241
|
hour: optionalString("hour", "Hour of day, 0-23"),
|
|
60242
60242
|
fragile: exports_Flag.choice("fragile", ["true", "false"]).pipe(exports_Flag.optional, exports_Flag.withDescription("Fragile surcharge flag")),
|
|
60243
60243
|
express: exports_Flag.choice("express", ["true", "false"]).pipe(exports_Flag.optional, exports_Flag.withDescription("Express surcharge flag"))
|