@rg-dev/stdlib 1.0.48 → 1.0.49
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/lib/trpc-helpers.d.cts +3 -32
- package/lib/trpc-helpers.d.ts +3 -32
- package/lib/trpc-helpers.js +1 -3
- package/package.json +4 -2
package/lib/trpc-helpers.d.cts
CHANGED
|
@@ -1,40 +1,11 @@
|
|
|
1
|
-
import * as express from 'express';
|
|
2
|
-
import * as _trpc_server from '@trpc/server';
|
|
3
1
|
import { initTRPC } from '@trpc/server';
|
|
4
|
-
import * as _trpc_server_unstable_core_do_not_import from '@trpc/server/unstable-core-do-not-import';
|
|
5
2
|
import * as trpcExpress from '@trpc/server/adapters/express';
|
|
3
|
+
import { Handler } from 'express';
|
|
6
4
|
|
|
7
5
|
type TrpcExpressRootType = ReturnType<ReturnType<typeof initTRPC.context<trpcExpress.CreateExpressContextOptions>>['create']>;
|
|
8
6
|
declare class TrpcServerHelpers {
|
|
9
|
-
static createExpressTrpcServer():
|
|
10
|
-
|
|
11
|
-
ctx: trpcExpress.CreateExpressContextOptions;
|
|
12
|
-
meta: object;
|
|
13
|
-
errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
|
|
14
|
-
transformer: false;
|
|
15
|
-
}>;
|
|
16
|
-
procedure: _trpc_server_unstable_core_do_not_import.ProcedureBuilder<trpcExpress.CreateExpressContextOptions, object, object, typeof _trpc_server_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_unstable_core_do_not_import.unsetMarker, false>;
|
|
17
|
-
middleware: <$ContextOverrides>(fn: _trpc_server_unstable_core_do_not_import.MiddlewareFunction<trpcExpress.CreateExpressContextOptions, object, object, $ContextOverrides, unknown>) => _trpc_server_unstable_core_do_not_import.MiddlewareBuilder<trpcExpress.CreateExpressContextOptions, object, $ContextOverrides, unknown>;
|
|
18
|
-
router: <TInput extends _trpc_server_unstable_core_do_not_import.CreateRouterOptions>(input: TInput) => _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
19
|
-
ctx: trpcExpress.CreateExpressContextOptions;
|
|
20
|
-
meta: object;
|
|
21
|
-
errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
|
|
22
|
-
transformer: false;
|
|
23
|
-
}, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<TInput>>;
|
|
24
|
-
mergeRouters: typeof _trpc_server_unstable_core_do_not_import.mergeRouters;
|
|
25
|
-
createCallerFactory: <TRecord extends _trpc_server.RouterRecord>(router: Pick<_trpc_server_unstable_core_do_not_import.Router<{
|
|
26
|
-
ctx: trpcExpress.CreateExpressContextOptions;
|
|
27
|
-
meta: object;
|
|
28
|
-
errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
|
|
29
|
-
transformer: false;
|
|
30
|
-
}, TRecord>, "_def">) => _trpc_server_unstable_core_do_not_import.RouterCaller<{
|
|
31
|
-
ctx: trpcExpress.CreateExpressContextOptions;
|
|
32
|
-
meta: object;
|
|
33
|
-
errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
|
|
34
|
-
transformer: false;
|
|
35
|
-
}, TRecord>;
|
|
36
|
-
};
|
|
37
|
-
static createTrpcExpressMiddleware(opts: Omit<Parameters<typeof trpcExpress.createExpressMiddleware>[0], 'createContext'>): express.Handler;
|
|
7
|
+
static createExpressTrpcServer(): TrpcExpressRootType;
|
|
8
|
+
static createTrpcExpressMiddleware(opts: Omit<Parameters<typeof trpcExpress.createExpressMiddleware>[0], 'createContext'>): Handler;
|
|
38
9
|
}
|
|
39
10
|
|
|
40
11
|
export { type TrpcExpressRootType, TrpcServerHelpers };
|
package/lib/trpc-helpers.d.ts
CHANGED
|
@@ -1,40 +1,11 @@
|
|
|
1
|
-
import * as express from 'express';
|
|
2
|
-
import * as _trpc_server from '@trpc/server';
|
|
3
1
|
import { initTRPC } from '@trpc/server';
|
|
4
|
-
import * as _trpc_server_unstable_core_do_not_import from '@trpc/server/unstable-core-do-not-import';
|
|
5
2
|
import * as trpcExpress from '@trpc/server/adapters/express';
|
|
3
|
+
import { Handler } from 'express';
|
|
6
4
|
|
|
7
5
|
type TrpcExpressRootType = ReturnType<ReturnType<typeof initTRPC.context<trpcExpress.CreateExpressContextOptions>>['create']>;
|
|
8
6
|
declare class TrpcServerHelpers {
|
|
9
|
-
static createExpressTrpcServer():
|
|
10
|
-
|
|
11
|
-
ctx: trpcExpress.CreateExpressContextOptions;
|
|
12
|
-
meta: object;
|
|
13
|
-
errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
|
|
14
|
-
transformer: false;
|
|
15
|
-
}>;
|
|
16
|
-
procedure: _trpc_server_unstable_core_do_not_import.ProcedureBuilder<trpcExpress.CreateExpressContextOptions, object, object, typeof _trpc_server_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_unstable_core_do_not_import.unsetMarker, false>;
|
|
17
|
-
middleware: <$ContextOverrides>(fn: _trpc_server_unstable_core_do_not_import.MiddlewareFunction<trpcExpress.CreateExpressContextOptions, object, object, $ContextOverrides, unknown>) => _trpc_server_unstable_core_do_not_import.MiddlewareBuilder<trpcExpress.CreateExpressContextOptions, object, $ContextOverrides, unknown>;
|
|
18
|
-
router: <TInput extends _trpc_server_unstable_core_do_not_import.CreateRouterOptions>(input: TInput) => _trpc_server_unstable_core_do_not_import.BuiltRouter<{
|
|
19
|
-
ctx: trpcExpress.CreateExpressContextOptions;
|
|
20
|
-
meta: object;
|
|
21
|
-
errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
|
|
22
|
-
transformer: false;
|
|
23
|
-
}, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<TInput>>;
|
|
24
|
-
mergeRouters: typeof _trpc_server_unstable_core_do_not_import.mergeRouters;
|
|
25
|
-
createCallerFactory: <TRecord extends _trpc_server.RouterRecord>(router: Pick<_trpc_server_unstable_core_do_not_import.Router<{
|
|
26
|
-
ctx: trpcExpress.CreateExpressContextOptions;
|
|
27
|
-
meta: object;
|
|
28
|
-
errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
|
|
29
|
-
transformer: false;
|
|
30
|
-
}, TRecord>, "_def">) => _trpc_server_unstable_core_do_not_import.RouterCaller<{
|
|
31
|
-
ctx: trpcExpress.CreateExpressContextOptions;
|
|
32
|
-
meta: object;
|
|
33
|
-
errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
|
|
34
|
-
transformer: false;
|
|
35
|
-
}, TRecord>;
|
|
36
|
-
};
|
|
37
|
-
static createTrpcExpressMiddleware(opts: Omit<Parameters<typeof trpcExpress.createExpressMiddleware>[0], 'createContext'>): express.Handler;
|
|
7
|
+
static createExpressTrpcServer(): TrpcExpressRootType;
|
|
8
|
+
static createTrpcExpressMiddleware(opts: Omit<Parameters<typeof trpcExpress.createExpressMiddleware>[0], 'createContext'>): Handler;
|
|
38
9
|
}
|
|
39
10
|
|
|
40
11
|
export { type TrpcExpressRootType, TrpcServerHelpers };
|
package/lib/trpc-helpers.js
CHANGED
|
@@ -19,9 +19,7 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
|
|
21
21
|
// src/trpc-helpers.ts
|
|
22
|
-
import {
|
|
23
|
-
initTRPC
|
|
24
|
-
} from "@trpc/server";
|
|
22
|
+
import { initTRPC } from "@trpc/server";
|
|
25
23
|
import * as trpcExpress from "@trpc/server/adapters/express";
|
|
26
24
|
import superjson from "superjson";
|
|
27
25
|
var TrpcServerHelpers = class {
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rg-dev/stdlib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.49",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
7
|
-
"build": "tsup && node after-build.mjs"
|
|
7
|
+
"build": "tsup && node after-build.mjs",
|
|
8
|
+
"ts":"tsdown"
|
|
8
9
|
},
|
|
9
10
|
"author": "",
|
|
10
11
|
"license": "ISC",
|
|
@@ -65,6 +66,7 @@
|
|
|
65
66
|
"access": "public"
|
|
66
67
|
},
|
|
67
68
|
"devDependencies": {
|
|
69
|
+
"tsdown": "^0.19.0",
|
|
68
70
|
"@trpc/server": "^11.1.1",
|
|
69
71
|
"@types/command-exists": "^1.2.3",
|
|
70
72
|
"@types/express": "^5.0.6",
|