merge main into the workflow editor branch (#2061)
This commit is contained in:
39 files changed
+4372
-547
No files matched your search
+47
-5
@@ -203,7 +203,24 @@ export const api = {
|
||||
event: (id: string) => request<EventDetail>(`/api/events/${encodeURIComponent(id)}`),
|
||||
eventSources: () => request<EventSource_[]>("/api/sources"),
|
||||
putEventSource: (name: string, connector: string, verification?: SourceVerification) =>
|
||||
request<{ source: string; token?: string; url: string }>(`/api/sources/${encodeURIComponent(name)}`, { method: "PUT", body: { connector, ...verification } }),
|
||||
request<{ source: string; token?: string; secret?: string; url: string }>(`/api/sources/${encodeURIComponent(name)}`, { method: "PUT", body: { connector, ...verification } }),
|
||||
sourceCapture: (name: string, capture: boolean) =>
|
||||
request<EventSource_>(`/api/sources/${encodeURIComponent(name)}/capture`, { method: "PUT", body: { capture } }),
|
||||
/** The runs a trigger started, newest first. */
|
||||
triggerDispatches: (name: string) =>
|
||||
request<TriggerRun[]>(`/api/triggers/${encodeURIComponent(name)}/dispatches`),
|
||||
approveTrigger: (name: string) =>
|
||||
request<Trigger>(`/api/triggers/${encodeURIComponent(name)}/approve`, { method: "POST" }),
|
||||
pauseTrigger: (name: string) =>
|
||||
request<Trigger>(`/api/triggers/${encodeURIComponent(name)}/pause`, { method: "POST" }),
|
||||
/** A resumed trigger waits for approval again. */
|
||||
resumeTrigger: (name: string) =>
|
||||
request<Trigger>(`/api/triggers/${encodeURIComponent(name)}/resume`, { method: "POST" }),
|
||||
deleteTrigger: (name: string) =>
|
||||
request<void>(`/api/triggers/${encodeURIComponent(name)}`, { method: "DELETE", parse: false }),
|
||||
/** The runs a stored delivery started. */
|
||||
captureDispatches: (id: string) =>
|
||||
request<TriggerRun[]>(`/api/captures/${encodeURIComponent(id)}/dispatches`),
|
||||
putSourceKeyFields: (name: string, paths: string[]) =>
|
||||
request<{ key_fields: string[] }>(`/api/sources/${encodeURIComponent(name)}/key-fields`, { method: "PUT", body: { paths } }),
|
||||
triggers: () => request<Trigger[]>("/api/triggers"),
|
||||
@@ -517,8 +534,7 @@ export const api = {
|
||||
}),
|
||||
captures: <T = unknown>(limit?: number) =>
|
||||
request<T>("/api/captures" + qs({ limit })),
|
||||
eventTypes: <T = unknown>(workspace?: string) =>
|
||||
request<T>("/api/event-types" + qs({ workspace })),
|
||||
eventTypes: <T = unknown>() => request<T>("/api/event-types"),
|
||||
eventTypeCreate: <T = unknown>(eventType: Payload) =>
|
||||
request<T>("/api/event-types", { method: "POST", body: eventType }),
|
||||
eventTypeUpdate: <T = unknown>(id: string, eventType: Payload) =>
|
||||
@@ -531,8 +547,7 @@ export const api = {
|
||||
method: "DELETE",
|
||||
parse: false,
|
||||
}),
|
||||
mappings: <T = unknown>(workspace?: string) =>
|
||||
request<T>("/api/mappings" + qs({ workspace })),
|
||||
mappings: <T = unknown>() => request<T>("/api/mappings"),
|
||||
mappingCreate: <T = unknown>(mapping: Payload) =>
|
||||
request<T>("/api/mappings", { method: "POST", body: mapping }),
|
||||
mappingUpdate: <T = unknown>(id: string, mapping: Payload) =>
|
||||
@@ -889,6 +904,16 @@ export interface EventRecord {
|
||||
dispatched_at?: string;
|
||||
linked_to?: string;
|
||||
fields?: unknown;
|
||||
/** How the delivery was verified; empty for an event a connector streamed. */
|
||||
verification?: "signed" | "token" | "unsigned" | "";
|
||||
}
|
||||
|
||||
/** A run a trigger started for a stored event. */
|
||||
export interface TriggerRun {
|
||||
event_id: string;
|
||||
run_id: string;
|
||||
trigger?: string;
|
||||
created_at?: string;
|
||||
}
|
||||
|
||||
export interface EventDetail {
|
||||
@@ -914,6 +939,14 @@ export interface EventSource_ {
|
||||
hmac_header?: string;
|
||||
hmac_prefix?: string;
|
||||
hmac_secret_set: boolean;
|
||||
display_name?: string;
|
||||
/** The header a sender repeats on every retry of one delivery. */
|
||||
delivery_header?: string;
|
||||
signing: "signed" | "token" | "unsigned_pending_approval" | "unsigned";
|
||||
/** Whether the source keeps each delivery's headers and payload. */
|
||||
capture: boolean;
|
||||
/** A signing secret the request issued; shown once. */
|
||||
secret?: string;
|
||||
}
|
||||
|
||||
export interface Trigger {
|
||||
@@ -924,6 +957,11 @@ export interface Trigger {
|
||||
workflow: string;
|
||||
filter?: Record<string, string>;
|
||||
enabled: boolean;
|
||||
status: "pending_approval" | "armed" | "paused";
|
||||
event_type_id?: string;
|
||||
mapping_id?: string;
|
||||
/** The source takes deliveries with no verification. */
|
||||
unsigned: boolean;
|
||||
}
|
||||
|
||||
export interface TriggerInput {
|
||||
@@ -933,6 +971,10 @@ export interface TriggerInput {
|
||||
workflow: string;
|
||||
filter?: Record<string, string>;
|
||||
disabled: boolean;
|
||||
event_type_id?: string;
|
||||
mapping_id?: string;
|
||||
/** Save waiting for approval. */
|
||||
pending?: boolean;
|
||||
}
|
||||
|
||||
export interface WorkflowVersion {
|
||||
|
||||
Reference in new issue
Block a user