arri 0.1.0-beta.6 → 0.1.0-beta.8
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/cli.cjs +12 -14
- package/dist/cli.mjs +12 -14
- package/dist/index.cjs +3 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +1 -1
- package/dist/shared/{arri.18968810.mjs → arri.16b8531c.mjs} +26 -26
- package/dist/shared/{arri.45622e4c.cjs → arri.eea9df0a.cjs} +27 -25
- package/package.json +5 -5
package/dist/cli.cjs
CHANGED
|
@@ -11,7 +11,7 @@ const consola = require('consola');
|
|
|
11
11
|
const esbuild = require('esbuild');
|
|
12
12
|
const path = require('pathe');
|
|
13
13
|
const prettier = require('prettier');
|
|
14
|
-
const config = require('./shared/arri.
|
|
14
|
+
const config = require('./shared/arri.eea9df0a.cjs');
|
|
15
15
|
const globby = require('globby');
|
|
16
16
|
const scule = require('scule');
|
|
17
17
|
const arriCodegenDart = require('arri-codegen-dart');
|
|
@@ -142,12 +142,12 @@ const getRpcMetaFromPath = (config, filePath) => {
|
|
|
142
142
|
httpPath: `/${httpParts.join("/")}`
|
|
143
143
|
};
|
|
144
144
|
};
|
|
145
|
-
async function
|
|
145
|
+
async function transpileFiles(config) {
|
|
146
146
|
const outDir = path__default.resolve(config.rootDir, config.buildDir);
|
|
147
147
|
const files = await globby.globby(["**/*.ts"], {
|
|
148
148
|
cwd: path__default.resolve(config.rootDir, config.srcDir)
|
|
149
149
|
});
|
|
150
|
-
|
|
150
|
+
await esbuild__namespace.build({
|
|
151
151
|
entryPoints: [
|
|
152
152
|
...files.map(
|
|
153
153
|
(file) => path__default.resolve(config.rootDir, config.srcDir, file)
|
|
@@ -159,7 +159,6 @@ async function transpileFilesContext(config) {
|
|
|
159
159
|
target: "node18",
|
|
160
160
|
platform: "node"
|
|
161
161
|
});
|
|
162
|
-
return ctx;
|
|
163
162
|
}
|
|
164
163
|
|
|
165
164
|
const build = citty.defineCommand({
|
|
@@ -195,8 +194,7 @@ async function startBuild(config, skipCodeGen = false) {
|
|
|
195
194
|
createBuildEntryModule(config),
|
|
196
195
|
createBuildCodegenModule(config)
|
|
197
196
|
]);
|
|
198
|
-
|
|
199
|
-
await transpile.rebuild();
|
|
197
|
+
await transpileFiles(config);
|
|
200
198
|
await bundleFiles(config);
|
|
201
199
|
logger$1.log("Finished bundling");
|
|
202
200
|
const clientCount = config.clientGenerators.length;
|
|
@@ -224,7 +222,6 @@ async function startBuild(config, skipCodeGen = false) {
|
|
|
224
222
|
logger$1.log(
|
|
225
223
|
`Build finished! You can start your server by running "node .output/server.js"`
|
|
226
224
|
);
|
|
227
|
-
await transpile.dispose();
|
|
228
225
|
}
|
|
229
226
|
async function bundleFiles(config, allowCodegen = true) {
|
|
230
227
|
if (allowCodegen) {
|
|
@@ -429,7 +426,7 @@ const dev = citty.defineCommand({
|
|
|
429
426
|
await startDevServer(config$1);
|
|
430
427
|
}
|
|
431
428
|
});
|
|
432
|
-
const startListener = (config, showQr = false) => listhen.listenAndWatch(path__default.resolve(config.rootDir, ".output", "
|
|
429
|
+
const startListener = (config, showQr = false) => listhen.listenAndWatch(path__default.resolve(config.rootDir, ".output", "server.js"), {
|
|
433
430
|
public: true,
|
|
434
431
|
port: config.port,
|
|
435
432
|
logger,
|
|
@@ -441,7 +438,7 @@ async function bundleFilesContext(config) {
|
|
|
441
438
|
entryPoints: [
|
|
442
439
|
path__default.resolve(config.rootDir, config.buildDir, "entry.js")
|
|
443
440
|
],
|
|
444
|
-
outfile: path__default.resolve(config.rootDir, ".output", "
|
|
441
|
+
outfile: path__default.resolve(config.rootDir, ".output", "server.js"),
|
|
445
442
|
format: "esm",
|
|
446
443
|
bundle: true,
|
|
447
444
|
sourcemap: true,
|
|
@@ -454,9 +451,8 @@ async function startDevServer(config) {
|
|
|
454
451
|
await setupWorkingDir(config);
|
|
455
452
|
let fileWatcher;
|
|
456
453
|
await Promise.all([createRoutesModule(config), createEntryModule(config)]);
|
|
457
|
-
|
|
454
|
+
await transpileFiles(config);
|
|
458
455
|
const bundleFiles = await bundleFilesContext(config);
|
|
459
|
-
await transpileFiles.rebuild();
|
|
460
456
|
await bundleFiles.rebuild();
|
|
461
457
|
const listener = await startListener(config, true);
|
|
462
458
|
setTimeout(async () => {
|
|
@@ -469,7 +465,6 @@ async function startDevServer(config) {
|
|
|
469
465
|
await Promise.allSettled([
|
|
470
466
|
listener.close(),
|
|
471
467
|
fileWatcher?.close(),
|
|
472
|
-
transpileFiles.dispose(),
|
|
473
468
|
bundleFiles.dispose()
|
|
474
469
|
]);
|
|
475
470
|
});
|
|
@@ -490,14 +485,17 @@ async function startDevServer(config) {
|
|
|
490
485
|
ignored: [buildDir, outDir],
|
|
491
486
|
ignoreInitial: true
|
|
492
487
|
});
|
|
493
|
-
fileWatcher.on("all", async (
|
|
488
|
+
fileWatcher.on("all", async (event, file) => {
|
|
489
|
+
if (event === "add" || event === "addDir") {
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
494
492
|
await createRoutesModule(config);
|
|
495
493
|
let bundleCreated = false;
|
|
496
494
|
try {
|
|
497
495
|
logger.log(
|
|
498
496
|
"Change detected. Bundling files and restarting server...."
|
|
499
497
|
);
|
|
500
|
-
await transpileFiles
|
|
498
|
+
await transpileFiles(config);
|
|
501
499
|
await bundleFiles.rebuild();
|
|
502
500
|
bundleCreated = true;
|
|
503
501
|
} catch (err) {
|
package/dist/cli.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import * as esbuild from 'esbuild';
|
|
|
10
10
|
import { build as build$1 } from 'esbuild';
|
|
11
11
|
import path from 'pathe';
|
|
12
12
|
import prettier from 'prettier';
|
|
13
|
-
import { m as defaultConfig, l as isResolvedArriConfig, a as DEV_DEFINITION_ENDPOINT } from './shared/arri.
|
|
13
|
+
import { m as defaultConfig, l as isResolvedArriConfig, a as DEV_DEFINITION_ENDPOINT } from './shared/arri.16b8531c.mjs';
|
|
14
14
|
import { globby } from 'globby';
|
|
15
15
|
import { camelCase, kebabCase } from 'scule';
|
|
16
16
|
import { dartClientGenerator } from 'arri-codegen-dart';
|
|
@@ -121,12 +121,12 @@ const getRpcMetaFromPath = (config, filePath) => {
|
|
|
121
121
|
httpPath: `/${httpParts.join("/")}`
|
|
122
122
|
};
|
|
123
123
|
};
|
|
124
|
-
async function
|
|
124
|
+
async function transpileFiles(config) {
|
|
125
125
|
const outDir = path.resolve(config.rootDir, config.buildDir);
|
|
126
126
|
const files = await globby(["**/*.ts"], {
|
|
127
127
|
cwd: path.resolve(config.rootDir, config.srcDir)
|
|
128
128
|
});
|
|
129
|
-
|
|
129
|
+
await esbuild.build({
|
|
130
130
|
entryPoints: [
|
|
131
131
|
...files.map(
|
|
132
132
|
(file) => path.resolve(config.rootDir, config.srcDir, file)
|
|
@@ -138,7 +138,6 @@ async function transpileFilesContext(config) {
|
|
|
138
138
|
target: "node18",
|
|
139
139
|
platform: "node"
|
|
140
140
|
});
|
|
141
|
-
return ctx;
|
|
142
141
|
}
|
|
143
142
|
|
|
144
143
|
const build = defineCommand({
|
|
@@ -174,8 +173,7 @@ async function startBuild(config, skipCodeGen = false) {
|
|
|
174
173
|
createBuildEntryModule(config),
|
|
175
174
|
createBuildCodegenModule(config)
|
|
176
175
|
]);
|
|
177
|
-
|
|
178
|
-
await transpile.rebuild();
|
|
176
|
+
await transpileFiles(config);
|
|
179
177
|
await bundleFiles(config);
|
|
180
178
|
logger$1.log("Finished bundling");
|
|
181
179
|
const clientCount = config.clientGenerators.length;
|
|
@@ -203,7 +201,6 @@ async function startBuild(config, skipCodeGen = false) {
|
|
|
203
201
|
logger$1.log(
|
|
204
202
|
`Build finished! You can start your server by running "node .output/server.js"`
|
|
205
203
|
);
|
|
206
|
-
await transpile.dispose();
|
|
207
204
|
}
|
|
208
205
|
async function bundleFiles(config, allowCodegen = true) {
|
|
209
206
|
if (allowCodegen) {
|
|
@@ -408,7 +405,7 @@ const dev = defineCommand({
|
|
|
408
405
|
await startDevServer(config);
|
|
409
406
|
}
|
|
410
407
|
});
|
|
411
|
-
const startListener = (config, showQr = false) => listenAndWatch(path.resolve(config.rootDir, ".output", "
|
|
408
|
+
const startListener = (config, showQr = false) => listenAndWatch(path.resolve(config.rootDir, ".output", "server.js"), {
|
|
412
409
|
public: true,
|
|
413
410
|
port: config.port,
|
|
414
411
|
logger,
|
|
@@ -420,7 +417,7 @@ async function bundleFilesContext(config) {
|
|
|
420
417
|
entryPoints: [
|
|
421
418
|
path.resolve(config.rootDir, config.buildDir, "entry.js")
|
|
422
419
|
],
|
|
423
|
-
outfile: path.resolve(config.rootDir, ".output", "
|
|
420
|
+
outfile: path.resolve(config.rootDir, ".output", "server.js"),
|
|
424
421
|
format: "esm",
|
|
425
422
|
bundle: true,
|
|
426
423
|
sourcemap: true,
|
|
@@ -433,9 +430,8 @@ async function startDevServer(config) {
|
|
|
433
430
|
await setupWorkingDir(config);
|
|
434
431
|
let fileWatcher;
|
|
435
432
|
await Promise.all([createRoutesModule(config), createEntryModule(config)]);
|
|
436
|
-
|
|
433
|
+
await transpileFiles(config);
|
|
437
434
|
const bundleFiles = await bundleFilesContext(config);
|
|
438
|
-
await transpileFiles.rebuild();
|
|
439
435
|
await bundleFiles.rebuild();
|
|
440
436
|
const listener = await startListener(config, true);
|
|
441
437
|
setTimeout(async () => {
|
|
@@ -448,7 +444,6 @@ async function startDevServer(config) {
|
|
|
448
444
|
await Promise.allSettled([
|
|
449
445
|
listener.close(),
|
|
450
446
|
fileWatcher?.close(),
|
|
451
|
-
transpileFiles.dispose(),
|
|
452
447
|
bundleFiles.dispose()
|
|
453
448
|
]);
|
|
454
449
|
});
|
|
@@ -469,14 +464,17 @@ async function startDevServer(config) {
|
|
|
469
464
|
ignored: [buildDir, outDir],
|
|
470
465
|
ignoreInitial: true
|
|
471
466
|
});
|
|
472
|
-
fileWatcher.on("all", async (
|
|
467
|
+
fileWatcher.on("all", async (event, file) => {
|
|
468
|
+
if (event === "add" || event === "addDir") {
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
473
471
|
await createRoutesModule(config);
|
|
474
472
|
let bundleCreated = false;
|
|
475
473
|
try {
|
|
476
474
|
logger.log(
|
|
477
475
|
"Change detected. Bundling files and restarting server...."
|
|
478
476
|
);
|
|
479
|
-
await transpileFiles
|
|
477
|
+
await transpileFiles(config);
|
|
480
478
|
await bundleFiles.rebuild();
|
|
481
479
|
bundleCreated = true;
|
|
482
480
|
} catch (err) {
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const config = require('./shared/arri.
|
|
3
|
+
const config = require('./shared/arri.eea9df0a.cjs');
|
|
4
4
|
const h3 = require('h3');
|
|
5
5
|
require('arri-validate');
|
|
6
6
|
require('arri-codegen-utils');
|
|
@@ -24,9 +24,11 @@ exports.getRpcParamName = config.getRpcParamName;
|
|
|
24
24
|
exports.getRpcPath = config.getRpcPath;
|
|
25
25
|
exports.getRpcResponseName = config.getRpcResponseName;
|
|
26
26
|
exports.handleH3Error = config.handleH3Error;
|
|
27
|
+
exports.handleRoute = config.handleRoute;
|
|
27
28
|
exports.isArriConfig = config.isArriConfig;
|
|
28
29
|
exports.isResolvedArriConfig = config.isResolvedArriConfig;
|
|
29
30
|
exports.isRpc = config.isRpc;
|
|
31
|
+
exports.registerRoute = config.registerRoute;
|
|
30
32
|
exports.registerRpc = config.registerRpc;
|
|
31
33
|
exports.defineMiddleware = defineMiddleware;
|
|
32
34
|
Object.keys(h3).forEach(function (k) {
|
package/dist/index.d.cts
CHANGED
|
@@ -13,11 +13,9 @@ interface MiddlewareEvent extends H3Event {
|
|
|
13
13
|
}
|
|
14
14
|
type Middleware = (event: MiddlewareEvent) => void | Promise<void>;
|
|
15
15
|
declare const defineMiddleware: (middleware: Middleware) => Middleware;
|
|
16
|
-
type ExtractParam$1<Path, NextPart> = Path extends `:${infer Param}` ? Record<Param, string> & NextPart : NextPart;
|
|
17
|
-
type ExtractParams$1<Path> = Path extends `${infer Segment}/${infer Rest}` ? ExtractParam$1<Segment, ExtractParams$1<Rest>> : ExtractParam$1<Path, {}>;
|
|
18
|
-
|
|
19
16
|
type ExtractParam<Path, NextPart> = Path extends `:${infer Param}` ? Record<Param, string> & NextPart : NextPart;
|
|
20
17
|
type ExtractParams<Path> = Path extends `${infer Segment}/${infer Rest}` ? ExtractParam<Segment, ExtractParams<Rest>> : ExtractParam<Path, {}>;
|
|
18
|
+
|
|
21
19
|
interface RouteEventContext<TPath extends string, TQuery extends Record<any, any> = any, TBody = any> extends H3EventContext {
|
|
22
20
|
params: ExtractParams<TPath>;
|
|
23
21
|
query: TQuery;
|
|
@@ -44,6 +42,8 @@ declare function defineRoute<TPath extends string, TQuery extends AObjectSchema<
|
|
|
44
42
|
type RouteOptions = Pick<ArriOptions, "onAfterResponse" | "onBeforeResponse" | "onError" | "onRequest"> & {
|
|
45
43
|
middleware: Middleware[];
|
|
46
44
|
};
|
|
45
|
+
declare function registerRoute(router: Router, route: ArriRoute<any>, opts: RouteOptions): void;
|
|
46
|
+
declare function handleRoute(router: Router, method: HttpMethod, route: ArriRoute<any>, opts: RouteOptions): void;
|
|
47
47
|
|
|
48
48
|
interface ArriProcedure<TParams extends AObjectSchema | undefined, TResponse extends AObjectSchema | undefined> {
|
|
49
49
|
description?: string;
|
|
@@ -168,4 +168,4 @@ type ResolvedArriConfig = Required<ArriConfig>;
|
|
|
168
168
|
declare const defaultConfig: Required<ArriConfig>;
|
|
169
169
|
declare function defineConfig(config: ArriConfig): ResolvedArriConfig;
|
|
170
170
|
|
|
171
|
-
export { ArriApp, type ArriConfig, type ArriNamedProcedure, type ArriOptions, type ArriProcedure, type ArriProcedureHandler, type ArriProcedurePostHandler, type ArriRoute, ArriRouter, type ArriRouterBase, DEV_DEFINITION_ENDPOINT, DEV_ENDPOINT_ROOT, ErrorResponse, type ExtractParam
|
|
171
|
+
export { ArriApp, type ArriConfig, type ArriNamedProcedure, type ArriOptions, type ArriProcedure, type ArriProcedureHandler, type ArriProcedurePostHandler, type ArriRoute, ArriRouter, type ArriRouterBase, DEV_DEFINITION_ENDPOINT, DEV_ENDPOINT_ROOT, ErrorResponse, type ExtractParam, type ExtractParams, type HandlerContext, type Middleware, type MiddlewareEvent, type MiddlewareEventContext, type PostRouteEvent, type PostRouteEventContext, type ResolvedArriConfig, type RouteEvent, type RouteEventContext, type RouteOptions, type RpcEvent, type RpcHandlerContext, type RpcPostEvent, type RpcPostHandlerContext, type StatusCode, createRpcDefinition, defaultConfig, defineConfig, defineError, defineMiddleware, defineRoute, defineRpc, errorResponseFromValidationErrors, getRpcParamName, getRpcPath, getRpcResponseName, handleH3Error, handleRoute, isArriConfig, isResolvedArriConfig, isRpc, registerRoute, registerRpc };
|
package/dist/index.d.mts
CHANGED
|
@@ -13,11 +13,9 @@ interface MiddlewareEvent extends H3Event {
|
|
|
13
13
|
}
|
|
14
14
|
type Middleware = (event: MiddlewareEvent) => void | Promise<void>;
|
|
15
15
|
declare const defineMiddleware: (middleware: Middleware) => Middleware;
|
|
16
|
-
type ExtractParam$1<Path, NextPart> = Path extends `:${infer Param}` ? Record<Param, string> & NextPart : NextPart;
|
|
17
|
-
type ExtractParams$1<Path> = Path extends `${infer Segment}/${infer Rest}` ? ExtractParam$1<Segment, ExtractParams$1<Rest>> : ExtractParam$1<Path, {}>;
|
|
18
|
-
|
|
19
16
|
type ExtractParam<Path, NextPart> = Path extends `:${infer Param}` ? Record<Param, string> & NextPart : NextPart;
|
|
20
17
|
type ExtractParams<Path> = Path extends `${infer Segment}/${infer Rest}` ? ExtractParam<Segment, ExtractParams<Rest>> : ExtractParam<Path, {}>;
|
|
18
|
+
|
|
21
19
|
interface RouteEventContext<TPath extends string, TQuery extends Record<any, any> = any, TBody = any> extends H3EventContext {
|
|
22
20
|
params: ExtractParams<TPath>;
|
|
23
21
|
query: TQuery;
|
|
@@ -44,6 +42,8 @@ declare function defineRoute<TPath extends string, TQuery extends AObjectSchema<
|
|
|
44
42
|
type RouteOptions = Pick<ArriOptions, "onAfterResponse" | "onBeforeResponse" | "onError" | "onRequest"> & {
|
|
45
43
|
middleware: Middleware[];
|
|
46
44
|
};
|
|
45
|
+
declare function registerRoute(router: Router, route: ArriRoute<any>, opts: RouteOptions): void;
|
|
46
|
+
declare function handleRoute(router: Router, method: HttpMethod, route: ArriRoute<any>, opts: RouteOptions): void;
|
|
47
47
|
|
|
48
48
|
interface ArriProcedure<TParams extends AObjectSchema | undefined, TResponse extends AObjectSchema | undefined> {
|
|
49
49
|
description?: string;
|
|
@@ -168,4 +168,4 @@ type ResolvedArriConfig = Required<ArriConfig>;
|
|
|
168
168
|
declare const defaultConfig: Required<ArriConfig>;
|
|
169
169
|
declare function defineConfig(config: ArriConfig): ResolvedArriConfig;
|
|
170
170
|
|
|
171
|
-
export { ArriApp, type ArriConfig, type ArriNamedProcedure, type ArriOptions, type ArriProcedure, type ArriProcedureHandler, type ArriProcedurePostHandler, type ArriRoute, ArriRouter, type ArriRouterBase, DEV_DEFINITION_ENDPOINT, DEV_ENDPOINT_ROOT, ErrorResponse, type ExtractParam
|
|
171
|
+
export { ArriApp, type ArriConfig, type ArriNamedProcedure, type ArriOptions, type ArriProcedure, type ArriProcedureHandler, type ArriProcedurePostHandler, type ArriRoute, ArriRouter, type ArriRouterBase, DEV_DEFINITION_ENDPOINT, DEV_ENDPOINT_ROOT, ErrorResponse, type ExtractParam, type ExtractParams, type HandlerContext, type Middleware, type MiddlewareEvent, type MiddlewareEventContext, type PostRouteEvent, type PostRouteEventContext, type ResolvedArriConfig, type RouteEvent, type RouteEventContext, type RouteOptions, type RpcEvent, type RpcHandlerContext, type RpcPostEvent, type RpcPostHandlerContext, type StatusCode, createRpcDefinition, defaultConfig, defineConfig, defineError, defineMiddleware, defineRoute, defineRpc, errorResponseFromValidationErrors, getRpcParamName, getRpcPath, getRpcResponseName, handleH3Error, handleRoute, isArriConfig, isResolvedArriConfig, isRpc, registerRoute, registerRpc };
|
package/dist/index.d.ts
CHANGED
|
@@ -13,11 +13,9 @@ interface MiddlewareEvent extends H3Event {
|
|
|
13
13
|
}
|
|
14
14
|
type Middleware = (event: MiddlewareEvent) => void | Promise<void>;
|
|
15
15
|
declare const defineMiddleware: (middleware: Middleware) => Middleware;
|
|
16
|
-
type ExtractParam$1<Path, NextPart> = Path extends `:${infer Param}` ? Record<Param, string> & NextPart : NextPart;
|
|
17
|
-
type ExtractParams$1<Path> = Path extends `${infer Segment}/${infer Rest}` ? ExtractParam$1<Segment, ExtractParams$1<Rest>> : ExtractParam$1<Path, {}>;
|
|
18
|
-
|
|
19
16
|
type ExtractParam<Path, NextPart> = Path extends `:${infer Param}` ? Record<Param, string> & NextPart : NextPart;
|
|
20
17
|
type ExtractParams<Path> = Path extends `${infer Segment}/${infer Rest}` ? ExtractParam<Segment, ExtractParams<Rest>> : ExtractParam<Path, {}>;
|
|
18
|
+
|
|
21
19
|
interface RouteEventContext<TPath extends string, TQuery extends Record<any, any> = any, TBody = any> extends H3EventContext {
|
|
22
20
|
params: ExtractParams<TPath>;
|
|
23
21
|
query: TQuery;
|
|
@@ -44,6 +42,8 @@ declare function defineRoute<TPath extends string, TQuery extends AObjectSchema<
|
|
|
44
42
|
type RouteOptions = Pick<ArriOptions, "onAfterResponse" | "onBeforeResponse" | "onError" | "onRequest"> & {
|
|
45
43
|
middleware: Middleware[];
|
|
46
44
|
};
|
|
45
|
+
declare function registerRoute(router: Router, route: ArriRoute<any>, opts: RouteOptions): void;
|
|
46
|
+
declare function handleRoute(router: Router, method: HttpMethod, route: ArriRoute<any>, opts: RouteOptions): void;
|
|
47
47
|
|
|
48
48
|
interface ArriProcedure<TParams extends AObjectSchema | undefined, TResponse extends AObjectSchema | undefined> {
|
|
49
49
|
description?: string;
|
|
@@ -168,4 +168,4 @@ type ResolvedArriConfig = Required<ArriConfig>;
|
|
|
168
168
|
declare const defaultConfig: Required<ArriConfig>;
|
|
169
169
|
declare function defineConfig(config: ArriConfig): ResolvedArriConfig;
|
|
170
170
|
|
|
171
|
-
export { ArriApp, type ArriConfig, type ArriNamedProcedure, type ArriOptions, type ArriProcedure, type ArriProcedureHandler, type ArriProcedurePostHandler, type ArriRoute, ArriRouter, type ArriRouterBase, DEV_DEFINITION_ENDPOINT, DEV_ENDPOINT_ROOT, ErrorResponse, type ExtractParam
|
|
171
|
+
export { ArriApp, type ArriConfig, type ArriNamedProcedure, type ArriOptions, type ArriProcedure, type ArriProcedureHandler, type ArriProcedurePostHandler, type ArriRoute, ArriRouter, type ArriRouterBase, DEV_DEFINITION_ENDPOINT, DEV_ENDPOINT_ROOT, ErrorResponse, type ExtractParam, type ExtractParams, type HandlerContext, type Middleware, type MiddlewareEvent, type MiddlewareEventContext, type PostRouteEvent, type PostRouteEventContext, type ResolvedArriConfig, type RouteEvent, type RouteEventContext, type RouteOptions, type RpcEvent, type RpcHandlerContext, type RpcPostEvent, type RpcPostHandlerContext, type StatusCode, createRpcDefinition, defaultConfig, defineConfig, defineError, defineMiddleware, defineRoute, defineRpc, errorResponseFromValidationErrors, getRpcParamName, getRpcPath, getRpcResponseName, handleH3Error, handleRoute, isArriConfig, isResolvedArriConfig, isRpc, registerRoute, registerRpc };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ArriApp, o as ArriRouter, a as DEV_DEFINITION_ENDPOINT, D as DEV_ENDPOINT_ROOT, E as ErrorResponse, c as createRpcDefinition, m as defaultConfig, n as defineConfig, f as defineError, p as defineRoute, d as defineRpc, h as errorResponseFromValidationErrors, b as getRpcParamName, g as getRpcPath, e as getRpcResponseName, j as handleH3Error, k as isArriConfig, l as isResolvedArriConfig, i as isRpc, r as registerRpc } from './shared/arri.
|
|
1
|
+
export { A as ArriApp, o as ArriRouter, a as DEV_DEFINITION_ENDPOINT, D as DEV_ENDPOINT_ROOT, E as ErrorResponse, c as createRpcDefinition, m as defaultConfig, n as defineConfig, f as defineError, p as defineRoute, d as defineRpc, h as errorResponseFromValidationErrors, b as getRpcParamName, g as getRpcPath, e as getRpcResponseName, j as handleH3Error, s as handleRoute, k as isArriConfig, l as isResolvedArriConfig, i as isRpc, q as registerRoute, r as registerRpc } from './shared/arri.16b8531c.mjs';
|
|
2
2
|
export * from 'h3';
|
|
3
3
|
import 'arri-validate';
|
|
4
4
|
import 'arri-codegen-utils';
|
|
@@ -405,6 +405,31 @@ function registerRpc(router, path, procedure, opts) {
|
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
407
|
|
|
408
|
+
var __defProp$1 = Object.defineProperty;
|
|
409
|
+
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
410
|
+
var __publicField$1 = (obj, key, value) => {
|
|
411
|
+
__defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
412
|
+
return value;
|
|
413
|
+
};
|
|
414
|
+
class ArriRouter {
|
|
415
|
+
constructor() {
|
|
416
|
+
__publicField$1(this, "procedures", []);
|
|
417
|
+
__publicField$1(this, "routes", []);
|
|
418
|
+
}
|
|
419
|
+
rpc(procedure) {
|
|
420
|
+
this.procedures.push(procedure);
|
|
421
|
+
}
|
|
422
|
+
route(route) {
|
|
423
|
+
this.routes.push(route);
|
|
424
|
+
}
|
|
425
|
+
getProcedures() {
|
|
426
|
+
return this.procedures;
|
|
427
|
+
}
|
|
428
|
+
getRoutes() {
|
|
429
|
+
return this.routes;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
|
|
408
433
|
function defineRoute(route) {
|
|
409
434
|
return route;
|
|
410
435
|
}
|
|
@@ -526,31 +551,6 @@ function handleRoute(router, method, route, opts) {
|
|
|
526
551
|
}
|
|
527
552
|
}
|
|
528
553
|
|
|
529
|
-
var __defProp$1 = Object.defineProperty;
|
|
530
|
-
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
531
|
-
var __publicField$1 = (obj, key, value) => {
|
|
532
|
-
__defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
533
|
-
return value;
|
|
534
|
-
};
|
|
535
|
-
class ArriRouter {
|
|
536
|
-
constructor() {
|
|
537
|
-
__publicField$1(this, "procedures", []);
|
|
538
|
-
__publicField$1(this, "routes", []);
|
|
539
|
-
}
|
|
540
|
-
rpc(procedure) {
|
|
541
|
-
this.procedures.push(procedure);
|
|
542
|
-
}
|
|
543
|
-
route(route) {
|
|
544
|
-
this.routes.push(route);
|
|
545
|
-
}
|
|
546
|
-
getProcedures() {
|
|
547
|
-
return this.procedures;
|
|
548
|
-
}
|
|
549
|
-
getRoutes() {
|
|
550
|
-
return this.routes;
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
|
|
554
554
|
var __defProp = Object.defineProperty;
|
|
555
555
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
556
556
|
var __publicField = (obj, key, value) => {
|
|
@@ -725,4 +725,4 @@ function defineConfig(config) {
|
|
|
725
725
|
};
|
|
726
726
|
}
|
|
727
727
|
|
|
728
|
-
export { ArriApp as A, DEV_ENDPOINT_ROOT as D, ErrorResponse as E, DEV_DEFINITION_ENDPOINT as a, getRpcParamName as b, createRpcDefinition as c, defineRpc as d, getRpcResponseName as e, defineError as f, getRpcPath as g, errorResponseFromValidationErrors as h, isRpc as i, handleH3Error as j, isArriConfig as k, isResolvedArriConfig as l, defaultConfig as m, defineConfig as n, ArriRouter as o, defineRoute as p, registerRpc as r };
|
|
728
|
+
export { ArriApp as A, DEV_ENDPOINT_ROOT as D, ErrorResponse as E, DEV_DEFINITION_ENDPOINT as a, getRpcParamName as b, createRpcDefinition as c, defineRpc as d, getRpcResponseName as e, defineError as f, getRpcPath as g, errorResponseFromValidationErrors as h, isRpc as i, handleH3Error as j, isArriConfig as k, isResolvedArriConfig as l, defaultConfig as m, defineConfig as n, ArriRouter as o, defineRoute as p, registerRoute as q, registerRpc as r, handleRoute as s };
|
|
@@ -407,6 +407,31 @@ function registerRpc(router, path, procedure, opts) {
|
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
|
|
410
|
+
var __defProp$1 = Object.defineProperty;
|
|
411
|
+
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
412
|
+
var __publicField$1 = (obj, key, value) => {
|
|
413
|
+
__defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
414
|
+
return value;
|
|
415
|
+
};
|
|
416
|
+
class ArriRouter {
|
|
417
|
+
constructor() {
|
|
418
|
+
__publicField$1(this, "procedures", []);
|
|
419
|
+
__publicField$1(this, "routes", []);
|
|
420
|
+
}
|
|
421
|
+
rpc(procedure) {
|
|
422
|
+
this.procedures.push(procedure);
|
|
423
|
+
}
|
|
424
|
+
route(route) {
|
|
425
|
+
this.routes.push(route);
|
|
426
|
+
}
|
|
427
|
+
getProcedures() {
|
|
428
|
+
return this.procedures;
|
|
429
|
+
}
|
|
430
|
+
getRoutes() {
|
|
431
|
+
return this.routes;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
410
435
|
function defineRoute(route) {
|
|
411
436
|
return route;
|
|
412
437
|
}
|
|
@@ -528,31 +553,6 @@ function handleRoute(router, method, route, opts) {
|
|
|
528
553
|
}
|
|
529
554
|
}
|
|
530
555
|
|
|
531
|
-
var __defProp$1 = Object.defineProperty;
|
|
532
|
-
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
533
|
-
var __publicField$1 = (obj, key, value) => {
|
|
534
|
-
__defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
535
|
-
return value;
|
|
536
|
-
};
|
|
537
|
-
class ArriRouter {
|
|
538
|
-
constructor() {
|
|
539
|
-
__publicField$1(this, "procedures", []);
|
|
540
|
-
__publicField$1(this, "routes", []);
|
|
541
|
-
}
|
|
542
|
-
rpc(procedure) {
|
|
543
|
-
this.procedures.push(procedure);
|
|
544
|
-
}
|
|
545
|
-
route(route) {
|
|
546
|
-
this.routes.push(route);
|
|
547
|
-
}
|
|
548
|
-
getProcedures() {
|
|
549
|
-
return this.procedures;
|
|
550
|
-
}
|
|
551
|
-
getRoutes() {
|
|
552
|
-
return this.routes;
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
|
|
556
556
|
var __defProp = Object.defineProperty;
|
|
557
557
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
558
558
|
var __publicField = (obj, key, value) => {
|
|
@@ -743,7 +743,9 @@ exports.getRpcParamName = getRpcParamName;
|
|
|
743
743
|
exports.getRpcPath = getRpcPath;
|
|
744
744
|
exports.getRpcResponseName = getRpcResponseName;
|
|
745
745
|
exports.handleH3Error = handleH3Error;
|
|
746
|
+
exports.handleRoute = handleRoute;
|
|
746
747
|
exports.isArriConfig = isArriConfig;
|
|
747
748
|
exports.isResolvedArriConfig = isResolvedArriConfig;
|
|
748
749
|
exports.isRpc = isRpc;
|
|
750
|
+
exports.registerRoute = registerRoute;
|
|
749
751
|
exports.registerRpc = registerRpc;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arri",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"pathe": "^1.1.1",
|
|
32
32
|
"prettier": "^3.0.3",
|
|
33
33
|
"scule": "^1.0.0",
|
|
34
|
-
"arri-codegen-
|
|
35
|
-
"arri-
|
|
36
|
-
"arri-
|
|
37
|
-
"arri-codegen-ts": "0.1.0-beta.
|
|
34
|
+
"arri-codegen-dart": "0.1.0-beta.8",
|
|
35
|
+
"arri-validate": "0.1.0-beta.8",
|
|
36
|
+
"arri-codegen-utils": "0.1.0-beta.8",
|
|
37
|
+
"arri-codegen-ts": "0.1.0-beta.8"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"bun-types": "^1.0.5"
|