jr-common-micro 1.1.78 → 1.1.79

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.
@@ -1,7 +1,7 @@
1
1
  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_pb.js";
2
2
  import { MethodKind } from "@bufbuild/protobuf";
3
3
  import { ByIdRequest, EmptyRequest, EmptyResponse, PaginateFromRequest, PaginateRequest } from "../general_pb.js";
4
- import { BetaCodePaginateResponse, BetaCodeSingleResponse, BetaCodeStoreRequest, BetaCodeUpdateRequest, ContactPaginationResponse, ContactRequest, ContactResponse, PreviewResponse, PublicUserPreviewResponse, UpdatePasswordRequest, UserAdminStoreRequest, UserPaginationResponse, UserSingleResponse, UserUpdateRequest } from "./user_messages_pb.js";
4
+ import { BetaCodePaginateResponse, BetaCodeSingleResponse, BetaCodeStoreRequest, BetaCodeUpdateRequest, ContactPaginationResponse, ContactRequest, ContactResponse, PreviewResponse, PublicUserPreviewResponse, UpdatePasswordRequest, UserAdminStoreRequest, UserBadgeSetRequest, UserBadgesResponse, UserPaginationResponse, UserSingleResponse, UserUpdateRequest } from "./user_messages_pb.js";
5
5
  import { SiteSettingsRequest, SiteSettingsResponse } from "./site_settings_messages_pb.js";
6
6
  import { AvatarPhotoResponse, AvatarPhotoSetRequest, ClaimUsernameRequest, FollowRequest, LikeRequest, ProfileByUsernameRequest, ProfileIdListResponse, ProfileListResponse, ProfilesByIdsRequest, ProfileSingleResponse, ProfileUpdateRequest, SearchProfilesRequest, UsernameAvailableRequest, UsernameAvailableResponse } from "./profile_messages_pb.js";
7
7
  import { RoleAdminStoreRequest, RoleAdminUpdateRequest, RolePaginationResponse, RoleSingleResponse } from "./authorization_messages_pb.js";
@@ -348,6 +348,18 @@ export declare const PUserAdminService: {
348
348
  readonly O: typeof UserSingleResponse;
349
349
  readonly kind: MethodKind.ServerStreaming;
350
350
  };
351
+ readonly badges: {
352
+ readonly name: "Badges";
353
+ readonly I: typeof ByIdRequest;
354
+ readonly O: typeof UserBadgesResponse;
355
+ readonly kind: MethodKind.ServerStreaming;
356
+ };
357
+ readonly setBadge: {
358
+ readonly name: "SetBadge";
359
+ readonly I: typeof UserBadgeSetRequest;
360
+ readonly O: typeof UserBadgesResponse;
361
+ readonly kind: MethodKind.ServerStreaming;
362
+ };
351
363
  };
352
364
  };
353
365
  export declare const PRoleAdminService: {
@@ -351,6 +351,18 @@ exports.PUserAdminService = {
351
351
  O: user_messages_pb_js_1.UserSingleResponse,
352
352
  kind: protobuf_1.MethodKind.ServerStreaming,
353
353
  },
354
+ badges: {
355
+ name: "Badges",
356
+ I: general_pb_js_1.ByIdRequest,
357
+ O: user_messages_pb_js_1.UserBadgesResponse,
358
+ kind: protobuf_1.MethodKind.ServerStreaming,
359
+ },
360
+ setBadge: {
361
+ name: "SetBadge",
362
+ I: user_messages_pb_js_1.UserBadgeSetRequest,
363
+ O: user_messages_pb_js_1.UserBadgesResponse,
364
+ kind: protobuf_1.MethodKind.ServerStreaming,
365
+ },
354
366
  }
355
367
  };
356
368
  exports.PRoleAdminService = {
@@ -5,7 +5,7 @@ import { AppleRequest, GoogleRequest, LoginRequest, LoginResponse, LostPasswordC
5
5
  import { RoleAdminStoreRequest, RoleAdminUpdateRequest, RolePaginationResponse, RoleSingleResponse } from "./authorization_messages_nest";
6
6
  import { AvatarPhotoResponse, AvatarPhotoSetRequest, ClaimUsernameRequest, FollowRequest, LikeRequest, ProfileByUsernameRequest, ProfileIdListResponse, ProfileListResponse, ProfilesByIdsRequest, ProfileSingleResponse, ProfileUpdateRequest, SearchProfilesRequest, UsernameAvailableRequest, UsernameAvailableResponse } from "./profile_messages_nest";
7
7
  import { SiteSettingsRequest, SiteSettingsResponse } from "./site_settings_messages_nest";
8
- import { BetaCodePaginateResponse, BetaCodeSingleResponse, BetaCodeStoreRequest, BetaCodeUpdateRequest, ContactPaginationResponse, ContactRequest, ContactResponse, PreviewResponse, PublicUserPreviewResponse, UpdatePasswordRequest, UserAdminStoreRequest, UserPaginationResponse, UserSingleResponse, UserUpdateRequest } from "./user_messages_nest";
8
+ import { BetaCodePaginateResponse, BetaCodeSingleResponse, BetaCodeStoreRequest, BetaCodeUpdateRequest, ContactPaginationResponse, ContactRequest, ContactResponse, PreviewResponse, PublicUserPreviewResponse, UpdatePasswordRequest, UserAdminStoreRequest, UserBadgeSetRequest, UserBadgesResponse, UserPaginationResponse, UserSingleResponse, UserUpdateRequest } from "./user_messages_nest";
9
9
  export declare const protobufPackage = "micro.v1.user";
10
10
  export declare const MICRO_V1_USER_PACKAGE_NAME = "micro.v1.user";
11
11
  export interface PAuthServiceClient {
@@ -148,6 +148,8 @@ export interface PUserAdminServiceClient {
148
148
  paginateFrom(request: PaginateFromRequest, metadata?: Metadata): Observable<UserPaginationResponse>;
149
149
  preview(request: ByIdRequest, metadata?: Metadata): Observable<PreviewResponse>;
150
150
  updateUser(request: UserUpdateRequest, metadata?: Metadata): Observable<UserSingleResponse>;
151
+ badges(request: ByIdRequest, metadata?: Metadata): Observable<UserBadgesResponse>;
152
+ setBadge(request: UserBadgeSetRequest, metadata?: Metadata): Observable<UserBadgesResponse>;
151
153
  }
152
154
  export interface PUserAdminServiceController {
153
155
  read(request: ByIdRequest, metadata?: Metadata): Observable<UserSingleResponse>;
@@ -159,6 +161,8 @@ export interface PUserAdminServiceController {
159
161
  paginateFrom(request: PaginateFromRequest, metadata?: Metadata): Observable<UserPaginationResponse>;
160
162
  preview(request: ByIdRequest, metadata?: Metadata): Observable<PreviewResponse>;
161
163
  updateUser(request: UserUpdateRequest, metadata?: Metadata): Observable<UserSingleResponse>;
164
+ badges(request: ByIdRequest, metadata?: Metadata): Observable<UserBadgesResponse>;
165
+ setBadge(request: UserBadgeSetRequest, metadata?: Metadata): Observable<UserBadgesResponse>;
162
166
  }
163
167
  export declare function PUserAdminServiceControllerMethods(): (constructor: Function) => void;
164
168
  export declare const P_USER_ADMIN_SERVICE_NAME = "PUserAdminService";
@@ -176,6 +176,8 @@ function PUserAdminServiceControllerMethods() {
176
176
  "paginateFrom",
177
177
  "preview",
178
178
  "updateUser",
179
+ "badges",
180
+ "setBadge",
179
181
  ];
180
182
  for (const method of grpcMethods) {
181
183
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
@@ -21,6 +21,16 @@ export interface UserDto {
21
21
  created_at: string;
22
22
  updated_at?: string | undefined;
23
23
  deleted_at?: string | undefined;
24
+ badges: string[];
25
+ }
26
+ export interface UserBadgeSetRequest {
27
+ user_id: string;
28
+ badge: string;
29
+ grant: boolean;
30
+ }
31
+ export interface UserBadgesResponse {
32
+ status: ResponseStatus | undefined;
33
+ badges: string[];
24
34
  }
25
35
  export interface UserProfileDto {
26
36
  id: string;
@@ -21,6 +21,7 @@ export declare class UserDto extends Message<UserDto> {
21
21
  createdAt: string;
22
22
  updatedAt?: string;
23
23
  deletedAt?: string;
24
+ badges: string[];
24
25
  constructor(data?: PartialMessage<UserDto>);
25
26
  static readonly runtime: typeof proto3;
26
27
  static readonly typeName = "micro.v1.user.UserDto";
@@ -30,6 +31,31 @@ export declare class UserDto extends Message<UserDto> {
30
31
  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): UserDto;
31
32
  static equals(a: UserDto | PlainMessage<UserDto> | undefined, b: UserDto | PlainMessage<UserDto> | undefined): boolean;
32
33
  }
34
+ export declare class UserBadgeSetRequest extends Message<UserBadgeSetRequest> {
35
+ userId: string;
36
+ badge: string;
37
+ grant: boolean;
38
+ constructor(data?: PartialMessage<UserBadgeSetRequest>);
39
+ static readonly runtime: typeof proto3;
40
+ static readonly typeName = "micro.v1.user.UserBadgeSetRequest";
41
+ static readonly fields: FieldList;
42
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): UserBadgeSetRequest;
43
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): UserBadgeSetRequest;
44
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): UserBadgeSetRequest;
45
+ static equals(a: UserBadgeSetRequest | PlainMessage<UserBadgeSetRequest> | undefined, b: UserBadgeSetRequest | PlainMessage<UserBadgeSetRequest> | undefined): boolean;
46
+ }
47
+ export declare class UserBadgesResponse extends Message<UserBadgesResponse> {
48
+ status?: ResponseStatus;
49
+ badges: string[];
50
+ constructor(data?: PartialMessage<UserBadgesResponse>);
51
+ static readonly runtime: typeof proto3;
52
+ static readonly typeName = "micro.v1.user.UserBadgesResponse";
53
+ static readonly fields: FieldList;
54
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): UserBadgesResponse;
55
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): UserBadgesResponse;
56
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): UserBadgesResponse;
57
+ static equals(a: UserBadgesResponse | PlainMessage<UserBadgesResponse> | undefined, b: UserBadgesResponse | PlainMessage<UserBadgesResponse> | undefined): boolean;
58
+ }
33
59
  export declare class UserProfileDto extends Message<UserProfileDto> {
34
60
  id: string;
35
61
  userId: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PublicUserPreviewResponse = exports.PublicUserPreviewDto = exports.removeUserDataRequest = exports.ContactDto = exports.ContactResponse = exports.ContactRequest = exports.BetaCodePaginateResponse = exports.BetaCodeUpdateRequest = exports.BetaCodeSingleResponse = exports.BetaCodeDto = exports.BetaCodeStoreRequest = exports.UserProfileAdminStoreRequest = exports.UserAdminStoreRequest = exports.PreviewResponse = exports.PreviewDto = exports.ContactPaginationResponse = exports.UserPaginationResponse = exports.UserSingleResponse = exports.UserUpdateRequest = exports.UpdatePasswordRequest = exports.UserStoreRequest = exports.UserProfileDto = exports.UserDto = exports.TfaSelectionEnum = void 0;
3
+ exports.PublicUserPreviewResponse = exports.PublicUserPreviewDto = exports.removeUserDataRequest = exports.ContactDto = exports.ContactResponse = exports.ContactRequest = exports.BetaCodePaginateResponse = exports.BetaCodeUpdateRequest = exports.BetaCodeSingleResponse = exports.BetaCodeDto = exports.BetaCodeStoreRequest = exports.UserProfileAdminStoreRequest = exports.UserAdminStoreRequest = exports.PreviewResponse = exports.PreviewDto = exports.ContactPaginationResponse = exports.UserPaginationResponse = exports.UserSingleResponse = exports.UserUpdateRequest = exports.UpdatePasswordRequest = exports.UserStoreRequest = exports.UserProfileDto = exports.UserBadgesResponse = exports.UserBadgeSetRequest = exports.UserDto = exports.TfaSelectionEnum = void 0;
4
4
  const protobuf_1 = require("@bufbuild/protobuf");
5
5
  const general_pb_js_1 = require("../general_pb.js");
6
6
  const authorization_messages_pb_js_1 = require("./authorization_messages_pb.js");
@@ -29,6 +29,7 @@ class UserDto extends protobuf_1.Message {
29
29
  createdAt = "";
30
30
  updatedAt;
31
31
  deletedAt;
32
+ badges = [];
32
33
  constructor(data) {
33
34
  super();
34
35
  protobuf_1.proto3.util.initPartial(data, this);
@@ -49,6 +50,7 @@ class UserDto extends protobuf_1.Message {
49
50
  { no: 11, name: "created_at", kind: "scalar", T: 9 },
50
51
  { no: 12, name: "updated_at", kind: "scalar", T: 9, opt: true },
51
52
  { no: 13, name: "deleted_at", kind: "scalar", T: 9, opt: true },
53
+ { no: 14, name: "badges", kind: "scalar", T: 9, repeated: true },
52
54
  ]);
53
55
  static fromBinary(bytes, options) {
54
56
  return new UserDto().fromBinary(bytes, options);
@@ -64,6 +66,62 @@ class UserDto extends protobuf_1.Message {
64
66
  }
65
67
  }
66
68
  exports.UserDto = UserDto;
69
+ class UserBadgeSetRequest extends protobuf_1.Message {
70
+ userId = "";
71
+ badge = "";
72
+ grant = false;
73
+ constructor(data) {
74
+ super();
75
+ protobuf_1.proto3.util.initPartial(data, this);
76
+ }
77
+ static runtime = protobuf_1.proto3;
78
+ static typeName = "micro.v1.user.UserBadgeSetRequest";
79
+ static fields = protobuf_1.proto3.util.newFieldList(() => [
80
+ { no: 1, name: "user_id", kind: "scalar", T: 9 },
81
+ { no: 2, name: "badge", kind: "scalar", T: 9 },
82
+ { no: 3, name: "grant", kind: "scalar", T: 8 },
83
+ ]);
84
+ static fromBinary(bytes, options) {
85
+ return new UserBadgeSetRequest().fromBinary(bytes, options);
86
+ }
87
+ static fromJson(jsonValue, options) {
88
+ return new UserBadgeSetRequest().fromJson(jsonValue, options);
89
+ }
90
+ static fromJsonString(jsonString, options) {
91
+ return new UserBadgeSetRequest().fromJsonString(jsonString, options);
92
+ }
93
+ static equals(a, b) {
94
+ return protobuf_1.proto3.util.equals(UserBadgeSetRequest, a, b);
95
+ }
96
+ }
97
+ exports.UserBadgeSetRequest = UserBadgeSetRequest;
98
+ class UserBadgesResponse extends protobuf_1.Message {
99
+ status;
100
+ badges = [];
101
+ constructor(data) {
102
+ super();
103
+ protobuf_1.proto3.util.initPartial(data, this);
104
+ }
105
+ static runtime = protobuf_1.proto3;
106
+ static typeName = "micro.v1.user.UserBadgesResponse";
107
+ static fields = protobuf_1.proto3.util.newFieldList(() => [
108
+ { no: 1, name: "status", kind: "message", T: general_pb_js_1.ResponseStatus },
109
+ { no: 2, name: "badges", kind: "scalar", T: 9, repeated: true },
110
+ ]);
111
+ static fromBinary(bytes, options) {
112
+ return new UserBadgesResponse().fromBinary(bytes, options);
113
+ }
114
+ static fromJson(jsonValue, options) {
115
+ return new UserBadgesResponse().fromJson(jsonValue, options);
116
+ }
117
+ static fromJsonString(jsonString, options) {
118
+ return new UserBadgesResponse().fromJsonString(jsonString, options);
119
+ }
120
+ static equals(a, b) {
121
+ return protobuf_1.proto3.util.equals(UserBadgesResponse, a, b);
122
+ }
123
+ }
124
+ exports.UserBadgesResponse = UserBadgesResponse;
67
125
  class UserProfileDto extends protobuf_1.Message {
68
126
  id = "";
69
127
  userId = "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jr-common-micro",
3
- "version": "1.1.78",
3
+ "version": "1.1.79",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -90,6 +90,8 @@ service PUserAdminService {
90
90
  rpc PaginateFrom(PaginateFromRequest) returns(stream UserPaginationResponse) {}
91
91
  rpc Preview(ByIdRequest) returns(stream PreviewResponse) {}
92
92
  rpc UpdateUser(UserUpdateRequest) returns(stream UserSingleResponse) {}
93
+ rpc Badges(ByIdRequest) returns(stream UserBadgesResponse) {}
94
+ rpc SetBadge(UserBadgeSetRequest) returns(stream UserBadgesResponse) {}
93
95
  }
94
96
 
95
97
  service PRoleAdminService {
@@ -29,6 +29,22 @@ message UserDto {
29
29
  string created_at = 11;
30
30
  optional string updated_at = 12;
31
31
  optional string deleted_at = 13;
32
+
33
+ // Active display badges (utils/badges catalogue).
34
+ repeated string badges = 14;
35
+ }
36
+
37
+ // Admin: grant (grant=true) or revoke a display badge. Only manually
38
+ // grantable badges are accepted (gold today; premium comes from plans).
39
+ message UserBadgeSetRequest {
40
+ string user_id = 1;
41
+ string badge = 2;
42
+ bool grant = 3;
43
+ }
44
+
45
+ message UserBadgesResponse {
46
+ ResponseStatus status = 1;
47
+ repeated string badges = 2;
32
48
  }
33
49
 
34
50
  enum TfaSelectionEnum { nothing = 0; sms = 1; authenticator = 2; }