@candesk/contracts 6.1.0 → 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.
@@ -0,0 +1,4 @@
1
+ export interface AccountDeletedEvent {
2
+ accountId: string;
3
+ email: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export interface AccountDeletionRequestedEvent {
2
+ email: string;
3
+ code: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,4 +3,6 @@ export declare const AUTH_EVENTS: {
3
3
  readonly EMAIL_CHANGE_REQUESTED: 'auth.email-change.requested';
4
4
  readonly EMAIL_CHANGED: 'auth.email.changed';
5
5
  readonly TELEGRAM_LINKED: 'auth.telegram.linked';
6
+ readonly ACCOUNT_DELETION_REQUESTED: 'auth.account-deletion.requested';
7
+ readonly ACCOUNT_DELETED: 'auth.account.deleted';
6
8
  };
@@ -5,5 +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
- TELEGRAM_LINKED: 'auth.telegram.linked'
8
+ TELEGRAM_LINKED: 'auth.telegram.linked',
9
+ ACCOUNT_DELETION_REQUESTED: 'auth.account-deletion.requested',
10
+ ACCOUNT_DELETED: 'auth.account.deleted'
9
11
  };
@@ -1,3 +1,5 @@
1
+ export * from './account-deleted.interface';
2
+ export * from './account-deletion-requested.interface';
1
3
  export * from './auth.events';
2
4
  export * from './email-change-requested.interface';
3
5
  export * from './email-changed.interface';
@@ -14,6 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./account-deleted.interface"), exports);
18
+ __exportStar(require("./account-deletion-requested.interface"), exports);
17
19
  __exportStar(require("./auth.events"), exports);
18
20
  __exportStar(require("./email-change-requested.interface"), exports);
19
21
  __exportStar(require("./email-changed.interface"), exports);
@@ -1,3 +1,4 @@
1
1
  export declare const RMQ_QUEUES: {
2
2
  readonly NOTIFICATIONS: 'notifications_queue';
3
+ readonly USERS: 'users_queue';
3
4
  };
@@ -2,5 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RMQ_QUEUES = void 0;
4
4
  exports.RMQ_QUEUES = {
5
- NOTIFICATIONS: 'notifications_queue'
5
+ NOTIFICATIONS: 'notifications_queue',
6
+ USERS: 'users_queue'
6
7
  };
@@ -53,10 +53,25 @@ export interface UnlinkTelegramRequest {
53
53
  export interface UnlinkTelegramResponse {
54
54
  ok: boolean;
55
55
  }
56
+ export interface InitAccountDeletionRequest {
57
+ userId: string;
58
+ }
59
+ export interface InitAccountDeletionResponse {
60
+ ok: boolean;
61
+ }
62
+ export interface ConfirmAccountDeletionRequest {
63
+ userId: string;
64
+ code: string;
65
+ }
66
+ export interface ConfirmAccountDeletionResponse {
67
+ ok: boolean;
68
+ }
56
69
  export interface AccountService {
57
70
  getAccount(request: GetAccountRequest): Promise<GetAccountResponse>;
58
71
  initEmailChange(request: InitEmailChangeRequest): Promise<InitEmailChangeResponse>;
59
72
  confirmEmailChange(request: ConfirmEmailChangeRequest): Promise<ConfirmEmailChangeResponse>;
60
73
  linkTelegram(request: LinkTelegramRequest): Promise<LinkTelegramResponse>;
61
74
  unlinkTelegram(request: UnlinkTelegramRequest): Promise<UnlinkTelegramResponse>;
75
+ initAccountDeletion(request: InitAccountDeletionRequest): Promise<InitAccountDeletionResponse>;
76
+ confirmAccountDeletion(request: ConfirmAccountDeletionRequest): Promise<ConfirmAccountDeletionResponse>;
62
77
  }
@@ -54,6 +54,19 @@ export interface UnlinkTelegramRequest {
54
54
  export interface UnlinkTelegramResponse {
55
55
  ok: boolean;
56
56
  }
57
+ export interface InitAccountDeletionRequest {
58
+ userId: string;
59
+ }
60
+ export interface InitAccountDeletionResponse {
61
+ ok: boolean;
62
+ }
63
+ export interface ConfirmAccountDeletionRequest {
64
+ userId: string;
65
+ code: string;
66
+ }
67
+ export interface ConfirmAccountDeletionResponse {
68
+ ok: boolean;
69
+ }
57
70
  export declare const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
58
71
  export interface AccountServiceClient {
59
72
  getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
@@ -61,6 +74,8 @@ export interface AccountServiceClient {
61
74
  confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
62
75
  linkTelegram(request: LinkTelegramRequest): Observable<LinkTelegramResponse>;
63
76
  unlinkTelegram(request: UnlinkTelegramRequest): Observable<UnlinkTelegramResponse>;
77
+ initAccountDeletion(request: InitAccountDeletionRequest): Observable<InitAccountDeletionResponse>;
78
+ confirmAccountDeletion(request: ConfirmAccountDeletionRequest): Observable<ConfirmAccountDeletionResponse>;
64
79
  }
65
80
  export interface AccountServiceController {
66
81
  getAccount(request: GetAccountRequest): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
@@ -68,6 +83,8 @@ export interface AccountServiceController {
68
83
  confirmEmailChange(request: ConfirmEmailChangeRequest): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
69
84
  linkTelegram(request: LinkTelegramRequest): Promise<LinkTelegramResponse> | Observable<LinkTelegramResponse> | LinkTelegramResponse;
70
85
  unlinkTelegram(request: UnlinkTelegramRequest): Promise<UnlinkTelegramResponse> | Observable<UnlinkTelegramResponse> | UnlinkTelegramResponse;
86
+ initAccountDeletion(request: InitAccountDeletionRequest): Promise<InitAccountDeletionResponse> | Observable<InitAccountDeletionResponse> | InitAccountDeletionResponse;
87
+ confirmAccountDeletion(request: ConfirmAccountDeletionRequest): Promise<ConfirmAccountDeletionResponse> | Observable<ConfirmAccountDeletionResponse> | ConfirmAccountDeletionResponse;
71
88
  }
72
89
  export declare function AccountServiceControllerMethods(): (constructor: Function) => void;
73
90
  export declare const ACCOUNT_SERVICE_NAME = "AccountService";
@@ -25,6 +25,8 @@ function AccountServiceControllerMethods() {
25
25
  "confirmEmailChange",
26
26
  "linkTelegram",
27
27
  "unlinkTelegram",
28
+ "initAccountDeletion",
29
+ "confirmAccountDeletion",
28
30
  ];
29
31
  for (const method of grpcMethods) {
30
32
  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.1.0",
3
+ "version": "6.2.0",
4
4
  "description": "Protobuf contracts for CanDesk microservices",
5
5
  "author": {
6
6
  "name": "Alexander Schulz",
@@ -10,6 +10,9 @@ service AccountService {
10
10
 
11
11
  rpc LinkTelegram(LinkTelegramRequest) returns (LinkTelegramResponse);
12
12
  rpc UnlinkTelegram(UnlinkTelegramRequest) returns (UnlinkTelegramResponse);
13
+
14
+ rpc InitAccountDeletion(InitAccountDeletionRequest) returns (InitAccountDeletionResponse);
15
+ rpc ConfirmAccountDeletion(ConfirmAccountDeletionRequest) returns (ConfirmAccountDeletionResponse);
13
16
  }
14
17
 
15
18
  message GetAccountRequest {
@@ -65,6 +68,23 @@ message UnlinkTelegramResponse {
65
68
  bool ok = 1;
66
69
  }
67
70
 
71
+ message InitAccountDeletionRequest {
72
+ string user_id = 1;
73
+ }
74
+
75
+ message InitAccountDeletionResponse {
76
+ bool ok = 1;
77
+ }
78
+
79
+ message ConfirmAccountDeletionRequest {
80
+ string user_id = 1;
81
+ string code = 2;
82
+ }
83
+
84
+ message ConfirmAccountDeletionResponse {
85
+ bool ok = 1;
86
+ }
87
+
68
88
  enum Role {
69
89
  USER = 0;
70
90
  ADMIN = 1;