From 4a8f15995c7a5305dae3d3894e802fe218a12ac2 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 19 Jul 2024 10:47:02 +0200 Subject: [PATCH] Type sdk couchdb fields --- packages/server/src/sdk/app/automations/crud.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/server/src/sdk/app/automations/crud.ts b/packages/server/src/sdk/app/automations/crud.ts index c0f3df6f28..90fe6c16c4 100644 --- a/packages/server/src/sdk/app/automations/crud.ts +++ b/packages/server/src/sdk/app/automations/crud.ts @@ -11,6 +11,11 @@ import { import { definitions } from "../../../automations/triggerInfo" import automations from "." +interface PersistedAutomation extends Automation { + _id: string + _rev: string +} + function getDb() { return context.getAppDB() } @@ -71,7 +76,7 @@ async function handleStepEvents( export async function fetch() { const db = getDb() - const response = await db.allDocs( + const response = await db.allDocs( getAutomationParams(null, { include_docs: true, }) @@ -81,7 +86,7 @@ export async function fetch() { export async function get(automationId: string) { const db = getDb() - const result = await db.get(automationId) + const result = await db.get(automationId) return result }