@orpc/contract 0.11.0 → 0.13.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 +4 -0
- package/dist/src/builder.d.ts +1 -0
- package/dist/src/constants.d.ts +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/procedure.d.ts +2 -0
- package/dist/src/router-builder.d.ts +1 -0
- package/dist/src/router.d.ts +1 -0
- package/dist/src/types.d.ts +1 -0
- package/dist/src/utils.d.ts +1 -0
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -59,6 +59,9 @@ function isContractProcedure(item) {
|
|
|
59
59
|
var ContractRouterBuilder = class _ContractRouterBuilder {
|
|
60
60
|
constructor(zz$crb) {
|
|
61
61
|
this.zz$crb = zz$crb;
|
|
62
|
+
if (zz$crb.prefix && zz$crb.prefix.includes("{")) {
|
|
63
|
+
throw new Error('Prefix cannot contain "{" for dynamic routing');
|
|
64
|
+
}
|
|
62
65
|
}
|
|
63
66
|
prefix(prefix) {
|
|
64
67
|
return new _ContractRouterBuilder({
|
|
@@ -173,3 +176,4 @@ export {
|
|
|
173
176
|
prefixHTTPPath,
|
|
174
177
|
standardizeHTTPPath
|
|
175
178
|
};
|
|
179
|
+
//# sourceMappingURL=index.js.map
|
package/dist/src/builder.d.ts
CHANGED
package/dist/src/constants.d.ts
CHANGED
package/dist/src/index.d.ts
CHANGED
package/dist/src/procedure.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export declare class ContractProcedure<TInputSchema extends Schema, TOutputSchem
|
|
|
33
33
|
outputExample?: SchemaOutput<TOutputSchema>;
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
+
export type WELL_CONTRACT_PROCEDURE = ContractProcedure<Schema, Schema>;
|
|
36
37
|
export declare class DecoratedContractProcedure<TInputSchema extends Schema, TOutputSchema extends Schema> extends ContractProcedure<TInputSchema, TOutputSchema> {
|
|
37
38
|
static decorate<TInputSchema extends Schema, TOutputSchema extends Schema>(cp: ContractProcedure<TInputSchema, TOutputSchema>): DecoratedContractProcedure<TInputSchema, TOutputSchema>;
|
|
38
39
|
route(opts: RouteOptions): DecoratedContractProcedure<TInputSchema, TOutputSchema>;
|
|
@@ -43,3 +44,4 @@ export declare class DecoratedContractProcedure<TInputSchema extends Schema, TOu
|
|
|
43
44
|
}
|
|
44
45
|
export type WELL_DEFINED_CONTRACT_PROCEDURE = ContractProcedure<Schema, Schema>;
|
|
45
46
|
export declare function isContractProcedure(item: unknown): item is WELL_DEFINED_CONTRACT_PROCEDURE;
|
|
47
|
+
//# sourceMappingURL=procedure.d.ts.map
|
package/dist/src/router.d.ts
CHANGED
|
@@ -13,3 +13,4 @@ export type InferContractRouterInputs<T extends ContractRouter> = {
|
|
|
13
13
|
export type InferContractRouterOutputs<T extends ContractRouter> = {
|
|
14
14
|
[K in keyof T]: T[K] extends ContractProcedure<any, infer UOutputSchema> ? SchemaOutput<UOutputSchema> : T[K] extends ContractRouter ? InferContractRouterOutputs<T[K]> : never;
|
|
15
15
|
};
|
|
16
|
+
//# sourceMappingURL=router.d.ts.map
|
package/dist/src/types.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ export type HTTPStatus = number;
|
|
|
5
5
|
export type Schema = ZodType<any, any, any> | undefined;
|
|
6
6
|
export type SchemaInput<TSchema extends Schema, TFallback = unknown> = TSchema extends undefined ? TFallback : TSchema extends ZodType<any, any, any> ? input<TSchema> : TFallback;
|
|
7
7
|
export type SchemaOutput<TSchema extends Schema, TFallback = unknown> = TSchema extends undefined ? TFallback : TSchema extends ZodType<any, any, any> ? output<TSchema> : TFallback;
|
|
8
|
+
//# sourceMappingURL=types.d.ts.map
|
package/dist/src/utils.d.ts
CHANGED
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.13.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
|
7
7
|
"repository": {
|
|
@@ -24,17 +24,18 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
27
|
-
"
|
|
27
|
+
"!**/*.map",
|
|
28
|
+
"!**/*.tsbuildinfo",
|
|
28
29
|
"dist"
|
|
29
30
|
],
|
|
30
31
|
"peerDependencies": {
|
|
31
32
|
"zod": ">=3.23.0"
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
|
-
"@orpc/shared": "0.
|
|
35
|
+
"@orpc/shared": "0.13.0"
|
|
35
36
|
},
|
|
36
37
|
"scripts": {
|
|
37
|
-
"build": "tsup --clean --entry.index=src/index.ts --format=esm --onSuccess='tsc -b --noCheck'",
|
|
38
|
+
"build": "tsup --clean --sourcemap --entry.index=src/index.ts --format=esm --onSuccess='tsc -b --noCheck'",
|
|
38
39
|
"build:watch": "pnpm run build --watch",
|
|
39
40
|
"type:check": "tsc -b"
|
|
40
41
|
}
|