@taskora-uni/contracts 6.1.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";
@@ -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";
@@ -9,4 +9,14 @@ export declare const PROTO_CONTRACTS: {
9
9
  readonly PATH: string;
10
10
  readonly SERVICE_NAME: "InvitationService";
11
11
  };
12
+ readonly USER: {
13
+ readonly PACKAGE_NAME: "user.v1";
14
+ readonly PATH: string;
15
+ readonly SERVICE_NAME: "UserService";
16
+ };
17
+ readonly PROFILE: {
18
+ readonly PACKAGE_NAME: "profile.v1";
19
+ readonly PATH: string;
20
+ readonly SERVICE_NAME: "ProfileService";
21
+ };
12
22
  };
@@ -13,4 +13,14 @@ 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
+ },
21
+ PROFILE: {
22
+ PACKAGE_NAME: "profile.v1",
23
+ PATH: (0, path_1.join)(__dirname, "../../proto/profile.proto"),
24
+ SERVICE_NAME: "ProfileService",
25
+ },
16
26
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taskora-uni/contracts",
3
- "version": "6.1.0",
3
+ "version": "6.3.0",
4
4
  "description": "Shared protobuf contracts and generated TypeScript bindings for Taskora Uni backend services.",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -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
+ }
@@ -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
+ }