mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-09-11 07:16:09 +03:00
Explicit public API types (#1930)
This commit is contained in:
parent
bdc31a1ac7
commit
a283e15ea5
@ -1,11 +1,11 @@
|
||||
import axios, { type AxiosError } from 'axios'
|
||||
import axios, { type AxiosInstance, type AxiosError } from 'axios'
|
||||
|
||||
import { config } from 'wasp/client'
|
||||
import { storage } from 'wasp/core/storage'
|
||||
import { apiEventsEmitter } from './events.js'
|
||||
|
||||
// PUBLIC API
|
||||
export const api = axios.create({
|
||||
export const api: AxiosInstance = axios.create({
|
||||
baseURL: config.apiUrl,
|
||||
})
|
||||
|
||||
|
@ -6,7 +6,7 @@ export function ForgotPasswordForm({
|
||||
appearance,
|
||||
logo,
|
||||
socialLayout,
|
||||
}: CustomizationOptions) {
|
||||
}: CustomizationOptions): React.JSX.Element {
|
||||
return (
|
||||
<Auth
|
||||
appearance={appearance}
|
||||
|
@ -6,7 +6,7 @@ export function LoginForm({
|
||||
appearance,
|
||||
logo,
|
||||
socialLayout,
|
||||
}: CustomizationOptions) {
|
||||
}: CustomizationOptions): React.JSX.Element {
|
||||
return (
|
||||
<Auth
|
||||
appearance={appearance}
|
||||
|
@ -6,7 +6,7 @@ export function ResetPasswordForm({
|
||||
appearance,
|
||||
logo,
|
||||
socialLayout,
|
||||
}: CustomizationOptions) {
|
||||
}: CustomizationOptions): React.JSX.Element {
|
||||
return (
|
||||
<Auth
|
||||
appearance={appearance}
|
||||
|
@ -11,7 +11,7 @@ export function SignupForm({
|
||||
logo,
|
||||
socialLayout,
|
||||
additionalFields,
|
||||
}: CustomizationOptions & { additionalFields?: AdditionalSignupFields; }) {
|
||||
}: CustomizationOptions & { additionalFields?: AdditionalSignupFields; }): React.JSX.Element {
|
||||
return (
|
||||
<Auth
|
||||
appearance={appearance}
|
||||
|
@ -6,7 +6,7 @@ export function VerifyEmailForm({
|
||||
appearance,
|
||||
logo,
|
||||
socialLayout,
|
||||
}: CustomizationOptions) {
|
||||
}: CustomizationOptions): React.JSX.Element {
|
||||
return (
|
||||
<Auth
|
||||
appearance={appearance}
|
||||
|
@ -5,10 +5,10 @@ import { SocialButton } from '../forms/internal/social/SocialButton'
|
||||
import * as SocialIcons from '../forms/internal/social/SocialIcons'
|
||||
|
||||
// PUBLIC API
|
||||
export const signInUrl = `${config.apiUrl}{= signInPath =}`
|
||||
export const signInUrl: string = `${config.apiUrl}{= signInPath =}`
|
||||
|
||||
// PUBLIC API
|
||||
export function SignInButton() {
|
||||
export function SignInButton(): React.JSX.Element {
|
||||
return (
|
||||
<SocialButton href={signInUrl}>
|
||||
<SocialIcons.{= displayName =} />
|
@ -5,7 +5,7 @@ import type { Expand } from 'wasp/universal/types'
|
||||
import type { ProviderName } from '../utils'
|
||||
|
||||
// PUBLIC API
|
||||
export function defineUserSignupFields(fields: UserSignupFields) {
|
||||
export function defineUserSignupFields(fields: UserSignupFields): UserSignupFields {
|
||||
return fields
|
||||
}
|
||||
|
||||
|
@ -4,12 +4,13 @@ import { useQuery, addMetadataToQuery } from 'wasp/client/operations'
|
||||
import { api, handleApiError } from 'wasp/client/api'
|
||||
import { HttpMethod } from 'wasp/client'
|
||||
import type { AuthUser } from './types'
|
||||
import { UseQueryResult } from '@tanstack/react-query'
|
||||
|
||||
// PUBLIC API
|
||||
export const getMe = createUserGetter()
|
||||
export const getMe: () => Promise<AuthUser | null> = createUserGetter()
|
||||
|
||||
// PUBLIC API
|
||||
export default function useAuth(queryFnArgs?: unknown, config?: any) {
|
||||
export default function useAuth(queryFnArgs?: unknown, config?: any): UseQueryResult<AuthUser> {
|
||||
return useQuery(getMe, queryFnArgs, config)
|
||||
}
|
||||
|
||||
|
@ -3,8 +3,12 @@ import { stripTrailingSlash } from 'wasp/universal/url'
|
||||
|
||||
const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || '{= defaultServerUrl =}';
|
||||
|
||||
const config = {
|
||||
// PUBLIC API
|
||||
export type ClientConfig = {
|
||||
apiUrl: string,
|
||||
}
|
||||
|
||||
// PUBLIC API
|
||||
export const config: ClientConfig = {
|
||||
apiUrl,
|
||||
}
|
||||
|
||||
export default config
|
@ -11,4 +11,4 @@ export enum HttpMethod {
|
||||
export type Route = { method: HttpMethod; path: string }
|
||||
|
||||
// PUBLIC API
|
||||
export { default as config } from './config'
|
||||
export { config, ClientConfig } from './config'
|
||||
|
@ -1,14 +0,0 @@
|
||||
import { type Action } from '../core.js'
|
||||
import type { Expand, _Awaited, _ReturnType } from 'wasp/universal/types'
|
||||
|
||||
// PRIVATE API
|
||||
export function createAction<BackendAction extends GenericBackendAction>(
|
||||
actionRoute: string,
|
||||
entitiesUsed: unknown[]
|
||||
): ActionFor<BackendAction>
|
||||
|
||||
type ActionFor<BackendAction extends GenericBackendAction> = Expand<
|
||||
Action<Parameters<BackendAction>[0], _Awaited<_ReturnType<BackendAction>>>
|
||||
>
|
||||
|
||||
type GenericBackendAction = (args: never, context: any) => unknown
|
@ -1,3 +1,5 @@
|
||||
import type { Expand, _Awaited, _ReturnType } from 'wasp/universal/types'
|
||||
import { type Action } from '../core.js'
|
||||
import { callOperation, makeOperationRoute } from '../internal/index.js'
|
||||
import {
|
||||
registerActionInProgress,
|
||||
@ -5,7 +7,10 @@ import {
|
||||
} from '../internal/resources.js'
|
||||
|
||||
// PRIVATE API
|
||||
export function createAction(relativeActionRoute, entitiesUsed) {
|
||||
export function createAction<BackendAction extends GenericBackendAction>(
|
||||
relativeActionRoute: string,
|
||||
entitiesUsed: unknown[]
|
||||
): ActionFor<BackendAction> {
|
||||
const actionRoute = makeOperationRoute(relativeActionRoute)
|
||||
|
||||
async function internalAction(args, specificOptimisticUpdateDefinitions) {
|
||||
@ -32,5 +37,12 @@ export function createAction(relativeActionRoute, entitiesUsed) {
|
||||
const action = (args) => internalAction(args, [])
|
||||
action.internal = internalAction
|
||||
|
||||
return action
|
||||
return action as ActionFor<BackendAction>
|
||||
}
|
||||
|
||||
// PRIVATE API
|
||||
export type ActionFor<BackendAction extends GenericBackendAction> =
|
||||
Action<Parameters<BackendAction>[0], _Awaited<_ReturnType<BackendAction>>>
|
||||
|
||||
|
||||
type GenericBackendAction = (args: never, context: any) => unknown
|
@ -1,12 +1,12 @@
|
||||
{{={= =}=}}
|
||||
import { createAction } from './core'
|
||||
import { type ActionFor, createAction } from './core'
|
||||
{=# actions =}
|
||||
{=& operationTypeImportStmt =}
|
||||
{=/ actions =}
|
||||
{=# actions =}
|
||||
|
||||
// PUBLIC API
|
||||
export const {= operationName =} = createAction<{= operationTypeName =}>(
|
||||
export const {= operationName =}: ActionFor<{= operationTypeName =}> = createAction<{= operationTypeName =}>(
|
||||
'{= actionRoute =}',
|
||||
{=& entitiesArray =},
|
||||
)
|
||||
|
@ -6,10 +6,10 @@ import {
|
||||
} from 'superjson'
|
||||
|
||||
// PRIVATE API
|
||||
export type OperationRoute = { method: HttpMethod, path: string }
|
||||
export type OperationRoute = { method: HttpMethod.Post, path: string }
|
||||
|
||||
// PRIVATE API
|
||||
export async function callOperation(operationRoute: OperationRoute & { method: HttpMethod.Post }, args: any) {
|
||||
export async function callOperation(operationRoute: OperationRoute, args: any) {
|
||||
try {
|
||||
const superjsonArgs = superjsonSerialize(args)
|
||||
const response = await api.post(operationRoute.path, superjsonArgs)
|
||||
|
@ -1,25 +0,0 @@
|
||||
import { type Query } from '../core.js'
|
||||
import { Route } from 'wasp/client'
|
||||
import type { Expand, _Awaited, _ReturnType } from 'wasp/universal/types'
|
||||
|
||||
// PRIVATE API
|
||||
export function createQuery<BackendQuery extends GenericBackendQuery>(
|
||||
queryRoute: string,
|
||||
entitiesUsed: any[]
|
||||
): QueryFor<BackendQuery>
|
||||
|
||||
// PRIVATE API
|
||||
export function addMetadataToQuery(
|
||||
query: (...args: any[]) => Promise<unknown>,
|
||||
metadata: {
|
||||
relativeQueryPath: string
|
||||
queryRoute: Route
|
||||
entitiesUsed: string[]
|
||||
}
|
||||
): void
|
||||
|
||||
type QueryFor<BackendQuery extends GenericBackendQuery> = Expand<
|
||||
Query<Parameters<BackendQuery>[0], _Awaited<_ReturnType<BackendQuery>>>
|
||||
>
|
||||
|
||||
type GenericBackendQuery = (args: never, context: any) => unknown
|
@ -1,11 +1,16 @@
|
||||
import { Route } from 'wasp/client'
|
||||
import type { Expand, _Awaited, _ReturnType } from 'wasp/universal/types'
|
||||
import { type Query } from '../core.js'
|
||||
import { callOperation, makeOperationRoute } from '../internal/index.js'
|
||||
import {
|
||||
addResourcesUsedByQuery,
|
||||
getActiveOptimisticUpdates,
|
||||
} from '../internal/resources'
|
||||
|
||||
// PRIVATE API
|
||||
export function createQuery(relativeQueryPath, entitiesUsed) {
|
||||
export function createQuery<BackendQuery extends GenericBackendQuery>(
|
||||
relativeQueryPath: string,
|
||||
entitiesUsed: string[]
|
||||
): QueryFor<BackendQuery> {
|
||||
const queryRoute = makeOperationRoute(relativeQueryPath)
|
||||
|
||||
async function query(queryKey, queryArgs) {
|
||||
@ -21,6 +26,16 @@ export function createQuery(relativeQueryPath, entitiesUsed) {
|
||||
return query
|
||||
}
|
||||
|
||||
// PRIVATE API
|
||||
export function addMetadataToQuery(
|
||||
query: (...args: any[]) => Promise<unknown>,
|
||||
metadata: {
|
||||
relativeQueryPath: string
|
||||
queryRoute: Route
|
||||
entitiesUsed: string[]
|
||||
}
|
||||
): void
|
||||
|
||||
// PRIVATE API
|
||||
export function addMetadataToQuery(
|
||||
query,
|
||||
@ -30,3 +45,9 @@ export function addMetadataToQuery(
|
||||
query.route = queryRoute
|
||||
addResourcesUsedByQuery(query.queryCacheKey, entitiesUsed)
|
||||
}
|
||||
|
||||
export type QueryFor<BackendQuery extends GenericBackendQuery> =
|
||||
Query<Parameters<BackendQuery>[0], _Awaited<_ReturnType<BackendQuery>>>
|
||||
|
||||
|
||||
type GenericBackendQuery = (args: never, context: any) => unknown
|
@ -1,12 +1,12 @@
|
||||
{{={= =}=}}
|
||||
import { createQuery } from './core'
|
||||
import { type QueryFor, createQuery } from './core'
|
||||
{=# queries =}
|
||||
{=& operationTypeImportStmt =}
|
||||
{=/ queries =}
|
||||
{=# queries =}
|
||||
|
||||
// PUBLIC API
|
||||
export const {= operationName =} = createQuery<{= operationTypeName =}>(
|
||||
export const {= operationName =}: QueryFor<{= operationTypeName =}> = createQuery<{= operationTypeName =}>(
|
||||
'{= queryRoute =}',
|
||||
{=& entitiesArray =},
|
||||
)
|
||||
|
@ -13,7 +13,7 @@ export function Link(
|
||||
hash?: string;
|
||||
}
|
||||
& Routes
|
||||
) {
|
||||
): React.JSX.Element {
|
||||
const toPropWithParams = useMemo(() => {
|
||||
return interpolatePath(to, params, search, hash)
|
||||
}, [to, params])
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { useContext, useEffect } from 'react'
|
||||
import { WebSocketContext } from './WebSocketProvider'
|
||||
import { WebSocketContext, WebSocketContextValue } from './WebSocketProvider'
|
||||
import type {
|
||||
ClientToServerEvents,
|
||||
ServerToClientEvents,
|
||||
@ -13,7 +13,7 @@ export type ClientToServerPayload<Event extends keyof ClientToServerEvents> =
|
||||
Parameters<ClientToServerEvents[Event]>[0]
|
||||
|
||||
// PUBLIC API
|
||||
export function useSocket() {
|
||||
export function useSocket(): WebSocketContextValue {
|
||||
return useContext(WebSocketContext)
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ export function useSocket() {
|
||||
export function useSocketListener<Event extends keyof ServerToClientEvents>(
|
||||
event: Event,
|
||||
handler: ServerToClientEvents[Event]
|
||||
) {
|
||||
): void {
|
||||
const { socket } = useContext(WebSocketContext)
|
||||
useEffect(() => {
|
||||
// Casting to `keyof ServerToClientEvents` is necessary because TypeScript
|
||||
|
@ -29,12 +29,12 @@ export type DummyEmailProvider = {
|
||||
type: "dummy";
|
||||
}
|
||||
|
||||
// PRIVATE API
|
||||
// PUBLIC API
|
||||
export type EmailSender = {
|
||||
send: (email: Email) => Promise<SentMessageInfo>;
|
||||
};
|
||||
|
||||
// PRIVATE API
|
||||
// PUBLIC API
|
||||
export type SentMessageInfo = any;
|
||||
|
||||
// PUBLIC API
|
||||
|
@ -1,5 +1,6 @@
|
||||
{{={= =}=}}
|
||||
import { initEmailSender } from "./core/index.js";
|
||||
import { EmailSender } from "./core/types.js";
|
||||
|
||||
{=# isSmtpProviderUsed =}
|
||||
const emailProvider = {
|
||||
@ -30,7 +31,7 @@ const emailProvider = {
|
||||
{=/ isDummyProviderUsed =}
|
||||
|
||||
// PUBLIC API
|
||||
export const emailSender = initEmailSender(emailProvider);
|
||||
export const emailSender: EmailSender = initEmailSender(emailProvider);
|
||||
|
||||
// PUBLIC API
|
||||
export type { Email, EmailFromField } from "./core/types.js";
|
||||
export type { Email, EmailFromField, EmailSender, SentMessageInfo } from "./core/types.js";
|
||||
|
@ -8,16 +8,14 @@ waspBuild/.wasp/build/sdk/wasp/api/events.ts
|
||||
waspBuild/.wasp/build/sdk/wasp/api/index.ts
|
||||
waspBuild/.wasp/build/sdk/wasp/client/config.ts
|
||||
waspBuild/.wasp/build/sdk/wasp/client/index.ts
|
||||
waspBuild/.wasp/build/sdk/wasp/client/operations/actions/core.d.ts
|
||||
waspBuild/.wasp/build/sdk/wasp/client/operations/actions/core.js
|
||||
waspBuild/.wasp/build/sdk/wasp/client/operations/actions/core.ts
|
||||
waspBuild/.wasp/build/sdk/wasp/client/operations/actions/index.ts
|
||||
waspBuild/.wasp/build/sdk/wasp/client/operations/core.ts
|
||||
waspBuild/.wasp/build/sdk/wasp/client/operations/index.ts
|
||||
waspBuild/.wasp/build/sdk/wasp/client/operations/internal/index.ts
|
||||
waspBuild/.wasp/build/sdk/wasp/client/operations/internal/resources.js
|
||||
waspBuild/.wasp/build/sdk/wasp/client/operations/internal/updateHandlersMap.js
|
||||
waspBuild/.wasp/build/sdk/wasp/client/operations/queries/core.d.ts
|
||||
waspBuild/.wasp/build/sdk/wasp/client/operations/queries/core.js
|
||||
waspBuild/.wasp/build/sdk/wasp/client/operations/queries/core.ts
|
||||
waspBuild/.wasp/build/sdk/wasp/client/operations/queries/index.ts
|
||||
waspBuild/.wasp/build/sdk/wasp/client/operations/queryClient.ts
|
||||
waspBuild/.wasp/build/sdk/wasp/client/router/Link.tsx
|
||||
@ -225,16 +223,14 @@ waspBuild/.wasp/out/sdk/wasp/api/events.ts
|
||||
waspBuild/.wasp/out/sdk/wasp/api/index.ts
|
||||
waspBuild/.wasp/out/sdk/wasp/client/config.ts
|
||||
waspBuild/.wasp/out/sdk/wasp/client/index.ts
|
||||
waspBuild/.wasp/out/sdk/wasp/client/operations/actions/core.d.ts
|
||||
waspBuild/.wasp/out/sdk/wasp/client/operations/actions/core.js
|
||||
waspBuild/.wasp/out/sdk/wasp/client/operations/actions/core.ts
|
||||
waspBuild/.wasp/out/sdk/wasp/client/operations/actions/index.ts
|
||||
waspBuild/.wasp/out/sdk/wasp/client/operations/core.ts
|
||||
waspBuild/.wasp/out/sdk/wasp/client/operations/index.ts
|
||||
waspBuild/.wasp/out/sdk/wasp/client/operations/internal/index.ts
|
||||
waspBuild/.wasp/out/sdk/wasp/client/operations/internal/resources.js
|
||||
waspBuild/.wasp/out/sdk/wasp/client/operations/internal/updateHandlersMap.js
|
||||
waspBuild/.wasp/out/sdk/wasp/client/operations/queries/core.d.ts
|
||||
waspBuild/.wasp/out/sdk/wasp/client/operations/queries/core.js
|
||||
waspBuild/.wasp/out/sdk/wasp/client/operations/queries/core.ts
|
||||
waspBuild/.wasp/out/sdk/wasp/client/operations/queries/index.ts
|
||||
waspBuild/.wasp/out/sdk/wasp/client/operations/queryClient.ts
|
||||
waspBuild/.wasp/out/sdk/wasp/client/router/Link.tsx
|
||||
|
@ -11,42 +11,35 @@
|
||||
"file",
|
||||
"../out/sdk/wasp/api/index.ts"
|
||||
],
|
||||
"b33b86f9a24e947243d7c64e8adffb72a42fde853af0d29641429d4697d040b2"
|
||||
"5784ba365e8a5cb2031571cfebf1cbae8670f86f8e5a596b133d333cdf6c91eb"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/config.ts"
|
||||
],
|
||||
"68141be8527e8ae3d15838663769737278a71d3853b1dbdc48696e92d4e42548"
|
||||
"bc7d48bd7ec4cdf74f85b98113eb26e670ef265ca4bbd735e361409c9335ad85"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/index.ts"
|
||||
],
|
||||
"7a9f44a82a8b15b177fda593c7ddefcef0dadb7c52648c4e934ca76333c589a6"
|
||||
"2b3651e7040a63cfd6a271c2aa89f21cf01170e0abeb6c5ab74adde324852fe4"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/operations/actions/core.d.ts"
|
||||
"../out/sdk/wasp/client/operations/actions/core.ts"
|
||||
],
|
||||
"676855c039620769cc6ac728149d263c438024e5888ea0afd7f575507a95682a"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/operations/actions/core.js"
|
||||
],
|
||||
"620a4aefbab701dd47b8bf21a07fc4e081ae1fd297261c5af7a05f21f558dff1"
|
||||
"016623c0ebdc1b88d746fa1345015b3cb9653429abdc13a9147a952bff83a927"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/operations/actions/index.ts"
|
||||
],
|
||||
"cada58ebdd19f239b97a4cc6bfc1d37b855022629457ddb0c03ff9317aa8e8f0"
|
||||
"246823e2446114189c40bb85795a8ebd0c5eb1badcba540c13fff3b161eac3f4"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -67,7 +60,7 @@
|
||||
"file",
|
||||
"../out/sdk/wasp/client/operations/internal/index.ts"
|
||||
],
|
||||
"0cd5c744f0d883d48a6c1ddf8eacbe48059e123e79c5f39fad2d17073b6c9f9e"
|
||||
"f08a4f1fb1f897edca465b3f228215e06418109fb439232e8fa0ffdbdc98b833"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -86,23 +79,16 @@
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/operations/queries/core.d.ts"
|
||||
"../out/sdk/wasp/client/operations/queries/core.ts"
|
||||
],
|
||||
"8ca19541652926772e2a7c5d88b5497b7760e98bc9d19c9a217bd03d83cec97d"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/operations/queries/core.js"
|
||||
],
|
||||
"34425abc901cd6294ca902df6b0c080aeafe2b3abf5b539c5e622020601f838e"
|
||||
"5f30328d93582f9c8444720e99f45c19c8647f052b7fbcf5f71b578b9241ac96"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/operations/queries/index.ts"
|
||||
],
|
||||
"9d188907e5a3175e1bdada1c242ee4741eb866598d06d9d71d73a01e7a9a8ba2"
|
||||
"882410504b909cc421d50a27c39952f664ba3457438ce746a95d9cab3431944c"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -116,7 +102,7 @@
|
||||
"file",
|
||||
"../out/sdk/wasp/client/router/Link.tsx"
|
||||
],
|
||||
"80db39a38f50833f8c965bfd7758da990083db60a6f2f8e394353eed5f981cc9"
|
||||
"66aebac1ceb458f661b4e24085c321e0764663ada56843261640a230718bb29d"
|
||||
],
|
||||
[
|
||||
[
|
||||
|
@ -1,11 +1,11 @@
|
||||
import axios, { type AxiosError } from 'axios'
|
||||
import axios, { type AxiosInstance, type AxiosError } from 'axios'
|
||||
|
||||
import { config } from 'wasp/client'
|
||||
import { storage } from 'wasp/core/storage'
|
||||
import { apiEventsEmitter } from './events.js'
|
||||
|
||||
// PUBLIC API
|
||||
export const api = axios.create({
|
||||
export const api: AxiosInstance = axios.create({
|
||||
baseURL: config.apiUrl,
|
||||
})
|
||||
|
||||
|
@ -2,8 +2,12 @@ import { stripTrailingSlash } from 'wasp/universal/url'
|
||||
|
||||
const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001';
|
||||
|
||||
const config = {
|
||||
// PUBLIC API
|
||||
export type ClientConfig = {
|
||||
apiUrl: string,
|
||||
}
|
||||
|
||||
// PUBLIC API
|
||||
export const config: ClientConfig = {
|
||||
apiUrl,
|
||||
}
|
||||
|
||||
export default config
|
@ -11,4 +11,4 @@ export enum HttpMethod {
|
||||
export type Route = { method: HttpMethod; path: string }
|
||||
|
||||
// PUBLIC API
|
||||
export { default as config } from './config'
|
||||
export { config, ClientConfig } from './config'
|
||||
|
@ -1,14 +0,0 @@
|
||||
import { type Action } from '../core.js'
|
||||
import type { Expand, _Awaited, _ReturnType } from 'wasp/universal/types'
|
||||
|
||||
// PRIVATE API
|
||||
export function createAction<BackendAction extends GenericBackendAction>(
|
||||
actionRoute: string,
|
||||
entitiesUsed: unknown[]
|
||||
): ActionFor<BackendAction>
|
||||
|
||||
type ActionFor<BackendAction extends GenericBackendAction> = Expand<
|
||||
Action<Parameters<BackendAction>[0], _Awaited<_ReturnType<BackendAction>>>
|
||||
>
|
||||
|
||||
type GenericBackendAction = (args: never, context: any) => unknown
|
@ -1,3 +1,5 @@
|
||||
import type { Expand, _Awaited, _ReturnType } from 'wasp/universal/types'
|
||||
import { type Action } from '../core.js'
|
||||
import { callOperation, makeOperationRoute } from '../internal/index.js'
|
||||
import {
|
||||
registerActionInProgress,
|
||||
@ -5,7 +7,10 @@ import {
|
||||
} from '../internal/resources.js'
|
||||
|
||||
// PRIVATE API
|
||||
export function createAction(relativeActionRoute, entitiesUsed) {
|
||||
export function createAction<BackendAction extends GenericBackendAction>(
|
||||
relativeActionRoute: string,
|
||||
entitiesUsed: unknown[]
|
||||
): ActionFor<BackendAction> {
|
||||
const actionRoute = makeOperationRoute(relativeActionRoute)
|
||||
|
||||
async function internalAction(args, specificOptimisticUpdateDefinitions) {
|
||||
@ -32,5 +37,12 @@ export function createAction(relativeActionRoute, entitiesUsed) {
|
||||
const action = (args) => internalAction(args, [])
|
||||
action.internal = internalAction
|
||||
|
||||
return action
|
||||
return action as ActionFor<BackendAction>
|
||||
}
|
||||
|
||||
// PRIVATE API
|
||||
export type ActionFor<BackendAction extends GenericBackendAction> =
|
||||
Action<Parameters<BackendAction>[0], _Awaited<_ReturnType<BackendAction>>>
|
||||
|
||||
|
||||
type GenericBackendAction = (args: never, context: any) => unknown
|
@ -1 +1 @@
|
||||
import { createAction } from './core'
|
||||
import { type ActionFor, createAction } from './core'
|
||||
|
@ -6,10 +6,10 @@ import {
|
||||
} from 'superjson'
|
||||
|
||||
// PRIVATE API
|
||||
export type OperationRoute = { method: HttpMethod, path: string }
|
||||
export type OperationRoute = { method: HttpMethod.Post, path: string }
|
||||
|
||||
// PRIVATE API
|
||||
export async function callOperation(operationRoute: OperationRoute & { method: HttpMethod.Post }, args: any) {
|
||||
export async function callOperation(operationRoute: OperationRoute, args: any) {
|
||||
try {
|
||||
const superjsonArgs = superjsonSerialize(args)
|
||||
const response = await api.post(operationRoute.path, superjsonArgs)
|
||||
|
@ -1,25 +0,0 @@
|
||||
import { type Query } from '../core.js'
|
||||
import { Route } from 'wasp/client'
|
||||
import type { Expand, _Awaited, _ReturnType } from 'wasp/universal/types'
|
||||
|
||||
// PRIVATE API
|
||||
export function createQuery<BackendQuery extends GenericBackendQuery>(
|
||||
queryRoute: string,
|
||||
entitiesUsed: any[]
|
||||
): QueryFor<BackendQuery>
|
||||
|
||||
// PRIVATE API
|
||||
export function addMetadataToQuery(
|
||||
query: (...args: any[]) => Promise<unknown>,
|
||||
metadata: {
|
||||
relativeQueryPath: string
|
||||
queryRoute: Route
|
||||
entitiesUsed: string[]
|
||||
}
|
||||
): void
|
||||
|
||||
type QueryFor<BackendQuery extends GenericBackendQuery> = Expand<
|
||||
Query<Parameters<BackendQuery>[0], _Awaited<_ReturnType<BackendQuery>>>
|
||||
>
|
||||
|
||||
type GenericBackendQuery = (args: never, context: any) => unknown
|
@ -1,11 +1,16 @@
|
||||
import { Route } from 'wasp/client'
|
||||
import type { Expand, _Awaited, _ReturnType } from 'wasp/universal/types'
|
||||
import { type Query } from '../core.js'
|
||||
import { callOperation, makeOperationRoute } from '../internal/index.js'
|
||||
import {
|
||||
addResourcesUsedByQuery,
|
||||
getActiveOptimisticUpdates,
|
||||
} from '../internal/resources'
|
||||
|
||||
// PRIVATE API
|
||||
export function createQuery(relativeQueryPath, entitiesUsed) {
|
||||
export function createQuery<BackendQuery extends GenericBackendQuery>(
|
||||
relativeQueryPath: string,
|
||||
entitiesUsed: string[]
|
||||
): QueryFor<BackendQuery> {
|
||||
const queryRoute = makeOperationRoute(relativeQueryPath)
|
||||
|
||||
async function query(queryKey, queryArgs) {
|
||||
@ -21,6 +26,16 @@ export function createQuery(relativeQueryPath, entitiesUsed) {
|
||||
return query
|
||||
}
|
||||
|
||||
// PRIVATE API
|
||||
export function addMetadataToQuery(
|
||||
query: (...args: any[]) => Promise<unknown>,
|
||||
metadata: {
|
||||
relativeQueryPath: string
|
||||
queryRoute: Route
|
||||
entitiesUsed: string[]
|
||||
}
|
||||
): void
|
||||
|
||||
// PRIVATE API
|
||||
export function addMetadataToQuery(
|
||||
query,
|
||||
@ -30,3 +45,9 @@ export function addMetadataToQuery(
|
||||
query.route = queryRoute
|
||||
addResourcesUsedByQuery(query.queryCacheKey, entitiesUsed)
|
||||
}
|
||||
|
||||
export type QueryFor<BackendQuery extends GenericBackendQuery> =
|
||||
Query<Parameters<BackendQuery>[0], _Awaited<_ReturnType<BackendQuery>>>
|
||||
|
||||
|
||||
type GenericBackendQuery = (args: never, context: any) => unknown
|
@ -1,4 +1,4 @@
|
||||
import { createQuery } from './core'
|
||||
import { type QueryFor, createQuery } from './core'
|
||||
|
||||
// PRIVATE API
|
||||
export { addMetadataToQuery } from './core'
|
||||
|
@ -13,7 +13,7 @@ export function Link(
|
||||
hash?: string;
|
||||
}
|
||||
& Routes
|
||||
) {
|
||||
): React.JSX.Element {
|
||||
const toPropWithParams = useMemo(() => {
|
||||
return interpolatePath(to, params, search, hash)
|
||||
}, [to, params])
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { type AxiosError } from 'axios';
|
||||
export declare const api: import("axios").AxiosInstance;
|
||||
import { type AxiosInstance, type AxiosError } from 'axios';
|
||||
export declare const api: AxiosInstance;
|
||||
export declare function setSessionId(sessionId: string): void;
|
||||
export declare function getSessionId(): string | undefined;
|
||||
export declare function clearSessionId(): void;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAA;AAE9C,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,GAAG,KAAK,CAAC,MAAM,CAAC;IAC9B,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;AAC1C,CAAC;AAED,oBAAoB;AACpB,MAAM,UAAU,mBAAmB;IACjC,oBAAoB,GAAG,SAAS,CAAA;IAChC,OAAO,CAAC,KAAK,EAAE,CAAA;IACf,gBAAgB,CAAC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AC,CAAA;QACd,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;CACF"}
|
@ -1,4 +1,4 @@
|
||||
declare const config: {
|
||||
export type ClientConfig = {
|
||||
apiUrl: string;
|
||||
};
|
||||
export default config;
|
||||
export declare const config: ClientConfig;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { stripTrailingSlash } from 'wasp/universal/url';
|
||||
const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001';
|
||||
const config = {
|
||||
// PUBLIC API
|
||||
export const config = {
|
||||
apiUrl,
|
||||
};
|
||||
export default config;
|
||||
//# sourceMappingURL=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;AAEhG,MAAM,MAAM,GAAG;IACb,MAAM;CACP,CAAA;AAED,eAAe,MAAM,CAAA"}
|
||||
{"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"}
|
@ -8,4 +8,4 @@ export type Route = {
|
||||
method: HttpMethod;
|
||||
path: string;
|
||||
};
|
||||
export { default as config } from './config';
|
||||
export { config, ClientConfig } from './config';
|
||||
|
@ -8,5 +8,5 @@ export var HttpMethod;
|
||||
HttpMethod["Delete"] = "DELETE";
|
||||
})(HttpMethod || (HttpMethod = {}));
|
||||
// PUBLIC API
|
||||
export { default as config } from './config';
|
||||
export { config } from './config';
|
||||
//# sourceMappingURL=index.js.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,mFAAmF;AACnF,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;AAClB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAKD,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAA"}
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,mFAAmF;AACnF,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;AAClB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAKD,aAAa;AACb,OAAO,EAAE,MAAM,EAAgB,MAAM,UAAU,CAAA"}
|
@ -1,4 +1,6 @@
|
||||
export function createAction(relativeActionRoute: any, entitiesUsed: any): {
|
||||
(args: any): Promise<unknown>;
|
||||
internal: (args: any, specificOptimisticUpdateDefinitions: any) => Promise<unknown>;
|
||||
};
|
||||
import type { _Awaited, _ReturnType } from 'wasp/universal/types';
|
||||
import { type Action } from '../core.js';
|
||||
export declare function createAction<BackendAction extends GenericBackendAction>(relativeActionRoute: string, entitiesUsed: unknown[]): ActionFor<BackendAction>;
|
||||
export type ActionFor<BackendAction extends GenericBackendAction> = Action<Parameters<BackendAction>[0], _Awaited<_ReturnType<BackendAction>>>;
|
||||
type GenericBackendAction = (args: never, context: any) => unknown;
|
||||
export {};
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../../client/operations/actions/core.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,EACL,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,0BAA0B,CAAA;AAEjC,cAAc;AACd,MAAM,UAAU,YAAY,CAAC,mBAAmB,EAAE,YAAY;IAC5D,MAAM,WAAW,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAE3D,KAAK,UAAU,cAAc,CAAC,IAAI,EAAE,mCAAmC;QACrE,wBAAwB,CAAC,mCAAmC,CAAC,CAAA;QAC7D,IAAI,CAAC;YACH,yEAAyE;YACzE,wEAAwE;YACxE,kCAAkC;YAClC,OAAO,MAAM,aAAa,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;QAC/C,CAAC;gBAAS,CAAC;YACT,MAAM,kBAAkB,CAAC,YAAY,EAAE,mCAAmC,CAAC,CAAA;QAC7E,CAAC;IACH,CAAC;IAED,0EAA0E;IAC1E,yEAAyE;IACzE,6EAA6E;IAC7E,yEAAyE;IACzE,gBAAgB;IAChB,EAAE;IACF,0EAA0E;IAC1E,8EAA8E;IAC9E,wCAAwC;IACxC,MAAM,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IACjD,MAAM,CAAC,QAAQ,GAAG,cAAc,CAAA;IAEhC,OAAO,MAAM,CAAA;AACf,CAAC"}
|
||||
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../../client/operations/actions/core.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,EACL,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,0BAA0B,CAAA;AAEjC,cAAc;AACd,MAAM,UAAU,YAAY,CAC1B,mBAA2B,EAC3B,YAAuB;IAEvB,MAAM,WAAW,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAE3D,KAAK,UAAU,cAAc,CAAC,IAAI,EAAE,mCAAmC;QACrE,wBAAwB,CAAC,mCAAmC,CAAC,CAAA;QAC7D,IAAI,CAAC;YACH,yEAAyE;YACzE,wEAAwE;YACxE,kCAAkC;YAClC,OAAO,MAAM,aAAa,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;QAC/C,CAAC;gBAAS,CAAC;YACT,MAAM,kBAAkB,CAAC,YAAY,EAAE,mCAAmC,CAAC,CAAA;QAC7E,CAAC;IACH,CAAC;IAED,0EAA0E;IAC1E,yEAAyE;IACzE,6EAA6E;IAC7E,yEAAyE;IACzE,gBAAgB;IAChB,EAAE;IACF,0EAA0E;IAC1E,8EAA8E;IAC9E,wCAAwC;IACxC,MAAM,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IACjD,MAAM,CAAC,QAAQ,GAAG,cAAc,CAAA;IAEhC,OAAO,MAAkC,CAAA;AAC3C,CAAC"}
|
@ -1,9 +1,7 @@
|
||||
import { HttpMethod } from 'wasp/client';
|
||||
export type OperationRoute = {
|
||||
method: HttpMethod;
|
||||
method: HttpMethod.Post;
|
||||
path: string;
|
||||
};
|
||||
export declare function callOperation(operationRoute: OperationRoute & {
|
||||
method: HttpMethod.Post;
|
||||
}, args: any): Promise<unknown>;
|
||||
export declare function callOperation(operationRoute: OperationRoute, args: any): Promise<unknown>;
|
||||
export declare function makeOperationRoute(relativeOperationRoute: string): OperationRoute;
|
||||
|
@ -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,IAA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O,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"}
|
@ -1,6 +1,12 @@
|
||||
export function createQuery(relativeQueryPath: any, entitiesUsed: any): (queryKey: any, queryArgs: any) => Promise<any>;
|
||||
export function addMetadataToQuery(query: any, { relativeQueryPath, queryRoute, entitiesUsed }: {
|
||||
relativeQueryPath: any;
|
||||
queryRoute: any;
|
||||
entitiesUsed: any;
|
||||
import { Route } from 'wasp/client';
|
||||
import type { _Awaited, _ReturnType } from 'wasp/universal/types';
|
||||
import { type Query } from '../core.js';
|
||||
export declare function createQuery<BackendQuery extends GenericBackendQuery>(relativeQueryPath: string, entitiesUsed: string[]): QueryFor<BackendQuery>;
|
||||
export declare function addMetadataToQuery(query: (...args: any[]) => Promise<unknown>, metadata: {
|
||||
relativeQueryPath: string;
|
||||
queryRoute: Route;
|
||||
entitiesUsed: string[];
|
||||
}): void;
|
||||
export type QueryFor<BackendQuery extends GenericBackendQuery> = Query<Parameters<BackendQuery>[0], _Awaited<_ReturnType<BackendQuery>>>;
|
||||
type GenericBackendQuery = (args: never, context: any) => unknown;
|
||||
export {};
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { callOperation, makeOperationRoute } from '../internal/index.js';
|
||||
import { addResourcesUsedByQuery, getActiveOptimisticUpdates, } from '../internal/resources';
|
||||
// PRIVATE API
|
||||
export function createQuery(relativeQueryPath, entitiesUsed) {
|
||||
const queryRoute = makeOperationRoute(relativeQueryPath);
|
||||
async function query(queryKey, queryArgs) {
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../../client/operations/queries/core.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,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A;IAExD,KAAK,UAAU,KAAK,CAAC,QAAQ,EAAE,SAAS;QACtC,MAAM,YAAY,GAAG,MAAM,aAAa,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;QAC/D,OAAO,0BAA0B,CAAC,QAAQ,CAAC,CAAC,MAAM,CAChD,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAClC,YAAY,CACb,CAAA;IACH,CAAC;IAED,kBAAkB,CAAC,KAAK,EAAE,EAAE,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC,CAAA;IAE1E,OAAO,KAAK,CAAA;AACd,CAAC;AAYD,cAAc;AACd,MAAM,UAAU,kBAAkB,CAChC,KAAK,EACL,EAAE,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAE;IAE/C,KAAK,CAAC,aAAa,GAAG,CAAC,iBAAiB,CAAC,CAAA;IACzC,KAAK,CAAC,KAAK,GAAG,UAAU,CAAA;IACxB,uBAAuB,CAAC,KAAK,CAAC,aAAa,EAAE,YAAY,CAAC,CAAA;AAC5D,CAAC"}
|
@ -4,5 +4,5 @@ type RouterLinkProps = Parameters<typeof RouterLink>[0];
|
||||
export declare function Link({ to, params, search, hash, ...restOfProps }: Omit<RouterLinkProps, "to"> & {
|
||||
search?: Record<string, string>;
|
||||
hash?: string;
|
||||
} & Routes): import("react").JSX.Element;
|
||||
} & Routes): React.JSX.Element;
|
||||
export {};
|
||||
|
@ -1,11 +1,11 @@
|
||||
import axios, { type AxiosError } from 'axios'
|
||||
import axios, { type AxiosInstance, type AxiosError } from 'axios'
|
||||
|
||||
import { config } from 'wasp/client'
|
||||
import { storage } from 'wasp/core/storage'
|
||||
import { apiEventsEmitter } from './events.js'
|
||||
|
||||
// PUBLIC API
|
||||
export const api = axios.create({
|
||||
export const api: AxiosInstance = axios.create({
|
||||
baseURL: config.apiUrl,
|
||||
})
|
||||
|
||||
|
@ -2,8 +2,12 @@ import { stripTrailingSlash } from 'wasp/universal/url'
|
||||
|
||||
const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001';
|
||||
|
||||
const config = {
|
||||
// PUBLIC API
|
||||
export type ClientConfig = {
|
||||
apiUrl: string,
|
||||
}
|
||||
|
||||
// PUBLIC API
|
||||
export const config: ClientConfig = {
|
||||
apiUrl,
|
||||
}
|
||||
|
||||
export default config
|
@ -11,4 +11,4 @@ export enum HttpMethod {
|
||||
export type Route = { method: HttpMethod; path: string }
|
||||
|
||||
// PUBLIC API
|
||||
export { default as config } from './config'
|
||||
export { config, ClientConfig } from './config'
|
||||
|
@ -1,14 +0,0 @@
|
||||
import { type Action } from '../core.js'
|
||||
import type { Expand, _Awaited, _ReturnType } from 'wasp/universal/types'
|
||||
|
||||
// PRIVATE API
|
||||
export function createAction<BackendAction extends GenericBackendAction>(
|
||||
actionRoute: string,
|
||||
entitiesUsed: unknown[]
|
||||
): ActionFor<BackendAction>
|
||||
|
||||
type ActionFor<BackendAction extends GenericBackendAction> = Expand<
|
||||
Action<Parameters<BackendAction>[0], _Awaited<_ReturnType<BackendAction>>>
|
||||
>
|
||||
|
||||
type GenericBackendAction = (args: never, context: any) => unknown
|
@ -1,3 +1,5 @@
|
||||
import type { Expand, _Awaited, _ReturnType } from 'wasp/universal/types'
|
||||
import { type Action } from '../core.js'
|
||||
import { callOperation, makeOperationRoute } from '../internal/index.js'
|
||||
import {
|
||||
registerActionInProgress,
|
||||
@ -5,7 +7,10 @@ import {
|
||||
} from '../internal/resources.js'
|
||||
|
||||
// PRIVATE API
|
||||
export function createAction(relativeActionRoute, entitiesUsed) {
|
||||
export function createAction<BackendAction extends GenericBackendAction>(
|
||||
relativeActionRoute: string,
|
||||
entitiesUsed: unknown[]
|
||||
): ActionFor<BackendAction> {
|
||||
const actionRoute = makeOperationRoute(relativeActionRoute)
|
||||
|
||||
async function internalAction(args, specificOptimisticUpdateDefinitions) {
|
||||
@ -32,5 +37,12 @@ export function createAction(relativeActionRoute, entitiesUsed) {
|
||||
const action = (args) => internalAction(args, [])
|
||||
action.internal = internalAction
|
||||
|
||||
return action
|
||||
return action as ActionFor<BackendAction>
|
||||
}
|
||||
|
||||
// PRIVATE API
|
||||
export type ActionFor<BackendAction extends GenericBackendAction> =
|
||||
Action<Parameters<BackendAction>[0], _Awaited<_ReturnType<BackendAction>>>
|
||||
|
||||
|
||||
type GenericBackendAction = (args: never, context: any) => unknown
|
@ -1 +1 @@
|
||||
import { createAction } from './core'
|
||||
import { type ActionFor, createAction } from './core'
|
||||
|
@ -6,10 +6,10 @@ import {
|
||||
} from 'superjson'
|
||||
|
||||
// PRIVATE API
|
||||
export type OperationRoute = { method: HttpMethod, path: string }
|
||||
export type OperationRoute = { method: HttpMethod.Post, path: string }
|
||||
|
||||
// PRIVATE API
|
||||
export async function callOperation(operationRoute: OperationRoute & { method: HttpMethod.Post }, args: any) {
|
||||
export async function callOperation(operationRoute: OperationRoute, args: any) {
|
||||
try {
|
||||
const superjsonArgs = superjsonSerialize(args)
|
||||
const response = await api.post(operationRoute.path, superjsonArgs)
|
||||
|
@ -1,25 +0,0 @@
|
||||
import { type Query } from '../core.js'
|
||||
import { Route } from 'wasp/client'
|
||||
import type { Expand, _Awaited, _ReturnType } from 'wasp/universal/types'
|
||||
|
||||
// PRIVATE API
|
||||
export function createQuery<BackendQuery extends GenericBackendQuery>(
|
||||
queryRoute: string,
|
||||
entitiesUsed: any[]
|
||||
): QueryFor<BackendQuery>
|
||||
|
||||
// PRIVATE API
|
||||
export function addMetadataToQuery(
|
||||
query: (...args: any[]) => Promise<unknown>,
|
||||
metadata: {
|
||||
relativeQueryPath: string
|
||||
queryRoute: Route
|
||||
entitiesUsed: string[]
|
||||
}
|
||||
): void
|
||||
|
||||
type QueryFor<BackendQuery extends GenericBackendQuery> = Expand<
|
||||
Query<Parameters<BackendQuery>[0], _Awaited<_ReturnType<BackendQuery>>>
|
||||
>
|
||||
|
||||
type GenericBackendQuery = (args: never, context: any) => unknown
|
@ -1,11 +1,16 @@
|
||||
import { Route } from 'wasp/client'
|
||||
import type { Expand, _Awaited, _ReturnType } from 'wasp/universal/types'
|
||||
import { type Query } from '../core.js'
|
||||
import { callOperation, makeOperationRoute } from '../internal/index.js'
|
||||
import {
|
||||
addResourcesUsedByQuery,
|
||||
getActiveOptimisticUpdates,
|
||||
} from '../internal/resources'
|
||||
|
||||
// PRIVATE API
|
||||
export function createQuery(relativeQueryPath, entitiesUsed) {
|
||||
export function createQuery<BackendQuery extends GenericBackendQuery>(
|
||||
relativeQueryPath: string,
|
||||
entitiesUsed: string[]
|
||||
): QueryFor<BackendQuery> {
|
||||
const queryRoute = makeOperationRoute(relativeQueryPath)
|
||||
|
||||
async function query(queryKey, queryArgs) {
|
||||
@ -21,6 +26,16 @@ export function createQuery(relativeQueryPath, entitiesUsed) {
|
||||
return query
|
||||
}
|
||||
|
||||
// PRIVATE API
|
||||
export function addMetadataToQuery(
|
||||
query: (...args: any[]) => Promise<unknown>,
|
||||
metadata: {
|
||||
relativeQueryPath: string
|
||||
queryRoute: Route
|
||||
entitiesUsed: string[]
|
||||
}
|
||||
): void
|
||||
|
||||
// PRIVATE API
|
||||
export function addMetadataToQuery(
|
||||
query,
|
||||
@ -30,3 +45,9 @@ export function addMetadataToQuery(
|
||||
query.route = queryRoute
|
||||
addResourcesUsedByQuery(query.queryCacheKey, entitiesUsed)
|
||||
}
|
||||
|
||||
export type QueryFor<BackendQuery extends GenericBackendQuery> =
|
||||
Query<Parameters<BackendQuery>[0], _Awaited<_ReturnType<BackendQuery>>>
|
||||
|
||||
|
||||
type GenericBackendQuery = (args: never, context: any) => unknown
|
@ -1,4 +1,4 @@
|
||||
import { createQuery } from './core'
|
||||
import { type QueryFor, createQuery } from './core'
|
||||
|
||||
// PRIVATE API
|
||||
export { addMetadataToQuery } from './core'
|
||||
|
@ -13,7 +13,7 @@ export function Link(
|
||||
hash?: string;
|
||||
}
|
||||
& Routes
|
||||
) {
|
||||
): React.JSX.Element {
|
||||
const toPropWithParams = useMemo(() => {
|
||||
return interpolatePath(to, params, search, hash)
|
||||
}, [to, params])
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { type AxiosError } from 'axios';
|
||||
export declare const api: import("axios").AxiosInstance;
|
||||
import { type AxiosInstance, type AxiosError } from 'axios';
|
||||
export declare const api: AxiosInstance;
|
||||
export declare function setSessionId(sessionId: string): void;
|
||||
export declare function getSessionId(): string | undefined;
|
||||
export declare function clearSessionId(): void;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAA;AAE9C,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,GAAG,KAAK,CAAC,MAAM,CAAC;IAC9B,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,I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M,CAAC;QACN,4CAA4C;QAC5C,MAAM,KAAK,CAAA;IACb,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"}
|
@ -1,4 +1,4 @@
|
||||
declare const config: {
|
||||
export type ClientConfig = {
|
||||
apiUrl: string;
|
||||
};
|
||||
export default config;
|
||||
export declare const config: ClientConfig;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { stripTrailingSlash } from 'wasp/universal/url';
|
||||
const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001';
|
||||
const config = {
|
||||
// PUBLIC API
|
||||
export const config = {
|
||||
apiUrl,
|
||||
};
|
||||
export default config;
|
||||
//# sourceMappingURL=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;AAEhG,MAAM,MAAM,GAAG;IACb,MAAM;CACP,CAAA;AAED,eAAe,MAAM,CAAA"}
|
||||
{"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"}
|
@ -8,4 +8,4 @@ export type Route = {
|
||||
method: HttpMethod;
|
||||
path: string;
|
||||
};
|
||||
export { default as config } from './config';
|
||||
export { config, ClientConfig } from './config';
|
||||
|
@ -8,5 +8,5 @@ export var HttpMethod;
|
||||
HttpMethod["Delete"] = "DELETE";
|
||||
})(HttpMethod || (HttpMethod = {}));
|
||||
// PUBLIC API
|
||||
export { default as config } from './config';
|
||||
export { config } from './config';
|
||||
//# sourceMappingURL=index.js.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,mFAAmF;AACnF,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;AAClB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAKD,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAA"}
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,mFAAmF;AACnF,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;AAClB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAKD,aAAa;AACb,OAAO,EAAE,MAAM,EAAgB,MAAM,UAAU,CAAA"}
|
@ -1,4 +1,6 @@
|
||||
export function createAction(relativeActionRoute: any, entitiesUsed: any): {
|
||||
(args: any): Promise<unknown>;
|
||||
internal: (args: any, specificOptimisticUpdateDefinitions: any) => Promise<unknown>;
|
||||
};
|
||||
import type { _Awaited, _ReturnType } from 'wasp/universal/types';
|
||||
import { type Action } from '../core.js';
|
||||
export declare function createAction<BackendAction extends GenericBackendAction>(relativeActionRoute: string, entitiesUsed: unknown[]): ActionFor<BackendAction>;
|
||||
export type ActionFor<BackendAction extends GenericBackendAction> = Action<Parameters<BackendAction>[0], _Awaited<_ReturnType<BackendAction>>>;
|
||||
type GenericBackendAction = (args: never, context: any) => unknown;
|
||||
export {};
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../../client/operations/actions/core.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,EACL,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,0BAA0B,CAAA;AAEjC,cAAc;AACd,MAAM,UAAU,YAAY,CAAC,mBAAmB,EAAE,YAAY;IAC5D,MAAM,WAAW,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAE3D,KAAK,UAAU,cAAc,CAAC,IAAI,EAAE,mCAAmC;QACrE,wBAAwB,CAAC,mCAAmC,CAAC,CAAA;QAC7D,IAAI,CAAC;YACH,yEAAyE;YACzE,wEAAwE;YACxE,kCAAkC;YAClC,OAAO,MAAM,aAAa,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;QAC/C,CAAC;gBAAS,CAAC;YACT,MAAM,kBAAkB,CAAC,YAAY,EAAE,mCAAmC,CAAC,CAAA;QAC7E,CAAC;IACH,CAAC;IAED,0EAA0E;IAC1E,yEAAyE;IACzE,6EAA6E;IAC7E,yEAAyE;IACzE,gBAAgB;IAChB,EAAE;IACF,0EAA0E;IAC1E,8EAA8E;IAC9E,wCAAwC;IACxC,MAAM,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IACjD,MAAM,CAAC,QAAQ,GAAG,cAAc,CAAA;IAEhC,OAAO,MAAM,CAAA;AACf,CAAC"}
|
||||
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../../client/operations/actions/core.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,EACL,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,0BAA0B,CAAA;AAEjC,cAAc;AACd,MAAM,UAAU,YAAY,CAC1B,mBAA2B,EAC3B,YAAuB;IAEvB,MAAM,WAAW,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,CAAA;IAE3D,KAAK,UAAU,cAAc,CAAC,IAAI,EAAE,mCAAmC;QACrE,wBAAwB,CAAC,mCAAmC,CAAC,CAAA;QAC7D,IAAI,CAAC;YACH,yEAAyE;YACzE,wEAAwE;YACxE,kCAAkC;YAClC,OAAO,MAAM,aAAa,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;QAC/C,CAAC;gBAAS,CAAC;YACT,MAAM,kBAAkB,CAAC,YAAY,EAAE,mCAAmC,CAAC,CAAA;QAC7E,CAAC;IACH,CAAC;IAED,0EAA0E;IAC1E,yEAAyE;IACzE,6EAA6E;IAC7E,yEAAyE;IACzE,gBAAgB;IAChB,EAAE;IACF,0EAA0E;IAC1E,8EAA8E;IAC9E,wCAAwC;IACxC,MAAM,MAAM,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IACjD,MAAM,CAAC,QAAQ,GAAG,cAAc,CAAA;IAEhC,OAAO,MAAkC,CAAA;AAC3C,CAAC"}
|
@ -1,9 +1,7 @@
|
||||
import { HttpMethod } from 'wasp/client';
|
||||
export type OperationRoute = {
|
||||
method: HttpMethod;
|
||||
method: HttpMethod.Post;
|
||||
path: string;
|
||||
};
|
||||
export declare function callOperation(operationRoute: OperationRoute & {
|
||||
method: HttpMethod.Post;
|
||||
}, args: any): Promise<unknown>;
|
||||
export declare function callOperation(operationRoute: OperationRoute, args: any): Promise<unknown>;
|
||||
export declare function makeOperationRoute(relativeOperationRoute: string): OperationRoute;
|
||||
|
@ -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,cAA4D,EAAE,IAAS;IACzG,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"}
|
||||
{"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"}
|
@ -1,6 +1,12 @@
|
||||
export function createQuery(relativeQueryPath: any, entitiesUsed: any): (queryKey: any, queryArgs: any) => Promise<any>;
|
||||
export function addMetadataToQuery(query: any, { relativeQueryPath, queryRoute, entitiesUsed }: {
|
||||
relativeQueryPath: any;
|
||||
queryRoute: any;
|
||||
entitiesUsed: any;
|
||||
import { Route } from 'wasp/client';
|
||||
import type { _Awaited, _ReturnType } from 'wasp/universal/types';
|
||||
import { type Query } from '../core.js';
|
||||
export declare function createQuery<BackendQuery extends GenericBackendQuery>(relativeQueryPath: string, entitiesUsed: string[]): QueryFor<BackendQuery>;
|
||||
export declare function addMetadataToQuery(query: (...args: any[]) => Promise<unknown>, metadata: {
|
||||
relativeQueryPath: string;
|
||||
queryRoute: Route;
|
||||
entitiesUsed: string[];
|
||||
}): void;
|
||||
export type QueryFor<BackendQuery extends GenericBackendQuery> = Query<Parameters<BackendQuery>[0], _Awaited<_ReturnType<BackendQuery>>>;
|
||||
type GenericBackendQuery = (args: never, context: any) => unknown;
|
||||
export {};
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { callOperation, makeOperationRoute } from '../internal/index.js';
|
||||
import { addResourcesUsedByQuery, getActiveOptimisticUpdates, } from '../internal/resources';
|
||||
// PRIVATE API
|
||||
export function createQuery(relativeQueryPath, entitiesUsed) {
|
||||
const queryRoute = makeOperationRoute(relativeQueryPath);
|
||||
async function query(queryKey, queryArgs) {
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../../client/operations/queries/core.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,EACL,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAA;AAE9B,cAAc;AACd,MAAM,UAAU,WAAW,CAAC,iBAAiB,EAAE,YAAY;IACzD,MAAM,UAAU,GAAG,kBAAkB,CAAC,iBAAiB,CAAC,CAAA;IAExD,KAAK,UAAU,KAAK,CAAC,QAAQ,EAAE,SAAS;QACtC,MAAM,YAAY,GAAG,MAAM,aAAa,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;QAC/D,OAAO,0BAA0B,CAAC,QAAQ,CAAC,CAAC,MAAM,CAChD,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAClC,YAAY,CACb,CAAA;IACH,CAAC;IAED,kBAAkB,CAAC,KAAK,EAAE,EAAE,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC,CAAA;IAE1E,OAAO,KAAK,CAAA;AACd,CAAC;AAED,cAAc;AACd,MAAM,UAAU,kBAAkB,CAChC,KAAK,EACL,EAAE,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAE;IAE/C,KAAK,CAAC,aAAa,GAAG,CAAC,iBAAiB,CAAC,CAAA;IACzC,KAAK,CAAC,KAAK,GAAG,UAAU,CAAA;IACxB,uBAAuB,CAAC,KAAK,CAAC,aAAa,EAAE,YAAY,CAAC,CAAA;AAC5D,CAAC"}
|
||||
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../../client/operations/queries/core.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,EACL,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAA;AAE9B,MAAM,UAAU,WAAW,CACzB,iBAAyB,EACzB,YAAsB;IAEtB,MAAM,UAAU,GAAG,kBAAkB,CAAC,iBAAiB,CAAC,CAAA;IAExD,KAAK,UAAU,KAAK,CAAC,QAAQ,EAAE,SAAS;QACtC,MAAM,YAAY,GAAG,MAAM,aAAa,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;QAC/D,OAAO,0BAA0B,CAAC,QAAQ,CAAC,CAAC,MAAM,CAChD,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAClC,YAAY,CACb,CAAA;IACH,CAAC;IAED,kBAAkB,CAAC,KAAK,EAAE,EAAE,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC,CAAA;IAE1E,OAAO,KAAK,CAAA;AACd,CAAC;AAYD,cAAc;AACd,MAAM,UAAU,kBAAkB,CAChC,KAAK,EACL,EAAE,iBAAiB,EAAE,UAAU,EAAE,YAAY,EAAE;IAE/C,KAAK,CAAC,aAAa,GAAG,CAAC,iBAAiB,CAAC,CAAA;IACzC,KAAK,CAAC,KAAK,GAAG,UAAU,CAAA;IACxB,uBAAuB,CAAC,KAAK,CAAC,aAAa,EAAE,YAAY,CAAC,CAAA;AAC5D,CAAC"}
|
@ -4,5 +4,5 @@ type RouterLinkProps = Parameters<typeof RouterLink>[0];
|
||||
export declare function Link({ to, params, search, hash, ...restOfProps }: Omit<RouterLinkProps, "to"> & {
|
||||
search?: Record<string, string>;
|
||||
hash?: string;
|
||||
} & Routes): import("react").JSX.Element;
|
||||
} & Routes): React.JSX.Element;
|
||||
export {};
|
||||
|
@ -7,16 +7,14 @@ waspCompile/.wasp/out/sdk/wasp/api/events.ts
|
||||
waspCompile/.wasp/out/sdk/wasp/api/index.ts
|
||||
waspCompile/.wasp/out/sdk/wasp/client/config.ts
|
||||
waspCompile/.wasp/out/sdk/wasp/client/index.ts
|
||||
waspCompile/.wasp/out/sdk/wasp/client/operations/actions/core.d.ts
|
||||
waspCompile/.wasp/out/sdk/wasp/client/operations/actions/core.js
|
||||
waspCompile/.wasp/out/sdk/wasp/client/operations/actions/core.ts
|
||||
waspCompile/.wasp/out/sdk/wasp/client/operations/actions/index.ts
|
||||
waspCompile/.wasp/out/sdk/wasp/client/operations/core.ts
|
||||
waspCompile/.wasp/out/sdk/wasp/client/operations/index.ts
|
||||
waspCompile/.wasp/out/sdk/wasp/client/operations/internal/index.ts
|
||||
waspCompile/.wasp/out/sdk/wasp/client/operations/internal/resources.js
|
||||
waspCompile/.wasp/out/sdk/wasp/client/operations/internal/updateHandlersMap.js
|
||||
waspCompile/.wasp/out/sdk/wasp/client/operations/queries/core.d.ts
|
||||
waspCompile/.wasp/out/sdk/wasp/client/operations/queries/core.js
|
||||
waspCompile/.wasp/out/sdk/wasp/client/operations/queries/core.ts
|
||||
waspCompile/.wasp/out/sdk/wasp/client/operations/queries/index.ts
|
||||
waspCompile/.wasp/out/sdk/wasp/client/operations/queryClient.ts
|
||||
waspCompile/.wasp/out/sdk/wasp/client/router/Link.tsx
|
||||
|
@ -11,42 +11,35 @@
|
||||
"file",
|
||||
"../out/sdk/wasp/api/index.ts"
|
||||
],
|
||||
"b33b86f9a24e947243d7c64e8adffb72a42fde853af0d29641429d4697d040b2"
|
||||
"5784ba365e8a5cb2031571cfebf1cbae8670f86f8e5a596b133d333cdf6c91eb"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/config.ts"
|
||||
],
|
||||
"68141be8527e8ae3d15838663769737278a71d3853b1dbdc48696e92d4e42548"
|
||||
"bc7d48bd7ec4cdf74f85b98113eb26e670ef265ca4bbd735e361409c9335ad85"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/index.ts"
|
||||
],
|
||||
"7a9f44a82a8b15b177fda593c7ddefcef0dadb7c52648c4e934ca76333c589a6"
|
||||
"2b3651e7040a63cfd6a271c2aa89f21cf01170e0abeb6c5ab74adde324852fe4"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/operations/actions/core.d.ts"
|
||||
"../out/sdk/wasp/client/operations/actions/core.ts"
|
||||
],
|
||||
"676855c039620769cc6ac728149d263c438024e5888ea0afd7f575507a95682a"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/operations/actions/core.js"
|
||||
],
|
||||
"620a4aefbab701dd47b8bf21a07fc4e081ae1fd297261c5af7a05f21f558dff1"
|
||||
"016623c0ebdc1b88d746fa1345015b3cb9653429abdc13a9147a952bff83a927"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/operations/actions/index.ts"
|
||||
],
|
||||
"cada58ebdd19f239b97a4cc6bfc1d37b855022629457ddb0c03ff9317aa8e8f0"
|
||||
"246823e2446114189c40bb85795a8ebd0c5eb1badcba540c13fff3b161eac3f4"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -67,7 +60,7 @@
|
||||
"file",
|
||||
"../out/sdk/wasp/client/operations/internal/index.ts"
|
||||
],
|
||||
"0cd5c744f0d883d48a6c1ddf8eacbe48059e123e79c5f39fad2d17073b6c9f9e"
|
||||
"f08a4f1fb1f897edca465b3f228215e06418109fb439232e8fa0ffdbdc98b833"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -86,23 +79,16 @@
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/operations/queries/core.d.ts"
|
||||
"../out/sdk/wasp/client/operations/queries/core.ts"
|
||||
],
|
||||
"8ca19541652926772e2a7c5d88b5497b7760e98bc9d19c9a217bd03d83cec97d"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/operations/queries/core.js"
|
||||
],
|
||||
"34425abc901cd6294ca902df6b0c080aeafe2b3abf5b539c5e622020601f838e"
|
||||
"5f30328d93582f9c8444720e99f45c19c8647f052b7fbcf5f71b578b9241ac96"
|
||||
],
|
||||
[
|
||||
[
|
||||
"file",
|
||||
"../out/sdk/wasp/client/operations/queries/index.ts"
|
||||
],
|
||||
"9d188907e5a3175e1bdada1c242ee4741eb866598d06d9d71d73a01e7a9a8ba2"
|
||||
"882410504b909cc421d50a27c39952f664ba3457438ce746a95d9cab3431944c"
|
||||
],
|
||||
[
|
||||
[
|
||||
@ -116,7 +102,7 @@
|
||||
"file",
|
||||
"../out/sdk/wasp/client/router/Link.tsx"
|
||||
],
|
||||
"80db39a38f50833f8c965bfd7758da990083db60a6f2f8e394353eed5f981cc9"
|
||||
"66aebac1ceb458f661b4e24085c321e0764663ada56843261640a230718bb29d"
|
||||
],
|
||||
[
|
||||
[
|
||||
|
@ -1,11 +1,11 @@
|
||||
import axios, { type AxiosError } from 'axios'
|
||||
import axios, { type AxiosInstance, type AxiosError } from 'axios'
|
||||
|
||||
import { config } from 'wasp/client'
|
||||
import { storage } from 'wasp/core/storage'
|
||||
import { apiEventsEmitter } from './events.js'
|
||||
|
||||
// PUBLIC API
|
||||
export const api = axios.create({
|
||||
export const api: AxiosInstance = axios.create({
|
||||
baseURL: config.apiUrl,
|
||||
})
|
||||
|
||||
|
@ -2,8 +2,12 @@ import { stripTrailingSlash } from 'wasp/universal/url'
|
||||
|
||||
const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001';
|
||||
|
||||
const config = {
|
||||
// PUBLIC API
|
||||
export type ClientConfig = {
|
||||
apiUrl: string,
|
||||
}
|
||||
|
||||
// PUBLIC API
|
||||
export const config: ClientConfig = {
|
||||
apiUrl,
|
||||
}
|
||||
|
||||
export default config
|
@ -11,4 +11,4 @@ export enum HttpMethod {
|
||||
export type Route = { method: HttpMethod; path: string }
|
||||
|
||||
// PUBLIC API
|
||||
export { default as config } from './config'
|
||||
export { config, ClientConfig } from './config'
|
||||
|
@ -1,14 +0,0 @@
|
||||
import { type Action } from '../core.js'
|
||||
import type { Expand, _Awaited, _ReturnType } from 'wasp/universal/types'
|
||||
|
||||
// PRIVATE API
|
||||
export function createAction<BackendAction extends GenericBackendAction>(
|
||||
actionRoute: string,
|
||||
entitiesUsed: unknown[]
|
||||
): ActionFor<BackendAction>
|
||||
|
||||
type ActionFor<BackendAction extends GenericBackendAction> = Expand<
|
||||
Action<Parameters<BackendAction>[0], _Awaited<_ReturnType<BackendAction>>>
|
||||
>
|
||||
|
||||
type GenericBackendAction = (args: never, context: any) => unknown
|
@ -1,3 +1,5 @@
|
||||
import type { Expand, _Awaited, _ReturnType } from 'wasp/universal/types'
|
||||
import { type Action } from '../core.js'
|
||||
import { callOperation, makeOperationRoute } from '../internal/index.js'
|
||||
import {
|
||||
registerActionInProgress,
|
||||
@ -5,7 +7,10 @@ import {
|
||||
} from '../internal/resources.js'
|
||||
|
||||
// PRIVATE API
|
||||
export function createAction(relativeActionRoute, entitiesUsed) {
|
||||
export function createAction<BackendAction extends GenericBackendAction>(
|
||||
relativeActionRoute: string,
|
||||
entitiesUsed: unknown[]
|
||||
): ActionFor<BackendAction> {
|
||||
const actionRoute = makeOperationRoute(relativeActionRoute)
|
||||
|
||||
async function internalAction(args, specificOptimisticUpdateDefinitions) {
|
||||
@ -32,5 +37,12 @@ export function createAction(relativeActionRoute, entitiesUsed) {
|
||||
const action = (args) => internalAction(args, [])
|
||||
action.internal = internalAction
|
||||
|
||||
return action
|
||||
return action as ActionFor<BackendAction>
|
||||
}
|
||||
|
||||
// PRIVATE API
|
||||
export type ActionFor<BackendAction extends GenericBackendAction> =
|
||||
Action<Parameters<BackendAction>[0], _Awaited<_ReturnType<BackendAction>>>
|
||||
|
||||
|
||||
type GenericBackendAction = (args: never, context: any) => unknown
|
@ -1 +1 @@
|
||||
import { createAction } from './core'
|
||||
import { type ActionFor, createAction } from './core'
|
||||
|
@ -6,10 +6,10 @@ import {
|
||||
} from 'superjson'
|
||||
|
||||
// PRIVATE API
|
||||
export type OperationRoute = { method: HttpMethod, path: string }
|
||||
export type OperationRoute = { method: HttpMethod.Post, path: string }
|
||||
|
||||
// PRIVATE API
|
||||
export async function callOperation(operationRoute: OperationRoute & { method: HttpMethod.Post }, args: any) {
|
||||
export async function callOperation(operationRoute: OperationRoute, args: any) {
|
||||
try {
|
||||
const superjsonArgs = superjsonSerialize(args)
|
||||
const response = await api.post(operationRoute.path, superjsonArgs)
|
||||
|
@ -1,25 +0,0 @@
|
||||
import { type Query } from '../core.js'
|
||||
import { Route } from 'wasp/client'
|
||||
import type { Expand, _Awaited, _ReturnType } from 'wasp/universal/types'
|
||||
|
||||
// PRIVATE API
|
||||
export function createQuery<BackendQuery extends GenericBackendQuery>(
|
||||
queryRoute: string,
|
||||
entitiesUsed: any[]
|
||||
): QueryFor<BackendQuery>
|
||||
|
||||
// PRIVATE API
|
||||
export function addMetadataToQuery(
|
||||
query: (...args: any[]) => Promise<unknown>,
|
||||
metadata: {
|
||||
relativeQueryPath: string
|
||||
queryRoute: Route
|
||||
entitiesUsed: string[]
|
||||
}
|
||||
): void
|
||||
|
||||
type QueryFor<BackendQuery extends GenericBackendQuery> = Expand<
|
||||
Query<Parameters<BackendQuery>[0], _Awaited<_ReturnType<BackendQuery>>>
|
||||
>
|
||||
|
||||
type GenericBackendQuery = (args: never, context: any) => unknown
|
@ -1,11 +1,16 @@
|
||||
import { Route } from 'wasp/client'
|
||||
import type { Expand, _Awaited, _ReturnType } from 'wasp/universal/types'
|
||||
import { type Query } from '../core.js'
|
||||
import { callOperation, makeOperationRoute } from '../internal/index.js'
|
||||
import {
|
||||
addResourcesUsedByQuery,
|
||||
getActiveOptimisticUpdates,
|
||||
} from '../internal/resources'
|
||||
|
||||
// PRIVATE API
|
||||
export function createQuery(relativeQueryPath, entitiesUsed) {
|
||||
export function createQuery<BackendQuery extends GenericBackendQuery>(
|
||||
relativeQueryPath: string,
|
||||
entitiesUsed: string[]
|
||||
): QueryFor<BackendQuery> {
|
||||
const queryRoute = makeOperationRoute(relativeQueryPath)
|
||||
|
||||
async function query(queryKey, queryArgs) {
|
||||
@ -21,6 +26,16 @@ export function createQuery(relativeQueryPath, entitiesUsed) {
|
||||
return query
|
||||
}
|
||||
|
||||
// PRIVATE API
|
||||
export function addMetadataToQuery(
|
||||
query: (...args: any[]) => Promise<unknown>,
|
||||
metadata: {
|
||||
relativeQueryPath: string
|
||||
queryRoute: Route
|
||||
entitiesUsed: string[]
|
||||
}
|
||||
): void
|
||||
|
||||
// PRIVATE API
|
||||
export function addMetadataToQuery(
|
||||
query,
|
||||
@ -30,3 +45,9 @@ export function addMetadataToQuery(
|
||||
query.route = queryRoute
|
||||
addResourcesUsedByQuery(query.queryCacheKey, entitiesUsed)
|
||||
}
|
||||
|
||||
export type QueryFor<BackendQuery extends GenericBackendQuery> =
|
||||
Query<Parameters<BackendQuery>[0], _Awaited<_ReturnType<BackendQuery>>>
|
||||
|
||||
|
||||
type GenericBackendQuery = (args: never, context: any) => unknown
|
@ -1,4 +1,4 @@
|
||||
import { createQuery } from './core'
|
||||
import { type QueryFor, createQuery } from './core'
|
||||
|
||||
// PRIVATE API
|
||||
export { addMetadataToQuery } from './core'
|
||||
|
@ -13,7 +13,7 @@ export function Link(
|
||||
hash?: string;
|
||||
}
|
||||
& Routes
|
||||
) {
|
||||
): React.JSX.Element {
|
||||
const toPropWithParams = useMemo(() => {
|
||||
return interpolatePath(to, params, search, hash)
|
||||
}, [to, params])
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { type AxiosError } from 'axios';
|
||||
export declare const api: import("axios").AxiosInstance;
|
||||
import { type AxiosInstance, type AxiosError } from 'axios';
|
||||
export declare const api: AxiosInstance;
|
||||
export declare function setSessionId(sessionId: string): void;
|
||||
export declare function getSessionId(): string | undefined;
|
||||
export declare function clearSessionId(): void;
|
||||
|
@ -1 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,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I,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,CAAC,KAAuD;;IACpF,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,MAAM,IAAI,aAAa,CAAC,kBAAkB,EAAE,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,mCAAI,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;IACnG,CAAC;SAAM,CAAC;QACN,4CAA4C;QAC5C,MAAM,KAAK,CAAA;IACb,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"}
|
@ -1,4 +1,4 @@
|
||||
declare const config: {
|
||||
export type ClientConfig = {
|
||||
apiUrl: string;
|
||||
};
|
||||
export default config;
|
||||
export declare const config: ClientConfig;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { stripTrailingSlash } from 'wasp/universal/url';
|
||||
const apiUrl = stripTrailingSlash(import.meta.env.REACT_APP_API_URL) || 'http://localhost:3001';
|
||||
const config = {
|
||||
// PUBLIC API
|
||||
export const config = {
|
||||
apiUrl,
|
||||
};
|
||||
export default config;
|
||||
//# sourceMappingURL=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;AAEhG,MAAM,MAAM,GAAG;IACb,MAAM;CACP,CAAA;AAED,eAAe,MAAM,CAAA"}
|
||||
{"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"}
|
@ -8,4 +8,4 @@ export type Route = {
|
||||
method: HttpMethod;
|
||||
path: string;
|
||||
};
|
||||
export { default as config } from './config';
|
||||
export { config, ClientConfig } from './config';
|
||||
|
@ -8,5 +8,5 @@ export var HttpMethod;
|
||||
HttpMethod["Delete"] = "DELETE";
|
||||
})(HttpMethod || (HttpMethod = {}));
|
||||
// PUBLIC API
|
||||
export { default as config } from './config';
|
||||
export { config } from './config';
|
||||
//# sourceMappingURL=index.js.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,mFAAmF;AACnF,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;AAClB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAKD,aAAa;AACb,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAA"}
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,mFAAmF;AACnF,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACrB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,yBAAW,CAAA;IACX,+BAAiB,CAAA;AAClB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAKD,aAAa;AACb,OAAO,EAAE,MAAM,EAAgB,MAAM,UAAU,CAAA"}
|
@ -1,4 +1,6 @@
|
||||
export function createAction(relativeActionRoute: any, entitiesUsed: any): {
|
||||
(args: any): Promise<unknown>;
|
||||
internal: (args: any, specificOptimisticUpdateDefinitions: any) => Promise<unknown>;
|
||||
};
|
||||
import type { _Awaited, _ReturnType } from 'wasp/universal/types';
|
||||
import { type Action } from '../core.js';
|
||||
export declare function createAction<BackendAction extends GenericBackendAction>(relativeActionRoute: string, entitiesUsed: unknown[]): ActionFor<BackendAction>;
|
||||
export type ActionFor<BackendAction extends GenericBackendAction> = Action<Parameters<BackendAction>[0], _Awaited<_ReturnType<BackendAction>>>;
|
||||
type GenericBackendAction = (args: never, context: any) => unknown;
|
||||
export {};
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user