@candesk/contracts 6.6.0 → 6.7.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.
- package/dist/constants/telegram.constants.d.ts +1 -0
- package/dist/constants/telegram.constants.js +2 -1
- package/dist/events/auth/auth.events.d.ts +1 -0
- package/dist/events/auth/auth.events.js +1 -0
- package/dist/events/auth/index.d.ts +1 -0
- package/dist/events/auth/index.js +1 -0
- package/dist/events/auth/telegram-unlinked.interface.d.ts +4 -0
- package/dist/events/auth/telegram-unlinked.interface.js +2 -0
- package/dist/gen/account.d.ts +14 -0
- package/dist/gen/auth.d.ts +7 -0
- package/dist/nest/account.d.ts +16 -0
- package/dist/nest/account.js +2 -0
- package/dist/nest/auth.d.ts +7 -0
- package/package.json +1 -1
- package/proto/account.proto +18 -0
- package/proto/auth.proto +8 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TELEGRAM_SESSION_TTL_SECONDS = void 0;
|
|
3
|
+
exports.TELEGRAM_LINK_START_PREFIX = exports.TELEGRAM_SESSION_TTL_SECONDS = void 0;
|
|
4
4
|
exports.TELEGRAM_SESSION_TTL_SECONDS = 5 * 60; // 5 minutes
|
|
5
|
+
exports.TELEGRAM_LINK_START_PREFIX = 'link_';
|
|
@@ -3,6 +3,7 @@ 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 TELEGRAM_UNLINKED: 'auth.telegram.unlinked';
|
|
6
7
|
readonly ACCOUNT_DELETION_REQUESTED: 'auth.account-deletion.requested';
|
|
7
8
|
readonly ACCOUNT_DELETED: 'auth.account.deleted';
|
|
8
9
|
};
|
|
@@ -6,6 +6,7 @@ exports.AUTH_EVENTS = {
|
|
|
6
6
|
EMAIL_CHANGE_REQUESTED: 'auth.email-change.requested',
|
|
7
7
|
EMAIL_CHANGED: 'auth.email.changed',
|
|
8
8
|
TELEGRAM_LINKED: 'auth.telegram.linked',
|
|
9
|
+
TELEGRAM_UNLINKED: 'auth.telegram.unlinked',
|
|
9
10
|
ACCOUNT_DELETION_REQUESTED: 'auth.account-deletion.requested',
|
|
10
11
|
ACCOUNT_DELETED: 'auth.account.deleted'
|
|
11
12
|
};
|
|
@@ -21,3 +21,4 @@ __exportStar(require("./email-change-requested.interface"), exports);
|
|
|
21
21
|
__exportStar(require("./email-changed.interface"), exports);
|
|
22
22
|
__exportStar(require("./otp-requested.interface"), exports);
|
|
23
23
|
__exportStar(require("./telegram-linked.interface"), exports);
|
|
24
|
+
__exportStar(require("./telegram-unlinked.interface"), exports);
|
package/dist/gen/account.d.ts
CHANGED
|
@@ -35,6 +35,12 @@ export interface ConfirmEmailChangeRequest {
|
|
|
35
35
|
export interface ConfirmEmailChangeResponse {
|
|
36
36
|
ok: boolean;
|
|
37
37
|
}
|
|
38
|
+
export interface InitTelegramLinkRequest {
|
|
39
|
+
userId: string;
|
|
40
|
+
}
|
|
41
|
+
export interface InitTelegramLinkResponse {
|
|
42
|
+
url: string;
|
|
43
|
+
}
|
|
38
44
|
export interface LinkTelegramRequest {
|
|
39
45
|
userId: string;
|
|
40
46
|
query: {
|
|
@@ -49,6 +55,12 @@ export interface LinkTelegramResponse {
|
|
|
49
55
|
linked: boolean;
|
|
50
56
|
url: string;
|
|
51
57
|
}
|
|
58
|
+
export interface PollTelegramLinkRequest {
|
|
59
|
+
userId: string;
|
|
60
|
+
}
|
|
61
|
+
export interface PollTelegramLinkResponse {
|
|
62
|
+
linked: boolean;
|
|
63
|
+
}
|
|
52
64
|
export interface UnlinkTelegramRequest {
|
|
53
65
|
userId: string;
|
|
54
66
|
}
|
|
@@ -72,7 +84,9 @@ export interface AccountService {
|
|
|
72
84
|
getAccount(request: GetAccountRequest): Promise<GetAccountResponse>;
|
|
73
85
|
initEmailChange(request: InitEmailChangeRequest): Promise<InitEmailChangeResponse>;
|
|
74
86
|
confirmEmailChange(request: ConfirmEmailChangeRequest): Promise<ConfirmEmailChangeResponse>;
|
|
87
|
+
initTelegramLink(request: InitTelegramLinkRequest): Promise<InitTelegramLinkResponse>;
|
|
75
88
|
linkTelegram(request: LinkTelegramRequest): Promise<LinkTelegramResponse>;
|
|
89
|
+
pollTelegramLink(request: PollTelegramLinkRequest): Promise<PollTelegramLinkResponse>;
|
|
76
90
|
unlinkTelegram(request: UnlinkTelegramRequest): Promise<UnlinkTelegramResponse>;
|
|
77
91
|
initAccountDeletion(request: InitAccountDeletionRequest): Promise<InitAccountDeletionResponse>;
|
|
78
92
|
confirmAccountDeletion(request: ConfirmAccountDeletionRequest): Promise<ConfirmAccountDeletionResponse>;
|
package/dist/gen/auth.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ export interface TelegramCompleteRequest {
|
|
|
53
53
|
export interface TelegramCompleteResponse {
|
|
54
54
|
sessionId: string;
|
|
55
55
|
linked: boolean;
|
|
56
|
+
account: TelegramAccount | undefined;
|
|
56
57
|
}
|
|
57
58
|
export interface TelegramConsumeRequest {
|
|
58
59
|
sessionId: string;
|
|
@@ -74,6 +75,12 @@ export interface TelegramStatusRequest {
|
|
|
74
75
|
}
|
|
75
76
|
export interface TelegramStatusResponse {
|
|
76
77
|
linked: boolean;
|
|
78
|
+
account: TelegramAccount | undefined;
|
|
79
|
+
}
|
|
80
|
+
export interface TelegramAccount {
|
|
81
|
+
id: string;
|
|
82
|
+
email: string;
|
|
83
|
+
phone: string;
|
|
77
84
|
}
|
|
78
85
|
export interface AuthService {
|
|
79
86
|
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse>;
|
package/dist/nest/account.d.ts
CHANGED
|
@@ -36,6 +36,12 @@ export interface ConfirmEmailChangeRequest {
|
|
|
36
36
|
export interface ConfirmEmailChangeResponse {
|
|
37
37
|
ok: boolean;
|
|
38
38
|
}
|
|
39
|
+
export interface InitTelegramLinkRequest {
|
|
40
|
+
userId: string;
|
|
41
|
+
}
|
|
42
|
+
export interface InitTelegramLinkResponse {
|
|
43
|
+
url: string;
|
|
44
|
+
}
|
|
39
45
|
export interface LinkTelegramRequest {
|
|
40
46
|
userId: string;
|
|
41
47
|
query: {
|
|
@@ -50,6 +56,12 @@ export interface LinkTelegramResponse {
|
|
|
50
56
|
linked: boolean;
|
|
51
57
|
url: string;
|
|
52
58
|
}
|
|
59
|
+
export interface PollTelegramLinkRequest {
|
|
60
|
+
userId: string;
|
|
61
|
+
}
|
|
62
|
+
export interface PollTelegramLinkResponse {
|
|
63
|
+
linked: boolean;
|
|
64
|
+
}
|
|
53
65
|
export interface UnlinkTelegramRequest {
|
|
54
66
|
userId: string;
|
|
55
67
|
}
|
|
@@ -74,7 +86,9 @@ export interface AccountServiceClient {
|
|
|
74
86
|
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
75
87
|
initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponse>;
|
|
76
88
|
confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
|
|
89
|
+
initTelegramLink(request: InitTelegramLinkRequest): Observable<InitTelegramLinkResponse>;
|
|
77
90
|
linkTelegram(request: LinkTelegramRequest): Observable<LinkTelegramResponse>;
|
|
91
|
+
pollTelegramLink(request: PollTelegramLinkRequest): Observable<PollTelegramLinkResponse>;
|
|
78
92
|
unlinkTelegram(request: UnlinkTelegramRequest): Observable<UnlinkTelegramResponse>;
|
|
79
93
|
initAccountDeletion(request: InitAccountDeletionRequest): Observable<InitAccountDeletionResponse>;
|
|
80
94
|
confirmAccountDeletion(request: ConfirmAccountDeletionRequest): Observable<ConfirmAccountDeletionResponse>;
|
|
@@ -83,7 +97,9 @@ export interface AccountServiceController {
|
|
|
83
97
|
getAccount(request: GetAccountRequest): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
84
98
|
initEmailChange(request: InitEmailChangeRequest): Promise<InitEmailChangeResponse> | Observable<InitEmailChangeResponse> | InitEmailChangeResponse;
|
|
85
99
|
confirmEmailChange(request: ConfirmEmailChangeRequest): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
|
|
100
|
+
initTelegramLink(request: InitTelegramLinkRequest): Promise<InitTelegramLinkResponse> | Observable<InitTelegramLinkResponse> | InitTelegramLinkResponse;
|
|
86
101
|
linkTelegram(request: LinkTelegramRequest): Promise<LinkTelegramResponse> | Observable<LinkTelegramResponse> | LinkTelegramResponse;
|
|
102
|
+
pollTelegramLink(request: PollTelegramLinkRequest): Promise<PollTelegramLinkResponse> | Observable<PollTelegramLinkResponse> | PollTelegramLinkResponse;
|
|
87
103
|
unlinkTelegram(request: UnlinkTelegramRequest): Promise<UnlinkTelegramResponse> | Observable<UnlinkTelegramResponse> | UnlinkTelegramResponse;
|
|
88
104
|
initAccountDeletion(request: InitAccountDeletionRequest): Promise<InitAccountDeletionResponse> | Observable<InitAccountDeletionResponse> | InitAccountDeletionResponse;
|
|
89
105
|
confirmAccountDeletion(request: ConfirmAccountDeletionRequest): Promise<ConfirmAccountDeletionResponse> | Observable<ConfirmAccountDeletionResponse> | ConfirmAccountDeletionResponse;
|
package/dist/nest/account.js
CHANGED
package/dist/nest/auth.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ export interface TelegramCompleteRequest {
|
|
|
54
54
|
export interface TelegramCompleteResponse {
|
|
55
55
|
sessionId: string;
|
|
56
56
|
linked: boolean;
|
|
57
|
+
account: TelegramAccount | undefined;
|
|
57
58
|
}
|
|
58
59
|
export interface TelegramConsumeRequest {
|
|
59
60
|
sessionId: string;
|
|
@@ -75,6 +76,12 @@ export interface TelegramStatusRequest {
|
|
|
75
76
|
}
|
|
76
77
|
export interface TelegramStatusResponse {
|
|
77
78
|
linked: boolean;
|
|
79
|
+
account: TelegramAccount | undefined;
|
|
80
|
+
}
|
|
81
|
+
export interface TelegramAccount {
|
|
82
|
+
id: string;
|
|
83
|
+
email: string;
|
|
84
|
+
phone: string;
|
|
78
85
|
}
|
|
79
86
|
export declare const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
80
87
|
export interface AuthServiceClient {
|
package/package.json
CHANGED
package/proto/account.proto
CHANGED
|
@@ -8,7 +8,9 @@ service AccountService {
|
|
|
8
8
|
rpc InitEmailChange(InitEmailChangeRequest) returns (InitEmailChangeResponse);
|
|
9
9
|
rpc ConfirmEmailChange(ConfirmEmailChangeRequest) returns (ConfirmEmailChangeResponse);
|
|
10
10
|
|
|
11
|
+
rpc InitTelegramLink(InitTelegramLinkRequest) returns (InitTelegramLinkResponse);
|
|
11
12
|
rpc LinkTelegram(LinkTelegramRequest) returns (LinkTelegramResponse);
|
|
13
|
+
rpc PollTelegramLink(PollTelegramLinkRequest) returns (PollTelegramLinkResponse);
|
|
12
14
|
rpc UnlinkTelegram(UnlinkTelegramRequest) returns (UnlinkTelegramResponse);
|
|
13
15
|
|
|
14
16
|
rpc InitAccountDeletion(InitAccountDeletionRequest) returns (InitAccountDeletionResponse);
|
|
@@ -50,6 +52,14 @@ message ConfirmEmailChangeResponse {
|
|
|
50
52
|
bool ok = 1;
|
|
51
53
|
}
|
|
52
54
|
|
|
55
|
+
message InitTelegramLinkRequest {
|
|
56
|
+
string user_id = 1;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
message InitTelegramLinkResponse {
|
|
60
|
+
string url = 1;
|
|
61
|
+
}
|
|
62
|
+
|
|
53
63
|
message LinkTelegramRequest {
|
|
54
64
|
string user_id = 1;
|
|
55
65
|
map<string, string> query = 2;
|
|
@@ -60,6 +70,14 @@ message LinkTelegramResponse {
|
|
|
60
70
|
string url = 2;
|
|
61
71
|
}
|
|
62
72
|
|
|
73
|
+
message PollTelegramLinkRequest {
|
|
74
|
+
string user_id = 1;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
message PollTelegramLinkResponse {
|
|
78
|
+
bool linked = 1;
|
|
79
|
+
}
|
|
80
|
+
|
|
63
81
|
message UnlinkTelegramRequest {
|
|
64
82
|
string user_id = 1;
|
|
65
83
|
}
|
package/proto/auth.proto
CHANGED
|
@@ -77,6 +77,7 @@ message TelegramCompleteRequest {
|
|
|
77
77
|
message TelegramCompleteResponse {
|
|
78
78
|
string session_id = 1;
|
|
79
79
|
bool linked = 2;
|
|
80
|
+
TelegramAccount account = 3;
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
message TelegramConsumeRequest {
|
|
@@ -104,4 +105,11 @@ message TelegramStatusRequest {
|
|
|
104
105
|
|
|
105
106
|
message TelegramStatusResponse {
|
|
106
107
|
bool linked = 1;
|
|
108
|
+
TelegramAccount account = 2;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
message TelegramAccount {
|
|
112
|
+
string id = 1;
|
|
113
|
+
string email = 2;
|
|
114
|
+
string phone = 3;
|
|
107
115
|
}
|