@taskora-uni/contracts 6.2.0 → 6.3.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.
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
import { Timestamp } from "./google/protobuf/timestamp";
|
|
3
|
+
export declare const protobufPackage = "profile.v1";
|
|
4
|
+
export declare enum SystemRole {
|
|
5
|
+
SYSTEM_ROLE_UNSPECIFIED = 0,
|
|
6
|
+
SYSTEM_ROLE_USER = 1,
|
|
7
|
+
SYSTEM_ROLE_ADMIN = 2,
|
|
8
|
+
UNRECOGNIZED = -1
|
|
9
|
+
}
|
|
10
|
+
export interface GetMyProfileRequest {
|
|
11
|
+
credentialId: string;
|
|
12
|
+
}
|
|
13
|
+
export interface UpdateMyProfileRequest {
|
|
14
|
+
credentialId: string;
|
|
15
|
+
firstName: string;
|
|
16
|
+
lastName: string;
|
|
17
|
+
}
|
|
18
|
+
export interface Profile {
|
|
19
|
+
firstName: string;
|
|
20
|
+
lastName: string;
|
|
21
|
+
email: string;
|
|
22
|
+
systemRole: SystemRole;
|
|
23
|
+
createdAt: Timestamp | undefined;
|
|
24
|
+
}
|
|
25
|
+
export declare const PROFILE_V1_PACKAGE_NAME = "profile.v1";
|
|
26
|
+
export interface ProfileServiceClient {
|
|
27
|
+
getMyProfile(request: GetMyProfileRequest): Observable<Profile>;
|
|
28
|
+
updateMyProfile(request: UpdateMyProfileRequest): Observable<Profile>;
|
|
29
|
+
}
|
|
30
|
+
export interface ProfileServiceController {
|
|
31
|
+
getMyProfile(request: GetMyProfileRequest): Promise<Profile> | Observable<Profile> | Profile;
|
|
32
|
+
updateMyProfile(request: UpdateMyProfileRequest): Promise<Profile> | Observable<Profile> | Profile;
|
|
33
|
+
}
|
|
34
|
+
export declare function ProfileServiceControllerMethods(): (constructor: Function) => void;
|
|
35
|
+
export declare const PROFILE_SERVICE_NAME = "ProfileService";
|
|
@@ -0,0 +1,35 @@
|
|
|
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: profile.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.PROFILE_SERVICE_NAME = exports.PROFILE_V1_PACKAGE_NAME = exports.SystemRole = exports.protobufPackage = void 0;
|
|
9
|
+
exports.ProfileServiceControllerMethods = ProfileServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "profile.v1";
|
|
13
|
+
var SystemRole;
|
|
14
|
+
(function (SystemRole) {
|
|
15
|
+
SystemRole[SystemRole["SYSTEM_ROLE_UNSPECIFIED"] = 0] = "SYSTEM_ROLE_UNSPECIFIED";
|
|
16
|
+
SystemRole[SystemRole["SYSTEM_ROLE_USER"] = 1] = "SYSTEM_ROLE_USER";
|
|
17
|
+
SystemRole[SystemRole["SYSTEM_ROLE_ADMIN"] = 2] = "SYSTEM_ROLE_ADMIN";
|
|
18
|
+
SystemRole[SystemRole["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
19
|
+
})(SystemRole || (exports.SystemRole = SystemRole = {}));
|
|
20
|
+
exports.PROFILE_V1_PACKAGE_NAME = "profile.v1";
|
|
21
|
+
function ProfileServiceControllerMethods() {
|
|
22
|
+
return function (constructor) {
|
|
23
|
+
const grpcMethods = ["getMyProfile", "updateMyProfile"];
|
|
24
|
+
for (const method of grpcMethods) {
|
|
25
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
26
|
+
(0, microservices_1.GrpcMethod)("ProfileService", method)(constructor.prototype[method], method, descriptor);
|
|
27
|
+
}
|
|
28
|
+
const grpcStreamMethods = [];
|
|
29
|
+
for (const method of grpcStreamMethods) {
|
|
30
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
31
|
+
(0, microservices_1.GrpcStreamMethod)("ProfileService", method)(constructor.prototype[method], method, descriptor);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
exports.PROFILE_SERVICE_NAME = "ProfileService";
|
package/dist/proto/contracts.js
CHANGED
|
@@ -18,4 +18,9 @@ exports.PROTO_CONTRACTS = {
|
|
|
18
18
|
PATH: (0, path_1.join)(__dirname, "../../proto/user.proto"),
|
|
19
19
|
SERVICE_NAME: "UserService",
|
|
20
20
|
},
|
|
21
|
+
PROFILE: {
|
|
22
|
+
PACKAGE_NAME: "profile.v1",
|
|
23
|
+
PATH: (0, path_1.join)(__dirname, "../../proto/profile.proto"),
|
|
24
|
+
SERVICE_NAME: "ProfileService",
|
|
25
|
+
},
|
|
21
26
|
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package profile.v1;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/timestamp.proto";
|
|
6
|
+
|
|
7
|
+
service ProfileService {
|
|
8
|
+
rpc GetMyProfile(GetMyProfileRequest) returns (Profile);
|
|
9
|
+
rpc UpdateMyProfile(UpdateMyProfileRequest) returns (Profile);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
enum SystemRole {
|
|
13
|
+
SYSTEM_ROLE_UNSPECIFIED = 0;
|
|
14
|
+
SYSTEM_ROLE_USER = 1;
|
|
15
|
+
SYSTEM_ROLE_ADMIN = 2;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
message GetMyProfileRequest {
|
|
19
|
+
string credential_id = 1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message UpdateMyProfileRequest {
|
|
23
|
+
string credential_id = 1;
|
|
24
|
+
string first_name = 2;
|
|
25
|
+
string last_name = 3;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message Profile {
|
|
29
|
+
string first_name = 1;
|
|
30
|
+
string last_name = 2;
|
|
31
|
+
string email = 3;
|
|
32
|
+
SystemRole system_role = 4;
|
|
33
|
+
google.protobuf.Timestamp created_at = 5;
|
|
34
|
+
}
|