arri 0.44.0 → 0.45.0
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/README.md +66 -542
- package/dist/cli.cjs +51 -393
- package/dist/cli.mjs +6 -336
- package/dist/index.cjs +25 -44
- package/dist/index.d.cts +8 -278
- package/dist/index.d.mts +8 -278
- package/dist/index.d.ts +8 -278
- package/dist/index.mjs +15 -9
- package/dist/shared/arri.547ce62e.cjs +436 -0
- package/dist/shared/arri.e5993636.mjs +403 -0
- package/package.json +17 -27
- package/dist/codegen.cjs +0 -13
- package/dist/codegen.d.cts +0 -4
- package/dist/codegen.d.mts +0 -4
- package/dist/codegen.d.ts +0 -4
- package/dist/codegen.mjs +0 -4
- package/dist/shared/arri.0628c07d.cjs +0 -1285
- package/dist/shared/arri.c3a553fc.mjs +0 -1250
package/dist/index.d.ts
CHANGED
|
@@ -1,282 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { Peer, WSError } from 'crossws';
|
|
1
|
+
export { dartClientGenerator } from '@arrirpc/codegen-dart';
|
|
2
|
+
export { typescriptClientGenerator } from '@arrirpc/codegen-ts';
|
|
3
|
+
export { kotlinClientGenerator } from '@arrirpc/codegen-kotlin';
|
|
4
|
+
import { ClientGenerator } from '@arrirpc/codegen-utils';
|
|
5
|
+
export { AppDefinition, createAppDefinition } from '@arrirpc/codegen-utils';
|
|
7
6
|
import { BuildOptions } from 'esbuild';
|
|
8
7
|
|
|
9
|
-
declare class ArriServerError extends Error {
|
|
10
|
-
code: number;
|
|
11
|
-
data?: any;
|
|
12
|
-
constructor(err: {
|
|
13
|
-
code: number;
|
|
14
|
-
message: string;
|
|
15
|
-
data?: any;
|
|
16
|
-
stack?: string;
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
declare const ArriServerErrorResponse: AObjectSchema<{
|
|
20
|
-
code: number;
|
|
21
|
-
message: string;
|
|
22
|
-
stack?: string[] | undefined;
|
|
23
|
-
data?: any;
|
|
24
|
-
}, false>;
|
|
25
|
-
type ArriServerErrorResponse = a.infer<typeof ArriServerErrorResponse>;
|
|
26
|
-
declare function defineError(statusCode: StatusCode, input?: Partial<Omit<ArriServerErrorResponse, "code" | "stack">>): ArriServerError;
|
|
27
|
-
declare function errorResponseFromValidationErrors(errors: ValidationError["errors"], prefixText?: string): H3Error;
|
|
28
|
-
type StatusCode = number | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 507 | 511;
|
|
29
|
-
declare function handleH3Error(err: unknown, event: H3Event, onError: ArriOptions["onError"], debug: boolean): Promise<void>;
|
|
30
|
-
|
|
31
|
-
type ArriEventContext = Record<string, any>;
|
|
32
|
-
interface RpcEventContext<TParams = undefined> extends ArriEventContext, Omit<H3EventContext, "params"> {
|
|
33
|
-
rpcName: string;
|
|
34
|
-
params: TParams;
|
|
35
|
-
}
|
|
36
|
-
interface RpcPostEventContext<TParams = undefined, TResponse = undefined> extends RpcEventContext<TParams> {
|
|
37
|
-
response: TResponse;
|
|
38
|
-
}
|
|
39
|
-
interface RouteEventContext<TPath extends string, TQuery extends Record<any, any> = any, TBody = any> extends ArriEventContext, H3EventContext {
|
|
40
|
-
params: ExtractParams<TPath>;
|
|
41
|
-
query: TQuery;
|
|
42
|
-
body: TBody;
|
|
43
|
-
}
|
|
44
|
-
interface RoutePostEventContext<TPath extends string, TQuery extends Record<any, any> = any, TBody = any, TResponse = any> extends RouteEventContext<TPath, TQuery, TBody> {
|
|
45
|
-
response: TResponse;
|
|
46
|
-
}
|
|
47
|
-
interface MiddlewareEventContext extends ArriEventContext, H3EventContext {
|
|
48
|
-
rpcName?: string;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
interface MiddlewareEvent extends H3Event {
|
|
52
|
-
context: MiddlewareEventContext;
|
|
53
|
-
}
|
|
54
|
-
type Middleware = (event: MiddlewareEvent) => void | Promise<void>;
|
|
55
|
-
declare const defineMiddleware: (middleware: Middleware) => Middleware;
|
|
56
|
-
type ExtractParam<Path, NextPart> = Path extends `:${infer Param}` ? Record<Param, string> & NextPart : NextPart;
|
|
57
|
-
type ExtractParams<Path> = Path extends `${infer Segment}/${infer Rest}` ? ExtractParam<Segment, ExtractParams<Rest>> : ExtractParam<Path, {}>;
|
|
58
|
-
|
|
59
|
-
interface RouteEvent<TPath extends string, TQuery extends Record<any, any> = any, TBody = any> extends H3Event {
|
|
60
|
-
context: RouteEventContext<TPath, TQuery, TBody>;
|
|
61
|
-
}
|
|
62
|
-
interface PostRouteEvent<TPath extends string, TQuery extends Record<any, any> = any, TBody = any, TResponse = any> extends H3Event {
|
|
63
|
-
context: RoutePostEventContext<TPath, TQuery, TBody, TResponse>;
|
|
64
|
-
}
|
|
65
|
-
interface ArriRoute<TPath extends string, TQuery extends AObjectSchema<any, any> = any, TBody extends ASchema<any> = any, TResponse = any> {
|
|
66
|
-
path: TPath;
|
|
67
|
-
method: HttpMethod | HttpMethod[];
|
|
68
|
-
query?: TQuery;
|
|
69
|
-
body?: TBody;
|
|
70
|
-
handler: (event: RouteEvent<TPath, InferType<TQuery>, InferType<TBody>>) => TResponse;
|
|
71
|
-
postHandler?: (event: PostRouteEvent<TPath, InferType<TQuery>, InferType<TBody>, Awaited<TResponse>>) => any;
|
|
72
|
-
}
|
|
73
|
-
declare function defineRoute<TPath extends string, TQuery extends AObjectSchema<any, any> = any, TBody extends AObjectSchema<any, any> = any, TResponse = any>(route: ArriRoute<TPath, TQuery, TBody, TResponse>): ArriRoute<TPath, TQuery, TBody, TResponse>;
|
|
74
|
-
type RouteOptions = Pick<ArriOptions, "onAfterResponse" | "onBeforeResponse" | "onError" | "onRequest" | "debug"> & {
|
|
75
|
-
middleware: Middleware[];
|
|
76
|
-
};
|
|
77
|
-
declare function registerRoute(router: Router, route: ArriRoute<any>, opts: RouteOptions): void;
|
|
78
|
-
declare function handleRoute(router: Router, method: HttpMethod, route: ArriRoute<any>, opts: RouteOptions): void;
|
|
79
|
-
|
|
80
|
-
declare function defineEventStreamRpc<TParams extends RpcParamSchema | undefined = undefined, TResponse extends RpcParamSchema | undefined | never = undefined>(config: Omit<EventStreamRpc<TParams, TResponse>, "isEventStream" | "transport">): EventStreamRpc<TParams, TResponse>;
|
|
81
|
-
declare function isEventStreamRpc(input: unknown): input is EventStreamRpc<any, any>;
|
|
82
|
-
interface EventStreamRpc<TParams extends RpcParamSchema | undefined = undefined, TResponse extends RpcParamSchema | undefined = undefined> extends Omit<Rpc<true, TParams, TResponse>, "handler" | "postHandler"> {
|
|
83
|
-
isEventStream: true;
|
|
84
|
-
handler: EventStreamRpcHandler<TParams extends RpcParamSchema ? InferType<TParams> : undefined, TResponse extends RpcParamSchema ? InferType<TResponse> : undefined>;
|
|
85
|
-
}
|
|
86
|
-
type EventStreamRpcHandler<TParams, TResponse> = (context: EventStreamRpcHandlerContext<TParams, TResponse>, event: RpcEvent<TResponse>) => void | Promise<void>;
|
|
87
|
-
interface EventStreamRpcHandlerContext<TParams = any, TResponse = any> extends RpcEventContext<TParams> {
|
|
88
|
-
stream: EventStreamConnection<TResponse>;
|
|
89
|
-
}
|
|
90
|
-
interface EventStreamConnectionOptions<TData> {
|
|
91
|
-
validator: (input: unknown) => input is TData;
|
|
92
|
-
validationErrors: (input: unknown) => ValueError[];
|
|
93
|
-
serializer: (input: TData) => string;
|
|
94
|
-
pingInterval?: number;
|
|
95
|
-
}
|
|
96
|
-
declare class EventStreamConnection<TData> {
|
|
97
|
-
readonly lastEventId?: string;
|
|
98
|
-
private readonly validationErrors;
|
|
99
|
-
private readonly validator;
|
|
100
|
-
private readonly serializer;
|
|
101
|
-
private pingInterval;
|
|
102
|
-
private readonly pingIntervalMs;
|
|
103
|
-
readonly eventStream: EventStream;
|
|
104
|
-
constructor(event: H3Event, opts: EventStreamConnectionOptions<TData>);
|
|
105
|
-
/**
|
|
106
|
-
* Send the stream to the client. This must be called before sending any events.
|
|
107
|
-
*/
|
|
108
|
-
send(): void;
|
|
109
|
-
/**
|
|
110
|
-
* Publish a new event. Events published with this hook will trigger the `onData()` hooks of any connected clients.
|
|
111
|
-
*/
|
|
112
|
-
push(data: TData[], eventId?: string): Promise<void>;
|
|
113
|
-
push(data: TData, eventId?: string): Promise<void>;
|
|
114
|
-
/**
|
|
115
|
-
* Publish an error event. This will trigger the `onError` hooks of any connected clients.
|
|
116
|
-
*/
|
|
117
|
-
pushError(error: ArriServerErrorResponse, eventId?: string): Promise<void>;
|
|
118
|
-
private cleanup;
|
|
119
|
-
/**
|
|
120
|
-
* Tell clients that the stream has ended and close the connection.
|
|
121
|
-
*/
|
|
122
|
-
close(): Promise<void>;
|
|
123
|
-
onClose(cb: () => any): void;
|
|
124
|
-
}
|
|
125
|
-
declare function registerEventStreamRpc(router: Router, path: string, procedure: EventStreamRpc<any, any> & {
|
|
126
|
-
name: string;
|
|
127
|
-
}, opts: RouteOptions): void;
|
|
128
|
-
|
|
129
|
-
interface NamedWebsocketRpc<TParams extends RpcParamSchema | undefined = undefined, TResponse extends RpcParamSchema | undefined = undefined> extends WebsocketRpc<TParams, TResponse> {
|
|
130
|
-
name: string;
|
|
131
|
-
}
|
|
132
|
-
interface WebsocketRpc<TParams extends RpcParamSchema | undefined = undefined, TResponse extends RpcParamSchema | undefined = undefined> {
|
|
133
|
-
transport: "ws";
|
|
134
|
-
description?: string;
|
|
135
|
-
path?: string;
|
|
136
|
-
isDeprecated?: boolean;
|
|
137
|
-
params: TParams;
|
|
138
|
-
response: TResponse;
|
|
139
|
-
pingInterval?: boolean;
|
|
140
|
-
handler: WebSocketRpcHandler<TParams extends RpcParamSchema ? InferType<TParams> : undefined, TResponse extends RpcParamSchema ? InferType<TResponse> : undefined> | (() => WebSocketRpcHandler<TParams extends RpcParamSchema ? InferType<TParams> : undefined, TResponse extends RpcParamSchema ? InferType<TResponse> : undefined>);
|
|
141
|
-
}
|
|
142
|
-
interface WsPeerOpts<TResponse> {
|
|
143
|
-
validator?: CompiledValidator<ASchema<TResponse>>;
|
|
144
|
-
context: WsPeerContext;
|
|
145
|
-
}
|
|
146
|
-
interface WsPeerContext extends Record<string, any> {
|
|
147
|
-
rpcName: string;
|
|
148
|
-
queryParams?: Record<string, string>;
|
|
149
|
-
clientAddress?: string;
|
|
150
|
-
}
|
|
151
|
-
declare class WsPeer<TResponse> {
|
|
152
|
-
private readonly _peer;
|
|
153
|
-
private readonly _validator?;
|
|
154
|
-
context: WsPeerContext;
|
|
155
|
-
url: string;
|
|
156
|
-
constructor(peer: Peer, opts: WsPeerOpts<TResponse>);
|
|
157
|
-
send(data: TResponse): number | undefined;
|
|
158
|
-
sendError(err: ArriServerErrorResponse): number;
|
|
159
|
-
close(): void;
|
|
160
|
-
subscribe(channel: string): void;
|
|
161
|
-
unsubscribe(channel: string): void;
|
|
162
|
-
publish(channel: string, message: TResponse): void;
|
|
163
|
-
readyState(): (0 | 1 | 2 | 3) | -1;
|
|
164
|
-
}
|
|
165
|
-
interface WebSocketRpcHandler<TParams, TResponse> {
|
|
166
|
-
onOpen: (peer: WsPeer<TResponse>) => void;
|
|
167
|
-
onMessage: (peer: WsPeer<TResponse>, message: TParams) => void;
|
|
168
|
-
onClose: (peer: WsPeer<TResponse>, details: {
|
|
169
|
-
code?: number;
|
|
170
|
-
reason?: string;
|
|
171
|
-
}) => void;
|
|
172
|
-
onError: (peer: WsPeer<TResponse>, error: WSError) => void;
|
|
173
|
-
}
|
|
174
|
-
declare function defineWebsocketRpc<TParams extends RpcParamSchema | undefined, TResponse extends RpcParamSchema | undefined>(def: Omit<WebsocketRpc<TParams, TResponse>, "transport">): WebsocketRpc<TParams, TResponse>;
|
|
175
|
-
declare function registerWebsocketRpc(router: Router, path: string, rpc: NamedWebsocketRpc<any, any>): void;
|
|
176
|
-
declare function createWsRpcDefinition(rpcName: string, path: string, rpc: NamedWebsocketRpc<any, any>): WsRpcDefinition;
|
|
177
|
-
|
|
178
|
-
type RpcParamSchema<TObjectInner = any, TDiscriminatorInner = any> = AObjectSchema<TObjectInner> | ADiscriminatorSchema<TDiscriminatorInner>;
|
|
179
|
-
declare function isRpcParamSchema(input: unknown): input is RpcParamSchema;
|
|
180
|
-
interface NamedRpc<TIsEventStream extends boolean = false, TParams extends RpcParamSchema | undefined = undefined, TResponse extends RpcParamSchema | undefined = undefined> extends Rpc<TIsEventStream, TParams, TResponse> {
|
|
181
|
-
name: string;
|
|
182
|
-
}
|
|
183
|
-
interface Rpc<TIsEventStream extends boolean = false, TParams extends RpcParamSchema | undefined = undefined, TResponse extends RpcParamSchema | undefined = undefined> {
|
|
184
|
-
transport: "http";
|
|
185
|
-
method?: RpcHttpMethod;
|
|
186
|
-
path?: string;
|
|
187
|
-
description?: string;
|
|
188
|
-
params: TParams;
|
|
189
|
-
response: TResponse;
|
|
190
|
-
isDeprecated?: boolean;
|
|
191
|
-
isEventStream?: TIsEventStream;
|
|
192
|
-
pingInterval?: TIsEventStream extends true ? number : undefined;
|
|
193
|
-
handler: TIsEventStream extends true ? EventStreamRpcHandler<TParams extends RpcParamSchema ? InferType<TParams> : undefined, TResponse extends RpcParamSchema ? InferType<TResponse> : undefined> : RpcHandler<TParams extends RpcParamSchema ? InferType<TParams> : undefined, TResponse extends RpcParamSchema ? InferType<TResponse> : void>;
|
|
194
|
-
postHandler?: TIsEventStream extends true ? undefined : RpcPostHandler<TParams extends RpcParamSchema ? InferType<TParams> : undefined, TResponse extends RpcParamSchema ? InferType<TResponse> : undefined>;
|
|
195
|
-
}
|
|
196
|
-
type HttpRpc<TParams extends RpcParamSchema | undefined, TResponse extends RpcParamSchema | undefined> = Omit<Rpc<false, TParams, TResponse>, "isEventStream">;
|
|
197
|
-
interface RpcEvent<TParams = undefined> extends Omit<H3Event, "context"> {
|
|
198
|
-
context: RpcEventContext<TParams>;
|
|
199
|
-
}
|
|
200
|
-
interface RpcPostEvent<TParams = undefined, TResponse = undefined> extends Omit<H3Event, "context"> {
|
|
201
|
-
context: RpcPostEventContext<TParams, TResponse>;
|
|
202
|
-
}
|
|
203
|
-
type RpcHandler<TParams, TResponse> = (context: RpcEventContext<TParams>, event: RpcEvent<TParams>) => TResponse | Promise<TResponse>;
|
|
204
|
-
type RpcPostHandler<TParams, TResponse> = (context: RpcPostEventContext<TParams, TResponse>, event: RpcPostEvent<TParams, TResponse>) => any;
|
|
205
|
-
declare function isRpc(input: unknown): input is Rpc<any, any>;
|
|
206
|
-
declare function defineRpc<TParams extends RpcParamSchema | undefined = undefined, TResponse extends RpcParamSchema | undefined | never = undefined>(config: Omit<HttpRpc<TParams, TResponse>, "transport">): Rpc<false, TParams, TResponse>;
|
|
207
|
-
declare function createHttpRpcDefinition(rpcName: string, httpPath: string, procedure: Rpc<any, any, any>): HttpRpcDefinition;
|
|
208
|
-
declare function getRpcPath(rpcName: string, prefix?: string): string;
|
|
209
|
-
declare function getRpcParamName(rpcName: string, procedure: Rpc<any, any, any> | WebsocketRpc<any, any>): string | undefined;
|
|
210
|
-
declare function getRpcResponseName(rpcName: string, procedure: Rpc<any, any, any> | WebsocketRpc<any, any>): string | undefined;
|
|
211
|
-
declare function registerRpc(router: Router, path: string, procedure: NamedRpc<any, any, any>, opts: RouteOptions): void;
|
|
212
|
-
declare function validateRpcRequestInput(event: H3Event, httpMethod: RpcHttpMethod, schema: ASchema): Promise<void>;
|
|
213
|
-
|
|
214
|
-
interface ArriRouterBase {
|
|
215
|
-
rpc: <TIsEventStream extends boolean, TParams extends AObjectSchema<any, any> | undefined, TResponse extends AObjectSchema<any, any> | undefined>(procedure: Omit<NamedRpc<TIsEventStream, TParams, TResponse>, "transport">) => void;
|
|
216
|
-
wsRpc: <TParams extends RpcParamSchema | undefined, TResponse extends RpcParamSchema | undefined>(procedure: Omit<NamedWebsocketRpc<TParams, TResponse>, "transport">) => void;
|
|
217
|
-
route: <TPath extends string, TQuery extends AObjectSchema<any, any> = any, TBody extends ASchema<any> = any, TResponse = any>(route: ArriRoute<TPath, TQuery, TBody, TResponse>) => void;
|
|
218
|
-
registerModels: (models: ModelMap) => void;
|
|
219
|
-
}
|
|
220
|
-
declare class ArriRouter implements ArriRouterBase {
|
|
221
|
-
private readonly procedures;
|
|
222
|
-
private readonly routes;
|
|
223
|
-
private readonly models;
|
|
224
|
-
rpc<TIsEventStream extends boolean = false, TParams extends AObjectSchema<any, any> | undefined = undefined, TResponse extends AObjectSchema<any, any> | undefined = undefined>(procedure: Omit<NamedRpc<TIsEventStream, TParams, TResponse>, "transport">): void;
|
|
225
|
-
wsRpc<TParams extends RpcParamSchema | undefined, TResponse extends RpcParamSchema | undefined>(procedure: Omit<NamedWebsocketRpc<TParams, TResponse>, "transport">): void;
|
|
226
|
-
route<TPath extends string, TQuery extends AObjectSchema<any, any> = any, TBody extends ASchema<any> = any, TResponse = any>(route: ArriRoute<TPath, TQuery, TBody, TResponse>): void;
|
|
227
|
-
registerModels(models: ModelMap): void;
|
|
228
|
-
getProcedures(): (NamedWebsocketRpc<any, any> | NamedRpc<any, any, any>)[];
|
|
229
|
-
getRoutes(): ArriRoute<any, any, any, any>[];
|
|
230
|
-
getModels(): ModelMap;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
declare const DEV_ENDPOINT_ROOT = "/__arri_dev__";
|
|
234
|
-
declare const DEV_DEFINITION_ENDPOINT = "/__arri_dev__/__definition";
|
|
235
|
-
type ModelMap = Record<string, SchemaFormProperties | SchemaFormDiscriminator | SchemaFormValues>;
|
|
236
|
-
declare const createAppDefinition: (def: AppDefinition) => AppDefinition;
|
|
237
|
-
declare class ArriApp implements ArriRouterBase {
|
|
238
|
-
__isArri__: boolean;
|
|
239
|
-
readonly h3App: App;
|
|
240
|
-
readonly h3Router: Router;
|
|
241
|
-
private readonly _rpcDefinitionPath;
|
|
242
|
-
private readonly _rpcRoutePrefix;
|
|
243
|
-
appInfo: AppDefinition["info"];
|
|
244
|
-
private _procedures;
|
|
245
|
-
private _models;
|
|
246
|
-
private readonly _middlewares;
|
|
247
|
-
private readonly _onRequest;
|
|
248
|
-
private readonly _onAfterResponse;
|
|
249
|
-
private readonly _onBeforeResponse;
|
|
250
|
-
private readonly _onError;
|
|
251
|
-
private readonly _debug;
|
|
252
|
-
readonly definitionPath: string;
|
|
253
|
-
constructor(opts?: ArriOptions);
|
|
254
|
-
use(input: Middleware | ArriRouter): void;
|
|
255
|
-
rpc<TIsEventStream extends boolean = false, TParams extends AObjectSchema<any, any> | undefined = undefined, TResponse extends AObjectSchema<any, any> | undefined = undefined>(procedure: Omit<NamedRpc<TIsEventStream, TParams, TResponse>, "transport">): void;
|
|
256
|
-
wsRpc<TParams extends RpcParamSchema | undefined, TResponse extends RpcParamSchema | undefined>(procedure: Omit<NamedWebsocketRpc<TParams, TResponse>, "transport">): void;
|
|
257
|
-
route<TPath extends string, TQuery extends AObjectSchema<any, any>, TBody extends ASchema<any>, TResponse = any>(route: ArriRoute<TPath, TQuery, TBody, TResponse>): void;
|
|
258
|
-
registerModels(models: ModelMap): void;
|
|
259
|
-
getAppDefinition(): AppDefinition;
|
|
260
|
-
}
|
|
261
|
-
interface ArriOptions {
|
|
262
|
-
debug?: boolean;
|
|
263
|
-
/**
|
|
264
|
-
* Metadata to display in the __definition.json file
|
|
265
|
-
*/
|
|
266
|
-
appInfo?: AppDefinition["info"];
|
|
267
|
-
rpcRoutePrefix?: string;
|
|
268
|
-
/**
|
|
269
|
-
* Defaults to /__definitions
|
|
270
|
-
* This parameters also takes the rpcRoutePrefix option into account
|
|
271
|
-
*/
|
|
272
|
-
rpcDefinitionPath?: string;
|
|
273
|
-
disableDefaultRoute?: boolean;
|
|
274
|
-
onRequest?: (event: MiddlewareEvent) => void | Promise<void>;
|
|
275
|
-
onAfterResponse?: (event: MiddlewareEvent) => void | Promise<void>;
|
|
276
|
-
onBeforeResponse?: (event: MiddlewareEvent) => void | Promise<void>;
|
|
277
|
-
onError?: (error: ArriServerError, event: MiddlewareEvent) => void | Promise<void>;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
8
|
interface ArriConfig {
|
|
281
9
|
port?: number;
|
|
282
10
|
entry?: string;
|
|
@@ -310,4 +38,6 @@ type ResolvedArriConfig = Required<ArriConfig>;
|
|
|
310
38
|
declare const defaultConfig: Required<ArriConfig>;
|
|
311
39
|
declare function defineConfig(config: ArriConfig): ResolvedArriConfig;
|
|
312
40
|
|
|
313
|
-
|
|
41
|
+
declare const DEV_DEFINITION_ENDPOINT = "/__arri_dev__/__definition";
|
|
42
|
+
|
|
43
|
+
export { type ArriConfig, DEV_DEFINITION_ENDPOINT, type ResolvedArriConfig, defaultConfig, defineConfig, isArriConfig, isResolvedArriConfig };
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export { dartClientGenerator } from '@arrirpc/codegen-dart';
|
|
2
|
+
export { typescriptClientGenerator } from '@arrirpc/codegen-ts';
|
|
3
|
+
export { kotlinClientGenerator } from '@arrirpc/codegen-kotlin';
|
|
4
|
+
export { createAppDefinition } from '@arrirpc/codegen-utils';
|
|
5
|
+
export { D as DEV_DEFINITION_ENDPOINT, d as defaultConfig, b as defineConfig, i as isArriConfig, a as isResolvedArriConfig } from './shared/arri.e5993636.mjs';
|
|
6
|
+
import 'node:fs';
|
|
7
|
+
import 'node:fs/promises';
|
|
8
|
+
import '@joshmossas/listhen';
|
|
9
|
+
import 'c12';
|
|
10
|
+
import 'citty';
|
|
11
|
+
import 'esbuild';
|
|
12
|
+
import 'ofetch';
|
|
13
|
+
import 'pathe';
|
|
14
|
+
import 'consola';
|
|
15
|
+
import 'prettier';
|
|
6
16
|
import 'scule';
|
|
7
|
-
|
|
8
|
-
const defineMiddleware = (middleware) => middleware;
|
|
9
|
-
|
|
10
|
-
export { defineMiddleware };
|