Fix turnstile

This commit is contained in:
2026-10-15 15:53:32 +02:00
parent 7dc93ac5ed
commit 70b676660d
80 changed files with 1136 additions and 902 deletions
+10 -10
View File
@@ -10,17 +10,17 @@ import type { BasePayload, Field } from 'payload';
* at most every REFRESH_MS while an error persists, so a broken integration on a
* busy form doesn't turn every submission into a DB write.
*/
export type IntegrationState = 'degraded' | 'ok';
export type IntegrationState = 'ok' | 'degraded';
export type IntegrationStatus = {
/** Last time the integration was used (refreshed at most every REFRESH_MS). */
checkedAt?: null | string;
/** Machine code from the provider or the plugin, e.g. 'invalid-input-secret', 'missing-secret'. */
code?: null | string;
/** Human explanation shown in the panel (English — panel language). */
message?: null | string;
/** When the current state started. */
since?: null | string;
state?: IntegrationState | null;
/** Machine code from the provider or the plugin, e.g. 'invalid-input-secret', 'missing-secret'. */
code?: string | null;
/** Human explanation shown in the panel (English — panel language). */
message?: string | null;
/** When the current state started. */
since?: string | null;
/** Last time the integration was used (refreshed at most every REFRESH_MS). */
checkedAt?: string | null;
};
/** Hidden group field holding the status — add next to the integration's fields. */
export declare function buildIntegrationStatusField(name: string): Field;
@@ -31,7 +31,7 @@ export declare function buildIntegrationStatusBanner(statusField: string, label:
* request that triggered it.
*/
export declare function recordIntegrationStatus(payload: BasePayload, field: string, previous: IntegrationStatus | null | undefined, next: {
state: IntegrationState;
code?: string;
message?: string;
state: IntegrationState;
}): Promise<void>;