@wasp.sh/wasp-cli-darwin-arm64-unknown 0.23.0 → 0.24.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/Cli/starters/basic/main.wasp.ts +60 -0
- package/data/Cli/starters/basic/package.json +4 -1
- package/data/Cli/starters/basic/prettier.config.mjs +9 -0
- package/data/Cli/starters/basic/src/tags/tags.wasp.ts +8 -0
- package/data/Cli/starters/basic/src/tasks/task.wasp.ts +16 -0
- package/data/Cli/starters/minimal/main.wasp.ts +12 -0
- package/data/Cli/starters/minimal/package.json +4 -1
- package/data/Cli/starters/skeleton/AGENTS.md +23 -0
- package/data/Cli/starters/skeleton/CLAUDE.md +23 -0
- package/data/Cli/starters/skeleton/tsconfig.json +5 -26
- package/data/Cli/starters/{ts-minimal → skeleton}/tsconfig.src.json +2 -1
- package/data/Cli/starters/{ts-minimal → skeleton}/tsconfig.wasp.json +5 -2
- package/data/Generator/libs/auth/{wasp.sh-lib-auth-0.23.0.tgz → wasp.sh-lib-auth-0.24.0.tgz} +0 -0
- package/data/Generator/libs/vite-ssr/{wasp.sh-lib-vite-ssr-0.23.0.tgz → wasp.sh-lib-vite-ssr-0.24.0.tgz} +0 -0
- package/data/Generator/templates/sdk/wasp/api/index.ts +51 -47
- package/data/Generator/templates/sdk/wasp/auth/email/actions/login.ts +5 -2
- package/data/Generator/templates/sdk/wasp/auth/email/actions/passwordReset.ts +9 -4
- package/data/Generator/templates/sdk/wasp/auth/email/actions/signup.ts +5 -2
- package/data/Generator/templates/sdk/wasp/auth/email/actions/verifyEmail.ts +5 -2
- package/data/Generator/templates/sdk/wasp/auth/responseSchemas.ts +10 -0
- package/data/Generator/templates/sdk/wasp/auth/useAuth.ts +2 -2
- package/data/Generator/templates/sdk/wasp/auth/username/actions/login.ts +5 -3
- package/data/Generator/templates/sdk/wasp/auth/username/actions/signup.ts +3 -2
- package/data/Generator/templates/sdk/wasp/client/app/layout.tsx +13 -20
- package/data/Generator/templates/sdk/wasp/client/app/pages/OAuthCallback.tsx +12 -11
- package/data/Generator/templates/sdk/wasp/client/env/schema.ts +8 -8
- package/data/Generator/templates/sdk/wasp/client/env.ts +2 -2
- package/data/Generator/templates/sdk/wasp/client/operations/internal/index.ts +4 -2
- package/data/Generator/templates/sdk/wasp/client/router/NavLink.tsx +21 -0
- package/data/Generator/templates/sdk/wasp/client/router/index.ts +2 -0
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/typescriptCheck.ts +8 -4
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/validateEnv.ts +72 -44
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/wasp.ts +1 -1
- package/data/Generator/templates/sdk/wasp/tsconfig.json +3 -0
- package/data/Generator/templates/types/spec/register.ts +14 -0
- package/data/packages/deploy/dist/providers/railway/commands/setup/setup.js +9 -0
- package/data/packages/deploy/dist/providers/railway/jsonOutputSchemas.js +47 -0
- package/data/packages/deploy/dist/providers/railway/railwayService/deployment.js +45 -0
- package/data/packages/deploy/package-lock.json +2 -2
- package/data/packages/deploy/package.json +1 -1
- package/data/packages/prisma/package-lock.json +2 -2
- package/data/packages/prisma/package.json +1 -2
- package/data/packages/spec/dist/__tests__/cli.unit.test.js +128 -0
- package/data/packages/spec/dist/__tests__/legacy/appAnalyzer.unit.test.d.ts.map +1 -0
- package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/appAnalyzer.unit.test.js +3 -3
- package/data/packages/spec/dist/__tests__/legacy/mapTsAppSpecToAppSpecDecls.integration.test.d.ts.map +1 -0
- package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/mapTsAppSpecToAppSpecDecls.integration.test.js +2 -2
- package/data/packages/spec/dist/__tests__/legacy/mapTsAppSpecToAppSpecDecls.unit.test.d.ts.map +1 -0
- package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/mapTsAppSpecToAppSpecDecls.unit.test.js +4 -18
- package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/testFixtures.d.ts +4 -4
- package/data/packages/spec/dist/__tests__/legacy/testFixtures.d.ts.map +1 -0
- package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/testFixtures.js +2 -2
- package/data/packages/spec/dist/__tests__/legacy/testFixtures.test-d.d.ts.map +1 -0
- package/data/packages/spec/dist/__tests__/spec/appAnalyzer.unit.test.d.ts +2 -0
- package/data/packages/spec/dist/__tests__/spec/appAnalyzer.unit.test.d.ts.map +1 -0
- package/data/packages/spec/dist/__tests__/spec/appAnalyzer.unit.test.js +68 -0
- package/data/packages/spec/dist/__tests__/spec/mapApp.unit.test.d.ts +2 -0
- package/data/packages/spec/dist/__tests__/spec/mapApp.unit.test.d.ts.map +1 -0
- package/data/packages/spec/dist/__tests__/spec/mapApp.unit.test.js +814 -0
- package/data/packages/spec/dist/__tests__/spec/refObject.test-d.d.ts +2 -0
- package/data/packages/spec/dist/__tests__/spec/refObject.test-d.d.ts.map +1 -0
- package/data/packages/spec/dist/__tests__/spec/refObject.test-d.js +148 -0
- package/data/packages/spec/dist/__tests__/spec/refObject.unit.test.d.ts +2 -0
- package/data/packages/spec/dist/__tests__/spec/refObject.unit.test.d.ts.map +1 -0
- package/data/packages/spec/dist/__tests__/spec/refObject.unit.test.js +49 -0
- package/data/packages/spec/dist/__tests__/spec/refObjectPath.unit.test.d.ts +2 -0
- package/data/packages/spec/dist/__tests__/spec/refObjectPath.unit.test.d.ts.map +1 -0
- package/data/packages/spec/dist/__tests__/spec/refObjectPath.unit.test.js +204 -0
- package/data/packages/spec/dist/__tests__/spec/testFixtures.d.ts +85 -0
- package/data/packages/spec/dist/__tests__/spec/testFixtures.d.ts.map +1 -0
- package/data/packages/spec/dist/__tests__/spec/testFixtures.js +473 -0
- package/data/packages/spec/dist/__tests__/spec/tsAppSpec.test-d.d.ts +2 -0
- package/data/packages/spec/dist/__tests__/spec/tsAppSpec.test-d.d.ts.map +1 -0
- package/data/packages/spec/dist/__tests__/spec/tsAppSpec.test-d.js +44 -0
- package/data/packages/spec/dist/__tests__/spec-pipeline/pipeline.integration.test.d.ts +2 -0
- package/data/packages/spec/dist/__tests__/spec-pipeline/pipeline.integration.test.d.ts.map +1 -0
- package/data/packages/spec/dist/__tests__/spec-pipeline/pipeline.integration.test.js +218 -0
- package/data/packages/spec/dist/__tests__/spec-pipeline/transformWaspTsSpecFile/imports.unit.test.d.ts +2 -0
- package/data/packages/spec/dist/__tests__/spec-pipeline/transformWaspTsSpecFile/imports.unit.test.d.ts.map +1 -0
- package/data/packages/spec/dist/__tests__/spec-pipeline/transformWaspTsSpecFile/imports.unit.test.js +174 -0
- package/data/packages/spec/dist/__tests__/spec-pipeline/transformWaspTsSpecFile/refHelper.unit.test.d.ts +2 -0
- package/data/packages/spec/dist/__tests__/spec-pipeline/transformWaspTsSpecFile/refHelper.unit.test.d.ts.map +1 -0
- package/data/packages/spec/dist/__tests__/spec-pipeline/transformWaspTsSpecFile/refHelper.unit.test.js +119 -0
- package/data/packages/{wasp-config → spec}/dist/src/appSpec.d.ts +11 -4
- package/data/packages/spec/dist/src/appSpec.d.ts.map +1 -0
- package/data/packages/{wasp-config → spec}/dist/src/cli.d.ts +3 -1
- package/data/packages/spec/dist/src/cli.d.ts.map +1 -0
- package/data/packages/spec/dist/src/cli.js +28 -0
- package/data/packages/spec/dist/src/index.d.ts +2 -0
- package/data/packages/spec/dist/src/index.d.ts.map +1 -0
- package/data/packages/spec/dist/src/index.js +1 -0
- package/data/packages/spec/dist/src/internal.d.ts +2 -0
- package/data/packages/spec/dist/src/internal.d.ts.map +1 -0
- package/data/packages/spec/dist/src/internal.js +1 -0
- package/data/packages/spec/dist/src/legacy/_private.d.ts.map +1 -0
- package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/appAnalyzer.d.ts +1 -1
- package/data/packages/spec/dist/src/legacy/appAnalyzer.d.ts.map +1 -0
- package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/mapTsAppSpecToAppSpecDecls.d.ts +1 -1
- package/data/packages/spec/dist/src/legacy/mapTsAppSpecToAppSpecDecls.d.ts.map +1 -0
- package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/mapTsAppSpecToAppSpecDecls.js +3 -6
- package/data/packages/spec/dist/src/legacy/publicApi/App.d.ts.map +1 -0
- package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/publicApi/tsAppSpec.d.ts +3 -3
- package/data/packages/spec/dist/src/legacy/publicApi/tsAppSpec.d.ts.map +1 -0
- package/data/packages/spec/dist/src/run.js +28 -0
- package/data/packages/spec/dist/src/spec/appAnalyzer.d.ts +8 -0
- package/data/packages/spec/dist/src/spec/appAnalyzer.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec/appAnalyzer.js +35 -0
- package/data/packages/spec/dist/src/spec/mapApp.d.ts +54 -0
- package/data/packages/spec/dist/src/spec/mapApp.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec/mapApp.js +336 -0
- package/data/packages/spec/dist/src/spec/publicApi/constructors.d.ts +296 -0
- package/data/packages/spec/dist/src/spec/publicApi/constructors.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec/publicApi/constructors.js +277 -0
- package/data/packages/spec/dist/src/spec/publicApi/index.d.ts +5 -0
- package/data/packages/spec/dist/src/spec/publicApi/index.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec/publicApi/index.js +2 -0
- package/data/packages/spec/dist/src/spec/publicApi/register.d.ts +9 -0
- package/data/packages/spec/dist/src/spec/publicApi/register.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec/publicApi/register.js +1 -0
- package/data/packages/spec/dist/src/spec/publicApi/waspSpec.d.ts +872 -0
- package/data/packages/spec/dist/src/spec/publicApi/waspSpec.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec/publicApi/waspSpec.js +1 -0
- package/data/packages/spec/dist/src/spec/refObject.d.ts +95 -0
- package/data/packages/spec/dist/src/spec/refObject.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec/refObject.js +119 -0
- package/data/packages/spec/dist/src/spec/refObjectPath.d.ts +18 -0
- package/data/packages/spec/dist/src/spec/refObjectPath.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec/refObjectPath.js +79 -0
- package/data/packages/spec/dist/src/spec/specUserError.d.ts +9 -0
- package/data/packages/spec/dist/src/spec/specUserError.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec/specUserError.js +8 -0
- package/data/packages/spec/dist/src/spec-pipeline/common.d.ts +2 -0
- package/data/packages/spec/dist/src/spec-pipeline/common.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec-pipeline/common.js +1 -0
- package/data/packages/spec/dist/src/spec-pipeline/loadWaspTsSpec.d.ts +5 -0
- package/data/packages/spec/dist/src/spec-pipeline/loadWaspTsSpec.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec-pipeline/loadWaspTsSpec.js +46 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/apply.d.ts +4 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/apply.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/apply.js +34 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/check.d.ts +3 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/check.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/check.js +14 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/index.d.ts +5 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/index.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/index.js +40 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/plan.d.ts +26 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/plan.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/plan.js +57 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/index.d.ts +3 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/index.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/index.js +8 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/apply.d.ts +4 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/apply.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/apply.js +18 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/check.d.ts +3 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/check.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/check.js +13 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/index.d.ts +5 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/index.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/index.js +40 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/plan.d.ts +19 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/plan.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/plan.js +60 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/util.d.ts +10 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/util.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/util.js +53 -0
- package/data/packages/spec/dist/src/spec-pipeline/typecheckPlugin/index.d.ts +5 -0
- package/data/packages/spec/dist/src/spec-pipeline/typecheckPlugin/index.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec-pipeline/typecheckPlugin/index.js +38 -0
- package/data/packages/spec/dist/src/spec-pipeline/typecheckPlugin/project.d.ts +9 -0
- package/data/packages/spec/dist/src/spec-pipeline/typecheckPlugin/project.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec-pipeline/typecheckPlugin/project.js +66 -0
- package/data/packages/spec/dist/src/typeUtils.d.ts +3 -0
- package/data/packages/spec/dist/src/typeUtils.d.ts.map +1 -0
- package/data/packages/spec/dist/src/typeUtils.js +1 -0
- package/data/packages/{wasp-config → spec}/package-lock.json +921 -1475
- package/data/packages/spec/package.json +48 -0
- package/data/packages/studio/package-lock.json +2 -2
- package/data/packages/studio/package.json +1 -1
- package/data/packages/ts-inspect/package-lock.json +2 -2
- package/data/packages/ts-inspect/package.json +1 -1
- package/package.json +1 -1
- package/wasp-bin +0 -0
- package/data/Cli/starters/basic/.prettierrc +0 -3
- package/data/Cli/starters/basic/main.wasp +0 -100
- package/data/Cli/starters/minimal/main.wasp +0 -14
- package/data/Cli/starters/ts-minimal/main.wasp.ts +0 -15
- package/data/Cli/starters/ts-minimal/package.json +0 -18
- package/data/Cli/starters/ts-minimal/schema.prisma +0 -10
- package/data/Cli/starters/ts-minimal/src/Main.css +0 -103
- package/data/Cli/starters/ts-minimal/src/MainPage.tsx +0 -37
- package/data/Cli/starters/ts-minimal/src/assets/logo.svg +0 -1
- package/data/Cli/starters/ts-minimal/tsconfig.json +0 -7
- package/data/Cli/starters/ts-minimal/vite.config.ts +0 -9
- package/data/packages/wasp-config/dist/__tests__/appAnalyzer.unit.test.d.ts.map +0 -1
- package/data/packages/wasp-config/dist/__tests__/cli.unit.test.js +0 -65
- package/data/packages/wasp-config/dist/__tests__/mapTsAppSpecToAppSpecDecls.integration.test.d.ts.map +0 -1
- package/data/packages/wasp-config/dist/__tests__/mapTsAppSpecToAppSpecDecls.unit.test.d.ts.map +0 -1
- package/data/packages/wasp-config/dist/__tests__/testFixtures.d.ts.map +0 -1
- package/data/packages/wasp-config/dist/__tests__/testFixtures.test-d.d.ts.map +0 -1
- package/data/packages/wasp-config/dist/src/_private.d.ts.map +0 -1
- package/data/packages/wasp-config/dist/src/appAnalyzer.d.ts.map +0 -1
- package/data/packages/wasp-config/dist/src/appSpec.d.ts.map +0 -1
- package/data/packages/wasp-config/dist/src/cli.d.ts.map +0 -1
- package/data/packages/wasp-config/dist/src/cli.js +0 -24
- package/data/packages/wasp-config/dist/src/index.d.ts +0 -8
- package/data/packages/wasp-config/dist/src/index.d.ts.map +0 -1
- package/data/packages/wasp-config/dist/src/index.js +0 -1
- package/data/packages/wasp-config/dist/src/mapTsAppSpecToAppSpecDecls.d.ts.map +0 -1
- package/data/packages/wasp-config/dist/src/publicApi/App.d.ts.map +0 -1
- package/data/packages/wasp-config/dist/src/publicApi/tsAppSpec.d.ts.map +0 -1
- package/data/packages/wasp-config/dist/src/run.js +0 -18
- package/data/packages/wasp-config/package.json +0 -40
- /package/data/packages/{wasp-config → spec}/dist/__tests__/cli.unit.test.d.ts +0 -0
- /package/data/packages/{wasp-config → spec}/dist/__tests__/cli.unit.test.d.ts.map +0 -0
- /package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/appAnalyzer.unit.test.d.ts +0 -0
- /package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/mapTsAppSpecToAppSpecDecls.integration.test.d.ts +0 -0
- /package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/mapTsAppSpecToAppSpecDecls.unit.test.d.ts +0 -0
- /package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/testFixtures.test-d.d.ts +0 -0
- /package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/testFixtures.test-d.js +0 -0
- /package/data/packages/{wasp-config → spec}/dist/src/appSpec.js +0 -0
- /package/data/packages/{wasp-config → spec}/dist/src/branded.d.ts +0 -0
- /package/data/packages/{wasp-config → spec}/dist/src/branded.d.ts.map +0 -0
- /package/data/packages/{wasp-config → spec}/dist/src/branded.js +0 -0
- /package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/_private.d.ts +0 -0
- /package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/_private.js +0 -0
- /package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/appAnalyzer.js +0 -0
- /package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/publicApi/App.d.ts +0 -0
- /package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/publicApi/App.js +0 -0
- /package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/publicApi/tsAppSpec.js +0 -0
- /package/data/packages/{wasp-config → spec}/dist/src/run.d.ts +0 -0
- /package/data/packages/{wasp-config → spec}/dist/src/run.d.ts.map +0 -0
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import type { Action, Api, ApiNamespace, App, Crud, Job, Page, Query, Route } from "./waspSpec.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a Wasp {@link App}.
|
|
4
|
+
*
|
|
5
|
+
* Call `app()` exactly once in your `main.wasp.ts` and export the result as
|
|
6
|
+
* the file's default export. The Wasp compiler reads this default export to
|
|
7
|
+
* generate your app.
|
|
8
|
+
*
|
|
9
|
+
* See the [Wasp Spec docs](https://wasp.sh/docs/general/spec) for the full
|
|
10
|
+
* shape of the configuration.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { app, page, route } from '@wasp.sh/spec'
|
|
15
|
+
* import MainPage from './src/MainPage' with { type: 'ref' }
|
|
16
|
+
*
|
|
17
|
+
* export default app({
|
|
18
|
+
* name: 'todoApp',
|
|
19
|
+
* title: 'ToDo App',
|
|
20
|
+
* wasp: { version: '^0.24.0' },
|
|
21
|
+
* spec: [
|
|
22
|
+
* route('MainRoute', '/', page(MainPage)),
|
|
23
|
+
* ],
|
|
24
|
+
* })
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @param config The app configuration.
|
|
28
|
+
*
|
|
29
|
+
* @category Wasp Spec
|
|
30
|
+
*/
|
|
31
|
+
export declare function app(config: AppConfig): App;
|
|
32
|
+
/**
|
|
33
|
+
* @inline
|
|
34
|
+
* @expandType App
|
|
35
|
+
*/
|
|
36
|
+
type AppConfig = Omit<App, "kind">;
|
|
37
|
+
/**
|
|
38
|
+
* Creates a {@link Page} definition.
|
|
39
|
+
*
|
|
40
|
+
* A page is a React component rendered by a {@link route}.
|
|
41
|
+
*
|
|
42
|
+
* See [Routing](https://wasp.sh/docs/advanced/routing) and the
|
|
43
|
+
* [Auth overview](https://wasp.sh/docs/auth/overview#protecting-a-page-with-authrequired)
|
|
44
|
+
* for protecting pages with `authRequired`.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* import { page } from '@wasp.sh/spec'
|
|
49
|
+
* import MainPage from './src/MainPage' with { type: 'ref' }
|
|
50
|
+
*
|
|
51
|
+
* page(MainPage, { authRequired: true })
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @param component The React component to render.
|
|
55
|
+
*
|
|
56
|
+
* {@include ./referenceImports.md}
|
|
57
|
+
* @param config Optional page settings such as `authRequired`.
|
|
58
|
+
*
|
|
59
|
+
* @category Constructors
|
|
60
|
+
*/
|
|
61
|
+
export declare function page(component: Page["component"], config?: PageConfig): Page;
|
|
62
|
+
/**
|
|
63
|
+
* @inline
|
|
64
|
+
* @expandType Page
|
|
65
|
+
*/
|
|
66
|
+
type PageConfig = Omit<Page, "kind" | "component">;
|
|
67
|
+
/**
|
|
68
|
+
* Creates a {@link Route} definition.
|
|
69
|
+
*
|
|
70
|
+
* Maps a URL path to a {@link Page}. Paths support React Router patterns
|
|
71
|
+
* such as dynamic segments (`/tasks/:id`), optional segments
|
|
72
|
+
* (`/photo/:id/edit?`), and splats (`/files/*`).
|
|
73
|
+
*
|
|
74
|
+
* Use `config.prerender` to render the route to static HTML at build time
|
|
75
|
+
* (see [Prerendering](https://wasp.sh/docs/advanced/prerendering)) and
|
|
76
|
+
* `config.lazy` to opt out of lazy-loading the page's bundle.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* import { page, route } from '@wasp.sh/spec'
|
|
81
|
+
* import MainPage from './src/MainPage' with { type: 'ref' }
|
|
82
|
+
*
|
|
83
|
+
* route('MainRoute', '/', page(MainPage))
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
86
|
+
* @param name Unique name for the route.
|
|
87
|
+
* @param path URL path the route matches.
|
|
88
|
+
* @param page The result of `page()`.
|
|
89
|
+
* @param config Optional route settings (`lazy`, `prerender`).
|
|
90
|
+
*
|
|
91
|
+
* @category Constructors
|
|
92
|
+
*/
|
|
93
|
+
export declare function route(name: Route["name"], path: Route["path"],
|
|
94
|
+
/**
|
|
95
|
+
* @remarks
|
|
96
|
+
* This should be the result of the `page()` function.
|
|
97
|
+
*/
|
|
98
|
+
page: Route["page"], config?: RouteConfig): Route;
|
|
99
|
+
/**
|
|
100
|
+
* @inline
|
|
101
|
+
* @expandType Route
|
|
102
|
+
*/
|
|
103
|
+
type RouteConfig = Omit<Route, "kind" | "name" | "path" | "page">;
|
|
104
|
+
/**
|
|
105
|
+
* Creates a {@link Query} definition.
|
|
106
|
+
*
|
|
107
|
+
* Queries are server-side read-only operations. They can be invoked from
|
|
108
|
+
* the client (with caching via `useQuery`) and the server. List the
|
|
109
|
+
* entities the query reads from so Wasp can inject the matching Prisma
|
|
110
|
+
* delegates into `context.entities` and invalidate the client cache when
|
|
111
|
+
* related actions modify them.
|
|
112
|
+
*
|
|
113
|
+
* See [Queries](https://wasp.sh/docs/data-model/operations/queries).
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```ts
|
|
117
|
+
* import { query } from '@wasp.sh/spec'
|
|
118
|
+
* import { getTasks } from './src/queries' with { type: 'ref' }
|
|
119
|
+
*
|
|
120
|
+
* query(getTasks, { entities: ['Task'] })
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* @param fn The Query's NodeJS implementation.
|
|
124
|
+
*
|
|
125
|
+
* {@include ./referenceImports.md}
|
|
126
|
+
* @param config Optional settings: `entities` and `auth`.
|
|
127
|
+
*
|
|
128
|
+
* @category Constructors
|
|
129
|
+
*/
|
|
130
|
+
export declare function query(fn: Query["fn"], config?: QueryConfig): Query;
|
|
131
|
+
/**
|
|
132
|
+
* @inline
|
|
133
|
+
* @expandType Query
|
|
134
|
+
*/
|
|
135
|
+
type QueryConfig = Omit<Query, "kind" | "fn">;
|
|
136
|
+
/**
|
|
137
|
+
* Creates an {@link Action} definition.
|
|
138
|
+
*
|
|
139
|
+
* Actions are server-side write operations. Like queries, they can be
|
|
140
|
+
* called from the client and the server. Listing entities in `config.entities`
|
|
141
|
+
* lets Wasp invalidate related query caches when this action runs.
|
|
142
|
+
*
|
|
143
|
+
* See [Actions](https://wasp.sh/docs/data-model/operations/actions).
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```ts
|
|
147
|
+
* import { action } from '@wasp.sh/spec'
|
|
148
|
+
* import { createTask } from './src/actions' with { type: 'ref' }
|
|
149
|
+
*
|
|
150
|
+
* action(createTask, { entities: ['Task'] })
|
|
151
|
+
* ```
|
|
152
|
+
*
|
|
153
|
+
* @param fn The Action's NodeJS implementation.
|
|
154
|
+
*
|
|
155
|
+
* {@include ./referenceImports.md}
|
|
156
|
+
* @param config Optional settings: `entities` and `auth`.
|
|
157
|
+
*
|
|
158
|
+
* @category Constructors
|
|
159
|
+
*/
|
|
160
|
+
export declare function action(fn: Action["fn"], config?: ActionConfig): Action;
|
|
161
|
+
/**
|
|
162
|
+
* @inline
|
|
163
|
+
* @expandType Action
|
|
164
|
+
*/
|
|
165
|
+
type ActionConfig = Omit<Action, "kind" | "fn">;
|
|
166
|
+
/**
|
|
167
|
+
* Creates an {@link Api} endpoint definition.
|
|
168
|
+
*
|
|
169
|
+
* APIs are custom HTTP endpoints handled by a plain Express function. Use
|
|
170
|
+
* them for webhooks, file uploads, or any HTTP interaction that doesn't fit
|
|
171
|
+
* the {@link query}/{@link action} model.
|
|
172
|
+
*
|
|
173
|
+
* See [Custom HTTP API Endpoints](https://wasp.sh/docs/advanced/apis).
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* ```ts
|
|
177
|
+
* import { api } from '@wasp.sh/spec'
|
|
178
|
+
* import { barBaz } from './src/apis' with { type: 'ref' }
|
|
179
|
+
*
|
|
180
|
+
* api('GET', '/bar/baz', barBaz, { entities: ['Task'], auth: false })
|
|
181
|
+
* ```
|
|
182
|
+
*
|
|
183
|
+
* @param method HTTP method to listen on (or `"ALL"` for any).
|
|
184
|
+
* @param path Express path the endpoint is mounted at.
|
|
185
|
+
* @param fn The API's NodeJS implementation.
|
|
186
|
+
*
|
|
187
|
+
* {@include ./referenceImports.md}
|
|
188
|
+
* @param config Optional settings: `middlewareConfigFn`, `entities`, `auth`.
|
|
189
|
+
*
|
|
190
|
+
* @category Constructors
|
|
191
|
+
*/
|
|
192
|
+
export declare function api(method: Api["method"], path: Api["path"], fn: Api["fn"], config?: ApiConfig): Api;
|
|
193
|
+
/**
|
|
194
|
+
* @inline
|
|
195
|
+
* @expandType Api
|
|
196
|
+
*/
|
|
197
|
+
type ApiConfig = Omit<Api, "kind" | "method" | "path" | "fn">;
|
|
198
|
+
/**
|
|
199
|
+
* Creates an {@link ApiNamespace} definition.
|
|
200
|
+
*
|
|
201
|
+
* Applies a shared middleware function to every {@link api} mounted under a
|
|
202
|
+
* given path prefix. Useful for tweaking middleware (e.g. raw body parsing,
|
|
203
|
+
* CORS) for a group of related endpoints.
|
|
204
|
+
*
|
|
205
|
+
* See the
|
|
206
|
+
* [per-path middleware section](https://wasp.sh/docs/advanced/middleware-config#3-customize-per-path-middleware).
|
|
207
|
+
*
|
|
208
|
+
* @example
|
|
209
|
+
* ```ts
|
|
210
|
+
* import { apiNamespace } from '@wasp.sh/spec'
|
|
211
|
+
* import { barMiddleware } from './src/apis' with { type: 'ref' }
|
|
212
|
+
*
|
|
213
|
+
* apiNamespace('/bar', { middlewareConfigFn: barMiddleware })
|
|
214
|
+
* ```
|
|
215
|
+
*
|
|
216
|
+
* @param path Path prefix the namespace applies to.
|
|
217
|
+
* @param config Required `middlewareConfigFn`.
|
|
218
|
+
*
|
|
219
|
+
* {@include ./referenceImports.md}
|
|
220
|
+
*
|
|
221
|
+
* @category Constructors
|
|
222
|
+
*/
|
|
223
|
+
export declare function apiNamespace(path: ApiNamespace["path"], config: ApiNamespaceConfig): ApiNamespace;
|
|
224
|
+
/**
|
|
225
|
+
* @inline
|
|
226
|
+
* @expandType ApiNamespace
|
|
227
|
+
*/
|
|
228
|
+
type ApiNamespaceConfig = Omit<ApiNamespace, "kind" | "path">;
|
|
229
|
+
/**
|
|
230
|
+
* Creates a {@link Job} definition.
|
|
231
|
+
*
|
|
232
|
+
* Jobs are background tasks that persist across server restarts, can be
|
|
233
|
+
* retried on failure, delayed, and scheduled with cron. Pass the worker
|
|
234
|
+
* function as the first argument and configure the executor and schedule
|
|
235
|
+
* in `config`.
|
|
236
|
+
*
|
|
237
|
+
* See [Recurring Jobs](https://wasp.sh/docs/advanced/jobs).
|
|
238
|
+
*
|
|
239
|
+
* @example
|
|
240
|
+
* ```ts
|
|
241
|
+
* import { job } from '@wasp.sh/spec'
|
|
242
|
+
* import { foo } from './src/jobs/bar' with { type: 'ref' }
|
|
243
|
+
*
|
|
244
|
+
* job(foo, {
|
|
245
|
+
* executor: 'PgBoss',
|
|
246
|
+
* entities: ['Task'],
|
|
247
|
+
* schedule: { cron: '0 * * * *' },
|
|
248
|
+
* })
|
|
249
|
+
* ```
|
|
250
|
+
*
|
|
251
|
+
* @param fn The async function that performs the job's work. It receives the
|
|
252
|
+
* submitted args and a context containing the declared entities.
|
|
253
|
+
*
|
|
254
|
+
* {@include ./referenceImports.md}
|
|
255
|
+
* @param config Required `executor` and optional `schedule`, `entities`,
|
|
256
|
+
* and `performExecutorOptions`.
|
|
257
|
+
*
|
|
258
|
+
* @category Constructors
|
|
259
|
+
*/
|
|
260
|
+
export declare function job(fn: Job["fn"], config: JobConfig): Job;
|
|
261
|
+
/**
|
|
262
|
+
* @inline
|
|
263
|
+
* @expandType Job
|
|
264
|
+
*/
|
|
265
|
+
type JobConfig = Omit<Job, "kind" | "fn">;
|
|
266
|
+
/**
|
|
267
|
+
* Creates a {@link Crud} definition.
|
|
268
|
+
*
|
|
269
|
+
* Auto-generates queries and actions for a Prisma entity. Each operation in
|
|
270
|
+
* `operations` can be enabled with defaults (an empty object), made public
|
|
271
|
+
* via `isPublic`, or replaced by a custom implementation via `overrideFn`.
|
|
272
|
+
*
|
|
273
|
+
* See [Automatic CRUD](https://wasp.sh/docs/data-model/crud).
|
|
274
|
+
*
|
|
275
|
+
* @example
|
|
276
|
+
* ```ts
|
|
277
|
+
* import { crud } from '@wasp.sh/spec'
|
|
278
|
+
* import { createTaskOverride } from './src/actions' with { type: 'ref' }
|
|
279
|
+
*
|
|
280
|
+
* crud('tasks', 'Task', {
|
|
281
|
+
* getAll: {},
|
|
282
|
+
* create: { overrideFn: createTaskOverride },
|
|
283
|
+
* })
|
|
284
|
+
* ```
|
|
285
|
+
*
|
|
286
|
+
* @param name Unique name for the generated CRUD.
|
|
287
|
+
* @param entity Name of the Prisma entity to generate operations for.
|
|
288
|
+
* @param operations Which operations to generate and how to configure each.
|
|
289
|
+
*
|
|
290
|
+
* {@include ./referenceImports.md}
|
|
291
|
+
*
|
|
292
|
+
* @category Constructors
|
|
293
|
+
*/
|
|
294
|
+
export declare function crud(name: Crud["name"], entity: Crud["entity"], operations: Crud["operations"]): Crud;
|
|
295
|
+
export {};
|
|
296
|
+
//# sourceMappingURL=constructors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constructors.d.ts","sourceRoot":"","sources":["../../../../src/spec/publicApi/constructors.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
// Throughout this file, in order for the constructor's input type to be
|
|
2
|
+
// expanded in the docs, but not the resulting type; we do one bit of
|
|
3
|
+
// indirection, by creating a {Type}Config file, and setting it with the
|
|
4
|
+
// `@inline` and `@expandType {Type}` tags. This makes sure that the config
|
|
5
|
+
// option appear right in the documentation of the so users don't have to move
|
|
6
|
+
// to another page to see the fields.
|
|
7
|
+
/**
|
|
8
|
+
* Creates a Wasp {@link App}.
|
|
9
|
+
*
|
|
10
|
+
* Call `app()` exactly once in your `main.wasp.ts` and export the result as
|
|
11
|
+
* the file's default export. The Wasp compiler reads this default export to
|
|
12
|
+
* generate your app.
|
|
13
|
+
*
|
|
14
|
+
* See the [Wasp Spec docs](https://wasp.sh/docs/general/spec) for the full
|
|
15
|
+
* shape of the configuration.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { app, page, route } from '@wasp.sh/spec'
|
|
20
|
+
* import MainPage from './src/MainPage' with { type: 'ref' }
|
|
21
|
+
*
|
|
22
|
+
* export default app({
|
|
23
|
+
* name: 'todoApp',
|
|
24
|
+
* title: 'ToDo App',
|
|
25
|
+
* wasp: { version: '^0.24.0' },
|
|
26
|
+
* spec: [
|
|
27
|
+
* route('MainRoute', '/', page(MainPage)),
|
|
28
|
+
* ],
|
|
29
|
+
* })
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @param config The app configuration.
|
|
33
|
+
*
|
|
34
|
+
* @category Wasp Spec
|
|
35
|
+
*/
|
|
36
|
+
export function app(config) {
|
|
37
|
+
return config;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Creates a {@link Page} definition.
|
|
41
|
+
*
|
|
42
|
+
* A page is a React component rendered by a {@link route}.
|
|
43
|
+
*
|
|
44
|
+
* See [Routing](https://wasp.sh/docs/advanced/routing) and the
|
|
45
|
+
* [Auth overview](https://wasp.sh/docs/auth/overview#protecting-a-page-with-authrequired)
|
|
46
|
+
* for protecting pages with `authRequired`.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* import { page } from '@wasp.sh/spec'
|
|
51
|
+
* import MainPage from './src/MainPage' with { type: 'ref' }
|
|
52
|
+
*
|
|
53
|
+
* page(MainPage, { authRequired: true })
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* @param component The React component to render.
|
|
57
|
+
*
|
|
58
|
+
* {@include ./referenceImports.md}
|
|
59
|
+
* @param config Optional page settings such as `authRequired`.
|
|
60
|
+
*
|
|
61
|
+
* @category Constructors
|
|
62
|
+
*/
|
|
63
|
+
export function page(component, config) {
|
|
64
|
+
return { kind: "page", component, ...config };
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Creates a {@link Route} definition.
|
|
68
|
+
*
|
|
69
|
+
* Maps a URL path to a {@link Page}. Paths support React Router patterns
|
|
70
|
+
* such as dynamic segments (`/tasks/:id`), optional segments
|
|
71
|
+
* (`/photo/:id/edit?`), and splats (`/files/*`).
|
|
72
|
+
*
|
|
73
|
+
* Use `config.prerender` to render the route to static HTML at build time
|
|
74
|
+
* (see [Prerendering](https://wasp.sh/docs/advanced/prerendering)) and
|
|
75
|
+
* `config.lazy` to opt out of lazy-loading the page's bundle.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* import { page, route } from '@wasp.sh/spec'
|
|
80
|
+
* import MainPage from './src/MainPage' with { type: 'ref' }
|
|
81
|
+
*
|
|
82
|
+
* route('MainRoute', '/', page(MainPage))
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* @param name Unique name for the route.
|
|
86
|
+
* @param path URL path the route matches.
|
|
87
|
+
* @param page The result of `page()`.
|
|
88
|
+
* @param config Optional route settings (`lazy`, `prerender`).
|
|
89
|
+
*
|
|
90
|
+
* @category Constructors
|
|
91
|
+
*/
|
|
92
|
+
export function route(name, path,
|
|
93
|
+
/**
|
|
94
|
+
* @remarks
|
|
95
|
+
* This should be the result of the `page()` function.
|
|
96
|
+
*/
|
|
97
|
+
page, config) {
|
|
98
|
+
return { kind: "route", name, path, page, ...config };
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Creates a {@link Query} definition.
|
|
102
|
+
*
|
|
103
|
+
* Queries are server-side read-only operations. They can be invoked from
|
|
104
|
+
* the client (with caching via `useQuery`) and the server. List the
|
|
105
|
+
* entities the query reads from so Wasp can inject the matching Prisma
|
|
106
|
+
* delegates into `context.entities` and invalidate the client cache when
|
|
107
|
+
* related actions modify them.
|
|
108
|
+
*
|
|
109
|
+
* See [Queries](https://wasp.sh/docs/data-model/operations/queries).
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```ts
|
|
113
|
+
* import { query } from '@wasp.sh/spec'
|
|
114
|
+
* import { getTasks } from './src/queries' with { type: 'ref' }
|
|
115
|
+
*
|
|
116
|
+
* query(getTasks, { entities: ['Task'] })
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* @param fn The Query's NodeJS implementation.
|
|
120
|
+
*
|
|
121
|
+
* {@include ./referenceImports.md}
|
|
122
|
+
* @param config Optional settings: `entities` and `auth`.
|
|
123
|
+
*
|
|
124
|
+
* @category Constructors
|
|
125
|
+
*/
|
|
126
|
+
export function query(fn, config) {
|
|
127
|
+
return { kind: "query", fn, ...config };
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Creates an {@link Action} definition.
|
|
131
|
+
*
|
|
132
|
+
* Actions are server-side write operations. Like queries, they can be
|
|
133
|
+
* called from the client and the server. Listing entities in `config.entities`
|
|
134
|
+
* lets Wasp invalidate related query caches when this action runs.
|
|
135
|
+
*
|
|
136
|
+
* See [Actions](https://wasp.sh/docs/data-model/operations/actions).
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```ts
|
|
140
|
+
* import { action } from '@wasp.sh/spec'
|
|
141
|
+
* import { createTask } from './src/actions' with { type: 'ref' }
|
|
142
|
+
*
|
|
143
|
+
* action(createTask, { entities: ['Task'] })
|
|
144
|
+
* ```
|
|
145
|
+
*
|
|
146
|
+
* @param fn The Action's NodeJS implementation.
|
|
147
|
+
*
|
|
148
|
+
* {@include ./referenceImports.md}
|
|
149
|
+
* @param config Optional settings: `entities` and `auth`.
|
|
150
|
+
*
|
|
151
|
+
* @category Constructors
|
|
152
|
+
*/
|
|
153
|
+
export function action(fn, config) {
|
|
154
|
+
return { kind: "action", fn, ...config };
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Creates an {@link Api} endpoint definition.
|
|
158
|
+
*
|
|
159
|
+
* APIs are custom HTTP endpoints handled by a plain Express function. Use
|
|
160
|
+
* them for webhooks, file uploads, or any HTTP interaction that doesn't fit
|
|
161
|
+
* the {@link query}/{@link action} model.
|
|
162
|
+
*
|
|
163
|
+
* See [Custom HTTP API Endpoints](https://wasp.sh/docs/advanced/apis).
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```ts
|
|
167
|
+
* import { api } from '@wasp.sh/spec'
|
|
168
|
+
* import { barBaz } from './src/apis' with { type: 'ref' }
|
|
169
|
+
*
|
|
170
|
+
* api('GET', '/bar/baz', barBaz, { entities: ['Task'], auth: false })
|
|
171
|
+
* ```
|
|
172
|
+
*
|
|
173
|
+
* @param method HTTP method to listen on (or `"ALL"` for any).
|
|
174
|
+
* @param path Express path the endpoint is mounted at.
|
|
175
|
+
* @param fn The API's NodeJS implementation.
|
|
176
|
+
*
|
|
177
|
+
* {@include ./referenceImports.md}
|
|
178
|
+
* @param config Optional settings: `middlewareConfigFn`, `entities`, `auth`.
|
|
179
|
+
*
|
|
180
|
+
* @category Constructors
|
|
181
|
+
*/
|
|
182
|
+
export function api(method, path, fn, config) {
|
|
183
|
+
return { kind: "api", method, path, fn, ...config };
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Creates an {@link ApiNamespace} definition.
|
|
187
|
+
*
|
|
188
|
+
* Applies a shared middleware function to every {@link api} mounted under a
|
|
189
|
+
* given path prefix. Useful for tweaking middleware (e.g. raw body parsing,
|
|
190
|
+
* CORS) for a group of related endpoints.
|
|
191
|
+
*
|
|
192
|
+
* See the
|
|
193
|
+
* [per-path middleware section](https://wasp.sh/docs/advanced/middleware-config#3-customize-per-path-middleware).
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* ```ts
|
|
197
|
+
* import { apiNamespace } from '@wasp.sh/spec'
|
|
198
|
+
* import { barMiddleware } from './src/apis' with { type: 'ref' }
|
|
199
|
+
*
|
|
200
|
+
* apiNamespace('/bar', { middlewareConfigFn: barMiddleware })
|
|
201
|
+
* ```
|
|
202
|
+
*
|
|
203
|
+
* @param path Path prefix the namespace applies to.
|
|
204
|
+
* @param config Required `middlewareConfigFn`.
|
|
205
|
+
*
|
|
206
|
+
* {@include ./referenceImports.md}
|
|
207
|
+
*
|
|
208
|
+
* @category Constructors
|
|
209
|
+
*/
|
|
210
|
+
export function apiNamespace(path, config) {
|
|
211
|
+
return { kind: "apiNamespace", path, ...config };
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Creates a {@link Job} definition.
|
|
215
|
+
*
|
|
216
|
+
* Jobs are background tasks that persist across server restarts, can be
|
|
217
|
+
* retried on failure, delayed, and scheduled with cron. Pass the worker
|
|
218
|
+
* function as the first argument and configure the executor and schedule
|
|
219
|
+
* in `config`.
|
|
220
|
+
*
|
|
221
|
+
* See [Recurring Jobs](https://wasp.sh/docs/advanced/jobs).
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* ```ts
|
|
225
|
+
* import { job } from '@wasp.sh/spec'
|
|
226
|
+
* import { foo } from './src/jobs/bar' with { type: 'ref' }
|
|
227
|
+
*
|
|
228
|
+
* job(foo, {
|
|
229
|
+
* executor: 'PgBoss',
|
|
230
|
+
* entities: ['Task'],
|
|
231
|
+
* schedule: { cron: '0 * * * *' },
|
|
232
|
+
* })
|
|
233
|
+
* ```
|
|
234
|
+
*
|
|
235
|
+
* @param fn The async function that performs the job's work. It receives the
|
|
236
|
+
* submitted args and a context containing the declared entities.
|
|
237
|
+
*
|
|
238
|
+
* {@include ./referenceImports.md}
|
|
239
|
+
* @param config Required `executor` and optional `schedule`, `entities`,
|
|
240
|
+
* and `performExecutorOptions`.
|
|
241
|
+
*
|
|
242
|
+
* @category Constructors
|
|
243
|
+
*/
|
|
244
|
+
export function job(fn, config) {
|
|
245
|
+
return { kind: "job", fn, ...config };
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Creates a {@link Crud} definition.
|
|
249
|
+
*
|
|
250
|
+
* Auto-generates queries and actions for a Prisma entity. Each operation in
|
|
251
|
+
* `operations` can be enabled with defaults (an empty object), made public
|
|
252
|
+
* via `isPublic`, or replaced by a custom implementation via `overrideFn`.
|
|
253
|
+
*
|
|
254
|
+
* See [Automatic CRUD](https://wasp.sh/docs/data-model/crud).
|
|
255
|
+
*
|
|
256
|
+
* @example
|
|
257
|
+
* ```ts
|
|
258
|
+
* import { crud } from '@wasp.sh/spec'
|
|
259
|
+
* import { createTaskOverride } from './src/actions' with { type: 'ref' }
|
|
260
|
+
*
|
|
261
|
+
* crud('tasks', 'Task', {
|
|
262
|
+
* getAll: {},
|
|
263
|
+
* create: { overrideFn: createTaskOverride },
|
|
264
|
+
* })
|
|
265
|
+
* ```
|
|
266
|
+
*
|
|
267
|
+
* @param name Unique name for the generated CRUD.
|
|
268
|
+
* @param entity Name of the Prisma entity to generate operations for.
|
|
269
|
+
* @param operations Which operations to generate and how to configure each.
|
|
270
|
+
*
|
|
271
|
+
* {@include ./referenceImports.md}
|
|
272
|
+
*
|
|
273
|
+
* @category Constructors
|
|
274
|
+
*/
|
|
275
|
+
export function crud(name, entity, operations) {
|
|
276
|
+
return { kind: "crud", name, entity, operations };
|
|
277
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/spec/publicApi/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EACL,MAAM,EACN,GAAG,EACH,YAAY,EACZ,GAAG,EACH,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,KAAK,EACL,KAAK,GACN,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,mBAAmB,eAAe,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registry for type augmentation via declaration merging.
|
|
3
|
+
*
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export interface Register {
|
|
7
|
+
}
|
|
8
|
+
export type FromRegister<Key extends string, Fallback> = Key extends keyof Register ? Register[Key] : Fallback;
|
|
9
|
+
//# sourceMappingURL=register.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/spec/publicApi/register.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,QAAQ;CAAG;AAE5B,MAAM,MAAM,YAAY,CACtB,GAAG,SAAS,MAAM,EAClB,QAAQ,IACN,GAAG,SAAS,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|