@orpc/contract 1.12.2 → 1.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.d.mts CHANGED
@@ -207,6 +207,12 @@ declare class ContractBuilder<TInputSchema extends AnySchema, TOutputSchema exte
207
207
  * @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
208
208
  */
209
209
  $route(initialRoute: Route): ContractBuilder<TInputSchema, TOutputSchema, TErrorMap, TMeta>;
210
+ /**
211
+ * Sets or overrides the initial input schema.
212
+ *
213
+ * @see {@link https://orpc.dev/docs/procedure#initial-configuration Initial Procedure Configuration Docs}
214
+ */
215
+ $input<U extends AnySchema>(initialInputSchema?: U): ContractBuilder<U, TOutputSchema, TErrorMap, TMeta>;
210
216
  /**
211
217
  * Adds type-safe custom errors to the contract.
212
218
  * The provided errors are spared-merged with any existing errors in the contract.
package/dist/index.d.ts CHANGED
@@ -207,6 +207,12 @@ declare class ContractBuilder<TInputSchema extends AnySchema, TOutputSchema exte
207
207
  * @see {@link https://orpc.dev/docs/openapi/input-output-structure OpenAPI Input/Output Structure Docs}
208
208
  */
209
209
  $route(initialRoute: Route): ContractBuilder<TInputSchema, TOutputSchema, TErrorMap, TMeta>;
210
+ /**
211
+ * Sets or overrides the initial input schema.
212
+ *
213
+ * @see {@link https://orpc.dev/docs/procedure#initial-configuration Initial Procedure Configuration Docs}
214
+ */
215
+ $input<U extends AnySchema>(initialInputSchema?: U): ContractBuilder<U, TOutputSchema, TErrorMap, TMeta>;
210
216
  /**
211
217
  * Adds type-safe custom errors to the contract.
212
218
  * The provided errors are spared-merged with any existing errors in the contract.
package/dist/index.mjs CHANGED
@@ -121,6 +121,17 @@ class ContractBuilder extends ContractProcedure {
121
121
  route: initialRoute
122
122
  });
123
123
  }
124
+ /**
125
+ * Sets or overrides the initial input schema.
126
+ *
127
+ * @see {@link https://orpc.dev/docs/procedure#initial-configuration Initial Procedure Configuration Docs}
128
+ */
129
+ $input(initialInputSchema) {
130
+ return new ContractBuilder({
131
+ ...this["~orpc"],
132
+ inputSchema: initialInputSchema
133
+ });
134
+ }
124
135
  /**
125
136
  * Adds type-safe custom errors to the contract.
126
137
  * The provided errors are spared-merged with any existing errors in the contract.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orpc/contract",
3
3
  "type": "module",
4
- "version": "1.12.2",
4
+ "version": "1.13.0",
5
5
  "license": "MIT",
6
6
  "homepage": "https://orpc.dev",
7
7
  "repository": {
@@ -31,8 +31,8 @@
31
31
  "dependencies": {
32
32
  "@standard-schema/spec": "^1.0.0",
33
33
  "openapi-types": "^12.1.3",
34
- "@orpc/client": "1.12.2",
35
- "@orpc/shared": "1.12.2"
34
+ "@orpc/client": "1.13.0",
35
+ "@orpc/shared": "1.13.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "arktype": "2.1.27",