@jetta/cargo-stabilizer 0.1.0-3 → 0.1.0-5
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/CHANGELOG.md +21 -1
- package/README.md +51 -11
- package/build/core/adapters/axle_adapter.d.ts +4 -4
- package/build/core/adapters/axle_adapter.d.ts.map +1 -1
- package/build/core/adapters/axle_adapter.js +7 -5
- package/build/core/adapters/coordinate_mapper.d.ts +5 -5
- package/build/core/adapters/coordinate_mapper.d.ts.map +1 -1
- package/build/core/adapters/coordinate_mapper.js +11 -11
- package/build/core/adapters/empty_space_adapter.d.ts +10 -0
- package/build/core/adapters/empty_space_adapter.d.ts.map +1 -0
- package/build/core/adapters/empty_space_adapter.js +24 -0
- package/build/core/adapters/map_item_to_positioned_cube.d.ts +9 -0
- package/build/core/adapters/map_item_to_positioned_cube.d.ts.map +1 -0
- package/build/core/adapters/map_item_to_positioned_cube.js +16 -0
- package/build/core/adapters/stability_adapter.d.ts +1 -1
- package/build/core/adapters/stability_adapter.d.ts.map +1 -1
- package/build/core/adapters/stability_adapter.js +1 -1
- package/build/core/candidates/build_candidate_context.d.ts +1 -1
- package/build/core/candidates/build_candidate_context.d.ts.map +1 -1
- package/build/core/candidates/build_candidate_context.js +3 -1
- package/build/core/candidates/candidate_context.d.ts +4 -1
- package/build/core/candidates/candidate_context.d.ts.map +1 -1
- package/build/core/candidates/candidate_generator.d.ts +1 -1
- package/build/core/candidates/candidate_generator.d.ts.map +1 -1
- package/build/core/candidates/candidate_generator.js +19 -16
- package/build/core/candidates/candidate_validation.d.ts +0 -12
- package/build/core/candidates/candidate_validation.d.ts.map +1 -1
- package/build/core/candidates/candidate_validation.js +32 -26
- package/build/core/candidates/enumerate_empty_space_slots.d.ts +15 -0
- package/build/core/candidates/enumerate_empty_space_slots.d.ts.map +1 -0
- package/build/core/candidates/enumerate_empty_space_slots.js +44 -0
- package/build/core/candidates/rank_candidates.d.ts.map +1 -1
- package/build/core/candidates/rank_candidates.js +3 -0
- package/build/core/evaluation/evaluation_context.d.ts +3 -1
- package/build/core/evaluation/evaluation_context.d.ts.map +1 -1
- package/build/core/evaluation/state_evaluator.d.ts +12 -1
- package/build/core/evaluation/state_evaluator.d.ts.map +1 -1
- package/build/core/evaluation/state_evaluator.js +28 -5
- package/build/core/exceptions/InvalidStabilizerOutputError.d.ts +4 -0
- package/build/core/exceptions/InvalidStabilizerOutputError.d.ts.map +1 -0
- package/build/core/exceptions/InvalidStabilizerOutputError.js +6 -0
- package/build/core/factory/read_stabilizer_config.d.ts +4 -2
- package/build/core/factory/read_stabilizer_config.d.ts.map +1 -1
- package/build/core/factory/read_stabilizer_config.js +6 -25
- package/build/core/factory/read_stabilizer_config_helpers.d.ts +28 -0
- package/build/core/factory/read_stabilizer_config_helpers.d.ts.map +1 -0
- package/build/core/factory/read_stabilizer_config_helpers.js +62 -0
- package/build/core/filters/loose_item_filter.d.ts +2 -2
- package/build/core/filters/loose_item_filter.d.ts.map +1 -1
- package/build/core/filters/loose_item_filter.js +3 -3
- package/build/core/geometry/box_geometry.d.ts +17 -1
- package/build/core/geometry/box_geometry.d.ts.map +1 -1
- package/build/core/geometry/box_geometry.js +67 -2
- package/build/core/move/apply_move.d.ts +1 -1
- package/build/core/move/apply_move.d.ts.map +1 -1
- package/build/core/move/apply_move.js +1 -1
- package/build/core/orchestration/StabilizerFlow.d.ts +2 -1
- package/build/core/orchestration/StabilizerFlow.d.ts.map +1 -1
- package/build/core/orchestration/StabilizerFlow.js +2 -2
- package/build/core/orchestration/build_milkrun_bands_from_config.d.ts +13 -0
- package/build/core/orchestration/build_milkrun_bands_from_config.d.ts.map +1 -0
- package/build/core/orchestration/build_milkrun_bands_from_config.js +14 -0
- package/build/core/orchestration/build_reorder_context.d.ts +1 -1
- package/build/core/orchestration/build_reorder_context.d.ts.map +1 -1
- package/build/core/orchestration/build_reorder_context.js +7 -7
- package/build/core/orchestration/read_primary_env.d.ts +9 -0
- package/build/core/orchestration/read_primary_env.d.ts.map +1 -0
- package/build/core/orchestration/read_primary_env.js +13 -0
- package/build/core/strategies/reorder/BeamSearchReorder.d.ts +1 -1
- package/build/core/strategies/reorder/BeamSearchReorder.d.ts.map +1 -1
- package/build/core/strategies/reorder/BeamSearchReorder.js +3 -3
- package/build/core/strategies/reorder/GeneticReorder.d.ts +1 -1
- package/build/core/strategies/reorder/GeneticReorder.d.ts.map +1 -1
- package/build/core/strategies/reorder/GravityCompaction.d.ts +1 -1
- package/build/core/strategies/reorder/GravityCompaction.d.ts.map +1 -1
- package/build/core/strategies/reorder/GravityCompaction.js +2 -2
- package/build/core/strategies/reorder/GreedyReorder.d.ts +1 -1
- package/build/core/strategies/reorder/GreedyReorder.d.ts.map +1 -1
- package/build/core/strategies/reorder/ReorderStrategy.d.ts +3 -1
- package/build/core/strategies/reorder/ReorderStrategy.d.ts.map +1 -1
- package/build/core/strategies/reorder/SimulatedAnnealingReorder.d.ts +1 -1
- package/build/core/strategies/reorder/SimulatedAnnealingReorder.d.ts.map +1 -1
- package/build/core/strategies/reorder/anneal_helpers.d.ts +1 -1
- package/build/core/strategies/reorder/anneal_helpers.d.ts.map +1 -1
- package/build/core/strategies/reorder/anneal_helpers.js +1 -1
- package/build/core/strategies/reorder/apply_if_gates_pass.d.ts +1 -1
- package/build/core/strategies/reorder/apply_if_gates_pass.d.ts.map +1 -1
- package/build/core/strategies/reorder/beam_context.d.ts +1 -1
- package/build/core/strategies/reorder/beam_context.d.ts.map +1 -1
- package/build/core/strategies/reorder/genetic/Chromosome.d.ts +1 -1
- package/build/core/strategies/reorder/genetic/Chromosome.d.ts.map +1 -1
- package/build/core/strategies/reorder/genetic/Chromosome.js +2 -2
- package/build/core/strategies/reorder/greedy_improvement.d.ts +1 -1
- package/build/core/strategies/reorder/greedy_improvement.d.ts.map +1 -1
- package/build/core/strategies/reorder/greedy_improvement.js +2 -2
- package/build/core/validation/contract/cargo_movement_wire_field_map.d.ts +21 -0
- package/build/core/validation/contract/cargo_movement_wire_field_map.d.ts.map +1 -0
- package/build/core/validation/contract/cargo_movement_wire_field_map.js +27 -0
- package/build/core/validation/contract/cargo_movement_wire_mapper.d.ts +14 -0
- package/build/core/validation/contract/cargo_movement_wire_mapper.d.ts.map +1 -0
- package/build/core/validation/contract/cargo_movement_wire_mapper.js +34 -0
- package/build/core/validation/contract/format_zod_error.d.ts +8 -0
- package/build/core/validation/contract/format_zod_error.d.ts.map +1 -0
- package/build/core/validation/contract/format_zod_error.js +11 -0
- package/build/core/validation/contract/index.d.ts +9 -0
- package/build/core/validation/contract/index.d.ts.map +1 -0
- package/build/core/validation/contract/index.js +8 -0
- package/build/core/validation/contract/map_contract_to_wire_shape.d.ts +3 -0
- package/build/core/validation/contract/map_contract_to_wire_shape.d.ts.map +1 -0
- package/build/core/validation/contract/map_contract_to_wire_shape.js +28 -0
- package/build/core/validation/contract/map_wire_input_to_contract_shape.d.ts +2 -0
- package/build/core/validation/contract/map_wire_input_to_contract_shape.d.ts.map +1 -0
- package/build/core/validation/contract/map_wire_input_to_contract_shape.js +62 -0
- package/build/core/validation/contract/parse_stabilizer_input.d.ts +45 -0
- package/build/core/validation/contract/parse_stabilizer_input.d.ts.map +1 -0
- package/build/core/validation/contract/parse_stabilizer_input.js +26 -0
- package/build/core/validation/contract/parse_stabilizer_output.d.ts +47 -0
- package/build/core/validation/contract/parse_stabilizer_output.d.ts.map +1 -0
- package/build/core/validation/contract/parse_stabilizer_output.js +24 -0
- package/build/core/validation/contract/stabilizer_domain_schema.d.ts +92 -0
- package/build/core/validation/contract/stabilizer_domain_schema.d.ts.map +1 -0
- package/build/core/validation/contract/stabilizer_domain_schema.js +61 -0
- package/build/core/validation/contract/stabilizer_input_schema.d.ts +33 -0
- package/build/core/validation/contract/stabilizer_input_schema.d.ts.map +1 -0
- package/build/core/validation/contract/stabilizer_input_schema.js +11 -0
- package/build/core/validation/contract/stabilizer_output_schema.d.ts +70 -0
- package/build/core/validation/contract/stabilizer_output_schema.d.ts.map +1 -0
- package/build/core/validation/contract/stabilizer_output_schema.js +16 -0
- package/build/core/validation/contract/wire_mapper_record_utils.d.ts +20 -0
- package/build/core/validation/contract/wire_mapper_record_utils.d.ts.map +1 -0
- package/build/core/validation/contract/wire_mapper_record_utils.js +36 -0
- package/build/core/validation/schemas/stabilizer_config_schema.d.ts +4 -1
- package/build/core/validation/schemas/stabilizer_config_schema.d.ts.map +1 -1
- package/build/core/validation/schemas/stabilizer_config_schema.js +4 -1
- package/build/core/waypoint/build_waypoint_zones.d.ts +1 -1
- package/build/core/waypoint/build_waypoint_zones.d.ts.map +1 -1
- package/build/core/waypoint/build_waypoint_zones.js +2 -2
- package/build/core/waypoint/milkrun_wall_reservation.d.ts +24 -0
- package/build/core/waypoint/milkrun_wall_reservation.d.ts.map +1 -0
- package/build/core/waypoint/milkrun_wall_reservation.js +57 -0
- package/build/core/waypoint/milkrun_wall_reservation_helpers.d.ts +15 -0
- package/build/core/waypoint/milkrun_wall_reservation_helpers.d.ts.map +1 -0
- package/build/core/waypoint/milkrun_wall_reservation_helpers.js +48 -0
- package/build/core/waypoint/milkrun_wall_reservation_types.d.ts +16 -0
- package/build/core/waypoint/milkrun_wall_reservation_types.d.ts.map +1 -0
- package/build/core/waypoint/milkrun_wall_reservation_types.js +1 -0
- package/build/core/waypoint/preserves_waypoint_order.d.ts +1 -1
- package/build/core/waypoint/preserves_waypoint_order.d.ts.map +1 -1
- package/build/core/waypoint/validate_waypoint_ids.d.ts +1 -1
- package/build/core/waypoint/validate_waypoint_ids.d.ts.map +1 -1
- package/build/index.d.ts +15 -6
- package/build/index.d.ts.map +1 -1
- package/build/index.js +30 -7
- package/package.json +1 -1
- package/build/core/validation/parse_stabilizer_input.d.ts +0 -8
- package/build/core/validation/parse_stabilizer_input.d.ts.map +0 -1
- package/build/core/validation/parse_stabilizer_input.js +0 -20
- package/build/core/validation/schemas/stabilizer_input_schema.d.ts +0 -110
- package/build/core/validation/schemas/stabilizer_input_schema.d.ts.map +0 -1
- package/build/core/validation/schemas/stabilizer_input_schema.js +0 -34
- package/build/core/validation/schemas/stabilizer_output_schema.d.ts +0 -13
- package/build/core/validation/schemas/stabilizer_output_schema.d.ts.map +0 -1
- package/build/core/validation/schemas/stabilizer_output_schema.js +0 -6
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { is_loose_item } from '../filters/loose_item_filter.js';
|
|
2
|
+
import { build_container_milkrun_band } from './milkrun_wall_reservation_helpers.js';
|
|
3
|
+
/**
|
|
4
|
+
* Builds reserved Z bands for the last N waypoints' compound walls per container.
|
|
5
|
+
* @param containers - Baseline container layout.
|
|
6
|
+
* @param mode - Waypoint mode.
|
|
7
|
+
* @param wall_count - Number of trailing waypoints to reserve.
|
|
8
|
+
* @returns Reserved Z bands (empty when wall_count is zero or single-waypoint mode).
|
|
9
|
+
*/
|
|
10
|
+
export function build_milkrun_reserved_z_bands(containers, mode, wall_count) {
|
|
11
|
+
if (wall_count <= 0 || mode.kind === 'SINGLE_WAYPOINT') {
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
return containers.flatMap((container, container_index) => {
|
|
15
|
+
const band = build_container_milkrun_band({
|
|
16
|
+
container,
|
|
17
|
+
mode,
|
|
18
|
+
wall_count,
|
|
19
|
+
container_index
|
|
20
|
+
});
|
|
21
|
+
return band ? [band] : [];
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @param request - Reserved bands and candidate placement.
|
|
26
|
+
* @returns True when candidate overlaps a reserved band.
|
|
27
|
+
*/
|
|
28
|
+
export function is_position_in_milkrun_reserved_band(request) {
|
|
29
|
+
const item_z_min = request.position.z;
|
|
30
|
+
const item_z_max = request.position.z + request.item.depth;
|
|
31
|
+
return request.bands.some(band => band.container_index === request.container_index &&
|
|
32
|
+
item_z_min < band.z_max &&
|
|
33
|
+
item_z_max > band.z_min);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @param containers - Layout to validate.
|
|
37
|
+
* @param bands - Reserved milkrun Z bands.
|
|
38
|
+
* @returns True when no loose item overlaps a reserved band.
|
|
39
|
+
*/
|
|
40
|
+
export function is_layout_milkrun_valid(containers, bands) {
|
|
41
|
+
if (bands.length === 0) {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
return containers.every((container, container_index) => container.items.every(item => is_loose_item_position_valid(item, bands, container_index)));
|
|
45
|
+
}
|
|
46
|
+
function is_loose_item_position_valid(item, bands, container_index) {
|
|
47
|
+
if (!is_loose_item(item)) {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
const overlaps = is_position_in_milkrun_reserved_band({
|
|
51
|
+
bands,
|
|
52
|
+
container_index,
|
|
53
|
+
item,
|
|
54
|
+
position: { z: item.z }
|
|
55
|
+
});
|
|
56
|
+
return !overlaps;
|
|
57
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { StabilizerContainer } from '../validation/contract/stabilizer_domain_schema.js';
|
|
2
|
+
import type { WaypointMode } from './WaypointMode.js';
|
|
3
|
+
import type { MilkrunReservedBand } from './milkrun_wall_reservation_types.js';
|
|
4
|
+
export interface ContainerMilkrunBandRequest {
|
|
5
|
+
container: StabilizerContainer;
|
|
6
|
+
mode: WaypointMode;
|
|
7
|
+
wall_count: number;
|
|
8
|
+
container_index: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @param request - Container milkrun band request.
|
|
12
|
+
* @returns Reserved Z band for one container.
|
|
13
|
+
*/
|
|
14
|
+
export declare function build_container_milkrun_band(request: ContainerMilkrunBandRequest): MilkrunReservedBand | undefined;
|
|
15
|
+
//# sourceMappingURL=milkrun_wall_reservation_helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"milkrun_wall_reservation_helpers.d.ts","sourceRoot":"","sources":["../../../src/core/waypoint/milkrun_wall_reservation_helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAA;AAC7F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AAE9E,MAAM,WAAW,2BAA2B;IAExC,SAAS,EAAE,mBAAmB,CAAA;IAC9B,IAAI,EAAE,YAAY,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,EAAE,MAAM,CAAA;CAC1B;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CACxC,OAAO,EAAE,2BAA2B,GACrC,mBAAmB,GAAG,SAAS,CAwBjC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { is_loose_item } from '../filters/loose_item_filter.js';
|
|
2
|
+
import { resolve_item_waypoint_id } from './validate_waypoint_ids.js';
|
|
3
|
+
/**
|
|
4
|
+
* @param request - Container milkrun band request.
|
|
5
|
+
* @returns Reserved Z band for one container.
|
|
6
|
+
*/
|
|
7
|
+
export function build_container_milkrun_band(request) {
|
|
8
|
+
const order = build_compound_waypoint_order(request.container.items, request.mode);
|
|
9
|
+
const reserved_waypoints = order.slice(-request.wall_count);
|
|
10
|
+
if (reserved_waypoints.length === 0) {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
const z_values = collect_compound_z_extents(request.container.items, request.mode, reserved_waypoints);
|
|
14
|
+
if (z_values.length === 0) {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
container_index: request.container_index,
|
|
19
|
+
z_min: Math.min(...z_values),
|
|
20
|
+
z_max: Math.max(...z_values)
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function build_compound_waypoint_order(items, mode) {
|
|
24
|
+
const compound_items = items.filter(item => !is_loose_item(item));
|
|
25
|
+
const sorted = [...compound_items].sort((left, right) => left.z - right.z);
|
|
26
|
+
const vector = [];
|
|
27
|
+
for (const item of sorted) {
|
|
28
|
+
const waypoint_id = resolve_item_waypoint_id(item, mode);
|
|
29
|
+
if (vector.length === 0 || vector[vector.length - 1] !== waypoint_id) {
|
|
30
|
+
vector.push(waypoint_id);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return vector;
|
|
34
|
+
}
|
|
35
|
+
function collect_compound_z_extents(items, mode, reserved_waypoints) {
|
|
36
|
+
const z_values = [];
|
|
37
|
+
for (const item of items) {
|
|
38
|
+
if (is_loose_item(item)) {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
const waypoint_id = resolve_item_waypoint_id(item, mode);
|
|
42
|
+
if (!reserved_waypoints.includes(waypoint_id)) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
z_values.push(item.z, item.z + item.depth);
|
|
46
|
+
}
|
|
47
|
+
return z_values;
|
|
48
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface MilkrunReservedBand {
|
|
2
|
+
container_index: number;
|
|
3
|
+
z_min: number;
|
|
4
|
+
z_max: number;
|
|
5
|
+
}
|
|
6
|
+
export interface MilkrunPositionCheck {
|
|
7
|
+
bands: MilkrunReservedBand[];
|
|
8
|
+
container_index: number;
|
|
9
|
+
item: {
|
|
10
|
+
depth: number;
|
|
11
|
+
};
|
|
12
|
+
position: {
|
|
13
|
+
z: number;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=milkrun_wall_reservation_types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"milkrun_wall_reservation_types.d.ts","sourceRoot":"","sources":["../../../src/core/waypoint/milkrun_wall_reservation_types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAEhC,eAAe,EAAE,MAAM,CAAA;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,oBAAoB;IAEjC,KAAK,EAAE,mBAAmB,EAAE,CAAA;IAC5B,eAAe,EAAE,MAAM,CAAA;IACvB,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IACvB,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StabilizerContainer } from '../validation/
|
|
1
|
+
import type { StabilizerContainer } from '../validation/contract/stabilizer_domain_schema.js';
|
|
2
2
|
import type { WaypointMode } from './WaypointMode.js';
|
|
3
3
|
/**
|
|
4
4
|
* Builds macro waypoint order vector along Z for one container.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preserves_waypoint_order.d.ts","sourceRoot":"","sources":["../../../src/core/waypoint/preserves_waypoint_order.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"preserves_waypoint_order.d.ts","sourceRoot":"","sources":["../../../src/core/waypoint/preserves_waypoint_order.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAA;AAC7F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGrD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACvC,SAAS,EAAE,mBAAmB,EAC9B,IAAI,EAAE,YAAY,GACnB,MAAM,EAAE,CAeV;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAQxE;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACpC,MAAM,EAAE,mBAAmB,EAAE,EAC7B,KAAK,EAAE,mBAAmB,EAAE,EAC5B,IAAI,EAAE,YAAY,GACnB,OAAO,CAkBT"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StabilizerItem } from '../validation/
|
|
1
|
+
import type { StabilizerItem } from '../validation/contract/stabilizer_domain_schema.js';
|
|
2
2
|
import type { WaypointMode } from './WaypointMode.js';
|
|
3
3
|
/**
|
|
4
4
|
* Validates waypoint_id consistency across all items in an env.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate_waypoint_ids.d.ts","sourceRoot":"","sources":["../../../src/core/waypoint/validate_waypoint_ids.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"validate_waypoint_ids.d.ts","sourceRoot":"","sources":["../../../src/core/waypoint/validate_waypoint_ids.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oDAAoD,CAAA;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,YAAY,CAgB3E;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM,CAQzF"}
|
package/build/index.d.ts
CHANGED
|
@@ -1,17 +1,26 @@
|
|
|
1
|
-
import type { StabilizerInput } from './core/validation/schemas/stabilizer_input_schema.js';
|
|
2
|
-
import type { StabilizerResponse } from './core/validation/schemas/stabilizer_output_schema.js';
|
|
3
1
|
export { REORDER_STRATEGY, REORDER_STRATEGY_VALUES } from './core/constants/ReorderStrategy.js';
|
|
4
2
|
export type { ReorderStrategyValue } from './core/constants/ReorderStrategy.js';
|
|
5
3
|
export { MixedWaypointIdError } from './core/exceptions/MixedWaypointIdError.js';
|
|
6
4
|
export { UnknownReorderStrategyError } from './core/exceptions/UnknownReorderStrategyError.js';
|
|
7
5
|
export { InvalidStabilizerInputError } from './core/exceptions/InvalidStabilizerInputError.js';
|
|
8
|
-
export
|
|
6
|
+
export { InvalidStabilizerOutputError } from './core/exceptions/InvalidStabilizerOutputError.js';
|
|
7
|
+
export type { StabilizerInput, StabilizerResponse, StabilizerSuccessResponse, StabilizerErrorResponse, StabilizerItem, StabilizerContainer, StabilizerEnv, StabilizerCargoState } from './core/validation/contract/index.js';
|
|
8
|
+
export { parse_stabilizer_input, safe_parse_stabilizer_input, parse_stabilizer_output, safe_parse_stabilizer_output, map_wire_input_to_contract, map_contract_to_wire_output } from './core/validation/contract/index.js';
|
|
9
|
+
export type StabilizerWireResponse = {
|
|
10
|
+
status: 'success';
|
|
11
|
+
data: unknown;
|
|
12
|
+
messages: string[];
|
|
13
|
+
} | {
|
|
14
|
+
status: 'error';
|
|
15
|
+
data: string;
|
|
16
|
+
messages: string[];
|
|
17
|
+
};
|
|
9
18
|
/**
|
|
10
19
|
* Stabilizes cargo by reordering loose items (legacy CM-compatible response).
|
|
11
|
-
* @param input -
|
|
12
|
-
* @returns Success or error response with
|
|
20
|
+
* @param input - Cargo-movement wire payload or English contract input.
|
|
21
|
+
* @returns Success or error response with CM wire cargo_state on success.
|
|
13
22
|
*/
|
|
14
|
-
export declare function stabilize(input:
|
|
23
|
+
export declare function stabilize(input: unknown): Promise<StabilizerWireResponse>;
|
|
15
24
|
export { run_stabilizer_flow_from_unknown } from './core/orchestration/StabilizerFlow.js';
|
|
16
25
|
export { create_reorder_strategy } from './core/factory/strategy_factory.js';
|
|
17
26
|
export { validate_waypoint_ids } from './core/waypoint/validate_waypoint_ids.js';
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAA;AAC/F,YAAY,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAA;AAC9F,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAA;AAC9F,OAAO,EAAE,4BAA4B,EAAE,MAAM,mDAAmD,CAAA;AAChG,YAAY,EACR,eAAe,EACf,kBAAkB,EAClB,yBAAyB,EACzB,uBAAuB,EACvB,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACvB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EACH,sBAAsB,EACtB,2BAA2B,EAC3B,uBAAuB,EACvB,4BAA4B,EAC5B,0BAA0B,EAC1B,2BAA2B,EAC9B,MAAM,qCAAqC,CAAA;AAK5C,MAAM,MAAM,sBAAsB,GAC5B;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,GACxD;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAE3D;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAI/E;AAsED,OAAO,EAAE,gCAAgC,EAAE,MAAM,wCAAwC,CAAA;AACzF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAA"}
|
package/build/index.js
CHANGED
|
@@ -1,21 +1,33 @@
|
|
|
1
1
|
import { Logger } from '@jetta/logger';
|
|
2
2
|
import { run_stabilizer_flow_from_unknown } from './core/orchestration/StabilizerFlow.js';
|
|
3
3
|
import { stabilizer_logger } from './core/logging/stabilizer_logger.js';
|
|
4
|
+
import { map_contract_to_wire_output, parse_stabilizer_output } from './core/validation/contract/index.js';
|
|
4
5
|
export { REORDER_STRATEGY, REORDER_STRATEGY_VALUES } from './core/constants/ReorderStrategy.js';
|
|
5
6
|
export { MixedWaypointIdError } from './core/exceptions/MixedWaypointIdError.js';
|
|
6
7
|
export { UnknownReorderStrategyError } from './core/exceptions/UnknownReorderStrategyError.js';
|
|
7
8
|
export { InvalidStabilizerInputError } from './core/exceptions/InvalidStabilizerInputError.js';
|
|
9
|
+
export { InvalidStabilizerOutputError } from './core/exceptions/InvalidStabilizerOutputError.js';
|
|
10
|
+
export { parse_stabilizer_input, safe_parse_stabilizer_input, parse_stabilizer_output, safe_parse_stabilizer_output, map_wire_input_to_contract, map_contract_to_wire_output } from './core/validation/contract/index.js';
|
|
8
11
|
const messages = [];
|
|
9
12
|
const UNKNOWN_IDENTITY = 'UNKNOWN';
|
|
10
13
|
/**
|
|
11
14
|
* Stabilizes cargo by reordering loose items (legacy CM-compatible response).
|
|
12
|
-
* @param input -
|
|
13
|
-
* @returns Success or error response with
|
|
15
|
+
* @param input - Cargo-movement wire payload or English contract input.
|
|
16
|
+
* @returns Success or error response with CM wire cargo_state on success.
|
|
14
17
|
*/
|
|
15
18
|
export async function stabilize(input) {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
const identity = read_stabilizer_identity(input);
|
|
20
|
+
return Logger.run_with_cargo_info(identity.company, identity.cargo_id, () => run_stabilize(input));
|
|
21
|
+
}
|
|
22
|
+
function read_stabilizer_identity(input) {
|
|
23
|
+
if (typeof input !== 'object' || input === null) {
|
|
24
|
+
return { company: UNKNOWN_IDENTITY, cargo_id: UNKNOWN_IDENTITY };
|
|
25
|
+
}
|
|
26
|
+
const record = input;
|
|
27
|
+
return {
|
|
28
|
+
company: record.company !== undefined ? String(record.company) : UNKNOWN_IDENTITY,
|
|
29
|
+
cargo_id: record.id !== undefined ? String(record.id) : UNKNOWN_IDENTITY
|
|
30
|
+
};
|
|
19
31
|
}
|
|
20
32
|
function run_stabilize(input) {
|
|
21
33
|
stabilizer_logger.log('cargo-stabilizer started');
|
|
@@ -29,11 +41,20 @@ function run_stabilize(input) {
|
|
|
29
41
|
}
|
|
30
42
|
}
|
|
31
43
|
function build_success_response(cargo_state) {
|
|
32
|
-
|
|
44
|
+
const english_response = {
|
|
33
45
|
status: 'success',
|
|
34
46
|
data: cargo_state,
|
|
35
47
|
messages: [...messages]
|
|
36
48
|
};
|
|
49
|
+
const validated = parse_stabilizer_output(english_response);
|
|
50
|
+
if (validated.status !== 'success') {
|
|
51
|
+
throw new Error('Expected success response after stabilizer flow');
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
status: 'success',
|
|
55
|
+
data: map_contract_to_wire_output(validated.data),
|
|
56
|
+
messages: validated.messages
|
|
57
|
+
};
|
|
37
58
|
}
|
|
38
59
|
function build_error_response(err) {
|
|
39
60
|
stabilizer_logger.warn('cargo-stabilizer finished with error');
|
|
@@ -41,11 +62,13 @@ function build_error_response(err) {
|
|
|
41
62
|
if (err.stack) {
|
|
42
63
|
stabilizer_logger.error(err.stack);
|
|
43
64
|
}
|
|
44
|
-
|
|
65
|
+
const response = {
|
|
45
66
|
status: 'error',
|
|
46
67
|
data: err.message,
|
|
47
68
|
messages: [...messages, err.message]
|
|
48
69
|
};
|
|
70
|
+
parse_stabilizer_output(response);
|
|
71
|
+
return response;
|
|
49
72
|
}
|
|
50
73
|
export { run_stabilizer_flow_from_unknown } from './core/orchestration/StabilizerFlow.js';
|
|
51
74
|
export { create_reorder_strategy } from './core/factory/strategy_factory.js';
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type StabilizerInput } from './schemas/stabilizer_input_schema.js';
|
|
2
|
-
/**
|
|
3
|
-
* Parses stabilizer input at the public boundary.
|
|
4
|
-
* @param input_data - Unknown wire payload.
|
|
5
|
-
* @returns Validated stabilizer input.
|
|
6
|
-
*/
|
|
7
|
-
export declare function parse_stabilizer_input(input_data: unknown): StabilizerInput;
|
|
8
|
-
//# sourceMappingURL=parse_stabilizer_input.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse_stabilizer_input.d.ts","sourceRoot":"","sources":["../../../src/core/validation/parse_stabilizer_input.ts"],"names":[],"mappings":"AAEA,OAAO,EAA2B,KAAK,eAAe,EAAE,MAAM,sCAAsC,CAAA;AAEpG;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,OAAO,GAAG,eAAe,CAS3E"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { InvalidStabilizerInputError } from '../exceptions/InvalidStabilizerInputError.js';
|
|
2
|
-
import { stabilizer_input_schema } from './schemas/stabilizer_input_schema.js';
|
|
3
|
-
/**
|
|
4
|
-
* Parses stabilizer input at the public boundary.
|
|
5
|
-
* @param input_data - Unknown wire payload.
|
|
6
|
-
* @returns Validated stabilizer input.
|
|
7
|
-
*/
|
|
8
|
-
export function parse_stabilizer_input(input_data) {
|
|
9
|
-
const result = stabilizer_input_schema.safeParse(input_data);
|
|
10
|
-
if (!result.success) {
|
|
11
|
-
throw new InvalidStabilizerInputError(format_zod_error(result.error));
|
|
12
|
-
}
|
|
13
|
-
return result.data;
|
|
14
|
-
}
|
|
15
|
-
function format_zod_error(error) {
|
|
16
|
-
return error.issues.map(issue => {
|
|
17
|
-
const path = issue.path.length > 0 ? issue.path.join('.') : '(root)';
|
|
18
|
-
return `${path}: ${issue.message}`;
|
|
19
|
-
}).join('; ');
|
|
20
|
-
}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const stabilizer_item_schema: z.ZodObject<{
|
|
3
|
-
_id: z.ZodString;
|
|
4
|
-
groupId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
5
|
-
waypoint_id: z.ZodOptional<z.ZodString>;
|
|
6
|
-
x: z.ZodNumber;
|
|
7
|
-
y: z.ZodNumber;
|
|
8
|
-
z: z.ZodNumber;
|
|
9
|
-
w: z.ZodNumber;
|
|
10
|
-
h: z.ZodNumber;
|
|
11
|
-
d: z.ZodNumber;
|
|
12
|
-
peso: z.ZodOptional<z.ZodNumber>;
|
|
13
|
-
}, z.core.$loose>;
|
|
14
|
-
export declare const stabilizer_container_schema: z.ZodObject<{
|
|
15
|
-
sequencia: z.ZodOptional<z.ZodNumber>;
|
|
16
|
-
largura: z.ZodNumber;
|
|
17
|
-
altura: z.ZodNumber;
|
|
18
|
-
comprimento: z.ZodNumber;
|
|
19
|
-
items: z.ZodArray<z.ZodObject<{
|
|
20
|
-
_id: z.ZodString;
|
|
21
|
-
groupId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
22
|
-
waypoint_id: z.ZodOptional<z.ZodString>;
|
|
23
|
-
x: z.ZodNumber;
|
|
24
|
-
y: z.ZodNumber;
|
|
25
|
-
z: z.ZodNumber;
|
|
26
|
-
w: z.ZodNumber;
|
|
27
|
-
h: z.ZodNumber;
|
|
28
|
-
d: z.ZodNumber;
|
|
29
|
-
peso: z.ZodOptional<z.ZodNumber>;
|
|
30
|
-
}, z.core.$loose>>;
|
|
31
|
-
}, z.core.$loose>;
|
|
32
|
-
export declare const stabilizer_env_schema: z.ZodObject<{
|
|
33
|
-
containers: z.ZodArray<z.ZodObject<{
|
|
34
|
-
sequencia: z.ZodOptional<z.ZodNumber>;
|
|
35
|
-
largura: z.ZodNumber;
|
|
36
|
-
altura: z.ZodNumber;
|
|
37
|
-
comprimento: z.ZodNumber;
|
|
38
|
-
items: z.ZodArray<z.ZodObject<{
|
|
39
|
-
_id: z.ZodString;
|
|
40
|
-
groupId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
41
|
-
waypoint_id: z.ZodOptional<z.ZodString>;
|
|
42
|
-
x: z.ZodNumber;
|
|
43
|
-
y: z.ZodNumber;
|
|
44
|
-
z: z.ZodNumber;
|
|
45
|
-
w: z.ZodNumber;
|
|
46
|
-
h: z.ZodNumber;
|
|
47
|
-
d: z.ZodNumber;
|
|
48
|
-
peso: z.ZodOptional<z.ZodNumber>;
|
|
49
|
-
}, z.core.$loose>>;
|
|
50
|
-
}, z.core.$loose>>;
|
|
51
|
-
eixos: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
52
|
-
}, z.core.$loose>;
|
|
53
|
-
export declare const stabilizer_cargo_state_schema: z.ZodObject<{
|
|
54
|
-
envs: z.ZodArray<z.ZodObject<{
|
|
55
|
-
containers: z.ZodArray<z.ZodObject<{
|
|
56
|
-
sequencia: z.ZodOptional<z.ZodNumber>;
|
|
57
|
-
largura: z.ZodNumber;
|
|
58
|
-
altura: z.ZodNumber;
|
|
59
|
-
comprimento: z.ZodNumber;
|
|
60
|
-
items: z.ZodArray<z.ZodObject<{
|
|
61
|
-
_id: z.ZodString;
|
|
62
|
-
groupId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
63
|
-
waypoint_id: z.ZodOptional<z.ZodString>;
|
|
64
|
-
x: z.ZodNumber;
|
|
65
|
-
y: z.ZodNumber;
|
|
66
|
-
z: z.ZodNumber;
|
|
67
|
-
w: z.ZodNumber;
|
|
68
|
-
h: z.ZodNumber;
|
|
69
|
-
d: z.ZodNumber;
|
|
70
|
-
peso: z.ZodOptional<z.ZodNumber>;
|
|
71
|
-
}, z.core.$loose>>;
|
|
72
|
-
}, z.core.$loose>>;
|
|
73
|
-
eixos: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
74
|
-
}, z.core.$loose>>;
|
|
75
|
-
}, z.core.$loose>;
|
|
76
|
-
export declare const stabilizer_input_schema: z.ZodObject<{
|
|
77
|
-
id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
78
|
-
company: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
79
|
-
cargo_state: z.ZodObject<{
|
|
80
|
-
envs: z.ZodArray<z.ZodObject<{
|
|
81
|
-
containers: z.ZodArray<z.ZodObject<{
|
|
82
|
-
sequencia: z.ZodOptional<z.ZodNumber>;
|
|
83
|
-
largura: z.ZodNumber;
|
|
84
|
-
altura: z.ZodNumber;
|
|
85
|
-
comprimento: z.ZodNumber;
|
|
86
|
-
items: z.ZodArray<z.ZodObject<{
|
|
87
|
-
_id: z.ZodString;
|
|
88
|
-
groupId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
89
|
-
waypoint_id: z.ZodOptional<z.ZodString>;
|
|
90
|
-
x: z.ZodNumber;
|
|
91
|
-
y: z.ZodNumber;
|
|
92
|
-
z: z.ZodNumber;
|
|
93
|
-
w: z.ZodNumber;
|
|
94
|
-
h: z.ZodNumber;
|
|
95
|
-
d: z.ZodNumber;
|
|
96
|
-
peso: z.ZodOptional<z.ZodNumber>;
|
|
97
|
-
}, z.core.$loose>>;
|
|
98
|
-
}, z.core.$loose>>;
|
|
99
|
-
eixos: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
100
|
-
}, z.core.$loose>>;
|
|
101
|
-
}, z.core.$loose>;
|
|
102
|
-
original_input: z.ZodOptional<z.ZodUnknown>;
|
|
103
|
-
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
104
|
-
}, z.core.$loose>;
|
|
105
|
-
export type StabilizerItem = z.infer<typeof stabilizer_item_schema>;
|
|
106
|
-
export type StabilizerContainer = z.infer<typeof stabilizer_container_schema>;
|
|
107
|
-
export type StabilizerEnv = z.infer<typeof stabilizer_env_schema>;
|
|
108
|
-
export type StabilizerCargoState = z.infer<typeof stabilizer_cargo_state_schema>;
|
|
109
|
-
export type StabilizerInput = z.infer<typeof stabilizer_input_schema>;
|
|
110
|
-
//# sourceMappingURL=stabilizer_input_schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stabilizer_input_schema.d.ts","sourceRoot":"","sources":["../../../../src/core/validation/schemas/stabilizer_input_schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,sBAAsB;;;;;;;;;;;iBAWnB,CAAA;AAEhB,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;iBAMxB,CAAA;AAEhB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;iBAGlB,CAAA;AAEhB,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;iBAE1B,CAAA;AAEhB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMpB,CAAA;AAEhB,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AACnE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAC7E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AACjE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAA;AAChF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export const stabilizer_item_schema = z.object({
|
|
3
|
-
_id: z.string().min(1),
|
|
4
|
-
groupId: z.union([z.string(), z.null()]).optional(),
|
|
5
|
-
waypoint_id: z.string().optional(),
|
|
6
|
-
x: z.number(),
|
|
7
|
-
y: z.number(),
|
|
8
|
-
z: z.number(),
|
|
9
|
-
w: z.number().positive(),
|
|
10
|
-
h: z.number().positive(),
|
|
11
|
-
d: z.number().positive(),
|
|
12
|
-
peso: z.number().optional()
|
|
13
|
-
}).passthrough();
|
|
14
|
-
export const stabilizer_container_schema = z.object({
|
|
15
|
-
sequencia: z.number().optional(),
|
|
16
|
-
largura: z.number().positive(),
|
|
17
|
-
altura: z.number().positive(),
|
|
18
|
-
comprimento: z.number().positive(),
|
|
19
|
-
items: z.array(stabilizer_item_schema)
|
|
20
|
-
}).passthrough();
|
|
21
|
-
export const stabilizer_env_schema = z.object({
|
|
22
|
-
containers: z.array(stabilizer_container_schema).min(1),
|
|
23
|
-
eixos: z.array(z.record(z.string(), z.unknown())).optional()
|
|
24
|
-
}).passthrough();
|
|
25
|
-
export const stabilizer_cargo_state_schema = z.object({
|
|
26
|
-
envs: z.array(stabilizer_env_schema).min(1)
|
|
27
|
-
}).passthrough();
|
|
28
|
-
export const stabilizer_input_schema = z.object({
|
|
29
|
-
id: z.union([z.string(), z.number()]).optional(),
|
|
30
|
-
company: z.union([z.string(), z.number()]).optional(),
|
|
31
|
-
cargo_state: stabilizer_cargo_state_schema,
|
|
32
|
-
original_input: z.unknown().optional(),
|
|
33
|
-
config: z.record(z.string(), z.unknown()).optional()
|
|
34
|
-
}).passthrough();
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { stabilizer_cargo_state_schema } from './stabilizer_input_schema.js';
|
|
3
|
-
export declare const stabilizer_response_schema: z.ZodObject<{
|
|
4
|
-
status: z.ZodEnum<{
|
|
5
|
-
error: "error";
|
|
6
|
-
success: "success";
|
|
7
|
-
}>;
|
|
8
|
-
data: z.ZodUnknown;
|
|
9
|
-
messages: z.ZodArray<z.ZodString>;
|
|
10
|
-
}, z.core.$strip>;
|
|
11
|
-
export type StabilizerResponse = z.infer<typeof stabilizer_response_schema>;
|
|
12
|
-
export type StabilizerSuccessData = z.infer<typeof stabilizer_cargo_state_schema>;
|
|
13
|
-
//# sourceMappingURL=stabilizer_output_schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stabilizer_output_schema.d.ts","sourceRoot":"","sources":["../../../../src/core/validation/schemas/stabilizer_output_schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAA;AAE5E,eAAO,MAAM,0BAA0B;;;;;;;iBAIrC,CAAA;AAEF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAC3E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAA"}
|