@oods/component-contracts 0.11.3 → 0.12.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/index.d.cts CHANGED
@@ -312,6 +312,8 @@ interface CollectionEvent {
312
312
  at: string;
313
313
  description: string;
314
314
  kind: 'state' | 'payment';
315
+ /** s244-m01 (#2829): who acted, for whom and who approved, when the history entry names them (historyAttribution). */
316
+ attribution?: string;
315
317
  }
316
318
  /** Invalid dates cannot participate in a chronological view; ties retain source order. */
317
319
  declare function chronologicalEvents(events: readonly CollectionEvent[]): CollectionEvent[];
@@ -350,6 +352,29 @@ declare function ownershipPhrase(ownerLabel?: unknown, ownerType?: unknown, role
350
352
  /** Keep authored record keys and the Transaction fallback; UUIDs belong in technical inspection. */
351
353
  declare function formatRecordLabel(value: unknown, readableIdentifier?: boolean): string;
352
354
 
355
+ /**
356
+ * s244-m01 (#2829): every recorded change can name three parties, and every place history is printed says who in one
357
+ * phrase built here.
358
+ *
359
+ * A history entry (Stateful's state_history, Auditable's audit_log) may carry these optional fields beside its
360
+ * actor_id, following Relationship's source_id/source_name pattern:
361
+ * actor_name, actor_id who acted
362
+ * actor_kind person, agent or system (the Actor trait's kinds)
363
+ * on_behalf_of_name, _id who it acted for
364
+ * approved_by_name, _id who approved it, when someone did
365
+ *
366
+ * Only a `*_name` field names a party: `actor` and `actor_id` are ids, and an entry that names no one renders exactly as
367
+ * it did before, its "Actor: <id>" line included.
368
+ */
369
+ interface HistoryAttribution {
370
+ /** "Billing Agent for Tidewater Co-op · approved by Ruth Adeyemi"; "Ruth Adeyemi" alone for a person acting for herself. */
371
+ text: string;
372
+ /** True when the entry names who acted, so its actor id is not printed beside the name. */
373
+ namesActor: boolean;
374
+ }
375
+ /** The phrase for an entry's named parties, or undefined when it names no one. */
376
+ declare function historyAttribution(entry: unknown): HistoryAttribution | undefined;
377
+
353
378
  /** Preserve generated SVG bytes while admitting only passive, local SVG markup. */
354
379
  declare function assertStaticSvg(svg: string): string;
355
380
  /**
@@ -2775,11 +2800,12 @@ interface TraitEventValues {
2775
2800
  type TraitEventKind = 'archive' | 'cancellation' | 'transition';
2776
2801
  /** Missing timestamps stay disclosed; history order and authored actor/reason are preserved. */
2777
2802
  declare function traitEventRows(kind: TraitEventKind, values: TraitEventValues): {
2803
+ actor: string | undefined;
2804
+ reason: string | undefined;
2805
+ attribution?: string | undefined;
2778
2806
  code: string | undefined;
2779
2807
  at: string | undefined;
2780
2808
  time: string;
2781
- actor: string | undefined;
2782
- reason: string | undefined;
2783
2809
  title: string;
2784
2810
  }[];
2785
2811
  /** Catalog rows can be strings or named records; never stringify objects into [object Object]. */
@@ -3402,4 +3428,4 @@ declare function getBaselineCapability(componentId: string): {
3402
3428
  };
3403
3429
  } | undefined;
3404
3430
 
3405
- export { type AuditSummaryValues, BILLING_AMOUNT_ERROR, BILLING_INTERVALS, BILLING_INTERVAL_ERROR, BILLING_MINOR_UNITS, type BillingAmountResult, type BillingCycleValues, type BillingPaymentValues, COMPONENT_CLASSIFICATIONS, COMPONENT_CONTRACT_VERSION, COMPONENT_CONTRACT_VERSION_1_1, type CollectionEvent, type ComponentBehavior, type ComponentClassification, type ComponentContract, DEFAULT_COLOR_STATES, EMISSION_ELIGIBILITY_EVIDENCE_CLASSES, type EmissionEligibilityEvidence, type EmissionEligibilityEvidenceClass, type EvidenceResult, type EvidenceStatus, FOUNDATION_V1_EVIDENCE_CLASSES, type FoundationV1Evidence, type FoundationV1EvidenceClass, GOVERNED_DEFINITION, GOVERNED_SURFACES, type GeoFieldMappingValue, type GovernedComponentId, type GovernedLedgerRow, NO_LAST_PAYMENT, NO_NEXT_PAYMENT, NUCLEUS_COMPONENT_IDS, type NucleusComponentId, type NumberDisplayFormat, type ObligationStatus, PORTED_COMPONENT_IDS, type PortedComponentId, RESULT_STATES, RESULT_STATE_TONE, type ResultState, SEVERITY_TONES, STATUS_DOMAINS, STATUS_ICON_SHAPES, STATUS_ICON_SVG_ATTRS, type ScenarioTrigger, type SharedScenario, type SortIndicatorValues, type SortState, type StatusDomain, type StatusIconName, type StatusIconShape, type StatusPresentation, type StatusTokenSet, type StatusTone, type SubstitutionContractReport, type SubstitutionObligation, type TraitEventKind, type TraitEventValues, UI_WORKFLOW_STATES, type UiWorkflowState, VIZ_CONTROL_IDS, VIZ_CONTROL_TITLES, VIZ_PREVIEW_TYPES, VIZ_SUMMARY_IDS, VIZ_SVG_PROPS, VIZ_THEME_SVG_PROPS, type VizChannel, type VizChartType, type VizColorBinding, type VizControlField, type VizControlId, type VizFieldBinding, type VizIntentFragment, type VizPreviewLayer, type VizPreviewTheme, type VizRenderAttribute, type VizScale, type VizSummaryId, type VizThemeSvgProp, addressCollectionSummary, ariaSort, assertStaticSvg, auditSummary, billingAmountMessage, billingAmountText, billingCycle, billingDate, billingIntervalMessage, billingPaymentRows, billingPaymentSummary, billingPeriodEnd, billingSummary, chronologicalEvents, componentBehaviors, componentCapabilityBaseline, componentContracts, componentIntake, componentReconciliationProposal, currencyMinorUnits, dateTimeInputValue, defaultVizIntent, deriveStartingComponentCount, editVizIntent, evaluateEmissionEligibility, evaluateFoundationV1, formatBillingAmount, formatDateTime, formatDeclaredNumber, formatPriceAmount, formatPriceCode, formatReadOnlyValue, formatRecordLabel, formatReferenceLabel, geoFieldMapping, getBannerToneTokenSet, getBaselineCapability, getStatusPresentation, getToneTokenSet, initialSort, isGovernedComponent, isVizIntentFragment, listStatuses, nextSort, ownershipPhrase, parseBillingAmount, portedComponentContracts, portedScenarios, recipeItemLabels, recordCollectionEvents, relativeTimestampEmptyScenario, resolveStatusIcon, restartedBillingPeriod, sharedScenarios, statusIconMarkup, substitutionContractReport, summarizeSubstitutionReport, summaryValue, svgCarriesTitle, traitEventRows, validMinorUnits, validateComponentIntakeDocument, vizControlFields, vizFieldValue, vizPreviewLayers, vizSummaryRows };
3431
+ export { type AuditSummaryValues, BILLING_AMOUNT_ERROR, BILLING_INTERVALS, BILLING_INTERVAL_ERROR, BILLING_MINOR_UNITS, type BillingAmountResult, type BillingCycleValues, type BillingPaymentValues, COMPONENT_CLASSIFICATIONS, COMPONENT_CONTRACT_VERSION, COMPONENT_CONTRACT_VERSION_1_1, type CollectionEvent, type ComponentBehavior, type ComponentClassification, type ComponentContract, DEFAULT_COLOR_STATES, EMISSION_ELIGIBILITY_EVIDENCE_CLASSES, type EmissionEligibilityEvidence, type EmissionEligibilityEvidenceClass, type EvidenceResult, type EvidenceStatus, FOUNDATION_V1_EVIDENCE_CLASSES, type FoundationV1Evidence, type FoundationV1EvidenceClass, GOVERNED_DEFINITION, GOVERNED_SURFACES, type GeoFieldMappingValue, type GovernedComponentId, type GovernedLedgerRow, type HistoryAttribution, NO_LAST_PAYMENT, NO_NEXT_PAYMENT, NUCLEUS_COMPONENT_IDS, type NucleusComponentId, type NumberDisplayFormat, type ObligationStatus, PORTED_COMPONENT_IDS, type PortedComponentId, RESULT_STATES, RESULT_STATE_TONE, type ResultState, SEVERITY_TONES, STATUS_DOMAINS, STATUS_ICON_SHAPES, STATUS_ICON_SVG_ATTRS, type ScenarioTrigger, type SharedScenario, type SortIndicatorValues, type SortState, type StatusDomain, type StatusIconName, type StatusIconShape, type StatusPresentation, type StatusTokenSet, type StatusTone, type SubstitutionContractReport, type SubstitutionObligation, type TraitEventKind, type TraitEventValues, UI_WORKFLOW_STATES, type UiWorkflowState, VIZ_CONTROL_IDS, VIZ_CONTROL_TITLES, VIZ_PREVIEW_TYPES, VIZ_SUMMARY_IDS, VIZ_SVG_PROPS, VIZ_THEME_SVG_PROPS, type VizChannel, type VizChartType, type VizColorBinding, type VizControlField, type VizControlId, type VizFieldBinding, type VizIntentFragment, type VizPreviewLayer, type VizPreviewTheme, type VizRenderAttribute, type VizScale, type VizSummaryId, type VizThemeSvgProp, addressCollectionSummary, ariaSort, assertStaticSvg, auditSummary, billingAmountMessage, billingAmountText, billingCycle, billingDate, billingIntervalMessage, billingPaymentRows, billingPaymentSummary, billingPeriodEnd, billingSummary, chronologicalEvents, componentBehaviors, componentCapabilityBaseline, componentContracts, componentIntake, componentReconciliationProposal, currencyMinorUnits, dateTimeInputValue, defaultVizIntent, deriveStartingComponentCount, editVizIntent, evaluateEmissionEligibility, evaluateFoundationV1, formatBillingAmount, formatDateTime, formatDeclaredNumber, formatPriceAmount, formatPriceCode, formatReadOnlyValue, formatRecordLabel, formatReferenceLabel, geoFieldMapping, getBannerToneTokenSet, getBaselineCapability, getStatusPresentation, getToneTokenSet, historyAttribution, initialSort, isGovernedComponent, isVizIntentFragment, listStatuses, nextSort, ownershipPhrase, parseBillingAmount, portedComponentContracts, portedScenarios, recipeItemLabels, recordCollectionEvents, relativeTimestampEmptyScenario, resolveStatusIcon, restartedBillingPeriod, sharedScenarios, statusIconMarkup, substitutionContractReport, summarizeSubstitutionReport, summaryValue, svgCarriesTitle, traitEventRows, validMinorUnits, validateComponentIntakeDocument, vizControlFields, vizFieldValue, vizPreviewLayers, vizSummaryRows };
package/dist/index.d.ts CHANGED
@@ -312,6 +312,8 @@ interface CollectionEvent {
312
312
  at: string;
313
313
  description: string;
314
314
  kind: 'state' | 'payment';
315
+ /** s244-m01 (#2829): who acted, for whom and who approved, when the history entry names them (historyAttribution). */
316
+ attribution?: string;
315
317
  }
316
318
  /** Invalid dates cannot participate in a chronological view; ties retain source order. */
317
319
  declare function chronologicalEvents(events: readonly CollectionEvent[]): CollectionEvent[];
@@ -350,6 +352,29 @@ declare function ownershipPhrase(ownerLabel?: unknown, ownerType?: unknown, role
350
352
  /** Keep authored record keys and the Transaction fallback; UUIDs belong in technical inspection. */
351
353
  declare function formatRecordLabel(value: unknown, readableIdentifier?: boolean): string;
352
354
 
355
+ /**
356
+ * s244-m01 (#2829): every recorded change can name three parties, and every place history is printed says who in one
357
+ * phrase built here.
358
+ *
359
+ * A history entry (Stateful's state_history, Auditable's audit_log) may carry these optional fields beside its
360
+ * actor_id, following Relationship's source_id/source_name pattern:
361
+ * actor_name, actor_id who acted
362
+ * actor_kind person, agent or system (the Actor trait's kinds)
363
+ * on_behalf_of_name, _id who it acted for
364
+ * approved_by_name, _id who approved it, when someone did
365
+ *
366
+ * Only a `*_name` field names a party: `actor` and `actor_id` are ids, and an entry that names no one renders exactly as
367
+ * it did before, its "Actor: <id>" line included.
368
+ */
369
+ interface HistoryAttribution {
370
+ /** "Billing Agent for Tidewater Co-op · approved by Ruth Adeyemi"; "Ruth Adeyemi" alone for a person acting for herself. */
371
+ text: string;
372
+ /** True when the entry names who acted, so its actor id is not printed beside the name. */
373
+ namesActor: boolean;
374
+ }
375
+ /** The phrase for an entry's named parties, or undefined when it names no one. */
376
+ declare function historyAttribution(entry: unknown): HistoryAttribution | undefined;
377
+
353
378
  /** Preserve generated SVG bytes while admitting only passive, local SVG markup. */
354
379
  declare function assertStaticSvg(svg: string): string;
355
380
  /**
@@ -2775,11 +2800,12 @@ interface TraitEventValues {
2775
2800
  type TraitEventKind = 'archive' | 'cancellation' | 'transition';
2776
2801
  /** Missing timestamps stay disclosed; history order and authored actor/reason are preserved. */
2777
2802
  declare function traitEventRows(kind: TraitEventKind, values: TraitEventValues): {
2803
+ actor: string | undefined;
2804
+ reason: string | undefined;
2805
+ attribution?: string | undefined;
2778
2806
  code: string | undefined;
2779
2807
  at: string | undefined;
2780
2808
  time: string;
2781
- actor: string | undefined;
2782
- reason: string | undefined;
2783
2809
  title: string;
2784
2810
  }[];
2785
2811
  /** Catalog rows can be strings or named records; never stringify objects into [object Object]. */
@@ -3402,4 +3428,4 @@ declare function getBaselineCapability(componentId: string): {
3402
3428
  };
3403
3429
  } | undefined;
3404
3430
 
3405
- export { type AuditSummaryValues, BILLING_AMOUNT_ERROR, BILLING_INTERVALS, BILLING_INTERVAL_ERROR, BILLING_MINOR_UNITS, type BillingAmountResult, type BillingCycleValues, type BillingPaymentValues, COMPONENT_CLASSIFICATIONS, COMPONENT_CONTRACT_VERSION, COMPONENT_CONTRACT_VERSION_1_1, type CollectionEvent, type ComponentBehavior, type ComponentClassification, type ComponentContract, DEFAULT_COLOR_STATES, EMISSION_ELIGIBILITY_EVIDENCE_CLASSES, type EmissionEligibilityEvidence, type EmissionEligibilityEvidenceClass, type EvidenceResult, type EvidenceStatus, FOUNDATION_V1_EVIDENCE_CLASSES, type FoundationV1Evidence, type FoundationV1EvidenceClass, GOVERNED_DEFINITION, GOVERNED_SURFACES, type GeoFieldMappingValue, type GovernedComponentId, type GovernedLedgerRow, NO_LAST_PAYMENT, NO_NEXT_PAYMENT, NUCLEUS_COMPONENT_IDS, type NucleusComponentId, type NumberDisplayFormat, type ObligationStatus, PORTED_COMPONENT_IDS, type PortedComponentId, RESULT_STATES, RESULT_STATE_TONE, type ResultState, SEVERITY_TONES, STATUS_DOMAINS, STATUS_ICON_SHAPES, STATUS_ICON_SVG_ATTRS, type ScenarioTrigger, type SharedScenario, type SortIndicatorValues, type SortState, type StatusDomain, type StatusIconName, type StatusIconShape, type StatusPresentation, type StatusTokenSet, type StatusTone, type SubstitutionContractReport, type SubstitutionObligation, type TraitEventKind, type TraitEventValues, UI_WORKFLOW_STATES, type UiWorkflowState, VIZ_CONTROL_IDS, VIZ_CONTROL_TITLES, VIZ_PREVIEW_TYPES, VIZ_SUMMARY_IDS, VIZ_SVG_PROPS, VIZ_THEME_SVG_PROPS, type VizChannel, type VizChartType, type VizColorBinding, type VizControlField, type VizControlId, type VizFieldBinding, type VizIntentFragment, type VizPreviewLayer, type VizPreviewTheme, type VizRenderAttribute, type VizScale, type VizSummaryId, type VizThemeSvgProp, addressCollectionSummary, ariaSort, assertStaticSvg, auditSummary, billingAmountMessage, billingAmountText, billingCycle, billingDate, billingIntervalMessage, billingPaymentRows, billingPaymentSummary, billingPeriodEnd, billingSummary, chronologicalEvents, componentBehaviors, componentCapabilityBaseline, componentContracts, componentIntake, componentReconciliationProposal, currencyMinorUnits, dateTimeInputValue, defaultVizIntent, deriveStartingComponentCount, editVizIntent, evaluateEmissionEligibility, evaluateFoundationV1, formatBillingAmount, formatDateTime, formatDeclaredNumber, formatPriceAmount, formatPriceCode, formatReadOnlyValue, formatRecordLabel, formatReferenceLabel, geoFieldMapping, getBannerToneTokenSet, getBaselineCapability, getStatusPresentation, getToneTokenSet, initialSort, isGovernedComponent, isVizIntentFragment, listStatuses, nextSort, ownershipPhrase, parseBillingAmount, portedComponentContracts, portedScenarios, recipeItemLabels, recordCollectionEvents, relativeTimestampEmptyScenario, resolveStatusIcon, restartedBillingPeriod, sharedScenarios, statusIconMarkup, substitutionContractReport, summarizeSubstitutionReport, summaryValue, svgCarriesTitle, traitEventRows, validMinorUnits, validateComponentIntakeDocument, vizControlFields, vizFieldValue, vizPreviewLayers, vizSummaryRows };
3431
+ export { type AuditSummaryValues, BILLING_AMOUNT_ERROR, BILLING_INTERVALS, BILLING_INTERVAL_ERROR, BILLING_MINOR_UNITS, type BillingAmountResult, type BillingCycleValues, type BillingPaymentValues, COMPONENT_CLASSIFICATIONS, COMPONENT_CONTRACT_VERSION, COMPONENT_CONTRACT_VERSION_1_1, type CollectionEvent, type ComponentBehavior, type ComponentClassification, type ComponentContract, DEFAULT_COLOR_STATES, EMISSION_ELIGIBILITY_EVIDENCE_CLASSES, type EmissionEligibilityEvidence, type EmissionEligibilityEvidenceClass, type EvidenceResult, type EvidenceStatus, FOUNDATION_V1_EVIDENCE_CLASSES, type FoundationV1Evidence, type FoundationV1EvidenceClass, GOVERNED_DEFINITION, GOVERNED_SURFACES, type GeoFieldMappingValue, type GovernedComponentId, type GovernedLedgerRow, type HistoryAttribution, NO_LAST_PAYMENT, NO_NEXT_PAYMENT, NUCLEUS_COMPONENT_IDS, type NucleusComponentId, type NumberDisplayFormat, type ObligationStatus, PORTED_COMPONENT_IDS, type PortedComponentId, RESULT_STATES, RESULT_STATE_TONE, type ResultState, SEVERITY_TONES, STATUS_DOMAINS, STATUS_ICON_SHAPES, STATUS_ICON_SVG_ATTRS, type ScenarioTrigger, type SharedScenario, type SortIndicatorValues, type SortState, type StatusDomain, type StatusIconName, type StatusIconShape, type StatusPresentation, type StatusTokenSet, type StatusTone, type SubstitutionContractReport, type SubstitutionObligation, type TraitEventKind, type TraitEventValues, UI_WORKFLOW_STATES, type UiWorkflowState, VIZ_CONTROL_IDS, VIZ_CONTROL_TITLES, VIZ_PREVIEW_TYPES, VIZ_SUMMARY_IDS, VIZ_SVG_PROPS, VIZ_THEME_SVG_PROPS, type VizChannel, type VizChartType, type VizColorBinding, type VizControlField, type VizControlId, type VizFieldBinding, type VizIntentFragment, type VizPreviewLayer, type VizPreviewTheme, type VizRenderAttribute, type VizScale, type VizSummaryId, type VizThemeSvgProp, addressCollectionSummary, ariaSort, assertStaticSvg, auditSummary, billingAmountMessage, billingAmountText, billingCycle, billingDate, billingIntervalMessage, billingPaymentRows, billingPaymentSummary, billingPeriodEnd, billingSummary, chronologicalEvents, componentBehaviors, componentCapabilityBaseline, componentContracts, componentIntake, componentReconciliationProposal, currencyMinorUnits, dateTimeInputValue, defaultVizIntent, deriveStartingComponentCount, editVizIntent, evaluateEmissionEligibility, evaluateFoundationV1, formatBillingAmount, formatDateTime, formatDeclaredNumber, formatPriceAmount, formatPriceCode, formatReadOnlyValue, formatRecordLabel, formatReferenceLabel, geoFieldMapping, getBannerToneTokenSet, getBaselineCapability, getStatusPresentation, getToneTokenSet, historyAttribution, initialSort, isGovernedComponent, isVizIntentFragment, listStatuses, nextSort, ownershipPhrase, parseBillingAmount, portedComponentContracts, portedScenarios, recipeItemLabels, recordCollectionEvents, relativeTimestampEmptyScenario, resolveStatusIcon, restartedBillingPeriod, sharedScenarios, statusIconMarkup, substitutionContractReport, summarizeSubstitutionReport, summaryValue, svgCarriesTitle, traitEventRows, validMinorUnits, validateComponentIntakeDocument, vizControlFields, vizFieldValue, vizPreviewLayers, vizSummaryRows };