@mtkruto/node 0.0.972 → 0.0.973
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/esm/constants.d.ts +1 -1
- package/esm/constants.js +1 -1
- package/esm/storage/0_storage.d.ts +1 -1
- package/esm/storage/0_storage.js +7 -2
- package/package.json +1 -1
- package/script/constants.d.ts +1 -1
- package/script/constants.js +1 -1
- package/script/storage/0_storage.d.ts +1 -1
- package/script/storage/0_storage.js +7 -2
package/esm/constants.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const PUBLIC_KEYS: PublicKeys;
|
|
|
5
5
|
export declare const VECTOR_CONSTRUCTOR = 481674261;
|
|
6
6
|
export declare const INITIAL_DC: DC;
|
|
7
7
|
export declare const LAYER = 160;
|
|
8
|
-
export declare const APP_VERSION = "MTKruto 0.0.
|
|
8
|
+
export declare const APP_VERSION = "MTKruto 0.0.973";
|
|
9
9
|
export declare const DEVICE_MODEL: string;
|
|
10
10
|
export declare const LANG_CODE: string;
|
|
11
11
|
export declare const LANG_PACK = "";
|
package/esm/constants.js
CHANGED
|
@@ -54,7 +54,7 @@ export const PUBLIC_KEYS = Object.freeze([
|
|
|
54
54
|
export const VECTOR_CONSTRUCTOR = 0x1CB5C415;
|
|
55
55
|
export const INITIAL_DC = "2-test";
|
|
56
56
|
export const LAYER = 160;
|
|
57
|
-
export const APP_VERSION = "MTKruto 0.0.
|
|
57
|
+
export const APP_VERSION = "MTKruto 0.0.973";
|
|
58
58
|
// @ts-ignore: lib
|
|
59
59
|
export const DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
|
|
60
60
|
export const LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
|
|
@@ -19,7 +19,7 @@ export declare abstract class Storage {
|
|
|
19
19
|
setUserAccessHash(id: bigint, accessHash: bigint): MaybePromise<void>;
|
|
20
20
|
getUserAccessHash(id: bigint): MaybePromise<bigint | null>;
|
|
21
21
|
updateUsernames(type: "user" | "channel", id: bigint, usernames: string[]): Promise<void>;
|
|
22
|
-
getUsername(username: string):
|
|
22
|
+
getUsername(username: string): Promise<["channel" | "user", bigint, Date] | null>;
|
|
23
23
|
setTlObject(key: readonly StorageKeyPart[], value: TLObject | null): Promise<void>;
|
|
24
24
|
getTLObject(key: readonly StorageKeyPart[]): Promise<import("../tl/3_tl_reader.js").ReadObject | null>;
|
|
25
25
|
setState(state: types.UpdatesState): Promise<void>;
|
package/esm/storage/0_storage.js
CHANGED
|
@@ -71,9 +71,14 @@ export class Storage {
|
|
|
71
71
|
await this.set(KPARTS__USERNAME(username), [type, String(id), new Date()]);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
getUsername(username) {
|
|
74
|
+
async getUsername(username) {
|
|
75
75
|
username = username.toLowerCase();
|
|
76
|
-
|
|
76
|
+
const v = await this.get(KPARTS__USERNAME(username));
|
|
77
|
+
if (v != null) {
|
|
78
|
+
v[1] = BigInt(v[1]);
|
|
79
|
+
v[2] = new Date(v[2]);
|
|
80
|
+
}
|
|
81
|
+
return v;
|
|
77
82
|
}
|
|
78
83
|
async setTlObject(key, value) {
|
|
79
84
|
if (value == null) {
|
package/package.json
CHANGED
package/script/constants.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const PUBLIC_KEYS: PublicKeys;
|
|
|
5
5
|
export declare const VECTOR_CONSTRUCTOR = 481674261;
|
|
6
6
|
export declare const INITIAL_DC: DC;
|
|
7
7
|
export declare const LAYER = 160;
|
|
8
|
-
export declare const APP_VERSION = "MTKruto 0.0.
|
|
8
|
+
export declare const APP_VERSION = "MTKruto 0.0.973";
|
|
9
9
|
export declare const DEVICE_MODEL: string;
|
|
10
10
|
export declare const LANG_CODE: string;
|
|
11
11
|
export declare const LANG_PACK = "";
|
package/script/constants.js
CHANGED
|
@@ -80,7 +80,7 @@ exports.PUBLIC_KEYS = Object.freeze([
|
|
|
80
80
|
exports.VECTOR_CONSTRUCTOR = 0x1CB5C415;
|
|
81
81
|
exports.INITIAL_DC = "2-test";
|
|
82
82
|
exports.LAYER = 160;
|
|
83
|
-
exports.APP_VERSION = "MTKruto 0.0.
|
|
83
|
+
exports.APP_VERSION = "MTKruto 0.0.973";
|
|
84
84
|
// @ts-ignore: lib
|
|
85
85
|
exports.DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
|
|
86
86
|
exports.LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
|
|
@@ -19,7 +19,7 @@ export declare abstract class Storage {
|
|
|
19
19
|
setUserAccessHash(id: bigint, accessHash: bigint): MaybePromise<void>;
|
|
20
20
|
getUserAccessHash(id: bigint): MaybePromise<bigint | null>;
|
|
21
21
|
updateUsernames(type: "user" | "channel", id: bigint, usernames: string[]): Promise<void>;
|
|
22
|
-
getUsername(username: string):
|
|
22
|
+
getUsername(username: string): Promise<["channel" | "user", bigint, Date] | null>;
|
|
23
23
|
setTlObject(key: readonly StorageKeyPart[], value: TLObject | null): Promise<void>;
|
|
24
24
|
getTLObject(key: readonly StorageKeyPart[]): Promise<import("../tl/3_tl_reader.js").ReadObject | null>;
|
|
25
25
|
setState(state: types.UpdatesState): Promise<void>;
|
|
@@ -97,9 +97,14 @@ class Storage {
|
|
|
97
97
|
await this.set(KPARTS__USERNAME(username), [type, String(id), new Date()]);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
getUsername(username) {
|
|
100
|
+
async getUsername(username) {
|
|
101
101
|
username = username.toLowerCase();
|
|
102
|
-
|
|
102
|
+
const v = await this.get(KPARTS__USERNAME(username));
|
|
103
|
+
if (v != null) {
|
|
104
|
+
v[1] = BigInt(v[1]);
|
|
105
|
+
v[2] = new Date(v[2]);
|
|
106
|
+
}
|
|
107
|
+
return v;
|
|
103
108
|
}
|
|
104
109
|
async setTlObject(key, value) {
|
|
105
110
|
if (value == null) {
|