@aepstore-dev/contracts 1.26.0 → 1.28.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 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,12 +69,38 @@ 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 {
73
86
  application: Application | undefined;
74
87
  }
75
88
 
89
+ export interface CreateIconUploadUrlRequest {
90
+ fileName: string;
91
+ /** e.g. image/svg+xml */
92
+ mimeType: string;
93
+ }
94
+
95
+ export interface IconUploadUrlResponse {
96
+ /** presigned PUT URL — client uploads the SVG bytes here */
97
+ uploadUrl: string;
98
+ /** final public URL to store as Application.iconUrl */
99
+ iconUrl: string;
100
+ fileKey: string;
101
+ expiresIn: number;
102
+ }
103
+
76
104
  export const TAXONOMY_V1_PACKAGE_NAME = "taxonomy.v1";
77
105
 
78
106
  export interface TaxonomyServiceClient {
@@ -85,6 +113,16 @@ export interface TaxonomyServiceClient {
85
113
  createCategory(request: CreateCategoryRequest): Observable<CategoryResponse>;
86
114
 
87
115
  createApplication(request: CreateApplicationRequest): Observable<ApplicationResponse>;
116
+
117
+ updateApplication(request: UpdateApplicationRequest): Observable<ApplicationResponse>;
118
+
119
+ /**
120
+ * Mint a presigned PUT URL for an application icon SVG (proxies upload-service,
121
+ * kind=ICON → public/icons/). Client PUTs the bytes to upload_url, then passes
122
+ * icon_url to Create/UpdateApplication.
123
+ */
124
+
125
+ createIconUploadUrl(request: CreateIconUploadUrlRequest): Observable<IconUploadUrlResponse>;
88
126
  }
89
127
 
90
128
  export interface TaxonomyServiceController {
@@ -105,6 +143,20 @@ export interface TaxonomyServiceController {
105
143
  createApplication(
106
144
  request: CreateApplicationRequest,
107
145
  ): Promise<ApplicationResponse> | Observable<ApplicationResponse> | ApplicationResponse;
146
+
147
+ updateApplication(
148
+ request: UpdateApplicationRequest,
149
+ ): Promise<ApplicationResponse> | Observable<ApplicationResponse> | ApplicationResponse;
150
+
151
+ /**
152
+ * Mint a presigned PUT URL for an application icon SVG (proxies upload-service,
153
+ * kind=ICON → public/icons/). Client PUTs the bytes to upload_url, then passes
154
+ * icon_url to Create/UpdateApplication.
155
+ */
156
+
157
+ createIconUploadUrl(
158
+ request: CreateIconUploadUrlRequest,
159
+ ): Promise<IconUploadUrlResponse> | Observable<IconUploadUrlResponse> | IconUploadUrlResponse;
108
160
  }
109
161
 
110
162
  export function TaxonomyServiceControllerMethods() {
@@ -115,6 +167,8 @@ export function TaxonomyServiceControllerMethods() {
115
167
  "findAllTags",
116
168
  "createCategory",
117
169
  "createApplication",
170
+ "updateApplication",
171
+ "createIconUploadUrl",
118
172
  ];
119
173
  for (const method of grpcMethods) {
120
174
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/gen/upload.ts CHANGED
@@ -21,6 +21,8 @@ export enum UploadKind {
21
21
  UPLOAD_KIND_MEDIA = 2,
22
22
  UPLOAD_KIND_AVATAR = 3,
23
23
  UPLOAD_KIND_BANNER = 4,
24
+ /** UPLOAD_KIND_ICON - taxonomy program/app brand icons → public/icons/ */
25
+ UPLOAD_KIND_ICON = 5,
24
26
  UNRECOGNIZED = -1,
25
27
  }
26
28
 
@@ -97,6 +99,8 @@ export interface CreateUploadUrlResponse {
97
99
  url: string;
98
100
  fileKey: string;
99
101
  expiresIn: number;
102
+ /** final object URL (only meaningful for public kinds) */
103
+ publicUrl: string;
100
104
  }
101
105
 
102
106
  export interface SignedUrlRequest {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aepstore-dev/contracts",
3
- "version": "1.26.0",
3
+ "version": "1.28.0",
4
4
  "description": "Protobuf definitions for aepstore microservices",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
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
+ }