@funpay-pilot/contracts 0.0.2 → 0.0.4
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.ts +1 -0
- package/dist/index.js +17 -0
- package/dist/proto/index.d.ts +1 -0
- package/dist/proto/index.js +17 -0
- package/dist/proto/paths.d.ts +3 -0
- package/dist/proto/paths.js +7 -0
- package/gen/users.ts +49 -0
- package/package.json +2 -1
- package/proto/users.proto +16 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './proto';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./proto"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './paths';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./paths"), exports);
|
package/gen/users.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.6
|
|
4
|
+
// protoc v7.34.0
|
|
5
|
+
// source: users.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "users.v1";
|
|
12
|
+
|
|
13
|
+
export interface CreateUserRequest {
|
|
14
|
+
id: string;
|
|
15
|
+
username: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface CreateUserResponse {
|
|
19
|
+
ok: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const USERS_V1_PACKAGE_NAME = "users.v1";
|
|
23
|
+
|
|
24
|
+
export interface UsersServiceClient {
|
|
25
|
+
createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface UsersServiceController {
|
|
29
|
+
createUser(
|
|
30
|
+
request: CreateUserRequest,
|
|
31
|
+
): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function UsersServiceControllerMethods() {
|
|
35
|
+
return function (constructor: Function) {
|
|
36
|
+
const grpcMethods: string[] = ["createUser"];
|
|
37
|
+
for (const method of grpcMethods) {
|
|
38
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
39
|
+
GrpcMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
|
|
40
|
+
}
|
|
41
|
+
const grpcStreamMethods: string[] = [];
|
|
42
|
+
for (const method of grpcStreamMethods) {
|
|
43
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
44
|
+
GrpcStreamMethod("UsersService", method)(constructor.prototype[method], method, descriptor);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const USERS_SERVICE_NAME = "UsersService";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funpay-pilot/contracts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Protobuf definitions and generated TypeScript types",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"generate": "npx protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
|
+
"dist",
|
|
12
13
|
"proto",
|
|
13
14
|
"gen"
|
|
14
15
|
],
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package users.v1;
|
|
4
|
+
|
|
5
|
+
service UsersService {
|
|
6
|
+
rpc CreateUser(CreateUserRequest) returns (CreateUserResponse);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
message CreateUserRequest {
|
|
10
|
+
string id = 1;
|
|
11
|
+
string username = 2;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
message CreateUserResponse {
|
|
15
|
+
bool ok = 1;
|
|
16
|
+
}
|