@taskora-uni/contracts 6.1.0 → 6.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/dist/generated/user.d.ts +37 -0
- package/dist/generated/user.js +42 -0
- package/dist/proto/contracts.d.ts +5 -0
- package/dist/proto/contracts.js +5 -0
- package/package.json +1 -1
- package/proto/user.proto +37 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
import { Timestamp } from "./google/protobuf/timestamp";
|
|
3
|
+
export declare const protobufPackage = "user.v1";
|
|
4
|
+
export declare enum SortOrder {
|
|
5
|
+
SORT_ORDER_UNSPECIFIED = 0,
|
|
6
|
+
SORT_ORDER_ASC = 1,
|
|
7
|
+
SORT_ORDER_DESC = 2,
|
|
8
|
+
UNRECOGNIZED = -1
|
|
9
|
+
}
|
|
10
|
+
export declare enum SystemRole {
|
|
11
|
+
SYSTEM_ROLE_UNSPECIFIED = 0,
|
|
12
|
+
SYSTEM_ROLE_USER = 1,
|
|
13
|
+
SYSTEM_ROLE_ADMIN = 2,
|
|
14
|
+
UNRECOGNIZED = -1
|
|
15
|
+
}
|
|
16
|
+
export interface ListUsersRequest {
|
|
17
|
+
createdAtOrder?: SortOrder | undefined;
|
|
18
|
+
}
|
|
19
|
+
export interface User {
|
|
20
|
+
firstName: string;
|
|
21
|
+
lastName: string;
|
|
22
|
+
email: string;
|
|
23
|
+
systemRole: SystemRole;
|
|
24
|
+
createdAt: Timestamp | undefined;
|
|
25
|
+
}
|
|
26
|
+
export interface ListUsersResponse {
|
|
27
|
+
users: User[];
|
|
28
|
+
}
|
|
29
|
+
export declare const USER_V1_PACKAGE_NAME = "user.v1";
|
|
30
|
+
export interface UserServiceClient {
|
|
31
|
+
listUsers(request: ListUsersRequest): Observable<ListUsersResponse>;
|
|
32
|
+
}
|
|
33
|
+
export interface UserServiceController {
|
|
34
|
+
listUsers(request: ListUsersRequest): Promise<ListUsersResponse> | Observable<ListUsersResponse> | ListUsersResponse;
|
|
35
|
+
}
|
|
36
|
+
export declare function UserServiceControllerMethods(): (constructor: Function) => void;
|
|
37
|
+
export declare const USER_SERVICE_NAME = "UserService";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.11.6
|
|
5
|
+
// protoc v3.21.12
|
|
6
|
+
// source: user.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.USER_SERVICE_NAME = exports.USER_V1_PACKAGE_NAME = exports.SystemRole = exports.SortOrder = exports.protobufPackage = void 0;
|
|
9
|
+
exports.UserServiceControllerMethods = UserServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "user.v1";
|
|
13
|
+
var SortOrder;
|
|
14
|
+
(function (SortOrder) {
|
|
15
|
+
SortOrder[SortOrder["SORT_ORDER_UNSPECIFIED"] = 0] = "SORT_ORDER_UNSPECIFIED";
|
|
16
|
+
SortOrder[SortOrder["SORT_ORDER_ASC"] = 1] = "SORT_ORDER_ASC";
|
|
17
|
+
SortOrder[SortOrder["SORT_ORDER_DESC"] = 2] = "SORT_ORDER_DESC";
|
|
18
|
+
SortOrder[SortOrder["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
19
|
+
})(SortOrder || (exports.SortOrder = SortOrder = {}));
|
|
20
|
+
var SystemRole;
|
|
21
|
+
(function (SystemRole) {
|
|
22
|
+
SystemRole[SystemRole["SYSTEM_ROLE_UNSPECIFIED"] = 0] = "SYSTEM_ROLE_UNSPECIFIED";
|
|
23
|
+
SystemRole[SystemRole["SYSTEM_ROLE_USER"] = 1] = "SYSTEM_ROLE_USER";
|
|
24
|
+
SystemRole[SystemRole["SYSTEM_ROLE_ADMIN"] = 2] = "SYSTEM_ROLE_ADMIN";
|
|
25
|
+
SystemRole[SystemRole["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
26
|
+
})(SystemRole || (exports.SystemRole = SystemRole = {}));
|
|
27
|
+
exports.USER_V1_PACKAGE_NAME = "user.v1";
|
|
28
|
+
function UserServiceControllerMethods() {
|
|
29
|
+
return function (constructor) {
|
|
30
|
+
const grpcMethods = ["listUsers"];
|
|
31
|
+
for (const method of grpcMethods) {
|
|
32
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
33
|
+
(0, microservices_1.GrpcMethod)("UserService", method)(constructor.prototype[method], method, descriptor);
|
|
34
|
+
}
|
|
35
|
+
const grpcStreamMethods = [];
|
|
36
|
+
for (const method of grpcStreamMethods) {
|
|
37
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
38
|
+
(0, microservices_1.GrpcStreamMethod)("UserService", method)(constructor.prototype[method], method, descriptor);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
exports.USER_SERVICE_NAME = "UserService";
|
package/dist/proto/contracts.js
CHANGED
|
@@ -13,4 +13,9 @@ exports.PROTO_CONTRACTS = {
|
|
|
13
13
|
PATH: (0, path_1.join)(__dirname, "../../proto/invitation.proto"),
|
|
14
14
|
SERVICE_NAME: "InvitationService",
|
|
15
15
|
},
|
|
16
|
+
USER: {
|
|
17
|
+
PACKAGE_NAME: "user.v1",
|
|
18
|
+
PATH: (0, path_1.join)(__dirname, "../../proto/user.proto"),
|
|
19
|
+
SERVICE_NAME: "UserService",
|
|
20
|
+
},
|
|
16
21
|
};
|
package/package.json
CHANGED
package/proto/user.proto
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package user.v1;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/timestamp.proto";
|
|
6
|
+
|
|
7
|
+
service UserService {
|
|
8
|
+
rpc ListUsers(ListUsersRequest) returns (ListUsersResponse);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
enum SortOrder {
|
|
12
|
+
SORT_ORDER_UNSPECIFIED = 0;
|
|
13
|
+
SORT_ORDER_ASC = 1;
|
|
14
|
+
SORT_ORDER_DESC = 2;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
enum SystemRole {
|
|
18
|
+
SYSTEM_ROLE_UNSPECIFIED = 0;
|
|
19
|
+
SYSTEM_ROLE_USER = 1;
|
|
20
|
+
SYSTEM_ROLE_ADMIN = 2;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message ListUsersRequest {
|
|
24
|
+
optional SortOrder created_at_order = 1;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
message User {
|
|
28
|
+
string first_name = 1;
|
|
29
|
+
string last_name = 2;
|
|
30
|
+
string email = 3;
|
|
31
|
+
SystemRole system_role = 4;
|
|
32
|
+
google.protobuf.Timestamp created_at = 5;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message ListUsersResponse {
|
|
36
|
+
repeated User users = 1;
|
|
37
|
+
}
|