@timeax/digital-service-engine 0.2.1 → 0.2.3

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.
@@ -261,6 +261,7 @@ type ServiceFallback = {
261
261
  };
262
262
  type FallbackEditorServiceMap = DgpServiceMap;
263
263
  type FallbackRegistrationScope = "global" | "node";
264
+ type FallbackEligibleSource = "all_services" | "registered";
264
265
  type FallbackScopeRef = {
265
266
  scope: "global";
266
267
  primary: ServiceIdRef;
@@ -591,16 +592,6 @@ declare function resolveServiceFallback(params: {
591
592
  props: ServiceProps;
592
593
  }): ServiceIdRef | null;
593
594
  declare function collectFailedFallbacks(props: ServiceProps, services: DgpServiceMap, settings?: FallbackSettings): FailedFallbackContext[];
594
- /**
595
- * Return all fallback candidates that are eligible for the given primary,
596
- * respecting:
597
- * - node-scoped list first (if nodeId provided), then global list for `primary`
598
- * - rate policy vs. primary
599
- * - (optional) tag constraint fit, only when tagId is provided and requireConstraintFit=true
600
- * - excludes (including primary automatically)
601
- * - selectionStrategy: 'priority' keeps list order, 'cheapest' sorts by rate asc
602
- * - unique (dedupe) and optional limit
603
- */
604
595
  declare function getEligibleFallbacks(params: {
605
596
  primary: ServiceIdRef;
606
597
  nodeId?: NodeIdRef;
@@ -612,6 +603,11 @@ declare function getEligibleFallbacks(params: {
612
603
  exclude?: Array<ServiceIdRef>;
613
604
  unique?: boolean;
614
605
  limit?: number;
606
+ source?: FallbackEligibleSource;
607
+ }): ServiceIdRef[];
608
+ declare function getAssignedServiceIds(params: {
609
+ props?: ServiceProps;
610
+ snapshot?: OrderSnapshot;
615
611
  }): ServiceIdRef[];
616
612
  declare function getFallbackRegistrationInfo(props: ServiceProps, nodeId: NodeIdRef): {
617
613
  primary?: ServiceIdRef;
@@ -842,8 +838,9 @@ interface FallbackEditor {
842
838
  exclude?: ServiceIdRef[];
843
839
  unique?: boolean;
844
840
  limit?: number;
841
+ source?: FallbackEligibleSource;
845
842
  }): ServiceIdRef[];
846
843
  }
847
844
  declare function createFallbackEditor(options?: FallbackEditorOptions): FallbackEditor;
848
845
 
849
- export { type AncestryHit, type AnyNode, type Builder, type BuilderOptions, type FailedFallbackContext, type FallbackEditor, type FieldNode, type FilterServicesForVisibleGroupInput, type FilterServicesForVisibleGroupResult, type NodeIndex, type NodeKind, type NormaliseOptions, type OptionNode, type RateCoherenceDiagnostic, type RelKind, type ServiceCheck, type TagNode, type UnknownNode, type WithAncestry, buildOrderSnapshot, collectFailedFallbacks, createBuilder, createFallbackEditor, createNodeIndex, filterServicesForVisibleGroup, getEligibleFallbacks, getFallbackRegistrationInfo, normalise, normalizeFieldValidation, resolveServiceFallback, validate, validateAsync, validateRateCoherenceDeep };
846
+ export { type AncestryHit, type AnyNode, type Builder, type BuilderOptions, type FailedFallbackContext, type FallbackEditor, type FieldNode, type FilterServicesForVisibleGroupInput, type FilterServicesForVisibleGroupResult, type NodeIndex, type NodeKind, type NormaliseOptions, type OptionNode, type RateCoherenceDiagnostic, type RelKind, type ServiceCheck, type TagNode, type UnknownNode, type WithAncestry, buildOrderSnapshot, collectFailedFallbacks, createBuilder, createFallbackEditor, createNodeIndex, filterServicesForVisibleGroup, getAssignedServiceIds, getEligibleFallbacks, getFallbackRegistrationInfo, normalise, normalizeFieldValidation, resolveServiceFallback, validate, validateAsync, validateRateCoherenceDeep };
@@ -261,6 +261,7 @@ type ServiceFallback = {
261
261
  };
262
262
  type FallbackEditorServiceMap = DgpServiceMap;
263
263
  type FallbackRegistrationScope = "global" | "node";
264
+ type FallbackEligibleSource = "all_services" | "registered";
264
265
  type FallbackScopeRef = {
265
266
  scope: "global";
266
267
  primary: ServiceIdRef;
@@ -591,16 +592,6 @@ declare function resolveServiceFallback(params: {
591
592
  props: ServiceProps;
592
593
  }): ServiceIdRef | null;
593
594
  declare function collectFailedFallbacks(props: ServiceProps, services: DgpServiceMap, settings?: FallbackSettings): FailedFallbackContext[];
594
- /**
595
- * Return all fallback candidates that are eligible for the given primary,
596
- * respecting:
597
- * - node-scoped list first (if nodeId provided), then global list for `primary`
598
- * - rate policy vs. primary
599
- * - (optional) tag constraint fit, only when tagId is provided and requireConstraintFit=true
600
- * - excludes (including primary automatically)
601
- * - selectionStrategy: 'priority' keeps list order, 'cheapest' sorts by rate asc
602
- * - unique (dedupe) and optional limit
603
- */
604
595
  declare function getEligibleFallbacks(params: {
605
596
  primary: ServiceIdRef;
606
597
  nodeId?: NodeIdRef;
@@ -612,6 +603,11 @@ declare function getEligibleFallbacks(params: {
612
603
  exclude?: Array<ServiceIdRef>;
613
604
  unique?: boolean;
614
605
  limit?: number;
606
+ source?: FallbackEligibleSource;
607
+ }): ServiceIdRef[];
608
+ declare function getAssignedServiceIds(params: {
609
+ props?: ServiceProps;
610
+ snapshot?: OrderSnapshot;
615
611
  }): ServiceIdRef[];
616
612
  declare function getFallbackRegistrationInfo(props: ServiceProps, nodeId: NodeIdRef): {
617
613
  primary?: ServiceIdRef;
@@ -842,8 +838,9 @@ interface FallbackEditor {
842
838
  exclude?: ServiceIdRef[];
843
839
  unique?: boolean;
844
840
  limit?: number;
841
+ source?: FallbackEligibleSource;
845
842
  }): ServiceIdRef[];
846
843
  }
847
844
  declare function createFallbackEditor(options?: FallbackEditorOptions): FallbackEditor;
848
845
 
849
- export { type AncestryHit, type AnyNode, type Builder, type BuilderOptions, type FailedFallbackContext, type FallbackEditor, type FieldNode, type FilterServicesForVisibleGroupInput, type FilterServicesForVisibleGroupResult, type NodeIndex, type NodeKind, type NormaliseOptions, type OptionNode, type RateCoherenceDiagnostic, type RelKind, type ServiceCheck, type TagNode, type UnknownNode, type WithAncestry, buildOrderSnapshot, collectFailedFallbacks, createBuilder, createFallbackEditor, createNodeIndex, filterServicesForVisibleGroup, getEligibleFallbacks, getFallbackRegistrationInfo, normalise, normalizeFieldValidation, resolveServiceFallback, validate, validateAsync, validateRateCoherenceDeep };
846
+ export { type AncestryHit, type AnyNode, type Builder, type BuilderOptions, type FailedFallbackContext, type FallbackEditor, type FieldNode, type FilterServicesForVisibleGroupInput, type FilterServicesForVisibleGroupResult, type NodeIndex, type NodeKind, type NormaliseOptions, type OptionNode, type RateCoherenceDiagnostic, type RelKind, type ServiceCheck, type TagNode, type UnknownNode, type WithAncestry, buildOrderSnapshot, collectFailedFallbacks, createBuilder, createFallbackEditor, createNodeIndex, filterServicesForVisibleGroup, getAssignedServiceIds, getEligibleFallbacks, getFallbackRegistrationInfo, normalise, normalizeFieldValidation, resolveServiceFallback, validate, validateAsync, validateRateCoherenceDeep };