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/api/api.ts
CHANGED
|
@@ -3773,10 +3773,19 @@ export interface ReportMessageAbuseReqest {
|
|
|
3773
3773
|
}
|
|
3774
3774
|
|
|
3775
3775
|
export interface LogedDeviceList {
|
|
3776
|
+
devices: LogedDevice[];
|
|
3777
|
+
}
|
|
3778
|
+
|
|
3779
|
+
export interface LogedDevice {
|
|
3780
|
+
device_id: string;
|
|
3776
3781
|
device_name: string;
|
|
3777
|
-
|
|
3782
|
+
login_at: Date | undefined;
|
|
3778
3783
|
status: number;
|
|
3779
3784
|
platform: string;
|
|
3785
|
+
ip: string;
|
|
3786
|
+
last_active: Date | undefined;
|
|
3787
|
+
location: string;
|
|
3788
|
+
is_current_device: boolean;
|
|
3780
3789
|
}
|
|
3781
3790
|
|
|
3782
3791
|
function createBaseAccount(): Account {
|
|
@@ -38798,30 +38807,114 @@ export const ReportMessageAbuseReqest = {
|
|
|
38798
38807
|
};
|
|
38799
38808
|
|
|
38800
38809
|
function createBaseLogedDeviceList(): LogedDeviceList {
|
|
38801
|
-
return {
|
|
38810
|
+
return { devices: [] };
|
|
38802
38811
|
}
|
|
38803
38812
|
|
|
38804
38813
|
export const LogedDeviceList = {
|
|
38805
38814
|
encode(message: LogedDeviceList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
38815
|
+
for (const v of message.devices) {
|
|
38816
|
+
LogedDevice.encode(v!, writer.uint32(10).fork()).ldelim();
|
|
38817
|
+
}
|
|
38818
|
+
return writer;
|
|
38819
|
+
},
|
|
38820
|
+
|
|
38821
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): LogedDeviceList {
|
|
38822
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
38823
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
38824
|
+
const message = createBaseLogedDeviceList();
|
|
38825
|
+
while (reader.pos < end) {
|
|
38826
|
+
const tag = reader.uint32();
|
|
38827
|
+
switch (tag >>> 3) {
|
|
38828
|
+
case 1:
|
|
38829
|
+
if (tag !== 10) {
|
|
38830
|
+
break;
|
|
38831
|
+
}
|
|
38832
|
+
|
|
38833
|
+
message.devices.push(LogedDevice.decode(reader, reader.uint32()));
|
|
38834
|
+
continue;
|
|
38835
|
+
}
|
|
38836
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
38837
|
+
break;
|
|
38838
|
+
}
|
|
38839
|
+
reader.skipType(tag & 7);
|
|
38840
|
+
}
|
|
38841
|
+
return message;
|
|
38842
|
+
},
|
|
38843
|
+
|
|
38844
|
+
fromJSON(object: any): LogedDeviceList {
|
|
38845
|
+
return {
|
|
38846
|
+
devices: globalThis.Array.isArray(object?.devices) ? object.devices.map((e: any) => LogedDevice.fromJSON(e)) : [],
|
|
38847
|
+
};
|
|
38848
|
+
},
|
|
38849
|
+
|
|
38850
|
+
toJSON(message: LogedDeviceList): unknown {
|
|
38851
|
+
const obj: any = {};
|
|
38852
|
+
if (message.devices?.length) {
|
|
38853
|
+
obj.devices = message.devices.map((e) => LogedDevice.toJSON(e));
|
|
38854
|
+
}
|
|
38855
|
+
return obj;
|
|
38856
|
+
},
|
|
38857
|
+
|
|
38858
|
+
create<I extends Exact<DeepPartial<LogedDeviceList>, I>>(base?: I): LogedDeviceList {
|
|
38859
|
+
return LogedDeviceList.fromPartial(base ?? ({} as any));
|
|
38860
|
+
},
|
|
38861
|
+
fromPartial<I extends Exact<DeepPartial<LogedDeviceList>, I>>(object: I): LogedDeviceList {
|
|
38862
|
+
const message = createBaseLogedDeviceList();
|
|
38863
|
+
message.devices = object.devices?.map((e) => LogedDevice.fromPartial(e)) || [];
|
|
38864
|
+
return message;
|
|
38865
|
+
},
|
|
38866
|
+
};
|
|
38867
|
+
|
|
38868
|
+
function createBaseLogedDevice(): LogedDevice {
|
|
38869
|
+
return {
|
|
38870
|
+
device_id: "",
|
|
38871
|
+
device_name: "",
|
|
38872
|
+
login_at: undefined,
|
|
38873
|
+
status: 0,
|
|
38874
|
+
platform: "",
|
|
38875
|
+
ip: "",
|
|
38876
|
+
last_active: undefined,
|
|
38877
|
+
location: "",
|
|
38878
|
+
is_current_device: false,
|
|
38879
|
+
};
|
|
38880
|
+
}
|
|
38881
|
+
|
|
38882
|
+
export const LogedDevice = {
|
|
38883
|
+
encode(message: LogedDevice, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
38884
|
+
if (message.device_id !== "") {
|
|
38885
|
+
writer.uint32(10).string(message.device_id);
|
|
38886
|
+
}
|
|
38806
38887
|
if (message.device_name !== "") {
|
|
38807
|
-
writer.uint32(
|
|
38888
|
+
writer.uint32(18).string(message.device_name);
|
|
38808
38889
|
}
|
|
38809
|
-
if (message.
|
|
38810
|
-
Timestamp.encode(toTimestamp(message.
|
|
38890
|
+
if (message.login_at !== undefined) {
|
|
38891
|
+
Timestamp.encode(toTimestamp(message.login_at), writer.uint32(26).fork()).ldelim();
|
|
38811
38892
|
}
|
|
38812
38893
|
if (message.status !== 0) {
|
|
38813
|
-
writer.uint32(
|
|
38894
|
+
writer.uint32(32).int32(message.status);
|
|
38814
38895
|
}
|
|
38815
38896
|
if (message.platform !== "") {
|
|
38816
|
-
writer.uint32(
|
|
38897
|
+
writer.uint32(42).string(message.platform);
|
|
38898
|
+
}
|
|
38899
|
+
if (message.ip !== "") {
|
|
38900
|
+
writer.uint32(50).string(message.ip);
|
|
38901
|
+
}
|
|
38902
|
+
if (message.last_active !== undefined) {
|
|
38903
|
+
Timestamp.encode(toTimestamp(message.last_active), writer.uint32(58).fork()).ldelim();
|
|
38904
|
+
}
|
|
38905
|
+
if (message.location !== "") {
|
|
38906
|
+
writer.uint32(66).string(message.location);
|
|
38907
|
+
}
|
|
38908
|
+
if (message.is_current_device !== false) {
|
|
38909
|
+
writer.uint32(72).bool(message.is_current_device);
|
|
38817
38910
|
}
|
|
38818
38911
|
return writer;
|
|
38819
38912
|
},
|
|
38820
38913
|
|
|
38821
|
-
decode(input: _m0.Reader | Uint8Array, length?: number):
|
|
38914
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): LogedDevice {
|
|
38822
38915
|
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
38823
38916
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
38824
|
-
const message =
|
|
38917
|
+
const message = createBaseLogedDevice();
|
|
38825
38918
|
while (reader.pos < end) {
|
|
38826
38919
|
const tag = reader.uint32();
|
|
38827
38920
|
switch (tag >>> 3) {
|
|
@@ -38830,29 +38923,64 @@ export const LogedDeviceList = {
|
|
|
38830
38923
|
break;
|
|
38831
38924
|
}
|
|
38832
38925
|
|
|
38833
|
-
message.
|
|
38926
|
+
message.device_id = reader.string();
|
|
38834
38927
|
continue;
|
|
38835
38928
|
case 2:
|
|
38836
38929
|
if (tag !== 18) {
|
|
38837
38930
|
break;
|
|
38838
38931
|
}
|
|
38839
38932
|
|
|
38840
|
-
message.
|
|
38933
|
+
message.device_name = reader.string();
|
|
38841
38934
|
continue;
|
|
38842
38935
|
case 3:
|
|
38843
|
-
if (tag !==
|
|
38936
|
+
if (tag !== 26) {
|
|
38844
38937
|
break;
|
|
38845
38938
|
}
|
|
38846
38939
|
|
|
38847
|
-
message.
|
|
38940
|
+
message.login_at = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
38848
38941
|
continue;
|
|
38849
38942
|
case 4:
|
|
38850
|
-
if (tag !==
|
|
38943
|
+
if (tag !== 32) {
|
|
38944
|
+
break;
|
|
38945
|
+
}
|
|
38946
|
+
|
|
38947
|
+
message.status = reader.int32();
|
|
38948
|
+
continue;
|
|
38949
|
+
case 5:
|
|
38950
|
+
if (tag !== 42) {
|
|
38851
38951
|
break;
|
|
38852
38952
|
}
|
|
38853
38953
|
|
|
38854
38954
|
message.platform = reader.string();
|
|
38855
38955
|
continue;
|
|
38956
|
+
case 6:
|
|
38957
|
+
if (tag !== 50) {
|
|
38958
|
+
break;
|
|
38959
|
+
}
|
|
38960
|
+
|
|
38961
|
+
message.ip = reader.string();
|
|
38962
|
+
continue;
|
|
38963
|
+
case 7:
|
|
38964
|
+
if (tag !== 58) {
|
|
38965
|
+
break;
|
|
38966
|
+
}
|
|
38967
|
+
|
|
38968
|
+
message.last_active = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
38969
|
+
continue;
|
|
38970
|
+
case 8:
|
|
38971
|
+
if (tag !== 66) {
|
|
38972
|
+
break;
|
|
38973
|
+
}
|
|
38974
|
+
|
|
38975
|
+
message.location = reader.string();
|
|
38976
|
+
continue;
|
|
38977
|
+
case 9:
|
|
38978
|
+
if (tag !== 72) {
|
|
38979
|
+
break;
|
|
38980
|
+
}
|
|
38981
|
+
|
|
38982
|
+
message.is_current_device = reader.bool();
|
|
38983
|
+
continue;
|
|
38856
38984
|
}
|
|
38857
38985
|
if ((tag & 7) === 4 || tag === 0) {
|
|
38858
38986
|
break;
|
|
@@ -38862,22 +38990,30 @@ export const LogedDeviceList = {
|
|
|
38862
38990
|
return message;
|
|
38863
38991
|
},
|
|
38864
38992
|
|
|
38865
|
-
fromJSON(object: any):
|
|
38993
|
+
fromJSON(object: any): LogedDevice {
|
|
38866
38994
|
return {
|
|
38995
|
+
device_id: isSet(object.device_id) ? globalThis.String(object.device_id) : "",
|
|
38867
38996
|
device_name: isSet(object.device_name) ? globalThis.String(object.device_name) : "",
|
|
38868
|
-
|
|
38997
|
+
login_at: isSet(object.login_at) ? fromJsonTimestamp(object.login_at) : undefined,
|
|
38869
38998
|
status: isSet(object.status) ? globalThis.Number(object.status) : 0,
|
|
38870
38999
|
platform: isSet(object.platform) ? globalThis.String(object.platform) : "",
|
|
39000
|
+
ip: isSet(object.ip) ? globalThis.String(object.ip) : "",
|
|
39001
|
+
last_active: isSet(object.last_active) ? fromJsonTimestamp(object.last_active) : undefined,
|
|
39002
|
+
location: isSet(object.location) ? globalThis.String(object.location) : "",
|
|
39003
|
+
is_current_device: isSet(object.is_current_device) ? globalThis.Boolean(object.is_current_device) : false,
|
|
38871
39004
|
};
|
|
38872
39005
|
},
|
|
38873
39006
|
|
|
38874
|
-
toJSON(message:
|
|
39007
|
+
toJSON(message: LogedDevice): unknown {
|
|
38875
39008
|
const obj: any = {};
|
|
39009
|
+
if (message.device_id !== "") {
|
|
39010
|
+
obj.device_id = message.device_id;
|
|
39011
|
+
}
|
|
38876
39012
|
if (message.device_name !== "") {
|
|
38877
39013
|
obj.device_name = message.device_name;
|
|
38878
39014
|
}
|
|
38879
|
-
if (message.
|
|
38880
|
-
obj.
|
|
39015
|
+
if (message.login_at !== undefined) {
|
|
39016
|
+
obj.login_at = message.login_at.toISOString();
|
|
38881
39017
|
}
|
|
38882
39018
|
if (message.status !== 0) {
|
|
38883
39019
|
obj.status = Math.round(message.status);
|
|
@@ -38885,18 +39021,35 @@ export const LogedDeviceList = {
|
|
|
38885
39021
|
if (message.platform !== "") {
|
|
38886
39022
|
obj.platform = message.platform;
|
|
38887
39023
|
}
|
|
39024
|
+
if (message.ip !== "") {
|
|
39025
|
+
obj.ip = message.ip;
|
|
39026
|
+
}
|
|
39027
|
+
if (message.last_active !== undefined) {
|
|
39028
|
+
obj.last_active = message.last_active.toISOString();
|
|
39029
|
+
}
|
|
39030
|
+
if (message.location !== "") {
|
|
39031
|
+
obj.location = message.location;
|
|
39032
|
+
}
|
|
39033
|
+
if (message.is_current_device !== false) {
|
|
39034
|
+
obj.is_current_device = message.is_current_device;
|
|
39035
|
+
}
|
|
38888
39036
|
return obj;
|
|
38889
39037
|
},
|
|
38890
39038
|
|
|
38891
|
-
create<I extends Exact<DeepPartial<
|
|
38892
|
-
return
|
|
39039
|
+
create<I extends Exact<DeepPartial<LogedDevice>, I>>(base?: I): LogedDevice {
|
|
39040
|
+
return LogedDevice.fromPartial(base ?? ({} as any));
|
|
38893
39041
|
},
|
|
38894
|
-
fromPartial<I extends Exact<DeepPartial<
|
|
38895
|
-
const message =
|
|
39042
|
+
fromPartial<I extends Exact<DeepPartial<LogedDevice>, I>>(object: I): LogedDevice {
|
|
39043
|
+
const message = createBaseLogedDevice();
|
|
39044
|
+
message.device_id = object.device_id ?? "";
|
|
38896
39045
|
message.device_name = object.device_name ?? "";
|
|
38897
|
-
message.
|
|
39046
|
+
message.login_at = object.login_at ?? undefined;
|
|
38898
39047
|
message.status = object.status ?? 0;
|
|
38899
39048
|
message.platform = object.platform ?? "";
|
|
39049
|
+
message.ip = object.ip ?? "";
|
|
39050
|
+
message.last_active = object.last_active ?? undefined;
|
|
39051
|
+
message.location = object.location ?? "";
|
|
39052
|
+
message.is_current_device = object.is_current_device ?? false;
|
|
38900
39053
|
return message;
|
|
38901
39054
|
},
|
|
38902
39055
|
};
|
package/api.gen.ts
CHANGED
|
@@ -179,16 +179,33 @@ export interface MezonUpdateChannelDescBody {
|
|
|
179
179
|
topic?: string;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
+
|
|
182
183
|
/** */
|
|
183
|
-
export interface
|
|
184
|
+
export interface ApiLogedDevice {
|
|
185
|
+
//
|
|
186
|
+
device_id?: string;
|
|
184
187
|
//
|
|
185
188
|
device_name?: string;
|
|
186
189
|
//
|
|
187
|
-
|
|
190
|
+
ip?: string;
|
|
191
|
+
//
|
|
192
|
+
last_active?: string;
|
|
193
|
+
//
|
|
194
|
+
login_at?: string;
|
|
188
195
|
//
|
|
189
196
|
platform?: string;
|
|
190
197
|
//
|
|
191
198
|
status?: number;
|
|
199
|
+
//
|
|
200
|
+
location?: string;
|
|
201
|
+
//
|
|
202
|
+
is_current?: boolean;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/** */
|
|
206
|
+
export interface ApiLogedDeviceList {
|
|
207
|
+
//
|
|
208
|
+
devices?: Array<ApiLogedDevice>;
|
|
192
209
|
}
|
|
193
210
|
|
|
194
211
|
/** */
|
|
@@ -2905,36 +2922,6 @@ export interface ApiVoiceChannelUserList {
|
|
|
2905
2922
|
voice_channel_users?: Array<ApiVoiceChannelUser>;
|
|
2906
2923
|
}
|
|
2907
2924
|
|
|
2908
|
-
/** */
|
|
2909
|
-
export interface ApiStoreWalletKeyRequest {
|
|
2910
|
-
//
|
|
2911
|
-
address?: string;
|
|
2912
|
-
//
|
|
2913
|
-
enc_privkey?: string;
|
|
2914
|
-
}
|
|
2915
|
-
|
|
2916
|
-
/** */
|
|
2917
|
-
export interface ApiWalletLedger {
|
|
2918
|
-
//
|
|
2919
|
-
create_time?: string;
|
|
2920
|
-
//
|
|
2921
|
-
id?: string;
|
|
2922
|
-
//
|
|
2923
|
-
transaction_id?: string;
|
|
2924
|
-
//
|
|
2925
|
-
user_id?: string;
|
|
2926
|
-
//
|
|
2927
|
-
value?: number;
|
|
2928
|
-
}
|
|
2929
|
-
|
|
2930
|
-
/** */
|
|
2931
|
-
export interface ApiWalletLedgerList {
|
|
2932
|
-
//
|
|
2933
|
-
count?: number;
|
|
2934
|
-
//
|
|
2935
|
-
wallet_ledger?: Array<ApiWalletLedger>;
|
|
2936
|
-
}
|
|
2937
|
-
|
|
2938
2925
|
/** */
|
|
2939
2926
|
export interface ApiWebhook {
|
|
2940
2927
|
//
|
|
@@ -4092,28 +4079,33 @@ export class MezonApi {
|
|
|
4092
4079
|
const urlPath = "/v2/account/session/refresh";
|
|
4093
4080
|
const queryParams = new Map<string, any>();
|
|
4094
4081
|
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4082
|
+
const bodyWriter = tsproto.SessionRefreshRequest.encode(
|
|
4083
|
+
tsproto.SessionRefreshRequest.fromPartial(body)
|
|
4084
|
+
);
|
|
4085
|
+
const encodedBody = bodyWriter.finish();
|
|
4098
4086
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
4099
|
-
const fetchOptions = buildFetchOptions("POST", options,
|
|
4087
|
+
const fetchOptions = buildFetchOptions("POST", options, '');
|
|
4088
|
+
fetchOptions.body = encodedBody;
|
|
4100
4089
|
if (basicAuthUsername) {
|
|
4101
4090
|
fetchOptions.headers["Authorization"] =
|
|
4102
4091
|
"Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
|
|
4103
4092
|
}
|
|
4093
|
+
fetchOptions.headers["Content-Type"] = "application/x-protobuf";
|
|
4094
|
+
fetchOptions.headers["Accept"] = "application/x-protobuf";
|
|
4104
4095
|
|
|
4105
4096
|
return Promise.race([
|
|
4106
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
4097
|
+
fetch(fullUrl, fetchOptions).then(async (response) => {
|
|
4107
4098
|
if (response.status == 204) {
|
|
4108
|
-
return
|
|
4099
|
+
return {} as ApiSession;
|
|
4109
4100
|
} else if (response.status >= 200 && response.status < 300) {
|
|
4110
|
-
|
|
4101
|
+
const buffer = await response.arrayBuffer();
|
|
4102
|
+
return tsproto.Session.decode(new Uint8Array(buffer)) as unknown as ApiSession;
|
|
4111
4103
|
} else {
|
|
4112
4104
|
throw response;
|
|
4113
4105
|
}
|
|
4114
4106
|
}),
|
|
4115
|
-
new Promise((_, reject) =>
|
|
4116
|
-
setTimeout(reject
|
|
4107
|
+
new Promise<never>((_, reject) =>
|
|
4108
|
+
setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
|
|
4117
4109
|
),
|
|
4118
4110
|
]);
|
|
4119
4111
|
}
|
|
@@ -6202,19 +6194,21 @@ export class MezonApi {
|
|
|
6202
6194
|
if (bearerToken) {
|
|
6203
6195
|
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
6204
6196
|
}
|
|
6197
|
+
fetchOptions.headers["Accept"] = "application/x-protobuf";
|
|
6205
6198
|
|
|
6206
6199
|
return Promise.race([
|
|
6207
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
6200
|
+
fetch(fullUrl, fetchOptions).then(async (response) => {
|
|
6208
6201
|
if (response.status == 204) {
|
|
6209
|
-
return
|
|
6202
|
+
return {} as ApiRegistFcmDeviceTokenResponse;
|
|
6210
6203
|
} else if (response.status >= 200 && response.status < 300) {
|
|
6211
|
-
|
|
6204
|
+
const buffer = await response.arrayBuffer();
|
|
6205
|
+
return tsproto.RegistFcmDeviceTokenResponse.decode(new Uint8Array(buffer)) as unknown as ApiRegistFcmDeviceTokenResponse;
|
|
6212
6206
|
} else {
|
|
6213
6207
|
throw response;
|
|
6214
6208
|
}
|
|
6215
6209
|
}),
|
|
6216
|
-
new Promise((_, reject) =>
|
|
6217
|
-
setTimeout(reject
|
|
6210
|
+
new Promise<never>((_, reject) =>
|
|
6211
|
+
setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
|
|
6218
6212
|
),
|
|
6219
6213
|
]);
|
|
6220
6214
|
}
|
|
@@ -9954,42 +9948,6 @@ export class MezonApi {
|
|
|
9954
9948
|
]);
|
|
9955
9949
|
}
|
|
9956
9950
|
|
|
9957
|
-
/** Store wallet key */
|
|
9958
|
-
storeWalletKey(bearerToken: string,
|
|
9959
|
-
body:ApiStoreWalletKeyRequest,
|
|
9960
|
-
options: any = {}): Promise<any> {
|
|
9961
|
-
|
|
9962
|
-
if (body === null || body === undefined) {
|
|
9963
|
-
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
9964
|
-
}
|
|
9965
|
-
const urlPath = "/v2/wallet/key";
|
|
9966
|
-
const queryParams = new Map<string, any>();
|
|
9967
|
-
|
|
9968
|
-
let bodyJson : string = "";
|
|
9969
|
-
bodyJson = JSON.stringify(body || {});
|
|
9970
|
-
|
|
9971
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
9972
|
-
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
|
9973
|
-
if (bearerToken) {
|
|
9974
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
9975
|
-
}
|
|
9976
|
-
|
|
9977
|
-
return Promise.race([
|
|
9978
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
9979
|
-
if (response.status == 204) {
|
|
9980
|
-
return response;
|
|
9981
|
-
} else if (response.status >= 200 && response.status < 300) {
|
|
9982
|
-
return response.json();
|
|
9983
|
-
} else {
|
|
9984
|
-
throw response;
|
|
9985
|
-
}
|
|
9986
|
-
}),
|
|
9987
|
-
new Promise((_, reject) =>
|
|
9988
|
-
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
9989
|
-
),
|
|
9990
|
-
]);
|
|
9991
|
-
}
|
|
9992
|
-
|
|
9993
9951
|
/** create webhook */
|
|
9994
9952
|
generateWebhook(
|
|
9995
9953
|
bearerToken: string,
|
|
@@ -11785,7 +11743,7 @@ export class MezonApi {
|
|
|
11785
11743
|
return Promise.race([
|
|
11786
11744
|
fetch(fullUrl, fetchOptions).then(async (response) => {
|
|
11787
11745
|
if (response.status == 204) {
|
|
11788
|
-
return
|
|
11746
|
+
return {} as ApiLogedDeviceList;
|
|
11789
11747
|
} else if (response.status >= 200 && response.status < 300) {
|
|
11790
11748
|
const buffer = await response.arrayBuffer();
|
|
11791
11749
|
return tsproto.LogedDeviceList.decode(new Uint8Array(buffer)) as unknown as ApiLogedDeviceList;
|
package/dist/api/api.d.ts
CHANGED
|
@@ -3107,10 +3107,18 @@ export interface ReportMessageAbuseReqest {
|
|
|
3107
3107
|
abuse_type: string;
|
|
3108
3108
|
}
|
|
3109
3109
|
export interface LogedDeviceList {
|
|
3110
|
+
devices: LogedDevice[];
|
|
3111
|
+
}
|
|
3112
|
+
export interface LogedDevice {
|
|
3113
|
+
device_id: string;
|
|
3110
3114
|
device_name: string;
|
|
3111
|
-
|
|
3115
|
+
login_at: Date | undefined;
|
|
3112
3116
|
status: number;
|
|
3113
3117
|
platform: string;
|
|
3118
|
+
ip: string;
|
|
3119
|
+
last_active: Date | undefined;
|
|
3120
|
+
location: string;
|
|
3121
|
+
is_current_device: boolean;
|
|
3114
3122
|
}
|
|
3115
3123
|
export declare const Account: {
|
|
3116
3124
|
encode(message: Account, writer?: _m0.Writer): _m0.Writer;
|
|
@@ -23758,27 +23766,163 @@ export declare const LogedDeviceList: {
|
|
|
23758
23766
|
fromJSON(object: any): LogedDeviceList;
|
|
23759
23767
|
toJSON(message: LogedDeviceList): unknown;
|
|
23760
23768
|
create<I extends {
|
|
23769
|
+
devices?: {
|
|
23770
|
+
device_id?: string | undefined;
|
|
23771
|
+
device_name?: string | undefined;
|
|
23772
|
+
login_at?: Date | undefined;
|
|
23773
|
+
status?: number | undefined;
|
|
23774
|
+
platform?: string | undefined;
|
|
23775
|
+
ip?: string | undefined;
|
|
23776
|
+
last_active?: Date | undefined;
|
|
23777
|
+
location?: string | undefined;
|
|
23778
|
+
is_current_device?: boolean | undefined;
|
|
23779
|
+
}[] | undefined;
|
|
23780
|
+
} & {
|
|
23781
|
+
devices?: ({
|
|
23782
|
+
device_id?: string | undefined;
|
|
23783
|
+
device_name?: string | undefined;
|
|
23784
|
+
login_at?: Date | undefined;
|
|
23785
|
+
status?: number | undefined;
|
|
23786
|
+
platform?: string | undefined;
|
|
23787
|
+
ip?: string | undefined;
|
|
23788
|
+
last_active?: Date | undefined;
|
|
23789
|
+
location?: string | undefined;
|
|
23790
|
+
is_current_device?: boolean | undefined;
|
|
23791
|
+
}[] & ({
|
|
23792
|
+
device_id?: string | undefined;
|
|
23793
|
+
device_name?: string | undefined;
|
|
23794
|
+
login_at?: Date | undefined;
|
|
23795
|
+
status?: number | undefined;
|
|
23796
|
+
platform?: string | undefined;
|
|
23797
|
+
ip?: string | undefined;
|
|
23798
|
+
last_active?: Date | undefined;
|
|
23799
|
+
location?: string | undefined;
|
|
23800
|
+
is_current_device?: boolean | undefined;
|
|
23801
|
+
} & {
|
|
23802
|
+
device_id?: string | undefined;
|
|
23803
|
+
device_name?: string | undefined;
|
|
23804
|
+
login_at?: Date | undefined;
|
|
23805
|
+
status?: number | undefined;
|
|
23806
|
+
platform?: string | undefined;
|
|
23807
|
+
ip?: string | undefined;
|
|
23808
|
+
last_active?: Date | undefined;
|
|
23809
|
+
location?: string | undefined;
|
|
23810
|
+
is_current_device?: boolean | undefined;
|
|
23811
|
+
} & { [K in Exclude<keyof I["devices"][number], keyof LogedDevice>]: never; })[] & { [K_1 in Exclude<keyof I["devices"], keyof {
|
|
23812
|
+
device_id?: string | undefined;
|
|
23813
|
+
device_name?: string | undefined;
|
|
23814
|
+
login_at?: Date | undefined;
|
|
23815
|
+
status?: number | undefined;
|
|
23816
|
+
platform?: string | undefined;
|
|
23817
|
+
ip?: string | undefined;
|
|
23818
|
+
last_active?: Date | undefined;
|
|
23819
|
+
location?: string | undefined;
|
|
23820
|
+
is_current_device?: boolean | undefined;
|
|
23821
|
+
}[]>]: never; }) | undefined;
|
|
23822
|
+
} & { [K_2 in Exclude<keyof I, "devices">]: never; }>(base?: I | undefined): LogedDeviceList;
|
|
23823
|
+
fromPartial<I_1 extends {
|
|
23824
|
+
devices?: {
|
|
23825
|
+
device_id?: string | undefined;
|
|
23826
|
+
device_name?: string | undefined;
|
|
23827
|
+
login_at?: Date | undefined;
|
|
23828
|
+
status?: number | undefined;
|
|
23829
|
+
platform?: string | undefined;
|
|
23830
|
+
ip?: string | undefined;
|
|
23831
|
+
last_active?: Date | undefined;
|
|
23832
|
+
location?: string | undefined;
|
|
23833
|
+
is_current_device?: boolean | undefined;
|
|
23834
|
+
}[] | undefined;
|
|
23835
|
+
} & {
|
|
23836
|
+
devices?: ({
|
|
23837
|
+
device_id?: string | undefined;
|
|
23838
|
+
device_name?: string | undefined;
|
|
23839
|
+
login_at?: Date | undefined;
|
|
23840
|
+
status?: number | undefined;
|
|
23841
|
+
platform?: string | undefined;
|
|
23842
|
+
ip?: string | undefined;
|
|
23843
|
+
last_active?: Date | undefined;
|
|
23844
|
+
location?: string | undefined;
|
|
23845
|
+
is_current_device?: boolean | undefined;
|
|
23846
|
+
}[] & ({
|
|
23847
|
+
device_id?: string | undefined;
|
|
23848
|
+
device_name?: string | undefined;
|
|
23849
|
+
login_at?: Date | undefined;
|
|
23850
|
+
status?: number | undefined;
|
|
23851
|
+
platform?: string | undefined;
|
|
23852
|
+
ip?: string | undefined;
|
|
23853
|
+
last_active?: Date | undefined;
|
|
23854
|
+
location?: string | undefined;
|
|
23855
|
+
is_current_device?: boolean | undefined;
|
|
23856
|
+
} & {
|
|
23857
|
+
device_id?: string | undefined;
|
|
23858
|
+
device_name?: string | undefined;
|
|
23859
|
+
login_at?: Date | undefined;
|
|
23860
|
+
status?: number | undefined;
|
|
23861
|
+
platform?: string | undefined;
|
|
23862
|
+
ip?: string | undefined;
|
|
23863
|
+
last_active?: Date | undefined;
|
|
23864
|
+
location?: string | undefined;
|
|
23865
|
+
is_current_device?: boolean | undefined;
|
|
23866
|
+
} & { [K_3 in Exclude<keyof I_1["devices"][number], keyof LogedDevice>]: never; })[] & { [K_4 in Exclude<keyof I_1["devices"], keyof {
|
|
23867
|
+
device_id?: string | undefined;
|
|
23868
|
+
device_name?: string | undefined;
|
|
23869
|
+
login_at?: Date | undefined;
|
|
23870
|
+
status?: number | undefined;
|
|
23871
|
+
platform?: string | undefined;
|
|
23872
|
+
ip?: string | undefined;
|
|
23873
|
+
last_active?: Date | undefined;
|
|
23874
|
+
location?: string | undefined;
|
|
23875
|
+
is_current_device?: boolean | undefined;
|
|
23876
|
+
}[]>]: never; }) | undefined;
|
|
23877
|
+
} & { [K_5 in Exclude<keyof I_1, "devices">]: never; }>(object: I_1): LogedDeviceList;
|
|
23878
|
+
};
|
|
23879
|
+
export declare const LogedDevice: {
|
|
23880
|
+
encode(message: LogedDevice, writer?: _m0.Writer): _m0.Writer;
|
|
23881
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): LogedDevice;
|
|
23882
|
+
fromJSON(object: any): LogedDevice;
|
|
23883
|
+
toJSON(message: LogedDevice): unknown;
|
|
23884
|
+
create<I extends {
|
|
23885
|
+
device_id?: string | undefined;
|
|
23761
23886
|
device_name?: string | undefined;
|
|
23762
|
-
|
|
23887
|
+
login_at?: Date | undefined;
|
|
23763
23888
|
status?: number | undefined;
|
|
23764
23889
|
platform?: string | undefined;
|
|
23890
|
+
ip?: string | undefined;
|
|
23891
|
+
last_active?: Date | undefined;
|
|
23892
|
+
location?: string | undefined;
|
|
23893
|
+
is_current_device?: boolean | undefined;
|
|
23765
23894
|
} & {
|
|
23895
|
+
device_id?: string | undefined;
|
|
23766
23896
|
device_name?: string | undefined;
|
|
23767
|
-
|
|
23897
|
+
login_at?: Date | undefined;
|
|
23768
23898
|
status?: number | undefined;
|
|
23769
23899
|
platform?: string | undefined;
|
|
23770
|
-
|
|
23900
|
+
ip?: string | undefined;
|
|
23901
|
+
last_active?: Date | undefined;
|
|
23902
|
+
location?: string | undefined;
|
|
23903
|
+
is_current_device?: boolean | undefined;
|
|
23904
|
+
} & { [K in Exclude<keyof I, keyof LogedDevice>]: never; }>(base?: I | undefined): LogedDevice;
|
|
23771
23905
|
fromPartial<I_1 extends {
|
|
23906
|
+
device_id?: string | undefined;
|
|
23772
23907
|
device_name?: string | undefined;
|
|
23773
|
-
|
|
23908
|
+
login_at?: Date | undefined;
|
|
23774
23909
|
status?: number | undefined;
|
|
23775
23910
|
platform?: string | undefined;
|
|
23911
|
+
ip?: string | undefined;
|
|
23912
|
+
last_active?: Date | undefined;
|
|
23913
|
+
location?: string | undefined;
|
|
23914
|
+
is_current_device?: boolean | undefined;
|
|
23776
23915
|
} & {
|
|
23916
|
+
device_id?: string | undefined;
|
|
23777
23917
|
device_name?: string | undefined;
|
|
23778
|
-
|
|
23918
|
+
login_at?: Date | undefined;
|
|
23779
23919
|
status?: number | undefined;
|
|
23780
23920
|
platform?: string | undefined;
|
|
23781
|
-
|
|
23921
|
+
ip?: string | undefined;
|
|
23922
|
+
last_active?: Date | undefined;
|
|
23923
|
+
location?: string | undefined;
|
|
23924
|
+
is_current_device?: boolean | undefined;
|
|
23925
|
+
} & { [K_1 in Exclude<keyof I_1, keyof LogedDevice>]: never; }>(object: I_1): LogedDevice;
|
|
23782
23926
|
};
|
|
23783
23927
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
23784
23928
|
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|