| | | 1 | | using Elsa.Connections.Models; |
| | | 2 | | |
| | | 3 | | namespace Elsa.Connections.Contracts; |
| | | 4 | | |
| | | 5 | | /// <summary>Host-owned remote offboarding actions with explicit outcome and retry guarantees.</summary> |
| | | 6 | | /// <remarks> |
| | | 7 | | /// Implementations must report <see cref="SupportsStableOperationIdIdempotency"/> as true for an operation kind only wh |
| | | 8 | | /// guarantees at-most-once effects for repeated calls with the same operation ID. Without that guarantee, unknown outco |
| | | 9 | | /// remain durable and are not automatically replayed. A retryable failure guarantees the provider knows no remote effec |
| | | 10 | | /// </remarks> |
| | | 11 | | public interface IConnectionOffboardingProvider |
| | | 12 | | { |
| | | 13 | | /// <summary>Whether repeated calls with the same operation ID are guaranteed to produce at most one remote effect.< |
| | 0 | 14 | | bool SupportsStableOperationIdIdempotency(ConnectionOffboardingOperationKind kind) => false; |
| | | 15 | | |
| | | 16 | | Task<ConnectionOffboardingProviderResult> RevokeTokenPairAsync( |
| | | 17 | | string providerId, |
| | | 18 | | string providerAccountId, |
| | | 19 | | string operationId, |
| | | 20 | | CredentialMaterial credentials, |
| | | 21 | | CancellationToken cancellationToken = default); |
| | | 22 | | |
| | | 23 | | /// <summary>Uses provider-owned host credentials; this operation does not receive or resolve a Connections generati |
| | | 24 | | Task<ConnectionOffboardingProviderResult> UninstallInstallationAsync( |
| | | 25 | | string providerId, |
| | | 26 | | string providerAccountId, |
| | | 27 | | string operationId, |
| | | 28 | | CancellationToken cancellationToken = default); |
| | | 29 | | } |
| | | 30 | | |
| | | 31 | | public enum ConnectionOffboardingProviderResult |
| | | 32 | | { |
| | | 33 | | Succeeded, |
| | | 34 | | /// <summary>The provider confirms that no remote effect occurred, so a later retry is safe without idempotency supp |
| | | 35 | | RetryableFailure, |
| | | 36 | | TerminalFailure, |
| | | 37 | | UnknownOutcome |
| | | 38 | | } |