@candesk/contracts 6.18.0 → 6.20.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.
@@ -19,6 +19,7 @@ export interface GetAccountResponse {
19
19
  role: Role;
20
20
  isTelegramLinked: boolean;
21
21
  isIdentityVerified: boolean;
22
+ isOwner: boolean;
22
23
  }
23
24
  export interface InitEmailChangeRequest {
24
25
  email: string;
@@ -111,11 +112,29 @@ export interface DeleteStaffAccountRequest {
111
112
  export interface DeleteStaffAccountResponse {
112
113
  ok: boolean;
113
114
  }
115
+ export interface ChangeStaffRoleRequest {
116
+ id: string;
117
+ role: Role;
118
+ adminId: string;
119
+ }
120
+ export interface ChangeStaffRoleResponse {
121
+ account: StaffAccount | undefined;
122
+ }
123
+ export interface SetStaffActiveRequest {
124
+ id: string;
125
+ active: boolean;
126
+ adminId: string;
127
+ }
128
+ export interface SetStaffActiveResponse {
129
+ account: StaffAccount | undefined;
130
+ }
114
131
  export interface StaffAccount {
115
132
  id: string;
116
133
  email: string;
117
134
  role: Role;
118
135
  createdAt: string;
136
+ isActive: boolean;
137
+ isOwner: boolean;
119
138
  }
120
139
  export interface AccountService {
121
140
  getAccount(request: GetAccountRequest): Promise<GetAccountResponse>;
@@ -132,4 +151,6 @@ export interface AccountService {
132
151
  getStaffAccount(request: GetStaffAccountRequest): Promise<GetStaffAccountResponse>;
133
152
  listStaffAccounts(request: ListStaffAccountsRequest): Promise<ListStaffAccountsResponse>;
134
153
  deleteStaffAccount(request: DeleteStaffAccountRequest): Promise<DeleteStaffAccountResponse>;
154
+ changeStaffRole(request: ChangeStaffRoleRequest): Promise<ChangeStaffRoleResponse>;
155
+ setStaffActive(request: SetStaffActiveRequest): Promise<SetStaffActiveResponse>;
135
156
  }
@@ -20,6 +20,7 @@ export interface GetAccountResponse {
20
20
  role: Role;
21
21
  isTelegramLinked: boolean;
22
22
  isIdentityVerified: boolean;
23
+ isOwner: boolean;
23
24
  }
24
25
  export interface InitEmailChangeRequest {
25
26
  email: string;
@@ -112,11 +113,29 @@ export interface DeleteStaffAccountRequest {
112
113
  export interface DeleteStaffAccountResponse {
113
114
  ok: boolean;
114
115
  }
116
+ export interface ChangeStaffRoleRequest {
117
+ id: string;
118
+ role: Role;
119
+ adminId: string;
120
+ }
121
+ export interface ChangeStaffRoleResponse {
122
+ account: StaffAccount | undefined;
123
+ }
124
+ export interface SetStaffActiveRequest {
125
+ id: string;
126
+ active: boolean;
127
+ adminId: string;
128
+ }
129
+ export interface SetStaffActiveResponse {
130
+ account: StaffAccount | undefined;
131
+ }
115
132
  export interface StaffAccount {
116
133
  id: string;
117
134
  email: string;
118
135
  role: Role;
119
136
  createdAt: string;
137
+ isActive: boolean;
138
+ isOwner: boolean;
120
139
  }
121
140
  export declare const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
122
141
  export interface AccountServiceClient {
@@ -134,6 +153,8 @@ export interface AccountServiceClient {
134
153
  getStaffAccount(request: GetStaffAccountRequest): Observable<GetStaffAccountResponse>;
135
154
  listStaffAccounts(request: ListStaffAccountsRequest): Observable<ListStaffAccountsResponse>;
136
155
  deleteStaffAccount(request: DeleteStaffAccountRequest): Observable<DeleteStaffAccountResponse>;
156
+ changeStaffRole(request: ChangeStaffRoleRequest): Observable<ChangeStaffRoleResponse>;
157
+ setStaffActive(request: SetStaffActiveRequest): Observable<SetStaffActiveResponse>;
137
158
  }
138
159
  export interface AccountServiceController {
139
160
  getAccount(request: GetAccountRequest): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
@@ -150,6 +171,8 @@ export interface AccountServiceController {
150
171
  getStaffAccount(request: GetStaffAccountRequest): Promise<GetStaffAccountResponse> | Observable<GetStaffAccountResponse> | GetStaffAccountResponse;
151
172
  listStaffAccounts(request: ListStaffAccountsRequest): Promise<ListStaffAccountsResponse> | Observable<ListStaffAccountsResponse> | ListStaffAccountsResponse;
152
173
  deleteStaffAccount(request: DeleteStaffAccountRequest): Promise<DeleteStaffAccountResponse> | Observable<DeleteStaffAccountResponse> | DeleteStaffAccountResponse;
174
+ changeStaffRole(request: ChangeStaffRoleRequest): Promise<ChangeStaffRoleResponse> | Observable<ChangeStaffRoleResponse> | ChangeStaffRoleResponse;
175
+ setStaffActive(request: SetStaffActiveRequest): Promise<SetStaffActiveResponse> | Observable<SetStaffActiveResponse> | SetStaffActiveResponse;
153
176
  }
154
177
  export declare function AccountServiceControllerMethods(): (constructor: Function) => void;
155
178
  export declare const ACCOUNT_SERVICE_NAME = "AccountService";
@@ -37,6 +37,8 @@ function AccountServiceControllerMethods() {
37
37
  "getStaffAccount",
38
38
  "listStaffAccounts",
39
39
  "deleteStaffAccount",
40
+ "changeStaffRole",
41
+ "setStaffActive",
40
42
  ];
41
43
  for (const method of grpcMethods) {
42
44
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candesk/contracts",
3
- "version": "6.18.0",
3
+ "version": "6.20.0",
4
4
  "description": "Protobuf contracts for CanDesk microservices",
5
5
  "author": {
6
6
  "name": "Alexander Schulz",
@@ -22,6 +22,8 @@ service AccountService {
22
22
  rpc GetStaffAccount(GetStaffAccountRequest) returns (GetStaffAccountResponse);
23
23
  rpc ListStaffAccounts(ListStaffAccountsRequest) returns (ListStaffAccountsResponse);
24
24
  rpc DeleteStaffAccount(DeleteStaffAccountRequest) returns (DeleteStaffAccountResponse);
25
+ rpc ChangeStaffRole(ChangeStaffRoleRequest) returns (ChangeStaffRoleResponse);
26
+ rpc SetStaffActive(SetStaffActiveRequest) returns (SetStaffActiveResponse);
25
27
  }
26
28
 
27
29
  message GetAccountRequest {
@@ -37,6 +39,7 @@ message GetAccountResponse {
37
39
  Role role = 6;
38
40
  bool is_telegram_linked = 7;
39
41
  bool is_identity_verified = 8;
42
+ bool is_owner = 9;
40
43
  }
41
44
 
42
45
  message InitEmailChangeRequest {
@@ -149,11 +152,33 @@ message DeleteStaffAccountResponse {
149
152
  bool ok = 1;
150
153
  }
151
154
 
155
+ message ChangeStaffRoleRequest {
156
+ string id = 1;
157
+ Role role = 2;
158
+ string admin_id = 3;
159
+ }
160
+
161
+ message ChangeStaffRoleResponse {
162
+ StaffAccount account = 1;
163
+ }
164
+
165
+ message SetStaffActiveRequest {
166
+ string id = 1;
167
+ bool active = 2;
168
+ string admin_id = 3;
169
+ }
170
+
171
+ message SetStaffActiveResponse {
172
+ StaffAccount account = 1;
173
+ }
174
+
152
175
  message StaffAccount {
153
176
  string id = 1;
154
177
  string email = 2;
155
178
  Role role = 3;
156
179
  string created_at = 4;
180
+ bool is_active = 5;
181
+ bool is_owner = 6;
157
182
  }
158
183
 
159
184
  enum Role {