@de./types 1.0.0
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/api.d.ts +113 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +92 -0
- package/dist/api.js.map +1 -0
- package/dist/auth.d.ts +109 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +80 -0
- package/dist/auth.js.map +1 -0
- package/dist/aux/agent-rvs.d.ts +1205 -0
- package/dist/aux/agent-rvs.d.ts.map +1 -0
- package/dist/aux/agent-rvs.js +444 -0
- package/dist/aux/agent-rvs.js.map +1 -0
- package/dist/aux/agents.d.ts +1573 -0
- package/dist/aux/agents.d.ts.map +1 -0
- package/dist/aux/agents.js +487 -0
- package/dist/aux/agents.js.map +1 -0
- package/dist/aux/customer-rvs.d.ts +711 -0
- package/dist/aux/customer-rvs.d.ts.map +1 -0
- package/dist/aux/customer-rvs.js +321 -0
- package/dist/aux/customer-rvs.js.map +1 -0
- package/dist/aux/customers.d.ts +379 -0
- package/dist/aux/customers.d.ts.map +1 -0
- package/dist/aux/customers.js +67 -0
- package/dist/aux/customers.js.map +1 -0
- package/dist/aux/index.d.ts +5 -0
- package/dist/aux/index.d.ts.map +1 -0
- package/dist/aux/index.js +21 -0
- package/dist/aux/index.js.map +1 -0
- package/dist/billing.d.ts +367 -0
- package/dist/billing.d.ts.map +1 -0
- package/dist/billing.js +308 -0
- package/dist/billing.js.map +1 -0
- package/dist/bucket.d.ts +97 -0
- package/dist/bucket.d.ts.map +1 -0
- package/dist/bucket.js +52 -0
- package/dist/bucket.js.map +1 -0
- package/dist/context.d.ts +148 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +148 -0
- package/dist/context.js.map +1 -0
- package/dist/csp/analytics.d.ts +270 -0
- package/dist/csp/analytics.d.ts.map +1 -0
- package/dist/csp/analytics.js +185 -0
- package/dist/csp/analytics.js.map +1 -0
- package/dist/csp/base.d.ts +11 -0
- package/dist/csp/base.d.ts.map +1 -0
- package/dist/csp/base.js +17 -0
- package/dist/csp/base.js.map +1 -0
- package/dist/csp/index.d.ts +107 -0
- package/dist/csp/index.d.ts.map +1 -0
- package/dist/csp/index.js +48 -0
- package/dist/csp/index.js.map +1 -0
- package/dist/csp/inventory.d.ts +361 -0
- package/dist/csp/inventory.d.ts.map +1 -0
- package/dist/csp/inventory.js +267 -0
- package/dist/csp/inventory.js.map +1 -0
- package/dist/csp/order.d.ts +1457 -0
- package/dist/csp/order.d.ts.map +1 -0
- package/dist/csp/order.js +367 -0
- package/dist/csp/order.js.map +1 -0
- package/dist/csp/webhook.d.ts +381 -0
- package/dist/csp/webhook.d.ts.map +1 -0
- package/dist/csp/webhook.js +207 -0
- package/dist/csp/webhook.js.map +1 -0
- package/dist/de.profile.d.ts +411 -0
- package/dist/de.profile.d.ts.map +1 -0
- package/dist/de.profile.js +98 -0
- package/dist/de.profile.js.map +1 -0
- package/dist/dev/developer.d.ts +211 -0
- package/dist/dev/developer.d.ts.map +1 -0
- package/dist/dev/developer.js +55 -0
- package/dist/dev/developer.js.map +1 -0
- package/dist/dev/index.d.ts +133 -0
- package/dist/dev/index.d.ts.map +1 -0
- package/dist/dev/index.js +79 -0
- package/dist/dev/index.js.map +1 -0
- package/dist/entity.d.ts +159 -0
- package/dist/entity.d.ts.map +1 -0
- package/dist/entity.js +127 -0
- package/dist/entity.js.map +1 -0
- package/dist/events.d.ts +1844 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +303 -0
- package/dist/events.js.map +1 -0
- package/dist/faq.d.ts +60 -0
- package/dist/faq.d.ts.map +1 -0
- package/dist/faq.js +31 -0
- package/dist/faq.js.map +1 -0
- package/dist/geo.d.ts +123 -0
- package/dist/geo.d.ts.map +1 -0
- package/dist/geo.js +87 -0
- package/dist/geo.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -0
- package/dist/inventory.d.ts +1347 -0
- package/dist/inventory.d.ts.map +1 -0
- package/dist/inventory.js +356 -0
- package/dist/inventory.js.map +1 -0
- package/dist/invoice.d.ts +46 -0
- package/dist/invoice.d.ts.map +1 -0
- package/dist/invoice.js +33 -0
- package/dist/invoice.js.map +1 -0
- package/dist/iotsp/device.d.ts +581 -0
- package/dist/iotsp/device.d.ts.map +1 -0
- package/dist/iotsp/device.js +277 -0
- package/dist/iotsp/device.js.map +1 -0
- package/dist/iotsp/index.d.ts +111 -0
- package/dist/iotsp/index.d.ts.map +1 -0
- package/dist/iotsp/index.js +76 -0
- package/dist/iotsp/index.js.map +1 -0
- package/dist/iotsp/rule.d.ts +340 -0
- package/dist/iotsp/rule.d.ts.map +1 -0
- package/dist/iotsp/rule.js +172 -0
- package/dist/iotsp/rule.js.map +1 -0
- package/dist/iotsp/topic.d.ts +249 -0
- package/dist/iotsp/topic.d.ts.map +1 -0
- package/dist/iotsp/topic.js +139 -0
- package/dist/iotsp/topic.js.map +1 -0
- package/dist/lsp/carrier/analytics.d.ts +1191 -0
- package/dist/lsp/carrier/analytics.d.ts.map +1 -0
- package/dist/lsp/carrier/analytics.js +354 -0
- package/dist/lsp/carrier/analytics.js.map +1 -0
- package/dist/lsp/carrier/capabilities.d.ts +3603 -0
- package/dist/lsp/carrier/capabilities.d.ts.map +1 -0
- package/dist/lsp/carrier/capabilities.js +880 -0
- package/dist/lsp/carrier/capabilities.js.map +1 -0
- package/dist/lsp/carrier/capacities.d.ts +4436 -0
- package/dist/lsp/carrier/capacities.d.ts.map +1 -0
- package/dist/lsp/carrier/capacities.js +615 -0
- package/dist/lsp/carrier/capacities.js.map +1 -0
- package/dist/lsp/carrier/index.d.ts +734 -0
- package/dist/lsp/carrier/index.d.ts.map +1 -0
- package/dist/lsp/carrier/index.js +150 -0
- package/dist/lsp/carrier/index.js.map +1 -0
- package/dist/lsp/carrier/performance.d.ts +567 -0
- package/dist/lsp/carrier/performance.d.ts.map +1 -0
- package/dist/lsp/carrier/performance.js +127 -0
- package/dist/lsp/carrier/performance.js.map +1 -0
- package/dist/lsp/carrier/utilities.d.ts +6671 -0
- package/dist/lsp/carrier/utilities.d.ts.map +1 -0
- package/dist/lsp/carrier/utilities.js +597 -0
- package/dist/lsp/carrier/utilities.js.map +1 -0
- package/dist/lsp/consolidation.d.ts +793 -0
- package/dist/lsp/consolidation.d.ts.map +1 -0
- package/dist/lsp/consolidation.js +343 -0
- package/dist/lsp/consolidation.js.map +1 -0
- package/dist/lsp/coverage.d.ts +7449 -0
- package/dist/lsp/coverage.d.ts.map +1 -0
- package/dist/lsp/coverage.js +706 -0
- package/dist/lsp/coverage.js.map +1 -0
- package/dist/lsp/fleet/index.d.ts +1128 -0
- package/dist/lsp/fleet/index.d.ts.map +1 -0
- package/dist/lsp/fleet/index.js +269 -0
- package/dist/lsp/fleet/index.js.map +1 -0
- package/dist/lsp/fleet/maintenance.d.ts +2022 -0
- package/dist/lsp/fleet/maintenance.d.ts.map +1 -0
- package/dist/lsp/fleet/maintenance.js +386 -0
- package/dist/lsp/fleet/maintenance.js.map +1 -0
- package/dist/lsp/fleet/parking.d.ts +2043 -0
- package/dist/lsp/fleet/parking.d.ts.map +1 -0
- package/dist/lsp/fleet/parking.js +458 -0
- package/dist/lsp/fleet/parking.js.map +1 -0
- package/dist/lsp/fleet/vehicle.d.ts +783 -0
- package/dist/lsp/fleet/vehicle.d.ts.map +1 -0
- package/dist/lsp/fleet/vehicle.js +314 -0
- package/dist/lsp/fleet/vehicle.js.map +1 -0
- package/dist/lsp/graph.d.ts +212 -0
- package/dist/lsp/graph.d.ts.map +1 -0
- package/dist/lsp/graph.js +92 -0
- package/dist/lsp/graph.js.map +1 -0
- package/dist/lsp/hub/analytics.d.ts +4294 -0
- package/dist/lsp/hub/analytics.d.ts.map +1 -0
- package/dist/lsp/hub/analytics.js +219 -0
- package/dist/lsp/hub/analytics.js.map +1 -0
- package/dist/lsp/hub/capabilities.d.ts +1467 -0
- package/dist/lsp/hub/capabilities.d.ts.map +1 -0
- package/dist/lsp/hub/capabilities.js +464 -0
- package/dist/lsp/hub/capabilities.js.map +1 -0
- package/dist/lsp/hub/capacities.d.ts +4278 -0
- package/dist/lsp/hub/capacities.d.ts.map +1 -0
- package/dist/lsp/hub/capacities.js +495 -0
- package/dist/lsp/hub/capacities.js.map +1 -0
- package/dist/lsp/hub/index.d.ts +2784 -0
- package/dist/lsp/hub/index.d.ts.map +1 -0
- package/dist/lsp/hub/index.js +268 -0
- package/dist/lsp/hub/index.js.map +1 -0
- package/dist/lsp/hub/performance.d.ts +391 -0
- package/dist/lsp/hub/performance.d.ts.map +1 -0
- package/dist/lsp/hub/performance.js +78 -0
- package/dist/lsp/hub/performance.js.map +1 -0
- package/dist/lsp/hub/utilities.d.ts +2996 -0
- package/dist/lsp/hub/utilities.d.ts.map +1 -0
- package/dist/lsp/hub/utilities.js +521 -0
- package/dist/lsp/hub/utilities.js.map +1 -0
- package/dist/lsp/index.d.ts +157 -0
- package/dist/lsp/index.d.ts.map +1 -0
- package/dist/lsp/index.js +121 -0
- package/dist/lsp/index.js.map +1 -0
- package/dist/lsp/operations.d.ts +563 -0
- package/dist/lsp/operations.d.ts.map +1 -0
- package/dist/lsp/operations.js +265 -0
- package/dist/lsp/operations.js.map +1 -0
- package/dist/lsp/order/delivery.d.ts +1119 -0
- package/dist/lsp/order/delivery.d.ts.map +1 -0
- package/dist/lsp/order/delivery.js +169 -0
- package/dist/lsp/order/delivery.js.map +1 -0
- package/dist/lsp/order/flow/processes.d.ts +8 -0
- package/dist/lsp/order/flow/processes.d.ts.map +1 -0
- package/dist/lsp/order/flow/processes.js +67 -0
- package/dist/lsp/order/flow/processes.js.map +1 -0
- package/dist/lsp/order/flow/stages.d.ts +8 -0
- package/dist/lsp/order/flow/stages.d.ts.map +1 -0
- package/dist/lsp/order/flow/stages.js +111 -0
- package/dist/lsp/order/flow/stages.js.map +1 -0
- package/dist/lsp/order/inbound.d.ts +1165 -0
- package/dist/lsp/order/inbound.d.ts.map +1 -0
- package/dist/lsp/order/inbound.js +185 -0
- package/dist/lsp/order/inbound.js.map +1 -0
- package/dist/lsp/order/internal.d.ts +1404 -0
- package/dist/lsp/order/internal.d.ts.map +1 -0
- package/dist/lsp/order/internal.js +255 -0
- package/dist/lsp/order/internal.js.map +1 -0
- package/dist/lsp/order/management.d.ts +541 -0
- package/dist/lsp/order/management.d.ts.map +1 -0
- package/dist/lsp/order/management.js +326 -0
- package/dist/lsp/order/management.js.map +1 -0
- package/dist/lsp/order/outbound.d.ts +909 -0
- package/dist/lsp/order/outbound.d.ts.map +1 -0
- package/dist/lsp/order/outbound.js +105 -0
- package/dist/lsp/order/outbound.js.map +1 -0
- package/dist/lsp/order/passthrough.d.ts +1816 -0
- package/dist/lsp/order/passthrough.d.ts.map +1 -0
- package/dist/lsp/order/passthrough.js +360 -0
- package/dist/lsp/order/passthrough.js.map +1 -0
- package/dist/lsp/order/ride.d.ts +1056 -0
- package/dist/lsp/order/ride.d.ts.map +1 -0
- package/dist/lsp/order/ride.js +166 -0
- package/dist/lsp/order/ride.js.map +1 -0
- package/dist/lsp/order/shipping.d.ts +1524 -0
- package/dist/lsp/order/shipping.d.ts.map +1 -0
- package/dist/lsp/order/shipping.js +223 -0
- package/dist/lsp/order/shipping.js.map +1 -0
- package/dist/lsp/performance.d.ts +2 -0
- package/dist/lsp/performance.d.ts.map +1 -0
- package/dist/lsp/performance.js +3 -0
- package/dist/lsp/performance.js.map +1 -0
- package/dist/lsp/pod/index.d.ts +805 -0
- package/dist/lsp/pod/index.d.ts.map +1 -0
- package/dist/lsp/pod/index.js +250 -0
- package/dist/lsp/pod/index.js.map +1 -0
- package/dist/lsp/pricing.d.ts +1811 -0
- package/dist/lsp/pricing.d.ts.map +1 -0
- package/dist/lsp/pricing.js +972 -0
- package/dist/lsp/pricing.js.map +1 -0
- package/dist/lsp/processing.d.ts +893 -0
- package/dist/lsp/processing.d.ts.map +1 -0
- package/dist/lsp/processing.js +202 -0
- package/dist/lsp/processing.js.map +1 -0
- package/dist/lsp/product.d.ts +76 -0
- package/dist/lsp/product.d.ts.map +1 -0
- package/dist/lsp/product.js +3 -0
- package/dist/lsp/product.js.map +1 -0
- package/dist/lsp/psl.d.ts +785 -0
- package/dist/lsp/psl.d.ts.map +1 -0
- package/dist/lsp/psl.js +333 -0
- package/dist/lsp/psl.js.map +1 -0
- package/dist/lsp/terminal/analytics.d.ts +278 -0
- package/dist/lsp/terminal/analytics.d.ts.map +1 -0
- package/dist/lsp/terminal/analytics.js +310 -0
- package/dist/lsp/terminal/analytics.js.map +1 -0
- package/dist/lsp/terminal/capabilities.d.ts +797 -0
- package/dist/lsp/terminal/capabilities.d.ts.map +1 -0
- package/dist/lsp/terminal/capabilities.js +506 -0
- package/dist/lsp/terminal/capabilities.js.map +1 -0
- package/dist/lsp/terminal/capacities.d.ts +3152 -0
- package/dist/lsp/terminal/capacities.d.ts.map +1 -0
- package/dist/lsp/terminal/capacities.js +504 -0
- package/dist/lsp/terminal/capacities.js.map +1 -0
- package/dist/lsp/terminal/index.d.ts +1056 -0
- package/dist/lsp/terminal/index.d.ts.map +1 -0
- package/dist/lsp/terminal/index.js +394 -0
- package/dist/lsp/terminal/index.js.map +1 -0
- package/dist/lsp/terminal/performance.d.ts +955 -0
- package/dist/lsp/terminal/performance.d.ts.map +1 -0
- package/dist/lsp/terminal/performance.js +159 -0
- package/dist/lsp/terminal/performance.js.map +1 -0
- package/dist/lsp/terminal/utilities.d.ts +2374 -0
- package/dist/lsp/terminal/utilities.d.ts.map +1 -0
- package/dist/lsp/terminal/utilities.js +161 -0
- package/dist/lsp/terminal/utilities.js.map +1 -0
- package/dist/lsp/warehouse/analytics.d.ts +3088 -0
- package/dist/lsp/warehouse/analytics.d.ts.map +1 -0
- package/dist/lsp/warehouse/analytics.js +229 -0
- package/dist/lsp/warehouse/analytics.js.map +1 -0
- package/dist/lsp/warehouse/capabilities.d.ts +1384 -0
- package/dist/lsp/warehouse/capabilities.d.ts.map +1 -0
- package/dist/lsp/warehouse/capabilities.js +567 -0
- package/dist/lsp/warehouse/capabilities.js.map +1 -0
- package/dist/lsp/warehouse/capacities.d.ts +2921 -0
- package/dist/lsp/warehouse/capacities.d.ts.map +1 -0
- package/dist/lsp/warehouse/capacities.js +450 -0
- package/dist/lsp/warehouse/capacities.js.map +1 -0
- package/dist/lsp/warehouse/index.d.ts +2566 -0
- package/dist/lsp/warehouse/index.d.ts.map +1 -0
- package/dist/lsp/warehouse/index.js +264 -0
- package/dist/lsp/warehouse/index.js.map +1 -0
- package/dist/lsp/warehouse/performance.d.ts +287 -0
- package/dist/lsp/warehouse/performance.d.ts.map +1 -0
- package/dist/lsp/warehouse/performance.js +72 -0
- package/dist/lsp/warehouse/performance.js.map +1 -0
- package/dist/lsp/warehouse/utilities.d.ts +5174 -0
- package/dist/lsp/warehouse/utilities.d.ts.map +1 -0
- package/dist/lsp/warehouse/utilities.js +588 -0
- package/dist/lsp/warehouse/utilities.js.map +1 -0
- package/dist/lsp/zones.d.ts +305 -0
- package/dist/lsp/zones.d.ts.map +1 -0
- package/dist/lsp/zones.js +118 -0
- package/dist/lsp/zones.js.map +1 -0
- package/dist/measure.d.ts +139 -0
- package/dist/measure.d.ts.map +1 -0
- package/dist/measure.js +190 -0
- package/dist/measure.js.map +1 -0
- package/dist/operator.d.ts +103 -0
- package/dist/operator.d.ts.map +1 -0
- package/dist/operator.js +38 -0
- package/dist/operator.js.map +1 -0
- package/dist/order.d.ts +2739 -0
- package/dist/order.d.ts.map +1 -0
- package/dist/order.js +1078 -0
- package/dist/order.js.map +1 -0
- package/dist/realm/index.d.ts +4 -0
- package/dist/realm/index.d.ts.map +1 -0
- package/dist/realm/index.js +20 -0
- package/dist/realm/index.js.map +1 -0
- package/dist/realm/pipelines.d.ts +32567 -0
- package/dist/realm/pipelines.d.ts.map +1 -0
- package/dist/realm/pipelines.js +1273 -0
- package/dist/realm/pipelines.js.map +1 -0
- package/dist/realm/queries.d.ts +1327 -0
- package/dist/realm/queries.d.ts.map +1 -0
- package/dist/realm/queries.js +456 -0
- package/dist/realm/queries.js.map +1 -0
- package/dist/realm/utilities.d.ts +1794 -0
- package/dist/realm/utilities.d.ts.map +1 -0
- package/dist/realm/utilities.js +594 -0
- package/dist/realm/utilities.js.map +1 -0
- package/dist/routing.d.ts +428 -0
- package/dist/routing.d.ts.map +1 -0
- package/dist/routing.js +60 -0
- package/dist/routing.js.map +1 -0
- package/dist/service.d.ts +264 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +60 -0
- package/dist/service.js.map +1 -0
- package/dist/shared/access.d.ts +102 -0
- package/dist/shared/access.d.ts.map +1 -0
- package/dist/shared/access.js +30 -0
- package/dist/shared/access.js.map +1 -0
- package/dist/shared/account.d.ts +44 -0
- package/dist/shared/account.d.ts.map +1 -0
- package/dist/shared/account.js +15 -0
- package/dist/shared/account.js.map +1 -0
- package/dist/shared/auth.d.ts +45 -0
- package/dist/shared/auth.d.ts.map +1 -0
- package/dist/shared/auth.js +19 -0
- package/dist/shared/auth.js.map +1 -0
- package/dist/shared/bucket.d.ts +294 -0
- package/dist/shared/bucket.d.ts.map +1 -0
- package/dist/shared/bucket.js +79 -0
- package/dist/shared/bucket.js.map +1 -0
- package/dist/shared/faq.d.ts +280 -0
- package/dist/shared/faq.d.ts.map +1 -0
- package/dist/shared/faq.js +73 -0
- package/dist/shared/faq.js.map +1 -0
- package/dist/shared/index.d.ts +10 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +26 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/invitation.d.ts +1525 -0
- package/dist/shared/invitation.d.ts.map +1 -0
- package/dist/shared/invitation.js +60 -0
- package/dist/shared/invitation.js.map +1 -0
- package/dist/shared/operator.d.ts +956 -0
- package/dist/shared/operator.d.ts.map +1 -0
- package/dist/shared/operator.js +48 -0
- package/dist/shared/operator.js.map +1 -0
- package/dist/shared/tracking.d.ts +31 -0
- package/dist/shared/tracking.d.ts.map +1 -0
- package/dist/shared/tracking.js +23 -0
- package/dist/shared/tracking.js.map +1 -0
- package/dist/shared/user.d.ts +77 -0
- package/dist/shared/user.d.ts.map +1 -0
- package/dist/shared/user.js +22 -0
- package/dist/shared/user.js.map +1 -0
- package/dist/sync.d.ts +539 -0
- package/dist/sync.d.ts.map +1 -0
- package/dist/sync.js +329 -0
- package/dist/sync.js.map +1 -0
- package/dist/time.d.ts +139 -0
- package/dist/time.d.ts.map +1 -0
- package/dist/time.js +93 -0
- package/dist/time.js.map +1 -0
- package/dist/user.d.ts +394 -0
- package/dist/user.d.ts.map +1 -0
- package/dist/user.js +205 -0
- package/dist/user.js.map +1 -0
- package/dist/workspace/admin.d.ts +91 -0
- package/dist/workspace/admin.d.ts.map +1 -0
- package/dist/workspace/admin.js +33 -0
- package/dist/workspace/admin.js.map +1 -0
- package/dist/workspace/billing.d.ts +2 -0
- package/dist/workspace/billing.d.ts.map +1 -0
- package/dist/workspace/billing.js +18 -0
- package/dist/workspace/billing.js.map +1 -0
- package/dist/workspace/connector.d.ts +595 -0
- package/dist/workspace/connector.d.ts.map +1 -0
- package/dist/workspace/connector.js +229 -0
- package/dist/workspace/connector.js.map +1 -0
- package/dist/workspace/index.d.ts +36 -0
- package/dist/workspace/index.d.ts.map +1 -0
- package/dist/workspace/index.js +21 -0
- package/dist/workspace/index.js.map +1 -0
- package/package.json +70 -0
- package/src/api.ts +147 -0
- package/src/auth.ts +103 -0
- package/src/aux/agent-rvs.ts +596 -0
- package/src/aux/agents.ts +542 -0
- package/src/aux/customer-rvs.ts +421 -0
- package/src/aux/customers.ts +80 -0
- package/src/aux/index.ts +4 -0
- package/src/billing.ts +330 -0
- package/src/bucket.ts +58 -0
- package/src/context.ts +167 -0
- package/src/csp/analytics.ts +238 -0
- package/src/csp/base.ts +18 -0
- package/src/csp/index.ts +41 -0
- package/src/csp/inventory.ts +325 -0
- package/src/csp/order.ts +485 -0
- package/src/csp/webhook.ts +269 -0
- package/src/de.profile.ts +123 -0
- package/src/dev/developer.ts +90 -0
- package/src/dev/index.ts +81 -0
- package/src/entity.ts +154 -0
- package/src/events.ts +349 -0
- package/src/faq.ts +39 -0
- package/src/geo.ts +111 -0
- package/src/index.ts +48 -0
- package/src/inventory.ts +405 -0
- package/src/invoice.ts +37 -0
- package/src/iotsp/device.ts +334 -0
- package/src/iotsp/index.ts +91 -0
- package/src/iotsp/rule.ts +227 -0
- package/src/iotsp/topic.ts +191 -0
- package/src/lsp/carrier/analytics.ts +393 -0
- package/src/lsp/carrier/capabilities.ts +1009 -0
- package/src/lsp/carrier/capacities.ts +723 -0
- package/src/lsp/carrier/index.ts +175 -0
- package/src/lsp/carrier/performance.ts +145 -0
- package/src/lsp/carrier/utilities.ts +654 -0
- package/src/lsp/consolidation.ts +420 -0
- package/src/lsp/coverage.ts +869 -0
- package/src/lsp/fleet/index.ts +327 -0
- package/src/lsp/fleet/maintenance.ts +478 -0
- package/src/lsp/fleet/parking.ts +582 -0
- package/src/lsp/fleet/vehicle.ts +381 -0
- package/src/lsp/graph.ts +113 -0
- package/src/lsp/hub/analytics.ts +236 -0
- package/src/lsp/hub/capabilities.ts +549 -0
- package/src/lsp/hub/capacities.ts +590 -0
- package/src/lsp/hub/index.ts +298 -0
- package/src/lsp/hub/performance.ts +89 -0
- package/src/lsp/hub/utilities.ts +560 -0
- package/src/lsp/index.ts +125 -0
- package/src/lsp/operations.ts +304 -0
- package/src/lsp/order/delivery.ts +212 -0
- package/src/lsp/order/flow/processes.ts +70 -0
- package/src/lsp/order/flow/stages.ts +119 -0
- package/src/lsp/order/inbound.ts +231 -0
- package/src/lsp/order/internal.ts +305 -0
- package/src/lsp/order/management.ts +367 -0
- package/src/lsp/order/outbound.ts +128 -0
- package/src/lsp/order/passthrough.ts +434 -0
- package/src/lsp/order/ride.ts +190 -0
- package/src/lsp/order/shipping.ts +263 -0
- package/src/lsp/performance.ts +2 -0
- package/src/lsp/pod/index.ts +323 -0
- package/src/lsp/pricing.ts +1097 -0
- package/src/lsp/processing.ts +243 -0
- package/src/lsp/product.ts +104 -0
- package/src/lsp/psl.ts +399 -0
- package/src/lsp/terminal/analytics.ts +334 -0
- package/src/lsp/terminal/capabilities.ts +541 -0
- package/src/lsp/terminal/capacities.ts +556 -0
- package/src/lsp/terminal/index.ts +442 -0
- package/src/lsp/terminal/performance.ts +168 -0
- package/src/lsp/terminal/utilities.ts +173 -0
- package/src/lsp/warehouse/analytics.ts +248 -0
- package/src/lsp/warehouse/capabilities.ts +673 -0
- package/src/lsp/warehouse/capacities.ts +538 -0
- package/src/lsp/warehouse/index.ts +298 -0
- package/src/lsp/warehouse/performance.ts +83 -0
- package/src/lsp/warehouse/utilities.ts +634 -0
- package/src/lsp/zones.ts +148 -0
- package/src/measure.ts +240 -0
- package/src/operator.ts +39 -0
- package/src/order.ts +1207 -0
- package/src/realm/index.ts +3 -0
- package/src/realm/pipelines.ts +1607 -0
- package/src/realm/queries.ts +608 -0
- package/src/realm/utilities.ts +730 -0
- package/src/routing.ts +69 -0
- package/src/service.ts +66 -0
- package/src/shared/access.ts +58 -0
- package/src/shared/account.ts +25 -0
- package/src/shared/auth.ts +30 -0
- package/src/shared/bucket.ts +153 -0
- package/src/shared/faq.ts +139 -0
- package/src/shared/index.ts +9 -0
- package/src/shared/invitation.ts +124 -0
- package/src/shared/operator.ts +159 -0
- package/src/shared/tracking.ts +30 -0
- package/src/shared/user.ts +42 -0
- package/src/sync.ts +364 -0
- package/src/time.ts +113 -0
- package/src/user.ts +243 -0
- package/src/workspace/admin.ts +38 -0
- package/src/workspace/billing.ts +1 -0
- package/src/workspace/connector.ts +270 -0
- package/src/workspace/index.ts +22 -0
|
@@ -0,0 +1,1607 @@
|
|
|
1
|
+
import { Type, Static, type TObject } from '@sinclair/typebox'
|
|
2
|
+
import { LSPOrderTypeSchema } from '../lsp'
|
|
3
|
+
import { ContextTypeSchema, ContextSchema } from '../context'
|
|
4
|
+
import { CarrierMatchingCriteriaSchema } from '../lsp/carrier/utilities'
|
|
5
|
+
import { HubMatchingCriteriaSchema } from '../lsp/hub/utilities'
|
|
6
|
+
import { WarehouseMatchingCriteriaSchema } from '../lsp/warehouse/utilities'
|
|
7
|
+
import { TerminalMatchingCriteriaSchema } from '../lsp/terminal/utilities'
|
|
8
|
+
import { ActionRecordSchema, DateTimeZoneSchema } from '../time'
|
|
9
|
+
import { APIResponseBaseSchema, APIResponseDataSchemaFactory, FetchByQueryRequestSchema } from '../api'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Pipeline System - Three-Phase Architecture
|
|
13
|
+
*
|
|
14
|
+
* Phase 1: PipelineTemplate - Design-time workflow definition
|
|
15
|
+
* Phase 2: Pipeline - Validated, continuously-monitored executable
|
|
16
|
+
* Phase 3: PipelineExecution - Runtime order processing
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
export const PipelineHealthStatusSchema = Type.Object({
|
|
20
|
+
status: Type.Union([
|
|
21
|
+
Type.Literal('HEALTHY'),
|
|
22
|
+
Type.Literal('WARNING'),
|
|
23
|
+
Type.Literal('CRITICAL')
|
|
24
|
+
]),
|
|
25
|
+
warnings: Type.Array(Type.String()),
|
|
26
|
+
lastCheck: Type.String({ format: 'date-time' })
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
// ============================================================================
|
|
30
|
+
// DYNAMIC SERVICE RESOLUTION
|
|
31
|
+
// ============================================================================
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Dynamic Query for Stage Service Selection
|
|
35
|
+
* Allows runtime resolution of service providers
|
|
36
|
+
*/
|
|
37
|
+
export const DynamicServiceQuerySchema = Type.Object({
|
|
38
|
+
// Query type
|
|
39
|
+
queryType: Type.Union([
|
|
40
|
+
Type.Literal('CARRIER'),
|
|
41
|
+
Type.Literal('WAREHOUSE'),
|
|
42
|
+
Type.Literal('HUB'),
|
|
43
|
+
Type.Literal('TERMINAL'),
|
|
44
|
+
Type.Literal('IOTSP'),
|
|
45
|
+
Type.Literal('PIPELINE') // For future recursive composition
|
|
46
|
+
]),
|
|
47
|
+
|
|
48
|
+
// Selection criteria based on queryType
|
|
49
|
+
criteria: Type.Union([
|
|
50
|
+
Type.Object({
|
|
51
|
+
type: Type.Literal('CARRIER'),
|
|
52
|
+
filters: CarrierMatchingCriteriaSchema
|
|
53
|
+
}),
|
|
54
|
+
Type.Object({
|
|
55
|
+
type: Type.Literal('WAREHOUSE'),
|
|
56
|
+
filters: WarehouseMatchingCriteriaSchema
|
|
57
|
+
}),
|
|
58
|
+
Type.Object({
|
|
59
|
+
type: Type.Literal('HUB'),
|
|
60
|
+
filters: HubMatchingCriteriaSchema
|
|
61
|
+
}),
|
|
62
|
+
Type.Object({
|
|
63
|
+
type: Type.Literal('TERMINAL'),
|
|
64
|
+
filters: TerminalMatchingCriteriaSchema
|
|
65
|
+
}),
|
|
66
|
+
Type.Object({
|
|
67
|
+
type: Type.Literal('IOTSP'),
|
|
68
|
+
filters: Type.Object({
|
|
69
|
+
capabilities: Type.Array(Type.String()),
|
|
70
|
+
location: Type.Optional(Type.Object({
|
|
71
|
+
city: Type.Optional(Type.String()),
|
|
72
|
+
region: Type.Optional(Type.String()),
|
|
73
|
+
country: Type.Optional(Type.String())
|
|
74
|
+
})),
|
|
75
|
+
maxCost: Type.Optional(Type.Number())
|
|
76
|
+
})
|
|
77
|
+
})
|
|
78
|
+
]),
|
|
79
|
+
|
|
80
|
+
// Selection strategy when multiple matches found
|
|
81
|
+
selectionStrategy: Type.Union([
|
|
82
|
+
Type.Literal('BEST_MATCH'), // Highest capability score
|
|
83
|
+
Type.Literal('CHEAPEST'), // Lowest cost
|
|
84
|
+
Type.Literal('FASTEST'), // Shortest estimated time
|
|
85
|
+
Type.Literal('HIGHEST_RATED'), // Best performance history
|
|
86
|
+
Type.Literal('CLOSEST'), // Geographic proximity
|
|
87
|
+
Type.Literal('RANDOM') // Random selection (load balancing)
|
|
88
|
+
]), // Default as BEST_MATCH
|
|
89
|
+
|
|
90
|
+
// Fallback options if primary query fails
|
|
91
|
+
fallbackOptions: Type.Optional(Type.Array(Type.Object({
|
|
92
|
+
criteria: Type.Any(),
|
|
93
|
+
priority: Type.Number({ minimum: 1 })
|
|
94
|
+
}))),
|
|
95
|
+
|
|
96
|
+
// Cache duration for query results (seconds)
|
|
97
|
+
cacheDuration: Type.Optional(Type.Number({ minimum: 0 })) // Default as 300
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Stage Assignment Type
|
|
102
|
+
* Either fixed processor or dynamic query
|
|
103
|
+
*/
|
|
104
|
+
export const StageAssignmentSchema = Type.Union([
|
|
105
|
+
// Fixed assignment
|
|
106
|
+
Type.Object({
|
|
107
|
+
assignmentType: Type.Literal('FIXED'),
|
|
108
|
+
processor: ContextSchema
|
|
109
|
+
}),
|
|
110
|
+
// Dynamic query-based assignment
|
|
111
|
+
Type.Object({
|
|
112
|
+
assignmentType: Type.Literal('DYNAMIC'),
|
|
113
|
+
query: DynamicServiceQuerySchema
|
|
114
|
+
}),
|
|
115
|
+
// Manual selection
|
|
116
|
+
Type.Object({
|
|
117
|
+
assignmentType: Type.Literal('MANUAL')
|
|
118
|
+
})
|
|
119
|
+
])
|
|
120
|
+
|
|
121
|
+
// ============================================================================
|
|
122
|
+
// PIPELINE EXECUTION (RUNTIME)
|
|
123
|
+
// ============================================================================
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Pre-Execution Validation
|
|
127
|
+
*/
|
|
128
|
+
export const PreExecutionValidationSchema = Type.Object({
|
|
129
|
+
pid: Type.String(),
|
|
130
|
+
orderReference: Type.String(),
|
|
131
|
+
|
|
132
|
+
passed: Type.Boolean(),
|
|
133
|
+
|
|
134
|
+
// Stage-specific validations
|
|
135
|
+
stageValidations: Type.Array(Type.Object({
|
|
136
|
+
stageId: Type.String(),
|
|
137
|
+
stageName: Type.String(),
|
|
138
|
+
passed: Type.Boolean(),
|
|
139
|
+
|
|
140
|
+
// Capacity validation
|
|
141
|
+
hasCapacity: Type.Boolean(),
|
|
142
|
+
capacityDetails: Type.Optional(Type.String()),
|
|
143
|
+
|
|
144
|
+
// Provider availability
|
|
145
|
+
providerAvailable: Type.Boolean(),
|
|
146
|
+
assignedProvider: Type.Optional(ContextSchema),
|
|
147
|
+
|
|
148
|
+
// Issues
|
|
149
|
+
issues: Type.Optional(Type.Array(Type.String()))
|
|
150
|
+
})),
|
|
151
|
+
|
|
152
|
+
// Overall issues
|
|
153
|
+
failureReasons: Type.Optional(Type.Array(Type.String())),
|
|
154
|
+
|
|
155
|
+
// Alternative suggestions
|
|
156
|
+
suggestedAlternatives: Type.Optional(Type.Array(Type.String())),
|
|
157
|
+
|
|
158
|
+
// Timestamp
|
|
159
|
+
validated: ActionRecordSchema
|
|
160
|
+
})
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Enhanced Stage Execution Status
|
|
164
|
+
*/
|
|
165
|
+
export const StageExecutionStatusSchema = Type.Union([
|
|
166
|
+
Type.Literal('PENDING'),
|
|
167
|
+
Type.Literal('VALIDATING'), // Pre-execution validation
|
|
168
|
+
Type.Literal('READY'),
|
|
169
|
+
Type.Literal('ASSIGNING_PROCESSOR'), // Dynamic processor assignment
|
|
170
|
+
Type.Literal('IN_PROGRESS'),
|
|
171
|
+
Type.Literal('WAITING'),
|
|
172
|
+
Type.Literal('COMPLETED'),
|
|
173
|
+
Type.Literal('FAILED'),
|
|
174
|
+
Type.Literal('SKIPPED'),
|
|
175
|
+
Type.Literal('CANCELLED'),
|
|
176
|
+
Type.Literal('RETRY_PENDING'),
|
|
177
|
+
Type.Literal('FALLBACK_IN_PROGRESS'), // Using fallback processor
|
|
178
|
+
Type.Literal('ESCALATED'),
|
|
179
|
+
Type.Literal('REQUIRES_MANUAL_INTERVENTION')
|
|
180
|
+
])
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Enhanced Stage Execution
|
|
184
|
+
*/
|
|
185
|
+
export const StageExecutionSchema = Type.Object({
|
|
186
|
+
stageId: Type.String(),
|
|
187
|
+
stageName: Type.String(),
|
|
188
|
+
order: Type.Number({ minimum: 1 }),
|
|
189
|
+
|
|
190
|
+
// Processor assignment
|
|
191
|
+
processorType: ContextTypeSchema,
|
|
192
|
+
assignmentType: Type.Union([
|
|
193
|
+
Type.Literal('FIXED'),
|
|
194
|
+
Type.Literal('DYNAMIC'),
|
|
195
|
+
Type.Literal('MANUAL')
|
|
196
|
+
]),
|
|
197
|
+
|
|
198
|
+
// Assigned processor (resolved at runtime)
|
|
199
|
+
assignedProcessor: Type.Optional(ContextSchema),
|
|
200
|
+
assigned: Type.Optional(ActionRecordSchema),
|
|
201
|
+
|
|
202
|
+
// Dynamic query results (if applicable)
|
|
203
|
+
queryResults: Type.Optional(Type.Object({
|
|
204
|
+
queryExecuted: ActionRecordSchema,
|
|
205
|
+
candidatesFound: Type.Number({ minimum: 0 }),
|
|
206
|
+
selectedProvider: ContextSchema,
|
|
207
|
+
selectionReason: Type.String(),
|
|
208
|
+
cached: Type.Boolean()
|
|
209
|
+
})),
|
|
210
|
+
|
|
211
|
+
// Fallback tracking
|
|
212
|
+
usingFallback: Type.Optional(Type.Boolean()),
|
|
213
|
+
fallbackReason: Type.Optional(Type.String()),
|
|
214
|
+
|
|
215
|
+
// Child order
|
|
216
|
+
orderType: Type.Optional(LSPOrderTypeSchema),
|
|
217
|
+
childOrderReference: Type.Optional(Type.String()),
|
|
218
|
+
|
|
219
|
+
// Execution state
|
|
220
|
+
status: StageExecutionStatusSchema,
|
|
221
|
+
started: Type.Optional(ActionRecordSchema),
|
|
222
|
+
completed: Type.Optional(ActionRecordSchema),
|
|
223
|
+
durationMinutes: Type.Optional(Type.Number({ minimum: 0 })),
|
|
224
|
+
|
|
225
|
+
// Transition tracking
|
|
226
|
+
currentTransition: Type.Optional(Type.Object({
|
|
227
|
+
ruleIndex: Type.Number(),
|
|
228
|
+
type: Type.String(),
|
|
229
|
+
attempts: Type.Number({ minimum: 0 }),
|
|
230
|
+
lastAttempt: Type.Optional(DateTimeZoneSchema),
|
|
231
|
+
nextAttempt: Type.Optional(DateTimeZoneSchema)
|
|
232
|
+
})),
|
|
233
|
+
|
|
234
|
+
// State transitions history
|
|
235
|
+
transitions: Type.Array(Type.Object({
|
|
236
|
+
from: StageExecutionStatusSchema,
|
|
237
|
+
to: StageExecutionStatusSchema,
|
|
238
|
+
triggered: ActionRecordSchema,
|
|
239
|
+
reason: Type.Optional(Type.String()),
|
|
240
|
+
metadata: Type.Optional(Type.Record(Type.String(), Type.Any()))
|
|
241
|
+
})),
|
|
242
|
+
|
|
243
|
+
// Error tracking
|
|
244
|
+
errors: Type.Optional(Type.Array(Type.Object({
|
|
245
|
+
datetime: DateTimeZoneSchema,
|
|
246
|
+
error: Type.String(),
|
|
247
|
+
code: Type.Optional(Type.String()),
|
|
248
|
+
recoverable: Type.Boolean(),
|
|
249
|
+
retryAttempt: Type.Optional(Type.Number())
|
|
250
|
+
}))),
|
|
251
|
+
|
|
252
|
+
// Retry management
|
|
253
|
+
retryAttempts: Type.Optional(Type.Number({ minimum: 0 })),
|
|
254
|
+
nextRetryAt: Type.Optional(DateTimeZoneSchema),
|
|
255
|
+
|
|
256
|
+
// Cost tracking
|
|
257
|
+
actualCost: Type.Optional(Type.Number()),
|
|
258
|
+
estimatedCost: Type.Optional(Type.Number())
|
|
259
|
+
})
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Pipeline Execution Instance - Phase 3 (Runtime)
|
|
263
|
+
*/
|
|
264
|
+
export const PipelineExecutionSchema = Type.Object({
|
|
265
|
+
id: Type.String(),
|
|
266
|
+
context: ContextSchema,
|
|
267
|
+
|
|
268
|
+
// Deployed pipeline reference
|
|
269
|
+
pid: Type.String(),
|
|
270
|
+
|
|
271
|
+
// Order reference
|
|
272
|
+
orderReference: Type.Optional(Type.String()),
|
|
273
|
+
|
|
274
|
+
// Template snapshot (for audit)
|
|
275
|
+
template: Type.Object({
|
|
276
|
+
id: Type.String(),
|
|
277
|
+
version: Type.String(),
|
|
278
|
+
name: Type.String()
|
|
279
|
+
}),
|
|
280
|
+
|
|
281
|
+
// Pre-execution validation
|
|
282
|
+
preExecutionValidation: Type.Optional(PreExecutionValidationSchema),
|
|
283
|
+
|
|
284
|
+
// Current position
|
|
285
|
+
currentStageIndex: Type.Number({ minimum: 0 }),
|
|
286
|
+
currentStageId: Type.Optional(Type.String()),
|
|
287
|
+
|
|
288
|
+
// Overall status
|
|
289
|
+
status: Type.Union([
|
|
290
|
+
Type.Literal('INITIALIZED'),
|
|
291
|
+
Type.Literal('VALIDATING'),
|
|
292
|
+
Type.Literal('RUNNING'),
|
|
293
|
+
Type.Literal('WAITING'),
|
|
294
|
+
Type.Literal('COMPLETED'),
|
|
295
|
+
Type.Literal('FAILED'),
|
|
296
|
+
Type.Literal('CANCELLED'),
|
|
297
|
+
Type.Literal('PAUSED'),
|
|
298
|
+
Type.Literal('HALTED')
|
|
299
|
+
]),
|
|
300
|
+
|
|
301
|
+
// Halt information
|
|
302
|
+
halted: Type.Optional(ActionRecordSchema),
|
|
303
|
+
haltReason: Type.Optional(Type.String()),
|
|
304
|
+
|
|
305
|
+
// Stage executions
|
|
306
|
+
stages: Type.Array(StageExecutionSchema),
|
|
307
|
+
|
|
308
|
+
// Timing
|
|
309
|
+
initiated: ActionRecordSchema,
|
|
310
|
+
started: Type.Optional(ActionRecordSchema),
|
|
311
|
+
completed: Type.Optional(ActionRecordSchema),
|
|
312
|
+
estimatedCompletion: Type.Optional(ActionRecordSchema),
|
|
313
|
+
|
|
314
|
+
// Duration tracking
|
|
315
|
+
actualDurationMinutes: Type.Optional(Type.Number({ minimum: 0 })),
|
|
316
|
+
estimatedDurationMinutes: Type.Optional(Type.Number({ minimum: 0 })),
|
|
317
|
+
|
|
318
|
+
// Cost tracking
|
|
319
|
+
actualCost: Type.Optional(Type.Number()),
|
|
320
|
+
estimatedCost: Type.Optional(Type.Number()),
|
|
321
|
+
|
|
322
|
+
// Metrics
|
|
323
|
+
metrics: Type.Optional(Type.Object({
|
|
324
|
+
totalStages: Type.Number(),
|
|
325
|
+
completedStages: Type.Number(),
|
|
326
|
+
failedStages: Type.Number(),
|
|
327
|
+
skippedStages: Type.Number(),
|
|
328
|
+
progressPercentage: Type.Number({ minimum: 0, maximum: 100 }),
|
|
329
|
+
|
|
330
|
+
// Performance
|
|
331
|
+
averageStageCompletionTime: Type.Optional(Type.Number()),
|
|
332
|
+
bottleneckStages: Type.Optional(Type.Array(Type.String()))
|
|
333
|
+
})),
|
|
334
|
+
|
|
335
|
+
// Parent/child relationships (for pipeline composition)
|
|
336
|
+
parentExecutionId: Type.Optional(Type.String()),
|
|
337
|
+
childExecutionIds: Type.Optional(Type.Array(Type.String()))
|
|
338
|
+
})
|
|
339
|
+
|
|
340
|
+
export const PipelineExecutionWithHealthSchema = Type.Object({
|
|
341
|
+
executionId: Type.String(),
|
|
342
|
+
orderReference: Type.Optional(Type.String()),
|
|
343
|
+
execution: PipelineExecutionSchema,
|
|
344
|
+
health: PipelineHealthStatusSchema
|
|
345
|
+
})
|
|
346
|
+
|
|
347
|
+
// ============================================================================
|
|
348
|
+
// PIPELINE ESCALATION
|
|
349
|
+
// ============================================================================
|
|
350
|
+
|
|
351
|
+
export const EscalationSeveritySchema = Type.Union([
|
|
352
|
+
Type.Literal('LOW'),
|
|
353
|
+
Type.Literal('HIGH'),
|
|
354
|
+
Type.Literal('CRITICAL')
|
|
355
|
+
])
|
|
356
|
+
|
|
357
|
+
export const EscalationStatusSchema = Type.Union([
|
|
358
|
+
Type.Literal('OPEN'),
|
|
359
|
+
Type.Literal('IN_PROGRESS'),
|
|
360
|
+
Type.Literal('RESOLVED')
|
|
361
|
+
])
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Pipeline Escalation - created when automatic recovery is exhausted
|
|
365
|
+
*/
|
|
366
|
+
export const PipelineEscalationSchema = Type.Object({
|
|
367
|
+
id: Type.String(),
|
|
368
|
+
context: ContextSchema,
|
|
369
|
+
|
|
370
|
+
// References
|
|
371
|
+
executionId: Type.String(),
|
|
372
|
+
stageId: Type.String(),
|
|
373
|
+
|
|
374
|
+
// Escalation detail
|
|
375
|
+
reason: Type.String(),
|
|
376
|
+
severity: EscalationSeveritySchema,
|
|
377
|
+
status: EscalationStatusSchema,
|
|
378
|
+
failureReason: Type.String(),
|
|
379
|
+
|
|
380
|
+
// Lifecycle
|
|
381
|
+
created: ActionRecordSchema,
|
|
382
|
+
resolved: Type.Optional(ActionRecordSchema),
|
|
383
|
+
resolution: Type.Optional(Type.String())
|
|
384
|
+
})
|
|
385
|
+
|
|
386
|
+
// ============================================================================
|
|
387
|
+
// PIPELINE TEMPLATE (DESIGN-TIME)
|
|
388
|
+
// ============================================================================
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Template Status - Design phase
|
|
392
|
+
*/
|
|
393
|
+
export const PipelineTemplateStatusSchema = Type.Union([
|
|
394
|
+
Type.Literal('DRAFT'), // Being edited
|
|
395
|
+
Type.Literal('READY'), // Ready for deployment
|
|
396
|
+
Type.Literal('ARCHIVED') // Historical record
|
|
397
|
+
])
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Enhanced Stage Transition Rule
|
|
401
|
+
*/
|
|
402
|
+
export const StageTransitionRuleSchema = Type.Object({
|
|
403
|
+
type: Type.Union([
|
|
404
|
+
Type.Literal('STATUS_MATCH'),
|
|
405
|
+
Type.Literal('WEBHOOK_RECEIVED'),
|
|
406
|
+
Type.Literal('MANUAL_TRIGGER'),
|
|
407
|
+
Type.Literal('TIME_ELAPSED'),
|
|
408
|
+
Type.Literal('API_CHECK'),
|
|
409
|
+
Type.Literal('CONDITION_MET') // Custom condition evaluation
|
|
410
|
+
]),
|
|
411
|
+
|
|
412
|
+
condition: Type.Object({
|
|
413
|
+
targetStatus: Type.Optional(Type.String()),
|
|
414
|
+
webhookEvent: Type.Optional(Type.String()),
|
|
415
|
+
delayMinutes: Type.Optional(Type.Number({ minimum: 0 })),
|
|
416
|
+
endpoint: Type.Optional(Type.String()),
|
|
417
|
+
checkInterval: Type.Optional(Type.Number({ minimum: 1 })),
|
|
418
|
+
maxAttempts: Type.Optional(Type.Number({ minimum: 1 })),
|
|
419
|
+
|
|
420
|
+
// Field-based conditions (for CONDITION_MET)
|
|
421
|
+
field: Type.Optional(Type.String()),
|
|
422
|
+
operator: Type.Optional(Type.Union([
|
|
423
|
+
Type.Literal('EQUALS'),
|
|
424
|
+
Type.Literal('NOT_EQUALS'),
|
|
425
|
+
Type.Literal('GREATER_THAN'),
|
|
426
|
+
Type.Literal('LESS_THAN'),
|
|
427
|
+
Type.Literal('GREATER_THAN_OR_EQUAL'),
|
|
428
|
+
Type.Literal('LESS_THAN_OR_EQUAL'),
|
|
429
|
+
Type.Literal('CONTAINS'),
|
|
430
|
+
Type.Literal('IN'),
|
|
431
|
+
Type.Literal('EXISTS')
|
|
432
|
+
])),
|
|
433
|
+
value: Type.Optional(Type.Any()),
|
|
434
|
+
|
|
435
|
+
// Custom condition (JSONPath or expression)
|
|
436
|
+
expression: Type.Optional(Type.String())
|
|
437
|
+
}),
|
|
438
|
+
|
|
439
|
+
onSuccess: Type.Object({
|
|
440
|
+
action: Type.Union([
|
|
441
|
+
Type.Literal('CREATE_CHILD_ORDER'),
|
|
442
|
+
Type.Literal('UPDATE_PARENT'),
|
|
443
|
+
Type.Literal('TRIGGER_WEBHOOK'),
|
|
444
|
+
Type.Literal('COMPLETE_STAGE'),
|
|
445
|
+
Type.Literal('NEXT_STAGE'),
|
|
446
|
+
Type.Literal('SKIP_TO'),
|
|
447
|
+
Type.Literal('COMPLETE_PIPELINE')
|
|
448
|
+
]),
|
|
449
|
+
params: Type.Optional(Type.Record(Type.String(), Type.Any())),
|
|
450
|
+
targetStageId: Type.Optional(Type.String()),
|
|
451
|
+
nextStage: Type.Optional(StageExecutionStatusSchema)
|
|
452
|
+
}),
|
|
453
|
+
|
|
454
|
+
onFailure: Type.Optional(Type.Object({
|
|
455
|
+
action: Type.Union([
|
|
456
|
+
Type.Literal('RETRY'),
|
|
457
|
+
Type.Literal('FALLBACK'), // Use fallback processor
|
|
458
|
+
Type.Literal('SKIP_STAGE'),
|
|
459
|
+
Type.Literal('HALT_PIPELINE'),
|
|
460
|
+
Type.Literal('MANUAL_INTERVENTION'),
|
|
461
|
+
Type.Literal('ESCALATE'),
|
|
462
|
+
Type.Literal('AUTO_FAIL'),
|
|
463
|
+
Type.Literal('ALERT')
|
|
464
|
+
]),
|
|
465
|
+
retryCount: Type.Optional(Type.Number({ minimum: 0, maximum: 10 })),
|
|
466
|
+
retryDelay: Type.Optional(Type.Number({ minimum: 0 })),
|
|
467
|
+
retryBackoff: Type.Optional(Type.Union([
|
|
468
|
+
Type.Literal('LINEAR'),
|
|
469
|
+
Type.Literal('EXPONENTIAL')
|
|
470
|
+
])),
|
|
471
|
+
|
|
472
|
+
// Fallback processor options
|
|
473
|
+
fallbackProcessor: Type.Optional(StageAssignmentSchema),
|
|
474
|
+
fallbackStageId: Type.Optional(Type.String())
|
|
475
|
+
}))
|
|
476
|
+
})
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* Enhanced Pipeline Stage Template
|
|
480
|
+
*/
|
|
481
|
+
export const PipelineStageTemplateSchema: TObject<any> = Type.Object({
|
|
482
|
+
id: Type.String(),
|
|
483
|
+
name: Type.String({ minLength: 1, maxLength: 100 }),
|
|
484
|
+
description: Type.Optional(Type.String({ maxLength: 500 })),
|
|
485
|
+
order: Type.Number({ minimum: 1 }),
|
|
486
|
+
|
|
487
|
+
// Processor assignment
|
|
488
|
+
processorType: ContextTypeSchema,
|
|
489
|
+
assignment: StageAssignmentSchema,
|
|
490
|
+
|
|
491
|
+
// Order type for this stage
|
|
492
|
+
orderType: Type.Optional(LSPOrderTypeSchema),
|
|
493
|
+
|
|
494
|
+
// Required capabilities
|
|
495
|
+
requiredCapabilities: Type.Optional(Type.Array(Type.String())),
|
|
496
|
+
|
|
497
|
+
// Transitions
|
|
498
|
+
transitions: Type.Array(StageTransitionRuleSchema),
|
|
499
|
+
|
|
500
|
+
// Skip conditions
|
|
501
|
+
skippable: Type.Boolean(),
|
|
502
|
+
skipConditions: Type.Optional(Type.Array(Type.Object({
|
|
503
|
+
field: Type.String(),
|
|
504
|
+
operator: Type.Union([
|
|
505
|
+
Type.Literal('EQUALS'),
|
|
506
|
+
Type.Literal('NOT_EQUALS'),
|
|
507
|
+
Type.Literal('GREATER_THAN'),
|
|
508
|
+
Type.Literal('LESS_THAN'),
|
|
509
|
+
Type.Literal('GREATER_THAN_OR_EQUAL'),
|
|
510
|
+
Type.Literal('LESS_THAN_OR_EQUAL'),
|
|
511
|
+
Type.Literal('CONTAINS'),
|
|
512
|
+
Type.Literal('IN'),
|
|
513
|
+
Type.Literal('EXISTS')
|
|
514
|
+
]),
|
|
515
|
+
value: Type.Any()
|
|
516
|
+
}))),
|
|
517
|
+
|
|
518
|
+
// Timeout
|
|
519
|
+
timeout: Type.Optional(Type.Object({
|
|
520
|
+
duration: Type.Number({ minimum: 1, description: 'minutes' }),
|
|
521
|
+
action: Type.Union([
|
|
522
|
+
Type.Literal('ALERT'),
|
|
523
|
+
Type.Literal('ESCALATE'),
|
|
524
|
+
Type.Literal('AUTO_FAIL')
|
|
525
|
+
])
|
|
526
|
+
})),
|
|
527
|
+
|
|
528
|
+
// Estimated metrics
|
|
529
|
+
estimatedDuration: Type.Optional(Type.Number({ minimum: 0, description: 'minutes' })),
|
|
530
|
+
estimatedCost: Type.Optional(Type.Number({ minimum: 0 }))
|
|
531
|
+
})
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* Pipeline Template Type
|
|
535
|
+
*/
|
|
536
|
+
export const PipelineTemplateTypeSchema = Type.Union([
|
|
537
|
+
Type.Literal('CSP_TO_CUSTOMER'),
|
|
538
|
+
Type.Literal('CSP_TO_WAREHOUSE'),
|
|
539
|
+
Type.Literal('WAREHOUSE_TO_CUSTOMER'),
|
|
540
|
+
Type.Literal('CROSS_DOCK'),
|
|
541
|
+
Type.Literal('COLD_CHAIN'),
|
|
542
|
+
Type.Literal('MULTI_HUB'),
|
|
543
|
+
Type.Literal('RETURN'),
|
|
544
|
+
Type.Literal('CUSTOM')
|
|
545
|
+
])
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Pipeline Template - Phase 1 (Design-time)
|
|
549
|
+
*/
|
|
550
|
+
export const PipelineTemplateSchema = Type.Object({
|
|
551
|
+
id: Type.String(),
|
|
552
|
+
context: ContextSchema,
|
|
553
|
+
|
|
554
|
+
version: Type.String({ pattern: '^[0-9]+\\.[0-9]+\\.[0-9]+$' }),
|
|
555
|
+
name: Type.String({ minLength: 1, maxLength: 100 }),
|
|
556
|
+
description: Type.Optional(Type.String({ maxLength: 1000 })),
|
|
557
|
+
type: PipelineTemplateTypeSchema,
|
|
558
|
+
|
|
559
|
+
// Visibility
|
|
560
|
+
visibility: Type.Union([
|
|
561
|
+
Type.Literal('PUBLIC'), // Available to all providers
|
|
562
|
+
Type.Literal('PRIVATE'), // Only creator can use
|
|
563
|
+
Type.Literal('SHARED') // Shared with specific providers
|
|
564
|
+
]),
|
|
565
|
+
|
|
566
|
+
// Shared with (if visibility = SHARED)
|
|
567
|
+
sharedWith: Type.Optional(Type.Array(Type.String())),
|
|
568
|
+
|
|
569
|
+
// Stages
|
|
570
|
+
stages: Type.Array(PipelineStageTemplateSchema, { minItems: 1 }),
|
|
571
|
+
|
|
572
|
+
// Applicability rules
|
|
573
|
+
applicableWhen: Type.Optional(Type.Object({
|
|
574
|
+
orderPriority: Type.Optional(Type.Array(Type.String())),
|
|
575
|
+
orderRequirements: Type.Optional(Type.Array(Type.String())),
|
|
576
|
+
originType: Type.Optional(Type.Array(Type.String())),
|
|
577
|
+
destinationType: Type.Optional(Type.Array(Type.String())),
|
|
578
|
+
serviceLevel: Type.Optional(Type.Array(Type.String())),
|
|
579
|
+
temperatureControlled: Type.Optional(Type.Boolean()),
|
|
580
|
+
|
|
581
|
+
// Geographic constraints
|
|
582
|
+
regions: Type.Optional(Type.Array(Type.String())),
|
|
583
|
+
countries: Type.Optional(Type.Array(Type.String())),
|
|
584
|
+
|
|
585
|
+
// Cost constraints
|
|
586
|
+
maxCost: Type.Optional(Type.Number()),
|
|
587
|
+
|
|
588
|
+
// Custom conditions
|
|
589
|
+
customRules: Type.Optional(Type.Array(Type.Object({
|
|
590
|
+
field: Type.String(),
|
|
591
|
+
operator: Type.String(),
|
|
592
|
+
value: Type.Any()
|
|
593
|
+
})))
|
|
594
|
+
})),
|
|
595
|
+
|
|
596
|
+
// Metadata
|
|
597
|
+
tags: Type.Optional(Type.Array(Type.String())),
|
|
598
|
+
category: Type.Optional(Type.String()),
|
|
599
|
+
|
|
600
|
+
// Status
|
|
601
|
+
status: PipelineTemplateStatusSchema,
|
|
602
|
+
|
|
603
|
+
// Timestamps
|
|
604
|
+
created: ActionRecordSchema,
|
|
605
|
+
updated: Type.Optional(ActionRecordSchema)
|
|
606
|
+
})
|
|
607
|
+
|
|
608
|
+
// ============================================================================
|
|
609
|
+
// DEPLOYED PIPELINE (ESTABLISHMENT)
|
|
610
|
+
// ============================================================================
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* Deployed Pipeline Status
|
|
614
|
+
*/
|
|
615
|
+
export const PipelineStatusSchema = Type.Union([
|
|
616
|
+
Type.Literal('DEPLOYING'), // Initial deployment processing
|
|
617
|
+
Type.Literal('VALIDATING'), // Schema and capability validation
|
|
618
|
+
Type.Literal('SIMULATING'), // Initial simulation tests
|
|
619
|
+
Type.Literal('ACTIVE'), // Healthy and assignable
|
|
620
|
+
Type.Literal('DEGRADED'), // Health issues detected
|
|
621
|
+
Type.Literal('DEPRECATED'), // Marked for retirement
|
|
622
|
+
Type.Literal('ARCHIVED') // Historical record
|
|
623
|
+
])
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* Validation Result
|
|
627
|
+
*/
|
|
628
|
+
export const ValidationResultSchema = Type.Object({
|
|
629
|
+
validationType: Type.Union([
|
|
630
|
+
Type.Literal('SCHEMA'), // Template schema validation
|
|
631
|
+
Type.Literal('CAPABILITY'), // Provider capability check
|
|
632
|
+
Type.Literal('SIMULATION'), // Simulation test
|
|
633
|
+
Type.Literal('CAPACITY'), // Real-time capacity check
|
|
634
|
+
Type.Literal('PRE_EXECUTION') // Just-in-time order validation
|
|
635
|
+
]),
|
|
636
|
+
|
|
637
|
+
passed: Type.Boolean(),
|
|
638
|
+
|
|
639
|
+
datetime: DateTimeZoneSchema,
|
|
640
|
+
|
|
641
|
+
// Validation details
|
|
642
|
+
details: Type.Object({
|
|
643
|
+
message: Type.String(),
|
|
644
|
+
|
|
645
|
+
// Specific checks
|
|
646
|
+
checks: Type.Array(Type.Object({
|
|
647
|
+
name: Type.String(),
|
|
648
|
+
passed: Type.Boolean(),
|
|
649
|
+
message: Type.Optional(Type.String()),
|
|
650
|
+
stageId: Type.Optional(Type.String())
|
|
651
|
+
})),
|
|
652
|
+
|
|
653
|
+
// Issues found
|
|
654
|
+
issues: Type.Optional(Type.Array(Type.Object({
|
|
655
|
+
severity: Type.Union([
|
|
656
|
+
Type.Literal('ERROR'),
|
|
657
|
+
Type.Literal('WARNING'),
|
|
658
|
+
Type.Literal('INFO')
|
|
659
|
+
]),
|
|
660
|
+
stageId: Type.Optional(Type.String()),
|
|
661
|
+
message: Type.String(),
|
|
662
|
+
suggestion: Type.Optional(Type.String())
|
|
663
|
+
})))
|
|
664
|
+
}),
|
|
665
|
+
|
|
666
|
+
// Validation duration
|
|
667
|
+
durationMs: Type.Number({ minimum: 0 })
|
|
668
|
+
})
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* Simulation Result
|
|
672
|
+
*/
|
|
673
|
+
export const SimulationResultSchema = Type.Object({
|
|
674
|
+
simulationId: Type.String(),
|
|
675
|
+
|
|
676
|
+
// Simulation type
|
|
677
|
+
simulationType: Type.Union([
|
|
678
|
+
Type.Literal('INITIAL'), // First deployment simulation
|
|
679
|
+
Type.Literal('CONTINUOUS'), // Background health check
|
|
680
|
+
Type.Literal('ON_DEMAND') // Manual retest
|
|
681
|
+
]),
|
|
682
|
+
|
|
683
|
+
// Test scenario
|
|
684
|
+
scenario: Type.Object({
|
|
685
|
+
orderProfile: Type.String(), // Order type tested
|
|
686
|
+
testData: Type.Optional(Type.Record(Type.String(), Type.Any()))
|
|
687
|
+
}),
|
|
688
|
+
|
|
689
|
+
// Results
|
|
690
|
+
passed: Type.Boolean(),
|
|
691
|
+
|
|
692
|
+
// Stage-by-stage results
|
|
693
|
+
stageResults: Type.Array(Type.Object({
|
|
694
|
+
stageId: Type.String(),
|
|
695
|
+
stageName: Type.String(),
|
|
696
|
+
passed: Type.Boolean(),
|
|
697
|
+
|
|
698
|
+
// Provider that would be assigned
|
|
699
|
+
assignedProvider: Type.Optional(ContextSchema),
|
|
700
|
+
|
|
701
|
+
// Capacity check
|
|
702
|
+
hasCapacity: Type.Boolean(),
|
|
703
|
+
availableCapacity: Type.Optional(Type.Number()),
|
|
704
|
+
|
|
705
|
+
// Estimated metrics
|
|
706
|
+
estimatedDuration: Type.Optional(Type.Number()),
|
|
707
|
+
estimatedCost: Type.Optional(Type.Number()),
|
|
708
|
+
|
|
709
|
+
// Issues
|
|
710
|
+
issues: Type.Optional(Type.Array(Type.String()))
|
|
711
|
+
})),
|
|
712
|
+
|
|
713
|
+
// Overall metrics
|
|
714
|
+
totalEstimatedDuration: Type.Optional(Type.Number({ description: 'minutes' })),
|
|
715
|
+
totalEstimatedCost: Type.Optional(Type.Number()),
|
|
716
|
+
|
|
717
|
+
// Timing
|
|
718
|
+
started: ActionRecordSchema,
|
|
719
|
+
completed: ActionRecordSchema,
|
|
720
|
+
durationMs: Type.Number({ minimum: 0 })
|
|
721
|
+
})
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* Health Score Calculation
|
|
725
|
+
*/
|
|
726
|
+
export const HealthScoreSchema = Type.Object({
|
|
727
|
+
// Overall score (0-100)
|
|
728
|
+
score: Type.Number({ minimum: 0, maximum: 100 }),
|
|
729
|
+
|
|
730
|
+
// Component scores
|
|
731
|
+
components: Type.Object({
|
|
732
|
+
// Simulation success rate
|
|
733
|
+
simulationSuccess: Type.Number({ minimum: 0, maximum: 100 }),
|
|
734
|
+
|
|
735
|
+
// Execution success rate (historical)
|
|
736
|
+
executionSuccess: Type.Number({ minimum: 0, maximum: 100 }),
|
|
737
|
+
|
|
738
|
+
// Capacity availability
|
|
739
|
+
capacityAvailability: Type.Number({ minimum: 0, maximum: 100 }),
|
|
740
|
+
|
|
741
|
+
// Performance (speed)
|
|
742
|
+
performance: Type.Number({ minimum: 0, maximum: 100 }),
|
|
743
|
+
|
|
744
|
+
// Cost predictability
|
|
745
|
+
costPredictability: Type.Number({ minimum: 0, maximum: 100 })
|
|
746
|
+
}),
|
|
747
|
+
|
|
748
|
+
// Grade
|
|
749
|
+
grade: Type.Union([
|
|
750
|
+
Type.Literal('A'), // 90-100
|
|
751
|
+
Type.Literal('B'), // 80-89
|
|
752
|
+
Type.Literal('C'), // 70-79
|
|
753
|
+
Type.Literal('D'), // 60-69
|
|
754
|
+
Type.Literal('F') // <60
|
|
755
|
+
]),
|
|
756
|
+
|
|
757
|
+
// Calculation timestamp
|
|
758
|
+
calculated: ActionRecordSchema
|
|
759
|
+
})
|
|
760
|
+
|
|
761
|
+
/**
|
|
762
|
+
* Deployed Pipeline - Phase 2 (Establishment)
|
|
763
|
+
*/
|
|
764
|
+
export const PipelineSchema = Type.Object({
|
|
765
|
+
id: Type.String(),
|
|
766
|
+
context: ContextSchema,
|
|
767
|
+
|
|
768
|
+
// Template reference (locked version)
|
|
769
|
+
template: Type.Object({
|
|
770
|
+
id: Type.String(),
|
|
771
|
+
version: Type.String(), // Frozen copy version
|
|
772
|
+
copy: PipelineTemplateSchema // Frozen copy
|
|
773
|
+
}),
|
|
774
|
+
|
|
775
|
+
// Status
|
|
776
|
+
status: Type.Object({
|
|
777
|
+
current: PipelineStatusSchema,
|
|
778
|
+
reason: Type.Optional(Type.String()),
|
|
779
|
+
updated: Type.Optional(ActionRecordSchema),
|
|
780
|
+
}),
|
|
781
|
+
|
|
782
|
+
// Validation history
|
|
783
|
+
validations: Type.Array(ValidationResultSchema),
|
|
784
|
+
lastValidation: Type.Optional(ValidationResultSchema),
|
|
785
|
+
|
|
786
|
+
// Simulation history
|
|
787
|
+
simulations: Type.Array(SimulationResultSchema),
|
|
788
|
+
lastSimulation: Type.Optional(SimulationResultSchema),
|
|
789
|
+
|
|
790
|
+
// Health monitoring
|
|
791
|
+
healthScore: Type.Optional(HealthScoreSchema),
|
|
792
|
+
healthHistory: Type.Optional(Type.Array(Type.Object({
|
|
793
|
+
score: Type.Number(),
|
|
794
|
+
datetime: DateTimeZoneSchema
|
|
795
|
+
}))),
|
|
796
|
+
|
|
797
|
+
// Continuous testing schedule
|
|
798
|
+
testingSchedule: Type.Object({
|
|
799
|
+
frequency: Type.Union([
|
|
800
|
+
Type.Literal('DAILY'),
|
|
801
|
+
Type.Literal('EVERY_12_HOURS'),
|
|
802
|
+
Type.Literal('EVERY_6_HOURS'),
|
|
803
|
+
Type.Literal('HOURLY')
|
|
804
|
+
]),
|
|
805
|
+
|
|
806
|
+
lastTestAt: Type.Optional(DateTimeZoneSchema),
|
|
807
|
+
nextTestAt: Type.Optional(DateTimeZoneSchema)
|
|
808
|
+
}),
|
|
809
|
+
|
|
810
|
+
// Event triggers
|
|
811
|
+
webhookTriggers: Type.Optional(Type.Array(Type.Object({
|
|
812
|
+
event: Type.String(),
|
|
813
|
+
url: Type.String(),
|
|
814
|
+
description: Type.Optional(Type.String())
|
|
815
|
+
}))),
|
|
816
|
+
|
|
817
|
+
// Usage statistics
|
|
818
|
+
stats: Type.Optional(Type.Object({
|
|
819
|
+
totalExecutions: Type.Number({ minimum: 0 }),
|
|
820
|
+
activeExecutions: Type.Number({ minimum: 0 }),
|
|
821
|
+
completedExecutions: Type.Number({ minimum: 0 }),
|
|
822
|
+
failedExecutions: Type.Number({ minimum: 0 }),
|
|
823
|
+
|
|
824
|
+
// Success rate
|
|
825
|
+
successRate: Type.Number({ minimum: 0, maximum: 100 }),
|
|
826
|
+
|
|
827
|
+
// Performance metrics
|
|
828
|
+
averageDuration: Type.Optional(Type.Number({ description: 'minutes' })),
|
|
829
|
+
averageCost: Type.Optional(Type.Number()),
|
|
830
|
+
|
|
831
|
+
// Timing
|
|
832
|
+
firstExecuted: Type.Optional(ActionRecordSchema),
|
|
833
|
+
lastExecuted: Type.Optional(ActionRecordSchema)
|
|
834
|
+
})),
|
|
835
|
+
|
|
836
|
+
// Deprecation info
|
|
837
|
+
deprecationReason: Type.Optional(Type.String()),
|
|
838
|
+
replacedBy: Type.Optional(Type.String({ description: 'New deployed pipeline ID' })),
|
|
839
|
+
|
|
840
|
+
// Deployment metadata
|
|
841
|
+
deployed: ActionRecordSchema,
|
|
842
|
+
deprecated: Type.Optional(ActionRecordSchema),
|
|
843
|
+
|
|
844
|
+
// Archival
|
|
845
|
+
archived: Type.Optional(ActionRecordSchema)
|
|
846
|
+
})
|
|
847
|
+
|
|
848
|
+
// ============================================================================
|
|
849
|
+
// PIPELINE SEARCH & DISCOVERY
|
|
850
|
+
// ============================================================================
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* Pipeline Search Query
|
|
854
|
+
*/
|
|
855
|
+
export const PipelineSearchQuerySchema = Type.Object({
|
|
856
|
+
// Text search
|
|
857
|
+
query: Type.Optional(Type.String()),
|
|
858
|
+
|
|
859
|
+
// Filters
|
|
860
|
+
filters: Type.Optional(Type.Object({
|
|
861
|
+
type: Type.Optional(PipelineTemplateTypeSchema),
|
|
862
|
+
createdBy: Type.Optional(Type.String()),
|
|
863
|
+
|
|
864
|
+
// Capabilities
|
|
865
|
+
requiredCapabilities: Type.Optional(Type.Array(Type.String())),
|
|
866
|
+
|
|
867
|
+
// Geographic
|
|
868
|
+
regions: Type.Optional(Type.Array(Type.String())),
|
|
869
|
+
countries: Type.Optional(Type.Array(Type.String())),
|
|
870
|
+
|
|
871
|
+
// Performance
|
|
872
|
+
minHealthScore: Type.Optional(Type.Number({ minimum: 0, maximum: 100 })),
|
|
873
|
+
minSuccessRate: Type.Optional(Type.Number({ minimum: 0, maximum: 100 })),
|
|
874
|
+
|
|
875
|
+
// Cost
|
|
876
|
+
maxCost: Type.Optional(Type.Number()),
|
|
877
|
+
|
|
878
|
+
// Service level
|
|
879
|
+
serviceLevel: Type.Optional(Type.Array(Type.String())),
|
|
880
|
+
|
|
881
|
+
// Temperature control
|
|
882
|
+
temperatureControlled: Type.Optional(Type.Boolean()),
|
|
883
|
+
|
|
884
|
+
// Status
|
|
885
|
+
status: Type.Optional(Type.Array(PipelineStatusSchema)),
|
|
886
|
+
|
|
887
|
+
// Tags
|
|
888
|
+
tags: Type.Optional(Type.Array(Type.String()))
|
|
889
|
+
})),
|
|
890
|
+
|
|
891
|
+
// Sorting
|
|
892
|
+
sortBy: Type.Optional(Type.Union([
|
|
893
|
+
Type.Literal('HEALTH_SCORE'),
|
|
894
|
+
Type.Literal('SUCCESS_RATE'),
|
|
895
|
+
Type.Literal('COST'),
|
|
896
|
+
Type.Literal('DURATION'),
|
|
897
|
+
Type.Literal('POPULARITY'),
|
|
898
|
+
Type.Literal('CREATED_AT'),
|
|
899
|
+
Type.Literal('UPDATED_AT')
|
|
900
|
+
])),
|
|
901
|
+
|
|
902
|
+
sortOrder: Type.Optional(Type.Union([
|
|
903
|
+
Type.Literal('ASC'),
|
|
904
|
+
Type.Literal('DESC')
|
|
905
|
+
])),
|
|
906
|
+
|
|
907
|
+
// Pagination
|
|
908
|
+
page: Type.Optional(Type.Number({ minimum: 1 })),
|
|
909
|
+
limit: Type.Optional(Type.Number({ minimum: 1, maximum: 100 })) // default 20
|
|
910
|
+
})
|
|
911
|
+
|
|
912
|
+
/**
|
|
913
|
+
* Pipeline Search Result
|
|
914
|
+
*/
|
|
915
|
+
export const PipelineSearchResultSchema = Type.Object({
|
|
916
|
+
pipeline: PipelineSchema,
|
|
917
|
+
|
|
918
|
+
// Match score
|
|
919
|
+
relevanceScore: Type.Number({ minimum: 0, maximum: 100 }),
|
|
920
|
+
|
|
921
|
+
// Highlight why this matches
|
|
922
|
+
matchReasons: Type.Array(Type.String()),
|
|
923
|
+
|
|
924
|
+
// Quick stats
|
|
925
|
+
quickStats: Type.Object({
|
|
926
|
+
healthScore: Type.Number({ minimum: 0, maximum: 100 }),
|
|
927
|
+
successRate: Type.Number({ minimum: 0, maximum: 100 }),
|
|
928
|
+
totalExecutions: Type.Number({ minimum: 0 }),
|
|
929
|
+
avgDuration: Type.Optional(Type.Number()),
|
|
930
|
+
avgCost: Type.Optional(Type.Number())
|
|
931
|
+
})
|
|
932
|
+
})
|
|
933
|
+
|
|
934
|
+
|
|
935
|
+
// ============================================================================
|
|
936
|
+
// TYPE EXPORTS
|
|
937
|
+
// ============================================================================
|
|
938
|
+
|
|
939
|
+
export type DynamicServiceQuery = Static<typeof DynamicServiceQuerySchema>
|
|
940
|
+
export type StageAssignment = Static<typeof StageAssignmentSchema>
|
|
941
|
+
|
|
942
|
+
export type PipelineTemplateStatus = Static<typeof PipelineTemplateStatusSchema>
|
|
943
|
+
export type StageTransitionRule = Static<typeof StageTransitionRuleSchema>
|
|
944
|
+
export type PipelineStageTemplate = Static<typeof PipelineStageTemplateSchema>
|
|
945
|
+
export type PipelineTemplateType = Static<typeof PipelineTemplateTypeSchema>
|
|
946
|
+
export type PipelineTemplate = Static<typeof PipelineTemplateSchema>
|
|
947
|
+
|
|
948
|
+
export type ValidationResult = Static<typeof ValidationResultSchema>
|
|
949
|
+
export type SimulationResult = Static<typeof SimulationResultSchema>
|
|
950
|
+
export type HealthScore = Static<typeof HealthScoreSchema>
|
|
951
|
+
export type PipelineHealthStatus = Static<typeof PipelineHealthStatusSchema>
|
|
952
|
+
export type PipelineStatus = Static<typeof PipelineStatusSchema>
|
|
953
|
+
export type Pipeline = Static<typeof PipelineSchema>
|
|
954
|
+
|
|
955
|
+
export type PreExecutionValidation = Static<typeof PreExecutionValidationSchema>
|
|
956
|
+
export type StageExecutionStatus = Static<typeof StageExecutionStatusSchema>
|
|
957
|
+
export type StageExecution = Static<typeof StageExecutionSchema>
|
|
958
|
+
export type PipelineExecution = Static<typeof PipelineExecutionSchema>
|
|
959
|
+
export type PipelineExecutionWithHealth = Static<typeof PipelineExecutionWithHealthSchema>
|
|
960
|
+
|
|
961
|
+
export type PipelineSearchQuery = Static<typeof PipelineSearchQuerySchema>
|
|
962
|
+
export type PipelineSearchResult = Static<typeof PipelineSearchResultSchema>
|
|
963
|
+
|
|
964
|
+
export type EscalationSeverity = Static<typeof EscalationSeveritySchema>
|
|
965
|
+
export type EscalationStatus = Static<typeof EscalationStatusSchema>
|
|
966
|
+
export type PipelineEscalation = Static<typeof PipelineEscalationSchema>
|
|
967
|
+
|
|
968
|
+
|
|
969
|
+
// ============================================================================
|
|
970
|
+
// REQUEST VALIDATION SCHEMAS
|
|
971
|
+
// ============================================================================
|
|
972
|
+
// The sufix `RVS` stands for `Request Validation Schema` to keep it short
|
|
973
|
+
|
|
974
|
+
export const PipelineQueriesSearchRVS = {
|
|
975
|
+
params: Type.Object({
|
|
976
|
+
wid: Type.Optional(Type.String()),
|
|
977
|
+
xcode: Type.Optional(Type.String())
|
|
978
|
+
}),
|
|
979
|
+
body: PipelineSearchQuerySchema,
|
|
980
|
+
response: Type.Intersect([
|
|
981
|
+
APIResponseBaseSchema,
|
|
982
|
+
APIResponseDataSchemaFactory({
|
|
983
|
+
results: Type.Array(PipelineSearchResultSchema),
|
|
984
|
+
total: Type.Number(),
|
|
985
|
+
page: Type.Number(),
|
|
986
|
+
limit: Type.Number(),
|
|
987
|
+
facets: Type.Optional(Type.Any())
|
|
988
|
+
})
|
|
989
|
+
])
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
export type PipelineQueriesSearchValidation = {
|
|
993
|
+
params: Static<typeof PipelineQueriesSearchRVS.params>
|
|
994
|
+
body: Static<typeof PipelineQueriesSearchRVS.body>
|
|
995
|
+
response: Static<typeof PipelineQueriesSearchRVS.response>
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
export const PipelineQueriesRecommendRVS = {
|
|
999
|
+
body: Type.Object({
|
|
1000
|
+
orderData: Type.Any(),
|
|
1001
|
+
limit: Type.Optional(Type.Number())
|
|
1002
|
+
}),
|
|
1003
|
+
response: Type.Intersect([
|
|
1004
|
+
APIResponseBaseSchema,
|
|
1005
|
+
APIResponseDataSchemaFactory({
|
|
1006
|
+
recommendations: Type.Array(PipelineSearchResultSchema)
|
|
1007
|
+
})
|
|
1008
|
+
])
|
|
1009
|
+
}
|
|
1010
|
+
export type PipelineQueriesRecommendValidation = {
|
|
1011
|
+
body: Static<typeof PipelineQueriesRecommendRVS.body>
|
|
1012
|
+
response: Static<typeof PipelineQueriesRecommendRVS.response>
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
// ─── Pipelines (main) ────────────────────────────────────────────────────────
|
|
1016
|
+
|
|
1017
|
+
export const PipelineListRVS = {
|
|
1018
|
+
querystring: Type.Intersect([
|
|
1019
|
+
FetchByQueryRequestSchema,
|
|
1020
|
+
Type.Object({
|
|
1021
|
+
status: Type.Optional(PipelineStatusSchema),
|
|
1022
|
+
minHealthScore: Type.Optional(Type.Number())
|
|
1023
|
+
})
|
|
1024
|
+
]),
|
|
1025
|
+
response: Type.Intersect([
|
|
1026
|
+
APIResponseBaseSchema,
|
|
1027
|
+
APIResponseDataSchemaFactory({
|
|
1028
|
+
pipelines: Type.Array(PipelineSchema),
|
|
1029
|
+
total: Type.Number()
|
|
1030
|
+
})
|
|
1031
|
+
])
|
|
1032
|
+
}
|
|
1033
|
+
export type PipelineListValidation = {
|
|
1034
|
+
querystring: Static<typeof PipelineListRVS.querystring>
|
|
1035
|
+
response: Static<typeof PipelineListRVS.response>
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
export const PipelineRetrieveRVS = {
|
|
1039
|
+
response: Type.Intersect([
|
|
1040
|
+
APIResponseBaseSchema,
|
|
1041
|
+
APIResponseDataSchemaFactory({ pipeline: PipelineSchema })
|
|
1042
|
+
])
|
|
1043
|
+
}
|
|
1044
|
+
export type PipelineRetrieveValidation = {
|
|
1045
|
+
response: Static<typeof PipelineRetrieveRVS.response>
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
export const PipelineDeployRVS = {
|
|
1049
|
+
body: Type.Object({
|
|
1050
|
+
templateId: Type.String(),
|
|
1051
|
+
version: Type.Optional(Type.String()),
|
|
1052
|
+
testingSchedule: Type.Optional(Type.Object({
|
|
1053
|
+
frequency: Type.Union([
|
|
1054
|
+
Type.Literal('DAILY'),
|
|
1055
|
+
Type.Literal('EVERY_12_HOURS'),
|
|
1056
|
+
Type.Literal('EVERY_6_HOURS'),
|
|
1057
|
+
Type.Literal('HOURLY')
|
|
1058
|
+
])
|
|
1059
|
+
}))
|
|
1060
|
+
}),
|
|
1061
|
+
response: Type.Intersect([
|
|
1062
|
+
APIResponseBaseSchema,
|
|
1063
|
+
APIResponseDataSchemaFactory({
|
|
1064
|
+
pid: Type.String(),
|
|
1065
|
+
deploymentStatus: Type.String()
|
|
1066
|
+
})
|
|
1067
|
+
])
|
|
1068
|
+
}
|
|
1069
|
+
export type PipelineDeployValidation = {
|
|
1070
|
+
body: Static<typeof PipelineDeployRVS.body>
|
|
1071
|
+
response: Static<typeof PipelineDeployRVS.response>
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
export const PipelineValidateRVS = {
|
|
1075
|
+
response: Type.Intersect([
|
|
1076
|
+
APIResponseBaseSchema,
|
|
1077
|
+
APIResponseDataSchemaFactory({ validation: ValidationResultSchema })
|
|
1078
|
+
])
|
|
1079
|
+
}
|
|
1080
|
+
export type PipelineValidateValidation = {
|
|
1081
|
+
response: Static<typeof PipelineValidateRVS.response>
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
export const PipelineSimulateRVS = {
|
|
1085
|
+
body: Type.Object({
|
|
1086
|
+
scenario: Type.Optional(Type.Object({
|
|
1087
|
+
orderProfile: Type.String(),
|
|
1088
|
+
testData: Type.Optional(Type.Any())
|
|
1089
|
+
}))
|
|
1090
|
+
}),
|
|
1091
|
+
response: Type.Intersect([
|
|
1092
|
+
APIResponseBaseSchema,
|
|
1093
|
+
APIResponseDataSchemaFactory({ simulation: SimulationResultSchema })
|
|
1094
|
+
])
|
|
1095
|
+
}
|
|
1096
|
+
export type PipelineSimulateValidation = {
|
|
1097
|
+
body: Static<typeof PipelineSimulateRVS.body>
|
|
1098
|
+
response: Static<typeof PipelineSimulateRVS.response>
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
export const PipelineSetStatusRVS = {
|
|
1102
|
+
response: Type.Intersect([
|
|
1103
|
+
APIResponseBaseSchema,
|
|
1104
|
+
APIResponseDataSchemaFactory({ pipeline: PipelineSchema })
|
|
1105
|
+
])
|
|
1106
|
+
}
|
|
1107
|
+
export type PipelineSetStatusValidation = {
|
|
1108
|
+
response: Static<typeof PipelineSetStatusRVS.response>
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
// ─── Monitor ─────────────────────────────────────────────────────────────────
|
|
1112
|
+
|
|
1113
|
+
export const PipelineMonitorListRVS = {
|
|
1114
|
+
querystring: Type.Object({
|
|
1115
|
+
status: Type.Optional(Type.Union([
|
|
1116
|
+
Type.Literal('INITIALIZED'),
|
|
1117
|
+
Type.Literal('RUNNING'),
|
|
1118
|
+
Type.Literal('WAITING'),
|
|
1119
|
+
Type.Literal('COMPLETED'),
|
|
1120
|
+
Type.Literal('FAILED'),
|
|
1121
|
+
Type.Literal('HALTED')
|
|
1122
|
+
])),
|
|
1123
|
+
pid: Type.Optional(Type.String()),
|
|
1124
|
+
limit: Type.Optional(Type.Number({ minimum: 1, maximum: 100 })),
|
|
1125
|
+
offset: Type.Optional(Type.Number({ minimum: 0 }))
|
|
1126
|
+
}),
|
|
1127
|
+
response: Type.Intersect([
|
|
1128
|
+
APIResponseBaseSchema,
|
|
1129
|
+
APIResponseDataSchemaFactory({
|
|
1130
|
+
executions: Type.Array(PipelineExecutionWithHealthSchema),
|
|
1131
|
+
total: Type.Number()
|
|
1132
|
+
})
|
|
1133
|
+
])
|
|
1134
|
+
}
|
|
1135
|
+
export type PipelineMonitorListValidation = {
|
|
1136
|
+
querystring: Static<typeof PipelineMonitorListRVS.querystring>
|
|
1137
|
+
response: Static<typeof PipelineMonitorListRVS.response>
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
export const PipelineMonitorGetRVS = {
|
|
1141
|
+
response: Type.Intersect([
|
|
1142
|
+
APIResponseBaseSchema,
|
|
1143
|
+
APIResponseDataSchemaFactory({
|
|
1144
|
+
execution: PipelineExecutionSchema,
|
|
1145
|
+
health: PipelineHealthStatusSchema,
|
|
1146
|
+
pipeline: Type.Optional(Type.Any()),
|
|
1147
|
+
metrics: Type.Optional(Type.Object({
|
|
1148
|
+
totalStages: Type.Number(),
|
|
1149
|
+
completedStages: Type.Number(),
|
|
1150
|
+
failedStages: Type.Number(),
|
|
1151
|
+
skippedStages: Type.Number(),
|
|
1152
|
+
progressPercentage: Type.Number()
|
|
1153
|
+
}))
|
|
1154
|
+
})
|
|
1155
|
+
])
|
|
1156
|
+
}
|
|
1157
|
+
export type PipelineMonitorGetValidation = {
|
|
1158
|
+
response: Static<typeof PipelineMonitorGetRVS.response>
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
export const PipelineMonitorOverviewRVS = {
|
|
1162
|
+
response: Type.Intersect([
|
|
1163
|
+
APIResponseBaseSchema,
|
|
1164
|
+
APIResponseDataSchemaFactory({
|
|
1165
|
+
stats: Type.Object({
|
|
1166
|
+
activeExecutions: Type.Number(),
|
|
1167
|
+
stalledStages: Type.Number(),
|
|
1168
|
+
timedOutStages: Type.Number(),
|
|
1169
|
+
completedToday: Type.Number(),
|
|
1170
|
+
failedToday: Type.Number()
|
|
1171
|
+
}),
|
|
1172
|
+
alerts: Type.Array(Type.Object({
|
|
1173
|
+
severity: Type.Union([
|
|
1174
|
+
Type.Literal('LOW'),
|
|
1175
|
+
Type.Literal('WARNING'),
|
|
1176
|
+
Type.Literal('HIGH'),
|
|
1177
|
+
Type.Literal('CRITICAL')
|
|
1178
|
+
]),
|
|
1179
|
+
message: Type.String(),
|
|
1180
|
+
executionId: Type.String(),
|
|
1181
|
+
stageId: Type.Optional(Type.String()),
|
|
1182
|
+
timestamp: Type.Number()
|
|
1183
|
+
})),
|
|
1184
|
+
recentFailures: Type.Array(Type.Object({
|
|
1185
|
+
executionId: Type.String(),
|
|
1186
|
+
orderReference: Type.String(),
|
|
1187
|
+
failedAt: Type.Number(),
|
|
1188
|
+
reason: Type.String()
|
|
1189
|
+
}))
|
|
1190
|
+
})
|
|
1191
|
+
])
|
|
1192
|
+
}
|
|
1193
|
+
export type PipelineMonitorOverviewValidation = {
|
|
1194
|
+
response: Static<typeof PipelineMonitorOverviewRVS.response>
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
// ─── Webhooks ─────────────────────────────────────────────────────────────────
|
|
1198
|
+
|
|
1199
|
+
export const PipelineWebhookEventTypeSchema = Type.Union([
|
|
1200
|
+
Type.Literal('CAPACITY_CHANGE'),
|
|
1201
|
+
Type.Literal('PROVIDER_UNAVAILABLE'),
|
|
1202
|
+
Type.Literal('COST_CHANGE'),
|
|
1203
|
+
Type.Literal('COMPLIANCE_UPDATE'),
|
|
1204
|
+
Type.Literal('CUSTOM')
|
|
1205
|
+
])
|
|
1206
|
+
export type PipelineWebhookEventType = Static<typeof PipelineWebhookEventTypeSchema>
|
|
1207
|
+
|
|
1208
|
+
export const PipelineWebhookProcessRVS = {
|
|
1209
|
+
body: Type.Object({
|
|
1210
|
+
type: PipelineWebhookEventTypeSchema,
|
|
1211
|
+
source: Type.String(),
|
|
1212
|
+
timestamp: Type.String(),
|
|
1213
|
+
data: Type.Any(),
|
|
1214
|
+
affectedEntities: Type.Optional(Type.Array(Type.Object({
|
|
1215
|
+
type: Type.Union([
|
|
1216
|
+
Type.Literal('WAREHOUSE'),
|
|
1217
|
+
Type.Literal('CARRIER'),
|
|
1218
|
+
Type.Literal('HUB'),
|
|
1219
|
+
Type.Literal('TERMINAL'),
|
|
1220
|
+
Type.Literal('IOTSP')
|
|
1221
|
+
]),
|
|
1222
|
+
id: Type.String()
|
|
1223
|
+
})))
|
|
1224
|
+
}),
|
|
1225
|
+
response: Type.Intersect([
|
|
1226
|
+
APIResponseBaseSchema,
|
|
1227
|
+
APIResponseDataSchemaFactory({
|
|
1228
|
+
result: Type.Object({
|
|
1229
|
+
processed: Type.Boolean(),
|
|
1230
|
+
pipelinesAffected: Type.Number(),
|
|
1231
|
+
validationsTriggered: Type.Number(),
|
|
1232
|
+
simulationsTriggered: Type.Number(),
|
|
1233
|
+
errors: Type.Array(Type.String())
|
|
1234
|
+
})
|
|
1235
|
+
})
|
|
1236
|
+
])
|
|
1237
|
+
}
|
|
1238
|
+
export type PipelineWebhookProcessValidation = {
|
|
1239
|
+
body: Static<typeof PipelineWebhookProcessRVS.body>
|
|
1240
|
+
response: Static<typeof PipelineWebhookProcessRVS.response>
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
export const PipelineWebhookRegisterRVS = {
|
|
1244
|
+
body: Type.Object({
|
|
1245
|
+
url: Type.String(),
|
|
1246
|
+
events: Type.Array(PipelineWebhookEventTypeSchema),
|
|
1247
|
+
secret: Type.Optional(Type.String())
|
|
1248
|
+
})
|
|
1249
|
+
}
|
|
1250
|
+
export type PipelineWebhookRegisterValidation = {
|
|
1251
|
+
body: Static<typeof PipelineWebhookRegisterRVS.body>
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
// ─── Templates ────────────────────────────────────────────────────────────────
|
|
1255
|
+
|
|
1256
|
+
export const PipelineTemplateCreateRVS = {
|
|
1257
|
+
body: Type.Omit(PipelineTemplateSchema, ['id', 'created', 'status', 'context']),
|
|
1258
|
+
response: Type.Intersect([
|
|
1259
|
+
APIResponseBaseSchema,
|
|
1260
|
+
APIResponseDataSchemaFactory({ template: PipelineTemplateSchema })
|
|
1261
|
+
])
|
|
1262
|
+
}
|
|
1263
|
+
export type PipelineTemplateCreateValidation = {
|
|
1264
|
+
body: Static<typeof PipelineTemplateCreateRVS.body>
|
|
1265
|
+
response: Static<typeof PipelineTemplateCreateRVS.response>
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
export const PipelineTemplateListRVS = {
|
|
1269
|
+
querystring: Type.Intersect([
|
|
1270
|
+
FetchByQueryRequestSchema,
|
|
1271
|
+
Type.Object({
|
|
1272
|
+
status: Type.Optional(PipelineTemplateStatusSchema),
|
|
1273
|
+
type: Type.Optional(Type.String()),
|
|
1274
|
+
createdBy: Type.Optional(Type.String())
|
|
1275
|
+
})
|
|
1276
|
+
]),
|
|
1277
|
+
response: Type.Intersect([
|
|
1278
|
+
APIResponseBaseSchema,
|
|
1279
|
+
APIResponseDataSchemaFactory({
|
|
1280
|
+
templates: Type.Array(PipelineTemplateSchema),
|
|
1281
|
+
total: Type.Number()
|
|
1282
|
+
})
|
|
1283
|
+
])
|
|
1284
|
+
}
|
|
1285
|
+
export type PipelineTemplateListValidation = {
|
|
1286
|
+
querystring: Static<typeof PipelineTemplateListRVS.querystring>
|
|
1287
|
+
response: Static<typeof PipelineTemplateListRVS.response>
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
export const PipelineTemplateGetRVS = {
|
|
1291
|
+
response: Type.Intersect([
|
|
1292
|
+
APIResponseBaseSchema,
|
|
1293
|
+
APIResponseDataSchemaFactory({
|
|
1294
|
+
template: PipelineTemplateSchema,
|
|
1295
|
+
versions: Type.Array(Type.String())
|
|
1296
|
+
})
|
|
1297
|
+
])
|
|
1298
|
+
}
|
|
1299
|
+
export type PipelineTemplateGetValidation = {
|
|
1300
|
+
response: Static<typeof PipelineTemplateGetRVS.response>
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
export const PipelineTemplateUpdateRVS = {
|
|
1304
|
+
body: Type.Partial(Type.Omit(PipelineTemplateSchema, ['id', 'created'])),
|
|
1305
|
+
response: Type.Intersect([
|
|
1306
|
+
APIResponseBaseSchema,
|
|
1307
|
+
APIResponseDataSchemaFactory({ template: PipelineTemplateSchema })
|
|
1308
|
+
])
|
|
1309
|
+
}
|
|
1310
|
+
export type PipelineTemplateUpdateValidation = {
|
|
1311
|
+
body: Static<typeof PipelineTemplateUpdateRVS.body>
|
|
1312
|
+
response: Static<typeof PipelineTemplateUpdateRVS.response>
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
// ─── Analytics ────────────────────────────────────────────────────────────────
|
|
1316
|
+
|
|
1317
|
+
export const PipelineAnalyticsOverviewRVS = {
|
|
1318
|
+
querystring: Type.Object({
|
|
1319
|
+
timeRange: Type.Optional(Type.Union([
|
|
1320
|
+
Type.Literal('24h'),
|
|
1321
|
+
Type.Literal('7d'),
|
|
1322
|
+
Type.Literal('30d'),
|
|
1323
|
+
Type.Literal('90d')
|
|
1324
|
+
])),
|
|
1325
|
+
includeArchived: Type.Optional(Type.Boolean())
|
|
1326
|
+
}),
|
|
1327
|
+
response: Type.Intersect([
|
|
1328
|
+
APIResponseBaseSchema,
|
|
1329
|
+
APIResponseDataSchemaFactory({
|
|
1330
|
+
analytics: Type.Object({
|
|
1331
|
+
summary: Type.Object({
|
|
1332
|
+
totalTemplates: Type.Number(),
|
|
1333
|
+
totalDeployedPipelines: Type.Number(),
|
|
1334
|
+
totalExecutions: Type.Number(),
|
|
1335
|
+
activeExecutions: Type.Number()
|
|
1336
|
+
}),
|
|
1337
|
+
health: Type.Object({
|
|
1338
|
+
averageHealthScore: Type.Number(),
|
|
1339
|
+
healthDistribution: Type.Record(Type.String(), Type.Number())
|
|
1340
|
+
}),
|
|
1341
|
+
performance: Type.Object({
|
|
1342
|
+
averageSuccessRate: Type.Number(),
|
|
1343
|
+
totalSuccessfulExecutions: Type.Number(),
|
|
1344
|
+
totalFailedExecutions: Type.Number(),
|
|
1345
|
+
averageDuration: Type.Optional(Type.Number()),
|
|
1346
|
+
averageCost: Type.Optional(Type.Number())
|
|
1347
|
+
}),
|
|
1348
|
+
trends: Type.Optional(Type.Object({
|
|
1349
|
+
executionsOverTime: Type.Array(Type.Object({ date: Type.String(), count: Type.Number() })),
|
|
1350
|
+
successRateOverTime: Type.Array(Type.Object({ date: Type.String(), rate: Type.Number() }))
|
|
1351
|
+
}))
|
|
1352
|
+
})
|
|
1353
|
+
})
|
|
1354
|
+
])
|
|
1355
|
+
}
|
|
1356
|
+
export type PipelineAnalyticsOverviewValidation = {
|
|
1357
|
+
querystring: Static<typeof PipelineAnalyticsOverviewRVS.querystring>
|
|
1358
|
+
response: Static<typeof PipelineAnalyticsOverviewRVS.response>
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
export const PipelineAnalyticsPipelineRVS = {
|
|
1362
|
+
querystring: Type.Object({
|
|
1363
|
+
timeRange: Type.Optional(Type.String())
|
|
1364
|
+
}),
|
|
1365
|
+
response: Type.Intersect([
|
|
1366
|
+
APIResponseBaseSchema,
|
|
1367
|
+
APIResponseDataSchemaFactory({
|
|
1368
|
+
stats: Type.Object({
|
|
1369
|
+
executions: Type.Object({
|
|
1370
|
+
total: Type.Number(),
|
|
1371
|
+
successful: Type.Number(),
|
|
1372
|
+
failed: Type.Number(),
|
|
1373
|
+
successRate: Type.Number()
|
|
1374
|
+
}),
|
|
1375
|
+
performance: Type.Object({
|
|
1376
|
+
averageDuration: Type.Optional(Type.Number()),
|
|
1377
|
+
averageCost: Type.Optional(Type.Number()),
|
|
1378
|
+
stagePerformance: Type.Optional(Type.Array(Type.Object({
|
|
1379
|
+
stageId: Type.String(),
|
|
1380
|
+
stageName: Type.String(),
|
|
1381
|
+
averageDuration: Type.Number(),
|
|
1382
|
+
successRate: Type.Number()
|
|
1383
|
+
})))
|
|
1384
|
+
}),
|
|
1385
|
+
health: Type.Object({
|
|
1386
|
+
currentScore: Type.Number(),
|
|
1387
|
+
trend: Type.String(),
|
|
1388
|
+
recentIssues: Type.Array(Type.String())
|
|
1389
|
+
})
|
|
1390
|
+
})
|
|
1391
|
+
})
|
|
1392
|
+
])
|
|
1393
|
+
}
|
|
1394
|
+
export type PipelineAnalyticsPipelineValidation = {
|
|
1395
|
+
querystring: Static<typeof PipelineAnalyticsPipelineRVS.querystring>
|
|
1396
|
+
response: Static<typeof PipelineAnalyticsPipelineRVS.response>
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
// ─── Executions ───────────────────────────────────────────────────────────────
|
|
1400
|
+
|
|
1401
|
+
export const PipelineExecutionCreateRVS = {
|
|
1402
|
+
body: Type.Object({
|
|
1403
|
+
pid: Type.String(),
|
|
1404
|
+
orderReference: Type.String(),
|
|
1405
|
+
preValidate: Type.Optional(Type.Boolean())
|
|
1406
|
+
}),
|
|
1407
|
+
response: Type.Intersect([
|
|
1408
|
+
APIResponseBaseSchema,
|
|
1409
|
+
APIResponseDataSchemaFactory({
|
|
1410
|
+
execution: Type.Optional(PipelineExecutionSchema),
|
|
1411
|
+
validationFailed: Type.Optional(Type.Boolean())
|
|
1412
|
+
})
|
|
1413
|
+
])
|
|
1414
|
+
}
|
|
1415
|
+
export type PipelineExecutionCreateValidation = {
|
|
1416
|
+
body: Static<typeof PipelineExecutionCreateRVS.body>
|
|
1417
|
+
response: Static<typeof PipelineExecutionCreateRVS.response>
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
export const PipelineExecutionListRVS = {
|
|
1421
|
+
querystring: Type.Intersect([
|
|
1422
|
+
FetchByQueryRequestSchema,
|
|
1423
|
+
Type.Object({
|
|
1424
|
+
pid: Type.Optional(Type.String()),
|
|
1425
|
+
status: Type.Optional(Type.String()),
|
|
1426
|
+
orderReference: Type.Optional(Type.String())
|
|
1427
|
+
})
|
|
1428
|
+
]),
|
|
1429
|
+
response: Type.Intersect([
|
|
1430
|
+
APIResponseBaseSchema,
|
|
1431
|
+
APIResponseDataSchemaFactory({
|
|
1432
|
+
executions: Type.Array(PipelineExecutionSchema),
|
|
1433
|
+
total: Type.Number()
|
|
1434
|
+
})
|
|
1435
|
+
])
|
|
1436
|
+
}
|
|
1437
|
+
export type PipelineExecutionListValidation = {
|
|
1438
|
+
querystring: Static<typeof PipelineExecutionListRVS.querystring>
|
|
1439
|
+
response: Static<typeof PipelineExecutionListRVS.response>
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
export const PipelineExecutionGetRVS = {
|
|
1443
|
+
response: Type.Intersect([
|
|
1444
|
+
APIResponseBaseSchema,
|
|
1445
|
+
APIResponseDataSchemaFactory({ execution: PipelineExecutionSchema })
|
|
1446
|
+
])
|
|
1447
|
+
}
|
|
1448
|
+
export type PipelineExecutionGetValidation = {
|
|
1449
|
+
response: Static<typeof PipelineExecutionGetRVS.response>
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
export const PipelineExecutionActionRVS = {
|
|
1453
|
+
response: Type.Intersect([
|
|
1454
|
+
APIResponseBaseSchema,
|
|
1455
|
+
APIResponseDataSchemaFactory({ execution: PipelineExecutionSchema })
|
|
1456
|
+
])
|
|
1457
|
+
}
|
|
1458
|
+
export type PipelineExecutionActionValidation = {
|
|
1459
|
+
response: Static<typeof PipelineExecutionActionRVS.response>
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
export const PipelineExecutionCancelRVS = {
|
|
1463
|
+
body: Type.Object({
|
|
1464
|
+
reason: Type.String()
|
|
1465
|
+
}),
|
|
1466
|
+
response: Type.Intersect([
|
|
1467
|
+
APIResponseBaseSchema,
|
|
1468
|
+
APIResponseDataSchemaFactory({ execution: PipelineExecutionSchema })
|
|
1469
|
+
])
|
|
1470
|
+
}
|
|
1471
|
+
export type PipelineExecutionCancelValidation = {
|
|
1472
|
+
body: Static<typeof PipelineExecutionCancelRVS.body>
|
|
1473
|
+
response: Static<typeof PipelineExecutionCancelRVS.response>
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
// ─── Escalations ──────────────────────────────────────────────────────────────
|
|
1477
|
+
|
|
1478
|
+
export const PipelineEscalationListRVS = {
|
|
1479
|
+
querystring: Type.Object({
|
|
1480
|
+
status: Type.Optional(EscalationStatusSchema),
|
|
1481
|
+
severity: Type.Optional(EscalationSeveritySchema),
|
|
1482
|
+
limit: Type.Optional(Type.Number({ minimum: 1, maximum: 100 })),
|
|
1483
|
+
offset: Type.Optional(Type.Number({ minimum: 0 }))
|
|
1484
|
+
}),
|
|
1485
|
+
response: Type.Intersect([
|
|
1486
|
+
APIResponseBaseSchema,
|
|
1487
|
+
APIResponseDataSchemaFactory({
|
|
1488
|
+
escalations: Type.Array(Type.Omit(PipelineEscalationSchema, ['context'])),
|
|
1489
|
+
total: Type.Number()
|
|
1490
|
+
})
|
|
1491
|
+
])
|
|
1492
|
+
}
|
|
1493
|
+
export type PipelineEscalationListValidation = {
|
|
1494
|
+
querystring: Static<typeof PipelineEscalationListRVS.querystring>
|
|
1495
|
+
response: Static<typeof PipelineEscalationListRVS.response>
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
export const PipelineEscalationResolveRVS = {
|
|
1499
|
+
body: Type.Object({
|
|
1500
|
+
resolution: Type.String({ minLength: 10, maxLength: 1000 }),
|
|
1501
|
+
resumeStage: Type.Boolean(),
|
|
1502
|
+
metadata: Type.Optional(Type.Record(Type.String(), Type.Any()))
|
|
1503
|
+
}),
|
|
1504
|
+
response: Type.Intersect([
|
|
1505
|
+
APIResponseBaseSchema,
|
|
1506
|
+
APIResponseDataSchemaFactory({
|
|
1507
|
+
resolved: Type.Boolean(),
|
|
1508
|
+
execution: Type.Optional(PipelineExecutionSchema),
|
|
1509
|
+
message: Type.String()
|
|
1510
|
+
})
|
|
1511
|
+
])
|
|
1512
|
+
}
|
|
1513
|
+
export type PipelineEscalationResolveValidation = {
|
|
1514
|
+
body: Static<typeof PipelineEscalationResolveRVS.body>
|
|
1515
|
+
response: Static<typeof PipelineEscalationResolveRVS.response>
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
// ─── Interventions ────────────────────────────────────────────────────────────
|
|
1519
|
+
|
|
1520
|
+
export const PipelineInterventionStageRVS = {
|
|
1521
|
+
body: Type.Object({
|
|
1522
|
+
action: Type.Union([
|
|
1523
|
+
Type.Literal('RETRY_STAGE'),
|
|
1524
|
+
Type.Literal('COMPLETE_STAGE'),
|
|
1525
|
+
Type.Literal('FAIL_STAGE'),
|
|
1526
|
+
Type.Literal('SKIP_STAGE'),
|
|
1527
|
+
Type.Literal('RESELECT_PROCESSOR')
|
|
1528
|
+
]),
|
|
1529
|
+
reason: Type.String({ minLength: 10, maxLength: 500 }),
|
|
1530
|
+
metadata: Type.Optional(Type.Record(Type.String(), Type.Any()))
|
|
1531
|
+
}),
|
|
1532
|
+
response: Type.Intersect([
|
|
1533
|
+
APIResponseBaseSchema,
|
|
1534
|
+
APIResponseDataSchemaFactory({
|
|
1535
|
+
applied: Type.Boolean(),
|
|
1536
|
+
execution: PipelineExecutionSchema,
|
|
1537
|
+
message: Type.String(),
|
|
1538
|
+
recoveryAttempted: Type.Optional(Type.Boolean()),
|
|
1539
|
+
newProcessor: Type.Optional(Type.Object({
|
|
1540
|
+
wid: Type.String(),
|
|
1541
|
+
type: Type.String(),
|
|
1542
|
+
xcode: Type.String()
|
|
1543
|
+
}))
|
|
1544
|
+
})
|
|
1545
|
+
])
|
|
1546
|
+
}
|
|
1547
|
+
export type PipelineInterventionStageValidation = {
|
|
1548
|
+
body: Static<typeof PipelineInterventionStageRVS.body>
|
|
1549
|
+
response: Static<typeof PipelineInterventionStageRVS.response>
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
export const PipelineInterventionExecutionRVS = {
|
|
1553
|
+
body: Type.Object({
|
|
1554
|
+
action: Type.Union([
|
|
1555
|
+
Type.Literal('HALT_EXECUTION'),
|
|
1556
|
+
Type.Literal('RESUME_EXECUTION'),
|
|
1557
|
+
Type.Literal('FORCE_PROGRESS'),
|
|
1558
|
+
Type.Literal('CANCEL_EXECUTION')
|
|
1559
|
+
]),
|
|
1560
|
+
reason: Type.String({ minLength: 10, maxLength: 500 }),
|
|
1561
|
+
metadata: Type.Optional(Type.Record(Type.String(), Type.Any()))
|
|
1562
|
+
}),
|
|
1563
|
+
response: Type.Intersect([
|
|
1564
|
+
APIResponseBaseSchema,
|
|
1565
|
+
APIResponseDataSchemaFactory({
|
|
1566
|
+
applied: Type.Boolean(),
|
|
1567
|
+
execution: PipelineExecutionSchema,
|
|
1568
|
+
message: Type.String()
|
|
1569
|
+
})
|
|
1570
|
+
])
|
|
1571
|
+
}
|
|
1572
|
+
export type PipelineInterventionExecutionValidation = {
|
|
1573
|
+
body: Static<typeof PipelineInterventionExecutionRVS.body>
|
|
1574
|
+
response: Static<typeof PipelineInterventionExecutionRVS.response>
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
// ─── Workers ──────────────────────────────────────────────────────────────────
|
|
1578
|
+
|
|
1579
|
+
export const PipelineWorkerInitializeRVS = {
|
|
1580
|
+
response: Type.Intersect([
|
|
1581
|
+
APIResponseBaseSchema,
|
|
1582
|
+
APIResponseDataSchemaFactory({ workers: Type.Array(Type.String()) })
|
|
1583
|
+
])
|
|
1584
|
+
}
|
|
1585
|
+
export type PipelineWorkerInitializeValidation = {
|
|
1586
|
+
response: Static<typeof PipelineWorkerInitializeRVS.response>
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
export const PipelineWorkerStatsRVS = {
|
|
1590
|
+
response: Type.Intersect([
|
|
1591
|
+
APIResponseBaseSchema,
|
|
1592
|
+
APIResponseDataSchemaFactory({ workers: Type.Array(Type.Any()) })
|
|
1593
|
+
])
|
|
1594
|
+
}
|
|
1595
|
+
export type PipelineWorkerStatsValidation = {
|
|
1596
|
+
response: Static<typeof PipelineWorkerStatsRVS.response>
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
export const PipelineWorkerStatsByNameRVS = {
|
|
1600
|
+
response: Type.Intersect([
|
|
1601
|
+
APIResponseBaseSchema,
|
|
1602
|
+
APIResponseDataSchemaFactory({ worker: Type.Any() })
|
|
1603
|
+
])
|
|
1604
|
+
}
|
|
1605
|
+
export type PipelineWorkerStatsByNameValidation = {
|
|
1606
|
+
response: Static<typeof PipelineWorkerStatsByNameRVS.response>
|
|
1607
|
+
}
|