@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.
Files changed (233) hide show
  1. package/data/Cli/starters/basic/main.wasp.ts +60 -0
  2. package/data/Cli/starters/basic/package.json +4 -1
  3. package/data/Cli/starters/basic/prettier.config.mjs +9 -0
  4. package/data/Cli/starters/basic/src/tags/tags.wasp.ts +8 -0
  5. package/data/Cli/starters/basic/src/tasks/task.wasp.ts +16 -0
  6. package/data/Cli/starters/minimal/main.wasp.ts +12 -0
  7. package/data/Cli/starters/minimal/package.json +4 -1
  8. package/data/Cli/starters/skeleton/AGENTS.md +23 -0
  9. package/data/Cli/starters/skeleton/CLAUDE.md +23 -0
  10. package/data/Cli/starters/skeleton/tsconfig.json +5 -26
  11. package/data/Cli/starters/{ts-minimal → skeleton}/tsconfig.src.json +2 -1
  12. package/data/Cli/starters/{ts-minimal → skeleton}/tsconfig.wasp.json +5 -2
  13. package/data/Generator/libs/auth/{wasp.sh-lib-auth-0.23.0.tgz → wasp.sh-lib-auth-0.24.0.tgz} +0 -0
  14. 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
  15. package/data/Generator/templates/sdk/wasp/api/index.ts +51 -47
  16. package/data/Generator/templates/sdk/wasp/auth/email/actions/login.ts +5 -2
  17. package/data/Generator/templates/sdk/wasp/auth/email/actions/passwordReset.ts +9 -4
  18. package/data/Generator/templates/sdk/wasp/auth/email/actions/signup.ts +5 -2
  19. package/data/Generator/templates/sdk/wasp/auth/email/actions/verifyEmail.ts +5 -2
  20. package/data/Generator/templates/sdk/wasp/auth/responseSchemas.ts +10 -0
  21. package/data/Generator/templates/sdk/wasp/auth/useAuth.ts +2 -2
  22. package/data/Generator/templates/sdk/wasp/auth/username/actions/login.ts +5 -3
  23. package/data/Generator/templates/sdk/wasp/auth/username/actions/signup.ts +3 -2
  24. package/data/Generator/templates/sdk/wasp/client/app/layout.tsx +13 -20
  25. package/data/Generator/templates/sdk/wasp/client/app/pages/OAuthCallback.tsx +12 -11
  26. package/data/Generator/templates/sdk/wasp/client/env/schema.ts +8 -8
  27. package/data/Generator/templates/sdk/wasp/client/env.ts +2 -2
  28. package/data/Generator/templates/sdk/wasp/client/operations/internal/index.ts +4 -2
  29. package/data/Generator/templates/sdk/wasp/client/router/NavLink.tsx +21 -0
  30. package/data/Generator/templates/sdk/wasp/client/router/index.ts +2 -0
  31. package/data/Generator/templates/sdk/wasp/client/vite/plugins/typescriptCheck.ts +8 -4
  32. package/data/Generator/templates/sdk/wasp/client/vite/plugins/validateEnv.ts +72 -44
  33. package/data/Generator/templates/sdk/wasp/client/vite/plugins/wasp.ts +1 -1
  34. package/data/Generator/templates/sdk/wasp/tsconfig.json +3 -0
  35. package/data/Generator/templates/types/spec/register.ts +14 -0
  36. package/data/packages/deploy/dist/providers/railway/commands/setup/setup.js +9 -0
  37. package/data/packages/deploy/dist/providers/railway/jsonOutputSchemas.js +47 -0
  38. package/data/packages/deploy/dist/providers/railway/railwayService/deployment.js +45 -0
  39. package/data/packages/deploy/package-lock.json +2 -2
  40. package/data/packages/deploy/package.json +1 -1
  41. package/data/packages/prisma/package-lock.json +2 -2
  42. package/data/packages/prisma/package.json +1 -2
  43. package/data/packages/spec/dist/__tests__/cli.unit.test.js +128 -0
  44. package/data/packages/spec/dist/__tests__/legacy/appAnalyzer.unit.test.d.ts.map +1 -0
  45. package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/appAnalyzer.unit.test.js +3 -3
  46. package/data/packages/spec/dist/__tests__/legacy/mapTsAppSpecToAppSpecDecls.integration.test.d.ts.map +1 -0
  47. package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/mapTsAppSpecToAppSpecDecls.integration.test.js +2 -2
  48. package/data/packages/spec/dist/__tests__/legacy/mapTsAppSpecToAppSpecDecls.unit.test.d.ts.map +1 -0
  49. package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/mapTsAppSpecToAppSpecDecls.unit.test.js +4 -18
  50. package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/testFixtures.d.ts +4 -4
  51. package/data/packages/spec/dist/__tests__/legacy/testFixtures.d.ts.map +1 -0
  52. package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/testFixtures.js +2 -2
  53. package/data/packages/spec/dist/__tests__/legacy/testFixtures.test-d.d.ts.map +1 -0
  54. package/data/packages/spec/dist/__tests__/spec/appAnalyzer.unit.test.d.ts +2 -0
  55. package/data/packages/spec/dist/__tests__/spec/appAnalyzer.unit.test.d.ts.map +1 -0
  56. package/data/packages/spec/dist/__tests__/spec/appAnalyzer.unit.test.js +68 -0
  57. package/data/packages/spec/dist/__tests__/spec/mapApp.unit.test.d.ts +2 -0
  58. package/data/packages/spec/dist/__tests__/spec/mapApp.unit.test.d.ts.map +1 -0
  59. package/data/packages/spec/dist/__tests__/spec/mapApp.unit.test.js +814 -0
  60. package/data/packages/spec/dist/__tests__/spec/refObject.test-d.d.ts +2 -0
  61. package/data/packages/spec/dist/__tests__/spec/refObject.test-d.d.ts.map +1 -0
  62. package/data/packages/spec/dist/__tests__/spec/refObject.test-d.js +148 -0
  63. package/data/packages/spec/dist/__tests__/spec/refObject.unit.test.d.ts +2 -0
  64. package/data/packages/spec/dist/__tests__/spec/refObject.unit.test.d.ts.map +1 -0
  65. package/data/packages/spec/dist/__tests__/spec/refObject.unit.test.js +49 -0
  66. package/data/packages/spec/dist/__tests__/spec/refObjectPath.unit.test.d.ts +2 -0
  67. package/data/packages/spec/dist/__tests__/spec/refObjectPath.unit.test.d.ts.map +1 -0
  68. package/data/packages/spec/dist/__tests__/spec/refObjectPath.unit.test.js +204 -0
  69. package/data/packages/spec/dist/__tests__/spec/testFixtures.d.ts +85 -0
  70. package/data/packages/spec/dist/__tests__/spec/testFixtures.d.ts.map +1 -0
  71. package/data/packages/spec/dist/__tests__/spec/testFixtures.js +473 -0
  72. package/data/packages/spec/dist/__tests__/spec/tsAppSpec.test-d.d.ts +2 -0
  73. package/data/packages/spec/dist/__tests__/spec/tsAppSpec.test-d.d.ts.map +1 -0
  74. package/data/packages/spec/dist/__tests__/spec/tsAppSpec.test-d.js +44 -0
  75. package/data/packages/spec/dist/__tests__/spec-pipeline/pipeline.integration.test.d.ts +2 -0
  76. package/data/packages/spec/dist/__tests__/spec-pipeline/pipeline.integration.test.d.ts.map +1 -0
  77. package/data/packages/spec/dist/__tests__/spec-pipeline/pipeline.integration.test.js +218 -0
  78. package/data/packages/spec/dist/__tests__/spec-pipeline/transformWaspTsSpecFile/imports.unit.test.d.ts +2 -0
  79. package/data/packages/spec/dist/__tests__/spec-pipeline/transformWaspTsSpecFile/imports.unit.test.d.ts.map +1 -0
  80. package/data/packages/spec/dist/__tests__/spec-pipeline/transformWaspTsSpecFile/imports.unit.test.js +174 -0
  81. package/data/packages/spec/dist/__tests__/spec-pipeline/transformWaspTsSpecFile/refHelper.unit.test.d.ts +2 -0
  82. package/data/packages/spec/dist/__tests__/spec-pipeline/transformWaspTsSpecFile/refHelper.unit.test.d.ts.map +1 -0
  83. package/data/packages/spec/dist/__tests__/spec-pipeline/transformWaspTsSpecFile/refHelper.unit.test.js +119 -0
  84. package/data/packages/{wasp-config → spec}/dist/src/appSpec.d.ts +11 -4
  85. package/data/packages/spec/dist/src/appSpec.d.ts.map +1 -0
  86. package/data/packages/{wasp-config → spec}/dist/src/cli.d.ts +3 -1
  87. package/data/packages/spec/dist/src/cli.d.ts.map +1 -0
  88. package/data/packages/spec/dist/src/cli.js +28 -0
  89. package/data/packages/spec/dist/src/index.d.ts +2 -0
  90. package/data/packages/spec/dist/src/index.d.ts.map +1 -0
  91. package/data/packages/spec/dist/src/index.js +1 -0
  92. package/data/packages/spec/dist/src/internal.d.ts +2 -0
  93. package/data/packages/spec/dist/src/internal.d.ts.map +1 -0
  94. package/data/packages/spec/dist/src/internal.js +1 -0
  95. package/data/packages/spec/dist/src/legacy/_private.d.ts.map +1 -0
  96. package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/appAnalyzer.d.ts +1 -1
  97. package/data/packages/spec/dist/src/legacy/appAnalyzer.d.ts.map +1 -0
  98. package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/mapTsAppSpecToAppSpecDecls.d.ts +1 -1
  99. package/data/packages/spec/dist/src/legacy/mapTsAppSpecToAppSpecDecls.d.ts.map +1 -0
  100. package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/mapTsAppSpecToAppSpecDecls.js +3 -6
  101. package/data/packages/spec/dist/src/legacy/publicApi/App.d.ts.map +1 -0
  102. package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/publicApi/tsAppSpec.d.ts +3 -3
  103. package/data/packages/spec/dist/src/legacy/publicApi/tsAppSpec.d.ts.map +1 -0
  104. package/data/packages/spec/dist/src/run.js +28 -0
  105. package/data/packages/spec/dist/src/spec/appAnalyzer.d.ts +8 -0
  106. package/data/packages/spec/dist/src/spec/appAnalyzer.d.ts.map +1 -0
  107. package/data/packages/spec/dist/src/spec/appAnalyzer.js +35 -0
  108. package/data/packages/spec/dist/src/spec/mapApp.d.ts +54 -0
  109. package/data/packages/spec/dist/src/spec/mapApp.d.ts.map +1 -0
  110. package/data/packages/spec/dist/src/spec/mapApp.js +336 -0
  111. package/data/packages/spec/dist/src/spec/publicApi/constructors.d.ts +296 -0
  112. package/data/packages/spec/dist/src/spec/publicApi/constructors.d.ts.map +1 -0
  113. package/data/packages/spec/dist/src/spec/publicApi/constructors.js +277 -0
  114. package/data/packages/spec/dist/src/spec/publicApi/index.d.ts +5 -0
  115. package/data/packages/spec/dist/src/spec/publicApi/index.d.ts.map +1 -0
  116. package/data/packages/spec/dist/src/spec/publicApi/index.js +2 -0
  117. package/data/packages/spec/dist/src/spec/publicApi/register.d.ts +9 -0
  118. package/data/packages/spec/dist/src/spec/publicApi/register.d.ts.map +1 -0
  119. package/data/packages/spec/dist/src/spec/publicApi/register.js +1 -0
  120. package/data/packages/spec/dist/src/spec/publicApi/waspSpec.d.ts +872 -0
  121. package/data/packages/spec/dist/src/spec/publicApi/waspSpec.d.ts.map +1 -0
  122. package/data/packages/spec/dist/src/spec/publicApi/waspSpec.js +1 -0
  123. package/data/packages/spec/dist/src/spec/refObject.d.ts +95 -0
  124. package/data/packages/spec/dist/src/spec/refObject.d.ts.map +1 -0
  125. package/data/packages/spec/dist/src/spec/refObject.js +119 -0
  126. package/data/packages/spec/dist/src/spec/refObjectPath.d.ts +18 -0
  127. package/data/packages/spec/dist/src/spec/refObjectPath.d.ts.map +1 -0
  128. package/data/packages/spec/dist/src/spec/refObjectPath.js +79 -0
  129. package/data/packages/spec/dist/src/spec/specUserError.d.ts +9 -0
  130. package/data/packages/spec/dist/src/spec/specUserError.d.ts.map +1 -0
  131. package/data/packages/spec/dist/src/spec/specUserError.js +8 -0
  132. package/data/packages/spec/dist/src/spec-pipeline/common.d.ts +2 -0
  133. package/data/packages/spec/dist/src/spec-pipeline/common.d.ts.map +1 -0
  134. package/data/packages/spec/dist/src/spec-pipeline/common.js +1 -0
  135. package/data/packages/spec/dist/src/spec-pipeline/loadWaspTsSpec.d.ts +5 -0
  136. package/data/packages/spec/dist/src/spec-pipeline/loadWaspTsSpec.d.ts.map +1 -0
  137. package/data/packages/spec/dist/src/spec-pipeline/loadWaspTsSpec.js +46 -0
  138. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/apply.d.ts +4 -0
  139. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/apply.d.ts.map +1 -0
  140. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/apply.js +34 -0
  141. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/check.d.ts +3 -0
  142. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/check.d.ts.map +1 -0
  143. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/check.js +14 -0
  144. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/index.d.ts +5 -0
  145. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/index.d.ts.map +1 -0
  146. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/index.js +40 -0
  147. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/plan.d.ts +26 -0
  148. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/plan.d.ts.map +1 -0
  149. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/imports/plan.js +57 -0
  150. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/index.d.ts +3 -0
  151. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/index.d.ts.map +1 -0
  152. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/index.js +8 -0
  153. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/apply.d.ts +4 -0
  154. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/apply.d.ts.map +1 -0
  155. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/apply.js +18 -0
  156. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/check.d.ts +3 -0
  157. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/check.d.ts.map +1 -0
  158. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/check.js +13 -0
  159. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/index.d.ts +5 -0
  160. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/index.d.ts.map +1 -0
  161. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/index.js +40 -0
  162. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/plan.d.ts +19 -0
  163. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/plan.d.ts.map +1 -0
  164. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/refHelper/plan.js +60 -0
  165. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/util.d.ts +10 -0
  166. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/util.d.ts.map +1 -0
  167. package/data/packages/spec/dist/src/spec-pipeline/transformWaspTsSpecFilesPlugin/util.js +53 -0
  168. package/data/packages/spec/dist/src/spec-pipeline/typecheckPlugin/index.d.ts +5 -0
  169. package/data/packages/spec/dist/src/spec-pipeline/typecheckPlugin/index.d.ts.map +1 -0
  170. package/data/packages/spec/dist/src/spec-pipeline/typecheckPlugin/index.js +38 -0
  171. package/data/packages/spec/dist/src/spec-pipeline/typecheckPlugin/project.d.ts +9 -0
  172. package/data/packages/spec/dist/src/spec-pipeline/typecheckPlugin/project.d.ts.map +1 -0
  173. package/data/packages/spec/dist/src/spec-pipeline/typecheckPlugin/project.js +66 -0
  174. package/data/packages/spec/dist/src/typeUtils.d.ts +3 -0
  175. package/data/packages/spec/dist/src/typeUtils.d.ts.map +1 -0
  176. package/data/packages/spec/dist/src/typeUtils.js +1 -0
  177. package/data/packages/{wasp-config → spec}/package-lock.json +921 -1475
  178. package/data/packages/spec/package.json +48 -0
  179. package/data/packages/studio/package-lock.json +2 -2
  180. package/data/packages/studio/package.json +1 -1
  181. package/data/packages/ts-inspect/package-lock.json +2 -2
  182. package/data/packages/ts-inspect/package.json +1 -1
  183. package/package.json +1 -1
  184. package/wasp-bin +0 -0
  185. package/data/Cli/starters/basic/.prettierrc +0 -3
  186. package/data/Cli/starters/basic/main.wasp +0 -100
  187. package/data/Cli/starters/minimal/main.wasp +0 -14
  188. package/data/Cli/starters/ts-minimal/main.wasp.ts +0 -15
  189. package/data/Cli/starters/ts-minimal/package.json +0 -18
  190. package/data/Cli/starters/ts-minimal/schema.prisma +0 -10
  191. package/data/Cli/starters/ts-minimal/src/Main.css +0 -103
  192. package/data/Cli/starters/ts-minimal/src/MainPage.tsx +0 -37
  193. package/data/Cli/starters/ts-minimal/src/assets/logo.svg +0 -1
  194. package/data/Cli/starters/ts-minimal/tsconfig.json +0 -7
  195. package/data/Cli/starters/ts-minimal/vite.config.ts +0 -9
  196. package/data/packages/wasp-config/dist/__tests__/appAnalyzer.unit.test.d.ts.map +0 -1
  197. package/data/packages/wasp-config/dist/__tests__/cli.unit.test.js +0 -65
  198. package/data/packages/wasp-config/dist/__tests__/mapTsAppSpecToAppSpecDecls.integration.test.d.ts.map +0 -1
  199. package/data/packages/wasp-config/dist/__tests__/mapTsAppSpecToAppSpecDecls.unit.test.d.ts.map +0 -1
  200. package/data/packages/wasp-config/dist/__tests__/testFixtures.d.ts.map +0 -1
  201. package/data/packages/wasp-config/dist/__tests__/testFixtures.test-d.d.ts.map +0 -1
  202. package/data/packages/wasp-config/dist/src/_private.d.ts.map +0 -1
  203. package/data/packages/wasp-config/dist/src/appAnalyzer.d.ts.map +0 -1
  204. package/data/packages/wasp-config/dist/src/appSpec.d.ts.map +0 -1
  205. package/data/packages/wasp-config/dist/src/cli.d.ts.map +0 -1
  206. package/data/packages/wasp-config/dist/src/cli.js +0 -24
  207. package/data/packages/wasp-config/dist/src/index.d.ts +0 -8
  208. package/data/packages/wasp-config/dist/src/index.d.ts.map +0 -1
  209. package/data/packages/wasp-config/dist/src/index.js +0 -1
  210. package/data/packages/wasp-config/dist/src/mapTsAppSpecToAppSpecDecls.d.ts.map +0 -1
  211. package/data/packages/wasp-config/dist/src/publicApi/App.d.ts.map +0 -1
  212. package/data/packages/wasp-config/dist/src/publicApi/tsAppSpec.d.ts.map +0 -1
  213. package/data/packages/wasp-config/dist/src/run.js +0 -18
  214. package/data/packages/wasp-config/package.json +0 -40
  215. /package/data/packages/{wasp-config → spec}/dist/__tests__/cli.unit.test.d.ts +0 -0
  216. /package/data/packages/{wasp-config → spec}/dist/__tests__/cli.unit.test.d.ts.map +0 -0
  217. /package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/appAnalyzer.unit.test.d.ts +0 -0
  218. /package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/mapTsAppSpecToAppSpecDecls.integration.test.d.ts +0 -0
  219. /package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/mapTsAppSpecToAppSpecDecls.unit.test.d.ts +0 -0
  220. /package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/testFixtures.test-d.d.ts +0 -0
  221. /package/data/packages/{wasp-config/dist/__tests__ → spec/dist/__tests__/legacy}/testFixtures.test-d.js +0 -0
  222. /package/data/packages/{wasp-config → spec}/dist/src/appSpec.js +0 -0
  223. /package/data/packages/{wasp-config → spec}/dist/src/branded.d.ts +0 -0
  224. /package/data/packages/{wasp-config → spec}/dist/src/branded.d.ts.map +0 -0
  225. /package/data/packages/{wasp-config → spec}/dist/src/branded.js +0 -0
  226. /package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/_private.d.ts +0 -0
  227. /package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/_private.js +0 -0
  228. /package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/appAnalyzer.js +0 -0
  229. /package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/publicApi/App.d.ts +0 -0
  230. /package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/publicApi/App.js +0 -0
  231. /package/data/packages/{wasp-config/dist/src → spec/dist/src/legacy}/publicApi/tsAppSpec.js +0 -0
  232. /package/data/packages/{wasp-config → spec}/dist/src/run.d.ts +0 -0
  233. /package/data/packages/{wasp-config → spec}/dist/src/run.d.ts.map +0 -0
@@ -0,0 +1,872 @@
1
+ import type { RequireOneOrNone } from "type-fest";
2
+ import type { AnyFunction, AnyObject } from "../../typeUtils.js";
3
+ import type { RefObject } from "../refObject.js";
4
+ import { FromRegister } from "./register.js";
5
+ /**
6
+ * Root shape of a Wasp app specification.
7
+ *
8
+ * Pass an `App` to the {@link app} constructor and `export default` the
9
+ * result from `main.wasp.ts`.
10
+ *
11
+ * @category Wasp Spec
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * import { app } from "@wasp.sh/spec"
16
+ *
17
+ * export default app({
18
+ * name: "todoApp",
19
+ * title: "ToDo App",
20
+ * wasp: { version: "^0.24.0" },
21
+ * spec: [],
22
+ * });
23
+ * ```
24
+ */
25
+ export interface App {
26
+ /**
27
+ * Internal app name.
28
+ *
29
+ * Must not contain spaces.
30
+ */
31
+ name: string;
32
+ /**
33
+ * Wasp metadata.
34
+ *
35
+ * This will get checked against the Wasp CLI.
36
+ */
37
+ wasp: Wasp;
38
+ /**
39
+ * App title.
40
+ *
41
+ * Used as the browser tab title.
42
+ */
43
+ title: string;
44
+ /**
45
+ * Extra tags injected into the HTML `<head>`.
46
+ *
47
+ * Each entry is rendered inside a React component, so the strings must be
48
+ * valid JSX: self-closing tags must end with `/>` (e.g. `<meta ... />`),
49
+ * and attributes must be camelCased (e.g. `httpEquiv` instead of
50
+ * `http-equiv`).
51
+ *
52
+ * Due to a React bug, avoid `defer` on `<script>` tags because it can cause
53
+ * hydration warnings. Use `async` instead.
54
+ */
55
+ head?: string[];
56
+ /** Configuration for authentication. Enables auth when set. */
57
+ auth?: Auth;
58
+ /** Configuration for the server part of the resulting Wasp app. */
59
+ server?: Server;
60
+ /** Configuration for the client part of the resulting Wasp app. */
61
+ client?: Client;
62
+ /** Configuration for the app's database. */
63
+ db?: Db;
64
+ /** Configuration for the app's email sender. */
65
+ emailSender?: EmailSender;
66
+ /** Configuration for the app's WebSocket support. */
67
+ webSocket?: WebSocket;
68
+ /**
69
+ * The specification ({@link Spec}) of the app.
70
+ *
71
+ * Build entries with the dedicated constructors ({@link page}, {@link route},
72
+ * {@link query}, {@link action}, {@link api}, {@link apiNamespace},
73
+ * {@link job}, {@link crud}).
74
+ */
75
+ spec: Spec;
76
+ }
77
+ /**
78
+ * Wasp compiler metadata used by the app.
79
+ */
80
+ export interface Wasp {
81
+ /**
82
+ * The Wasp version this app is built for, as an npm-compatible version range
83
+ * (e.g. `"^0.24.0"`).
84
+ */
85
+ version: string;
86
+ }
87
+ /**
88
+ * Authentication configuration and lifecycle hooks.
89
+ *
90
+ * See the [Auth overview](https://wasp.sh/docs/auth/overview) for the
91
+ * supported auth methods and how the `User` entity is connected to auth.
92
+ * If hooks are async, Wasp awaits them. All hooks receive `prisma` and `req`
93
+ * in their input. Hook return values are ignored except for
94
+ * {@link AuthHooks.onBeforeOAuthRedirect}, which can change the redirect URL.
95
+ */
96
+ export interface Auth extends AuthHooks {
97
+ /**
98
+ * Name of the Prisma model that represents the application user connected
99
+ * to your business logic.
100
+ *
101
+ * The model must be defined in `schema.prisma` and have an `@id` field. The
102
+ * ID can use any Prisma-supported ID type.
103
+ *
104
+ * See [Accessing User Data](https://wasp.sh/docs/auth/entities) for
105
+ * how the user entity connects to the rest of the auth system.
106
+ */
107
+ userEntity: EntityName;
108
+ /** Enabled authentication methods. */
109
+ methods: AuthMethods;
110
+ /**
111
+ * Route that Wasp redirects unauthenticated users to when they try to
112
+ * access a page that has `authRequired: true`.
113
+ *
114
+ * See [Adding Auth to the Project](https://wasp.sh/docs/tutorial/auth#adding-auth-to-the-project)
115
+ * for an example.
116
+ */
117
+ onAuthFailedRedirectTo: string;
118
+ /**
119
+ * Route that Wasp redirects users to after a successful login or signup.
120
+ *
121
+ * Only takes effect when using Wasp's built-in Auth UI.
122
+ *
123
+ * See [Auth UI](https://wasp.sh/docs/auth/ui).
124
+ *
125
+ * @default "/"
126
+ */
127
+ onAuthSucceededRedirectTo?: string;
128
+ }
129
+ interface AuthHooks {
130
+ /**
131
+ * Called before the user is created. Receives `providerId` plus the common
132
+ * hook input. Throw from this hook to reject a signup based on custom
133
+ * criteria.
134
+ */
135
+ onBeforeSignup?: Reference<AnyFunction>;
136
+ /**
137
+ * Called after the user is created. Receives `providerId`, the created
138
+ * `user`, and, for social auth, `oauth` fields including tokens and the
139
+ * unique OAuth request ID.
140
+ */
141
+ onAfterSignup?: Reference<AnyFunction>;
142
+ /** Called once, after the user verifies their email. Receives `email` and `user`. */
143
+ onAfterEmailVerified?: Reference<AnyFunction>;
144
+ /**
145
+ * Called before redirecting the user to the OAuth provider. Receives the
146
+ * generated `url` and `oauth.uniqueRequestId`. Return `{ url }` to override
147
+ * the redirect URL.
148
+ */
149
+ onBeforeOAuthRedirect?: Reference<AnyFunction>;
150
+ /**
151
+ * Called before the user is logged in. Receives `providerId` and `user`.
152
+ * Throw from this hook to reject a login based on custom criteria.
153
+ */
154
+ onBeforeLogin?: Reference<AnyFunction>;
155
+ /**
156
+ * Called after a successful login. Receives `providerId`, `user`, and, for
157
+ * social auth, `oauth` fields including tokens and the unique OAuth request
158
+ * ID.
159
+ */
160
+ onAfterLogin?: Reference<AnyFunction>;
161
+ }
162
+ /**
163
+ * Enabled authentication methods for the app.
164
+ *
165
+ * At most one local auth method ({@link LocalAuthMethods}) can be used, but you
166
+ * can enable as many external auth methods ({@link ExternalAuthMethods}) as you
167
+ * need.
168
+ */
169
+ export type AuthMethods = RequireOneOrNone<LocalAuthMethods> & ExternalAuthMethods;
170
+ /**
171
+ * Built-in local auth methods.
172
+ *
173
+ * Pick at most one of these.
174
+ */
175
+ export interface LocalAuthMethods {
176
+ /** Enables username and password auth. */
177
+ usernameAndPassword: UsernameAndPasswordConfig;
178
+ /**
179
+ * Enables email and password auth with email verification and password
180
+ * reset flows.
181
+ */
182
+ email: EmailAuthConfig;
183
+ }
184
+ /**
185
+ * Social (OAuth) auth methods.
186
+ *
187
+ * Each enabled provider also requires the matching client ID and secret to
188
+ * be set as environment variables. See the
189
+ * [Social Auth overview](https://wasp.sh/docs/auth/social-auth/overview) for
190
+ * details on each provider.
191
+ */
192
+ export interface ExternalAuthMethods extends Partial<Record<SocialAuthMethodName, SocialAuthConfig>> {
193
+ }
194
+ /**
195
+ * Supported social auth providers.
196
+ */
197
+ type SocialAuthMethodName = "discord" | "google" | "gitHub" | "keycloak" | "microsoft" | "slack";
198
+ /**
199
+ * Username and password auth configuration.
200
+ */
201
+ export interface UsernameAndPasswordConfig extends BaseAuthMethodConfig {
202
+ }
203
+ /**
204
+ * Social auth provider configuration.
205
+ *
206
+ * By default, Wasp stores only the user's provider-specific ID. Use
207
+ * `userSignupFields` to save provider account details or custom signup state
208
+ * on your {@link Auth.userEntity}. Each provider has provider-specific
209
+ * `userSignupFields` and `configFn` behavior, documented in the
210
+ * [Social Auth docs](https://wasp.sh/docs/auth/social-auth/overview).
211
+ */
212
+ export interface SocialAuthConfig extends BaseAuthMethodConfig {
213
+ /**
214
+ * Function that returns provider-specific OAuth options (scopes, prompt,
215
+ * etc.). Use this to request extra scopes, such as requesting email/profile
216
+ * data from providers that do not include it by default, or to customize the
217
+ * OAuth flow.
218
+ */
219
+ configFn?: Reference<AnyFunction>;
220
+ }
221
+ /**
222
+ * Email auth configuration.
223
+ *
224
+ * See the [Email auth docs](https://wasp.sh/docs/auth/email) for the full
225
+ * signup, verification, and password reset flows.
226
+ */
227
+ export interface EmailAuthConfig extends BaseAuthMethodConfig {
228
+ /** Sender identity used for verification and password reset emails. */
229
+ fromField: EmailFromField;
230
+ /**
231
+ * Email verification flow configuration.
232
+ *
233
+ * Its `clientRoute` should handle the verification link sent to the user.
234
+ */
235
+ emailVerification: EmailFlowConfig;
236
+ /**
237
+ * Password reset flow configuration.
238
+ *
239
+ * Its `clientRoute` should handle the password reset link and the new
240
+ * password submitted by the user.
241
+ */
242
+ passwordReset: EmailFlowConfig;
243
+ }
244
+ interface BaseAuthMethodConfig {
245
+ /**
246
+ * Object that defines extra fields to save on the user during signup
247
+ * (e.g. `firstName`, `address`). Each field name must exist on the
248
+ * configured {@link Auth.userEntity}.
249
+ *
250
+ * Each field function receives the data sent from the client and returns
251
+ * the value Wasp saves to the database. For social auth, this data includes
252
+ * provider-specific profile information. If the value is invalid, throw an
253
+ * error. The `password` field is excluded from this object and handled by
254
+ * Wasp's auth backend.
255
+ *
256
+ * See [Signup Fields Customization](https://wasp.sh/docs/auth/overview#signup-fields-customization).
257
+ */
258
+ userSignupFields?: Reference<AnyObject>;
259
+ }
260
+ /**
261
+ * Configuration for an email-based auth flow (verification or password reset).
262
+ */
263
+ export interface EmailFlowConfig {
264
+ /**
265
+ * Function that returns the email content (subject, html, text) Wasp sends
266
+ * for this flow. Verification email functions receive
267
+ * `{ verificationLink }`, and password reset email functions receive
268
+ * `{ passwordResetLink }`. If omitted, Wasp uses a built-in default
269
+ * template.
270
+ */
271
+ getEmailContentFn?: Reference<AnyFunction>;
272
+ /**
273
+ * Name of the route that handles the link sent in the email
274
+ * (e.g. `"EmailVerificationRoute"` or `"PasswordResetRoute"`).
275
+ *
276
+ * The route must be defined in {@link App.spec} with the {@link route}
277
+ * constructor.
278
+ */
279
+ clientRoute: string;
280
+ }
281
+ /**
282
+ * Server-side application configuration.
283
+ *
284
+ * See [Server Config](https://wasp.sh/docs/project/server-config) for usage
285
+ * details.
286
+ */
287
+ export interface Server {
288
+ /**
289
+ * Async function called once on server start. Wasp awaits it before the
290
+ * server accepts requests. Receives a context containing the Express `app`
291
+ * and underlying `http.Server`, so you can register custom routes, set up
292
+ * additional databases or WebSockets, or kick off scheduled jobs.
293
+ */
294
+ setupFn?: Reference<AnyFunction>;
295
+ /**
296
+ * Function that customizes the global Express middleware stack. Affects
297
+ * all operations and APIs.
298
+ *
299
+ * See [Configuring Middleware](https://wasp.sh/docs/advanced/middleware-config).
300
+ */
301
+ middlewareConfigFn?: Reference<AnyFunction>;
302
+ /**
303
+ * Zod schema used to validate user-defined server environment variables on
304
+ * startup. Wasp merges it with built-in validation for Wasp-defined env vars
305
+ * when validating `process.env`.
306
+ *
307
+ * {@include ./referenceImports.md}
308
+ *
309
+ * For example:
310
+ *
311
+ * ```ts
312
+ * import { serverEnvSchema } from './src/env' with { type: 'ref' }
313
+ * ```
314
+ *
315
+ * See [Env Vars](https://wasp.sh/docs/project/env-vars).
316
+ */
317
+ envValidationSchema?: Reference<ZodSchema>;
318
+ }
319
+ /**
320
+ * Client-side application configuration.
321
+ *
322
+ * See [Client Config](https://wasp.sh/docs/project/client-config) for usage
323
+ * details.
324
+ */
325
+ export interface Client {
326
+ /**
327
+ * Wrapper React component rendered at the root of the client app. Must
328
+ * render `Outlet` from `react-router` to show the current page.
329
+ *
330
+ * Useful for layouts, providers (Redux, theme, etc.), and global UI.
331
+ */
332
+ rootComponent?: Reference<AnyFunction>;
333
+ /**
334
+ * Async function Wasp calls once while initializing the client app. Wasp
335
+ * awaits it before rendering the app. It receives no arguments, and its
336
+ * return value is ignored. Use it for one-time client-side setup, such as
337
+ * configuring the query client or starting client-side periodic jobs.
338
+ */
339
+ setupFn?: Reference<AnyFunction>;
340
+ /**
341
+ * Subpath the client app is served from (e.g. `"/my-app"`).
342
+ *
343
+ * When set, Wasp configures React Router's `basename` for routing and
344
+ * Vite's `base` option for asset URLs, so the app works from
345
+ * `https://example.com/my-app`.
346
+ */
347
+ baseDir?: `/${string}`;
348
+ /**
349
+ * Zod schema used to validate user-defined client environment variables at
350
+ * build time. Wasp merges it with built-in validation for Wasp-defined env
351
+ * vars when validating `import.meta.env`. Client env vars must be prefixed
352
+ * with `REACT_APP_`.
353
+ *
354
+ * {@include ./referenceImports.md}
355
+ *
356
+ * For example:
357
+ *
358
+ * ```ts
359
+ * import { clientEnvSchema } from './src/env' with { type: 'ref' }
360
+ * ```
361
+ *
362
+ * See [Env Vars](https://wasp.sh/docs/project/env-vars).
363
+ */
364
+ envValidationSchema?: Reference<ZodSchema>;
365
+ }
366
+ /**
367
+ * Database configuration.
368
+ *
369
+ * See [Databases](https://wasp.sh/docs/data-model/databases) for seeding and
370
+ * Prisma client customization.
371
+ */
372
+ export interface Db {
373
+ /**
374
+ * Async functions runnable with `wasp db seed [name]` to populate the
375
+ * database with initial data. Each function receives Wasp's Prisma Client;
376
+ * the name passed to `wasp db seed` matches the function's identifier in the
377
+ * import.
378
+ *
379
+ * See [Seeding the Database](https://wasp.sh/docs/data-model/databases#seeding-the-database).
380
+ */
381
+ seeds?: Reference<AnyFunction>[];
382
+ /**
383
+ * Function that sets up and returns a configured Prisma Client instance.
384
+ * Use this to add Prisma logging or client extensions.
385
+ *
386
+ * See Prisma's [logging](https://www.prisma.io/docs/orm/prisma-client/observability-and-logging/logging)
387
+ * and [client extensions](https://www.prisma.io/docs/orm/prisma-client/client-extensions)
388
+ * docs.
389
+ */
390
+ prismaSetupFn?: Reference<AnyFunction>;
391
+ }
392
+ /**
393
+ * Email sender configuration.
394
+ *
395
+ * Required for the email auth flows (verification, password reset) and
396
+ * available for sending arbitrary emails via `wasp/server/email`.
397
+ *
398
+ * See [Sending Emails](https://wasp.sh/docs/advanced/email).
399
+ */
400
+ export interface EmailSender {
401
+ /** Provider Wasp uses to deliver outgoing emails. */
402
+ provider: EmailSenderProviderName;
403
+ /**
404
+ * Sender identity used when an email is sent without an explicit `from`.
405
+ */
406
+ defaultFrom?: EmailFromField;
407
+ }
408
+ /**
409
+ * Supported email sender providers.
410
+ *
411
+ * `"Dummy"` logs emails to the console instead of sending them, which is
412
+ * convenient during development, but not allowed in production.
413
+ */
414
+ export type EmailSenderProviderName = "SMTP" | "SendGrid" | "Mailgun" | "Dummy";
415
+ /**
416
+ * Sender identity used in outgoing emails.
417
+ */
418
+ export interface EmailFromField {
419
+ /** Optional display name shown alongside the email address. */
420
+ name?: string;
421
+ /** Email address the message is sent from. */
422
+ email: string;
423
+ }
424
+ /**
425
+ * WebSocket configuration.
426
+ *
427
+ * See [Web Sockets](https://wasp.sh/docs/advanced/web-sockets) for handler
428
+ * shape and client-side usage.
429
+ */
430
+ export interface WebSocket {
431
+ /**
432
+ * Function that registers Socket.IO event handlers. Wasp calls it once on
433
+ * server start with the Socket.IO server instance and a context containing
434
+ * all app entities. If a connected socket is authenticated, Wasp stores the
435
+ * user on `socket.data.user`.
436
+ */
437
+ fn: Reference<AnyFunction>;
438
+ /**
439
+ * If `true` (the default), the client connects to the WebSocket server as
440
+ * soon as the app loads. Set to `false` to connect manually via
441
+ * `useSocket`.
442
+ *
443
+ * @default true
444
+ */
445
+ autoConnect?: boolean;
446
+ }
447
+ /**
448
+ * A single {@link SpecElement}, or an (optionally nested) array of them, that
449
+ * makes up the {@link App.spec}.
450
+ *
451
+ * This lets you define related elements separately (for example, one array per
452
+ * feature) and compose them together. The nested structure is treated as a single
453
+ * flat list of elements.
454
+ *
455
+ * @category Specifications
456
+ *
457
+ * @example
458
+ * Nested arrays let you compose a spec from separate sub-specs:
459
+ * ```ts
460
+ * const authSpec: Spec = [signupRoute, loginRoute];
461
+ * const tasksSpec: Spec = [tasksRoute, getTasks, createTask];
462
+ *
463
+ * const spec: Spec = [authSpec, tasksSpec];
464
+ * ```
465
+ */
466
+ export type Spec = SpecElement | Spec[];
467
+ /**
468
+ * Union of every kind of specification element that can appear in {@link App.spec}.
469
+ *
470
+ * Each variant is produced by its matching constructor.
471
+ *
472
+ * @category Specifications
473
+ */
474
+ export type SpecElement = Page | Route | Query | Action | Api | ApiNamespace | Job | Crud;
475
+ /**
476
+ * A page in the app, normally a React component rendered for a {@link Route}.
477
+ *
478
+ * Create one with the {@link page} constructor.
479
+ *
480
+ * @category Specifications
481
+ */
482
+ export interface Page extends BaseSpecElement<"page"> {
483
+ /** React component rendered for this page. */
484
+ component: Reference<AnyFunction>;
485
+ /**
486
+ * If `true`, only authenticated users can access this page. Unauthenticated
487
+ * visitors are redirected to {@link Auth.onAuthFailedRedirectTo}.
488
+ *
489
+ * Cannot be combined with {@link Route.prerender}.
490
+ *
491
+ * @default false
492
+ */
493
+ authRequired?: boolean;
494
+ }
495
+ /**
496
+ * A URL path mapped to a {@link Page}.
497
+ *
498
+ * Create one with the {@link route} constructor.
499
+ *
500
+ * See [Routing](https://wasp.sh/docs/advanced/routing) for path patterns
501
+ * (dynamic segments, optional segments, splats).
502
+ *
503
+ * @category Specifications
504
+ */
505
+ export interface Route extends BaseSpecElement<"route"> {
506
+ /** Unique route name. */
507
+ name: string;
508
+ /**
509
+ * URL path. Supports React Router patterns like `/tasks/:id`,
510
+ * `/photo/:id/edit?`, and `/files/*`.
511
+ */
512
+ path: string;
513
+ /** Page rendered when this route matches. */
514
+ page: Page;
515
+ /**
516
+ * If `true`, Wasp renders this page to static HTML at build time. Useful
517
+ * for SEO and AI crawlers.
518
+ *
519
+ * Only works on static paths and cannot be combined with
520
+ * {@link Page.authRequired}. See
521
+ * [Prerendering](https://wasp.sh/docs/advanced/prerendering).
522
+ *
523
+ * @default false
524
+ */
525
+ prerender?: boolean;
526
+ /**
527
+ * Lazy-load the page's component.
528
+ *
529
+ * Set to `false` to include the page in the initial client bundle, which
530
+ * avoids the brief loading delay on first navigation at the cost of a larger
531
+ * initial download.
532
+ *
533
+ * @default true
534
+ */
535
+ lazy?: boolean;
536
+ }
537
+ /**
538
+ * A server-side read-only operation, callable from the client and the server.
539
+ *
540
+ * Create one with the {@link query} constructor.
541
+ *
542
+ * See [Queries](https://wasp.sh/docs/data-model/operations/queries).
543
+ *
544
+ * @category Specifications
545
+ */
546
+ export interface Query extends BaseSpecElement<"query"> {
547
+ /**
548
+ * Reference to the Query's NodeJS implementation. The implementation can be
549
+ * async and receives two positional arguments: the caller-provided `args`
550
+ * payload and a Wasp-provided `context` containing declared entities and,
551
+ * when auth is enabled for the Query, the current user.
552
+ */
553
+ fn: Reference<AnyFunction>;
554
+ /**
555
+ * Entities the query reads from. Wasp injects a Prisma delegate for each
556
+ * one into the query's `context.entities`, and uses the list to invalidate
557
+ * the client-side cache when related actions run.
558
+ *
559
+ * See [Using Entities in Queries](https://wasp.sh/docs/data-model/operations/queries#using-entities-in-queries).
560
+ */
561
+ entities?: EntityName[];
562
+ /**
563
+ * If `true`, the query receives `context.user`. Defaults to `true` when
564
+ * the app has auth enabled, and `false` otherwise.
565
+ *
566
+ * You can only set this field when app-level auth is enabled.
567
+ */
568
+ auth?: boolean;
569
+ }
570
+ /**
571
+ * A server-side write operation, callable from the client and the server.
572
+ *
573
+ * Create one with the {@link action} constructor.
574
+ *
575
+ * See [Actions](https://wasp.sh/docs/data-model/operations/actions).
576
+ *
577
+ * @category Specifications
578
+ */
579
+ export interface Action extends BaseSpecElement<"action"> {
580
+ /**
581
+ * Reference to the Action's NodeJS implementation. The implementation can be
582
+ * async and receives two positional arguments: the caller-provided `args`
583
+ * payload and a Wasp-provided `context` containing declared entities and,
584
+ * when auth is enabled for the Action, the current user.
585
+ */
586
+ fn: Reference<AnyFunction>;
587
+ /**
588
+ * Entities the action operates on. Wasp injects a Prisma delegate for each
589
+ * one into the action's `context.entities`, and uses the list to
590
+ * invalidate the related query caches on the client.
591
+ *
592
+ * See [Using Entities in Actions](https://wasp.sh/docs/data-model/operations/actions#using-entities-in-actions).
593
+ */
594
+ entities?: EntityName[];
595
+ /**
596
+ * If `true`, the action receives `context.user`. Defaults to `true` when
597
+ * the app has auth enabled, and `false` otherwise.
598
+ *
599
+ * You can only set this field when app-level auth is enabled.
600
+ */
601
+ auth?: boolean;
602
+ }
603
+ /**
604
+ * A custom HTTP endpoint mounted on the Wasp server.
605
+ *
606
+ * Create one with the {@link api} constructor.
607
+ *
608
+ * Unlike operations, APIs are plain Express handlers that receive `req`,
609
+ * `res`, and a Wasp `context`. They are useful for webhooks and any
610
+ * non-standard HTTP interaction.
611
+ *
612
+ * See [Custom HTTP API Endpoints](https://wasp.sh/docs/advanced/apis).
613
+ *
614
+ * @category Specifications
615
+ */
616
+ export interface Api extends BaseSpecElement<"api"> {
617
+ /** HTTP method this endpoint responds to. */
618
+ method: HttpMethod;
619
+ /** Express path of the endpoint (e.g. `"/webhooks/stripe"`). */
620
+ path: string;
621
+ /** Reference to the API's NodeJS implementation. */
622
+ fn: Reference<AnyFunction>;
623
+ /**
624
+ * Reference to an Express middleware config function for this endpoint only.
625
+ *
626
+ * See [Configuring API middleware](https://wasp.sh/docs/advanced/middleware-config#2-customize-api-specific-middleware).
627
+ */
628
+ middlewareConfigFn?: Reference<AnyFunction>;
629
+ /**
630
+ * Entities the handler operates on. Wasp injects a Prisma delegate for
631
+ * each one into the handler's `context.entities`.
632
+ *
633
+ * See [Using Entities in APIs](https://wasp.sh/docs/advanced/apis#using-entities-in-apis).
634
+ */
635
+ entities?: EntityName[];
636
+ /**
637
+ * If `true`, the handler requires the request to come from an
638
+ * authenticated user and receives `context.user`. Defaults to `true` when
639
+ * the app has auth enabled, and `false` otherwise. Set to `false` to skip
640
+ * parsing the JWT from the Authorization header.
641
+ */
642
+ auth?: boolean;
643
+ }
644
+ /**
645
+ * Shared middleware applied to every {@link Api} mounted under a path
646
+ * prefix.
647
+ *
648
+ * Create one with the {@link apiNamespace} constructor.
649
+ *
650
+ * @category Specifications
651
+ */
652
+ export interface ApiNamespace extends BaseSpecElement<"apiNamespace"> {
653
+ /** Reference to an Express middleware config function for this namespace. */
654
+ middlewareConfigFn: Reference<AnyFunction>;
655
+ /** Path prefix the namespace applies to (e.g. `"/webhooks"`). */
656
+ path: string;
657
+ }
658
+ /**
659
+ * HTTP methods supported by an {@link Api}.
660
+ *
661
+ * Use `"ALL"` to match any method.
662
+ */
663
+ export type HttpMethod = "ALL" | "GET" | "POST" | "PUT" | "DELETE";
664
+ /**
665
+ * A background job. Can be submitted ad-hoc or run on a recurring schedule.
666
+ *
667
+ * Create one with the {@link job} constructor.
668
+ *
669
+ * See [Recurring Jobs](https://wasp.sh/docs/advanced/jobs).
670
+ *
671
+ * @category Specifications
672
+ */
673
+ export interface Job extends BaseSpecElement<"job"> {
674
+ /**
675
+ * Reference to the job's NodeJS implementation. It receives the submitted
676
+ * args and a context containing the declared entities.
677
+ */
678
+ fn: Reference<AnyFunction>;
679
+ /** Executor backing this job. */
680
+ executor: JobExecutor;
681
+ /** Cron schedule that runs the job automatically. */
682
+ schedule?: Schedule;
683
+ /**
684
+ * Entities the worker operates on. Wasp injects a Prisma delegate for
685
+ * each one into the worker's `context.entities`.
686
+ *
687
+ * This works like entity access in queries and actions. See
688
+ * [Using Entities in Queries](https://wasp.sh/docs/data-model/operations/queries#using-entities-in-queries).
689
+ */
690
+ entities?: EntityName[];
691
+ /**
692
+ * Executor-specific default options used when submitting the job.
693
+ *
694
+ * These options are passed through to the executor and can be overridden
695
+ * when submitting the job or by {@link Schedule.executorOptions} for
696
+ * scheduled runs. For example, with PgBoss this can set retry limits,
697
+ * expiration, or priority.
698
+ *
699
+ * @default {}
700
+ */
701
+ performExecutorOptions?: ExecutorOptions;
702
+ }
703
+ /**
704
+ * Supported job executors. Currently only `"PgBoss"` is available, which
705
+ * stores jobs in the app's PostgreSQL database via
706
+ * [pg-boss](https://github.com/timgit/pg-boss).
707
+ */
708
+ export type JobExecutor = "PgBoss";
709
+ /**
710
+ * Cron schedule for a {@link Job}.
711
+ */
712
+ export interface Schedule {
713
+ /**
714
+ * Five-field cron expression (e.g. `"0 * * * *"` for hourly).
715
+ *
716
+ * Wasp supports minute-level precision.
717
+ *
718
+ * See pg-boss's [scheduling docs](https://github.com/timgit/pg-boss/blob/8.4.2/docs/readme.md#scheduling)
719
+ * for the rationale. Use [Crontab Guru](https://crontab.guru/#0_*_*_*_*)
720
+ * to build cron expressions.
721
+ */
722
+ cron: string;
723
+ /** Arguments passed to the worker function on each scheduled run. */
724
+ args?: object;
725
+ /**
726
+ * Executor-specific options applied only to scheduled runs. These override
727
+ * or extend {@link Job.performExecutorOptions}.
728
+ */
729
+ executorOptions?: ExecutorOptions;
730
+ }
731
+ /**
732
+ * Executor-specific options.
733
+ *
734
+ * The `pgBoss` field is forwarded as-is to the matching pg-boss API. See
735
+ * the [pg-boss send options docs](https://github.com/timgit/pg-boss/blob/8.4.2/docs/readme.md#sendname-data-options)
736
+ * for the supported keys.
737
+ */
738
+ export interface ExecutorOptions {
739
+ pgBoss: object;
740
+ }
741
+ /**
742
+ * Auto-generated CRUD operations for an entity.
743
+ *
744
+ * Create one with the {@link crud} constructor.
745
+ *
746
+ * See [Automatic CRUD](https://wasp.sh/docs/data-model/crud).
747
+ *
748
+ * @category Specifications
749
+ */
750
+ export interface Crud extends BaseSpecElement<"crud"> {
751
+ /** Unique name for this CRUD. */
752
+ name: string;
753
+ /** Entity to generate operations for. */
754
+ entity: EntityName;
755
+ /** Which operations to generate and how to configure each one. */
756
+ operations: CrudOperations;
757
+ }
758
+ /**
759
+ * Mapping of CRUD operations to their options.
760
+ *
761
+ * Each key enables the matching operation; an empty object enables it with
762
+ * Wasp's defaults. Default `get`, `update`, and `delete` implementations use
763
+ * the field marked with `@id` in the Prisma schema as the entity ID. Default
764
+ * `getAll` returns all entities.
765
+ *
766
+ * CRUD operations are implemented with Wasp queries and actions. See
767
+ * [Operations](https://wasp.sh/docs/data-model/operations/overview).
768
+ */
769
+ export interface CrudOperations extends Partial<Record<CrudOperation, CrudOperationOptions>> {
770
+ }
771
+ /**
772
+ * Operations a {@link Crud} can generate.
773
+ */
774
+ export type CrudOperation = "get" | "getAll" | "create" | "update" | "delete";
775
+ /**
776
+ * Configuration for a single CRUD operation.
777
+ */
778
+ export interface CrudOperationOptions {
779
+ /**
780
+ * If `true`, the operation skips Wasp's auth check and can be called by
781
+ * anyone.
782
+ *
783
+ * @default false
784
+ */
785
+ isPublic?: boolean;
786
+ /**
787
+ * Reference to a custom implementation that replaces Wasp's auto-generated
788
+ * one. Use this when you need custom business logic for an operation (e.g.
789
+ * attaching `userId` on `create`).
790
+ *
791
+ * See the [CRUD guide](https://wasp.sh/docs/data-model/crud#adding-crud-to-the-task-entity-)
792
+ * for an override example.
793
+ *
794
+ * The override receives the caller-provided `args` payload and a
795
+ * Wasp-provided `context` containing the current user and the entity being
796
+ * operated on. Use an override to validate or filter input before saving it;
797
+ * the default `create` and `update` implementations pass client-sent data to
798
+ * Prisma.
799
+ */
800
+ overrideFn?: Reference<AnyFunction>;
801
+ }
802
+ /**
803
+ * One of the app's entity names, matching a model in `schema.prisma`.
804
+ */
805
+ export type EntityName = keyof Entities extends never ? string : Extract<keyof Entities, string>;
806
+ type Entities = FromRegister<"entities", {}>;
807
+ /**
808
+ * Represents a value from your app passed into the Wasp spec.
809
+ *
810
+ * {@include ./referenceImports.md}
811
+ *
812
+ * @category References
813
+ *
814
+ * @typeParam AppValue - The expected TypeScript type for the value from your
815
+ * app. The field using `Reference<AppValue>` decides this type. For example,
816
+ * {@link Page.component} expects a React component, {@link Query.fn} expects a
817
+ * server function, and env schema fields expect a {@link ZodSchema}.
818
+ *
819
+ * @example
820
+ * ```ts
821
+ * import { query } from "@wasp.sh/spec"
822
+ * import { getTasks } from "./src/queries" with { type: "ref" }
823
+ *
824
+ * query(getTasks, { entities: ["Task"] })
825
+ * ```
826
+ */
827
+ export type Reference<AppValue> = RefObject | AppValue;
828
+ export type {
829
+ /**
830
+ * Default-import variant of {@link RefObjectDescriptor}.
831
+ */
832
+ DefaultRefObjectDescriptor,
833
+ /**
834
+ * Named-import variant of {@link RefObjectDescriptor}.
835
+ */
836
+ NamedRefObjectDescriptor,
837
+ /**
838
+ * A user-facing reference object, pointing to a value in the project's `src`
839
+ * directory.
840
+ */
841
+ RefObject,
842
+ /**
843
+ * Descriptor accepted by {@link ref}.
844
+ */
845
+ RefObjectDescriptor, } from "../refObject.js";
846
+ interface BaseSpecElement<Kind extends string> {
847
+ /**
848
+ * The internal Wasp type of a {@link SpecElement}. Used by the compiler.
849
+ * You should not set this field directly, instead use the dedicated constructors.
850
+ */
851
+ kind: Kind;
852
+ }
853
+ /**
854
+ * Structural type for a runtime Zod schema accepted by Wasp env validation fields.
855
+ *
856
+ * {@include ./referenceImports.md}
857
+ *
858
+ * See {@link Server.envValidationSchema} and
859
+ * {@link Client.envValidationSchema} for examples.
860
+ *
861
+ * To avoid depending on the `zod` package, Wasp structurally recognizes Zod 4
862
+ * schemas via their documented library-author marker. See
863
+ * https://zod.dev/library-authors.
864
+ *
865
+ * @category References
866
+ */
867
+ export type ZodSchema = {
868
+ readonly _zod: {
869
+ readonly def: object;
870
+ };
871
+ };
872
+ //# sourceMappingURL=waspSpec.d.ts.map