@orpc/contract 0.12.0 → 0.14.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 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
@@ -10,3 +10,4 @@ export declare class ContractBuilder {
10
10
  output<USchema extends Schema>(schema: USchema, example?: SchemaOutput<USchema>): DecoratedContractProcedure<undefined, USchema>;
11
11
  router<T extends ContractRouter>(router: T): T;
12
12
  }
13
+ //# sourceMappingURL=builder.d.ts.map
@@ -1,2 +1,3 @@
1
1
  export declare const ORPC_HEADER = "x-orpc-transformer";
2
2
  export declare const ORPC_HEADER_VALUE = "t";
3
+ //# sourceMappingURL=constants.d.ts.map
@@ -7,3 +7,4 @@ export * from './router';
7
7
  export * from './types';
8
8
  export * from './utils';
9
9
  export declare const oc: ContractBuilder;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -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
@@ -13,3 +13,4 @@ export declare class ContractRouterBuilder {
13
13
  tags(...tags: string[]): ContractRouterBuilder;
14
14
  router<T extends ContractRouter>(router: T): HandledContractRouter<T>;
15
15
  }
16
+ //# sourceMappingURL=router-builder.d.ts.map
@@ -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
@@ -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
@@ -1,3 +1,4 @@
1
1
  import type { HTTPPath } from './types';
2
2
  export declare function standardizeHTTPPath(path: HTTPPath): HTTPPath;
3
3
  export declare function prefixHTTPPath(prefix: HTTPPath, path: HTTPPath): HTTPPath;
4
+ //# sourceMappingURL=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.12.0",
4
+ "version": "0.14.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
- "!dist/*.tsbuildinfo",
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.12.0"
35
+ "@orpc/shared": "0.14.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
  }