@candesk/contracts 6.17.0 → 6.19.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.
@@ -87,6 +87,53 @@ export interface SetIdentityVerifiedRequest {
87
87
  export interface SetIdentityVerifiedResponse {
88
88
  ok: boolean;
89
89
  }
90
+ export interface CreateStaffAccountRequest {
91
+ email: string;
92
+ role: Role;
93
+ }
94
+ export interface CreateStaffAccountResponse {
95
+ account: StaffAccount | undefined;
96
+ }
97
+ export interface GetStaffAccountRequest {
98
+ id: string;
99
+ }
100
+ export interface GetStaffAccountResponse {
101
+ account: StaffAccount | undefined;
102
+ }
103
+ export interface ListStaffAccountsRequest {
104
+ }
105
+ export interface ListStaffAccountsResponse {
106
+ accounts: StaffAccount[];
107
+ }
108
+ export interface DeleteStaffAccountRequest {
109
+ id: string;
110
+ }
111
+ export interface DeleteStaffAccountResponse {
112
+ ok: boolean;
113
+ }
114
+ export interface ChangeStaffRoleRequest {
115
+ id: string;
116
+ role: Role;
117
+ adminId: string;
118
+ }
119
+ export interface ChangeStaffRoleResponse {
120
+ account: StaffAccount | undefined;
121
+ }
122
+ export interface SetStaffActiveRequest {
123
+ id: string;
124
+ active: boolean;
125
+ adminId: string;
126
+ }
127
+ export interface SetStaffActiveResponse {
128
+ account: StaffAccount | undefined;
129
+ }
130
+ export interface StaffAccount {
131
+ id: string;
132
+ email: string;
133
+ role: Role;
134
+ createdAt: string;
135
+ isActive: boolean;
136
+ }
90
137
  export interface AccountService {
91
138
  getAccount(request: GetAccountRequest): Promise<GetAccountResponse>;
92
139
  initEmailChange(request: InitEmailChangeRequest): Promise<InitEmailChangeResponse>;
@@ -98,4 +145,10 @@ export interface AccountService {
98
145
  initAccountDeletion(request: InitAccountDeletionRequest): Promise<InitAccountDeletionResponse>;
99
146
  confirmAccountDeletion(request: ConfirmAccountDeletionRequest): Promise<ConfirmAccountDeletionResponse>;
100
147
  setIdentityVerified(request: SetIdentityVerifiedRequest): Promise<SetIdentityVerifiedResponse>;
148
+ createStaffAccount(request: CreateStaffAccountRequest): Promise<CreateStaffAccountResponse>;
149
+ getStaffAccount(request: GetStaffAccountRequest): Promise<GetStaffAccountResponse>;
150
+ listStaffAccounts(request: ListStaffAccountsRequest): Promise<ListStaffAccountsResponse>;
151
+ deleteStaffAccount(request: DeleteStaffAccountRequest): Promise<DeleteStaffAccountResponse>;
152
+ changeStaffRole(request: ChangeStaffRoleRequest): Promise<ChangeStaffRoleResponse>;
153
+ setStaffActive(request: SetStaffActiveRequest): Promise<SetStaffActiveResponse>;
101
154
  }
@@ -0,0 +1,27 @@
1
+ export declare const protobufPackage = "staff.v1";
2
+ export declare const protobufFileName = "staff.proto";
3
+ export interface ListStaffRequest {
4
+ ids: string[];
5
+ }
6
+ export interface ListStaffResponse {
7
+ staff: Staff[];
8
+ }
9
+ export interface SaveStaffRequest {
10
+ id: string;
11
+ title?: string | undefined;
12
+ firstName: string;
13
+ lastName: string;
14
+ }
15
+ export interface SaveStaffResponse {
16
+ staff: Staff | undefined;
17
+ }
18
+ export interface Staff {
19
+ id: string;
20
+ title?: string | undefined;
21
+ firstName: string;
22
+ lastName: string;
23
+ }
24
+ export interface StaffService {
25
+ listStaff(request: ListStaffRequest): Promise<ListStaffResponse>;
26
+ saveStaff(request: SaveStaffRequest): Promise<SaveStaffResponse>;
27
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.18.0
5
+ // protoc v3.21.12
6
+ // source: staff.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.protobufFileName = exports.protobufPackage = void 0;
9
+ /* eslint-disable */
10
+ exports.protobufPackage = "staff.v1";
11
+ exports.protobufFileName = "staff.proto";
@@ -88,6 +88,53 @@ export interface SetIdentityVerifiedRequest {
88
88
  export interface SetIdentityVerifiedResponse {
89
89
  ok: boolean;
90
90
  }
91
+ export interface CreateStaffAccountRequest {
92
+ email: string;
93
+ role: Role;
94
+ }
95
+ export interface CreateStaffAccountResponse {
96
+ account: StaffAccount | undefined;
97
+ }
98
+ export interface GetStaffAccountRequest {
99
+ id: string;
100
+ }
101
+ export interface GetStaffAccountResponse {
102
+ account: StaffAccount | undefined;
103
+ }
104
+ export interface ListStaffAccountsRequest {
105
+ }
106
+ export interface ListStaffAccountsResponse {
107
+ accounts: StaffAccount[];
108
+ }
109
+ export interface DeleteStaffAccountRequest {
110
+ id: string;
111
+ }
112
+ export interface DeleteStaffAccountResponse {
113
+ ok: boolean;
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
+ }
131
+ export interface StaffAccount {
132
+ id: string;
133
+ email: string;
134
+ role: Role;
135
+ createdAt: string;
136
+ isActive: boolean;
137
+ }
91
138
  export declare const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
92
139
  export interface AccountServiceClient {
93
140
  getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
@@ -100,6 +147,12 @@ export interface AccountServiceClient {
100
147
  initAccountDeletion(request: InitAccountDeletionRequest): Observable<InitAccountDeletionResponse>;
101
148
  confirmAccountDeletion(request: ConfirmAccountDeletionRequest): Observable<ConfirmAccountDeletionResponse>;
102
149
  setIdentityVerified(request: SetIdentityVerifiedRequest): Observable<SetIdentityVerifiedResponse>;
150
+ createStaffAccount(request: CreateStaffAccountRequest): Observable<CreateStaffAccountResponse>;
151
+ getStaffAccount(request: GetStaffAccountRequest): Observable<GetStaffAccountResponse>;
152
+ listStaffAccounts(request: ListStaffAccountsRequest): Observable<ListStaffAccountsResponse>;
153
+ deleteStaffAccount(request: DeleteStaffAccountRequest): Observable<DeleteStaffAccountResponse>;
154
+ changeStaffRole(request: ChangeStaffRoleRequest): Observable<ChangeStaffRoleResponse>;
155
+ setStaffActive(request: SetStaffActiveRequest): Observable<SetStaffActiveResponse>;
103
156
  }
104
157
  export interface AccountServiceController {
105
158
  getAccount(request: GetAccountRequest): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
@@ -112,6 +165,12 @@ export interface AccountServiceController {
112
165
  initAccountDeletion(request: InitAccountDeletionRequest): Promise<InitAccountDeletionResponse> | Observable<InitAccountDeletionResponse> | InitAccountDeletionResponse;
113
166
  confirmAccountDeletion(request: ConfirmAccountDeletionRequest): Promise<ConfirmAccountDeletionResponse> | Observable<ConfirmAccountDeletionResponse> | ConfirmAccountDeletionResponse;
114
167
  setIdentityVerified(request: SetIdentityVerifiedRequest): Promise<SetIdentityVerifiedResponse> | Observable<SetIdentityVerifiedResponse> | SetIdentityVerifiedResponse;
168
+ createStaffAccount(request: CreateStaffAccountRequest): Promise<CreateStaffAccountResponse> | Observable<CreateStaffAccountResponse> | CreateStaffAccountResponse;
169
+ getStaffAccount(request: GetStaffAccountRequest): Promise<GetStaffAccountResponse> | Observable<GetStaffAccountResponse> | GetStaffAccountResponse;
170
+ listStaffAccounts(request: ListStaffAccountsRequest): Promise<ListStaffAccountsResponse> | Observable<ListStaffAccountsResponse> | ListStaffAccountsResponse;
171
+ deleteStaffAccount(request: DeleteStaffAccountRequest): Promise<DeleteStaffAccountResponse> | Observable<DeleteStaffAccountResponse> | DeleteStaffAccountResponse;
172
+ changeStaffRole(request: ChangeStaffRoleRequest): Promise<ChangeStaffRoleResponse> | Observable<ChangeStaffRoleResponse> | ChangeStaffRoleResponse;
173
+ setStaffActive(request: SetStaffActiveRequest): Promise<SetStaffActiveResponse> | Observable<SetStaffActiveResponse> | SetStaffActiveResponse;
115
174
  }
116
175
  export declare function AccountServiceControllerMethods(): (constructor: Function) => void;
117
176
  export declare const ACCOUNT_SERVICE_NAME = "AccountService";
@@ -33,6 +33,12 @@ function AccountServiceControllerMethods() {
33
33
  "initAccountDeletion",
34
34
  "confirmAccountDeletion",
35
35
  "setIdentityVerified",
36
+ "createStaffAccount",
37
+ "getStaffAccount",
38
+ "listStaffAccounts",
39
+ "deleteStaffAccount",
40
+ "changeStaffRole",
41
+ "setStaffActive",
36
42
  ];
37
43
  for (const method of grpcMethods) {
38
44
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
@@ -0,0 +1,35 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const protobufPackage = "staff.v1";
3
+ export declare const protobufFileName = "staff.proto";
4
+ export interface ListStaffRequest {
5
+ ids: string[];
6
+ }
7
+ export interface ListStaffResponse {
8
+ staff: Staff[];
9
+ }
10
+ export interface SaveStaffRequest {
11
+ id: string;
12
+ title?: string | undefined;
13
+ firstName: string;
14
+ lastName: string;
15
+ }
16
+ export interface SaveStaffResponse {
17
+ staff: Staff | undefined;
18
+ }
19
+ export interface Staff {
20
+ id: string;
21
+ title?: string | undefined;
22
+ firstName: string;
23
+ lastName: string;
24
+ }
25
+ export declare const STAFF_V1_PACKAGE_NAME = "staff.v1";
26
+ export interface StaffServiceClient {
27
+ listStaff(request: ListStaffRequest): Observable<ListStaffResponse>;
28
+ saveStaff(request: SaveStaffRequest): Observable<SaveStaffResponse>;
29
+ }
30
+ export interface StaffServiceController {
31
+ listStaff(request: ListStaffRequest): Promise<ListStaffResponse> | Observable<ListStaffResponse> | ListStaffResponse;
32
+ saveStaff(request: SaveStaffRequest): Promise<SaveStaffResponse> | Observable<SaveStaffResponse> | SaveStaffResponse;
33
+ }
34
+ export declare function StaffServiceControllerMethods(): (constructor: Function) => void;
35
+ export declare const STAFF_SERVICE_NAME = "StaffService";
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.18.0
5
+ // protoc v3.21.12
6
+ // source: staff.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.STAFF_SERVICE_NAME = exports.STAFF_V1_PACKAGE_NAME = exports.protobufFileName = exports.protobufPackage = void 0;
9
+ exports.StaffServiceControllerMethods = StaffServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "staff.v1";
13
+ exports.protobufFileName = "staff.proto";
14
+ exports.STAFF_V1_PACKAGE_NAME = "staff.v1";
15
+ function StaffServiceControllerMethods() {
16
+ return function (constructor) {
17
+ const grpcMethods = ["listStaff", "saveStaff"];
18
+ for (const method of grpcMethods) {
19
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
20
+ (0, microservices_1.GrpcMethod)("StaffService", method)(constructor.prototype[method], method, descriptor);
21
+ Object.defineProperty(constructor.prototype, method, descriptor);
22
+ }
23
+ const grpcStreamMethods = [];
24
+ for (const method of grpcStreamMethods) {
25
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
26
+ (0, microservices_1.GrpcStreamMethod)("StaffService", method)(constructor.prototype[method], method, descriptor);
27
+ Object.defineProperty(constructor.prototype, method, descriptor);
28
+ }
29
+ };
30
+ }
31
+ exports.STAFF_SERVICE_NAME = "StaffService";
@@ -2,6 +2,7 @@ export declare const PROTO_PATHS: {
2
2
  readonly AUTH: string;
3
3
  readonly ACCOUNT: string;
4
4
  readonly USER: string;
5
+ readonly STAFF: string;
5
6
  readonly MEDIA: string;
6
7
  readonly KYC: string;
7
8
  readonly TREATMENT: string;
@@ -6,6 +6,7 @@ exports.PROTO_PATHS = {
6
6
  AUTH: (0, path_1.join)(__dirname, '../../proto/auth.proto'),
7
7
  ACCOUNT: (0, path_1.join)(__dirname, '../../proto/account.proto'),
8
8
  USER: (0, path_1.join)(__dirname, '../../proto/user.proto'),
9
+ STAFF: (0, path_1.join)(__dirname, '../../proto/staff.proto'),
9
10
  MEDIA: (0, path_1.join)(__dirname, '../../proto/media.proto'),
10
11
  KYC: (0, path_1.join)(__dirname, '../../proto/kyc.proto'),
11
12
  TREATMENT: (0, path_1.join)(__dirname, '../../proto/treatment.proto'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candesk/contracts",
3
- "version": "6.17.0",
3
+ "version": "6.19.0",
4
4
  "description": "Protobuf contracts for CanDesk microservices",
5
5
  "author": {
6
6
  "name": "Alexander Schulz",
@@ -17,6 +17,13 @@ service AccountService {
17
17
  rpc ConfirmAccountDeletion(ConfirmAccountDeletionRequest) returns (ConfirmAccountDeletionResponse);
18
18
 
19
19
  rpc SetIdentityVerified(SetIdentityVerifiedRequest) returns (SetIdentityVerifiedResponse);
20
+
21
+ rpc CreateStaffAccount(CreateStaffAccountRequest) returns (CreateStaffAccountResponse);
22
+ rpc GetStaffAccount(GetStaffAccountRequest) returns (GetStaffAccountResponse);
23
+ rpc ListStaffAccounts(ListStaffAccountsRequest) returns (ListStaffAccountsResponse);
24
+ rpc DeleteStaffAccount(DeleteStaffAccountRequest) returns (DeleteStaffAccountResponse);
25
+ rpc ChangeStaffRole(ChangeStaffRoleRequest) returns (ChangeStaffRoleResponse);
26
+ rpc SetStaffActive(SetStaffActiveRequest) returns (SetStaffActiveResponse);
20
27
  }
21
28
 
22
29
  message GetAccountRequest {
@@ -113,6 +120,65 @@ message SetIdentityVerifiedResponse {
113
120
  bool ok = 1;
114
121
  }
115
122
 
123
+ message CreateStaffAccountRequest {
124
+ string email = 1;
125
+ Role role = 2;
126
+ }
127
+
128
+ message CreateStaffAccountResponse {
129
+ StaffAccount account = 1;
130
+ }
131
+
132
+ message GetStaffAccountRequest {
133
+ string id = 1;
134
+ }
135
+
136
+ message GetStaffAccountResponse {
137
+ StaffAccount account = 1;
138
+ }
139
+
140
+ message ListStaffAccountsRequest {}
141
+
142
+ message ListStaffAccountsResponse {
143
+ repeated StaffAccount accounts = 1;
144
+ }
145
+
146
+ message DeleteStaffAccountRequest {
147
+ string id = 1;
148
+ }
149
+
150
+ message DeleteStaffAccountResponse {
151
+ bool ok = 1;
152
+ }
153
+
154
+ message ChangeStaffRoleRequest {
155
+ string id = 1;
156
+ Role role = 2;
157
+ string admin_id = 3;
158
+ }
159
+
160
+ message ChangeStaffRoleResponse {
161
+ StaffAccount account = 1;
162
+ }
163
+
164
+ message SetStaffActiveRequest {
165
+ string id = 1;
166
+ bool active = 2;
167
+ string admin_id = 3;
168
+ }
169
+
170
+ message SetStaffActiveResponse {
171
+ StaffAccount account = 1;
172
+ }
173
+
174
+ message StaffAccount {
175
+ string id = 1;
176
+ string email = 2;
177
+ Role role = 3;
178
+ string created_at = 4;
179
+ bool is_active = 5;
180
+ }
181
+
116
182
  enum Role {
117
183
  PATIENT = 0;
118
184
  ADMIN = 1;
@@ -0,0 +1,34 @@
1
+ syntax = "proto3";
2
+
3
+ package staff.v1;
4
+
5
+ service StaffService {
6
+ rpc ListStaff (ListStaffRequest) returns (ListStaffResponse);
7
+ rpc SaveStaff (SaveStaffRequest) returns (SaveStaffResponse);
8
+ }
9
+
10
+ message ListStaffRequest {
11
+ repeated string ids = 1;
12
+ }
13
+
14
+ message ListStaffResponse {
15
+ repeated Staff staff = 1;
16
+ }
17
+
18
+ message SaveStaffRequest {
19
+ string id = 1;
20
+ optional string title = 2;
21
+ string first_name = 3;
22
+ string last_name = 4;
23
+ }
24
+
25
+ message SaveStaffResponse {
26
+ Staff staff = 1;
27
+ }
28
+
29
+ message Staff {
30
+ string id = 1;
31
+ optional string title = 2;
32
+ string first_name = 3;
33
+ string last_name = 4;
34
+ }