@arrirpc/server 0.57.6 → 0.58.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 +3 -1
- package/dist/index.cjs +1 -3
- package/dist/index.d.cts +5 -3
- package/dist/index.d.mts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.mjs +1 -3
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -276,7 +276,9 @@ stream.close()
|
|
|
276
276
|
stream.onClosed(cb: () => any)
|
|
277
277
|
```
|
|
278
278
|
|
|
279
|
-
### Creating Websocket Procedures (Experimental
|
|
279
|
+
### Creating Websocket Procedures (Experimental
|
|
280
|
+
|
|
281
|
+
Very experimental. Do not use in production.
|
|
280
282
|
|
|
281
283
|
```ts
|
|
282
284
|
// Websocket procedures work really well with discriminated unions
|
package/dist/index.cjs
CHANGED
|
@@ -349,9 +349,7 @@ function registerRpc(router, path, procedure, opts) {
|
|
|
349
349
|
);
|
|
350
350
|
}
|
|
351
351
|
const response = await procedure.handler(
|
|
352
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
353
352
|
event.context,
|
|
354
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
355
353
|
event
|
|
356
354
|
);
|
|
357
355
|
event.context.response = response;
|
|
@@ -475,7 +473,7 @@ function getSchemaValidator(rpcName, type, schema$1) {
|
|
|
475
473
|
return schema.validatorFromAdaptedSchema(schema$1);
|
|
476
474
|
}
|
|
477
475
|
return schema.a.compile(schema$1);
|
|
478
|
-
} catch (
|
|
476
|
+
} catch (_) {
|
|
479
477
|
console.error(`Error compiling ${type} validator for ${rpcName}`);
|
|
480
478
|
return void 0;
|
|
481
479
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -12,7 +12,7 @@ declare const defineMiddleware: (middleware: Middleware) => Middleware;
|
|
|
12
12
|
type ExtractParam<Path, NextPart> = Path extends `:${infer Param}` ? Record<Param, string> & NextPart : NextPart;
|
|
13
13
|
type ExtractParams<Path> = Path extends `${infer Segment}/${infer Rest}` ? ExtractParam<Segment, ExtractParams<Rest>> : ExtractParam<Path, {}>;
|
|
14
14
|
|
|
15
|
-
interface ArriEventContext extends Record<string,
|
|
15
|
+
interface ArriEventContext extends Record<string, any> {
|
|
16
16
|
}
|
|
17
17
|
type RpcEventContext<TParams = undefined> = ArriEventContext & {
|
|
18
18
|
rpcName: string;
|
|
@@ -34,7 +34,7 @@ type MiddlewareEventContext = ArriEventContext & {
|
|
|
34
34
|
};
|
|
35
35
|
type RequestHookContext = ArriEventContext & {
|
|
36
36
|
rpcName?: string;
|
|
37
|
-
params?: Record<string,
|
|
37
|
+
params?: Record<string, any>;
|
|
38
38
|
response?: unknown;
|
|
39
39
|
};
|
|
40
40
|
|
|
@@ -268,7 +268,9 @@ declare class ArriApp {
|
|
|
268
268
|
private readonly _debug;
|
|
269
269
|
readonly definitionPath: string;
|
|
270
270
|
constructor(opts?: ArriOptions);
|
|
271
|
-
use(input: Middleware
|
|
271
|
+
use(input: Middleware): void;
|
|
272
|
+
use(input: ArriRouter): void;
|
|
273
|
+
use(input: ArriService): void;
|
|
272
274
|
rpc(name: string, procedure: Rpc<any, any, any>): void;
|
|
273
275
|
route<TPath extends string, TQuery extends AObjectSchema<any, any>, TBody extends ASchema<any>, TResponse = any>(route: ArriRoute<TPath, TQuery, TBody, TResponse>): void;
|
|
274
276
|
registerDefinitions(definitions: DefinitionMap): void;
|
package/dist/index.d.mts
CHANGED
|
@@ -12,7 +12,7 @@ declare const defineMiddleware: (middleware: Middleware) => Middleware;
|
|
|
12
12
|
type ExtractParam<Path, NextPart> = Path extends `:${infer Param}` ? Record<Param, string> & NextPart : NextPart;
|
|
13
13
|
type ExtractParams<Path> = Path extends `${infer Segment}/${infer Rest}` ? ExtractParam<Segment, ExtractParams<Rest>> : ExtractParam<Path, {}>;
|
|
14
14
|
|
|
15
|
-
interface ArriEventContext extends Record<string,
|
|
15
|
+
interface ArriEventContext extends Record<string, any> {
|
|
16
16
|
}
|
|
17
17
|
type RpcEventContext<TParams = undefined> = ArriEventContext & {
|
|
18
18
|
rpcName: string;
|
|
@@ -34,7 +34,7 @@ type MiddlewareEventContext = ArriEventContext & {
|
|
|
34
34
|
};
|
|
35
35
|
type RequestHookContext = ArriEventContext & {
|
|
36
36
|
rpcName?: string;
|
|
37
|
-
params?: Record<string,
|
|
37
|
+
params?: Record<string, any>;
|
|
38
38
|
response?: unknown;
|
|
39
39
|
};
|
|
40
40
|
|
|
@@ -268,7 +268,9 @@ declare class ArriApp {
|
|
|
268
268
|
private readonly _debug;
|
|
269
269
|
readonly definitionPath: string;
|
|
270
270
|
constructor(opts?: ArriOptions);
|
|
271
|
-
use(input: Middleware
|
|
271
|
+
use(input: Middleware): void;
|
|
272
|
+
use(input: ArriRouter): void;
|
|
273
|
+
use(input: ArriService): void;
|
|
272
274
|
rpc(name: string, procedure: Rpc<any, any, any>): void;
|
|
273
275
|
route<TPath extends string, TQuery extends AObjectSchema<any, any>, TBody extends ASchema<any>, TResponse = any>(route: ArriRoute<TPath, TQuery, TBody, TResponse>): void;
|
|
274
276
|
registerDefinitions(definitions: DefinitionMap): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ declare const defineMiddleware: (middleware: Middleware) => Middleware;
|
|
|
12
12
|
type ExtractParam<Path, NextPart> = Path extends `:${infer Param}` ? Record<Param, string> & NextPart : NextPart;
|
|
13
13
|
type ExtractParams<Path> = Path extends `${infer Segment}/${infer Rest}` ? ExtractParam<Segment, ExtractParams<Rest>> : ExtractParam<Path, {}>;
|
|
14
14
|
|
|
15
|
-
interface ArriEventContext extends Record<string,
|
|
15
|
+
interface ArriEventContext extends Record<string, any> {
|
|
16
16
|
}
|
|
17
17
|
type RpcEventContext<TParams = undefined> = ArriEventContext & {
|
|
18
18
|
rpcName: string;
|
|
@@ -34,7 +34,7 @@ type MiddlewareEventContext = ArriEventContext & {
|
|
|
34
34
|
};
|
|
35
35
|
type RequestHookContext = ArriEventContext & {
|
|
36
36
|
rpcName?: string;
|
|
37
|
-
params?: Record<string,
|
|
37
|
+
params?: Record<string, any>;
|
|
38
38
|
response?: unknown;
|
|
39
39
|
};
|
|
40
40
|
|
|
@@ -268,7 +268,9 @@ declare class ArriApp {
|
|
|
268
268
|
private readonly _debug;
|
|
269
269
|
readonly definitionPath: string;
|
|
270
270
|
constructor(opts?: ArriOptions);
|
|
271
|
-
use(input: Middleware
|
|
271
|
+
use(input: Middleware): void;
|
|
272
|
+
use(input: ArriRouter): void;
|
|
273
|
+
use(input: ArriService): void;
|
|
272
274
|
rpc(name: string, procedure: Rpc<any, any, any>): void;
|
|
273
275
|
route<TPath extends string, TQuery extends AObjectSchema<any, any>, TBody extends ASchema<any>, TResponse = any>(route: ArriRoute<TPath, TQuery, TBody, TResponse>): void;
|
|
274
276
|
registerDefinitions(definitions: DefinitionMap): void;
|
package/dist/index.mjs
CHANGED
|
@@ -348,9 +348,7 @@ function registerRpc(router, path, procedure, opts) {
|
|
|
348
348
|
);
|
|
349
349
|
}
|
|
350
350
|
const response = await procedure.handler(
|
|
351
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
352
351
|
event.context,
|
|
353
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
354
352
|
event
|
|
355
353
|
);
|
|
356
354
|
event.context.response = response;
|
|
@@ -474,7 +472,7 @@ function getSchemaValidator(rpcName, type, schema) {
|
|
|
474
472
|
return validatorFromAdaptedSchema(schema);
|
|
475
473
|
}
|
|
476
474
|
return a.compile(schema);
|
|
477
|
-
} catch (
|
|
475
|
+
} catch (_) {
|
|
478
476
|
console.error(`Error compiling ${type} validator for ${rpcName}`);
|
|
479
477
|
return void 0;
|
|
480
478
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arrirpc/server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.58.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"scule": "^1.3.0",
|
|
29
29
|
"source-map-support": "^0.5.21",
|
|
30
30
|
"uncrypto": "^0.1.3",
|
|
31
|
-
"@arrirpc/codegen-dart": "0.
|
|
32
|
-
"@arrirpc/codegen-kotlin": "0.
|
|
33
|
-
"@arrirpc/
|
|
34
|
-
"@arrirpc/codegen-utils": "0.
|
|
35
|
-
"arri": "0.
|
|
36
|
-
"@arrirpc/
|
|
31
|
+
"@arrirpc/codegen-dart": "0.58.0",
|
|
32
|
+
"@arrirpc/codegen-kotlin": "0.58.0",
|
|
33
|
+
"@arrirpc/schema": "0.58.0",
|
|
34
|
+
"@arrirpc/codegen-utils": "0.58.0",
|
|
35
|
+
"arri": "0.58.0",
|
|
36
|
+
"@arrirpc/codegen-ts": "0.58.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"bun-types": "^1.1.21"
|