@loke/http-rpc 5.1.0-beta.2 → 5.1.0-beta.3
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/README.md +68 -63
- package/dist/schema.d.ts +5 -0
- package/dist/schema.js +36 -6
- package/dist/schema.js.map +1 -1
- package/dist/test/schema.js +2 -0
- package/dist/test/schema.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -52,69 +52,6 @@ app.use(
|
|
|
52
52
|
app.use(createErrorHandler({ log: (msg) => console.log(msg) }));
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
With Schema
|
|
56
|
-
|
|
57
|
-
```ts
|
|
58
|
-
const { serviceWithSchema } = require("@loke/http-rpc");
|
|
59
|
-
|
|
60
|
-
const MY_SERVICE_META = {
|
|
61
|
-
service: "my-service", // display name
|
|
62
|
-
help: "Documentation goes here",
|
|
63
|
-
multiArg: false, // defaults to false. If true accepts an array for arguments, if false an array will be assumed to be the first (and only) argument.
|
|
64
|
-
expose: [
|
|
65
|
-
// The methods to be exposed publicly
|
|
66
|
-
|
|
67
|
-
{
|
|
68
|
-
methodName: "moreStuff",
|
|
69
|
-
methodTimeout: 15000,
|
|
70
|
-
paramNames: ["stuffs"],
|
|
71
|
-
help: "This is a silly method",
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const meta = { implementation: myService, meta: MY_SERVICE_META };
|
|
77
|
-
|
|
78
|
-
interface Thing {
|
|
79
|
-
name: string;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
type Defs = { Thing: Thing };
|
|
83
|
-
|
|
84
|
-
// can now be...
|
|
85
|
-
|
|
86
|
-
// https://jsontypedef.com/docs/jtd-in-5-minutes/#empty-schemas
|
|
87
|
-
|
|
88
|
-
// instead of `typeof myService` you could also name a type like
|
|
89
|
-
// type Service = {}
|
|
90
|
-
const metaWithSchema = serviceWithSchema<typeof myService, Defs>(myService, {
|
|
91
|
-
name: "my-service",
|
|
92
|
-
// Record<string, JTD>
|
|
93
|
-
definitions: {
|
|
94
|
-
Thing: {
|
|
95
|
-
properties: {
|
|
96
|
-
name: { type: "string" },
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
methods: {
|
|
101
|
-
moreStuff: {
|
|
102
|
-
help: "This is a silly method",
|
|
103
|
-
// JTD
|
|
104
|
-
requestTypeDef: {
|
|
105
|
-
properties: {
|
|
106
|
-
stuffs: { type: "string" },
|
|
107
|
-
},
|
|
108
|
-
optionalProperties: {
|
|
109
|
-
thing: {},
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
responseTypeDef: { ref: "Thing" },
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
});
|
|
116
|
-
```
|
|
117
|
-
|
|
118
55
|
## Implementation Guide
|
|
119
56
|
|
|
120
57
|
```js
|
|
@@ -169,3 +106,71 @@ Also, to list runtime RPC metadata you can GET /rpc
|
|
|
169
106
|
```
|
|
170
107
|
curl -X GET http://localhost:5000/rpc
|
|
171
108
|
```
|
|
109
|
+
|
|
110
|
+
## Schemas
|
|
111
|
+
|
|
112
|
+
Since v5.1.0 we now support
|
|
113
|
+
[JTD Schemas](https://jsontypedef.com/docs/jtd-in-5-minutes/) for requests and
|
|
114
|
+
responses validation (Via [AJV](https://ajv.js.org/json-type-definition.html)).
|
|
115
|
+
|
|
116
|
+
```ts
|
|
117
|
+
const {
|
|
118
|
+
createRequestHandler,
|
|
119
|
+
createErrorHandler,
|
|
120
|
+
serviceWithSchema,
|
|
121
|
+
} = require("@loke/http-rpc");
|
|
122
|
+
|
|
123
|
+
interface Thing {
|
|
124
|
+
name: string;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const myService = {
|
|
128
|
+
async doStuff(args: {}) {
|
|
129
|
+
return await Promise.resolve("stuff done");
|
|
130
|
+
},
|
|
131
|
+
async getThing(args: { name: string }): Promise<Thing> {
|
|
132
|
+
return { name: args.name };
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
// Type for definitions
|
|
137
|
+
type Defs = { Thing: Thing };
|
|
138
|
+
|
|
139
|
+
// instead of `typeof myService` you could also name a type like
|
|
140
|
+
// type Service = {}
|
|
141
|
+
const myRpcService = serviceWithSchema<typeof myService, Defs>(myService, {
|
|
142
|
+
name: "my-service",
|
|
143
|
+
// Record<string, JTD>
|
|
144
|
+
definitions: {
|
|
145
|
+
Thing: {
|
|
146
|
+
properties: {
|
|
147
|
+
name: { type: "string" },
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
methods: {
|
|
152
|
+
doStuff: {
|
|
153
|
+
help: "This is a silly method",
|
|
154
|
+
// JTD
|
|
155
|
+
requestTypeDef: {
|
|
156
|
+
properties: {},
|
|
157
|
+
},
|
|
158
|
+
responseTypeDef: { type: "string" },
|
|
159
|
+
},
|
|
160
|
+
getThing: {
|
|
161
|
+
help: "Get a thing",
|
|
162
|
+
requestTypeDef: {
|
|
163
|
+
properties: { name: { type: "string" } },
|
|
164
|
+
},
|
|
165
|
+
responseTypeDef: { ref: "Thing" },
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
const rpcHandler = createRequestHandler([myRpcService]);
|
|
171
|
+
|
|
172
|
+
const errorLogger = (msg) => console.log(msg);
|
|
173
|
+
|
|
174
|
+
app.use("/rpc", rpcHandler);
|
|
175
|
+
app.use(createErrorHandler({ log: errorLogger }));
|
|
176
|
+
```
|
package/dist/schema.d.ts
CHANGED
|
@@ -9,11 +9,16 @@ export interface MethodDetails<Req, Res, Def extends Record<string, unknown> = R
|
|
|
9
9
|
declare type Methods<S extends Service, Def extends Record<string, unknown> = Record<string, never>> = {
|
|
10
10
|
[K in keyof S]?: MethodDetails<Parameters<S[K]>[0], Awaited<ReturnType<S[K]>>, Def>;
|
|
11
11
|
};
|
|
12
|
+
interface Logger {
|
|
13
|
+
warn: (str: string) => void;
|
|
14
|
+
}
|
|
12
15
|
export declare function serviceWithSchema<S extends Service, Def extends Record<string, unknown> = Record<string, never>>(service: S, serviceMeta: {
|
|
13
16
|
name: string;
|
|
14
17
|
definitions?: {
|
|
15
18
|
[K in keyof Def]: JTDSchemaType<Def[K], Def>;
|
|
16
19
|
};
|
|
17
20
|
methods: Methods<S, Def>;
|
|
21
|
+
logger: Logger;
|
|
22
|
+
strictResponseValidation?: boolean;
|
|
18
23
|
}): ServiceSet<any>;
|
|
19
24
|
export {};
|
package/dist/schema.js
CHANGED
|
@@ -17,6 +17,18 @@ class ValidationError extends Error {
|
|
|
17
17
|
Object.assign(this, params);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
class ResponseValidationError extends Error {
|
|
21
|
+
constructor(message, params) {
|
|
22
|
+
super(message);
|
|
23
|
+
this.code = "validation";
|
|
24
|
+
this.type = "https://errors.loke.global/@loke/http-rpc/response-validation";
|
|
25
|
+
Object.defineProperty(this, "message", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
value: message,
|
|
28
|
+
});
|
|
29
|
+
Object.assign(this, params);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
20
32
|
function serviceWithSchema(service, serviceMeta) {
|
|
21
33
|
const ajv = new jtd_1.default();
|
|
22
34
|
const implementation = {};
|
|
@@ -25,6 +37,7 @@ function serviceWithSchema(service, serviceMeta) {
|
|
|
25
37
|
definitions: serviceMeta === null || serviceMeta === void 0 ? void 0 : serviceMeta.definitions,
|
|
26
38
|
expose: [],
|
|
27
39
|
};
|
|
40
|
+
const { logger, strictResponseValidation = process.env.NODE_ENV !== "production", } = serviceMeta;
|
|
28
41
|
for (const [methodName, methodMeta] of Object.entries(serviceMeta.methods)) {
|
|
29
42
|
const requestSchema = ajv.compile(Object.assign({ definitions: serviceMeta === null || serviceMeta === void 0 ? void 0 : serviceMeta.definitions }, methodMeta === null || methodMeta === void 0 ? void 0 : methodMeta.requestTypeDef));
|
|
30
43
|
const responseSchema = ajv.compile(Object.assign({ definitions: serviceMeta === null || serviceMeta === void 0 ? void 0 : serviceMeta.definitions }, methodMeta === null || methodMeta === void 0 ? void 0 : methodMeta.responseTypeDef));
|
|
@@ -46,10 +59,7 @@ function serviceWithSchema(service, serviceMeta) {
|
|
|
46
59
|
if (err) {
|
|
47
60
|
params.instancePath = err.instancePath;
|
|
48
61
|
params.schemaPath = err.schemaPath;
|
|
49
|
-
msg =
|
|
50
|
-
(err.instancePath
|
|
51
|
-
? err.instancePath.slice(1).replace(/\//g, ".") + " "
|
|
52
|
-
: "") + err.message;
|
|
62
|
+
msg = errorMessage(err);
|
|
53
63
|
}
|
|
54
64
|
}
|
|
55
65
|
throw new ValidationError(msg, params);
|
|
@@ -57,8 +67,23 @@ function serviceWithSchema(service, serviceMeta) {
|
|
|
57
67
|
const result = await endpoint(args);
|
|
58
68
|
if (!responseSchema(result)) {
|
|
59
69
|
const errors = responseSchema.errors;
|
|
60
|
-
|
|
61
|
-
|
|
70
|
+
if (strictResponseValidation) {
|
|
71
|
+
const errors = requestSchema.errors;
|
|
72
|
+
let msg = "response schema validation error";
|
|
73
|
+
const params = {};
|
|
74
|
+
if (Array.isArray(errors)) {
|
|
75
|
+
const err = errors[0];
|
|
76
|
+
if (err) {
|
|
77
|
+
params.instancePath = err.instancePath;
|
|
78
|
+
params.schemaPath = err.schemaPath;
|
|
79
|
+
msg = errorMessage(err);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
throw new ResponseValidationError(msg, params);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
logger.warn(`rpc response schema validation errors: ${JSON.stringify(errors)}`);
|
|
86
|
+
}
|
|
62
87
|
}
|
|
63
88
|
return result;
|
|
64
89
|
};
|
|
@@ -69,4 +94,9 @@ function serviceWithSchema(service, serviceMeta) {
|
|
|
69
94
|
};
|
|
70
95
|
}
|
|
71
96
|
exports.serviceWithSchema = serviceWithSchema;
|
|
97
|
+
function errorMessage(err) {
|
|
98
|
+
return ((err.instancePath
|
|
99
|
+
? err.instancePath.slice(1).replace(/\//g, ".") + " "
|
|
100
|
+
: "") + err.message);
|
|
101
|
+
}
|
|
72
102
|
//# sourceMappingURL=schema.js.map
|
package/dist/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../schema.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../schema.ts"],"names":[],"mappings":";;;;;;AAAA,uDAA+D;AAQ/D,MAAM,eAAgB,SAAQ,KAAK;IAMjC,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,sDAAsD,CAAC;QACnE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE;YACrC,UAAU,EAAE,IAAI;YAChB,KAAK,EAAE,OAAO;SACf,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC9B,CAAC;CACF;AAED,MAAM,uBAAwB,SAAQ,KAAK;IAMzC,YAAY,OAAe,EAAE,MAA6B;QACxD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,+DAA+D,CAAC;QAC5E,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE;YACrC,UAAU,EAAE,IAAI;YAChB,KAAK,EAAE,OAAO;SACf,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC9B,CAAC;CACF;AA4BD,SAAgB,iBAAiB,CAI/B,OAAU,EACV,WAQC;IAED,MAAM,GAAG,GAAG,IAAI,aAAG,EAAE,CAAC;IAEtB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BACH;aACF;YAED,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;KACH;IAED,OAAO;QACL,cAAc;QACd,IAAI,EAAE,cAAc;KACrB,CAAC;AACJ,CAAC;AA1GD,8CA0GC;AAED,SAAS,YAAY,CAAC,GAAgB;IACpC,OAAO,CACL,CAAC,GAAG,CAAC,YAAY;QACf,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,GAAG;QACrD,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,OAAO,CACtB,CAAC;AACJ,CAAC"}
|
package/dist/test/schema.js
CHANGED
|
@@ -72,6 +72,7 @@ function createServerAddress(app) {
|
|
|
72
72
|
responseTypeDef: { ref: "User" },
|
|
73
73
|
},
|
|
74
74
|
},
|
|
75
|
+
logger: { warn: t.log },
|
|
75
76
|
}),
|
|
76
77
|
(0, schema_1.serviceWithSchema)(service2, {
|
|
77
78
|
name: "service2",
|
|
@@ -95,6 +96,7 @@ function createServerAddress(app) {
|
|
|
95
96
|
responseTypeDef: { type: "string" },
|
|
96
97
|
},
|
|
97
98
|
},
|
|
99
|
+
logger: { warn: t.log },
|
|
98
100
|
}),
|
|
99
101
|
]), (0, __1.createErrorHandler)());
|
|
100
102
|
const serverAddress = createServerAddress(app);
|
package/dist/test/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../test/schema.ts"],"names":[],"mappings":";;;;;AAAA,8CAAuB;AACvB,gDAAwB;AACxB,sDAA2C;AAC3C,8DAAqC;AACrC,8CAAqC;AACrC,2BAA+D;AAC/D,sCAA8C;AAE9C,8DAA8D;AAC9D,MAAM,OAAO,GAAG,CAAC,GAAQ,EAAE,GAAQ,EAAE,IAAgB,EAAE,EAAE;IACvD,IAAI,EAAE,CAAC;AACT,CAAC,CAAC;AAEF,SAAS,mBAAmB,CAAC,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