@wasp.sh/wasp-cli-darwin-arm64-unknown 0.24.0 → 0.25.0-rc.1
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 +1 -1
- package/data/Cli/starters/basic/package.json +5 -5
- package/data/Cli/starters/basic/src/App.css +12 -11
- package/data/Cli/starters/basic/src/assets/wasp-logo-rounded.svg +1 -0
- package/data/Cli/starters/basic/src/shared/components/Header.tsx +3 -3
- package/data/Cli/starters/minimal/main.wasp.ts +1 -1
- package/data/Cli/starters/minimal/package.json +4 -4
- package/data/Cli/starters/minimal/src/Main.css +5 -5
- package/data/Cli/starters/minimal/src/MainPage.tsx +2 -2
- package/data/Cli/starters/minimal/src/assets/wasp-logo-rounded.svg +1 -0
- package/data/Cli/starters/skeleton/public/favicon.ico +0 -0
- package/data/Cli/starters/skeleton/tsconfig.src.json +2 -1
- package/data/Cli/starters/skeleton/tsconfig.wasp.json +3 -2
- package/data/Generator/libs/auth/wasp.sh-lib-auth-0.25.0.tgz +0 -0
- package/data/Generator/libs/vite-ssr/wasp.sh-lib-vite-ssr-0.25.0.tgz +0 -0
- package/data/Generator/templates/sdk/wasp/api/index.ts +2 -2
- package/data/Generator/templates/sdk/wasp/auth/email/actions/login.ts +1 -1
- package/data/Generator/templates/sdk/wasp/auth/email/actions/passwordReset.ts +1 -1
- package/data/Generator/templates/sdk/wasp/auth/email/actions/signup.ts +1 -1
- package/data/Generator/templates/sdk/wasp/auth/email/actions/verifyEmail.ts +1 -1
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/auth-styles.css +2 -2
- package/data/Generator/templates/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx +1 -1
- package/data/Generator/templates/sdk/wasp/auth/helpers/_Provider.tsx +1 -1
- package/data/Generator/templates/sdk/wasp/auth/helpers/user.ts +1 -1
- package/data/Generator/templates/sdk/wasp/auth/jwt.ts +1 -1
- package/data/Generator/templates/sdk/wasp/auth/logout.ts +1 -1
- package/data/Generator/templates/sdk/wasp/auth/lucia.ts +2 -2
- package/data/Generator/templates/sdk/wasp/auth/providers/types.ts +1 -1
- package/data/Generator/templates/sdk/wasp/auth/session.ts +1 -1
- package/data/Generator/templates/sdk/wasp/auth/types.ts +1 -1
- package/data/Generator/templates/sdk/wasp/auth/useAuth.ts +5 -5
- package/data/Generator/templates/sdk/wasp/auth/username/actions/login.ts +1 -1
- package/data/Generator/templates/sdk/wasp/auth/username/actions/signup.ts +1 -1
- package/data/Generator/templates/sdk/wasp/auth/utils.ts +3 -3
- package/data/Generator/templates/sdk/wasp/auth/validation.ts +1 -1
- package/data/Generator/templates/sdk/wasp/client/app/layout.tsx +55 -46
- package/data/Generator/templates/sdk/wasp/client/app/router.tsx +2 -5
- package/data/Generator/templates/sdk/wasp/client/crud/_crud.ts +2 -2
- package/data/Generator/templates/sdk/wasp/client/operations/actions/core.ts +1 -1
- package/data/Generator/templates/sdk/wasp/client/operations/index.ts +5 -0
- package/data/Generator/templates/sdk/wasp/client/operations/internal/index.ts +3 -3
- package/data/Generator/templates/sdk/wasp/client/operations/internal/resources.js +4 -2
- package/data/Generator/templates/sdk/wasp/client/operations/queries/core.ts +2 -2
- package/data/Generator/templates/sdk/wasp/client/operations/rpc.ts +2 -2
- package/data/Generator/templates/sdk/wasp/client/test/vitest/helpers.tsx +3 -4
- package/data/Generator/templates/sdk/wasp/client/vite/plugins/validateEnv.ts +14 -8
- package/data/Generator/templates/sdk/wasp/client/vite/virtual-files/files/client-entry.tsx +31 -11
- package/data/Generator/templates/sdk/wasp/client/vite/virtual-files/files/routes.tsx +26 -20
- package/data/Generator/templates/sdk/wasp/client/vite/virtual-files/files/ssr-entry.tsx +29 -24
- package/data/Generator/templates/sdk/wasp/client/vite/virtual-files/resolver.ts +12 -5
- package/data/Generator/templates/sdk/wasp/client/webSocket/WebSocketProvider.tsx +4 -4
- package/data/Generator/templates/sdk/wasp/client/webSocket/index.ts +1 -1
- package/data/Generator/templates/sdk/wasp/core/auth.ts +3 -3
- package/data/Generator/templates/sdk/wasp/env/validation.ts +1 -1
- package/data/Generator/templates/sdk/wasp/package.json +2 -42
- package/data/Generator/templates/sdk/wasp/serialization/index.ts +11 -0
- package/data/Generator/templates/sdk/wasp/server/_types/index.ts +6 -6
- package/data/Generator/templates/sdk/wasp/server/_types/taggedEntities.ts +1 -1
- package/data/Generator/templates/sdk/wasp/server/auth/email/utils.ts +6 -6
- package/data/Generator/templates/sdk/wasp/server/crud/_operationTypes.ts +2 -2
- package/data/Generator/templates/sdk/wasp/server/email/core/index.ts +4 -0
- package/data/Generator/templates/sdk/wasp/server/email/core/providers/dummy.ts +1 -1
- package/data/Generator/templates/sdk/wasp/server/email/core/providers/resend.ts +31 -0
- package/data/Generator/templates/sdk/wasp/server/email/core/types.ts +7 -1
- package/data/Generator/templates/sdk/wasp/server/email/index.ts +6 -0
- package/data/Generator/templates/sdk/wasp/server/env.ts +5 -0
- package/data/Generator/templates/sdk/wasp/server/jobs/_job.ts +2 -2
- package/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts +3 -3
- package/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/types.ts +2 -2
- package/data/Generator/templates/sdk/wasp/server/operations/actions/index.ts +1 -1
- package/data/Generator/templates/sdk/wasp/server/operations/actions/types.ts +2 -2
- package/data/Generator/templates/sdk/wasp/server/operations/queries/index.ts +1 -1
- package/data/Generator/templates/sdk/wasp/server/operations/queries/types.ts +2 -2
- package/data/Generator/templates/sdk/wasp/server/operations/wrappers.ts +1 -1
- package/data/Generator/templates/sdk/wasp/server/webSocket/index.ts +2 -3
- package/data/Generator/templates/sdk/wasp/tsconfig.json +1 -0
- package/data/Generator/templates/server/tsconfig.json +2 -1
- package/data/packages/deploy/package-lock.json +2015 -2285
- package/data/packages/deploy/package.json +7 -6
- package/data/packages/prisma/package-lock.json +1730 -2131
- package/data/packages/prisma/package.json +6 -6
- package/data/packages/spec/dist/__tests__/spec/appAnalyzer.unit.test.js +4 -4
- package/data/packages/spec/dist/__tests__/spec/mapApp.unit.test.js +161 -129
- package/data/packages/spec/dist/__tests__/spec/normalizePrerender.unit.test.d.ts +2 -0
- package/data/packages/spec/dist/__tests__/spec/normalizePrerender.unit.test.d.ts.map +1 -0
- package/data/packages/spec/dist/__tests__/spec/normalizePrerender.unit.test.js +15 -0
- package/data/packages/spec/dist/__tests__/spec/refObject.unit.test.js +2 -2
- package/data/packages/spec/dist/__tests__/spec/refObjectPath.unit.test.js +3 -3
- package/data/packages/spec/dist/__tests__/spec-pipeline/pipeline.integration.test.js +38 -7
- package/data/packages/spec/dist/__tests__/spec-pipeline/transformWaspTsSpecFile/imports.unit.test.js +5 -5
- package/data/packages/spec/dist/__tests__/spec-pipeline/transformWaspTsSpecFile/refHelper.unit.test.js +2 -2
- package/data/packages/spec/dist/src/appSpec.d.ts +2 -2
- package/data/packages/spec/dist/src/appSpec.d.ts.map +1 -1
- package/data/packages/spec/dist/src/normalizePrerender.d.ts +11 -0
- package/data/packages/spec/dist/src/normalizePrerender.d.ts.map +1 -0
- package/data/packages/spec/dist/src/normalizePrerender.js +18 -0
- package/data/packages/spec/dist/src/run.js +2 -2
- package/data/packages/spec/dist/src/spec/appAnalyzer.js +5 -5
- package/data/packages/spec/dist/src/spec/mapper/app.d.ts +17 -0
- package/data/packages/spec/dist/src/spec/mapper/app.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec/mapper/app.js +119 -0
- package/data/packages/spec/dist/src/spec/mapper/context.d.ts +19 -0
- package/data/packages/spec/dist/src/spec/mapper/context.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec/mapper/context.js +65 -0
- package/data/packages/spec/dist/src/spec/mapper/index.d.ts +7 -0
- package/data/packages/spec/dist/src/spec/mapper/index.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec/mapper/index.js +20 -0
- package/data/packages/spec/dist/src/spec/mapper/specElements.d.ts +28 -0
- package/data/packages/spec/dist/src/spec/mapper/specElements.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec/mapper/specElements.js +162 -0
- package/data/packages/spec/dist/src/spec/publicApi/constructors.d.ts +54 -13
- package/data/packages/spec/dist/src/spec/publicApi/constructors.d.ts.map +1 -1
- package/data/packages/spec/dist/src/spec/publicApi/constructors.js +10 -7
- package/data/packages/spec/dist/src/spec/publicApi/index.d.ts +2 -0
- package/data/packages/spec/dist/src/spec/publicApi/index.d.ts.map +1 -1
- package/data/packages/spec/dist/src/spec/publicApi/index.js +1 -0
- package/data/packages/spec/dist/src/spec/publicApi/waspSpec.d.ts +23 -10
- package/data/packages/spec/dist/src/spec/publicApi/waspSpec.d.ts.map +1 -1
- package/data/packages/spec/dist/src/spec/refObject.js +4 -4
- package/data/packages/spec/dist/src/spec/refObjectPath.js +2 -2
- package/data/packages/spec/dist/src/spec/waspSpecUserError.d.ts +31 -0
- package/data/packages/spec/dist/src/spec/waspSpecUserError.d.ts.map +1 -0
- package/data/packages/spec/dist/src/spec/waspSpecUserError.js +30 -0
- package/data/packages/spec/dist/src/spec-pipeline/loadWaspTsSpec.d.ts.map +1 -1
- package/data/packages/spec/dist/src/spec-pipeline/loadWaspTsSpec.js +18 -15
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/apply.js +2 -2
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/check.js +2 -2
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/plan.js +2 -2
- package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/check.js +2 -2
- package/data/packages/spec/dist/src/spec-pipeline/typecheckPlugin/index.js +2 -2
- package/data/packages/spec/package-lock.json +189 -169
- package/data/packages/spec/package.json +30 -7
- package/data/packages/studio/dist/public/assets/Flow-CyIU6UP_.js +26 -0
- package/data/packages/studio/dist/public/assets/dist-CttM53IC.js +1 -0
- package/data/packages/studio/dist/public/assets/index-Cb2AqsRv.js +20 -0
- package/data/packages/studio/dist/public/assets/index-Cq-JJ-zI.css +1 -0
- package/data/packages/studio/dist/public/index.html +2 -2
- package/data/packages/studio/package-lock.json +6 -6
- package/data/packages/studio/package.json +2 -2
- package/data/packages/ts-inspect/package-lock.json +1918 -2142
- package/data/packages/ts-inspect/package.json +6 -6
- package/package.json +1 -1
- package/wasp-bin +0 -0
- package/data/Cli/starters/basic/src/assets/logo.svg +0 -1
- package/data/Cli/starters/minimal/src/assets/logo.svg +0 -1
- package/data/Cli/starters/skeleton/public/.gitkeep +0 -0
- package/data/Generator/libs/auth/wasp.sh-lib-auth-0.24.0.tgz +0 -0
- package/data/Generator/libs/vite-ssr/wasp.sh-lib-vite-ssr-0.24.0.tgz +0 -0
- package/data/Generator/templates/sdk/wasp/client/app/hooks/useIsClient.ts +0 -16
- package/data/packages/spec/dist/__tests__/legacy/appAnalyzer.unit.test.d.ts +0 -2
- package/data/packages/spec/dist/__tests__/legacy/appAnalyzer.unit.test.d.ts.map +0 -1
- package/data/packages/spec/dist/__tests__/legacy/appAnalyzer.unit.test.js +0 -72
- package/data/packages/spec/dist/__tests__/legacy/mapTsAppSpecToAppSpecDecls.integration.test.d.ts +0 -2
- package/data/packages/spec/dist/__tests__/legacy/mapTsAppSpecToAppSpecDecls.integration.test.d.ts.map +0 -1
- package/data/packages/spec/dist/__tests__/legacy/mapTsAppSpecToAppSpecDecls.integration.test.js +0 -126
- package/data/packages/spec/dist/__tests__/legacy/mapTsAppSpecToAppSpecDecls.unit.test.d.ts +0 -2
- package/data/packages/spec/dist/__tests__/legacy/mapTsAppSpecToAppSpecDecls.unit.test.d.ts.map +0 -1
- package/data/packages/spec/dist/__tests__/legacy/mapTsAppSpecToAppSpecDecls.unit.test.js +0 -732
- package/data/packages/spec/dist/__tests__/legacy/testFixtures.d.ts +0 -224
- package/data/packages/spec/dist/__tests__/legacy/testFixtures.d.ts.map +0 -1
- package/data/packages/spec/dist/__tests__/legacy/testFixtures.js +0 -659
- package/data/packages/spec/dist/__tests__/legacy/testFixtures.test-d.d.ts +0 -2
- package/data/packages/spec/dist/__tests__/legacy/testFixtures.test-d.d.ts.map +0 -1
- package/data/packages/spec/dist/__tests__/legacy/testFixtures.test-d.js +0 -57
- package/data/packages/spec/dist/src/legacy/_private.d.ts +0 -2
- package/data/packages/spec/dist/src/legacy/_private.d.ts.map +0 -1
- package/data/packages/spec/dist/src/legacy/_private.js +0 -1
- package/data/packages/spec/dist/src/legacy/appAnalyzer.d.ts +0 -16
- package/data/packages/spec/dist/src/legacy/appAnalyzer.d.ts.map +0 -1
- package/data/packages/spec/dist/src/legacy/appAnalyzer.js +0 -34
- package/data/packages/spec/dist/src/legacy/mapTsAppSpecToAppSpecDecls.d.ts +0 -38
- package/data/packages/spec/dist/src/legacy/mapTsAppSpecToAppSpecDecls.d.ts.map +0 -1
- package/data/packages/spec/dist/src/legacy/mapTsAppSpecToAppSpecDecls.js +0 -294
- package/data/packages/spec/dist/src/legacy/publicApi/App.d.ts +0 -24
- package/data/packages/spec/dist/src/legacy/publicApi/App.d.ts.map +0 -1
- package/data/packages/spec/dist/src/legacy/publicApi/App.js +0 -75
- package/data/packages/spec/dist/src/legacy/publicApi/tsAppSpec.d.ts +0 -174
- package/data/packages/spec/dist/src/legacy/publicApi/tsAppSpec.d.ts.map +0 -1
- package/data/packages/spec/dist/src/legacy/publicApi/tsAppSpec.js +0 -1
- package/data/packages/spec/dist/src/spec/mapApp.d.ts +0 -54
- package/data/packages/spec/dist/src/spec/mapApp.d.ts.map +0 -1
- package/data/packages/spec/dist/src/spec/mapApp.js +0 -336
- package/data/packages/spec/dist/src/spec/specUserError.d.ts +0 -9
- package/data/packages/spec/dist/src/spec/specUserError.d.ts.map +0 -1
- package/data/packages/spec/dist/src/spec/specUserError.js +0 -8
- package/data/packages/studio/dist/public/assets/Flow-_d98T2dd.js +0 -26
- package/data/packages/studio/dist/public/assets/index-B6X8EdJH.js +0 -21
- package/data/packages/studio/dist/public/assets/index-CXlD_bzV.js +0 -1
- package/data/packages/studio/dist/public/assets/index-IWX3d-Jz.css +0 -1
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { describe, expectTypeOf, test } from "vitest";
|
|
2
|
-
describe("MinimalConfig<T>", () => {
|
|
3
|
-
test("should not affect primitive types", async () => {
|
|
4
|
-
expectTypeOf().toEqualTypeOf();
|
|
5
|
-
expectTypeOf().toEqualTypeOf();
|
|
6
|
-
expectTypeOf().toEqualTypeOf();
|
|
7
|
-
expectTypeOf().toEqualTypeOf();
|
|
8
|
-
expectTypeOf().toEqualTypeOf();
|
|
9
|
-
expectTypeOf().toEqualTypeOf();
|
|
10
|
-
expectTypeOf().toEqualTypeOf();
|
|
11
|
-
});
|
|
12
|
-
test("should not affect branded types", async () => {
|
|
13
|
-
expectTypeOf().toEqualTypeOf();
|
|
14
|
-
});
|
|
15
|
-
test("should convert no props object to EmptyObject", async () => {
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
17
|
-
expectTypeOf().toEqualTypeOf();
|
|
18
|
-
});
|
|
19
|
-
test("should remove optional props", async () => {
|
|
20
|
-
expectTypeOf().toEqualTypeOf();
|
|
21
|
-
});
|
|
22
|
-
test("should not affect required props", async () => {
|
|
23
|
-
expectTypeOf().toEqualTypeOf();
|
|
24
|
-
});
|
|
25
|
-
test("should recursively apply to nested objects", async () => {
|
|
26
|
-
expectTypeOf().toEqualTypeOf();
|
|
27
|
-
});
|
|
28
|
-
test("Should recursively apply to array items", async () => {
|
|
29
|
-
expectTypeOf().toEqualTypeOf();
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
describe("FullConfig<T>", () => {
|
|
33
|
-
test("should not affect primitive types", async () => {
|
|
34
|
-
expectTypeOf().toEqualTypeOf();
|
|
35
|
-
expectTypeOf().toEqualTypeOf();
|
|
36
|
-
expectTypeOf().toEqualTypeOf();
|
|
37
|
-
expectTypeOf().toEqualTypeOf();
|
|
38
|
-
expectTypeOf().toEqualTypeOf();
|
|
39
|
-
expectTypeOf().toEqualTypeOf();
|
|
40
|
-
expectTypeOf().toEqualTypeOf();
|
|
41
|
-
});
|
|
42
|
-
test("should not affect branded types", async () => {
|
|
43
|
-
expectTypeOf().toEqualTypeOf();
|
|
44
|
-
});
|
|
45
|
-
test("should not affect required props", async () => {
|
|
46
|
-
expectTypeOf().toEqualTypeOf();
|
|
47
|
-
});
|
|
48
|
-
test("should make optional props required", async () => {
|
|
49
|
-
expectTypeOf().toEqualTypeOf();
|
|
50
|
-
});
|
|
51
|
-
test("should recursively apply to nested objects", async () => {
|
|
52
|
-
expectTypeOf().toEqualTypeOf();
|
|
53
|
-
});
|
|
54
|
-
test("Should recursively apply to array items", async () => {
|
|
55
|
-
expectTypeOf().toEqualTypeOf();
|
|
56
|
-
});
|
|
57
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_private.d.ts","sourceRoot":"","sources":["../../../src/legacy/_private.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,eAA4B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const GET_TS_APP_SPEC = Symbol("GET_TS_APP_SPEC");
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as AppSpec from "../appSpec.js";
|
|
2
|
-
export declare function analyzeApp(waspTsSpecPath: string, entityNames: string[]): Promise<Result<AppSpec.Decl[], string>>;
|
|
3
|
-
/**
|
|
4
|
-
* Result type is used instead of exceptions for the normal control flow because:
|
|
5
|
-
* - The error users see with the Result type is nicer (no stack trace).
|
|
6
|
-
* - Exceptions can slip through the type system.
|
|
7
|
-
*/
|
|
8
|
-
type Result<Value, Error> = {
|
|
9
|
-
status: "ok";
|
|
10
|
-
value: Value;
|
|
11
|
-
} | {
|
|
12
|
-
status: "error";
|
|
13
|
-
error: Error;
|
|
14
|
-
};
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=appAnalyzer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"appAnalyzer.d.ts","sourceRoot":"","sources":["../../../src/legacy/appAnalyzer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,eAAe,CAAC;AAKzC,wBAAsB,UAAU,CAC9B,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,EAAE,GACpB,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC,CAezC;AA0BD;;;;GAIG;AACH,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,IACpB;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,GAC9B;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { GET_TS_APP_SPEC } from "./_private.js";
|
|
2
|
-
import { mapTsAppSpecToAppSpecDecls } from "./mapTsAppSpecToAppSpecDecls.js";
|
|
3
|
-
import { App } from "./publicApi/App.js";
|
|
4
|
-
export async function analyzeApp(waspTsSpecPath, entityNames) {
|
|
5
|
-
const appResult = await getApp(waspTsSpecPath);
|
|
6
|
-
if (appResult.status === "error") {
|
|
7
|
-
return appResult;
|
|
8
|
-
}
|
|
9
|
-
const app = appResult.value;
|
|
10
|
-
const tsAppSpec = app[GET_TS_APP_SPEC]();
|
|
11
|
-
const appSpecDecls = mapTsAppSpecToAppSpecDecls(tsAppSpec, entityNames);
|
|
12
|
-
return {
|
|
13
|
-
status: "ok",
|
|
14
|
-
value: appSpecDecls,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
async function getApp(mainWaspJs) {
|
|
18
|
-
const usersDefaultExport = await (await import(mainWaspJs)).default;
|
|
19
|
-
if (!usersDefaultExport) {
|
|
20
|
-
return {
|
|
21
|
-
status: "error",
|
|
22
|
-
error: "Could not load your app config. " +
|
|
23
|
-
"Make sure your *.wasp.ts file includes a default export of the app.",
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
if (!(usersDefaultExport instanceof App)) {
|
|
27
|
-
return {
|
|
28
|
-
status: "error",
|
|
29
|
-
error: "The default export of your *.wasp.ts file must be an instance of App. " +
|
|
30
|
-
"Make sure you export an object created with new App(...).",
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
return { status: "ok", value: usersDefaultExport };
|
|
34
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This module maps the TsAppSpec-facing API to the internal representation of the app (AppSpec Decl).
|
|
3
|
-
* All of the mapping functions are exported so that they can be individually tested.
|
|
4
|
-
*/
|
|
5
|
-
import * as AppSpec from "../appSpec.js";
|
|
6
|
-
import * as TsAppSpec from "./publicApi/tsAppSpec.js";
|
|
7
|
-
export declare function mapTsAppSpecToAppSpecDecls(tsAppSpec: TsAppSpec.TsAppSpec, entityNames: string[]): AppSpec.Decl[];
|
|
8
|
-
export declare function mapOperation(config: TsAppSpec.QueryConfig, entityRefParser: RefParser<"Entity">): AppSpec.Query;
|
|
9
|
-
export declare function mapOperation(config: TsAppSpec.ActionConfig, entityRefParser: RefParser<"Entity">): AppSpec.Action;
|
|
10
|
-
export declare function mapExtImport(extImport: TsAppSpec.ExtImport): AppSpec.ExtImport;
|
|
11
|
-
export declare function mapHttpRoute(httpRoute: TsAppSpec.HttpRoute): AppSpec.HttpRoute;
|
|
12
|
-
export declare function mapApi(config: TsAppSpec.ApiConfig, entityRefParser: RefParser<"Entity">): AppSpec.Api;
|
|
13
|
-
export declare function mapApiNamespace(config: TsAppSpec.ApiNamespaceConfig): AppSpec.ApiNamespace;
|
|
14
|
-
export declare function mapApp(app: TsAppSpec.AppConfig, entityRefParser: RefParser<"Entity">, routeRefParser: RefParser<"Route">, auth?: TsAppSpec.AuthConfig, client?: TsAppSpec.ClientConfig, server?: TsAppSpec.ServerConfig, db?: TsAppSpec.DbConfig, emailSender?: TsAppSpec.EmailSenderConfig, webSocket?: TsAppSpec.WebsocketConfig): AppSpec.App;
|
|
15
|
-
export declare function mapAuth(auth: TsAppSpec.AuthConfig, entityRefParser: RefParser<"Entity">, routeRefParser: RefParser<"Route">): AppSpec.Auth;
|
|
16
|
-
export declare function mapAuthMethods(methods: TsAppSpec.AuthMethods, routeRefParser: RefParser<"Route">): AppSpec.AuthMethods;
|
|
17
|
-
export declare function mapUsernameAndPassword(usernameAndPassword: TsAppSpec.UsernameAndPasswordConfig): AppSpec.UsernameAndPasswordConfig;
|
|
18
|
-
export declare function mapExternalAuth(externalAuth: TsAppSpec.ExternalAuthConfig): AppSpec.ExternalAuthConfig;
|
|
19
|
-
export declare function mapEmailAuth(emailConfig: TsAppSpec.EmailAuthConfig, routeRefParser: RefParser<"Route">): AppSpec.EmailAuthConfig;
|
|
20
|
-
export declare function mapEmailVerification(emailVerification: TsAppSpec.EmailVerificationConfig, routeRefParser: RefParser<"Route">): AppSpec.EmailVerificationConfig;
|
|
21
|
-
export declare function mapPasswordReset(passwordReset: TsAppSpec.PasswordResetConfig, routeRefParser: RefParser<"Route">): AppSpec.PasswordResetConfig;
|
|
22
|
-
export declare function mapDb(db: TsAppSpec.DbConfig): AppSpec.Db;
|
|
23
|
-
export declare function mapEmailSender(emailSender: TsAppSpec.EmailSenderConfig): AppSpec.EmailSender;
|
|
24
|
-
export declare function mapEmailFromField(defaultFrom: TsAppSpec.EmailFromField): AppSpec.EmailFromField;
|
|
25
|
-
export declare function mapServer(server: TsAppSpec.ServerConfig): AppSpec.Server;
|
|
26
|
-
export declare function mapClient(client: TsAppSpec.ClientConfig): AppSpec.Client;
|
|
27
|
-
export declare function mapWebSocket(websocket: TsAppSpec.WebsocketConfig): AppSpec.WebSocket;
|
|
28
|
-
export declare function mapJob(job: TsAppSpec.JobConfig, entityRefParser: RefParser<"Entity">): AppSpec.Job;
|
|
29
|
-
export declare function mapSchedule(schedule: TsAppSpec.Schedule): AppSpec.Schedule;
|
|
30
|
-
export declare function mapPerform(perform: TsAppSpec.Perform): AppSpec.Perform;
|
|
31
|
-
export declare function mapRoute(route: TsAppSpec.RouteConfig, pageRefParser: RefParser<"Page">): AppSpec.Route;
|
|
32
|
-
export declare function mapCrud(crudConfig: TsAppSpec.CrudConfig, entityRefParser: RefParser<"Entity">): AppSpec.Crud;
|
|
33
|
-
export declare function mapCrudOperations(operations: TsAppSpec.CrudOperations): AppSpec.CrudOperations;
|
|
34
|
-
export declare function mapCrudOperationOptions(options: TsAppSpec.CrudOperationOptions): AppSpec.CrudOperationOptions;
|
|
35
|
-
export declare function mapPage(pageConfig: TsAppSpec.PageConfig): AppSpec.Page;
|
|
36
|
-
export type RefParser<T extends AppSpec.DeclType> = (potentialReferences: string) => AppSpec.Ref<T>;
|
|
37
|
-
export declare function makeRefParser<T extends AppSpec.DeclType>(declType: T, declNames: string[]): RefParser<T>;
|
|
38
|
-
//# sourceMappingURL=mapTsAppSpecToAppSpecDecls.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mapTsAppSpecToAppSpecDecls.d.ts","sourceRoot":"","sources":["../../../src/legacy/mapTsAppSpecToAppSpecDecls.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,OAAO,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAC;AAEtD,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,SAAS,CAAC,SAAS,EAC9B,WAAW,EAAE,MAAM,EAAE,GACpB,OAAO,CAAC,IAAI,EAAE,CA8EhB;AAsBD,wBAAgB,YAAY,CAC1B,MAAM,EAAE,SAAS,CAAC,WAAW,EAC7B,eAAe,EAAE,SAAS,CAAC,QAAQ,CAAC,GACnC,OAAO,CAAC,KAAK,CAAC;AACjB,wBAAgB,YAAY,CAC1B,MAAM,EAAE,SAAS,CAAC,YAAY,EAC9B,eAAe,EAAE,SAAS,CAAC,QAAQ,CAAC,GACnC,OAAO,CA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G,OAAO,CAAC,QAAQ,CAO1E;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAMtE;AAED,wBAAgB,QAAQ,CACtB,KAAK,EAAE,SAAS,CAAC,WAAW,EAC5B,aAAa,EAAE,SAAS,CAAC,MAAM,CAAC,GAC/B,OAAO,CAAC,KAAK,CAQf;AAED,wBAAgB,OAAO,CACrB,UAAU,EAAE,SAAS,CAAC,UAAU,EAChC,eAAe,EAAE,SAAS,CAAC,QAAQ,CAAC,GACnC,OAAO,CAAC,IAAI,CAMd;AAED,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,SAAS,CAAC,cAAc,GACnC,OAAO,CAAC,cAAc,CAUxB;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,SAAS,CAAC,oBAAoB,GACtC,OAAO,CAAC,oBAAoB,CAM9B;AAED,wBAAgB,OAAO,CAAC,UAAU,EAAE,SAAS,CAAC,UAAU,GAAG,OAAO,CAAC,IAAI,CAMtE;AAED,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,IAAI,CAClD,mBAAmB,EAAE,MAAM,KACxB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAEpB,wBAAgB,aAAa,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,EACtD,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,MAAM,EAAE,GAClB,SAAS,CAAC,CAAC,CAAC,CAUd"}
|
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This module maps the TsAppSpec-facing API to the internal representation of the app (AppSpec Decl).
|
|
3
|
-
* All of the mapping functions are exported so that they can be individually tested.
|
|
4
|
-
*/
|
|
5
|
-
export function mapTsAppSpecToAppSpecDecls(tsAppSpec, entityNames) {
|
|
6
|
-
const { app, actions, apis, apiNamespaces, auth, client, db, emailSender, jobs, pages, queries, routes, server, websocket, cruds, } = tsAppSpec;
|
|
7
|
-
const pageNames = Array.from(pages.keys());
|
|
8
|
-
const routeNames = Array.from(routes.keys());
|
|
9
|
-
const entityRefParser = makeRefParser("Entity", entityNames);
|
|
10
|
-
const pageRefParser = makeRefParser("Page", pageNames);
|
|
11
|
-
const routeRefParser = makeRefParser("Route", routeNames);
|
|
12
|
-
const pageDecls = mapToDecls(pages, "Page", mapPage);
|
|
13
|
-
const routeDecls = mapToDecls(routes, "Route", (routeConfig) => mapRoute(routeConfig, pageRefParser));
|
|
14
|
-
const actionDecls = mapToDecls(actions, "Action", (actionConfig) => mapOperation(actionConfig, entityRefParser));
|
|
15
|
-
const queryDecls = mapToDecls(queries, "Query", (queryConfig) => mapOperation(queryConfig, entityRefParser));
|
|
16
|
-
const apiDecls = mapToDecls(apis, "Api", (apiConfig) => mapApi(apiConfig, entityRefParser));
|
|
17
|
-
const jobDecls = mapToDecls(jobs, "Job", (jobConfig) => mapJob(jobConfig, entityRefParser));
|
|
18
|
-
const apiNamespaceDecls = mapToDecls(apiNamespaces, "ApiNamespace", mapApiNamespace);
|
|
19
|
-
const crudDecls = mapToDecls(cruds, "Crud", (crudConfig) => mapCrud(crudConfig, entityRefParser));
|
|
20
|
-
const appDecl = {
|
|
21
|
-
declType: "App",
|
|
22
|
-
declName: app.name,
|
|
23
|
-
declValue: mapApp(app.config, entityRefParser, routeRefParser, auth, client, server, db, emailSender, websocket),
|
|
24
|
-
};
|
|
25
|
-
return makeDeclsArray({
|
|
26
|
-
App: [appDecl],
|
|
27
|
-
Page: pageDecls,
|
|
28
|
-
Route: routeDecls,
|
|
29
|
-
Action: actionDecls,
|
|
30
|
-
Query: queryDecls,
|
|
31
|
-
Api: apiDecls,
|
|
32
|
-
Job: jobDecls,
|
|
33
|
-
ApiNamespace: apiNamespaceDecls,
|
|
34
|
-
Crud: crudDecls,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
function makeDeclsArray(decls) {
|
|
38
|
-
return Object.values(decls).flatMap((decl) => [...decl]);
|
|
39
|
-
}
|
|
40
|
-
function mapToDecls(configs, type, configToDeclValue) {
|
|
41
|
-
return [...configs].map(([name, config]) => ({
|
|
42
|
-
declType: type,
|
|
43
|
-
declName: name,
|
|
44
|
-
declValue: configToDeclValue(config),
|
|
45
|
-
}));
|
|
46
|
-
}
|
|
47
|
-
export function mapOperation(config, entityRefParser) {
|
|
48
|
-
const { fn, entities, auth } = config;
|
|
49
|
-
return {
|
|
50
|
-
fn: mapExtImport(fn),
|
|
51
|
-
entities: entities?.map(entityRefParser),
|
|
52
|
-
auth,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
export function mapExtImport(extImport) {
|
|
56
|
-
if ("import" in extImport) {
|
|
57
|
-
return {
|
|
58
|
-
kind: "named",
|
|
59
|
-
name: extImport.import,
|
|
60
|
-
path: extImport.from,
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
else if ("importDefault" in extImport) {
|
|
64
|
-
return {
|
|
65
|
-
kind: "default",
|
|
66
|
-
name: extImport.importDefault,
|
|
67
|
-
path: extImport.from,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
throw new Error("Invalid ExtImport: neither `import` nor `importDefault` is defined");
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
export function mapHttpRoute(httpRoute) {
|
|
75
|
-
return [httpRoute.method, httpRoute.route];
|
|
76
|
-
}
|
|
77
|
-
export function mapApi(config, entityRefParser) {
|
|
78
|
-
const { fn, middlewareConfigFn, entities, httpRoute, auth } = config;
|
|
79
|
-
return {
|
|
80
|
-
fn: mapExtImport(fn),
|
|
81
|
-
middlewareConfigFn: middlewareConfigFn && mapExtImport(middlewareConfigFn),
|
|
82
|
-
entities: entities && entities.map(entityRefParser),
|
|
83
|
-
httpRoute: mapHttpRoute(httpRoute),
|
|
84
|
-
auth,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
export function mapApiNamespace(config) {
|
|
88
|
-
const { middlewareConfigFn, path } = config;
|
|
89
|
-
return {
|
|
90
|
-
middlewareConfigFn: mapExtImport(middlewareConfigFn),
|
|
91
|
-
path,
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
export function mapApp(app,
|
|
95
|
-
// TODO: Make this better, optional props are problematic so I have to pass the parsers first
|
|
96
|
-
entityRefParser, routeRefParser, auth, client, server, db, emailSender, webSocket) {
|
|
97
|
-
const { title, wasp, head } = app;
|
|
98
|
-
return {
|
|
99
|
-
wasp,
|
|
100
|
-
title,
|
|
101
|
-
head,
|
|
102
|
-
auth: auth && mapAuth(auth, entityRefParser, routeRefParser),
|
|
103
|
-
client: client && mapClient(client),
|
|
104
|
-
server: server && mapServer(server),
|
|
105
|
-
webSocket: webSocket && mapWebSocket(webSocket),
|
|
106
|
-
db: db && mapDb(db),
|
|
107
|
-
emailSender: emailSender && mapEmailSender(emailSender),
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
export function mapAuth(auth, entityRefParser, routeRefParser) {
|
|
111
|
-
const { userEntity, methods, onAuthFailedRedirectTo, onAuthSucceededRedirectTo, onBeforeSignup, onAfterSignup, onAfterEmailVerified, onBeforeOAuthRedirect, onBeforeLogin, onAfterLogin, } = auth;
|
|
112
|
-
return {
|
|
113
|
-
userEntity: entityRefParser(userEntity),
|
|
114
|
-
methods: mapAuthMethods(methods, routeRefParser),
|
|
115
|
-
onAuthFailedRedirectTo,
|
|
116
|
-
onAuthSucceededRedirectTo,
|
|
117
|
-
onBeforeSignup: onBeforeSignup && mapExtImport(onBeforeSignup),
|
|
118
|
-
onAfterSignup: onAfterSignup && mapExtImport(onAfterSignup),
|
|
119
|
-
onAfterEmailVerified: onAfterEmailVerified && mapExtImport(onAfterEmailVerified),
|
|
120
|
-
onBeforeOAuthRedirect: onBeforeOAuthRedirect && mapExtImport(onBeforeOAuthRedirect),
|
|
121
|
-
onBeforeLogin: onBeforeLogin && mapExtImport(onBeforeLogin),
|
|
122
|
-
onAfterLogin: onAfterLogin && mapExtImport(onAfterLogin),
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
export function mapAuthMethods(methods, routeRefParser) {
|
|
126
|
-
// TODO: check keyof danger, effective ts
|
|
127
|
-
const { usernameAndPassword, slack, discord, google, gitHub, keycloak, microsoft, email, } = methods;
|
|
128
|
-
return {
|
|
129
|
-
usernameAndPassword: usernameAndPassword && mapUsernameAndPassword(usernameAndPassword),
|
|
130
|
-
slack: slack && mapExternalAuth(slack),
|
|
131
|
-
discord: discord && mapExternalAuth(discord),
|
|
132
|
-
google: google && mapExternalAuth(google),
|
|
133
|
-
gitHub: gitHub && mapExternalAuth(gitHub),
|
|
134
|
-
keycloak: keycloak && mapExternalAuth(keycloak),
|
|
135
|
-
microsoft: microsoft && mapExternalAuth(microsoft),
|
|
136
|
-
email: email && mapEmailAuth(email, routeRefParser),
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
export function mapUsernameAndPassword(usernameAndPassword) {
|
|
140
|
-
const { userSignupFields } = usernameAndPassword;
|
|
141
|
-
return {
|
|
142
|
-
userSignupFields: userSignupFields && mapExtImport(userSignupFields),
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
export function mapExternalAuth(externalAuth) {
|
|
146
|
-
const { configFn, userSignupFields } = externalAuth;
|
|
147
|
-
return {
|
|
148
|
-
configFn: configFn && mapExtImport(configFn),
|
|
149
|
-
userSignupFields: userSignupFields && mapExtImport(userSignupFields),
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
export function mapEmailAuth(emailConfig, routeRefParser) {
|
|
153
|
-
const { userSignupFields, fromField, emailVerification, passwordReset } = emailConfig;
|
|
154
|
-
return {
|
|
155
|
-
userSignupFields: userSignupFields && mapExtImport(userSignupFields),
|
|
156
|
-
fromField: mapEmailFromField(fromField),
|
|
157
|
-
emailVerification: mapEmailVerification(emailVerification, routeRefParser),
|
|
158
|
-
passwordReset: mapPasswordReset(passwordReset, routeRefParser),
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
export function mapEmailVerification(emailVerification, routeRefParser) {
|
|
162
|
-
const { getEmailContentFn, clientRoute } = emailVerification;
|
|
163
|
-
return {
|
|
164
|
-
getEmailContentFn: getEmailContentFn && mapExtImport(getEmailContentFn),
|
|
165
|
-
clientRoute: routeRefParser(clientRoute),
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
export function mapPasswordReset(passwordReset, routeRefParser) {
|
|
169
|
-
const { getEmailContentFn, clientRoute } = passwordReset;
|
|
170
|
-
return {
|
|
171
|
-
getEmailContentFn: getEmailContentFn && mapExtImport(getEmailContentFn),
|
|
172
|
-
clientRoute: routeRefParser(clientRoute),
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
export function mapDb(db) {
|
|
176
|
-
const { seeds, prismaSetupFn } = db;
|
|
177
|
-
return {
|
|
178
|
-
seeds: seeds?.map(mapExtImport),
|
|
179
|
-
prismaSetupFn: prismaSetupFn && mapExtImport(prismaSetupFn),
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
export function mapEmailSender(emailSender) {
|
|
183
|
-
const { provider, defaultFrom } = emailSender;
|
|
184
|
-
return {
|
|
185
|
-
provider,
|
|
186
|
-
defaultFrom: defaultFrom && mapEmailFromField(defaultFrom),
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
export function mapEmailFromField(defaultFrom) {
|
|
190
|
-
return (defaultFrom && {
|
|
191
|
-
name: defaultFrom.name,
|
|
192
|
-
email: defaultFrom.email,
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
export function mapServer(server) {
|
|
196
|
-
const { setupFn, middlewareConfigFn, envValidationSchema } = server;
|
|
197
|
-
return {
|
|
198
|
-
setupFn: setupFn && mapExtImport(setupFn),
|
|
199
|
-
middlewareConfigFn: middlewareConfigFn && mapExtImport(middlewareConfigFn),
|
|
200
|
-
envValidationSchema: envValidationSchema && mapExtImport(envValidationSchema),
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
export function mapClient(client) {
|
|
204
|
-
const { setupFn, rootComponent, baseDir, envValidationSchema } = client;
|
|
205
|
-
return {
|
|
206
|
-
setupFn: setupFn && mapExtImport(setupFn),
|
|
207
|
-
rootComponent: rootComponent && mapExtImport(rootComponent),
|
|
208
|
-
baseDir,
|
|
209
|
-
envValidationSchema: envValidationSchema && mapExtImport(envValidationSchema),
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
export function mapWebSocket(websocket) {
|
|
213
|
-
const { fn, autoConnect } = websocket;
|
|
214
|
-
return {
|
|
215
|
-
fn: mapExtImport(fn),
|
|
216
|
-
autoConnect,
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
export function mapJob(job, entityRefParser) {
|
|
220
|
-
const { executor, perform, schedule, entities } = job;
|
|
221
|
-
return {
|
|
222
|
-
executor,
|
|
223
|
-
perform: mapPerform(perform),
|
|
224
|
-
schedule: schedule && mapSchedule(schedule),
|
|
225
|
-
entities: entities && entities.map(entityRefParser),
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
export function mapSchedule(schedule) {
|
|
229
|
-
const { cron, args, executorOptions } = schedule;
|
|
230
|
-
return {
|
|
231
|
-
cron,
|
|
232
|
-
args,
|
|
233
|
-
executorOptions,
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
export function mapPerform(perform) {
|
|
237
|
-
const { fn, executorOptions } = perform;
|
|
238
|
-
return {
|
|
239
|
-
fn: mapExtImport(fn),
|
|
240
|
-
executorOptions,
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
export function mapRoute(route, pageRefParser) {
|
|
244
|
-
const { path, to, prerender, lazy } = route;
|
|
245
|
-
return {
|
|
246
|
-
path,
|
|
247
|
-
to: pageRefParser(to),
|
|
248
|
-
prerender,
|
|
249
|
-
lazy,
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
export function mapCrud(crudConfig, entityRefParser) {
|
|
253
|
-
const { entity, operations } = crudConfig;
|
|
254
|
-
return {
|
|
255
|
-
entity: entityRefParser(entity),
|
|
256
|
-
operations: mapCrudOperations(operations),
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
export function mapCrudOperations(operations) {
|
|
260
|
-
const { get, getAll, create, update, delete: del } = operations;
|
|
261
|
-
// TODO: Do this for all keys
|
|
262
|
-
return {
|
|
263
|
-
get: get && mapCrudOperationOptions(get),
|
|
264
|
-
getAll: getAll && mapCrudOperationOptions(getAll),
|
|
265
|
-
create: create && mapCrudOperationOptions(create),
|
|
266
|
-
update: update && mapCrudOperationOptions(update),
|
|
267
|
-
delete: del && mapCrudOperationOptions(del),
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
export function mapCrudOperationOptions(options) {
|
|
271
|
-
const { isPublic, overrideFn } = options;
|
|
272
|
-
return {
|
|
273
|
-
isPublic,
|
|
274
|
-
overrideFn: overrideFn && mapExtImport(overrideFn),
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
export function mapPage(pageConfig) {
|
|
278
|
-
const { component, authRequired } = pageConfig;
|
|
279
|
-
return {
|
|
280
|
-
component: mapExtImport(component),
|
|
281
|
-
authRequired,
|
|
282
|
-
};
|
|
283
|
-
}
|
|
284
|
-
export function makeRefParser(declType, declNames) {
|
|
285
|
-
return function parseRef(potentialRef) {
|
|
286
|
-
if (!declNames.includes(potentialRef)) {
|
|
287
|
-
throw new Error(`Invalid ${declType} reference: ${potentialRef}`);
|
|
288
|
-
}
|
|
289
|
-
return {
|
|
290
|
-
name: potentialRef,
|
|
291
|
-
declType,
|
|
292
|
-
};
|
|
293
|
-
};
|
|
294
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/** This module defines the user-facing API for defining a Wasp app.
|
|
2
|
-
*/
|
|
3
|
-
import { GET_TS_APP_SPEC } from "../_private.js";
|
|
4
|
-
import * as TsAppSpec from "./tsAppSpec.js";
|
|
5
|
-
export declare class App {
|
|
6
|
-
#private;
|
|
7
|
-
[GET_TS_APP_SPEC](): TsAppSpec.TsAppSpec;
|
|
8
|
-
constructor(name: string, config: TsAppSpec.AppConfig);
|
|
9
|
-
action(this: App, name: string, config: TsAppSpec.ActionConfig): void;
|
|
10
|
-
apiNamespace(this: App, name: string, config: TsAppSpec.ApiNamespaceConfig): void;
|
|
11
|
-
api(this: App, name: string, config: TsAppSpec.ApiConfig): void;
|
|
12
|
-
auth(this: App, config: TsAppSpec.AuthConfig): void;
|
|
13
|
-
client(this: App, config: TsAppSpec.ClientConfig): void;
|
|
14
|
-
crud(this: App, name: string, config: TsAppSpec.CrudConfig): void;
|
|
15
|
-
db(this: App, config: TsAppSpec.DbConfig): void;
|
|
16
|
-
emailSender(this: App, config: TsAppSpec.EmailSenderConfig): void;
|
|
17
|
-
job(this: App, name: string, config: TsAppSpec.JobConfig): void;
|
|
18
|
-
page(this: App, name: string, config: TsAppSpec.PageConfig): TsAppSpec.PageName;
|
|
19
|
-
query(this: App, name: string, config: TsAppSpec.QueryConfig): void;
|
|
20
|
-
route(this: App, name: string, config: TsAppSpec.RouteConfig): void;
|
|
21
|
-
server(this: App, config: TsAppSpec.ServerConfig): void;
|
|
22
|
-
webSocket(this: App, config: TsAppSpec.WebsocketConfig): void;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=App.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../../../src/legacy/publicApi/App.ts"],"names":[],"mappings":"AAAA;GACG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAE5C,qBAAa,GAAG;;IAMd,CAAC,eAAe,CAAC,IAAI,SAAS,CAAC,SAAS;gBAI5B,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,SAAS;IAqBrD,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,S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;IAIvD,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,eAAe;CAGvD"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/** This module defines the user-facing API for defining a Wasp app.
|
|
2
|
-
*/
|
|
3
|
-
import { GET_TS_APP_SPEC } from "../_private.js";
|
|
4
|
-
export class App {
|
|
5
|
-
#tsAppSpec;
|
|
6
|
-
// NOTE: Using a non-public symbol gives us a package-private property.
|
|
7
|
-
// It's not that important to hide it from the users, but we still don't want
|
|
8
|
-
// user's IDE to suggest it during autocompletion.
|
|
9
|
-
[GET_TS_APP_SPEC]() {
|
|
10
|
-
return this.#tsAppSpec;
|
|
11
|
-
}
|
|
12
|
-
constructor(name, config) {
|
|
13
|
-
this.#tsAppSpec = {
|
|
14
|
-
app: { name, config },
|
|
15
|
-
actions: new Map(),
|
|
16
|
-
apiNamespaces: new Map(),
|
|
17
|
-
apis: new Map(),
|
|
18
|
-
auth: undefined,
|
|
19
|
-
client: undefined,
|
|
20
|
-
cruds: new Map(),
|
|
21
|
-
db: undefined,
|
|
22
|
-
emailSender: undefined,
|
|
23
|
-
jobs: new Map(),
|
|
24
|
-
pages: new Map(),
|
|
25
|
-
queries: new Map(),
|
|
26
|
-
routes: new Map(),
|
|
27
|
-
server: undefined,
|
|
28
|
-
websocket: undefined,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
// TODO: Enforce that all methods are covered in compile time
|
|
32
|
-
action(name, config) {
|
|
33
|
-
this.#tsAppSpec.actions.set(name, config);
|
|
34
|
-
}
|
|
35
|
-
apiNamespace(name, config) {
|
|
36
|
-
this.#tsAppSpec.apiNamespaces.set(name, config);
|
|
37
|
-
}
|
|
38
|
-
api(name, config) {
|
|
39
|
-
this.#tsAppSpec.apis.set(name, config);
|
|
40
|
-
}
|
|
41
|
-
auth(config) {
|
|
42
|
-
this.#tsAppSpec.auth = config;
|
|
43
|
-
}
|
|
44
|
-
client(config) {
|
|
45
|
-
this.#tsAppSpec.client = config;
|
|
46
|
-
}
|
|
47
|
-
crud(name, config) {
|
|
48
|
-
this.#tsAppSpec.cruds.set(name, config);
|
|
49
|
-
}
|
|
50
|
-
db(config) {
|
|
51
|
-
this.#tsAppSpec.db = config;
|
|
52
|
-
}
|
|
53
|
-
emailSender(config) {
|
|
54
|
-
this.#tsAppSpec.emailSender = config;
|
|
55
|
-
}
|
|
56
|
-
job(name, config) {
|
|
57
|
-
this.#tsAppSpec.jobs.set(name, config);
|
|
58
|
-
}
|
|
59
|
-
page(name, config) {
|
|
60
|
-
this.#tsAppSpec.pages.set(name, config);
|
|
61
|
-
return name;
|
|
62
|
-
}
|
|
63
|
-
query(name, config) {
|
|
64
|
-
this.#tsAppSpec.queries.set(name, config);
|
|
65
|
-
}
|
|
66
|
-
route(name, config) {
|
|
67
|
-
this.#tsAppSpec.routes.set(name, config);
|
|
68
|
-
}
|
|
69
|
-
server(config) {
|
|
70
|
-
this.#tsAppSpec.server = config;
|
|
71
|
-
}
|
|
72
|
-
webSocket(config) {
|
|
73
|
-
this.#tsAppSpec.websocket = config;
|
|
74
|
-
}
|
|
75
|
-
}
|