mezon-js 2.14.23 → 2.14.24
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/dist/mezon-js.cjs.js +49 -20
- package/dist/mezon-js.esm.mjs +49 -20
- package/dist/utils.d.ts +5 -5
- package/package.json +1 -1
- package/utils.ts +50 -24
package/dist/mezon-js.cjs.js
CHANGED
|
@@ -32247,34 +32247,63 @@ function safeJSONParse(jsonStr) {
|
|
|
32247
32247
|
}
|
|
32248
32248
|
}
|
|
32249
32249
|
function decodeMentions(data) {
|
|
32250
|
-
|
|
32251
|
-
|
|
32252
|
-
|
|
32253
|
-
|
|
32250
|
+
try {
|
|
32251
|
+
const buffer = data;
|
|
32252
|
+
const uintBuffer = new Uint8Array(buffer);
|
|
32253
|
+
const mentions = MessageMentionList.decode(uintBuffer);
|
|
32254
|
+
return mentions;
|
|
32255
|
+
} catch (error) {
|
|
32256
|
+
console.error("Failed to decode mentions:", error);
|
|
32257
|
+
console.error(data, "data");
|
|
32258
|
+
return void 0;
|
|
32259
|
+
}
|
|
32254
32260
|
}
|
|
32255
32261
|
function decodeAttachments(data) {
|
|
32256
|
-
|
|
32257
|
-
|
|
32258
|
-
|
|
32259
|
-
|
|
32262
|
+
try {
|
|
32263
|
+
const buffer = data;
|
|
32264
|
+
const uintBuffer = new Uint8Array(buffer);
|
|
32265
|
+
const attachments = MessageAttachmentList.decode(uintBuffer);
|
|
32266
|
+
return attachments;
|
|
32267
|
+
} catch (error) {
|
|
32268
|
+
console.error("Failed to decode attachments:", error);
|
|
32269
|
+
console.error(data, "data");
|
|
32270
|
+
return void 0;
|
|
32271
|
+
}
|
|
32260
32272
|
}
|
|
32261
32273
|
function decodeRefs(data) {
|
|
32262
|
-
|
|
32263
|
-
|
|
32264
|
-
|
|
32265
|
-
|
|
32274
|
+
try {
|
|
32275
|
+
const buffer = data;
|
|
32276
|
+
const uintBuffer = new Uint8Array(buffer);
|
|
32277
|
+
const refs = MessageRefList.decode(uintBuffer);
|
|
32278
|
+
return refs;
|
|
32279
|
+
} catch (error) {
|
|
32280
|
+
console.error("Failed to decode refs:", error);
|
|
32281
|
+
console.error(data, "data");
|
|
32282
|
+
return void 0;
|
|
32283
|
+
}
|
|
32266
32284
|
}
|
|
32267
32285
|
function decodeReactions(data) {
|
|
32268
|
-
|
|
32269
|
-
|
|
32270
|
-
|
|
32271
|
-
|
|
32286
|
+
try {
|
|
32287
|
+
const buffer = data;
|
|
32288
|
+
const uintBuffer = new Uint8Array(buffer);
|
|
32289
|
+
const reactions = MessageReactionList.decode(uintBuffer);
|
|
32290
|
+
return reactions;
|
|
32291
|
+
} catch (error) {
|
|
32292
|
+
console.error("Failed to decode reactions:", error);
|
|
32293
|
+
console.error(data, "data");
|
|
32294
|
+
return void 0;
|
|
32295
|
+
}
|
|
32272
32296
|
}
|
|
32273
32297
|
function decodeNotificationFcm(data) {
|
|
32274
|
-
|
|
32275
|
-
|
|
32276
|
-
|
|
32277
|
-
|
|
32298
|
+
try {
|
|
32299
|
+
const buffer = data;
|
|
32300
|
+
const uintBuffer = new Uint8Array(buffer);
|
|
32301
|
+
const noti = DirectFcmProto.decode(uintBuffer);
|
|
32302
|
+
return noti;
|
|
32303
|
+
} catch (error) {
|
|
32304
|
+
console.error("Failed to decode notification FCM:", error);
|
|
32305
|
+
return void 0;
|
|
32306
|
+
}
|
|
32278
32307
|
}
|
|
32279
32308
|
function encodeAttachments(data) {
|
|
32280
32309
|
const attachmentWriter = MessageAttachmentList.encode(
|
package/dist/mezon-js.esm.mjs
CHANGED
|
@@ -32216,34 +32216,63 @@ function safeJSONParse(jsonStr) {
|
|
|
32216
32216
|
}
|
|
32217
32217
|
}
|
|
32218
32218
|
function decodeMentions(data) {
|
|
32219
|
-
|
|
32220
|
-
|
|
32221
|
-
|
|
32222
|
-
|
|
32219
|
+
try {
|
|
32220
|
+
const buffer = data;
|
|
32221
|
+
const uintBuffer = new Uint8Array(buffer);
|
|
32222
|
+
const mentions = MessageMentionList.decode(uintBuffer);
|
|
32223
|
+
return mentions;
|
|
32224
|
+
} catch (error) {
|
|
32225
|
+
console.error("Failed to decode mentions:", error);
|
|
32226
|
+
console.error(data, "data");
|
|
32227
|
+
return void 0;
|
|
32228
|
+
}
|
|
32223
32229
|
}
|
|
32224
32230
|
function decodeAttachments(data) {
|
|
32225
|
-
|
|
32226
|
-
|
|
32227
|
-
|
|
32228
|
-
|
|
32231
|
+
try {
|
|
32232
|
+
const buffer = data;
|
|
32233
|
+
const uintBuffer = new Uint8Array(buffer);
|
|
32234
|
+
const attachments = MessageAttachmentList.decode(uintBuffer);
|
|
32235
|
+
return attachments;
|
|
32236
|
+
} catch (error) {
|
|
32237
|
+
console.error("Failed to decode attachments:", error);
|
|
32238
|
+
console.error(data, "data");
|
|
32239
|
+
return void 0;
|
|
32240
|
+
}
|
|
32229
32241
|
}
|
|
32230
32242
|
function decodeRefs(data) {
|
|
32231
|
-
|
|
32232
|
-
|
|
32233
|
-
|
|
32234
|
-
|
|
32243
|
+
try {
|
|
32244
|
+
const buffer = data;
|
|
32245
|
+
const uintBuffer = new Uint8Array(buffer);
|
|
32246
|
+
const refs = MessageRefList.decode(uintBuffer);
|
|
32247
|
+
return refs;
|
|
32248
|
+
} catch (error) {
|
|
32249
|
+
console.error("Failed to decode refs:", error);
|
|
32250
|
+
console.error(data, "data");
|
|
32251
|
+
return void 0;
|
|
32252
|
+
}
|
|
32235
32253
|
}
|
|
32236
32254
|
function decodeReactions(data) {
|
|
32237
|
-
|
|
32238
|
-
|
|
32239
|
-
|
|
32240
|
-
|
|
32255
|
+
try {
|
|
32256
|
+
const buffer = data;
|
|
32257
|
+
const uintBuffer = new Uint8Array(buffer);
|
|
32258
|
+
const reactions = MessageReactionList.decode(uintBuffer);
|
|
32259
|
+
return reactions;
|
|
32260
|
+
} catch (error) {
|
|
32261
|
+
console.error("Failed to decode reactions:", error);
|
|
32262
|
+
console.error(data, "data");
|
|
32263
|
+
return void 0;
|
|
32264
|
+
}
|
|
32241
32265
|
}
|
|
32242
32266
|
function decodeNotificationFcm(data) {
|
|
32243
|
-
|
|
32244
|
-
|
|
32245
|
-
|
|
32246
|
-
|
|
32267
|
+
try {
|
|
32268
|
+
const buffer = data;
|
|
32269
|
+
const uintBuffer = new Uint8Array(buffer);
|
|
32270
|
+
const noti = DirectFcmProto.decode(uintBuffer);
|
|
32271
|
+
return noti;
|
|
32272
|
+
} catch (error) {
|
|
32273
|
+
console.error("Failed to decode notification FCM:", error);
|
|
32274
|
+
return void 0;
|
|
32275
|
+
}
|
|
32247
32276
|
}
|
|
32248
32277
|
function encodeAttachments(data) {
|
|
32249
32278
|
const attachmentWriter = MessageAttachmentList.encode(
|
package/dist/utils.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ export declare function buildFetchOptions(method: string, options: any, bodyJson
|
|
|
3
3
|
export declare function b64EncodeUnicode(str: string): string;
|
|
4
4
|
export declare function b64DecodeUnicode(str: string): string;
|
|
5
5
|
export declare function safeJSONParse(jsonStr: string): any;
|
|
6
|
-
export declare function decodeMentions(data: any): tsproto.MessageMentionList;
|
|
7
|
-
export declare function decodeAttachments(data: any): tsproto.MessageAttachmentList;
|
|
8
|
-
export declare function decodeRefs(data: any): tsproto.MessageRefList;
|
|
9
|
-
export declare function decodeReactions(data: any): tsproto.MessageReactionList;
|
|
10
|
-
export declare function decodeNotificationFcm(data: any): tsproto.DirectFcmProto;
|
|
6
|
+
export declare function decodeMentions(data: any): tsproto.MessageMentionList | undefined;
|
|
7
|
+
export declare function decodeAttachments(data: any): tsproto.MessageAttachmentList | undefined;
|
|
8
|
+
export declare function decodeRefs(data: any): tsproto.MessageRefList | undefined;
|
|
9
|
+
export declare function decodeReactions(data: any): tsproto.MessageReactionList | undefined;
|
|
10
|
+
export declare function decodeNotificationFcm(data: any): tsproto.DirectFcmProto | undefined;
|
|
11
11
|
export declare function encodeAttachments(data: tsproto.MessageAttachmentList): Uint8Array;
|
package/package.json
CHANGED
package/utils.ts
CHANGED
|
@@ -56,42 +56,68 @@ export function safeJSONParse(jsonStr: string) {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
export function decodeMentions(data: any) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
try {
|
|
60
|
+
const buffer: ArrayBuffer = data;
|
|
61
|
+
const uintBuffer: Uint8Array = new Uint8Array(buffer);
|
|
62
|
+
const mentions = tsproto.MessageMentionList.decode(uintBuffer);
|
|
63
|
+
return mentions;
|
|
64
|
+
} catch (error) {
|
|
65
|
+
console.error('Failed to decode mentions:', error);
|
|
66
|
+
console.error(data, 'data');
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
64
69
|
}
|
|
65
70
|
|
|
66
71
|
export function decodeAttachments(data: any) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
try {
|
|
73
|
+
const buffer: ArrayBuffer = data;
|
|
74
|
+
const uintBuffer: Uint8Array = new Uint8Array(buffer);
|
|
75
|
+
const attachments = tsproto.MessageAttachmentList.decode(uintBuffer);
|
|
76
|
+
return attachments;
|
|
77
|
+
} catch (error) {
|
|
78
|
+
console.error('Failed to decode attachments:', error);
|
|
79
|
+
console.error(data, 'data');
|
|
80
|
+
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
72
83
|
}
|
|
73
84
|
|
|
74
85
|
export function decodeRefs(data: any) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
86
|
+
try {
|
|
87
|
+
const buffer: ArrayBuffer = data;
|
|
88
|
+
const uintBuffer: Uint8Array = new Uint8Array(buffer);
|
|
89
|
+
const refs = tsproto.MessageRefList.decode(uintBuffer);
|
|
90
|
+
return refs;
|
|
91
|
+
} catch (error) {
|
|
92
|
+
console.error('Failed to decode refs:', error);
|
|
93
|
+
console.error(data, 'data');
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
80
96
|
}
|
|
81
97
|
|
|
82
98
|
export function decodeReactions(data: any) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
99
|
+
try {
|
|
100
|
+
const buffer: ArrayBuffer = data;
|
|
101
|
+
const uintBuffer: Uint8Array = new Uint8Array(buffer);
|
|
102
|
+
const reactions = tsproto.MessageReactionList.decode(uintBuffer);
|
|
103
|
+
return reactions;
|
|
104
|
+
} catch (error) {
|
|
105
|
+
console.error('Failed to decode reactions:', error);
|
|
106
|
+
console.error(data, 'data');
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
87
109
|
}
|
|
88
110
|
|
|
89
111
|
export function decodeNotificationFcm(data: any) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
112
|
+
try {
|
|
113
|
+
const buffer: ArrayBuffer = data;
|
|
114
|
+
const uintBuffer: Uint8Array = new Uint8Array(buffer);
|
|
115
|
+
const noti = tsproto.DirectFcmProto.decode(uintBuffer);
|
|
116
|
+
return noti;
|
|
117
|
+
} catch (error) {
|
|
118
|
+
console.error('Failed to decode notification FCM:', error);
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
95
121
|
}
|
|
96
122
|
|
|
97
123
|
export function encodeAttachments(data: tsproto.MessageAttachmentList) {
|