| | | 1 | | using Elsa.Connections.Models; |
| | | 2 | | |
| | | 3 | | namespace Elsa.Connections.Contracts; |
| | | 4 | | |
| | | 5 | | public interface IConnectionLifecycleStore |
| | | 6 | | { |
| | | 7 | | Task CreateAsync(IntegrationConnection connection, CancellationToken cancellationToken = default); |
| | | 8 | | |
| | | 9 | | Task<IntegrationConnection?> FindAsync(string id, string tenantId, string environmentId, CancellationToken cancellat |
| | | 10 | | |
| | | 11 | | Task<ConnectionGenerationCleanup?> FindGenerationCleanupAsync(string connectionId, string tenantId, string environme |
| | | 12 | | |
| | | 13 | | Task<ConnectionGenerationCleanup?> TryClaimGenerationCleanupAsync(string connectionId, string tenantId, string envir |
| | | 14 | | |
| | | 15 | | Task<bool> CompleteGenerationCleanupAsync(string connectionId, string tenantId, string environmentId, string generat |
| | | 16 | | |
| | | 17 | | Task<bool> CancelGenerationCleanupAsync(string connectionId, string tenantId, string environmentId, string generatio |
| | | 18 | | |
| | | 19 | | Task<IntegrationConnection?> TryDisconnectAndRecordAsync( |
| | | 20 | | string id, |
| | | 21 | | string tenantId, |
| | | 22 | | string environmentId, |
| | | 23 | | long expectedRevision, |
| | | 24 | | ConnectionOffboardingOperation operation, |
| | | 25 | | CancellationToken cancellationToken = default); |
| | | 26 | | |
| | | 27 | | Task<ConnectionOffboardingOperation?> FindOffboardingOperationAsync( |
| | | 28 | | string operationId, |
| | | 29 | | string tenantId, |
| | | 30 | | string environmentId, |
| | | 31 | | string connectionId, |
| | | 32 | | CancellationToken cancellationToken = default); |
| | | 33 | | |
| | | 34 | | Task<ConnectionOffboardingOperation?> FindNextOffboardingOperationAsync( |
| | | 35 | | string tenantId, |
| | | 36 | | string environmentId, |
| | | 37 | | string connectionId, |
| | | 38 | | DateTimeOffset now, |
| | | 39 | | bool stableRevocationIdIdempotency, |
| | | 40 | | bool stableUninstallIdIdempotency, |
| | | 41 | | CancellationToken cancellationToken = default); |
| | | 42 | | |
| | | 43 | | Task<ConnectionOffboardingOperation?> TryQueueOffboardingOperationAsync( |
| | | 44 | | long expectedConnectionRevision, |
| | | 45 | | ConnectionOffboardingOperation operation, |
| | | 46 | | CancellationToken cancellationToken = default); |
| | | 47 | | |
| | | 48 | | Task<ConnectionOffboardingOperation?> TryClaimOffboardingOperationAsync( |
| | | 49 | | string operationId, |
| | | 50 | | string tenantId, |
| | | 51 | | string environmentId, |
| | | 52 | | string connectionId, |
| | | 53 | | long expectedFence, |
| | | 54 | | DateTimeOffset now, |
| | | 55 | | DateTimeOffset leaseExpiresAt, |
| | | 56 | | CancellationToken cancellationToken = default); |
| | | 57 | | |
| | | 58 | | Task<bool> TryStartOffboardingProviderCallAsync( |
| | | 59 | | string operationId, |
| | | 60 | | string tenantId, |
| | | 61 | | string environmentId, |
| | | 62 | | string connectionId, |
| | | 63 | | long fence, |
| | | 64 | | DateTimeOffset now, |
| | | 65 | | CancellationToken cancellationToken = default); |
| | | 66 | | |
| | | 67 | | Task<bool> TryMarkOffboardingOutcomeUnknownIfLeaseExpiredAsync( |
| | | 68 | | string operationId, |
| | | 69 | | string tenantId, |
| | | 70 | | string environmentId, |
| | | 71 | | string connectionId, |
| | | 72 | | long fence, |
| | | 73 | | DateTimeOffset now, |
| | | 74 | | string safeErrorCode, |
| | | 75 | | CancellationToken cancellationToken = default); |
| | | 76 | | |
| | | 77 | | Task<bool> TryReleaseOffboardingClaimAsync( |
| | | 78 | | string operationId, |
| | | 79 | | string tenantId, |
| | | 80 | | string environmentId, |
| | | 81 | | string connectionId, |
| | | 82 | | long fence, |
| | | 83 | | DateTimeOffset updatedAt, |
| | | 84 | | DateTimeOffset nextAttemptAt, |
| | | 85 | | string safeErrorCode, |
| | | 86 | | CancellationToken cancellationToken = default); |
| | | 87 | | |
| | | 88 | | Task<bool> TryCompleteOffboardingOperationAsync( |
| | | 89 | | string operationId, |
| | | 90 | | string tenantId, |
| | | 91 | | string environmentId, |
| | | 92 | | string connectionId, |
| | | 93 | | long fence, |
| | | 94 | | DateTimeOffset completedAt, |
| | | 95 | | CancellationToken cancellationToken = default); |
| | | 96 | | |
| | | 97 | | Task<bool> TryRecordOffboardingFailureAsync( |
| | | 98 | | string operationId, |
| | | 99 | | string tenantId, |
| | | 100 | | string environmentId, |
| | | 101 | | string connectionId, |
| | | 102 | | long fence, |
| | | 103 | | ConnectionOffboardingOperationStatus status, |
| | | 104 | | DateTimeOffset updatedAt, |
| | | 105 | | DateTimeOffset? nextAttemptAt, |
| | | 106 | | string safeErrorCode, |
| | | 107 | | CancellationToken cancellationToken = default); |
| | | 108 | | |
| | | 109 | | Task<IntegrationConnection?> TryClaimRefreshAsync( |
| | | 110 | | string id, |
| | | 111 | | string tenantId, |
| | | 112 | | string environmentId, |
| | | 113 | | long expectedRevision, |
| | | 114 | | string operationId, |
| | | 115 | | DateTimeOffset leaseExpiresAt, |
| | | 116 | | CancellationToken cancellationToken = default); |
| | | 117 | | |
| | | 118 | | Task<IntegrationConnection?> TryClaimCredentialUpdateAsync( |
| | | 119 | | string id, |
| | | 120 | | string tenantId, |
| | | 121 | | string environmentId, |
| | | 122 | | long expectedRevision, |
| | | 123 | | string operationId, |
| | | 124 | | DateTimeOffset leaseExpiresAt, |
| | | 125 | | CancellationToken cancellationToken = default) => |
| | 0 | 126 | | TryClaimRefreshAsync(id, tenantId, environmentId, expectedRevision, operationId, leaseExpiresAt, cancellationTok |
| | | 127 | | |
| | | 128 | | Task<bool> TryAcceptCredentialUpdateAsync(string id, string tenantId, string environmentId, long expectedRevision, s |
| | 0 | 129 | | Task.FromResult(false); |
| | | 130 | | |
| | | 131 | | Task<bool> TryStartProviderCallAsync(string id, string tenantId, string environmentId, long expectedRevision, string |
| | | 132 | | |
| | | 133 | | Task<bool> TryReleaseUnstartedRefreshAsync(string id, string tenantId, string environmentId, string operationId, lon |
| | | 134 | | |
| | | 135 | | Task<bool> TryReleaseExpiredRefreshClaimAsync(string id, string tenantId, string environmentId, string operationId, |
| | | 136 | | |
| | | 137 | | Task<bool> TryRecordStagedGenerationAsync( |
| | | 138 | | string id, |
| | | 139 | | string tenantId, |
| | | 140 | | string environmentId, |
| | | 141 | | long expectedRevision, |
| | | 142 | | string operationId, |
| | | 143 | | long fence, |
| | | 144 | | string secretName, |
| | | 145 | | string generationId, |
| | | 146 | | CancellationToken cancellationToken = default); |
| | | 147 | | |
| | | 148 | | Task<bool> TryRecordStagedGenerationAsync( |
| | | 149 | | string id, |
| | | 150 | | string tenantId, |
| | | 151 | | string environmentId, |
| | | 152 | | long expectedRevision, |
| | | 153 | | string operationId, |
| | | 154 | | long fence, |
| | | 155 | | string secretName, |
| | | 156 | | string generationId, |
| | | 157 | | ConnectionCredentialKind? credentialKind, |
| | | 158 | | DateTimeOffset? credentialExpiresAt, |
| | | 159 | | CancellationToken cancellationToken = default) => |
| | 0 | 160 | | TryRecordStagedGenerationAsync(id, tenantId, environmentId, expectedRevision, operationId, fence, secretName, ge |
| | | 161 | | |
| | | 162 | | Task<bool> TryPublishGenerationAsync(string id, string tenantId, string environmentId, long expectedRevision, string |
| | | 163 | | |
| | | 164 | | Task<bool> TryPromoteRecoveryGenerationAsync(string id, string tenantId, string environmentId, long expectedRevision |
| | | 165 | | |
| | | 166 | | Task<bool> TryPromoteRecoveryGenerationAsync( |
| | | 167 | | string id, |
| | | 168 | | string tenantId, |
| | | 169 | | string environmentId, |
| | | 170 | | long expectedRevision, |
| | | 171 | | string operationId, |
| | | 172 | | long fence, |
| | | 173 | | ConnectionCredentialKind? credentialKind, |
| | | 174 | | DateTimeOffset? credentialExpiresAt, |
| | | 175 | | CancellationToken cancellationToken = default) => |
| | 0 | 176 | | TryPromoteRecoveryGenerationAsync(id, tenantId, environmentId, expectedRevision, operationId, fence, cancellatio |
| | | 177 | | |
| | | 178 | | Task<bool> MarkRecoveryRequiredAsync(string id, string tenantId, string environmentId, string operationId, long fenc |
| | | 179 | | |
| | | 180 | | Task<bool> TryMarkRecoveryRequiredIfLeaseExpiredAsync(string id, string tenantId, string environmentId, string opera |
| | | 181 | | |
| | | 182 | | Task<bool> TryRestoreSourceGenerationAfterMissingPlanAsync( |
| | | 183 | | string id, |
| | | 184 | | string tenantId, |
| | | 185 | | string environmentId, |
| | | 186 | | long expectedRevision, |
| | | 187 | | string operationId, |
| | | 188 | | long fence, |
| | | 189 | | string sourceGenerationId, |
| | | 190 | | string safeErrorCode, |
| | 0 | 191 | | CancellationToken cancellationToken = default) => Task.FromResult(false); |
| | | 192 | | |
| | | 193 | | Task<bool> TryDisconnectAsync(string id, string tenantId, string environmentId, long expectedRevision, CancellationT |
| | | 194 | | } |