@aepstore-dev/contracts 1.27.0 → 1.29.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
@@ -86,6 +86,21 @@ export interface ApplicationResponse {
86
86
  application: Application | undefined;
87
87
  }
88
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
+
89
104
  export const TAXONOMY_V1_PACKAGE_NAME = "taxonomy.v1";
90
105
 
91
106
  export interface TaxonomyServiceClient {
@@ -100,6 +115,14 @@ export interface TaxonomyServiceClient {
100
115
  createApplication(request: CreateApplicationRequest): Observable<ApplicationResponse>;
101
116
 
102
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>;
103
126
  }
104
127
 
105
128
  export interface TaxonomyServiceController {
@@ -124,6 +147,16 @@ export interface TaxonomyServiceController {
124
147
  updateApplication(
125
148
  request: UpdateApplicationRequest,
126
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;
127
160
  }
128
161
 
129
162
  export function TaxonomyServiceControllerMethods() {
@@ -135,6 +168,7 @@ export function TaxonomyServiceControllerMethods() {
135
168
  "createCategory",
136
169
  "createApplication",
137
170
  "updateApplication",
171
+ "createIconUploadUrl",
138
172
  ];
139
173
  for (const method of grpcMethods) {
140
174
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/gen/upload.ts CHANGED
@@ -21,9 +21,29 @@ 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
 
29
+ export interface ListObjectsRequest {
30
+ prefix: string;
31
+ /** empty for the first page */
32
+ continuationToken: string;
33
+ }
34
+
35
+ export interface StoredObject {
36
+ key: string;
37
+ /** ISO 8601 */
38
+ lastModified: string;
39
+ }
40
+
41
+ export interface ListObjectsResponse {
42
+ objects: StoredObject[];
43
+ /** empty when there are no more pages */
44
+ nextContinuationToken: string;
45
+ }
46
+
27
47
  export interface Ok {
28
48
  ok: boolean;
29
49
  }
@@ -97,6 +117,8 @@ export interface CreateUploadUrlResponse {
97
117
  url: string;
98
118
  fileKey: string;
99
119
  expiresIn: number;
120
+ /** final object URL (only meaningful for public kinds) */
121
+ publicUrl: string;
100
122
  }
101
123
 
102
124
  export interface SignedUrlRequest {
@@ -167,6 +189,13 @@ export interface UploadServiceClient {
167
189
  headObject(request: HeadObjectRequest): Observable<HeadObjectResponse>;
168
190
 
169
191
  deleteObject(request: DeleteObjectRequest): Observable<Ok>;
192
+
193
+ /**
194
+ * List objects under a prefix (paginated) — for GC/reconciliation jobs
195
+ * (e.g. tasks-service sweeping orphaned uploads). Not for user traffic.
196
+ */
197
+
198
+ listObjects(request: ListObjectsRequest): Observable<ListObjectsResponse>;
170
199
  }
171
200
 
172
201
  /**
@@ -219,6 +248,15 @@ export interface UploadServiceController {
219
248
  ): Promise<HeadObjectResponse> | Observable<HeadObjectResponse> | HeadObjectResponse;
220
249
 
221
250
  deleteObject(request: DeleteObjectRequest): Promise<Ok> | Observable<Ok> | Ok;
251
+
252
+ /**
253
+ * List objects under a prefix (paginated) — for GC/reconciliation jobs
254
+ * (e.g. tasks-service sweeping orphaned uploads). Not for user traffic.
255
+ */
256
+
257
+ listObjects(
258
+ request: ListObjectsRequest,
259
+ ): Promise<ListObjectsResponse> | Observable<ListObjectsResponse> | ListObjectsResponse;
222
260
  }
223
261
 
224
262
  export function UploadServiceControllerMethods() {
@@ -232,6 +270,7 @@ export function UploadServiceControllerMethods() {
232
270
  "generateSignedUrl",
233
271
  "headObject",
234
272
  "deleteObject",
273
+ "listObjects",
235
274
  ];
236
275
  for (const method of grpcMethods) {
237
276
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aepstore-dev/contracts",
3
- "version": "1.27.0",
3
+ "version": "1.29.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
+ }