jr-common-micro 1.1.127 → 1.1.129

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.
@@ -94,6 +94,7 @@ export interface TaskInfo {
94
94
  locked: boolean;
95
95
  reopened: boolean;
96
96
  requirement: string;
97
+ last_done_at: string;
97
98
  }
98
99
  export interface TasksSummary {
99
100
  done: number;
@@ -151,6 +151,7 @@ export declare class TaskInfo extends Message<TaskInfo> {
151
151
  locked: boolean;
152
152
  reopened: boolean;
153
153
  requirement: string;
154
+ lastDoneAt: string;
154
155
  constructor(data?: PartialMessage<TaskInfo>);
155
156
  static readonly runtime: typeof proto3;
156
157
  static readonly typeName = "micro.v1.mining.TaskInfo";
@@ -310,6 +310,7 @@ class TaskInfo extends protobuf_1.Message {
310
310
  locked = false;
311
311
  reopened = false;
312
312
  requirement = "";
313
+ lastDoneAt = "";
313
314
  constructor(data) {
314
315
  super();
315
316
  protobuf_1.proto3.util.initPartial(data, this);
@@ -331,6 +332,7 @@ class TaskInfo extends protobuf_1.Message {
331
332
  { no: 12, name: "locked", kind: "scalar", T: 8 },
332
333
  { no: 13, name: "reopened", kind: "scalar", T: 8 },
333
334
  { no: 14, name: "requirement", kind: "scalar", T: 9 },
335
+ { no: 15, name: "last_done_at", kind: "scalar", T: 9 },
334
336
  ]);
335
337
  static fromBinary(bytes, options) {
336
338
  return new TaskInfo().fromBinary(bytes, options);
@@ -1,4 +1,4 @@
1
- import { CreateTicketRequest, DeleteMessageRequest, ReplyRequest, SetHiddenRequest, SetStatusRequest, TicketDraftsRequest, TicketDraftsResponse, TicketListRequest, TicketListResponse, TicketThreadResponse } from "./support_messages_pb.js";
1
+ import { AttachmentRequest, AttachmentResponse, CreateTicketRequest, DeleteMessageRequest, ReplyRequest, SetHiddenRequest, SetStatusRequest, TicketDraftsRequest, TicketDraftsResponse, TicketListRequest, TicketListResponse, TicketThreadResponse } from "./support_messages_pb.js";
2
2
  import { MethodKind } from "@bufbuild/protobuf";
3
3
  import { ByIdRequest, EmptyResponse } from "../general_pb.js";
4
4
  export declare const PSupportService: {
@@ -34,6 +34,12 @@ export declare const PSupportService: {
34
34
  readonly O: typeof TicketThreadResponse;
35
35
  readonly kind: MethodKind.ServerStreaming;
36
36
  };
37
+ readonly attachment: {
38
+ readonly name: "Attachment";
39
+ readonly I: typeof AttachmentRequest;
40
+ readonly O: typeof AttachmentResponse;
41
+ readonly kind: MethodKind.ServerStreaming;
42
+ };
37
43
  readonly adminTickets: {
38
44
  readonly name: "AdminTickets";
39
45
  readonly I: typeof TicketListRequest;
@@ -37,6 +37,12 @@ exports.PSupportService = {
37
37
  O: support_messages_pb_js_1.TicketThreadResponse,
38
38
  kind: protobuf_1.MethodKind.ServerStreaming,
39
39
  },
40
+ attachment: {
41
+ name: "Attachment",
42
+ I: support_messages_pb_js_1.AttachmentRequest,
43
+ O: support_messages_pb_js_1.AttachmentResponse,
44
+ kind: protobuf_1.MethodKind.ServerStreaming,
45
+ },
40
46
  adminTickets: {
41
47
  name: "AdminTickets",
42
48
  I: support_messages_pb_js_1.TicketListRequest,
@@ -1,7 +1,7 @@
1
1
  import type { Metadata } from "@grpc/grpc-js";
2
2
  import { Observable } from "rxjs";
3
3
  import { ByIdRequest, EmptyResponse } from "../general_nest";
4
- import { CreateTicketRequest, DeleteMessageRequest, ReplyRequest, SetHiddenRequest, SetStatusRequest, TicketDraftsRequest, TicketDraftsResponse, TicketListRequest, TicketListResponse, TicketThreadResponse } from "./support_messages_nest";
4
+ import { AttachmentRequest, AttachmentResponse, CreateTicketRequest, DeleteMessageRequest, ReplyRequest, SetHiddenRequest, SetStatusRequest, TicketDraftsRequest, TicketDraftsResponse, TicketListRequest, TicketListResponse, TicketThreadResponse } from "./support_messages_nest";
5
5
  export declare const protobufPackage = "micro.v1.support";
6
6
  export declare const MICRO_V1_SUPPORT_PACKAGE_NAME = "micro.v1.support";
7
7
  export interface PSupportServiceClient {
@@ -10,6 +10,7 @@ export interface PSupportServiceClient {
10
10
  ticket(request: ByIdRequest, metadata?: Metadata): Observable<TicketThreadResponse>;
11
11
  reply(request: ReplyRequest, metadata?: Metadata): Observable<TicketThreadResponse>;
12
12
  deleteMessage(request: DeleteMessageRequest, metadata?: Metadata): Observable<TicketThreadResponse>;
13
+ attachment(request: AttachmentRequest, metadata?: Metadata): Observable<AttachmentResponse>;
13
14
  adminTickets(request: TicketListRequest, metadata?: Metadata): Observable<TicketListResponse>;
14
15
  adminTicket(request: ByIdRequest, metadata?: Metadata): Observable<TicketThreadResponse>;
15
16
  adminSetStatus(request: SetStatusRequest, metadata?: Metadata): Observable<TicketThreadResponse>;
@@ -23,6 +24,7 @@ export interface PSupportServiceController {
23
24
  ticket(request: ByIdRequest, metadata?: Metadata): Observable<TicketThreadResponse>;
24
25
  reply(request: ReplyRequest, metadata?: Metadata): Observable<TicketThreadResponse>;
25
26
  deleteMessage(request: DeleteMessageRequest, metadata?: Metadata): Observable<TicketThreadResponse>;
27
+ attachment(request: AttachmentRequest, metadata?: Metadata): Observable<AttachmentResponse>;
26
28
  adminTickets(request: TicketListRequest, metadata?: Metadata): Observable<TicketListResponse>;
27
29
  adminTicket(request: ByIdRequest, metadata?: Metadata): Observable<TicketThreadResponse>;
28
30
  adminSetStatus(request: SetStatusRequest, metadata?: Metadata): Observable<TicketThreadResponse>;
@@ -13,6 +13,7 @@ function PSupportServiceControllerMethods() {
13
13
  "ticket",
14
14
  "reply",
15
15
  "deleteMessage",
16
+ "attachment",
16
17
  "adminTickets",
17
18
  "adminTicket",
18
19
  "adminSetStatus",
@@ -20,6 +20,13 @@ export interface Ticket {
20
20
  updated_at: string;
21
21
  closed_at: string;
22
22
  hidden: boolean;
23
+ last_has_attachment: boolean;
24
+ }
25
+ export interface TicketAttachment {
26
+ id: string;
27
+ width: number;
28
+ height: number;
29
+ expired: boolean;
23
30
  }
24
31
  export interface TicketMessage {
25
32
  id: string;
@@ -30,6 +37,7 @@ export interface TicketMessage {
30
37
  message: string;
31
38
  attachment_url: string;
32
39
  created_at: string;
40
+ attachment?: TicketAttachment | undefined;
33
41
  }
34
42
  export interface CreateTicketRequest {
35
43
  topic: string;
@@ -37,6 +45,8 @@ export interface CreateTicketRequest {
37
45
  attachment_url: string;
38
46
  platform: string;
39
47
  app_version: string;
48
+ attachment_data: Buffer;
49
+ attachment_mimetype: string;
40
50
  }
41
51
  export interface TicketListRequest {
42
52
  page: number;
@@ -48,6 +58,17 @@ export interface ReplyRequest {
48
58
  ticket_id: string;
49
59
  message: string;
50
60
  attachment_url: string;
61
+ attachment_data: Buffer;
62
+ attachment_mimetype: string;
63
+ }
64
+ export interface AttachmentRequest {
65
+ id: string;
66
+ thumb: boolean;
67
+ }
68
+ export interface AttachmentResponse {
69
+ status: ResponseStatus | undefined;
70
+ data: Buffer;
71
+ mimetype: string;
51
72
  }
52
73
  export interface DeleteMessageRequest {
53
74
  ticket_id: string;
@@ -21,6 +21,7 @@ export declare class Ticket extends Message<Ticket> {
21
21
  updatedAt: string;
22
22
  closedAt: string;
23
23
  hidden: boolean;
24
+ lastHasAttachment: boolean;
24
25
  constructor(data?: PartialMessage<Ticket>);
25
26
  static readonly runtime: typeof proto3;
26
27
  static readonly typeName = "micro.v1.support.Ticket";
@@ -30,6 +31,20 @@ export declare class Ticket extends Message<Ticket> {
30
31
  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Ticket;
31
32
  static equals(a: Ticket | PlainMessage<Ticket> | undefined, b: Ticket | PlainMessage<Ticket> | undefined): boolean;
32
33
  }
34
+ export declare class TicketAttachment extends Message<TicketAttachment> {
35
+ id: string;
36
+ width: number;
37
+ height: number;
38
+ expired: boolean;
39
+ constructor(data?: PartialMessage<TicketAttachment>);
40
+ static readonly runtime: typeof proto3;
41
+ static readonly typeName = "micro.v1.support.TicketAttachment";
42
+ static readonly fields: FieldList;
43
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TicketAttachment;
44
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): TicketAttachment;
45
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TicketAttachment;
46
+ static equals(a: TicketAttachment | PlainMessage<TicketAttachment> | undefined, b: TicketAttachment | PlainMessage<TicketAttachment> | undefined): boolean;
47
+ }
33
48
  export declare class TicketMessage extends Message<TicketMessage> {
34
49
  id: string;
35
50
  ticketId: string;
@@ -39,6 +54,7 @@ export declare class TicketMessage extends Message<TicketMessage> {
39
54
  message: string;
40
55
  attachmentUrl: string;
41
56
  createdAt: string;
57
+ attachment?: TicketAttachment;
42
58
  constructor(data?: PartialMessage<TicketMessage>);
43
59
  static readonly runtime: typeof proto3;
44
60
  static readonly typeName = "micro.v1.support.TicketMessage";
@@ -54,6 +70,8 @@ export declare class CreateTicketRequest extends Message<CreateTicketRequest> {
54
70
  attachmentUrl: string;
55
71
  platform: string;
56
72
  appVersion: string;
73
+ attachmentData: Uint8Array<ArrayBuffer>;
74
+ attachmentMimetype: string;
57
75
  constructor(data?: PartialMessage<CreateTicketRequest>);
58
76
  static readonly runtime: typeof proto3;
59
77
  static readonly typeName = "micro.v1.support.CreateTicketRequest";
@@ -81,6 +99,8 @@ export declare class ReplyRequest extends Message<ReplyRequest> {
81
99
  ticketId: string;
82
100
  message: string;
83
101
  attachmentUrl: string;
102
+ attachmentData: Uint8Array<ArrayBuffer>;
103
+ attachmentMimetype: string;
84
104
  constructor(data?: PartialMessage<ReplyRequest>);
85
105
  static readonly runtime: typeof proto3;
86
106
  static readonly typeName = "micro.v1.support.ReplyRequest";
@@ -90,6 +110,31 @@ export declare class ReplyRequest extends Message<ReplyRequest> {
90
110
  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ReplyRequest;
91
111
  static equals(a: ReplyRequest | PlainMessage<ReplyRequest> | undefined, b: ReplyRequest | PlainMessage<ReplyRequest> | undefined): boolean;
92
112
  }
113
+ export declare class AttachmentRequest extends Message<AttachmentRequest> {
114
+ id: string;
115
+ thumb: boolean;
116
+ constructor(data?: PartialMessage<AttachmentRequest>);
117
+ static readonly runtime: typeof proto3;
118
+ static readonly typeName = "micro.v1.support.AttachmentRequest";
119
+ static readonly fields: FieldList;
120
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AttachmentRequest;
121
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): AttachmentRequest;
122
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AttachmentRequest;
123
+ static equals(a: AttachmentRequest | PlainMessage<AttachmentRequest> | undefined, b: AttachmentRequest | PlainMessage<AttachmentRequest> | undefined): boolean;
124
+ }
125
+ export declare class AttachmentResponse extends Message<AttachmentResponse> {
126
+ status?: ResponseStatus;
127
+ data: Uint8Array<ArrayBuffer>;
128
+ mimetype: string;
129
+ constructor(data?: PartialMessage<AttachmentResponse>);
130
+ static readonly runtime: typeof proto3;
131
+ static readonly typeName = "micro.v1.support.AttachmentResponse";
132
+ static readonly fields: FieldList;
133
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AttachmentResponse;
134
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): AttachmentResponse;
135
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AttachmentResponse;
136
+ static equals(a: AttachmentResponse | PlainMessage<AttachmentResponse> | undefined, b: AttachmentResponse | PlainMessage<AttachmentResponse> | undefined): boolean;
137
+ }
93
138
  export declare class DeleteMessageRequest extends Message<DeleteMessageRequest> {
94
139
  ticketId: string;
95
140
  messageId: string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TicketThreadResponse = exports.TicketListResponse = exports.TicketResponse = exports.TicketDraftsResponse = exports.TicketDraftsRequest = exports.TicketCounts = exports.SetHiddenRequest = exports.SetStatusRequest = exports.DeleteMessageRequest = exports.ReplyRequest = exports.TicketListRequest = exports.CreateTicketRequest = exports.TicketMessage = exports.Ticket = void 0;
3
+ exports.TicketThreadResponse = exports.TicketListResponse = exports.TicketResponse = exports.TicketDraftsResponse = exports.TicketDraftsRequest = exports.TicketCounts = exports.SetHiddenRequest = exports.SetStatusRequest = exports.DeleteMessageRequest = exports.AttachmentResponse = exports.AttachmentRequest = exports.ReplyRequest = exports.TicketListRequest = exports.CreateTicketRequest = exports.TicketMessage = exports.TicketAttachment = exports.Ticket = void 0;
4
4
  const protobuf_1 = require("@bufbuild/protobuf");
5
5
  const general_pb_js_1 = require("../general_pb.js");
6
6
  class Ticket extends protobuf_1.Message {
@@ -23,6 +23,7 @@ class Ticket extends protobuf_1.Message {
23
23
  updatedAt = "";
24
24
  closedAt = "";
25
25
  hidden = false;
26
+ lastHasAttachment = false;
26
27
  constructor(data) {
27
28
  super();
28
29
  protobuf_1.proto3.util.initPartial(data, this);
@@ -49,6 +50,7 @@ class Ticket extends protobuf_1.Message {
49
50
  { no: 17, name: "updated_at", kind: "scalar", T: 9 },
50
51
  { no: 18, name: "closed_at", kind: "scalar", T: 9 },
51
52
  { no: 19, name: "hidden", kind: "scalar", T: 8 },
53
+ { no: 20, name: "last_has_attachment", kind: "scalar", T: 8 },
52
54
  ]);
53
55
  static fromBinary(bytes, options) {
54
56
  return new Ticket().fromBinary(bytes, options);
@@ -64,6 +66,37 @@ class Ticket extends protobuf_1.Message {
64
66
  }
65
67
  }
66
68
  exports.Ticket = Ticket;
69
+ class TicketAttachment extends protobuf_1.Message {
70
+ id = "";
71
+ width = 0;
72
+ height = 0;
73
+ expired = false;
74
+ constructor(data) {
75
+ super();
76
+ protobuf_1.proto3.util.initPartial(data, this);
77
+ }
78
+ static runtime = protobuf_1.proto3;
79
+ static typeName = "micro.v1.support.TicketAttachment";
80
+ static fields = protobuf_1.proto3.util.newFieldList(() => [
81
+ { no: 1, name: "id", kind: "scalar", T: 9 },
82
+ { no: 2, name: "width", kind: "scalar", T: 5 },
83
+ { no: 3, name: "height", kind: "scalar", T: 5 },
84
+ { no: 4, name: "expired", kind: "scalar", T: 8 },
85
+ ]);
86
+ static fromBinary(bytes, options) {
87
+ return new TicketAttachment().fromBinary(bytes, options);
88
+ }
89
+ static fromJson(jsonValue, options) {
90
+ return new TicketAttachment().fromJson(jsonValue, options);
91
+ }
92
+ static fromJsonString(jsonString, options) {
93
+ return new TicketAttachment().fromJsonString(jsonString, options);
94
+ }
95
+ static equals(a, b) {
96
+ return protobuf_1.proto3.util.equals(TicketAttachment, a, b);
97
+ }
98
+ }
99
+ exports.TicketAttachment = TicketAttachment;
67
100
  class TicketMessage extends protobuf_1.Message {
68
101
  id = "";
69
102
  ticketId = "";
@@ -73,6 +106,7 @@ class TicketMessage extends protobuf_1.Message {
73
106
  message = "";
74
107
  attachmentUrl = "";
75
108
  createdAt = "";
109
+ attachment;
76
110
  constructor(data) {
77
111
  super();
78
112
  protobuf_1.proto3.util.initPartial(data, this);
@@ -88,6 +122,7 @@ class TicketMessage extends protobuf_1.Message {
88
122
  { no: 6, name: "message", kind: "scalar", T: 9 },
89
123
  { no: 7, name: "attachment_url", kind: "scalar", T: 9 },
90
124
  { no: 8, name: "created_at", kind: "scalar", T: 9 },
125
+ { no: 9, name: "attachment", kind: "message", T: TicketAttachment, opt: true },
91
126
  ]);
92
127
  static fromBinary(bytes, options) {
93
128
  return new TicketMessage().fromBinary(bytes, options);
@@ -109,6 +144,8 @@ class CreateTicketRequest extends protobuf_1.Message {
109
144
  attachmentUrl = "";
110
145
  platform = "";
111
146
  appVersion = "";
147
+ attachmentData = new Uint8Array(0);
148
+ attachmentMimetype = "";
112
149
  constructor(data) {
113
150
  super();
114
151
  protobuf_1.proto3.util.initPartial(data, this);
@@ -121,6 +158,8 @@ class CreateTicketRequest extends protobuf_1.Message {
121
158
  { no: 3, name: "attachment_url", kind: "scalar", T: 9 },
122
159
  { no: 4, name: "platform", kind: "scalar", T: 9 },
123
160
  { no: 5, name: "app_version", kind: "scalar", T: 9 },
161
+ { no: 6, name: "attachment_data", kind: "scalar", T: 12 },
162
+ { no: 7, name: "attachment_mimetype", kind: "scalar", T: 9 },
124
163
  ]);
125
164
  static fromBinary(bytes, options) {
126
165
  return new CreateTicketRequest().fromBinary(bytes, options);
@@ -171,6 +210,8 @@ class ReplyRequest extends protobuf_1.Message {
171
210
  ticketId = "";
172
211
  message = "";
173
212
  attachmentUrl = "";
213
+ attachmentData = new Uint8Array(0);
214
+ attachmentMimetype = "";
174
215
  constructor(data) {
175
216
  super();
176
217
  protobuf_1.proto3.util.initPartial(data, this);
@@ -181,6 +222,8 @@ class ReplyRequest extends protobuf_1.Message {
181
222
  { no: 1, name: "ticket_id", kind: "scalar", T: 9 },
182
223
  { no: 2, name: "message", kind: "scalar", T: 9 },
183
224
  { no: 3, name: "attachment_url", kind: "scalar", T: 9 },
225
+ { no: 4, name: "attachment_data", kind: "scalar", T: 12 },
226
+ { no: 5, name: "attachment_mimetype", kind: "scalar", T: 9 },
184
227
  ]);
185
228
  static fromBinary(bytes, options) {
186
229
  return new ReplyRequest().fromBinary(bytes, options);
@@ -196,6 +239,62 @@ class ReplyRequest extends protobuf_1.Message {
196
239
  }
197
240
  }
198
241
  exports.ReplyRequest = ReplyRequest;
242
+ class AttachmentRequest extends protobuf_1.Message {
243
+ id = "";
244
+ thumb = false;
245
+ constructor(data) {
246
+ super();
247
+ protobuf_1.proto3.util.initPartial(data, this);
248
+ }
249
+ static runtime = protobuf_1.proto3;
250
+ static typeName = "micro.v1.support.AttachmentRequest";
251
+ static fields = protobuf_1.proto3.util.newFieldList(() => [
252
+ { no: 1, name: "id", kind: "scalar", T: 9 },
253
+ { no: 2, name: "thumb", kind: "scalar", T: 8 },
254
+ ]);
255
+ static fromBinary(bytes, options) {
256
+ return new AttachmentRequest().fromBinary(bytes, options);
257
+ }
258
+ static fromJson(jsonValue, options) {
259
+ return new AttachmentRequest().fromJson(jsonValue, options);
260
+ }
261
+ static fromJsonString(jsonString, options) {
262
+ return new AttachmentRequest().fromJsonString(jsonString, options);
263
+ }
264
+ static equals(a, b) {
265
+ return protobuf_1.proto3.util.equals(AttachmentRequest, a, b);
266
+ }
267
+ }
268
+ exports.AttachmentRequest = AttachmentRequest;
269
+ class AttachmentResponse extends protobuf_1.Message {
270
+ status;
271
+ data = new Uint8Array(0);
272
+ mimetype = "";
273
+ constructor(data) {
274
+ super();
275
+ protobuf_1.proto3.util.initPartial(data, this);
276
+ }
277
+ static runtime = protobuf_1.proto3;
278
+ static typeName = "micro.v1.support.AttachmentResponse";
279
+ static fields = protobuf_1.proto3.util.newFieldList(() => [
280
+ { no: 1, name: "status", kind: "message", T: general_pb_js_1.ResponseStatus },
281
+ { no: 2, name: "data", kind: "scalar", T: 12 },
282
+ { no: 3, name: "mimetype", kind: "scalar", T: 9 },
283
+ ]);
284
+ static fromBinary(bytes, options) {
285
+ return new AttachmentResponse().fromBinary(bytes, options);
286
+ }
287
+ static fromJson(jsonValue, options) {
288
+ return new AttachmentResponse().fromJson(jsonValue, options);
289
+ }
290
+ static fromJsonString(jsonString, options) {
291
+ return new AttachmentResponse().fromJsonString(jsonString, options);
292
+ }
293
+ static equals(a, b) {
294
+ return protobuf_1.proto3.util.equals(AttachmentResponse, a, b);
295
+ }
296
+ }
297
+ exports.AttachmentResponse = AttachmentResponse;
199
298
  class DeleteMessageRequest extends protobuf_1.Message {
200
299
  ticketId = "";
201
300
  messageId = "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jr-common-micro",
3
- "version": "1.1.127",
3
+ "version": "1.1.129",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -159,6 +159,9 @@ message TaskInfo {
159
159
  bool reopened = 13;
160
160
  // What it takes, for the step's text: a USD amount or a KYC level; ''.
161
161
  string requirement = 14;
162
+ // Admin view only: when the task was last done (start of its latest
163
+ // window, RFC 3339), whether or not that window still runs; '' if never.
164
+ string last_done_at = 15;
162
165
  }
163
166
 
164
167
  message TasksSummary {
@@ -17,6 +17,8 @@ service PSupportService {
17
17
  // Taking a message back: the author their own, an admin any team answer.
18
18
  // The ticket's opening message cannot be taken back (it is the ticket).
19
19
  rpc DeleteMessage(DeleteMessageRequest) returns(stream TicketThreadResponse) {}
20
+ // A message's photo, for the ticket's owner or an admin.
21
+ rpc Attachment(AttachmentRequest) returns(stream AttachmentResponse) {}
20
22
 
21
23
  rpc AdminTickets(TicketListRequest) returns(stream TicketListResponse) {}
22
24
  // The thread for an admin; marks the person's messages as read for admins.
@@ -36,6 +36,18 @@ message Ticket {
36
36
  string closed_at = 18;
37
37
  // Admin lists only: set aside from the inbox (the person sees no difference).
38
38
  bool hidden = 19;
39
+ // The newest message carries a photo (its text may be empty).
40
+ bool last_has_attachment = 20;
41
+ }
42
+
43
+ // A photo on a message. The bytes are served to the ticket's owner and to
44
+ // admins only (Attachment below); after 30 days they are deleted and the
45
+ // message keeps expired = true, so the apps show a placeholder.
46
+ message TicketAttachment {
47
+ string id = 1;
48
+ int32 width = 2;
49
+ int32 height = 3;
50
+ bool expired = 4;
39
51
  }
40
52
 
41
53
  message TicketMessage {
@@ -45,16 +57,22 @@ message TicketMessage {
45
57
  string author_username = 4;
46
58
  bool from_admin = 5;
47
59
  string message = 6;
60
+ // Unused, always empty: photos ride `attachment`.
48
61
  string attachment_url = 7;
49
62
  string created_at = 8;
63
+ optional TicketAttachment attachment = 9;
50
64
  }
51
65
 
52
66
  message CreateTicketRequest {
53
67
  string topic = 1;
54
68
  string message = 2;
69
+ // Unused, always empty.
55
70
  string attachment_url = 3;
56
71
  string platform = 4;
57
72
  string app_version = 5;
73
+ // One photo (JPEG, PNG or WebP bytes); re-encoded by the service.
74
+ bytes attachment_data = 6;
75
+ string attachment_mimetype = 7;
58
76
  }
59
77
 
60
78
  message TicketListRequest {
@@ -70,7 +88,25 @@ message TicketListRequest {
70
88
  message ReplyRequest {
71
89
  string ticket_id = 1;
72
90
  string message = 2;
91
+ // Unused, always empty.
73
92
  string attachment_url = 3;
93
+ // One photo, as in CreateTicketRequest; the text may then be empty.
94
+ bytes attachment_data = 4;
95
+ string attachment_mimetype = 5;
96
+ }
97
+
98
+ message AttachmentRequest {
99
+ string id = 1;
100
+ // The small variant for the bubble; false for the full photo.
101
+ bool thumb = 2;
102
+ }
103
+
104
+ // 404 for someone who is neither the ticket's owner nor an admin, and for an
105
+ // expired photo.
106
+ message AttachmentResponse {
107
+ ResponseStatus status = 1;
108
+ bytes data = 2;
109
+ string mimetype = 3;
74
110
  }
75
111
 
76
112
  message DeleteMessageRequest {