nodejs-insta-private-api-mqt 1.3.84 → 1.3.86
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/dist/dist/constants/constants.d.ts +1 -0
- package/dist/dist/constants/index.d.ts +25 -0
- package/dist/dist/core/client.d.ts +106 -0
- package/dist/dist/core/nav-chain.d.ts +77 -0
- package/dist/dist/core/repository.d.ts +3 -0
- package/dist/dist/core/request.d.ts +76 -0
- package/dist/dist/core/state.d.ts +605 -0
- package/dist/dist/core/utils.d.ts +129 -0
- package/dist/dist/downloadMedia.d.ts +106 -0
- package/{dist-ts → dist}/dist/downloadMedia.js +19 -20
- package/dist/dist/errors/index.d.ts +18 -0
- package/dist/dist/extend.d.ts +20 -0
- package/dist/dist/fbns/fbns.client.d.ts +43 -0
- package/dist/dist/fbns/fbns.client.events.d.ts +0 -0
- package/{dist-ts → dist}/dist/fbns/fbns.client.js +4 -5
- package/dist/dist/fbns/fbns.device-auth.d.ts +9 -0
- package/{src-ts/dist/fbns/fbns.device-auth.ts → dist/dist/fbns/fbns.device-auth.js} +6 -3
- package/dist/dist/fbns/fbns.types.d.ts +0 -0
- package/dist/dist/fbns/fbns.utilities.d.ts +4 -0
- package/dist/dist/fbns/index.d.ts +2 -0
- package/dist/dist/index.d.ts +49 -0
- package/dist/dist/mqtt-shim.d.ts +1 -0
- package/dist/dist/mqttot/index.d.ts +2 -0
- package/dist/dist/mqttot/mqttot.client.d.ts +77 -0
- package/{dist-ts → dist}/dist/mqttot/mqttot.client.js +10 -10
- package/dist/dist/mqttot/mqttot.connect.request.packet.d.ts +1 -0
- package/dist/dist/mqttot/mqttot.connect.response.packet.d.ts +5 -0
- package/dist/dist/mqttot/mqttot.connection.d.ts +6 -0
- package/dist/dist/realtime/commands/commands.d.ts +19 -0
- package/dist/dist/realtime/commands/direct.commands.d.ts +142 -0
- package/dist/dist/realtime/commands/enhanced.direct.commands.d.ts +425 -0
- package/{dist-ts → dist}/dist/realtime/commands/enhanced.direct.commands.js +8 -10
- package/dist/dist/realtime/commands/index.d.ts +2 -0
- package/dist/dist/realtime/delta-sync.manager.d.ts +82 -0
- package/{dist-ts → dist}/dist/realtime/delta-sync.manager.js +7 -10
- package/dist/dist/realtime/features/dm-sender.d.ts +20 -0
- package/{src-ts/dist/realtime/features/dm-sender.ts → dist/dist/realtime/features/dm-sender.js} +6 -3
- package/dist/dist/realtime/features/error-handler.d.ts +33 -0
- package/{dist-ts → dist}/dist/realtime/features/error-handler.js +4 -4
- package/dist/dist/realtime/features/gap-handler.d.ts +19 -0
- package/dist/dist/realtime/features/persistent-logger.d.ts +28 -0
- package/{dist-ts → dist}/dist/realtime/features/persistent-logger.js +3 -3
- package/dist/dist/realtime/features/presence.manager.d.ts +24 -0
- package/{src-ts/dist/realtime/features/presence.manager.ts → dist/dist/realtime/features/presence.manager.js} +2 -1
- package/dist/dist/realtime/features/session-health-monitor.d.ts +93 -0
- package/{src-ts/dist/realtime/features/session-health-monitor.ts → dist/dist/realtime/features/session-health-monitor.js} +45 -65
- package/dist/dist/realtime/index.d.ts +9 -0
- package/dist/dist/realtime/messages/app-presence.event.d.ts +0 -0
- package/dist/dist/realtime/messages/index.d.ts +2 -0
- package/dist/dist/realtime/messages/message-sync.message.d.ts +1 -0
- package/dist/dist/realtime/messages/realtime-sub.direct.data.d.ts +0 -0
- package/dist/dist/realtime/messages/thread-update.message.d.ts +0 -0
- package/dist/dist/realtime/mixins/index.d.ts +2 -0
- package/dist/dist/realtime/mixins/message-sync.mixin.d.ts +38 -0
- package/{dist-ts → dist}/dist/realtime/mixins/message-sync.mixin.js +16 -18
- package/dist/dist/realtime/mixins/mixin.d.ts +4 -0
- package/dist/dist/realtime/mixins/presence-typing.mixin.d.ts +9 -0
- package/dist/dist/realtime/mixins/realtime-sub.mixin.d.ts +37 -0
- package/{dist-ts → dist}/dist/realtime/mixins/realtime-sub.mixin.js +4 -5
- package/dist/dist/realtime/parsers/graphql-parser.d.ts +18 -0
- package/dist/dist/realtime/parsers/graphql.parser.d.ts +10 -0
- package/{src-ts/dist/realtime/parsers/graphql.parser.ts → dist/dist/realtime/parsers/graphql.parser.js} +0 -1
- package/dist/dist/realtime/parsers/index.d.ts +2 -0
- package/dist/dist/realtime/parsers/iris-parser.d.ts +18 -0
- package/dist/dist/realtime/parsers/iris.parser.d.ts +3 -0
- package/dist/dist/realtime/parsers/json-parser.d.ts +18 -0
- package/dist/dist/realtime/parsers/json.parser.d.ts +6 -0
- package/dist/dist/realtime/parsers/parser.d.ts +0 -0
- package/dist/dist/realtime/parsers/region-hint-parser.d.ts +18 -0
- package/dist/dist/realtime/parsers/region-hint.parser.d.ts +4 -0
- package/dist/dist/realtime/parsers/skywalker-parser.d.ts +18 -0
- package/dist/dist/realtime/parsers/skywalker.parser.d.ts +7 -0
- package/dist/dist/realtime/parsers-advanced.d.ts +93 -0
- package/{dist-ts → dist}/dist/realtime/parsers-advanced.js +5 -8
- package/dist/dist/realtime/proto-parser.d.ts +27 -0
- package/{dist-ts → dist}/dist/realtime/proto-parser.js +1 -2
- package/dist/dist/realtime/protocols/iris.handshake.d.ts +41 -0
- package/dist/dist/realtime/protocols/proto-definitions.d.ts +0 -0
- package/dist/dist/realtime/protocols/skywalker.protocol.d.ts +20 -0
- package/{src-ts/dist/realtime/protocols/skywalker.protocol.ts → dist/dist/realtime/protocols/skywalker.protocol.js} +8 -5
- package/dist/dist/realtime/realtime.client.d.ts +169 -0
- package/dist/dist/realtime/realtime.client.events.d.ts +0 -0
- package/{dist-ts → dist}/dist/realtime/realtime.client.js +75 -86
- package/dist/dist/realtime/realtime.service.d.ts +109 -0
- package/dist/dist/realtime/reconnect.manager.d.ts +15 -0
- package/dist/dist/realtime/session.manager.d.ts +25 -0
- package/dist/dist/realtime/subscriptions/graphql.subscription.d.ts +4 -0
- package/dist/dist/realtime/subscriptions/index.d.ts +2 -0
- package/dist/dist/realtime/subscriptions/skywalker.subscription.d.ts +4 -0
- package/dist/dist/realtime/topic-map.d.ts +97 -0
- package/dist/dist/realtime/topic.d.ts +71 -0
- package/dist/dist/repositories/account.repository.d.ts +72 -0
- package/{dist-ts → dist}/dist/repositories/account.repository.js +4 -6
- package/dist/dist/repositories/bloks.repository.d.ts +6 -0
- package/dist/dist/repositories/captcha.repository.d.ts +6 -0
- package/dist/dist/repositories/challenge.repository.d.ts +12 -0
- package/{dist-ts → dist}/dist/repositories/challenge.repository.js +1 -2
- package/dist/dist/repositories/clip.repository.d.ts +10 -0
- package/dist/dist/repositories/close-friends.repository.d.ts +8 -0
- package/dist/dist/repositories/collection.repository.d.ts +8 -0
- package/dist/dist/repositories/direct-thread.repository.d.ts +88 -0
- package/{dist-ts → dist}/dist/repositories/direct-thread.repository.js +7 -9
- package/dist/dist/repositories/direct.repository.d.ts +22 -0
- package/{dist-ts → dist}/dist/repositories/direct.repository.js +4 -5
- package/dist/dist/repositories/explore.repository.d.ts +7 -0
- package/dist/dist/repositories/fbsearch.repository.d.ts +14 -0
- package/dist/dist/repositories/feed.repository.d.ts +19 -0
- package/dist/dist/repositories/friendship.repository.d.ts +26 -0
- package/dist/dist/repositories/fundraiser.repository.d.ts +6 -0
- package/dist/dist/repositories/hashtag.repository.d.ts +11 -0
- package/dist/dist/repositories/highlights.repository.d.ts +11 -0
- package/dist/dist/repositories/insights.repository.d.ts +8 -0
- package/dist/dist/repositories/location.repository.d.ts +9 -0
- package/dist/dist/repositories/media.repository.d.ts +41 -0
- package/{dist-ts → dist}/dist/repositories/media.repository.js +1 -2
- package/dist/dist/repositories/multiple-accounts.repository.d.ts +7 -0
- package/dist/dist/repositories/news.repository.d.ts +6 -0
- package/dist/dist/repositories/note.repository.d.ts +8 -0
- package/dist/dist/repositories/notification.repository.d.ts +33 -0
- package/{dist-ts → dist}/dist/repositories/notification.repository.js +1 -1
- package/dist/dist/repositories/share.repository.d.ts +12 -0
- package/dist/dist/repositories/signup.repository.d.ts +19 -0
- package/dist/dist/repositories/story.repository.d.ts +23 -0
- package/{dist-ts → dist}/dist/repositories/story.repository.js +1 -2
- package/dist/dist/repositories/timeline.repository.d.ts +7 -0
- package/dist/dist/repositories/totp.repository.d.ts +14 -0
- package/dist/dist/repositories/track.repository.d.ts +7 -0
- package/{dist-ts → dist}/dist/repositories/track.repository.js +1 -2
- package/dist/dist/repositories/upload.repository.d.ts +30 -0
- package/{dist-ts → dist}/dist/repositories/upload.repository.js +4 -5
- package/dist/dist/repositories/user.repository.d.ts +52 -0
- package/dist/dist/sendmedia/index.d.ts +12 -0
- package/dist/dist/sendmedia/sendFile.d.ts +8 -0
- package/dist/dist/sendmedia/sendPhoto.d.ts +26 -0
- package/dist/dist/sendmedia/sendRavenPhoto.d.ts +14 -0
- package/{dist-ts → dist}/dist/sendmedia/sendRavenPhoto.js +4 -5
- package/dist/dist/sendmedia/sendRavenVideo.d.ts +15 -0
- package/{dist-ts → dist}/dist/sendmedia/sendRavenVideo.js +4 -5
- package/dist/dist/sendmedia/uploadPhoto.d.ts +8 -0
- package/dist/dist/sendmedia/uploadfFile.d.ts +13 -0
- package/{dist-ts → dist}/dist/sendmedia/uploadfFile.js +3 -4
- package/dist/dist/services/live.service.d.ts +13 -0
- package/dist/dist/services/search.service.d.ts +11 -0
- package/dist/dist/shared/index.d.ts +4 -0
- package/{src-ts/dist/shared/index.ts → dist/dist/shared/index.js} +14 -13
- package/dist/dist/shared/shared.d.ts +15 -0
- package/dist/dist/thrift/index.d.ts +2 -0
- package/dist/dist/thrift/thrift.d.ts +11 -0
- package/dist/dist/thrift/thrift.reading.d.ts +49 -0
- package/{dist-ts → dist}/dist/thrift/thrift.reading.js +3 -5
- package/dist/dist/thrift/thrift.writing.d.ts +49 -0
- package/{dist-ts → dist}/dist/thrift/thrift.writing.js +2 -4
- package/dist/dist/types/index.d.ts +28 -0
- package/dist/dist/useMultiFileAuthState.d.ts +267 -0
- package/{dist-ts → dist}/dist/useMultiFileAuthState.js +47 -61
- package/dist/dist/utils/helper-1.d.ts +0 -0
- package/dist/dist/utils/helper-10.d.ts +0 -0
- package/dist/dist/utils/helper-11.d.ts +0 -0
- package/dist/dist/utils/helper-12.d.ts +0 -0
- package/dist/dist/utils/helper-13.d.ts +0 -0
- package/dist/dist/utils/helper-14.d.ts +0 -0
- package/dist/dist/utils/helper-15.d.ts +0 -0
- package/dist/dist/utils/helper-16.d.ts +0 -0
- package/dist/dist/utils/helper-17.d.ts +0 -0
- package/dist/dist/utils/helper-18.d.ts +0 -0
- package/dist/dist/utils/helper-19.d.ts +0 -0
- package/dist/dist/utils/helper-2.d.ts +0 -0
- package/dist/dist/utils/helper-20.d.ts +0 -0
- package/dist/dist/utils/helper-21.d.ts +0 -0
- package/dist/dist/utils/helper-22.d.ts +0 -0
- package/dist/dist/utils/helper-23.d.ts +0 -0
- package/dist/dist/utils/helper-24.d.ts +0 -0
- package/dist/dist/utils/helper-25.d.ts +0 -0
- package/dist/dist/utils/helper-26.d.ts +0 -0
- package/dist/dist/utils/helper-27.d.ts +0 -0
- package/dist/dist/utils/helper-28.d.ts +0 -0
- package/dist/dist/utils/helper-29.d.ts +0 -0
- package/dist/dist/utils/helper-3.d.ts +0 -0
- package/dist/dist/utils/helper-30.d.ts +0 -0
- package/dist/dist/utils/helper-4.d.ts +0 -0
- package/dist/dist/utils/helper-5.d.ts +0 -0
- package/dist/dist/utils/helper-6.d.ts +0 -0
- package/dist/dist/utils/helper-7.d.ts +0 -0
- package/dist/dist/utils/helper-8.d.ts +0 -0
- package/dist/dist/utils/helper-9.d.ts +0 -0
- package/dist/dist/utils/index.d.ts +56 -0
- package/{dist-ts → dist}/dist/utils/index.js +1 -2
- package/dist/dist/utils/insta-mqtt-helper.d.ts +30 -0
- package/dist/examples/listen-to-messages.d.ts +4 -0
- package/{dist-ts → dist}/examples/listen-to-messages.js +1 -2
- package/package.json +41 -38
- package/dist-ts/dist/fbns/fbns.device-auth.js +0 -59
- package/dist-ts/dist/realtime/features/dm-sender.js +0 -94
- package/dist-ts/dist/realtime/features/presence.manager.js +0 -68
- package/dist-ts/dist/realtime/features/session-health-monitor.js +0 -327
- package/dist-ts/dist/realtime/parsers/graphql.parser.js +0 -22
- package/dist-ts/dist/realtime/protocols/skywalker.protocol.js +0 -96
- package/dist-ts/dist/shared/index.js +0 -98
- package/examples/listen-to-messages.js +0 -86
- package/src-ts/dist/constants/constants.ts +0 -342
- package/src-ts/dist/constants/index.ts +0 -58
- package/src-ts/dist/core/client.ts +0 -419
- package/src-ts/dist/core/nav-chain.ts +0 -282
- package/src-ts/dist/core/repository.ts +0 -7
- package/src-ts/dist/core/request.ts +0 -395
- package/src-ts/dist/core/state.ts +0 -1484
- package/src-ts/dist/core/utils.ts +0 -786
- package/src-ts/dist/downloadMedia.ts +0 -381
- package/src-ts/dist/errors/index.ts +0 -38
- package/src-ts/dist/extend.ts +0 -167
- package/src-ts/dist/fbns/fbns.client.events.ts +0 -3
- package/src-ts/dist/fbns/fbns.client.ts +0 -252
- package/src-ts/dist/fbns/fbns.types.ts +0 -3
- package/src-ts/dist/fbns/fbns.utilities.ts +0 -79
- package/src-ts/dist/fbns/index.ts +0 -21
- package/src-ts/dist/index.ts +0 -139
- package/src-ts/dist/mqtt-shim.ts +0 -15
- package/src-ts/dist/mqttot/index.ts +0 -21
- package/src-ts/dist/mqttot/mqttot.client.ts +0 -318
- package/src-ts/dist/mqttot/mqttot.connect.request.packet.ts +0 -9
- package/src-ts/dist/mqttot/mqttot.connect.response.packet.ts +0 -24
- package/src-ts/dist/mqttot/mqttot.connection.ts +0 -77
- package/src-ts/dist/realtime/commands/commands.ts +0 -71
- package/src-ts/dist/realtime/commands/direct.commands.ts +0 -417
- package/src-ts/dist/realtime/commands/enhanced.direct.commands.ts +0 -1731
- package/src-ts/dist/realtime/commands/index.ts +0 -20
- package/src-ts/dist/realtime/delta-sync.manager.ts +0 -293
- package/src-ts/dist/realtime/features/error-handler.ts +0 -185
- package/src-ts/dist/realtime/features/gap-handler.ts +0 -61
- package/src-ts/dist/realtime/features/persistent-logger.ts +0 -186
- package/src-ts/dist/realtime/index.ts +0 -30
- package/src-ts/dist/realtime/messages/app-presence.event.ts +0 -3
- package/src-ts/dist/realtime/messages/index.ts +0 -20
- package/src-ts/dist/realtime/messages/message-sync.message.ts +0 -43
- package/src-ts/dist/realtime/messages/realtime-sub.direct.data.ts +0 -3
- package/src-ts/dist/realtime/messages/thread-update.message.ts +0 -3
- package/src-ts/dist/realtime/mixins/index.ts +0 -20
- package/src-ts/dist/realtime/mixins/message-sync.mixin.ts +0 -596
- package/src-ts/dist/realtime/mixins/mixin.ts +0 -41
- package/src-ts/dist/realtime/mixins/presence-typing.mixin.ts +0 -33
- package/src-ts/dist/realtime/mixins/realtime-sub.mixin.ts +0 -181
- package/src-ts/dist/realtime/parsers/graphql-parser.ts +0 -43
- package/src-ts/dist/realtime/parsers/index.ts +0 -23
- package/src-ts/dist/realtime/parsers/iris-parser.ts +0 -43
- package/src-ts/dist/realtime/parsers/iris.parser.ts +0 -10
- package/src-ts/dist/realtime/parsers/json-parser.ts +0 -43
- package/src-ts/dist/realtime/parsers/json.parser.ts +0 -10
- package/src-ts/dist/realtime/parsers/parser.ts +0 -3
- package/src-ts/dist/realtime/parsers/region-hint-parser.ts +0 -43
- package/src-ts/dist/realtime/parsers/region-hint.parser.ts +0 -15
- package/src-ts/dist/realtime/parsers/skywalker-parser.ts +0 -43
- package/src-ts/dist/realtime/parsers/skywalker.parser.ts +0 -15
- package/src-ts/dist/realtime/parsers-advanced.ts +0 -158
- package/src-ts/dist/realtime/proto-parser.ts +0 -195
- package/src-ts/dist/realtime/protocols/iris.handshake.ts +0 -74
- package/src-ts/dist/realtime/protocols/proto-definitions.ts +0 -80
- package/src-ts/dist/realtime/realtime.client.events.ts +0 -3
- package/src-ts/dist/realtime/realtime.client.ts +0 -1996
- package/src-ts/dist/realtime/realtime.service.ts +0 -462
- package/src-ts/dist/realtime/reconnect.manager.ts +0 -88
- package/src-ts/dist/realtime/session.manager.ts +0 -121
- package/src-ts/dist/realtime/subscriptions/graphql.subscription.ts +0 -99
- package/src-ts/dist/realtime/subscriptions/index.ts +0 -19
- package/src-ts/dist/realtime/subscriptions/skywalker.subscription.ts +0 -13
- package/src-ts/dist/realtime/topic-map.ts +0 -71
- package/src-ts/dist/realtime/topic.ts +0 -80
- package/src-ts/dist/repositories/account.repository.ts +0 -1384
- package/src-ts/dist/repositories/bloks.repository.ts +0 -70
- package/src-ts/dist/repositories/captcha.repository.ts +0 -44
- package/src-ts/dist/repositories/challenge.repository.ts +0 -120
- package/src-ts/dist/repositories/clip.repository.ts +0 -165
- package/src-ts/dist/repositories/close-friends.repository.ts +0 -46
- package/src-ts/dist/repositories/collection.repository.ts +0 -68
- package/src-ts/dist/repositories/direct-thread.repository.ts +0 -446
- package/src-ts/dist/repositories/direct.repository.ts +0 -266
- package/src-ts/dist/repositories/explore.repository.ts +0 -70
- package/src-ts/dist/repositories/fbsearch.repository.ts +0 -140
- package/src-ts/dist/repositories/feed.repository.ts +0 -245
- package/src-ts/dist/repositories/friendship.repository.ts +0 -296
- package/src-ts/dist/repositories/fundraiser.repository.ts +0 -49
- package/src-ts/dist/repositories/hashtag.repository.ts +0 -99
- package/src-ts/dist/repositories/highlights.repository.ts +0 -121
- package/src-ts/dist/repositories/insights.repository.ts +0 -82
- package/src-ts/dist/repositories/location.repository.ts +0 -84
- package/src-ts/dist/repositories/media.repository.ts +0 -395
- package/src-ts/dist/repositories/multiple-accounts.repository.ts +0 -41
- package/src-ts/dist/repositories/news.repository.ts +0 -35
- package/src-ts/dist/repositories/note.repository.ts +0 -57
- package/src-ts/dist/repositories/notification.repository.ts +0 -79
- package/src-ts/dist/repositories/share.repository.ts +0 -35
- package/src-ts/dist/repositories/signup.repository.ts +0 -218
- package/src-ts/dist/repositories/story.repository.ts +0 -290
- package/src-ts/dist/repositories/timeline.repository.ts +0 -60
- package/src-ts/dist/repositories/totp.repository.ts +0 -139
- package/src-ts/dist/repositories/track.repository.ts +0 -53
- package/src-ts/dist/repositories/upload.repository.ts +0 -204
- package/src-ts/dist/repositories/user.repository.ts +0 -360
- package/src-ts/dist/sendmedia/index.ts +0 -27
- package/src-ts/dist/sendmedia/sendFile.ts +0 -72
- package/src-ts/dist/sendmedia/sendPhoto.ts +0 -142
- package/src-ts/dist/sendmedia/sendRavenPhoto.ts +0 -153
- package/src-ts/dist/sendmedia/sendRavenVideo.ts +0 -158
- package/src-ts/dist/sendmedia/uploadPhoto.ts +0 -107
- package/src-ts/dist/sendmedia/uploadfFile.ts +0 -130
- package/src-ts/dist/services/live.service.ts +0 -139
- package/src-ts/dist/services/search.service.ts +0 -115
- package/src-ts/dist/shared/shared.ts +0 -86
- package/src-ts/dist/thrift/index.ts +0 -20
- package/src-ts/dist/thrift/thrift.reading.ts +0 -368
- package/src-ts/dist/thrift/thrift.ts +0 -111
- package/src-ts/dist/thrift/thrift.writing.ts +0 -396
- package/src-ts/dist/types/index.ts +0 -285
- package/src-ts/dist/useMultiFileAuthState.ts +0 -1800
- package/src-ts/dist/utils/helper-1.ts +0 -1
- package/src-ts/dist/utils/helper-10.ts +0 -1
- package/src-ts/dist/utils/helper-11.ts +0 -1
- package/src-ts/dist/utils/helper-12.ts +0 -1
- package/src-ts/dist/utils/helper-13.ts +0 -1
- package/src-ts/dist/utils/helper-14.ts +0 -1
- package/src-ts/dist/utils/helper-15.ts +0 -1
- package/src-ts/dist/utils/helper-16.ts +0 -1
- package/src-ts/dist/utils/helper-17.ts +0 -1
- package/src-ts/dist/utils/helper-18.ts +0 -1
- package/src-ts/dist/utils/helper-19.ts +0 -1
- package/src-ts/dist/utils/helper-2.ts +0 -1
- package/src-ts/dist/utils/helper-20.ts +0 -1
- package/src-ts/dist/utils/helper-21.ts +0 -1
- package/src-ts/dist/utils/helper-22.ts +0 -1
- package/src-ts/dist/utils/helper-23.ts +0 -1
- package/src-ts/dist/utils/helper-24.ts +0 -1
- package/src-ts/dist/utils/helper-25.ts +0 -1
- package/src-ts/dist/utils/helper-26.ts +0 -1
- package/src-ts/dist/utils/helper-27.ts +0 -1
- package/src-ts/dist/utils/helper-28.ts +0 -1
- package/src-ts/dist/utils/helper-29.ts +0 -1
- package/src-ts/dist/utils/helper-3.ts +0 -1
- package/src-ts/dist/utils/helper-30.ts +0 -1
- package/src-ts/dist/utils/helper-4.ts +0 -1
- package/src-ts/dist/utils/helper-5.ts +0 -1
- package/src-ts/dist/utils/helper-6.ts +0 -1
- package/src-ts/dist/utils/helper-7.ts +0 -1
- package/src-ts/dist/utils/helper-8.ts +0 -1
- package/src-ts/dist/utils/helper-9.ts +0 -1
- package/src-ts/dist/utils/index.ts +0 -280
- package/src-ts/dist/utils/insta-mqtt-helper.ts +0 -128
- package/src-ts/examples/listen-to-messages.ts +0 -86
- /package/{dist-ts → dist}/dist/constants/constants.js +0 -0
- /package/{dist-ts → dist}/dist/constants/index.js +0 -0
- /package/{dist-ts → dist}/dist/core/client.js +0 -0
- /package/{dist-ts → dist}/dist/core/nav-chain.js +0 -0
- /package/{dist-ts → dist}/dist/core/repository.js +0 -0
- /package/{dist-ts → dist}/dist/core/request.js +0 -0
- /package/{dist-ts → dist}/dist/core/state.js +0 -0
- /package/{dist-ts → dist}/dist/core/utils.js +0 -0
- /package/{dist-ts → dist}/dist/errors/index.js +0 -0
- /package/{dist-ts → dist}/dist/extend.js +0 -0
- /package/{dist-ts → dist}/dist/fbns/fbns.client.events.js +0 -0
- /package/{dist-ts → dist}/dist/fbns/fbns.types.js +0 -0
- /package/{dist-ts → dist}/dist/fbns/fbns.utilities.js +0 -0
- /package/{dist-ts → dist}/dist/fbns/index.js +0 -0
- /package/{dist-ts → dist}/dist/index.js +0 -0
- /package/{dist-ts → dist}/dist/mqtt-shim.js +0 -0
- /package/{dist-ts → dist}/dist/mqttot/index.js +0 -0
- /package/{dist-ts → dist}/dist/mqttot/mqttot.connect.request.packet.js +0 -0
- /package/{dist-ts → dist}/dist/mqttot/mqttot.connect.response.packet.js +0 -0
- /package/{dist-ts → dist}/dist/mqttot/mqttot.connection.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/commands/commands.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/commands/direct.commands.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/commands/index.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/features/gap-handler.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/index.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/messages/app-presence.event.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/messages/index.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/messages/message-sync.message.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/messages/realtime-sub.direct.data.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/messages/thread-update.message.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/mixins/index.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/mixins/mixin.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/mixins/presence-typing.mixin.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/parsers/graphql-parser.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/parsers/index.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/parsers/iris-parser.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/parsers/iris.parser.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/parsers/json-parser.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/parsers/json.parser.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/parsers/parser.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/parsers/region-hint-parser.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/parsers/region-hint.parser.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/parsers/skywalker-parser.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/parsers/skywalker.parser.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/protocols/iris.handshake.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/protocols/proto-definitions.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/realtime.client.events.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/realtime.service.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/reconnect.manager.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/session.manager.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/subscriptions/graphql.subscription.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/subscriptions/index.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/subscriptions/skywalker.subscription.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/topic-map.js +0 -0
- /package/{dist-ts → dist}/dist/realtime/topic.js +0 -0
- /package/{dist-ts → dist}/dist/repositories/bloks.repository.js +0 -0
- /package/{dist-ts → dist}/dist/repositories/captcha.repository.js +0 -0
- /package/{dist-ts → dist}/dist/repositories/clip.repository.js +0 -0
- /package/{dist-ts → dist}/dist/repositories/close-friends.repository.js +0 -0
- /package/{dist-ts → dist}/dist/repositories/collection.repository.js +0 -0
- /package/{dist-ts → dist}/dist/repositories/explore.repository.js +0 -0
- /package/{dist-ts → dist}/dist/repositories/fbsearch.repository.js +0 -0
- /package/{dist-ts → dist}/dist/repositories/feed.repository.js +0 -0
- /package/{dist-ts → dist}/dist/repositories/friendship.repository.js +0 -0
- /package/{dist-ts → dist}/dist/repositories/fundraiser.repository.js +0 -0
- /package/{dist-ts → dist}/dist/repositories/hashtag.repository.js +0 -0
- /package/{dist-ts → dist}/dist/repositories/highlights.repository.js +0 -0
- /package/{dist-ts → dist}/dist/repositories/insights.repository.js +0 -0
- /package/{dist-ts → dist}/dist/repositories/location.repository.js +0 -0
- /package/{dist-ts → dist}/dist/repositories/multiple-accounts.repository.js +0 -0
- /package/{dist-ts → dist}/dist/repositories/news.repository.js +0 -0
- /package/{dist-ts → dist}/dist/repositories/note.repository.js +0 -0
- /package/{dist-ts → dist}/dist/repositories/share.repository.js +0 -0
- /package/{dist-ts → dist}/dist/repositories/signup.repository.js +0 -0
- /package/{dist-ts → dist}/dist/repositories/timeline.repository.js +0 -0
- /package/{dist-ts → dist}/dist/repositories/totp.repository.js +0 -0
- /package/{dist-ts → dist}/dist/repositories/user.repository.js +0 -0
- /package/{dist-ts → dist}/dist/sendmedia/index.js +0 -0
- /package/{dist-ts → dist}/dist/sendmedia/sendFile.js +0 -0
- /package/{dist-ts → dist}/dist/sendmedia/sendPhoto.js +0 -0
- /package/{dist-ts → dist}/dist/sendmedia/uploadPhoto.js +0 -0
- /package/{dist-ts → dist}/dist/services/live.service.js +0 -0
- /package/{dist-ts → dist}/dist/services/search.service.js +0 -0
- /package/{dist-ts → dist}/dist/shared/shared.js +0 -0
- /package/{dist-ts → dist}/dist/thrift/index.js +0 -0
- /package/{dist-ts → dist}/dist/thrift/thrift.js +0 -0
- /package/{dist-ts → dist}/dist/types/index.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-1.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-10.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-11.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-12.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-13.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-14.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-15.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-16.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-17.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-18.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-19.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-2.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-20.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-21.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-22.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-23.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-24.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-25.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-26.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-27.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-28.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-29.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-3.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-30.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-4.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-5.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-6.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-7.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-8.js +0 -0
- /package/{dist-ts → dist}/dist/utils/helper-9.js +0 -0
- /package/{dist-ts → dist}/dist/utils/insta-mqtt-helper.js +0 -0
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FbnsClient = void 0;
|
|
4
|
-
const constants_1 = require("../constants");
|
|
5
|
-
const fbns_device_auth_1 = require("./fbns.device-auth");
|
|
6
|
-
const shared_1 = require("../shared");
|
|
7
|
-
const mqttot_1 = require("../mqttot");
|
|
8
|
-
const chance_1 = require("chance");
|
|
9
|
-
const mqtts_1 = require("../mqtt-shim");
|
|
10
|
-
const errors_1 = require("../errors");
|
|
11
|
-
const eventemitter3_1 = require("eventemitter3");
|
|
12
|
-
const fbns_utilities_1 = require("./fbns.utilities");
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* FbnsClient
|
|
16
|
-
*
|
|
17
|
-
* Lightweight wrapper around MQTToTClient to handle FBNS-specific connection
|
|
18
|
-
* payloads, registration, message handling and safe disconnect behavior.
|
|
19
|
-
*
|
|
20
|
-
* NOTE: This file contains a small but important robustness change:
|
|
21
|
-
* when receiving an empty CONNACK payload we no longer force a disconnect.
|
|
22
|
-
* Instagram sometimes returns a successful CONNACK with an empty payload;
|
|
23
|
-
* treating that as a fatal error causes unnecessary disconnect loops.
|
|
24
|
-
*/
|
|
25
|
-
class FbnsClient extends eventemitter3_1.EventEmitter {
|
|
26
|
-
get auth() {
|
|
27
|
-
return this._auth;
|
|
28
|
-
}
|
|
29
|
-
set auth(value) {
|
|
30
|
-
this._auth = value;
|
|
31
|
-
}
|
|
32
|
-
constructor(ig) {
|
|
33
|
-
super();
|
|
34
|
-
this.ig = ig;
|
|
35
|
-
this.fbnsDebug = (0, shared_1.debugChannel)('fbns');
|
|
36
|
-
this.safeDisconnect = false;
|
|
37
|
-
this._auth = new fbns_device_auth_1.FbnsDeviceAuth(this.ig);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
buildConnection() {
|
|
41
|
-
this.fbnsDebug('Constructing connection');
|
|
42
|
-
this.conn = new mqttot_1.MQTToTConnection({
|
|
43
|
-
clientIdentifier: this._auth.clientId,
|
|
44
|
-
clientInfo: {
|
|
45
|
-
userId: BigInt(this._auth.userId),
|
|
46
|
-
userAgent: (0, shared_1.createFbnsUserAgent)(this.ig),
|
|
47
|
-
clientCapabilities: 183,
|
|
48
|
-
endpointCapabilities: 128,
|
|
49
|
-
publishFormat: 1,
|
|
50
|
-
noAutomaticForeground: true,
|
|
51
|
-
makeUserAvailableInForeground: false,
|
|
52
|
-
deviceId: this._auth.deviceId,
|
|
53
|
-
isInitiallyForeground: false,
|
|
54
|
-
networkType: 1,
|
|
55
|
-
networkSubtype: 0,
|
|
56
|
-
clientMqttSessionId: BigInt(Date.now()) & BigInt(0xffffffff),
|
|
57
|
-
subscribeTopics: [76, 80, 231],
|
|
58
|
-
clientType: 'device_auth',
|
|
59
|
-
appId: BigInt(567310203415052),
|
|
60
|
-
deviceSecret: this._auth.deviceSecret,
|
|
61
|
-
anotherUnknown: BigInt(-1),
|
|
62
|
-
clientStack: 3,
|
|
63
|
-
},
|
|
64
|
-
password: this._auth.password,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Connect to FBNS (Firebase/FBNS equivalent over Instagram MQTT)
|
|
70
|
-
*
|
|
71
|
-
* Options:
|
|
72
|
-
* - enableTrace
|
|
73
|
-
* - autoReconnect
|
|
74
|
-
* - socksOptions
|
|
75
|
-
* - additionalTlsOptions
|
|
76
|
-
*
|
|
77
|
-
* Important robustness changes:
|
|
78
|
-
* - Do not force disconnect on empty CONNACK payload; log and continue.
|
|
79
|
-
* - Use clean:false to prefer session resume on reconnect (less aggressive).
|
|
80
|
-
*/
|
|
81
|
-
async connect({ enableTrace, autoReconnect, socksOptions, additionalTlsOptions, } = {}) {
|
|
82
|
-
this.fbnsDebug('Connecting to FBNS...');
|
|
83
|
-
// Ensure auth info is up-to-date
|
|
84
|
-
this.auth.update();
|
|
85
|
-
|
|
86
|
-
this.client = new mqttot_1.MQTToTClient({
|
|
87
|
-
url: constants_1.FBNS.HOST_NAME_V6,
|
|
88
|
-
payloadProvider: () => {
|
|
89
|
-
this.buildConnection();
|
|
90
|
-
if (!this.conn) {
|
|
91
|
-
throw new errors_1.InvalidStateError("No connection created - can't build provider");
|
|
92
|
-
}
|
|
93
|
-
return (0, shared_1.compressDeflate)(this.conn.toThrift());
|
|
94
|
-
},
|
|
95
|
-
enableTrace,
|
|
96
|
-
autoReconnect: autoReconnect ?? true,
|
|
97
|
-
requirePayload: false,
|
|
98
|
-
socksOptions,
|
|
99
|
-
additionalOptions: additionalTlsOptions,
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
// Re-emit warnings/errors to outer listeners
|
|
103
|
-
this.client.on('warning', w => this.emit('warning', w));
|
|
104
|
-
this.client.on('error', e => this.emit('error', e));
|
|
105
|
-
|
|
106
|
-
// If disconnect happens and safeDisconnect is false, emit error to upper layer
|
|
107
|
-
this.client.on('disconnect', reason => this.safeDisconnect
|
|
108
|
-
? this.emit('disconnect', reason && JSON.stringify(reason))
|
|
109
|
-
: this.emit('error', new errors_1.ClientDisconnectedError(`MQTToTClient got disconnected. Reason: ${reason && JSON.stringify(reason)}`)));
|
|
110
|
-
|
|
111
|
-
// Listen for FBNS messages and transform them accordingly
|
|
112
|
-
this.client.listen(constants_1.FbnsTopics.FBNS_MESSAGE.id, msg => this.handleMessage(msg));
|
|
113
|
-
this.client.listen({
|
|
114
|
-
topic: constants_1.FbnsTopics.FBNS_EXP_LOGGING.id,
|
|
115
|
-
transformer: async (msg) => JSON.parse((await (0, shared_1.tryUnzipAsync)(msg.payload)).toString()),
|
|
116
|
-
}, msg => this.emit('logging', msg));
|
|
117
|
-
this.client.listen(constants_1.FbnsTopics.PP.id, msg => this.emit('pp', msg.payload.toString()));
|
|
118
|
-
|
|
119
|
-
// Handle connect event from the underlying mqtt client
|
|
120
|
-
this.client.on('connect', async (res) => {
|
|
121
|
-
if (!this.client) {
|
|
122
|
-
throw new mqtts_1.IllegalStateError('No client registered but an event was received');
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
this.fbnsDebug('Connected to MQTT');
|
|
126
|
-
|
|
127
|
-
// IMPORTANT: Instagram sometimes returns a valid CONNACK with an empty payload.
|
|
128
|
-
// Historically this library treated that as an error and disconnected.
|
|
129
|
-
// That behavior causes unnecessary reconnect loops. Instead, log and continue.
|
|
130
|
-
if (!res.payload?.length) {
|
|
131
|
-
this.fbnsDebug(`Received empty connect packet. Reason: ${res.errorName} (continuing without disconnect)`);
|
|
132
|
-
// Emit a warning but do not disconnect.
|
|
133
|
-
this.emit('warning', new errors_1.EmptyPacketError('Received empty connect packet (continuing).'));
|
|
134
|
-
// NOTE: we do not return here because some flows expect the registration step below.
|
|
135
|
-
// If you prefer to skip registration on empty payload, uncomment the next line:
|
|
136
|
-
// return;
|
|
137
|
-
} else {
|
|
138
|
-
// If payload present, read auth as before
|
|
139
|
-
try {
|
|
140
|
-
const payload = res.payload.toString('utf8');
|
|
141
|
-
this.fbnsDebug(`Received auth: ${payload}`);
|
|
142
|
-
this._auth.read(payload);
|
|
143
|
-
this.emit('auth', this.auth);
|
|
144
|
-
} catch (e) {
|
|
145
|
-
this.fbnsDebug(`Failed to parse connect payload: ${e?.message || e}`);
|
|
146
|
-
this.emit('error', e);
|
|
147
|
-
// do not force disconnect here - let reconnect logic handle transient issues
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// Continue with registration attempt if possible.
|
|
152
|
-
try {
|
|
153
|
-
await this.client.mqttotPublish({
|
|
154
|
-
topic: constants_1.FbnsTopics.FBNS_REG_REQ.id,
|
|
155
|
-
payload: Buffer.from(JSON.stringify({
|
|
156
|
-
pkg_name: constants_1.INSTAGRAM_PACKAGE_NAME,
|
|
157
|
-
appid: this.ig.state.fbAnalyticsApplicationId,
|
|
158
|
-
}), 'utf8'),
|
|
159
|
-
qosLevel: 1,
|
|
160
|
-
});
|
|
161
|
-
} catch (e) {
|
|
162
|
-
// Log registration publish error but don't necessarily abort connection entirely here
|
|
163
|
-
this.fbnsDebug(`FBNS_REG_REQ publish failed: ${e?.message || e}`);
|
|
164
|
-
this.emit('warning', e);
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
// Set up the register response listener BEFORE connecting
|
|
169
|
-
// because the response can arrive before connect() returns
|
|
170
|
-
const regRespPromise = (0, shared_1.listenOnce)(this.client, constants_1.FbnsTopics.FBNS_REG_RESP.id);
|
|
171
|
-
|
|
172
|
-
// Establish connection with conservative options (prefer session resume)
|
|
173
|
-
await this.client
|
|
174
|
-
.connect({
|
|
175
|
-
keepAlive: 60,
|
|
176
|
-
protocolLevel: 3,
|
|
177
|
-
// Use clean: false to allow session resume where the broker supports it.
|
|
178
|
-
// If you have issues with stale state, consider setting clean: true.
|
|
179
|
-
clean: false,
|
|
180
|
-
connectDelay: 60 * 1000,
|
|
181
|
-
})
|
|
182
|
-
.catch(e => {
|
|
183
|
-
this.fbnsDebug(`Connection failed: ${e}`);
|
|
184
|
-
throw e;
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
// Subscribe to FBNS message topic
|
|
188
|
-
await this.client.subscribe({ topic: constants_1.FbnsTopics.FBNS_MESSAGE.id });
|
|
189
|
-
|
|
190
|
-
// Wait for the register response (listener was set up before connect)
|
|
191
|
-
const msg = await regRespPromise;
|
|
192
|
-
const data = await (0, shared_1.tryUnzipAsync)(msg.payload);
|
|
193
|
-
const payload = data.toString('utf8');
|
|
194
|
-
this.fbnsDebug(`Received register response: ${payload}`);
|
|
195
|
-
const { token, error } = JSON.parse(payload);
|
|
196
|
-
if (error) {
|
|
197
|
-
this.emit('error', error);
|
|
198
|
-
throw error;
|
|
199
|
-
}
|
|
200
|
-
try {
|
|
201
|
-
await this.sendPushRegister(token);
|
|
202
|
-
}
|
|
203
|
-
catch (e) {
|
|
204
|
-
if (e instanceof Error) {
|
|
205
|
-
this.emit('error', e);
|
|
206
|
-
}
|
|
207
|
-
throw e;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
disconnect() {
|
|
212
|
-
this.safeDisconnect = true;
|
|
213
|
-
if (!this.client) {
|
|
214
|
-
return Promise.resolve();
|
|
215
|
-
}
|
|
216
|
-
return this.client.disconnect();
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
async handleMessage(msg) {
|
|
220
|
-
const payload = JSON.parse((await (0, shared_1.tryUnzipAsync)(msg.payload)).toString('utf8'));
|
|
221
|
-
if ((0, shared_1.notUndefined)(payload.fbpushnotif)) {
|
|
222
|
-
const notification = (0, fbns_utilities_1.createNotificationFromJson)(payload.fbpushnotif);
|
|
223
|
-
this.emit('push', notification);
|
|
224
|
-
if (notification.collapseKey)
|
|
225
|
-
this.emit(notification.collapseKey, notification);
|
|
226
|
-
}
|
|
227
|
-
else {
|
|
228
|
-
this.fbnsDebug(`Received a message without 'fbpushnotif': ${JSON.stringify(payload)}`);
|
|
229
|
-
this.emit('message', payload);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
async sendPushRegister(token) {
|
|
234
|
-
const { body } = await this.ig.request.send({
|
|
235
|
-
url: `/api/v1/push/register/`,
|
|
236
|
-
method: 'POST',
|
|
237
|
-
form: {
|
|
238
|
-
device_type: 'android_mqtt',
|
|
239
|
-
is_main_push_channel: true,
|
|
240
|
-
device_sub_type: 2,
|
|
241
|
-
device_token: token,
|
|
242
|
-
guid: this.ig.state.uuid,
|
|
243
|
-
uuid: this.ig.state.uuid,
|
|
244
|
-
users: this.ig.state.cookieUserId,
|
|
245
|
-
family_device_id: new chance_1.Chance().guid({ version: 4 }),
|
|
246
|
-
},
|
|
247
|
-
});
|
|
248
|
-
return body;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
exports.FbnsClient = FbnsClient;
|
|
252
|
-
//# sourceMappingURL=fbns.client.js.map
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createNotificationFromJson = void 0;
|
|
4
|
-
const shared_1 = require("../shared");
|
|
5
|
-
const querystring = require("querystring");
|
|
6
|
-
const URL = require("url");
|
|
7
|
-
function createNotificationFromJson(json) {
|
|
8
|
-
const data = JSON.parse(json);
|
|
9
|
-
const notification = Object.defineProperty({}, 'description', {
|
|
10
|
-
enumerable: false,
|
|
11
|
-
value: data,
|
|
12
|
-
});
|
|
13
|
-
if ((0, shared_1.notUndefined)(data.t)) {
|
|
14
|
-
notification.title = data.t;
|
|
15
|
-
}
|
|
16
|
-
if ((0, shared_1.notUndefined)(data.m)) {
|
|
17
|
-
notification.message = data.m;
|
|
18
|
-
}
|
|
19
|
-
if ((0, shared_1.notUndefined)(data.tt)) {
|
|
20
|
-
notification.tickerText = data.tt;
|
|
21
|
-
}
|
|
22
|
-
if ((0, shared_1.notUndefined)(data.ig)) {
|
|
23
|
-
notification.igAction = data.ig;
|
|
24
|
-
const url = URL.parse(data.ig);
|
|
25
|
-
if (url.pathname) {
|
|
26
|
-
notification.actionPath = url.pathname;
|
|
27
|
-
}
|
|
28
|
-
if (url.query) {
|
|
29
|
-
notification.actionParams = querystring.decode(url.query);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
if ((0, shared_1.notUndefined)(data.collapse_key)) {
|
|
33
|
-
notification.collapseKey = data.collapse_key;
|
|
34
|
-
}
|
|
35
|
-
if ((0, shared_1.notUndefined)(data.i)) {
|
|
36
|
-
notification.optionalImage = data.i;
|
|
37
|
-
}
|
|
38
|
-
if ((0, shared_1.notUndefined)(data.a)) {
|
|
39
|
-
notification.optionalAvatarUrl = data.a;
|
|
40
|
-
}
|
|
41
|
-
if ((0, shared_1.notUndefined)(data.sound)) {
|
|
42
|
-
notification.sound = data.sound;
|
|
43
|
-
}
|
|
44
|
-
if ((0, shared_1.notUndefined)(data.pi)) {
|
|
45
|
-
notification.pushId = data.pi;
|
|
46
|
-
}
|
|
47
|
-
if ((0, shared_1.notUndefined)(data.c)) {
|
|
48
|
-
notification.pushCategory = data.c;
|
|
49
|
-
}
|
|
50
|
-
if ((0, shared_1.notUndefined)(data.u)) {
|
|
51
|
-
notification.intendedRecipientUserId = data.u;
|
|
52
|
-
}
|
|
53
|
-
if ((0, shared_1.notUndefined)(data.s) && data.s !== 'None') {
|
|
54
|
-
notification.sourceUserId = data.s;
|
|
55
|
-
}
|
|
56
|
-
if ((0, shared_1.notUndefined)(data.igo)) {
|
|
57
|
-
notification.igActionOverride = data.igo;
|
|
58
|
-
}
|
|
59
|
-
if ((0, shared_1.notUndefined)(data.bc)) {
|
|
60
|
-
const badgeCount = {};
|
|
61
|
-
const parsed = JSON.parse(data.bc);
|
|
62
|
-
if ((0, shared_1.notUndefined)(parsed.di)) {
|
|
63
|
-
badgeCount.direct = parsed.di;
|
|
64
|
-
}
|
|
65
|
-
if ((0, shared_1.notUndefined)(parsed.ds)) {
|
|
66
|
-
badgeCount.ds = parsed.ds;
|
|
67
|
-
}
|
|
68
|
-
if ((0, shared_1.notUndefined)(parsed.ac)) {
|
|
69
|
-
badgeCount.activities = parsed.ac;
|
|
70
|
-
}
|
|
71
|
-
notification.badgeCount = badgeCount;
|
|
72
|
-
}
|
|
73
|
-
if ((0, shared_1.notUndefined)(data.ia)) {
|
|
74
|
-
notification.inAppActors = data.ia;
|
|
75
|
-
}
|
|
76
|
-
return notification;
|
|
77
|
-
}
|
|
78
|
-
exports.createNotificationFromJson = createNotificationFromJson;
|
|
79
|
-
//# sourceMappingURL=fbns.utilities.js.map
|
|
@@ -1,21 +0,0 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./fbns.client"), exports);
|
|
18
|
-
__exportStar(require("./fbns.device-auth"), exports);
|
|
19
|
-
__exportStar(require("./fbns.types"), exports);
|
|
20
|
-
__exportStar(require("./fbns.utilities"), exports);
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
package/src-ts/dist/index.ts
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
const IgApiClient = require('./core/client');
|
|
2
|
-
const NavChainManager = require('./core/nav-chain');
|
|
3
|
-
const { IgApiClientError } = require('./errors');
|
|
4
|
-
const { APP_VERSION } = require('./constants/constants');
|
|
5
|
-
const { RealtimeClient, IrisHandshake, SkywalkerProtocol, PresenceManager, DMSender, ErrorHandler, GapHandler, EnhancedDirectCommands, PresenceTypingMixin } = require('./realtime');
|
|
6
|
-
const constants = require('./constants/constants');
|
|
7
|
-
const sendmedia = require('./sendmedia');
|
|
8
|
-
const { sendRavenPhoto, sendRavenPhotoOnce, sendRavenPhotoReplayable, sendRavenVideo, sendRavenVideoOnce, sendRavenVideoReplayable } = sendmedia;
|
|
9
|
-
const { useMultiFileAuthState, MultiFileAuthState, extractStateData, applyStateData } = require('./useMultiFileAuthState');
|
|
10
|
-
const { downloadContentFromMessage, downloadMediaBuffer, extractMediaUrls, hasMedia, getMediaType, isViewOnceMedia, MEDIA_TYPES } = require('./downloadMedia');
|
|
11
|
-
const { GraphQLSubscriptions, QueryIDs } = require('./realtime/subscriptions/graphql.subscription');
|
|
12
|
-
const { SkywalkerSubscriptions } = require('./realtime/subscriptions/skywalker.subscription');
|
|
13
|
-
let FbnsClient;
|
|
14
|
-
try {
|
|
15
|
-
FbnsClient = require('./fbns/fbns.client').FbnsClient;
|
|
16
|
-
} catch (e) {
|
|
17
|
-
FbnsClient = class FbnsClient {
|
|
18
|
-
constructor() { throw new Error('FbnsClient requires mqtt-shim dependency which is not installed. Install it with: npm install mqtt-shim'); }
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
const { MQTToTClient, mqttotConnectFlow, INSTAGRAM_VERSION } = require('./mqttot/mqttot.client');
|
|
22
|
-
const { MQTToTConnection } = require('./mqttot/mqttot.connection');
|
|
23
|
-
const { IgApiClientExt, withFbns, withRealtime, withFbnsAndRealtime } = require('./extend');
|
|
24
|
-
|
|
25
|
-
const AccountRepository = require('./repositories/account.repository');
|
|
26
|
-
const UserRepository = require('./repositories/user.repository');
|
|
27
|
-
const MediaRepository = require('./repositories/media.repository');
|
|
28
|
-
const FeedRepository = require('./repositories/feed.repository');
|
|
29
|
-
const UploadRepository = require('./repositories/upload.repository');
|
|
30
|
-
const StoryRepository = require('./repositories/story.repository');
|
|
31
|
-
const DirectRepository = require('./repositories/direct.repository');
|
|
32
|
-
const DirectThreadRepository = require('./repositories/direct-thread.repository');
|
|
33
|
-
const FriendshipRepository = require('./repositories/friendship.repository');
|
|
34
|
-
const LocationRepository = require('./repositories/location.repository');
|
|
35
|
-
const HashtagRepository = require('./repositories/hashtag.repository');
|
|
36
|
-
const NewsRepository = require('./repositories/news.repository');
|
|
37
|
-
const CollectionRepository = require('./repositories/collection.repository');
|
|
38
|
-
const CloseFriendsRepository = require('./repositories/close-friends.repository');
|
|
39
|
-
const HighlightsRepository = require('./repositories/highlights.repository');
|
|
40
|
-
const ClipRepository = require('./repositories/clip.repository');
|
|
41
|
-
const TimelineRepository = require('./repositories/timeline.repository');
|
|
42
|
-
const InsightsRepository = require('./repositories/insights.repository');
|
|
43
|
-
const NoteRepository = require('./repositories/note.repository');
|
|
44
|
-
const NotificationRepository = require('./repositories/notification.repository');
|
|
45
|
-
const SignupRepository = require('./repositories/signup.repository');
|
|
46
|
-
const TOTPRepository = require('./repositories/totp.repository');
|
|
47
|
-
const BloksRepository = require('./repositories/bloks.repository');
|
|
48
|
-
const ChallengeRepository = require('./repositories/challenge.repository');
|
|
49
|
-
const ShareRepository = require('./repositories/share.repository');
|
|
50
|
-
const TrackRepository = require('./repositories/track.repository');
|
|
51
|
-
const ExploreRepository = require('./repositories/explore.repository');
|
|
52
|
-
const FBSearchRepository = require('./repositories/fbsearch.repository');
|
|
53
|
-
const FundraiserRepository = require('./repositories/fundraiser.repository');
|
|
54
|
-
const MultipleAccountsRepository = require('./repositories/multiple-accounts.repository');
|
|
55
|
-
const CaptchaRepository = require('./repositories/captcha.repository');
|
|
56
|
-
|
|
57
|
-
const { SessionHealthMonitor } = require('./realtime/features/session-health-monitor');
|
|
58
|
-
const { PersistentLogger } = require('./realtime/features/persistent-logger');
|
|
59
|
-
|
|
60
|
-
module.exports = {
|
|
61
|
-
IgApiClient,
|
|
62
|
-
NavChainManager,
|
|
63
|
-
IgApiClientError,
|
|
64
|
-
RealtimeClient,
|
|
65
|
-
IrisHandshake,
|
|
66
|
-
SkywalkerProtocol,
|
|
67
|
-
PresenceManager,
|
|
68
|
-
DMSender,
|
|
69
|
-
ErrorHandler,
|
|
70
|
-
GapHandler,
|
|
71
|
-
EnhancedDirectCommands,
|
|
72
|
-
PresenceTypingMixin,
|
|
73
|
-
Topics: constants.Topics,
|
|
74
|
-
REALTIME: constants.REALTIME,
|
|
75
|
-
sendmedia,
|
|
76
|
-
sendRavenPhoto,
|
|
77
|
-
sendRavenPhotoOnce,
|
|
78
|
-
sendRavenPhotoReplayable,
|
|
79
|
-
sendRavenVideo,
|
|
80
|
-
sendRavenVideoOnce,
|
|
81
|
-
sendRavenVideoReplayable,
|
|
82
|
-
useMultiFileAuthState,
|
|
83
|
-
MultiFileAuthState,
|
|
84
|
-
extractStateData,
|
|
85
|
-
applyStateData,
|
|
86
|
-
downloadContentFromMessage,
|
|
87
|
-
downloadMediaBuffer,
|
|
88
|
-
extractMediaUrls,
|
|
89
|
-
hasMedia,
|
|
90
|
-
getMediaType,
|
|
91
|
-
isViewOnceMedia,
|
|
92
|
-
MEDIA_TYPES,
|
|
93
|
-
GraphQLSubscriptions,
|
|
94
|
-
QueryIDs,
|
|
95
|
-
SkywalkerSubscriptions,
|
|
96
|
-
FbnsClient,
|
|
97
|
-
MQTToTClient,
|
|
98
|
-
mqttotConnectFlow,
|
|
99
|
-
MQTToTConnection,
|
|
100
|
-
INSTAGRAM_VERSION,
|
|
101
|
-
IgApiClientExt,
|
|
102
|
-
withFbns,
|
|
103
|
-
withRealtime,
|
|
104
|
-
withFbnsAndRealtime,
|
|
105
|
-
APP_VERSION,
|
|
106
|
-
SessionHealthMonitor,
|
|
107
|
-
PersistentLogger,
|
|
108
|
-
AccountRepository,
|
|
109
|
-
UserRepository,
|
|
110
|
-
MediaRepository,
|
|
111
|
-
FeedRepository,
|
|
112
|
-
UploadRepository,
|
|
113
|
-
StoryRepository,
|
|
114
|
-
DirectRepository,
|
|
115
|
-
DirectThreadRepository,
|
|
116
|
-
FriendshipRepository,
|
|
117
|
-
LocationRepository,
|
|
118
|
-
HashtagRepository,
|
|
119
|
-
NewsRepository,
|
|
120
|
-
CollectionRepository,
|
|
121
|
-
CloseFriendsRepository,
|
|
122
|
-
HighlightsRepository,
|
|
123
|
-
ClipRepository,
|
|
124
|
-
TimelineRepository,
|
|
125
|
-
InsightsRepository,
|
|
126
|
-
NoteRepository,
|
|
127
|
-
NotificationRepository,
|
|
128
|
-
SignupRepository,
|
|
129
|
-
TOTPRepository,
|
|
130
|
-
BloksRepository,
|
|
131
|
-
ChallengeRepository,
|
|
132
|
-
ShareRepository,
|
|
133
|
-
TrackRepository,
|
|
134
|
-
ExploreRepository,
|
|
135
|
-
FBSearchRepository,
|
|
136
|
-
FundraiserRepository,
|
|
137
|
-
MultipleAccountsRepository,
|
|
138
|
-
CaptchaRepository,
|
|
139
|
-
};
|
package/src-ts/dist/mqtt-shim.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const mqtts = require("mqtts");
|
|
4
|
-
|
|
5
|
-
exports.PacketType = mqtts.PacketType;
|
|
6
|
-
exports.ConnectResponsePacket = mqtts.ConnectResponsePacket;
|
|
7
|
-
exports.IllegalStateError = mqtts.IllegalStateError;
|
|
8
|
-
exports.MqttClient = mqtts.MqttClient;
|
|
9
|
-
exports.TlsTransport = mqtts.TlsTransport;
|
|
10
|
-
exports.SocksTlsTransport = mqtts.SocksTlsTransport;
|
|
11
|
-
exports.PacketStream = mqtts.PacketStream;
|
|
12
|
-
exports.DefaultPacketReadMap = mqtts.DefaultPacketReadMap;
|
|
13
|
-
exports.DefaultPacketWriteMap = mqtts.DefaultPacketWriteMap;
|
|
14
|
-
exports.isConnAck = mqtts.isConnAck;
|
|
15
|
-
exports.ConnectReturnCode = mqtts.ConnectReturnCode;
|
|
@@ -1,21 +0,0 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./mqttot.client"), exports);
|
|
18
|
-
__exportStar(require("./mqttot.connect.request.packet"), exports);
|
|
19
|
-
__exportStar(require("./mqttot.connect.response.packet"), exports);
|
|
20
|
-
__exportStar(require("./mqttot.connection"), exports);
|
|
21
|
-
//# sourceMappingURL=index.js.map
|