nodejs-insta-private-api-mqt 1.3.70
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/LICENSE +21 -0
- package/README.md +3677 -0
- package/dist/constants/constants.js +342 -0
- package/dist/constants/index.js +58 -0
- package/dist/core/client.js +419 -0
- package/dist/core/nav-chain.js +282 -0
- package/dist/core/repository.js +7 -0
- package/dist/core/request.js +390 -0
- package/dist/core/state.js +1473 -0
- package/dist/core/utils.js +786 -0
- package/dist/downloadMedia.js +381 -0
- package/dist/errors/index.d.ts +16 -0
- package/dist/errors/index.js +38 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/extend.js +167 -0
- package/dist/fbns/fbns.client.d.ts +32 -0
- package/dist/fbns/fbns.client.events.d.ts +41 -0
- package/dist/fbns/fbns.client.events.js +3 -0
- package/dist/fbns/fbns.client.events.js.map +1 -0
- package/dist/fbns/fbns.client.js +252 -0
- package/dist/fbns/fbns.client.js.map +1 -0
- package/dist/fbns/fbns.device-auth.d.ts +17 -0
- package/dist/fbns/fbns.device-auth.js +54 -0
- package/dist/fbns/fbns.device-auth.js.map +1 -0
- package/dist/fbns/fbns.types.d.ts +83 -0
- package/dist/fbns/fbns.types.js +3 -0
- package/dist/fbns/fbns.types.js.map +1 -0
- package/dist/fbns/fbns.utilities.d.ts +2 -0
- package/dist/fbns/fbns.utilities.js +79 -0
- package/dist/fbns/fbns.utilities.js.map +1 -0
- package/dist/fbns/index.d.ts +4 -0
- package/dist/fbns/index.js +21 -0
- package/dist/fbns/index.js.map +1 -0
- package/dist/index.js +139 -0
- package/dist/mqtt-shim.d.ts +96 -0
- package/dist/mqtt-shim.js +15 -0
- package/dist/mqttot/index.d.ts +4 -0
- package/dist/mqttot/index.js +21 -0
- package/dist/mqttot/index.js.map +1 -0
- package/dist/mqttot/mqttot.client.d.ts +39 -0
- package/dist/mqttot/mqttot.client.js +318 -0
- package/dist/mqttot/mqttot.client.js.map +1 -0
- package/dist/mqttot/mqttot.connect.request.packet.d.ts +7 -0
- package/dist/mqttot/mqttot.connect.request.packet.js +9 -0
- package/dist/mqttot/mqttot.connect.request.packet.js.map +1 -0
- package/dist/mqttot/mqttot.connect.response.packet.d.ts +7 -0
- package/dist/mqttot/mqttot.connect.response.packet.js +24 -0
- package/dist/mqttot/mqttot.connect.response.packet.js.map +1 -0
- package/dist/mqttot/mqttot.connection.d.ts +57 -0
- package/dist/mqttot/mqttot.connection.js +79 -0
- package/dist/mqttot/mqttot.connection.js.map +1 -0
- package/dist/package.json +59 -0
- package/dist/realtime/commands/commands.d.ts +15 -0
- package/dist/realtime/commands/commands.js +71 -0
- package/dist/realtime/commands/commands.js.map +1 -0
- package/dist/realtime/commands/direct.commands.d.ts +75 -0
- package/dist/realtime/commands/direct.commands.js +417 -0
- package/dist/realtime/commands/direct.commands.js.map +1 -0
- package/dist/realtime/commands/enhanced.direct.commands.js +1731 -0
- package/dist/realtime/commands/enhanced.direct.commands.js.bak +967 -0
- package/dist/realtime/commands/index.d.ts +2 -0
- package/dist/realtime/commands/index.js +20 -0
- package/dist/realtime/commands/index.js.map +1 -0
- package/dist/realtime/delta-sync.manager.js +293 -0
- package/dist/realtime/features/dm-sender.js +88 -0
- package/dist/realtime/features/error-handler.js +185 -0
- package/dist/realtime/features/gap-handler.js +61 -0
- package/dist/realtime/features/persistent-logger.js +186 -0
- package/dist/realtime/features/presence.manager.js +66 -0
- package/dist/realtime/features/session-health-monitor.js +345 -0
- package/dist/realtime/index.js +30 -0
- package/dist/realtime/messages/app-presence.event.d.ts +9 -0
- package/dist/realtime/messages/app-presence.event.js +3 -0
- package/dist/realtime/messages/app-presence.event.js.map +1 -0
- package/dist/realtime/messages/index.d.ts +3 -0
- package/dist/realtime/messages/index.js +20 -0
- package/dist/realtime/messages/index.js.map +1 -0
- package/dist/realtime/messages/message-sync.message.d.ts +222 -0
- package/dist/realtime/messages/message-sync.message.js +43 -0
- package/dist/realtime/messages/message-sync.message.js.map +1 -0
- package/dist/realtime/messages/realtime-sub.direct.data.d.ts +11 -0
- package/dist/realtime/messages/realtime-sub.direct.data.js +3 -0
- package/dist/realtime/messages/realtime-sub.direct.data.js.map +1 -0
- package/dist/realtime/messages/thread-update.message.d.ts +68 -0
- package/dist/realtime/messages/thread-update.message.js +3 -0
- package/dist/realtime/messages/thread-update.message.js.map +1 -0
- package/dist/realtime/mixins/index.d.ts +3 -0
- package/dist/realtime/mixins/index.js +20 -0
- package/dist/realtime/mixins/index.js.map +1 -0
- package/dist/realtime/mixins/message-sync.mixin.d.ts +8 -0
- package/dist/realtime/mixins/message-sync.mixin.js +596 -0
- package/dist/realtime/mixins/message-sync.mixin.js.map +1 -0
- package/dist/realtime/mixins/mixin.d.ts +19 -0
- package/dist/realtime/mixins/mixin.js +41 -0
- package/dist/realtime/mixins/mixin.js.map +1 -0
- package/dist/realtime/mixins/presence-typing.mixin.js +33 -0
- package/dist/realtime/mixins/realtime-sub.mixin.d.ts +8 -0
- package/dist/realtime/mixins/realtime-sub.mixin.js +181 -0
- package/dist/realtime/mixins/realtime-sub.mixin.js.map +1 -0
- package/dist/realtime/parsers/graphql-parser.js +43 -0
- package/dist/realtime/parsers/graphql.parser.d.ts +15 -0
- package/dist/realtime/parsers/graphql.parser.js +22 -0
- package/dist/realtime/parsers/graphql.parser.js.map +1 -0
- package/dist/realtime/parsers/index.d.ts +6 -0
- package/dist/realtime/parsers/index.js +23 -0
- package/dist/realtime/parsers/index.js.map +1 -0
- package/dist/realtime/parsers/iris-parser.js +43 -0
- package/dist/realtime/parsers/iris.parser.d.ts +17 -0
- package/dist/realtime/parsers/iris.parser.js +10 -0
- package/dist/realtime/parsers/iris.parser.js.map +1 -0
- package/dist/realtime/parsers/json-parser.js +43 -0
- package/dist/realtime/parsers/json.parser.d.ts +6 -0
- package/dist/realtime/parsers/json.parser.js +10 -0
- package/dist/realtime/parsers/json.parser.js.map +1 -0
- package/dist/realtime/parsers/parser.d.ts +9 -0
- package/dist/realtime/parsers/parser.js +3 -0
- package/dist/realtime/parsers/parser.js.map +1 -0
- package/dist/realtime/parsers/region-hint-parser.js +43 -0
- package/dist/realtime/parsers/region-hint.parser.d.ts +12 -0
- package/dist/realtime/parsers/region-hint.parser.js +15 -0
- package/dist/realtime/parsers/region-hint.parser.js.map +1 -0
- package/dist/realtime/parsers/skywalker-parser.js +43 -0
- package/dist/realtime/parsers/skywalker.parser.d.ts +12 -0
- package/dist/realtime/parsers/skywalker.parser.js +15 -0
- package/dist/realtime/parsers/skywalker.parser.js.map +1 -0
- package/dist/realtime/parsers-advanced.js +158 -0
- package/dist/realtime/proto/common.proto +38 -0
- package/dist/realtime/proto/direct.proto +65 -0
- package/dist/realtime/proto/ig-messages.proto +83 -0
- package/dist/realtime/proto/iris.proto +188 -0
- package/dist/realtime/proto-parser.js +195 -0
- package/dist/realtime/protocols/iris.handshake.js +74 -0
- package/dist/realtime/protocols/proto-definitions.js +80 -0
- package/dist/realtime/protocols/skywalker.protocol.js +91 -0
- package/dist/realtime/realtime.client.events.js +3 -0
- package/dist/realtime/realtime.client.js +1915 -0
- package/dist/realtime/realtime.service.js +462 -0
- package/dist/realtime/reconnect.manager.js +88 -0
- package/dist/realtime/session.manager.js +121 -0
- package/dist/realtime/subscriptions/graphql.subscription.d.ts +47 -0
- package/dist/realtime/subscriptions/graphql.subscription.js +99 -0
- package/dist/realtime/subscriptions/graphql.subscription.js.map +1 -0
- package/dist/realtime/subscriptions/index.d.ts +2 -0
- package/dist/realtime/subscriptions/index.js +19 -0
- package/dist/realtime/subscriptions/index.js.map +1 -0
- package/dist/realtime/subscriptions/skywalker.subscription.d.ts +4 -0
- package/dist/realtime/subscriptions/skywalker.subscription.js +13 -0
- package/dist/realtime/subscriptions/skywalker.subscription.js.map +1 -0
- package/dist/realtime/topic-map.js +71 -0
- package/dist/realtime/topic.js +80 -0
- package/dist/repositories/account.repository.js +575 -0
- package/dist/repositories/bloks.repository.js +70 -0
- package/dist/repositories/captcha.repository.js +44 -0
- package/dist/repositories/challenge.repository.js +120 -0
- package/dist/repositories/clip.repository.js +165 -0
- package/dist/repositories/close-friends.repository.js +46 -0
- package/dist/repositories/collection.repository.js +68 -0
- package/dist/repositories/direct-thread.repository.js +446 -0
- package/dist/repositories/direct.repository.js +232 -0
- package/dist/repositories/explore.repository.js +70 -0
- package/dist/repositories/fbsearch.repository.js +140 -0
- package/dist/repositories/feed.repository.js +245 -0
- package/dist/repositories/friendship.repository.js +296 -0
- package/dist/repositories/fundraiser.repository.js +49 -0
- package/dist/repositories/hashtag.repository.js +99 -0
- package/dist/repositories/highlights.repository.js +121 -0
- package/dist/repositories/insights.repository.js +82 -0
- package/dist/repositories/location.repository.js +84 -0
- package/dist/repositories/media.repository.js +395 -0
- package/dist/repositories/multiple-accounts.repository.js +41 -0
- package/dist/repositories/news.repository.js +35 -0
- package/dist/repositories/note.repository.js +57 -0
- package/dist/repositories/notification.repository.js +79 -0
- package/dist/repositories/share.repository.js +35 -0
- package/dist/repositories/signup.repository.js +218 -0
- package/dist/repositories/story.repository.js +290 -0
- package/dist/repositories/timeline.repository.js +60 -0
- package/dist/repositories/totp.repository.js +139 -0
- package/dist/repositories/track.repository.js +53 -0
- package/dist/repositories/upload.repository.js +204 -0
- package/dist/repositories/user.repository.js +360 -0
- package/dist/sendmedia/index.js +27 -0
- package/dist/sendmedia/sendFile.js +72 -0
- package/dist/sendmedia/sendPhoto.js +142 -0
- package/dist/sendmedia/sendRavenPhoto.js +153 -0
- package/dist/sendmedia/sendRavenVideo.js +158 -0
- package/dist/sendmedia/uploadPhoto.js +107 -0
- package/dist/sendmedia/uploadfFile.js +130 -0
- package/dist/services/live.service.js +139 -0
- package/dist/services/search.service.js +115 -0
- package/dist/shared/index.js +96 -0
- package/dist/shared/shared.js +86 -0
- package/dist/thrift/index.d.ts +3 -0
- package/dist/thrift/index.js +20 -0
- package/dist/thrift/index.js.map +1 -0
- package/dist/thrift/thrift.d.ts +59 -0
- package/dist/thrift/thrift.js +101 -0
- package/dist/thrift/thrift.js.map +1 -0
- package/dist/thrift/thrift.reading.d.ts +41 -0
- package/dist/thrift/thrift.reading.js +327 -0
- package/dist/thrift/thrift.reading.js.map +1 -0
- package/dist/thrift/thrift.writing.d.ts +44 -0
- package/dist/thrift/thrift.writing.js +342 -0
- package/dist/thrift/thrift.writing.js.map +1 -0
- package/dist/types/index.js +285 -0
- package/dist/useMultiFileAuthState.js +1768 -0
- package/dist/utils/helper-1.js +1 -0
- package/dist/utils/helper-10.js +1 -0
- package/dist/utils/helper-11.js +1 -0
- package/dist/utils/helper-12.js +1 -0
- package/dist/utils/helper-13.js +1 -0
- package/dist/utils/helper-14.js +1 -0
- package/dist/utils/helper-15.js +1 -0
- package/dist/utils/helper-16.js +1 -0
- package/dist/utils/helper-17.js +1 -0
- package/dist/utils/helper-18.js +1 -0
- package/dist/utils/helper-19.js +1 -0
- package/dist/utils/helper-2.js +1 -0
- package/dist/utils/helper-20.js +1 -0
- package/dist/utils/helper-21.js +1 -0
- package/dist/utils/helper-22.js +1 -0
- package/dist/utils/helper-23.js +1 -0
- package/dist/utils/helper-24.js +1 -0
- package/dist/utils/helper-25.js +1 -0
- package/dist/utils/helper-26.js +1 -0
- package/dist/utils/helper-27.js +1 -0
- package/dist/utils/helper-28.js +1 -0
- package/dist/utils/helper-29.js +1 -0
- package/dist/utils/helper-3.js +1 -0
- package/dist/utils/helper-30.js +1 -0
- package/dist/utils/helper-4.js +1 -0
- package/dist/utils/helper-5.js +1 -0
- package/dist/utils/helper-6.js +1 -0
- package/dist/utils/helper-7.js +1 -0
- package/dist/utils/helper-8.js +1 -0
- package/dist/utils/helper-9.js +1 -0
- package/dist/utils/index.js +280 -0
- package/dist/utils/insta-mqtt-helper.js +128 -0
- package/examples/listen-to-messages.js +86 -0
- package/package.json +82 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SkywalkerParser = void 0;
|
|
4
|
+
const thrift_1 = require("../../thrift");
|
|
5
|
+
class SkywalkerParser {
|
|
6
|
+
parseMessage(topic, payload) {
|
|
7
|
+
return {
|
|
8
|
+
topic,
|
|
9
|
+
data: (0, thrift_1.thriftReadToObject)(payload, SkywalkerParser.descriptors),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.SkywalkerParser = SkywalkerParser;
|
|
14
|
+
SkywalkerParser.descriptors = [thrift_1.ThriftDescriptors.int32('topic', 1), thrift_1.ThriftDescriptors.binary('payload', 2)];
|
|
15
|
+
//# sourceMappingURL=skywalker.parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skywalker.parser.js","sourceRoot":"","sources":["../../../src/realtime/parsers/skywalker.parser.ts"],"names":[],"mappings":";;;AAEA,yCAA2F;AAE3F,MAAa,eAAe;IAGlB,YAAY,CAAC,KAAY,EAAE,OAAe;QAC9C,OAAO;YACJ,KAAK;YACL,IAAI,EAAE,IAAA,2BAAkB,EAAC,OAAO,EAAE,eAAe,CAAC,WAAW,CAAC;SAChE,CAAC;IACL,CAAC;;AARJ,0CASC;AARgB,2BAAW,GAAG,CAAC,0BAAiB,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,0BAAiB,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
const debug = require('debug')('ig:parsers');
|
|
2
|
+
const ProtoParser = require('./proto-parser');
|
|
3
|
+
|
|
4
|
+
const protoParser = new ProtoParser();
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Advanced Topic-Specific Parsers
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// Parse Iris (Direct Messages)
|
|
11
|
+
function parseIris(topicId, payload) {
|
|
12
|
+
const result = protoParser.decode(topicId, payload);
|
|
13
|
+
|
|
14
|
+
if (result.success && result.messages) {
|
|
15
|
+
return {
|
|
16
|
+
type: 'iris',
|
|
17
|
+
messages: result.messages.filter(m => m.type === 'message' || !m.type),
|
|
18
|
+
threads: result.messages.filter(m => m.type === 'thread').map(m => m.thread),
|
|
19
|
+
typing: result.messages.filter(m => m.type === 'typing').map(m => m.typing)
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return { type: 'iris', error: result.error, raw: result.raw };
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Parse GraphQL (Presence, Typing)
|
|
27
|
+
function parseGraphQL(topicId, payload) {
|
|
28
|
+
const result = protoParser.decode(topicId, payload);
|
|
29
|
+
|
|
30
|
+
if (result.success) {
|
|
31
|
+
return {
|
|
32
|
+
type: 'graphql',
|
|
33
|
+
data: result.decoded,
|
|
34
|
+
messages: result.messages
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return { type: 'graphql', error: result.error };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Parse Delta (Sync updates)
|
|
42
|
+
function parseDelta(topicId, payload) {
|
|
43
|
+
const result = protoParser.decode(topicId, payload);
|
|
44
|
+
|
|
45
|
+
if (result.success && result.decoded) {
|
|
46
|
+
return {
|
|
47
|
+
type: 'delta',
|
|
48
|
+
seqId: result.decoded.seq_id,
|
|
49
|
+
action: result.decoded.action,
|
|
50
|
+
items: result.messages,
|
|
51
|
+
metadata: result.decoded.metadata
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return { type: 'delta', error: result.error };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Parse Presence
|
|
59
|
+
function parsePresence(topicId, payload) {
|
|
60
|
+
const result = protoParser.decode(topicId, payload);
|
|
61
|
+
|
|
62
|
+
if (result.success) {
|
|
63
|
+
return {
|
|
64
|
+
type: 'presence',
|
|
65
|
+
items: result.messages.map(m => ({
|
|
66
|
+
userId: m.id,
|
|
67
|
+
status: m.typing?.state || 'unknown',
|
|
68
|
+
timestamp: m.timestamp
|
|
69
|
+
}))
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return { type: 'presence', error: result.error };
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Parse Feed
|
|
77
|
+
function parseFeed(topicId, payload) {
|
|
78
|
+
const result = protoParser.decode(topicId, payload);
|
|
79
|
+
|
|
80
|
+
return {
|
|
81
|
+
type: 'feed',
|
|
82
|
+
decoded: result.decoded,
|
|
83
|
+
items: result.messages,
|
|
84
|
+
error: result.error
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Parse Live
|
|
89
|
+
function parseLive(topicId, payload) {
|
|
90
|
+
const result = protoParser.decode(topicId, payload);
|
|
91
|
+
|
|
92
|
+
return {
|
|
93
|
+
type: 'live',
|
|
94
|
+
decoded: result.decoded,
|
|
95
|
+
items: result.messages,
|
|
96
|
+
error: result.error
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Parse Region Hint
|
|
101
|
+
function parseRegionHint(topicId, payload) {
|
|
102
|
+
try {
|
|
103
|
+
const text = payload.toString('utf-8');
|
|
104
|
+
const hint = JSON.parse(text);
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
type: 'region-hint',
|
|
108
|
+
region: hint.region,
|
|
109
|
+
endpoint: hint.endpoint,
|
|
110
|
+
data: hint
|
|
111
|
+
};
|
|
112
|
+
} catch (e) {
|
|
113
|
+
return {
|
|
114
|
+
type: 'region-hint',
|
|
115
|
+
raw: payload.toString('utf-8', 0, 200),
|
|
116
|
+
error: e.message
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Unified router
|
|
122
|
+
const PARSERS = {
|
|
123
|
+
iris: parseIris,
|
|
124
|
+
graphql: parseGraphQL,
|
|
125
|
+
delta: parseDelta,
|
|
126
|
+
presence: parsePresence,
|
|
127
|
+
feed: parseFeed,
|
|
128
|
+
live: parseLive,
|
|
129
|
+
'region-hint': parseRegionHint
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
function parseByType(topicType, topicId, payload) {
|
|
133
|
+
const parser = PARSERS[topicType];
|
|
134
|
+
|
|
135
|
+
if (!parser) {
|
|
136
|
+
debug(`⚠️ Unknown topic type: ${topicType}`);
|
|
137
|
+
return { type: topicType, error: 'Unknown parser', raw: payload.toString('utf-8', 0, 200) };
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
try {
|
|
141
|
+
return parser(topicId, payload);
|
|
142
|
+
} catch (e) {
|
|
143
|
+
debug(`Parse error for ${topicType}:`, e.message);
|
|
144
|
+
return { type: topicType, error: e.message };
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
module.exports = {
|
|
149
|
+
parseIris,
|
|
150
|
+
parseGraphQL,
|
|
151
|
+
parseDelta,
|
|
152
|
+
parsePresence,
|
|
153
|
+
parseFeed,
|
|
154
|
+
parseLive,
|
|
155
|
+
parseRegionHint,
|
|
156
|
+
parseByType,
|
|
157
|
+
ProtoParser
|
|
158
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package ig.common;
|
|
4
|
+
|
|
5
|
+
// Shared message types used across Instagram
|
|
6
|
+
|
|
7
|
+
message Timestamp {
|
|
8
|
+
int64 unix_time_ms = 1;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
message UserId {
|
|
12
|
+
int64 id = 1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message ThreadId {
|
|
16
|
+
int64 id = 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message Reaction {
|
|
20
|
+
string emoji = 1;
|
|
21
|
+
int32 count = 2;
|
|
22
|
+
int64 created_at = 3;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message MediaAttachment {
|
|
26
|
+
int64 media_id = 1;
|
|
27
|
+
string type = 2; // image, video, carousel
|
|
28
|
+
string url = 3;
|
|
29
|
+
int32 width = 4;
|
|
30
|
+
int32 height = 5;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
message Link {
|
|
34
|
+
string url = 1;
|
|
35
|
+
string title = 2;
|
|
36
|
+
string description = 3;
|
|
37
|
+
string image_url = 4;
|
|
38
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package ig.direct;
|
|
4
|
+
|
|
5
|
+
import "common.proto";
|
|
6
|
+
|
|
7
|
+
// Direct message protocol - Specific implementation for DMs
|
|
8
|
+
|
|
9
|
+
message DirectInboxMessageContent {
|
|
10
|
+
string text = 1;
|
|
11
|
+
repeated ig.common.MediaAttachment media = 2;
|
|
12
|
+
repeated ig.common.Link links = 3;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message DirectInboxMessage {
|
|
16
|
+
string id = 1;
|
|
17
|
+
int64 user_id = 2;
|
|
18
|
+
int64 timestamp = 3;
|
|
19
|
+
|
|
20
|
+
string item_type = 4; // text, media_share, animated_media, etc
|
|
21
|
+
DirectInboxMessageContent content = 5;
|
|
22
|
+
|
|
23
|
+
map<string, string> reactions = 6;
|
|
24
|
+
|
|
25
|
+
bool is_sent = 7;
|
|
26
|
+
bool is_delivered = 8;
|
|
27
|
+
bool is_seen = 9;
|
|
28
|
+
|
|
29
|
+
int32 is_forward = 10;
|
|
30
|
+
int32 forwarded_from_id = 11;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
message DirectInboxThread {
|
|
34
|
+
int64 thread_id = 1;
|
|
35
|
+
repeated int64 user_ids = 2;
|
|
36
|
+
|
|
37
|
+
string thread_title = 3;
|
|
38
|
+
int64 last_activity_at = 4;
|
|
39
|
+
|
|
40
|
+
DirectInboxMessage last_message = 5;
|
|
41
|
+
|
|
42
|
+
int32 unfollowers_count = 6;
|
|
43
|
+
int32 thread_v2_id = 7;
|
|
44
|
+
|
|
45
|
+
bool is_pin = 8;
|
|
46
|
+
bool is_muted = 9;
|
|
47
|
+
bool is_archived = 10;
|
|
48
|
+
bool has_newer = 11;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
message DirectInbox {
|
|
52
|
+
repeated DirectInboxThread threads = 1;
|
|
53
|
+
string cursor = 2;
|
|
54
|
+
bool has_older = 3;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
message DirectSync {
|
|
58
|
+
int64 seq_id = 1;
|
|
59
|
+
int64 timestamp = 2;
|
|
60
|
+
|
|
61
|
+
repeated DirectInboxMessage messages = 3;
|
|
62
|
+
repeated DirectInboxThread threads = 4;
|
|
63
|
+
|
|
64
|
+
map<string, int64> seq_ids = 5; // per-thread seq tracking
|
|
65
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// Instagram Direct Messages Protocol (Protobuf)
|
|
2
|
+
// Used for real-time message sync via MQTT
|
|
3
|
+
|
|
4
|
+
syntax = "proto3";
|
|
5
|
+
|
|
6
|
+
package ig.iris;
|
|
7
|
+
|
|
8
|
+
// DirectMessage - Single message in a thread
|
|
9
|
+
message DirectMessage {
|
|
10
|
+
int64 message_id = 1;
|
|
11
|
+
int64 user_id = 2;
|
|
12
|
+
string content = 3;
|
|
13
|
+
int64 timestamp = 4;
|
|
14
|
+
|
|
15
|
+
// Message type: text, photo, video, etc.
|
|
16
|
+
string type = 5;
|
|
17
|
+
|
|
18
|
+
// Reactions: emoji -> count
|
|
19
|
+
map<string, int32> reactions = 6;
|
|
20
|
+
|
|
21
|
+
// Whether user has seen
|
|
22
|
+
bool is_sent = 7;
|
|
23
|
+
bool is_delivered = 8;
|
|
24
|
+
bool is_read = 9;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// DirectThread - Conversation thread
|
|
28
|
+
message DirectThread {
|
|
29
|
+
int64 thread_id = 1;
|
|
30
|
+
repeated int64 participant_ids = 2;
|
|
31
|
+
string thread_title = 3;
|
|
32
|
+
int64 last_message_ts = 4;
|
|
33
|
+
|
|
34
|
+
// Admin user ID
|
|
35
|
+
int64 admin_user_id = 5;
|
|
36
|
+
|
|
37
|
+
// Is group thread
|
|
38
|
+
bool is_group = 6;
|
|
39
|
+
|
|
40
|
+
// Is archived
|
|
41
|
+
bool is_archived = 7;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// TypingIndicator - User typing signal
|
|
45
|
+
message TypingIndicator {
|
|
46
|
+
int64 thread_id = 1;
|
|
47
|
+
int64 from_user_id = 2;
|
|
48
|
+
int64 timestamp = 3;
|
|
49
|
+
|
|
50
|
+
// 0 = typing, 1 = stopped
|
|
51
|
+
int32 state = 4;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// PresenceStatus - User online/offline
|
|
55
|
+
message PresenceStatus {
|
|
56
|
+
int64 user_id = 1;
|
|
57
|
+
|
|
58
|
+
// 0 = offline, 1 = active, 2 = idle
|
|
59
|
+
int32 status = 2;
|
|
60
|
+
|
|
61
|
+
int64 timestamp = 3;
|
|
62
|
+
int64 last_active = 4;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// DeltaMessage - Incremental sync update
|
|
66
|
+
message DeltaMessage {
|
|
67
|
+
int64 sequence_id = 1;
|
|
68
|
+
string operation = 2; // add, update, delete
|
|
69
|
+
|
|
70
|
+
oneof data {
|
|
71
|
+
DirectMessage message = 3;
|
|
72
|
+
DirectThread thread = 4;
|
|
73
|
+
TypingIndicator typing = 5;
|
|
74
|
+
PresenceStatus presence = 6;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Acknowledgment - Server expects ACK for delivery
|
|
79
|
+
message Acknowledgment {
|
|
80
|
+
int64 message_id = 1;
|
|
81
|
+
int64 thread_id = 2;
|
|
82
|
+
int64 timestamp = 3;
|
|
83
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package ig.iris;
|
|
4
|
+
|
|
5
|
+
import "common.proto";
|
|
6
|
+
|
|
7
|
+
// Real Instagram Iris Protocol - Direct Messages & Realtime
|
|
8
|
+
// Based on reverse-engineered instagram_mqtt package
|
|
9
|
+
|
|
10
|
+
message IrisPayload {
|
|
11
|
+
string action = 1;
|
|
12
|
+
int64 seq_id = 2;
|
|
13
|
+
repeated IrisItem items = 3;
|
|
14
|
+
map<string, string> metadata = 4;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
message IrisItem {
|
|
18
|
+
string id = 1;
|
|
19
|
+
string type = 2; // message, thread, typing, presence, deletion
|
|
20
|
+
int64 timestamp = 3;
|
|
21
|
+
|
|
22
|
+
oneof data {
|
|
23
|
+
MessageSyncMessage message = 4;
|
|
24
|
+
ThreadUpdate thread = 5;
|
|
25
|
+
TypingIndicator typing = 6;
|
|
26
|
+
PresenceIndicator presence = 7;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
string op = 8; // add, replace, delete
|
|
30
|
+
string path = 9; // JSON path to item
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Message from sync - includes text, media, reactions
|
|
34
|
+
message MessageSyncMessage {
|
|
35
|
+
string item_id = 1;
|
|
36
|
+
int64 user_id = 2;
|
|
37
|
+
int64 timestamp = 3;
|
|
38
|
+
|
|
39
|
+
string thread_id = 4;
|
|
40
|
+
string thread_v2_id = 5;
|
|
41
|
+
|
|
42
|
+
// Message type: text, media, like, hashtag, media_share, location, voice_media, animated_media
|
|
43
|
+
string item_type = 6;
|
|
44
|
+
string text = 7;
|
|
45
|
+
|
|
46
|
+
// Media references
|
|
47
|
+
MediaData media = 8;
|
|
48
|
+
VoiceMediaData voice_media = 9;
|
|
49
|
+
AnimatedMediaData animated_media = 10;
|
|
50
|
+
MediaShareData media_share = 11;
|
|
51
|
+
|
|
52
|
+
// Reactions
|
|
53
|
+
ReactionData reactions = 12;
|
|
54
|
+
|
|
55
|
+
// Metadata
|
|
56
|
+
bool is_sent = 13;
|
|
57
|
+
bool is_delivered = 14;
|
|
58
|
+
bool is_read = 15;
|
|
59
|
+
|
|
60
|
+
// Voice/Video Call info
|
|
61
|
+
string raven_media_type = 16;
|
|
62
|
+
map<string, string> extra_data = 17;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
message MediaData {
|
|
66
|
+
string id = 1;
|
|
67
|
+
int32 media_type = 2; // 1=image, 2=video, 8=album
|
|
68
|
+
|
|
69
|
+
int32 original_width = 3;
|
|
70
|
+
int32 original_height = 4;
|
|
71
|
+
|
|
72
|
+
repeated string image_urls = 5;
|
|
73
|
+
repeated string video_urls = 6;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
message VoiceMediaData {
|
|
77
|
+
string id = 1;
|
|
78
|
+
string audio_src = 2;
|
|
79
|
+
int32 duration = 3;
|
|
80
|
+
repeated int32 waveform_data = 4;
|
|
81
|
+
|
|
82
|
+
bool seen = 5;
|
|
83
|
+
int32 seen_count = 6;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
message AnimatedMediaData {
|
|
87
|
+
string id = 1;
|
|
88
|
+
string url = 2;
|
|
89
|
+
bool is_sticker = 3;
|
|
90
|
+
bool is_random = 4;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
message MediaShareData {
|
|
94
|
+
string id = 1;
|
|
95
|
+
string code = 2;
|
|
96
|
+
int32 media_type = 3;
|
|
97
|
+
|
|
98
|
+
int32 original_width = 4;
|
|
99
|
+
int32 original_height = 5;
|
|
100
|
+
|
|
101
|
+
string caption = 6;
|
|
102
|
+
int32 like_count = 7;
|
|
103
|
+
int32 comment_count = 8;
|
|
104
|
+
int64 taken_at = 9;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
message ReactionData {
|
|
108
|
+
map<int64, string> emojis = 1; // user_id -> emoji
|
|
109
|
+
int32 likes_count = 2;
|
|
110
|
+
int32 emojis_count = 3;
|
|
111
|
+
|
|
112
|
+
repeated ReactionItem likes = 4;
|
|
113
|
+
repeated ReactionItem emoji_reactions = 5;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
message ReactionItem {
|
|
117
|
+
int64 sender_id = 1;
|
|
118
|
+
int64 timestamp = 2;
|
|
119
|
+
string client_context = 3;
|
|
120
|
+
string emoji = 4;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Thread Update - conversation data
|
|
124
|
+
message ThreadUpdate {
|
|
125
|
+
string thread_id = 1;
|
|
126
|
+
string thread_v2_id = 2;
|
|
127
|
+
|
|
128
|
+
// Participants
|
|
129
|
+
repeated int64 user_ids = 3;
|
|
130
|
+
repeated int64 left_user_ids = 4;
|
|
131
|
+
repeated int64 admin_user_ids = 5;
|
|
132
|
+
|
|
133
|
+
// Thread info
|
|
134
|
+
string thread_title = 6;
|
|
135
|
+
int64 last_activity_at = 7;
|
|
136
|
+
|
|
137
|
+
bool is_group = 8;
|
|
138
|
+
bool is_archived = 9;
|
|
139
|
+
bool is_muted = 10;
|
|
140
|
+
bool is_pinned = 11;
|
|
141
|
+
bool is_spam = 12;
|
|
142
|
+
|
|
143
|
+
string thread_type = 13; // private, group
|
|
144
|
+
int32 folder = 14;
|
|
145
|
+
|
|
146
|
+
// Last message in thread
|
|
147
|
+
MessageSyncMessage last_message = 15;
|
|
148
|
+
|
|
149
|
+
// Pagination
|
|
150
|
+
bool has_older = 16;
|
|
151
|
+
bool has_newer = 17;
|
|
152
|
+
string newest_cursor = 18;
|
|
153
|
+
string oldest_cursor = 19;
|
|
154
|
+
string next_cursor = 20;
|
|
155
|
+
|
|
156
|
+
map<string, ThreadMetadata> metadata = 21;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
message ThreadMetadata {
|
|
160
|
+
string key = 1;
|
|
161
|
+
string value = 2;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Typing indicator
|
|
165
|
+
message TypingIndicator {
|
|
166
|
+
int64 thread_id = 1;
|
|
167
|
+
int64 from_user_id = 2;
|
|
168
|
+
string state = 3; // started, stopped
|
|
169
|
+
int64 timestamp = 4;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// User presence indicator
|
|
173
|
+
message PresenceIndicator {
|
|
174
|
+
int64 user_id = 1;
|
|
175
|
+
string status = 2; // active, inactive
|
|
176
|
+
int64 last_seen_at = 3;
|
|
177
|
+
int64 timestamp = 4;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Delta - incremental update
|
|
181
|
+
message Delta {
|
|
182
|
+
string operation = 1; // add, update, delete
|
|
183
|
+
string path = 2;
|
|
184
|
+
|
|
185
|
+
IrisItem item = 3;
|
|
186
|
+
|
|
187
|
+
map<string, string> context = 4;
|
|
188
|
+
}
|