@mtkruto/node 0.0.937 → 0.0.938
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/types/0_location.d.ts +8 -0
- package/esm/types/0_location.js +1 -0
- package/esm/types/0_venue.d.ts +10 -0
- package/esm/types/0_venue.js +16 -0
- package/esm/types/3_message.d.ts +2 -0
- package/esm/types/3_message.js +4 -0
- package/package.json +1 -1
- package/script/constants.d.ts +1 -1
- package/script/constants.js +1 -1
- package/script/types/0_location.d.ts +8 -0
- package/script/types/0_location.js +2 -0
- package/script/types/0_venue.d.ts +10 -0
- package/script/types/0_venue.js +43 -0
- package/script/types/3_message.d.ts +2 -0
- package/script/types/3_message.js +4 -0
package/esm/constants.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare const publicKeys: Map<bigint, [bigint, bigint]>;
|
|
|
4
4
|
export declare const VECTOR_CONSTRUCTOR = 481674261;
|
|
5
5
|
export declare const DEFAULT_INITIAL_DC: DC;
|
|
6
6
|
export declare const LAYER = 158;
|
|
7
|
-
export declare const DEFAULT_APP_VERSION = "MTKruto 0.0.
|
|
7
|
+
export declare const DEFAULT_APP_VERSION = "MTKruto 0.0.938";
|
|
8
8
|
export declare const DEFAULT_DEVICE_MODEL: string;
|
|
9
9
|
export declare const DEFAULT_LANG_CODE: string;
|
|
10
10
|
export declare const DEFAULT_LANG_PACK = "";
|
package/esm/constants.js
CHANGED
|
@@ -62,7 +62,7 @@ export const publicKeys = new Map([
|
|
|
62
62
|
export const VECTOR_CONSTRUCTOR = 0x1CB5C415;
|
|
63
63
|
export const DEFAULT_INITIAL_DC = "2-test";
|
|
64
64
|
export const LAYER = 158;
|
|
65
|
-
export const DEFAULT_APP_VERSION = "MTKruto 0.0.
|
|
65
|
+
export const DEFAULT_APP_VERSION = "MTKruto 0.0.938";
|
|
66
66
|
// @ts-ignore: lib
|
|
67
67
|
export const DEFAULT_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;
|
|
68
68
|
export const DEFAULT_LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as types from "../tl/2_types.js";
|
|
2
|
+
import { Location } from "./0_location.js";
|
|
3
|
+
export interface Venue {
|
|
4
|
+
location: Location;
|
|
5
|
+
title: string;
|
|
6
|
+
address: string;
|
|
7
|
+
foursquareId?: string;
|
|
8
|
+
foursquareType?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function constructVenue(media_: types.MessageMediaVenue): Venue;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { as } from "../mod.js";
|
|
2
|
+
import * as types from "../tl/2_types.js";
|
|
3
|
+
export function constructVenue(media_) {
|
|
4
|
+
const geo = media_.geo[as](types.GeoPoint);
|
|
5
|
+
return {
|
|
6
|
+
location: {
|
|
7
|
+
latitude: geo.lat,
|
|
8
|
+
longitude: geo.long,
|
|
9
|
+
horizontalAccuracy: geo.accuracyRadius,
|
|
10
|
+
},
|
|
11
|
+
title: media_.title,
|
|
12
|
+
address: media_.address,
|
|
13
|
+
foursquareId: media_.venueId,
|
|
14
|
+
foursquareType: media_.venueType,
|
|
15
|
+
};
|
|
16
|
+
}
|
package/esm/types/3_message.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { Voice } from "./0_voice.js";
|
|
|
18
18
|
import { Dice } from "./0_dice.js";
|
|
19
19
|
import { Contact } from "./0_contact.js";
|
|
20
20
|
import { Game } from "./2_game.js";
|
|
21
|
+
import { Venue } from "./0_venue.js";
|
|
21
22
|
/** This object represents a message. */
|
|
22
23
|
export interface Message {
|
|
23
24
|
/** Unique message identifier inside this chat */
|
|
@@ -86,6 +87,7 @@ export interface Message {
|
|
|
86
87
|
videoNote?: VideoNote;
|
|
87
88
|
contact?: Contact;
|
|
88
89
|
game?: Game;
|
|
90
|
+
venue?: Venue;
|
|
89
91
|
}
|
|
90
92
|
interface EntityGetter {
|
|
91
93
|
(peer: types.PeerUser): MaybePromise<types.User | null>;
|
package/esm/types/3_message.js
CHANGED
|
@@ -21,6 +21,7 @@ import { constructDice } from "./0_dice.js";
|
|
|
21
21
|
import { FileID, FileType, FileUniqueID, FileUniqueType } from "./!0_file_id.js";
|
|
22
22
|
import { constructContact } from "./0_contact.js";
|
|
23
23
|
import { constructGame } from "./2_game.js";
|
|
24
|
+
import { constructVenue } from "./0_venue.js";
|
|
24
25
|
const d = debug("types/Message");
|
|
25
26
|
async function getSender(message_, getEntity) {
|
|
26
27
|
if (message_.fromId instanceof types.PeerUser) {
|
|
@@ -269,6 +270,9 @@ export async function constructMessage(message_, getEntity, getMessage, getStick
|
|
|
269
270
|
else if (message_.media instanceof types.MessageMediaGame) {
|
|
270
271
|
message.game = constructGame(message_.media);
|
|
271
272
|
}
|
|
273
|
+
else if (message_.media instanceof types.MessageMediaVenue) {
|
|
274
|
+
message.venue = constructVenue(message_.media);
|
|
275
|
+
}
|
|
272
276
|
else {
|
|
273
277
|
console.log(message_.media);
|
|
274
278
|
// not implemented
|
package/package.json
CHANGED
package/script/constants.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare const publicKeys: Map<bigint, [bigint, bigint]>;
|
|
|
4
4
|
export declare const VECTOR_CONSTRUCTOR = 481674261;
|
|
5
5
|
export declare const DEFAULT_INITIAL_DC: DC;
|
|
6
6
|
export declare const LAYER = 158;
|
|
7
|
-
export declare const DEFAULT_APP_VERSION = "MTKruto 0.0.
|
|
7
|
+
export declare const DEFAULT_APP_VERSION = "MTKruto 0.0.938";
|
|
8
8
|
export declare const DEFAULT_DEVICE_MODEL: string;
|
|
9
9
|
export declare const DEFAULT_LANG_CODE: string;
|
|
10
10
|
export declare const DEFAULT_LANG_PACK = "";
|
package/script/constants.js
CHANGED
|
@@ -88,7 +88,7 @@ exports.publicKeys = new Map([
|
|
|
88
88
|
exports.VECTOR_CONSTRUCTOR = 0x1CB5C415;
|
|
89
89
|
exports.DEFAULT_INITIAL_DC = "2-test";
|
|
90
90
|
exports.LAYER = 158;
|
|
91
|
-
exports.DEFAULT_APP_VERSION = "MTKruto 0.0.
|
|
91
|
+
exports.DEFAULT_APP_VERSION = "MTKruto 0.0.938";
|
|
92
92
|
// @ts-ignore: lib
|
|
93
93
|
exports.DEFAULT_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;
|
|
94
94
|
exports.DEFAULT_LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as types from "../tl/2_types.js";
|
|
2
|
+
import { Location } from "./0_location.js";
|
|
3
|
+
export interface Venue {
|
|
4
|
+
location: Location;
|
|
5
|
+
title: string;
|
|
6
|
+
address: string;
|
|
7
|
+
foursquareId?: string;
|
|
8
|
+
foursquareType?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function constructVenue(media_: types.MessageMediaVenue): Venue;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.constructVenue = void 0;
|
|
27
|
+
const mod_js_1 = require("../mod.js");
|
|
28
|
+
const types = __importStar(require("../tl/2_types.js"));
|
|
29
|
+
function constructVenue(media_) {
|
|
30
|
+
const geo = media_.geo[mod_js_1.as](types.GeoPoint);
|
|
31
|
+
return {
|
|
32
|
+
location: {
|
|
33
|
+
latitude: geo.lat,
|
|
34
|
+
longitude: geo.long,
|
|
35
|
+
horizontalAccuracy: geo.accuracyRadius,
|
|
36
|
+
},
|
|
37
|
+
title: media_.title,
|
|
38
|
+
address: media_.address,
|
|
39
|
+
foursquareId: media_.venueId,
|
|
40
|
+
foursquareType: media_.venueType,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
exports.constructVenue = constructVenue;
|
|
@@ -18,6 +18,7 @@ import { Voice } from "./0_voice.js";
|
|
|
18
18
|
import { Dice } from "./0_dice.js";
|
|
19
19
|
import { Contact } from "./0_contact.js";
|
|
20
20
|
import { Game } from "./2_game.js";
|
|
21
|
+
import { Venue } from "./0_venue.js";
|
|
21
22
|
/** This object represents a message. */
|
|
22
23
|
export interface Message {
|
|
23
24
|
/** Unique message identifier inside this chat */
|
|
@@ -86,6 +87,7 @@ export interface Message {
|
|
|
86
87
|
videoNote?: VideoNote;
|
|
87
88
|
contact?: Contact;
|
|
88
89
|
game?: Game;
|
|
90
|
+
venue?: Venue;
|
|
89
91
|
}
|
|
90
92
|
interface EntityGetter {
|
|
91
93
|
(peer: types.PeerUser): MaybePromise<types.User | null>;
|
|
@@ -47,6 +47,7 @@ const _0_dice_js_1 = require("./0_dice.js");
|
|
|
47
47
|
const _0_file_id_js_1 = require("./!0_file_id.js");
|
|
48
48
|
const _0_contact_js_1 = require("./0_contact.js");
|
|
49
49
|
const _2_game_js_1 = require("./2_game.js");
|
|
50
|
+
const _0_venue_js_1 = require("./0_venue.js");
|
|
50
51
|
const d = (0, deps_js_1.debug)("types/Message");
|
|
51
52
|
async function getSender(message_, getEntity) {
|
|
52
53
|
if (message_.fromId instanceof types.PeerUser) {
|
|
@@ -295,6 +296,9 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
|
|
|
295
296
|
else if (message_.media instanceof types.MessageMediaGame) {
|
|
296
297
|
message.game = (0, _2_game_js_1.constructGame)(message_.media);
|
|
297
298
|
}
|
|
299
|
+
else if (message_.media instanceof types.MessageMediaVenue) {
|
|
300
|
+
message.venue = (0, _0_venue_js_1.constructVenue)(message_.media);
|
|
301
|
+
}
|
|
298
302
|
else {
|
|
299
303
|
console.log(message_.media);
|
|
300
304
|
// not implemented
|