@aepstore-dev/contracts 1.8.0 → 1.10.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.
@@ -3,6 +3,7 @@ export declare const PROTO_PATHS: {
3
3
  readonly AUTH: string;
4
4
  readonly MAIL: string;
5
5
  readonly PRODUCTS: string;
6
+ readonly SUPPORT: string;
6
7
  readonly TAXONOMY: string;
7
8
  readonly UPLOAD: string;
8
9
  readonly USERS: string;
@@ -12,6 +13,7 @@ export declare const PROTO_PACKAGES: {
12
13
  readonly AUTH: "auth.v1";
13
14
  readonly MAIL: "mail.v1";
14
15
  readonly PRODUCTS: "products.v1";
16
+ readonly SUPPORT: "support.v1";
15
17
  readonly TAXONOMY: "taxonomy.v1";
16
18
  readonly UPLOAD: "upload.v1";
17
19
  readonly USERS: "users.v1";
@@ -8,6 +8,7 @@ exports.PROTO_PATHS = {
8
8
  AUTH: (0, path_1.join)(PROTO_DIR, "auth.proto"),
9
9
  MAIL: (0, path_1.join)(PROTO_DIR, "mail.proto"),
10
10
  PRODUCTS: (0, path_1.join)(PROTO_DIR, "products.proto"),
11
+ SUPPORT: (0, path_1.join)(PROTO_DIR, "support.proto"),
11
12
  TAXONOMY: (0, path_1.join)(PROTO_DIR, "taxonomy.proto"),
12
13
  UPLOAD: (0, path_1.join)(PROTO_DIR, "upload.proto"),
13
14
  USERS: (0, path_1.join)(PROTO_DIR, "users.proto"),
@@ -17,6 +18,7 @@ exports.PROTO_PACKAGES = {
17
18
  AUTH: "auth.v1",
18
19
  MAIL: "mail.v1",
19
20
  PRODUCTS: "products.v1",
21
+ SUPPORT: "support.v1",
20
22
  TAXONOMY: "taxonomy.v1",
21
23
  UPLOAD: "upload.v1",
22
24
  USERS: "users.v1",
package/gen/products.ts CHANGED
@@ -161,6 +161,8 @@ export interface UpdateProductRequest {
161
161
  discountPercent: string;
162
162
  finalPrice: string;
163
163
  tags: string[];
164
+ categoryIds: string[];
165
+ applicationIds: string[];
164
166
  }
165
167
 
166
168
  export interface QueryProductsRequest {
package/gen/support.ts ADDED
@@ -0,0 +1,59 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.10.1
4
+ // protoc v7.35.0
5
+ // source: support.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "support.v1";
12
+
13
+ export interface PingRequest {
14
+ message: string;
15
+ }
16
+
17
+ export interface PingResponse {
18
+ ok: boolean;
19
+ message: string;
20
+ }
21
+
22
+ export const SUPPORT_V1_PACKAGE_NAME = "support.v1";
23
+
24
+ /**
25
+ * Placeholder service. Legacy support-service was an empty stub; this keeps a
26
+ * valid gRPC contract so the service boots and is ready to grow into a tickets
27
+ * API later. Replace Ping with real RPCs when support functionality is built.
28
+ */
29
+
30
+ export interface SupportServiceClient {
31
+ ping(request: PingRequest): Observable<PingResponse>;
32
+ }
33
+
34
+ /**
35
+ * Placeholder service. Legacy support-service was an empty stub; this keeps a
36
+ * valid gRPC contract so the service boots and is ready to grow into a tickets
37
+ * API later. Replace Ping with real RPCs when support functionality is built.
38
+ */
39
+
40
+ export interface SupportServiceController {
41
+ ping(request: PingRequest): Promise<PingResponse> | Observable<PingResponse> | PingResponse;
42
+ }
43
+
44
+ export function SupportServiceControllerMethods() {
45
+ return function (constructor: Function) {
46
+ const grpcMethods: string[] = ["ping"];
47
+ for (const method of grpcMethods) {
48
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
49
+ GrpcMethod("SupportService", method)(constructor.prototype[method], method, descriptor);
50
+ }
51
+ const grpcStreamMethods: string[] = [];
52
+ for (const method of grpcStreamMethods) {
53
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
54
+ GrpcStreamMethod("SupportService", method)(constructor.prototype[method], method, descriptor);
55
+ }
56
+ };
57
+ }
58
+
59
+ export const SUPPORT_SERVICE_NAME = "SupportService";
package/gen/upload.ts CHANGED
@@ -112,6 +112,18 @@ export interface SignedUrlResponse {
112
112
  expiresIn: number;
113
113
  }
114
114
 
115
+ export interface HeadObjectRequest {
116
+ fileKey: string;
117
+ }
118
+
119
+ export interface HeadObjectResponse {
120
+ /** false only when the object is definitively absent (404) */
121
+ exists: boolean;
122
+ /** bytes (0 when absent) */
123
+ size: number;
124
+ contentType: string;
125
+ }
126
+
115
127
  export interface DeleteObjectRequest {
116
128
  fileKey: string;
117
129
  }
@@ -146,6 +158,14 @@ export interface UploadServiceClient {
146
158
 
147
159
  generateSignedUrl(request: SignedUrlRequest): Observable<SignedUrlResponse>;
148
160
 
161
+ /**
162
+ * Verify an object actually exists (and read its size/type). Used by
163
+ * products-service to confirm a client-echoed fileKey points at a real
164
+ * uploaded object before persisting attachment metadata.
165
+ */
166
+
167
+ headObject(request: HeadObjectRequest): Observable<HeadObjectResponse>;
168
+
149
169
  deleteObject(request: DeleteObjectRequest): Observable<Ok>;
150
170
  }
151
171
 
@@ -188,6 +208,16 @@ export interface UploadServiceController {
188
208
  request: SignedUrlRequest,
189
209
  ): Promise<SignedUrlResponse> | Observable<SignedUrlResponse> | SignedUrlResponse;
190
210
 
211
+ /**
212
+ * Verify an object actually exists (and read its size/type). Used by
213
+ * products-service to confirm a client-echoed fileKey points at a real
214
+ * uploaded object before persisting attachment metadata.
215
+ */
216
+
217
+ headObject(
218
+ request: HeadObjectRequest,
219
+ ): Promise<HeadObjectResponse> | Observable<HeadObjectResponse> | HeadObjectResponse;
220
+
191
221
  deleteObject(request: DeleteObjectRequest): Promise<Ok> | Observable<Ok> | Ok;
192
222
  }
193
223
 
@@ -200,6 +230,7 @@ export function UploadServiceControllerMethods() {
200
230
  "abortMultipartUpload",
201
231
  "createUploadUrl",
202
232
  "generateSignedUrl",
233
+ "headObject",
203
234
  "deleteObject",
204
235
  ];
205
236
  for (const method of grpcMethods) {
package/gen/users.ts CHANGED
@@ -201,6 +201,20 @@ export interface GetUserFieldsResponse {
201
201
  limit: number;
202
202
  }
203
203
 
204
+ export interface SubscriptionRequest {
205
+ /** the authenticated user performing the action */
206
+ subscriberId: string;
207
+ /** the user being (un)subscribed to/from */
208
+ targetId: string;
209
+ }
210
+
211
+ export interface SubscriptionResponse {
212
+ /** state after the call */
213
+ subscribed: boolean;
214
+ /** target's subscriber count after the call */
215
+ subscribersCount: number;
216
+ }
217
+
204
218
  export const USERS_V1_PACKAGE_NAME = "users.v1";
205
219
 
206
220
  export interface UsersServiceClient {
@@ -219,6 +233,10 @@ export interface UsersServiceClient {
219
233
  manageDevices(request: ManageDevicesRequest): Observable<ManageDevicesResponse>;
220
234
 
221
235
  getUserFields(request: GetUserFieldsRequest): Observable<GetUserFieldsResponse>;
236
+
237
+ createSubscription(request: SubscriptionRequest): Observable<SubscriptionResponse>;
238
+
239
+ deleteSubscription(request: SubscriptionRequest): Observable<SubscriptionResponse>;
222
240
  }
223
241
 
224
242
  export interface UsersServiceController {
@@ -247,6 +265,14 @@ export interface UsersServiceController {
247
265
  getUserFields(
248
266
  request: GetUserFieldsRequest,
249
267
  ): Promise<GetUserFieldsResponse> | Observable<GetUserFieldsResponse> | GetUserFieldsResponse;
268
+
269
+ createSubscription(
270
+ request: SubscriptionRequest,
271
+ ): Promise<SubscriptionResponse> | Observable<SubscriptionResponse> | SubscriptionResponse;
272
+
273
+ deleteSubscription(
274
+ request: SubscriptionRequest,
275
+ ): Promise<SubscriptionResponse> | Observable<SubscriptionResponse> | SubscriptionResponse;
250
276
  }
251
277
 
252
278
  export function UsersServiceControllerMethods() {
@@ -260,6 +286,8 @@ export function UsersServiceControllerMethods() {
260
286
  "getActiveDevices",
261
287
  "manageDevices",
262
288
  "getUserFields",
289
+ "createSubscription",
290
+ "deleteSubscription",
263
291
  ];
264
292
  for (const method of grpcMethods) {
265
293
  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.8.0",
3
+ "version": "1.10.0",
4
4
  "description": "Protobuf definitions for aepstore microservices",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -183,6 +183,8 @@ message UpdateProductRequest {
183
183
  string discount_percent = 6;
184
184
  string final_price = 7;
185
185
  repeated string tags = 8;
186
+ repeated string category_ids = 9;
187
+ repeated string application_ids = 10;
186
188
  }
187
189
 
188
190
  message QueryProductsRequest {
@@ -0,0 +1,19 @@
1
+ syntax = "proto3";
2
+
3
+ package support.v1;
4
+
5
+ // Placeholder service. Legacy support-service was an empty stub; this keeps a
6
+ // valid gRPC contract so the service boots and is ready to grow into a tickets
7
+ // API later. Replace Ping with real RPCs when support functionality is built.
8
+ service SupportService {
9
+ rpc Ping(PingRequest) returns (PingResponse);
10
+ }
11
+
12
+ message PingRequest {
13
+ string message = 1;
14
+ }
15
+
16
+ message PingResponse {
17
+ bool ok = 1;
18
+ string message = 2;
19
+ }
@@ -24,6 +24,11 @@ service UploadService {
24
24
 
25
25
  rpc GenerateSignedUrl(SignedUrlRequest) returns (SignedUrlResponse);
26
26
 
27
+ // Verify an object actually exists (and read its size/type). Used by
28
+ // products-service to confirm a client-echoed fileKey points at a real
29
+ // uploaded object before persisting attachment metadata.
30
+ rpc HeadObject(HeadObjectRequest) returns (HeadObjectResponse);
31
+
27
32
  rpc DeleteObject(DeleteObjectRequest) returns (Ok);
28
33
  }
29
34
 
@@ -126,6 +131,16 @@ message SignedUrlResponse {
126
131
  int32 expires_in = 2;
127
132
  }
128
133
 
134
+ message HeadObjectRequest {
135
+ string file_key = 1;
136
+ }
137
+
138
+ message HeadObjectResponse {
139
+ bool exists = 1; // false only when the object is definitively absent (404)
140
+ double size = 2; // bytes (0 when absent)
141
+ string content_type = 3;
142
+ }
143
+
129
144
  // ---------------------------------------------------------------------------
130
145
  // Cleanup
131
146
  // ---------------------------------------------------------------------------
package/proto/users.proto CHANGED
@@ -11,6 +11,9 @@ service UsersService {
11
11
  rpc GetActiveDevices(GetActiveDevicesRequest) returns (GetActiveDevicesResponse);
12
12
  rpc ManageDevices(ManageDevicesRequest) returns (ManageDevicesResponse);
13
13
  rpc GetUserFields(GetUserFieldsRequest) returns (GetUserFieldsResponse);
14
+
15
+ rpc CreateSubscription(SubscriptionRequest) returns (SubscriptionResponse);
16
+ rpc DeleteSubscription(SubscriptionRequest) returns (SubscriptionResponse);
14
17
  }
15
18
 
16
19
  // =================================================================
@@ -225,3 +228,17 @@ message GetUserFieldsResponse {
225
228
  int32 page = 6;
226
229
  int32 limit = 7;
227
230
  }
231
+
232
+ // =================================================================
233
+ // Subscriptions
234
+ // =================================================================
235
+
236
+ message SubscriptionRequest {
237
+ string subscriber_id = 1; // the authenticated user performing the action
238
+ string target_id = 2; // the user being (un)subscribed to/from
239
+ }
240
+
241
+ message SubscriptionResponse {
242
+ bool subscribed = 1; // state after the call
243
+ int32 subscribers_count = 2; // target's subscriber count after the call
244
+ }