mezon-js 2.13.71 → 2.13.73
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 +177 -24
- package/api.gen.ts +41 -83
- package/dist/api/api.d.ts +151 -7
- package/dist/api.gen.d.ts +11 -22
- package/dist/mezon-js.cjs.js +595 -73
- package/dist/mezon-js.esm.mjs +595 -73
- package/package.json +1 -1
package/dist/mezon-js.cjs.js
CHANGED
|
@@ -1555,7 +1555,7 @@ var require_minimal = __commonJS({
|
|
|
1555
1555
|
util.isString = function isString(value) {
|
|
1556
1556
|
return typeof value === "string" || value instanceof String;
|
|
1557
1557
|
};
|
|
1558
|
-
util.isObject = function
|
|
1558
|
+
util.isObject = function isObject2(value) {
|
|
1559
1559
|
return value && typeof value === "object";
|
|
1560
1560
|
};
|
|
1561
1561
|
util.isset = /**
|
|
@@ -2295,7 +2295,7 @@ __export(index_exports, {
|
|
|
2295
2295
|
ConnectionState: () => ConnectionState,
|
|
2296
2296
|
DefaultSocket: () => DefaultSocket,
|
|
2297
2297
|
NotificationType: () => NotificationType,
|
|
2298
|
-
Session: () =>
|
|
2298
|
+
Session: () => Session2,
|
|
2299
2299
|
WebSocketAdapterText: () => WebSocketAdapterText,
|
|
2300
2300
|
WebrtcSignalingType: () => WebrtcSignalingType,
|
|
2301
2301
|
b64DecodeUnicode: () => b64DecodeUnicode,
|
|
@@ -3113,6 +3113,57 @@ var Int32Value = {
|
|
|
3113
3113
|
return message;
|
|
3114
3114
|
}
|
|
3115
3115
|
};
|
|
3116
|
+
function createBaseBoolValue() {
|
|
3117
|
+
return { value: false };
|
|
3118
|
+
}
|
|
3119
|
+
var BoolValue = {
|
|
3120
|
+
encode(message, writer = import_minimal3.default.Writer.create()) {
|
|
3121
|
+
if (message.value !== false) {
|
|
3122
|
+
writer.uint32(8).bool(message.value);
|
|
3123
|
+
}
|
|
3124
|
+
return writer;
|
|
3125
|
+
},
|
|
3126
|
+
decode(input, length) {
|
|
3127
|
+
const reader = input instanceof import_minimal3.default.Reader ? input : import_minimal3.default.Reader.create(input);
|
|
3128
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3129
|
+
const message = createBaseBoolValue();
|
|
3130
|
+
while (reader.pos < end) {
|
|
3131
|
+
const tag = reader.uint32();
|
|
3132
|
+
switch (tag >>> 3) {
|
|
3133
|
+
case 1:
|
|
3134
|
+
if (tag !== 8) {
|
|
3135
|
+
break;
|
|
3136
|
+
}
|
|
3137
|
+
message.value = reader.bool();
|
|
3138
|
+
continue;
|
|
3139
|
+
}
|
|
3140
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3141
|
+
break;
|
|
3142
|
+
}
|
|
3143
|
+
reader.skipType(tag & 7);
|
|
3144
|
+
}
|
|
3145
|
+
return message;
|
|
3146
|
+
},
|
|
3147
|
+
fromJSON(object) {
|
|
3148
|
+
return { value: isSet2(object.value) ? globalThis.Boolean(object.value) : false };
|
|
3149
|
+
},
|
|
3150
|
+
toJSON(message) {
|
|
3151
|
+
const obj = {};
|
|
3152
|
+
if (message.value !== false) {
|
|
3153
|
+
obj.value = message.value;
|
|
3154
|
+
}
|
|
3155
|
+
return obj;
|
|
3156
|
+
},
|
|
3157
|
+
create(base) {
|
|
3158
|
+
return BoolValue.fromPartial(base != null ? base : {});
|
|
3159
|
+
},
|
|
3160
|
+
fromPartial(object) {
|
|
3161
|
+
var _a;
|
|
3162
|
+
const message = createBaseBoolValue();
|
|
3163
|
+
message.value = (_a = object.value) != null ? _a : false;
|
|
3164
|
+
return message;
|
|
3165
|
+
}
|
|
3166
|
+
};
|
|
3116
3167
|
if (import_minimal3.default.util.Long !== import_long2.default) {
|
|
3117
3168
|
import_minimal3.default.util.Long = import_long2.default;
|
|
3118
3169
|
import_minimal3.default.configure();
|
|
@@ -3297,6 +3348,171 @@ var Account = {
|
|
|
3297
3348
|
return message;
|
|
3298
3349
|
}
|
|
3299
3350
|
};
|
|
3351
|
+
function createBaseSessionRefreshRequest() {
|
|
3352
|
+
return { token: "", vars: {}, is_remember: void 0 };
|
|
3353
|
+
}
|
|
3354
|
+
var SessionRefreshRequest = {
|
|
3355
|
+
encode(message, writer = import_minimal4.default.Writer.create()) {
|
|
3356
|
+
if (message.token !== "") {
|
|
3357
|
+
writer.uint32(10).string(message.token);
|
|
3358
|
+
}
|
|
3359
|
+
Object.entries(message.vars).forEach(([key, value]) => {
|
|
3360
|
+
SessionRefreshRequest_VarsEntry.encode({ key, value }, writer.uint32(18).fork()).ldelim();
|
|
3361
|
+
});
|
|
3362
|
+
if (message.is_remember !== void 0) {
|
|
3363
|
+
BoolValue.encode({ value: message.is_remember }, writer.uint32(26).fork()).ldelim();
|
|
3364
|
+
}
|
|
3365
|
+
return writer;
|
|
3366
|
+
},
|
|
3367
|
+
decode(input, length) {
|
|
3368
|
+
const reader = input instanceof import_minimal4.default.Reader ? input : import_minimal4.default.Reader.create(input);
|
|
3369
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3370
|
+
const message = createBaseSessionRefreshRequest();
|
|
3371
|
+
while (reader.pos < end) {
|
|
3372
|
+
const tag = reader.uint32();
|
|
3373
|
+
switch (tag >>> 3) {
|
|
3374
|
+
case 1:
|
|
3375
|
+
if (tag !== 10) {
|
|
3376
|
+
break;
|
|
3377
|
+
}
|
|
3378
|
+
message.token = reader.string();
|
|
3379
|
+
continue;
|
|
3380
|
+
case 2:
|
|
3381
|
+
if (tag !== 18) {
|
|
3382
|
+
break;
|
|
3383
|
+
}
|
|
3384
|
+
const entry2 = SessionRefreshRequest_VarsEntry.decode(reader, reader.uint32());
|
|
3385
|
+
if (entry2.value !== void 0) {
|
|
3386
|
+
message.vars[entry2.key] = entry2.value;
|
|
3387
|
+
}
|
|
3388
|
+
continue;
|
|
3389
|
+
case 3:
|
|
3390
|
+
if (tag !== 26) {
|
|
3391
|
+
break;
|
|
3392
|
+
}
|
|
3393
|
+
message.is_remember = BoolValue.decode(reader, reader.uint32()).value;
|
|
3394
|
+
continue;
|
|
3395
|
+
}
|
|
3396
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3397
|
+
break;
|
|
3398
|
+
}
|
|
3399
|
+
reader.skipType(tag & 7);
|
|
3400
|
+
}
|
|
3401
|
+
return message;
|
|
3402
|
+
},
|
|
3403
|
+
fromJSON(object) {
|
|
3404
|
+
return {
|
|
3405
|
+
token: isSet3(object.token) ? globalThis.String(object.token) : "",
|
|
3406
|
+
vars: isObject(object.vars) ? Object.entries(object.vars).reduce((acc, [key, value]) => {
|
|
3407
|
+
acc[key] = String(value);
|
|
3408
|
+
return acc;
|
|
3409
|
+
}, {}) : {},
|
|
3410
|
+
is_remember: isSet3(object.is_remember) ? Boolean(object.is_remember) : void 0
|
|
3411
|
+
};
|
|
3412
|
+
},
|
|
3413
|
+
toJSON(message) {
|
|
3414
|
+
const obj = {};
|
|
3415
|
+
if (message.token !== "") {
|
|
3416
|
+
obj.token = message.token;
|
|
3417
|
+
}
|
|
3418
|
+
if (message.vars) {
|
|
3419
|
+
const entries = Object.entries(message.vars);
|
|
3420
|
+
if (entries.length > 0) {
|
|
3421
|
+
obj.vars = {};
|
|
3422
|
+
entries.forEach(([k, v]) => {
|
|
3423
|
+
obj.vars[k] = v;
|
|
3424
|
+
});
|
|
3425
|
+
}
|
|
3426
|
+
}
|
|
3427
|
+
if (message.is_remember !== void 0) {
|
|
3428
|
+
obj.is_remember = message.is_remember;
|
|
3429
|
+
}
|
|
3430
|
+
return obj;
|
|
3431
|
+
},
|
|
3432
|
+
create(base) {
|
|
3433
|
+
return SessionRefreshRequest.fromPartial(base != null ? base : {});
|
|
3434
|
+
},
|
|
3435
|
+
fromPartial(object) {
|
|
3436
|
+
var _a, _b, _c;
|
|
3437
|
+
const message = createBaseSessionRefreshRequest();
|
|
3438
|
+
message.token = (_a = object.token) != null ? _a : "";
|
|
3439
|
+
message.vars = Object.entries((_b = object.vars) != null ? _b : {}).reduce((acc, [key, value]) => {
|
|
3440
|
+
if (value !== void 0) {
|
|
3441
|
+
acc[key] = globalThis.String(value);
|
|
3442
|
+
}
|
|
3443
|
+
return acc;
|
|
3444
|
+
}, {});
|
|
3445
|
+
message.is_remember = (_c = object.is_remember) != null ? _c : void 0;
|
|
3446
|
+
return message;
|
|
3447
|
+
}
|
|
3448
|
+
};
|
|
3449
|
+
function createBaseSessionRefreshRequest_VarsEntry() {
|
|
3450
|
+
return { key: "", value: "" };
|
|
3451
|
+
}
|
|
3452
|
+
var SessionRefreshRequest_VarsEntry = {
|
|
3453
|
+
encode(message, writer = import_minimal4.default.Writer.create()) {
|
|
3454
|
+
if (message.key !== "") {
|
|
3455
|
+
writer.uint32(10).string(message.key);
|
|
3456
|
+
}
|
|
3457
|
+
if (message.value !== "") {
|
|
3458
|
+
writer.uint32(18).string(message.value);
|
|
3459
|
+
}
|
|
3460
|
+
return writer;
|
|
3461
|
+
},
|
|
3462
|
+
decode(input, length) {
|
|
3463
|
+
const reader = input instanceof import_minimal4.default.Reader ? input : import_minimal4.default.Reader.create(input);
|
|
3464
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3465
|
+
const message = createBaseSessionRefreshRequest_VarsEntry();
|
|
3466
|
+
while (reader.pos < end) {
|
|
3467
|
+
const tag = reader.uint32();
|
|
3468
|
+
switch (tag >>> 3) {
|
|
3469
|
+
case 1:
|
|
3470
|
+
if (tag !== 10) {
|
|
3471
|
+
break;
|
|
3472
|
+
}
|
|
3473
|
+
message.key = reader.string();
|
|
3474
|
+
continue;
|
|
3475
|
+
case 2:
|
|
3476
|
+
if (tag !== 18) {
|
|
3477
|
+
break;
|
|
3478
|
+
}
|
|
3479
|
+
message.value = reader.string();
|
|
3480
|
+
continue;
|
|
3481
|
+
}
|
|
3482
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3483
|
+
break;
|
|
3484
|
+
}
|
|
3485
|
+
reader.skipType(tag & 7);
|
|
3486
|
+
}
|
|
3487
|
+
return message;
|
|
3488
|
+
},
|
|
3489
|
+
fromJSON(object) {
|
|
3490
|
+
return {
|
|
3491
|
+
key: isSet3(object.key) ? globalThis.String(object.key) : "",
|
|
3492
|
+
value: isSet3(object.value) ? globalThis.String(object.value) : ""
|
|
3493
|
+
};
|
|
3494
|
+
},
|
|
3495
|
+
toJSON(message) {
|
|
3496
|
+
const obj = {};
|
|
3497
|
+
if (message.key !== "") {
|
|
3498
|
+
obj.key = message.key;
|
|
3499
|
+
}
|
|
3500
|
+
if (message.value !== "") {
|
|
3501
|
+
obj.value = message.value;
|
|
3502
|
+
}
|
|
3503
|
+
return obj;
|
|
3504
|
+
},
|
|
3505
|
+
create(base) {
|
|
3506
|
+
return SessionRefreshRequest_VarsEntry.fromPartial(base != null ? base : {});
|
|
3507
|
+
},
|
|
3508
|
+
fromPartial(object) {
|
|
3509
|
+
var _a, _b;
|
|
3510
|
+
const message = createBaseSessionRefreshRequest_VarsEntry();
|
|
3511
|
+
message.key = (_a = object.key) != null ? _a : "";
|
|
3512
|
+
message.value = (_b = object.value) != null ? _b : "";
|
|
3513
|
+
return message;
|
|
3514
|
+
}
|
|
3515
|
+
};
|
|
3300
3516
|
function createBaseIsBannedResponse() {
|
|
3301
3517
|
return { is_banned: false, expired_ban_time: 0 };
|
|
3302
3518
|
}
|
|
@@ -4912,6 +5128,87 @@ var ClanUserList_ClanUser = {
|
|
|
4912
5128
|
return message;
|
|
4913
5129
|
}
|
|
4914
5130
|
};
|
|
5131
|
+
function createBaseRegistFcmDeviceTokenResponse() {
|
|
5132
|
+
return { token: "", device_id: "", platform: "" };
|
|
5133
|
+
}
|
|
5134
|
+
var RegistFcmDeviceTokenResponse = {
|
|
5135
|
+
encode(message, writer = import_minimal4.default.Writer.create()) {
|
|
5136
|
+
if (message.token !== "") {
|
|
5137
|
+
writer.uint32(10).string(message.token);
|
|
5138
|
+
}
|
|
5139
|
+
if (message.device_id !== "") {
|
|
5140
|
+
writer.uint32(18).string(message.device_id);
|
|
5141
|
+
}
|
|
5142
|
+
if (message.platform !== "") {
|
|
5143
|
+
writer.uint32(26).string(message.platform);
|
|
5144
|
+
}
|
|
5145
|
+
return writer;
|
|
5146
|
+
},
|
|
5147
|
+
decode(input, length) {
|
|
5148
|
+
const reader = input instanceof import_minimal4.default.Reader ? input : import_minimal4.default.Reader.create(input);
|
|
5149
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
5150
|
+
const message = createBaseRegistFcmDeviceTokenResponse();
|
|
5151
|
+
while (reader.pos < end) {
|
|
5152
|
+
const tag = reader.uint32();
|
|
5153
|
+
switch (tag >>> 3) {
|
|
5154
|
+
case 1:
|
|
5155
|
+
if (tag !== 10) {
|
|
5156
|
+
break;
|
|
5157
|
+
}
|
|
5158
|
+
message.token = reader.string();
|
|
5159
|
+
continue;
|
|
5160
|
+
case 2:
|
|
5161
|
+
if (tag !== 18) {
|
|
5162
|
+
break;
|
|
5163
|
+
}
|
|
5164
|
+
message.device_id = reader.string();
|
|
5165
|
+
continue;
|
|
5166
|
+
case 3:
|
|
5167
|
+
if (tag !== 26) {
|
|
5168
|
+
break;
|
|
5169
|
+
}
|
|
5170
|
+
message.platform = reader.string();
|
|
5171
|
+
continue;
|
|
5172
|
+
}
|
|
5173
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
5174
|
+
break;
|
|
5175
|
+
}
|
|
5176
|
+
reader.skipType(tag & 7);
|
|
5177
|
+
}
|
|
5178
|
+
return message;
|
|
5179
|
+
},
|
|
5180
|
+
fromJSON(object) {
|
|
5181
|
+
return {
|
|
5182
|
+
token: isSet3(object.token) ? globalThis.String(object.token) : "",
|
|
5183
|
+
device_id: isSet3(object.device_id) ? globalThis.String(object.device_id) : "",
|
|
5184
|
+
platform: isSet3(object.platform) ? globalThis.String(object.platform) : ""
|
|
5185
|
+
};
|
|
5186
|
+
},
|
|
5187
|
+
toJSON(message) {
|
|
5188
|
+
const obj = {};
|
|
5189
|
+
if (message.token !== "") {
|
|
5190
|
+
obj.token = message.token;
|
|
5191
|
+
}
|
|
5192
|
+
if (message.device_id !== "") {
|
|
5193
|
+
obj.device_id = message.device_id;
|
|
5194
|
+
}
|
|
5195
|
+
if (message.platform !== "") {
|
|
5196
|
+
obj.platform = message.platform;
|
|
5197
|
+
}
|
|
5198
|
+
return obj;
|
|
5199
|
+
},
|
|
5200
|
+
create(base) {
|
|
5201
|
+
return RegistFcmDeviceTokenResponse.fromPartial(base != null ? base : {});
|
|
5202
|
+
},
|
|
5203
|
+
fromPartial(object) {
|
|
5204
|
+
var _a, _b, _c;
|
|
5205
|
+
const message = createBaseRegistFcmDeviceTokenResponse();
|
|
5206
|
+
message.token = (_a = object.token) != null ? _a : "";
|
|
5207
|
+
message.device_id = (_b = object.device_id) != null ? _b : "";
|
|
5208
|
+
message.platform = (_c = object.platform) != null ? _c : "";
|
|
5209
|
+
return message;
|
|
5210
|
+
}
|
|
5211
|
+
};
|
|
4915
5212
|
function createBaseNotification() {
|
|
4916
5213
|
return {
|
|
4917
5214
|
id: "",
|
|
@@ -5365,6 +5662,115 @@ var NotificationList = {
|
|
|
5365
5662
|
return message;
|
|
5366
5663
|
}
|
|
5367
5664
|
};
|
|
5665
|
+
function createBaseSession() {
|
|
5666
|
+
return { created: false, token: "", refresh_token: "", user_id: "", is_remember: false };
|
|
5667
|
+
}
|
|
5668
|
+
var Session = {
|
|
5669
|
+
encode(message, writer = import_minimal4.default.Writer.create()) {
|
|
5670
|
+
if (message.created !== false) {
|
|
5671
|
+
writer.uint32(8).bool(message.created);
|
|
5672
|
+
}
|
|
5673
|
+
if (message.token !== "") {
|
|
5674
|
+
writer.uint32(18).string(message.token);
|
|
5675
|
+
}
|
|
5676
|
+
if (message.refresh_token !== "") {
|
|
5677
|
+
writer.uint32(26).string(message.refresh_token);
|
|
5678
|
+
}
|
|
5679
|
+
if (message.user_id !== "") {
|
|
5680
|
+
writer.uint32(34).string(message.user_id);
|
|
5681
|
+
}
|
|
5682
|
+
if (message.is_remember !== false) {
|
|
5683
|
+
writer.uint32(40).bool(message.is_remember);
|
|
5684
|
+
}
|
|
5685
|
+
return writer;
|
|
5686
|
+
},
|
|
5687
|
+
decode(input, length) {
|
|
5688
|
+
const reader = input instanceof import_minimal4.default.Reader ? input : import_minimal4.default.Reader.create(input);
|
|
5689
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
5690
|
+
const message = createBaseSession();
|
|
5691
|
+
while (reader.pos < end) {
|
|
5692
|
+
const tag = reader.uint32();
|
|
5693
|
+
switch (tag >>> 3) {
|
|
5694
|
+
case 1:
|
|
5695
|
+
if (tag !== 8) {
|
|
5696
|
+
break;
|
|
5697
|
+
}
|
|
5698
|
+
message.created = reader.bool();
|
|
5699
|
+
continue;
|
|
5700
|
+
case 2:
|
|
5701
|
+
if (tag !== 18) {
|
|
5702
|
+
break;
|
|
5703
|
+
}
|
|
5704
|
+
message.token = reader.string();
|
|
5705
|
+
continue;
|
|
5706
|
+
case 3:
|
|
5707
|
+
if (tag !== 26) {
|
|
5708
|
+
break;
|
|
5709
|
+
}
|
|
5710
|
+
message.refresh_token = reader.string();
|
|
5711
|
+
continue;
|
|
5712
|
+
case 4:
|
|
5713
|
+
if (tag !== 34) {
|
|
5714
|
+
break;
|
|
5715
|
+
}
|
|
5716
|
+
message.user_id = reader.string();
|
|
5717
|
+
continue;
|
|
5718
|
+
case 5:
|
|
5719
|
+
if (tag !== 40) {
|
|
5720
|
+
break;
|
|
5721
|
+
}
|
|
5722
|
+
message.is_remember = reader.bool();
|
|
5723
|
+
continue;
|
|
5724
|
+
}
|
|
5725
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
5726
|
+
break;
|
|
5727
|
+
}
|
|
5728
|
+
reader.skipType(tag & 7);
|
|
5729
|
+
}
|
|
5730
|
+
return message;
|
|
5731
|
+
},
|
|
5732
|
+
fromJSON(object) {
|
|
5733
|
+
return {
|
|
5734
|
+
created: isSet3(object.created) ? globalThis.Boolean(object.created) : false,
|
|
5735
|
+
token: isSet3(object.token) ? globalThis.String(object.token) : "",
|
|
5736
|
+
refresh_token: isSet3(object.refresh_token) ? globalThis.String(object.refresh_token) : "",
|
|
5737
|
+
user_id: isSet3(object.user_id) ? globalThis.String(object.user_id) : "",
|
|
5738
|
+
is_remember: isSet3(object.is_remember) ? globalThis.Boolean(object.is_remember) : false
|
|
5739
|
+
};
|
|
5740
|
+
},
|
|
5741
|
+
toJSON(message) {
|
|
5742
|
+
const obj = {};
|
|
5743
|
+
if (message.created !== false) {
|
|
5744
|
+
obj.created = message.created;
|
|
5745
|
+
}
|
|
5746
|
+
if (message.token !== "") {
|
|
5747
|
+
obj.token = message.token;
|
|
5748
|
+
}
|
|
5749
|
+
if (message.refresh_token !== "") {
|
|
5750
|
+
obj.refresh_token = message.refresh_token;
|
|
5751
|
+
}
|
|
5752
|
+
if (message.user_id !== "") {
|
|
5753
|
+
obj.user_id = message.user_id;
|
|
5754
|
+
}
|
|
5755
|
+
if (message.is_remember !== false) {
|
|
5756
|
+
obj.is_remember = message.is_remember;
|
|
5757
|
+
}
|
|
5758
|
+
return obj;
|
|
5759
|
+
},
|
|
5760
|
+
create(base) {
|
|
5761
|
+
return Session.fromPartial(base != null ? base : {});
|
|
5762
|
+
},
|
|
5763
|
+
fromPartial(object) {
|
|
5764
|
+
var _a, _b, _c, _d, _e;
|
|
5765
|
+
const message = createBaseSession();
|
|
5766
|
+
message.created = (_a = object.created) != null ? _a : false;
|
|
5767
|
+
message.token = (_b = object.token) != null ? _b : "";
|
|
5768
|
+
message.refresh_token = (_c = object.refresh_token) != null ? _c : "";
|
|
5769
|
+
message.user_id = (_d = object.user_id) != null ? _d : "";
|
|
5770
|
+
message.is_remember = (_e = object.is_remember) != null ? _e : false;
|
|
5771
|
+
return message;
|
|
5772
|
+
}
|
|
5773
|
+
};
|
|
5368
5774
|
function createBaseUser() {
|
|
5369
5775
|
return {
|
|
5370
5776
|
id: "",
|
|
@@ -14371,28 +14777,107 @@ var QuickMenuAccessList = {
|
|
|
14371
14777
|
}
|
|
14372
14778
|
};
|
|
14373
14779
|
function createBaseLogedDeviceList() {
|
|
14374
|
-
return {
|
|
14780
|
+
return { devices: [] };
|
|
14375
14781
|
}
|
|
14376
14782
|
var LogedDeviceList = {
|
|
14377
14783
|
encode(message, writer = import_minimal4.default.Writer.create()) {
|
|
14784
|
+
for (const v of message.devices) {
|
|
14785
|
+
LogedDevice.encode(v, writer.uint32(10).fork()).ldelim();
|
|
14786
|
+
}
|
|
14787
|
+
return writer;
|
|
14788
|
+
},
|
|
14789
|
+
decode(input, length) {
|
|
14790
|
+
const reader = input instanceof import_minimal4.default.Reader ? input : import_minimal4.default.Reader.create(input);
|
|
14791
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
14792
|
+
const message = createBaseLogedDeviceList();
|
|
14793
|
+
while (reader.pos < end) {
|
|
14794
|
+
const tag = reader.uint32();
|
|
14795
|
+
switch (tag >>> 3) {
|
|
14796
|
+
case 1:
|
|
14797
|
+
if (tag !== 10) {
|
|
14798
|
+
break;
|
|
14799
|
+
}
|
|
14800
|
+
message.devices.push(LogedDevice.decode(reader, reader.uint32()));
|
|
14801
|
+
continue;
|
|
14802
|
+
}
|
|
14803
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
14804
|
+
break;
|
|
14805
|
+
}
|
|
14806
|
+
reader.skipType(tag & 7);
|
|
14807
|
+
}
|
|
14808
|
+
return message;
|
|
14809
|
+
},
|
|
14810
|
+
fromJSON(object) {
|
|
14811
|
+
return {
|
|
14812
|
+
devices: globalThis.Array.isArray(object == null ? void 0 : object.devices) ? object.devices.map((e) => LogedDevice.fromJSON(e)) : []
|
|
14813
|
+
};
|
|
14814
|
+
},
|
|
14815
|
+
toJSON(message) {
|
|
14816
|
+
var _a;
|
|
14817
|
+
const obj = {};
|
|
14818
|
+
if ((_a = message.devices) == null ? void 0 : _a.length) {
|
|
14819
|
+
obj.devices = message.devices.map((e) => LogedDevice.toJSON(e));
|
|
14820
|
+
}
|
|
14821
|
+
return obj;
|
|
14822
|
+
},
|
|
14823
|
+
create(base) {
|
|
14824
|
+
return LogedDeviceList.fromPartial(base != null ? base : {});
|
|
14825
|
+
},
|
|
14826
|
+
fromPartial(object) {
|
|
14827
|
+
var _a;
|
|
14828
|
+
const message = createBaseLogedDeviceList();
|
|
14829
|
+
message.devices = ((_a = object.devices) == null ? void 0 : _a.map((e) => LogedDevice.fromPartial(e))) || [];
|
|
14830
|
+
return message;
|
|
14831
|
+
}
|
|
14832
|
+
};
|
|
14833
|
+
function createBaseLogedDevice() {
|
|
14834
|
+
return {
|
|
14835
|
+
device_id: "",
|
|
14836
|
+
device_name: "",
|
|
14837
|
+
login_at: void 0,
|
|
14838
|
+
status: 0,
|
|
14839
|
+
platform: "",
|
|
14840
|
+
ip: "",
|
|
14841
|
+
last_active: void 0,
|
|
14842
|
+
location: "",
|
|
14843
|
+
is_current_device: false
|
|
14844
|
+
};
|
|
14845
|
+
}
|
|
14846
|
+
var LogedDevice = {
|
|
14847
|
+
encode(message, writer = import_minimal4.default.Writer.create()) {
|
|
14848
|
+
if (message.device_id !== "") {
|
|
14849
|
+
writer.uint32(10).string(message.device_id);
|
|
14850
|
+
}
|
|
14378
14851
|
if (message.device_name !== "") {
|
|
14379
|
-
writer.uint32(
|
|
14852
|
+
writer.uint32(18).string(message.device_name);
|
|
14380
14853
|
}
|
|
14381
|
-
if (message.
|
|
14382
|
-
Timestamp.encode(toTimestamp(message.
|
|
14854
|
+
if (message.login_at !== void 0) {
|
|
14855
|
+
Timestamp.encode(toTimestamp(message.login_at), writer.uint32(26).fork()).ldelim();
|
|
14383
14856
|
}
|
|
14384
14857
|
if (message.status !== 0) {
|
|
14385
|
-
writer.uint32(
|
|
14858
|
+
writer.uint32(32).int32(message.status);
|
|
14386
14859
|
}
|
|
14387
14860
|
if (message.platform !== "") {
|
|
14388
|
-
writer.uint32(
|
|
14861
|
+
writer.uint32(42).string(message.platform);
|
|
14862
|
+
}
|
|
14863
|
+
if (message.ip !== "") {
|
|
14864
|
+
writer.uint32(50).string(message.ip);
|
|
14865
|
+
}
|
|
14866
|
+
if (message.last_active !== void 0) {
|
|
14867
|
+
Timestamp.encode(toTimestamp(message.last_active), writer.uint32(58).fork()).ldelim();
|
|
14868
|
+
}
|
|
14869
|
+
if (message.location !== "") {
|
|
14870
|
+
writer.uint32(66).string(message.location);
|
|
14871
|
+
}
|
|
14872
|
+
if (message.is_current_device !== false) {
|
|
14873
|
+
writer.uint32(72).bool(message.is_current_device);
|
|
14389
14874
|
}
|
|
14390
14875
|
return writer;
|
|
14391
14876
|
},
|
|
14392
14877
|
decode(input, length) {
|
|
14393
14878
|
const reader = input instanceof import_minimal4.default.Reader ? input : import_minimal4.default.Reader.create(input);
|
|
14394
14879
|
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
14395
|
-
const message =
|
|
14880
|
+
const message = createBaseLogedDevice();
|
|
14396
14881
|
while (reader.pos < end) {
|
|
14397
14882
|
const tag = reader.uint32();
|
|
14398
14883
|
switch (tag >>> 3) {
|
|
@@ -14400,26 +14885,56 @@ var LogedDeviceList = {
|
|
|
14400
14885
|
if (tag !== 10) {
|
|
14401
14886
|
break;
|
|
14402
14887
|
}
|
|
14403
|
-
message.
|
|
14888
|
+
message.device_id = reader.string();
|
|
14404
14889
|
continue;
|
|
14405
14890
|
case 2:
|
|
14406
14891
|
if (tag !== 18) {
|
|
14407
14892
|
break;
|
|
14408
14893
|
}
|
|
14409
|
-
message.
|
|
14894
|
+
message.device_name = reader.string();
|
|
14410
14895
|
continue;
|
|
14411
14896
|
case 3:
|
|
14412
|
-
if (tag !==
|
|
14897
|
+
if (tag !== 26) {
|
|
14413
14898
|
break;
|
|
14414
14899
|
}
|
|
14415
|
-
message.
|
|
14900
|
+
message.login_at = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
14416
14901
|
continue;
|
|
14417
14902
|
case 4:
|
|
14418
|
-
if (tag !==
|
|
14903
|
+
if (tag !== 32) {
|
|
14904
|
+
break;
|
|
14905
|
+
}
|
|
14906
|
+
message.status = reader.int32();
|
|
14907
|
+
continue;
|
|
14908
|
+
case 5:
|
|
14909
|
+
if (tag !== 42) {
|
|
14419
14910
|
break;
|
|
14420
14911
|
}
|
|
14421
14912
|
message.platform = reader.string();
|
|
14422
14913
|
continue;
|
|
14914
|
+
case 6:
|
|
14915
|
+
if (tag !== 50) {
|
|
14916
|
+
break;
|
|
14917
|
+
}
|
|
14918
|
+
message.ip = reader.string();
|
|
14919
|
+
continue;
|
|
14920
|
+
case 7:
|
|
14921
|
+
if (tag !== 58) {
|
|
14922
|
+
break;
|
|
14923
|
+
}
|
|
14924
|
+
message.last_active = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
14925
|
+
continue;
|
|
14926
|
+
case 8:
|
|
14927
|
+
if (tag !== 66) {
|
|
14928
|
+
break;
|
|
14929
|
+
}
|
|
14930
|
+
message.location = reader.string();
|
|
14931
|
+
continue;
|
|
14932
|
+
case 9:
|
|
14933
|
+
if (tag !== 72) {
|
|
14934
|
+
break;
|
|
14935
|
+
}
|
|
14936
|
+
message.is_current_device = reader.bool();
|
|
14937
|
+
continue;
|
|
14423
14938
|
}
|
|
14424
14939
|
if ((tag & 7) === 4 || tag === 0) {
|
|
14425
14940
|
break;
|
|
@@ -14430,19 +14945,27 @@ var LogedDeviceList = {
|
|
|
14430
14945
|
},
|
|
14431
14946
|
fromJSON(object) {
|
|
14432
14947
|
return {
|
|
14948
|
+
device_id: isSet3(object.device_id) ? globalThis.String(object.device_id) : "",
|
|
14433
14949
|
device_name: isSet3(object.device_name) ? globalThis.String(object.device_name) : "",
|
|
14434
|
-
|
|
14950
|
+
login_at: isSet3(object.login_at) ? fromJsonTimestamp(object.login_at) : void 0,
|
|
14435
14951
|
status: isSet3(object.status) ? globalThis.Number(object.status) : 0,
|
|
14436
|
-
platform: isSet3(object.platform) ? globalThis.String(object.platform) : ""
|
|
14952
|
+
platform: isSet3(object.platform) ? globalThis.String(object.platform) : "",
|
|
14953
|
+
ip: isSet3(object.ip) ? globalThis.String(object.ip) : "",
|
|
14954
|
+
last_active: isSet3(object.last_active) ? fromJsonTimestamp(object.last_active) : void 0,
|
|
14955
|
+
location: isSet3(object.location) ? globalThis.String(object.location) : "",
|
|
14956
|
+
is_current_device: isSet3(object.is_current_device) ? globalThis.Boolean(object.is_current_device) : false
|
|
14437
14957
|
};
|
|
14438
14958
|
},
|
|
14439
14959
|
toJSON(message) {
|
|
14440
14960
|
const obj = {};
|
|
14961
|
+
if (message.device_id !== "") {
|
|
14962
|
+
obj.device_id = message.device_id;
|
|
14963
|
+
}
|
|
14441
14964
|
if (message.device_name !== "") {
|
|
14442
14965
|
obj.device_name = message.device_name;
|
|
14443
14966
|
}
|
|
14444
|
-
if (message.
|
|
14445
|
-
obj.
|
|
14967
|
+
if (message.login_at !== void 0) {
|
|
14968
|
+
obj.login_at = message.login_at.toISOString();
|
|
14446
14969
|
}
|
|
14447
14970
|
if (message.status !== 0) {
|
|
14448
14971
|
obj.status = Math.round(message.status);
|
|
@@ -14450,18 +14973,35 @@ var LogedDeviceList = {
|
|
|
14450
14973
|
if (message.platform !== "") {
|
|
14451
14974
|
obj.platform = message.platform;
|
|
14452
14975
|
}
|
|
14976
|
+
if (message.ip !== "") {
|
|
14977
|
+
obj.ip = message.ip;
|
|
14978
|
+
}
|
|
14979
|
+
if (message.last_active !== void 0) {
|
|
14980
|
+
obj.last_active = message.last_active.toISOString();
|
|
14981
|
+
}
|
|
14982
|
+
if (message.location !== "") {
|
|
14983
|
+
obj.location = message.location;
|
|
14984
|
+
}
|
|
14985
|
+
if (message.is_current_device !== false) {
|
|
14986
|
+
obj.is_current_device = message.is_current_device;
|
|
14987
|
+
}
|
|
14453
14988
|
return obj;
|
|
14454
14989
|
},
|
|
14455
14990
|
create(base) {
|
|
14456
|
-
return
|
|
14991
|
+
return LogedDevice.fromPartial(base != null ? base : {});
|
|
14457
14992
|
},
|
|
14458
14993
|
fromPartial(object) {
|
|
14459
|
-
var _a, _b, _c, _d;
|
|
14460
|
-
const message =
|
|
14461
|
-
message.
|
|
14462
|
-
message.
|
|
14463
|
-
message.
|
|
14464
|
-
message.
|
|
14994
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
14995
|
+
const message = createBaseLogedDevice();
|
|
14996
|
+
message.device_id = (_a = object.device_id) != null ? _a : "";
|
|
14997
|
+
message.device_name = (_b = object.device_name) != null ? _b : "";
|
|
14998
|
+
message.login_at = (_c = object.login_at) != null ? _c : void 0;
|
|
14999
|
+
message.status = (_d = object.status) != null ? _d : 0;
|
|
15000
|
+
message.platform = (_e = object.platform) != null ? _e : "";
|
|
15001
|
+
message.ip = (_f = object.ip) != null ? _f : "";
|
|
15002
|
+
message.last_active = (_g = object.last_active) != null ? _g : void 0;
|
|
15003
|
+
message.location = (_h = object.location) != null ? _h : "";
|
|
15004
|
+
message.is_current_device = (_i = object.is_current_device) != null ? _i : false;
|
|
14465
15005
|
return message;
|
|
14466
15006
|
}
|
|
14467
15007
|
};
|
|
@@ -14497,6 +15037,9 @@ if (import_minimal4.default.util.Long !== import_long3.default) {
|
|
|
14497
15037
|
import_minimal4.default.util.Long = import_long3.default;
|
|
14498
15038
|
import_minimal4.default.configure();
|
|
14499
15039
|
}
|
|
15040
|
+
function isObject(value) {
|
|
15041
|
+
return typeof value === "object" && value !== null;
|
|
15042
|
+
}
|
|
14500
15043
|
function isSet3(value) {
|
|
14501
15044
|
return value !== null && value !== void 0;
|
|
14502
15045
|
}
|
|
@@ -14989,25 +15532,31 @@ var MezonApi = class {
|
|
|
14989
15532
|
}
|
|
14990
15533
|
const urlPath = "/v2/account/session/refresh";
|
|
14991
15534
|
const queryParams = /* @__PURE__ */ new Map();
|
|
14992
|
-
|
|
14993
|
-
|
|
15535
|
+
const bodyWriter = SessionRefreshRequest.encode(
|
|
15536
|
+
SessionRefreshRequest.fromPartial(body)
|
|
15537
|
+
);
|
|
15538
|
+
const encodedBody = bodyWriter.finish();
|
|
14994
15539
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
14995
|
-
const fetchOptions = buildFetchOptions("POST", options,
|
|
15540
|
+
const fetchOptions = buildFetchOptions("POST", options, "");
|
|
15541
|
+
fetchOptions.body = encodedBody;
|
|
14996
15542
|
if (basicAuthUsername) {
|
|
14997
15543
|
fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
|
|
14998
15544
|
}
|
|
15545
|
+
fetchOptions.headers["Content-Type"] = "application/x-protobuf";
|
|
15546
|
+
fetchOptions.headers["Accept"] = "application/x-protobuf";
|
|
14999
15547
|
return Promise.race([
|
|
15000
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
15548
|
+
fetch(fullUrl, fetchOptions).then((response) => __async(this, null, function* () {
|
|
15001
15549
|
if (response.status == 204) {
|
|
15002
|
-
return
|
|
15550
|
+
return {};
|
|
15003
15551
|
} else if (response.status >= 200 && response.status < 300) {
|
|
15004
|
-
|
|
15552
|
+
const buffer = yield response.arrayBuffer();
|
|
15553
|
+
return Session.decode(new Uint8Array(buffer));
|
|
15005
15554
|
} else {
|
|
15006
15555
|
throw response;
|
|
15007
15556
|
}
|
|
15008
|
-
}),
|
|
15557
|
+
})),
|
|
15009
15558
|
new Promise(
|
|
15010
|
-
(_, reject) => setTimeout(reject
|
|
15559
|
+
(_, reject) => setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
|
|
15011
15560
|
)
|
|
15012
15561
|
]);
|
|
15013
15562
|
}
|
|
@@ -16632,18 +17181,20 @@ var MezonApi = class {
|
|
|
16632
17181
|
if (bearerToken) {
|
|
16633
17182
|
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
16634
17183
|
}
|
|
17184
|
+
fetchOptions.headers["Accept"] = "application/x-protobuf";
|
|
16635
17185
|
return Promise.race([
|
|
16636
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
17186
|
+
fetch(fullUrl, fetchOptions).then((response) => __async(this, null, function* () {
|
|
16637
17187
|
if (response.status == 204) {
|
|
16638
|
-
return
|
|
17188
|
+
return {};
|
|
16639
17189
|
} else if (response.status >= 200 && response.status < 300) {
|
|
16640
|
-
|
|
17190
|
+
const buffer = yield response.arrayBuffer();
|
|
17191
|
+
return RegistFcmDeviceTokenResponse.decode(new Uint8Array(buffer));
|
|
16641
17192
|
} else {
|
|
16642
17193
|
throw response;
|
|
16643
17194
|
}
|
|
16644
|
-
}),
|
|
17195
|
+
})),
|
|
16645
17196
|
new Promise(
|
|
16646
|
-
(_, reject) => setTimeout(reject
|
|
17197
|
+
(_, reject) => setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
|
|
16647
17198
|
)
|
|
16648
17199
|
]);
|
|
16649
17200
|
}
|
|
@@ -19581,35 +20132,6 @@ var MezonApi = class {
|
|
|
19581
20132
|
)
|
|
19582
20133
|
]);
|
|
19583
20134
|
}
|
|
19584
|
-
/** Store wallet key */
|
|
19585
|
-
storeWalletKey(bearerToken, body, options = {}) {
|
|
19586
|
-
if (body === null || body === void 0) {
|
|
19587
|
-
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
19588
|
-
}
|
|
19589
|
-
const urlPath = "/v2/wallet/key";
|
|
19590
|
-
const queryParams = /* @__PURE__ */ new Map();
|
|
19591
|
-
let bodyJson = "";
|
|
19592
|
-
bodyJson = JSON.stringify(body || {});
|
|
19593
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
19594
|
-
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
|
19595
|
-
if (bearerToken) {
|
|
19596
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
19597
|
-
}
|
|
19598
|
-
return Promise.race([
|
|
19599
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
19600
|
-
if (response.status == 204) {
|
|
19601
|
-
return response;
|
|
19602
|
-
} else if (response.status >= 200 && response.status < 300) {
|
|
19603
|
-
return response.json();
|
|
19604
|
-
} else {
|
|
19605
|
-
throw response;
|
|
19606
|
-
}
|
|
19607
|
-
}),
|
|
19608
|
-
new Promise(
|
|
19609
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
19610
|
-
)
|
|
19611
|
-
]);
|
|
19612
|
-
}
|
|
19613
20135
|
/** create webhook */
|
|
19614
20136
|
generateWebhook(bearerToken, body, options = {}) {
|
|
19615
20137
|
if (body === null || body === void 0) {
|
|
@@ -21016,7 +21538,7 @@ var MezonApi = class {
|
|
|
21016
21538
|
return Promise.race([
|
|
21017
21539
|
fetch(fullUrl, fetchOptions).then((response) => __async(this, null, function* () {
|
|
21018
21540
|
if (response.status == 204) {
|
|
21019
|
-
return
|
|
21541
|
+
return {};
|
|
21020
21542
|
} else if (response.status >= 200 && response.status < 300) {
|
|
21021
21543
|
const buffer = yield response.arrayBuffer();
|
|
21022
21544
|
return LogedDeviceList.decode(new Uint8Array(buffer));
|
|
@@ -21032,7 +21554,7 @@ var MezonApi = class {
|
|
|
21032
21554
|
};
|
|
21033
21555
|
|
|
21034
21556
|
// session.ts
|
|
21035
|
-
var
|
|
21557
|
+
var Session2 = class _Session {
|
|
21036
21558
|
constructor(token, refresh_token, created, api_url, id_token, is_remember) {
|
|
21037
21559
|
this.created = created;
|
|
21038
21560
|
this.api_url = api_url;
|
|
@@ -22488,7 +23010,7 @@ var Client = class {
|
|
|
22488
23010
|
isRemember,
|
|
22489
23011
|
options
|
|
22490
23012
|
).then((apiSession) => {
|
|
22491
|
-
return new
|
|
23013
|
+
return new Session2(
|
|
22492
23014
|
apiSession.token || "",
|
|
22493
23015
|
apiSession.refresh_token || "",
|
|
22494
23016
|
apiSession.created || false,
|
|
@@ -22527,7 +23049,7 @@ var Client = class {
|
|
|
22527
23049
|
confirmAuthenticateOTP(request) {
|
|
22528
23050
|
return __async(this, null, function* () {
|
|
22529
23051
|
return this.apiClient.confirmAuthenticateOTP(this.serverkey, "", request).then((apiSession) => {
|
|
22530
|
-
return new
|
|
23052
|
+
return new Session2(
|
|
22531
23053
|
apiSession.token || "",
|
|
22532
23054
|
apiSession.refresh_token || "",
|
|
22533
23055
|
apiSession.created || false,
|
|
@@ -22549,7 +23071,7 @@ var Client = class {
|
|
|
22549
23071
|
}
|
|
22550
23072
|
};
|
|
22551
23073
|
return this.apiClient.authenticateEmail(this.serverkey, "", request, username).then((apiSession) => {
|
|
22552
|
-
return new
|
|
23074
|
+
return new Session2(
|
|
22553
23075
|
apiSession.token || "",
|
|
22554
23076
|
apiSession.refresh_token || "",
|
|
22555
23077
|
apiSession.created || false,
|
|
@@ -24538,7 +25060,7 @@ var Client = class {
|
|
|
24538
25060
|
if (!(apiSession == null ? void 0 : apiSession.token)) {
|
|
24539
25061
|
return null;
|
|
24540
25062
|
}
|
|
24541
|
-
return new
|
|
25063
|
+
return new Session2(
|
|
24542
25064
|
apiSession.token || "",
|
|
24543
25065
|
apiSession.refresh_token || "",
|
|
24544
25066
|
apiSession.created || false,
|