@rg-dev/stdlib 1.0.46 → 1.0.48
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/common-env.cjs +1 -1
- package/lib/common-env.js +1 -1
- package/lib/trpc-helpers.cjs +2 -2
- package/lib/trpc-helpers.d.cts +17 -16
- package/lib/trpc-helpers.d.ts +17 -16
- package/lib/trpc-helpers.js +2 -2
- package/package.json +5 -4
package/lib/common-env.cjs
CHANGED
|
@@ -210,7 +210,7 @@ function doSafe(safe, onError) {
|
|
|
210
210
|
try {
|
|
211
211
|
const result = safe();
|
|
212
212
|
if (isPromise(result)) {
|
|
213
|
-
(_a = result["catch"]) == null ? void 0 : _a.call(
|
|
213
|
+
(_a = result == null ? void 0 : result["catch"]) == null ? void 0 : _a.call(
|
|
214
214
|
result,
|
|
215
215
|
(error) => {
|
|
216
216
|
if (error instanceof Error) {
|
package/lib/common-env.js
CHANGED
|
@@ -175,7 +175,7 @@ function doSafe(safe, onError) {
|
|
|
175
175
|
try {
|
|
176
176
|
const result = safe();
|
|
177
177
|
if (isPromise(result)) {
|
|
178
|
-
(_a = result["catch"]) == null ? void 0 : _a.call(
|
|
178
|
+
(_a = result == null ? void 0 : result["catch"]) == null ? void 0 : _a.call(
|
|
179
179
|
result,
|
|
180
180
|
(error) => {
|
|
181
181
|
if (error instanceof Error) {
|
package/lib/trpc-helpers.cjs
CHANGED
|
@@ -46,13 +46,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
46
46
|
// src/trpc-helpers.ts
|
|
47
47
|
var trpc_helpers_exports = {};
|
|
48
48
|
__export(trpc_helpers_exports, {
|
|
49
|
-
|
|
49
|
+
TrpcServerHelpers: () => TrpcServerHelpers
|
|
50
50
|
});
|
|
51
51
|
module.exports = __toCommonJS(trpc_helpers_exports);
|
|
52
52
|
var import_server = require("@trpc/server");
|
|
53
53
|
var trpcExpress = __toESM(require("@trpc/server/adapters/express"), 1);
|
|
54
54
|
var import_superjson = __toESM(require("superjson"), 1);
|
|
55
|
-
var
|
|
55
|
+
var TrpcServerHelpers = class {
|
|
56
56
|
static createExpressTrpcServer() {
|
|
57
57
|
if (globalThis.Headers == void 0) {
|
|
58
58
|
throw new Error("node version too old?, globalThis.Headers undefined");
|
package/lib/trpc-helpers.d.cts
CHANGED
|
@@ -1,39 +1,40 @@
|
|
|
1
|
+
import * as express from 'express';
|
|
1
2
|
import * as _trpc_server from '@trpc/server';
|
|
2
3
|
import { initTRPC } from '@trpc/server';
|
|
3
|
-
import * as
|
|
4
|
+
import * as _trpc_server_unstable_core_do_not_import from '@trpc/server/unstable-core-do-not-import';
|
|
4
5
|
import * as trpcExpress from '@trpc/server/adapters/express';
|
|
5
6
|
|
|
6
|
-
type
|
|
7
|
-
declare class
|
|
7
|
+
type TrpcExpressRootType = ReturnType<ReturnType<typeof initTRPC.context<trpcExpress.CreateExpressContextOptions>>['create']>;
|
|
8
|
+
declare class TrpcServerHelpers {
|
|
8
9
|
static createExpressTrpcServer(): {
|
|
9
|
-
_config:
|
|
10
|
+
_config: _trpc_server_unstable_core_do_not_import.RootConfig<{
|
|
10
11
|
ctx: trpcExpress.CreateExpressContextOptions;
|
|
11
12
|
meta: object;
|
|
12
|
-
errorShape:
|
|
13
|
+
errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
|
|
13
14
|
transformer: false;
|
|
14
15
|
}>;
|
|
15
|
-
procedure:
|
|
16
|
-
middleware: <$ContextOverrides>(fn:
|
|
17
|
-
router: <TInput extends
|
|
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<{
|
|
18
19
|
ctx: trpcExpress.CreateExpressContextOptions;
|
|
19
20
|
meta: object;
|
|
20
|
-
errorShape:
|
|
21
|
+
errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
|
|
21
22
|
transformer: false;
|
|
22
|
-
},
|
|
23
|
-
mergeRouters: typeof
|
|
24
|
-
createCallerFactory: <TRecord extends _trpc_server.RouterRecord>(router: Pick<
|
|
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<{
|
|
25
26
|
ctx: trpcExpress.CreateExpressContextOptions;
|
|
26
27
|
meta: object;
|
|
27
|
-
errorShape:
|
|
28
|
+
errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
|
|
28
29
|
transformer: false;
|
|
29
|
-
}, TRecord>, "_def">) =>
|
|
30
|
+
}, TRecord>, "_def">) => _trpc_server_unstable_core_do_not_import.RouterCaller<{
|
|
30
31
|
ctx: trpcExpress.CreateExpressContextOptions;
|
|
31
32
|
meta: object;
|
|
32
|
-
errorShape:
|
|
33
|
+
errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
|
|
33
34
|
transformer: false;
|
|
34
35
|
}, TRecord>;
|
|
35
36
|
};
|
|
36
37
|
static createTrpcExpressMiddleware(opts: Omit<Parameters<typeof trpcExpress.createExpressMiddleware>[0], 'createContext'>): express.Handler;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
export { type
|
|
40
|
+
export { type TrpcExpressRootType, TrpcServerHelpers };
|
package/lib/trpc-helpers.d.ts
CHANGED
|
@@ -1,39 +1,40 @@
|
|
|
1
|
+
import * as express from 'express';
|
|
1
2
|
import * as _trpc_server from '@trpc/server';
|
|
2
3
|
import { initTRPC } from '@trpc/server';
|
|
3
|
-
import * as
|
|
4
|
+
import * as _trpc_server_unstable_core_do_not_import from '@trpc/server/unstable-core-do-not-import';
|
|
4
5
|
import * as trpcExpress from '@trpc/server/adapters/express';
|
|
5
6
|
|
|
6
|
-
type
|
|
7
|
-
declare class
|
|
7
|
+
type TrpcExpressRootType = ReturnType<ReturnType<typeof initTRPC.context<trpcExpress.CreateExpressContextOptions>>['create']>;
|
|
8
|
+
declare class TrpcServerHelpers {
|
|
8
9
|
static createExpressTrpcServer(): {
|
|
9
|
-
_config:
|
|
10
|
+
_config: _trpc_server_unstable_core_do_not_import.RootConfig<{
|
|
10
11
|
ctx: trpcExpress.CreateExpressContextOptions;
|
|
11
12
|
meta: object;
|
|
12
|
-
errorShape:
|
|
13
|
+
errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
|
|
13
14
|
transformer: false;
|
|
14
15
|
}>;
|
|
15
|
-
procedure:
|
|
16
|
-
middleware: <$ContextOverrides>(fn:
|
|
17
|
-
router: <TInput extends
|
|
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<{
|
|
18
19
|
ctx: trpcExpress.CreateExpressContextOptions;
|
|
19
20
|
meta: object;
|
|
20
|
-
errorShape:
|
|
21
|
+
errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
|
|
21
22
|
transformer: false;
|
|
22
|
-
},
|
|
23
|
-
mergeRouters: typeof
|
|
24
|
-
createCallerFactory: <TRecord extends _trpc_server.RouterRecord>(router: Pick<
|
|
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<{
|
|
25
26
|
ctx: trpcExpress.CreateExpressContextOptions;
|
|
26
27
|
meta: object;
|
|
27
|
-
errorShape:
|
|
28
|
+
errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
|
|
28
29
|
transformer: false;
|
|
29
|
-
}, TRecord>, "_def">) =>
|
|
30
|
+
}, TRecord>, "_def">) => _trpc_server_unstable_core_do_not_import.RouterCaller<{
|
|
30
31
|
ctx: trpcExpress.CreateExpressContextOptions;
|
|
31
32
|
meta: object;
|
|
32
|
-
errorShape:
|
|
33
|
+
errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
|
|
33
34
|
transformer: false;
|
|
34
35
|
}, TRecord>;
|
|
35
36
|
};
|
|
36
37
|
static createTrpcExpressMiddleware(opts: Omit<Parameters<typeof trpcExpress.createExpressMiddleware>[0], 'createContext'>): express.Handler;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
export { type
|
|
40
|
+
export { type TrpcExpressRootType, TrpcServerHelpers };
|
package/lib/trpc-helpers.js
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from "@trpc/server";
|
|
25
25
|
import * as trpcExpress from "@trpc/server/adapters/express";
|
|
26
26
|
import superjson from "superjson";
|
|
27
|
-
var
|
|
27
|
+
var TrpcServerHelpers = class {
|
|
28
28
|
static createExpressTrpcServer() {
|
|
29
29
|
if (globalThis.Headers == void 0) {
|
|
30
30
|
throw new Error("node version too old?, globalThis.Headers undefined");
|
|
@@ -41,5 +41,5 @@ var trpcServerHelpers = class {
|
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
export {
|
|
44
|
-
|
|
44
|
+
TrpcServerHelpers
|
|
45
45
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rg-dev/stdlib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.48",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
],
|
|
14
14
|
"typesVersions": {
|
|
15
15
|
"*": {
|
|
16
|
-
|
|
16
|
+
"lib/trpc-helpers": [
|
|
17
17
|
"lib/trpc-helpers.d.ts"
|
|
18
18
|
],
|
|
19
19
|
"lib/common-env": [
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"types": "./lib/index.d.cts",
|
|
34
34
|
"type": "module",
|
|
35
35
|
"exports": {
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
"./lib/trpc-helpers": {
|
|
37
|
+
"import": "./lib/trpc-helpers.js",
|
|
38
38
|
"require": "./lib/trpc-helpers.cjs",
|
|
39
39
|
"types": "./lib/trpc-helpers.d.ts"
|
|
40
40
|
},
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@trpc/server": "^11.1.1",
|
|
69
69
|
"@types/command-exists": "^1.2.3",
|
|
70
|
+
"@types/express": "^5.0.6",
|
|
70
71
|
"@types/fs-extra": "^11.0.4",
|
|
71
72
|
"@types/node": "^18.19.3",
|
|
72
73
|
"builtin-modules": "^3.3.0",
|