@orpc/contract 0.45.1 → 0.46.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 +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +3 -3
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -17,12 +17,12 @@ declare class ValidationError extends Error {
|
|
|
17
17
|
readonly issues: readonly StandardSchemaV1.Issue[];
|
|
18
18
|
constructor(options: ValidationErrorOptions);
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
interface ErrorMapItem<TDataSchema extends Schema> {
|
|
21
21
|
status?: number;
|
|
22
22
|
message?: string;
|
|
23
23
|
description?: string;
|
|
24
24
|
data?: TDataSchema;
|
|
25
|
-
}
|
|
25
|
+
}
|
|
26
26
|
type ErrorMap = {
|
|
27
27
|
[key in ORPCErrorCode]?: ErrorMapItem<Schema>;
|
|
28
28
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -17,12 +17,12 @@ declare class ValidationError extends Error {
|
|
|
17
17
|
readonly issues: readonly StandardSchemaV1.Issue[];
|
|
18
18
|
constructor(options: ValidationErrorOptions);
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
interface ErrorMapItem<TDataSchema extends Schema> {
|
|
21
21
|
status?: number;
|
|
22
22
|
message?: string;
|
|
23
23
|
description?: string;
|
|
24
24
|
data?: TDataSchema;
|
|
25
|
-
}
|
|
25
|
+
}
|
|
26
26
|
type ErrorMap = {
|
|
27
27
|
[key in ORPCErrorCode]?: ErrorMapItem<Schema>;
|
|
28
28
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -188,7 +188,7 @@ function eventIterator(yields, returns) {
|
|
|
188
188
|
version: 1,
|
|
189
189
|
validate(iterator) {
|
|
190
190
|
if (!isAsyncIteratorObject(iterator)) {
|
|
191
|
-
return { issues: [{ message: "Expect event
|
|
191
|
+
return { issues: [{ message: "Expect event iterator", path: [] }] };
|
|
192
192
|
}
|
|
193
193
|
const mapped = mapEventIterator(iterator, {
|
|
194
194
|
async value(value, done) {
|
|
@@ -199,10 +199,10 @@ function eventIterator(yields, returns) {
|
|
|
199
199
|
const result = await schema["~standard"].validate(value);
|
|
200
200
|
if (result.issues) {
|
|
201
201
|
throw new ORPCError("EVENT_ITERATOR_VALIDATION_FAILED", {
|
|
202
|
-
message: "Event
|
|
202
|
+
message: "Event iterator validation failed",
|
|
203
203
|
cause: new ValidationError({
|
|
204
204
|
issues: result.issues,
|
|
205
|
-
message: "Event
|
|
205
|
+
message: "Event iterator validation failed"
|
|
206
206
|
})
|
|
207
207
|
});
|
|
208
208
|
}
|
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.46.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://orpc.unnoq.com",
|
|
7
7
|
"repository": {
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@standard-schema/spec": "^1.0.0",
|
|
28
|
-
"@orpc/client": "0.
|
|
29
|
-
"@orpc/
|
|
30
|
-
"@orpc/
|
|
28
|
+
"@orpc/client": "0.46.0",
|
|
29
|
+
"@orpc/shared": "0.46.0",
|
|
30
|
+
"@orpc/standard-server": "0.46.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"arktype": "2.0.0-rc.26",
|