@requ1emz/contracts 1.0.13 → 1.0.15
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/gen/family.ts +73 -0
- package/gen/google/protobuf/empty.ts +23 -0
- package/package.json +1 -1
- package/proto/family.proto +36 -0
package/gen/family.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.10.1
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: family.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
import { Empty } from "./google/protobuf/empty";
|
|
11
|
+
|
|
12
|
+
export const protobufPackage = "family.v1";
|
|
13
|
+
|
|
14
|
+
export interface CreateFamilyRequest {
|
|
15
|
+
userId: string;
|
|
16
|
+
name: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface DeleteFamilyRequest {
|
|
20
|
+
userId: string;
|
|
21
|
+
familyId: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface GetFamilyRequest {
|
|
25
|
+
userId: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface FamilyResponse {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
createdBy: string;
|
|
32
|
+
members: FamilyMemberDto[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface FamilyMemberDto {
|
|
36
|
+
userId: string;
|
|
37
|
+
role: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const FAMILY_V1_PACKAGE_NAME = "family.v1";
|
|
41
|
+
|
|
42
|
+
export interface FamilyServiceClient {
|
|
43
|
+
createFamily(request: CreateFamilyRequest): Observable<FamilyResponse>;
|
|
44
|
+
|
|
45
|
+
deleteFamily(request: DeleteFamilyRequest): Observable<Empty>;
|
|
46
|
+
|
|
47
|
+
getFamily(request: GetFamilyRequest): Observable<FamilyResponse>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface FamilyServiceController {
|
|
51
|
+
createFamily(request: CreateFamilyRequest): Promise<FamilyResponse> | Observable<FamilyResponse> | FamilyResponse;
|
|
52
|
+
|
|
53
|
+
deleteFamily(request: DeleteFamilyRequest): void;
|
|
54
|
+
|
|
55
|
+
getFamily(request: GetFamilyRequest): Promise<FamilyResponse> | Observable<FamilyResponse> | FamilyResponse;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function FamilyServiceControllerMethods() {
|
|
59
|
+
return function (constructor: Function) {
|
|
60
|
+
const grpcMethods: string[] = ["createFamily", "deleteFamily", "getFamily"];
|
|
61
|
+
for (const method of grpcMethods) {
|
|
62
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
63
|
+
GrpcMethod("FamilyService", method)(constructor.prototype[method], method, descriptor);
|
|
64
|
+
}
|
|
65
|
+
const grpcStreamMethods: string[] = [];
|
|
66
|
+
for (const method of grpcStreamMethods) {
|
|
67
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
68
|
+
GrpcStreamMethod("FamilyService", method)(constructor.prototype[method], method, descriptor);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export const FAMILY_SERVICE_NAME = "FamilyService";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.10.1
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: google/protobuf/empty.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
|
|
9
|
+
export const protobufPackage = "google.protobuf";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A generic empty message that you can re-use to avoid defining duplicated
|
|
13
|
+
* empty messages in your APIs. A typical example is to use it as the request
|
|
14
|
+
* or the response type of an API method. For instance:
|
|
15
|
+
*
|
|
16
|
+
* service Foo {
|
|
17
|
+
* rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
20
|
+
export interface Empty {
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
package/package.json
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package family.v1;
|
|
4
|
+
import "google/protobuf/empty.proto";
|
|
5
|
+
|
|
6
|
+
service FamilyService {
|
|
7
|
+
rpc CreateFamily (CreateFamilyRequest) returns (FamilyResponse);
|
|
8
|
+
rpc DeleteFamily (DeleteFamilyRequest) returns (google.protobuf.Empty);
|
|
9
|
+
rpc GetFamily (GetFamilyRequest) returns (FamilyResponse);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
message CreateFamilyRequest {
|
|
13
|
+
string user_id = 1;
|
|
14
|
+
string name = 2;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
message DeleteFamilyRequest {
|
|
18
|
+
string user_id = 1;
|
|
19
|
+
string family_id = 2;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message GetFamilyRequest {
|
|
23
|
+
string user_id = 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
message FamilyResponse {
|
|
27
|
+
string id = 1;
|
|
28
|
+
string name = 2;
|
|
29
|
+
string created_by = 3;
|
|
30
|
+
repeated FamilyMemberDto members = 4;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
message FamilyMemberDto {
|
|
34
|
+
string user_id = 1;
|
|
35
|
+
string role = 2;
|
|
36
|
+
}
|