@irpclib/irpc 1.2.5 → 1.2.6
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/adapter.d.ts +6 -6
- package/dist/driver.d.ts +3 -3
- package/dist/types.d.ts +2 -2
- package/package.json +2 -2
package/dist/adapter.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IRPCPackage } from "./module.js";
|
|
2
|
-
import { IRPCCrudMeta, IRPCData, IRPCStub } from "./types.js";
|
|
2
|
+
import { IRPCCrudMeta, IRPCData, IRPCMeta, IRPCStub } from "./types.js";
|
|
3
3
|
import { IRPCDriver } from "./driver.js";
|
|
4
4
|
|
|
5
5
|
//#region src/adapter.d.ts
|
|
@@ -20,7 +20,7 @@ declare class IRPCAdapter {
|
|
|
20
20
|
* @param args - Arguments forwarded to the driver method
|
|
21
21
|
* @throws CrudError.notImplemented if no driver handles the method
|
|
22
22
|
*/
|
|
23
|
-
protected dispatch(method: string, meta:
|
|
23
|
+
protected dispatch<O>(method: string, meta: IRPCMeta, ...args: unknown[]): Promise<O> | O;
|
|
24
24
|
/**
|
|
25
25
|
* Attaches a single stub to a specific method on this adapter
|
|
26
26
|
* @param stub - The stub function to attach
|
|
@@ -54,26 +54,26 @@ declare class IRPCCrudAdapter extends IRPCAdapter {
|
|
|
54
54
|
* @param meta - Resolved entity metadata
|
|
55
55
|
* @param id - The entity identifier
|
|
56
56
|
*/
|
|
57
|
-
get(meta: IRPCCrudMeta, id:
|
|
57
|
+
get(meta: IRPCCrudMeta, id: string): Promise<IRPCData> | IRPCData;
|
|
58
58
|
/**
|
|
59
59
|
* Runs a create operation through the driver chain
|
|
60
60
|
* @param meta - Resolved entity metadata
|
|
61
61
|
* @param data - The entity data to create
|
|
62
62
|
*/
|
|
63
|
-
create(meta: IRPCCrudMeta, data:
|
|
63
|
+
create<D extends IRPCData>(meta: IRPCCrudMeta, data: D): Promise<IRPCData> | IRPCData;
|
|
64
64
|
/**
|
|
65
65
|
* Runs an update operation through the driver chain
|
|
66
66
|
* @param meta - Resolved entity metadata
|
|
67
67
|
* @param id - The entity identifier
|
|
68
68
|
* @param data - The entity data to update
|
|
69
69
|
*/
|
|
70
|
-
update(meta: IRPCCrudMeta, id:
|
|
70
|
+
update(meta: IRPCCrudMeta, id: string, data: IRPCData): Promise<IRPCData> | IRPCData;
|
|
71
71
|
/**
|
|
72
72
|
* Runs a delete operation through the driver chain
|
|
73
73
|
* @param meta - Resolved entity metadata
|
|
74
74
|
* @param id - The entity identifier
|
|
75
75
|
*/
|
|
76
|
-
delete(meta: IRPCCrudMeta, id:
|
|
76
|
+
delete(meta: IRPCCrudMeta, id: string): Promise<IRPCData> | IRPCData;
|
|
77
77
|
}
|
|
78
78
|
//#endregion
|
|
79
79
|
export { IRPCAdapter, IRPCCrudAdapter };
|
package/dist/driver.d.ts
CHANGED
|
@@ -7,10 +7,10 @@ type IRPCDriver<Adapter extends IRPCAdapter> = Partial<Omit<Adapter, 'use' | 'at
|
|
|
7
7
|
* Base class for CRUD drivers that receive per-method resolved metadata on every call
|
|
8
8
|
*/
|
|
9
9
|
declare abstract class IRPCCrudDriver {
|
|
10
|
-
get?(meta: IRPCCrudMeta, id:
|
|
10
|
+
get?(meta: IRPCCrudMeta, id: string): Promise<IRPCData> | IRPCData;
|
|
11
11
|
create?(meta: IRPCCrudMeta, data: IRPCData): Promise<IRPCData> | IRPCData;
|
|
12
|
-
update?(meta: IRPCCrudMeta, id:
|
|
13
|
-
delete?(meta: IRPCCrudMeta, id:
|
|
12
|
+
update?(meta: IRPCCrudMeta, id: string, data: IRPCData): Promise<IRPCData> | IRPCData;
|
|
13
|
+
delete?(meta: IRPCCrudMeta, id: string): Promise<IRPCData> | IRPCData;
|
|
14
14
|
}
|
|
15
15
|
//#endregion
|
|
16
16
|
export { IRPCCrudDriver, IRPCDriver };
|
package/dist/types.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { RemoteState } from "./state.js";
|
|
|
5
5
|
import { IRPCReader } from "./reader.js";
|
|
6
6
|
import { IRPCTransport } from "./transport.js";
|
|
7
7
|
import { AsyncValue, StateChange } from "@anchorlib/core";
|
|
8
|
-
import { ZodArray, ZodBoolean, ZodNull, ZodNumber, ZodObject, ZodSafeParseResult, ZodString, ZodUndefined } from "zod/v4";
|
|
8
|
+
import { ZodArray, ZodBoolean, ZodCustom, ZodNull, ZodNumber, ZodObject, ZodOptional, ZodSafeParseResult, ZodString, ZodUndefined } from "zod/v4";
|
|
9
9
|
|
|
10
10
|
//#region src/types.d.ts
|
|
11
11
|
|
|
@@ -123,7 +123,7 @@ type IRPCDefined = string | number | boolean | IRPCObject | IRPCFile | IRPCBlob
|
|
|
123
123
|
/**
|
|
124
124
|
* Union type of all primitive Zod schema types used for validation.
|
|
125
125
|
*/
|
|
126
|
-
type IRPCPrimitiveSchema = ZodString | ZodNumber | ZodBoolean | ZodNull | ZodUndefined;
|
|
126
|
+
type IRPCPrimitiveSchema = ZodString | ZodNumber | ZodBoolean | ZodNull | ZodUndefined | ZodOptional | ZodCustom;
|
|
127
127
|
/**
|
|
128
128
|
* Zod object schema type used for validating structured data.
|
|
129
129
|
*/
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@irpclib/irpc",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.6",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"module": "./dist/index.js",
|
|
7
7
|
"exports": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"zod": "^4.1.5"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@anchorlib/core": "1.2.
|
|
39
|
+
"@anchorlib/core": "1.2.6",
|
|
40
40
|
"typescript": "^5.9.3"
|
|
41
41
|
},
|
|
42
42
|
"optionalDependencies": {
|