web & sdk: improved sdk (better failover and batching)

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-01-12 11:31:46 +01:00
parent 8e7558790e
commit 5b5ad23f66
26 changed files with 1266 additions and 377 deletions

View File

@@ -0,0 +1,3 @@
-- AlterTable
ALTER TABLE "clients" ADD COLUMN "cors" TEXT NOT NULL DEFAULT '*',
ALTER COLUMN "secret" DROP NOT NULL;

View File

@@ -0,0 +1,9 @@
-- CreateTable
CREATE TABLE "event_failed" (
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
"data" JSONB NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "event_failed_pkey" PRIMARY KEY ("id")
);

View File

@@ -90,14 +90,24 @@ model Profile {
@@map("profiles")
}
model EventFailed {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
data Json
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
@@map("event_failed")
}
model Client {
id String @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid
name String
secret String
secret String?
project_id String @db.Uuid
project Project @relation(fields: [project_id], references: [id])
organization_id String @db.Uuid
organization Organization @relation(fields: [organization_id], references: [id])
cors String @default("*")
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt