replace twilio connect with account sid/auth token form

This commit is contained in:
m5r
2022-06-09 00:33:19 +02:00
parent c047e169f2
commit e8ba6a63ab
19 changed files with 437 additions and 208 deletions

View File

@ -21,17 +21,16 @@ CREATE TYPE "CallStatus" AS ENUM ('Queued', 'Ringing', 'InProgress', 'Completed'
-- CreateTable
CREATE TABLE "TwilioAccount" (
"subAccountSid" TEXT NOT NULL,
"accountSid" TEXT NOT NULL,
"createdAt" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMPTZ(6) NOT NULL,
"subAccountAuthToken" TEXT NOT NULL,
"accountSid" TEXT NOT NULL,
"authToken" TEXT NOT NULL,
"twimlAppSid" TEXT,
"apiKeySid" TEXT,
"apiKeySecret" TEXT,
"organizationId" TEXT NOT NULL,
CONSTRAINT "TwilioAccount_pkey" PRIMARY KEY ("subAccountSid")
CONSTRAINT "TwilioAccount_pkey" PRIMARY KEY ("accountSid")
);
-- CreateTable

View File

@ -8,14 +8,13 @@ datasource db {
}
model TwilioAccount {
subAccountSid String @id
createdAt DateTime @default(now()) @db.Timestamptz(6)
updatedAt DateTime @updatedAt @db.Timestamptz(6)
subAccountAuthToken String
accountSid String
twimlAppSid String?
apiKeySid String?
apiKeySecret String?
accountSid String @id
createdAt DateTime @default(now()) @db.Timestamptz(6)
updatedAt DateTime @updatedAt @db.Timestamptz(6)
authToken String
twimlAppSid String?
apiKeySid String?
apiKeySecret String?
organizationId String @unique
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
@ -157,8 +156,8 @@ model NotificationSubscription {
keys_p256dh String
keys_auth String
membership Membership? @relation(fields: [membershipId], references: [id], onDelete: Cascade)
membershipId String?
membership Membership @relation(fields: [membershipId], references: [id], onDelete: Cascade)
membershipId String
}
enum SubscriptionStatus {