@taskora-uni/contracts 6.3.0 → 7.0.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,90 @@
1
+ import { Observable } from "rxjs";
2
+ import { Empty } from "./google/protobuf/empty";
3
+ import { Timestamp } from "./google/protobuf/timestamp";
4
+ export declare const protobufPackage = "project.v1";
5
+ export declare enum SystemRole {
6
+ SYSTEM_ROLE_UNSPECIFIED = 0,
7
+ SYSTEM_ROLE_USER = 1,
8
+ SYSTEM_ROLE_ADMIN = 2,
9
+ UNRECOGNIZED = -1
10
+ }
11
+ export declare enum ProjectRole {
12
+ PROJECT_ROLE_UNSPECIFIED = 0,
13
+ PROJECT_ROLE_MEMBER = 1,
14
+ PROJECT_ROLE_OBSERVER = 2,
15
+ PROJECT_ROLE_MANAGER = 3,
16
+ UNRECOGNIZED = -1
17
+ }
18
+ export interface WorkspaceUserSummary {
19
+ accountId: string;
20
+ firstName: string;
21
+ lastName: string;
22
+ }
23
+ export interface ProjectMemberInput {
24
+ accountId: string;
25
+ role: ProjectRole;
26
+ }
27
+ export interface ProjectMembersPatch {
28
+ members: ProjectMemberInput[];
29
+ }
30
+ export interface ProjectMember {
31
+ accountId: string;
32
+ role: ProjectRole;
33
+ user: WorkspaceUserSummary | undefined;
34
+ }
35
+ export interface Project {
36
+ id: string;
37
+ name: string;
38
+ description: string;
39
+ members: ProjectMember[];
40
+ createdAt: Timestamp | undefined;
41
+ }
42
+ export interface ListProjectsRequest {
43
+ requesterAccountId: string;
44
+ requesterSystemRole: SystemRole;
45
+ }
46
+ export interface ListProjectsResponse {
47
+ projects: Project[];
48
+ }
49
+ export interface GetProjectRequest {
50
+ requesterAccountId: string;
51
+ requesterSystemRole: SystemRole;
52
+ id: string;
53
+ }
54
+ export interface CreateProjectRequest {
55
+ requesterAccountId: string;
56
+ requesterSystemRole: SystemRole;
57
+ name: string;
58
+ description?: string | undefined;
59
+ members: ProjectMemberInput[];
60
+ }
61
+ export interface UpdateProjectRequest {
62
+ requesterAccountId: string;
63
+ requesterSystemRole: SystemRole;
64
+ id: string;
65
+ name?: string | undefined;
66
+ description?: string | undefined;
67
+ membersPatch?: ProjectMembersPatch | undefined;
68
+ }
69
+ export interface DeleteProjectRequest {
70
+ requesterAccountId: string;
71
+ requesterSystemRole: SystemRole;
72
+ id: string;
73
+ }
74
+ export declare const PROJECT_V1_PACKAGE_NAME = "project.v1";
75
+ export interface ProjectServiceClient {
76
+ listProjects(request: ListProjectsRequest): Observable<ListProjectsResponse>;
77
+ getProject(request: GetProjectRequest): Observable<Project>;
78
+ createProject(request: CreateProjectRequest): Observable<Project>;
79
+ updateProject(request: UpdateProjectRequest): Observable<Project>;
80
+ deleteProject(request: DeleteProjectRequest): Observable<Empty>;
81
+ }
82
+ export interface ProjectServiceController {
83
+ listProjects(request: ListProjectsRequest): Promise<ListProjectsResponse> | Observable<ListProjectsResponse> | ListProjectsResponse;
84
+ getProject(request: GetProjectRequest): Promise<Project> | Observable<Project> | Project;
85
+ createProject(request: CreateProjectRequest): Promise<Project> | Observable<Project> | Project;
86
+ updateProject(request: UpdateProjectRequest): Promise<Project> | Observable<Project> | Project;
87
+ deleteProject(request: DeleteProjectRequest): void | Promise<void>;
88
+ }
89
+ export declare function ProjectServiceControllerMethods(): (constructor: Function) => void;
90
+ export declare const PROJECT_SERVICE_NAME = "ProjectService";
@@ -0,0 +1,43 @@
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: project.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.PROJECT_SERVICE_NAME = exports.PROJECT_V1_PACKAGE_NAME = exports.ProjectRole = exports.SystemRole = exports.protobufPackage = void 0;
9
+ exports.ProjectServiceControllerMethods = ProjectServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "project.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
+ var ProjectRole;
21
+ (function (ProjectRole) {
22
+ ProjectRole[ProjectRole["PROJECT_ROLE_UNSPECIFIED"] = 0] = "PROJECT_ROLE_UNSPECIFIED";
23
+ ProjectRole[ProjectRole["PROJECT_ROLE_MEMBER"] = 1] = "PROJECT_ROLE_MEMBER";
24
+ ProjectRole[ProjectRole["PROJECT_ROLE_OBSERVER"] = 2] = "PROJECT_ROLE_OBSERVER";
25
+ ProjectRole[ProjectRole["PROJECT_ROLE_MANAGER"] = 3] = "PROJECT_ROLE_MANAGER";
26
+ ProjectRole[ProjectRole["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
27
+ })(ProjectRole || (exports.ProjectRole = ProjectRole = {}));
28
+ exports.PROJECT_V1_PACKAGE_NAME = "project.v1";
29
+ function ProjectServiceControllerMethods() {
30
+ return function (constructor) {
31
+ const grpcMethods = ["listProjects", "getProject", "createProject", "updateProject", "deleteProject"];
32
+ for (const method of grpcMethods) {
33
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
34
+ (0, microservices_1.GrpcMethod)("ProjectService", method)(constructor.prototype[method], method, descriptor);
35
+ }
36
+ const grpcStreamMethods = [];
37
+ for (const method of grpcStreamMethods) {
38
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
39
+ (0, microservices_1.GrpcStreamMethod)("ProjectService", method)(constructor.prototype[method], method, descriptor);
40
+ }
41
+ };
42
+ }
43
+ exports.PROJECT_SERVICE_NAME = "ProjectService";
@@ -0,0 +1,116 @@
1
+ import { Observable } from "rxjs";
2
+ import { Empty } from "./google/protobuf/empty";
3
+ import { Timestamp } from "./google/protobuf/timestamp";
4
+ export declare const protobufPackage = "task.v1";
5
+ export declare enum SystemRole {
6
+ SYSTEM_ROLE_UNSPECIFIED = 0,
7
+ SYSTEM_ROLE_USER = 1,
8
+ SYSTEM_ROLE_ADMIN = 2,
9
+ UNRECOGNIZED = -1
10
+ }
11
+ export declare enum TaskPriority {
12
+ TASK_PRIORITY_UNSPECIFIED = 0,
13
+ TASK_PRIORITY_LOW = 1,
14
+ TASK_PRIORITY_MEDIUM = 2,
15
+ TASK_PRIORITY_HIGH = 3,
16
+ UNRECOGNIZED = -1
17
+ }
18
+ export declare enum TaskStatusCode {
19
+ TASK_STATUS_CODE_UNSPECIFIED = 0,
20
+ TASK_STATUS_CODE_TODO = 1,
21
+ TASK_STATUS_CODE_IN_PROGRESS = 2,
22
+ TASK_STATUS_CODE_TESTING = 3,
23
+ TASK_STATUS_CODE_DONE = 4,
24
+ UNRECOGNIZED = -1
25
+ }
26
+ export interface WorkspaceUserSummary {
27
+ accountId: string;
28
+ firstName: string;
29
+ lastName: string;
30
+ }
31
+ export interface TaskStatus {
32
+ id: string;
33
+ code: TaskStatusCode;
34
+ name: string;
35
+ }
36
+ export interface Task {
37
+ id: string;
38
+ name: string;
39
+ description: string;
40
+ priority: TaskPriority;
41
+ deadline: Timestamp | undefined;
42
+ status: TaskStatus | undefined;
43
+ projectId: string;
44
+ creator: WorkspaceUserSummary | undefined;
45
+ assignee: WorkspaceUserSummary | undefined;
46
+ createdAt: Timestamp | undefined;
47
+ updatedAt: Timestamp | undefined;
48
+ }
49
+ export interface ListTaskStatusesRequest {
50
+ }
51
+ export interface ListTaskStatusesResponse {
52
+ statuses: TaskStatus[];
53
+ }
54
+ export interface ListProjectTasksRequest {
55
+ requesterAccountId: string;
56
+ requesterSystemRole: SystemRole;
57
+ projectId: string;
58
+ }
59
+ export interface ListProjectTasksResponse {
60
+ tasks: Task[];
61
+ }
62
+ export interface CreateTaskRequest {
63
+ requesterAccountId: string;
64
+ requesterSystemRole: SystemRole;
65
+ projectId: string;
66
+ name: string;
67
+ description?: string | undefined;
68
+ priority: TaskPriority;
69
+ deadline: Timestamp | undefined;
70
+ assigneeId?: string | undefined;
71
+ statusCode?: TaskStatusCode | undefined;
72
+ }
73
+ export interface AssigneePatch {
74
+ assigneeId?: string | undefined;
75
+ clear?: boolean | undefined;
76
+ }
77
+ export interface UpdateTaskRequest {
78
+ requesterAccountId: string;
79
+ requesterSystemRole: SystemRole;
80
+ id: string;
81
+ name?: string | undefined;
82
+ description?: string | undefined;
83
+ priority?: TaskPriority | undefined;
84
+ deadline: Timestamp | undefined;
85
+ assigneePatch?: AssigneePatch | undefined;
86
+ }
87
+ export interface DeleteTaskRequest {
88
+ requesterAccountId: string;
89
+ requesterSystemRole: SystemRole;
90
+ id: string;
91
+ }
92
+ export interface UpdateTaskStatusRequest {
93
+ requesterAccountId: string;
94
+ requesterSystemRole: SystemRole;
95
+ id: string;
96
+ statusCode: TaskStatusCode;
97
+ }
98
+ export declare const TASK_V1_PACKAGE_NAME = "task.v1";
99
+ export interface TaskServiceClient {
100
+ listTaskStatuses(request: ListTaskStatusesRequest): Observable<ListTaskStatusesResponse>;
101
+ listProjectTasks(request: ListProjectTasksRequest): Observable<ListProjectTasksResponse>;
102
+ createTask(request: CreateTaskRequest): Observable<Task>;
103
+ updateTask(request: UpdateTaskRequest): Observable<Task>;
104
+ deleteTask(request: DeleteTaskRequest): Observable<Empty>;
105
+ updateTaskStatus(request: UpdateTaskStatusRequest): Observable<Task>;
106
+ }
107
+ export interface TaskServiceController {
108
+ listTaskStatuses(request: ListTaskStatusesRequest): Promise<ListTaskStatusesResponse> | Observable<ListTaskStatusesResponse> | ListTaskStatusesResponse;
109
+ listProjectTasks(request: ListProjectTasksRequest): Promise<ListProjectTasksResponse> | Observable<ListProjectTasksResponse> | ListProjectTasksResponse;
110
+ createTask(request: CreateTaskRequest): Promise<Task> | Observable<Task> | Task;
111
+ updateTask(request: UpdateTaskRequest): Promise<Task> | Observable<Task> | Task;
112
+ deleteTask(request: DeleteTaskRequest): void | Promise<void>;
113
+ updateTaskStatus(request: UpdateTaskStatusRequest): Promise<Task> | Observable<Task> | Task;
114
+ }
115
+ export declare function TaskServiceControllerMethods(): (constructor: Function) => void;
116
+ export declare const TASK_SERVICE_NAME = "TaskService";
@@ -0,0 +1,59 @@
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: task.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.TASK_SERVICE_NAME = exports.TASK_V1_PACKAGE_NAME = exports.TaskStatusCode = exports.TaskPriority = exports.SystemRole = exports.protobufPackage = void 0;
9
+ exports.TaskServiceControllerMethods = TaskServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "task.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
+ var TaskPriority;
21
+ (function (TaskPriority) {
22
+ TaskPriority[TaskPriority["TASK_PRIORITY_UNSPECIFIED"] = 0] = "TASK_PRIORITY_UNSPECIFIED";
23
+ TaskPriority[TaskPriority["TASK_PRIORITY_LOW"] = 1] = "TASK_PRIORITY_LOW";
24
+ TaskPriority[TaskPriority["TASK_PRIORITY_MEDIUM"] = 2] = "TASK_PRIORITY_MEDIUM";
25
+ TaskPriority[TaskPriority["TASK_PRIORITY_HIGH"] = 3] = "TASK_PRIORITY_HIGH";
26
+ TaskPriority[TaskPriority["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
27
+ })(TaskPriority || (exports.TaskPriority = TaskPriority = {}));
28
+ var TaskStatusCode;
29
+ (function (TaskStatusCode) {
30
+ TaskStatusCode[TaskStatusCode["TASK_STATUS_CODE_UNSPECIFIED"] = 0] = "TASK_STATUS_CODE_UNSPECIFIED";
31
+ TaskStatusCode[TaskStatusCode["TASK_STATUS_CODE_TODO"] = 1] = "TASK_STATUS_CODE_TODO";
32
+ TaskStatusCode[TaskStatusCode["TASK_STATUS_CODE_IN_PROGRESS"] = 2] = "TASK_STATUS_CODE_IN_PROGRESS";
33
+ TaskStatusCode[TaskStatusCode["TASK_STATUS_CODE_TESTING"] = 3] = "TASK_STATUS_CODE_TESTING";
34
+ TaskStatusCode[TaskStatusCode["TASK_STATUS_CODE_DONE"] = 4] = "TASK_STATUS_CODE_DONE";
35
+ TaskStatusCode[TaskStatusCode["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
36
+ })(TaskStatusCode || (exports.TaskStatusCode = TaskStatusCode = {}));
37
+ exports.TASK_V1_PACKAGE_NAME = "task.v1";
38
+ function TaskServiceControllerMethods() {
39
+ return function (constructor) {
40
+ const grpcMethods = [
41
+ "listTaskStatuses",
42
+ "listProjectTasks",
43
+ "createTask",
44
+ "updateTask",
45
+ "deleteTask",
46
+ "updateTaskStatus",
47
+ ];
48
+ for (const method of grpcMethods) {
49
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
50
+ (0, microservices_1.GrpcMethod)("TaskService", method)(constructor.prototype[method], method, descriptor);
51
+ }
52
+ const grpcStreamMethods = [];
53
+ for (const method of grpcStreamMethods) {
54
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
55
+ (0, microservices_1.GrpcStreamMethod)("TaskService", method)(constructor.prototype[method], method, descriptor);
56
+ }
57
+ };
58
+ }
59
+ exports.TASK_SERVICE_NAME = "TaskService";
@@ -17,21 +17,36 @@ export interface ListUsersRequest {
17
17
  createdAtOrder?: SortOrder | undefined;
18
18
  }
19
19
  export interface User {
20
+ id: string;
20
21
  firstName: string;
21
22
  lastName: string;
22
23
  email: string;
23
24
  systemRole: SystemRole;
24
25
  createdAt: Timestamp | undefined;
26
+ accountId: string;
25
27
  }
26
28
  export interface ListUsersResponse {
27
29
  users: User[];
28
30
  }
31
+ export interface GetUsersByAccountIdsRequest {
32
+ accountIds: string[];
33
+ }
34
+ export interface UserSummary {
35
+ accountId: string;
36
+ firstName: string;
37
+ lastName: string;
38
+ }
39
+ export interface GetUsersByAccountIdsResponse {
40
+ users: UserSummary[];
41
+ }
29
42
  export declare const USER_V1_PACKAGE_NAME = "user.v1";
30
43
  export interface UserServiceClient {
31
44
  listUsers(request: ListUsersRequest): Observable<ListUsersResponse>;
45
+ getUsersByAccountIds(request: GetUsersByAccountIdsRequest): Observable<GetUsersByAccountIdsResponse>;
32
46
  }
33
47
  export interface UserServiceController {
34
48
  listUsers(request: ListUsersRequest): Promise<ListUsersResponse> | Observable<ListUsersResponse> | ListUsersResponse;
49
+ getUsersByAccountIds(request: GetUsersByAccountIdsRequest): Promise<GetUsersByAccountIdsResponse> | Observable<GetUsersByAccountIdsResponse> | GetUsersByAccountIdsResponse;
35
50
  }
36
51
  export declare function UserServiceControllerMethods(): (constructor: Function) => void;
37
52
  export declare const USER_SERVICE_NAME = "UserService";
@@ -27,7 +27,7 @@ var SystemRole;
27
27
  exports.USER_V1_PACKAGE_NAME = "user.v1";
28
28
  function UserServiceControllerMethods() {
29
29
  return function (constructor) {
30
- const grpcMethods = ["listUsers"];
30
+ const grpcMethods = ["listUsers", "getUsersByAccountIds"];
31
31
  for (const method of grpcMethods) {
32
32
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
33
33
  (0, microservices_1.GrpcMethod)("UserService", method)(constructor.prototype[method], method, descriptor);
@@ -19,4 +19,14 @@ export declare const PROTO_CONTRACTS: {
19
19
  readonly PATH: string;
20
20
  readonly SERVICE_NAME: "ProfileService";
21
21
  };
22
+ readonly PROJECT: {
23
+ readonly PACKAGE_NAME: "project.v1";
24
+ readonly PATH: string;
25
+ readonly SERVICE_NAME: "ProjectService";
26
+ };
27
+ readonly TASK: {
28
+ readonly PACKAGE_NAME: "task.v1";
29
+ readonly PATH: string;
30
+ readonly SERVICE_NAME: "TaskService";
31
+ };
22
32
  };
@@ -23,4 +23,14 @@ exports.PROTO_CONTRACTS = {
23
23
  PATH: (0, path_1.join)(__dirname, "../../proto/profile.proto"),
24
24
  SERVICE_NAME: "ProfileService",
25
25
  },
26
+ PROJECT: {
27
+ PACKAGE_NAME: "project.v1",
28
+ PATH: (0, path_1.join)(__dirname, "../../proto/project.proto"),
29
+ SERVICE_NAME: "ProjectService",
30
+ },
31
+ TASK: {
32
+ PACKAGE_NAME: "task.v1",
33
+ PATH: (0, path_1.join)(__dirname, "../../proto/task.proto"),
34
+ SERVICE_NAME: "TaskService",
35
+ },
26
36
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taskora-uni/contracts",
3
- "version": "6.3.0",
3
+ "version": "7.0.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,94 @@
1
+ syntax = "proto3";
2
+
3
+ package project.v1;
4
+
5
+ import "google/protobuf/empty.proto";
6
+ import "google/protobuf/timestamp.proto";
7
+
8
+ service ProjectService {
9
+ rpc ListProjects(ListProjectsRequest) returns (ListProjectsResponse);
10
+ rpc GetProject(GetProjectRequest) returns (Project);
11
+ rpc CreateProject(CreateProjectRequest) returns (Project);
12
+ rpc UpdateProject(UpdateProjectRequest) returns (Project);
13
+ rpc DeleteProject(DeleteProjectRequest) returns (google.protobuf.Empty);
14
+ }
15
+
16
+ enum SystemRole {
17
+ SYSTEM_ROLE_UNSPECIFIED = 0;
18
+ SYSTEM_ROLE_USER = 1;
19
+ SYSTEM_ROLE_ADMIN = 2;
20
+ }
21
+
22
+ enum ProjectRole {
23
+ PROJECT_ROLE_UNSPECIFIED = 0;
24
+ PROJECT_ROLE_MEMBER = 1;
25
+ PROJECT_ROLE_OBSERVER = 2;
26
+ PROJECT_ROLE_MANAGER = 3;
27
+ }
28
+
29
+ message WorkspaceUserSummary {
30
+ string account_id = 1;
31
+ string first_name = 2;
32
+ string last_name = 3;
33
+ }
34
+
35
+ message ProjectMemberInput {
36
+ string account_id = 1;
37
+ ProjectRole role = 2;
38
+ }
39
+
40
+ message ProjectMembersPatch {
41
+ repeated ProjectMemberInput members = 1;
42
+ }
43
+
44
+ message ProjectMember {
45
+ string account_id = 1;
46
+ ProjectRole role = 2;
47
+ WorkspaceUserSummary user = 3;
48
+ }
49
+
50
+ message Project {
51
+ string id = 1;
52
+ string name = 2;
53
+ string description = 3;
54
+ repeated ProjectMember members = 4;
55
+ google.protobuf.Timestamp created_at = 5;
56
+ }
57
+
58
+ message ListProjectsRequest {
59
+ string requester_account_id = 1;
60
+ SystemRole requester_system_role = 2;
61
+ }
62
+
63
+ message ListProjectsResponse {
64
+ repeated Project projects = 1;
65
+ }
66
+
67
+ message GetProjectRequest {
68
+ string requester_account_id = 1;
69
+ SystemRole requester_system_role = 2;
70
+ string id = 3;
71
+ }
72
+
73
+ message CreateProjectRequest {
74
+ string requester_account_id = 1;
75
+ SystemRole requester_system_role = 2;
76
+ string name = 3;
77
+ optional string description = 4;
78
+ repeated ProjectMemberInput members = 5;
79
+ }
80
+
81
+ message UpdateProjectRequest {
82
+ string requester_account_id = 1;
83
+ SystemRole requester_system_role = 2;
84
+ string id = 3;
85
+ optional string name = 4;
86
+ optional string description = 5;
87
+ optional ProjectMembersPatch members_patch = 6;
88
+ }
89
+
90
+ message DeleteProjectRequest {
91
+ string requester_account_id = 1;
92
+ SystemRole requester_system_role = 2;
93
+ string id = 3;
94
+ }
@@ -0,0 +1,121 @@
1
+ syntax = "proto3";
2
+
3
+ package task.v1;
4
+
5
+ import "google/protobuf/empty.proto";
6
+ import "google/protobuf/timestamp.proto";
7
+
8
+ service TaskService {
9
+ rpc ListTaskStatuses(ListTaskStatusesRequest) returns (ListTaskStatusesResponse);
10
+ rpc ListProjectTasks(ListProjectTasksRequest) returns (ListProjectTasksResponse);
11
+ rpc CreateTask(CreateTaskRequest) returns (Task);
12
+ rpc UpdateTask(UpdateTaskRequest) returns (Task);
13
+ rpc DeleteTask(DeleteTaskRequest) returns (google.protobuf.Empty);
14
+ rpc UpdateTaskStatus(UpdateTaskStatusRequest) returns (Task);
15
+ }
16
+
17
+ enum SystemRole {
18
+ SYSTEM_ROLE_UNSPECIFIED = 0;
19
+ SYSTEM_ROLE_USER = 1;
20
+ SYSTEM_ROLE_ADMIN = 2;
21
+ }
22
+
23
+ enum TaskPriority {
24
+ TASK_PRIORITY_UNSPECIFIED = 0;
25
+ TASK_PRIORITY_LOW = 1;
26
+ TASK_PRIORITY_MEDIUM = 2;
27
+ TASK_PRIORITY_HIGH = 3;
28
+ }
29
+
30
+ enum TaskStatusCode {
31
+ TASK_STATUS_CODE_UNSPECIFIED = 0;
32
+ TASK_STATUS_CODE_TODO = 1;
33
+ TASK_STATUS_CODE_IN_PROGRESS = 2;
34
+ TASK_STATUS_CODE_TESTING = 3;
35
+ TASK_STATUS_CODE_DONE = 4;
36
+ }
37
+
38
+ message WorkspaceUserSummary {
39
+ string account_id = 1;
40
+ string first_name = 2;
41
+ string last_name = 3;
42
+ }
43
+
44
+ message TaskStatus {
45
+ string id = 1;
46
+ TaskStatusCode code = 2;
47
+ string name = 3;
48
+ }
49
+
50
+ message Task {
51
+ string id = 1;
52
+ string name = 2;
53
+ string description = 3;
54
+ TaskPriority priority = 4;
55
+ google.protobuf.Timestamp deadline = 5;
56
+ TaskStatus status = 6;
57
+ string project_id = 7;
58
+ WorkspaceUserSummary creator = 8;
59
+ WorkspaceUserSummary assignee = 9;
60
+ google.protobuf.Timestamp created_at = 10;
61
+ google.protobuf.Timestamp updated_at = 11;
62
+ }
63
+
64
+ message ListTaskStatusesRequest {}
65
+
66
+ message ListTaskStatusesResponse {
67
+ repeated TaskStatus statuses = 1;
68
+ }
69
+
70
+ message ListProjectTasksRequest {
71
+ string requester_account_id = 1;
72
+ SystemRole requester_system_role = 2;
73
+ string project_id = 3;
74
+ }
75
+
76
+ message ListProjectTasksResponse {
77
+ repeated Task tasks = 1;
78
+ }
79
+
80
+ message CreateTaskRequest {
81
+ string requester_account_id = 1;
82
+ SystemRole requester_system_role = 2;
83
+ string project_id = 3;
84
+ string name = 4;
85
+ optional string description = 5;
86
+ TaskPriority priority = 6;
87
+ google.protobuf.Timestamp deadline = 7;
88
+ optional string assignee_id = 8;
89
+ optional TaskStatusCode status_code = 9;
90
+ }
91
+
92
+ message AssigneePatch {
93
+ oneof value {
94
+ string assignee_id = 1;
95
+ bool clear = 2;
96
+ }
97
+ }
98
+
99
+ message UpdateTaskRequest {
100
+ string requester_account_id = 1;
101
+ SystemRole requester_system_role = 2;
102
+ string id = 3;
103
+ optional string name = 4;
104
+ optional string description = 5;
105
+ optional TaskPriority priority = 6;
106
+ google.protobuf.Timestamp deadline = 7;
107
+ optional AssigneePatch assignee_patch = 8;
108
+ }
109
+
110
+ message DeleteTaskRequest {
111
+ string requester_account_id = 1;
112
+ SystemRole requester_system_role = 2;
113
+ string id = 3;
114
+ }
115
+
116
+ message UpdateTaskStatusRequest {
117
+ string requester_account_id = 1;
118
+ SystemRole requester_system_role = 2;
119
+ string id = 3;
120
+ TaskStatusCode status_code = 4;
121
+ }
package/proto/user.proto CHANGED
@@ -6,6 +6,7 @@ import "google/protobuf/timestamp.proto";
6
6
 
7
7
  service UserService {
8
8
  rpc ListUsers(ListUsersRequest) returns (ListUsersResponse);
9
+ rpc GetUsersByAccountIds(GetUsersByAccountIdsRequest) returns (GetUsersByAccountIdsResponse);
9
10
  }
10
11
 
11
12
  enum SortOrder {
@@ -25,13 +26,29 @@ message ListUsersRequest {
25
26
  }
26
27
 
27
28
  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;
29
+ string id = 1;
30
+ string first_name = 2;
31
+ string last_name = 3;
32
+ string email = 4;
33
+ SystemRole system_role = 5;
34
+ google.protobuf.Timestamp created_at = 6;
35
+ string account_id = 7;
33
36
  }
34
37
 
35
38
  message ListUsersResponse {
36
39
  repeated User users = 1;
37
40
  }
41
+
42
+ message GetUsersByAccountIdsRequest {
43
+ repeated string account_ids = 1;
44
+ }
45
+
46
+ message UserSummary {
47
+ string account_id = 1;
48
+ string first_name = 2;
49
+ string last_name = 3;
50
+ }
51
+
52
+ message GetUsersByAccountIdsResponse {
53
+ repeated UserSummary users = 1;
54
+ }