@farm.js/core 0.1.0-beta.21 → 0.1.0-beta.22
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/after.d.mts +25 -0
- package/dist/after.d.ts +25 -0
- package/dist/agent-runtime.d.mts +96 -0
- package/dist/agent-runtime.d.ts +96 -0
- package/dist/api/route-manager.d.mts +68 -0
- package/dist/api/route-manager.d.ts +68 -0
- package/dist/api/runtime.d.mts +3 -0
- package/dist/api/runtime.d.ts +3 -0
- package/dist/api.cjs +22 -19
- package/dist/api.cjs.map +1 -1
- package/dist/api.d.mts +50 -0
- package/dist/api.d.ts +50 -0
- package/dist/api.mjs +2 -1
- package/dist/app-BB8GCH1g.d.ts +306 -0
- package/dist/app-DwsTpyNZ.d.mts +306 -0
- package/dist/app-markdown.d.mts +24 -0
- package/dist/app-markdown.d.ts +24 -0
- package/dist/cache.d.mts +192 -0
- package/dist/cache.d.ts +192 -0
- package/dist/{chunk-MIUW47JX.mjs → chunk-2PEJGY5V.mjs} +15 -20
- package/dist/chunk-2PEJGY5V.mjs.map +1 -0
- package/dist/{chunk-RIXKJPGI.mjs → chunk-42325TLU.mjs} +2 -2
- package/dist/{chunk-I3UWA2P2.mjs → chunk-DAUR3WUZ.mjs} +2 -2
- package/dist/{chunk-I3UWA2P2.mjs.map → chunk-DAUR3WUZ.mjs.map} +1 -1
- package/dist/chunk-GIELMNBG.mjs +15 -0
- package/dist/chunk-GIELMNBG.mjs.map +1 -0
- package/dist/{chunk-4EATUJFO.mjs → chunk-ICTGDDV4.mjs} +20 -22
- package/dist/chunk-ICTGDDV4.mjs.map +1 -0
- package/dist/{chunk-FKKM7HVF.mjs → chunk-XBKXKJX5.mjs} +30 -35
- package/dist/chunk-XBKXKJX5.mjs.map +1 -0
- package/dist/{chunk-VIC7NJ77.mjs → chunk-ZP73P4VR.mjs} +2 -2
- package/dist/chunk-recovery-lnQFzcQP.d.mts +26 -0
- package/dist/chunk-recovery-lnQFzcQP.d.ts +26 -0
- package/dist/client-BT1mFQas.d.mts +447 -0
- package/dist/client-Nn0q4eO4.d.ts +447 -0
- package/dist/client-cache-CIlyBlmx.d.ts +6 -0
- package/dist/client-cache-D-EZ7XVW.d.mts +6 -0
- package/dist/client-plugins-CbRum1fj.d.ts +2088 -0
- package/dist/client-plugins-QQntVkrv.d.mts +2088 -0
- package/dist/client-plugins.d.mts +24 -0
- package/dist/client-plugins.d.ts +24 -0
- package/dist/client.d.mts +452 -0
- package/dist/client.d.ts +452 -0
- package/dist/config.d.mts +31 -0
- package/dist/config.d.ts +31 -0
- package/dist/cron.d.mts +78 -0
- package/dist/cron.d.ts +78 -0
- package/dist/deferred.d.mts +42 -0
- package/dist/deferred.d.ts +42 -0
- package/dist/deployment.d.mts +36 -0
- package/dist/deployment.d.ts +36 -0
- package/dist/docs.d.mts +80 -0
- package/dist/docs.d.ts +80 -0
- package/dist/env-types.d.mts +12 -0
- package/dist/env-types.d.ts +12 -0
- package/dist/env.d.mts +45 -0
- package/dist/env.d.ts +45 -0
- package/dist/environment/vite.d.mts +22 -0
- package/dist/environment/vite.d.ts +22 -0
- package/dist/environment.d.mts +18 -0
- package/dist/environment.d.ts +18 -0
- package/dist/font.d.mts +95 -0
- package/dist/font.d.ts +95 -0
- package/dist/headers.d.mts +22 -0
- package/dist/headers.d.ts +22 -0
- package/dist/i18n/client.d.mts +32 -0
- package/dist/i18n/client.d.ts +32 -0
- package/dist/i18n/index.d.mts +20 -0
- package/dist/i18n/index.d.ts +20 -0
- package/dist/i18n/server.d.mts +30 -0
- package/dist/i18n/server.d.ts +30 -0
- package/dist/image/server.d.mts +37 -0
- package/dist/image/server.d.ts +37 -0
- package/dist/image/sharp.d.mts +7 -0
- package/dist/image/sharp.d.ts +7 -0
- package/dist/image-config-Duob7wER.d.mts +50 -0
- package/dist/image-config-Duob7wER.d.ts +50 -0
- package/dist/image.d.mts +39 -0
- package/dist/image.d.ts +39 -0
- package/dist/index.cjs +66 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +477 -0
- package/dist/index.d.ts +477 -0
- package/dist/index.mjs +7 -6
- package/dist/index.mjs.map +1 -1
- package/dist/integration-api-CHT2OKAf.d.mts +93 -0
- package/dist/integration-api-CHT2OKAf.d.ts +93 -0
- package/dist/integrations.d.mts +24 -0
- package/dist/integrations.d.ts +24 -0
- package/dist/internal/build-runtime.cjs +50 -50
- package/dist/internal/build-runtime.cjs.map +1 -1
- package/dist/internal/build-runtime.d.mts +41 -0
- package/dist/internal/build-runtime.d.ts +41 -0
- package/dist/internal/build-runtime.mjs +5 -4
- package/dist/internal/client-runtime.d.mts +17 -0
- package/dist/internal/client-runtime.d.ts +17 -0
- package/dist/internal/config-runtime.d.mts +41 -0
- package/dist/internal/config-runtime.d.ts +41 -0
- package/dist/internal/metadata-image-runtime.d.mts +25 -0
- package/dist/internal/metadata-image-runtime.d.ts +25 -0
- package/dist/internal/production-node-env.d.mts +12 -0
- package/dist/internal/production-node-env.d.ts +12 -0
- package/dist/internal/production-runtime.d.mts +66 -0
- package/dist/internal/production-runtime.d.ts +66 -0
- package/dist/island-CfGru1MO.d.mts +9 -0
- package/dist/island-CfGru1MO.d.ts +9 -0
- package/dist/markdown.d.mts +60 -0
- package/dist/markdown.d.ts +60 -0
- package/dist/metadata-B5jBJHq1.d.ts +22 -0
- package/dist/metadata-BxOJ4FJl.d.mts +22 -0
- package/dist/middleware.cjs +17 -17
- package/dist/middleware.cjs.map +1 -1
- package/dist/middleware.d.mts +171 -0
- package/dist/middleware.d.ts +171 -0
- package/dist/middleware.mjs +3 -2
- package/dist/navigation-errors-Dvwpzaer.d.mts +13 -0
- package/dist/navigation-errors-Dvwpzaer.d.ts +13 -0
- package/dist/navigation.d.mts +14 -0
- package/dist/navigation.d.ts +14 -0
- package/dist/observability.d.mts +335 -0
- package/dist/observability.d.ts +335 -0
- package/dist/params-BALtrRim.d.ts +15 -0
- package/dist/params-ry-lxqmy.d.mts +15 -0
- package/dist/plugin-BJDf43dc.d.mts +165 -0
- package/dist/plugin-BJDf43dc.d.ts +165 -0
- package/dist/plugin.cjs +42 -48
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.mts +24 -0
- package/dist/plugin.d.ts +24 -0
- package/dist/plugin.mjs +4 -3
- package/dist/production-runtime-Bxua86uR.d.mts +81 -0
- package/dist/production-runtime-CZqXjRVi.d.ts +81 -0
- package/dist/query/client.d.mts +61 -0
- package/dist/query/client.d.ts +61 -0
- package/dist/query/index.d.mts +90 -0
- package/dist/query/index.d.ts +90 -0
- package/dist/query/parsers.d.mts +25 -0
- package/dist/query/parsers.d.ts +25 -0
- package/dist/query/server.d.mts +55 -0
- package/dist/query/server.d.ts +55 -0
- package/dist/request-7V0GaZK_.d.mts +6 -0
- package/dist/request-B5XYBv5a.d.ts +6 -0
- package/dist/request.d.mts +25 -0
- package/dist/request.d.ts +25 -0
- package/dist/resolver-DJqjLMg_.d.mts +14 -0
- package/dist/resolver-IH4RmPEl.d.ts +14 -0
- package/dist/route-runtime-DoOHzCAD.d.mts +38 -0
- package/dist/route-runtime-DoOHzCAD.d.ts +38 -0
- package/dist/router.d.mts +36 -0
- package/dist/router.d.ts +36 -0
- package/dist/routes.d.mts +226 -0
- package/dist/routes.d.ts +226 -0
- package/dist/runtime-Bpp-c28k.d.ts +231 -0
- package/dist/runtime-Cxpq6xZN.d.mts +27 -0
- package/dist/runtime-Q3u74Nbq.d.mts +231 -0
- package/dist/runtime-bv63eUiO.d.ts +27 -0
- package/dist/server-action-security.d.mts +45 -0
- package/dist/server-action-security.d.ts +45 -0
- package/dist/server-fn-client.d.mts +33 -0
- package/dist/server-fn-client.d.ts +33 -0
- package/dist/server-fn-error-DDh14a0V.d.mts +26 -0
- package/dist/server-fn-error-DDh14a0V.d.ts +26 -0
- package/dist/server-fn.d.mts +121 -0
- package/dist/server-fn.d.ts +121 -0
- package/dist/server-plugins.d.mts +57 -0
- package/dist/server-plugins.d.ts +57 -0
- package/dist/server-query-client.d.mts +51 -0
- package/dist/server-query-client.d.ts +51 -0
- package/dist/server-query.d.mts +37 -0
- package/dist/server-query.d.ts +37 -0
- package/dist/server.cjs +45 -67
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.mts +51 -0
- package/dist/server.d.ts +51 -0
- package/dist/server.mjs +8 -22
- package/dist/server.mjs.map +1 -1
- package/dist/storage.d.mts +52 -0
- package/dist/storage.d.ts +52 -0
- package/dist/testing.d.mts +103 -0
- package/dist/testing.d.ts +103 -0
- package/dist/transport-BmbGTXA5.d.mts +49 -0
- package/dist/transport-BmbGTXA5.d.ts +49 -0
- package/dist/types-BMxWr97v.d.mts +81 -0
- package/dist/types-BMxWr97v.d.ts +81 -0
- package/dist/types-D1A6-XvH.d.mts +73 -0
- package/dist/types-D1A6-XvH.d.ts +73 -0
- package/dist/types-DTzm4TCl.d.mts +78 -0
- package/dist/types-DTzm4TCl.d.ts +78 -0
- package/dist/utils-s9pN0Yep.d.mts +23 -0
- package/dist/utils-xTFxzu47.d.ts +23 -0
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.mts +3 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +44 -50
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.mts +24 -0
- package/dist/vite.d.ts +24 -0
- package/dist/vite.mjs +4 -3
- package/dist/workflows-CusFV6mn.d.mts +153 -0
- package/dist/workflows-CusFV6mn.d.ts +153 -0
- package/dist/workflows.d.mts +1 -0
- package/dist/workflows.d.ts +1 -0
- package/package.json +1 -1
- package/dist/chunk-4EATUJFO.mjs.map +0 -1
- package/dist/chunk-FKKM7HVF.mjs.map +0 -1
- package/dist/chunk-MIUW47JX.mjs.map +0 -1
- /package/dist/{chunk-RIXKJPGI.mjs.map → chunk-42325TLU.mjs.map} +0 -0
- /package/dist/{chunk-VIC7NJ77.mjs.map → chunk-ZP73P4VR.mjs.map} +0 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
type FarmIntegrationAPIMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD";
|
|
2
|
+
type FarmIntegrationAPIBodyFormat = "json" | "form" | "none";
|
|
3
|
+
type FarmIntegrationAPIResponseFormat = "json" | "text" | "response";
|
|
4
|
+
interface FarmIntegrationAPIOperation<TBody = never, TQuery = never, TResponse = unknown, TServer extends boolean = false, TMethod extends FarmIntegrationAPIMethod = FarmIntegrationAPIMethod> {
|
|
5
|
+
readonly kind: "farm-integration-api-operation";
|
|
6
|
+
path: string;
|
|
7
|
+
method: TMethod;
|
|
8
|
+
bodyFormat?: FarmIntegrationAPIBodyFormat;
|
|
9
|
+
responseFormat?: FarmIntegrationAPIResponseFormat;
|
|
10
|
+
headers?: Record<string, string>;
|
|
11
|
+
credentials?: RequestCredentials;
|
|
12
|
+
isServer?: TServer;
|
|
13
|
+
__pathless?: boolean;
|
|
14
|
+
__types?: {
|
|
15
|
+
body: TBody;
|
|
16
|
+
query: TQuery;
|
|
17
|
+
response: TResponse;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
type FarmIntegrationAPI = {
|
|
21
|
+
[key: string]: FarmIntegrationAPI | FarmIntegrationAPIOperation<any, any, any, any, any>;
|
|
22
|
+
};
|
|
23
|
+
type FarmIntegrationRouteOperationCarrier<TPath extends string = string, TOperation extends FarmIntegrationAPIOperation<any, any, any, any, any> = FarmIntegrationAPIOperation<any, any, any, any, any>> = {
|
|
24
|
+
path: TPath;
|
|
25
|
+
__operation: TOperation;
|
|
26
|
+
};
|
|
27
|
+
type IntegrationAPIBuilderOptions<TServer extends boolean = false> = Omit<FarmIntegrationAPIOperation<any, any, any, TServer>, "kind" | "method" | "path" | "__pathless" | "__types">;
|
|
28
|
+
declare function defineIntegrationAPIOperation<TBody = never, TQuery = never, TResponse = unknown, TServer extends boolean = false, TMethod extends FarmIntegrationAPIMethod = FarmIntegrationAPIMethod>(operation: Omit<FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, TMethod>, "kind" | "__types">): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, TMethod>;
|
|
29
|
+
declare function defineIntegrationAPI<TAPI extends FarmIntegrationAPI>(api: TAPI): TAPI;
|
|
30
|
+
declare function get<TResponse = unknown, TServer extends boolean = false>(path: string, options?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<never, never, TResponse, TServer, "GET">;
|
|
31
|
+
declare function get<TQuery = never, TResponse = unknown, TServer extends boolean = false>(path: string, options?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<never, TQuery, TResponse, TServer, "GET">;
|
|
32
|
+
declare function get<TResponse = unknown, TServer extends boolean = false>(options?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<never, never, TResponse, TServer, "GET">;
|
|
33
|
+
declare function get<TQuery = never, TResponse = unknown, TServer extends boolean = false>(options?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<never, TQuery, TResponse, TServer, "GET">;
|
|
34
|
+
type RouteOperationsToAPI<TOperations extends readonly FarmIntegrationAPIOperation<any, any, any, any, any>[]> = {
|
|
35
|
+
[TMethod in Lowercase<TOperations[number]["method"] & string>]: Extract<TOperations[number], {
|
|
36
|
+
method: Uppercase<TMethod>;
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
39
|
+
type StripRouteClientPrefix<TPath extends string> = TPath extends `/api/${string}/${infer TRest}` ? TRest : TPath extends `/${string}/${infer TRest}` ? TRest : TPath extends `/${infer TRest}` ? TRest : TPath;
|
|
40
|
+
type NormalizeRouteSegment<TSegment extends string> = TSegment extends `[...${infer TName}]` ? TName : TSegment extends `[${infer TName}]` ? TName : TSegment extends `${infer TName}(${string}` ? TName : CamelCaseRouteSegment<TSegment>;
|
|
41
|
+
type CamelCaseRouteSegment<TSegment extends string> = TSegment extends `${infer THead}-${infer TTail}` ? `${THead}${Capitalize<CamelCaseRouteSegment<TTail>>}` : TSegment;
|
|
42
|
+
type RouteNamespaceFromPath<TPath extends string, TOperation extends FarmIntegrationAPIOperation<any, any, any, any, any>> = TPath extends `${infer THead}/${infer TTail}` ? {
|
|
43
|
+
[TKey in NormalizeRouteSegment<THead>]: RouteNamespaceFromPath<TTail, TOperation>;
|
|
44
|
+
} : {
|
|
45
|
+
[TKey in NormalizeRouteSegment<TPath>]: {
|
|
46
|
+
[TMethod in Lowercase<TOperation["method"] & string>]: TOperation;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
type UnionToIntersection<TUnion> = (TUnion extends unknown ? (value: TUnion) => void : never) extends (value: infer TIntersection) => void ? TIntersection : never;
|
|
50
|
+
type ExpandRecursively<TValue> = TValue extends (...args: any[]) => any ? TValue : TValue extends object ? {
|
|
51
|
+
[TKey in keyof TValue]: ExpandRecursively<TValue[TKey]>;
|
|
52
|
+
} : TValue;
|
|
53
|
+
type RoutesToAPI<TRoutes extends readonly FarmIntegrationRouteOperationCarrier<string, any>[]> = ExpandRecursively<UnionToIntersection<TRoutes[number] extends FarmIntegrationRouteOperationCarrier<infer TPath, infer TOperation> ? RouteNamespaceFromPath<StripRouteClientPrefix<TPath>, TOperation> : never>>;
|
|
54
|
+
type InferIntegrationAPIFromRoutes<TRoutes extends readonly FarmIntegrationRouteOperationCarrier<string, any>[]> = RoutesToAPI<TRoutes>;
|
|
55
|
+
declare function route<TAPI extends FarmIntegrationAPI>(path: string, definition: TAPI): TAPI;
|
|
56
|
+
declare function route<TOperations extends readonly FarmIntegrationAPIOperation<any, any, any, any, any>[]>(path: string, ...operations: TOperations): RouteOperationsToAPI<TOperations>;
|
|
57
|
+
declare function fromRoutes<TRoutes extends readonly FarmIntegrationRouteOperationCarrier<string, any>[]>(routes: TRoutes): RoutesToAPI<TRoutes>;
|
|
58
|
+
declare const api: {
|
|
59
|
+
get: typeof get;
|
|
60
|
+
route: typeof route;
|
|
61
|
+
fromRoutes: typeof fromRoutes;
|
|
62
|
+
post<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "POST">;
|
|
63
|
+
put<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PUT">;
|
|
64
|
+
patch<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PATCH">;
|
|
65
|
+
delete<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "DELETE">;
|
|
66
|
+
options<TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<never, TQuery, TResponse, TServer, "OPTIONS">;
|
|
67
|
+
head<TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<never, TQuery, TResponse, TServer, "HEAD">;
|
|
68
|
+
form: {
|
|
69
|
+
post<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "POST">;
|
|
70
|
+
put<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PUT">;
|
|
71
|
+
patch<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PATCH">;
|
|
72
|
+
delete<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "DELETE">;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
declare const endpoint: {
|
|
76
|
+
get: typeof get;
|
|
77
|
+
route: typeof route;
|
|
78
|
+
fromRoutes: typeof fromRoutes;
|
|
79
|
+
post<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "POST">;
|
|
80
|
+
put<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PUT">;
|
|
81
|
+
patch<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PATCH">;
|
|
82
|
+
delete<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "DELETE">;
|
|
83
|
+
options<TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<never, TQuery, TResponse, TServer, "OPTIONS">;
|
|
84
|
+
head<TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<never, TQuery, TResponse, TServer, "HEAD">;
|
|
85
|
+
form: {
|
|
86
|
+
post<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "POST">;
|
|
87
|
+
put<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PUT">;
|
|
88
|
+
patch<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PATCH">;
|
|
89
|
+
delete<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "DELETE">;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export { type FarmIntegrationAPI as F, type InferIntegrationAPIFromRoutes as I, type FarmIntegrationAPIOperation as a, api as b, defineIntegrationAPIOperation as c, defineIntegrationAPI as d, type FarmIntegrationAPIBodyFormat as e, type FarmIntegrationAPIMethod as f, type FarmIntegrationAPIResponseFormat as g, type FarmIntegrationRouteOperationCarrier as h, endpoint as i };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
type FarmIntegrationAPIMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "HEAD";
|
|
2
|
+
type FarmIntegrationAPIBodyFormat = "json" | "form" | "none";
|
|
3
|
+
type FarmIntegrationAPIResponseFormat = "json" | "text" | "response";
|
|
4
|
+
interface FarmIntegrationAPIOperation<TBody = never, TQuery = never, TResponse = unknown, TServer extends boolean = false, TMethod extends FarmIntegrationAPIMethod = FarmIntegrationAPIMethod> {
|
|
5
|
+
readonly kind: "farm-integration-api-operation";
|
|
6
|
+
path: string;
|
|
7
|
+
method: TMethod;
|
|
8
|
+
bodyFormat?: FarmIntegrationAPIBodyFormat;
|
|
9
|
+
responseFormat?: FarmIntegrationAPIResponseFormat;
|
|
10
|
+
headers?: Record<string, string>;
|
|
11
|
+
credentials?: RequestCredentials;
|
|
12
|
+
isServer?: TServer;
|
|
13
|
+
__pathless?: boolean;
|
|
14
|
+
__types?: {
|
|
15
|
+
body: TBody;
|
|
16
|
+
query: TQuery;
|
|
17
|
+
response: TResponse;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
type FarmIntegrationAPI = {
|
|
21
|
+
[key: string]: FarmIntegrationAPI | FarmIntegrationAPIOperation<any, any, any, any, any>;
|
|
22
|
+
};
|
|
23
|
+
type FarmIntegrationRouteOperationCarrier<TPath extends string = string, TOperation extends FarmIntegrationAPIOperation<any, any, any, any, any> = FarmIntegrationAPIOperation<any, any, any, any, any>> = {
|
|
24
|
+
path: TPath;
|
|
25
|
+
__operation: TOperation;
|
|
26
|
+
};
|
|
27
|
+
type IntegrationAPIBuilderOptions<TServer extends boolean = false> = Omit<FarmIntegrationAPIOperation<any, any, any, TServer>, "kind" | "method" | "path" | "__pathless" | "__types">;
|
|
28
|
+
declare function defineIntegrationAPIOperation<TBody = never, TQuery = never, TResponse = unknown, TServer extends boolean = false, TMethod extends FarmIntegrationAPIMethod = FarmIntegrationAPIMethod>(operation: Omit<FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, TMethod>, "kind" | "__types">): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, TMethod>;
|
|
29
|
+
declare function defineIntegrationAPI<TAPI extends FarmIntegrationAPI>(api: TAPI): TAPI;
|
|
30
|
+
declare function get<TResponse = unknown, TServer extends boolean = false>(path: string, options?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<never, never, TResponse, TServer, "GET">;
|
|
31
|
+
declare function get<TQuery = never, TResponse = unknown, TServer extends boolean = false>(path: string, options?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<never, TQuery, TResponse, TServer, "GET">;
|
|
32
|
+
declare function get<TResponse = unknown, TServer extends boolean = false>(options?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<never, never, TResponse, TServer, "GET">;
|
|
33
|
+
declare function get<TQuery = never, TResponse = unknown, TServer extends boolean = false>(options?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<never, TQuery, TResponse, TServer, "GET">;
|
|
34
|
+
type RouteOperationsToAPI<TOperations extends readonly FarmIntegrationAPIOperation<any, any, any, any, any>[]> = {
|
|
35
|
+
[TMethod in Lowercase<TOperations[number]["method"] & string>]: Extract<TOperations[number], {
|
|
36
|
+
method: Uppercase<TMethod>;
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
39
|
+
type StripRouteClientPrefix<TPath extends string> = TPath extends `/api/${string}/${infer TRest}` ? TRest : TPath extends `/${string}/${infer TRest}` ? TRest : TPath extends `/${infer TRest}` ? TRest : TPath;
|
|
40
|
+
type NormalizeRouteSegment<TSegment extends string> = TSegment extends `[...${infer TName}]` ? TName : TSegment extends `[${infer TName}]` ? TName : TSegment extends `${infer TName}(${string}` ? TName : CamelCaseRouteSegment<TSegment>;
|
|
41
|
+
type CamelCaseRouteSegment<TSegment extends string> = TSegment extends `${infer THead}-${infer TTail}` ? `${THead}${Capitalize<CamelCaseRouteSegment<TTail>>}` : TSegment;
|
|
42
|
+
type RouteNamespaceFromPath<TPath extends string, TOperation extends FarmIntegrationAPIOperation<any, any, any, any, any>> = TPath extends `${infer THead}/${infer TTail}` ? {
|
|
43
|
+
[TKey in NormalizeRouteSegment<THead>]: RouteNamespaceFromPath<TTail, TOperation>;
|
|
44
|
+
} : {
|
|
45
|
+
[TKey in NormalizeRouteSegment<TPath>]: {
|
|
46
|
+
[TMethod in Lowercase<TOperation["method"] & string>]: TOperation;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
type UnionToIntersection<TUnion> = (TUnion extends unknown ? (value: TUnion) => void : never) extends (value: infer TIntersection) => void ? TIntersection : never;
|
|
50
|
+
type ExpandRecursively<TValue> = TValue extends (...args: any[]) => any ? TValue : TValue extends object ? {
|
|
51
|
+
[TKey in keyof TValue]: ExpandRecursively<TValue[TKey]>;
|
|
52
|
+
} : TValue;
|
|
53
|
+
type RoutesToAPI<TRoutes extends readonly FarmIntegrationRouteOperationCarrier<string, any>[]> = ExpandRecursively<UnionToIntersection<TRoutes[number] extends FarmIntegrationRouteOperationCarrier<infer TPath, infer TOperation> ? RouteNamespaceFromPath<StripRouteClientPrefix<TPath>, TOperation> : never>>;
|
|
54
|
+
type InferIntegrationAPIFromRoutes<TRoutes extends readonly FarmIntegrationRouteOperationCarrier<string, any>[]> = RoutesToAPI<TRoutes>;
|
|
55
|
+
declare function route<TAPI extends FarmIntegrationAPI>(path: string, definition: TAPI): TAPI;
|
|
56
|
+
declare function route<TOperations extends readonly FarmIntegrationAPIOperation<any, any, any, any, any>[]>(path: string, ...operations: TOperations): RouteOperationsToAPI<TOperations>;
|
|
57
|
+
declare function fromRoutes<TRoutes extends readonly FarmIntegrationRouteOperationCarrier<string, any>[]>(routes: TRoutes): RoutesToAPI<TRoutes>;
|
|
58
|
+
declare const api: {
|
|
59
|
+
get: typeof get;
|
|
60
|
+
route: typeof route;
|
|
61
|
+
fromRoutes: typeof fromRoutes;
|
|
62
|
+
post<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "POST">;
|
|
63
|
+
put<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PUT">;
|
|
64
|
+
patch<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PATCH">;
|
|
65
|
+
delete<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "DELETE">;
|
|
66
|
+
options<TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<never, TQuery, TResponse, TServer, "OPTIONS">;
|
|
67
|
+
head<TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<never, TQuery, TResponse, TServer, "HEAD">;
|
|
68
|
+
form: {
|
|
69
|
+
post<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "POST">;
|
|
70
|
+
put<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PUT">;
|
|
71
|
+
patch<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PATCH">;
|
|
72
|
+
delete<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "DELETE">;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
declare const endpoint: {
|
|
76
|
+
get: typeof get;
|
|
77
|
+
route: typeof route;
|
|
78
|
+
fromRoutes: typeof fromRoutes;
|
|
79
|
+
post<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "POST">;
|
|
80
|
+
put<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PUT">;
|
|
81
|
+
patch<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PATCH">;
|
|
82
|
+
delete<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "DELETE">;
|
|
83
|
+
options<TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<never, TQuery, TResponse, TServer, "OPTIONS">;
|
|
84
|
+
head<TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<never, TQuery, TResponse, TServer, "HEAD">;
|
|
85
|
+
form: {
|
|
86
|
+
post<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "POST">;
|
|
87
|
+
put<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PUT">;
|
|
88
|
+
patch<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "PATCH">;
|
|
89
|
+
delete<TBody = never, TResponse = unknown, TQuery = never, TServer extends boolean = false>(pathOrOptions?: string | IntegrationAPIBuilderOptions<TServer>, maybeOptions?: IntegrationAPIBuilderOptions<TServer>): FarmIntegrationAPIOperation<TBody, TQuery, TResponse, TServer, "DELETE">;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export { type FarmIntegrationAPI as F, type InferIntegrationAPIFromRoutes as I, type FarmIntegrationAPIOperation as a, api as b, defineIntegrationAPIOperation as c, defineIntegrationAPI as d, type FarmIntegrationAPIBodyFormat as e, type FarmIntegrationAPIMethod as f, type FarmIntegrationAPIResponseFormat as g, type FarmIntegrationRouteOperationCarrier as h, endpoint as i };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import 'react';
|
|
2
|
+
export { F as FarmIntegrationAPI, e as FarmIntegrationAPIBodyFormat, f as FarmIntegrationAPIMethod, a as FarmIntegrationAPIOperation, g as FarmIntegrationAPIResponseFormat, b as api, d as defineIntegrationAPI, c as defineIntegrationAPIOperation } from './integration-api-CHT2OKAf.mjs';
|
|
3
|
+
export { cq as DefinedIntegration, bG as FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY, a0 as FarmIntegration, br as FarmIntegrationCategory, bK as FarmIntegrationConfigContext, bL as FarmIntegrationConfigDefinition, bM as FarmIntegrationConfigInput, cd as FarmIntegrationContributedPlugin, bR as FarmIntegrationData, b$ as FarmIntegrationDocumentNavigation, ck as FarmIntegrationEndpointValue, cl as FarmIntegrationEndpoints, cn as FarmIntegrationEndpointsFactory, cm as FarmIntegrationEndpointsFactoryContext, bS as FarmIntegrationHandlerContext, bD as FarmIntegrationInputSchema, bP as FarmIntegrationLifecycleContext, bQ as FarmIntegrationLifecycleHook, bN as FarmIntegrationLifecycleLogLevel, bO as FarmIntegrationLifecycleLogger, ca as FarmIntegrationLogEvent, c9 as FarmIntegrationLogPhase, cb as FarmIntegrationLogger, bY as FarmIntegrationMiddleware, cc as FarmIntegrationPluginOwner, b_ as FarmIntegrationProvider, bZ as FarmIntegrationProviderProps, bF as FarmIntegrationRequestContextStore, bV as FarmIntegrationRoute, bJ as FarmIntegrationRouteArgs, bH as FarmIntegrationRouteDb, ch as FarmIntegrationRouteFactory, bU as FarmIntegrationRouteHook, bT as FarmIntegrationRouteHookContext, by as FarmIntegrationRouteInput, bE as FarmIntegrationRouteInputSchemas, bw as FarmIntegrationRouteInputSource, bv as FarmIntegrationRouteMethod, bX as FarmIntegrationRouteMiddleware, bt as FarmIntegrationRouteParamValue, bu as FarmIntegrationRouteParams, bI as FarmIntegrationRouteStorageArgs, cj as FarmIntegrationRoutesFactory, ci as FarmIntegrationRoutesFactoryContext, c7 as FarmIntegrationSchema, c3 as FarmIntegrationSchemaConstraint, c2 as FarmIntegrationSchemaField, c0 as FarmIntegrationSchemaFieldType, c4 as FarmIntegrationSchemaModel, c5 as FarmIntegrationSchemaModelExtension, c6 as FarmIntegrationSchemaModelOverride, c1 as FarmIntegrationSchemaReference, bs as FarmIntegrationSlot, bC as FarmIntegrationStandardValidationResult, bA as FarmIntegrationValidationErrorLike, bz as FarmIntegrationValidationIssue, bx as FarmIntegrationValidationPathSegment, bB as FarmIntegrationValidationResult, ce as FarmIntegrationsUserConfig, bW as FarmTypedIntegrationRoute, co as createIntegrationRoute, cr as defineIntegration, c8 as defineIntegrationSchema, cD as dispatchIntegrationRequest, cg as getFarmIntegrationPluginOwner, cf as getFarmIntegrationPluginServerRuntime, cv as getIntegrationDocumentNavigationMatchers, cu as getIntegrationProviders, cw as getIntegrationSchemas, cC as getRegisteredIntegrationAPIManifest, cx as getRegisteredIntegrationRuntime, cz as getRegisteredIntegrationSchemas, cy as getRegisteredIntegrations, cp as integrationRoute, cs as isFarmIntegration, cA as matchIntegrationRoute, cB as matchRegisteredIntegrationRoute, ct as resolveIntegrationPlugins } from './client-plugins-QQntVkrv.mjs';
|
|
4
|
+
import './plugin-BJDf43dc.mjs';
|
|
5
|
+
import 'http';
|
|
6
|
+
import './types-D1A6-XvH.mjs';
|
|
7
|
+
import 'db0';
|
|
8
|
+
import 'unstorage';
|
|
9
|
+
import '@farming-labs/orm';
|
|
10
|
+
import './types-DTzm4TCl.mjs';
|
|
11
|
+
import '@farming-labs/docs';
|
|
12
|
+
import './markdown.mjs';
|
|
13
|
+
import './observability.mjs';
|
|
14
|
+
import 'vite';
|
|
15
|
+
import './workflows-CusFV6mn.mjs';
|
|
16
|
+
import './cron.mjs';
|
|
17
|
+
import './env.mjs';
|
|
18
|
+
import './server-action-security.mjs';
|
|
19
|
+
import './server-fn-error-DDh14a0V.mjs';
|
|
20
|
+
import './image-config-Duob7wER.mjs';
|
|
21
|
+
import './types-BMxWr97v.mjs';
|
|
22
|
+
import './cache.mjs';
|
|
23
|
+
import './route-runtime-DoOHzCAD.mjs';
|
|
24
|
+
import './font.mjs';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import 'react';
|
|
2
|
+
export { F as FarmIntegrationAPI, e as FarmIntegrationAPIBodyFormat, f as FarmIntegrationAPIMethod, a as FarmIntegrationAPIOperation, g as FarmIntegrationAPIResponseFormat, b as api, d as defineIntegrationAPI, c as defineIntegrationAPIOperation } from './integration-api-CHT2OKAf.js';
|
|
3
|
+
export { cq as DefinedIntegration, bG as FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY, a0 as FarmIntegration, br as FarmIntegrationCategory, bK as FarmIntegrationConfigContext, bL as FarmIntegrationConfigDefinition, bM as FarmIntegrationConfigInput, cd as FarmIntegrationContributedPlugin, bR as FarmIntegrationData, b$ as FarmIntegrationDocumentNavigation, ck as FarmIntegrationEndpointValue, cl as FarmIntegrationEndpoints, cn as FarmIntegrationEndpointsFactory, cm as FarmIntegrationEndpointsFactoryContext, bS as FarmIntegrationHandlerContext, bD as FarmIntegrationInputSchema, bP as FarmIntegrationLifecycleContext, bQ as FarmIntegrationLifecycleHook, bN as FarmIntegrationLifecycleLogLevel, bO as FarmIntegrationLifecycleLogger, ca as FarmIntegrationLogEvent, c9 as FarmIntegrationLogPhase, cb as FarmIntegrationLogger, bY as FarmIntegrationMiddleware, cc as FarmIntegrationPluginOwner, b_ as FarmIntegrationProvider, bZ as FarmIntegrationProviderProps, bF as FarmIntegrationRequestContextStore, bV as FarmIntegrationRoute, bJ as FarmIntegrationRouteArgs, bH as FarmIntegrationRouteDb, ch as FarmIntegrationRouteFactory, bU as FarmIntegrationRouteHook, bT as FarmIntegrationRouteHookContext, by as FarmIntegrationRouteInput, bE as FarmIntegrationRouteInputSchemas, bw as FarmIntegrationRouteInputSource, bv as FarmIntegrationRouteMethod, bX as FarmIntegrationRouteMiddleware, bt as FarmIntegrationRouteParamValue, bu as FarmIntegrationRouteParams, bI as FarmIntegrationRouteStorageArgs, cj as FarmIntegrationRoutesFactory, ci as FarmIntegrationRoutesFactoryContext, c7 as FarmIntegrationSchema, c3 as FarmIntegrationSchemaConstraint, c2 as FarmIntegrationSchemaField, c0 as FarmIntegrationSchemaFieldType, c4 as FarmIntegrationSchemaModel, c5 as FarmIntegrationSchemaModelExtension, c6 as FarmIntegrationSchemaModelOverride, c1 as FarmIntegrationSchemaReference, bs as FarmIntegrationSlot, bC as FarmIntegrationStandardValidationResult, bA as FarmIntegrationValidationErrorLike, bz as FarmIntegrationValidationIssue, bx as FarmIntegrationValidationPathSegment, bB as FarmIntegrationValidationResult, ce as FarmIntegrationsUserConfig, bW as FarmTypedIntegrationRoute, co as createIntegrationRoute, cr as defineIntegration, c8 as defineIntegrationSchema, cD as dispatchIntegrationRequest, cg as getFarmIntegrationPluginOwner, cf as getFarmIntegrationPluginServerRuntime, cv as getIntegrationDocumentNavigationMatchers, cu as getIntegrationProviders, cw as getIntegrationSchemas, cC as getRegisteredIntegrationAPIManifest, cx as getRegisteredIntegrationRuntime, cz as getRegisteredIntegrationSchemas, cy as getRegisteredIntegrations, cp as integrationRoute, cs as isFarmIntegration, cA as matchIntegrationRoute, cB as matchRegisteredIntegrationRoute, ct as resolveIntegrationPlugins } from './client-plugins-CbRum1fj.js';
|
|
4
|
+
import './plugin-BJDf43dc.js';
|
|
5
|
+
import 'http';
|
|
6
|
+
import './types-D1A6-XvH.js';
|
|
7
|
+
import 'db0';
|
|
8
|
+
import 'unstorage';
|
|
9
|
+
import '@farming-labs/orm';
|
|
10
|
+
import './types-DTzm4TCl.js';
|
|
11
|
+
import '@farming-labs/docs';
|
|
12
|
+
import './markdown.js';
|
|
13
|
+
import './observability.js';
|
|
14
|
+
import 'vite';
|
|
15
|
+
import './workflows-CusFV6mn.js';
|
|
16
|
+
import './cron.js';
|
|
17
|
+
import './env.js';
|
|
18
|
+
import './server-action-security.js';
|
|
19
|
+
import './server-fn-error-DDh14a0V.js';
|
|
20
|
+
import './image-config-Duob7wER.js';
|
|
21
|
+
import './types-BMxWr97v.js';
|
|
22
|
+
import './cache.js';
|
|
23
|
+
import './route-runtime-DoOHzCAD.js';
|
|
24
|
+
import './font.js';
|
|
@@ -16727,6 +16727,19 @@ var init_module = __esm({
|
|
|
16727
16727
|
}
|
|
16728
16728
|
});
|
|
16729
16729
|
|
|
16730
|
+
// src/cli-colors.ts
|
|
16731
|
+
function createCliColors(interactive = process.stdout.isTTY === true) {
|
|
16732
|
+
return import_picocolors.default.createColors(interactive);
|
|
16733
|
+
}
|
|
16734
|
+
var import_picocolors;
|
|
16735
|
+
var init_cli_colors = __esm({
|
|
16736
|
+
"src/cli-colors.ts"() {
|
|
16737
|
+
"use strict";
|
|
16738
|
+
import_picocolors = __toESM(require("picocolors"));
|
|
16739
|
+
__name(createCliColors, "createCliColors");
|
|
16740
|
+
}
|
|
16741
|
+
});
|
|
16742
|
+
|
|
16730
16743
|
// src/middleware/manager.ts
|
|
16731
16744
|
function isMiddlewareResponse(value) {
|
|
16732
16745
|
return value instanceof Response;
|
|
@@ -16743,6 +16756,7 @@ var init_manager = __esm({
|
|
|
16743
16756
|
init_response();
|
|
16744
16757
|
init_observability();
|
|
16745
16758
|
init_routing();
|
|
16759
|
+
init_cli_colors();
|
|
16746
16760
|
__name(isMiddlewareResponse, "isMiddlewareResponse");
|
|
16747
16761
|
_MiddlewareManager = class _MiddlewareManager {
|
|
16748
16762
|
constructor(appDir, viteServer, config, i18n) {
|
|
@@ -16896,23 +16910,16 @@ var init_manager = __esm({
|
|
|
16896
16910
|
if (applicable.length === 0) {
|
|
16897
16911
|
return false;
|
|
16898
16912
|
}
|
|
16899
|
-
|
|
16900
|
-
|
|
16901
|
-
|
|
16902
|
-
|
|
16903
|
-
|
|
16904
|
-
|
|
16905
|
-
|
|
16906
|
-
|
|
16907
|
-
|
|
16908
|
-
|
|
16909
|
-
].join(" ");
|
|
16910
|
-
console.log(log);
|
|
16911
|
-
} catch {
|
|
16912
|
-
console.log(
|
|
16913
|
-
`[FARM] [MIDDLEWARE] [${method}] Executing ${pathname} (${applicable.length} middleware)`
|
|
16914
|
-
);
|
|
16915
|
-
}
|
|
16913
|
+
const pc = createCliColors();
|
|
16914
|
+
const log = [
|
|
16915
|
+
pc.dim("[") + pc.bold(pc.blue("FARM")) + pc.dim("]"),
|
|
16916
|
+
pc.dim("[") + pc.bold(pc.magenta("MIDDLEWARE")) + pc.dim("]"),
|
|
16917
|
+
pc.dim("[") + pc.bold(pc.white(method.padEnd(3))) + pc.dim("]"),
|
|
16918
|
+
pc.gray("Executing middleware: "),
|
|
16919
|
+
pc.gray(pathname),
|
|
16920
|
+
pc.dim(` (${(Date.now() - startTime).toFixed(2)}ms)`)
|
|
16921
|
+
].join(" ");
|
|
16922
|
+
console.log(log);
|
|
16916
16923
|
for (const entry of applicable) {
|
|
16917
16924
|
const { mw, routeMatch } = entry;
|
|
16918
16925
|
const configMatch = mw.config ? this.matchesConfig(routePathname, mw.config, ctx) : { matched: true };
|
|
@@ -18074,7 +18081,7 @@ var init_type_artifacts = __esm({
|
|
|
18074
18081
|
var version;
|
|
18075
18082
|
var init_package = __esm({
|
|
18076
18083
|
"package.json"() {
|
|
18077
|
-
version = "0.1.0-beta.
|
|
18084
|
+
version = "0.1.0-beta.22";
|
|
18078
18085
|
}
|
|
18079
18086
|
});
|
|
18080
18087
|
|
|
@@ -25375,18 +25382,14 @@ function farmPlugin(options = {}, initialPluginManager) {
|
|
|
25375
25382
|
let refreshRouteDiscovery = null;
|
|
25376
25383
|
let workflowHandler = null;
|
|
25377
25384
|
const logUpdate = /* @__PURE__ */ __name((tag, message) => {
|
|
25378
|
-
|
|
25379
|
-
|
|
25380
|
-
|
|
25381
|
-
|
|
25382
|
-
|
|
25383
|
-
|
|
25384
|
-
|
|
25385
|
-
|
|
25386
|
-
console.log(log);
|
|
25387
|
-
} catch {
|
|
25388
|
-
console.log(`[FARM] [${tag}] [UPDATE] ${message}`);
|
|
25389
|
-
}
|
|
25385
|
+
const pc = createCliColors();
|
|
25386
|
+
const log = [
|
|
25387
|
+
pc.dim("[") + pc.bold(pc.blue("FARM")) + pc.dim("]"),
|
|
25388
|
+
pc.dim("[") + pc.bold(pc.cyan(tag)) + pc.dim("]"),
|
|
25389
|
+
pc.dim("[") + pc.bold(pc.yellow("UPDATE")) + pc.dim("]"),
|
|
25390
|
+
pc.gray(message)
|
|
25391
|
+
].join(" ");
|
|
25392
|
+
console.log(log);
|
|
25390
25393
|
}, "logUpdate");
|
|
25391
25394
|
return {
|
|
25392
25395
|
name: "farm",
|
|
@@ -25827,25 +25830,21 @@ window.__FARM_MANIFEST__ = ${inlineValue({
|
|
|
25827
25830
|
return;
|
|
25828
25831
|
}
|
|
25829
25832
|
logResponse.__last = { key: dedupeKey, ts: now };
|
|
25830
|
-
|
|
25831
|
-
|
|
25832
|
-
|
|
25833
|
-
|
|
25834
|
-
|
|
25835
|
-
|
|
25836
|
-
|
|
25837
|
-
|
|
25838
|
-
|
|
25839
|
-
|
|
25840
|
-
|
|
25841
|
-
|
|
25842
|
-
|
|
25843
|
-
|
|
25844
|
-
|
|
25845
|
-
console.log(log);
|
|
25846
|
-
} catch {
|
|
25847
|
-
console.log(`[FARM] [${tag}] [${method}] ${urlPath} - ${status} (${duration}ms)`);
|
|
25848
|
-
}
|
|
25833
|
+
const pc = createCliColors();
|
|
25834
|
+
let statusColor = pc.green;
|
|
25835
|
+
if (status >= 500) statusColor = pc.red;
|
|
25836
|
+
else if (status >= 400) statusColor = pc.yellow;
|
|
25837
|
+
else if (status >= 300) statusColor = pc.cyan;
|
|
25838
|
+
const log = [
|
|
25839
|
+
pc.dim("[") + pc.bold(pc.blue("FARM")) + pc.dim("]"),
|
|
25840
|
+
pc.dim("[") + pc.bold(pc.cyan(tag)) + pc.dim("]"),
|
|
25841
|
+
pc.dim("[") + pc.bold(pc.white(method.padEnd(3))) + pc.dim("]"),
|
|
25842
|
+
pc.gray(urlPath),
|
|
25843
|
+
pc.dim("-"),
|
|
25844
|
+
statusColor(status.toString()),
|
|
25845
|
+
pc.dim(`(${duration}ms)`)
|
|
25846
|
+
].join(" ");
|
|
25847
|
+
console.log(log);
|
|
25849
25848
|
}, "logResponse");
|
|
25850
25849
|
server.middlewares.use(
|
|
25851
25850
|
_withAfterNodeMiddleware(async (req, res, next) => {
|
|
@@ -28902,7 +28901,7 @@ async function defineConfig2(config = {}) {
|
|
|
28902
28901
|
return null;
|
|
28903
28902
|
}
|
|
28904
28903
|
};
|
|
28905
|
-
const pc =
|
|
28904
|
+
const pc = createCliColors();
|
|
28906
28905
|
let serverStarted = false;
|
|
28907
28906
|
let startTime = Date.now();
|
|
28908
28907
|
const farmLogger = {
|
|
@@ -29077,6 +29076,7 @@ var init_vite = __esm({
|
|
|
29077
29076
|
init_vite_config();
|
|
29078
29077
|
init_fonts();
|
|
29079
29078
|
init_server_http();
|
|
29079
|
+
init_cli_colors();
|
|
29080
29080
|
ALL_TYPE_ARTIFACTS = {
|
|
29081
29081
|
routes: true,
|
|
29082
29082
|
api: true,
|