@aepstore-dev/contracts 1.25.0 → 1.27.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/gen/taxonomy.ts +20 -0
- package/gen/users.ts +11 -4
- package/package.json +1 -1
- package/proto/auth.proto +126 -126
- package/proto/mail.proto +42 -42
- package/proto/payments.proto +203 -203
- package/proto/support.proto +118 -118
- package/proto/taxonomy.proto +88 -78
- package/proto/upload.proto +150 -150
- package/proto/users.proto +11 -4
package/gen/taxonomy.ts
CHANGED
|
@@ -24,6 +24,8 @@ export interface Application {
|
|
|
24
24
|
description: string;
|
|
25
25
|
createdAt: string;
|
|
26
26
|
updatedAt: string;
|
|
27
|
+
/** public S3 URL to brand SVG (admin-set), empty if none */
|
|
28
|
+
iconUrl: string;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
export interface Tag {
|
|
@@ -67,6 +69,17 @@ export interface CategoryResponse {
|
|
|
67
69
|
export interface CreateApplicationRequest {
|
|
68
70
|
name: string;
|
|
69
71
|
description: string;
|
|
72
|
+
iconUrl: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface UpdateApplicationRequest {
|
|
76
|
+
id: string;
|
|
77
|
+
/** optional — empty keeps current */
|
|
78
|
+
name: string;
|
|
79
|
+
/** optional */
|
|
80
|
+
description: string;
|
|
81
|
+
/** optional — empty keeps current */
|
|
82
|
+
iconUrl: string;
|
|
70
83
|
}
|
|
71
84
|
|
|
72
85
|
export interface ApplicationResponse {
|
|
@@ -85,6 +98,8 @@ export interface TaxonomyServiceClient {
|
|
|
85
98
|
createCategory(request: CreateCategoryRequest): Observable<CategoryResponse>;
|
|
86
99
|
|
|
87
100
|
createApplication(request: CreateApplicationRequest): Observable<ApplicationResponse>;
|
|
101
|
+
|
|
102
|
+
updateApplication(request: UpdateApplicationRequest): Observable<ApplicationResponse>;
|
|
88
103
|
}
|
|
89
104
|
|
|
90
105
|
export interface TaxonomyServiceController {
|
|
@@ -105,6 +120,10 @@ export interface TaxonomyServiceController {
|
|
|
105
120
|
createApplication(
|
|
106
121
|
request: CreateApplicationRequest,
|
|
107
122
|
): Promise<ApplicationResponse> | Observable<ApplicationResponse> | ApplicationResponse;
|
|
123
|
+
|
|
124
|
+
updateApplication(
|
|
125
|
+
request: UpdateApplicationRequest,
|
|
126
|
+
): Promise<ApplicationResponse> | Observable<ApplicationResponse> | ApplicationResponse;
|
|
108
127
|
}
|
|
109
128
|
|
|
110
129
|
export function TaxonomyServiceControllerMethods() {
|
|
@@ -115,6 +134,7 @@ export function TaxonomyServiceControllerMethods() {
|
|
|
115
134
|
"findAllTags",
|
|
116
135
|
"createCategory",
|
|
117
136
|
"createApplication",
|
|
137
|
+
"updateApplication",
|
|
118
138
|
];
|
|
119
139
|
for (const method of grpcMethods) {
|
|
120
140
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
package/gen/users.ts
CHANGED
|
@@ -124,6 +124,13 @@ export interface ProfileStats {
|
|
|
124
124
|
videosCount: number;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
/** Compact public user card for subscriber/subscription lists — no email/ban data. */
|
|
128
|
+
export interface ProfileUser {
|
|
129
|
+
id: string;
|
|
130
|
+
username: string;
|
|
131
|
+
avatarUrl: string;
|
|
132
|
+
}
|
|
133
|
+
|
|
127
134
|
export interface GetPublicProfileRequest {
|
|
128
135
|
username: string;
|
|
129
136
|
/** optional — present when caller is authenticated */
|
|
@@ -148,8 +155,8 @@ export interface PublicProfileResponse {
|
|
|
148
155
|
createdAt: string;
|
|
149
156
|
hideSubscriptions: boolean;
|
|
150
157
|
/** Either populated lists or empty depending on hide_subscriptions */
|
|
151
|
-
subscriptions:
|
|
152
|
-
subscribers:
|
|
158
|
+
subscriptions: ProfileUser[];
|
|
159
|
+
subscribers: ProfileUser[];
|
|
153
160
|
isOwner: boolean;
|
|
154
161
|
/** viewer is subscribed to this profile (false when anonymous / self) */
|
|
155
162
|
isSubscribed: boolean;
|
|
@@ -232,8 +239,8 @@ export interface GetUserFieldsRequest {
|
|
|
232
239
|
export interface GetUserFieldsResponse {
|
|
233
240
|
videos: Video[];
|
|
234
241
|
products: Product[];
|
|
235
|
-
subscriptions:
|
|
236
|
-
subscribers:
|
|
242
|
+
subscriptions: ProfileUser[];
|
|
243
|
+
subscribers: ProfileUser[];
|
|
237
244
|
total: number;
|
|
238
245
|
page: number;
|
|
239
246
|
limit: number;
|
package/package.json
CHANGED
package/proto/auth.proto
CHANGED
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package auth.v1;
|
|
4
|
-
|
|
5
|
-
// Ported from legacy auth-service (@MessagePattern → @GrpcMethod).
|
|
6
|
-
// Tokens are HMAC primitives from @aepstore-dev/passport:
|
|
7
|
-
// - access token: short TTL, carries userId; the gateway validates it
|
|
8
|
-
// locally via PassportAuthGuard (no round-trip here).
|
|
9
|
-
// - refresh token: long TTL HMAC + a RefreshToken DB row (device list +
|
|
10
|
-
// revocation). Refresh verifies the HMAC AND that the row still exists.
|
|
11
|
-
service AuthService {
|
|
12
|
-
rpc Login(LoginRequest) returns (AuthResult);
|
|
13
|
-
rpc Register(RegisterRequest) returns (AuthResult);
|
|
14
|
-
rpc CreateCode(CreateCodeRequest) returns (AuthResult);
|
|
15
|
-
rpc VerifyCode(VerifyCodeRequest) returns (AuthResult);
|
|
16
|
-
rpc CheckToken(CheckTokenRequest) returns (AuthUser);
|
|
17
|
-
rpc RefreshToken(RefreshTokenRequest) returns (AuthResult);
|
|
18
|
-
rpc Get2faStatus(Get2faStatusRequest) returns (TwoFactorStatusResponse);
|
|
19
|
-
rpc GetProfile(GetProfileRequest) returns (AuthUser);
|
|
20
|
-
rpc CleanupExpiredTotpSetups(Empty) returns (Empty);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
enum TwoFactorType {
|
|
24
|
-
NONE = 0;
|
|
25
|
-
APP = 1;
|
|
26
|
-
EMAIL = 2;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// ---------------------------------------------------------------------------
|
|
30
|
-
// Requests
|
|
31
|
-
// ---------------------------------------------------------------------------
|
|
32
|
-
|
|
33
|
-
// Login by username OR email (one of the two must be set).
|
|
34
|
-
message LoginRequest {
|
|
35
|
-
string password = 1;
|
|
36
|
-
string credentials = 2; // username OR email — resolved by the service
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
message RegisterRequest {
|
|
40
|
-
string email = 1;
|
|
41
|
-
string username = 2;
|
|
42
|
-
string password = 3;
|
|
43
|
-
string ip = 4; // optional, attached by gateway from req
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// type ∈ { twofa, reset, totp_generate, totp_activate, confirm } (legacy strings)
|
|
47
|
-
message CreateCodeRequest {
|
|
48
|
-
string email = 1;
|
|
49
|
-
string type = 2;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// type ∈ { twofa, twofa_deactivate, reset, totp, totp_deactivate, backup, confirm }
|
|
53
|
-
// new_password is only used by the 'reset' flow.
|
|
54
|
-
message VerifyCodeRequest {
|
|
55
|
-
string email = 1;
|
|
56
|
-
string code = 2;
|
|
57
|
-
string type = 3;
|
|
58
|
-
string new_password = 4; // optional
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
message CheckTokenRequest {
|
|
62
|
-
string token = 1;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
message RefreshTokenRequest {
|
|
66
|
-
string refresh_token = 1;
|
|
67
|
-
string user_agent = 2; // optional
|
|
68
|
-
string ip = 3; // optional
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
message Get2faStatusRequest {
|
|
72
|
-
string username = 1;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
message GetProfileRequest {
|
|
76
|
-
string user_id = 1;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// ---------------------------------------------------------------------------
|
|
80
|
-
// Responses
|
|
81
|
-
// ---------------------------------------------------------------------------
|
|
82
|
-
|
|
83
|
-
message AuthUser {
|
|
84
|
-
string id = 1;
|
|
85
|
-
string username = 2;
|
|
86
|
-
string email = 3;
|
|
87
|
-
string avatar_url = 4;
|
|
88
|
-
string banner_url = 5;
|
|
89
|
-
repeated string roles = 6;
|
|
90
|
-
string role = 7; // primary role (roles[0])
|
|
91
|
-
bool is_verified = 8;
|
|
92
|
-
TwoFactorType two_factor_type = 9;
|
|
93
|
-
bool two_factor_enabled = 10;
|
|
94
|
-
string balance = 11; // Decimal as string (D7)
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// Unified result for login/register/createCode/verifyCode/refresh. Which fields
|
|
98
|
-
// are populated depends on the flow:
|
|
99
|
-
// - fully authenticated → access_token + refresh_token + expires_in + user
|
|
100
|
-
// - 2FA required / pending confirm → message + requires_2fa + two_factor_type + user (no tokens)
|
|
101
|
-
// - totp_generate → secret + otpauth + qr (+ user)
|
|
102
|
-
// - totp_activate → backup_codes (+ tokens/user)
|
|
103
|
-
message AuthResult {
|
|
104
|
-
string access_token = 1;
|
|
105
|
-
string refresh_token = 2;
|
|
106
|
-
int32 expires_in = 3;
|
|
107
|
-
AuthUser user = 4;
|
|
108
|
-
|
|
109
|
-
string message = 5;
|
|
110
|
-
bool requires_2fa = 6;
|
|
111
|
-
TwoFactorType two_factor_type = 7;
|
|
112
|
-
|
|
113
|
-
// TOTP setup extras
|
|
114
|
-
string secret = 8;
|
|
115
|
-
string otpauth = 9;
|
|
116
|
-
string qr = 10; // data URL (PNG)
|
|
117
|
-
repeated string backup_codes = 11;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
message TwoFactorStatusResponse {
|
|
121
|
-
TwoFactorType two_factor_type = 1;
|
|
122
|
-
bool has_2fa = 2;
|
|
123
|
-
bool is_verified = 3;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
message Empty {}
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package auth.v1;
|
|
4
|
+
|
|
5
|
+
// Ported from legacy auth-service (@MessagePattern → @GrpcMethod).
|
|
6
|
+
// Tokens are HMAC primitives from @aepstore-dev/passport:
|
|
7
|
+
// - access token: short TTL, carries userId; the gateway validates it
|
|
8
|
+
// locally via PassportAuthGuard (no round-trip here).
|
|
9
|
+
// - refresh token: long TTL HMAC + a RefreshToken DB row (device list +
|
|
10
|
+
// revocation). Refresh verifies the HMAC AND that the row still exists.
|
|
11
|
+
service AuthService {
|
|
12
|
+
rpc Login(LoginRequest) returns (AuthResult);
|
|
13
|
+
rpc Register(RegisterRequest) returns (AuthResult);
|
|
14
|
+
rpc CreateCode(CreateCodeRequest) returns (AuthResult);
|
|
15
|
+
rpc VerifyCode(VerifyCodeRequest) returns (AuthResult);
|
|
16
|
+
rpc CheckToken(CheckTokenRequest) returns (AuthUser);
|
|
17
|
+
rpc RefreshToken(RefreshTokenRequest) returns (AuthResult);
|
|
18
|
+
rpc Get2faStatus(Get2faStatusRequest) returns (TwoFactorStatusResponse);
|
|
19
|
+
rpc GetProfile(GetProfileRequest) returns (AuthUser);
|
|
20
|
+
rpc CleanupExpiredTotpSetups(Empty) returns (Empty);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
enum TwoFactorType {
|
|
24
|
+
NONE = 0;
|
|
25
|
+
APP = 1;
|
|
26
|
+
EMAIL = 2;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
// Requests
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
|
|
33
|
+
// Login by username OR email (one of the two must be set).
|
|
34
|
+
message LoginRequest {
|
|
35
|
+
string password = 1;
|
|
36
|
+
string credentials = 2; // username OR email — resolved by the service
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
message RegisterRequest {
|
|
40
|
+
string email = 1;
|
|
41
|
+
string username = 2;
|
|
42
|
+
string password = 3;
|
|
43
|
+
string ip = 4; // optional, attached by gateway from req
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// type ∈ { twofa, reset, totp_generate, totp_activate, confirm } (legacy strings)
|
|
47
|
+
message CreateCodeRequest {
|
|
48
|
+
string email = 1;
|
|
49
|
+
string type = 2;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// type ∈ { twofa, twofa_deactivate, reset, totp, totp_deactivate, backup, confirm }
|
|
53
|
+
// new_password is only used by the 'reset' flow.
|
|
54
|
+
message VerifyCodeRequest {
|
|
55
|
+
string email = 1;
|
|
56
|
+
string code = 2;
|
|
57
|
+
string type = 3;
|
|
58
|
+
string new_password = 4; // optional
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
message CheckTokenRequest {
|
|
62
|
+
string token = 1;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
message RefreshTokenRequest {
|
|
66
|
+
string refresh_token = 1;
|
|
67
|
+
string user_agent = 2; // optional
|
|
68
|
+
string ip = 3; // optional
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
message Get2faStatusRequest {
|
|
72
|
+
string username = 1;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
message GetProfileRequest {
|
|
76
|
+
string user_id = 1;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// ---------------------------------------------------------------------------
|
|
80
|
+
// Responses
|
|
81
|
+
// ---------------------------------------------------------------------------
|
|
82
|
+
|
|
83
|
+
message AuthUser {
|
|
84
|
+
string id = 1;
|
|
85
|
+
string username = 2;
|
|
86
|
+
string email = 3;
|
|
87
|
+
string avatar_url = 4;
|
|
88
|
+
string banner_url = 5;
|
|
89
|
+
repeated string roles = 6;
|
|
90
|
+
string role = 7; // primary role (roles[0])
|
|
91
|
+
bool is_verified = 8;
|
|
92
|
+
TwoFactorType two_factor_type = 9;
|
|
93
|
+
bool two_factor_enabled = 10;
|
|
94
|
+
string balance = 11; // Decimal as string (D7)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Unified result for login/register/createCode/verifyCode/refresh. Which fields
|
|
98
|
+
// are populated depends on the flow:
|
|
99
|
+
// - fully authenticated → access_token + refresh_token + expires_in + user
|
|
100
|
+
// - 2FA required / pending confirm → message + requires_2fa + two_factor_type + user (no tokens)
|
|
101
|
+
// - totp_generate → secret + otpauth + qr (+ user)
|
|
102
|
+
// - totp_activate → backup_codes (+ tokens/user)
|
|
103
|
+
message AuthResult {
|
|
104
|
+
string access_token = 1;
|
|
105
|
+
string refresh_token = 2;
|
|
106
|
+
int32 expires_in = 3;
|
|
107
|
+
AuthUser user = 4;
|
|
108
|
+
|
|
109
|
+
string message = 5;
|
|
110
|
+
bool requires_2fa = 6;
|
|
111
|
+
TwoFactorType two_factor_type = 7;
|
|
112
|
+
|
|
113
|
+
// TOTP setup extras
|
|
114
|
+
string secret = 8;
|
|
115
|
+
string otpauth = 9;
|
|
116
|
+
string qr = 10; // data URL (PNG)
|
|
117
|
+
repeated string backup_codes = 11;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
message TwoFactorStatusResponse {
|
|
121
|
+
TwoFactorType two_factor_type = 1;
|
|
122
|
+
bool has_2fa = 2;
|
|
123
|
+
bool is_verified = 3;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
message Empty {}
|
package/proto/mail.proto
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package mail.v1;
|
|
4
|
-
|
|
5
|
-
// Legacy mail-service used @EventPattern (fire-and-forget). In the new gRPC
|
|
6
|
-
// stack each becomes a unary RPC that returns an Ack. Callers ignore the
|
|
7
|
-
// response if they don't care about delivery.
|
|
8
|
-
service MailService {
|
|
9
|
-
rpc SendReg(SendRegRequest) returns (MailAck);
|
|
10
|
-
rpc Send2fa(Send2faRequest) returns (MailAck);
|
|
11
|
-
rpc SendPasswordReset(SendPasswordResetRequest) returns (MailAck);
|
|
12
|
-
rpc SendRegistrationConfirm(SendRegistrationConfirmRequest) returns (MailAck);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
message MailAck {
|
|
16
|
-
bool queued = 1;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
message SendRegRequest {
|
|
20
|
-
string user_id = 1;
|
|
21
|
-
string email = 2;
|
|
22
|
-
string username = 3;
|
|
23
|
-
string full_name = 4;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
message Send2faRequest {
|
|
27
|
-
string email = 1;
|
|
28
|
-
string code = 2;
|
|
29
|
-
string username = 3;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
message SendPasswordResetRequest {
|
|
33
|
-
string email = 1;
|
|
34
|
-
string code = 2;
|
|
35
|
-
string username = 3;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
message SendRegistrationConfirmRequest {
|
|
39
|
-
string email = 1;
|
|
40
|
-
string code = 2;
|
|
41
|
-
string username = 3;
|
|
42
|
-
}
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package mail.v1;
|
|
4
|
+
|
|
5
|
+
// Legacy mail-service used @EventPattern (fire-and-forget). In the new gRPC
|
|
6
|
+
// stack each becomes a unary RPC that returns an Ack. Callers ignore the
|
|
7
|
+
// response if they don't care about delivery.
|
|
8
|
+
service MailService {
|
|
9
|
+
rpc SendReg(SendRegRequest) returns (MailAck);
|
|
10
|
+
rpc Send2fa(Send2faRequest) returns (MailAck);
|
|
11
|
+
rpc SendPasswordReset(SendPasswordResetRequest) returns (MailAck);
|
|
12
|
+
rpc SendRegistrationConfirm(SendRegistrationConfirmRequest) returns (MailAck);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message MailAck {
|
|
16
|
+
bool queued = 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message SendRegRequest {
|
|
20
|
+
string user_id = 1;
|
|
21
|
+
string email = 2;
|
|
22
|
+
string username = 3;
|
|
23
|
+
string full_name = 4;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
message Send2faRequest {
|
|
27
|
+
string email = 1;
|
|
28
|
+
string code = 2;
|
|
29
|
+
string username = 3;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
message SendPasswordResetRequest {
|
|
33
|
+
string email = 1;
|
|
34
|
+
string code = 2;
|
|
35
|
+
string username = 3;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
message SendRegistrationConfirmRequest {
|
|
39
|
+
string email = 1;
|
|
40
|
+
string code = 2;
|
|
41
|
+
string username = 3;
|
|
42
|
+
}
|