@taskora-uni/contracts 6.0.1 → 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.
@@ -2,6 +2,18 @@ import { Observable } from "rxjs";
2
2
  import { Empty } from "./google/protobuf/empty";
3
3
  import { Timestamp } from "./google/protobuf/timestamp";
4
4
  export declare const protobufPackage = "invitation.v1";
5
+ export declare enum InvitationUsageStatus {
6
+ INVITATION_USAGE_STATUS_UNSPECIFIED = 0,
7
+ INVITATION_USAGE_STATUS_USED = 1,
8
+ INVITATION_USAGE_STATUS_UNUSED = 2,
9
+ UNRECOGNIZED = -1
10
+ }
11
+ export declare enum SortOrder {
12
+ SORT_ORDER_UNSPECIFIED = 0,
13
+ SORT_ORDER_ASC = 1,
14
+ SORT_ORDER_DESC = 2,
15
+ UNRECOGNIZED = -1
16
+ }
5
17
  export interface CreateInvitationResponse {
6
18
  token: string;
7
19
  expiresAt: Timestamp | undefined;
@@ -17,6 +29,10 @@ export interface Invitation {
17
29
  usedAt?: Timestamp | undefined;
18
30
  createdAt: Timestamp | undefined;
19
31
  }
32
+ export interface ListInvitationsRequest {
33
+ status?: InvitationUsageStatus | undefined;
34
+ createdAtOrder?: SortOrder | undefined;
35
+ }
20
36
  export interface ListInvitationsResponse {
21
37
  invitations: Invitation[];
22
38
  }
@@ -32,13 +48,13 @@ export interface DeleteInvitationRequest {
32
48
  export declare const INVITATION_V1_PACKAGE_NAME = "invitation.v1";
33
49
  export interface InvitationServiceClient {
34
50
  createInvitation(request: Empty): Observable<CreateInvitationResponse>;
35
- listInvitations(request: Empty): Observable<ListInvitationsResponse>;
51
+ listInvitations(request: ListInvitationsRequest): Observable<ListInvitationsResponse>;
36
52
  validateInvitationToken(request: ValidateInvitationTokenRequest): Observable<ValidateInvitationTokenResponse>;
37
53
  deleteInvitation(request: DeleteInvitationRequest): Observable<Empty>;
38
54
  }
39
55
  export interface InvitationServiceController {
40
56
  createInvitation(request: Empty): Promise<CreateInvitationResponse> | Observable<CreateInvitationResponse> | CreateInvitationResponse;
41
- listInvitations(request: Empty): Promise<ListInvitationsResponse> | Observable<ListInvitationsResponse> | ListInvitationsResponse;
57
+ listInvitations(request: ListInvitationsRequest): Promise<ListInvitationsResponse> | Observable<ListInvitationsResponse> | ListInvitationsResponse;
42
58
  validateInvitationToken(request: ValidateInvitationTokenRequest): Promise<ValidateInvitationTokenResponse> | Observable<ValidateInvitationTokenResponse> | ValidateInvitationTokenResponse;
43
59
  deleteInvitation(request: DeleteInvitationRequest): void | Promise<void>;
44
60
  }
@@ -5,11 +5,25 @@
5
5
  // protoc v3.21.12
6
6
  // source: invitation.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.INVITATION_SERVICE_NAME = exports.INVITATION_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
8
+ exports.INVITATION_SERVICE_NAME = exports.INVITATION_V1_PACKAGE_NAME = exports.SortOrder = exports.InvitationUsageStatus = exports.protobufPackage = void 0;
9
9
  exports.InvitationServiceControllerMethods = InvitationServiceControllerMethods;
10
10
  /* eslint-disable */
11
11
  const microservices_1 = require("@nestjs/microservices");
12
12
  exports.protobufPackage = "invitation.v1";
13
+ var InvitationUsageStatus;
14
+ (function (InvitationUsageStatus) {
15
+ InvitationUsageStatus[InvitationUsageStatus["INVITATION_USAGE_STATUS_UNSPECIFIED"] = 0] = "INVITATION_USAGE_STATUS_UNSPECIFIED";
16
+ InvitationUsageStatus[InvitationUsageStatus["INVITATION_USAGE_STATUS_USED"] = 1] = "INVITATION_USAGE_STATUS_USED";
17
+ InvitationUsageStatus[InvitationUsageStatus["INVITATION_USAGE_STATUS_UNUSED"] = 2] = "INVITATION_USAGE_STATUS_UNUSED";
18
+ InvitationUsageStatus[InvitationUsageStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
19
+ })(InvitationUsageStatus || (exports.InvitationUsageStatus = InvitationUsageStatus = {}));
20
+ var SortOrder;
21
+ (function (SortOrder) {
22
+ SortOrder[SortOrder["SORT_ORDER_UNSPECIFIED"] = 0] = "SORT_ORDER_UNSPECIFIED";
23
+ SortOrder[SortOrder["SORT_ORDER_ASC"] = 1] = "SORT_ORDER_ASC";
24
+ SortOrder[SortOrder["SORT_ORDER_DESC"] = 2] = "SORT_ORDER_DESC";
25
+ SortOrder[SortOrder["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
26
+ })(SortOrder || (exports.SortOrder = SortOrder = {}));
13
27
  exports.INVITATION_V1_PACKAGE_NAME = "invitation.v1";
14
28
  function InvitationServiceControllerMethods() {
15
29
  return function (constructor) {
@@ -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,9 @@ 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
+ };
12
17
  };
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taskora-uni/contracts",
3
- "version": "6.0.1",
3
+ "version": "6.2.0",
4
4
  "description": "Shared protobuf contracts and generated TypeScript bindings for Taskora Uni backend services.",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -7,7 +7,7 @@ import "google/protobuf/timestamp.proto";
7
7
 
8
8
  service InvitationService {
9
9
  rpc CreateInvitation(google.protobuf.Empty) returns (CreateInvitationResponse);
10
- rpc ListInvitations(google.protobuf.Empty) returns (ListInvitationsResponse);
10
+ rpc ListInvitations(ListInvitationsRequest) returns (ListInvitationsResponse);
11
11
  rpc ValidateInvitationToken(ValidateInvitationTokenRequest) returns (ValidateInvitationTokenResponse);
12
12
  rpc DeleteInvitation(DeleteInvitationRequest) returns (google.protobuf.Empty);
13
13
  }
@@ -30,6 +30,23 @@ message Invitation {
30
30
  google.protobuf.Timestamp created_at = 5;
31
31
  }
32
32
 
33
+ enum InvitationUsageStatus {
34
+ INVITATION_USAGE_STATUS_UNSPECIFIED = 0;
35
+ INVITATION_USAGE_STATUS_USED = 1;
36
+ INVITATION_USAGE_STATUS_UNUSED = 2;
37
+ }
38
+
39
+ enum SortOrder {
40
+ SORT_ORDER_UNSPECIFIED = 0;
41
+ SORT_ORDER_ASC = 1;
42
+ SORT_ORDER_DESC = 2;
43
+ }
44
+
45
+ message ListInvitationsRequest {
46
+ optional InvitationUsageStatus status = 1;
47
+ optional SortOrder created_at_order = 2;
48
+ }
49
+
33
50
  message ListInvitationsResponse {
34
51
  repeated Invitation invitations = 1;
35
52
  }
@@ -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
+ }