mezon-light-sdk 1.0.3 → 1.0.4
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/README.md +258 -258
- package/package.json +43 -22
- package/dist/api.gen.d.ts +0 -150
- package/dist/api.gen.js +0 -149
- package/dist/client.d.ts +0 -137
- package/dist/client.js +0 -267
- package/dist/constants.d.ts +0 -16
- package/dist/constants.js +0 -19
- package/dist/google/protobuf/struct.d.ts +0 -201
- package/dist/google/protobuf/struct.js +0 -449
- package/dist/google/protobuf/wrappers.d.ts +0 -238
- package/dist/google/protobuf/wrappers.js +0 -506
- package/dist/index.d.ts +0 -5
- package/dist/index.js +0 -20
- package/dist/proto/api.d.ts +0 -24188
- package/dist/proto/api.js +0 -33287
- package/dist/proto/realtime.d.ts +0 -36125
- package/dist/proto/realtime.js +0 -13947
- package/dist/session.d.ts +0 -63
- package/dist/session.js +0 -92
- package/dist/socket.d.ts +0 -135
- package/dist/socket.gen.d.ts +0 -136
- package/dist/socket.gen.js +0 -327
- package/dist/socket.js +0 -249
- package/dist/types.d.ts +0 -44
- package/dist/types.js +0 -2
- package/dist/utils.d.ts +0 -3
- package/dist/utils.js +0 -110
- package/dist/web_socket_adapter_pb.d.ts +0 -69
- package/dist/web_socket_adapter_pb.js +0 -111
|
@@ -1,506 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
-
// versions:
|
|
4
|
-
// protoc-gen-ts_proto v1.181.2
|
|
5
|
-
// protoc v4.25.2
|
|
6
|
-
// source: google/protobuf/wrappers.proto
|
|
7
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9
|
-
};
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.BytesValue = exports.StringValue = exports.BoolValue = exports.UInt32Value = exports.Int32Value = exports.UInt64Value = exports.Int64Value = exports.FloatValue = exports.DoubleValue = exports.protobufPackage = void 0;
|
|
12
|
-
/* eslint-disable */
|
|
13
|
-
const long_1 = __importDefault(require("long"));
|
|
14
|
-
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
15
|
-
exports.protobufPackage = "google.protobuf";
|
|
16
|
-
function createBaseDoubleValue() {
|
|
17
|
-
return { value: 0 };
|
|
18
|
-
}
|
|
19
|
-
exports.DoubleValue = {
|
|
20
|
-
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
21
|
-
if (message.value !== 0) {
|
|
22
|
-
writer.uint32(9).double(message.value);
|
|
23
|
-
}
|
|
24
|
-
return writer;
|
|
25
|
-
},
|
|
26
|
-
decode(input, length) {
|
|
27
|
-
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
28
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
29
|
-
const message = createBaseDoubleValue();
|
|
30
|
-
while (reader.pos < end) {
|
|
31
|
-
const tag = reader.uint32();
|
|
32
|
-
switch (tag >>> 3) {
|
|
33
|
-
case 1:
|
|
34
|
-
if (tag !== 9) {
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
message.value = reader.double();
|
|
38
|
-
continue;
|
|
39
|
-
}
|
|
40
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
reader.skipType(tag & 7);
|
|
44
|
-
}
|
|
45
|
-
return message;
|
|
46
|
-
},
|
|
47
|
-
fromJSON(object) {
|
|
48
|
-
return { value: isSet(object.value) ? globalThis.Number(object.value) : 0 };
|
|
49
|
-
},
|
|
50
|
-
toJSON(message) {
|
|
51
|
-
const obj = {};
|
|
52
|
-
if (message.value !== 0) {
|
|
53
|
-
obj.value = message.value;
|
|
54
|
-
}
|
|
55
|
-
return obj;
|
|
56
|
-
},
|
|
57
|
-
create(base) {
|
|
58
|
-
return exports.DoubleValue.fromPartial(base ?? {});
|
|
59
|
-
},
|
|
60
|
-
fromPartial(object) {
|
|
61
|
-
const message = createBaseDoubleValue();
|
|
62
|
-
message.value = object.value ?? 0;
|
|
63
|
-
return message;
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
function createBaseFloatValue() {
|
|
67
|
-
return { value: 0 };
|
|
68
|
-
}
|
|
69
|
-
exports.FloatValue = {
|
|
70
|
-
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
71
|
-
if (message.value !== 0) {
|
|
72
|
-
writer.uint32(13).float(message.value);
|
|
73
|
-
}
|
|
74
|
-
return writer;
|
|
75
|
-
},
|
|
76
|
-
decode(input, length) {
|
|
77
|
-
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
78
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
79
|
-
const message = createBaseFloatValue();
|
|
80
|
-
while (reader.pos < end) {
|
|
81
|
-
const tag = reader.uint32();
|
|
82
|
-
switch (tag >>> 3) {
|
|
83
|
-
case 1:
|
|
84
|
-
if (tag !== 13) {
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
message.value = reader.float();
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
91
|
-
break;
|
|
92
|
-
}
|
|
93
|
-
reader.skipType(tag & 7);
|
|
94
|
-
}
|
|
95
|
-
return message;
|
|
96
|
-
},
|
|
97
|
-
fromJSON(object) {
|
|
98
|
-
return { value: isSet(object.value) ? globalThis.Number(object.value) : 0 };
|
|
99
|
-
},
|
|
100
|
-
toJSON(message) {
|
|
101
|
-
const obj = {};
|
|
102
|
-
if (message.value !== 0) {
|
|
103
|
-
obj.value = message.value;
|
|
104
|
-
}
|
|
105
|
-
return obj;
|
|
106
|
-
},
|
|
107
|
-
create(base) {
|
|
108
|
-
return exports.FloatValue.fromPartial(base ?? {});
|
|
109
|
-
},
|
|
110
|
-
fromPartial(object) {
|
|
111
|
-
const message = createBaseFloatValue();
|
|
112
|
-
message.value = object.value ?? 0;
|
|
113
|
-
return message;
|
|
114
|
-
},
|
|
115
|
-
};
|
|
116
|
-
function createBaseInt64Value() {
|
|
117
|
-
return { value: 0 };
|
|
118
|
-
}
|
|
119
|
-
exports.Int64Value = {
|
|
120
|
-
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
121
|
-
if (message.value !== 0) {
|
|
122
|
-
writer.uint32(8).int64(message.value);
|
|
123
|
-
}
|
|
124
|
-
return writer;
|
|
125
|
-
},
|
|
126
|
-
decode(input, length) {
|
|
127
|
-
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
128
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
129
|
-
const message = createBaseInt64Value();
|
|
130
|
-
while (reader.pos < end) {
|
|
131
|
-
const tag = reader.uint32();
|
|
132
|
-
switch (tag >>> 3) {
|
|
133
|
-
case 1:
|
|
134
|
-
if (tag !== 8) {
|
|
135
|
-
break;
|
|
136
|
-
}
|
|
137
|
-
message.value = longToNumber(reader.int64());
|
|
138
|
-
continue;
|
|
139
|
-
}
|
|
140
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
141
|
-
break;
|
|
142
|
-
}
|
|
143
|
-
reader.skipType(tag & 7);
|
|
144
|
-
}
|
|
145
|
-
return message;
|
|
146
|
-
},
|
|
147
|
-
fromJSON(object) {
|
|
148
|
-
return { value: isSet(object.value) ? globalThis.Number(object.value) : 0 };
|
|
149
|
-
},
|
|
150
|
-
toJSON(message) {
|
|
151
|
-
const obj = {};
|
|
152
|
-
if (message.value !== 0) {
|
|
153
|
-
obj.value = Math.round(message.value);
|
|
154
|
-
}
|
|
155
|
-
return obj;
|
|
156
|
-
},
|
|
157
|
-
create(base) {
|
|
158
|
-
return exports.Int64Value.fromPartial(base ?? {});
|
|
159
|
-
},
|
|
160
|
-
fromPartial(object) {
|
|
161
|
-
const message = createBaseInt64Value();
|
|
162
|
-
message.value = object.value ?? 0;
|
|
163
|
-
return message;
|
|
164
|
-
},
|
|
165
|
-
};
|
|
166
|
-
function createBaseUInt64Value() {
|
|
167
|
-
return { value: 0 };
|
|
168
|
-
}
|
|
169
|
-
exports.UInt64Value = {
|
|
170
|
-
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
171
|
-
if (message.value !== 0) {
|
|
172
|
-
writer.uint32(8).uint64(message.value);
|
|
173
|
-
}
|
|
174
|
-
return writer;
|
|
175
|
-
},
|
|
176
|
-
decode(input, length) {
|
|
177
|
-
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
178
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
179
|
-
const message = createBaseUInt64Value();
|
|
180
|
-
while (reader.pos < end) {
|
|
181
|
-
const tag = reader.uint32();
|
|
182
|
-
switch (tag >>> 3) {
|
|
183
|
-
case 1:
|
|
184
|
-
if (tag !== 8) {
|
|
185
|
-
break;
|
|
186
|
-
}
|
|
187
|
-
message.value = longToNumber(reader.uint64());
|
|
188
|
-
continue;
|
|
189
|
-
}
|
|
190
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
191
|
-
break;
|
|
192
|
-
}
|
|
193
|
-
reader.skipType(tag & 7);
|
|
194
|
-
}
|
|
195
|
-
return message;
|
|
196
|
-
},
|
|
197
|
-
fromJSON(object) {
|
|
198
|
-
return { value: isSet(object.value) ? globalThis.Number(object.value) : 0 };
|
|
199
|
-
},
|
|
200
|
-
toJSON(message) {
|
|
201
|
-
const obj = {};
|
|
202
|
-
if (message.value !== 0) {
|
|
203
|
-
obj.value = Math.round(message.value);
|
|
204
|
-
}
|
|
205
|
-
return obj;
|
|
206
|
-
},
|
|
207
|
-
create(base) {
|
|
208
|
-
return exports.UInt64Value.fromPartial(base ?? {});
|
|
209
|
-
},
|
|
210
|
-
fromPartial(object) {
|
|
211
|
-
const message = createBaseUInt64Value();
|
|
212
|
-
message.value = object.value ?? 0;
|
|
213
|
-
return message;
|
|
214
|
-
},
|
|
215
|
-
};
|
|
216
|
-
function createBaseInt32Value() {
|
|
217
|
-
return { value: 0 };
|
|
218
|
-
}
|
|
219
|
-
exports.Int32Value = {
|
|
220
|
-
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
221
|
-
if (message.value !== 0) {
|
|
222
|
-
writer.uint32(8).int32(message.value);
|
|
223
|
-
}
|
|
224
|
-
return writer;
|
|
225
|
-
},
|
|
226
|
-
decode(input, length) {
|
|
227
|
-
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
228
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
229
|
-
const message = createBaseInt32Value();
|
|
230
|
-
while (reader.pos < end) {
|
|
231
|
-
const tag = reader.uint32();
|
|
232
|
-
switch (tag >>> 3) {
|
|
233
|
-
case 1:
|
|
234
|
-
if (tag !== 8) {
|
|
235
|
-
break;
|
|
236
|
-
}
|
|
237
|
-
message.value = reader.int32();
|
|
238
|
-
continue;
|
|
239
|
-
}
|
|
240
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
241
|
-
break;
|
|
242
|
-
}
|
|
243
|
-
reader.skipType(tag & 7);
|
|
244
|
-
}
|
|
245
|
-
return message;
|
|
246
|
-
},
|
|
247
|
-
fromJSON(object) {
|
|
248
|
-
return { value: isSet(object.value) ? globalThis.Number(object.value) : 0 };
|
|
249
|
-
},
|
|
250
|
-
toJSON(message) {
|
|
251
|
-
const obj = {};
|
|
252
|
-
if (message.value !== 0) {
|
|
253
|
-
obj.value = Math.round(message.value);
|
|
254
|
-
}
|
|
255
|
-
return obj;
|
|
256
|
-
},
|
|
257
|
-
create(base) {
|
|
258
|
-
return exports.Int32Value.fromPartial(base ?? {});
|
|
259
|
-
},
|
|
260
|
-
fromPartial(object) {
|
|
261
|
-
const message = createBaseInt32Value();
|
|
262
|
-
message.value = object.value ?? 0;
|
|
263
|
-
return message;
|
|
264
|
-
},
|
|
265
|
-
};
|
|
266
|
-
function createBaseUInt32Value() {
|
|
267
|
-
return { value: 0 };
|
|
268
|
-
}
|
|
269
|
-
exports.UInt32Value = {
|
|
270
|
-
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
271
|
-
if (message.value !== 0) {
|
|
272
|
-
writer.uint32(8).uint32(message.value);
|
|
273
|
-
}
|
|
274
|
-
return writer;
|
|
275
|
-
},
|
|
276
|
-
decode(input, length) {
|
|
277
|
-
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
278
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
279
|
-
const message = createBaseUInt32Value();
|
|
280
|
-
while (reader.pos < end) {
|
|
281
|
-
const tag = reader.uint32();
|
|
282
|
-
switch (tag >>> 3) {
|
|
283
|
-
case 1:
|
|
284
|
-
if (tag !== 8) {
|
|
285
|
-
break;
|
|
286
|
-
}
|
|
287
|
-
message.value = reader.uint32();
|
|
288
|
-
continue;
|
|
289
|
-
}
|
|
290
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
291
|
-
break;
|
|
292
|
-
}
|
|
293
|
-
reader.skipType(tag & 7);
|
|
294
|
-
}
|
|
295
|
-
return message;
|
|
296
|
-
},
|
|
297
|
-
fromJSON(object) {
|
|
298
|
-
return { value: isSet(object.value) ? globalThis.Number(object.value) : 0 };
|
|
299
|
-
},
|
|
300
|
-
toJSON(message) {
|
|
301
|
-
const obj = {};
|
|
302
|
-
if (message.value !== 0) {
|
|
303
|
-
obj.value = Math.round(message.value);
|
|
304
|
-
}
|
|
305
|
-
return obj;
|
|
306
|
-
},
|
|
307
|
-
create(base) {
|
|
308
|
-
return exports.UInt32Value.fromPartial(base ?? {});
|
|
309
|
-
},
|
|
310
|
-
fromPartial(object) {
|
|
311
|
-
const message = createBaseUInt32Value();
|
|
312
|
-
message.value = object.value ?? 0;
|
|
313
|
-
return message;
|
|
314
|
-
},
|
|
315
|
-
};
|
|
316
|
-
function createBaseBoolValue() {
|
|
317
|
-
return { value: false };
|
|
318
|
-
}
|
|
319
|
-
exports.BoolValue = {
|
|
320
|
-
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
321
|
-
if (message.value !== false) {
|
|
322
|
-
writer.uint32(8).bool(message.value);
|
|
323
|
-
}
|
|
324
|
-
return writer;
|
|
325
|
-
},
|
|
326
|
-
decode(input, length) {
|
|
327
|
-
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
328
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
329
|
-
const message = createBaseBoolValue();
|
|
330
|
-
while (reader.pos < end) {
|
|
331
|
-
const tag = reader.uint32();
|
|
332
|
-
switch (tag >>> 3) {
|
|
333
|
-
case 1:
|
|
334
|
-
if (tag !== 8) {
|
|
335
|
-
break;
|
|
336
|
-
}
|
|
337
|
-
message.value = reader.bool();
|
|
338
|
-
continue;
|
|
339
|
-
}
|
|
340
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
341
|
-
break;
|
|
342
|
-
}
|
|
343
|
-
reader.skipType(tag & 7);
|
|
344
|
-
}
|
|
345
|
-
return message;
|
|
346
|
-
},
|
|
347
|
-
fromJSON(object) {
|
|
348
|
-
return { value: isSet(object.value) ? globalThis.Boolean(object.value) : false };
|
|
349
|
-
},
|
|
350
|
-
toJSON(message) {
|
|
351
|
-
const obj = {};
|
|
352
|
-
if (message.value !== false) {
|
|
353
|
-
obj.value = message.value;
|
|
354
|
-
}
|
|
355
|
-
return obj;
|
|
356
|
-
},
|
|
357
|
-
create(base) {
|
|
358
|
-
return exports.BoolValue.fromPartial(base ?? {});
|
|
359
|
-
},
|
|
360
|
-
fromPartial(object) {
|
|
361
|
-
const message = createBaseBoolValue();
|
|
362
|
-
message.value = object.value ?? false;
|
|
363
|
-
return message;
|
|
364
|
-
},
|
|
365
|
-
};
|
|
366
|
-
function createBaseStringValue() {
|
|
367
|
-
return { value: "" };
|
|
368
|
-
}
|
|
369
|
-
exports.StringValue = {
|
|
370
|
-
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
371
|
-
if (message.value !== "") {
|
|
372
|
-
writer.uint32(10).string(message.value);
|
|
373
|
-
}
|
|
374
|
-
return writer;
|
|
375
|
-
},
|
|
376
|
-
decode(input, length) {
|
|
377
|
-
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
378
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
379
|
-
const message = createBaseStringValue();
|
|
380
|
-
while (reader.pos < end) {
|
|
381
|
-
const tag = reader.uint32();
|
|
382
|
-
switch (tag >>> 3) {
|
|
383
|
-
case 1:
|
|
384
|
-
if (tag !== 10) {
|
|
385
|
-
break;
|
|
386
|
-
}
|
|
387
|
-
message.value = reader.string();
|
|
388
|
-
continue;
|
|
389
|
-
}
|
|
390
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
391
|
-
break;
|
|
392
|
-
}
|
|
393
|
-
reader.skipType(tag & 7);
|
|
394
|
-
}
|
|
395
|
-
return message;
|
|
396
|
-
},
|
|
397
|
-
fromJSON(object) {
|
|
398
|
-
return { value: isSet(object.value) ? globalThis.String(object.value) : "" };
|
|
399
|
-
},
|
|
400
|
-
toJSON(message) {
|
|
401
|
-
const obj = {};
|
|
402
|
-
if (message.value !== "") {
|
|
403
|
-
obj.value = message.value;
|
|
404
|
-
}
|
|
405
|
-
return obj;
|
|
406
|
-
},
|
|
407
|
-
create(base) {
|
|
408
|
-
return exports.StringValue.fromPartial(base ?? {});
|
|
409
|
-
},
|
|
410
|
-
fromPartial(object) {
|
|
411
|
-
const message = createBaseStringValue();
|
|
412
|
-
message.value = object.value ?? "";
|
|
413
|
-
return message;
|
|
414
|
-
},
|
|
415
|
-
};
|
|
416
|
-
function createBaseBytesValue() {
|
|
417
|
-
return { value: new Uint8Array(0) };
|
|
418
|
-
}
|
|
419
|
-
exports.BytesValue = {
|
|
420
|
-
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
421
|
-
if (message.value.length !== 0) {
|
|
422
|
-
writer.uint32(10).bytes(message.value);
|
|
423
|
-
}
|
|
424
|
-
return writer;
|
|
425
|
-
},
|
|
426
|
-
decode(input, length) {
|
|
427
|
-
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
428
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
429
|
-
const message = createBaseBytesValue();
|
|
430
|
-
while (reader.pos < end) {
|
|
431
|
-
const tag = reader.uint32();
|
|
432
|
-
switch (tag >>> 3) {
|
|
433
|
-
case 1:
|
|
434
|
-
if (tag !== 10) {
|
|
435
|
-
break;
|
|
436
|
-
}
|
|
437
|
-
message.value = reader.bytes();
|
|
438
|
-
continue;
|
|
439
|
-
}
|
|
440
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
441
|
-
break;
|
|
442
|
-
}
|
|
443
|
-
reader.skipType(tag & 7);
|
|
444
|
-
}
|
|
445
|
-
return message;
|
|
446
|
-
},
|
|
447
|
-
fromJSON(object) {
|
|
448
|
-
return { value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0) };
|
|
449
|
-
},
|
|
450
|
-
toJSON(message) {
|
|
451
|
-
const obj = {};
|
|
452
|
-
if (message.value.length !== 0) {
|
|
453
|
-
obj.value = base64FromBytes(message.value);
|
|
454
|
-
}
|
|
455
|
-
return obj;
|
|
456
|
-
},
|
|
457
|
-
create(base) {
|
|
458
|
-
return exports.BytesValue.fromPartial(base ?? {});
|
|
459
|
-
},
|
|
460
|
-
fromPartial(object) {
|
|
461
|
-
const message = createBaseBytesValue();
|
|
462
|
-
message.value = object.value ?? new Uint8Array(0);
|
|
463
|
-
return message;
|
|
464
|
-
},
|
|
465
|
-
};
|
|
466
|
-
function bytesFromBase64(b64) {
|
|
467
|
-
if (globalThis.Buffer) {
|
|
468
|
-
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
469
|
-
}
|
|
470
|
-
else {
|
|
471
|
-
const bin = globalThis.atob(b64);
|
|
472
|
-
const arr = new Uint8Array(bin.length);
|
|
473
|
-
for (let i = 0; i < bin.length; ++i) {
|
|
474
|
-
arr[i] = bin.charCodeAt(i);
|
|
475
|
-
}
|
|
476
|
-
return arr;
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
function base64FromBytes(arr) {
|
|
480
|
-
if (globalThis.Buffer) {
|
|
481
|
-
return globalThis.Buffer.from(arr).toString("base64");
|
|
482
|
-
}
|
|
483
|
-
else {
|
|
484
|
-
const bin = [];
|
|
485
|
-
arr.forEach((byte) => {
|
|
486
|
-
bin.push(globalThis.String.fromCharCode(byte));
|
|
487
|
-
});
|
|
488
|
-
return globalThis.btoa(bin.join(""));
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
function longToNumber(long) {
|
|
492
|
-
if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
|
|
493
|
-
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
494
|
-
}
|
|
495
|
-
if (long.lt(globalThis.Number.MIN_SAFE_INTEGER)) {
|
|
496
|
-
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
497
|
-
}
|
|
498
|
-
return long.toNumber();
|
|
499
|
-
}
|
|
500
|
-
if (minimal_1.default.util.Long !== long_1.default) {
|
|
501
|
-
minimal_1.default.util.Long = long_1.default;
|
|
502
|
-
minimal_1.default.configure();
|
|
503
|
-
}
|
|
504
|
-
function isSet(value) {
|
|
505
|
-
return value !== null && value !== undefined;
|
|
506
|
-
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { MEZON_GW_URL, SOCKET_READY_MAX_RETRY, SOCKET_READY_RETRY_DELAY, CLAN_DM, DEFAULT_SERVER_KEY, CHANNEL_TYPE_DM, CHANNEL_TYPE_GROUP, STREAM_MODE_DM, STREAM_MODE_GROUP, } from './constants';
|
|
2
|
-
export type { ClientInitConfig, AuthenticateConfig, SendMessagePayload, } from "./types";
|
|
3
|
-
export { LightClient, AuthenticationError, SessionError, } from './client';
|
|
4
|
-
export { LightSocket, SocketError, } from './socket';
|
|
5
|
-
export type { SocketConnectOptions, ChannelMessageHandler, } from './socket';
|
package/dist/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SocketError = exports.LightSocket = exports.SessionError = exports.AuthenticationError = exports.LightClient = exports.STREAM_MODE_GROUP = exports.STREAM_MODE_DM = exports.CHANNEL_TYPE_GROUP = exports.CHANNEL_TYPE_DM = exports.DEFAULT_SERVER_KEY = exports.CLAN_DM = exports.SOCKET_READY_RETRY_DELAY = exports.SOCKET_READY_MAX_RETRY = exports.MEZON_GW_URL = void 0;
|
|
4
|
-
var constants_1 = require("./constants");
|
|
5
|
-
Object.defineProperty(exports, "MEZON_GW_URL", { enumerable: true, get: function () { return constants_1.MEZON_GW_URL; } });
|
|
6
|
-
Object.defineProperty(exports, "SOCKET_READY_MAX_RETRY", { enumerable: true, get: function () { return constants_1.SOCKET_READY_MAX_RETRY; } });
|
|
7
|
-
Object.defineProperty(exports, "SOCKET_READY_RETRY_DELAY", { enumerable: true, get: function () { return constants_1.SOCKET_READY_RETRY_DELAY; } });
|
|
8
|
-
Object.defineProperty(exports, "CLAN_DM", { enumerable: true, get: function () { return constants_1.CLAN_DM; } });
|
|
9
|
-
Object.defineProperty(exports, "DEFAULT_SERVER_KEY", { enumerable: true, get: function () { return constants_1.DEFAULT_SERVER_KEY; } });
|
|
10
|
-
Object.defineProperty(exports, "CHANNEL_TYPE_DM", { enumerable: true, get: function () { return constants_1.CHANNEL_TYPE_DM; } });
|
|
11
|
-
Object.defineProperty(exports, "CHANNEL_TYPE_GROUP", { enumerable: true, get: function () { return constants_1.CHANNEL_TYPE_GROUP; } });
|
|
12
|
-
Object.defineProperty(exports, "STREAM_MODE_DM", { enumerable: true, get: function () { return constants_1.STREAM_MODE_DM; } });
|
|
13
|
-
Object.defineProperty(exports, "STREAM_MODE_GROUP", { enumerable: true, get: function () { return constants_1.STREAM_MODE_GROUP; } });
|
|
14
|
-
var client_1 = require("./client");
|
|
15
|
-
Object.defineProperty(exports, "LightClient", { enumerable: true, get: function () { return client_1.LightClient; } });
|
|
16
|
-
Object.defineProperty(exports, "AuthenticationError", { enumerable: true, get: function () { return client_1.AuthenticationError; } });
|
|
17
|
-
Object.defineProperty(exports, "SessionError", { enumerable: true, get: function () { return client_1.SessionError; } });
|
|
18
|
-
var socket_1 = require("./socket");
|
|
19
|
-
Object.defineProperty(exports, "LightSocket", { enumerable: true, get: function () { return socket_1.LightSocket; } });
|
|
20
|
-
Object.defineProperty(exports, "SocketError", { enumerable: true, get: function () { return socket_1.SocketError; } });
|