wasp/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/main.wasp
2023-06-14 21:56:26 +02:00

109 lines
2.3 KiB
JavaScript
Generated

app waspComplexTest {
db: { system: PostgreSQL },
wasp: {
version: "^0.11.0"
},
auth: {
userEntity: User,
externalAuthEntity: SocialLogin,
methods: {
google: {}
},
onAuthFailedRedirectTo: "/login"
},
server: {
setupFn: import mySetupFunction from "@server/myServerSetupCode.js",
},
client: {
setupFn: import myClientSetupFunction from "@client/myClientSetupCode.js",
rootComponent: import App from "@client/App.jsx"
},
emailSender: {
provider: SendGrid,
defaultFrom: {
name: "Hello",
email: "hello@itsme.com"
},
},
dependencies: [
("redux", "^4.0.5"),
("react-redux", "^7.1.3")
],
title: "waspComplexTest"
}
route RootRoute { path: "/", to: MainPage }
page MainPage {
component: import Main from "@client/MainPage.jsx"
}
entity User {=psl
id Int @id @default(autoincrement())
username String @unique
password String
externalAuthAssociations SocialLogin[]
psl=}
entity SocialLogin {=psl
id Int @id @default(autoincrement())
provider String
providerId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
userId Int
createdAt DateTime @default(now())
@@unique([provider, providerId, userId])
psl=}
job MySpecialJob {
executor: PgBoss,
perform: {
fn: import { foo } from "@server/jobs/bar.js"
}
}
action MySpecialAction {
fn: import { foo } from "@server/actions/bar.js",
entities: [User],
}
query MySpecialQuery {
fn: import { foo } from "@server/queries/bar.js",
entities: [User],
}
api fooBar {
fn: import { fooBar } from "@server/apis.js",
httpRoute: (GET, "/foo/bar"),
middlewareConfigFn: import { fooBarMiddlewareFn } from "@server/apis.js"
}
api fooBaz {
fn: import { fooBaz } from "@server/apis.js",
httpRoute: (GET, "/foo/baz"),
auth: false
}
apiNamespace fooBarNamespace {
middlewareConfigFn: import { fooBarNamespaceMiddlewareFn } from "@server/apiNamespaces.js",
path: "/bar"
}
entity Task {=psl
id Int @id @default(autoincrement())
description String
isDone Boolean @default(false)
psl=}
crud tasks {
entity: Task,
operations: {
get: {},
getAll: {},
create: {},
}
}