@aepstore-dev/contracts 1.9.0 → 1.11.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/products.ts +2 -0
- package/gen/upload.ts +31 -0
- package/gen/users.ts +30 -0
- package/package.json +1 -1
- package/proto/products.proto +2 -0
- package/proto/upload.proto +15 -0
- package/proto/users.proto +18 -0
package/gen/products.ts
CHANGED
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
|
@@ -148,6 +148,8 @@ export interface UpdateUserRoleRequest {
|
|
|
148
148
|
adminId: string;
|
|
149
149
|
userId: string;
|
|
150
150
|
role: string;
|
|
151
|
+
/** "grant" (default) | "revoke" */
|
|
152
|
+
action: string;
|
|
151
153
|
}
|
|
152
154
|
|
|
153
155
|
export interface GetUsersRequest {
|
|
@@ -201,6 +203,20 @@ export interface GetUserFieldsResponse {
|
|
|
201
203
|
limit: number;
|
|
202
204
|
}
|
|
203
205
|
|
|
206
|
+
export interface SubscriptionRequest {
|
|
207
|
+
/** the authenticated user performing the action */
|
|
208
|
+
subscriberId: string;
|
|
209
|
+
/** the user being (un)subscribed to/from */
|
|
210
|
+
targetId: string;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export interface SubscriptionResponse {
|
|
214
|
+
/** state after the call */
|
|
215
|
+
subscribed: boolean;
|
|
216
|
+
/** target's subscriber count after the call */
|
|
217
|
+
subscribersCount: number;
|
|
218
|
+
}
|
|
219
|
+
|
|
204
220
|
export const USERS_V1_PACKAGE_NAME = "users.v1";
|
|
205
221
|
|
|
206
222
|
export interface UsersServiceClient {
|
|
@@ -219,6 +235,10 @@ export interface UsersServiceClient {
|
|
|
219
235
|
manageDevices(request: ManageDevicesRequest): Observable<ManageDevicesResponse>;
|
|
220
236
|
|
|
221
237
|
getUserFields(request: GetUserFieldsRequest): Observable<GetUserFieldsResponse>;
|
|
238
|
+
|
|
239
|
+
createSubscription(request: SubscriptionRequest): Observable<SubscriptionResponse>;
|
|
240
|
+
|
|
241
|
+
deleteSubscription(request: SubscriptionRequest): Observable<SubscriptionResponse>;
|
|
222
242
|
}
|
|
223
243
|
|
|
224
244
|
export interface UsersServiceController {
|
|
@@ -247,6 +267,14 @@ export interface UsersServiceController {
|
|
|
247
267
|
getUserFields(
|
|
248
268
|
request: GetUserFieldsRequest,
|
|
249
269
|
): Promise<GetUserFieldsResponse> | Observable<GetUserFieldsResponse> | GetUserFieldsResponse;
|
|
270
|
+
|
|
271
|
+
createSubscription(
|
|
272
|
+
request: SubscriptionRequest,
|
|
273
|
+
): Promise<SubscriptionResponse> | Observable<SubscriptionResponse> | SubscriptionResponse;
|
|
274
|
+
|
|
275
|
+
deleteSubscription(
|
|
276
|
+
request: SubscriptionRequest,
|
|
277
|
+
): Promise<SubscriptionResponse> | Observable<SubscriptionResponse> | SubscriptionResponse;
|
|
250
278
|
}
|
|
251
279
|
|
|
252
280
|
export function UsersServiceControllerMethods() {
|
|
@@ -260,6 +288,8 @@ export function UsersServiceControllerMethods() {
|
|
|
260
288
|
"getActiveDevices",
|
|
261
289
|
"manageDevices",
|
|
262
290
|
"getUserFields",
|
|
291
|
+
"createSubscription",
|
|
292
|
+
"deleteSubscription",
|
|
263
293
|
];
|
|
264
294
|
for (const method of grpcMethods) {
|
|
265
295
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
package/package.json
CHANGED
package/proto/products.proto
CHANGED
package/proto/upload.proto
CHANGED
|
@@ -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
|
// =================================================================
|
|
@@ -154,6 +157,7 @@ message UpdateUserRoleRequest {
|
|
|
154
157
|
string admin_id = 1;
|
|
155
158
|
string user_id = 2;
|
|
156
159
|
string role = 3;
|
|
160
|
+
string action = 4; // "grant" (default) | "revoke"
|
|
157
161
|
}
|
|
158
162
|
|
|
159
163
|
// =================================================================
|
|
@@ -225,3 +229,17 @@ message GetUserFieldsResponse {
|
|
|
225
229
|
int32 page = 6;
|
|
226
230
|
int32 limit = 7;
|
|
227
231
|
}
|
|
232
|
+
|
|
233
|
+
// =================================================================
|
|
234
|
+
// Subscriptions
|
|
235
|
+
// =================================================================
|
|
236
|
+
|
|
237
|
+
message SubscriptionRequest {
|
|
238
|
+
string subscriber_id = 1; // the authenticated user performing the action
|
|
239
|
+
string target_id = 2; // the user being (un)subscribed to/from
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
message SubscriptionResponse {
|
|
243
|
+
bool subscribed = 1; // state after the call
|
|
244
|
+
int32 subscribers_count = 2; // target's subscriber count after the call
|
|
245
|
+
}
|