@farm.js/core 0.1.0-beta.65 → 0.1.0-beta.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/route-manager.cjs +2 -1
- package/dist/api/route-manager.cjs.map +1 -1
- package/dist/api/route-manager.d.mts +6 -2
- package/dist/api/route-manager.d.ts +6 -2
- package/dist/api/route-manager.mjs +1 -1
- package/dist/api.cjs +2 -1
- package/dist/api.cjs.map +1 -1
- package/dist/api.d.mts +1 -1
- package/dist/api.d.ts +1 -1
- package/dist/api.mjs +2 -2
- package/dist/{chunk-R6UV2YLL.mjs → chunk-335JWE6F.mjs} +4 -4
- package/dist/{chunk-R6UV2YLL.mjs.map → chunk-335JWE6F.mjs.map} +1 -1
- package/dist/{chunk-VQYZ6JT6.mjs → chunk-3PO3UK5B.mjs} +2 -2
- package/dist/{chunk-VQYZ6JT6.mjs.map → chunk-3PO3UK5B.mjs.map} +1 -1
- package/dist/{chunk-BYBYZSQ4.mjs → chunk-6HZ23B26.mjs} +2 -2
- package/dist/{chunk-ITSBK56Q.mjs → chunk-BDDLX64F.mjs} +3 -2
- package/dist/chunk-BDDLX64F.mjs.map +1 -0
- package/dist/{chunk-ECLBGYGZ.mjs → chunk-GAPAL2TO.mjs} +2 -2
- package/dist/{chunk-H5D6FDSG.mjs → chunk-HLMU3U7K.mjs} +3 -3
- package/dist/client/lifecycle.mjs +2 -2
- package/dist/client-plugins.cjs +1 -1
- package/dist/client-plugins.cjs.map +1 -1
- package/dist/client-plugins.mjs +2 -2
- package/dist/client.cjs +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.mjs +2 -2
- package/dist/index.cjs +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +6 -6
- package/dist/internal/build-runtime.cjs +4 -3
- package/dist/internal/build-runtime.cjs.map +1 -1
- package/dist/internal/build-runtime.mjs +4 -4
- package/dist/internal/client-runtime.cjs +1 -1
- package/dist/internal/client-runtime.cjs.map +1 -1
- package/dist/internal/client-runtime.mjs +2 -2
- package/dist/plugin.cjs +4 -3
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.mjs +3 -3
- package/dist/server.cjs +4 -3
- package/dist/server.cjs.map +1 -1
- package/dist/server.mjs +3 -3
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.mjs +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +4 -3
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.mjs +3 -3
- package/package.json +1 -1
- package/dist/chunk-ITSBK56Q.mjs.map +0 -1
- /package/dist/{chunk-BYBYZSQ4.mjs.map → chunk-6HZ23B26.mjs.map} +0 -0
- /package/dist/{chunk-ECLBGYGZ.mjs.map → chunk-GAPAL2TO.mjs.map} +0 -0
- /package/dist/{chunk-H5D6FDSG.mjs.map → chunk-HLMU3U7K.mjs.map} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -13,7 +13,7 @@ export { F as FarmIslandStrategy } from './island-CfGru1MO.mjs';
|
|
|
13
13
|
import { ViteDevServer } from 'vite';
|
|
14
14
|
export { createCompressionPlugin, createEnvPlugin, createHeadersPlugin, createLoggerPlugin, createRedirectsPlugin, createRewritesPlugin } from './server-plugins.mjs';
|
|
15
15
|
export { A as APIRouteMatch, c as APIRouteParamValue, b as APIRouteParams, s as AnyEndpointMiddleware, D as DELETE, f as EndpointErrorContracts, d as EndpointErrorDefinition, e as EndpointErrorDefinitions, g as EndpointErrorHandler, E as EndpointErrorSchema, h as EndpointFail, j as EndpointFailure, x as EndpointHandler, u as EndpointInvalidationContext, t as EndpointInvalidationTarget, v as EndpointInvalidations, r as EndpointMiddleware, p as EndpointMiddlewareContext, q as EndpointMiddlewareResult, w as EndpointOptions, l as EndpointParamValue, o as EndpointParams, G as GET, H as HEAD, I as InferEndpointMiddlewareContext, O as OPTIONS, B as PATCH, P as POST, z as PUT, Q as QUERY, T as TypedEndpoint, y as createEndpoint, i as invokeAPIRouteEndpoint, k as isEndpointFailure, a as isWebResponse, m as matchAPIRoute, n as normalizeRouteResponse } from './runtime-CDDYfuNz.mjs';
|
|
16
|
-
export { APIRoute, APIRouteManager, APIRouteManagerOptions, API_ROUTE_METHODS } from './api/route-manager.mjs';
|
|
16
|
+
export { APIRoute, APIRouteHandlerOptions, APIRouteManager, APIRouteManagerOptions, API_ROUTE_METHODS } from './api/route-manager.mjs';
|
|
17
17
|
export { r as APIClient, h as APIClientError, b as APIClientOptions, i as APIClientSystemError, c as APIClientWithoutIntegrationsOptions, g as APIResult, A as APIRouteRefMetadata, C as CacheKey, l as CacheOptions, k as CachePolicy, p as ClientOptions, a as FARM_API_ROUTE_META_SYMBOL, F as FARM_API_ROUTE_REF_SYMBOL, X as InferIntegrationOperationBody, Y as InferIntegrationOperationQuery, Z as InferIntegrationOperationResponse, T as IntegrationAPI, L as IntegrationClient, M as IntegrationClientAliases, V as IntegrationClientData, y as IntegrationClientError, P as IntegrationClientOptions, Q as IntegrationClientRequestOptions, N as IntegrationClientRoot, U as IntegrationClients, W as IntegrationOperationResult, _ as IntegrationServerClient, $ as IntegrationServerClientAliases, a0 as IntegrationServerClientOptions, a1 as IntegrationServerClientRequestOptions, a2 as IntegrationServerClientRoot, a3 as IntegrationServerRequestLike, n as InvalidateOptions, I as InvalidateTarget, o as OptimisticOptions, O as OptimisticUpdate, R as RequestEvent, j as ResponseEvent, m as RetryOptions, q as RouteAPIClient, s as ServerAPIClient, S as ServerAPIClientOptions, d as ServerAPIClientWithoutIntegrationsOptions, f as StatusEvent, e as StatusPhase, t as createAPIClient, z as createIntegrationApi, x as createIntegrationClient, B as createIntegrationClients, E as createIntegrationServerClient, D as createIntegrations, w as createServerAPIClient, v as getAPIRouteRefMetadata, G as getIntegrationAPIManifest, H as integrationClients, J as integrationsClient, K as integrationsServer, u as isAPIRouteRef } from './client-Di1SbJp5.mjs';
|
|
18
18
|
export { F as FarmAPIStream, c as FarmStreamResponse, a as MultipartField, M as MultipartSchema, b as MultipartValues, T as TypedFormData, e as isFarmAPIStream, d as isJSONStreamResponse, i as isMultipartSchema, j as jsonStream, m as multipart, r as readJSONStream, t as toFormData } from './transport-BmbGTXA5.mjs';
|
|
19
19
|
export { ApiRoute, FarmApiPluginOptions, farmApiPlugin } from './api.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export { F as FarmIslandStrategy } from './island-CfGru1MO.js';
|
|
|
13
13
|
import { ViteDevServer } from 'vite';
|
|
14
14
|
export { createCompressionPlugin, createEnvPlugin, createHeadersPlugin, createLoggerPlugin, createRedirectsPlugin, createRewritesPlugin } from './server-plugins.js';
|
|
15
15
|
export { A as APIRouteMatch, c as APIRouteParamValue, b as APIRouteParams, s as AnyEndpointMiddleware, D as DELETE, f as EndpointErrorContracts, d as EndpointErrorDefinition, e as EndpointErrorDefinitions, g as EndpointErrorHandler, E as EndpointErrorSchema, h as EndpointFail, j as EndpointFailure, x as EndpointHandler, u as EndpointInvalidationContext, t as EndpointInvalidationTarget, v as EndpointInvalidations, r as EndpointMiddleware, p as EndpointMiddlewareContext, q as EndpointMiddlewareResult, w as EndpointOptions, l as EndpointParamValue, o as EndpointParams, G as GET, H as HEAD, I as InferEndpointMiddlewareContext, O as OPTIONS, B as PATCH, P as POST, z as PUT, Q as QUERY, T as TypedEndpoint, y as createEndpoint, i as invokeAPIRouteEndpoint, k as isEndpointFailure, a as isWebResponse, m as matchAPIRoute, n as normalizeRouteResponse } from './runtime-BMOVEfom.js';
|
|
16
|
-
export { APIRoute, APIRouteManager, APIRouteManagerOptions, API_ROUTE_METHODS } from './api/route-manager.js';
|
|
16
|
+
export { APIRoute, APIRouteHandlerOptions, APIRouteManager, APIRouteManagerOptions, API_ROUTE_METHODS } from './api/route-manager.js';
|
|
17
17
|
export { r as APIClient, h as APIClientError, b as APIClientOptions, i as APIClientSystemError, c as APIClientWithoutIntegrationsOptions, g as APIResult, A as APIRouteRefMetadata, C as CacheKey, l as CacheOptions, k as CachePolicy, p as ClientOptions, a as FARM_API_ROUTE_META_SYMBOL, F as FARM_API_ROUTE_REF_SYMBOL, X as InferIntegrationOperationBody, Y as InferIntegrationOperationQuery, Z as InferIntegrationOperationResponse, T as IntegrationAPI, L as IntegrationClient, M as IntegrationClientAliases, V as IntegrationClientData, y as IntegrationClientError, P as IntegrationClientOptions, Q as IntegrationClientRequestOptions, N as IntegrationClientRoot, U as IntegrationClients, W as IntegrationOperationResult, _ as IntegrationServerClient, $ as IntegrationServerClientAliases, a0 as IntegrationServerClientOptions, a1 as IntegrationServerClientRequestOptions, a2 as IntegrationServerClientRoot, a3 as IntegrationServerRequestLike, n as InvalidateOptions, I as InvalidateTarget, o as OptimisticOptions, O as OptimisticUpdate, R as RequestEvent, j as ResponseEvent, m as RetryOptions, q as RouteAPIClient, s as ServerAPIClient, S as ServerAPIClientOptions, d as ServerAPIClientWithoutIntegrationsOptions, f as StatusEvent, e as StatusPhase, t as createAPIClient, z as createIntegrationApi, x as createIntegrationClient, B as createIntegrationClients, E as createIntegrationServerClient, D as createIntegrations, w as createServerAPIClient, v as getAPIRouteRefMetadata, G as getIntegrationAPIManifest, H as integrationClients, J as integrationsClient, K as integrationsServer, u as isAPIRouteRef } from './client-C_2pDigc.js';
|
|
18
18
|
export { F as FarmAPIStream, c as FarmStreamResponse, a as MultipartField, M as MultipartSchema, b as MultipartValues, T as TypedFormData, e as isFarmAPIStream, d as isJSONStreamResponse, i as isMultipartSchema, j as jsonStream, m as multipart, r as readJSONStream, t as toFormData } from './transport-BmbGTXA5.js';
|
|
19
19
|
export { ApiRoute, FarmApiPluginOptions, farmApiPlugin } from './api.js';
|
package/dist/index.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-HEOT63FC.mjs";
|
|
10
10
|
import {
|
|
11
11
|
build
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-HLMU3U7K.mjs";
|
|
13
13
|
import "./chunk-SL6HTIOK.mjs";
|
|
14
14
|
import "./chunk-4S3ORGFA.mjs";
|
|
15
15
|
import {
|
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
} from "./chunk-5TLXU6MG.mjs";
|
|
85
85
|
import {
|
|
86
86
|
farmApiPlugin
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-6HZ23B26.mjs";
|
|
88
88
|
import {
|
|
89
89
|
FARM_SERVER_QUERY_SYMBOL,
|
|
90
90
|
createServerQuery
|
|
@@ -208,7 +208,7 @@ import {
|
|
|
208
208
|
createClientPluginManager,
|
|
209
209
|
installChunkErrorRecovery,
|
|
210
210
|
isChunkLoadError
|
|
211
|
-
} from "./chunk-
|
|
211
|
+
} from "./chunk-GAPAL2TO.mjs";
|
|
212
212
|
import {
|
|
213
213
|
analyzeStaticRouteCandidate,
|
|
214
214
|
collectSSGPages,
|
|
@@ -227,7 +227,7 @@ import {
|
|
|
227
227
|
parseRouteRenderingDirective,
|
|
228
228
|
resolveRouteRenderingConfig,
|
|
229
229
|
resolveRouteRenderingConfigFromFile
|
|
230
|
-
} from "./chunk-
|
|
230
|
+
} from "./chunk-335JWE6F.mjs";
|
|
231
231
|
import {
|
|
232
232
|
APITypeGenerator
|
|
233
233
|
} from "./chunk-MD4TKIKU.mjs";
|
|
@@ -425,7 +425,7 @@ import {
|
|
|
425
425
|
import {
|
|
426
426
|
APIRouteManager,
|
|
427
427
|
API_ROUTE_METHODS
|
|
428
|
-
} from "./chunk-
|
|
428
|
+
} from "./chunk-BDDLX64F.mjs";
|
|
429
429
|
import "./chunk-HO33MT4X.mjs";
|
|
430
430
|
import "./chunk-FQYDHKKU.mjs";
|
|
431
431
|
import {
|
|
@@ -569,7 +569,7 @@ import {
|
|
|
569
569
|
runWithFarmSpan
|
|
570
570
|
} from "./chunk-7ZMKVETU.mjs";
|
|
571
571
|
import "./chunk-FXG2PS27.mjs";
|
|
572
|
-
import "./chunk-
|
|
572
|
+
import "./chunk-3PO3UK5B.mjs";
|
|
573
573
|
import {
|
|
574
574
|
createCompressionPlugin,
|
|
575
575
|
createEnvPlugin,
|
|
@@ -15197,7 +15197,7 @@ var init_server3 = __esm({
|
|
|
15197
15197
|
var version;
|
|
15198
15198
|
var init_package = __esm({
|
|
15199
15199
|
"package.json"() {
|
|
15200
|
-
version = "0.1.0-beta.
|
|
15200
|
+
version = "0.1.0-beta.67";
|
|
15201
15201
|
}
|
|
15202
15202
|
});
|
|
15203
15203
|
|
|
@@ -18154,7 +18154,7 @@ var init_route_manager2 = __esm({
|
|
|
18154
18154
|
/**
|
|
18155
18155
|
* Get the handler that directly invokes endpoint handlers
|
|
18156
18156
|
*/
|
|
18157
|
-
getHandler() {
|
|
18157
|
+
getHandler(options = {}) {
|
|
18158
18158
|
if (this.routes.size === 0) {
|
|
18159
18159
|
return null;
|
|
18160
18160
|
}
|
|
@@ -18184,6 +18184,7 @@ var init_route_manager2 = __esm({
|
|
|
18184
18184
|
try {
|
|
18185
18185
|
return await invokeAPIRouteEndpoint(endpoint, request, params, this.bodySizeLimit);
|
|
18186
18186
|
} catch (error) {
|
|
18187
|
+
if (options.throwOnError) throw error;
|
|
18187
18188
|
console.error(`[API Error] ${pathname}:`, error);
|
|
18188
18189
|
return new Response(JSON.stringify({ error: "Internal Server Error" }), {
|
|
18189
18190
|
status: 500,
|
|
@@ -27865,7 +27866,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
27865
27866
|
res.end(JSON.stringify({ error: "Internal server error" }));
|
|
27866
27867
|
return;
|
|
27867
27868
|
}
|
|
27868
|
-
const apiHandler = apiRouteManager.getHandler();
|
|
27869
|
+
const apiHandler = apiRouteManager.getHandler({ throwOnError: true });
|
|
27869
27870
|
const hasExplicitAPIRoute = hasMatchedApiRoute || Boolean(apiRouteManager.matchRoute(pathname2));
|
|
27870
27871
|
if (apiHandler && hasExplicitAPIRoute) {
|
|
27871
27872
|
const apiRoutePattern = matchedApiRoute?.route.path || apiRouteManager.matchRoute(pathname2)?.route.path || urlPath2;
|