diff --git a/waspc/ChangeLog.md b/waspc/ChangeLog.md index 06130b5f84..a66b07cbc8 100644 --- a/waspc/ChangeLog.md +++ b/waspc/ChangeLog.md @@ -1,5 +1,15 @@ # Changelog +## Next + +### ⚠️ Breaking Changes + +- Renamed and split `deserializeAndSanitizeProviderData` to `getProviderData` and `getProviderDataWithPassword` so it's more explicit if the resulting data will contain the hashed password or not. + +### 🔧 Small improvements + +- Enabled strict null checks for the Wasp SDK which means that some of the return types are more precise now e.g. you'll need to check if some value is `null` before using it. + ## 0.15.2 ### 🐞 Bug fixes @@ -79,7 +89,6 @@ To learn more about this feature and how to activate it, check out the [Wasp TS There are some breaking changes with React Router 6 which will require you to update your code. Also, the new version of Prisma may cause breaking changes depending on how you're using it. - Read more about breaking changes in the migration guide: https://wasp-lang.dev/docs/migration-guides/migrate-from-0-14-to-0-15 . ### 🐞 Bug fixes diff --git a/waspc/data/Generator/templates/sdk/wasp/api/index.ts b/waspc/data/Generator/templates/sdk/wasp/api/index.ts index 6037b3048c..c8895b1275 100644 --- a/waspc/data/Generator/templates/sdk/wasp/api/index.ts +++ b/waspc/data/Generator/templates/sdk/wasp/api/index.ts @@ -77,7 +77,7 @@ window.addEventListener('storage', (event) => { * standard format to be further used by the client. It is also assumed that given API * error has been formatted as implemented by HttpError on the server. */ -export function handleApiError(error: AxiosError<{ message?: string, data?: unknown }>): void { +export function handleApiError>(error: T): T | WaspHttpError { if (error?.response) { // If error came from HTTP response, we capture most informative message // and also add .statusCode information to it. @@ -88,10 +88,10 @@ export function handleApiError(error: AxiosError<{ message?: string, data?: unkn // That would require copying HttpError code to web-app also and using it here. const responseJson = error.response?.data const responseStatusCode = error.response.status - throw new WaspHttpError(responseStatusCode, responseJson?.message ?? error.message, responseJson) + return new WaspHttpError(responseStatusCode, responseJson?.message ?? error.message, responseJson) } else { // If any other error, we just propagate it. - throw error + return error } } diff --git a/waspc/data/Generator/templates/sdk/wasp/auth/email/actions/login.ts b/waspc/data/Generator/templates/sdk/wasp/auth/email/actions/login.ts index 6a2cbbad1b..533a709237 100644 --- a/waspc/data/Generator/templates/sdk/wasp/auth/email/actions/login.ts +++ b/waspc/data/Generator/templates/sdk/wasp/auth/email/actions/login.ts @@ -8,6 +8,6 @@ export async function login(data: { email: string; password: string }): Promise< const response = await api.post('{= loginPath =}', data); await initSession(response.data.sessionId); } catch (e) { - handleApiError(e); + throw handleApiError(e); } } diff --git a/waspc/data/Generator/templates/sdk/wasp/auth/email/actions/passwordReset.ts b/waspc/data/Generator/templates/sdk/wasp/auth/email/actions/passwordReset.ts index ca48bbf98d..5de42eff40 100644 --- a/waspc/data/Generator/templates/sdk/wasp/auth/email/actions/passwordReset.ts +++ b/waspc/data/Generator/templates/sdk/wasp/auth/email/actions/passwordReset.ts @@ -7,7 +7,7 @@ export async function requestPasswordReset(data: { email: string; }): Promise<{ const response = await api.post('{= requestPasswordResetPath =}', data); return response.data; } catch (e) { - handleApiError(e); + throw handleApiError(e); } } @@ -17,6 +17,6 @@ export async function resetPassword(data: { token: string; password: string; }): const response = await api.post('{= resetPasswordPath =}', data); return response.data; } catch (e) { - handleApiError(e); + throw handleApiError(e); } } diff --git a/waspc/data/Generator/templates/sdk/wasp/auth/email/actions/signup.ts b/waspc/data/Generator/templates/sdk/wasp/auth/email/actions/signup.ts index 797af04a26..ed14ce6d8c 100644 --- a/waspc/data/Generator/templates/sdk/wasp/auth/email/actions/signup.ts +++ b/waspc/data/Generator/templates/sdk/wasp/auth/email/actions/signup.ts @@ -7,6 +7,6 @@ export async function signup(data: { email: string; password: string }): Promise const response = await api.post('{= signupPath =}', data); return response.data; } catch (e) { - handleApiError(e); + throw handleApiError(e); } } diff --git a/waspc/data/Generator/templates/sdk/wasp/auth/email/actions/verifyEmail.ts b/waspc/data/Generator/templates/sdk/wasp/auth/email/actions/verifyEmail.ts index 80c7c4ceba..e67b71bc62 100644 --- a/waspc/data/Generator/templates/sdk/wasp/auth/email/actions/verifyEmail.ts +++ b/waspc/data/Generator/templates/sdk/wasp/auth/email/actions/verifyEmail.ts @@ -9,6 +9,6 @@ export async function verifyEmail(data: { const response = await api.post('{= verifyEmailPath =}', data) return response.data } catch (e) { - handleApiError(e) + throw handleApiError(e) } } diff --git a/waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx b/waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx index 71970f86bb..1270ed1f8b 100644 --- a/waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx +++ b/waspc/data/Generator/templates/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx @@ -280,7 +280,7 @@ function AdditionalFormFields({ }: { hookForm: UseFormReturn; formState: FormState; - additionalSignupFields: AdditionalSignupFields; + additionalSignupFields?: AdditionalSignupFields; }) { const { register, @@ -293,6 +293,7 @@ function AdditionalFormFields({ Component: any, props?: React.ComponentProps ) { + const errorMessage = errors[field.name]?.message; return ( {field.label} @@ -301,8 +302,8 @@ function AdditionalFormFields({ {...props} disabled={isLoading} /> - {errors[field.name] && ( - {errors[field.name].message} + {errorMessage && ( + {errorMessage} )} ); @@ -341,7 +342,7 @@ function isFieldRenderFn( } function areAdditionalFieldsRenderFn( - additionalSignupFields: AdditionalSignupFields + additionalSignupFields?: AdditionalSignupFields ): additionalSignupFields is AdditionalSignupFieldRenderFn { return typeof additionalSignupFields === 'function' } diff --git a/waspc/data/Generator/templates/sdk/wasp/auth/login.ts b/waspc/data/Generator/templates/sdk/wasp/auth/login.ts index 5d084ad794..0e2f3ef4b6 100644 --- a/waspc/data/Generator/templates/sdk/wasp/auth/login.ts +++ b/waspc/data/Generator/templates/sdk/wasp/auth/login.ts @@ -9,6 +9,6 @@ export default async function login(username: string, password: string): Promise await initSession(response.data.sessionId) } catch (error) { - handleApiError(error) + throw handleApiError(error) } } diff --git a/waspc/data/Generator/templates/sdk/wasp/auth/session.ts b/waspc/data/Generator/templates/sdk/wasp/auth/session.ts index ed5558ecbd..d4de93de4d 100644 --- a/waspc/data/Generator/templates/sdk/wasp/auth/session.ts +++ b/waspc/data/Generator/templates/sdk/wasp/auth/session.ts @@ -6,7 +6,7 @@ import { type AuthUserData } from '../server/auth/user.js'; import { auth } from "./lucia.js"; import type { Session } from "lucia"; -import { throwInvalidCredentialsError } from "./utils.js"; +import { createInvalidCredentialsError } from "./utils.js"; import { prisma } from 'wasp/server'; import { createAuthUserData } from "../server/auth/user.js"; @@ -66,7 +66,7 @@ async function getAuthUserData(userId: {= userEntityUpper =}['id']): Promise { if (error.response?.status === 401) { return null } else { - handleApiError(error) + throw handleApiError(error) } } } diff --git a/waspc/data/Generator/templates/sdk/wasp/auth/user.ts b/waspc/data/Generator/templates/sdk/wasp/auth/user.ts index 9310d32544..c32e17cc51 100644 --- a/waspc/data/Generator/templates/sdk/wasp/auth/user.ts +++ b/waspc/data/Generator/templates/sdk/wasp/auth/user.ts @@ -4,6 +4,7 @@ import type { AuthUser, UserEntityWithAuth, } from '../server/auth/user.js' +import { isNotNull } from '../universal/predicates.js' /** * We split the user.ts code into two files to avoid some server-only @@ -35,6 +36,7 @@ export type { AuthUserData, AuthUser } from '../server/auth/user.js' // PRIVATE API (used in SDK and server) export function makeAuthUserIfPossible(user: null): null export function makeAuthUserIfPossible(user: AuthUserData): AuthUser +export function makeAuthUserIfPossible(user: AuthUserData | null): AuthUser | null export function makeAuthUserIfPossible( user: AuthUserData | null, ): AuthUser | null { @@ -45,13 +47,13 @@ function makeAuthUser(data: AuthUserData): AuthUser { return { ...data, getFirstProviderUserId: () => { - const identities = Object.values(data.identities).filter(Boolean); + const identities = Object.values(data.identities).filter(isNotNull); return identities.length > 0 ? identities[0].id : null; }, }; } -function findUserIdentity(user: UserEntityWithAuth, providerName: ProviderName): UserEntityWithAuth['auth']['identities'][number] | null { +function findUserIdentity(user: UserEntityWithAuth, providerName: ProviderName): NonNullable['identities'][number] | null { if (!user.auth) { return null; } diff --git a/waspc/data/Generator/templates/sdk/wasp/auth/utils.ts b/waspc/data/Generator/templates/sdk/wasp/auth/utils.ts index f5875de04c..7d682ba1d8 100644 --- a/waspc/data/Generator/templates/sdk/wasp/auth/utils.ts +++ b/waspc/data/Generator/templates/sdk/wasp/auth/utils.ts @@ -110,7 +110,7 @@ export async function updateAuthIdentityProviderData( ): Promise<{= authIdentityEntityUpper =}> { // We are doing the sanitization here only on updates to avoid // hashing the password multiple times. - const sanitizedProviderDataUpdates = await sanitizeProviderData(providerDataUpdates); + const sanitizedProviderDataUpdates = await ensurePasswordIsHashed(providerDataUpdates); const newProviderData = { ...existingProviderData, ...sanitizedProviderDataUpdates, @@ -124,15 +124,31 @@ export async function updateAuthIdentityProviderData( }); } -type FindAuthWithUserResult = {= authEntityUpper =} & { +// PRIVATE API +export type FindAuthWithUserResult = {= authEntityUpper =} & { {= userFieldOnAuthEntityName =}: {= userEntityUpper =} } // PRIVATE API export async function findAuthWithUserBy( where: Prisma.{= authEntityUpper =}WhereInput -): Promise { - return prisma.{= authEntityLower =}.findFirst({ where, include: { {= userFieldOnAuthEntityName =}: true }}); +): Promise { + const result = await prisma.{= authEntityLower =}.findFirst({ where, include: { {= userFieldOnAuthEntityName =}: true }}); + + if (result === null) { + return null; + } + + if (result.user === null) { + return null; + } + + return { ...result, user: result.user }; +} + +// PUBLIC API +export type CreateUserResult = {= userEntityUpper =} & { + auth: {= authEntityUpper =} | null } // PUBLIC API @@ -140,9 +156,7 @@ export async function createUser( providerId: ProviderId, serializedProviderData?: string, userFields?: PossibleUserFields, -): Promise<{= userEntityUpper =} & { - auth: {= authEntityUpper =} -}> { +): Promise { return prisma.{= userEntityLower =}.create({ data: { // Using any here to prevent type errors when userFields are not @@ -261,18 +275,29 @@ export async function validateAndGetUserFields( } // PUBLIC API -export function deserializeAndSanitizeProviderData( +export function getProviderData( + providerData: string, +): Omit { + return sanitizeProviderData(getProviderDataWithPassword(providerData)); +} + +// PUBLIC API +export function getProviderDataWithPassword( providerData: string, - { shouldRemovePasswordField = false }: { shouldRemovePasswordField?: boolean } = {}, ): PossibleProviderData[PN] { // NOTE: We are letting JSON.parse throw an error if the providerData is not valid JSON. - let data = JSON.parse(providerData) as PossibleProviderData[PN]; + return JSON.parse(providerData); +} - if (providerDataHasPasswordField(data) && shouldRemovePasswordField) { - delete data.hashedPassword; +function sanitizeProviderData( + providerData: PossibleProviderData[PN], +): Omit { + if (providerDataHasPasswordField(providerData)) { + const { hashedPassword, ...rest } = providerData; + return rest; + } else { + return providerData; } - - return data; } // PUBLIC API @@ -280,7 +305,7 @@ export async function sanitizeAndSerializeProviderData( providerData: PossibleProviderData[PN], ): Promise { return serializeProviderData( - await sanitizeProviderData(providerData) + await ensurePasswordIsHashed(providerData) ); } @@ -288,7 +313,7 @@ function serializeProviderData(providerData: PossiblePr return JSON.stringify(providerData); } -async function sanitizeProviderData( +async function ensurePasswordIsHashed( providerData: PossibleProviderData[PN], ): Promise { const data = { @@ -309,6 +334,6 @@ function providerDataHasPasswordField( } // PRIVATE API -export function throwInvalidCredentialsError(message?: string): void { - throw new HttpError(401, 'Invalid credentials', { message }) +export function createInvalidCredentialsError(message?: string): HttpError { + return new HttpError(401, 'Invalid credentials', { message }) } diff --git a/waspc/data/Generator/templates/sdk/wasp/auth/validation.ts b/waspc/data/Generator/templates/sdk/wasp/auth/validation.ts index 637f4203fd..3ea1e08397 100644 --- a/waspc/data/Generator/templates/sdk/wasp/auth/validation.ts +++ b/waspc/data/Generator/templates/sdk/wasp/auth/validation.ts @@ -6,7 +6,7 @@ const EMAIL_FIELD = 'email'; const TOKEN_FIELD = 'token'; // PUBLIC API -export function ensureValidEmail(args: unknown): void { +export function ensureValidEmail(args: object): void { validate(args, [ { validates: EMAIL_FIELD, message: 'email must be present', validator: email => !!email }, { validates: EMAIL_FIELD, message: 'email must be a valid email', validator: email => isValidEmail(email) }, @@ -14,21 +14,21 @@ export function ensureValidEmail(args: unknown): void { } // PUBLIC API -export function ensureValidUsername(args: unknown): void { +export function ensureValidUsername(args: object): void { validate(args, [ { validates: USERNAME_FIELD, message: 'username must be present', validator: username => !!username } ]); } // PUBLIC API -export function ensurePasswordIsPresent(args: unknown): void { +export function ensurePasswordIsPresent(args: object): void { validate(args, [ { validates: PASSWORD_FIELD, message: 'password must be present', validator: password => !!password }, ]); } // PUBLIC API -export function ensureValidPassword(args: unknown): void { +export function ensureValidPassword(args: object): void { validate(args, [ { validates: PASSWORD_FIELD, message: 'password must be at least 8 characters', validator: password => isMinLength(password, 8) }, { validates: PASSWORD_FIELD, message: 'password must contain a number', validator: password => containsNumber(password) }, @@ -36,7 +36,7 @@ export function ensureValidPassword(args: unknown): void { } // PUBLIC API -export function ensureTokenIsPresent(args: unknown): void { +export function ensureTokenIsPresent(args: object): void { validate(args, [ { validates: TOKEN_FIELD, message: 'token must be present', validator: token => !!token }, ]); @@ -47,7 +47,7 @@ export function throwValidationError(message: string): void { throw new HttpError(422, 'Validation failed', { message }) } -function validate(args: unknown, validators: { validates: string, message: string, validator: (value: unknown) => boolean }[]): void { +function validate(args: object, validators: { validates: string, message: string, validator: (value: unknown) => boolean }[]): void { for (const { validates, message, validator } of validators) { if (!validator(args[validates])) { throwValidationError(message); diff --git a/waspc/data/Generator/templates/sdk/wasp/client/config.ts b/waspc/data/Generator/templates/sdk/wasp/client/config.ts index de0ab28387..39b620af01 100644 --- a/waspc/data/Generator/templates/sdk/wasp/client/config.ts +++ b/waspc/data/Generator/templates/sdk/wasp/client/config.ts @@ -1,5 +1,5 @@ {{={= =}=}} -import { stripTrailingSlash } from 'wasp/universal/url' +import { stripTrailingSlash } from '../universal/url.js' const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || '{= defaultServerUrl =}'; diff --git a/waspc/data/Generator/templates/sdk/wasp/client/operations/hooks.ts b/waspc/data/Generator/templates/sdk/wasp/client/operations/hooks.ts index 0f03f3167a..7ac0aac46d 100644 --- a/waspc/data/Generator/templates/sdk/wasp/client/operations/hooks.ts +++ b/waspc/data/Generator/templates/sdk/wasp/client/operations/hooks.ts @@ -28,8 +28,12 @@ export function useQuery( return rqUseQuery({ // todo: The full queryCacheKey is constructed in two places, both here and // inside the Query. See https://github.com/wasp-lang/wasp/issues/2017 - queryKey: makeQueryCacheKey(query, queryFnArgs), - queryFn: () => query(queryFnArgs), + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryKey: makeQueryCacheKey(query, (queryFnArgs as Input)), + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryFn: () => query(queryFnArgs as Input), ...options, }) } @@ -138,7 +142,7 @@ type InternalOptimisticUpdateDefinition = { * the current state of the cache and returns the desired (new) state of the * cache. */ -type SpecificUpdateQuery = (oldData: CachedData) => CachedData; +type SpecificUpdateQuery = (oldData: CachedData | undefined) => CachedData; /** * A specific, "instantiated" optimistic update definition which contains a @@ -170,7 +174,7 @@ function translateToInternalDefinition( ): InternalOptimisticUpdateDefinition { const { getQuerySpecifier, updateQuery } = publicOptimisticUpdateDefinition; - const definitionErrors = []; + const definitionErrors: string[] = []; if (typeof getQuerySpecifier !== "function") { definitionErrors.push("`getQuerySpecifier` is not a function."); } @@ -204,7 +208,7 @@ function makeOptimisticUpdateMutationFn( CachedData >[] ): typeof actionFn { - return (function performActionWithOptimisticUpdates(item?: Input) { + return (function performActionWithOptimisticUpdates(item: Input) { const specificOptimisticUpdateDefinitions = optimisticUpdateDefinitions.map( (generalDefinition) => getOptimisticUpdateDefinitionForSpecificItem(generalDefinition, item) @@ -259,10 +263,10 @@ function makeRqOptimisticUpdateOptions( ); // We're using a Map to correctly serialize query keys that contain objects. - const previousData = new Map(); + const previousData: Map = new Map(); specificOptimisticUpdateDefinitions.forEach(({ queryKey, updateQuery }) => { // Snapshot the currently cached value. - const previousDataForQuery: CachedData = + const previousDataForQuery: CachedData | undefined = queryClient.getQueryData(queryKey); // Attempt to optimistically update the cache using the new value. diff --git a/waspc/data/Generator/templates/sdk/wasp/client/operations/internal/index.ts b/waspc/data/Generator/templates/sdk/wasp/client/operations/internal/index.ts index 28c9ceef98..17bc0e8abf 100644 --- a/waspc/data/Generator/templates/sdk/wasp/client/operations/internal/index.ts +++ b/waspc/data/Generator/templates/sdk/wasp/client/operations/internal/index.ts @@ -15,7 +15,7 @@ export async function callOperation(operationRoute: OperationRoute, args: any) { const response = await api.post(operationRoute.path, superjsonArgs) return superjsonDeserialize(response.data) } catch (error) { - handleApiError(error) + throw handleApiError(error) } } diff --git a/waspc/data/Generator/templates/sdk/wasp/core/auth.ts b/waspc/data/Generator/templates/sdk/wasp/core/auth.ts index 8a7f3efc2a..fcc3303b16 100644 --- a/waspc/data/Generator/templates/sdk/wasp/core/auth.ts +++ b/waspc/data/Generator/templates/sdk/wasp/core/auth.ts @@ -1,6 +1,6 @@ import { handleRejection } from 'wasp/server/utils' import { getSessionAndUserFromBearerToken } from 'wasp/auth/session' -import { throwInvalidCredentialsError } from 'wasp/auth/utils' +import { createInvalidCredentialsError } from 'wasp/auth/utils' /** * Auth middleware @@ -28,7 +28,7 @@ const auth = handleRejection(async (req, res, next) => { const sessionAndUser = await getSessionAndUserFromBearerToken(req) if (sessionAndUser === null) { - throwInvalidCredentialsError() + throw createInvalidCredentialsError() } req.sessionId = sessionAndUser.session.id diff --git a/waspc/data/Generator/templates/sdk/wasp/server/HttpError.ts b/waspc/data/Generator/templates/sdk/wasp/server/HttpError.ts index 3e8d3f5a0d..d05a2c841b 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/HttpError.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/HttpError.ts @@ -2,8 +2,8 @@ export class HttpError extends Error { public statusCode: number public data: unknown - constructor (statusCode: number, message?: string, data?: Record, ...params: unknown[]) { - super(message, ...params) + constructor (statusCode: number, message?: string, data?: Record, options?: ErrorOptions) { + super(message, options) if (Error.captureStackTrace) { Error.captureStackTrace(this, HttpError) diff --git a/waspc/data/Generator/templates/sdk/wasp/server/auth/email/utils.ts b/waspc/data/Generator/templates/sdk/wasp/server/auth/email/utils.ts index 2d07a706bd..17cd82a436 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/auth/email/utils.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/auth/email/utils.ts @@ -6,7 +6,7 @@ import { createProviderId, updateAuthIdentityProviderData, findAuthIdentity, - deserializeAndSanitizeProviderData, + getProviderDataWithPassword, type EmailProviderData, } from 'wasp/auth/utils'; import { config as waspServerConfig } from 'wasp/server'; @@ -64,7 +64,12 @@ async function sendEmailAndSaveMetadata( // so the user can't send multiple requests while the email is being sent. const providerId = createProviderId("email", email); const authIdentity = await findAuthIdentity(providerId); - const providerData = deserializeAndSanitizeProviderData<'email'>(authIdentity.providerData); + + if (!authIdentity) { + throw new Error(`User with email: ${email} not found.`); + } + + const providerData = getProviderDataWithPassword<'email'>(authIdentity.providerData); await updateAuthIdentityProviderData<'email'>(providerId, providerData, metadata); emailSender.send(content).catch((e) => { diff --git a/waspc/data/Generator/templates/sdk/wasp/server/auth/hooks.ts b/waspc/data/Generator/templates/sdk/wasp/server/auth/hooks.ts index 67b1f2431c..bbb3ab23d8 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/auth/hooks.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/auth/hooks.ts @@ -1,6 +1,6 @@ {{={= =}=}} import type { Request as ExpressRequest } from 'express' -import { type ProviderId, createUser, findAuthWithUserBy } from '../../auth/utils.js' +import { type ProviderId, type CreateUserResult, type FindAuthWithUserResult } from '../../auth/utils.js' import { prisma } from '../index.js' import { Expand } from '../../universal/types.js' @@ -65,7 +65,7 @@ type OnAfterSignupHookParams = { /** * User object that was created during the signup process. */ - user: Awaited> + user: CreateUserResult /** * OAuth flow data that was generated during the OAuth flow. This is only * available if the user signed up using OAuth. @@ -100,7 +100,7 @@ type OnBeforeLoginHookParams = { /** * User that is trying to log in. */ - user: Awaited>['user'] + user: FindAuthWithUserResult['user'] /** * Request object that can be used to access the incoming request. */ @@ -115,7 +115,7 @@ type OnAfterLoginHookParams = { /** * User that is logged in. */ - user: Awaited>['user'] + user: FindAuthWithUserResult['user'] /** * OAuth flow data that was generated during the OAuth flow. This is only * available if the user logged in using OAuth. diff --git a/waspc/data/Generator/templates/sdk/wasp/server/auth/index.ts b/waspc/data/Generator/templates/sdk/wasp/server/auth/index.ts index 945793b0bc..406fc78ef7 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/auth/index.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/auth/index.ts @@ -7,9 +7,11 @@ export { createProviderId, sanitizeAndSerializeProviderData, updateAuthIdentityProviderData, - deserializeAndSanitizeProviderData, + getProviderData, + getProviderDataWithPassword, findAuthIdentity, createUser, + type CreateUserResult, type ProviderId, type ProviderName, type EmailProviderData, diff --git a/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/redirect.ts b/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/redirect.ts index 415459bf17..664b2cf635 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/redirect.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/auth/oauth/redirect.ts @@ -39,5 +39,5 @@ function getRedirectUriForError(error: string): URL { } function isHttpErrorWithExtraMessage(error: HttpError): error is HttpError & { data: { message: string } } { - return error.data && typeof (error.data as any).message === 'string'; + return !!error.data && typeof (error.data as any).message === 'string'; } diff --git a/waspc/data/Generator/templates/sdk/wasp/server/auth/user.ts b/waspc/data/Generator/templates/sdk/wasp/server/auth/user.ts index 96ebf3c0fa..b95bf06293 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/auth/user.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/auth/user.ts @@ -6,7 +6,7 @@ import { } from '../../entities/index.js' import { type PossibleProviderData, - deserializeAndSanitizeProviderData + getProviderData, } from '../../auth/utils.js' import { type ProviderName } from '../_types/index.js' import { Expand } from '../../universal/types.js' @@ -129,9 +129,7 @@ function getProviderInfo( return null } return { - ...deserializeAndSanitizeProviderData(identity.providerData, { - shouldRemovePasswordField: true, - }), + ...getProviderData(identity.providerData), id: identity.providerUserId, } } diff --git a/waspc/data/Generator/templates/sdk/wasp/server/config.ts b/waspc/data/Generator/templates/sdk/wasp/server/config.ts index a247438a64..01f9622c08 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/config.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/config.ts @@ -1,9 +1,9 @@ {{={= =}=}} import merge from 'lodash.merge' -import { stripTrailingSlash } from "wasp/universal/url"; +import { stripTrailingSlash } from "../universal/url.js"; -const env = process.env.NODE_ENV || 'development' +const nodeEnv = process.env.NODE_ENV ?? 'development' // TODO: // - Use dotenv library to consume env vars from a file. @@ -39,9 +39,9 @@ const config: { production: EnvConfig, } = { all: { - env, - isDevelopment: env === 'development', - port: parseInt(process.env.PORT) || {= defaultServerPort =}, + env: nodeEnv, + isDevelopment: nodeEnv === 'development', + port: process.env.PORT ? parseInt(process.env.PORT) : {= defaultServerPort =}, databaseUrl: process.env.{= databaseUrlEnvVarName =}, allowedCORSOrigins: [], {=# isAuthEnabled =} @@ -54,15 +54,17 @@ const config: { production: getProductionConfig(), } -const resolvedConfig: Config = merge(config.all, config[env]) +const resolvedConfig: Config = merge(config.all, config[nodeEnv]) // PUBLIC API export default resolvedConfig function getDevelopmentConfig(): EnvConfig { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL || '{= defaultClientUrl =}'); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL || '{= defaultServerUrl =}'); + const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL ?? '{= defaultClientUrl =}'); + const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL ?? '{= defaultServerUrl =}'); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, allowedCORSOrigins: '*', {=# isAuthEnabled =} @@ -77,8 +79,11 @@ function getProductionConfig(): EnvConfig { const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, + // @ts-ignore allowedCORSOrigins: [frontendUrl], {=# isAuthEnabled =} auth: { diff --git a/waspc/data/Generator/templates/sdk/wasp/server/email/index.ts b/waspc/data/Generator/templates/sdk/wasp/server/email/index.ts index fa0712469a..41a30c8871 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/email/index.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/email/index.ts @@ -2,27 +2,29 @@ import { initEmailSender } from "./core/index.js"; import { EmailSender } from "./core/types.js"; +// TODO: We need to validate all the env variables +// For now, we are letting the runtime throw if they are not provided {=# isSmtpProviderUsed =} -const emailProvider = { +const emailProvider = { type: "smtp", - host: process.env.SMTP_HOST, - port: parseInt(process.env.SMTP_PORT, 10), - username: process.env.SMTP_USERNAME, - password: process.env.SMTP_PASSWORD, + host: process.env.SMTP_HOST!, + port: parseInt(process.env.SMTP_PORT!, 10), + username: process.env.SMTP_USERNAME!, + password: process.env.SMTP_PASSWORD!, } as const; {=/ isSmtpProviderUsed =} {=# isSendGridProviderUsed =} const emailProvider = { type: "sendgrid", - apiKey: process.env.SENDGRID_API_KEY, + apiKey: process.env.SENDGRID_API_KEY!, } as const; {=/ isSendGridProviderUsed =} {=# isMailgunProviderUsed =} const emailProvider = { type: "mailgun", - apiKey: process.env.MAILGUN_API_KEY, - domain: process.env.MAILGUN_DOMAIN, - apiUrl: process.env.MAILGUN_API_URL, + apiKey: process.env.MAILGUN_API_KEY!, + domain: process.env.MAILGUN_DOMAIN!, + apiUrl: process.env.MAILGUN_API_URL!, } as const; {=/ isMailgunProviderUsed =} {=# isDummyProviderUsed =} diff --git a/waspc/data/Generator/templates/sdk/wasp/server/jobs/_job.ts b/waspc/data/Generator/templates/sdk/wasp/server/jobs/_job.ts index 6dac4edc0d..5ecc6be306 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/jobs/_job.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/jobs/_job.ts @@ -12,10 +12,28 @@ const entities = { // PUBLIC API export type {= typeName =} = JobFn +{=# jobSchedule.isDefined =} +const jobSchedule = { + cron: "{= jobSchedule.cron =}", + {=# jobSchedule.args.isDefined =} + args: {=& jobSchedule.args.json =}, + {=/ jobSchedule.args.isDefined =} + {=# jobSchedule.options.isDefined =} + options: {=& jobSchedule.options.json =}, + {=/ jobSchedule.options.isDefined =} + {=^ jobSchedule.options.isDefined =} + options: {}, + {=/ jobSchedule.options.isDefined =} +} +{=/ jobSchedule.isDefined =} +{=^ jobSchedule.isDefined =} +const jobSchedule = null +{=/ jobSchedule.isDefined =} + // PUBLIC API export const {= jobName =} = createJobDefinition({ jobName: '{= jobName =}', defaultJobOptions: {=& jobPerformOptions =}, - jobSchedule: {=& jobSchedule =}, + jobSchedule, entities, }) diff --git a/waspc/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts b/waspc/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts index 42435db213..d545566ab6 100644 --- a/waspc/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts +++ b/waspc/data/Generator/templates/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts @@ -9,8 +9,8 @@ export const PG_BOSS_EXECUTOR_NAME = Symbol('PgBoss') type JobSchedule = { cron: Parameters[1] - args: Parameters[2] options: Parameters[3] + args?: NonNullable[2]> } // PRIVATE API @@ -29,11 +29,11 @@ export function createJobDefinition< entities, }: { // jobName - The user-defined job name in their .wasp file. - jobName: Parameters[0] + jobName: PgBossJob['jobName'] // defaultJobOptions - pg-boss specific options for `boss.send()` applied to every `submit()` invocation, // which can overriden in that call. - defaultJobOptions: PgBoss.Schedule['options'] - jobSchedule: JobSchedule | null + defaultJobOptions: PgBossJob['defaultJobOptions'] + jobSchedule: PgBossJob['jobSchedule'] // Entities used by job, passed into callback context. entities: Entities }) { @@ -90,7 +90,7 @@ export function registerJob< await boss.schedule( job.jobName, job.jobSchedule.cron, - job.jobSchedule.args || null, + job.jobSchedule.args, options ) } @@ -108,7 +108,7 @@ class PgBossJob< Entities extends Partial > extends Job { public readonly defaultJobOptions: Parameters[2] - public readonly startAfter: number | string | Date + public readonly startAfter: number | string | Date | undefined public readonly entities: Entities public readonly jobSchedule: JobSchedule | null diff --git a/waspc/data/Generator/templates/sdk/wasp/tsconfig.json b/waspc/data/Generator/templates/sdk/wasp/tsconfig.json index c808790cac..c6e5e1fa46 100644 --- a/waspc/data/Generator/templates/sdk/wasp/tsconfig.json +++ b/waspc/data/Generator/templates/sdk/wasp/tsconfig.json @@ -14,11 +14,11 @@ "alwaysStrict": true, "noImplicitThis": true, "strictFunctionTypes": true, + "strictNullChecks": true, // See https://github.com/wasp-lang/wasp/issues/2056 before activating this: // "useUnknownInCatchVariables": true, - // The following 3 stict options will require more work: + // The following 2 stict options will require more work: // "noImplicitAny": true, - // "strictNullChecks": true, // "strictPropertyInitialization": true, // Overriding this because we want to use top-level await "module": "esnext", diff --git a/waspc/data/Generator/templates/sdk/wasp/universal/predicates.ts b/waspc/data/Generator/templates/sdk/wasp/universal/predicates.ts new file mode 100644 index 0000000000..4294e839f0 --- /dev/null +++ b/waspc/data/Generator/templates/sdk/wasp/universal/predicates.ts @@ -0,0 +1,3 @@ +export function isNotNull(value: T | null): value is T { + return value !== null; +} diff --git a/waspc/data/Generator/templates/server/src/auth/providers/email/login.ts b/waspc/data/Generator/templates/server/src/auth/providers/email/login.ts index 4e3ddb3913..4ace8a2042 100644 --- a/waspc/data/Generator/templates/server/src/auth/providers/email/login.ts +++ b/waspc/data/Generator/templates/server/src/auth/providers/email/login.ts @@ -1,11 +1,11 @@ import { Request, Response } from 'express'; -import { throwInvalidCredentialsError } from 'wasp/auth/utils' +import { createInvalidCredentialsError } from 'wasp/auth/utils' import { verifyPassword } from 'wasp/auth/password' import { createProviderId, findAuthIdentity, findAuthWithUserBy, - deserializeAndSanitizeProviderData, + getProviderDataWithPassword, } from 'wasp/auth/utils' import { createSession } from 'wasp/auth/session' import { ensureValidEmail, ensurePasswordIsPresent } from 'wasp/auth/validation' @@ -22,19 +22,23 @@ export function getLoginRoute() { const providerId = createProviderId("email", fields.email) const authIdentity = await findAuthIdentity(providerId) if (!authIdentity) { - throwInvalidCredentialsError() + throw createInvalidCredentialsError() } - const providerData = deserializeAndSanitizeProviderData<'email'>(authIdentity.providerData) + const providerData = getProviderDataWithPassword<'email'>(authIdentity.providerData) if (!providerData.isEmailVerified) { - throwInvalidCredentialsError() + throw createInvalidCredentialsError() } try { await verifyPassword(providerData.hashedPassword, fields.password); } catch(e) { - throwInvalidCredentialsError() + throw createInvalidCredentialsError() } const auth = await findAuthWithUserBy({ id: authIdentity.authId }) + + if (auth === null) { + throw createInvalidCredentialsError() + } await onBeforeLoginHook({ req, @@ -56,7 +60,7 @@ export function getLoginRoute() { }; } -function ensureValidArgs(args: unknown): void { +function ensureValidArgs(args: object): void { ensureValidEmail(args); ensurePasswordIsPresent(args); } diff --git a/waspc/data/Generator/templates/server/src/auth/providers/email/requestPasswordReset.ts b/waspc/data/Generator/templates/server/src/auth/providers/email/requestPasswordReset.ts index 74b1168a26..78bad56f05 100644 --- a/waspc/data/Generator/templates/server/src/auth/providers/email/requestPasswordReset.ts +++ b/waspc/data/Generator/templates/server/src/auth/providers/email/requestPasswordReset.ts @@ -3,7 +3,7 @@ import { createProviderId, findAuthIdentity, doFakeWork, - deserializeAndSanitizeProviderData, + getProviderDataWithPassword, } from 'wasp/auth/utils'; import { createPasswordResetLink, @@ -46,7 +46,7 @@ export function getRequestPasswordResetRoute({ return res.json({ success: true }); } - const providerData = deserializeAndSanitizeProviderData<'email'>(authIdentity.providerData); + const providerData = getProviderDataWithPassword<'email'>(authIdentity.providerData); const { isResendAllowed, timeLeft } = isEmailResendAllowed(providerData, 'passwordResetSentAt'); if (!isResendAllowed) { throw new HttpError(400, `Please wait ${timeLeft} secs before trying again.`); diff --git a/waspc/data/Generator/templates/server/src/auth/providers/email/resetPassword.ts b/waspc/data/Generator/templates/server/src/auth/providers/email/resetPassword.ts index 7b1d479005..6fac260332 100644 --- a/waspc/data/Generator/templates/server/src/auth/providers/email/resetPassword.ts +++ b/waspc/data/Generator/templates/server/src/auth/providers/email/resetPassword.ts @@ -3,7 +3,7 @@ import { createProviderId, findAuthIdentity, updateAuthIdentityProviderData, - deserializeAndSanitizeProviderData, + getProviderDataWithPassword, } from 'wasp/auth/utils'; import { validateJWT } from 'wasp/auth/jwt' import { ensureTokenIsPresent, ensurePasswordIsPresent, ensureValidPassword } from 'wasp/auth/validation'; @@ -28,7 +28,7 @@ export async function resetPassword( throw new HttpError(400, "Password reset failed, invalid token"); } - const providerData = deserializeAndSanitizeProviderData<'email'>(authIdentity.providerData); + const providerData = getProviderDataWithPassword<'email'>(authIdentity.providerData); await updateAuthIdentityProviderData(providerId, providerData, { // The act of resetting the password verifies the email @@ -41,7 +41,7 @@ export async function resetPassword( return res.json({ success: true }); }; -function ensureValidArgs(args: unknown): void { +function ensureValidArgs(args: object): void { ensureTokenIsPresent(args); ensurePasswordIsPresent(args); ensureValidPassword(args); diff --git a/waspc/data/Generator/templates/server/src/auth/providers/email/signup.ts b/waspc/data/Generator/templates/server/src/auth/providers/email/signup.ts index ddba171153..7cc86ca48a 100644 --- a/waspc/data/Generator/templates/server/src/auth/providers/email/signup.ts +++ b/waspc/data/Generator/templates/server/src/auth/providers/email/signup.ts @@ -6,7 +6,7 @@ import { findAuthIdentity, deleteUserByAuthId, doFakeWork, - deserializeAndSanitizeProviderData, + getProviderDataWithPassword, sanitizeAndSerializeProviderData, rethrowPossibleAuthError, } from 'wasp/auth/utils' @@ -74,7 +74,7 @@ export function getSignupRoute({ * address unavailable for later account creation (by real owner). */ if (existingAuthIdentity) { - const providerData = deserializeAndSanitizeProviderData<'email'>( + const providerData = getProviderDataWithPassword<'email'>( existingAuthIdentity.providerData, ) @@ -156,7 +156,7 @@ export function getSignupRoute({ } } -function ensureValidArgs(args: unknown): void { +function ensureValidArgs(args: object): void { ensureValidEmail(args) ensurePasswordIsPresent(args) ensureValidPassword(args) diff --git a/waspc/data/Generator/templates/server/src/auth/providers/email/verifyEmail.ts b/waspc/data/Generator/templates/server/src/auth/providers/email/verifyEmail.ts index bfa2f208a4..7b2c3c48b1 100644 --- a/waspc/data/Generator/templates/server/src/auth/providers/email/verifyEmail.ts +++ b/waspc/data/Generator/templates/server/src/auth/providers/email/verifyEmail.ts @@ -3,7 +3,7 @@ import { createProviderId, findAuthIdentity, updateAuthIdentityProviderData, - deserializeAndSanitizeProviderData, + getProviderDataWithPassword, } from 'wasp/auth/utils'; import { validateJWT } from 'wasp/auth/jwt' import { HttpError } from 'wasp/server'; @@ -25,7 +25,7 @@ export async function verifyEmail( throw new HttpError(400, "Email verification failed, invalid token"); } - const providerData = deserializeAndSanitizeProviderData<'email'>(authIdentity.providerData); + const providerData = getProviderDataWithPassword<'email'>(authIdentity.providerData); await updateAuthIdentityProviderData(providerId, providerData, { isEmailVerified: true, diff --git a/waspc/data/Generator/templates/server/src/auth/providers/oauth/user.ts b/waspc/data/Generator/templates/server/src/auth/providers/oauth/user.ts index 799e615439..08a220e8f7 100644 --- a/waspc/data/Generator/templates/server/src/auth/providers/oauth/user.ts +++ b/waspc/data/Generator/templates/server/src/auth/providers/oauth/user.ts @@ -85,6 +85,10 @@ async function getAuthIdFromProviderDetails({ // but we wanted to keep the onAfterLoginHook params consistent for all auth providers. const auth = await findAuthWithUserBy({ id: authId }) + if (auth === null) { + throw new Error('Auth entity not found while trying to log in with OAuth') + } + // NOTE: We are calling login hooks here even though we didn't log in the user yet. // It's because we have access to the OAuth tokens here and we want to pass them to the hooks. // We could have stored the tokens temporarily and called the hooks after the session is created, diff --git a/waspc/data/Generator/templates/server/src/auth/providers/username/login.ts b/waspc/data/Generator/templates/server/src/auth/providers/username/login.ts index e45aecfae5..863aa1735c 100644 --- a/waspc/data/Generator/templates/server/src/auth/providers/username/login.ts +++ b/waspc/data/Generator/templates/server/src/auth/providers/username/login.ts @@ -1,5 +1,5 @@ {{={= =}=}} -import { throwInvalidCredentialsError } from 'wasp/auth/utils' +import { createInvalidCredentialsError } from 'wasp/auth/utils' import { handleRejection } from 'wasp/server/utils' import { verifyPassword } from 'wasp/auth/password' @@ -7,7 +7,7 @@ import { createProviderId, findAuthIdentity, findAuthWithUserBy, - deserializeAndSanitizeProviderData, + getProviderDataWithPassword, } from 'wasp/auth/utils' import { createSession } from 'wasp/auth/session' import { ensureValidUsername, ensurePasswordIsPresent } from 'wasp/auth/validation' @@ -20,21 +20,25 @@ export default handleRejection(async (req, res) => { const providerId = createProviderId('username', fields.username) const authIdentity = await findAuthIdentity(providerId) if (!authIdentity) { - throwInvalidCredentialsError() + throw createInvalidCredentialsError() } try { - const providerData = deserializeAndSanitizeProviderData<'username'>(authIdentity.providerData) + const providerData = getProviderDataWithPassword<'username'>(authIdentity.providerData) await verifyPassword(providerData.hashedPassword, fields.password) } catch(e) { - throwInvalidCredentialsError() + throw createInvalidCredentialsError() } const auth = await findAuthWithUserBy({ id: authIdentity.authId }) + if (auth === null) { + throw createInvalidCredentialsError() + } + await onBeforeLoginHook({ req, providerId, @@ -54,7 +58,7 @@ export default handleRejection(async (req, res) => { }) }) -function ensureValidArgs(args: unknown): void { +function ensureValidArgs(args: object): void { ensureValidUsername(args); ensurePasswordIsPresent(args); } diff --git a/waspc/data/Generator/templates/server/src/auth/providers/username/signup.ts b/waspc/data/Generator/templates/server/src/auth/providers/username/signup.ts index 7648444652..c2e4b47a37 100644 --- a/waspc/data/Generator/templates/server/src/auth/providers/username/signup.ts +++ b/waspc/data/Generator/templates/server/src/auth/providers/username/signup.ts @@ -52,7 +52,7 @@ export function getSignupRoute({ }) } -function ensureValidArgs(args: unknown): void { +function ensureValidArgs(args: object): void { ensureValidUsername(args) ensurePasswordIsPresent(args) ensureValidPassword(args) diff --git a/waspc/data/Generator/templates/server/src/crud/_operations.ts b/waspc/data/Generator/templates/server/src/crud/_operations.ts index b1f60bc571..e76ff1cf27 100644 --- a/waspc/data/Generator/templates/server/src/crud/_operations.ts +++ b/waspc/data/Generator/templates/server/src/crud/_operations.ts @@ -2,7 +2,7 @@ import { prisma } from 'wasp/server' {=# isAuthEnabled =} -import { throwInvalidCredentialsError } from 'wasp/auth/utils' +import { createInvalidCredentialsError } from 'wasp/auth/utils' {=/ isAuthEnabled =} import type { {=# crud.operations.GetAll =} @@ -175,7 +175,7 @@ export async function deleteFn(args, context) { function throwIfNotAuthenticated (context) { {=# isAuthEnabled =} if (!context.user) { - throwInvalidCredentialsError() + throw createInvalidCredentialsError() } {=/ isAuthEnabled =} {=^ isAuthEnabled =} diff --git a/waspc/data/Generator/templates/server/src/routes/auth/logout.ts b/waspc/data/Generator/templates/server/src/routes/auth/logout.ts index 7966e56c03..e339443a17 100644 --- a/waspc/data/Generator/templates/server/src/routes/auth/logout.ts +++ b/waspc/data/Generator/templates/server/src/routes/auth/logout.ts @@ -1,5 +1,5 @@ import { handleRejection } from 'wasp/server/utils' -import { throwInvalidCredentialsError } from 'wasp/auth/utils' +import { createInvalidCredentialsError } from 'wasp/auth/utils' import { invalidateSession } from 'wasp/auth/session' export default handleRejection(async (req, res) => { @@ -7,6 +7,6 @@ export default handleRejection(async (req, res) => { await invalidateSession(req.sessionId) return res.json({ success: true }) } else { - throwInvalidCredentialsError() + throw createInvalidCredentialsError() } }) diff --git a/waspc/data/Generator/templates/server/src/routes/auth/me.ts b/waspc/data/Generator/templates/server/src/routes/auth/me.ts index 8c182835d1..ad379d14a5 100644 --- a/waspc/data/Generator/templates/server/src/routes/auth/me.ts +++ b/waspc/data/Generator/templates/server/src/routes/auth/me.ts @@ -1,11 +1,11 @@ import { serialize as superjsonSerialize } from 'superjson' import { handleRejection } from 'wasp/server/utils' -import { throwInvalidCredentialsError } from 'wasp/auth/utils' +import { createInvalidCredentialsError } from 'wasp/auth/utils' export default handleRejection(async (req, res) => { if (req.user) { return res.json(superjsonSerialize(req.user)) } else { - throwInvalidCredentialsError() + throw createInvalidCredentialsError() } }) diff --git a/waspc/data/Generator/templates/server/src/webSocket/initialization.ts b/waspc/data/Generator/templates/server/src/webSocket/initialization.ts index 08d942f4e1..6489e8bafc 100644 --- a/waspc/data/Generator/templates/server/src/webSocket/initialization.ts +++ b/waspc/data/Generator/templates/server/src/webSocket/initialization.ts @@ -43,7 +43,7 @@ async function addUserToSocketDataIfAuthenticated(socket: Socket, next: (err?: E const sessionId = socket.handshake.auth.sessionId if (sessionId) { try { - const sessionAndUser = await getSessionAndUserFromSessionId(sessionId) + const sessionAndUser = await getSessionAndUserFromSessionId(sessionId) const user = sessionAndUser ? makeAuthUserIfPossible(sessionAndUser.user) : null socket.data = { ...socket.data, diff --git a/waspc/e2e-test/Tests/WaspJobTest.hs b/waspc/e2e-test/Tests/WaspJobTest.hs index 00aa16179a..36516a7ec3 100644 --- a/waspc/e2e-test/Tests/WaspJobTest.hs +++ b/waspc/e2e-test/Tests/WaspJobTest.hs @@ -16,25 +16,64 @@ import Wasp.Project.Db (databaseUrlEnvVarName) waspJob :: GoldenTest waspJob = do - let jobDecl = - " job mySpecialJob { \n\ - \ executor: PgBoss, \n\ - \ perform: { \n\ - \ fn: import { foo } from \"@src/server/jobs/bar.js\" \n\ - \ } \n\ - \ } \n" + let simpleJobDecl = + unlines + [ "job simpleJob {", + " executor: PgBoss,", + " perform: {", + " fn: import { foo } from \"@src/server/jobs/bar.js\"", + " },", + "}" + ] + + let scheduledJobDecl = + unlines + [ "job scheduleJob {", + " executor: PgBoss,", + " perform: {", + " fn: import { foo } from \"@src/server/jobs/bar.js\"", + " },", + " schedule: {", + " cron: \"0 * * * *\",", + " executorOptions: {", + " pgBoss: {=json { \"retryLimit\": 2 } json=}", + " }", + " }", + "}" + ] + + let scheduledJobWithArgsDecl = + unlines + [ "job scheduledJobWithArgs {", + " executor: PgBoss,", + " perform: {", + " fn: import { foo } from \"@src/server/jobs/bar.js\"", + " },", + " schedule: {", + " cron: \"0 * * * *\",", + " args: {=json { \"foo\": \"bar\" } json=},", + " executorOptions: {", + " pgBoss: {=json { \"retryLimit\": 2 } json=}", + " }", + " }", + "}" + ] let jobFile = - " export const foo = async (args) => { \n\ - \ return 1 \n\ - \ } \n" + unlines + [ "export const foo = async (args) => {", + " return 1", + "}" + ] makeGoldenTest "waspJob" $ sequence [ waspCliNew, cdIntoCurrentProject, setDbToPSQL, - appendToWaspFile jobDecl, + appendToWaspFile simpleJobDecl, + appendToWaspFile scheduledJobDecl, + appendToWaspFile scheduledJobWithArgsDecl, createFile jobFile "./src/server/jobs" "bar.js" ] <++> addServerEnvFile diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest b/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest index 1ef46f2f24..55670c2900 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/files.manifest @@ -153,6 +153,9 @@ waspBuild/.wasp/build/sdk/wasp/dist/server/types/index.js.map waspBuild/.wasp/build/sdk/wasp/dist/server/utils.d.ts waspBuild/.wasp/build/sdk/wasp/dist/server/utils.js waspBuild/.wasp/build/sdk/wasp/dist/server/utils.js.map +waspBuild/.wasp/build/sdk/wasp/dist/universal/predicates.d.ts +waspBuild/.wasp/build/sdk/wasp/dist/universal/predicates.js +waspBuild/.wasp/build/sdk/wasp/dist/universal/predicates.js.map waspBuild/.wasp/build/sdk/wasp/dist/universal/types.d.ts waspBuild/.wasp/build/sdk/wasp/dist/universal/types.js waspBuild/.wasp/build/sdk/wasp/dist/universal/types.js.map @@ -187,6 +190,7 @@ waspBuild/.wasp/build/sdk/wasp/server/operations/wrappers.ts waspBuild/.wasp/build/sdk/wasp/server/types/index.ts waspBuild/.wasp/build/sdk/wasp/server/utils.ts waspBuild/.wasp/build/sdk/wasp/tsconfig.json +waspBuild/.wasp/build/sdk/wasp/universal/predicates.ts waspBuild/.wasp/build/sdk/wasp/universal/types.ts waspBuild/.wasp/build/sdk/wasp/universal/url.ts waspBuild/.wasp/build/sdk/wasp/universal/validators.ts @@ -382,6 +386,9 @@ waspBuild/.wasp/out/sdk/wasp/dist/server/types/index.js.map waspBuild/.wasp/out/sdk/wasp/dist/server/utils.d.ts waspBuild/.wasp/out/sdk/wasp/dist/server/utils.js waspBuild/.wasp/out/sdk/wasp/dist/server/utils.js.map +waspBuild/.wasp/out/sdk/wasp/dist/universal/predicates.d.ts +waspBuild/.wasp/out/sdk/wasp/dist/universal/predicates.js +waspBuild/.wasp/out/sdk/wasp/dist/universal/predicates.js.map waspBuild/.wasp/out/sdk/wasp/dist/universal/types.d.ts waspBuild/.wasp/out/sdk/wasp/dist/universal/types.js waspBuild/.wasp/out/sdk/wasp/dist/universal/types.js.map @@ -416,6 +423,7 @@ waspBuild/.wasp/out/sdk/wasp/server/operations/wrappers.ts waspBuild/.wasp/out/sdk/wasp/server/types/index.ts waspBuild/.wasp/out/sdk/wasp/server/utils.ts waspBuild/.wasp/out/sdk/wasp/tsconfig.json +waspBuild/.wasp/out/sdk/wasp/universal/predicates.ts waspBuild/.wasp/out/sdk/wasp/universal/types.ts waspBuild/.wasp/out/sdk/wasp/universal/url.ts waspBuild/.wasp/out/sdk/wasp/universal/validators.ts diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/.waspchecksums b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/.waspchecksums index d277902ebc..e6032f38d6 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/.waspchecksums +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/.waspchecksums @@ -11,14 +11,14 @@ "file", "../out/sdk/wasp/api/index.ts" ], - "5784ba365e8a5cb2031571cfebf1cbae8670f86f8e5a596b133d333cdf6c91eb" + "2c300f215d89a72dad5e7a766dd97a64aa85b19126c96708487201b9b08a94f9" ], [ [ "file", "../out/sdk/wasp/client/config.ts" ], - "bc7d48bd7ec4cdf74f85b98113eb26e670ef265ca4bbd735e361409c9335ad85" + "d94e8bee5fd8f6793b511652b9ee558e57f4913595763137a5385cd929648168" ], [ [ @@ -46,7 +46,7 @@ "file", "../out/sdk/wasp/client/operations/hooks.ts" ], - "d1a8fccfb8207476b90708e8285d1455b33ff4e446749b33c3eb1a54dcfe2d41" + "3c326183d9dcb2bcf14b747ffc66b19e4773642d05f3f84d401e3d54b843eeca" ], [ [ @@ -60,7 +60,7 @@ "file", "../out/sdk/wasp/client/operations/internal/index.ts" ], - "f08a4f1fb1f897edca465b3f228215e06418109fb439232e8fa0ffdbdc98b833" + "d710d9894f56194c0d87921f339100414c69b987f1f5221881ca372fd70be371" ], [ [ @@ -214,7 +214,7 @@ "file", "../out/sdk/wasp/server/HttpError.ts" ], - "eaa296c30acc65c78b90ebdf9a1d6fdb863f0c26c743d352afaeaa3bbc2fdd1b" + "f375fb45eeb16381b8cc575503db302c005ddaa1b35d837ca0ea043fe8ec6ccb" ], [ [ @@ -242,7 +242,7 @@ "file", "../out/sdk/wasp/server/config.ts" ], - "e5388a9259a22671ee2d2ef46d2c09fdd46c3b3ec24248c7a0b471c0fbf7aa54" + "5dd35660e0969defaa3c180179919f4922ab7bc041746872dff7f2280c1872ae" ], [ [ @@ -333,7 +333,14 @@ "file", "../out/sdk/wasp/tsconfig.json" ], - "4323884e7e8c52683788995be58e8f583c00fc611845fdbd481157d0118dccd2" + "3b09df60f6728880a953a746ef887e045de0b533cb383f89d6adf8ff906edac8" + ], + [ + [ + "file", + "../out/sdk/wasp/universal/predicates.ts" + ], + "baa4148fdf4995cfc154a81bc494e9e8077635d4db50958d5b59837d1b8ed691" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/api/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/api/index.ts index 6037b3048c..c8895b1275 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/api/index.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/api/index.ts @@ -77,7 +77,7 @@ window.addEventListener('storage', (event) => { * standard format to be further used by the client. It is also assumed that given API * error has been formatted as implemented by HttpError on the server. */ -export function handleApiError(error: AxiosError<{ message?: string, data?: unknown }>): void { +export function handleApiError>(error: T): T | WaspHttpError { if (error?.response) { // If error came from HTTP response, we capture most informative message // and also add .statusCode information to it. @@ -88,10 +88,10 @@ export function handleApiError(error: AxiosError<{ message?: string, data?: unkn // That would require copying HttpError code to web-app also and using it here. const responseJson = error.response?.data const responseStatusCode = error.response.status - throw new WaspHttpError(responseStatusCode, responseJson?.message ?? error.message, responseJson) + return new WaspHttpError(responseStatusCode, responseJson?.message ?? error.message, responseJson) } else { // If any other error, we just propagate it. - throw error + return error } } diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/config.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/config.ts index 2f9967891e..82b0f80b6a 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/config.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/config.ts @@ -1,4 +1,4 @@ -import { stripTrailingSlash } from 'wasp/universal/url' +import { stripTrailingSlash } from '../universal/url.js' const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/hooks.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/hooks.ts index 0f03f3167a..7ac0aac46d 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/hooks.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/hooks.ts @@ -28,8 +28,12 @@ export function useQuery( return rqUseQuery({ // todo: The full queryCacheKey is constructed in two places, both here and // inside the Query. See https://github.com/wasp-lang/wasp/issues/2017 - queryKey: makeQueryCacheKey(query, queryFnArgs), - queryFn: () => query(queryFnArgs), + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryKey: makeQueryCacheKey(query, (queryFnArgs as Input)), + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryFn: () => query(queryFnArgs as Input), ...options, }) } @@ -138,7 +142,7 @@ type InternalOptimisticUpdateDefinition = { * the current state of the cache and returns the desired (new) state of the * cache. */ -type SpecificUpdateQuery = (oldData: CachedData) => CachedData; +type SpecificUpdateQuery = (oldData: CachedData | undefined) => CachedData; /** * A specific, "instantiated" optimistic update definition which contains a @@ -170,7 +174,7 @@ function translateToInternalDefinition( ): InternalOptimisticUpdateDefinition { const { getQuerySpecifier, updateQuery } = publicOptimisticUpdateDefinition; - const definitionErrors = []; + const definitionErrors: string[] = []; if (typeof getQuerySpecifier !== "function") { definitionErrors.push("`getQuerySpecifier` is not a function."); } @@ -204,7 +208,7 @@ function makeOptimisticUpdateMutationFn( CachedData >[] ): typeof actionFn { - return (function performActionWithOptimisticUpdates(item?: Input) { + return (function performActionWithOptimisticUpdates(item: Input) { const specificOptimisticUpdateDefinitions = optimisticUpdateDefinitions.map( (generalDefinition) => getOptimisticUpdateDefinitionForSpecificItem(generalDefinition, item) @@ -259,10 +263,10 @@ function makeRqOptimisticUpdateOptions( ); // We're using a Map to correctly serialize query keys that contain objects. - const previousData = new Map(); + const previousData: Map = new Map(); specificOptimisticUpdateDefinitions.forEach(({ queryKey, updateQuery }) => { // Snapshot the currently cached value. - const previousDataForQuery: CachedData = + const previousDataForQuery: CachedData | undefined = queryClient.getQueryData(queryKey); // Attempt to optimistically update the cache using the new value. diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/internal/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/internal/index.ts index 28c9ceef98..17bc0e8abf 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/internal/index.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/client/operations/internal/index.ts @@ -15,7 +15,7 @@ export async function callOperation(operationRoute: OperationRoute, args: any) { const response = await api.post(operationRoute.path, superjsonArgs) return superjsonDeserialize(response.data) } catch (error) { - handleApiError(error) + throw handleApiError(error) } } diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.d.ts index c39a409f75..6971aac805 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.d.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.d.ts @@ -9,7 +9,13 @@ export declare function removeLocalUserData(): void; * standard format to be further used by the client. It is also assumed that given API * error has been formatted as implemented by HttpError on the server. */ -export declare function handleApiError(error: AxiosError<{ +export declare function handleApiError): void; +}>>(error: T): T | WaspHttpError; +declare class WaspHttpError extends Error { + statusCode: number; + data: unknown; + constructor(statusCode: number, message: string, data: unknown); +} +export {}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.js index 07e05c03f9..df5d608aa4 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.js @@ -79,11 +79,11 @@ export function handleApiError(error) { // That would require copying HttpError code to web-app also and using it here. const responseJson = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data; const responseStatusCode = error.response.status; - throw new WaspHttpError(responseStatusCode, (_b = responseJson === null || responseJson === void 0 ? void 0 : responseJson.message) !== null && _b !== void 0 ? _b : error.message, responseJson); + return new WaspHttpError(responseStatusCode, (_b = responseJson === null || responseJson === void 0 ? void 0 : responseJson.message) !== null && _b !== void 0 ? _b : error.message, responseJson); } else { // If any other error, we just propagate it. - throw error; + return error; } } class WaspHttpError extends Error { diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.js.map index 86433530c0..239cd44a19 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/api/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAA8C,MAAM,OAAO,CAAA;AAElE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE9C,aAAa;AACb,MAAM,CAAC,MAAM,GAAG,GAAkB,KAAK,CAAC,MAAM,CAAC;IAC7C,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CAAC,CAAA;AAEF,MAAM,6BAA6B,GAAG,WAAW,CAAA;AAEjD,IAAI,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAuB,CAAA;AAE3F,oBAAoB;AACpB,MAAM,UAAU,YAAY,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C;QACpB,wEAAwE;QACxE,8CAA8C;QAC9C,8EAA8E;QAC9E,8BAA8B;QAC9B,yEAAyE;QACzE,iEAAiE;QACjE,iFAAiF;QACjF,MAAM,YAAY,GAAG,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI,CAAA;QACzC,MAAM,kBAAkB,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAA;QAChD,OAAO,IAAI,aAAa,CAAC,kBAAkB,EAAE,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,mCAAI,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;IACpG,CAAC;SAAM,CAAC;QACN,4CAA4C;QAC5C,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAED,MAAM,aAAc,SAAQ,KAAK;IAK/B,YAAa,UAAkB,EAAE,OAAe,EAAE,IAAa;QAC7D,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;CACF"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/config.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/config.js index 74f4f78c97..1dffbd68bc 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/config.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/config.js @@ -1,4 +1,4 @@ -import { stripTrailingSlash } from 'wasp/universal/url'; +import { stripTrailingSlash } from '../universal/url.js'; const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; // PUBLIC API export const config = { diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/config.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/config.js.map index 82b7a8d169..d26d37022b 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/config.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAEvD,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,uBAAuB,CAAC;AAOhG,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAExD,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,uBAAuB,CAAC;AAOhG,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/hooks.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/hooks.js index 723993357c..d20d1f0588 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/hooks.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/hooks.js @@ -12,7 +12,12 @@ export function useQuery(query, queryFnArgs, options) { return rqUseQuery(Object.assign({ // todo: The full queryCacheKey is constructed in two places, both here and // inside the Query. See https://github.com/wasp-lang/wasp/issues/2017 - queryKey: makeQueryCacheKey(query, queryFnArgs), queryFn: () => query(queryFnArgs) }, options)); + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryKey: makeQueryCacheKey(query, queryFnArgs), + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryFn: () => query(queryFnArgs) }, options)); } // PUBLIC API /** diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/hooks.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/hooks.js.map index 40d9188b06..11ab1e3495 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/hooks.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/hooks.js.map @@ -1 +1 @@ -{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../client/operations/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EAEX,cAAc,EACd,QAAQ,IAAI,UAAU,GAEvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,aAAa;AACb,MAAM,UAAU,QAAQ,CACtB,KAA2B,EAC3B,WAAmB,EACnB,OAAa;IAEb,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,6CAA6C,CAAC,CAAA;IACpE,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QACzB,MAAM,IAAI,SAAS,CAAC,uDAAuD,CAAC,CAA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AC;QAC3B,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC;KAC7C,CAAC;AACJ,CAAC;AAED,qEAAqE;AACrE,+EAA+E;AAC/E;;;;;;GAMG;AACH,SAAS,0BAA0B,CACjC,cAAgD;IAEhD,MAAM,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,GAAG,cAAc,CAAC;IAC/C,OAAO,CAAC,GAAI,OAAe,CAAC,aAAa,EAAE,GAAG,SAAS,CAAC,CAAC;AAC3D,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.js index 68bbdadf3d..13e1dcb655 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.js @@ -9,7 +9,7 @@ export async function callOperation(operationRoute, args) { return superjsonDeserialize(response.data); } catch (error) { - handleApiError(error); + throw handleApiError(error); } } // PRIVATE API diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.js.map index 23d9e480d1..d271983a05 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/client/operations/internal/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../client/operations/internal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EACL,SAAS,IAAI,kBAAkB,EAC/B,WAAW,IAAI,oBAAoB,GACnC,MAAM,WAAW,CAAA;AAKnB,cAAc;AACd,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,cAA8B,EAAE,IAAS;IAC3E,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAC9C,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;QACnE,OAAO,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,cAAc,CAAC,KAAK,CAAC,CAAA;IACvB,CAAC;AACH,CAAC;AAED,cAAc;AACd,MAAM,UAAU,kBAAkB,CAAC,sBAA8B;IAC/D,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,sBAAsB,EAAE,EAAE,CAAA;AACxE,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../client/operations/internal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EACL,SAAS,IAAI,kBAAkB,EAC/B,WAAW,IAAI,oBAAoB,GACnC,MAAM,WAAW,CAAA;AAKnB,cAAc;AACd,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,cAA8B,EAAE,IAAS;IAC3E,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAC9C,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;QACnE,OAAO,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,cAAc,CAAC,KAAK,CAAC,CAAA;IAC7B,CAAC;AACH,CAAC;AAED,cAAc;AACd,MAAM,UAAU,kBAAkB,CAAC,sBAA8B;IAC/D,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,sBAAsB,EAAE,EAAE,CAAA;AACxE,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.d.ts index 56b8d88eca..e40cd74ab7 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.d.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.d.ts @@ -1,5 +1,5 @@ export declare class HttpError extends Error { statusCode: number; data: unknown; - constructor(statusCode: number, message?: string, data?: Record, ...params: unknown[]); + constructor(statusCode: number, message?: string, data?: Record, options?: ErrorOptions); } diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.js index 3e216e57ce..6e91977adc 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.js @@ -1,6 +1,6 @@ export class HttpError extends Error { - constructor(statusCode, message, data, ...params) { - super(message, ...params); + constructor(statusCode, message, data, options) { + super(message, options); if (Error.captureStackTrace) { Error.captureStackTrace(this, HttpError); } diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.js.map index 3cc7095281..8163354e1b 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/HttpError.js.map @@ -1 +1 @@ -{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YAAa,UAAkB,EAAE,OAAgB,EAAE,IAA8B,EAAE,GAAG,MAAiB;QACrG,KAAK,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAA;QAEzB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EAAE,CAAC;YAC7E,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YAAa,UAAkB,EAAE,OAAgB,EAAE,IAA8B,EAAE,OAAsB;QACvG,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAEvB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EAAE,CAAC;YAC7E,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js index dabd38b4b0..e4f89082c8 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js @@ -1,25 +1,29 @@ +var _a; import merge from 'lodash.merge'; -import { stripTrailingSlash } from "wasp/universal/url"; -const env = process.env.NODE_ENV || 'development'; +import { stripTrailingSlash } from "../universal/url.js"; +const nodeEnv = (_a = process.env.NODE_ENV) !== null && _a !== void 0 ? _a : 'development'; const config = { all: { - env, - isDevelopment: env === 'development', - port: parseInt(process.env.PORT) || 3001, + env: nodeEnv, + isDevelopment: nodeEnv === 'development', + port: process.env.PORT ? parseInt(process.env.PORT) : 3001, databaseUrl: process.env.DATABASE_URL, allowedCORSOrigins: [], }, development: getDevelopmentConfig(), production: getProductionConfig(), }; -const resolvedConfig = merge(config.all, config[env]); +const resolvedConfig = merge(config.all, config[nodeEnv]); // PUBLIC API export default resolvedConfig; function getDevelopmentConfig() { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL || 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL || 'http://localhost:3001'); + var _a, _b; + const frontendUrl = stripTrailingSlash((_a = process.env.WASP_WEB_CLIENT_URL) !== null && _a !== void 0 ? _a : 'http://localhost:3000/'); + const serverUrl = stripTrailingSlash((_b = process.env.WASP_SERVER_URL) !== null && _b !== void 0 ? _b : 'http://localhost:3001'); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, allowedCORSOrigins: '*', }; @@ -28,8 +32,11 @@ function getProductionConfig() { const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, + // @ts-ignore allowedCORSOrigins: [frontendUrl], }; } diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js.map index f4ad188c93..e284580bbd 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/server/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,cAAc,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAA;AAyBjD,MAAM,MAAM,GAIR;IACF,GAAG,EAAE;QACH,GAAG;QACH,aAAa,EAAE,GAAG,KAAK,aAAa;QACpC,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI;QACxC,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;QACrC,kBAAkB,EAAE,EAAE;KACvB;IACD,WAAW,EAAE,oBAAoB,EAAE;IACnC,UAAU,EAAE,mBAAmB,EAAE;CAClC,CAAA;AAED,MAAM,cAAc,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;AAC7D,aAAa;AACb,eAAe,cAAc,CAAA;AAE7B,SAAS,oBAAoB;IAC3B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,wBAAwB,CAAC,CAAC;IACpG,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,uBAAuB,CAAC,CAAC;IAC7F,OAAO;QACL,WAAW;QACX,SAAS;QACT,kBAAkB,EAAE,GAAG;KACxB,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB;IAC1B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACxE,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAClE,OAAO;QACL,WAAW;QACX,SAAS;QACT,kBAAkB,EAAE,CAAC,WAAW,CAAC;KAClC,CAAA;AACH,CAAC"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK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WAAW;QACX,aAAa;QACb,SAAS;QACT,aAAa;QACb,kBAAkB,EAAE,CAAC,WAAW,CAAC;KAClC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/predicates.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/predicates.d.ts new file mode 100644 index 0000000000..8e81fc0515 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/predicates.d.ts @@ -0,0 +1 @@ +export declare function isNotNull(value: T | null): value is T; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/predicates.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/predicates.js new file mode 100644 index 0000000000..b298e903bc --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/predicates.js @@ -0,0 +1,4 @@ +export function isNotNull(value) { + return value !== null; +} +//# sourceMappingURL=predicates.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/predicates.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/predicates.js.map new file mode 100644 index 0000000000..1fdec4adb8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/dist/universal/predicates.js.map @@ -0,0 +1 @@ +{"version":3,"file":"predicates.js","sourceRoot":"","sources":["../../universal/predicates.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAI,KAAe;IAC1C,OAAO,KAAK,KAAK,IAAI,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/HttpError.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/HttpError.ts index 3e8d3f5a0d..d05a2c841b 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/HttpError.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/HttpError.ts @@ -2,8 +2,8 @@ export class HttpError extends Error { public statusCode: number public data: unknown - constructor (statusCode: number, message?: string, data?: Record, ...params: unknown[]) { - super(message, ...params) + constructor (statusCode: number, message?: string, data?: Record, options?: ErrorOptions) { + super(message, options) if (Error.captureStackTrace) { Error.captureStackTrace(this, HttpError) diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/config.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/config.ts index 52699d800c..1dc9bafb93 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/config.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/server/config.ts @@ -1,8 +1,8 @@ import merge from 'lodash.merge' -import { stripTrailingSlash } from "wasp/universal/url"; +import { stripTrailingSlash } from "../universal/url.js"; -const env = process.env.NODE_ENV || 'development' +const nodeEnv = process.env.NODE_ENV ?? 'development' // TODO: // - Use dotenv library to consume env vars from a file. @@ -33,9 +33,9 @@ const config: { production: EnvConfig, } = { all: { - env, - isDevelopment: env === 'development', - port: parseInt(process.env.PORT) || 3001, + env: nodeEnv, + isDevelopment: nodeEnv === 'development', + port: process.env.PORT ? parseInt(process.env.PORT) : 3001, databaseUrl: process.env.DATABASE_URL, allowedCORSOrigins: [], }, @@ -43,15 +43,17 @@ const config: { production: getProductionConfig(), } -const resolvedConfig: Config = merge(config.all, config[env]) +const resolvedConfig: Config = merge(config.all, config[nodeEnv]) // PUBLIC API export default resolvedConfig function getDevelopmentConfig(): EnvConfig { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL || 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL || 'http://localhost:3001'); + const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL ?? 'http://localhost:3000/'); + const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL ?? 'http://localhost:3001'); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, allowedCORSOrigins: '*', } @@ -61,8 +63,11 @@ function getProductionConfig(): EnvConfig { const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, + // @ts-ignore allowedCORSOrigins: [frontendUrl], } } diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/tsconfig.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/tsconfig.json index 8c7c86644c..5a3c9142c3 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/tsconfig.json +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/tsconfig.json @@ -13,11 +13,11 @@ "alwaysStrict": true, "noImplicitThis": true, "strictFunctionTypes": true, + "strictNullChecks": true, // See https://github.com/wasp-lang/wasp/issues/2056 before activating this: // "useUnknownInCatchVariables": true, - // The following 3 stict options will require more work: + // The following 2 stict options will require more work: // "noImplicitAny": true, - // "strictNullChecks": true, // "strictPropertyInitialization": true, // Overriding this because we want to use top-level await "module": "esnext", diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/predicates.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/predicates.ts new file mode 100644 index 0000000000..4294e839f0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/build/sdk/wasp/universal/predicates.ts @@ -0,0 +1,3 @@ +export function isNotNull(value: T | null): value is T { + return value !== null; +} diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/api/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/api/index.ts index 6037b3048c..c8895b1275 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/api/index.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/api/index.ts @@ -77,7 +77,7 @@ window.addEventListener('storage', (event) => { * standard format to be further used by the client. It is also assumed that given API * error has been formatted as implemented by HttpError on the server. */ -export function handleApiError(error: AxiosError<{ message?: string, data?: unknown }>): void { +export function handleApiError>(error: T): T | WaspHttpError { if (error?.response) { // If error came from HTTP response, we capture most informative message // and also add .statusCode information to it. @@ -88,10 +88,10 @@ export function handleApiError(error: AxiosError<{ message?: string, data?: unkn // That would require copying HttpError code to web-app also and using it here. const responseJson = error.response?.data const responseStatusCode = error.response.status - throw new WaspHttpError(responseStatusCode, responseJson?.message ?? error.message, responseJson) + return new WaspHttpError(responseStatusCode, responseJson?.message ?? error.message, responseJson) } else { // If any other error, we just propagate it. - throw error + return error } } diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/config.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/config.ts index 2f9967891e..82b0f80b6a 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/config.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/config.ts @@ -1,4 +1,4 @@ -import { stripTrailingSlash } from 'wasp/universal/url' +import { stripTrailingSlash } from '../universal/url.js' const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/hooks.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/hooks.ts index 0f03f3167a..7ac0aac46d 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/hooks.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/hooks.ts @@ -28,8 +28,12 @@ export function useQuery( return rqUseQuery({ // todo: The full queryCacheKey is constructed in two places, both here and // inside the Query. See https://github.com/wasp-lang/wasp/issues/2017 - queryKey: makeQueryCacheKey(query, queryFnArgs), - queryFn: () => query(queryFnArgs), + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryKey: makeQueryCacheKey(query, (queryFnArgs as Input)), + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryFn: () => query(queryFnArgs as Input), ...options, }) } @@ -138,7 +142,7 @@ type InternalOptimisticUpdateDefinition = { * the current state of the cache and returns the desired (new) state of the * cache. */ -type SpecificUpdateQuery = (oldData: CachedData) => CachedData; +type SpecificUpdateQuery = (oldData: CachedData | undefined) => CachedData; /** * A specific, "instantiated" optimistic update definition which contains a @@ -170,7 +174,7 @@ function translateToInternalDefinition( ): InternalOptimisticUpdateDefinition { const { getQuerySpecifier, updateQuery } = publicOptimisticUpdateDefinition; - const definitionErrors = []; + const definitionErrors: string[] = []; if (typeof getQuerySpecifier !== "function") { definitionErrors.push("`getQuerySpecifier` is not a function."); } @@ -204,7 +208,7 @@ function makeOptimisticUpdateMutationFn( CachedData >[] ): typeof actionFn { - return (function performActionWithOptimisticUpdates(item?: Input) { + return (function performActionWithOptimisticUpdates(item: Input) { const specificOptimisticUpdateDefinitions = optimisticUpdateDefinitions.map( (generalDefinition) => getOptimisticUpdateDefinitionForSpecificItem(generalDefinition, item) @@ -259,10 +263,10 @@ function makeRqOptimisticUpdateOptions( ); // We're using a Map to correctly serialize query keys that contain objects. - const previousData = new Map(); + const previousData: Map = new Map(); specificOptimisticUpdateDefinitions.forEach(({ queryKey, updateQuery }) => { // Snapshot the currently cached value. - const previousDataForQuery: CachedData = + const previousDataForQuery: CachedData | undefined = queryClient.getQueryData(queryKey); // Attempt to optimistically update the cache using the new value. diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/internal/index.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/internal/index.ts index 28c9ceef98..17bc0e8abf 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/internal/index.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/client/operations/internal/index.ts @@ -15,7 +15,7 @@ export async function callOperation(operationRoute: OperationRoute, args: any) { const response = await api.post(operationRoute.path, superjsonArgs) return superjsonDeserialize(response.data) } catch (error) { - handleApiError(error) + throw handleApiError(error) } } diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/index.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/index.d.ts index c39a409f75..6971aac805 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/index.d.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/index.d.ts @@ -9,7 +9,13 @@ export declare function removeLocalUserData(): void; * standard format to be further used by the client. It is also assumed that given API * error has been formatted as implemented by HttpError on the server. */ -export declare function handleApiError(error: AxiosError<{ +export declare function handleApiError): void; +}>>(error: T): T | WaspHttpError; +declare class WaspHttpError extends Error { + statusCode: number; + data: unknown; + constructor(statusCode: number, message: string, data: unknown); +} +export {}; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/index.js index 07e05c03f9..df5d608aa4 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/index.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/index.js @@ -79,11 +79,11 @@ export function handleApiError(error) { // That would require copying HttpError code to web-app also and using it here. const responseJson = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data; const responseStatusCode = error.response.status; - throw new WaspHttpError(responseStatusCode, (_b = responseJson === null || responseJson === void 0 ? void 0 : responseJson.message) !== null && _b !== void 0 ? _b : error.message, responseJson); + return new WaspHttpError(responseStatusCode, (_b = responseJson === null || responseJson === void 0 ? void 0 : responseJson.message) !== null && _b !== void 0 ? _b : error.message, responseJson); } else { // If any other error, we just propagate it. - throw error; + return error; } } class WaspHttpError extends Error { diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/index.js.map index 86433530c0..239cd44a19 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/index.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/api/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAA8C,MAAM,OAAO,CA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AAI,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YACrB,oBAAoB,GAAG,KAAK,CAAC,QAAQ,CAAA;YACrC,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;QACxC,CAAC;aAAM,CAAC;YACN,oBAAoB,GAAG,SAAS,CAAA;YAChC,gBAAgB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;QAC1C,CAAC;IACH,CAAC;AACH,CAAC,CAAC,CAAA;AAEF,oBAAoB;AACpB;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAA6D,KAAQ;;IACjG,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,EAAE,CAAC;QACpB,wEAAwE;QACxE,8CAA8C;QAC9C,8EAA8E;QAC9E,8BAA8B;QAC9B,yEAAyE;QACzE,iEAAiE;QACjE,iFAAiF;QACjF,MAAM,YAAY,GAAG,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI,CAAA;QACzC,MAAM,kBAAkB,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAA;QAChD,OAAO,IAAI,aAAa,CAAC,kBAAkB,EAAE,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,mCAAI,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;IACpG,CAAC;SAAM,CAAC;QACN,4CAA4C;QAC5C,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAED,MAAM,aAAc,SAAQ,KAAK;IAK/B,YAAa,UAAkB,EAAE,OAAe,EAAE,IAAa;QAC7D,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;CACF"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/config.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/config.js index 74f4f78c97..1dffbd68bc 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/config.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/config.js @@ -1,4 +1,4 @@ -import { stripTrailingSlash } from 'wasp/universal/url'; +import { stripTrailingSlash } from '../universal/url.js'; const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; // PUBLIC API export const config = { diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/config.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/config.js.map index 82b7a8d169..d26d37022b 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/config.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAEvD,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,uBAAuB,CAAC;AAOhG,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAExD,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,uBAAuB,CAAC;AAOhG,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/hooks.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/hooks.js index 723993357c..d20d1f0588 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/hooks.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/hooks.js @@ -12,7 +12,12 @@ export function useQuery(query, queryFnArgs, options) { return rqUseQuery(Object.assign({ // todo: The full queryCacheKey is constructed in two places, both here and // inside the Query. See https://github.com/wasp-lang/wasp/issues/2017 - queryKey: makeQueryCacheKey(query, queryFnArgs), queryFn: () => query(queryFnArgs) }, options)); + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryKey: makeQueryCacheKey(query, queryFnArgs), + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryFn: () => query(queryFnArgs) }, options)); } // PUBLIC API /** diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/hooks.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/hooks.js.map index 40d9188b06..11ab1e3495 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/hooks.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/hooks.js.map @@ -1 +1 @@ -{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../client/operations/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EAEX,cAAc,EACd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AAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;YACpD,MAAM,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YAC1C,WAAW,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,QAAQ;QACR,OAAO;KACR,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,4CAA4C,CACnD,0BAGC,EACD,IAAiB;IAEjB,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,0BAA0B,CAAC;IAChE,OAAO;QACL,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC;QAC3B,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC;KAC7C,CAAC;AACJ,CAAC;AAED,qEAAqE;AACrE,+EAA+E;AAC/E;;;;;;GAMG;AACH,SAAS,0BAA0B,CACjC,cAAgD;IAEhD,MAAM,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,GAAG,cAAc,CAAC;IAC/C,OAAO,CAAC,GAAI,OAAe,CAAC,aAAa,EAAE,GAAG,SAAS,CAAC,CAAC;AAC3D,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js index 68bbdadf3d..13e1dcb655 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js @@ -9,7 +9,7 @@ export async function callOperation(operationRoute, args) { return superjsonDeserialize(response.data); } catch (error) { - handleApiError(error); + throw handleApiError(error); } } // PRIVATE API diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map index 23d9e480d1..d271983a05 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../client/operations/internal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EACL,SAAS,IAAI,kBAAkB,EAC/B,WAAW,IAAI,oBAAoB,GACnC,MAAM,WAAW,CAAA;AAKnB,cAAc;AACd,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,cAA8B,EAAE,IAAS;IAC3E,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAC9C,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;QACnE,OAAO,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,cAAc,CAAC,KAAK,CAAC,CAAA;IACvB,CAAC;AACH,CAAC;AAED,cAAc;AACd,MAAM,UAAU,kBAAkB,CAAC,sBAA8B;IAC/D,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,sBAAsB,EAAE,EAAE,CAAA;AACxE,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../client/operations/internal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EACL,SAAS,IAAI,kBAAkB,EAC/B,WAAW,IAAI,oBAAoB,GACnC,MAAM,WAAW,CAAA;AAKnB,cAAc;AACd,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,cAA8B,EAAE,IAAS;IAC3E,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAC9C,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;QACnE,OAAO,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,cAAc,CAAC,KAAK,CAAC,CAAA;IAC7B,CAAC;AACH,CAAC;AAED,cAAc;AACd,MAAM,UAAU,kBAAkB,CAAC,sBAA8B;IAC/D,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,sBAAsB,EAAE,EAAE,CAAA;AACxE,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts index 56b8d88eca..e40cd74ab7 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts @@ -1,5 +1,5 @@ export declare class HttpError extends Error { statusCode: number; data: unknown; - constructor(statusCode: number, message?: string, data?: Record, ...params: unknown[]); + constructor(statusCode: number, message?: string, data?: Record, options?: ErrorOptions); } diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.js index 3e216e57ce..6e91977adc 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.js @@ -1,6 +1,6 @@ export class HttpError extends Error { - constructor(statusCode, message, data, ...params) { - super(message, ...params); + constructor(statusCode, message, data, options) { + super(message, options); if (Error.captureStackTrace) { Error.captureStackTrace(this, HttpError); } diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.js.map index 3cc7095281..8163354e1b 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/HttpError.js.map @@ -1 +1 @@ -{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YAAa,UAAkB,EAAE,OAAgB,EAAE,IAA8B,EAAE,GAAG,MAAiB;QACrG,KAAK,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAA;QAEzB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EAAE,CAAC;YAC7E,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YAAa,UAAkB,EAAE,OAAgB,EAAE,IAA8B,EAAE,OAAsB;QACvG,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAEvB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EAAE,CAAC;YAC7E,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.js index dabd38b4b0..e4f89082c8 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.js +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.js @@ -1,25 +1,29 @@ +var _a; import merge from 'lodash.merge'; -import { stripTrailingSlash } from "wasp/universal/url"; -const env = process.env.NODE_ENV || 'development'; +import { stripTrailingSlash } from "../universal/url.js"; +const nodeEnv = (_a = process.env.NODE_ENV) !== null && _a !== void 0 ? _a : 'development'; const config = { all: { - env, - isDevelopment: env === 'development', - port: parseInt(process.env.PORT) || 3001, + env: nodeEnv, + isDevelopment: nodeEnv === 'development', + port: process.env.PORT ? parseInt(process.env.PORT) : 3001, databaseUrl: process.env.DATABASE_URL, allowedCORSOrigins: [], }, development: getDevelopmentConfig(), production: getProductionConfig(), }; -const resolvedConfig = merge(config.all, config[env]); +const resolvedConfig = merge(config.all, config[nodeEnv]); // PUBLIC API export default resolvedConfig; function getDevelopmentConfig() { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL || 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL || 'http://localhost:3001'); + var _a, _b; + const frontendUrl = stripTrailingSlash((_a = process.env.WASP_WEB_CLIENT_URL) !== null && _a !== void 0 ? _a : 'http://localhost:3000/'); + const serverUrl = stripTrailingSlash((_b = process.env.WASP_SERVER_URL) !== null && _b !== void 0 ? _b : 'http://localhost:3001'); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, allowedCORSOrigins: '*', }; @@ -28,8 +32,11 @@ function getProductionConfig() { const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, + // @ts-ignore allowedCORSOrigins: [frontendUrl], }; } diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.js.map index f4ad188c93..e284580bbd 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.js.map +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/server/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,cAAc,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAA;AAyBjD,MAAM,MAAM,GAIR;IACF,GAAG,EAAE;QACH,GAAG;QACH,aAAa,EAAE,GAAG,KAAK,aAAa;QACpC,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI;QACxC,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;QACrC,kBAAkB,EAAE,EAAE;KACvB;IACD,WAAW,EAAE,oBAAoB,EAAE;IACnC,UAAU,EAAE,mBAAmB,EAAE;CAClC,CAAA;AAED,MAAM,cAAc,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;AAC7D,aAAa;AACb,eAAe,cAAc,CAAA;AAE7B,SAAS,oBAAoB;IAC3B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,wBAAwB,CAAC,CAAC;IACpG,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,uBAAuB,CAAC,CAAC;IAC7F,OAAO;QACL,WAAW;QACX,SAAS;QACT,kBAAkB,EAAE,GAAG;KACxB,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB;IAC1B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACxE,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAClE,OAAO;QACL,WAAW;QACX,SAAS;QACT,kBAAkB,EAAE,CAAC,WAAW,CAAC;KAClC,CAAA;AACH,CAAC"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,cAAc,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,QAAQ,mCAAI,aAAa,CAAA;AAyBrD,MAAM,MAAM,GAIR;IACF,GAAG,EAAE;QACH,GAAG,EAAE,OAAO;QACZ,aAAa,EAAE,OAAO,KAAK,aAAa;QACxC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;QAC1D,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;QACrC,kBAAkB,EAAE,EAAE;KACvB;IACD,WAAW,EAAE,oBAAoB,EAAE;IACnC,UAAU,EAAE,mBAAmB,EAAE;CAClC,CAAA;AAED,MAAM,cAAc,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;AACjE,aAAa;AACb,eAAe,cAAc,CAAA;AAE7B,SAAS,oBAAoB;;IAC3B,MAAM,WAAW,GAAG,kBAAkB,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,mBAAmB,mCAAI,wBAAwB,CAAC,CAAC;IACpG,MAAM,SAAS,GAAG,kBAAkB,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,eAAe,mCAAI,uBAAuB,CAAC,CAAC;IAC7F,OAAO;QACL,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,kBAAkB,EAAE,GAAG;KACxB,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB;IAC1B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACxE,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAClE,OAAO;QACL,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,aAAa;QACb,kBAAkB,EAAE,CAAC,WAAW,CAAC;KAClC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/predicates.d.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/predicates.d.ts new file mode 100644 index 0000000000..8e81fc0515 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/predicates.d.ts @@ -0,0 +1 @@ +export declare function isNotNull(value: T | null): value is T; diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/predicates.js b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/predicates.js new file mode 100644 index 0000000000..b298e903bc --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/predicates.js @@ -0,0 +1,4 @@ +export function isNotNull(value) { + return value !== null; +} +//# sourceMappingURL=predicates.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/predicates.js.map b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/predicates.js.map new file mode 100644 index 0000000000..1fdec4adb8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/dist/universal/predicates.js.map @@ -0,0 +1 @@ +{"version":3,"file":"predicates.js","sourceRoot":"","sources":["../../universal/predicates.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAI,KAAe;IAC1C,OAAO,KAAK,KAAK,IAAI,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/HttpError.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/HttpError.ts index 3e8d3f5a0d..d05a2c841b 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/HttpError.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/HttpError.ts @@ -2,8 +2,8 @@ export class HttpError extends Error { public statusCode: number public data: unknown - constructor (statusCode: number, message?: string, data?: Record, ...params: unknown[]) { - super(message, ...params) + constructor (statusCode: number, message?: string, data?: Record, options?: ErrorOptions) { + super(message, options) if (Error.captureStackTrace) { Error.captureStackTrace(this, HttpError) diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/config.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/config.ts index 52699d800c..1dc9bafb93 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/config.ts +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/server/config.ts @@ -1,8 +1,8 @@ import merge from 'lodash.merge' -import { stripTrailingSlash } from "wasp/universal/url"; +import { stripTrailingSlash } from "../universal/url.js"; -const env = process.env.NODE_ENV || 'development' +const nodeEnv = process.env.NODE_ENV ?? 'development' // TODO: // - Use dotenv library to consume env vars from a file. @@ -33,9 +33,9 @@ const config: { production: EnvConfig, } = { all: { - env, - isDevelopment: env === 'development', - port: parseInt(process.env.PORT) || 3001, + env: nodeEnv, + isDevelopment: nodeEnv === 'development', + port: process.env.PORT ? parseInt(process.env.PORT) : 3001, databaseUrl: process.env.DATABASE_URL, allowedCORSOrigins: [], }, @@ -43,15 +43,17 @@ const config: { production: getProductionConfig(), } -const resolvedConfig: Config = merge(config.all, config[env]) +const resolvedConfig: Config = merge(config.all, config[nodeEnv]) // PUBLIC API export default resolvedConfig function getDevelopmentConfig(): EnvConfig { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL || 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL || 'http://localhost:3001'); + const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL ?? 'http://localhost:3000/'); + const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL ?? 'http://localhost:3001'); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, allowedCORSOrigins: '*', } @@ -61,8 +63,11 @@ function getProductionConfig(): EnvConfig { const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, + // @ts-ignore allowedCORSOrigins: [frontendUrl], } } diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/tsconfig.json b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/tsconfig.json index 8c7c86644c..5a3c9142c3 100644 --- a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/tsconfig.json +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/tsconfig.json @@ -13,11 +13,11 @@ "alwaysStrict": true, "noImplicitThis": true, "strictFunctionTypes": true, + "strictNullChecks": true, // See https://github.com/wasp-lang/wasp/issues/2056 before activating this: // "useUnknownInCatchVariables": true, - // The following 3 stict options will require more work: + // The following 2 stict options will require more work: // "noImplicitAny": true, - // "strictNullChecks": true, // "strictPropertyInitialization": true, // Overriding this because we want to use top-level await "module": "esnext", diff --git a/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/universal/predicates.ts b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/universal/predicates.ts new file mode 100644 index 0000000000..4294e839f0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspBuild-golden/waspBuild/.wasp/out/sdk/wasp/universal/predicates.ts @@ -0,0 +1,3 @@ +export function isNotNull(value: T | null): value is T { + return value !== null; +} diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/files.manifest b/waspc/e2e-test/test-outputs/waspCompile-golden/files.manifest index be6525f517..0ebc3d1eef 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/files.manifest @@ -152,6 +152,9 @@ waspCompile/.wasp/out/sdk/wasp/dist/server/types/index.js.map waspCompile/.wasp/out/sdk/wasp/dist/server/utils.d.ts waspCompile/.wasp/out/sdk/wasp/dist/server/utils.js waspCompile/.wasp/out/sdk/wasp/dist/server/utils.js.map +waspCompile/.wasp/out/sdk/wasp/dist/universal/predicates.d.ts +waspCompile/.wasp/out/sdk/wasp/dist/universal/predicates.js +waspCompile/.wasp/out/sdk/wasp/dist/universal/predicates.js.map waspCompile/.wasp/out/sdk/wasp/dist/universal/types.d.ts waspCompile/.wasp/out/sdk/wasp/dist/universal/types.js waspCompile/.wasp/out/sdk/wasp/dist/universal/types.js.map @@ -186,6 +189,7 @@ waspCompile/.wasp/out/sdk/wasp/server/operations/wrappers.ts waspCompile/.wasp/out/sdk/wasp/server/types/index.ts waspCompile/.wasp/out/sdk/wasp/server/utils.ts waspCompile/.wasp/out/sdk/wasp/tsconfig.json +waspCompile/.wasp/out/sdk/wasp/universal/predicates.ts waspCompile/.wasp/out/sdk/wasp/universal/types.ts waspCompile/.wasp/out/sdk/wasp/universal/url.ts waspCompile/.wasp/out/sdk/wasp/universal/validators.ts diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/.waspchecksums b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/.waspchecksums index 5299d0dd73..b086a6efd0 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/.waspchecksums +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/.waspchecksums @@ -11,14 +11,14 @@ "file", "../out/sdk/wasp/api/index.ts" ], - "5784ba365e8a5cb2031571cfebf1cbae8670f86f8e5a596b133d333cdf6c91eb" + "2c300f215d89a72dad5e7a766dd97a64aa85b19126c96708487201b9b08a94f9" ], [ [ "file", "../out/sdk/wasp/client/config.ts" ], - "bc7d48bd7ec4cdf74f85b98113eb26e670ef265ca4bbd735e361409c9335ad85" + "d94e8bee5fd8f6793b511652b9ee558e57f4913595763137a5385cd929648168" ], [ [ @@ -46,7 +46,7 @@ "file", "../out/sdk/wasp/client/operations/hooks.ts" ], - "d1a8fccfb8207476b90708e8285d1455b33ff4e446749b33c3eb1a54dcfe2d41" + "3c326183d9dcb2bcf14b747ffc66b19e4773642d05f3f84d401e3d54b843eeca" ], [ [ @@ -60,7 +60,7 @@ "file", "../out/sdk/wasp/client/operations/internal/index.ts" ], - "f08a4f1fb1f897edca465b3f228215e06418109fb439232e8fa0ffdbdc98b833" + "d710d9894f56194c0d87921f339100414c69b987f1f5221881ca372fd70be371" ], [ [ @@ -214,7 +214,7 @@ "file", "../out/sdk/wasp/server/HttpError.ts" ], - "eaa296c30acc65c78b90ebdf9a1d6fdb863f0c26c743d352afaeaa3bbc2fdd1b" + "f375fb45eeb16381b8cc575503db302c005ddaa1b35d837ca0ea043fe8ec6ccb" ], [ [ @@ -242,7 +242,7 @@ "file", "../out/sdk/wasp/server/config.ts" ], - "e5388a9259a22671ee2d2ef46d2c09fdd46c3b3ec24248c7a0b471c0fbf7aa54" + "5dd35660e0969defaa3c180179919f4922ab7bc041746872dff7f2280c1872ae" ], [ [ @@ -333,7 +333,14 @@ "file", "../out/sdk/wasp/tsconfig.json" ], - "4323884e7e8c52683788995be58e8f583c00fc611845fdbd481157d0118dccd2" + "3b09df60f6728880a953a746ef887e045de0b533cb383f89d6adf8ff906edac8" + ], + [ + [ + "file", + "../out/sdk/wasp/universal/predicates.ts" + ], + "baa4148fdf4995cfc154a81bc494e9e8077635d4db50958d5b59837d1b8ed691" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/api/index.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/api/index.ts index 6037b3048c..c8895b1275 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/api/index.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/api/index.ts @@ -77,7 +77,7 @@ window.addEventListener('storage', (event) => { * standard format to be further used by the client. It is also assumed that given API * error has been formatted as implemented by HttpError on the server. */ -export function handleApiError(error: AxiosError<{ message?: string, data?: unknown }>): void { +export function handleApiError>(error: T): T | WaspHttpError { if (error?.response) { // If error came from HTTP response, we capture most informative message // and also add .statusCode information to it. @@ -88,10 +88,10 @@ export function handleApiError(error: AxiosError<{ message?: string, data?: unkn // That would require copying HttpError code to web-app also and using it here. const responseJson = error.response?.data const responseStatusCode = error.response.status - throw new WaspHttpError(responseStatusCode, responseJson?.message ?? error.message, responseJson) + return new WaspHttpError(responseStatusCode, responseJson?.message ?? error.message, responseJson) } else { // If any other error, we just propagate it. - throw error + return error } } diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/config.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/config.ts index 2f9967891e..82b0f80b6a 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/config.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/config.ts @@ -1,4 +1,4 @@ -import { stripTrailingSlash } from 'wasp/universal/url' +import { stripTrailingSlash } from '../universal/url.js' const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/hooks.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/hooks.ts index 0f03f3167a..7ac0aac46d 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/hooks.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/hooks.ts @@ -28,8 +28,12 @@ export function useQuery( return rqUseQuery({ // todo: The full queryCacheKey is constructed in two places, both here and // inside the Query. See https://github.com/wasp-lang/wasp/issues/2017 - queryKey: makeQueryCacheKey(query, queryFnArgs), - queryFn: () => query(queryFnArgs), + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryKey: makeQueryCacheKey(query, (queryFnArgs as Input)), + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryFn: () => query(queryFnArgs as Input), ...options, }) } @@ -138,7 +142,7 @@ type InternalOptimisticUpdateDefinition = { * the current state of the cache and returns the desired (new) state of the * cache. */ -type SpecificUpdateQuery = (oldData: CachedData) => CachedData; +type SpecificUpdateQuery = (oldData: CachedData | undefined) => CachedData; /** * A specific, "instantiated" optimistic update definition which contains a @@ -170,7 +174,7 @@ function translateToInternalDefinition( ): InternalOptimisticUpdateDefinition { const { getQuerySpecifier, updateQuery } = publicOptimisticUpdateDefinition; - const definitionErrors = []; + const definitionErrors: string[] = []; if (typeof getQuerySpecifier !== "function") { definitionErrors.push("`getQuerySpecifier` is not a function."); } @@ -204,7 +208,7 @@ function makeOptimisticUpdateMutationFn( CachedData >[] ): typeof actionFn { - return (function performActionWithOptimisticUpdates(item?: Input) { + return (function performActionWithOptimisticUpdates(item: Input) { const specificOptimisticUpdateDefinitions = optimisticUpdateDefinitions.map( (generalDefinition) => getOptimisticUpdateDefinitionForSpecificItem(generalDefinition, item) @@ -259,10 +263,10 @@ function makeRqOptimisticUpdateOptions( ); // We're using a Map to correctly serialize query keys that contain objects. - const previousData = new Map(); + const previousData: Map = new Map(); specificOptimisticUpdateDefinitions.forEach(({ queryKey, updateQuery }) => { // Snapshot the currently cached value. - const previousDataForQuery: CachedData = + const previousDataForQuery: CachedData | undefined = queryClient.getQueryData(queryKey); // Attempt to optimistically update the cache using the new value. diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/internal/index.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/internal/index.ts index 28c9ceef98..17bc0e8abf 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/internal/index.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/client/operations/internal/index.ts @@ -15,7 +15,7 @@ export async function callOperation(operationRoute: OperationRoute, args: any) { const response = await api.post(operationRoute.path, superjsonArgs) return superjsonDeserialize(response.data) } catch (error) { - handleApiError(error) + throw handleApiError(error) } } diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/index.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/index.d.ts index c39a409f75..6971aac805 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/index.d.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/index.d.ts @@ -9,7 +9,13 @@ export declare function removeLocalUserData(): void; * standard format to be further used by the client. It is also assumed that given API * error has been formatted as implemented by HttpError on the server. */ -export declare function handleApiError(error: AxiosError<{ +export declare function handleApiError): void; +}>>(error: T): T | WaspHttpError; +declare class WaspHttpError extends Error { + statusCode: number; + data: unknown; + constructor(statusCode: number, message: string, data: unknown); +} +export {}; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/index.js index 07e05c03f9..df5d608aa4 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/index.js +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/index.js @@ -79,11 +79,11 @@ export function handleApiError(error) { // That would require copying HttpError code to web-app also and using it here. const responseJson = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data; const responseStatusCode = error.response.status; - throw new WaspHttpError(responseStatusCode, (_b = responseJson === null || responseJson === void 0 ? void 0 : responseJson.message) !== null && _b !== void 0 ? _b : error.message, responseJson); + return new WaspHttpError(responseStatusCode, (_b = responseJson === null || responseJson === void 0 ? void 0 : responseJson.message) !== null && _b !== void 0 ? _b : error.message, responseJson); } else { // If any other error, we just propagate it. - throw error; + return error; } } class WaspHttpError extends Error { diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/index.js.map index 86433530c0..239cd44a19 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/index.js.map +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/api/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAA8C,MAAM,OAAO,CAAA;AAElE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE9C,aAAa;AACb,MAAM,CAAC,MAAM,GAAG,GAAkB,KAAK,CAAC,MAAM,CAAC;IAC7C,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CAAC,CAAA;AAEF,MAAM,6BAA6B,GAAG,WAAW,CAAA;AAEjD,IAAI,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAuB,CAAA;AAE3F,oBAAoB;AACpB,MAAM,UAAU,YAAY,CAAC,SAAiB;IAC5C,oBAAoB,GAAG,SAAS,CAAA;IAChC,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,SAAS,CAAC,CAAA;IACrD,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;AACxC,CAAC;AAED,oBAAoB;AACpB,MAAM,UAAU,YAAY;IAC1B,OAAO,oBAAoB,CAAA;AAC7B,CAAC;AAED,oBAAoB;AACpB,MAAM,UAAU,cAAc;IAC5B,oBAAoB,GAAG,SAAS,CAAA;IAChC,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAA;IAC7C,gBAAgB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;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5C,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAED,MAAM,aAAc,SAAQ,KAAK;IAK/B,YAAa,UAAkB,EAAE,OAAe,EAAE,IAAa;QAC7D,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;CACF"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/config.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/config.js index 74f4f78c97..1dffbd68bc 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/config.js +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/config.js @@ -1,4 +1,4 @@ -import { stripTrailingSlash } from 'wasp/universal/url'; +import { stripTrailingSlash } from '../universal/url.js'; const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; // PUBLIC API export const config = { diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/config.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/config.js.map index 82b7a8d169..d26d37022b 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/config.js.map +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAEvD,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,uBAAuB,CAAC;AAOhG,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAExD,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,uBAAuB,CAAC;AAOhG,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/hooks.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/hooks.js index 723993357c..d20d1f0588 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/hooks.js +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/hooks.js @@ -12,7 +12,12 @@ export function useQuery(query, queryFnArgs, options) { return rqUseQuery(Object.assign({ // todo: The full queryCacheKey is constructed in two places, both here and // inside the Query. See https://github.com/wasp-lang/wasp/issues/2017 - queryKey: makeQueryCacheKey(query, queryFnArgs), queryFn: () => query(queryFnArgs) }, options)); + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryKey: makeQueryCacheKey(query, queryFnArgs), + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryFn: () => query(queryFnArgs) }, options)); } // PUBLIC API /** diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/hooks.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/hooks.js.map index 40d9188b06..11ab1e3495 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/hooks.js.map +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/hooks.js.map @@ -1 +1 @@ -{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../client/operations/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EAEX,cAAc,EACd,QAAQ,IAAI,UAAU,GAEvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,aAAa;AACb,MAAM,UAAU,QAAQ,CACtB,KAA2B,EAC3B,WAAmB,EACnB,OAAa;IAEb,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,6CAA6C,CAAC,CAAA;IACpE,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QACzB,MAAM,IAAI,SAAS,CAAC,uDAAuD,CAAC,CAAA;IAC9E,CAAC;IAED,OAAO,UAAU;QACf,2EAA2E;QAC3E,sEAAsE;QACtE,QAAQ,EAAE,iBAAiB,CAAC,KAAK,EAAE,WAAW,CAAC,EAC/C,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,IAC9B,OAAO,EACV,CAAA;AACJ,CAAC;AAED,aAAa;AACb;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CACvB,QAA+B,EAC/B,aAAoC;IAEpC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IAErC,IAAI,UAAU,GAAG,QAAQ,CAAC;IAC1B,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,a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,CAAC,aAAa,EAAE,GAAG,SAAS,CAAC,CAAC;AAC3D,CAAC"} \ No newline at end of file +{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../client/operations/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EAEX,cAAc,EACd,QAAQ,IAAI,UAAU,GAEvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,aAAa;AACb,MAAM,UAAU,QAAQ,CACtB,KAA2B,EAC3B,WAAmB,EACnB,OAAa;IAEb,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,6CAA6C,CAAC,CAAA;IACpE,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QACzB,MAAM,IAAI,SAAS,CAAC,uDAAuD,CAAC,CAAA;IAC9E,CAAC;IAED,OAAO,UAAU;QACf,2EAA2E;QAC3E,sEAAsE;QACtE,+DAA+D;QAC/D,gDAAgD;QAChD,QAAQ,EAAE,iBAAiB,CAAC,KAAK,EAAG,WAAqB,CAAC;QAC1D,+DAA+D;QAC/D,gDAAgD;QAChD,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,WAAoB,CAAC,IACvC,OAAO,EACV,CAAA;AACJ,CAAC;AAED,aAAa;AACb;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CACvB,QAA+B,EAC/B,aAAoC;IAEpC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IAErC,IAAI,UAAU,GAAG,QAAQ,CAAC;IAC1B,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,iBAAiB,EAAE,CAAC;QACrC,MAAM,4BAA4B,GAAG,aAAa,CAAC,iBAAiB,CAAC,GAAG,CACtE,6BAA6B,CAC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client/operations/internal/index.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js index 68bbdadf3d..13e1dcb655 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js @@ -9,7 +9,7 @@ export async function callOperation(operationRoute, args) { return superjsonDeserialize(response.data); } catch (error) { - handleApiError(error); + throw handleApiError(error); } } // PRIVATE API diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map index 23d9e480d1..d271983a05 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../client/operations/internal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EACL,SAAS,IAAI,kBAAkB,EAC/B,WAAW,IAAI,oBAAoB,GACnC,MAAM,WAAW,CAAA;AAKnB,cAAc;AACd,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,cAA8B,EAAE,IAAS;IAC3E,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAC9C,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;QACnE,OAAO,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,cAAc,CAAC,KAAK,CAAC,CAAA;IACvB,CAAC;AACH,CAAC;AAED,cAAc;AACd,MAAM,UAAU,kBAAkB,CAAC,sBAA8B;IAC/D,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,sBAAsB,EAAE,EAAE,CAAA;AACxE,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../client/operations/internal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EACL,SAAS,IAAI,kBAAkB,EAC/B,WAAW,IAAI,oBAAoB,GACnC,MAAM,WAAW,CAAA;AAKnB,cAAc;AACd,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,cAA8B,EAAE,IAAS;IAC3E,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAC9C,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;QACnE,OAAO,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,cAAc,CAAC,KAAK,CAAC,CAAA;IAC7B,CAAC;AACH,CAAC;AAED,cAAc;AACd,MAAM,UAAU,kBAAkB,CAAC,sBAA8B;IAC/D,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,sBAAsB,EAAE,EAAE,CAAA;AACxE,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts index 56b8d88eca..e40cd74ab7 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts @@ -1,5 +1,5 @@ export declare class HttpError extends Error { statusCode: number; data: unknown; - constructor(statusCode: number, message?: string, data?: Record, ...params: unknown[]); + constructor(statusCode: number, message?: string, data?: Record, options?: ErrorOptions); } diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.js index 3e216e57ce..6e91977adc 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.js +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.js @@ -1,6 +1,6 @@ export class HttpError extends Error { - constructor(statusCode, message, data, ...params) { - super(message, ...params); + constructor(statusCode, message, data, options) { + super(message, options); if (Error.captureStackTrace) { Error.captureStackTrace(this, HttpError); } diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.js.map index 3cc7095281..8163354e1b 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.js.map +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/HttpError.js.map @@ -1 +1 @@ -{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YAAa,UAAkB,EAAE,OAAgB,EAAE,IAA8B,EAAE,GAAG,MAAiB;QACrG,KAAK,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAA;QAEzB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EAAE,CAAC;YAC7E,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YAAa,UAAkB,EAAE,OAAgB,EAAE,IAA8B,EAAE,OAAsB;QACvG,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAEvB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EAAE,CAAC;YAC7E,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.js index dabd38b4b0..e4f89082c8 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.js +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.js @@ -1,25 +1,29 @@ +var _a; import merge from 'lodash.merge'; -import { stripTrailingSlash } from "wasp/universal/url"; -const env = process.env.NODE_ENV || 'development'; +import { stripTrailingSlash } from "../universal/url.js"; +const nodeEnv = (_a = process.env.NODE_ENV) !== null && _a !== void 0 ? _a : 'development'; const config = { all: { - env, - isDevelopment: env === 'development', - port: parseInt(process.env.PORT) || 3001, + env: nodeEnv, + isDevelopment: nodeEnv === 'development', + port: process.env.PORT ? parseInt(process.env.PORT) : 3001, databaseUrl: process.env.DATABASE_URL, allowedCORSOrigins: [], }, development: getDevelopmentConfig(), production: getProductionConfig(), }; -const resolvedConfig = merge(config.all, config[env]); +const resolvedConfig = merge(config.all, config[nodeEnv]); // PUBLIC API export default resolvedConfig; function getDevelopmentConfig() { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL || 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL || 'http://localhost:3001'); + var _a, _b; + const frontendUrl = stripTrailingSlash((_a = process.env.WASP_WEB_CLIENT_URL) !== null && _a !== void 0 ? _a : 'http://localhost:3000/'); + const serverUrl = stripTrailingSlash((_b = process.env.WASP_SERVER_URL) !== null && _b !== void 0 ? _b : 'http://localhost:3001'); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, allowedCORSOrigins: '*', }; @@ -28,8 +32,11 @@ function getProductionConfig() { const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, + // @ts-ignore allowedCORSOrigins: [frontendUrl], }; } diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.js.map index f4ad188c93..e284580bbd 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.js.map +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/server/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,cAAc,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAA;AAyBjD,MAAM,MAAM,GAIR;IACF,GAAG,EAAE;QACH,GAAG;QACH,aAAa,EAAE,GAAG,KAAK,aAAa;QACpC,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI;QACxC,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;QACrC,kBAAkB,EAAE,EAAE;KACvB;IACD,WAAW,EAAE,oBAAoB,EAAE;IACnC,UAAU,EAAE,mBAAmB,EAAE;C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C,GAAG,CAAC,YAAY;QACrC,kBAAkB,EAAE,EAAE;KACvB;IACD,WAAW,EAAE,oBAAoB,EAAE;IACnC,UAAU,EAAE,mBAAmB,EAAE;CAClC,CAAA;AAED,MAAM,cAAc,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;AACjE,aAAa;AACb,eAAe,cAAc,CAAA;AAE7B,SAAS,oBAAoB;;IAC3B,MAAM,WAAW,GAAG,kBAAkB,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,mBAAmB,mCAAI,wBAAwB,CAAC,CAAC;IACpG,MAAM,SAAS,GAAG,kBAAkB,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,eAAe,mCAAI,uBAAuB,CAAC,CAAC;IAC7F,OAAO;QACL,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,kBAAkB,EAAE,GAAG;KACxB,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB;IAC1B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACxE,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAClE,OAAO;QACL,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,aAAa;QACb,kBAAkB,EAAE,CAAC,WAAW,CAAC;KAClC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/predicates.d.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/predicates.d.ts new file mode 100644 index 0000000000..8e81fc0515 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/predicates.d.ts @@ -0,0 +1 @@ +export declare function isNotNull(value: T | null): value is T; diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/predicates.js b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/predicates.js new file mode 100644 index 0000000000..b298e903bc --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/predicates.js @@ -0,0 +1,4 @@ +export function isNotNull(value) { + return value !== null; +} +//# sourceMappingURL=predicates.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/predicates.js.map b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/predicates.js.map new file mode 100644 index 0000000000..1fdec4adb8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/dist/universal/predicates.js.map @@ -0,0 +1 @@ +{"version":3,"file":"predicates.js","sourceRoot":"","sources":["../../universal/predicates.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAI,KAAe;IAC1C,OAAO,KAAK,KAAK,IAAI,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/HttpError.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/HttpError.ts index 3e8d3f5a0d..d05a2c841b 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/HttpError.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/HttpError.ts @@ -2,8 +2,8 @@ export class HttpError extends Error { public statusCode: number public data: unknown - constructor (statusCode: number, message?: string, data?: Record, ...params: unknown[]) { - super(message, ...params) + constructor (statusCode: number, message?: string, data?: Record, options?: ErrorOptions) { + super(message, options) if (Error.captureStackTrace) { Error.captureStackTrace(this, HttpError) diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/config.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/config.ts index 52699d800c..1dc9bafb93 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/config.ts +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/server/config.ts @@ -1,8 +1,8 @@ import merge from 'lodash.merge' -import { stripTrailingSlash } from "wasp/universal/url"; +import { stripTrailingSlash } from "../universal/url.js"; -const env = process.env.NODE_ENV || 'development' +const nodeEnv = process.env.NODE_ENV ?? 'development' // TODO: // - Use dotenv library to consume env vars from a file. @@ -33,9 +33,9 @@ const config: { production: EnvConfig, } = { all: { - env, - isDevelopment: env === 'development', - port: parseInt(process.env.PORT) || 3001, + env: nodeEnv, + isDevelopment: nodeEnv === 'development', + port: process.env.PORT ? parseInt(process.env.PORT) : 3001, databaseUrl: process.env.DATABASE_URL, allowedCORSOrigins: [], }, @@ -43,15 +43,17 @@ const config: { production: getProductionConfig(), } -const resolvedConfig: Config = merge(config.all, config[env]) +const resolvedConfig: Config = merge(config.all, config[nodeEnv]) // PUBLIC API export default resolvedConfig function getDevelopmentConfig(): EnvConfig { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL || 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL || 'http://localhost:3001'); + const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL ?? 'http://localhost:3000/'); + const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL ?? 'http://localhost:3001'); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, allowedCORSOrigins: '*', } @@ -61,8 +63,11 @@ function getProductionConfig(): EnvConfig { const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, + // @ts-ignore allowedCORSOrigins: [frontendUrl], } } diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/tsconfig.json b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/tsconfig.json index 8c7c86644c..5a3c9142c3 100644 --- a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/tsconfig.json +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/tsconfig.json @@ -13,11 +13,11 @@ "alwaysStrict": true, "noImplicitThis": true, "strictFunctionTypes": true, + "strictNullChecks": true, // See https://github.com/wasp-lang/wasp/issues/2056 before activating this: // "useUnknownInCatchVariables": true, - // The following 3 stict options will require more work: + // The following 2 stict options will require more work: // "noImplicitAny": true, - // "strictNullChecks": true, // "strictPropertyInitialization": true, // Overriding this because we want to use top-level await "module": "esnext", diff --git a/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/universal/predicates.ts b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/universal/predicates.ts new file mode 100644 index 0000000000..4294e839f0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspCompile-golden/waspCompile/.wasp/out/sdk/wasp/universal/predicates.ts @@ -0,0 +1,3 @@ +export function isNotNull(value: T | null): value is T { + return value !== null; +} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/files.manifest b/waspc/e2e-test/test-outputs/waspComplexTest-golden/files.manifest index 022dd0bf88..42ed7f7d09 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/files.manifest @@ -383,6 +383,9 @@ waspComplexTest/.wasp/out/sdk/wasp/dist/server/types/index.js.map waspComplexTest/.wasp/out/sdk/wasp/dist/server/utils.d.ts waspComplexTest/.wasp/out/sdk/wasp/dist/server/utils.js waspComplexTest/.wasp/out/sdk/wasp/dist/server/utils.js.map +waspComplexTest/.wasp/out/sdk/wasp/dist/universal/predicates.d.ts +waspComplexTest/.wasp/out/sdk/wasp/dist/universal/predicates.js +waspComplexTest/.wasp/out/sdk/wasp/dist/universal/predicates.js.map waspComplexTest/.wasp/out/sdk/wasp/dist/universal/types.d.ts waspComplexTest/.wasp/out/sdk/wasp/dist/universal/types.js waspComplexTest/.wasp/out/sdk/wasp/dist/universal/types.js.map @@ -452,6 +455,7 @@ waspComplexTest/.wasp/out/sdk/wasp/server/operations/wrappers.ts waspComplexTest/.wasp/out/sdk/wasp/server/types/index.ts waspComplexTest/.wasp/out/sdk/wasp/server/utils.ts waspComplexTest/.wasp/out/sdk/wasp/tsconfig.json +waspComplexTest/.wasp/out/sdk/wasp/universal/predicates.ts waspComplexTest/.wasp/out/sdk/wasp/universal/types.ts waspComplexTest/.wasp/out/sdk/wasp/universal/url.ts waspComplexTest/.wasp/out/sdk/wasp/universal/validators.ts diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/.waspchecksums b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/.waspchecksums index 3d46b6cec4..3a751612d7 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/.waspchecksums +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/.waspchecksums @@ -11,7 +11,7 @@ "file", "../out/sdk/wasp/api/index.ts" ], - "5784ba365e8a5cb2031571cfebf1cbae8670f86f8e5a596b133d333cdf6c91eb" + "2c300f215d89a72dad5e7a766dd97a64aa85b19126c96708487201b9b08a94f9" ], [ [ @@ -53,7 +53,7 @@ "file", "../out/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx" ], - "c3299b01607b1206208e3e24a2830932607e8783a660b51e8f9168cbb067aab1" + "2625c4c99d8925586320492a69923c487764868f4461430672b09587408c0d08" ], [ [ @@ -137,7 +137,7 @@ "file", "../out/sdk/wasp/auth/session.ts" ], - "637798c4cd8c130aad2efa254c89269ca31c14db8c3c2fa3efda8892105e00b7" + "21b17473562e8815c94292fb02d2f0a808bf35b6d1836514d5c833c8d4a195b2" ], [ [ @@ -151,28 +151,28 @@ "file", "../out/sdk/wasp/auth/useAuth.ts" ], - "ebb4fe26cb12321d247c03b136c48742e245de4b6be6886314313498aadf4455" + "d215bb817de2f9dc2a4d1fa45fdb3f81048ba0552eecec922b853592c19a56ac" ], [ [ "file", "../out/sdk/wasp/auth/user.ts" ], - "19b44865cb0a36e86b8ddcd7779ca33d517e08da2b25f66003a66bda543f1c44" + "def17b8f5c4602736fefb2aec8e3773cd368851509211fd1a470ff71b827dc2d" ], [ [ "file", "../out/sdk/wasp/auth/utils.ts" ], - "4285ab69fb43af4436b2d8b4f7f330d64036c9ec89a58c29cc700beb2edbb60e" + "ceed4ab4ea541402f329e480db98cce0478a00a5aec75e9071c7dd4457893010" ], [ [ "file", "../out/sdk/wasp/auth/validation.ts" ], - "1981d8fb5415493741e0483b3f998808c1978d9d80889895d9cf60a53ca86dd3" + "73863c3650235aa0c284f77d9c4282d9edf1fa5a8b1fe38a24a199c1f8292bd3" ], [ [ @@ -200,7 +200,7 @@ "file", "../out/sdk/wasp/client/config.ts" ], - "bc7d48bd7ec4cdf74f85b98113eb26e670ef265ca4bbd735e361409c9335ad85" + "d94e8bee5fd8f6793b511652b9ee558e57f4913595763137a5385cd929648168" ], [ [ @@ -249,7 +249,7 @@ "file", "../out/sdk/wasp/client/operations/hooks.ts" ], - "d1a8fccfb8207476b90708e8285d1455b33ff4e446749b33c3eb1a54dcfe2d41" + "3c326183d9dcb2bcf14b747ffc66b19e4773642d05f3f84d401e3d54b843eeca" ], [ [ @@ -263,7 +263,7 @@ "file", "../out/sdk/wasp/client/operations/internal/index.ts" ], - "f08a4f1fb1f897edca465b3f228215e06418109fb439232e8fa0ffdbdc98b833" + "d710d9894f56194c0d87921f339100414c69b987f1f5221881ca372fd70be371" ], [ [ @@ -354,7 +354,7 @@ "file", "../out/sdk/wasp/core/auth.ts" ], - "2cbfa9369a7fa606f520c27590e86f9ea907f95d41280a327f7e1848279b108f" + "1b07a9570069f0205c4028edaeb67f7591c19885b36b1c7cbf2faef386e7e85c" ], [ [ @@ -501,7 +501,7 @@ "file", "../out/sdk/wasp/server/HttpError.ts" ], - "eaa296c30acc65c78b90ebdf9a1d6fdb863f0c26c743d352afaeaa3bbc2fdd1b" + "f375fb45eeb16381b8cc575503db302c005ddaa1b35d837ca0ea043fe8ec6ccb" ], [ [ @@ -536,14 +536,14 @@ "file", "../out/sdk/wasp/server/auth/hooks.ts" ], - "1626df1c652b4f5d5f6a64c6537bae422243e62c867e668c16968738fd9637b1" + "3137bb3403d809e0e295604e20ac1221f56512bda873272bb7a49efd385e2108" ], [ [ "file", "../out/sdk/wasp/server/auth/index.ts" ], - "9f932aba0d2ca6d1d2ff6fd826d238da3719b7676e7b42e97430af6f86fd03e2" + "6daa9ed1d7ad0875bd5772a440de2fd229e9cd1bf3f44bde548eff467a68116d" ], [ [ @@ -585,21 +585,21 @@ "file", "../out/sdk/wasp/server/auth/oauth/redirect.ts" ], - "2fb01e01e8e5209c8b96b0f25f2fcab5fb30c0c8c3a228d65711f3ce11031942" + "912ed66e1f591ef7ce6c511db457b990f4346b652c8ae92087382fb3f5590dbe" ], [ [ "file", "../out/sdk/wasp/server/auth/user.ts" ], - "bc415fd61fe7333ffe30d850bd07b4eae823a6e7b70321f03d0d881808d1a412" + "ad863cca8d6b65c43e71d03855cc7edc104177cee43cd88db3e23112948c770d" ], [ [ "file", "../out/sdk/wasp/server/config.ts" ], - "0cb590d15087323479f4a0e3622c464b6f172979e01a35c71521d31f6457a46f" + "7222022fceced6be8ce57e8fd06ea6dfe2100de5984d7a9bc752ed4d9ba6f4ef" ], [ [ @@ -655,7 +655,7 @@ "file", "../out/sdk/wasp/server/email/index.ts" ], - "08076b4b3261c3f92be2111ad8bf0caeb40ecab5e89ae570cda8921e3cb06dc2" + "7fc9cea5624d921d9cd2397767522282e3f1a8a0013806f8d3e721560526b177" ], [ [ @@ -690,7 +690,7 @@ "file", "../out/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts" ], - "5f38460e959430e59c2e8fb8fd0f57493ea420e316258277bf67e4ba30e16cd8" + "19de68ae9a461b6e3455271aa7ff439827d2a6292a301a9ed61a24d912ac1773" ], [ [ @@ -711,14 +711,14 @@ "file", "../out/sdk/wasp/server/jobs/mySpecialJob.ts" ], - "e3ae9eef941de7e55ccee6ea13239cb727ddf82bfa96bc41b71954e8fe1d813e" + "d8aa9dcdb2d2e0202951925c7e2c51a9832dadefb1106f305c24457cc1392d34" ], [ [ "file", "../out/sdk/wasp/server/jobs/returnHelloJob.ts" ], - "0f341aa2be5e33738d87a73fd18b0c11c69c2be100250e7b8b0106283d31ff75" + "89fa4d76de6480949e9bfd2363dead22b07c821baa108da90a51dffd72f0ba54" ], [ [ @@ -795,7 +795,14 @@ "file", "../out/sdk/wasp/tsconfig.json" ], - "4323884e7e8c52683788995be58e8f583c00fc611845fdbd481157d0118dccd2" + "3b09df60f6728880a953a746ef887e045de0b533cb383f89d6adf8ff906edac8" + ], + [ + [ + "file", + "../out/sdk/wasp/universal/predicates.ts" + ], + "baa4148fdf4995cfc154a81bc494e9e8077635d4db50958d5b59837d1b8ed691" ], [ [ @@ -984,14 +991,14 @@ "file", "server/src/auth/providers/oauth/user.ts" ], - "0798bdc8635f62e693d7bb4df5ab5ee4ec08a59b43cee3ce14094fd9ae19c89e" + "c9ad77f70a0cfc66c79783e09a2cce9849e4bf03712b5c0b53ef1b73295c230c" ], [ [ "file", "server/src/crud/tasks.ts" ], - "4669fd5e3d7c04bd3383e95e600d2425b63c07543aa1df3384acebc3316d3ec2" + "3195b00d2511b0860fc13ca62d3950a00af39027be838cc140d5e88205a34614" ], [ [ @@ -1068,14 +1075,14 @@ "file", "server/src/routes/auth/logout.ts" ], - "76d35d8c93a580cdbcd51cf2030176865648d25ee25eaa8c00fa31ea0669bf81" + "359334c0f977e7406efda826f31a1ecf1c6b92dc72054bb41088c64d3555e916" ], [ [ "file", "server/src/routes/auth/me.ts" ], - "aad9eb2527d58a3d8226ed7ae6c15a09eac7bbb74c58816d01b38fc0a67e2c08" + "da6eff1a2bb7855987343b030e66fc76316d38705f004aa8071213fff6029e00" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/api/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/api/index.ts index 6037b3048c..c8895b1275 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/api/index.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/api/index.ts @@ -77,7 +77,7 @@ window.addEventListener('storage', (event) => { * standard format to be further used by the client. It is also assumed that given API * error has been formatted as implemented by HttpError on the server. */ -export function handleApiError(error: AxiosError<{ message?: string, data?: unknown }>): void { +export function handleApiError>(error: T): T | WaspHttpError { if (error?.response) { // If error came from HTTP response, we capture most informative message // and also add .statusCode information to it. @@ -88,10 +88,10 @@ export function handleApiError(error: AxiosError<{ message?: string, data?: unkn // That would require copying HttpError code to web-app also and using it here. const responseJson = error.response?.data const responseStatusCode = error.response.status - throw new WaspHttpError(responseStatusCode, responseJson?.message ?? error.message, responseJson) + return new WaspHttpError(responseStatusCode, responseJson?.message ?? error.message, responseJson) } else { // If any other error, we just propagate it. - throw error + return error } } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx index d2d0fecbb2..c31332ea00 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/forms/internal/common/LoginSignupForm.tsx @@ -106,7 +106,7 @@ function AdditionalFormFields({ }: { hookForm: UseFormReturn; formState: FormState; - additionalSignupFields: AdditionalSignupFields; + additionalSignupFields?: AdditionalSignupFields; }) { const { register, @@ -119,6 +119,7 @@ function AdditionalFormFields({ Component: any, props?: React.ComponentProps ) { + const errorMessage = errors[field.name]?.message; return ( {field.label} @@ -127,8 +128,8 @@ function AdditionalFormFields({ {...props} disabled={isLoading} /> - {errors[field.name] && ( - {errors[field.name].message} + {errorMessage && ( + {errorMessage} )} ); @@ -167,7 +168,7 @@ function isFieldRenderFn( } function areAdditionalFieldsRenderFn( - additionalSignupFields: AdditionalSignupFields + additionalSignupFields?: AdditionalSignupFields ): additionalSignupFields is AdditionalSignupFieldRenderFn { return typeof additionalSignupFields === 'function' } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/session.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/session.ts index 471824c991..bf673d7ccc 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/session.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/session.ts @@ -5,7 +5,7 @@ import { type AuthUserData } from '../server/auth/user.js'; import { auth } from "./lucia.js"; import type { Session } from "lucia"; -import { throwInvalidCredentialsError } from "./utils.js"; +import { createInvalidCredentialsError } from "./utils.js"; import { prisma } from 'wasp/server'; import { createAuthUserData } from "../server/auth/user.js"; @@ -65,7 +65,7 @@ async function getAuthUserData(userId: User['id']): Promise { }) if (!user) { - throwInvalidCredentialsError() + throw createInvalidCredentialsError() } return createAuthUserData(user); diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/useAuth.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/useAuth.ts index 416ae3d685..11dd820dc6 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/useAuth.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/useAuth.ts @@ -27,7 +27,7 @@ function createUserGetter(): Query { if (error.response?.status === 401) { return null } else { - handleApiError(error) + throw handleApiError(error) } } } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/user.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/user.ts index 9310d32544..c32e17cc51 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/user.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/user.ts @@ -4,6 +4,7 @@ import type { AuthUser, UserEntityWithAuth, } from '../server/auth/user.js' +import { isNotNull } from '../universal/predicates.js' /** * We split the user.ts code into two files to avoid some server-only @@ -35,6 +36,7 @@ export type { AuthUserData, AuthUser } from '../server/auth/user.js' // PRIVATE API (used in SDK and server) export function makeAuthUserIfPossible(user: null): null export function makeAuthUserIfPossible(user: AuthUserData): AuthUser +export function makeAuthUserIfPossible(user: AuthUserData | null): AuthUser | null export function makeAuthUserIfPossible( user: AuthUserData | null, ): AuthUser | null { @@ -45,13 +47,13 @@ function makeAuthUser(data: AuthUserData): AuthUser { return { ...data, getFirstProviderUserId: () => { - const identities = Object.values(data.identities).filter(Boolean); + const identities = Object.values(data.identities).filter(isNotNull); return identities.length > 0 ? identities[0].id : null; }, }; } -function findUserIdentity(user: UserEntityWithAuth, providerName: ProviderName): UserEntityWithAuth['auth']['identities'][number] | null { +function findUserIdentity(user: UserEntityWithAuth, providerName: ProviderName): NonNullable['identities'][number] | null { if (!user.auth) { return null; } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/utils.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/utils.ts index 5996aa579f..98836339b1 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/utils.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/utils.ts @@ -109,7 +109,7 @@ export async function updateAuthIdentityProviderData( ): Promise { // We are doing the sanitization here only on updates to avoid // hashing the password multiple times. - const sanitizedProviderDataUpdates = await sanitizeProviderData(providerDataUpdates); + const sanitizedProviderDataUpdates = await ensurePasswordIsHashed(providerDataUpdates); const newProviderData = { ...existingProviderData, ...sanitizedProviderDataUpdates, @@ -123,15 +123,31 @@ export async function updateAuthIdentityProviderData( }); } -type FindAuthWithUserResult = Auth & { +// PRIVATE API +export type FindAuthWithUserResult = Auth & { user: User } // PRIVATE API export async function findAuthWithUserBy( where: Prisma.AuthWhereInput -): Promise { - return prisma.auth.findFirst({ where, include: { user: true }}); +): Promise { + const result = await prisma.auth.findFirst({ where, include: { user: true }}); + + if (result === null) { + return null; + } + + if (result.user === null) { + return null; + } + + return { ...result, user: result.user }; +} + +// PUBLIC API +export type CreateUserResult = User & { + auth: Auth | null } // PUBLIC API @@ -139,9 +155,7 @@ export async function createUser( providerId: ProviderId, serializedProviderData?: string, userFields?: PossibleUserFields, -): Promise { +): Promise { return prisma.user.create({ data: { // Using any here to prevent type errors when userFields are not @@ -260,18 +274,29 @@ export async function validateAndGetUserFields( } // PUBLIC API -export function deserializeAndSanitizeProviderData( +export function getProviderData( + providerData: string, +): Omit { + return sanitizeProviderData(getProviderDataWithPassword(providerData)); +} + +// PUBLIC API +export function getProviderDataWithPassword( providerData: string, - { shouldRemovePasswordField = false }: { shouldRemovePasswordField?: boolean } = {}, ): PossibleProviderData[PN] { // NOTE: We are letting JSON.parse throw an error if the providerData is not valid JSON. - let data = JSON.parse(providerData) as PossibleProviderData[PN]; + return JSON.parse(providerData); +} - if (providerDataHasPasswordField(data) && shouldRemovePasswordField) { - delete data.hashedPassword; +function sanitizeProviderData( + providerData: PossibleProviderData[PN], +): Omit { + if (providerDataHasPasswordField(providerData)) { + const { hashedPassword, ...rest } = providerData; + return rest; + } else { + return providerData; } - - return data; } // PUBLIC API @@ -279,7 +304,7 @@ export async function sanitizeAndSerializeProviderData( providerData: PossibleProviderData[PN], ): Promise { return serializeProviderData( - await sanitizeProviderData(providerData) + await ensurePasswordIsHashed(providerData) ); } @@ -287,7 +312,7 @@ function serializeProviderData(providerData: PossiblePr return JSON.stringify(providerData); } -async function sanitizeProviderData( +async function ensurePasswordIsHashed( providerData: PossibleProviderData[PN], ): Promise { const data = { @@ -308,6 +333,6 @@ function providerDataHasPasswordField( } // PRIVATE API -export function throwInvalidCredentialsError(message?: string): void { - throw new HttpError(401, 'Invalid credentials', { message }) +export function createInvalidCredentialsError(message?: string): HttpError { + return new HttpError(401, 'Invalid credentials', { message }) } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/validation.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/validation.ts index 637f4203fd..3ea1e08397 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/validation.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/auth/validation.ts @@ -6,7 +6,7 @@ const EMAIL_FIELD = 'email'; const TOKEN_FIELD = 'token'; // PUBLIC API -export function ensureValidEmail(args: unknown): void { +export function ensureValidEmail(args: object): void { validate(args, [ { validates: EMAIL_FIELD, message: 'email must be present', validator: email => !!email }, { validates: EMAIL_FIELD, message: 'email must be a valid email', validator: email => isValidEmail(email) }, @@ -14,21 +14,21 @@ export function ensureValidEmail(args: unknown): void { } // PUBLIC API -export function ensureValidUsername(args: unknown): void { +export function ensureValidUsername(args: object): void { validate(args, [ { validates: USERNAME_FIELD, message: 'username must be present', validator: username => !!username } ]); } // PUBLIC API -export function ensurePasswordIsPresent(args: unknown): void { +export function ensurePasswordIsPresent(args: object): void { validate(args, [ { validates: PASSWORD_FIELD, message: 'password must be present', validator: password => !!password }, ]); } // PUBLIC API -export function ensureValidPassword(args: unknown): void { +export function ensureValidPassword(args: object): void { validate(args, [ { validates: PASSWORD_FIELD, message: 'password must be at least 8 characters', validator: password => isMinLength(password, 8) }, { validates: PASSWORD_FIELD, message: 'password must contain a number', validator: password => containsNumber(password) }, @@ -36,7 +36,7 @@ export function ensureValidPassword(args: unknown): void { } // PUBLIC API -export function ensureTokenIsPresent(args: unknown): void { +export function ensureTokenIsPresent(args: object): void { validate(args, [ { validates: TOKEN_FIELD, message: 'token must be present', validator: token => !!token }, ]); @@ -47,7 +47,7 @@ export function throwValidationError(message: string): void { throw new HttpError(422, 'Validation failed', { message }) } -function validate(args: unknown, validators: { validates: string, message: string, validator: (value: unknown) => boolean }[]): void { +function validate(args: object, validators: { validates: string, message: string, validator: (value: unknown) => boolean }[]): void { for (const { validates, message, validator } of validators) { if (!validator(args[validates])) { throwValidationError(message); diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/config.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/config.ts index 2f9967891e..82b0f80b6a 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/config.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/config.ts @@ -1,4 +1,4 @@ -import { stripTrailingSlash } from 'wasp/universal/url' +import { stripTrailingSlash } from '../universal/url.js' const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/hooks.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/hooks.ts index 0f03f3167a..7ac0aac46d 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/hooks.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/hooks.ts @@ -28,8 +28,12 @@ export function useQuery( return rqUseQuery({ // todo: The full queryCacheKey is constructed in two places, both here and // inside the Query. See https://github.com/wasp-lang/wasp/issues/2017 - queryKey: makeQueryCacheKey(query, queryFnArgs), - queryFn: () => query(queryFnArgs), + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryKey: makeQueryCacheKey(query, (queryFnArgs as Input)), + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryFn: () => query(queryFnArgs as Input), ...options, }) } @@ -138,7 +142,7 @@ type InternalOptimisticUpdateDefinition = { * the current state of the cache and returns the desired (new) state of the * cache. */ -type SpecificUpdateQuery = (oldData: CachedData) => CachedData; +type SpecificUpdateQuery = (oldData: CachedData | undefined) => CachedData; /** * A specific, "instantiated" optimistic update definition which contains a @@ -170,7 +174,7 @@ function translateToInternalDefinition( ): InternalOptimisticUpdateDefinition { const { getQuerySpecifier, updateQuery } = publicOptimisticUpdateDefinition; - const definitionErrors = []; + const definitionErrors: string[] = []; if (typeof getQuerySpecifier !== "function") { definitionErrors.push("`getQuerySpecifier` is not a function."); } @@ -204,7 +208,7 @@ function makeOptimisticUpdateMutationFn( CachedData >[] ): typeof actionFn { - return (function performActionWithOptimisticUpdates(item?: Input) { + return (function performActionWithOptimisticUpdates(item: Input) { const specificOptimisticUpdateDefinitions = optimisticUpdateDefinitions.map( (generalDefinition) => getOptimisticUpdateDefinitionForSpecificItem(generalDefinition, item) @@ -259,10 +263,10 @@ function makeRqOptimisticUpdateOptions( ); // We're using a Map to correctly serialize query keys that contain objects. - const previousData = new Map(); + const previousData: Map = new Map(); specificOptimisticUpdateDefinitions.forEach(({ queryKey, updateQuery }) => { // Snapshot the currently cached value. - const previousDataForQuery: CachedData = + const previousDataForQuery: CachedData | undefined = queryClient.getQueryData(queryKey); // Attempt to optimistically update the cache using the new value. diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/internal/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/internal/index.ts index 28c9ceef98..17bc0e8abf 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/internal/index.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/client/operations/internal/index.ts @@ -15,7 +15,7 @@ export async function callOperation(operationRoute: OperationRoute, args: any) { const response = await api.post(operationRoute.path, superjsonArgs) return superjsonDeserialize(response.data) } catch (error) { - handleApiError(error) + throw handleApiError(error) } } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/core/auth.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/core/auth.ts index 8a7f3efc2a..fcc3303b16 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/core/auth.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/core/auth.ts @@ -1,6 +1,6 @@ import { handleRejection } from 'wasp/server/utils' import { getSessionAndUserFromBearerToken } from 'wasp/auth/session' -import { throwInvalidCredentialsError } from 'wasp/auth/utils' +import { createInvalidCredentialsError } from 'wasp/auth/utils' /** * Auth middleware @@ -28,7 +28,7 @@ const auth = handleRejection(async (req, res, next) => { const sessionAndUser = await getSessionAndUserFromBearerToken(req) if (sessionAndUser === null) { - throwInvalidCredentialsError() + throw createInvalidCredentialsError() } req.sessionId = sessionAndUser.session.id diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/api/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/api/index.d.ts index c39a409f75..6971aac805 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/api/index.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/api/index.d.ts @@ -9,7 +9,13 @@ export declare function removeLocalUserData(): void; * standard format to be further used by the client. It is also assumed that given API * error has been formatted as implemented by HttpError on the server. */ -export declare function handleApiError(error: AxiosError<{ +export declare function handleApiError): void; +}>>(error: T): T | WaspHttpError; +declare class WaspHttpError extends Error { + statusCode: number; + data: unknown; + constructor(statusCode: number, message: string, data: unknown); +} +export {}; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/api/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/api/index.js index 07e05c03f9..df5d608aa4 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/api/index.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/api/index.js @@ -79,11 +79,11 @@ export function handleApiError(error) { // That would require copying HttpError code to web-app also and using it here. const responseJson = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data; const responseStatusCode = error.response.status; - throw new WaspHttpError(responseStatusCode, (_b = responseJson === null || responseJson === void 0 ? void 0 : responseJson.message) !== null && _b !== void 0 ? _b : error.message, responseJson); + return new WaspHttpError(responseStatusCode, (_b = responseJson === null || responseJson === void 0 ? void 0 : responseJson.message) !== null && _b !== void 0 ? _b : error.message, responseJson); } else { // If any other error, we just propagate it. - throw error; + return error; } } class WaspHttpError extends Error { diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/api/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/api/index.js.map index 86433530c0..239cd44a19 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/api/index.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/api/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAA8C,MAAM,OAAO,CAAA;AAElE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE9C,aAAa;AACb,MAAM,CAAC,MAAM,GAAG,GAAkB,KAAK,CAAC,MAAM,CAAC;IAC7C,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CAAC,CAAA;AAEF,MAAM,6BAA6B,GAAG,WAAW,CAAA;AAEjD,IAAI,oBAAoB,GAAG,OAAO,CA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D,KAAQ;;IACjG,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,EAAE,CAAC;QACpB,wEAAwE;QACxE,8CAA8C;QAC9C,8EAA8E;QAC9E,8BAA8B;QAC9B,yEAAyE;QACzE,iEAAiE;QACjE,iFAAiF;QACjF,MAAM,YAAY,GAAG,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI,CAAA;QACzC,MAAM,kBAAkB,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAA;QAChD,OAAO,IAAI,aAAa,CAAC,kBAAkB,EAAE,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,mCAAI,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;IACpG,CAAC;SAAM,CAAC;QACN,4CAA4C;QAC5C,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAED,MAAM,aAAc,SAAQ,KAAK;IAK/B,YAAa,UAAkB,EAAE,OAAe,EAAE,IAAa;QAC7D,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;CACF"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Form.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Form.d.ts index 4caaa1c29e..ba2df28c0c 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Form.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Form.d.ts @@ -1,168 +1,168 @@ export declare const Form: import("@stitches/react/types/styled-component").StyledComponent<"form", {}, {}, import("@stitches/react/types/css-util").CSS<{}, { colors: { - waspYellow: string; - gray900: string; - gray700: string; - gray600: string; - gray500: string; - gray400: string; - red: string; - darkRed: string; - green: string; - brand: string; - brandAccent: string; - errorBackground: string; - errorText: string; - successBackground: string; - successText: string; - submitButtonText: string; - formErrorText: string; + waspYellow: "#ffcc00"; + gray900: "#1a202c"; + gray700: "#a1a5ab"; + gray600: "#d1d5db"; + gray500: "gainsboro"; + gray400: "#f0f0f0"; + red: "#FED7D7"; + darkRed: "#fa3838"; + green: "#C6F6D5"; + brand: "$waspYellow"; + brandAccent: "#ffdb46"; + errorBackground: "$red"; + errorText: "#2D3748"; + successBackground: "$green"; + successText: "#2D3748"; + submitButtonText: "black"; + formErrorText: "$darkRed"; }; fontSizes: { - sm: string; + sm: "0.875rem"; }; }, import("@stitches/react/types/config").DefaultThemeMap, {}>>; export declare const FormItemGroup: import("@stitches/react/types/styled-component").StyledComponent<"div", {}, {}, import("@stitches/react/types/css-util").CSS<{}, { colors: { - waspYellow: string; - gray900: string; - gray700: string; - gray600: string; - gray500: string; - gray400: string; - red: string; - darkRed: string; - green: string; - brand: string; - brandAccent: string; - errorBackground: string; - errorText: string; - successBackground: string; - successText: string; - submitButtonText: string; - formErrorText: string; + waspYellow: "#ffcc00"; + gray900: "#1a202c"; + gray700: "#a1a5ab"; + gray600: "#d1d5db"; + gray500: "gainsboro"; + gray400: "#f0f0f0"; + red: "#FED7D7"; + darkRed: "#fa3838"; + green: "#C6F6D5"; + brand: "$waspYellow"; + brandAccent: "#ffdb46"; + errorBackground: "$red"; + errorText: "#2D3748"; + successBackground: "$green"; + successText: "#2D3748"; + submitButtonText: "black"; + formErrorText: "$darkRed"; }; fontSizes: { - sm: string; + sm: "0.875rem"; }; }, import("@stitches/react/types/config").DefaultThemeMap, {}>>; export declare const FormLabel: import("@stitches/react/types/styled-component").StyledComponent<"label", {}, {}, import("@stitches/react/types/css-util").CSS<{}, { colors: { - waspYellow: string; - gray900: string; - gray700: string; - gray600: string; - gray500: string; - gray400: string; - red: string; - darkRed: string; - green: string; - brand: string; - brandAccent: string; - errorBackground: string; - errorText: string; - successBackground: string; - successText: string; - submitButtonText: string; - formErrorText: string; + waspYellow: "#ffcc00"; + gray900: "#1a202c"; + gray700: "#a1a5ab"; + gray600: "#d1d5db"; + gray500: "gainsboro"; + gray400: "#f0f0f0"; + red: "#FED7D7"; + darkRed: "#fa3838"; + green: "#C6F6D5"; + brand: "$waspYellow"; + brandAccent: "#ffdb46"; + errorBackground: "$red"; + errorText: "#2D3748"; + successBackground: "$green"; + successText: "#2D3748"; + submitButtonText: "black"; + formErrorText: "$darkRed"; }; fontSizes: { - sm: string; + sm: "0.875rem"; }; }, import("@stitches/react/types/config").DefaultThemeMap, {}>>; export declare const FormInput: import("@stitches/react/types/styled-component").StyledComponent<"input", {}, {}, import("@stitches/react/types/css-util").CSS<{}, { colors: { - waspYellow: string; - gray900: string; - gray700: string; - gray600: string; - gray500: string; - gray400: string; - red: string; - darkRed: string; - green: string; - brand: string; - brandAccent: string; - errorBackground: string; - errorText: string; - successBackground: string; - successText: string; - submitButtonText: string; - formErrorText: string; + waspYellow: "#ffcc00"; + gray900: "#1a202c"; + gray700: "#a1a5ab"; + gray600: "#d1d5db"; + gray500: "gainsboro"; + gray400: "#f0f0f0"; + red: "#FED7D7"; + darkRed: "#fa3838"; + green: "#C6F6D5"; + brand: "$waspYellow"; + brandAccent: "#ffdb46"; + errorBackground: "$red"; + errorText: "#2D3748"; + successBackground: "$green"; + successText: "#2D3748"; + submitButtonText: "black"; + formErrorText: "$darkRed"; }; fontSizes: { - sm: string; + sm: "0.875rem"; }; }, import("@stitches/react/types/config").DefaultThemeMap, {}>>; export declare const FormTextarea: import("@stitches/react/types/styled-component").StyledComponent<"textarea", {}, {}, import("@stitches/react/types/css-util").CSS<{}, { colors: { - waspYellow: string; - gray900: string; - gray700: string; - gray600: string; - gray500: string; - gray400: string; - red: string; - darkRed: string; - green: string; - brand: string; - brandAccent: string; - errorBackground: string; - errorText: string; - successBackground: string; - successText: string; - submitButtonText: string; - formErrorText: string; + waspYellow: "#ffcc00"; + gray900: "#1a202c"; + gray700: "#a1a5ab"; + gray600: "#d1d5db"; + gray500: "gainsboro"; + gray400: "#f0f0f0"; + red: "#FED7D7"; + darkRed: "#fa3838"; + green: "#C6F6D5"; + brand: "$waspYellow"; + brandAccent: "#ffdb46"; + errorBackground: "$red"; + errorText: "#2D3748"; + successBackground: "$green"; + successText: "#2D3748"; + submitButtonText: "black"; + formErrorText: "$darkRed"; }; fontSizes: { - sm: string; + sm: "0.875rem"; }; }, import("@stitches/react/types/config").DefaultThemeMap, {}>>; export declare const FormError: import("@stitches/react/types/styled-component").StyledComponent<"div", {}, {}, import("@stitches/react/types/css-util").CSS<{}, { colors: { - waspYellow: string; - gray900: string; - gray700: string; - gray600: string; - gray500: string; - gray400: string; - red: string; - darkRed: string; - green: string; - brand: string; - brandAccent: string; - errorBackground: string; - errorText: string; - successBackground: string; - successText: string; - submitButtonText: string; - formErrorText: string; + waspYellow: "#ffcc00"; + gray900: "#1a202c"; + gray700: "#a1a5ab"; + gray600: "#d1d5db"; + gray500: "gainsboro"; + gray400: "#f0f0f0"; + red: "#FED7D7"; + darkRed: "#fa3838"; + green: "#C6F6D5"; + brand: "$waspYellow"; + brandAccent: "#ffdb46"; + errorBackground: "$red"; + errorText: "#2D3748"; + successBackground: "$green"; + successText: "#2D3748"; + submitButtonText: "black"; + formErrorText: "$darkRed"; }; fontSizes: { - sm: string; + sm: "0.875rem"; }; }, import("@stitches/react/types/config").DefaultThemeMap, {}>>; export declare const SubmitButton: import("@stitches/react/types/styled-component").StyledComponent<"button", {}, {}, import("@stitches/react/types/css-util").CSS<{}, { colors: { - waspYellow: string; - gray900: string; - gray700: string; - gray600: string; - gray500: string; - gray400: string; - red: string; - darkRed: string; - green: string; - brand: string; - brandAccent: string; - errorBackground: string; - errorText: string; - successBackground: string; - successText: string; - submitButtonText: string; - formErrorText: string; + waspYellow: "#ffcc00"; + gray900: "#1a202c"; + gray700: "#a1a5ab"; + gray600: "#d1d5db"; + gray500: "gainsboro"; + gray400: "#f0f0f0"; + red: "#FED7D7"; + darkRed: "#fa3838"; + green: "#C6F6D5"; + brand: "$waspYellow"; + brandAccent: "#ffdb46"; + errorBackground: "$red"; + errorText: "#2D3748"; + successBackground: "$green"; + successText: "#2D3748"; + submitButtonText: "black"; + formErrorText: "$darkRed"; }; fontSizes: { - sm: string; + sm: "0.875rem"; }; }, import("@stitches/react/types/config").DefaultThemeMap, {}>>; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Message.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Message.d.ts index af7098b548..0f2a642502 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Message.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/Message.d.ts @@ -1,118 +1,118 @@ export declare const Message: import("@stitches/react/types/styled-component").StyledComponent<"div", {}, {}, import("@stitches/react/types/css-util").CSS<{}, { colors: { - waspYellow: string; - gray900: string; - gray700: string; - gray600: string; - gray500: string; - gray400: string; - red: string; - darkRed: string; - green: string; - brand: string; - brandAccent: string; - errorBackground: string; - errorText: string; - successBackground: string; - successText: string; - submitButtonText: string; - formErrorText: string; + waspYellow: "#ffcc00"; + gray900: "#1a202c"; + gray700: "#a1a5ab"; + gray600: "#d1d5db"; + gray500: "gainsboro"; + gray400: "#f0f0f0"; + red: "#FED7D7"; + darkRed: "#fa3838"; + green: "#C6F6D5"; + brand: "$waspYellow"; + brandAccent: "#ffdb46"; + errorBackground: "$red"; + errorText: "#2D3748"; + successBackground: "$green"; + successText: "#2D3748"; + submitButtonText: "black"; + formErrorText: "$darkRed"; }; fontSizes: { - sm: string; + sm: "0.875rem"; }; }, import("@stitches/react/types/config").DefaultThemeMap, {}>>; export declare const MessageError: import("@stitches/react/types/styled-component").StyledComponent>, {}, {}, import("@stitches/react/types/css-util").CSS<{}, { colors: { - waspYellow: string; - gray900: string; - gray700: string; - gray600: string; - gray500: string; - gray400: string; - red: string; - darkRed: string; - green: string; - brand: string; - brandAccent: string; - errorBackground: string; - errorText: string; - successBackground: string; - successText: string; - submitButtonText: string; - formErrorText: string; + waspYellow: "#ffcc00"; + gray900: "#1a202c"; + gray700: "#a1a5ab"; + gray600: "#d1d5db"; + gray500: "gainsboro"; + gray400: "#f0f0f0"; + red: "#FED7D7"; + darkRed: "#fa3838"; + green: "#C6F6D5"; + brand: "$waspYellow"; + brandAccent: "#ffdb46"; + errorBackground: "$red"; + errorText: "#2D3748"; + successBackground: "$green"; + successText: "#2D3748"; + submitButtonText: "black"; + formErrorText: "$darkRed"; }; fontSizes: { - sm: string; + sm: "0.875rem"; }; }, import("@stitches/react/types/config").DefaultThemeMap, {}>>; export declare const MessageSuccess: import("@stitches/react/types/styled-component").StyledComponent>, {}, {}, import("@stitches/react/types/css-util").CSS<{}, { colors: { - waspYellow: string; - gray900: string; - gray700: string; - gray600: string; - gray500: string; - gray400: string; - red: string; - darkRed: string; - green: string; - brand: string; - brandAccent: string; - errorBackground: string; - errorText: string; - successBackground: string; - successText: string; - submitButtonText: string; - formErrorText: string; + waspYellow: "#ffcc00"; + gray900: "#1a202c"; + gray700: "#a1a5ab"; + gray600: "#d1d5db"; + gray500: "gainsboro"; + gray400: "#f0f0f0"; + red: "#FED7D7"; + darkRed: "#fa3838"; + green: "#C6F6D5"; + brand: "$waspYellow"; + brandAccent: "#ffdb46"; + errorBackground: "$red"; + errorText: "#2D3748"; + successBackground: "$green"; + successText: "#2D3748"; + submitButtonText: "black"; + formErrorText: "$darkRed"; }; fontSizes: { - sm: string; + sm: "0.875rem"; }; }, import("@stitches/react/types/config").DefaultThemeMap, {}>>; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.jsx b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.jsx index cfffd53164..c211df1cea 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.jsx +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.jsx @@ -64,10 +64,12 @@ function AdditionalFormFields({ hookForm, formState: { isLoading }, additionalSi function renderField(field, // Ideally we would use ComponentType here, but it doesn't work with react-hook-form Component, props) { + var _a; + const errorMessage = (_a = errors[field.name]) === null || _a === void 0 ? void 0 : _a.message; return ( {field.label} - {errors[field.name] && ({errors[field.name].message})} + {errorMessage && ({errorMessage})} ); } if (areAdditionalFieldsRenderFn(additionalSignupFields)) { diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.jsx.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.jsx.map index b3bb264b89..1ba905f87d 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.jsx.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/common/LoginSignupForm.jsx.map @@ -1 +1 @@ -{"version":3,"file":"LoginSignupForm.jsx","sourceRoot":"","sources":["../../../../../auth/forms/internal/common/LoginSignupForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,E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sB,KAAK,UAAU,CAAA;AACrD,CAAC"} \ No newline at end of file +{"version":3,"file":"LoginSignupForm.jsx","sourceRoot":"","sources":["../../../../../auth/forms/internal/common/LoginSignupForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,EAAE,OAAO,EAAiB,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAEL,SAAS,EACT,aAAa,EACb,SAAS,EACT,SAAS,EACT,YAAY,GAEb,MAAM,SAAS,CAAA;AAOhB,OAAO,KAAK,WAAW,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAErD,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,EAAE;IAC7B,SAAS,EAAE,QAAQ;CACtB,CAAC,CAAA;AAEF,MAAM,eAAe,GAAG,MAAM,CAAC,KAAK,EAAE;IAClC,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,KAAK;CAClB,CAAC,CAAA;AAEF,MAAM,iBAAiB,GAAG,MAAM,CAAC,KAAK,EAAE;IACpC,SAAS,EAAE,QAAQ;IACnB,OAAO,EAAE,MAAM;IAEf,QAAQ,EAAE;QACN,SAAS,EAAE;YACP,UAAU,EAAE;gBACR,OAAO,EAAE,MAAM;gBACf,mBAAmB,EAAE,qCAAqC;aAC7D;YACD,QAAQ,EAAE;gBACN,aAAa,EAAE,QAAQ;gBACvB,MAAM,EAAE,OAAO;aAClB;SACJ;QACD,GAAG,EAAE;YACD,KAAK,EAAE;gBACH,GAAG,EAAE,KAAK;aACb;YACD,MAAM,EAAE;gBACJ,GAAG,EAAE,KAAK;aACb;YACD,KAAK,EAAE;gBACH,GAAG,EAAE,MAAM;aACd;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AAE,CAC1D,CAAA;YACL,CAAC;QACH,CAAC,CAAC,CACH,CAAA;AACH,CAAC;AAED,SAAS,eAAe,CACtB,qBAA4E;IAE5E,OAAO,OAAO,qBAAqB,KAAK,UAAU,CAAA;AACpD,CAAC;AAED,SAAS,2BAA2B,CAClC,sBAA+C;IAE/C,OAAO,OAAO,sBAAsB,KAAK,UAAU,CAAA;AACrD,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialButton.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialButton.d.ts index 96a40ee48f..ffd2f3536c 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialButton.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/forms/internal/social/SocialButton.d.ts @@ -1,24 +1,24 @@ export declare const SocialButton: import("@stitches/react/types/styled-component").StyledComponent<"a", {}, {}, import("@stitches/react/types/css-util").CSS<{}, { colors: { - waspYellow: string; - gray900: string; - gray700: string; - gray600: string; - gray500: string; - gray400: string; - red: string; - darkRed: string; - green: string; - brand: string; - brandAccent: string; - errorBackground: string; - errorText: string; - successBackground: string; - successText: string; - submitButtonText: string; - formErrorText: string; + waspYellow: "#ffcc00"; + gray900: "#1a202c"; + gray700: "#a1a5ab"; + gray600: "#d1d5db"; + gray500: "gainsboro"; + gray400: "#f0f0f0"; + red: "#FED7D7"; + darkRed: "#fa3838"; + green: "#C6F6D5"; + brand: "$waspYellow"; + brandAccent: "#ffdb46"; + errorBackground: "$red"; + errorText: "#2D3748"; + successBackground: "$green"; + successText: "#2D3748"; + submitButtonText: "black"; + formErrorText: "$darkRed"; }; fontSizes: { - sm: string; + sm: "0.875rem"; }; }, import("@stitches/react/types/config").DefaultThemeMap, {}>>; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.js index 4594be052d..7370caed9b 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.js @@ -1,5 +1,5 @@ import { auth } from "./lucia.js"; -import { throwInvalidCredentialsError } from "./utils.js"; +import { createInvalidCredentialsError } from "./utils.js"; import { prisma } from 'wasp/server'; import { createAuthUserData } from "../server/auth/user.js"; // PRIVATE API @@ -43,7 +43,7 @@ async function getAuthUserData(userId) { } }); if (!user) { - throwInvalidCredentialsError(); + throw createInvalidCredentialsError(); } return createAuthUserData(user); } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.js.map index 4036d2b282..ba46cedeb7 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/session.js.map @@ -1 +1 @@ -{"version":3,"file":"session.js","sourceRoot":"","sources":["../../auth/session.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,OAAO,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAE1D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,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C,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,OAAO;QACP,IAAI,EAAE,MAAM,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC;KAC/C,CAAA;AACH,CAAC;AAED,KAAK,UAAU,eAAe,CAAC,MAAkB;IAC/C,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI;SAC3B,UAAU,CAAC;QACV,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;QACrB,OAAO,EAAE;YACP,IAAI,EAAE;gBACJ,OAAO,EAAE;oBACP,UAAU,EAAE,IAAI;iBACjB;aACF;SACF;KACF,CAAC,CAAA;IAEJ,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,6BAA6B,EAAE,CAAA;IACvC,CAAC;IAED,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAED,cAAc;AACd,MAAM,UAAU,iBAAiB,CAAC,SAAiB;IACjD,OAAO,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;AAC3C,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.js index a72bd6b1b0..e44a4c353c 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.js @@ -24,7 +24,7 @@ function createUserGetter() { return null; } else { - handleApiError(error); + throw handleApiError(error); } } }; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.js.map index 58c84b290c..1dc4bc9773 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/useAuth.js.map @@ -1 +1 @@ -{"version":3,"file":"useAuth.js","sourceRoot":"","sources":["../../auth/useAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAC/D,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAExE,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAGxD,aAAa;AACb,MAAM,CAAC,MAAM,KAAK,GAAiC,gBAAgB,EAAE,CAAA;AAErE,aAAa;AACb,MAAM,CAAC,OAAO,UAAU,OAAO;IAC7B,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAA;AACxB,CAAC;AAED,SAAS,gBAAgB;IACvB,MAAM,iBAAiB,GAAG,SAAS,CAAA;IACnC,MAAM,UAAU,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,iBAAiB,EAAE,EAAE,CAAA;IAC5E,MAAM,KAAK,GAAyC,KAAK,IAAI,EAAE;;QAC7D,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;YAC/C,MAAM,QAAQ,GAAG,oBAAoB,CAAsB,QAAQ,CAAC,IAAI,CAAC,CAAA;YACzE,OAAO,sBAAsB,CAAC,QAAQ,CAAC,CAAA;QACz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AAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;YAC/C,MAAM,QAAQ,GAAG,oBAAoB,CAAsB,QAAQ,CAAC,IAAI,CAAC,CAAA;YACzE,OAAO,sBAAsB,CAAC,QAAQ,CAAC,CAAA;QACzC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM,MAAK,GAAG,EAAE,CAAC;gBACnC,OAAO,IAAI,CAAA;YACb,CAAC;iBAAM,CAAC;gBACN,MAAM,cAAc,CAAC,KAAK,CAAC,CAAA;YAC7B,CAAC;QACH,CAAC;IACH,CAAC,CAAA;IAED,OAAO,qBAAqB,CAAC,KAAK,EAAE;QAClC,aAAa,EAAE,CAAC,iBAAiB,CAAC;QAClC,UAAU,EAAE,UAAU;QACtB,YAAY,EAAE,CAAC,MAAM,CAAC;KACvB,CAAC,CAAA;AACJ,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.d.ts index 1f78360348..29fae3092b 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.d.ts @@ -9,3 +9,4 @@ export declare function getFirstProviderUserId(user?: UserEntityWithAuth): strin export type { AuthUserData, AuthUser } from '../server/auth/user.js'; export declare function makeAuthUserIfPossible(user: null): null; export declare function makeAuthUserIfPossible(user: AuthUserData): AuthUser; +export declare function makeAuthUserIfPossible(user: AuthUserData | null): AuthUser | null; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.js index bd1900fd11..191dba015c 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.js @@ -1,3 +1,4 @@ +import { isNotNull } from '../universal/predicates.js'; /** * We split the user.ts code into two files to avoid some server-only * code (Oslo's hashing functions) being imported on the client. @@ -25,7 +26,7 @@ export function makeAuthUserIfPossible(user) { } function makeAuthUser(data) { return Object.assign(Object.assign({}, data), { getFirstProviderUserId: () => { - const identities = Object.values(data.identities).filter(Boolean); + const identities = Object.values(data.identities).filter(isNotNull); return identities.length > 0 ? identities[0].id : null; } }); } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.js.map index cb000eb5f7..8a1f6d24e5 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/user.js.map @@ -1 +1 @@ -{"version":3,"file":"user.js","sourceRoot":"","sources":["../../auth/user.ts"],"names":[],"mappings":"AAOA;;;GAGG;AAEH,aAAa;AACb,MAAM,UAAU,QAAQ,CAAC,IAAwB;;IAC/C,OAAO,MAAA,MAAA,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,0CAAE,cAAc,mCAAI,IAAI,CAAC;AACjE,CAAC;AAED,aAAa;AACb,MAAM,UAAU,WAAW,CAAC,IAAwB;;IAClD,OAAO,MAAA,MAAA,gBAAgB,CAAC,IAAI,EAAE,UAAU,CAAC,0CAAE,cAAc,mCAAI,IAAI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AC;AAED,SAAS,gBAAgB,CAAC,IAAwB,EAAE,YAA0B;;IAC5E,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,MAAA,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAC9B,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,YAAY,KAAK,YAAY,CACrD,mCAAI,IAAI,CAAC;AACZ,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.d.ts index bf120a65bd..796e2fa899 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.d.ts @@ -1,3 +1,4 @@ +import { HttpError } from 'wasp/server'; import { type User, type Auth, type AuthIdentity } from 'wasp/entities'; import { Prisma } from '@prisma/client'; import { type UserSignupFields, type PossibleUserFields } from './providers/types.js'; @@ -60,13 +61,14 @@ export declare function findAuthIdentity(providerId: ProviderId): Promise(providerId: ProviderId, existingProviderData: PossibleProviderData[PN], providerDataUpdates: Partial): Promise; -type FindAuthWithUserResult = Auth & { +export type FindAuthWithUserResult = Auth & { user: User; }; -export declare function findAuthWithUserBy(where: Prisma.AuthWhereInput): Promise; -export declare function createUser(providerId: ProviderId, serializedProviderData?: string, userFields?: PossibleUserFields): Promise; +export declare function findAuthWithUserBy(where: Prisma.AuthWhereInput): Promise; +export type CreateUserResult = User & { + auth: Auth | null; +}; +export declare function createUser(providerId: ProviderId, serializedProviderData?: string, userFields?: PossibleUserFields): Promise; export declare function deleteUserByAuthId(authId: string): Promise<{ count: number; }>; @@ -75,9 +77,7 @@ export declare function rethrowPossibleAuthError(e: unknown): void; export declare function validateAndGetUserFields(data: { [key: string]: unknown; }, userSignupFields?: UserSignupFields): Promise>; -export declare function deserializeAndSanitizeProviderData(providerData: string, { shouldRemovePasswordField }?: { - shouldRemovePasswordField?: boolean; -}): PossibleProviderData[PN]; +export declare function getProviderData(providerData: string): Omit; +export declare function getProviderDataWithPassword(providerData: string): PossibleProviderData[PN]; export declare function sanitizeAndSerializeProviderData(providerData: PossibleProviderData[PN]): Promise; -export declare function throwInvalidCredentialsError(message?: string): void; -export {}; +export declare function createInvalidCredentialsError(message?: string): HttpError; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.js index 3aa4651799..18b6401683 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.js @@ -52,7 +52,7 @@ export async function findAuthIdentity(providerId) { export async function updateAuthIdentityProviderData(providerId, existingProviderData, providerDataUpdates) { // We are doing the sanitization here only on updates to avoid // hashing the password multiple times. - const sanitizedProviderDataUpdates = await sanitizeProviderData(providerDataUpdates); + const sanitizedProviderDataUpdates = await ensurePasswordIsHashed(providerDataUpdates); const newProviderData = Object.assign(Object.assign({}, existingProviderData), sanitizedProviderDataUpdates); const serializedProviderData = await serializeProviderData(newProviderData); return prisma.authIdentity.update({ @@ -64,7 +64,14 @@ export async function updateAuthIdentityProviderData(providerId, existingProvide } // PRIVATE API export async function findAuthWithUserBy(where) { - return prisma.auth.findFirst({ where, include: { user: true } }); + const result = await prisma.auth.findFirst({ where, include: { user: true } }); + if (result === null) { + return null; + } + if (result.user === null) { + return null; + } + return Object.assign(Object.assign({}, result), { user: result.user }); } // PUBLIC API export async function createUser(providerId, serializedProviderData, userFields) { @@ -163,22 +170,31 @@ export async function validateAndGetUserFields(data, userSignupFields) { return result; } // PUBLIC API -export function deserializeAndSanitizeProviderData(providerData, { shouldRemovePasswordField = false } = {}) { +export function getProviderData(providerData) { + return sanitizeProviderData(getProviderDataWithPassword(providerData)); +} +// PUBLIC API +export function getProviderDataWithPassword(providerData) { // NOTE: We are letting JSON.parse throw an error if the providerData is not valid JSON. - let data = JSON.parse(providerData); - if (providerDataHasPasswordField(data) && shouldRemovePasswordField) { - delete data.hashedPassword; + return JSON.parse(providerData); +} +function sanitizeProviderData(providerData) { + if (providerDataHasPasswordField(providerData)) { + const { hashedPassword } = providerData, rest = __rest(providerData, ["hashedPassword"]); + return rest; + } + else { + return providerData; } - return data; } // PUBLIC API export async function sanitizeAndSerializeProviderData(providerData) { - return serializeProviderData(await sanitizeProviderData(providerData)); + return serializeProviderData(await ensurePasswordIsHashed(providerData)); } function serializeProviderData(providerData) { return JSON.stringify(providerData); } -async function sanitizeProviderData(providerData) { +async function ensurePasswordIsHashed(providerData) { const data = Object.assign({}, providerData); if (providerDataHasPasswordField(data)) { data.hashedPassword = await hashPassword(data.hashedPassword); @@ -189,7 +205,7 @@ function providerDataHasPasswordField(providerData) { return 'hashedPassword' in providerData; } // PRIVATE API -export function throwInvalidCredentialsError(message) { - throw new HttpError(401, 'Invalid credentials', { message }); +export function createInvalidCredentialsError(message) { + return new HttpError(401, 'Invalid credentials', { message }); } //# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.js.map index dd75b5a2e4..48ed4d7d3d 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/utils.js.map @@ -1 +1 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../auth/utils.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAMzC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAwCtD,cAAc;AACd,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC,IAAI;KAClB;CACF,CAAA;AAED,cAAc;AACd,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,mBAAmB,EAAE,QAAQ;IAC7B,mBAAmB,EAAE,GAAG;CACzB,CAAA;AAiBD,aAAa;AACb,MAAM,UAAU,gBAAgB,CAAC,YAA0B,EAAE,cAAsB;IACjF,OAAO;QACL,YAAY;QACZ,cAAc,EAAE,cAAc,CAAC,WAAW,EAAE;KAC7C,CAAA;AACH,CAAC;AAED,aAAa;AACb,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,UAAsB;IAC3D,OAAO,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC;QACpC,KAAK,EAAE;YACL,2BAA2B,EAAE,UAAU;SACxC;KACF,CAAC,CAAC;AACL,CAAC;AAED,aAAa;AACb;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAClD,UAAsB,EACtB,oBAA8C,EAC9C,mBAAsD;IAEtD,8DAA8D;IAC9D,uCAAuC;IACvC,MAAM,4BAA4B,GAAG,MAAM,oBAAoB,CAAC,mBAAmB,CAAC,CAAC;IACrF,MAAM,eA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,KAAK,UAAU,gCAAgC,CACpD,YAAsC;IAEtC,OAAO,qBAAqB,CAC1B,MAAM,sBAAsB,CAAC,YAAY,CAAC,CAC3C,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB,CAA0B,YAAsC;IAC5F,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;AACtC,CAAC;AAED,KAAK,UAAU,sBAAsB,CACnC,YAAsC;IAEtC,MAAM,IAAI,qBACL,YAAY,CAChB,CAAC;IACF,IAAI,4BAA4B,CAAC,IAAI,CAAC,EAAE,CAAC;QACvC,IAAI,CAAC,cAAc,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAChE,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAGD,SAAS,4BAA4B,CACnC,YAA8D;IAE9D,OAAO,gBAAgB,IAAI,YAAY,CAAC;AAC1C,CAAC;AAED,cAAc;AACd,MAAM,UAAU,6BAA6B,CAAC,OAAgB;IAC5D,OAAO,IAAI,SAAS,CAAC,GAAG,EAAE,qBAAqB,EAAE,EAAE,OAAO,EAAE,CAAC,CAAA;AAC/D,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.d.ts index 489a6ee3da..d46be42376 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.d.ts @@ -1,7 +1,7 @@ export declare const PASSWORD_FIELD = "password"; -export declare function ensureValidEmail(args: unknown): void; -export declare function ensureValidUsername(args: unknown): void; -export declare function ensurePasswordIsPresent(args: unknown): void; -export declare function ensureValidPassword(args: unknown): void; -export declare function ensureTokenIsPresent(args: unknown): void; +export declare function ensureValidEmail(args: object): void; +export declare function ensureValidUsername(args: object): void; +export declare function ensurePasswordIsPresent(args: object): void; +export declare function ensureValidPassword(args: object): void; +export declare function ensureTokenIsPresent(args: object): void; export declare function throwValidationError(message: string): void; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.js.map index 67e6e2151c..a3d691948f 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/auth/validation.js.map @@ -1 +1 @@ -{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../auth/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;AACzC,MAAM,cAAc,GAAG,UAAU,CAAC;AAClC,MAAM,WAAW,GAAG,OAAO,CAAC;AAC5B,MAAM,WAAW,GAAG,OAAO,CAAC;AAE5B,aAAa;AACb,MAAM,UAAU,gBAAgB,CAAC,IAAa;IAC5C,QAAQ,CAAC,IAAI,EAAE;QACb,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE;QACzF,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,6BAA6B,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;KAC5G,CAAC,CAAC;AACL,CAAC;AAED,aAAa;AACb,MAAM,UAAU,mBAAmB,CAAC,IAAa;IAC/C,QAAQ,CAAC,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S,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,UAAU,EAAE,CAAC;QAC3D,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;YAChC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;AACH,CAAC;AAED,+EAA+E;AAE/E,MAAM,eAAe,GAAG,gcAAgc,CAAA;AACxd,SAAS,YAAY,CAAC,KAAc;IAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAA;IAChB,CAAC;IAED,OAAO,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,IAAI,CAAA;AAChD,CAAC;AAED,SAAS,WAAW,CAAC,KAAc,EAAE,SAAiB;IAClD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAA;IAChB,CAAC;IAED,OAAO,KAAK,CAAC,MAAM,IAAI,SAAS,CAAA;AACpC,CAAC;AAED,SAAS,cAAc,CAAC,KAAc;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAA;IAChB,CAAC;IAED,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC3B,CAAC"} \ No newline at end of file +{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../auth/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;AACzC,MAAM,cAAc,GAAG,UAAU,CAAC;AAClC,MAAM,WAAW,GAAG,OAAO,CAAC;AAC5B,MAAM,WAAW,GAAG,OAAO,CAAC;AAE5B,aAAa;AACb,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,QAAQ,CAAC,IAAI,EAAE;QACb,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,uBA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,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE;KAC1F,CAAC,CAAC;AACL,CAAC;AAED,cAAc;AACd,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,MAAM,IAAI,SAAS,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,CAAC,CAAA;AAC5D,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY,EAAE,UAA4F;IAC1H,KAAK,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,UAAU,EAAE,CAAC;QAC3D,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;YAChC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;AACH,CAAC;AAED,+EAA+E;AAE/E,MAAM,eAAe,GAAG,gcAAgc,CAAA;AACxd,SAAS,YAAY,CAAC,KAAc;IAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAA;IAChB,CAAC;IAED,OAAO,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,IAAI,CAAA;AAChD,CAAC;AAED,SAAS,WAAW,CAAC,KAAc,EAAE,SAAiB;IAClD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAA;IAChB,CAAC;IAED,OAAO,KAAK,CAAC,MAAM,IAAI,SAAS,CAAA;AACpC,CAAC;AAED,SAAS,cAAc,CAAC,KAAc;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAA;IAChB,CAAC;IAED,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC3B,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/config.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/config.js index 74f4f78c97..1dffbd68bc 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/config.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/config.js @@ -1,4 +1,4 @@ -import { stripTrailingSlash } from 'wasp/universal/url'; +import { stripTrailingSlash } from '../universal/url.js'; const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; // PUBLIC API export const config = { diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/config.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/config.js.map index 82b7a8d169..d26d37022b 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/config.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAEvD,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,uBAAuB,CAAC;AAOhG,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAExD,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,uBAAuB,CAAC;AAOhG,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/operationsHelpers.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/operationsHelpers.d.ts index 0286482afe..7a629cbb88 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/operationsHelpers.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/operationsHelpers.d.ts @@ -1,5 +1,7 @@ +import { useAction, useQuery } from "../operations"; import type { Query, Action } from "../operations/rpc"; -export declare function makeUseQueryFor(query: Query): (queryFnArgs?: Input, options?: any) => import("@tanstack/react-query").UseQueryResult; +import type { Tail } from "../../universal/types"; +export declare function makeUseQueryFor(query: Query): (queryFnArgs?: Input | undefined, options?: any) => import("@tanstack/react-query").UseQueryResult; export declare function makeUseActionFor(action: Action): (actionOptions?: { optimisticUpdates: import("../operations").OptimisticUpdateDefinition[]; -}) => import("../../universal/types").IfAny Promise, [Input] extends [never] ? (args?: unknown) => Promise : [Input] extends [void] ? () => Promise : (args: Input) => Promise>; +} | undefined) => import("../../universal/types").IfAny Promise, [Input] extends [never] ? (args?: unknown) => Promise : [Input] extends [void] ? () => Promise : (args: Input) => Promise>; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.d.ts index b6edb7895c..6ef5f6a14d 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/crud/tasks.d.ts @@ -2,15 +2,15 @@ import { GetQueryResolved, GetAllQueryResolved } from 'wasp/server/crud/tasks'; export declare const tasks: { get: { query: import("../operations/queries/core.js").QueryFor; - useQuery: (queryFnArgs?: import(".prisma/client").Prisma.TaskWhereUniqueInput, options?: any) => import("@tanstack/react-query").UseQueryResult<{ + useQuery: (queryFnArgs?: import(".prisma/client").Prisma.TaskWhereUniqueInput | undefined, options?: any) => import("@tanstack/react-query").UseQueryResult<{ id: number; description: string; isDone: boolean; - }, Error>; + } | null, Error>; }; getAll: { query: import("../operations/queries/core.js").QueryFor; - useQuery: (queryFnArgs?: {}, options?: any) => import("@tanstack/react-query").UseQueryResult<{ + useQuery: (queryFnArgs?: {} | undefined, options?: any) => import("@tanstack/react-query").UseQueryResult<{ id: number; description: string; isDone: boolean; @@ -24,7 +24,7 @@ export declare const tasks: { }>; useAction: (actionOptions?: { optimisticUpdates: import("../operations/hooks.js").OptimisticUpdateDefinition<(import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskUncheckedCreateInput) | (import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskCreateInput), any>[]; - }) => (args: (import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskUncheckedCreateInput) | (import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskCreateInput)) => Promise<{ + } | undefined) => (args: (import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskUncheckedCreateInput) | (import(".prisma/client").Prisma.Without & import(".prisma/client").Prisma.TaskCreateInput)) => Promise<{ id: number; description: string; isDone: boolean; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/hooks.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/hooks.js index 723993357c..d20d1f0588 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/hooks.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/hooks.js @@ -12,7 +12,12 @@ export function useQuery(query, queryFnArgs, options) { return rqUseQuery(Object.assign({ // todo: The full queryCacheKey is constructed in two places, both here and // inside the Query. See https://github.com/wasp-lang/wasp/issues/2017 - queryKey: makeQueryCacheKey(query, queryFnArgs), queryFn: () => query(queryFnArgs) }, options)); + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryKey: makeQueryCacheKey(query, queryFnArgs), + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryFn: () => query(queryFnArgs) }, options)); } // PUBLIC API /** diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/hooks.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/hooks.js.map index 40d9188b06..11ab1e3495 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/hooks.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/hooks.js.map @@ -1 +1 @@ -{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../client/operations/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EAEX,cAAc,EACd,QAAQ,IAAI,UAAU,GAEvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,aAAa;AACb,MAAM,UAAU,QAAQ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L,CAAC;IAED,OAAO;QACL,QAAQ;QACR,OAAO;KACR,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,4CAA4C,CACnD,0BAGC,EACD,IAAiB;IAEjB,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,0BAA0B,CAAC;IAChE,OAAO;QACL,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC;QAC3B,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC;KAC7C,CAAC;AACJ,CAAC;AAED,qEAAqE;AACrE,+EAA+E;AAC/E;;;;;;GAMG;AACH,SAAS,0BAA0B,CACjC,cAAgD;IAEhD,MAAM,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,GAAG,cAAc,CAAC;IAC/C,OAAO,CAAC,GAAI,OAAe,CAAC,aAAa,EAAE,GAAG,SAAS,CAAC,CAAC;AAC3D,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js index 68bbdadf3d..13e1dcb655 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js @@ -9,7 +9,7 @@ export async function callOperation(operationRoute, args) { return superjsonDeserialize(response.data); } catch (error) { - handleApiError(error); + throw handleApiError(error); } } // PRIVATE API diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map index 23d9e480d1..d271983a05 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../client/operations/internal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EACL,SAAS,IAAI,kBAAkB,EAC/B,WAAW,IAAI,oBAAoB,GACnC,MAAM,WAAW,CAAA;AAKnB,cAAc;AACd,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,cAA8B,EAAE,IAAS;IAC3E,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAC9C,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;QACnE,OAAO,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,cAAc,CAAC,KAAK,CAAC,CAAA;IACvB,CAAC;AACH,CAAC;AAED,cAAc;AACd,MAAM,UAAU,kBAAkB,CAAC,sBAA8B;IAC/D,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,sBAAsB,EAAE,EAAE,CAAA;AACxE,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../client/operations/internal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EACL,SAAS,IAAI,kBAAkB,EAC/B,WAAW,IAAI,oBAAoB,GACnC,MAAM,WAAW,CAAA;AAKnB,cAAc;AACd,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,cAA8B,EAAE,IAAS;IAC3E,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAC9C,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;QACnE,OAAO,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,cAAc,CAAC,KAAK,CAAC,CAAA;IAC7B,CAAC;AACH,CAAC;AAED,cAAc;AACd,MAAM,UAAU,kBAAkB,CAAC,sBAA8B;IAC/D,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,sBAAsB,EAAE,EAAE,CAAA;AACxE,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.js index 5c7ebac33a..b085ac633c 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.js @@ -1,6 +1,6 @@ import { handleRejection } from 'wasp/server/utils'; import { getSessionAndUserFromBearerToken } from 'wasp/auth/session'; -import { throwInvalidCredentialsError } from 'wasp/auth/utils'; +import { createInvalidCredentialsError } from 'wasp/auth/utils'; /** * Auth middleware * @@ -25,7 +25,7 @@ const auth = handleRejection(async (req, res, next) => { } const sessionAndUser = await getSessionAndUserFromBearerToken(req); if (sessionAndUser === null) { - throwInvalidCredentialsError(); + throw createInvalidCredentialsError(); } req.sessionId = sessionAndUser.session.id; req.user = sessionAndUser.user; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.js.map index 1f3bf897e0..c5471431dd 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/auth.js.map @@ -1 +1 @@ -{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../core/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAA;AACpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAA;AAE9D;;;;;;;;;;;GAWG;AACH,MAAM,IAAI,GAAG,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;IACpD,MAAM,UAAU,GAAG,GAAG,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;IAC3C,kFAAkF;IAClF,sFAAsF;IACtF,yDAAyD;IACzD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,GAAG,CAAC,SAAS,GAAG,IAAI,CAAA;QACpB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAA;QACf,OAAO,IAAI,EAAE,CAAA;IACf,CAAC;IAED,MAAM,cAAc,GAAG,MAAM,gCAAgC,CAAC,GAAG,CAAC,CAAA;IAElE,IAAI,cAAc,KAAK,IAAI,EAAE,CAAC;QAC5B,4BAA4B,EAAE,CAAA;IAChC,CAAC;IAED,GAAG,CAAC,SAAS,GAAG,cAAc,CAAC,OAAO,CAAC,EAAE,CAAA;IACzC,GAAG,CAAC,IAAI,GAAG,cAAc,CAAC,IAAI,CAAA;IAE9B,IAAI,EAAE,CAAA;AACR,CAAC,CAAC,CAAA;AAEF,eAAe,IAAI,CAAA"} \ No newline at end of file +{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../core/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAA;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAA;AAE/D;;;;;;;;;;;GAWG;AACH,MAAM,IAAI,GAAG,eAAe,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;IACpD,MAAM,UAAU,GAAG,GAAG,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;IAC3C,kFAAkF;IAClF,sFAAsF;IACtF,yDAAyD;IACzD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,GAAG,CAAC,SAAS,GAAG,IAAI,CAAA;QACpB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAA;QACf,OAAO,IAAI,EAAE,CAAA;IACf,CAAC;IAED,MAAM,cAAc,GAAG,MAAM,gCAAgC,CAAC,GAAG,CAAC,CAAA;IAElE,IAAI,cAAc,KAAK,IAAI,EAAE,CAAC;QAC5B,MAAM,6BAA6B,EAAE,CAAA;IACvC,CAAC;IAED,GAAG,CAAC,SAAS,GAAG,cAAc,CAAC,OAAO,CAAC,EAAE,CAAA;IACzC,GAAG,CAAC,IAAI,GAAG,cAAc,CAAC,IAAI,CAAA;IAE9B,IAAI,EAAE,CAAA;AACR,CAAC,CAAC,CAAA;AAEF,eAAe,IAAI,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/stitches.config.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/stitches.config.d.ts index 9e6f79c33c..936dc05a27 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/stitches.config.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/core/stitches.config.d.ts @@ -2,26 +2,26 @@ export declare const styled: >(type: Type, ...composers: { [K in keyof Composers]: string extends Composers[K] ? Composers[K] : Composers[K] extends string | import("@stitches/react/types/util").Function | import("react").ComponentType ? Composers[K] : import("@stitches/react/types/stitches").RemoveIndex & { variants?: { @@ -29,58 +29,58 @@ export declare const styled: ; } : import("@stitches/react/types/util").WideObject) & { + } | undefined; + compoundVariants?: (("variants" extends keyof Composers[K] ? { [Name in keyof Composers[K][keyof Composers[K] & "variants"]]?: import("@stitches/react/types/util").String | import("@stitches/react/types/util").Widen | undefined; } : import("@stitches/react/types/util").WideObject) & { css: CSS; - })[]; - defaultVariants?: "variants" extends keyof Composers[K] ? { [Name_1 in keyof Composers[K][keyof Composers[K] & "variants"]]?: import("@stitches/react/types/util").String | import("@stitches/react/types/util").Widen; } : import("@stitches/react/types/util").WideObject; + })[] | undefined; + defaultVariants?: ("variants" extends keyof Composers[K] ? { [Name_1 in keyof Composers[K][keyof Composers[K] & "variants"]]?: import("@stitches/react/types/util").String | import("@stitches/react/types/util").Widen | undefined; } : import("@stitches/react/types/util").WideObject) | undefined; } & CSS & { [K2 in keyof Composers[K]]: K2 extends "compoundVariants" | "defaultVariants" | "variants" ? unknown : K2 extends keyof CSS ? CSS[K2] : unknown; }; }) => import("@stitches/react/types/styled-component").StyledComponent, {}, import("@stitches/react/types/css-util").CSS<{}, { colors: { - waspYellow: string; - gray900: string; - gray700: string; - gray600: string; - gray500: string; - gray400: string; - red: string; - darkRed: string; - green: string; - brand: string; - brandAccent: string; - errorBackground: string; - errorText: string; - successBackground: string; - successText: string; - submitButtonText: string; - formErrorText: string; + waspYellow: "#ffcc00"; + gray900: "#1a202c"; + gray700: "#a1a5ab"; + gray600: "#d1d5db"; + gray500: "gainsboro"; + gray400: "#f0f0f0"; + red: "#FED7D7"; + darkRed: "#fa3838"; + green: "#C6F6D5"; + brand: "$waspYellow"; + brandAccent: "#ffdb46"; + errorBackground: "$red"; + errorText: "#2D3748"; + successBackground: "$green"; + successText: "#2D3748"; + submitButtonText: "black"; + formErrorText: "$darkRed"; }; fontSizes: { - sm: string; + sm: "0.875rem"; }; }, import("@stitches/react/types/config").DefaultThemeMap, {}>>, css: | React.JSXElementConstructor | import("@stitches/react/types/util").Function | { [name: string]: unknown; })[], CSS = import("@stitches/react/types/css-util").CSS<{}, { colors: { - waspYellow: string; - gray900: string; - gray700: string; - gray600: string; - gray500: string; - gray400: string; - red: string; - darkRed: string; - green: string; - brand: string; - brandAccent: string; - errorBackground: string; - errorText: string; - successBackground: string; - successText: string; - submitButtonText: string; - formErrorText: string; + waspYellow: "#ffcc00"; + gray900: "#1a202c"; + gray700: "#a1a5ab"; + gray600: "#d1d5db"; + gray500: "gainsboro"; + gray400: "#f0f0f0"; + red: "#FED7D7"; + darkRed: "#fa3838"; + green: "#C6F6D5"; + brand: "$waspYellow"; + brandAccent: "#ffdb46"; + errorBackground: "$red"; + errorText: "#2D3748"; + successBackground: "$green"; + successText: "#2D3748"; + submitButtonText: "black"; + formErrorText: "$darkRed"; }; fontSizes: { - sm: string; + sm: "0.875rem"; }; }, import("@stitches/react/types/config").DefaultThemeMap, {}>>(...composers: { [K in keyof Composers]: string extends Composers[K] ? Composers[K] : Composers[K] extends string | import("@stitches/react/types/util").Function | import("react").ExoticComponent | import("react").JSXElementConstructor ? Composers[K] : import("@stitches/react/types/stitches").RemoveIndex & { variants?: { @@ -88,34 +88,34 @@ export declare const styled: ; } : import("@stitches/react/types/util").WideObject) & { + } | undefined; + compoundVariants?: (("variants" extends keyof Composers[K] ? { [Name in keyof Composers[K][keyof Composers[K] & "variants"]]?: import("@stitches/react/types/util").String | import("@stitches/react/types/util").Widen | undefined; } : import("@stitches/react/types/util").WideObject) & { css: CSS; - })[]; - defaultVariants?: "variants" extends keyof Composers[K] ? { [Name_1 in keyof Composers[K][keyof Composers[K] & "variants"]]?: import("@stitches/react/types/util").String | import("@stitches/react/types/util").Widen; } : import("@stitches/react/types/util").WideObject; + })[] | undefined; + defaultVariants?: ("variants" extends keyof Composers[K] ? { [Name_1 in keyof Composers[K][keyof Composers[K] & "variants"]]?: import("@stitches/react/types/util").String | import("@stitches/react/types/util").Widen | undefined; } : import("@stitches/react/types/util").WideObject) | undefined; } & CSS & { [K2 in keyof Composers[K]]: K2 extends "compoundVariants" | "defaultVariants" | "variants" ? unknown : K2 extends keyof CSS ? CSS[K2] : unknown; }; }) => import("@stitches/react/types/styled-component").CssComponent, import("@stitches/react/types/styled-component").StyledComponentProps, {}, CSS>, keyframes: (style: { [offset: string]: import("@stitches/react/types/css-util").CSS<{}, { colors: { - waspYellow: string; - gray900: string; - gray700: string; - gray600: string; - gray500: string; - gray400: string; - red: string; - darkRed: string; - green: string; - brand: string; - brandAccent: string; - errorBackground: string; - errorText: string; - successBackground: string; - successText: string; - submitButtonText: string; - formErrorText: string; + waspYellow: "#ffcc00"; + gray900: "#1a202c"; + gray700: "#a1a5ab"; + gray600: "#d1d5db"; + gray500: "gainsboro"; + gray400: "#f0f0f0"; + red: "#FED7D7"; + darkRed: "#fa3838"; + green: "#C6F6D5"; + brand: "$waspYellow"; + brandAccent: "#ffdb46"; + errorBackground: "$red"; + errorText: "#2D3748"; + successBackground: "$green"; + successText: "#2D3748"; + submitButtonText: "black"; + formErrorText: "$darkRed"; }; fontSizes: { - sm: string; + sm: "0.875rem"; }; }, import("@stitches/react/types/config").DefaultThemeMap, {}>; }) => { diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts index 56b8d88eca..e40cd74ab7 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts @@ -1,5 +1,5 @@ export declare class HttpError extends Error { statusCode: number; data: unknown; - constructor(statusCode: number, message?: string, data?: Record, ...params: unknown[]); + constructor(statusCode: number, message?: string, data?: Record, options?: ErrorOptions); } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.js index 3e216e57ce..6e91977adc 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.js @@ -1,6 +1,6 @@ export class HttpError extends Error { - constructor(statusCode, message, data, ...params) { - super(message, ...params); + constructor(statusCode, message, data, options) { + super(message, options); if (Error.captureStackTrace) { Error.captureStackTrace(this, HttpError); } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.js.map index 3cc7095281..8163354e1b 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/HttpError.js.map @@ -1 +1 @@ -{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YAAa,UAAkB,EAAE,OAAgB,EAAE,IAA8B,EAAE,GAAG,MAAiB;QACrG,KAAK,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAA;QAEzB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EAAE,CAAC;YAC7E,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YAAa,UAAkB,EAAE,OAAgB,EAAE,IAA8B,EAAE,OAAsB;QACvG,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAEvB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EAAE,CAAC;YAC7E,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/hooks.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/hooks.d.ts index fe3999de1d..dcc64c305a 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/hooks.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/hooks.d.ts @@ -1,5 +1,5 @@ import type { Request as ExpressRequest } from 'express'; -import { type ProviderId, createUser, findAuthWithUserBy } from '../../auth/utils.js'; +import { type ProviderId, type CreateUserResult, type FindAuthWithUserResult } from '../../auth/utils.js'; import { prisma } from '../index.js'; import { Expand } from '../../universal/types.js'; export type OnBeforeSignupHook = (params: Expand) => void | Promise; @@ -38,7 +38,7 @@ type OnAfterSignupHookParams = { /** * User object that was created during the signup process. */ - user: Awaited>; + user: CreateUserResult; /** * OAuth flow data that was generated during the OAuth flow. This is only * available if the user signed up using OAuth. @@ -71,7 +71,7 @@ type OnBeforeLoginHookParams = { /** * User that is trying to log in. */ - user: Awaited>['user']; + user: FindAuthWithUserResult['user']; /** * Request object that can be used to access the incoming request. */ @@ -85,7 +85,7 @@ type OnAfterLoginHookParams = { /** * User that is logged in. */ - user: Awaited>['user']; + user: FindAuthWithUserResult['user']; /** * OAuth flow data that was generated during the OAuth flow. This is only * available if the user logged in using OAuth. diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.d.ts index d387a6172f..0bd025b65a 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.d.ts @@ -1,5 +1,5 @@ export { defineUserSignupFields, } from '../../auth/providers/types.js'; -export { createProviderId, sanitizeAndSerializeProviderData, updateAuthIdentityProviderData, deserializeAndSanitizeProviderData, findAuthIdentity, createUser, type ProviderId, type ProviderName, type EmailProviderData, type UsernameProviderData, type OAuthProviderData, } from '../../auth/utils.js'; +export { createProviderId, sanitizeAndSerializeProviderData, updateAuthIdentityProviderData, getProviderData, getProviderDataWithPassword, findAuthIdentity, createUser, type CreateUserResult, type ProviderId, type ProviderName, type EmailProviderData, type UsernameProviderData, type OAuthProviderData, } from '../../auth/utils.js'; export { ensurePasswordIsPresent, ensureValidPassword, ensureTokenIsPresent, } from '../../auth/validation.js'; export type { OnBeforeSignupHook, OnAfterSignupHook, OnBeforeOAuthRedirectHook, OnBeforeLoginHook, OnAfterLoginHook, InternalAuthHookParams, OAuthData, } from './hooks.js'; export * from './oauth/index.js'; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.js index 7f489c9a62..507ef28e7a 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.js @@ -1,5 +1,5 @@ export { defineUserSignupFields, } from '../../auth/providers/types.js'; -export { createProviderId, sanitizeAndSerializeProviderData, updateAuthIdentityProviderData, deserializeAndSanitizeProviderData, findAuthIdentity, createUser, } from '../../auth/utils.js'; +export { createProviderId, sanitizeAndSerializeProviderData, updateAuthIdentityProviderData, getProviderData, getProviderDataWithPassword, findAuthIdentity, createUser, } from '../../auth/utils.js'; export { ensurePasswordIsPresent, ensureValidPassword, ensureTokenIsPresent, } from '../../auth/validation.js'; export * from './oauth/index.js'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.js.map index 4fad2ccaeb..232d530f58 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,GACvB,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EACL,gBAAgB,EAChB,gCAAgC,EAChC,8BAA8B,EAC9B,kCAAkC,EAClC,gBAAgB,EAChB,UAAU,GAMX,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,0BAA0B,CAAA;AAYjC,cAAc,kBAAkB,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,GACvB,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EACL,gBAAgB,EAChB,gCAAgC,EAChC,8BAA8B,EAC9B,eAAe,EACf,2BAA2B,EAC3B,gBAAgB,EAChB,UAAU,GAOX,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,0BAA0B,CAAA;AAYjC,cAAc,kBAAkB,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/redirect.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/redirect.js index c228948ef6..f81553d3c3 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/redirect.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/redirect.js @@ -29,6 +29,6 @@ function getRedirectUriForError(error) { return new URL(`${config.frontendUrl}${clientOAuthCallbackPath}?error=${error}`); } function isHttpErrorWithExtraMessage(error) { - return error.data && typeof error.data.message === 'string'; + return !!error.data && typeof error.data.message === 'string'; } //# sourceMappingURL=redirect.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/redirect.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/redirect.js.map index d8e07016ca..2c50ac97c4 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/redirect.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/oauth/redirect.js.map @@ -1 +1 @@ -{"version":3,"file":"redirect.js","sourceRoot":"","sources":["../../../../server/auth/oauth/redirect.ts"],"names":[],"mappings":"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,CAAC,SAAS,SAAS,YAAY,IAAI,YAAY,EAAE,CAAC,CAAC;AAC7E,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAa;IAC3C,OAAO,IAAI,GAAG,CAAC,GAAG,MAAM,CAAC,WAAW,GAAG,uBAAuB,UAAU,KAAK,EAAE,CAAC,CAAC;AACnF,CAAC;AAED,SAAS,2BAA2B,CAAC,KAAgB;IACnD,OAAO,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,OAAQ,KAAK,CAAC,IAAY,CAAC,OAAO,KAAK,QAAQ,CAAC;AACzE,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/user.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/user.js index 03772c4e1d..ecf460d560 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/user.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/user.js @@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) { } return t; }; -import { deserializeAndSanitizeProviderData } from '../../auth/utils.js'; +import { getProviderData, } from '../../auth/utils.js'; // PRIVATE API export function createAuthUserData(user) { const { auth } = user, rest = __rest(user, ["auth"]); @@ -27,9 +27,7 @@ function getProviderInfo(auth, providerName) { if (!identity) { return null; } - return Object.assign(Object.assign({}, deserializeAndSanitizeProviderData(identity.providerData, { - shouldRemovePasswordField: true, - })), { id: identity.providerUserId }); + return Object.assign(Object.assign({}, getProviderData(identity.providerData)), { id: identity.providerUserId }); } function getIdentity(auth, providerName) { var _a; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/user.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/user.js.map index e56e706019..c7dd3ecad2 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/user.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/auth/user.js.map @@ -1 +1 @@ -{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../server/auth/user.ts"],"names":[],"mappings":";;;;;;;;;;;AAKA,OAAO,EAEL,kCAAkC,EACnC,MAAM,qBAAqB,CAAA;AA6D5B,cAAc;AACd,MAAM,UAAU,kBAAkB,CAAC,IAAgC;IACjE,MAAM,EAAE,IAAI,KAAc,IAAI,EAAb,IAAI,UAAK,IAAI,EAAxB,QAAiB,CAAO,CAAA;IAC9B,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC;6EACyD,CAAC,CAAA;IAC5E,CAAC;IACD,MAAM,UAAU,GAAG;QACjB,MAAM,EAAE,eAAe,CAAW,IAAI,EAAE,QAAQ,CAAC;KAClD,CAAA;IACD,uCACK,IAAI,KACP,UAAU,IACX;AACH,CAAC;AAED,SAAS,eAAe,CACtB,IAAsC,EACtC,YAAgB;IAIhB,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,EAAE,YAAY,CAAC,CAAA;IAChD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,IAAI,CAAA;IACb,CAAC;IACD,uCACK,kCAAkC,CAAK,QAAQ,CAAC,YAAY,EAAE;QAC/D,yBAAyB,EAAE,IAAI;KAChC,CAAC,KACF,EAAE,EAAE,QAAQ,CAAC,cAAc,IAC5B;AACH,CAAC;AAED,SAAS,WAAW,CAClB,IAAsC,EACtC,YAA0B;;IAE1B,OAAO,MAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,KAAK,YAAY,CAAC,mCAAI,IAAI,CAAA;AAC7E,CAAC"} \ No newline at end of file +{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../server/auth/user.ts"],"names":[],"mappings":";;;;;;;;;;;AAKA,OAAO,EAEL,eAAe,GAChB,MAAM,qBAAqB,CAAA;AA6D5B,cAAc;AACd,MAAM,UAAU,kBAAkB,CAAC,IAAgC;IACjE,MAAM,EAAE,IAAI,KAAc,IAAI,EAAb,IAAI,UAAK,IAAI,EAAxB,QAAiB,CAAO,CAAA;IAC9B,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC;6EACyD,CAAC,CAAA;IAC5E,CAAC;IACD,MAAM,UAAU,GAAG;QACjB,MAAM,EAAE,eAAe,CAAW,IAAI,EAAE,QAAQ,CAAC;KAClD,CAAA;IACD,uCACK,IAAI,KACP,UAAU,IACX;AACH,CAAC;AAED,SAAS,eAAe,CACtB,IAAsC,EACtC,YAAgB;IAIhB,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,EAAE,YAAY,CAAC,CAAA;IAChD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,IAAI,CAAA;IACb,CAAC;IACD,uCACK,eAAe,CAAK,QAAQ,CAAC,YAAY,CAAC,KAC7C,EAAE,EAAE,QAAQ,CAAC,cAAc,IAC5B;AACH,CAAC;AAED,SAAS,WAAW,CAClB,IAAsC,EACtC,YAA0B;;IAE1B,OAAO,MAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,KAAK,YAAY,CAAC,mCAAI,IAAI,CAAA;AAC7E,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js index 7fd7f5e7e9..cb99fb1dd0 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js @@ -1,11 +1,12 @@ +var _a; import merge from 'lodash.merge'; -import { stripTrailingSlash } from "wasp/universal/url"; -const env = process.env.NODE_ENV || 'development'; +import { stripTrailingSlash } from "../universal/url.js"; +const nodeEnv = (_a = process.env.NODE_ENV) !== null && _a !== void 0 ? _a : 'development'; const config = { all: { - env, - isDevelopment: env === 'development', - port: parseInt(process.env.PORT) || 3001, + env: nodeEnv, + isDevelopment: nodeEnv === 'development', + port: process.env.PORT ? parseInt(process.env.PORT) : 3001, databaseUrl: process.env.DATABASE_URL, allowedCORSOrigins: [], auth: { @@ -15,14 +16,17 @@ const config = { development: getDevelopmentConfig(), production: getProductionConfig(), }; -const resolvedConfig = merge(config.all, config[env]); +const resolvedConfig = merge(config.all, config[nodeEnv]); // PUBLIC API export default resolvedConfig; function getDevelopmentConfig() { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL || 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL || 'http://localhost:3001'); + var _a, _b; + const frontendUrl = stripTrailingSlash((_a = process.env.WASP_WEB_CLIENT_URL) !== null && _a !== void 0 ? _a : 'http://localhost:3000/'); + const serverUrl = stripTrailingSlash((_b = process.env.WASP_SERVER_URL) !== null && _b !== void 0 ? _b : 'http://localhost:3001'); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, allowedCORSOrigins: '*', auth: { @@ -34,8 +38,11 @@ function getProductionConfig() { const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, + // @ts-ignore allowedCORSOrigins: [frontendUrl], auth: { jwtSecret: process.env.JWT_SECRET diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js.map index d2f0e1bb1c..0ef81fb2bc 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,cAAc,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAA;AA4BjD,MAAM,MAAM,GAIR;IACF,GAAG,EAAE;QACH,GAAG;QACH,aAAa,EAAE,GAAG,KAAK,aAAa;QACpC,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI;QACxC,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;QACrC,kBAAkB,EAAE,EAAE;QACtB,IAAI,EAAE;YACJ,SAAS,EAAE,SAAS;SACrB;KACF;IACD,WAAW,EAAE,oBAAoB,EAAE;IACnC,UAAU,EAAE,mBAAmB,EAAE;CAClC,CAAA;AAED,MAAM,cAAc,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;AAC7D,aAAa;AACb,eAAe,cAAc,CAAA;AAE7B,SAAS,oBAAoB;IAC3B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,wBAAwB,CAAC,CAAC;IACpG,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,uBAAuB,CAAC,CAAC;IAC7F,OAAO;QACL,WAAW;QACX,SAAS;QACT,kBAAkB,EAAE,GAAG;QACvB,IAAI,EAAE;YACJ,SAAS,EAAE,cAAc;SAC1B;KACF,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB;IAC1B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACxE,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAClE,OAAO;QACL,WAAW;QACX,SAAS;QACT,kBAAkB,EAAE,CAAC,WAAW,CAAC;QACjC,IAAI,EAAE;YACJ,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;SAClC;KACF,CAAA;AACH,CAAC"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,cAAc,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,QAAQ,mCAAI,aAAa,CAAA;AA4BrD,MAAM,MAAM,GAIR;IACF,GAAG,EAAE;QACH,GAAG,EAAE,OAAO;QACZ,aAAa,EAAE,OAAO,KAAK,aAAa;QACxC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;QAC1D,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;QACrC,kBAAkB,EAAE,EAAE;QACtB,IAAI,EAAE;YACJ,SAAS,EAAE,SAAS;SACrB;KACF;IACD,WAAW,EAAE,oBAAoB,EAAE;IACnC,UAAU,EAAE,mBAAmB,EAAE;CAClC,CAAA;AAED,MAAM,cAAc,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;AACjE,aAAa;AACb,eAAe,cAAc,CAAA;AAE7B,SAAS,oBAAoB;;IAC3B,MAAM,WAAW,GAAG,kBAAkB,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,mBAAmB,mCAAI,wBAAwB,CAAC,CAAC;IACpG,MAAM,SAAS,GAAG,kBAAkB,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,eAAe,mCAAI,uBAAuB,CAAC,CAAC;IAC7F,OAAO;QACL,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,kBAAkB,EAAE,GAAG;QACvB,IAAI,EAAE;YACJ,SAAS,EAAE,cAAc;SAC1B;KACF,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB;IAC1B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACxE,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAClE,OAAO;QACL,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,aAAa;QACb,kBAAkB,EAAE,CAAC,WAAW,CAAC;QACjC,IAAI,EAAE;YACJ,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;SAClC;KACF,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js index d837baecb7..91c1207b30 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js @@ -1,4 +1,6 @@ import { initEmailSender } from "./core/index.js"; +// TODO: We need to validate all the env variables +// For now, we are letting the runtime throw if they are not provided const emailProvider = { type: "sendgrid", apiKey: process.env.SENDGRID_API_KEY, diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js.map index f37f90895f..1629cdd0f0 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/email/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/email/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD,MAAM,aAAa,GAAG;IACpB,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB;CAC5B,CAAC;AAEX,aAAa;AACb,MAAM,CAAC,MAAM,WAAW,GAAgB,eAAe,CAAC,aAAa,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/email/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD,kDAAkD;AAClD,qEAAqE;AACrE,MAAM,aAAa,GAAG;IACpB,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAiB;CAC7B,CAAC;AAEX,aAAa;AACb,MAAM,CAAC,MAAM,WAAW,GAAgB,eAAe,CAAC,aAAa,CAAC,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.d.ts index daf1c7f9d0..1a7e7c5a33 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.d.ts @@ -6,17 +6,17 @@ import type { JobFn } from 'wasp/server/jobs/core/pgBoss'; export declare const PG_BOSS_EXECUTOR_NAME: unique symbol; type JobSchedule = { cron: Parameters[1]; - args: Parameters[2]; options: Parameters[3]; + args?: NonNullable[2]>; }; /** * Creates an instance of PgBossJob which contains all of the necessary * information to submit a job to pg-boss. */ export declare function createJobDefinition>({ jobName, defaultJobOptions, jobSchedule, entities, }: { - jobName: Parameters[0]; - defaultJobOptions: PgBoss.Schedule['options']; - jobSchedule: JobSchedule | null; + jobName: PgBossJob['jobName']; + defaultJobOptions: PgBossJob['defaultJobOptions']; + jobSchedule: PgBossJob['jobSchedule']; entities: Entities; }): PgBossJob; /** @@ -35,7 +35,7 @@ export declare function registerJob> extends Job { readonly defaultJobOptions: Parameters[2]; - readonly startAfter: number | string | Date; + readonly startAfter: number | string | Date | undefined; readonly entities: Entities; readonly jobSchedule: JobSchedule | null; constructor(jobName: string, defaultJobOptions: Parameters[2], entities: Entities, jobSchedule: JobSchedule | null, startAfter?: number | string | Date); diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js index e26ad6250d..6798f1a929 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js @@ -36,7 +36,7 @@ export function registerJob({ job, jobFn }) { // Ref: https://github.com/timgit/pg-boss/blob/master/docs/readme.md#scheduling if (job.jobSchedule) { const options = Object.assign(Object.assign({}, job.defaultJobOptions), job.jobSchedule.options); - await boss.schedule(job.jobName, job.jobSchedule.cron, job.jobSchedule.args || null, options); + await boss.schedule(job.jobName, job.jobSchedule.cron, job.jobSchedule.args, options); } }); } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js.map index 7f0a871aaa..0b587da921 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js.map @@ -1 +1 @@ -{"version":3,"file":"pgBossJob.js","sourceRoot":"","sources":["../../../../../server/jobs/core/pgBoss/pgBossJob.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAK7C,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;AAQrD,cAAc;AACd;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAIjC,EACA,OAAO,EACP,iBAAiB,EACjB,WAAW,EACX,QAAQ,GAUT;IACC,OAAO,IAAI,SAAS,CAClB,O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,EAAE;QAC/B,MAAM,OAAO,GAAG,EAAE,QAAQ,EAAE,CAAA;QAC5B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAClC,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file +{"version":3,"file":"pgBossJob.js","sourceRoot":"","sources":["../../../../../server/jobs/core/pgBoss/pgBossJob.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAK7C,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;AAQrD,cAAc;AACd;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAIjC,EACA,OAAO,EACP,iBAAiB,EACjB,WAAW,EACX,QAAQ,GAUT;IACC,OAAO,IAAI,SAAS,CAClB,OAAO,EACP,iBAAiB,EACjB,QAAQ,EACR,WAAW,CACZ,CAAA;AACH,CAAC;AAED,cAAc;AACd;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAIzB,EAAE,GAAG,EAAE,KAAK,EAGb;IACC,wGAAwG;IACxG,wGAAwG;IACxG,6DAA6D;IAC7D,2FAA2F;IAC3F,uGAAuG;IACvG,4GAA4G;IAC5G,0DAA0D;IAC1D,kFAAkF;IAClF,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QAChC,6EAA6E;QAC7E,0EAA0E;QAC1E,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAE/B,wFAAwF;QACxF,yEAAyE;QACzE,MAAM,IAAI,CAAC,IAAI,CACb,GAAG,CAAC,OAAO,EACX,qBAAqB,CAA0B,KAAK,EAAE,GAAG,CAAC,QAAQ,CAAC,CACpE,CAAA;QAED,uEAAuE;QACvE,6GAA6G;QAC7G,+EAA+E;QAC/E,IAAI,GAAG,CAAC,WAAW,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C3E,CAAC;CACF;AAED;;GAEG;AACH,MAAM,kBAIJ,SAAQ,YAAY;IAOpB,YACE,IAAY,EACZ,GAAuC,EACvC,KAA4B;QAE5B,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QACjB,IAAI,CAAC,MAAM,GAAG;YACZ,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;YAChC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;YAChC,8DAA8D;YAC9D,OAAO,EAAE,GAAG,EAAE,CACZ,IAAI,CAAC,UAAU,CAAC,KAAK,CAAiD;SACzE,CAAA;IACH,CAAC;CACF;AAED;;;GAGG;AACH,SAAS,qBAAqB;AAK5B,wDAAwD;AACxD,KAAqC;AACrC,sDAAsD;AACtD,QAAkB;IAElB,OAAO,CAAC,IAAqB,EAAE,EAAE;QAC/B,MAAM,OAAO,GAAG,EAAE,QAAQ,EAAE,CAAA;QAC5B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAClC,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.d.ts index 5bfe012bf8..ced7292f4c 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.d.ts @@ -4,19 +4,19 @@ declare const entities: {}; export type MySpecialJob = JobFn; export declare const mySpecialJob: { readonly defaultJobOptions: Parameters[2]; - readonly startAfter: number | string | Date; + readonly startAfter: number | string | Date | undefined; readonly entities: {}; readonly jobSchedule: { cron: Parameters[1]; - args: Parameters[2]; options: Parameters[3]; + args?: NonNullable[2]>; } | null; - delay(startAfter: number | string | Date): any; + delay(startAfter: number | string | Date): /*elided*/ any; submit(jobArgs: JSONObject, jobOptions?: Parameters[2]): Promise<{ readonly pgBoss: { readonly cancel: () => ReturnType; readonly resume: () => ReturnType; - readonly details: () => Promise, "output" | "state"> & ({ + readonly details: () => Promise<(Omit, "output" | "state"> & ({ data: JSONObject; } & ({ state: "failed"; @@ -34,8 +34,8 @@ export declare const mySpecialJob: { value: false; } | { value: true; - }; - }))>; + } | null; + }))) | null>; }; readonly job: import("./core/job").Job; readonly jobId: string; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js index f8de946894..9658ce11d1 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js @@ -1,10 +1,11 @@ import { createJobDefinition } from 'wasp/server/jobs/core/pgBoss'; const entities = {}; +const jobSchedule = null; // PUBLIC API export const mySpecialJob = createJobDefinition({ jobName: 'mySpecialJob', defaultJobOptions: {}, - jobSchedule: null, + jobSchedule, entities, }); //# sourceMappingURL=mySpecialJob.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js.map index 4ae829e30f..6ea95bce07 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js.map @@ -1 +1 @@ -{"version":3,"file":"mySpecialJob.js","sourceRoot":"","sources":["../../../server/jobs/mySpecialJob.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAE9E,MAAM,QAAQ,GAAG,EAChB,CAAA;AAKD,aAAa;AACb,MAAM,CAAC,MAAM,YAAY,GAAG,mBAAmB,CAAC;IAC9C,OAAO,EAAE,cAAc;IACvB,iBAAiB,EAAE,EAAE;IACrB,WAAW,EAAE,IAAI;IACjB,QAAQ;CACT,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"mySpecialJob.js","sourceRoot":"","sources":["../../../server/jobs/mySpecialJob.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAE9E,MAAM,QAAQ,GAAG,EAChB,CAAA;AAKD,MAAM,WAAW,GAAG,IAAI,CAAA;AAExB,aAAa;AACb,MAAM,CAAC,MAAM,YAAY,GAAG,mBAAmB,CAAC;IAC9C,OAAO,EAAE,cAAc;IACvB,iBAAiB,EAAE,EAAE;IACrB,WAAW;IACX,QAAQ;CACT,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.d.ts index 94411dc1df..8e3d630a6c 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.d.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.d.ts @@ -6,21 +6,21 @@ declare const entities: { export type ReturnHelloJob = JobFn; export declare const returnHelloJob: { readonly defaultJobOptions: Parameters[2]; - readonly startAfter: number | string | Date; + readonly startAfter: number | string | Date | undefined; readonly entities: { User: import(".prisma/client").Prisma.UserDelegate; }; readonly jobSchedule: { cron: Parameters[1]; - args: Parameters[2]; options: Parameters[3]; + args?: NonNullable[2]>; } | null; - delay(startAfter: number | string | Date): any; + delay(startAfter: number | string | Date): /*elided*/ any; submit(jobArgs: JSONObject, jobOptions?: Parameters[2]): Promise<{ readonly pgBoss: { readonly cancel: () => ReturnType; readonly resume: () => ReturnType; - readonly details: () => Promise, "output" | "state"> & ({ + readonly details: () => Promise<(Omit, "output" | "state"> & ({ data: JSONObject; } & ({ state: "failed"; @@ -38,8 +38,8 @@ export declare const returnHelloJob: { value: false; } | { value: true; - }; - }))>; + } | null; + }))) | null>; }; readonly job: import("./core/job").Job; readonly jobId: string; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.js index 02e6f71fb6..2b0e0052e8 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.js +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.js @@ -3,11 +3,12 @@ import { createJobDefinition } from 'wasp/server/jobs/core/pgBoss'; const entities = { User: prisma.user, }; +const jobSchedule = null; // PUBLIC API export const returnHelloJob = createJobDefinition({ jobName: 'returnHelloJob', defaultJobOptions: {}, - jobSchedule: null, + jobSchedule, entities, }); //# sourceMappingURL=returnHelloJob.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.js.map index 6aed6d65d0..e27869a075 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.js.map +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/server/jobs/returnHelloJob.js.map @@ -1 +1 @@ -{"version":3,"file":"returnHelloJob.js","sourceRoot":"","sources":["../../../server/jobs/returnHelloJob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,OAAO,EAAc,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAE9E,MAAM,QAAQ,GAAG;IACf,IAAI,EAAE,MAAM,CAAC,IAAI;CAClB,CAAA;AAKD,aAAa;AACb,MAAM,CAAC,MAAM,cAAc,GAAG,mBAAmB,CAAC;IAChD,OAAO,EAAE,gBAAgB;IACzB,iBAAiB,EAAE,EAAE;IACrB,WAAW,EAAE,IAAI;IACjB,QAAQ;CACT,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"returnHelloJob.js","sourceRoot":"","sources":["../../../server/jobs/returnHelloJob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,OAAO,EAAc,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAE9E,MAAM,QAAQ,GAAG;IACf,IAAI,EAAE,MAAM,CAAC,IAAI;CAClB,CAAA;AAKD,MAAM,WAAW,GAAG,IAAI,CAAA;AAExB,aAAa;AACb,MAAM,CAAC,MAAM,cAAc,GAAG,mBAAmB,CAAC;IAChD,OAAO,EAAE,gBAAgB;IACzB,iBAAiB,EAAE,EAAE;IACrB,WAAW;IACX,QAAQ;CACT,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/predicates.d.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/predicates.d.ts new file mode 100644 index 0000000000..8e81fc0515 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/predicates.d.ts @@ -0,0 +1 @@ +export declare function isNotNull(value: T | null): value is T; diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/predicates.js b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/predicates.js new file mode 100644 index 0000000000..b298e903bc --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/predicates.js @@ -0,0 +1,4 @@ +export function isNotNull(value) { + return value !== null; +} +//# sourceMappingURL=predicates.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/predicates.js.map b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/predicates.js.map new file mode 100644 index 0000000000..1fdec4adb8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/dist/universal/predicates.js.map @@ -0,0 +1 @@ +{"version":3,"file":"predicates.js","sourceRoot":"","sources":["../../universal/predicates.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAI,KAAe;IAC1C,OAAO,KAAK,KAAK,IAAI,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/HttpError.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/HttpError.ts index 3e8d3f5a0d..d05a2c841b 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/HttpError.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/HttpError.ts @@ -2,8 +2,8 @@ export class HttpError extends Error { public statusCode: number public data: unknown - constructor (statusCode: number, message?: string, data?: Record, ...params: unknown[]) { - super(message, ...params) + constructor (statusCode: number, message?: string, data?: Record, options?: ErrorOptions) { + super(message, options) if (Error.captureStackTrace) { Error.captureStackTrace(this, HttpError) diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/hooks.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/hooks.ts index bb61fe8b95..98f7530ce0 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/hooks.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/hooks.ts @@ -1,5 +1,5 @@ import type { Request as ExpressRequest } from 'express' -import { type ProviderId, createUser, findAuthWithUserBy } from '../../auth/utils.js' +import { type ProviderId, type CreateUserResult, type FindAuthWithUserResult } from '../../auth/utils.js' import { prisma } from '../index.js' import { Expand } from '../../universal/types.js' @@ -64,7 +64,7 @@ type OnAfterSignupHookParams = { /** * User object that was created during the signup process. */ - user: Awaited> + user: CreateUserResult /** * OAuth flow data that was generated during the OAuth flow. This is only * available if the user signed up using OAuth. @@ -99,7 +99,7 @@ type OnBeforeLoginHookParams = { /** * User that is trying to log in. */ - user: Awaited>['user'] + user: FindAuthWithUserResult['user'] /** * Request object that can be used to access the incoming request. */ @@ -114,7 +114,7 @@ type OnAfterLoginHookParams = { /** * User that is logged in. */ - user: Awaited>['user'] + user: FindAuthWithUserResult['user'] /** * OAuth flow data that was generated during the OAuth flow. This is only * available if the user logged in using OAuth. diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/index.ts index 117225dae7..fc094eff40 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/index.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/index.ts @@ -6,9 +6,11 @@ export { createProviderId, sanitizeAndSerializeProviderData, updateAuthIdentityProviderData, - deserializeAndSanitizeProviderData, + getProviderData, + getProviderDataWithPassword, findAuthIdentity, createUser, + type CreateUserResult, type ProviderId, type ProviderName, type EmailProviderData, diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/oauth/redirect.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/oauth/redirect.ts index 1eac920af7..f7760ae3de 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/oauth/redirect.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/oauth/redirect.ts @@ -38,5 +38,5 @@ function getRedirectUriForError(error: string): URL { } function isHttpErrorWithExtraMessage(error: HttpError): error is HttpError & { data: { message: string } } { - return error.data && typeof (error.data as any).message === 'string'; + return !!error.data && typeof (error.data as any).message === 'string'; } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/user.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/user.ts index 4a7a147a47..45f0de220d 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/user.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/auth/user.ts @@ -5,7 +5,7 @@ import { } from '../../entities/index.js' import { type PossibleProviderData, - deserializeAndSanitizeProviderData + getProviderData, } from '../../auth/utils.js' import { type ProviderName } from '../_types/index.js' import { Expand } from '../../universal/types.js' @@ -94,9 +94,7 @@ function getProviderInfo( return null } return { - ...deserializeAndSanitizeProviderData(identity.providerData, { - shouldRemovePasswordField: true, - }), + ...getProviderData(identity.providerData), id: identity.providerUserId, } } diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/config.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/config.ts index 90bc82125a..4ca36bd30f 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/config.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/config.ts @@ -1,8 +1,8 @@ import merge from 'lodash.merge' -import { stripTrailingSlash } from "wasp/universal/url"; +import { stripTrailingSlash } from "../universal/url.js"; -const env = process.env.NODE_ENV || 'development' +const nodeEnv = process.env.NODE_ENV ?? 'development' // TODO: // - Use dotenv library to consume env vars from a file. @@ -36,9 +36,9 @@ const config: { production: EnvConfig, } = { all: { - env, - isDevelopment: env === 'development', - port: parseInt(process.env.PORT) || 3001, + env: nodeEnv, + isDevelopment: nodeEnv === 'development', + port: process.env.PORT ? parseInt(process.env.PORT) : 3001, databaseUrl: process.env.DATABASE_URL, allowedCORSOrigins: [], auth: { @@ -49,15 +49,17 @@ const config: { production: getProductionConfig(), } -const resolvedConfig: Config = merge(config.all, config[env]) +const resolvedConfig: Config = merge(config.all, config[nodeEnv]) // PUBLIC API export default resolvedConfig function getDevelopmentConfig(): EnvConfig { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL || 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL || 'http://localhost:3001'); + const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL ?? 'http://localhost:3000/'); + const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL ?? 'http://localhost:3001'); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, allowedCORSOrigins: '*', auth: { @@ -70,8 +72,11 @@ function getProductionConfig(): EnvConfig { const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, + // @ts-ignore allowedCORSOrigins: [frontendUrl], auth: { jwtSecret: process.env.JWT_SECRET diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/index.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/index.ts index 3230b5e8c5..3168a70671 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/index.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/email/index.ts @@ -1,9 +1,11 @@ import { initEmailSender } from "./core/index.js"; import { EmailSender } from "./core/types.js"; +// TODO: We need to validate all the env variables +// For now, we are letting the runtime throw if they are not provided const emailProvider = { type: "sendgrid", - apiKey: process.env.SENDGRID_API_KEY, + apiKey: process.env.SENDGRID_API_KEY!, } as const; // PUBLIC API diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts index 42435db213..d545566ab6 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts @@ -9,8 +9,8 @@ export const PG_BOSS_EXECUTOR_NAME = Symbol('PgBoss') type JobSchedule = { cron: Parameters[1] - args: Parameters[2] options: Parameters[3] + args?: NonNullable[2]> } // PRIVATE API @@ -29,11 +29,11 @@ export function createJobDefinition< entities, }: { // jobName - The user-defined job name in their .wasp file. - jobName: Parameters[0] + jobName: PgBossJob['jobName'] // defaultJobOptions - pg-boss specific options for `boss.send()` applied to every `submit()` invocation, // which can overriden in that call. - defaultJobOptions: PgBoss.Schedule['options'] - jobSchedule: JobSchedule | null + defaultJobOptions: PgBossJob['defaultJobOptions'] + jobSchedule: PgBossJob['jobSchedule'] // Entities used by job, passed into callback context. entities: Entities }) { @@ -90,7 +90,7 @@ export function registerJob< await boss.schedule( job.jobName, job.jobSchedule.cron, - job.jobSchedule.args || null, + job.jobSchedule.args, options ) } @@ -108,7 +108,7 @@ class PgBossJob< Entities extends Partial > extends Job { public readonly defaultJobOptions: Parameters[2] - public readonly startAfter: number | string | Date + public readonly startAfter: number | string | Date | undefined public readonly entities: Entities public readonly jobSchedule: JobSchedule | null diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/mySpecialJob.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/mySpecialJob.ts index 574030dba0..d07ff1d5be 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/mySpecialJob.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/mySpecialJob.ts @@ -8,10 +8,12 @@ const entities = { // PUBLIC API export type MySpecialJob = JobFn +const jobSchedule = null + // PUBLIC API export const mySpecialJob = createJobDefinition({ jobName: 'mySpecialJob', defaultJobOptions: {}, - jobSchedule: null, + jobSchedule, entities, }) diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/returnHelloJob.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/returnHelloJob.ts index c30d179a16..1f810c4351 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/returnHelloJob.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/server/jobs/returnHelloJob.ts @@ -9,10 +9,12 @@ const entities = { // PUBLIC API export type ReturnHelloJob = JobFn +const jobSchedule = null + // PUBLIC API export const returnHelloJob = createJobDefinition({ jobName: 'returnHelloJob', defaultJobOptions: {}, - jobSchedule: null, + jobSchedule, entities, }) diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/tsconfig.json b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/tsconfig.json index 8c7c86644c..5a3c9142c3 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/tsconfig.json +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/tsconfig.json @@ -13,11 +13,11 @@ "alwaysStrict": true, "noImplicitThis": true, "strictFunctionTypes": true, + "strictNullChecks": true, // See https://github.com/wasp-lang/wasp/issues/2056 before activating this: // "useUnknownInCatchVariables": true, - // The following 3 stict options will require more work: + // The following 2 stict options will require more work: // "noImplicitAny": true, - // "strictNullChecks": true, // "strictPropertyInitialization": true, // Overriding this because we want to use top-level await "module": "esnext", diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/universal/predicates.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/universal/predicates.ts new file mode 100644 index 0000000000..4294e839f0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/sdk/wasp/universal/predicates.ts @@ -0,0 +1,3 @@ +export function isNotNull(value: T | null): value is T { + return value !== null; +} diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/oauth/user.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/oauth/user.ts index c252b60f1a..6882219128 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/oauth/user.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/auth/providers/oauth/user.ts @@ -84,6 +84,10 @@ async function getAuthIdFromProviderDetails({ // but we wanted to keep the onAfterLoginHook params consistent for all auth providers. const auth = await findAuthWithUserBy({ id: authId }) + if (auth === null) { + throw new Error('Auth entity not found while trying to log in with OAuth') + } + // NOTE: We are calling login hooks here even though we didn't log in the user yet. // It's because we have access to the OAuth tokens here and we want to pass them to the hooks. // We could have stored the tokens temporarily and called the hooks after the session is created, diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/crud/tasks.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/crud/tasks.ts index f69ed856dc..7c05092c78 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/crud/tasks.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/crud/tasks.ts @@ -1,6 +1,6 @@ import { prisma } from 'wasp/server' -import { throwInvalidCredentialsError } from 'wasp/auth/utils' +import { createInvalidCredentialsError } from 'wasp/auth/utils' import type { GetAllQueryResolved, GetQueryResolved, @@ -54,6 +54,6 @@ export async function createFn(args, context) { function throwIfNotAuthenticated (context) { if (!context.user) { - throwInvalidCredentialsError() + throw createInvalidCredentialsError() } } \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/auth/logout.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/auth/logout.ts index 7966e56c03..e339443a17 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/auth/logout.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/auth/logout.ts @@ -1,5 +1,5 @@ import { handleRejection } from 'wasp/server/utils' -import { throwInvalidCredentialsError } from 'wasp/auth/utils' +import { createInvalidCredentialsError } from 'wasp/auth/utils' import { invalidateSession } from 'wasp/auth/session' export default handleRejection(async (req, res) => { @@ -7,6 +7,6 @@ export default handleRejection(async (req, res) => { await invalidateSession(req.sessionId) return res.json({ success: true }) } else { - throwInvalidCredentialsError() + throw createInvalidCredentialsError() } }) diff --git a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/auth/me.ts b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/auth/me.ts index 8c182835d1..ad379d14a5 100644 --- a/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/auth/me.ts +++ b/waspc/e2e-test/test-outputs/waspComplexTest-golden/waspComplexTest/.wasp/out/server/src/routes/auth/me.ts @@ -1,11 +1,11 @@ import { serialize as superjsonSerialize } from 'superjson' import { handleRejection } from 'wasp/server/utils' -import { throwInvalidCredentialsError } from 'wasp/auth/utils' +import { createInvalidCredentialsError } from 'wasp/auth/utils' export default handleRejection(async (req, res) => { if (req.user) { return res.json(superjsonSerialize(req.user)) } else { - throwInvalidCredentialsError() + throw createInvalidCredentialsError() } }) diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/files.manifest b/waspc/e2e-test/test-outputs/waspJob-golden/files.manifest index 7f7ab93dbc..c04620f749 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspJob-golden/files.manifest @@ -144,9 +144,15 @@ waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/types.js.map waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.d.ts waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.js waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.js.map -waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.d.ts -waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js -waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduleJob.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduleJob.js +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduleJob.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduledJobWithArgs.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduledJobWithArgs.js +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduledJobWithArgs.js.map +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/simpleJob.d.ts +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/simpleJob.js +waspJob/.wasp/out/sdk/wasp/dist/server/jobs/simpleJob.js.map waspJob/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.d.ts waspJob/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js waspJob/.wasp/out/sdk/wasp/dist/server/middleware/globalMiddleware.js.map @@ -177,6 +183,9 @@ waspJob/.wasp/out/sdk/wasp/dist/server/types/index.js.map waspJob/.wasp/out/sdk/wasp/dist/server/utils.d.ts waspJob/.wasp/out/sdk/wasp/dist/server/utils.js waspJob/.wasp/out/sdk/wasp/dist/server/utils.js.map +waspJob/.wasp/out/sdk/wasp/dist/universal/predicates.d.ts +waspJob/.wasp/out/sdk/wasp/dist/universal/predicates.js +waspJob/.wasp/out/sdk/wasp/dist/universal/predicates.js.map waspJob/.wasp/out/sdk/wasp/dist/universal/types.d.ts waspJob/.wasp/out/sdk/wasp/dist/universal/types.js waspJob/.wasp/out/sdk/wasp/dist/universal/types.js.map @@ -207,7 +216,9 @@ waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBoss.ts waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/types.ts waspJob/.wasp/out/sdk/wasp/server/jobs/index.ts -waspJob/.wasp/out/sdk/wasp/server/jobs/mySpecialJob.ts +waspJob/.wasp/out/sdk/wasp/server/jobs/scheduleJob.ts +waspJob/.wasp/out/sdk/wasp/server/jobs/scheduledJobWithArgs.ts +waspJob/.wasp/out/sdk/wasp/server/jobs/simpleJob.ts waspJob/.wasp/out/sdk/wasp/server/middleware/globalMiddleware.ts waspJob/.wasp/out/sdk/wasp/server/middleware/index.ts waspJob/.wasp/out/sdk/wasp/server/operations/actions/index.ts @@ -219,6 +230,7 @@ waspJob/.wasp/out/sdk/wasp/server/operations/wrappers.ts waspJob/.wasp/out/sdk/wasp/server/types/index.ts waspJob/.wasp/out/sdk/wasp/server/utils.ts waspJob/.wasp/out/sdk/wasp/tsconfig.json +waspJob/.wasp/out/sdk/wasp/universal/predicates.ts waspJob/.wasp/out/sdk/wasp/universal/types.ts waspJob/.wasp/out/sdk/wasp/universal/url.ts waspJob/.wasp/out/sdk/wasp/universal/validators.ts @@ -232,7 +244,9 @@ waspJob/.wasp/out/server/rollup.config.js waspJob/.wasp/out/server/scripts/validate-env.mjs waspJob/.wasp/out/server/src/app.js waspJob/.wasp/out/server/src/jobs/core/allJobs.ts -waspJob/.wasp/out/server/src/jobs/mySpecialJob.ts +waspJob/.wasp/out/server/src/jobs/scheduleJob.ts +waspJob/.wasp/out/server/src/jobs/scheduledJobWithArgs.ts +waspJob/.wasp/out/server/src/jobs/simpleJob.ts waspJob/.wasp/out/server/src/middleware/globalMiddleware.ts waspJob/.wasp/out/server/src/middleware/index.ts waspJob/.wasp/out/server/src/middleware/operations.ts diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/.waspchecksums b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/.waspchecksums index b5a8eac5dc..3b666d1aac 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/.waspchecksums +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/.waspchecksums @@ -11,14 +11,14 @@ "file", "../out/sdk/wasp/api/index.ts" ], - "5784ba365e8a5cb2031571cfebf1cbae8670f86f8e5a596b133d333cdf6c91eb" + "2c300f215d89a72dad5e7a766dd97a64aa85b19126c96708487201b9b08a94f9" ], [ [ "file", "../out/sdk/wasp/client/config.ts" ], - "bc7d48bd7ec4cdf74f85b98113eb26e670ef265ca4bbd735e361409c9335ad85" + "d94e8bee5fd8f6793b511652b9ee558e57f4913595763137a5385cd929648168" ], [ [ @@ -46,7 +46,7 @@ "file", "../out/sdk/wasp/client/operations/hooks.ts" ], - "d1a8fccfb8207476b90708e8285d1455b33ff4e446749b33c3eb1a54dcfe2d41" + "3c326183d9dcb2bcf14b747ffc66b19e4773642d05f3f84d401e3d54b843eeca" ], [ [ @@ -60,7 +60,7 @@ "file", "../out/sdk/wasp/client/operations/internal/index.ts" ], - "f08a4f1fb1f897edca465b3f228215e06418109fb439232e8fa0ffdbdc98b833" + "d710d9894f56194c0d87921f339100414c69b987f1f5221881ca372fd70be371" ], [ [ @@ -186,7 +186,7 @@ "file", "../out/sdk/wasp/ext-src/server/jobs/bar.js" ], - "2e126f35b3a3e9a289e0dcfd8707fe903c6a053e0cf85899fb5f686d77dd3eb5" + "83c606a3eee7608155cdb2c2a20a38f851a82987e060ce25b196b467092c4740" ], [ [ @@ -221,7 +221,7 @@ "file", "../out/sdk/wasp/server/HttpError.ts" ], - "eaa296c30acc65c78b90ebdf9a1d6fdb863f0c26c743d352afaeaa3bbc2fdd1b" + "f375fb45eeb16381b8cc575503db302c005ddaa1b35d837ca0ea043fe8ec6ccb" ], [ [ @@ -249,7 +249,7 @@ "file", "../out/sdk/wasp/server/config.ts" ], - "e5388a9259a22671ee2d2ef46d2c09fdd46c3b3ec24248c7a0b471c0fbf7aa54" + "5dd35660e0969defaa3c180179919f4922ab7bc041746872dff7f2280c1872ae" ], [ [ @@ -291,7 +291,7 @@ "file", "../out/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts" ], - "5f38460e959430e59c2e8fb8fd0f57493ea420e316258277bf67e4ba30e16cd8" + "19de68ae9a461b6e3455271aa7ff439827d2a6292a301a9ed61a24d912ac1773" ], [ [ @@ -305,14 +305,28 @@ "file", "../out/sdk/wasp/server/jobs/index.ts" ], - "f044a976b9e09e5b070d7d09649e72eb5955171d7061507dabac53504f8dd8af" + "ab50c7f50161cbd18c01dff6ddbd4ce1ab2671333a46770f9bba6ef1f7055c12" ], [ [ "file", - "../out/sdk/wasp/server/jobs/mySpecialJob.ts" + "../out/sdk/wasp/server/jobs/scheduleJob.ts" ], - "e3ae9eef941de7e55ccee6ea13239cb727ddf82bfa96bc41b71954e8fe1d813e" + "c06df4ce13bd786dc74f94e608168cb373aadee3e53e9ac4b6890e519d7c412e" + ], + [ + [ + "file", + "../out/sdk/wasp/server/jobs/scheduledJobWithArgs.ts" + ], + "c63177d281969bfa38280f9506a97b2504efb01bd169944dd5db9781d509c9ba" + ], + [ + [ + "file", + "../out/sdk/wasp/server/jobs/simpleJob.ts" + ], + "01ffbece6976912c847a61c9ada1017a6375d6ec2b169d44b25240aa1004892e" ], [ [ @@ -389,7 +403,14 @@ "file", "../out/sdk/wasp/tsconfig.json" ], - "4323884e7e8c52683788995be58e8f583c00fc611845fdbd481157d0118dccd2" + "3b09df60f6728880a953a746ef887e045de0b533cb383f89d6adf8ff906edac8" + ], + [ + [ + "file", + "../out/sdk/wasp/universal/predicates.ts" + ], + "baa4148fdf4995cfc154a81bc494e9e8077635d4db50958d5b59837d1b8ed691" ], [ [ @@ -508,14 +529,28 @@ "file", "server/src/jobs/core/allJobs.ts" ], - "777c5e9c0c5026689df46e542fbf325b76774db020f962c33f2c8c9168f2c776" + "c9ee40f162ae5532395e356be936a3bfc78207b6e0fae5f8a3e68b06b726fb48" + ], + [ + [ + "file", + "server/src/jobs/scheduleJob.ts" + ], + "438d536219e2d04c558b1a00ec8ac81d27f0fd65f727c57a13f08dcbe384035d" + ], + [ + [ + "file", + "server/src/jobs/scheduledJobWithArgs.ts" + ], + "a2978ed4d5f06710a1865b93e2e9ee18b938147e1b353598efe2bc4dc0c3aed1" ], [ [ "file", - "server/src/jobs/mySpecialJob.ts" + "server/src/jobs/simpleJob.ts" ], - "a93521d6cb34ea3e5b22fea6b8adaf2e00919f2f9460f189ef3b046a87f8c4b0" + "24e0374af6a063332747aff2f3811823f4184ab95fa6dfb6513d868714dd2fcf" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/api/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/api/index.ts index 6037b3048c..c8895b1275 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/api/index.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/api/index.ts @@ -77,7 +77,7 @@ window.addEventListener('storage', (event) => { * standard format to be further used by the client. It is also assumed that given API * error has been formatted as implemented by HttpError on the server. */ -export function handleApiError(error: AxiosError<{ message?: string, data?: unknown }>): void { +export function handleApiError>(error: T): T | WaspHttpError { if (error?.response) { // If error came from HTTP response, we capture most informative message // and also add .statusCode information to it. @@ -88,10 +88,10 @@ export function handleApiError(error: AxiosError<{ message?: string, data?: unkn // That would require copying HttpError code to web-app also and using it here. const responseJson = error.response?.data const responseStatusCode = error.response.status - throw new WaspHttpError(responseStatusCode, responseJson?.message ?? error.message, responseJson) + return new WaspHttpError(responseStatusCode, responseJson?.message ?? error.message, responseJson) } else { // If any other error, we just propagate it. - throw error + return error } } diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/config.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/config.ts index 2f9967891e..82b0f80b6a 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/config.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/config.ts @@ -1,4 +1,4 @@ -import { stripTrailingSlash } from 'wasp/universal/url' +import { stripTrailingSlash } from '../universal/url.js' const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/hooks.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/hooks.ts index 0f03f3167a..7ac0aac46d 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/hooks.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/hooks.ts @@ -28,8 +28,12 @@ export function useQuery( return rqUseQuery({ // todo: The full queryCacheKey is constructed in two places, both here and // inside the Query. See https://github.com/wasp-lang/wasp/issues/2017 - queryKey: makeQueryCacheKey(query, queryFnArgs), - queryFn: () => query(queryFnArgs), + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryKey: makeQueryCacheKey(query, (queryFnArgs as Input)), + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryFn: () => query(queryFnArgs as Input), ...options, }) } @@ -138,7 +142,7 @@ type InternalOptimisticUpdateDefinition = { * the current state of the cache and returns the desired (new) state of the * cache. */ -type SpecificUpdateQuery = (oldData: CachedData) => CachedData; +type SpecificUpdateQuery = (oldData: CachedData | undefined) => CachedData; /** * A specific, "instantiated" optimistic update definition which contains a @@ -170,7 +174,7 @@ function translateToInternalDefinition( ): InternalOptimisticUpdateDefinition { const { getQuerySpecifier, updateQuery } = publicOptimisticUpdateDefinition; - const definitionErrors = []; + const definitionErrors: string[] = []; if (typeof getQuerySpecifier !== "function") { definitionErrors.push("`getQuerySpecifier` is not a function."); } @@ -204,7 +208,7 @@ function makeOptimisticUpdateMutationFn( CachedData >[] ): typeof actionFn { - return (function performActionWithOptimisticUpdates(item?: Input) { + return (function performActionWithOptimisticUpdates(item: Input) { const specificOptimisticUpdateDefinitions = optimisticUpdateDefinitions.map( (generalDefinition) => getOptimisticUpdateDefinitionForSpecificItem(generalDefinition, item) @@ -259,10 +263,10 @@ function makeRqOptimisticUpdateOptions( ); // We're using a Map to correctly serialize query keys that contain objects. - const previousData = new Map(); + const previousData: Map = new Map(); specificOptimisticUpdateDefinitions.forEach(({ queryKey, updateQuery }) => { // Snapshot the currently cached value. - const previousDataForQuery: CachedData = + const previousDataForQuery: CachedData | undefined = queryClient.getQueryData(queryKey); // Attempt to optimistically update the cache using the new value. diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/internal/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/internal/index.ts index 28c9ceef98..17bc0e8abf 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/internal/index.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/client/operations/internal/index.ts @@ -15,7 +15,7 @@ export async function callOperation(operationRoute: OperationRoute, args: any) { const response = await api.post(operationRoute.path, superjsonArgs) return superjsonDeserialize(response.data) } catch (error) { - handleApiError(error) + throw handleApiError(error) } } diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/index.d.ts index c39a409f75..6971aac805 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/index.d.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/index.d.ts @@ -9,7 +9,13 @@ export declare function removeLocalUserData(): void; * standard format to be further used by the client. It is also assumed that given API * error has been formatted as implemented by HttpError on the server. */ -export declare function handleApiError(error: AxiosError<{ +export declare function handleApiError): void; +}>>(error: T): T | WaspHttpError; +declare class WaspHttpError extends Error { + statusCode: number; + data: unknown; + constructor(statusCode: number, message: string, data: unknown); +} +export {}; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/index.js index 07e05c03f9..df5d608aa4 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/index.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/index.js @@ -79,11 +79,11 @@ export function handleApiError(error) { // That would require copying HttpError code to web-app also and using it here. const responseJson = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data; const responseStatusCode = error.response.status; - throw new WaspHttpError(responseStatusCode, (_b = responseJson === null || responseJson === void 0 ? void 0 : responseJson.message) !== null && _b !== void 0 ? _b : error.message, responseJson); + return new WaspHttpError(responseStatusCode, (_b = responseJson === null || responseJson === void 0 ? void 0 : responseJson.message) !== null && _b !== void 0 ? _b : error.message, responseJson); } else { // If any other error, we just propagate it. - throw error; + return error; } } class WaspHttpError extends Error { diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/index.js.map index 86433530c0..239cd44a19 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/index.js.map +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/api/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAA8C,MAAM,OAAO,CAAA;AAElE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE9C,aAAa;AACb,MAAM,CAAC,MAAM,GAAG,GAAkB,KAAK,CAAC,MAAM,CAAC;IAC7C,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CAAC,CAAA;AAEF,MAAM,6BAA6B,GAAG,WAAW,CAAA;AAEjD,IAAI,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAuB,CAAA;AAE3F,oBAAoB;AACpB,MAAM,UAAU,YAAY,CAAC,SAAiB;IAC5C,oBAAoB,GAAG,SAAS,CAAA;IAChC,OAAO,CAAC,GAAG,CAAC,6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QACzE,iEAAiE;QACjE,iFAAiF;QACjF,MAAM,YAAY,GAAG,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI,CAAA;QACzC,MAAM,kBAAkB,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAA;QAChD,OAAO,IAAI,aAAa,CAAC,kBAAkB,EAAE,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,mCAAI,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;IACpG,CAAC;SAAM,CAAC;QACN,4CAA4C;QAC5C,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAED,MAAM,aAAc,SAAQ,KAAK;IAK/B,YAAa,UAAkB,EAAE,OAAe,EAAE,IAAa;QAC7D,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;CACF"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/config.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/config.js index 74f4f78c97..1dffbd68bc 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/config.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/config.js @@ -1,4 +1,4 @@ -import { stripTrailingSlash } from 'wasp/universal/url'; +import { stripTrailingSlash } from '../universal/url.js'; const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; // PUBLIC API export const config = { diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/config.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/config.js.map index 82b7a8d169..d26d37022b 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/config.js.map +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAEvD,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,uBAAuB,CAAC;AAOhG,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAExD,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,uBAAuB,CAAC;AAOhG,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/hooks.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/hooks.js index 723993357c..d20d1f0588 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/hooks.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/hooks.js @@ -12,7 +12,12 @@ export function useQuery(query, queryFnArgs, options) { return rqUseQuery(Object.assign({ // todo: The full queryCacheKey is constructed in two places, both here and // inside the Query. See https://github.com/wasp-lang/wasp/issues/2017 - queryKey: makeQueryCacheKey(query, queryFnArgs), queryFn: () => query(queryFnArgs) }, options)); + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryKey: makeQueryCacheKey(query, queryFnArgs), + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryFn: () => query(queryFnArgs) }, options)); } // PUBLIC API /** diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/hooks.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/hooks.js.map index 40d9188b06..11ab1e3495 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/hooks.js.map +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/hooks.js.map @@ -1 +1 @@ -{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../client/operations/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EAEX,cAAc,EACd,QAAQ,IAAI,UAAU,GAEvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,aAAa;AACb,MAAM,UAAU,QAAQ,CACtB,KAA2B,EAC3B,WAAmB,EACnB,OAAa;IAEb,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,6CAA6C,CAAC,CAAA;IACpE,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QACzB,MAAM,IAAI,SAAS,CAAC,uDAAuD,CAAC,CAAA;IAC9E,CAAC;IAED,OAAO,UAAU;QACf,2EAA2E;QAC3E,sEAAsE;QACtE,QAAQ,EAAE,iBAAiB,CAAC,KAAK,EAAE,WAAW,CAA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AW,CAAC,IAAI,CAAC;QAC3B,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC;KAC7C,CAAC;AACJ,CAAC;AAED,qEAAqE;AACrE,+EAA+E;AAC/E;;;;;;GAMG;AACH,SAAS,0BAA0B,CACjC,cAAgD;IAEhD,MAAM,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,GAAG,cAAc,CAAC;IAC/C,OAAO,CAAC,GAAI,OAAe,CAAC,aAAa,EAAE,GAAG,SAAS,CAAC,CAAC;AAC3D,CAAC"} \ No newline at end of file +{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../client/operations/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EAEX,cAAc,EACd,QAAQ,IAAI,UAAU,GAEvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,aAAa;AACb,MAAM,UAAU,QAAQ,CACtB,KAA2B,EAC3B,WAAmB,EACnB,OAAa;IAEb,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,6CAA6C,CAAC,CAAA;IACpE,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QACzB,MAAM,IAAI,SAAS,CAAC,uDAAuD,CAAC,CAAA;IAC9E,CAAC;IAED,OAAO,UAAU;QACf,2EAA2E;QAC3E,sEAAsE;QACtE,+DAA+D;QAC/D,gDAAgD;QAChD,QAAQ,EAAE,iBAAiB,CAAC,KAAK,EAAG,WAAqB,CAAC;QAC1D,+DAA+D;QAC/D,gDAAgD;QAChD,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,WAAoB,CAAC,IACvC,OAAO,EACV,CAAA;AACJ,CAAC;AAED,aAAa;AACb;;;;;;GAMG;AACH,M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ED,qEAAqE;AACrE,+EAA+E;AAC/E;;;;;;GAMG;AACH,SAAS,0BAA0B,CACjC,cAAgD;IAEhD,MAAM,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,GAAG,cAAc,CAAC;IAC/C,OAAO,CAAC,GAAI,OAAe,CAAC,aAAa,EAAE,GAAG,SAAS,CAAC,CAAC;AAC3D,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js index 68bbdadf3d..13e1dcb655 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js @@ -9,7 +9,7 @@ export async function callOperation(operationRoute, args) { return superjsonDeserialize(response.data); } catch (error) { - handleApiError(error); + throw handleApiError(error); } } // PRIVATE API diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map index 23d9e480d1..d271983a05 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../client/operations/internal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EACL,SAAS,IAAI,kBAAkB,EAC/B,WAAW,IAAI,oBAAoB,GACnC,MAAM,WAAW,CAAA;AAKnB,cAAc;AACd,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,cAA8B,EAAE,IAAS;IAC3E,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAC9C,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;QACnE,OAAO,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,cAAc,CAAC,KAAK,CAAC,CAAA;IACvB,CAAC;AACH,CAAC;AAED,cAAc;AACd,MAAM,UAAU,kBAAkB,CAAC,sBAA8B;IAC/D,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,sBAAsB,EAAE,EAAE,CAAA;AACxE,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../client/operations/internal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EACL,SAAS,IAAI,kBAAkB,EAC/B,WAAW,IAAI,oBAAoB,GACnC,MAAM,WAAW,CAAA;AAKnB,cAAc;AACd,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,cAA8B,EAAE,IAAS;IAC3E,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAC9C,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;QACnE,OAAO,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,cAAc,CAAC,KAAK,CAAC,CAAA;IAC7B,CAAC;AACH,CAAC;AAED,cAAc;AACd,MAAM,UAAU,kBAAkB,CAAC,sBAA8B;IAC/D,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,sBAAsB,EAAE,EAAE,CAAA;AACxE,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js.map index da28bebe51..fc611e3a85 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js.map +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/ext-src/server/jobs/bar.js.map @@ -1 +1 @@ -{"version":3,"file":"bar.js","sourceRoot":"","sources":["../../../../ext-src/server/jobs/bar.js"],"names":[],"mappings":"AAAC,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,EAAE,IAAI,EAAE,EAAE;IAChC,OAAO,CAAC,CAAA;AACV,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"bar.js","sourceRoot":"","sources":["../../../../ext-src/server/jobs/bar.js"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,EAAE,IAAI,EAAE,EAAE;IAChC,OAAO,CAAC,CAAA;AACV,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts index 56b8d88eca..e40cd74ab7 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts @@ -1,5 +1,5 @@ export declare class HttpError extends Error { statusCode: number; data: unknown; - constructor(statusCode: number, message?: string, data?: Record, ...params: unknown[]); + constructor(statusCode: number, message?: string, data?: Record, options?: ErrorOptions); } diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.js index 3e216e57ce..6e91977adc 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.js @@ -1,6 +1,6 @@ export class HttpError extends Error { - constructor(statusCode, message, data, ...params) { - super(message, ...params); + constructor(statusCode, message, data, options) { + super(message, options); if (Error.captureStackTrace) { Error.captureStackTrace(this, HttpError); } diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.js.map index 3cc7095281..8163354e1b 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.js.map +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/HttpError.js.map @@ -1 +1 @@ -{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YAAa,UAAkB,EAAE,OAAgB,EAAE,IAA8B,EAAE,GAAG,MAAiB;QACrG,KAAK,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAA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CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.js index dabd38b4b0..e4f89082c8 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.js @@ -1,25 +1,29 @@ +var _a; import merge from 'lodash.merge'; -import { stripTrailingSlash } from "wasp/universal/url"; -const env = process.env.NODE_ENV || 'development'; +import { stripTrailingSlash } from "../universal/url.js"; +const nodeEnv = (_a = process.env.NODE_ENV) !== null && _a !== void 0 ? _a : 'development'; const config = { all: { - env, - isDevelopment: env === 'development', - port: parseInt(process.env.PORT) || 3001, + env: nodeEnv, + isDevelopment: nodeEnv === 'development', + port: process.env.PORT ? parseInt(process.env.PORT) : 3001, databaseUrl: process.env.DATABASE_URL, allowedCORSOrigins: [], }, development: getDevelopmentConfig(), production: getProductionConfig(), }; -const resolvedConfig = merge(config.all, config[env]); +const resolvedConfig = merge(config.all, config[nodeEnv]); // PUBLIC API export default resolvedConfig; function getDevelopmentConfig() { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL || 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL || 'http://localhost:3001'); + var _a, _b; + const frontendUrl = stripTrailingSlash((_a = process.env.WASP_WEB_CLIENT_URL) !== null && _a !== void 0 ? _a : 'http://localhost:3000/'); + const serverUrl = stripTrailingSlash((_b = process.env.WASP_SERVER_URL) !== null && _b !== void 0 ? _b : 'http://localhost:3001'); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, allowedCORSOrigins: '*', }; @@ -28,8 +32,11 @@ function getProductionConfig() { const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, + // @ts-ignore allowedCORSOrigins: [frontendUrl], }; } diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.js.map index f4ad188c93..e284580bbd 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.js.map +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,cAAc,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAA;AAyBjD,MAAM,MAAM,GAIR;IACF,GAAG,EAAE;QACH,GAAG;QACH,aAAa,EAAE,GAAG,KAAK,aAAa;QACpC,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI;QACxC,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;QACrC,kBAAkB,EAAE,EAAE;KACvB;IACD,WAAW,EAAE,oBAAoB,EAAE;IACnC,UAAU,EAAE,mBAAmB,EAAE;CAClC,CAAA;AAED,MAAM,cAAc,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;AAC7D,aAAa;AACb,eAAe,cAAc,CAAA;AAE7B,SAAS,oBAAoB;IAC3B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,wBAAwB,CAAC,CAAC;IACpG,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,uBAAuB,CAAC,CAAC;IAC7F,OAAO;QACL,WAAW;QACX,SAAS;QACT,kBAAkB,EAAE,GAAG;KACxB,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB;IAC1B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACxE,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAClE,OAAO;QACL,WAAW;QACX,SAAS;QACT,kBAAkB,EAAE,CAAC,WAAW,CAAC;KAClC,CAAA;AACH,CAAC"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,cAAc,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,QAAQ,mCAAI,aAAa,CAAA;AAyBrD,MAAM,MAAM,GAIR;IACF,GAAG,EAAE;QACH,GAAG,EAAE,OAAO;QACZ,aAAa,EAAE,OAAO,KAAK,aAAa;QACxC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;QAC1D,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;QACrC,kBAAkB,EAAE,EAAE;KACvB;IACD,WAAW,EAAE,oBAAoB,EAAE;IACnC,UAAU,EAAE,mBAAmB,EAAE;CAClC,CAAA;AAED,MAAM,cAAc,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;AACjE,aAAa;AACb,eAAe,cAAc,CAAA;AAE7B,SAAS,oBAAoB;;IAC3B,MAAM,WAAW,GAAG,kBAAkB,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,mBAAmB,mCAAI,wBAAwB,CAAC,CAAC;IACpG,MAAM,SAAS,GAAG,kBAAkB,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,eAAe,mCAAI,uBAAuB,CAAC,CAAC;IAC7F,OAAO;QACL,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,kBAAkB,EAAE,GAAG;KACxB,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB;IAC1B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACxE,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAClE,OAAO;QACL,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,aAAa;QACb,kBAAkB,EAAE,CAAC,WAAW,CAAC;KAClC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.d.ts index daf1c7f9d0..1a7e7c5a33 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.d.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.d.ts @@ -6,17 +6,17 @@ import type { JobFn } from 'wasp/server/jobs/core/pgBoss'; export declare const PG_BOSS_EXECUTOR_NAME: unique symbol; type JobSchedule = { cron: Parameters[1]; - args: Parameters[2]; options: Parameters[3]; + args?: NonNullable[2]>; }; /** * Creates an instance of PgBossJob which contains all of the necessary * information to submit a job to pg-boss. */ export declare function createJobDefinition>({ jobName, defaultJobOptions, jobSchedule, entities, }: { - jobName: Parameters[0]; - defaultJobOptions: PgBoss.Schedule['options']; - jobSchedule: JobSchedule | null; + jobName: PgBossJob['jobName']; + defaultJobOptions: PgBossJob['defaultJobOptions']; + jobSchedule: PgBossJob['jobSchedule']; entities: Entities; }): PgBossJob; /** @@ -35,7 +35,7 @@ export declare function registerJob> extends Job { readonly defaultJobOptions: Parameters[2]; - readonly startAfter: number | string | Date; + readonly startAfter: number | string | Date | undefined; readonly entities: Entities; readonly jobSchedule: JobSchedule | null; constructor(jobName: string, defaultJobOptions: Parameters[2], entities: Entities, jobSchedule: JobSchedule | null, startAfter?: number | string | Date); diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js index e26ad6250d..6798f1a929 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js @@ -36,7 +36,7 @@ export function registerJob({ job, jobFn }) { // Ref: https://github.com/timgit/pg-boss/blob/master/docs/readme.md#scheduling if (job.jobSchedule) { const options = Object.assign(Object.assign({}, job.defaultJobOptions), job.jobSchedule.options); - await boss.schedule(job.jobName, job.jobSchedule.cron, job.jobSchedule.args || null, options); + await boss.schedule(job.jobName, job.jobSchedule.cron, job.jobSchedule.args, options); } }); } diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js.map index 7f0a871aaa..0b587da921 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js.map +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/core/pgBoss/pgBossJob.js.map @@ -1 +1 @@ -{"version":3,"file":"pgBossJob.js","sourceRoot":"","sources":["../../../../../server/jobs/core/pgBoss/pgBossJob.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAK7C,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;AAQrD,cAAc;AACd;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAIjC,EACA,OAAO,EACP,iBAAiB,EACjB,WAAW,EACX,QAAQ,GAUT;IACC,OAAO,IAAI,SAAS,CAClB,OAAO,EACP,iBAAiB,EACjB,QAAQ,EACR,WAAW,CACZ,CAAA;AACH,CAAC;AAED,cAAc;AACd;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAIzB,EAAE,GAAG,EAAE,KAAK,EAGb;IACC,wGAAwG;IACxG,wGAAwG;IACxG,6DAA6D;IAC7D,2FAA2F;IAC3F,uGAAuG;IACvG,4GAA4G;IAC5G,0DAA0D;IAC1D,kFAAkF;IAClF,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QAChC,6EAA6E;QAC7E,0EAA0E;QAC1E,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAE/B,wFAAwF;QACxF,yEAAyE;QACzE,MAAM,IAAI,CAAC,IAAI,CACb,GAAG,CAAC,OAAO,EACX,qBAAqB,CAA0B,KAAK,EAAE,GAAG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C,UAAU,EAAE,CAAC,GACpD,UAAU,EACb,CAAA;QACF,OAAO,IAAI,kBAAkB,CAA0B,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;IAC3E,CAAC;CACF;AAED;;GAEG;AACH,MAAM,kBAIJ,SAAQ,YAAY;IAOpB,YACE,IAAY,EACZ,GAAuC,EACvC,KAA4B;QAE5B,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QACjB,IAAI,CAAC,MAAM,GAAG;YACZ,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;YAChC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;YAChC,8DAA8D;YAC9D,OAAO,EAAE,GAAG,EAAE,CACZ,IAAI,CAAC,UAAU,CAAC,KAAK,CAAiD;SACzE,CAAA;IACH,CAAC;CACF;AAED;;;GAGG;AACH,SAAS,qBAAqB;AAK5B,wDAAwD;AACxD,KAAqC;AACrC,sDAAsD;AACtD,QAAkB;IAElB,OAAO,CAAC,IAAqB,EAAE,EAAE;QAC/B,MAAM,OAAO,GAAG,EAAE,QAAQ,EAAE,CAAA;QAC5B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAClC,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file +{"version":3,"file":"pgBossJob.js","sourceRoot":"","sources":["../../../../../server/jobs/core/pgBoss/pgBossJob.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAK7C,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;AAQrD,cAAc;AACd;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAIjC,EACA,OAAO,EACP,iBAAiB,EACjB,WAAW,EACX,QAAQ,GAUT;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AAC,IAAqB,EAAE,EAAE;QAC/B,MAAM,OAAO,GAAG,EAAE,QAAQ,EAAE,CAAA;QAC5B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAClC,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.d.ts index c70811600c..1378f96e9b 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.d.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.d.ts @@ -1 +1,3 @@ -export { type MySpecialJob, mySpecialJob } from './mySpecialJob.js'; +export { type SimpleJob, simpleJob } from './simpleJob.js'; +export { type ScheduleJob, scheduleJob } from './scheduleJob.js'; +export { type ScheduledJobWithArgs, scheduledJobWithArgs } from './scheduledJobWithArgs.js'; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.js index c0700a06be..27f810eb5f 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.js @@ -1,2 +1,4 @@ -export { mySpecialJob } from './mySpecialJob.js'; +export { simpleJob } from './simpleJob.js'; +export { scheduleJob } from './scheduleJob.js'; +export { scheduledJobWithArgs } from './scheduledJobWithArgs.js'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.js.map index bf72d0da78..f1f683c862 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.js.map +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/jobs/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,YAAY,EAAE,MAAM,mBAAmB,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/jobs/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,EAAoB,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,EAA6B,oBAAoB,EAAE,MAAM,2BAA2B,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js deleted file mode 100644 index f8de946894..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js +++ /dev/null @@ -1,10 +0,0 @@ -import { createJobDefinition } from 'wasp/server/jobs/core/pgBoss'; -const entities = {}; -// PUBLIC API -export const mySpecialJob = createJobDefinition({ - jobName: 'mySpecialJob', - defaultJobOptions: {}, - jobSchedule: null, - entities, -}); -//# sourceMappingURL=mySpecialJob.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js.map deleted file mode 100644 index 4ae829e30f..0000000000 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mySpecialJob.js","sourceRoot":"","sources":["../../../server/jobs/mySpecialJob.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAE9E,MAAM,QAAQ,GAAG,EAChB,CAAA;AAKD,aAAa;AACb,MAAM,CAAC,MAAM,YAAY,GAAG,mBAAmB,CAAC;IAC9C,OAAO,EAAE,cAAc;IACvB,iBAAiB,EAAE,EAAE;IACrB,WAAW,EAAE,IAAI;IACjB,QAAQ;CACT,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduleJob.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduleJob.d.ts new file mode 100644 index 0000000000..52cd1d5fef --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduleJob.d.ts @@ -0,0 +1,46 @@ +import type { JSONValue, JSONObject } from 'wasp/server/_types/serialization'; +import { type JobFn } from 'wasp/server/jobs/core/pgBoss'; +declare const entities: {}; +export type ScheduleJob = JobFn; +export declare const scheduleJob: { + readonly defaultJobOptions: Parameters[2]; + readonly startAfter: number | string | Date | undefined; + readonly entities: {}; + readonly jobSchedule: { + cron: Parameters[1]; + options: Parameters[3]; + args?: NonNullable[2]>; + } | null; + delay(startAfter: number | string | Date): /*elided*/ any; + submit(jobArgs: JSONObject, jobOptions?: Parameters[2]): Promise<{ + readonly pgBoss: { + readonly cancel: () => ReturnType; + readonly resume: () => ReturnType; + readonly details: () => Promise<(Omit, "state" | "output"> & ({ + data: JSONObject; + } & ({ + state: "failed"; + output: object; + } | { + state: "created" | "retry" | "active" | "expired" | "cancelled"; + output: null; + } | { + state: "completed"; + output: import("wasp/server/_types/serialization").JSONArray | JSONObject | { + value: string; + } | { + value: number; + } | { + value: false; + } | { + value: true; + } | null; + }))) | null>; + }; + readonly job: import("./core/job").Job; + readonly jobId: string; + }>; + readonly jobName: string; + readonly executorName: string | symbol; +}; +export {}; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduleJob.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduleJob.js new file mode 100644 index 0000000000..8da5366532 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduleJob.js @@ -0,0 +1,14 @@ +import { createJobDefinition } from 'wasp/server/jobs/core/pgBoss'; +const entities = {}; +const jobSchedule = { + cron: "0 * * * *", + options: { "retryLimit": 2 }, +}; +// PUBLIC API +export const scheduleJob = createJobDefinition({ + jobName: 'scheduleJob', + defaultJobOptions: {}, + jobSchedule, + entities, +}); +//# sourceMappingURL=scheduleJob.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduleJob.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduleJob.js.map new file mode 100644 index 0000000000..f4b374e480 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduleJob.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scheduleJob.js","sourceRoot":"","sources":["../../../server/jobs/scheduleJob.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAE9E,MAAM,QAAQ,GAAG,EAChB,CAAA;AAKD,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,EAAC,YAAY,EAAC,CAAC,EAAC;CAC1B,CAAA;AAED,aAAa;AACb,MAAM,CAAC,MAAM,WAAW,GAAG,mBAAmB,CAAC;IAC7C,OAAO,EAAE,aAAa;IACtB,iBAAiB,EAAE,EAAE;IACrB,WAAW;IACX,QAAQ;CACT,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduledJobWithArgs.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduledJobWithArgs.d.ts new file mode 100644 index 0000000000..6f65ab8c97 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduledJobWithArgs.d.ts @@ -0,0 +1,46 @@ +import type { JSONValue, JSONObject } from 'wasp/server/_types/serialization'; +import { type JobFn } from 'wasp/server/jobs/core/pgBoss'; +declare const entities: {}; +export type ScheduledJobWithArgs = JobFn; +export declare const scheduledJobWithArgs: { + readonly defaultJobOptions: Parameters[2]; + readonly startAfter: number | string | Date | undefined; + readonly entities: {}; + readonly jobSchedule: { + cron: Parameters[1]; + options: Parameters[3]; + args?: NonNullable[2]>; + } | null; + delay(startAfter: number | string | Date): /*elided*/ any; + submit(jobArgs: JSONObject, jobOptions?: Parameters[2]): Promise<{ + readonly pgBoss: { + readonly cancel: () => ReturnType; + readonly resume: () => ReturnType; + readonly details: () => Promise<(Omit, "state" | "output"> & ({ + data: JSONObject; + } & ({ + state: "failed"; + output: object; + } | { + state: "created" | "retry" | "active" | "expired" | "cancelled"; + output: null; + } | { + state: "completed"; + output: import("wasp/server/_types/serialization").JSONArray | JSONObject | { + value: string; + } | { + value: number; + } | { + value: false; + } | { + value: true; + } | null; + }))) | null>; + }; + readonly job: import("./core/job").Job; + readonly jobId: string; + }>; + readonly jobName: string; + readonly executorName: string | symbol; +}; +export {}; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduledJobWithArgs.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduledJobWithArgs.js new file mode 100644 index 0000000000..3f849e9d71 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduledJobWithArgs.js @@ -0,0 +1,15 @@ +import { createJobDefinition } from 'wasp/server/jobs/core/pgBoss'; +const entities = {}; +const jobSchedule = { + cron: "0 * * * *", + args: { "foo": "bar" }, + options: { "retryLimit": 2 }, +}; +// PUBLIC API +export const scheduledJobWithArgs = createJobDefinition({ + jobName: 'scheduledJobWithArgs', + defaultJobOptions: {}, + jobSchedule, + entities, +}); +//# sourceMappingURL=scheduledJobWithArgs.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduledJobWithArgs.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduledJobWithArgs.js.map new file mode 100644 index 0000000000..70d69824b8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/scheduledJobWithArgs.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scheduledJobWithArgs.js","sourceRoot":"","sources":["../../../server/jobs/scheduledJobWithArgs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAE9E,MAAM,QAAQ,GAAG,EAChB,CAAA;AAKD,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,EAAC,KAAK,EAAC,KAAK,EAAC;IACnB,OAAO,EAAE,EAAC,YAAY,EAAC,CAAC,EAAC;CAC1B,CAAA;AAED,aAAa;AACb,MAAM,CAAC,MAAM,oBAAoB,GAAG,mBAAmB,CAAC;IACtD,OAAO,EAAE,sBAAsB;IAC/B,iBAAiB,EAAE,EAAE;IACrB,WAAW;IACX,QAAQ;CACT,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/simpleJob.d.ts similarity index 73% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.d.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/simpleJob.d.ts index f3b9836c2d..1b9a6c6c95 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/mySpecialJob.d.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/simpleJob.d.ts @@ -1,22 +1,22 @@ import type { JSONValue, JSONObject } from 'wasp/server/_types/serialization'; import { type JobFn } from 'wasp/server/jobs/core/pgBoss'; declare const entities: {}; -export type MySpecialJob = JobFn; -export declare const mySpecialJob: { +export type SimpleJob = JobFn; +export declare const simpleJob: { readonly defaultJobOptions: Parameters[2]; - readonly startAfter: number | string | Date; + readonly startAfter: number | string | Date | undefined; readonly entities: {}; readonly jobSchedule: { cron: Parameters[1]; - args: Parameters[2]; options: Parameters[3]; + args?: NonNullable[2]>; } | null; - delay(startAfter: number | string | Date): any; + delay(startAfter: number | string | Date): /*elided*/ any; submit(jobArgs: JSONObject, jobOptions?: Parameters[2]): Promise<{ readonly pgBoss: { readonly cancel: () => ReturnType; readonly resume: () => ReturnType; - readonly details: () => Promise, "state" | "output"> & ({ + readonly details: () => Promise<(Omit, "state" | "output"> & ({ data: JSONObject; } & ({ state: "failed"; @@ -34,8 +34,8 @@ export declare const mySpecialJob: { value: false; } | { value: true; - }; - }))>; + } | null; + }))) | null>; }; readonly job: import("./core/job").Job; readonly jobId: string; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/simpleJob.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/simpleJob.js new file mode 100644 index 0000000000..2de83eaeb9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/simpleJob.js @@ -0,0 +1,11 @@ +import { createJobDefinition } from 'wasp/server/jobs/core/pgBoss'; +const entities = {}; +const jobSchedule = null; +// PUBLIC API +export const simpleJob = createJobDefinition({ + jobName: 'simpleJob', + defaultJobOptions: {}, + jobSchedule, + entities, +}); +//# sourceMappingURL=simpleJob.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/simpleJob.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/simpleJob.js.map new file mode 100644 index 0000000000..5bdb701013 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/server/jobs/simpleJob.js.map @@ -0,0 +1 @@ +{"version":3,"file":"simpleJob.js","sourceRoot":"","sources":["../../../server/jobs/simpleJob.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAE9E,MAAM,QAAQ,GAAG,EAChB,CAAA;AAKD,MAAM,WAAW,GAAG,IAAI,CAAA;AAExB,aAAa;AACb,MAAM,CAAC,MAAM,SAAS,GAAG,mBAAmB,CAAC;IAC3C,OAAO,EAAE,WAAW;IACpB,iBAAiB,EAAE,EAAE;IACrB,WAAW;IACX,QAAQ;CACT,CAAC,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/predicates.d.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/predicates.d.ts new file mode 100644 index 0000000000..8e81fc0515 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/predicates.d.ts @@ -0,0 +1 @@ +export declare function isNotNull(value: T | null): value is T; diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/predicates.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/predicates.js new file mode 100644 index 0000000000..b298e903bc --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/predicates.js @@ -0,0 +1,4 @@ +export function isNotNull(value) { + return value !== null; +} +//# sourceMappingURL=predicates.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/predicates.js.map b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/predicates.js.map new file mode 100644 index 0000000000..1fdec4adb8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/dist/universal/predicates.js.map @@ -0,0 +1 @@ +{"version":3,"file":"predicates.js","sourceRoot":"","sources":["../../universal/predicates.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAI,KAAe;IAC1C,OAAO,KAAK,KAAK,IAAI,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/ext-src/server/jobs/bar.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/ext-src/server/jobs/bar.js index f742d64747..9abde4e243 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/ext-src/server/jobs/bar.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/ext-src/server/jobs/bar.js @@ -1,4 +1,4 @@ - export const foo = async (args) => { - return 1 - } +export const foo = async (args) => { + return 1 +} diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/HttpError.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/HttpError.ts index 3e8d3f5a0d..d05a2c841b 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/HttpError.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/HttpError.ts @@ -2,8 +2,8 @@ export class HttpError extends Error { public statusCode: number public data: unknown - constructor (statusCode: number, message?: string, data?: Record, ...params: unknown[]) { - super(message, ...params) + constructor (statusCode: number, message?: string, data?: Record, options?: ErrorOptions) { + super(message, options) if (Error.captureStackTrace) { Error.captureStackTrace(this, HttpError) diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/config.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/config.ts index 52699d800c..1dc9bafb93 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/config.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/config.ts @@ -1,8 +1,8 @@ import merge from 'lodash.merge' -import { stripTrailingSlash } from "wasp/universal/url"; +import { stripTrailingSlash } from "../universal/url.js"; -const env = process.env.NODE_ENV || 'development' +const nodeEnv = process.env.NODE_ENV ?? 'development' // TODO: // - Use dotenv library to consume env vars from a file. @@ -33,9 +33,9 @@ const config: { production: EnvConfig, } = { all: { - env, - isDevelopment: env === 'development', - port: parseInt(process.env.PORT) || 3001, + env: nodeEnv, + isDevelopment: nodeEnv === 'development', + port: process.env.PORT ? parseInt(process.env.PORT) : 3001, databaseUrl: process.env.DATABASE_URL, allowedCORSOrigins: [], }, @@ -43,15 +43,17 @@ const config: { production: getProductionConfig(), } -const resolvedConfig: Config = merge(config.all, config[env]) +const resolvedConfig: Config = merge(config.all, config[nodeEnv]) // PUBLIC API export default resolvedConfig function getDevelopmentConfig(): EnvConfig { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL || 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL || 'http://localhost:3001'); + const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL ?? 'http://localhost:3000/'); + const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL ?? 'http://localhost:3001'); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, allowedCORSOrigins: '*', } @@ -61,8 +63,11 @@ function getProductionConfig(): EnvConfig { const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, + // @ts-ignore allowedCORSOrigins: [frontendUrl], } } diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts index 42435db213..d545566ab6 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/core/pgBoss/pgBossJob.ts @@ -9,8 +9,8 @@ export const PG_BOSS_EXECUTOR_NAME = Symbol('PgBoss') type JobSchedule = { cron: Parameters[1] - args: Parameters[2] options: Parameters[3] + args?: NonNullable[2]> } // PRIVATE API @@ -29,11 +29,11 @@ export function createJobDefinition< entities, }: { // jobName - The user-defined job name in their .wasp file. - jobName: Parameters[0] + jobName: PgBossJob['jobName'] // defaultJobOptions - pg-boss specific options for `boss.send()` applied to every `submit()` invocation, // which can overriden in that call. - defaultJobOptions: PgBoss.Schedule['options'] - jobSchedule: JobSchedule | null + defaultJobOptions: PgBossJob['defaultJobOptions'] + jobSchedule: PgBossJob['jobSchedule'] // Entities used by job, passed into callback context. entities: Entities }) { @@ -90,7 +90,7 @@ export function registerJob< await boss.schedule( job.jobName, job.jobSchedule.cron, - job.jobSchedule.args || null, + job.jobSchedule.args, options ) } @@ -108,7 +108,7 @@ class PgBossJob< Entities extends Partial > extends Job { public readonly defaultJobOptions: Parameters[2] - public readonly startAfter: number | string | Date + public readonly startAfter: number | string | Date | undefined public readonly entities: Entities public readonly jobSchedule: JobSchedule | null diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/index.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/index.ts index 8da5c7449c..88056a3ae4 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/index.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/index.ts @@ -1,2 +1,4 @@ -export { type MySpecialJob, mySpecialJob } from './mySpecialJob.js' +export { type SimpleJob, simpleJob } from './simpleJob.js' +export { type ScheduleJob, scheduleJob } from './scheduleJob.js' +export { type ScheduledJobWithArgs, scheduledJobWithArgs } from './scheduledJobWithArgs.js' diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/scheduleJob.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/scheduleJob.ts new file mode 100644 index 0000000000..6a4fe47552 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/scheduleJob.ts @@ -0,0 +1,22 @@ +import { prisma } from 'wasp/server' +import type { JSONValue, JSONObject } from 'wasp/server/_types/serialization' +import { type JobFn, createJobDefinition } from 'wasp/server/jobs/core/pgBoss' + +const entities = { +} + +// PUBLIC API +export type ScheduleJob = JobFn + +const jobSchedule = { + cron: "0 * * * *", + options: {"retryLimit":2}, +} + +// PUBLIC API +export const scheduleJob = createJobDefinition({ + jobName: 'scheduleJob', + defaultJobOptions: {}, + jobSchedule, + entities, +}) diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/scheduledJobWithArgs.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/scheduledJobWithArgs.ts new file mode 100644 index 0000000000..c5565de418 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/scheduledJobWithArgs.ts @@ -0,0 +1,23 @@ +import { prisma } from 'wasp/server' +import type { JSONValue, JSONObject } from 'wasp/server/_types/serialization' +import { type JobFn, createJobDefinition } from 'wasp/server/jobs/core/pgBoss' + +const entities = { +} + +// PUBLIC API +export type ScheduledJobWithArgs = JobFn + +const jobSchedule = { + cron: "0 * * * *", + args: {"foo":"bar"}, + options: {"retryLimit":2}, +} + +// PUBLIC API +export const scheduledJobWithArgs = createJobDefinition({ + jobName: 'scheduledJobWithArgs', + defaultJobOptions: {}, + jobSchedule, + entities, +}) diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/mySpecialJob.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/simpleJob.ts similarity index 55% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/mySpecialJob.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/simpleJob.ts index 574030dba0..27c10ff895 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/mySpecialJob.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/server/jobs/simpleJob.ts @@ -6,12 +6,14 @@ const entities = { } // PUBLIC API -export type MySpecialJob = JobFn +export type SimpleJob = JobFn + +const jobSchedule = null // PUBLIC API -export const mySpecialJob = createJobDefinition({ - jobName: 'mySpecialJob', +export const simpleJob = createJobDefinition({ + jobName: 'simpleJob', defaultJobOptions: {}, - jobSchedule: null, + jobSchedule, entities, }) diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/tsconfig.json b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/tsconfig.json index 8c7c86644c..5a3c9142c3 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/tsconfig.json +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/tsconfig.json @@ -13,11 +13,11 @@ "alwaysStrict": true, "noImplicitThis": true, "strictFunctionTypes": true, + "strictNullChecks": true, // See https://github.com/wasp-lang/wasp/issues/2056 before activating this: // "useUnknownInCatchVariables": true, - // The following 3 stict options will require more work: + // The following 2 stict options will require more work: // "noImplicitAny": true, - // "strictNullChecks": true, // "strictPropertyInitialization": true, // Overriding this because we want to use top-level await "module": "esnext", diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/universal/predicates.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/universal/predicates.ts new file mode 100644 index 0000000000..4294e839f0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/sdk/wasp/universal/predicates.ts @@ -0,0 +1,3 @@ +export function isNotNull(value: T | null): value is T { + return value !== null; +} diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/core/allJobs.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/core/allJobs.ts index 55438834d3..5f2482cb2e 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/core/allJobs.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/core/allJobs.ts @@ -2,4 +2,6 @@ // This module imports all jobs and is imported by the server to ensure // any schedules that are not referenced are still loaded by NodeJS. -import '../mySpecialJob.js' +import '../simpleJob.js' +import '../scheduleJob.js' +import '../scheduledJobWithArgs.js' diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/mySpecialJob.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/scheduleJob.ts similarity index 71% rename from waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/mySpecialJob.ts rename to waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/scheduleJob.ts index e6c21cd3a5..a502ea970c 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/mySpecialJob.ts +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/scheduleJob.ts @@ -1,6 +1,6 @@ import { registerJob } from 'wasp/server/jobs/core/pgBoss' import { foo } from '../../../../../src/server/jobs/bar.js' -import { mySpecialJob as _waspJobDefinition } from 'wasp/server/jobs' +import { scheduleJob as _waspJobDefinition } from 'wasp/server/jobs' registerJob({ job: _waspJobDefinition, diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/scheduledJobWithArgs.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/scheduledJobWithArgs.ts new file mode 100644 index 0000000000..4f92e30ee9 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/scheduledJobWithArgs.ts @@ -0,0 +1,8 @@ +import { registerJob } from 'wasp/server/jobs/core/pgBoss' +import { foo } from '../../../../../src/server/jobs/bar.js' +import { scheduledJobWithArgs as _waspJobDefinition } from 'wasp/server/jobs' + +registerJob({ + job: _waspJobDefinition, + jobFn: foo, +}) diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/simpleJob.ts b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/simpleJob.ts new file mode 100644 index 0000000000..41b8095f0e --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/.wasp/out/server/src/jobs/simpleJob.ts @@ -0,0 +1,8 @@ +import { registerJob } from 'wasp/server/jobs/core/pgBoss' +import { foo } from '../../../../../src/server/jobs/bar.js' +import { simpleJob as _waspJobDefinition } from 'wasp/server/jobs' + +registerJob({ + job: _waspJobDefinition, + jobFn: foo, +}) diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/main.wasp b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/main.wasp index 31ece0d0c4..815644889f 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/main.wasp +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/main.wasp @@ -9,10 +9,37 @@ route RootRoute { path: "/", to: MainPage } page MainPage { component: import { MainPage } from "@src/MainPage" } - job mySpecialJob { - executor: PgBoss, - perform: { - fn: import { foo } from "@src/server/jobs/bar.js" - } - } +job simpleJob { + executor: PgBoss, + perform: { + fn: import { foo } from "@src/server/jobs/bar.js" + }, +} + +job scheduleJob { + executor: PgBoss, + perform: { + fn: import { foo } from "@src/server/jobs/bar.js" + }, + schedule: { + cron: "0 * * * *", + executorOptions: { + pgBoss: {=json { "retryLimit": 2 } json=} + } + } +} + +job scheduledJobWithArgs { + executor: PgBoss, + perform: { + fn: import { foo } from "@src/server/jobs/bar.js" + }, + schedule: { + cron: "0 * * * *", + args: {=json { "foo": "bar" } json=}, + executorOptions: { + pgBoss: {=json { "retryLimit": 2 } json=} + } + } +} diff --git a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/server/jobs/bar.js b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/server/jobs/bar.js index f742d64747..9abde4e243 100644 --- a/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/server/jobs/bar.js +++ b/waspc/e2e-test/test-outputs/waspJob-golden/waspJob/src/server/jobs/bar.js @@ -1,4 +1,4 @@ - export const foo = async (args) => { - return 1 - } +export const foo = async (args) => { + return 1 +} diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/files.manifest b/waspc/e2e-test/test-outputs/waspMigrate-golden/files.manifest index 5cd0312ecc..a5f519b0fb 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/files.manifest +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/files.manifest @@ -156,6 +156,9 @@ waspMigrate/.wasp/out/sdk/wasp/dist/server/types/index.js.map waspMigrate/.wasp/out/sdk/wasp/dist/server/utils.d.ts waspMigrate/.wasp/out/sdk/wasp/dist/server/utils.js waspMigrate/.wasp/out/sdk/wasp/dist/server/utils.js.map +waspMigrate/.wasp/out/sdk/wasp/dist/universal/predicates.d.ts +waspMigrate/.wasp/out/sdk/wasp/dist/universal/predicates.js +waspMigrate/.wasp/out/sdk/wasp/dist/universal/predicates.js.map waspMigrate/.wasp/out/sdk/wasp/dist/universal/types.d.ts waspMigrate/.wasp/out/sdk/wasp/dist/universal/types.js waspMigrate/.wasp/out/sdk/wasp/dist/universal/types.js.map @@ -190,6 +193,7 @@ waspMigrate/.wasp/out/sdk/wasp/server/operations/wrappers.ts waspMigrate/.wasp/out/sdk/wasp/server/types/index.ts waspMigrate/.wasp/out/sdk/wasp/server/utils.ts waspMigrate/.wasp/out/sdk/wasp/tsconfig.json +waspMigrate/.wasp/out/sdk/wasp/universal/predicates.ts waspMigrate/.wasp/out/sdk/wasp/universal/types.ts waspMigrate/.wasp/out/sdk/wasp/universal/url.ts waspMigrate/.wasp/out/sdk/wasp/universal/validators.ts diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/.waspchecksums b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/.waspchecksums index d2dd86480f..bb773d7cbc 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/.waspchecksums +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/.waspchecksums @@ -11,14 +11,14 @@ "file", "../out/sdk/wasp/api/index.ts" ], - "5784ba365e8a5cb2031571cfebf1cbae8670f86f8e5a596b133d333cdf6c91eb" + "2c300f215d89a72dad5e7a766dd97a64aa85b19126c96708487201b9b08a94f9" ], [ [ "file", "../out/sdk/wasp/client/config.ts" ], - "bc7d48bd7ec4cdf74f85b98113eb26e670ef265ca4bbd735e361409c9335ad85" + "d94e8bee5fd8f6793b511652b9ee558e57f4913595763137a5385cd929648168" ], [ [ @@ -46,7 +46,7 @@ "file", "../out/sdk/wasp/client/operations/hooks.ts" ], - "d1a8fccfb8207476b90708e8285d1455b33ff4e446749b33c3eb1a54dcfe2d41" + "3c326183d9dcb2bcf14b747ffc66b19e4773642d05f3f84d401e3d54b843eeca" ], [ [ @@ -60,7 +60,7 @@ "file", "../out/sdk/wasp/client/operations/internal/index.ts" ], - "f08a4f1fb1f897edca465b3f228215e06418109fb439232e8fa0ffdbdc98b833" + "d710d9894f56194c0d87921f339100414c69b987f1f5221881ca372fd70be371" ], [ [ @@ -214,7 +214,7 @@ "file", "../out/sdk/wasp/server/HttpError.ts" ], - "eaa296c30acc65c78b90ebdf9a1d6fdb863f0c26c743d352afaeaa3bbc2fdd1b" + "f375fb45eeb16381b8cc575503db302c005ddaa1b35d837ca0ea043fe8ec6ccb" ], [ [ @@ -242,7 +242,7 @@ "file", "../out/sdk/wasp/server/config.ts" ], - "e5388a9259a22671ee2d2ef46d2c09fdd46c3b3ec24248c7a0b471c0fbf7aa54" + "5dd35660e0969defaa3c180179919f4922ab7bc041746872dff7f2280c1872ae" ], [ [ @@ -333,7 +333,14 @@ "file", "../out/sdk/wasp/tsconfig.json" ], - "4323884e7e8c52683788995be58e8f583c00fc611845fdbd481157d0118dccd2" + "3b09df60f6728880a953a746ef887e045de0b533cb383f89d6adf8ff906edac8" + ], + [ + [ + "file", + "../out/sdk/wasp/universal/predicates.ts" + ], + "baa4148fdf4995cfc154a81bc494e9e8077635d4db50958d5b59837d1b8ed691" ], [ [ diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/api/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/api/index.ts index 6037b3048c..c8895b1275 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/api/index.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/api/index.ts @@ -77,7 +77,7 @@ window.addEventListener('storage', (event) => { * standard format to be further used by the client. It is also assumed that given API * error has been formatted as implemented by HttpError on the server. */ -export function handleApiError(error: AxiosError<{ message?: string, data?: unknown }>): void { +export function handleApiError>(error: T): T | WaspHttpError { if (error?.response) { // If error came from HTTP response, we capture most informative message // and also add .statusCode information to it. @@ -88,10 +88,10 @@ export function handleApiError(error: AxiosError<{ message?: string, data?: unkn // That would require copying HttpError code to web-app also and using it here. const responseJson = error.response?.data const responseStatusCode = error.response.status - throw new WaspHttpError(responseStatusCode, responseJson?.message ?? error.message, responseJson) + return new WaspHttpError(responseStatusCode, responseJson?.message ?? error.message, responseJson) } else { // If any other error, we just propagate it. - throw error + return error } } diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/config.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/config.ts index 2f9967891e..82b0f80b6a 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/config.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/config.ts @@ -1,4 +1,4 @@ -import { stripTrailingSlash } from 'wasp/universal/url' +import { stripTrailingSlash } from '../universal/url.js' const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/hooks.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/hooks.ts index 0f03f3167a..7ac0aac46d 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/hooks.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/hooks.ts @@ -28,8 +28,12 @@ export function useQuery( return rqUseQuery({ // todo: The full queryCacheKey is constructed in two places, both here and // inside the Query. See https://github.com/wasp-lang/wasp/issues/2017 - queryKey: makeQueryCacheKey(query, queryFnArgs), - queryFn: () => query(queryFnArgs), + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryKey: makeQueryCacheKey(query, (queryFnArgs as Input)), + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryFn: () => query(queryFnArgs as Input), ...options, }) } @@ -138,7 +142,7 @@ type InternalOptimisticUpdateDefinition = { * the current state of the cache and returns the desired (new) state of the * cache. */ -type SpecificUpdateQuery = (oldData: CachedData) => CachedData; +type SpecificUpdateQuery = (oldData: CachedData | undefined) => CachedData; /** * A specific, "instantiated" optimistic update definition which contains a @@ -170,7 +174,7 @@ function translateToInternalDefinition( ): InternalOptimisticUpdateDefinition { const { getQuerySpecifier, updateQuery } = publicOptimisticUpdateDefinition; - const definitionErrors = []; + const definitionErrors: string[] = []; if (typeof getQuerySpecifier !== "function") { definitionErrors.push("`getQuerySpecifier` is not a function."); } @@ -204,7 +208,7 @@ function makeOptimisticUpdateMutationFn( CachedData >[] ): typeof actionFn { - return (function performActionWithOptimisticUpdates(item?: Input) { + return (function performActionWithOptimisticUpdates(item: Input) { const specificOptimisticUpdateDefinitions = optimisticUpdateDefinitions.map( (generalDefinition) => getOptimisticUpdateDefinitionForSpecificItem(generalDefinition, item) @@ -259,10 +263,10 @@ function makeRqOptimisticUpdateOptions( ); // We're using a Map to correctly serialize query keys that contain objects. - const previousData = new Map(); + const previousData: Map = new Map(); specificOptimisticUpdateDefinitions.forEach(({ queryKey, updateQuery }) => { // Snapshot the currently cached value. - const previousDataForQuery: CachedData = + const previousDataForQuery: CachedData | undefined = queryClient.getQueryData(queryKey); // Attempt to optimistically update the cache using the new value. diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/internal/index.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/internal/index.ts index 28c9ceef98..17bc0e8abf 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/internal/index.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/client/operations/internal/index.ts @@ -15,7 +15,7 @@ export async function callOperation(operationRoute: OperationRoute, args: any) { const response = await api.post(operationRoute.path, superjsonArgs) return superjsonDeserialize(response.data) } catch (error) { - handleApiError(error) + throw handleApiError(error) } } diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/index.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/index.d.ts index c39a409f75..6971aac805 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/index.d.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/index.d.ts @@ -9,7 +9,13 @@ export declare function removeLocalUserData(): void; * standard format to be further used by the client. It is also assumed that given API * error has been formatted as implemented by HttpError on the server. */ -export declare function handleApiError(error: AxiosError<{ +export declare function handleApiError): void; +}>>(error: T): T | WaspHttpError; +declare class WaspHttpError extends Error { + statusCode: number; + data: unknown; + constructor(statusCode: number, message: string, data: unknown); +} +export {}; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/index.js index 07e05c03f9..df5d608aa4 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/index.js +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/index.js @@ -79,11 +79,11 @@ export function handleApiError(error) { // That would require copying HttpError code to web-app also and using it here. const responseJson = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data; const responseStatusCode = error.response.status; - throw new WaspHttpError(responseStatusCode, (_b = responseJson === null || responseJson === void 0 ? void 0 : responseJson.message) !== null && _b !== void 0 ? _b : error.message, responseJson); + return new WaspHttpError(responseStatusCode, (_b = responseJson === null || responseJson === void 0 ? void 0 : responseJson.message) !== null && _b !== void 0 ? _b : error.message, responseJson); } else { // If any other error, we just propagate it. - throw error; + return error; } } class WaspHttpError extends Error { diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/index.js.map index 86433530c0..239cd44a19 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/index.js.map +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/api/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAA8C,MAAM,OAAO,CAAA;AAElE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE9C,aAAa;AACb,MAAM,CAAC,MAAM,GAAG,GAAkB,KAAK,CAAC,MAAM,CAAC;IAC7C,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CAAC,CAAA;AAEF,MAAM,6BAA6B,GAAG,WAAW,CAAA;AAEjD,IAAI,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAuB,CAAA;AAE3F,oBAAoB;AACpB,MAAM,UAAU,YAAY,CAAC,SAAiB;IAC5C,oBAAoB,GAAG,SAAS,CAAA;IAChC,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,SAAS,CAAC,CAAA;IACrD,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;AACxC,CAAC;AAED,oBAAoB;AACpB,MAAM,UAAU,YAAY;IAC1B,OAAO,oBAAoB,CAAA;AAC7B,CAAC;AAED,oBAAoB;AACpB,MAAM,UAAU,cAAc;IAC5B,oBAAoB,GAAG,SAAS,CAAA;IAChC,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E,OAAO,mCAAI,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;IACpG,CAAC;SAAM,CAAC;QACN,4CAA4C;QAC5C,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAED,MAAM,aAAc,SAAQ,KAAK;IAK/B,YAAa,UAAkB,EAAE,OAAe,EAAE,IAAa;QAC7D,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;CACF"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/config.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/config.js index 74f4f78c97..1dffbd68bc 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/config.js +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/config.js @@ -1,4 +1,4 @@ -import { stripTrailingSlash } from 'wasp/universal/url'; +import { stripTrailingSlash } from '../universal/url.js'; const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001'; // PUBLIC API export const config = { diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/config.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/config.js.map index 82b7a8d169..d26d37022b 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/config.js.map +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAEvD,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,uBAAuB,CAAC;AAOhG,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../client/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAExD,MAAM,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,IAAI,uBAAuB,CAAC;AAOhG,aAAa;AACb,MAAM,CAAC,MAAM,MAAM,GAAiB;IAClC,MAAM;CACP,CAAA"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/hooks.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/hooks.js index 723993357c..d20d1f0588 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/hooks.js +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/hooks.js @@ -12,7 +12,12 @@ export function useQuery(query, queryFnArgs, options) { return rqUseQuery(Object.assign({ // todo: The full queryCacheKey is constructed in two places, both here and // inside the Query. See https://github.com/wasp-lang/wasp/issues/2017 - queryKey: makeQueryCacheKey(query, queryFnArgs), queryFn: () => query(queryFnArgs) }, options)); + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryKey: makeQueryCacheKey(query, queryFnArgs), + // FIXME: query fns don't handle the `undefined` case correctly + // https://github.com/wasp-lang/wasp/issues/2017 + queryFn: () => query(queryFnArgs) }, options)); } // PUBLIC API /** diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/hooks.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/hooks.js.map index 40d9188b06..11ab1e3495 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/hooks.js.map +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/hooks.js.map @@ -1 +1 @@ -{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../client/operations/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EAEX,cAAc,EACd,QAAQ,IAAI,UAAU,GAEvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,aAAa;AACb,MAAM,UAAU,QAAQ,CACtB,KAA2B,EAC3B,WAAmB,EACnB,OAAa;IAEb,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,6CAA6C,CAAC,CAAA;IACpE,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QACzB,MAAM,IAAI,SAAS,CAAC,uDAAuD,CAAC,CAAA;IAC9E,CAAC;IAED,OAAO,UAAU;QACf,2EAA2E;QAC3E,sEAAsE;QACtE,QAAQ,EAAE,iBAAiB,CAAC,KAAK,EAAE,WAAW,CAAC,EAC/C,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,IAC9B,OAAO,EACV,CAAA;AACJ,CAAC;AAED,aAAa;AACb;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CACvB,QAA+B,EAC/B,a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;GAMG;AACH,SAAS,0BAA0B,CACjC,cAAgD;IAEhD,MAAM,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,GAAG,cAAc,CAAC;IAC/C,OAAO,CAAC,GAAI,OAAe,CAAC,aAAa,EAAE,GAAG,SAAS,CAAC,CAAC;AAC3D,CAAC"} \ No newline at end of file +{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../client/operations/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EAEX,cAAc,EACd,QAAQ,IAAI,UAAU,GAEvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAErD,aAAa;AACb,MAAM,UAAU,QAAQ,CACtB,KAA2B,EAC3B,WAAmB,EACnB,OAAa;IAEb,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,6CAA6C,CAAC,CAAA;IACpE,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QACzB,MAAM,IAAI,SAAS,CAAC,uDAAuD,CAAC,CAAA;IAC9E,CAAC;IAED,OAAO,UAAU;QACf,2EAA2E;QAC3E,sEAAsE;QACtE,+DAA+D;QAC/D,gDAAgD;QAChD,QAAQ,EAAE,iBAAiB,CAAC,KAAK,EAAG,WAAqB,CAAC;QAC1D,+DAA+D;QAC/D,gDAAgD;QAChD,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,WAAoB,CAAC,IACvC,OAAO,EACV,CAAA;AACJ,CAAC;AAED,aAAa;AACb;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CACvB,QAA+B,EAC/B,aAAoC;IAEpC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IAErC,IAAI,UAAU,GAAG,QAAQ,CAAC;IAC1B,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAA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Ae,CAAC,aAAa,EAAE,GAAG,SAAS,CAAC,CAAC;AAC3D,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js index 68bbdadf3d..13e1dcb655 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js @@ -9,7 +9,7 @@ export async function callOperation(operationRoute, args) { return superjsonDeserialize(response.data); } catch (error) { - handleApiError(error); + throw handleApiError(error); } } // PRIVATE API diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map index 23d9e480d1..d271983a05 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/client/operations/internal/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../client/operations/internal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EACL,SAAS,IAAI,kBAAkB,EAC/B,WAAW,IAAI,oBAAoB,GACnC,MAAM,WAAW,CAAA;AAKnB,cAAc;AACd,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,cAA8B,EAAE,IAAS;IAC3E,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAC9C,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;QACnE,OAAO,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,cAAc,CAAC,KAAK,CAAC,CAAA;IACvB,CAAC;AACH,CAAC;AAED,cAAc;AACd,MAAM,UAAU,kBAAkB,CAAC,sBAA8B;IAC/D,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,sBAAsB,EAAE,EAAE,CAAA;AACxE,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../client/operations/internal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EACL,SAAS,IAAI,kBAAkB,EAC/B,WAAW,IAAI,oBAAoB,GACnC,MAAM,WAAW,CAAA;AAKnB,cAAc;AACd,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,cAA8B,EAAE,IAAS;IAC3E,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAC9C,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;QACnE,OAAO,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,cAAc,CAAC,KAAK,CAAC,CAAA;IAC7B,CAAC;AACH,CAAC;AAED,cAAc;AACd,MAAM,UAAU,kBAAkB,CAAC,sBAA8B;IAC/D,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,sBAAsB,EAAE,EAAE,CAAA;AACxE,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts index 56b8d88eca..e40cd74ab7 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.d.ts @@ -1,5 +1,5 @@ export declare class HttpError extends Error { statusCode: number; data: unknown; - constructor(statusCode: number, message?: string, data?: Record, ...params: unknown[]); + constructor(statusCode: number, message?: string, data?: Record, options?: ErrorOptions); } diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.js index 3e216e57ce..6e91977adc 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.js +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.js @@ -1,6 +1,6 @@ export class HttpError extends Error { - constructor(statusCode, message, data, ...params) { - super(message, ...params); + constructor(statusCode, message, data, options) { + super(message, options); if (Error.captureStackTrace) { Error.captureStackTrace(this, HttpError); } diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.js.map index 3cc7095281..8163354e1b 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.js.map +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/HttpError.js.map @@ -1 +1 @@ -{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YAAa,UAAkB,EAAE,OAAgB,EAAE,IAA8B,EAAE,GAAG,MAAiB;QACrG,KAAK,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAA;QAEzB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EAAE,CAAC;YAC7E,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../server/HttpError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YAAa,UAAkB,EAAE,OAAgB,EAAE,IAA8B,EAAE,OAAsB;QACvG,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAEvB,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QAC1C,CAAC;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAA;QAEjC,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC,EAAE,CAAC;YAC7E,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAClB,CAAC;IACH,CAAC;CACF"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js index dabd38b4b0..e4f89082c8 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js @@ -1,25 +1,29 @@ +var _a; import merge from 'lodash.merge'; -import { stripTrailingSlash } from "wasp/universal/url"; -const env = process.env.NODE_ENV || 'development'; +import { stripTrailingSlash } from "../universal/url.js"; +const nodeEnv = (_a = process.env.NODE_ENV) !== null && _a !== void 0 ? _a : 'development'; const config = { all: { - env, - isDevelopment: env === 'development', - port: parseInt(process.env.PORT) || 3001, + env: nodeEnv, + isDevelopment: nodeEnv === 'development', + port: process.env.PORT ? parseInt(process.env.PORT) : 3001, databaseUrl: process.env.DATABASE_URL, allowedCORSOrigins: [], }, development: getDevelopmentConfig(), production: getProductionConfig(), }; -const resolvedConfig = merge(config.all, config[env]); +const resolvedConfig = merge(config.all, config[nodeEnv]); // PUBLIC API export default resolvedConfig; function getDevelopmentConfig() { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL || 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL || 'http://localhost:3001'); + var _a, _b; + const frontendUrl = stripTrailingSlash((_a = process.env.WASP_WEB_CLIENT_URL) !== null && _a !== void 0 ? _a : 'http://localhost:3000/'); + const serverUrl = stripTrailingSlash((_b = process.env.WASP_SERVER_URL) !== null && _b !== void 0 ? _b : 'http://localhost:3001'); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, allowedCORSOrigins: '*', }; @@ -28,8 +32,11 @@ function getProductionConfig() { const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, + // @ts-ignore allowedCORSOrigins: [frontendUrl], }; } diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js.map index f4ad188c93..e284580bbd 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js.map +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/server/config.js.map @@ -1 +1 @@ -{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,cAAc,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAA;AAyBjD,MAAM,MAAM,GAIR;IACF,GAAG,EAAE;QACH,GAAG;QACH,aAAa,EAAE,GAAG,KAAK,aAAa;QACpC,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI;QACxC,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;QACrC,kBAAkB,EAAE,EAAE;KACvB;IACD,WAAW,EAAE,oBAAoB,EAAE;IACnC,UAAU,EAAE,mBAAmB,EAAE;CAClC,CAAA;AAED,MAAM,cAAc,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;AAC7D,aAAa;AACb,eAAe,cAAc,CAAA;AAE7B,SAAS,oBAAoB;IAC3B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,wBAAwB,CAAC,CAAC;IACpG,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,uBAAuB,CAAC,CAAC;IAC7F,OAAO;QACL,WAAW;QACX,SAAS;QACT,kBAAkB,EAAE,GAAG;KACxB,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB;IAC1B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACxE,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAClE,OAAO;QACL,WAAW;QACX,SAAS;QACT,kBAAkB,EAAE,CAAC,WAAW,CAAC;KAClC,CAAA;AACH,CAAC"} \ No newline at end of file +{"version":3,"file":"config.js","sourceRoot":"","sources":["../../server/config.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,cAAc,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,QAAQ,mCAAI,aAAa,CAAA;AAyBrD,MAAM,MAAM,GAIR;IACF,GAAG,EAAE;QACH,GAAG,EAAE,OAAO;QACZ,aAAa,EAAE,OAAO,KAAK,aAAa;QACxC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;QAC1D,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY;QACrC,kBAAkB,EAAE,EAAE;KACvB;IACD,WAAW,EAAE,oBAAoB,EAAE;IACnC,UAAU,EAAE,mBAAmB,EAAE;CAClC,CAAA;AAED,MAAM,cAAc,GAAW,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;AACjE,aAAa;AACb,eAAe,cAAc,CAAA;AAE7B,SAAS,oBAAoB;;IAC3B,MAAM,WAAW,GAAG,kBAAkB,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,mBAAmB,mCAAI,wBAAwB,CAAC,CAAC;IACpG,MAAM,SAAS,GAAG,kBAAkB,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,eAAe,mCAAI,uBAAuB,CAAC,CAAC;IAC7F,OAAO;QACL,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,kBAAkB,EAAE,GAAG;KACxB,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB;IAC1B,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IACxE,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAClE,OAAO;QACL,aAAa;QACb,WAAW;QACX,aAAa;QACb,SAAS;QACT,aAAa;QACb,kBAAkB,EAAE,CAAC,WAAW,CAAC;KAClC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/predicates.d.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/predicates.d.ts new file mode 100644 index 0000000000..8e81fc0515 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/predicates.d.ts @@ -0,0 +1 @@ +export declare function isNotNull(value: T | null): value is T; diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/predicates.js b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/predicates.js new file mode 100644 index 0000000000..b298e903bc --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/predicates.js @@ -0,0 +1,4 @@ +export function isNotNull(value) { + return value !== null; +} +//# sourceMappingURL=predicates.js.map \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/predicates.js.map b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/predicates.js.map new file mode 100644 index 0000000000..1fdec4adb8 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/dist/universal/predicates.js.map @@ -0,0 +1 @@ +{"version":3,"file":"predicates.js","sourceRoot":"","sources":["../../universal/predicates.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAI,KAAe;IAC1C,OAAO,KAAK,KAAK,IAAI,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/HttpError.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/HttpError.ts index 3e8d3f5a0d..d05a2c841b 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/HttpError.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/HttpError.ts @@ -2,8 +2,8 @@ export class HttpError extends Error { public statusCode: number public data: unknown - constructor (statusCode: number, message?: string, data?: Record, ...params: unknown[]) { - super(message, ...params) + constructor (statusCode: number, message?: string, data?: Record, options?: ErrorOptions) { + super(message, options) if (Error.captureStackTrace) { Error.captureStackTrace(this, HttpError) diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/config.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/config.ts index 52699d800c..1dc9bafb93 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/config.ts +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/server/config.ts @@ -1,8 +1,8 @@ import merge from 'lodash.merge' -import { stripTrailingSlash } from "wasp/universal/url"; +import { stripTrailingSlash } from "../universal/url.js"; -const env = process.env.NODE_ENV || 'development' +const nodeEnv = process.env.NODE_ENV ?? 'development' // TODO: // - Use dotenv library to consume env vars from a file. @@ -33,9 +33,9 @@ const config: { production: EnvConfig, } = { all: { - env, - isDevelopment: env === 'development', - port: parseInt(process.env.PORT) || 3001, + env: nodeEnv, + isDevelopment: nodeEnv === 'development', + port: process.env.PORT ? parseInt(process.env.PORT) : 3001, databaseUrl: process.env.DATABASE_URL, allowedCORSOrigins: [], }, @@ -43,15 +43,17 @@ const config: { production: getProductionConfig(), } -const resolvedConfig: Config = merge(config.all, config[env]) +const resolvedConfig: Config = merge(config.all, config[nodeEnv]) // PUBLIC API export default resolvedConfig function getDevelopmentConfig(): EnvConfig { - const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL || 'http://localhost:3000/'); - const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL || 'http://localhost:3001'); + const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL ?? 'http://localhost:3000/'); + const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL ?? 'http://localhost:3001'); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, allowedCORSOrigins: '*', } @@ -61,8 +63,11 @@ function getProductionConfig(): EnvConfig { const frontendUrl = stripTrailingSlash(process.env.WASP_WEB_CLIENT_URL); const serverUrl = stripTrailingSlash(process.env.WASP_SERVER_URL); return { + // @ts-ignore frontendUrl, + // @ts-ignore serverUrl, + // @ts-ignore allowedCORSOrigins: [frontendUrl], } } diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/tsconfig.json b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/tsconfig.json index 8c7c86644c..5a3c9142c3 100644 --- a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/tsconfig.json +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/tsconfig.json @@ -13,11 +13,11 @@ "alwaysStrict": true, "noImplicitThis": true, "strictFunctionTypes": true, + "strictNullChecks": true, // See https://github.com/wasp-lang/wasp/issues/2056 before activating this: // "useUnknownInCatchVariables": true, - // The following 3 stict options will require more work: + // The following 2 stict options will require more work: // "noImplicitAny": true, - // "strictNullChecks": true, // "strictPropertyInitialization": true, // Overriding this because we want to use top-level await "module": "esnext", diff --git a/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/universal/predicates.ts b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/universal/predicates.ts new file mode 100644 index 0000000000..4294e839f0 --- /dev/null +++ b/waspc/e2e-test/test-outputs/waspMigrate-golden/waspMigrate/.wasp/out/sdk/wasp/universal/predicates.ts @@ -0,0 +1,3 @@ +export function isNotNull(value: T | null): value is T { + return value !== null; +} diff --git a/waspc/examples/crud-testing/src/DetailPage.tsx b/waspc/examples/crud-testing/src/DetailPage.tsx index e7e4351788..5400faa738 100644 --- a/waspc/examples/crud-testing/src/DetailPage.tsx +++ b/waspc/examples/crud-testing/src/DetailPage.tsx @@ -1,15 +1,20 @@ -import "./Main.css"; -import React from "react"; -import { useParams } from "react-router-dom"; -import { Link } from "wasp/client/router"; +import './Main.css' +import React from 'react' +import { useParams } from 'react-router-dom' +import { Link } from 'wasp/client/router' -import { tasks as tasksCrud } from "wasp/client/crud"; +import { tasks as tasksCrud } from 'wasp/client/crud' const DetailPage = () => { - const { id } = useParams<{ id: string }>(); - const { data: task, isLoading } = tasksCrud.get.useQuery({ - id: parseInt(id, 10), - }); + const { id } = useParams<{ id: string }>() + const { data: task, isLoading } = tasksCrud.get.useQuery( + { + id: parseInt(id!, 10), + }, + { + enabled: !!id, + } + ) return (
@@ -30,7 +35,7 @@ const DetailPage = () => { Return
- ); -}; + ) +} -export default DetailPage; +export default DetailPage diff --git a/waspc/headless-test/examples/todoApp/package-lock.json b/waspc/headless-test/examples/todoApp/package-lock.json index 0ade148f1d..75a03b5861 100644 --- a/waspc/headless-test/examples/todoApp/package-lock.json +++ b/waspc/headless-test/examples/todoApp/package-lock.json @@ -35,7 +35,7 @@ "arctic": "^1.2.1", "autoprefixer": "^10.4.13", "axios": "^1.4.0", - "express": "~4.18.1", + "express": "~4.21.0", "jsdom": "^21.1.1", "lodash.merge": "^4.6.2", "lucia": "^3.0.1", @@ -48,10 +48,9 @@ "prisma": "5.19.1", "react": "^18.2.0", "react-hook-form": "^7.45.4", - "react-router-dom": "^6.26.1", - "superjson": "^1.12.2", + "react-router-dom": "^6.26.2", + "superjson": "^2.2.1", "tailwindcss": "^3.2.7", - "uuid": "^9.0.0", "vitest": "^1.2.1" }, "devDependencies": { @@ -2121,9 +2120,9 @@ } }, "node_modules/@remix-run/router": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.19.1.tgz", - "integrity": "sha512-S45oynt/WH19bHbIXjtli6QmwNYvaz+vtnubvNpNDvUOoA/OWh6j1OikIP3G+v5GHdxyC6EXoChG3HgYGEUfcg==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.20.0.tgz", + "integrity": "sha512-mUnk8rPJBI9loFDZ+YzPGdeniYK+FTmRD1TMCz7ev2SNIozyKKpnGgsxO34u6Z4z/t0ITuu7voi/AshfsGsgFg==", "engines": { "node": ">=14.0.0" } @@ -3658,20 +3657,20 @@ } }, "node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "dependencies": { "bytes": "3.1.2", - "content-type": "~1.0.4", + "content-type": "~1.0.5", "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", + "qs": "6.13.0", + "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" }, @@ -4096,9 +4095,9 @@ } }, "node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", "engines": { "node": ">= 0.6" } @@ -4390,9 +4389,9 @@ "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, "node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", "engines": { "node": ">= 0.8" } @@ -4624,36 +4623,36 @@ } }, "node_modules/express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", + "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.1", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.5.0", + "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -4742,12 +4741,12 @@ } }, "node_modules/finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "dependencies": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -5932,9 +5931,12 @@ } }, "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/merge-stream": { "version": "2.0.0", @@ -6560,9 +6562,9 @@ } }, "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==" }, "node_modules/pathe": { "version": "1.1.2", @@ -6986,11 +6988,11 @@ } }, "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" }, "engines": { "node": ">=0.6" @@ -7032,9 +7034,9 @@ } }, "node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", @@ -7090,11 +7092,11 @@ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" }, "node_modules/react-router": { - "version": "6.26.1", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.26.1.tgz", - "integrity": "sha512-kIwJveZNwp7teQRI5QmwWo39A5bXRyqpH0COKKmPnyD2vBvDwgFXSqDUYtt1h+FEyfnE8eXr7oe0MxRzVwCcvQ==", + "version": "6.27.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.27.0.tgz", + "integrity": "sha512-YA+HGZXz4jaAkVoYBE98VQl+nVzI+cVI2Oj/06F5ZM+0u3TgedN9Y9kmMRo2mnkSK2nCpNQn0DVob4HCsY/WLw==", "dependencies": { - "@remix-run/router": "1.19.1" + "@remix-run/router": "1.20.0" }, "engines": { "node": ">=14.0.0" @@ -7104,12 +7106,12 @@ } }, "node_modules/react-router-dom": { - "version": "6.26.1", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.26.1.tgz", - "integrity": "sha512-veut7m41S1fLql4pLhxeSW3jlqs+4MtjRLj0xvuCEXsxusJCbs6I8yn9BxzzDX2XDgafrccY6hwjmd/bL54tFw==", + "version": "6.27.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.27.0.tgz", + "integrity": "sha512-+bvtFWMC0DgAFrfKXKG9Fc+BcXWRUO1aJIihbB79xaeq0v5UzfvnM5houGUm1Y461WVRcgAQ+Clh5rdb1eCx4g==", "dependencies": { - "@remix-run/router": "1.19.1", - "react-router": "6.26.1" + "@remix-run/router": "1.20.0", + "react-router": "6.27.0" }, "engines": { "node": ">=14.0.0" @@ -7344,9 +7346,9 @@ } }, "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "dependencies": { "debug": "2.6.9", "depd": "2.0.0", @@ -7366,6 +7368,14 @@ "node": ">= 0.8.0" } }, + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/send/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -7397,14 +7407,14 @@ } }, "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "dependencies": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" }, "engines": { "node": ">= 0.8.0" @@ -7469,11 +7479,11 @@ } }, "node_modules/side-channel": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.5.tgz", - "integrity": "sha512-QcgiIWV4WV7qWExbN5llt6frQB/lBven9pqliLXfGPB+K9ZYXxDozp0wLkHS24kWCm+6YXH/f0HhnObZnZOBnQ==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dependencies": { - "call-bind": "^1.0.6", + "call-bind": "^1.0.7", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.4", "object-inspect": "^1.13.1" @@ -7724,14 +7734,14 @@ } }, "node_modules/superjson": { - "version": "1.13.3", - "resolved": "https://registry.npmjs.org/superjson/-/superjson-1.13.3.tgz", - "integrity": "sha512-mJiVjfd2vokfDxsQPOwJ/PtanO87LhpYY88ubI5dUB1Ab58Txbyje3+jpm+/83R/fevaq/107NNhtYBLuoTrFg==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/superjson/-/superjson-2.2.1.tgz", + "integrity": "sha512-8iGv75BYOa0xRJHK5vRLEjE2H/i4lulTjzpUXic3Eg8akftYjkmQDa8JARQ42rlczXyFR3IeRoeFCc7RxHsYZA==", "dependencies": { "copy-anything": "^3.0.2" }, "engines": { - "node": ">=10" + "node": ">=16" } }, "node_modules/supports-color": { diff --git a/waspc/headless-test/examples/todoApp/src/server/actions.ts b/waspc/headless-test/examples/todoApp/src/server/actions.ts index 9cb8e20fe0..3b9f72ceee 100644 --- a/waspc/headless-test/examples/todoApp/src/server/actions.ts +++ b/waspc/headless-test/examples/todoApp/src/server/actions.ts @@ -1,11 +1,11 @@ -import { type Task } from "wasp/entities"; -import { HttpError } from "wasp/server"; +import { type Task } from 'wasp/entities' +import { HttpError } from 'wasp/server' import { type CreateTask, type DeleteCompletedTasks, type ToggleAllTasks, type UpdateTaskIsDone, -} from "wasp/server/operations"; +} from 'wasp/server/operations' import { getSomeResource } from './serverSetup.js' export const createTask: CreateTask> = async ( @@ -71,9 +71,10 @@ export const toggleAllTasks: ToggleAllTasks = async (_args, context) => { throw new HttpError(401) } + const userId = context.user.id const whereIsDone = (isDone: boolean) => ({ isDone, - user: { id: context.user.id }, + user: { id: userId }, }) const Task = context.entities.Task const notDoneTasksCount = await Task.count({ where: whereIsDone(false) }) diff --git a/waspc/src/Wasp/Generator/SdkGenerator.hs b/waspc/src/Wasp/Generator/SdkGenerator.hs index f2c382d856..ad0e8a1b12 100644 --- a/waspc/src/Wasp/Generator/SdkGenerator.hs +++ b/waspc/src/Wasp/Generator/SdkGenerator.hs @@ -337,7 +337,8 @@ genUniversalDir = return [ C.mkTmplFd [relfile|universal/url.ts|], C.mkTmplFd [relfile|universal/types.ts|], - C.mkTmplFd [relfile|universal/validators.ts|] + C.mkTmplFd [relfile|universal/validators.ts|], + C.mkTmplFd [relfile|universal/predicates.ts|] ] genServerUtils :: AppSpec -> Generator FileDraft diff --git a/waspc/src/Wasp/Generator/SdkGenerator/Server/JobGenerator.hs b/waspc/src/Wasp/Generator/SdkGenerator/Server/JobGenerator.hs index 71d4fe3952..03564e3366 100644 --- a/waspc/src/Wasp/Generator/SdkGenerator/Server/JobGenerator.hs +++ b/waspc/src/Wasp/Generator/SdkGenerator/Server/JobGenerator.hs @@ -71,20 +71,34 @@ genJob (jobName, job) = -- NOTE: You cannot directly input an Aeson.object for Mustache to substitute. -- This is why we must get a text representation of the object, either by -- `Aeson.Text.encodeToLazyText` on an Aeson.Object, or `show` on an AS.JSON. - "jobSchedule" .= Aeson.Text.encodeToLazyText (fromMaybe Aeson.Null maybeJobSchedule), + "jobSchedule" .= getJobScheduleData (J.schedule job), "jobPerformOptions" .= show (fromMaybe AS.JSON.emptyObject maybeJobPerformOptions) ] jobExecutorImportPath = getJobExecutorImportPath (J.executor job) maybeJobPerformOptions = J.performExecutorOptionsJson job - jobScheduleTmplData s = - object - [ "cron" .= J.cron s, - "args" .= J.args s, - "options" .= fromMaybe AS.JSON.emptyObject (J.scheduleExecutorOptionsJson job) - ] - maybeJobSchedule = jobScheduleTmplData <$> J.schedule job + + getJobScheduleData = + maybe + (object ["isDefined" .= False]) + ( \schedule -> + object + [ "isDefined" .= True, + "cron" .= J.cron schedule, + "args" .= getJobScheduleArgs (J.args schedule), + "options" .= getJobSchduleOptions (J.scheduleExecutorOptionsJson job) + ] + ) + getJobScheduleArgs = + maybe + (object ["isDefined" .= False]) + (\args -> object ["isDefined" .= True, "json" .= Aeson.Text.encodeToLazyText args]) + + getJobSchduleOptions = + maybe + (object ["isDefined" .= False]) + (\options -> object ["isDefined" .= True, "json" .= Aeson.Text.encodeToLazyText options]) -- | We are importing relevant functions and types per executor e.g. JobFn or registerJob, -- this functions maps the executor to the import path from SDK. diff --git a/web/docs/auth/email.md b/web/docs/auth/email.md index 5da5bfc69f..d6d0480f95 100644 --- a/web/docs/auth/email.md +++ b/web/docs/auth/email.md @@ -623,7 +623,7 @@ import { ensureValidEmail, createProviderId, sanitizeAndSerializeProviderData, - deserializeAndSanitizeProviderData, + getProviderData, findAuthIdentity, createUser, createEmailVerificationLink, @@ -640,7 +640,7 @@ export const signup = async (args, _context) => { const existingAuthIdentity = await findAuthIdentity(providerId) if (existingAuthIdentity) { - const providerData = deserializeAndSanitizeProviderData(existingAuthIdentity.providerData) + const providerData = getProviderData(existingAuthIdentity.providerData) // Your custom code here } else { // sanitizeAndSerializeProviderData will hash the user's password @@ -716,7 +716,7 @@ import { ensureValidEmail, createProviderId, sanitizeAndSerializeProviderData, - deserializeAndSanitizeProviderData, + getProviderData, findAuthIdentity, createUser, createEmailVerificationLink, @@ -746,7 +746,7 @@ export const signup: CustomSignup< const existingAuthIdentity = await findAuthIdentity(providerId) if (existingAuthIdentity) { - const providerData = deserializeAndSanitizeProviderData<'email'>( + const providerData = getProviderData<'email'>( existingAuthIdentity.providerData ) // Your custom code here diff --git a/web/docs/auth/overview.md b/web/docs/auth/overview.md index e21e0c596f..c9ed4a4b0d 100644 --- a/web/docs/auth/overview.md +++ b/web/docs/auth/overview.md @@ -410,7 +410,7 @@ import { createProviderId, findAuthIdentity, updateAuthIdentityProviderData, - deserializeAndSanitizeProviderData, + getProviderDataWithPassword, } from 'wasp/server/auth'; export const updatePassword = async (args, context) => { @@ -420,7 +420,7 @@ export const updatePassword = async (args, context) => { throw new HttpError(400, "Unknown user") } - const providerData = deserializeAndSanitizeProviderData(authIdentity.providerData) + const providerData = getProviderDataWithPassword(authIdentity.providerData) // Updates the password and hashes it automatically. await updateAuthIdentityProviderData(providerId, providerData, { @@ -437,7 +437,7 @@ import { createProviderId, findAuthIdentity, updateAuthIdentityProviderData, - deserializeAndSanitizeProviderData, + getProviderDataWithPassword, } from 'wasp/server/auth'; import { type UpdatePassword } from 'wasp/server/operations' @@ -451,7 +451,7 @@ export const updatePassword: UpdatePassword< throw new HttpError(400, "Unknown user") } - const providerData = deserializeAndSanitizeProviderData<'email'>(authIdentity.providerData) + const providerData = getProviderDataWithPassword<'email'>(authIdentity.providerData) // Updates the password and hashes it automatically. await updateAuthIdentityProviderData(providerId, providerData, {