jr-common-micro 1.1.53 → 1.1.54

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.
@@ -65,4 +65,13 @@ export interface ProfileListResponse {
65
65
  pagination: PaginationMetaResult | undefined;
66
66
  data: ProfileListItemDto[];
67
67
  }
68
+ export interface AvatarPhotoSetRequest {
69
+ data: Buffer;
70
+ mimetype: string;
71
+ }
72
+ export interface AvatarPhotoResponse {
73
+ status: ResponseStatus | undefined;
74
+ data: Buffer;
75
+ mimetype: string;
76
+ }
68
77
  export declare const MICRO_V1_USER_PACKAGE_NAME = "micro.v1.user";
@@ -162,3 +162,28 @@ export declare class ProfileListResponse extends Message<ProfileListResponse> {
162
162
  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ProfileListResponse;
163
163
  static equals(a: ProfileListResponse | PlainMessage<ProfileListResponse> | undefined, b: ProfileListResponse | PlainMessage<ProfileListResponse> | undefined): boolean;
164
164
  }
165
+ export declare class AvatarPhotoSetRequest extends Message<AvatarPhotoSetRequest> {
166
+ data: Uint8Array<ArrayBuffer>;
167
+ mimetype: string;
168
+ constructor(data?: PartialMessage<AvatarPhotoSetRequest>);
169
+ static readonly runtime: typeof proto3;
170
+ static readonly typeName = "micro.v1.user.AvatarPhotoSetRequest";
171
+ static readonly fields: FieldList;
172
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AvatarPhotoSetRequest;
173
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): AvatarPhotoSetRequest;
174
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AvatarPhotoSetRequest;
175
+ static equals(a: AvatarPhotoSetRequest | PlainMessage<AvatarPhotoSetRequest> | undefined, b: AvatarPhotoSetRequest | PlainMessage<AvatarPhotoSetRequest> | undefined): boolean;
176
+ }
177
+ export declare class AvatarPhotoResponse extends Message<AvatarPhotoResponse> {
178
+ status?: ResponseStatus;
179
+ data: Uint8Array<ArrayBuffer>;
180
+ mimetype: string;
181
+ constructor(data?: PartialMessage<AvatarPhotoResponse>);
182
+ static readonly runtime: typeof proto3;
183
+ static readonly typeName = "micro.v1.user.AvatarPhotoResponse";
184
+ static readonly fields: FieldList;
185
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AvatarPhotoResponse;
186
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): AvatarPhotoResponse;
187
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AvatarPhotoResponse;
188
+ static equals(a: AvatarPhotoResponse | PlainMessage<AvatarPhotoResponse> | undefined, b: AvatarPhotoResponse | PlainMessage<AvatarPhotoResponse> | undefined): boolean;
189
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProfileListResponse = exports.ProfilesByIdsRequest = exports.ProfileListItemDto = exports.LikeRequest = exports.FollowRequest = exports.ProfileSingleResponse = exports.ProfileByUsernameRequest = exports.ProfileUpdateRequest = exports.ClaimUsernameRequest = exports.UsernameAvailableResponse = exports.UsernameAvailableRequest = exports.ProfileDto = void 0;
3
+ exports.AvatarPhotoResponse = exports.AvatarPhotoSetRequest = exports.ProfileListResponse = exports.ProfilesByIdsRequest = exports.ProfileListItemDto = exports.LikeRequest = exports.FollowRequest = exports.ProfileSingleResponse = exports.ProfileByUsernameRequest = exports.ProfileUpdateRequest = exports.ClaimUsernameRequest = exports.UsernameAvailableResponse = exports.UsernameAvailableRequest = exports.ProfileDto = void 0;
4
4
  const protobuf_1 = require("@bufbuild/protobuf");
5
5
  const general_pb_js_1 = require("../general_pb.js");
6
6
  class ProfileDto extends protobuf_1.Message {
@@ -361,3 +361,59 @@ class ProfileListResponse extends protobuf_1.Message {
361
361
  }
362
362
  }
363
363
  exports.ProfileListResponse = ProfileListResponse;
364
+ class AvatarPhotoSetRequest extends protobuf_1.Message {
365
+ data = new Uint8Array(0);
366
+ mimetype = "";
367
+ constructor(data) {
368
+ super();
369
+ protobuf_1.proto3.util.initPartial(data, this);
370
+ }
371
+ static runtime = protobuf_1.proto3;
372
+ static typeName = "micro.v1.user.AvatarPhotoSetRequest";
373
+ static fields = protobuf_1.proto3.util.newFieldList(() => [
374
+ { no: 1, name: "data", kind: "scalar", T: 12 },
375
+ { no: 2, name: "mimetype", kind: "scalar", T: 9 },
376
+ ]);
377
+ static fromBinary(bytes, options) {
378
+ return new AvatarPhotoSetRequest().fromBinary(bytes, options);
379
+ }
380
+ static fromJson(jsonValue, options) {
381
+ return new AvatarPhotoSetRequest().fromJson(jsonValue, options);
382
+ }
383
+ static fromJsonString(jsonString, options) {
384
+ return new AvatarPhotoSetRequest().fromJsonString(jsonString, options);
385
+ }
386
+ static equals(a, b) {
387
+ return protobuf_1.proto3.util.equals(AvatarPhotoSetRequest, a, b);
388
+ }
389
+ }
390
+ exports.AvatarPhotoSetRequest = AvatarPhotoSetRequest;
391
+ class AvatarPhotoResponse extends protobuf_1.Message {
392
+ status;
393
+ data = new Uint8Array(0);
394
+ mimetype = "";
395
+ constructor(data) {
396
+ super();
397
+ protobuf_1.proto3.util.initPartial(data, this);
398
+ }
399
+ static runtime = protobuf_1.proto3;
400
+ static typeName = "micro.v1.user.AvatarPhotoResponse";
401
+ static fields = protobuf_1.proto3.util.newFieldList(() => [
402
+ { no: 1, name: "status", kind: "message", T: general_pb_js_1.ResponseStatus },
403
+ { no: 2, name: "data", kind: "scalar", T: 12 },
404
+ { no: 3, name: "mimetype", kind: "scalar", T: 9 },
405
+ ]);
406
+ static fromBinary(bytes, options) {
407
+ return new AvatarPhotoResponse().fromBinary(bytes, options);
408
+ }
409
+ static fromJson(jsonValue, options) {
410
+ return new AvatarPhotoResponse().fromJson(jsonValue, options);
411
+ }
412
+ static fromJsonString(jsonString, options) {
413
+ return new AvatarPhotoResponse().fromJsonString(jsonString, options);
414
+ }
415
+ static equals(a, b) {
416
+ return protobuf_1.proto3.util.equals(AvatarPhotoResponse, a, b);
417
+ }
418
+ }
419
+ exports.AvatarPhotoResponse = AvatarPhotoResponse;
@@ -3,7 +3,7 @@ import { MethodKind } from "@bufbuild/protobuf";
3
3
  import { ByIdRequest, EmptyRequest, EmptyResponse, PaginateFromRequest, PaginateRequest } from "../general_pb.js";
4
4
  import { BetaCodePaginateResponse, BetaCodeSingleResponse, BetaCodeStoreRequest, BetaCodeUpdateRequest, ContactPaginationResponse, ContactRequest, ContactResponse, PreviewResponse, PublicUserPreviewResponse, UpdatePasswordRequest, UserAdminStoreRequest, UserPaginationResponse, UserSingleResponse, UserUpdateRequest } from "./user_messages_pb.js";
5
5
  import { SiteSettingsRequest, SiteSettingsResponse } from "./site_settings_messages_pb.js";
6
- import { ClaimUsernameRequest, FollowRequest, LikeRequest, ProfileByUsernameRequest, ProfileListResponse, ProfilesByIdsRequest, ProfileSingleResponse, ProfileUpdateRequest, UsernameAvailableRequest, UsernameAvailableResponse } from "./profile_messages_pb.js";
6
+ import { AvatarPhotoResponse, AvatarPhotoSetRequest, ClaimUsernameRequest, FollowRequest, LikeRequest, ProfileByUsernameRequest, ProfileListResponse, ProfilesByIdsRequest, ProfileSingleResponse, ProfileUpdateRequest, UsernameAvailableRequest, UsernameAvailableResponse } from "./profile_messages_pb.js";
7
7
  import { RoleAdminStoreRequest, RoleAdminUpdateRequest, RolePaginationResponse, RoleSingleResponse } from "./authorization_messages_pb.js";
8
8
  export declare const PAuthService: {
9
9
  readonly typeName: "micro.v1.user.PAuthService";
@@ -205,6 +205,24 @@ export declare const PProfileService: {
205
205
  readonly O: typeof ProfileSingleResponse;
206
206
  readonly kind: MethodKind.ServerStreaming;
207
207
  };
208
+ readonly setAvatarPhoto: {
209
+ readonly name: "SetAvatarPhoto";
210
+ readonly I: typeof AvatarPhotoSetRequest;
211
+ readonly O: typeof EmptyResponse;
212
+ readonly kind: MethodKind.ServerStreaming;
213
+ };
214
+ readonly getAvatarPhoto: {
215
+ readonly name: "GetAvatarPhoto";
216
+ readonly I: typeof ByIdRequest;
217
+ readonly O: typeof AvatarPhotoResponse;
218
+ readonly kind: MethodKind.ServerStreaming;
219
+ };
220
+ readonly deleteAvatarPhoto: {
221
+ readonly name: "DeleteAvatarPhoto";
222
+ readonly I: typeof EmptyRequest;
223
+ readonly O: typeof EmptyResponse;
224
+ readonly kind: MethodKind.ServerStreaming;
225
+ };
208
226
  readonly myProfile: {
209
227
  readonly name: "MyProfile";
210
228
  readonly I: typeof EmptyRequest;
@@ -208,6 +208,24 @@ exports.PProfileService = {
208
208
  O: profile_messages_pb_js_1.ProfileSingleResponse,
209
209
  kind: protobuf_1.MethodKind.ServerStreaming,
210
210
  },
211
+ setAvatarPhoto: {
212
+ name: "SetAvatarPhoto",
213
+ I: profile_messages_pb_js_1.AvatarPhotoSetRequest,
214
+ O: general_pb_js_1.EmptyResponse,
215
+ kind: protobuf_1.MethodKind.ServerStreaming,
216
+ },
217
+ getAvatarPhoto: {
218
+ name: "GetAvatarPhoto",
219
+ I: general_pb_js_1.ByIdRequest,
220
+ O: profile_messages_pb_js_1.AvatarPhotoResponse,
221
+ kind: protobuf_1.MethodKind.ServerStreaming,
222
+ },
223
+ deleteAvatarPhoto: {
224
+ name: "DeleteAvatarPhoto",
225
+ I: general_pb_js_1.EmptyRequest,
226
+ O: general_pb_js_1.EmptyResponse,
227
+ kind: protobuf_1.MethodKind.ServerStreaming,
228
+ },
211
229
  myProfile: {
212
230
  name: "MyProfile",
213
231
  I: general_pb_js_1.EmptyRequest,
@@ -3,7 +3,7 @@ import { Observable } from "rxjs";
3
3
  import { ByIdRequest, EmptyRequest, EmptyResponse, PaginateFromRequest, PaginateRequest } from "../general_nest";
4
4
  import { AppleRequest, GoogleRequest, LoginRequest, LoginResponse, LostPasswordChangePasswordRequest, LostPasswordChangePasswordResponse, LostPasswordHashCheckRequest, LostPasswordHashCheckResponse, LostPasswordStartRequest, LostPasswordStartResponse, RegisterRequest, RegisterResponse, RemoveUserDataRequest, ResendVerificationEmailRequest, ResendVerificationEmailResponse, TfaRequest, TfaResponse, UserVerificationRequest, UserVerificationResponse, VerifyTokenRequest, VerifyTokenResponse } from "./auth_messages_nest";
5
5
  import { RoleAdminStoreRequest, RoleAdminUpdateRequest, RolePaginationResponse, RoleSingleResponse } from "./authorization_messages_nest";
6
- import { ClaimUsernameRequest, FollowRequest, LikeRequest, ProfileByUsernameRequest, ProfileListResponse, ProfilesByIdsRequest, ProfileSingleResponse, ProfileUpdateRequest, UsernameAvailableRequest, UsernameAvailableResponse } from "./profile_messages_nest";
6
+ import { AvatarPhotoResponse, AvatarPhotoSetRequest, ClaimUsernameRequest, FollowRequest, LikeRequest, ProfileByUsernameRequest, ProfileListResponse, ProfilesByIdsRequest, ProfileSingleResponse, ProfileUpdateRequest, UsernameAvailableRequest, UsernameAvailableResponse } from "./profile_messages_nest";
7
7
  import { SiteSettingsRequest, SiteSettingsResponse } from "./site_settings_messages_nest";
8
8
  import { BetaCodePaginateResponse, BetaCodeSingleResponse, BetaCodeStoreRequest, BetaCodeUpdateRequest, ContactPaginationResponse, ContactRequest, ContactResponse, PreviewResponse, PublicUserPreviewResponse, UpdatePasswordRequest, UserAdminStoreRequest, UserPaginationResponse, UserSingleResponse, UserUpdateRequest } from "./user_messages_nest";
9
9
  export declare const protobufPackage = "micro.v1.user";
@@ -103,6 +103,9 @@ export declare const P_USER_EXIST_SERVICE_NAME = "PUserExistService";
103
103
  export interface PProfileServiceClient {
104
104
  usernameAvailable(request: UsernameAvailableRequest, metadata?: Metadata): Observable<UsernameAvailableResponse>;
105
105
  claimUsername(request: ClaimUsernameRequest, metadata?: Metadata): Observable<ProfileSingleResponse>;
106
+ setAvatarPhoto(request: AvatarPhotoSetRequest, metadata?: Metadata): Observable<EmptyResponse>;
107
+ getAvatarPhoto(request: ByIdRequest, metadata?: Metadata): Observable<AvatarPhotoResponse>;
108
+ deleteAvatarPhoto(request: EmptyRequest, metadata?: Metadata): Observable<EmptyResponse>;
106
109
  myProfile(request: EmptyRequest, metadata?: Metadata): Observable<ProfileSingleResponse>;
107
110
  updateProfile(request: ProfileUpdateRequest, metadata?: Metadata): Observable<ProfileSingleResponse>;
108
111
  publicProfile(request: ProfileByUsernameRequest, metadata?: Metadata): Observable<ProfileSingleResponse>;
@@ -117,6 +120,9 @@ export interface PProfileServiceClient {
117
120
  export interface PProfileServiceController {
118
121
  usernameAvailable(request: UsernameAvailableRequest, metadata?: Metadata): Observable<UsernameAvailableResponse>;
119
122
  claimUsername(request: ClaimUsernameRequest, metadata?: Metadata): Observable<ProfileSingleResponse>;
123
+ setAvatarPhoto(request: AvatarPhotoSetRequest, metadata?: Metadata): Observable<EmptyResponse>;
124
+ getAvatarPhoto(request: ByIdRequest, metadata?: Metadata): Observable<AvatarPhotoResponse>;
125
+ deleteAvatarPhoto(request: EmptyRequest, metadata?: Metadata): Observable<EmptyResponse>;
120
126
  myProfile(request: EmptyRequest, metadata?: Metadata): Observable<ProfileSingleResponse>;
121
127
  updateProfile(request: ProfileUpdateRequest, metadata?: Metadata): Observable<ProfileSingleResponse>;
122
128
  publicProfile(request: ProfileByUsernameRequest, metadata?: Metadata): Observable<ProfileSingleResponse>;
@@ -137,6 +137,9 @@ function PProfileServiceControllerMethods() {
137
137
  const grpcMethods = [
138
138
  "usernameAvailable",
139
139
  "claimUsername",
140
+ "setAvatarPhoto",
141
+ "getAvatarPhoto",
142
+ "deleteAvatarPhoto",
140
143
  "myProfile",
141
144
  "updateProfile",
142
145
  "publicProfile",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jr-common-micro",
3
- "version": "1.1.53",
3
+ "version": "1.1.54",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -83,3 +83,15 @@ message ProfileListResponse {
83
83
  PaginationMetaResult pagination = 2;
84
84
  repeated ProfileListItemDto data = 3;
85
85
  }
86
+
87
+ // Raw profile photo bytes (server resizes to 512px JPEG on upload).
88
+ message AvatarPhotoSetRequest {
89
+ bytes data = 1;
90
+ string mimetype = 2;
91
+ }
92
+
93
+ message AvatarPhotoResponse {
94
+ ResponseStatus status = 1;
95
+ bytes data = 2;
96
+ string mimetype = 3;
97
+ }
@@ -62,6 +62,9 @@ service PUserExistService {
62
62
  service PProfileService {
63
63
  rpc UsernameAvailable(UsernameAvailableRequest) returns(stream UsernameAvailableResponse) {}
64
64
  rpc ClaimUsername(ClaimUsernameRequest) returns(stream ProfileSingleResponse) {}
65
+ rpc SetAvatarPhoto(AvatarPhotoSetRequest) returns(stream EmptyResponse) {}
66
+ rpc GetAvatarPhoto(ByIdRequest) returns(stream AvatarPhotoResponse) {}
67
+ rpc DeleteAvatarPhoto(EmptyRequest) returns(stream EmptyResponse) {}
65
68
  rpc MyProfile(EmptyRequest) returns(stream ProfileSingleResponse) {}
66
69
  rpc UpdateProfile(ProfileUpdateRequest) returns(stream ProfileSingleResponse) {}
67
70
  rpc PublicProfile(ProfileByUsernameRequest) returns(stream ProfileSingleResponse) {}