jr-common-micro 1.1.95 → 1.1.97

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.
Files changed (38) hide show
  1. package/dist/proto/micro/v1/index.d.ts +2 -0
  2. package/dist/proto/micro/v1/index.js +3 -1
  3. package/dist/proto/micro/v1/mining/index.d.ts +3 -0
  4. package/dist/proto/micro/v1/mining/index.js +7 -0
  5. package/dist/proto/micro/v1/mining/mining_messages_nest.d.ts +270 -0
  6. package/dist/proto/micro/v1/mining/mining_messages_nest.js +5 -0
  7. package/dist/proto/micro/v1/mining/mining_messages_pb.d.ts +582 -0
  8. package/dist/proto/micro/v1/mining/mining_messages_pb.js +1280 -0
  9. package/dist/proto/micro/v1/mining/services_connect.d.ts +116 -0
  10. package/dist/proto/micro/v1/mining/services_connect.js +119 -0
  11. package/dist/proto/micro/v1/mining/services_nest.d.ts +48 -0
  12. package/dist/proto/micro/v1/mining/services_nest.js +41 -0
  13. package/dist/proto/micro/v1/notification/notification_messages_nest.d.ts +18 -0
  14. package/dist/proto/micro/v1/notification/notification_messages_pb.d.ts +22 -0
  15. package/dist/proto/micro/v1/notification/notification_messages_pb.js +44 -1
  16. package/dist/proto/micro/v1/notification/services_connect.d.ts +7 -1
  17. package/dist/proto/micro/v1/notification/services_connect.js +6 -0
  18. package/dist/proto/micro/v1/notification/services_nest.d.ts +3 -1
  19. package/dist/proto/micro/v1/notification/services_nest.js +1 -0
  20. package/dist/proto/micro/v1/support/index.d.ts +3 -0
  21. package/dist/proto/micro/v1/support/index.js +7 -0
  22. package/dist/proto/micro/v1/support/services_connect.d.ts +56 -0
  23. package/dist/proto/micro/v1/support/services_connect.js +59 -0
  24. package/dist/proto/micro/v1/support/services_nest.d.ts +28 -0
  25. package/dist/proto/micro/v1/support/services_nest.js +31 -0
  26. package/dist/proto/micro/v1/support/support_messages_nest.d.ts +70 -0
  27. package/dist/proto/micro/v1/support/support_messages_nest.js +5 -0
  28. package/dist/proto/micro/v1/support/support_messages_pb.d.ts +142 -0
  29. package/dist/proto/micro/v1/support/support_messages_pb.js +310 -0
  30. package/dist/utils/constants.d.ts +2 -0
  31. package/dist/utils/constants.js +3 -1
  32. package/package.json +1 -1
  33. package/proto/micro/v1/mining/mining_messages.proto +366 -0
  34. package/proto/micro/v1/mining/services.proto +45 -0
  35. package/proto/micro/v1/notification/notification_messages.proto +19 -0
  36. package/proto/micro/v1/notification/services.proto +3 -0
  37. package/proto/micro/v1/support/services.proto +24 -0
  38. package/proto/micro/v1/support/support_messages.proto +96 -0
@@ -0,0 +1,366 @@
1
+ syntax = "proto3";
2
+
3
+ package micro.v1.mining;
4
+
5
+ import "micro/v1/general.proto";
6
+
7
+ // JR: a free, simulated in-app point ("kazı"). Amounts travel as decimal
8
+ // strings with 6 fraction digits ("186.797810"); hourly rates as decimal
9
+ // strings too. Times are RFC 3339 UTC. Nothing here is money: JR cannot
10
+ // be bought, sold or transferred.
11
+
12
+ // The open (or last) 24-hour session.
13
+ message SessionInfo {
14
+ string id = 1;
15
+ string started_at = 2;
16
+ string ends_at = 3;
17
+ // Set once the session is over (by the sweep or on read).
18
+ string closed_at = 4;
19
+ // JR earned so far (settled up to `settled_at`); the app ticks on from
20
+ // there with `hourly`.
21
+ string earned = 5;
22
+ string settled_at = 6;
23
+ // Expected total if the current rate held for the whole session.
24
+ string projected = 7;
25
+ bool open = 8;
26
+ }
27
+
28
+ // How the hourly rate comes together: hourly = base × multiplier,
29
+ // multiplier = min(cap, badge + own_tasks + team_share + full_team).
30
+ message RateInfo {
31
+ string base = 1;
32
+ // standard | blue | yellow
33
+ string badge = 2;
34
+ string badge_base = 3;
35
+ string own_tasks = 4;
36
+ string team_share = 5;
37
+ string full_team = 6;
38
+ // Team members that reached the full-team task threshold today.
39
+ int32 full_team_ready = 7;
40
+ int32 full_team_size = 8;
41
+ string multiplier = 9;
42
+ string cap = 10;
43
+ string hourly = 11;
44
+ }
45
+
46
+ // Base-rate halving progress.
47
+ message HalvingInfo {
48
+ int32 users = 1;
49
+ int32 next_threshold = 2;
50
+ string next_base = 3;
51
+ int32 halvings = 4;
52
+ }
53
+
54
+ // Referral earnings: two levels, accrued into a pool, moved to the balance
55
+ // with Claim.
56
+ message ReferralInfo {
57
+ string code = 1;
58
+ string link = 2;
59
+ string pending = 3;
60
+ // Estimated pool growth per hour (display only; the pool itself is
61
+ // credited from the referrals' settled mining).
62
+ string pending_hourly = 4;
63
+ string l1_share = 5;
64
+ string l2_share = 6;
65
+ int32 l1_count = 7;
66
+ int32 l1_mining = 8;
67
+ int32 l2_count = 9;
68
+ int32 l2_mining = 10;
69
+ // Lifetime totals already claimed, by source.
70
+ string earned_l1 = 11;
71
+ string earned_l2 = 12;
72
+ string earned_gifts = 13;
73
+ string earned_total = 14;
74
+ // Who invited this person (empty when nobody).
75
+ string referred_by_username = 15;
76
+ }
77
+
78
+ message TeamMember {
79
+ string user_id = 1;
80
+ string username = 2;
81
+ string avatar_url = 3;
82
+ // Tasks done today and the multiplier they add to the owner.
83
+ int32 tasks_today = 4;
84
+ string task_multiplier = 5;
85
+ string contribution = 6;
86
+ bool mining = 7;
87
+ bool full_team_ready = 8;
88
+ // When the member becomes / stops being effective (team lock).
89
+ string active_from = 9;
90
+ string active_until = 10;
91
+ // Nudge state: when the owner may nudge this member again ('' = now).
92
+ string nudge_available_at = 11;
93
+ }
94
+
95
+ message TeamInfo {
96
+ repeated TeamMember members = 1;
97
+ int32 size = 2;
98
+ // The team is locked while a session runs; changes apply at this time.
99
+ bool locked = 3;
100
+ string locked_until = 4;
101
+ string share = 5;
102
+ string full_team_bonus = 6;
103
+ int32 full_team_min_tasks = 7;
104
+ }
105
+
106
+ message TaskInfo {
107
+ string id = 1;
108
+ // daily | weekly | once
109
+ string kind = 2;
110
+ string title = 3;
111
+ string multiplier = 4;
112
+ // Times the task may count per period (ads: 5); 1 for most.
113
+ int32 max_count = 5;
114
+ int32 done_count = 6;
115
+ bool done = 7;
116
+ // When the current completion stops counting ('' when not done).
117
+ string expires_at = 8;
118
+ // Client event that completes it (mining_start, x_visit, news_read, ...)
119
+ // or '' when the server completes it on its own.
120
+ string event = 9;
121
+ // Only standard-badge users see it (ads).
122
+ bool standard_only = 10;
123
+ }
124
+
125
+ message TasksSummary {
126
+ int32 done = 1;
127
+ int32 total = 2;
128
+ // The next undone task worth the most ('' when all done).
129
+ string next_id = 3;
130
+ string next_title = 4;
131
+ string next_multiplier = 5;
132
+ // Multiplier if every task of the week were done.
133
+ string potential_multiplier = 6;
134
+ }
135
+
136
+ message MiningSettings {
137
+ bool notify_session_end = 1;
138
+ }
139
+
140
+ // Everything the Sosyal card and the JR Kazı page need in one answer.
141
+ message MiningState {
142
+ string user_id = 1;
143
+ // Settled balance; the app adds the open session's live earnings.
144
+ string balance = 2;
145
+ string total_mined = 3;
146
+ string total_claimed = 4;
147
+ optional SessionInfo session = 5;
148
+ RateInfo rate = 6;
149
+ HalvingInfo halving = 7;
150
+ ReferralInfo referral = 8;
151
+ TeamInfo team = 9;
152
+ TasksSummary tasks = 10;
153
+ MiningSettings settings = 11;
154
+ string server_time = 12;
155
+ // First visit after activation: show the welcome sheet once.
156
+ bool welcome_pending = 13;
157
+ // A session ended since the person last opened the app: show its summary.
158
+ optional SessionInfo ended_session = 14;
159
+ int32 sessions_completed = 15;
160
+ int32 streak_days = 16;
161
+ // Email not verified yet: nothing runs until it is.
162
+ bool inactive = 17;
163
+ }
164
+
165
+ message MiningMeResponse {
166
+ ResponseStatus status = 1;
167
+ optional MiningState data = 2;
168
+ }
169
+
170
+ message TasksResponse {
171
+ ResponseStatus status = 1;
172
+ repeated TaskInfo daily = 2;
173
+ repeated TaskInfo weekly = 3;
174
+ repeated TaskInfo once = 4;
175
+ optional TasksSummary summary = 5;
176
+ optional RateInfo rate = 6;
177
+ }
178
+
179
+ // The app reports what the person did; the server decides which task (if
180
+ // any) it completes.
181
+ message TaskEventRequest {
182
+ string event = 1;
183
+ // Free-form payload (prediction choice, article id ...).
184
+ string payload = 2;
185
+ }
186
+
187
+ message TaskEventResponse {
188
+ ResponseStatus status = 1;
189
+ // Task completed by this event ('' when nothing changed).
190
+ string completed_task_id = 2;
191
+ optional MiningState data = 3;
192
+ }
193
+
194
+ message ReferralItem {
195
+ string user_id = 1;
196
+ string username = 2;
197
+ string avatar_url = 3;
198
+ int32 level = 4;
199
+ bool verified = 5;
200
+ bool mining = 6;
201
+ int32 sessions_completed = 7;
202
+ // Referrer's gift: pending | paid | not_eligible
203
+ string gift_status = 8;
204
+ int32 referral_count = 9;
205
+ string hourly_contribution = 10;
206
+ bool in_team = 11;
207
+ bool team_eligible = 12;
208
+ string joined_at = 13;
209
+ }
210
+
211
+ message ReferralListRequest {
212
+ int32 page = 1;
213
+ int32 per_page = 2;
214
+ // all | mining | team | eligible
215
+ string filter = 3;
216
+ string search = 4;
217
+ int32 level = 5;
218
+ }
219
+
220
+ message ReferralListResponse {
221
+ ResponseStatus status = 1;
222
+ repeated ReferralItem data = 2;
223
+ optional PaginationMetaResult pagination = 3;
224
+ }
225
+
226
+ message ClaimResponse {
227
+ ResponseStatus status = 1;
228
+ string claimed = 2;
229
+ optional MiningState data = 3;
230
+ }
231
+
232
+ message SetTeamRequest {
233
+ repeated string user_ids = 1;
234
+ }
235
+
236
+ message TeamResponse {
237
+ ResponseStatus status = 1;
238
+ optional TeamInfo data = 2;
239
+ optional RateInfo rate = 3;
240
+ }
241
+
242
+ message HistoryRequest {
243
+ int32 page = 1;
244
+ int32 per_page = 2;
245
+ // all | mining | claim | gift
246
+ string filter = 3;
247
+ }
248
+
249
+ message HistoryItem {
250
+ string id = 1;
251
+ // mining | referral_claim | invite_gift
252
+ string kind = 2;
253
+ string amount = 3;
254
+ string created_at = 4;
255
+ // mining: average multiplier; claim: l1/l2/gift breakdown.
256
+ string detail = 5;
257
+ }
258
+
259
+ message HistoryDay {
260
+ string date = 1;
261
+ string amount = 2;
262
+ }
263
+
264
+ message HistoryResponse {
265
+ ResponseStatus status = 1;
266
+ repeated HistoryItem data = 2;
267
+ optional PaginationMetaResult pagination = 3;
268
+ // Last 7 days, for the chart.
269
+ repeated HistoryDay week = 4;
270
+ }
271
+
272
+ message UpdateSettingsRequest {
273
+ MiningSettings settings = 1;
274
+ }
275
+
276
+ // Internal (gateway at registration, or the app once, before activation):
277
+ // attach the invite code and device fingerprint to a new account.
278
+ message EnrollRequest {
279
+ string user_id = 1;
280
+ string referral_code = 2;
281
+ string device_hash = 3;
282
+ }
283
+
284
+ message EnrollResponse {
285
+ ResponseStatus status = 1;
286
+ bool referral_attached = 2;
287
+ // invalid_code | self | already_referred | too_late | same_device | ''
288
+ string reason = 3;
289
+ }
290
+
291
+ // Public: who an invite code belongs to, for the web invite page.
292
+ message ResolveCodeRequest {
293
+ string code = 1;
294
+ }
295
+
296
+ message ResolveCodeResponse {
297
+ ResponseStatus status = 1;
298
+ bool valid = 2;
299
+ string username = 3;
300
+ string avatar_url = 4;
301
+ string gift = 5;
302
+ }
303
+
304
+ message AdminOverviewRequest {
305
+ // today | week | month
306
+ string period = 1;
307
+ }
308
+
309
+ message AdminMetric {
310
+ string key = 1;
311
+ string value = 2;
312
+ // Change against the previous period, as a signed percentage string.
313
+ string change = 3;
314
+ }
315
+
316
+ message AdminSeriesPoint {
317
+ string date = 1;
318
+ string value = 2;
319
+ }
320
+
321
+ message AdminSeries {
322
+ string key = 1;
323
+ repeated AdminSeriesPoint points = 2;
324
+ }
325
+
326
+ message AdminTaskStat {
327
+ string task_id = 1;
328
+ string title = 2;
329
+ string completion_rate = 3;
330
+ string change = 4;
331
+ }
332
+
333
+ message AdminTopReferrer {
334
+ string user_id = 1;
335
+ string username = 2;
336
+ int32 referrals = 3;
337
+ string active_rate = 4;
338
+ string earned = 5;
339
+ }
340
+
341
+ message AdminOverviewResponse {
342
+ ResponseStatus status = 1;
343
+ repeated AdminMetric metrics = 2;
344
+ repeated AdminSeries series = 3;
345
+ repeated AdminTaskStat tasks = 4;
346
+ repeated AdminTopReferrer top_referrers = 5;
347
+ int32 suspicious_accounts = 6;
348
+ }
349
+
350
+ message ParameterItem {
351
+ string key = 1;
352
+ // JSON value.
353
+ string value = 2;
354
+ string updated_at = 3;
355
+ string updated_by = 4;
356
+ }
357
+
358
+ message ParametersResponse {
359
+ ResponseStatus status = 1;
360
+ repeated ParameterItem data = 2;
361
+ }
362
+
363
+ message SetParameterRequest {
364
+ string key = 1;
365
+ string value = 2;
366
+ }
@@ -0,0 +1,45 @@
1
+ syntax = "proto3";
2
+
3
+ package micro.v1.mining;
4
+
5
+ import "micro/v1/general.proto";
6
+ import "micro/v1/mining/mining_messages.proto";
7
+
8
+ // JR: the free, simulated in-app point behind the Sosyal tab. Sessions,
9
+ // rates, tasks, referrals, teams and the ledger all live here; the gateway
10
+ // forwards the caller's token, the app only shows what this service says.
11
+ service PMiningService {
12
+ // The caller's whole state (card + JR Kazı page). Initializes the person
13
+ // on first call once their email is verified.
14
+ rpc Me(EmptyRequest) returns(stream MiningMeResponse) {}
15
+ // Start the next 24-hour session (the first one starts on its own).
16
+ rpc StartSession(EmptyRequest) returns(stream MiningMeResponse) {}
17
+ // The welcome sheet / ended-session summary was shown.
18
+ rpc Acknowledge(ByIdRequest) returns(stream EmptyResponse) {}
19
+
20
+ rpc Tasks(EmptyRequest) returns(stream TasksResponse) {}
21
+ rpc TaskEvent(TaskEventRequest) returns(stream TaskEventResponse) {}
22
+
23
+ rpc Referrals(ReferralListRequest) returns(stream ReferralListResponse) {}
24
+ rpc Claim(EmptyRequest) returns(stream ClaimResponse) {}
25
+
26
+ rpc Team(EmptyRequest) returns(stream TeamResponse) {}
27
+ rpc SetTeam(SetTeamRequest) returns(stream TeamResponse) {}
28
+ rpc Nudge(ByIdRequest) returns(stream EmptyResponse) {}
29
+
30
+ rpc History(HistoryRequest) returns(stream HistoryResponse) {}
31
+ rpc UpdateSettings(UpdateSettingsRequest) returns(stream MiningMeResponse) {}
32
+
33
+ // Internal (gateway after registration) or the app before activation.
34
+ rpc Enroll(EnrollRequest) returns(stream EnrollResponse) {}
35
+ // Public, for the web invite page.
36
+ rpc ResolveCode(ResolveCodeRequest) returns(stream ResolveCodeResponse) {}
37
+
38
+ // Admin.
39
+ rpc AdminOverview(AdminOverviewRequest) returns(stream AdminOverviewResponse) {}
40
+ rpc AdminParameters(EmptyRequest) returns(stream ParametersResponse) {}
41
+ rpc AdminSetParameter(SetParameterRequest) returns(stream ParametersResponse) {}
42
+
43
+ // Account deletion parity with every other micro.
44
+ rpc RemoveUserData(ByIdRequest) returns(stream EmptyResponse) {}
45
+ }
@@ -133,6 +133,25 @@ message SendNotificationRequest {
133
133
  NotificationMessage notificationMessage = 3;
134
134
  }
135
135
 
136
+ // Generic targeted push: one text per language, the same data for every
137
+ // device. `lane` urgent|bulk picks the queue; `collapse_id` replaces an
138
+ // earlier push with the same id (max 64 bytes); `ttl_seconds` drops it when
139
+ // it is no longer worth delivering.
140
+ message SendUserPushRequest {
141
+ repeated string user_ids = 1;
142
+ string title_tr = 2;
143
+ string title_en = 3;
144
+ string body_tr = 4;
145
+ string body_en = 5;
146
+ // key=value pairs the app routes with (e.g. screen=mining).
147
+ map<string, string> data = 6;
148
+ string lane = 7;
149
+ string collapse_id = 8;
150
+ int32 ttl_seconds = 9;
151
+ // default | normal | high
152
+ string priority = 10;
153
+ }
154
+
136
155
  // Targeted push for chat mentions (localized body built micro-side).
137
156
  message SendChatMentionRequest {
138
157
  repeated string user_ids = 1;
@@ -19,6 +19,9 @@ service PNotificationService {
19
19
  rpc SendTestNotification(SendTestNotificationRequest) returns(stream EmptyResponse) {}
20
20
  rpc SendNotification(SendNotificationRequest) returns(stream EmptyResponse) {}
21
21
  rpc SendChatMention(SendChatMentionRequest) returns(stream EmptyResponse) {}
22
+ // Generic targeted push for other services (JR session end ...): the
23
+ // caller gives the text per language and the data the tap routes with.
24
+ rpc SendUserPush(SendUserPushRequest) returns(stream EmptyResponse) {}
22
25
  rpc GetUserNotificationPreferences(GetUserNotificationPreferencesRequest) returns(stream GetUserNotificationPreferencesResponse) {}
23
26
  rpc SaveMobileNotification(SaveMobileNotificationRequest) returns(stream EmptyResponse) {}
24
27
  rpc GetUserMobileNotification(GetUserMobileNotificationRequest) returns(stream GetUserMobileNotificationPaginationResponse) {}
@@ -0,0 +1,24 @@
1
+ syntax = "proto3";
2
+
3
+ package micro.v1.support;
4
+
5
+ import "micro/v1/general.proto";
6
+ import "micro/v1/support/support_messages.proto";
7
+
8
+ // Support tickets. Person-side calls carry the app token; the admin calls
9
+ // require the admin role; RemoveUserData is internal (account deletion).
10
+ service PSupportService {
11
+ rpc CreateTicket(CreateTicketRequest) returns(stream TicketThreadResponse) {}
12
+ rpc MyTickets(TicketListRequest) returns(stream TicketListResponse) {}
13
+ // The thread; marks the admin's answers as read for the person.
14
+ rpc Ticket(ByIdRequest) returns(stream TicketThreadResponse) {}
15
+ // A person writing into their own ticket, or an admin answering any.
16
+ rpc Reply(ReplyRequest) returns(stream TicketThreadResponse) {}
17
+
18
+ rpc AdminTickets(TicketListRequest) returns(stream TicketListResponse) {}
19
+ // The thread for an admin; marks the person's messages as read for admins.
20
+ rpc AdminTicket(ByIdRequest) returns(stream TicketThreadResponse) {}
21
+ rpc AdminSetStatus(SetStatusRequest) returns(stream TicketThreadResponse) {}
22
+
23
+ rpc RemoveUserData(ByIdRequest) returns(stream EmptyResponse) {}
24
+ }
@@ -0,0 +1,96 @@
1
+ syntax = "proto3";
2
+
3
+ package micro.v1.support;
4
+
5
+ import "micro/v1/general.proto";
6
+
7
+ // In-app support tickets ("Destek"): a person writes from the app, admins
8
+ // answer from the admin panel or the app. Lives in jr-mining-micro next to
9
+ // JR, served under its own package. Times are RFC 3339 UTC.
10
+
11
+ // A ticket as lists and the thread header show it.
12
+ message Ticket {
13
+ string id = 1;
14
+ // Short human number shown to the person ("#1043").
15
+ int32 number = 2;
16
+ string user_id = 3;
17
+ string username = 4;
18
+ string avatar_url = 5;
19
+ // mining | referral | tasks | team | account | other
20
+ string topic = 6;
21
+ // open | answered | closed
22
+ string status = 7;
23
+ // First message, trimmed, for list rows.
24
+ string preview = 8;
25
+ // The newest message, trimmed, for list rows.
26
+ string last_message = 9;
27
+ bool last_from_admin = 10;
28
+ int32 message_count = 11;
29
+ // Admin replied after the person last looked / person wrote after an admin last looked.
30
+ bool unread_for_user = 12;
31
+ bool unread_for_admin = 13;
32
+ string platform = 14;
33
+ string app_version = 15;
34
+ string created_at = 16;
35
+ string updated_at = 17;
36
+ string closed_at = 18;
37
+ }
38
+
39
+ message TicketMessage {
40
+ string id = 1;
41
+ string ticket_id = 2;
42
+ string author_id = 3;
43
+ string author_username = 4;
44
+ bool from_admin = 5;
45
+ string message = 6;
46
+ string attachment_url = 7;
47
+ string created_at = 8;
48
+ }
49
+
50
+ message CreateTicketRequest {
51
+ string topic = 1;
52
+ string message = 2;
53
+ string attachment_url = 3;
54
+ string platform = 4;
55
+ string app_version = 5;
56
+ }
57
+
58
+ message TicketListRequest {
59
+ int32 page = 1;
60
+ int32 per_page = 2;
61
+ // all | open | answered | closed
62
+ string status = 3;
63
+ // Admin lists only: username / number / text search.
64
+ string search = 4;
65
+ }
66
+
67
+ message ReplyRequest {
68
+ string ticket_id = 1;
69
+ string message = 2;
70
+ string attachment_url = 3;
71
+ }
72
+
73
+ message SetStatusRequest {
74
+ string ticket_id = 1;
75
+ // open | closed
76
+ string status = 2;
77
+ }
78
+
79
+ message TicketResponse {
80
+ ResponseStatus status = 1;
81
+ optional Ticket data = 2;
82
+ }
83
+
84
+ message TicketListResponse {
85
+ ResponseStatus status = 1;
86
+ repeated Ticket data = 2;
87
+ optional PaginationMetaResult pagination = 3;
88
+ // Admin: tickets waiting for an answer; person: tickets with a new answer.
89
+ int32 attention_count = 4;
90
+ }
91
+
92
+ message TicketThreadResponse {
93
+ ResponseStatus status = 1;
94
+ optional Ticket data = 2;
95
+ repeated TicketMessage messages = 3;
96
+ }