mezon-js-protobuf 1.8.81 → 1.8.82
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/api/api.ts +10 -10
- package/dist/mezon-js-protobuf/api/api.d.ts +5 -5
- package/dist/mezon-js-protobuf/utils.d.ts +1 -2
- package/dist/mezon-js-protobuf.cjs.js +315 -8
- package/dist/mezon-js-protobuf.esm.mjs +315 -8
- package/package.json +1 -1
- package/utils.ts +1 -9
package/api/api.ts
CHANGED
|
@@ -3747,7 +3747,7 @@ export interface DirectFcmProto {
|
|
|
3747
3747
|
username: string;
|
|
3748
3748
|
mention_ids: string[];
|
|
3749
3749
|
position_s: number[];
|
|
3750
|
-
|
|
3750
|
+
position_e: number[];
|
|
3751
3751
|
attachment_type: string;
|
|
3752
3752
|
has_more_attachment: boolean;
|
|
3753
3753
|
}
|
|
@@ -39056,7 +39056,7 @@ function createBaseDirectFcmProto(): DirectFcmProto {
|
|
|
39056
39056
|
username: "",
|
|
39057
39057
|
mention_ids: [],
|
|
39058
39058
|
position_s: [],
|
|
39059
|
-
|
|
39059
|
+
position_e: [],
|
|
39060
39060
|
attachment_type: "",
|
|
39061
39061
|
has_more_attachment: false,
|
|
39062
39062
|
};
|
|
@@ -39109,7 +39109,7 @@ export const DirectFcmProto = {
|
|
|
39109
39109
|
}
|
|
39110
39110
|
writer.ldelim();
|
|
39111
39111
|
writer.uint32(122).fork();
|
|
39112
|
-
for (const v of message.
|
|
39112
|
+
for (const v of message.position_e) {
|
|
39113
39113
|
writer.int32(v);
|
|
39114
39114
|
}
|
|
39115
39115
|
writer.ldelim();
|
|
@@ -39239,7 +39239,7 @@ export const DirectFcmProto = {
|
|
|
39239
39239
|
break;
|
|
39240
39240
|
case 15:
|
|
39241
39241
|
if (tag === 120) {
|
|
39242
|
-
message.
|
|
39242
|
+
message.position_e.push(reader.int32());
|
|
39243
39243
|
|
|
39244
39244
|
continue;
|
|
39245
39245
|
}
|
|
@@ -39247,7 +39247,7 @@ export const DirectFcmProto = {
|
|
|
39247
39247
|
if (tag === 122) {
|
|
39248
39248
|
const end2 = reader.uint32() + reader.pos;
|
|
39249
39249
|
while (reader.pos < end2) {
|
|
39250
|
-
message.
|
|
39250
|
+
message.position_e.push(reader.int32());
|
|
39251
39251
|
}
|
|
39252
39252
|
|
|
39253
39253
|
continue;
|
|
@@ -39297,8 +39297,8 @@ export const DirectFcmProto = {
|
|
|
39297
39297
|
position_s: globalThis.Array.isArray(object?.position_s)
|
|
39298
39298
|
? object.position_s.map((e: any) => globalThis.Number(e))
|
|
39299
39299
|
: [],
|
|
39300
|
-
|
|
39301
|
-
? object.
|
|
39300
|
+
position_e: globalThis.Array.isArray(object?.position_e)
|
|
39301
|
+
? object.position_e.map((e: any) => globalThis.Number(e))
|
|
39302
39302
|
: [],
|
|
39303
39303
|
attachment_type: isSet(object.attachment_type) ? globalThis.String(object.attachment_type) : "",
|
|
39304
39304
|
has_more_attachment: isSet(object.has_more_attachment) ? globalThis.Boolean(object.has_more_attachment) : false,
|
|
@@ -39349,8 +39349,8 @@ export const DirectFcmProto = {
|
|
|
39349
39349
|
if (message.position_s?.length) {
|
|
39350
39350
|
obj.position_s = message.position_s.map((e) => Math.round(e));
|
|
39351
39351
|
}
|
|
39352
|
-
if (message.
|
|
39353
|
-
obj.
|
|
39352
|
+
if (message.position_e?.length) {
|
|
39353
|
+
obj.position_e = message.position_e.map((e) => Math.round(e));
|
|
39354
39354
|
}
|
|
39355
39355
|
if (message.attachment_type !== "") {
|
|
39356
39356
|
obj.attachment_type = message.attachment_type;
|
|
@@ -39380,7 +39380,7 @@ export const DirectFcmProto = {
|
|
|
39380
39380
|
message.username = object.username ?? "";
|
|
39381
39381
|
message.mention_ids = object.mention_ids?.map((e) => e) || [];
|
|
39382
39382
|
message.position_s = object.position_s?.map((e) => e) || [];
|
|
39383
|
-
message.
|
|
39383
|
+
message.position_e = object.position_e?.map((e) => e) || [];
|
|
39384
39384
|
message.attachment_type = object.attachment_type ?? "";
|
|
39385
39385
|
message.has_more_attachment = object.has_more_attachment ?? false;
|
|
39386
39386
|
return message;
|
|
@@ -3133,7 +3133,7 @@ export interface DirectFcmProto {
|
|
|
3133
3133
|
username: string;
|
|
3134
3134
|
mention_ids: string[];
|
|
3135
3135
|
position_s: number[];
|
|
3136
|
-
|
|
3136
|
+
position_e: number[];
|
|
3137
3137
|
attachment_type: string;
|
|
3138
3138
|
has_more_attachment: boolean;
|
|
3139
3139
|
}
|
|
@@ -23259,7 +23259,7 @@ export declare const DirectFcmProto: {
|
|
|
23259
23259
|
username?: string | undefined;
|
|
23260
23260
|
mention_ids?: string[] | undefined;
|
|
23261
23261
|
position_s?: number[] | undefined;
|
|
23262
|
-
|
|
23262
|
+
position_e?: number[] | undefined;
|
|
23263
23263
|
attachment_type?: string | undefined;
|
|
23264
23264
|
has_more_attachment?: boolean | undefined;
|
|
23265
23265
|
} & {
|
|
@@ -23277,7 +23277,7 @@ export declare const DirectFcmProto: {
|
|
|
23277
23277
|
username?: string | undefined;
|
|
23278
23278
|
mention_ids?: (string[] & string[] & { [K in Exclude<keyof I["mention_ids"], keyof string[]>]: never; }) | undefined;
|
|
23279
23279
|
position_s?: (number[] & number[] & { [K_1 in Exclude<keyof I["position_s"], keyof number[]>]: never; }) | undefined;
|
|
23280
|
-
|
|
23280
|
+
position_e?: (number[] & number[] & { [K_2 in Exclude<keyof I["position_e"], keyof number[]>]: never; }) | undefined;
|
|
23281
23281
|
attachment_type?: string | undefined;
|
|
23282
23282
|
has_more_attachment?: boolean | undefined;
|
|
23283
23283
|
} & { [K_3 in Exclude<keyof I, keyof DirectFcmProto>]: never; }>(base?: I | undefined): DirectFcmProto;
|
|
@@ -23296,7 +23296,7 @@ export declare const DirectFcmProto: {
|
|
|
23296
23296
|
username?: string | undefined;
|
|
23297
23297
|
mention_ids?: string[] | undefined;
|
|
23298
23298
|
position_s?: number[] | undefined;
|
|
23299
|
-
|
|
23299
|
+
position_e?: number[] | undefined;
|
|
23300
23300
|
attachment_type?: string | undefined;
|
|
23301
23301
|
has_more_attachment?: boolean | undefined;
|
|
23302
23302
|
} & {
|
|
@@ -23314,7 +23314,7 @@ export declare const DirectFcmProto: {
|
|
|
23314
23314
|
username?: string | undefined;
|
|
23315
23315
|
mention_ids?: (string[] & string[] & { [K_4 in Exclude<keyof I_1["mention_ids"], keyof string[]>]: never; }) | undefined;
|
|
23316
23316
|
position_s?: (number[] & number[] & { [K_5 in Exclude<keyof I_1["position_s"], keyof number[]>]: never; }) | undefined;
|
|
23317
|
-
|
|
23317
|
+
position_e?: (number[] & number[] & { [K_6 in Exclude<keyof I_1["position_e"], keyof number[]>]: never; }) | undefined;
|
|
23318
23318
|
attachment_type?: string | undefined;
|
|
23319
23319
|
has_more_attachment?: boolean | undefined;
|
|
23320
23320
|
} & { [K_7 in Exclude<keyof I_1, keyof DirectFcmProto>]: never; }>(object: I_1): DirectFcmProto;
|
|
@@ -3,5 +3,4 @@ export declare function decodeMentions(data: any): tsproto.MessageMentionList;
|
|
|
3
3
|
export declare function decodeAttachments(data: any): tsproto.MessageAttachmentList;
|
|
4
4
|
export declare function decodeRefs(data: any): tsproto.MessageRefList;
|
|
5
5
|
export declare function decodeReactions(data: any): tsproto.MessageReactionList;
|
|
6
|
-
export declare function decodeNotificationFcm(data: any): tsproto.
|
|
7
|
-
export declare function decodeNotificationContent(data: any): string;
|
|
6
|
+
export declare function decodeNotificationFcm(data: any): tsproto.DirectFcmProto;
|
|
@@ -2267,7 +2267,6 @@ __export(mezon_js_protobuf_exports, {
|
|
|
2267
2267
|
WebSocketAdapterPb: () => WebSocketAdapterPb,
|
|
2268
2268
|
decodeAttachments: () => decodeAttachments,
|
|
2269
2269
|
decodeMentions: () => decodeMentions,
|
|
2270
|
-
decodeNotificationContent: () => decodeNotificationContent,
|
|
2271
2270
|
decodeNotificationFcm: () => decodeNotificationFcm,
|
|
2272
2271
|
decodeReactions: () => decodeReactions,
|
|
2273
2272
|
decodeRefs: () => decodeRefs
|
|
@@ -14162,6 +14161,320 @@ var SearchThreadRequest = {
|
|
|
14162
14161
|
return message;
|
|
14163
14162
|
}
|
|
14164
14163
|
};
|
|
14164
|
+
function createBaseDirectFcmProto() {
|
|
14165
|
+
return {
|
|
14166
|
+
title: "",
|
|
14167
|
+
link: "",
|
|
14168
|
+
content: "",
|
|
14169
|
+
channel_id: "",
|
|
14170
|
+
sender_id: "",
|
|
14171
|
+
avatar: "",
|
|
14172
|
+
clan_id: "",
|
|
14173
|
+
attachment_link: "",
|
|
14174
|
+
display_name: "",
|
|
14175
|
+
create_time_seconds: 0,
|
|
14176
|
+
update_time_seconds: 0,
|
|
14177
|
+
username: "",
|
|
14178
|
+
mention_ids: [],
|
|
14179
|
+
position_s: [],
|
|
14180
|
+
position_e: [],
|
|
14181
|
+
attachment_type: "",
|
|
14182
|
+
has_more_attachment: false
|
|
14183
|
+
};
|
|
14184
|
+
}
|
|
14185
|
+
var DirectFcmProto = {
|
|
14186
|
+
encode(message, writer = import_minimal3.default.Writer.create()) {
|
|
14187
|
+
if (message.title !== "") {
|
|
14188
|
+
writer.uint32(10).string(message.title);
|
|
14189
|
+
}
|
|
14190
|
+
if (message.link !== "") {
|
|
14191
|
+
writer.uint32(18).string(message.link);
|
|
14192
|
+
}
|
|
14193
|
+
if (message.content !== "") {
|
|
14194
|
+
writer.uint32(26).string(message.content);
|
|
14195
|
+
}
|
|
14196
|
+
if (message.channel_id !== "") {
|
|
14197
|
+
writer.uint32(34).string(message.channel_id);
|
|
14198
|
+
}
|
|
14199
|
+
if (message.sender_id !== "") {
|
|
14200
|
+
writer.uint32(42).string(message.sender_id);
|
|
14201
|
+
}
|
|
14202
|
+
if (message.avatar !== "") {
|
|
14203
|
+
writer.uint32(50).string(message.avatar);
|
|
14204
|
+
}
|
|
14205
|
+
if (message.clan_id !== "") {
|
|
14206
|
+
writer.uint32(58).string(message.clan_id);
|
|
14207
|
+
}
|
|
14208
|
+
if (message.attachment_link !== "") {
|
|
14209
|
+
writer.uint32(66).string(message.attachment_link);
|
|
14210
|
+
}
|
|
14211
|
+
if (message.display_name !== "") {
|
|
14212
|
+
writer.uint32(74).string(message.display_name);
|
|
14213
|
+
}
|
|
14214
|
+
if (message.create_time_seconds !== 0) {
|
|
14215
|
+
writer.uint32(80).int32(message.create_time_seconds);
|
|
14216
|
+
}
|
|
14217
|
+
if (message.update_time_seconds !== 0) {
|
|
14218
|
+
writer.uint32(88).int32(message.update_time_seconds);
|
|
14219
|
+
}
|
|
14220
|
+
if (message.username !== "") {
|
|
14221
|
+
writer.uint32(98).string(message.username);
|
|
14222
|
+
}
|
|
14223
|
+
for (const v of message.mention_ids) {
|
|
14224
|
+
writer.uint32(106).string(v);
|
|
14225
|
+
}
|
|
14226
|
+
writer.uint32(114).fork();
|
|
14227
|
+
for (const v of message.position_s) {
|
|
14228
|
+
writer.int32(v);
|
|
14229
|
+
}
|
|
14230
|
+
writer.ldelim();
|
|
14231
|
+
writer.uint32(122).fork();
|
|
14232
|
+
for (const v of message.position_e) {
|
|
14233
|
+
writer.int32(v);
|
|
14234
|
+
}
|
|
14235
|
+
writer.ldelim();
|
|
14236
|
+
if (message.attachment_type !== "") {
|
|
14237
|
+
writer.uint32(130).string(message.attachment_type);
|
|
14238
|
+
}
|
|
14239
|
+
if (message.has_more_attachment !== false) {
|
|
14240
|
+
writer.uint32(136).bool(message.has_more_attachment);
|
|
14241
|
+
}
|
|
14242
|
+
return writer;
|
|
14243
|
+
},
|
|
14244
|
+
decode(input, length) {
|
|
14245
|
+
const reader = input instanceof import_minimal3.default.Reader ? input : import_minimal3.default.Reader.create(input);
|
|
14246
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
14247
|
+
const message = createBaseDirectFcmProto();
|
|
14248
|
+
while (reader.pos < end) {
|
|
14249
|
+
const tag = reader.uint32();
|
|
14250
|
+
switch (tag >>> 3) {
|
|
14251
|
+
case 1:
|
|
14252
|
+
if (tag !== 10) {
|
|
14253
|
+
break;
|
|
14254
|
+
}
|
|
14255
|
+
message.title = reader.string();
|
|
14256
|
+
continue;
|
|
14257
|
+
case 2:
|
|
14258
|
+
if (tag !== 18) {
|
|
14259
|
+
break;
|
|
14260
|
+
}
|
|
14261
|
+
message.link = reader.string();
|
|
14262
|
+
continue;
|
|
14263
|
+
case 3:
|
|
14264
|
+
if (tag !== 26) {
|
|
14265
|
+
break;
|
|
14266
|
+
}
|
|
14267
|
+
message.content = reader.string();
|
|
14268
|
+
continue;
|
|
14269
|
+
case 4:
|
|
14270
|
+
if (tag !== 34) {
|
|
14271
|
+
break;
|
|
14272
|
+
}
|
|
14273
|
+
message.channel_id = reader.string();
|
|
14274
|
+
continue;
|
|
14275
|
+
case 5:
|
|
14276
|
+
if (tag !== 42) {
|
|
14277
|
+
break;
|
|
14278
|
+
}
|
|
14279
|
+
message.sender_id = reader.string();
|
|
14280
|
+
continue;
|
|
14281
|
+
case 6:
|
|
14282
|
+
if (tag !== 50) {
|
|
14283
|
+
break;
|
|
14284
|
+
}
|
|
14285
|
+
message.avatar = reader.string();
|
|
14286
|
+
continue;
|
|
14287
|
+
case 7:
|
|
14288
|
+
if (tag !== 58) {
|
|
14289
|
+
break;
|
|
14290
|
+
}
|
|
14291
|
+
message.clan_id = reader.string();
|
|
14292
|
+
continue;
|
|
14293
|
+
case 8:
|
|
14294
|
+
if (tag !== 66) {
|
|
14295
|
+
break;
|
|
14296
|
+
}
|
|
14297
|
+
message.attachment_link = reader.string();
|
|
14298
|
+
continue;
|
|
14299
|
+
case 9:
|
|
14300
|
+
if (tag !== 74) {
|
|
14301
|
+
break;
|
|
14302
|
+
}
|
|
14303
|
+
message.display_name = reader.string();
|
|
14304
|
+
continue;
|
|
14305
|
+
case 10:
|
|
14306
|
+
if (tag !== 80) {
|
|
14307
|
+
break;
|
|
14308
|
+
}
|
|
14309
|
+
message.create_time_seconds = reader.int32();
|
|
14310
|
+
continue;
|
|
14311
|
+
case 11:
|
|
14312
|
+
if (tag !== 88) {
|
|
14313
|
+
break;
|
|
14314
|
+
}
|
|
14315
|
+
message.update_time_seconds = reader.int32();
|
|
14316
|
+
continue;
|
|
14317
|
+
case 12:
|
|
14318
|
+
if (tag !== 98) {
|
|
14319
|
+
break;
|
|
14320
|
+
}
|
|
14321
|
+
message.username = reader.string();
|
|
14322
|
+
continue;
|
|
14323
|
+
case 13:
|
|
14324
|
+
if (tag !== 106) {
|
|
14325
|
+
break;
|
|
14326
|
+
}
|
|
14327
|
+
message.mention_ids.push(reader.string());
|
|
14328
|
+
continue;
|
|
14329
|
+
case 14:
|
|
14330
|
+
if (tag === 112) {
|
|
14331
|
+
message.position_s.push(reader.int32());
|
|
14332
|
+
continue;
|
|
14333
|
+
}
|
|
14334
|
+
if (tag === 114) {
|
|
14335
|
+
const end2 = reader.uint32() + reader.pos;
|
|
14336
|
+
while (reader.pos < end2) {
|
|
14337
|
+
message.position_s.push(reader.int32());
|
|
14338
|
+
}
|
|
14339
|
+
continue;
|
|
14340
|
+
}
|
|
14341
|
+
break;
|
|
14342
|
+
case 15:
|
|
14343
|
+
if (tag === 120) {
|
|
14344
|
+
message.position_e.push(reader.int32());
|
|
14345
|
+
continue;
|
|
14346
|
+
}
|
|
14347
|
+
if (tag === 122) {
|
|
14348
|
+
const end2 = reader.uint32() + reader.pos;
|
|
14349
|
+
while (reader.pos < end2) {
|
|
14350
|
+
message.position_e.push(reader.int32());
|
|
14351
|
+
}
|
|
14352
|
+
continue;
|
|
14353
|
+
}
|
|
14354
|
+
break;
|
|
14355
|
+
case 16:
|
|
14356
|
+
if (tag !== 130) {
|
|
14357
|
+
break;
|
|
14358
|
+
}
|
|
14359
|
+
message.attachment_type = reader.string();
|
|
14360
|
+
continue;
|
|
14361
|
+
case 17:
|
|
14362
|
+
if (tag !== 136) {
|
|
14363
|
+
break;
|
|
14364
|
+
}
|
|
14365
|
+
message.has_more_attachment = reader.bool();
|
|
14366
|
+
continue;
|
|
14367
|
+
}
|
|
14368
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
14369
|
+
break;
|
|
14370
|
+
}
|
|
14371
|
+
reader.skipType(tag & 7);
|
|
14372
|
+
}
|
|
14373
|
+
return message;
|
|
14374
|
+
},
|
|
14375
|
+
fromJSON(object) {
|
|
14376
|
+
return {
|
|
14377
|
+
title: isSet2(object.title) ? globalThis.String(object.title) : "",
|
|
14378
|
+
link: isSet2(object.link) ? globalThis.String(object.link) : "",
|
|
14379
|
+
content: isSet2(object.content) ? globalThis.String(object.content) : "",
|
|
14380
|
+
channel_id: isSet2(object.channel_id) ? globalThis.String(object.channel_id) : "",
|
|
14381
|
+
sender_id: isSet2(object.sender_id) ? globalThis.String(object.sender_id) : "",
|
|
14382
|
+
avatar: isSet2(object.avatar) ? globalThis.String(object.avatar) : "",
|
|
14383
|
+
clan_id: isSet2(object.clan_id) ? globalThis.String(object.clan_id) : "",
|
|
14384
|
+
attachment_link: isSet2(object.attachment_link) ? globalThis.String(object.attachment_link) : "",
|
|
14385
|
+
display_name: isSet2(object.display_name) ? globalThis.String(object.display_name) : "",
|
|
14386
|
+
create_time_seconds: isSet2(object.create_time_seconds) ? globalThis.Number(object.create_time_seconds) : 0,
|
|
14387
|
+
update_time_seconds: isSet2(object.update_time_seconds) ? globalThis.Number(object.update_time_seconds) : 0,
|
|
14388
|
+
username: isSet2(object.username) ? globalThis.String(object.username) : "",
|
|
14389
|
+
mention_ids: globalThis.Array.isArray(object == null ? void 0 : object.mention_ids) ? object.mention_ids.map((e) => globalThis.String(e)) : [],
|
|
14390
|
+
position_s: globalThis.Array.isArray(object == null ? void 0 : object.position_s) ? object.position_s.map((e) => globalThis.Number(e)) : [],
|
|
14391
|
+
position_e: globalThis.Array.isArray(object == null ? void 0 : object.position_e) ? object.position_e.map((e) => globalThis.Number(e)) : [],
|
|
14392
|
+
attachment_type: isSet2(object.attachment_type) ? globalThis.String(object.attachment_type) : "",
|
|
14393
|
+
has_more_attachment: isSet2(object.has_more_attachment) ? globalThis.Boolean(object.has_more_attachment) : false
|
|
14394
|
+
};
|
|
14395
|
+
},
|
|
14396
|
+
toJSON(message) {
|
|
14397
|
+
var _a, _b, _c;
|
|
14398
|
+
const obj = {};
|
|
14399
|
+
if (message.title !== "") {
|
|
14400
|
+
obj.title = message.title;
|
|
14401
|
+
}
|
|
14402
|
+
if (message.link !== "") {
|
|
14403
|
+
obj.link = message.link;
|
|
14404
|
+
}
|
|
14405
|
+
if (message.content !== "") {
|
|
14406
|
+
obj.content = message.content;
|
|
14407
|
+
}
|
|
14408
|
+
if (message.channel_id !== "") {
|
|
14409
|
+
obj.channel_id = message.channel_id;
|
|
14410
|
+
}
|
|
14411
|
+
if (message.sender_id !== "") {
|
|
14412
|
+
obj.sender_id = message.sender_id;
|
|
14413
|
+
}
|
|
14414
|
+
if (message.avatar !== "") {
|
|
14415
|
+
obj.avatar = message.avatar;
|
|
14416
|
+
}
|
|
14417
|
+
if (message.clan_id !== "") {
|
|
14418
|
+
obj.clan_id = message.clan_id;
|
|
14419
|
+
}
|
|
14420
|
+
if (message.attachment_link !== "") {
|
|
14421
|
+
obj.attachment_link = message.attachment_link;
|
|
14422
|
+
}
|
|
14423
|
+
if (message.display_name !== "") {
|
|
14424
|
+
obj.display_name = message.display_name;
|
|
14425
|
+
}
|
|
14426
|
+
if (message.create_time_seconds !== 0) {
|
|
14427
|
+
obj.create_time_seconds = Math.round(message.create_time_seconds);
|
|
14428
|
+
}
|
|
14429
|
+
if (message.update_time_seconds !== 0) {
|
|
14430
|
+
obj.update_time_seconds = Math.round(message.update_time_seconds);
|
|
14431
|
+
}
|
|
14432
|
+
if (message.username !== "") {
|
|
14433
|
+
obj.username = message.username;
|
|
14434
|
+
}
|
|
14435
|
+
if ((_a = message.mention_ids) == null ? void 0 : _a.length) {
|
|
14436
|
+
obj.mention_ids = message.mention_ids;
|
|
14437
|
+
}
|
|
14438
|
+
if ((_b = message.position_s) == null ? void 0 : _b.length) {
|
|
14439
|
+
obj.position_s = message.position_s.map((e) => Math.round(e));
|
|
14440
|
+
}
|
|
14441
|
+
if ((_c = message.position_e) == null ? void 0 : _c.length) {
|
|
14442
|
+
obj.position_e = message.position_e.map((e) => Math.round(e));
|
|
14443
|
+
}
|
|
14444
|
+
if (message.attachment_type !== "") {
|
|
14445
|
+
obj.attachment_type = message.attachment_type;
|
|
14446
|
+
}
|
|
14447
|
+
if (message.has_more_attachment !== false) {
|
|
14448
|
+
obj.has_more_attachment = message.has_more_attachment;
|
|
14449
|
+
}
|
|
14450
|
+
return obj;
|
|
14451
|
+
},
|
|
14452
|
+
create(base) {
|
|
14453
|
+
return DirectFcmProto.fromPartial(base != null ? base : {});
|
|
14454
|
+
},
|
|
14455
|
+
fromPartial(object) {
|
|
14456
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
14457
|
+
const message = createBaseDirectFcmProto();
|
|
14458
|
+
message.title = (_a = object.title) != null ? _a : "";
|
|
14459
|
+
message.link = (_b = object.link) != null ? _b : "";
|
|
14460
|
+
message.content = (_c = object.content) != null ? _c : "";
|
|
14461
|
+
message.channel_id = (_d = object.channel_id) != null ? _d : "";
|
|
14462
|
+
message.sender_id = (_e = object.sender_id) != null ? _e : "";
|
|
14463
|
+
message.avatar = (_f = object.avatar) != null ? _f : "";
|
|
14464
|
+
message.clan_id = (_g = object.clan_id) != null ? _g : "";
|
|
14465
|
+
message.attachment_link = (_h = object.attachment_link) != null ? _h : "";
|
|
14466
|
+
message.display_name = (_i = object.display_name) != null ? _i : "";
|
|
14467
|
+
message.create_time_seconds = (_j = object.create_time_seconds) != null ? _j : 0;
|
|
14468
|
+
message.update_time_seconds = (_k = object.update_time_seconds) != null ? _k : 0;
|
|
14469
|
+
message.username = (_l = object.username) != null ? _l : "";
|
|
14470
|
+
message.mention_ids = ((_m = object.mention_ids) == null ? void 0 : _m.map((e) => e)) || [];
|
|
14471
|
+
message.position_s = ((_n = object.position_s) == null ? void 0 : _n.map((e) => e)) || [];
|
|
14472
|
+
message.position_e = ((_o = object.position_e) == null ? void 0 : _o.map((e) => e)) || [];
|
|
14473
|
+
message.attachment_type = (_p = object.attachment_type) != null ? _p : "";
|
|
14474
|
+
message.has_more_attachment = (_q = object.has_more_attachment) != null ? _q : false;
|
|
14475
|
+
return message;
|
|
14476
|
+
}
|
|
14477
|
+
};
|
|
14165
14478
|
function createBaseMessageMentionList() {
|
|
14166
14479
|
return { mentions: [] };
|
|
14167
14480
|
}
|
|
@@ -26632,12 +26945,6 @@ function decodeReactions(data) {
|
|
|
26632
26945
|
function decodeNotificationFcm(data) {
|
|
26633
26946
|
const buffer = data;
|
|
26634
26947
|
const uintBuffer = new Uint8Array(buffer);
|
|
26635
|
-
const noti =
|
|
26948
|
+
const noti = DirectFcmProto.decode(uintBuffer);
|
|
26636
26949
|
return noti;
|
|
26637
26950
|
}
|
|
26638
|
-
function decodeNotificationContent(data) {
|
|
26639
|
-
const uint8Array = new Uint8Array(data);
|
|
26640
|
-
const decoder = new TextDecoder("utf-8");
|
|
26641
|
-
const notiContent = decoder.decode(uint8Array);
|
|
26642
|
-
return notiContent;
|
|
26643
|
-
}
|
|
@@ -14143,6 +14143,320 @@ var SearchThreadRequest = {
|
|
|
14143
14143
|
return message;
|
|
14144
14144
|
}
|
|
14145
14145
|
};
|
|
14146
|
+
function createBaseDirectFcmProto() {
|
|
14147
|
+
return {
|
|
14148
|
+
title: "",
|
|
14149
|
+
link: "",
|
|
14150
|
+
content: "",
|
|
14151
|
+
channel_id: "",
|
|
14152
|
+
sender_id: "",
|
|
14153
|
+
avatar: "",
|
|
14154
|
+
clan_id: "",
|
|
14155
|
+
attachment_link: "",
|
|
14156
|
+
display_name: "",
|
|
14157
|
+
create_time_seconds: 0,
|
|
14158
|
+
update_time_seconds: 0,
|
|
14159
|
+
username: "",
|
|
14160
|
+
mention_ids: [],
|
|
14161
|
+
position_s: [],
|
|
14162
|
+
position_e: [],
|
|
14163
|
+
attachment_type: "",
|
|
14164
|
+
has_more_attachment: false
|
|
14165
|
+
};
|
|
14166
|
+
}
|
|
14167
|
+
var DirectFcmProto = {
|
|
14168
|
+
encode(message, writer = import_minimal3.default.Writer.create()) {
|
|
14169
|
+
if (message.title !== "") {
|
|
14170
|
+
writer.uint32(10).string(message.title);
|
|
14171
|
+
}
|
|
14172
|
+
if (message.link !== "") {
|
|
14173
|
+
writer.uint32(18).string(message.link);
|
|
14174
|
+
}
|
|
14175
|
+
if (message.content !== "") {
|
|
14176
|
+
writer.uint32(26).string(message.content);
|
|
14177
|
+
}
|
|
14178
|
+
if (message.channel_id !== "") {
|
|
14179
|
+
writer.uint32(34).string(message.channel_id);
|
|
14180
|
+
}
|
|
14181
|
+
if (message.sender_id !== "") {
|
|
14182
|
+
writer.uint32(42).string(message.sender_id);
|
|
14183
|
+
}
|
|
14184
|
+
if (message.avatar !== "") {
|
|
14185
|
+
writer.uint32(50).string(message.avatar);
|
|
14186
|
+
}
|
|
14187
|
+
if (message.clan_id !== "") {
|
|
14188
|
+
writer.uint32(58).string(message.clan_id);
|
|
14189
|
+
}
|
|
14190
|
+
if (message.attachment_link !== "") {
|
|
14191
|
+
writer.uint32(66).string(message.attachment_link);
|
|
14192
|
+
}
|
|
14193
|
+
if (message.display_name !== "") {
|
|
14194
|
+
writer.uint32(74).string(message.display_name);
|
|
14195
|
+
}
|
|
14196
|
+
if (message.create_time_seconds !== 0) {
|
|
14197
|
+
writer.uint32(80).int32(message.create_time_seconds);
|
|
14198
|
+
}
|
|
14199
|
+
if (message.update_time_seconds !== 0) {
|
|
14200
|
+
writer.uint32(88).int32(message.update_time_seconds);
|
|
14201
|
+
}
|
|
14202
|
+
if (message.username !== "") {
|
|
14203
|
+
writer.uint32(98).string(message.username);
|
|
14204
|
+
}
|
|
14205
|
+
for (const v of message.mention_ids) {
|
|
14206
|
+
writer.uint32(106).string(v);
|
|
14207
|
+
}
|
|
14208
|
+
writer.uint32(114).fork();
|
|
14209
|
+
for (const v of message.position_s) {
|
|
14210
|
+
writer.int32(v);
|
|
14211
|
+
}
|
|
14212
|
+
writer.ldelim();
|
|
14213
|
+
writer.uint32(122).fork();
|
|
14214
|
+
for (const v of message.position_e) {
|
|
14215
|
+
writer.int32(v);
|
|
14216
|
+
}
|
|
14217
|
+
writer.ldelim();
|
|
14218
|
+
if (message.attachment_type !== "") {
|
|
14219
|
+
writer.uint32(130).string(message.attachment_type);
|
|
14220
|
+
}
|
|
14221
|
+
if (message.has_more_attachment !== false) {
|
|
14222
|
+
writer.uint32(136).bool(message.has_more_attachment);
|
|
14223
|
+
}
|
|
14224
|
+
return writer;
|
|
14225
|
+
},
|
|
14226
|
+
decode(input, length) {
|
|
14227
|
+
const reader = input instanceof import_minimal3.default.Reader ? input : import_minimal3.default.Reader.create(input);
|
|
14228
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
14229
|
+
const message = createBaseDirectFcmProto();
|
|
14230
|
+
while (reader.pos < end) {
|
|
14231
|
+
const tag = reader.uint32();
|
|
14232
|
+
switch (tag >>> 3) {
|
|
14233
|
+
case 1:
|
|
14234
|
+
if (tag !== 10) {
|
|
14235
|
+
break;
|
|
14236
|
+
}
|
|
14237
|
+
message.title = reader.string();
|
|
14238
|
+
continue;
|
|
14239
|
+
case 2:
|
|
14240
|
+
if (tag !== 18) {
|
|
14241
|
+
break;
|
|
14242
|
+
}
|
|
14243
|
+
message.link = reader.string();
|
|
14244
|
+
continue;
|
|
14245
|
+
case 3:
|
|
14246
|
+
if (tag !== 26) {
|
|
14247
|
+
break;
|
|
14248
|
+
}
|
|
14249
|
+
message.content = reader.string();
|
|
14250
|
+
continue;
|
|
14251
|
+
case 4:
|
|
14252
|
+
if (tag !== 34) {
|
|
14253
|
+
break;
|
|
14254
|
+
}
|
|
14255
|
+
message.channel_id = reader.string();
|
|
14256
|
+
continue;
|
|
14257
|
+
case 5:
|
|
14258
|
+
if (tag !== 42) {
|
|
14259
|
+
break;
|
|
14260
|
+
}
|
|
14261
|
+
message.sender_id = reader.string();
|
|
14262
|
+
continue;
|
|
14263
|
+
case 6:
|
|
14264
|
+
if (tag !== 50) {
|
|
14265
|
+
break;
|
|
14266
|
+
}
|
|
14267
|
+
message.avatar = reader.string();
|
|
14268
|
+
continue;
|
|
14269
|
+
case 7:
|
|
14270
|
+
if (tag !== 58) {
|
|
14271
|
+
break;
|
|
14272
|
+
}
|
|
14273
|
+
message.clan_id = reader.string();
|
|
14274
|
+
continue;
|
|
14275
|
+
case 8:
|
|
14276
|
+
if (tag !== 66) {
|
|
14277
|
+
break;
|
|
14278
|
+
}
|
|
14279
|
+
message.attachment_link = reader.string();
|
|
14280
|
+
continue;
|
|
14281
|
+
case 9:
|
|
14282
|
+
if (tag !== 74) {
|
|
14283
|
+
break;
|
|
14284
|
+
}
|
|
14285
|
+
message.display_name = reader.string();
|
|
14286
|
+
continue;
|
|
14287
|
+
case 10:
|
|
14288
|
+
if (tag !== 80) {
|
|
14289
|
+
break;
|
|
14290
|
+
}
|
|
14291
|
+
message.create_time_seconds = reader.int32();
|
|
14292
|
+
continue;
|
|
14293
|
+
case 11:
|
|
14294
|
+
if (tag !== 88) {
|
|
14295
|
+
break;
|
|
14296
|
+
}
|
|
14297
|
+
message.update_time_seconds = reader.int32();
|
|
14298
|
+
continue;
|
|
14299
|
+
case 12:
|
|
14300
|
+
if (tag !== 98) {
|
|
14301
|
+
break;
|
|
14302
|
+
}
|
|
14303
|
+
message.username = reader.string();
|
|
14304
|
+
continue;
|
|
14305
|
+
case 13:
|
|
14306
|
+
if (tag !== 106) {
|
|
14307
|
+
break;
|
|
14308
|
+
}
|
|
14309
|
+
message.mention_ids.push(reader.string());
|
|
14310
|
+
continue;
|
|
14311
|
+
case 14:
|
|
14312
|
+
if (tag === 112) {
|
|
14313
|
+
message.position_s.push(reader.int32());
|
|
14314
|
+
continue;
|
|
14315
|
+
}
|
|
14316
|
+
if (tag === 114) {
|
|
14317
|
+
const end2 = reader.uint32() + reader.pos;
|
|
14318
|
+
while (reader.pos < end2) {
|
|
14319
|
+
message.position_s.push(reader.int32());
|
|
14320
|
+
}
|
|
14321
|
+
continue;
|
|
14322
|
+
}
|
|
14323
|
+
break;
|
|
14324
|
+
case 15:
|
|
14325
|
+
if (tag === 120) {
|
|
14326
|
+
message.position_e.push(reader.int32());
|
|
14327
|
+
continue;
|
|
14328
|
+
}
|
|
14329
|
+
if (tag === 122) {
|
|
14330
|
+
const end2 = reader.uint32() + reader.pos;
|
|
14331
|
+
while (reader.pos < end2) {
|
|
14332
|
+
message.position_e.push(reader.int32());
|
|
14333
|
+
}
|
|
14334
|
+
continue;
|
|
14335
|
+
}
|
|
14336
|
+
break;
|
|
14337
|
+
case 16:
|
|
14338
|
+
if (tag !== 130) {
|
|
14339
|
+
break;
|
|
14340
|
+
}
|
|
14341
|
+
message.attachment_type = reader.string();
|
|
14342
|
+
continue;
|
|
14343
|
+
case 17:
|
|
14344
|
+
if (tag !== 136) {
|
|
14345
|
+
break;
|
|
14346
|
+
}
|
|
14347
|
+
message.has_more_attachment = reader.bool();
|
|
14348
|
+
continue;
|
|
14349
|
+
}
|
|
14350
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
14351
|
+
break;
|
|
14352
|
+
}
|
|
14353
|
+
reader.skipType(tag & 7);
|
|
14354
|
+
}
|
|
14355
|
+
return message;
|
|
14356
|
+
},
|
|
14357
|
+
fromJSON(object) {
|
|
14358
|
+
return {
|
|
14359
|
+
title: isSet2(object.title) ? globalThis.String(object.title) : "",
|
|
14360
|
+
link: isSet2(object.link) ? globalThis.String(object.link) : "",
|
|
14361
|
+
content: isSet2(object.content) ? globalThis.String(object.content) : "",
|
|
14362
|
+
channel_id: isSet2(object.channel_id) ? globalThis.String(object.channel_id) : "",
|
|
14363
|
+
sender_id: isSet2(object.sender_id) ? globalThis.String(object.sender_id) : "",
|
|
14364
|
+
avatar: isSet2(object.avatar) ? globalThis.String(object.avatar) : "",
|
|
14365
|
+
clan_id: isSet2(object.clan_id) ? globalThis.String(object.clan_id) : "",
|
|
14366
|
+
attachment_link: isSet2(object.attachment_link) ? globalThis.String(object.attachment_link) : "",
|
|
14367
|
+
display_name: isSet2(object.display_name) ? globalThis.String(object.display_name) : "",
|
|
14368
|
+
create_time_seconds: isSet2(object.create_time_seconds) ? globalThis.Number(object.create_time_seconds) : 0,
|
|
14369
|
+
update_time_seconds: isSet2(object.update_time_seconds) ? globalThis.Number(object.update_time_seconds) : 0,
|
|
14370
|
+
username: isSet2(object.username) ? globalThis.String(object.username) : "",
|
|
14371
|
+
mention_ids: globalThis.Array.isArray(object == null ? void 0 : object.mention_ids) ? object.mention_ids.map((e) => globalThis.String(e)) : [],
|
|
14372
|
+
position_s: globalThis.Array.isArray(object == null ? void 0 : object.position_s) ? object.position_s.map((e) => globalThis.Number(e)) : [],
|
|
14373
|
+
position_e: globalThis.Array.isArray(object == null ? void 0 : object.position_e) ? object.position_e.map((e) => globalThis.Number(e)) : [],
|
|
14374
|
+
attachment_type: isSet2(object.attachment_type) ? globalThis.String(object.attachment_type) : "",
|
|
14375
|
+
has_more_attachment: isSet2(object.has_more_attachment) ? globalThis.Boolean(object.has_more_attachment) : false
|
|
14376
|
+
};
|
|
14377
|
+
},
|
|
14378
|
+
toJSON(message) {
|
|
14379
|
+
var _a, _b, _c;
|
|
14380
|
+
const obj = {};
|
|
14381
|
+
if (message.title !== "") {
|
|
14382
|
+
obj.title = message.title;
|
|
14383
|
+
}
|
|
14384
|
+
if (message.link !== "") {
|
|
14385
|
+
obj.link = message.link;
|
|
14386
|
+
}
|
|
14387
|
+
if (message.content !== "") {
|
|
14388
|
+
obj.content = message.content;
|
|
14389
|
+
}
|
|
14390
|
+
if (message.channel_id !== "") {
|
|
14391
|
+
obj.channel_id = message.channel_id;
|
|
14392
|
+
}
|
|
14393
|
+
if (message.sender_id !== "") {
|
|
14394
|
+
obj.sender_id = message.sender_id;
|
|
14395
|
+
}
|
|
14396
|
+
if (message.avatar !== "") {
|
|
14397
|
+
obj.avatar = message.avatar;
|
|
14398
|
+
}
|
|
14399
|
+
if (message.clan_id !== "") {
|
|
14400
|
+
obj.clan_id = message.clan_id;
|
|
14401
|
+
}
|
|
14402
|
+
if (message.attachment_link !== "") {
|
|
14403
|
+
obj.attachment_link = message.attachment_link;
|
|
14404
|
+
}
|
|
14405
|
+
if (message.display_name !== "") {
|
|
14406
|
+
obj.display_name = message.display_name;
|
|
14407
|
+
}
|
|
14408
|
+
if (message.create_time_seconds !== 0) {
|
|
14409
|
+
obj.create_time_seconds = Math.round(message.create_time_seconds);
|
|
14410
|
+
}
|
|
14411
|
+
if (message.update_time_seconds !== 0) {
|
|
14412
|
+
obj.update_time_seconds = Math.round(message.update_time_seconds);
|
|
14413
|
+
}
|
|
14414
|
+
if (message.username !== "") {
|
|
14415
|
+
obj.username = message.username;
|
|
14416
|
+
}
|
|
14417
|
+
if ((_a = message.mention_ids) == null ? void 0 : _a.length) {
|
|
14418
|
+
obj.mention_ids = message.mention_ids;
|
|
14419
|
+
}
|
|
14420
|
+
if ((_b = message.position_s) == null ? void 0 : _b.length) {
|
|
14421
|
+
obj.position_s = message.position_s.map((e) => Math.round(e));
|
|
14422
|
+
}
|
|
14423
|
+
if ((_c = message.position_e) == null ? void 0 : _c.length) {
|
|
14424
|
+
obj.position_e = message.position_e.map((e) => Math.round(e));
|
|
14425
|
+
}
|
|
14426
|
+
if (message.attachment_type !== "") {
|
|
14427
|
+
obj.attachment_type = message.attachment_type;
|
|
14428
|
+
}
|
|
14429
|
+
if (message.has_more_attachment !== false) {
|
|
14430
|
+
obj.has_more_attachment = message.has_more_attachment;
|
|
14431
|
+
}
|
|
14432
|
+
return obj;
|
|
14433
|
+
},
|
|
14434
|
+
create(base) {
|
|
14435
|
+
return DirectFcmProto.fromPartial(base != null ? base : {});
|
|
14436
|
+
},
|
|
14437
|
+
fromPartial(object) {
|
|
14438
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
14439
|
+
const message = createBaseDirectFcmProto();
|
|
14440
|
+
message.title = (_a = object.title) != null ? _a : "";
|
|
14441
|
+
message.link = (_b = object.link) != null ? _b : "";
|
|
14442
|
+
message.content = (_c = object.content) != null ? _c : "";
|
|
14443
|
+
message.channel_id = (_d = object.channel_id) != null ? _d : "";
|
|
14444
|
+
message.sender_id = (_e = object.sender_id) != null ? _e : "";
|
|
14445
|
+
message.avatar = (_f = object.avatar) != null ? _f : "";
|
|
14446
|
+
message.clan_id = (_g = object.clan_id) != null ? _g : "";
|
|
14447
|
+
message.attachment_link = (_h = object.attachment_link) != null ? _h : "";
|
|
14448
|
+
message.display_name = (_i = object.display_name) != null ? _i : "";
|
|
14449
|
+
message.create_time_seconds = (_j = object.create_time_seconds) != null ? _j : 0;
|
|
14450
|
+
message.update_time_seconds = (_k = object.update_time_seconds) != null ? _k : 0;
|
|
14451
|
+
message.username = (_l = object.username) != null ? _l : "";
|
|
14452
|
+
message.mention_ids = ((_m = object.mention_ids) == null ? void 0 : _m.map((e) => e)) || [];
|
|
14453
|
+
message.position_s = ((_n = object.position_s) == null ? void 0 : _n.map((e) => e)) || [];
|
|
14454
|
+
message.position_e = ((_o = object.position_e) == null ? void 0 : _o.map((e) => e)) || [];
|
|
14455
|
+
message.attachment_type = (_p = object.attachment_type) != null ? _p : "";
|
|
14456
|
+
message.has_more_attachment = (_q = object.has_more_attachment) != null ? _q : false;
|
|
14457
|
+
return message;
|
|
14458
|
+
}
|
|
14459
|
+
};
|
|
14146
14460
|
function createBaseMessageMentionList() {
|
|
14147
14461
|
return { mentions: [] };
|
|
14148
14462
|
}
|
|
@@ -26613,20 +26927,13 @@ function decodeReactions(data) {
|
|
|
26613
26927
|
function decodeNotificationFcm(data) {
|
|
26614
26928
|
const buffer = data;
|
|
26615
26929
|
const uintBuffer = new Uint8Array(buffer);
|
|
26616
|
-
const noti =
|
|
26930
|
+
const noti = DirectFcmProto.decode(uintBuffer);
|
|
26617
26931
|
return noti;
|
|
26618
26932
|
}
|
|
26619
|
-
function decodeNotificationContent(data) {
|
|
26620
|
-
const uint8Array = new Uint8Array(data);
|
|
26621
|
-
const decoder = new TextDecoder("utf-8");
|
|
26622
|
-
const notiContent = decoder.decode(uint8Array);
|
|
26623
|
-
return notiContent;
|
|
26624
|
-
}
|
|
26625
26933
|
export {
|
|
26626
26934
|
WebSocketAdapterPb,
|
|
26627
26935
|
decodeAttachments,
|
|
26628
26936
|
decodeMentions,
|
|
26629
|
-
decodeNotificationContent,
|
|
26630
26937
|
decodeNotificationFcm,
|
|
26631
26938
|
decodeReactions,
|
|
26632
26939
|
decodeRefs
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mezon-js-protobuf",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.82",
|
|
4
4
|
"description": "Websocket adapter adding protocol buffer support to the Mezon Javascript client.",
|
|
5
5
|
"main": "dist/mezon-js-protobuf.cjs.js",
|
|
6
6
|
"module": "dist/mezon-js-protobuf.esm.mjs",
|
package/utils.ts
CHANGED
|
@@ -34,15 +34,7 @@ export function decodeReactions(data: any) {
|
|
|
34
34
|
export function decodeNotificationFcm(data: any) {
|
|
35
35
|
const buffer: ArrayBuffer = data;
|
|
36
36
|
const uintBuffer: Uint8Array = new Uint8Array(buffer);
|
|
37
|
-
const noti = tsproto.
|
|
37
|
+
const noti = tsproto.DirectFcmProto.decode(uintBuffer);
|
|
38
38
|
|
|
39
39
|
return noti;
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
export function decodeNotificationContent(data: any) {
|
|
43
|
-
const uint8Array = new Uint8Array(data);
|
|
44
|
-
const decoder = new TextDecoder("utf-8");
|
|
45
|
-
const notiContent = decoder.decode(uint8Array);
|
|
46
|
-
|
|
47
|
-
return notiContent;
|
|
48
|
-
}
|