@lage-run/rpc 1.1.0 → 1.2.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/CHANGELOG.json +16 -1
- package/CHANGELOG.md +10 -2
- package/lib/createClient.d.ts +7 -0
- package/lib/createServer.d.ts +2 -1
- package/lib/createServer.js +3 -2
- package/lib/gen/lage/v1/lage_connect.d.ts +12 -1
- package/lib/gen/lage/v1/lage_connect.js +10 -0
- package/lib/gen/lage/v1/lage_pb.d.ts +30 -0
- package/lib/gen/lage/v1/lage_pb.js +58 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +4 -0
- package/package.json +1 -1
- package/proto/lage/v1/lage.proto +9 -0
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,22 @@
|
|
|
2
2
|
"name": "@lage-run/rpc",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "Fri,
|
|
5
|
+
"date": "Fri, 13 Sep 2024 18:04:33 GMT",
|
|
6
|
+
"version": "1.2.0",
|
|
7
|
+
"tag": "@lage-run/rpc_v1.2.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "kchau@microsoft.com",
|
|
12
|
+
"package": "@lage-run/rpc",
|
|
13
|
+
"commit": "924b93e66ae3cc60effa7cfc1f5254e1e59e9969",
|
|
14
|
+
"comment": "modified to allow for lage-server"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Fri, 06 Sep 2024 20:03:01 GMT",
|
|
6
21
|
"version": "1.1.0",
|
|
7
22
|
"tag": "@lage-run/rpc_v1.1.0",
|
|
8
23
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
# Change Log - @lage-run/rpc
|
|
2
2
|
|
|
3
|
-
This log was last generated on Fri,
|
|
3
|
+
<!-- This log was last generated on Fri, 13 Sep 2024 18:04:33 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.2.0
|
|
8
|
+
|
|
9
|
+
Fri, 13 Sep 2024 18:04:33 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- modified to allow for lage-server (kchau@microsoft.com)
|
|
14
|
+
|
|
7
15
|
## 1.1.0
|
|
8
16
|
|
|
9
|
-
Fri, 06 Sep 2024 20:
|
|
17
|
+
Fri, 06 Sep 2024 20:03:01 GMT
|
|
10
18
|
|
|
11
19
|
### Minor changes
|
|
12
20
|
|
package/lib/createClient.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export interface CreateClientOptions {
|
|
|
2
2
|
baseUrl: string;
|
|
3
3
|
httpVersion: "1.1" | "2";
|
|
4
4
|
}
|
|
5
|
+
export type LageClient = ReturnType<typeof createClient>;
|
|
5
6
|
export declare function createClient({ baseUrl, httpVersion }: CreateClientOptions): import("@connectrpc/connect").PromiseClient<{
|
|
6
7
|
readonly typeName: "connectrpc.lage.v1.LageService";
|
|
7
8
|
readonly methods: {
|
|
@@ -11,5 +12,11 @@ export declare function createClient({ baseUrl, httpVersion }: CreateClientOptio
|
|
|
11
12
|
readonly O: typeof import("./gen/lage/v1/lage_pb.js").RunTargetResponse;
|
|
12
13
|
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
13
14
|
};
|
|
15
|
+
readonly ping: {
|
|
16
|
+
readonly name: "Ping";
|
|
17
|
+
readonly I: typeof import("./gen/lage/v1/lage_pb.js").PingRequest;
|
|
18
|
+
readonly O: typeof import("./gen/lage/v1/lage_pb.js").PingResponse;
|
|
19
|
+
readonly kind: import("@bufbuild/protobuf").MethodKind.Unary;
|
|
20
|
+
};
|
|
14
21
|
};
|
|
15
22
|
}>;
|
package/lib/createServer.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
2
3
|
import type { ILageService } from "./types/ILageService.js";
|
|
3
|
-
export declare function createServer(lageService: ILageService): Promise<import("fastify").FastifyInstance<import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault>>;
|
|
4
|
+
export declare function createServer(lageService: ILageService, abortController: AbortController): Promise<import("fastify").FastifyInstance<import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault>>;
|
package/lib/createServer.js
CHANGED
|
@@ -11,10 +11,11 @@ Object.defineProperty(exports, "createServer", {
|
|
|
11
11
|
const _fastify = require("fastify");
|
|
12
12
|
const _connectfastify = require("@connectrpc/connect-fastify");
|
|
13
13
|
const _createRoutes = require("./createRoutes.js");
|
|
14
|
-
async function createServer(lageService) {
|
|
14
|
+
async function createServer(lageService, abortController) {
|
|
15
15
|
const server = (0, _fastify.fastify)();
|
|
16
16
|
await server.register(_connectfastify.fastifyConnectPlugin, {
|
|
17
|
-
routes: (0, _createRoutes.createRoutes)(lageService)
|
|
17
|
+
routes: (0, _createRoutes.createRoutes)(lageService),
|
|
18
|
+
shutdownSignal: abortController.signal
|
|
18
19
|
});
|
|
19
20
|
server.get("/", (_, reply)=>{
|
|
20
21
|
reply.type("text/plain");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RunTargetRequest, RunTargetResponse } from "./lage_pb.js";
|
|
1
|
+
import { PingRequest, PingResponse, RunTargetRequest, RunTargetResponse } from "./lage_pb.js";
|
|
2
2
|
import { MethodKind } from "@bufbuild/protobuf";
|
|
3
3
|
/**
|
|
4
4
|
* @generated from service connectrpc.lage.v1.LageService
|
|
@@ -15,5 +15,16 @@ export declare const LageService: {
|
|
|
15
15
|
readonly O: typeof RunTargetResponse;
|
|
16
16
|
readonly kind: MethodKind.Unary;
|
|
17
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* a ping function to check if the server is up
|
|
20
|
+
*
|
|
21
|
+
* @generated from rpc connectrpc.lage.v1.LageService.Ping
|
|
22
|
+
*/
|
|
23
|
+
readonly ping: {
|
|
24
|
+
readonly name: "Ping";
|
|
25
|
+
readonly I: typeof PingRequest;
|
|
26
|
+
readonly O: typeof PingResponse;
|
|
27
|
+
readonly kind: MethodKind.Unary;
|
|
28
|
+
};
|
|
18
29
|
};
|
|
19
30
|
};
|
|
@@ -23,6 +23,16 @@ const LageService = {
|
|
|
23
23
|
I: _lage_pb.RunTargetRequest,
|
|
24
24
|
O: _lage_pb.RunTargetResponse,
|
|
25
25
|
kind: _protobuf.MethodKind.Unary
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* a ping function to check if the server is up
|
|
29
|
+
*
|
|
30
|
+
* @generated from rpc connectrpc.lage.v1.LageService.Ping
|
|
31
|
+
*/ ping: {
|
|
32
|
+
name: "Ping",
|
|
33
|
+
I: _lage_pb.PingRequest,
|
|
34
|
+
O: _lage_pb.PingResponse,
|
|
35
|
+
kind: _protobuf.MethodKind.Unary
|
|
26
36
|
}
|
|
27
37
|
}
|
|
28
38
|
};
|
|
@@ -58,3 +58,33 @@ export declare class RunTargetResponse extends Message<RunTargetResponse> {
|
|
|
58
58
|
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): RunTargetResponse;
|
|
59
59
|
static equals(a: RunTargetResponse | PlainMessage<RunTargetResponse> | undefined, b: RunTargetResponse | PlainMessage<RunTargetResponse> | undefined): boolean;
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* @generated from message connectrpc.lage.v1.PingRequest
|
|
63
|
+
*/
|
|
64
|
+
export declare class PingRequest extends Message<PingRequest> {
|
|
65
|
+
constructor(data?: PartialMessage<PingRequest>);
|
|
66
|
+
static readonly runtime: typeof proto3;
|
|
67
|
+
static readonly typeName = "connectrpc.lage.v1.PingRequest";
|
|
68
|
+
static readonly fields: FieldList;
|
|
69
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): PingRequest;
|
|
70
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): PingRequest;
|
|
71
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): PingRequest;
|
|
72
|
+
static equals(a: PingRequest | PlainMessage<PingRequest> | undefined, b: PingRequest | PlainMessage<PingRequest> | undefined): boolean;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* @generated from message connectrpc.lage.v1.PingResponse
|
|
76
|
+
*/
|
|
77
|
+
export declare class PingResponse extends Message<PingResponse> {
|
|
78
|
+
/**
|
|
79
|
+
* @generated from field: bool pong = 1;
|
|
80
|
+
*/
|
|
81
|
+
pong: boolean;
|
|
82
|
+
constructor(data?: PartialMessage<PingResponse>);
|
|
83
|
+
static readonly runtime: typeof proto3;
|
|
84
|
+
static readonly typeName = "connectrpc.lage.v1.PingResponse";
|
|
85
|
+
static readonly fields: FieldList;
|
|
86
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): PingResponse;
|
|
87
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): PingResponse;
|
|
88
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): PingResponse;
|
|
89
|
+
static equals(a: PingResponse | PlainMessage<PingResponse> | undefined, b: PingResponse | PlainMessage<PingResponse> | undefined): boolean;
|
|
90
|
+
}
|
|
@@ -17,6 +17,12 @@ _export(exports, {
|
|
|
17
17
|
},
|
|
18
18
|
RunTargetResponse: function() {
|
|
19
19
|
return RunTargetResponse;
|
|
20
|
+
},
|
|
21
|
+
PingRequest: function() {
|
|
22
|
+
return PingRequest;
|
|
23
|
+
},
|
|
24
|
+
PingResponse: function() {
|
|
25
|
+
return PingResponse;
|
|
20
26
|
}
|
|
21
27
|
});
|
|
22
28
|
const _protobuf = require("@bufbuild/protobuf");
|
|
@@ -152,3 +158,55 @@ _define_property(RunTargetResponse, "fields", _protobuf.proto3.util.newFieldList
|
|
|
152
158
|
T: 5 /* ScalarType.INT32 */
|
|
153
159
|
}
|
|
154
160
|
]));
|
|
161
|
+
class PingRequest extends _protobuf.Message {
|
|
162
|
+
static fromBinary(bytes, options) {
|
|
163
|
+
return new PingRequest().fromBinary(bytes, options);
|
|
164
|
+
}
|
|
165
|
+
static fromJson(jsonValue, options) {
|
|
166
|
+
return new PingRequest().fromJson(jsonValue, options);
|
|
167
|
+
}
|
|
168
|
+
static fromJsonString(jsonString, options) {
|
|
169
|
+
return new PingRequest().fromJsonString(jsonString, options);
|
|
170
|
+
}
|
|
171
|
+
static equals(a, b) {
|
|
172
|
+
return _protobuf.proto3.util.equals(PingRequest, a, b);
|
|
173
|
+
}
|
|
174
|
+
constructor(data){
|
|
175
|
+
super();
|
|
176
|
+
_protobuf.proto3.util.initPartial(data, this);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
_define_property(PingRequest, "runtime", _protobuf.proto3);
|
|
180
|
+
_define_property(PingRequest, "typeName", "connectrpc.lage.v1.PingRequest");
|
|
181
|
+
_define_property(PingRequest, "fields", _protobuf.proto3.util.newFieldList(()=>[]));
|
|
182
|
+
class PingResponse extends _protobuf.Message {
|
|
183
|
+
static fromBinary(bytes, options) {
|
|
184
|
+
return new PingResponse().fromBinary(bytes, options);
|
|
185
|
+
}
|
|
186
|
+
static fromJson(jsonValue, options) {
|
|
187
|
+
return new PingResponse().fromJson(jsonValue, options);
|
|
188
|
+
}
|
|
189
|
+
static fromJsonString(jsonString, options) {
|
|
190
|
+
return new PingResponse().fromJsonString(jsonString, options);
|
|
191
|
+
}
|
|
192
|
+
static equals(a, b) {
|
|
193
|
+
return _protobuf.proto3.util.equals(PingResponse, a, b);
|
|
194
|
+
}
|
|
195
|
+
constructor(data){
|
|
196
|
+
super();
|
|
197
|
+
/**
|
|
198
|
+
* @generated from field: bool pong = 1;
|
|
199
|
+
*/ _define_property(this, "pong", false);
|
|
200
|
+
_protobuf.proto3.util.initPartial(data, this);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
_define_property(PingResponse, "runtime", _protobuf.proto3);
|
|
204
|
+
_define_property(PingResponse, "typeName", "connectrpc.lage.v1.PingResponse");
|
|
205
|
+
_define_property(PingResponse, "fields", _protobuf.proto3.util.newFieldList(()=>[
|
|
206
|
+
{
|
|
207
|
+
no: 1,
|
|
208
|
+
name: "pong",
|
|
209
|
+
kind: "scalar",
|
|
210
|
+
T: 8 /* ScalarType.BOOL */
|
|
211
|
+
}
|
|
212
|
+
]));
|
package/lib/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { createServer } from "./createServer.js";
|
|
2
|
-
export { createClient } from "./createClient.js";
|
|
2
|
+
export { createClient, type LageClient } from "./createClient.js";
|
|
3
3
|
export type { ILageService } from "./types/ILageService.js";
|
|
4
|
+
export { ConnectError } from "@connectrpc/connect";
|
package/lib/index.js
CHANGED
|
@@ -14,7 +14,11 @@ _export(exports, {
|
|
|
14
14
|
},
|
|
15
15
|
createClient: function() {
|
|
16
16
|
return _createClient.createClient;
|
|
17
|
+
},
|
|
18
|
+
ConnectError: function() {
|
|
19
|
+
return _connect.ConnectError;
|
|
17
20
|
}
|
|
18
21
|
});
|
|
19
22
|
const _createServer = require("./createServer.js");
|
|
20
23
|
const _createClient = require("./createClient.js");
|
|
24
|
+
const _connect = require("@connectrpc/connect");
|
package/package.json
CHANGED
package/proto/lage/v1/lage.proto
CHANGED
|
@@ -16,6 +16,15 @@ message RunTargetResponse {
|
|
|
16
16
|
int32 exit_code = 5;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
message PingRequest {}
|
|
20
|
+
message PingResponse {
|
|
21
|
+
bool pong = 1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
19
25
|
service LageService {
|
|
20
26
|
rpc RunTarget(RunTargetRequest) returns (RunTargetResponse) {}
|
|
27
|
+
|
|
28
|
+
// a ping function to check if the server is up
|
|
29
|
+
rpc Ping(PingRequest) returns (PingResponse) {}
|
|
21
30
|
}
|