@candesk/contracts 6.35.0 → 6.37.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,7 @@ export declare const AUTH_EVENTS: {
2
2
  readonly OTP_REQUESTED: 'auth.otp.requested';
3
3
  readonly EMAIL_CHANGE_REQUESTED: 'auth.email-change.requested';
4
4
  readonly EMAIL_CHANGED: 'auth.email.changed';
5
+ readonly EMAIL_ASSIGNED: 'auth.email.assigned';
5
6
  readonly TELEGRAM_LINKED: 'auth.telegram.linked';
6
7
  readonly TELEGRAM_UNLINKED: 'auth.telegram.unlinked';
7
8
  readonly ACCOUNT_DELETION_REQUESTED: 'auth.account-deletion.requested';
@@ -5,6 +5,7 @@ exports.AUTH_EVENTS = {
5
5
  OTP_REQUESTED: 'auth.otp.requested',
6
6
  EMAIL_CHANGE_REQUESTED: 'auth.email-change.requested',
7
7
  EMAIL_CHANGED: 'auth.email.changed',
8
+ EMAIL_ASSIGNED: 'auth.email.assigned',
8
9
  TELEGRAM_LINKED: 'auth.telegram.linked',
9
10
  TELEGRAM_UNLINKED: 'auth.telegram.unlinked',
10
11
  ACCOUNT_DELETION_REQUESTED: 'auth.account-deletion.requested',
@@ -0,0 +1,3 @@
1
+ export interface EmailAssignedEvent {
2
+ email: string;
3
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,7 @@
1
1
  export * from './account-deleted.interface';
2
2
  export * from './account-deletion-requested.interface';
3
3
  export * from './auth.events';
4
+ export * from './email-assigned.interface';
4
5
  export * from './email-change-requested.interface';
5
6
  export * from './email-changed.interface';
6
7
  export * from './otp-requested.interface';
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./account-deleted.interface"), exports);
18
18
  __exportStar(require("./account-deletion-requested.interface"), exports);
19
19
  __exportStar(require("./auth.events"), exports);
20
+ __exportStar(require("./email-assigned.interface"), exports);
20
21
  __exportStar(require("./email-change-requested.interface"), exports);
21
22
  __exportStar(require("./email-changed.interface"), exports);
22
23
  __exportStar(require("./otp-requested.interface"), exports);
@@ -8,6 +8,11 @@ export declare enum Role {
8
8
  SUPER_ADMIN = 4,
9
9
  UNRECOGNIZED = -1
10
10
  }
11
+ export declare enum PatientStatus {
12
+ UNVERIFIED = 0,
13
+ VERIFIED = 1,
14
+ UNRECOGNIZED = -1
15
+ }
11
16
  export interface GetAccountRequest {
12
17
  id: string;
13
18
  }
@@ -177,6 +182,29 @@ export interface ResetStaffTotpRequest {
177
182
  export interface ResetStaffTotpResponse {
178
183
  account: StaffAccount | undefined;
179
184
  }
185
+ export interface ListPatientAccountsRequest {
186
+ id?: string | undefined;
187
+ status?: PatientStatus | undefined;
188
+ cursor?: string | undefined;
189
+ limit: number;
190
+ }
191
+ export interface ListPatientAccountsResponse {
192
+ accounts: PatientAccount[];
193
+ nextCursor?: string | undefined;
194
+ }
195
+ export interface GetPatientAccountRequest {
196
+ id: string;
197
+ }
198
+ export interface GetPatientAccountResponse {
199
+ account: PatientAccount | undefined;
200
+ }
201
+ export interface ChangePatientEmailRequest {
202
+ id: string;
203
+ email: string;
204
+ }
205
+ export interface ChangePatientEmailResponse {
206
+ account: PatientAccount | undefined;
207
+ }
180
208
  export interface StaffAccount {
181
209
  id: string;
182
210
  email: string;
@@ -186,6 +214,17 @@ export interface StaffAccount {
186
214
  lastActiveAt?: string | undefined;
187
215
  isTotpEnabled: boolean;
188
216
  }
217
+ export interface PatientAccount {
218
+ id: string;
219
+ email?: string | undefined;
220
+ phone?: string | undefined;
221
+ isTelegramLinked: boolean;
222
+ status: PatientStatus;
223
+ isTotpEnabled: boolean;
224
+ createdAt: string;
225
+ lastActiveAt?: string | undefined;
226
+ isEmailVerified: boolean;
227
+ }
189
228
  export interface AccountService {
190
229
  getAccount(request: GetAccountRequest): Promise<GetAccountResponse>;
191
230
  initEmailChange(request: InitEmailChangeRequest): Promise<InitEmailChangeResponse>;
@@ -209,4 +248,7 @@ export interface AccountService {
209
248
  setStaffActive(request: SetStaffActiveRequest): Promise<SetStaffActiveResponse>;
210
249
  changeStaffEmail(request: ChangeStaffEmailRequest): Promise<ChangeStaffEmailResponse>;
211
250
  resetStaffTotp(request: ResetStaffTotpRequest): Promise<ResetStaffTotpResponse>;
251
+ listPatientAccounts(request: ListPatientAccountsRequest): Promise<ListPatientAccountsResponse>;
252
+ getPatientAccount(request: GetPatientAccountRequest): Promise<GetPatientAccountResponse>;
253
+ changePatientEmail(request: ChangePatientEmailRequest): Promise<ChangePatientEmailResponse>;
212
254
  }
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.18.0
4
+ // protoc-gen-ts_proto v2.18.1
5
5
  // protoc v3.21.12
6
6
  // source: account.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.Role = exports.protobufFileName = exports.protobufPackage = void 0;
8
+ exports.PatientStatus = exports.Role = exports.protobufFileName = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
10
10
  exports.protobufPackage = "account.v1";
11
11
  exports.protobufFileName = "account.proto";
@@ -18,3 +18,9 @@ var Role;
18
18
  Role[Role["SUPER_ADMIN"] = 4] = "SUPER_ADMIN";
19
19
  Role[Role["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
20
20
  })(Role || (exports.Role = Role = {}));
21
+ var PatientStatus;
22
+ (function (PatientStatus) {
23
+ PatientStatus[PatientStatus["UNVERIFIED"] = 0] = "UNVERIFIED";
24
+ PatientStatus[PatientStatus["VERIFIED"] = 1] = "VERIFIED";
25
+ PatientStatus[PatientStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
26
+ })(PatientStatus || (exports.PatientStatus = PatientStatus = {}));
package/dist/gen/audit.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.18.0
4
+ // protoc-gen-ts_proto v2.18.1
5
5
  // protoc v3.21.12
6
6
  // source: audit.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
package/dist/gen/auth.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.18.0
4
+ // protoc-gen-ts_proto v2.18.1
5
5
  // protoc v3.21.12
6
6
  // source: auth.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.18.0
4
+ // protoc-gen-ts_proto v2.18.1
5
5
  // protoc v3.21.12
6
6
  // source: google/protobuf/empty.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
package/dist/gen/kyc.d.ts CHANGED
@@ -11,6 +11,7 @@ export declare enum VerificationStatus {
11
11
  VERIFICATION_STATUS_VERIFIED = 7,
12
12
  VERIFICATION_STATUS_MISMATCH = 8,
13
13
  VERIFICATION_STATUS_DUPLICATE = 9,
14
+ VERIFICATION_STATUS_EXPIRED = 10,
14
15
  UNRECOGNIZED = -1
15
16
  }
16
17
  export interface CreateSessionRequest {
@@ -28,6 +29,17 @@ export interface GetVerificationRequest {
28
29
  export interface GetVerificationResponse {
29
30
  status: VerificationStatus;
30
31
  }
32
+ export interface ListVerificationsRequest {
33
+ userId: string;
34
+ }
35
+ export interface ListVerificationsResponse {
36
+ verifications: Verification[];
37
+ }
38
+ export interface Verification {
39
+ status: VerificationStatus;
40
+ createdAt: string;
41
+ checkedAt?: string | undefined;
42
+ }
31
43
  export interface HandleWebhookRequest {
32
44
  payload: string;
33
45
  signature: string;
@@ -38,5 +50,6 @@ export interface HandleWebhookResponse {
38
50
  export interface KycService {
39
51
  createSession(request: CreateSessionRequest): Promise<CreateSessionResponse>;
40
52
  getVerification(request: GetVerificationRequest): Promise<GetVerificationResponse>;
53
+ listVerifications(request: ListVerificationsRequest): Promise<ListVerificationsResponse>;
41
54
  handleWebhook(request: HandleWebhookRequest): Promise<HandleWebhookResponse>;
42
55
  }
package/dist/gen/kyc.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.18.0
4
+ // protoc-gen-ts_proto v2.18.1
5
5
  // protoc v3.21.12
6
6
  // source: kyc.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -21,5 +21,6 @@ var VerificationStatus;
21
21
  VerificationStatus[VerificationStatus["VERIFICATION_STATUS_VERIFIED"] = 7] = "VERIFICATION_STATUS_VERIFIED";
22
22
  VerificationStatus[VerificationStatus["VERIFICATION_STATUS_MISMATCH"] = 8] = "VERIFICATION_STATUS_MISMATCH";
23
23
  VerificationStatus[VerificationStatus["VERIFICATION_STATUS_DUPLICATE"] = 9] = "VERIFICATION_STATUS_DUPLICATE";
24
+ VerificationStatus[VerificationStatus["VERIFICATION_STATUS_EXPIRED"] = 10] = "VERIFICATION_STATUS_EXPIRED";
24
25
  VerificationStatus[VerificationStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
25
26
  })(VerificationStatus || (exports.VerificationStatus = VerificationStatus = {}));
package/dist/gen/media.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.18.0
4
+ // protoc-gen-ts_proto v2.18.1
5
5
  // protoc v3.21.12
6
6
  // source: media.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.18.0
4
+ // protoc-gen-ts_proto v2.18.1
5
5
  // protoc v3.21.12
6
6
  // source: payment.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
package/dist/gen/staff.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.18.0
4
+ // protoc-gen-ts_proto v2.18.1
5
5
  // protoc v3.21.12
6
6
  // source: staff.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.18.0
4
+ // protoc-gen-ts_proto v2.18.1
5
5
  // protoc v3.21.12
6
6
  // source: treatment.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -6,6 +6,12 @@ export interface GetUserRequest {
6
6
  export interface GetUserResponse {
7
7
  user: User | undefined;
8
8
  }
9
+ export interface ListUsersRequest {
10
+ ids: string[];
11
+ }
12
+ export interface ListUsersResponse {
13
+ users: User[];
14
+ }
9
15
  export interface CreateUserRequest {
10
16
  id: string;
11
17
  firstName: string;
@@ -61,6 +67,7 @@ export interface Address {
61
67
  }
62
68
  export interface UserService {
63
69
  getUser(request: GetUserRequest): Promise<GetUserResponse>;
70
+ listUsers(request: ListUsersRequest): Promise<ListUsersResponse>;
64
71
  createUser(request: CreateUserRequest): Promise<CreateUserResponse>;
65
72
  updateUser(request: UpdateUserRequest): Promise<UpdateUserResponse>;
66
73
  setAvatar(request: SetAvatarRequest): Promise<SetAvatarResponse>;
package/dist/gen/user.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.18.0
4
+ // protoc-gen-ts_proto v2.18.1
5
5
  // protoc v3.21.12
6
6
  // source: user.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -9,6 +9,11 @@ export declare enum Role {
9
9
  SUPER_ADMIN = 4,
10
10
  UNRECOGNIZED = -1
11
11
  }
12
+ export declare enum PatientStatus {
13
+ UNVERIFIED = 0,
14
+ VERIFIED = 1,
15
+ UNRECOGNIZED = -1
16
+ }
12
17
  export interface GetAccountRequest {
13
18
  id: string;
14
19
  }
@@ -178,6 +183,29 @@ export interface ResetStaffTotpRequest {
178
183
  export interface ResetStaffTotpResponse {
179
184
  account: StaffAccount | undefined;
180
185
  }
186
+ export interface ListPatientAccountsRequest {
187
+ id?: string | undefined;
188
+ status?: PatientStatus | undefined;
189
+ cursor?: string | undefined;
190
+ limit: number;
191
+ }
192
+ export interface ListPatientAccountsResponse {
193
+ accounts: PatientAccount[];
194
+ nextCursor?: string | undefined;
195
+ }
196
+ export interface GetPatientAccountRequest {
197
+ id: string;
198
+ }
199
+ export interface GetPatientAccountResponse {
200
+ account: PatientAccount | undefined;
201
+ }
202
+ export interface ChangePatientEmailRequest {
203
+ id: string;
204
+ email: string;
205
+ }
206
+ export interface ChangePatientEmailResponse {
207
+ account: PatientAccount | undefined;
208
+ }
181
209
  export interface StaffAccount {
182
210
  id: string;
183
211
  email: string;
@@ -187,6 +215,17 @@ export interface StaffAccount {
187
215
  lastActiveAt?: string | undefined;
188
216
  isTotpEnabled: boolean;
189
217
  }
218
+ export interface PatientAccount {
219
+ id: string;
220
+ email?: string | undefined;
221
+ phone?: string | undefined;
222
+ isTelegramLinked: boolean;
223
+ status: PatientStatus;
224
+ isTotpEnabled: boolean;
225
+ createdAt: string;
226
+ lastActiveAt?: string | undefined;
227
+ isEmailVerified: boolean;
228
+ }
190
229
  export declare const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
191
230
  export interface AccountServiceClient {
192
231
  getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
@@ -211,6 +250,9 @@ export interface AccountServiceClient {
211
250
  setStaffActive(request: SetStaffActiveRequest): Observable<SetStaffActiveResponse>;
212
251
  changeStaffEmail(request: ChangeStaffEmailRequest): Observable<ChangeStaffEmailResponse>;
213
252
  resetStaffTotp(request: ResetStaffTotpRequest): Observable<ResetStaffTotpResponse>;
253
+ listPatientAccounts(request: ListPatientAccountsRequest): Observable<ListPatientAccountsResponse>;
254
+ getPatientAccount(request: GetPatientAccountRequest): Observable<GetPatientAccountResponse>;
255
+ changePatientEmail(request: ChangePatientEmailRequest): Observable<ChangePatientEmailResponse>;
214
256
  }
215
257
  export interface AccountServiceController {
216
258
  getAccount(request: GetAccountRequest): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
@@ -235,6 +277,9 @@ export interface AccountServiceController {
235
277
  setStaffActive(request: SetStaffActiveRequest): Promise<SetStaffActiveResponse> | Observable<SetStaffActiveResponse> | SetStaffActiveResponse;
236
278
  changeStaffEmail(request: ChangeStaffEmailRequest): Promise<ChangeStaffEmailResponse> | Observable<ChangeStaffEmailResponse> | ChangeStaffEmailResponse;
237
279
  resetStaffTotp(request: ResetStaffTotpRequest): Promise<ResetStaffTotpResponse> | Observable<ResetStaffTotpResponse> | ResetStaffTotpResponse;
280
+ listPatientAccounts(request: ListPatientAccountsRequest): Promise<ListPatientAccountsResponse> | Observable<ListPatientAccountsResponse> | ListPatientAccountsResponse;
281
+ getPatientAccount(request: GetPatientAccountRequest): Promise<GetPatientAccountResponse> | Observable<GetPatientAccountResponse> | GetPatientAccountResponse;
282
+ changePatientEmail(request: ChangePatientEmailRequest): Promise<ChangePatientEmailResponse> | Observable<ChangePatientEmailResponse> | ChangePatientEmailResponse;
238
283
  }
239
284
  export declare function AccountServiceControllerMethods(): (constructor: Function) => void;
240
285
  export declare const ACCOUNT_SERVICE_NAME = "AccountService";
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.18.0
4
+ // protoc-gen-ts_proto v2.18.1
5
5
  // protoc v3.21.12
6
6
  // source: account.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.ACCOUNT_SERVICE_NAME = exports.ACCOUNT_V1_PACKAGE_NAME = exports.Role = exports.protobufFileName = exports.protobufPackage = void 0;
8
+ exports.ACCOUNT_SERVICE_NAME = exports.ACCOUNT_V1_PACKAGE_NAME = exports.PatientStatus = exports.Role = exports.protobufFileName = exports.protobufPackage = void 0;
9
9
  exports.AccountServiceControllerMethods = AccountServiceControllerMethods;
10
10
  /* eslint-disable */
11
11
  const microservices_1 = require("@nestjs/microservices");
@@ -20,6 +20,12 @@ var Role;
20
20
  Role[Role["SUPER_ADMIN"] = 4] = "SUPER_ADMIN";
21
21
  Role[Role["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
22
22
  })(Role || (exports.Role = Role = {}));
23
+ var PatientStatus;
24
+ (function (PatientStatus) {
25
+ PatientStatus[PatientStatus["UNVERIFIED"] = 0] = "UNVERIFIED";
26
+ PatientStatus[PatientStatus["VERIFIED"] = 1] = "VERIFIED";
27
+ PatientStatus[PatientStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
28
+ })(PatientStatus || (exports.PatientStatus = PatientStatus = {}));
23
29
  exports.ACCOUNT_V1_PACKAGE_NAME = "account.v1";
24
30
  function AccountServiceControllerMethods() {
25
31
  return function (constructor) {
@@ -46,6 +52,9 @@ function AccountServiceControllerMethods() {
46
52
  "setStaffActive",
47
53
  "changeStaffEmail",
48
54
  "resetStaffTotp",
55
+ "listPatientAccounts",
56
+ "getPatientAccount",
57
+ "changePatientEmail",
49
58
  ];
50
59
  for (const method of grpcMethods) {
51
60
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.18.0
4
+ // protoc-gen-ts_proto v2.18.1
5
5
  // protoc v3.21.12
6
6
  // source: audit.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
package/dist/nest/auth.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.18.0
4
+ // protoc-gen-ts_proto v2.18.1
5
5
  // protoc v3.21.12
6
6
  // source: auth.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.18.0
4
+ // protoc-gen-ts_proto v2.18.1
5
5
  // protoc v3.21.12
6
6
  // source: google/protobuf/empty.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -12,6 +12,7 @@ export declare enum VerificationStatus {
12
12
  VERIFICATION_STATUS_VERIFIED = 7,
13
13
  VERIFICATION_STATUS_MISMATCH = 8,
14
14
  VERIFICATION_STATUS_DUPLICATE = 9,
15
+ VERIFICATION_STATUS_EXPIRED = 10,
15
16
  UNRECOGNIZED = -1
16
17
  }
17
18
  export interface CreateSessionRequest {
@@ -29,6 +30,17 @@ export interface GetVerificationRequest {
29
30
  export interface GetVerificationResponse {
30
31
  status: VerificationStatus;
31
32
  }
33
+ export interface ListVerificationsRequest {
34
+ userId: string;
35
+ }
36
+ export interface ListVerificationsResponse {
37
+ verifications: Verification[];
38
+ }
39
+ export interface Verification {
40
+ status: VerificationStatus;
41
+ createdAt: string;
42
+ checkedAt?: string | undefined;
43
+ }
32
44
  export interface HandleWebhookRequest {
33
45
  payload: string;
34
46
  signature: string;
@@ -40,11 +52,13 @@ export declare const KYC_V1_PACKAGE_NAME = "kyc.v1";
40
52
  export interface KycServiceClient {
41
53
  createSession(request: CreateSessionRequest): Observable<CreateSessionResponse>;
42
54
  getVerification(request: GetVerificationRequest): Observable<GetVerificationResponse>;
55
+ listVerifications(request: ListVerificationsRequest): Observable<ListVerificationsResponse>;
43
56
  handleWebhook(request: HandleWebhookRequest): Observable<HandleWebhookResponse>;
44
57
  }
45
58
  export interface KycServiceController {
46
59
  createSession(request: CreateSessionRequest): Promise<CreateSessionResponse> | Observable<CreateSessionResponse> | CreateSessionResponse;
47
60
  getVerification(request: GetVerificationRequest): Promise<GetVerificationResponse> | Observable<GetVerificationResponse> | GetVerificationResponse;
61
+ listVerifications(request: ListVerificationsRequest): Promise<ListVerificationsResponse> | Observable<ListVerificationsResponse> | ListVerificationsResponse;
48
62
  handleWebhook(request: HandleWebhookRequest): Promise<HandleWebhookResponse> | Observable<HandleWebhookResponse> | HandleWebhookResponse;
49
63
  }
50
64
  export declare function KycServiceControllerMethods(): (constructor: Function) => void;
package/dist/nest/kyc.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.18.0
4
+ // protoc-gen-ts_proto v2.18.1
5
5
  // protoc v3.21.12
6
6
  // source: kyc.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -23,12 +23,13 @@ var VerificationStatus;
23
23
  VerificationStatus[VerificationStatus["VERIFICATION_STATUS_VERIFIED"] = 7] = "VERIFICATION_STATUS_VERIFIED";
24
24
  VerificationStatus[VerificationStatus["VERIFICATION_STATUS_MISMATCH"] = 8] = "VERIFICATION_STATUS_MISMATCH";
25
25
  VerificationStatus[VerificationStatus["VERIFICATION_STATUS_DUPLICATE"] = 9] = "VERIFICATION_STATUS_DUPLICATE";
26
+ VerificationStatus[VerificationStatus["VERIFICATION_STATUS_EXPIRED"] = 10] = "VERIFICATION_STATUS_EXPIRED";
26
27
  VerificationStatus[VerificationStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
27
28
  })(VerificationStatus || (exports.VerificationStatus = VerificationStatus = {}));
28
29
  exports.KYC_V1_PACKAGE_NAME = "kyc.v1";
29
30
  function KycServiceControllerMethods() {
30
31
  return function (constructor) {
31
- const grpcMethods = ["createSession", "getVerification", "handleWebhook"];
32
+ const grpcMethods = ["createSession", "getVerification", "listVerifications", "handleWebhook"];
32
33
  for (const method of grpcMethods) {
33
34
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
34
35
  (0, microservices_1.GrpcMethod)("KycService", method)(constructor.prototype[method], method, descriptor);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.18.0
4
+ // protoc-gen-ts_proto v2.18.1
5
5
  // protoc v3.21.12
6
6
  // source: media.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.18.0
4
+ // protoc-gen-ts_proto v2.18.1
5
5
  // protoc v3.21.12
6
6
  // source: payment.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.18.0
4
+ // protoc-gen-ts_proto v2.18.1
5
5
  // protoc v3.21.12
6
6
  // source: staff.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.18.0
4
+ // protoc-gen-ts_proto v2.18.1
5
5
  // protoc v3.21.12
6
6
  // source: treatment.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -7,6 +7,12 @@ export interface GetUserRequest {
7
7
  export interface GetUserResponse {
8
8
  user: User | undefined;
9
9
  }
10
+ export interface ListUsersRequest {
11
+ ids: string[];
12
+ }
13
+ export interface ListUsersResponse {
14
+ users: User[];
15
+ }
10
16
  export interface CreateUserRequest {
11
17
  id: string;
12
18
  firstName: string;
@@ -63,6 +69,7 @@ export interface Address {
63
69
  export declare const USER_V1_PACKAGE_NAME = "user.v1";
64
70
  export interface UserServiceClient {
65
71
  getUser(request: GetUserRequest): Observable<GetUserResponse>;
72
+ listUsers(request: ListUsersRequest): Observable<ListUsersResponse>;
66
73
  createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
67
74
  updateUser(request: UpdateUserRequest): Observable<UpdateUserResponse>;
68
75
  setAvatar(request: SetAvatarRequest): Observable<SetAvatarResponse>;
@@ -70,6 +77,7 @@ export interface UserServiceClient {
70
77
  }
71
78
  export interface UserServiceController {
72
79
  getUser(request: GetUserRequest): Promise<GetUserResponse> | Observable<GetUserResponse> | GetUserResponse;
80
+ listUsers(request: ListUsersRequest): Promise<ListUsersResponse> | Observable<ListUsersResponse> | ListUsersResponse;
73
81
  createUser(request: CreateUserRequest): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
74
82
  updateUser(request: UpdateUserRequest): Promise<UpdateUserResponse> | Observable<UpdateUserResponse> | UpdateUserResponse;
75
83
  setAvatar(request: SetAvatarRequest): Promise<SetAvatarResponse> | Observable<SetAvatarResponse> | SetAvatarResponse;
package/dist/nest/user.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
3
  // versions:
4
- // protoc-gen-ts_proto v2.18.0
4
+ // protoc-gen-ts_proto v2.18.1
5
5
  // protoc v3.21.12
6
6
  // source: user.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -14,7 +14,7 @@ exports.protobufFileName = "user.proto";
14
14
  exports.USER_V1_PACKAGE_NAME = "user.v1";
15
15
  function UserServiceControllerMethods() {
16
16
  return function (constructor) {
17
- const grpcMethods = ["getUser", "createUser", "updateUser", "setAvatar", "setVerifiedName"];
17
+ const grpcMethods = ["getUser", "listUsers", "createUser", "updateUser", "setAvatar", "setVerifiedName"];
18
18
  for (const method of grpcMethods) {
19
19
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
20
20
  (0, microservices_1.GrpcMethod)("UserService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@candesk/contracts",
3
- "version": "6.35.0",
3
+ "version": "6.37.0",
4
4
  "description": "Protobuf contracts for CanDesk microservices",
5
5
  "author": {
6
6
  "name": "Alexander Schulz",
@@ -31,6 +31,10 @@ service AccountService {
31
31
  rpc SetStaffActive(SetStaffActiveRequest) returns (SetStaffActiveResponse);
32
32
  rpc ChangeStaffEmail(ChangeStaffEmailRequest) returns (ChangeStaffEmailResponse);
33
33
  rpc ResetStaffTotp(ResetStaffTotpRequest) returns (ResetStaffTotpResponse);
34
+
35
+ rpc ListPatientAccounts(ListPatientAccountsRequest) returns (ListPatientAccountsResponse);
36
+ rpc GetPatientAccount(GetPatientAccountRequest) returns (GetPatientAccountResponse);
37
+ rpc ChangePatientEmail(ChangePatientEmailRequest) returns (ChangePatientEmailResponse);
34
38
  }
35
39
 
36
40
  message GetAccountRequest {
@@ -239,6 +243,35 @@ message ResetStaffTotpResponse {
239
243
  StaffAccount account = 1;
240
244
  }
241
245
 
246
+ message ListPatientAccountsRequest {
247
+ optional string id = 1;
248
+ optional PatientStatus status = 2;
249
+ optional string cursor = 3;
250
+ int32 limit = 4;
251
+ }
252
+
253
+ message ListPatientAccountsResponse {
254
+ repeated PatientAccount accounts = 1;
255
+ optional string next_cursor = 2;
256
+ }
257
+
258
+ message GetPatientAccountRequest {
259
+ string id = 1;
260
+ }
261
+
262
+ message GetPatientAccountResponse {
263
+ PatientAccount account = 1;
264
+ }
265
+
266
+ message ChangePatientEmailRequest {
267
+ string id = 1;
268
+ string email = 2;
269
+ }
270
+
271
+ message ChangePatientEmailResponse {
272
+ PatientAccount account = 1;
273
+ }
274
+
242
275
  message StaffAccount {
243
276
  string id = 1;
244
277
  string email = 2;
@@ -250,10 +283,27 @@ message StaffAccount {
250
283
  bool is_totp_enabled = 8;
251
284
  }
252
285
 
286
+ message PatientAccount {
287
+ string id = 1;
288
+ optional string email = 2;
289
+ optional string phone = 3;
290
+ bool is_telegram_linked = 4;
291
+ PatientStatus status = 5;
292
+ bool is_totp_enabled = 6;
293
+ string created_at = 7;
294
+ optional string last_active_at = 8;
295
+ bool is_email_verified = 9;
296
+ }
297
+
253
298
  enum Role {
254
299
  PATIENT = 0;
255
300
  ADMIN = 1;
256
301
  DOCTOR = 2;
257
302
  SUPPORT = 3;
258
303
  SUPER_ADMIN = 4;
304
+ }
305
+
306
+ enum PatientStatus {
307
+ UNVERIFIED = 0;
308
+ VERIFIED = 1;
259
309
  }
package/proto/kyc.proto CHANGED
@@ -5,6 +5,7 @@ package kyc.v1;
5
5
  service KycService {
6
6
  rpc CreateSession (CreateSessionRequest) returns (CreateSessionResponse);
7
7
  rpc GetVerification (GetVerificationRequest) returns (GetVerificationResponse);
8
+ rpc ListVerifications (ListVerificationsRequest) returns (ListVerificationsResponse);
8
9
  rpc HandleWebhook (HandleWebhookRequest) returns (HandleWebhookResponse);
9
10
  }
10
11
 
@@ -19,6 +20,7 @@ enum VerificationStatus {
19
20
  VERIFICATION_STATUS_VERIFIED = 7;
20
21
  VERIFICATION_STATUS_MISMATCH = 8;
21
22
  VERIFICATION_STATUS_DUPLICATE = 9;
23
+ VERIFICATION_STATUS_EXPIRED = 10;
22
24
  }
23
25
 
24
26
  message CreateSessionRequest {
@@ -40,6 +42,20 @@ message GetVerificationResponse {
40
42
  VerificationStatus status = 1;
41
43
  }
42
44
 
45
+ message ListVerificationsRequest {
46
+ string user_id = 1;
47
+ }
48
+
49
+ message ListVerificationsResponse {
50
+ repeated Verification verifications = 1;
51
+ }
52
+
53
+ message Verification {
54
+ VerificationStatus status = 1;
55
+ string created_at = 2;
56
+ optional string checked_at = 3;
57
+ }
58
+
43
59
  message HandleWebhookRequest {
44
60
  string payload = 1;
45
61
  string signature = 2;
package/proto/user.proto CHANGED
@@ -4,6 +4,7 @@ package user.v1;
4
4
 
5
5
  service UserService {
6
6
  rpc GetUser (GetUserRequest) returns (GetUserResponse);
7
+ rpc ListUsers (ListUsersRequest) returns (ListUsersResponse);
7
8
  rpc CreateUser (CreateUserRequest) returns (CreateUserResponse);
8
9
  rpc UpdateUser (UpdateUserRequest) returns (UpdateUserResponse);
9
10
  rpc SetAvatar (SetAvatarRequest) returns (SetAvatarResponse);
@@ -18,6 +19,14 @@ message GetUserResponse {
18
19
  User user = 1;
19
20
  }
20
21
 
22
+ message ListUsersRequest {
23
+ repeated string ids = 1;
24
+ }
25
+
26
+ message ListUsersResponse {
27
+ repeated User users = 1;
28
+ }
29
+
21
30
  message CreateUserRequest {
22
31
  string id = 1;
23
32
  string first_name = 2;