@orpc/contract 0.30.0 → 0.31.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/dist/index.js +124 -33
- package/dist/src/builder.d.ts +8 -9
- package/dist/src/index.d.ts +4 -0
- package/dist/src/procedure-builder-with-input.d.ts +19 -0
- package/dist/src/procedure-builder-with-output.d.ts +19 -0
- package/dist/src/procedure-builder.d.ts +15 -0
- package/dist/src/procedure-decorated.d.ts +2 -4
- package/dist/src/schema-utils.d.ts +5 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -27,6 +27,15 @@ var DecoratedContractProcedure = class _DecoratedContractProcedure extends Contr
|
|
|
27
27
|
}
|
|
28
28
|
return new _DecoratedContractProcedure(procedure["~orpc"]);
|
|
29
29
|
}
|
|
30
|
+
errors(errors) {
|
|
31
|
+
return new _DecoratedContractProcedure({
|
|
32
|
+
...this["~orpc"],
|
|
33
|
+
errorMap: {
|
|
34
|
+
...this["~orpc"].errorMap,
|
|
35
|
+
...errors
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
30
39
|
route(route) {
|
|
31
40
|
return new _DecoratedContractProcedure({
|
|
32
41
|
...this["~orpc"],
|
|
@@ -59,27 +68,92 @@ var DecoratedContractProcedure = class _DecoratedContractProcedure extends Contr
|
|
|
59
68
|
}
|
|
60
69
|
});
|
|
61
70
|
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// src/procedure-builder-with-input.ts
|
|
74
|
+
var ContractProcedureBuilderWithInput = class _ContractProcedureBuilderWithInput extends ContractProcedure {
|
|
75
|
+
errors(errors) {
|
|
76
|
+
const decorated = DecoratedContractProcedure.decorate(this).errors(errors);
|
|
77
|
+
return new _ContractProcedureBuilderWithInput(decorated["~orpc"]);
|
|
78
|
+
}
|
|
79
|
+
route(route) {
|
|
80
|
+
const decorated = DecoratedContractProcedure.decorate(this).route(route);
|
|
81
|
+
return new _ContractProcedureBuilderWithInput(decorated["~orpc"]);
|
|
82
|
+
}
|
|
83
|
+
prefix(prefix) {
|
|
84
|
+
const decorated = DecoratedContractProcedure.decorate(this).prefix(prefix);
|
|
85
|
+
return new _ContractProcedureBuilderWithInput(decorated["~orpc"]);
|
|
86
|
+
}
|
|
87
|
+
unshiftTag(...tags) {
|
|
88
|
+
const decorated = DecoratedContractProcedure.decorate(this).unshiftTag(...tags);
|
|
89
|
+
return new _ContractProcedureBuilderWithInput(decorated["~orpc"]);
|
|
90
|
+
}
|
|
91
|
+
output(schema, example) {
|
|
92
|
+
return new DecoratedContractProcedure({
|
|
93
|
+
...this["~orpc"],
|
|
94
|
+
OutputSchema: schema,
|
|
95
|
+
outputExample: example
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
// src/procedure-builder-with-output.ts
|
|
101
|
+
var ContractProcedureBuilderWithOutput = class _ContractProcedureBuilderWithOutput extends ContractProcedure {
|
|
102
|
+
errors(errors) {
|
|
103
|
+
const decorated = DecoratedContractProcedure.decorate(this).errors(errors);
|
|
104
|
+
return new _ContractProcedureBuilderWithOutput(decorated["~orpc"]);
|
|
105
|
+
}
|
|
106
|
+
route(route) {
|
|
107
|
+
const decorated = DecoratedContractProcedure.decorate(this).route(route);
|
|
108
|
+
return new _ContractProcedureBuilderWithOutput(decorated["~orpc"]);
|
|
109
|
+
}
|
|
110
|
+
prefix(prefix) {
|
|
111
|
+
const decorated = DecoratedContractProcedure.decorate(this).prefix(prefix);
|
|
112
|
+
return new _ContractProcedureBuilderWithOutput(decorated["~orpc"]);
|
|
113
|
+
}
|
|
114
|
+
unshiftTag(...tags) {
|
|
115
|
+
const decorated = DecoratedContractProcedure.decorate(this).unshiftTag(...tags);
|
|
116
|
+
return new _ContractProcedureBuilderWithOutput(decorated["~orpc"]);
|
|
117
|
+
}
|
|
62
118
|
input(schema, example) {
|
|
63
|
-
return new
|
|
119
|
+
return new DecoratedContractProcedure({
|
|
64
120
|
...this["~orpc"],
|
|
65
121
|
InputSchema: schema,
|
|
66
122
|
inputExample: example
|
|
67
123
|
});
|
|
68
124
|
}
|
|
69
|
-
|
|
70
|
-
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
// src/procedure-builder.ts
|
|
128
|
+
var ContractProcedureBuilder = class _ContractProcedureBuilder extends ContractProcedure {
|
|
129
|
+
errors(errors) {
|
|
130
|
+
const decorated = DecoratedContractProcedure.decorate(this).errors(errors);
|
|
131
|
+
return new _ContractProcedureBuilder(decorated["~orpc"]);
|
|
132
|
+
}
|
|
133
|
+
route(route) {
|
|
134
|
+
const decorated = DecoratedContractProcedure.decorate(this).route(route);
|
|
135
|
+
return new _ContractProcedureBuilder(decorated["~orpc"]);
|
|
136
|
+
}
|
|
137
|
+
prefix(prefix) {
|
|
138
|
+
const decorated = DecoratedContractProcedure.decorate(this).prefix(prefix);
|
|
139
|
+
return new _ContractProcedureBuilder(decorated["~orpc"]);
|
|
140
|
+
}
|
|
141
|
+
unshiftTag(...tags) {
|
|
142
|
+
const decorated = DecoratedContractProcedure.decorate(this).unshiftTag(...tags);
|
|
143
|
+
return new _ContractProcedureBuilder(decorated["~orpc"]);
|
|
144
|
+
}
|
|
145
|
+
input(schema, example) {
|
|
146
|
+
return new ContractProcedureBuilderWithInput({
|
|
71
147
|
...this["~orpc"],
|
|
72
|
-
|
|
73
|
-
|
|
148
|
+
InputSchema: schema,
|
|
149
|
+
inputExample: example
|
|
74
150
|
});
|
|
75
151
|
}
|
|
76
|
-
|
|
77
|
-
return new
|
|
152
|
+
output(schema, example) {
|
|
153
|
+
return new ContractProcedureBuilderWithOutput({
|
|
78
154
|
...this["~orpc"],
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
...errors
|
|
82
|
-
}
|
|
155
|
+
OutputSchema: schema,
|
|
156
|
+
outputExample: example
|
|
83
157
|
});
|
|
84
158
|
}
|
|
85
159
|
};
|
|
@@ -133,12 +207,7 @@ var ContractRouterBuilder = class _ContractRouterBuilder {
|
|
|
133
207
|
};
|
|
134
208
|
|
|
135
209
|
// src/builder.ts
|
|
136
|
-
var ContractBuilder = class _ContractBuilder {
|
|
137
|
-
"~type" = "ContractBuilder";
|
|
138
|
-
"~orpc";
|
|
139
|
-
constructor(def) {
|
|
140
|
-
this["~orpc"] = def;
|
|
141
|
-
}
|
|
210
|
+
var ContractBuilder = class _ContractBuilder extends ContractProcedure {
|
|
142
211
|
errors(errors) {
|
|
143
212
|
return new _ContractBuilder({
|
|
144
213
|
...this["~orpc"],
|
|
@@ -148,20 +217,8 @@ var ContractBuilder = class _ContractBuilder {
|
|
|
148
217
|
}
|
|
149
218
|
});
|
|
150
219
|
}
|
|
151
|
-
prefix(prefix) {
|
|
152
|
-
return new ContractRouterBuilder({
|
|
153
|
-
prefix,
|
|
154
|
-
errorMap: this["~orpc"].errorMap
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
tag(...tags) {
|
|
158
|
-
return new ContractRouterBuilder({
|
|
159
|
-
tags,
|
|
160
|
-
errorMap: this["~orpc"].errorMap
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
220
|
route(route) {
|
|
164
|
-
return new
|
|
221
|
+
return new ContractProcedureBuilder({
|
|
165
222
|
route,
|
|
166
223
|
InputSchema: void 0,
|
|
167
224
|
OutputSchema: void 0,
|
|
@@ -169,7 +226,7 @@ var ContractBuilder = class _ContractBuilder {
|
|
|
169
226
|
});
|
|
170
227
|
}
|
|
171
228
|
input(schema, example) {
|
|
172
|
-
return new
|
|
229
|
+
return new ContractProcedureBuilderWithInput({
|
|
173
230
|
InputSchema: schema,
|
|
174
231
|
inputExample: example,
|
|
175
232
|
OutputSchema: void 0,
|
|
@@ -177,13 +234,25 @@ var ContractBuilder = class _ContractBuilder {
|
|
|
177
234
|
});
|
|
178
235
|
}
|
|
179
236
|
output(schema, example) {
|
|
180
|
-
return new
|
|
237
|
+
return new ContractProcedureBuilderWithOutput({
|
|
181
238
|
OutputSchema: schema,
|
|
182
239
|
outputExample: example,
|
|
183
240
|
InputSchema: void 0,
|
|
184
241
|
errorMap: this["~orpc"].errorMap
|
|
185
242
|
});
|
|
186
243
|
}
|
|
244
|
+
prefix(prefix) {
|
|
245
|
+
return new ContractRouterBuilder({
|
|
246
|
+
prefix,
|
|
247
|
+
errorMap: this["~orpc"].errorMap
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
tag(...tags) {
|
|
251
|
+
return new ContractRouterBuilder({
|
|
252
|
+
tags,
|
|
253
|
+
errorMap: this["~orpc"].errorMap
|
|
254
|
+
});
|
|
255
|
+
}
|
|
187
256
|
router(router) {
|
|
188
257
|
return new ContractRouterBuilder({
|
|
189
258
|
errorMap: this["~orpc"].errorMap
|
|
@@ -381,14 +450,35 @@ var ValidationError = class extends Error {
|
|
|
381
450
|
}
|
|
382
451
|
};
|
|
383
452
|
|
|
453
|
+
// src/schema-utils.ts
|
|
454
|
+
function type(...[map]) {
|
|
455
|
+
return {
|
|
456
|
+
"~standard": {
|
|
457
|
+
vendor: "custom",
|
|
458
|
+
version: 1,
|
|
459
|
+
async validate(value) {
|
|
460
|
+
if (map) {
|
|
461
|
+
return { value: await map(value) };
|
|
462
|
+
}
|
|
463
|
+
return { value };
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
|
|
384
469
|
// src/index.ts
|
|
385
470
|
var oc = new ContractBuilder({
|
|
386
|
-
errorMap: {}
|
|
471
|
+
errorMap: {},
|
|
472
|
+
InputSchema: void 0,
|
|
473
|
+
OutputSchema: void 0
|
|
387
474
|
});
|
|
388
475
|
export {
|
|
389
476
|
COMMON_ORPC_ERROR_DEFS,
|
|
390
477
|
ContractBuilder,
|
|
391
478
|
ContractProcedure,
|
|
479
|
+
ContractProcedureBuilder,
|
|
480
|
+
ContractProcedureBuilderWithInput,
|
|
481
|
+
ContractProcedureBuilderWithOutput,
|
|
392
482
|
ContractRouterBuilder,
|
|
393
483
|
DecoratedContractProcedure,
|
|
394
484
|
ORPCError,
|
|
@@ -401,6 +491,7 @@ export {
|
|
|
401
491
|
isDefinedError,
|
|
402
492
|
oc,
|
|
403
493
|
safe,
|
|
494
|
+
type,
|
|
404
495
|
validateORPCError
|
|
405
496
|
};
|
|
406
497
|
//# sourceMappingURL=index.js.map
|
package/dist/src/builder.d.ts
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import type { ErrorMap, ErrorMapGuard, ErrorMapSuggestions, StrictErrorMap } from './error-map';
|
|
2
|
-
import type { RouteOptions } from './procedure';
|
|
3
2
|
import type { ContractRouter } from './router';
|
|
4
3
|
import type { AdaptedContractRouter } from './router-builder';
|
|
5
4
|
import type { HTTPPath, Schema, SchemaInput, SchemaOutput } from './types';
|
|
6
|
-
import {
|
|
5
|
+
import { ContractProcedure, type RouteOptions } from './procedure';
|
|
6
|
+
import { ContractProcedureBuilder } from './procedure-builder';
|
|
7
|
+
import { ContractProcedureBuilderWithInput } from './procedure-builder-with-input';
|
|
8
|
+
import { ContractProcedureBuilderWithOutput } from './procedure-builder-with-output';
|
|
7
9
|
import { ContractRouterBuilder } from './router-builder';
|
|
8
10
|
export type ContractBuilderDef<TErrorMap extends ErrorMap> = {
|
|
9
11
|
errorMap: TErrorMap;
|
|
10
12
|
};
|
|
11
|
-
export declare class ContractBuilder<TErrorMap extends ErrorMap> {
|
|
12
|
-
'~type': "ContractBuilder";
|
|
13
|
-
'~orpc': ContractBuilderDef<TErrorMap>;
|
|
14
|
-
constructor(def: ContractBuilderDef<TErrorMap>);
|
|
13
|
+
export declare class ContractBuilder<TErrorMap extends ErrorMap> extends ContractProcedure<undefined, undefined, TErrorMap> {
|
|
15
14
|
errors<const U extends ErrorMap & ErrorMapGuard<TErrorMap> & ErrorMapSuggestions>(errors: U): ContractBuilder<U & TErrorMap>;
|
|
15
|
+
route(route: RouteOptions): ContractProcedureBuilder<TErrorMap>;
|
|
16
|
+
input<U extends Schema>(schema: U, example?: SchemaInput<U>): ContractProcedureBuilderWithInput<U, TErrorMap>;
|
|
17
|
+
output<U extends Schema>(schema: U, example?: SchemaOutput<U>): ContractProcedureBuilderWithOutput<U, TErrorMap>;
|
|
16
18
|
prefix(prefix: HTTPPath): ContractRouterBuilder<TErrorMap>;
|
|
17
19
|
tag(...tags: string[]): ContractRouterBuilder<TErrorMap>;
|
|
18
|
-
route(route: RouteOptions): DecoratedContractProcedure<undefined, undefined, TErrorMap>;
|
|
19
|
-
input<U extends Schema>(schema: U, example?: SchemaInput<U>): DecoratedContractProcedure<U, undefined, TErrorMap>;
|
|
20
|
-
output<U extends Schema>(schema: U, example?: SchemaOutput<U>): DecoratedContractProcedure<undefined, U, TErrorMap>;
|
|
21
20
|
router<T extends ContractRouter<ErrorMap & Partial<StrictErrorMap<TErrorMap>>>>(router: T): AdaptedContractRouter<T, TErrorMap>;
|
|
22
21
|
}
|
|
23
22
|
//# sourceMappingURL=builder.d.ts.map
|
package/dist/src/index.d.ts
CHANGED
|
@@ -8,11 +8,15 @@ export * from './error';
|
|
|
8
8
|
export * from './error-map';
|
|
9
9
|
export * from './error-orpc';
|
|
10
10
|
export * from './procedure';
|
|
11
|
+
export * from './procedure-builder';
|
|
12
|
+
export * from './procedure-builder-with-input';
|
|
13
|
+
export * from './procedure-builder-with-output';
|
|
11
14
|
export * from './procedure-client';
|
|
12
15
|
export * from './procedure-decorated';
|
|
13
16
|
export * from './router';
|
|
14
17
|
export * from './router-builder';
|
|
15
18
|
export * from './router-client';
|
|
19
|
+
export * from './schema-utils';
|
|
16
20
|
export * from './types';
|
|
17
21
|
export declare const oc: ContractBuilder<Record<never, never>>;
|
|
18
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ErrorMap, ErrorMapGuard, ErrorMapSuggestions } from './error-map';
|
|
2
|
+
import type { RouteOptions } from './procedure';
|
|
3
|
+
import type { HTTPPath, Schema, SchemaOutput } from './types';
|
|
4
|
+
import { ContractProcedure } from './procedure';
|
|
5
|
+
import { DecoratedContractProcedure } from './procedure-decorated';
|
|
6
|
+
/**
|
|
7
|
+
* `ContractProcedureBuilderWithInput` is a branch of `ContractProcedureBuilder` which it has input schema.
|
|
8
|
+
*
|
|
9
|
+
* Why?
|
|
10
|
+
* - prevents override input schema after .input
|
|
11
|
+
*/
|
|
12
|
+
export declare class ContractProcedureBuilderWithInput<TInputSchema extends Schema, TErrorMap extends ErrorMap> extends ContractProcedure<TInputSchema, undefined, TErrorMap> {
|
|
13
|
+
errors<const U extends ErrorMap & ErrorMapGuard<TErrorMap> & ErrorMapSuggestions>(errors: U): ContractProcedureBuilderWithInput<TInputSchema, TErrorMap & U>;
|
|
14
|
+
route(route: RouteOptions): ContractProcedureBuilderWithInput<TInputSchema, TErrorMap>;
|
|
15
|
+
prefix(prefix: HTTPPath): ContractProcedureBuilderWithInput<TInputSchema, TErrorMap>;
|
|
16
|
+
unshiftTag(...tags: string[]): ContractProcedureBuilderWithInput<TInputSchema, TErrorMap>;
|
|
17
|
+
output<U extends Schema>(schema: U, example?: SchemaOutput<U>): DecoratedContractProcedure<TInputSchema, U, TErrorMap>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=procedure-builder-with-input.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ErrorMap, ErrorMapGuard, ErrorMapSuggestions } from './error-map';
|
|
2
|
+
import type { RouteOptions } from './procedure';
|
|
3
|
+
import type { HTTPPath, Schema, SchemaInput } from './types';
|
|
4
|
+
import { ContractProcedure } from './procedure';
|
|
5
|
+
import { DecoratedContractProcedure } from './procedure-decorated';
|
|
6
|
+
/**
|
|
7
|
+
* `ContractProcedureBuilderWithOutput` is a branch of `ContractProcedureBuilder` which it has output schema.
|
|
8
|
+
*
|
|
9
|
+
* Why?
|
|
10
|
+
* - prevents override output schema after .output
|
|
11
|
+
*/
|
|
12
|
+
export declare class ContractProcedureBuilderWithOutput<TOutputSchema extends Schema, TErrorMap extends ErrorMap> extends ContractProcedure<undefined, TOutputSchema, TErrorMap> {
|
|
13
|
+
errors<const U extends ErrorMap & ErrorMapGuard<TErrorMap> & ErrorMapSuggestions>(errors: U): ContractProcedureBuilderWithOutput<TOutputSchema, TErrorMap & U>;
|
|
14
|
+
route(route: RouteOptions): ContractProcedureBuilderWithOutput<TOutputSchema, TErrorMap>;
|
|
15
|
+
prefix(prefix: HTTPPath): ContractProcedureBuilderWithOutput<TOutputSchema, TErrorMap>;
|
|
16
|
+
unshiftTag(...tags: string[]): ContractProcedureBuilderWithOutput<TOutputSchema, TErrorMap>;
|
|
17
|
+
input<U extends Schema>(schema: U, example?: SchemaInput<U>): DecoratedContractProcedure<U, TOutputSchema, TErrorMap>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=procedure-builder-with-output.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ErrorMap, ErrorMapGuard, ErrorMapSuggestions } from './error-map';
|
|
2
|
+
import type { RouteOptions } from './procedure';
|
|
3
|
+
import type { HTTPPath, Schema, SchemaInput, SchemaOutput } from './types';
|
|
4
|
+
import { ContractProcedure } from './procedure';
|
|
5
|
+
import { ContractProcedureBuilderWithInput } from './procedure-builder-with-input';
|
|
6
|
+
import { ContractProcedureBuilderWithOutput } from './procedure-builder-with-output';
|
|
7
|
+
export declare class ContractProcedureBuilder<TErrorMap extends ErrorMap> extends ContractProcedure<undefined, undefined, TErrorMap> {
|
|
8
|
+
errors<const U extends ErrorMap & ErrorMapGuard<TErrorMap> & ErrorMapSuggestions>(errors: U): ContractProcedureBuilder<TErrorMap & U>;
|
|
9
|
+
route(route: RouteOptions): ContractProcedureBuilder<TErrorMap>;
|
|
10
|
+
prefix(prefix: HTTPPath): ContractProcedureBuilder<TErrorMap>;
|
|
11
|
+
unshiftTag(...tags: string[]): ContractProcedureBuilder<TErrorMap>;
|
|
12
|
+
input<U extends Schema>(schema: U, example?: SchemaInput<U>): ContractProcedureBuilderWithInput<U, TErrorMap>;
|
|
13
|
+
output<U extends Schema>(schema: U, example?: SchemaOutput<U>): ContractProcedureBuilderWithOutput<U, TErrorMap>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=procedure-builder.d.ts.map
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import type { ErrorMap, ErrorMapGuard, ErrorMapSuggestions } from './error-map';
|
|
2
2
|
import type { RouteOptions } from './procedure';
|
|
3
|
-
import type { HTTPPath, Schema
|
|
3
|
+
import type { HTTPPath, Schema } from './types';
|
|
4
4
|
import { ContractProcedure } from './procedure';
|
|
5
5
|
export declare class DecoratedContractProcedure<TInputSchema extends Schema, TOutputSchema extends Schema, TErrorMap extends ErrorMap> extends ContractProcedure<TInputSchema, TOutputSchema, TErrorMap> {
|
|
6
6
|
static decorate<UInputSchema extends Schema, UOutputSchema extends Schema, TErrorMap extends ErrorMap>(procedure: ContractProcedure<UInputSchema, UOutputSchema, TErrorMap>): DecoratedContractProcedure<UInputSchema, UOutputSchema, TErrorMap>;
|
|
7
|
+
errors<const U extends ErrorMap & ErrorMapGuard<TErrorMap> & ErrorMapSuggestions>(errors: U): DecoratedContractProcedure<TInputSchema, TOutputSchema, TErrorMap & U>;
|
|
7
8
|
route(route: RouteOptions): DecoratedContractProcedure<TInputSchema, TOutputSchema, TErrorMap>;
|
|
8
9
|
prefix(prefix: HTTPPath): DecoratedContractProcedure<TInputSchema, TOutputSchema, TErrorMap>;
|
|
9
10
|
unshiftTag(...tags: string[]): DecoratedContractProcedure<TInputSchema, TOutputSchema, TErrorMap>;
|
|
10
|
-
input<U extends Schema>(schema: U, example?: SchemaInput<U>): DecoratedContractProcedure<U, TOutputSchema, TErrorMap>;
|
|
11
|
-
output<U extends Schema>(schema: U, example?: SchemaOutput<U>): DecoratedContractProcedure<TInputSchema, U, TErrorMap>;
|
|
12
|
-
errors<const U extends ErrorMap & ErrorMapGuard<TErrorMap> & ErrorMapSuggestions>(errors: U): DecoratedContractProcedure<TInputSchema, TOutputSchema, TErrorMap & U>;
|
|
13
11
|
}
|
|
14
12
|
//# sourceMappingURL=procedure-decorated.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IsEqual, Promisable } from '@orpc/shared';
|
|
2
|
+
import type { StandardSchemaV1 } from '@standard-schema/spec';
|
|
3
|
+
export type TypeRest<TInput, TOutput> = [map: (input: TInput) => Promisable<TOutput>] | (IsEqual<TInput, TOutput> extends true ? [] : never);
|
|
4
|
+
export declare function type<TInput, TOutput = TInput>(...[map]: TypeRest<TInput, TOutput>): StandardSchemaV1<TInput, TOutput>;
|
|
5
|
+
//# sourceMappingURL=schema-utils.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orpc/contract",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.31.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
|
7
7
|
"repository": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@standard-schema/spec": "1.0.0-beta.4",
|
|
33
|
-
"@orpc/shared": "0.
|
|
33
|
+
"@orpc/shared": "0.31.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"arktype": "2.0.0-rc.26",
|