nodejs-insta-private-api-mqt 1.3.85 → 1.3.87
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 +828 -214
- 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 +37 -42
- 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
|
@@ -11,9 +11,8 @@
|
|
|
11
11
|
* IG_SUPPRESS_INTERNAL_LOGS=0 node yourfile.js
|
|
12
12
|
*/
|
|
13
13
|
(function installConsoleFilter() {
|
|
14
|
-
var _a;
|
|
15
14
|
const flag = process.env.IG_SUPPRESS_INTERNAL_LOGS;
|
|
16
|
-
const enabled = (flag === undefined || flag === null || flag === '' || flag === '1' ||
|
|
15
|
+
const enabled = (flag === undefined || flag === null || flag === '' || flag === '1' || flag.toLowerCase?.() === 'true');
|
|
17
16
|
if (!enabled)
|
|
18
17
|
return;
|
|
19
18
|
const DROP_PREFIXES = [
|
|
@@ -251,7 +250,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
251
250
|
this._loadPersistedMqttSession();
|
|
252
251
|
}
|
|
253
252
|
catch (e) {
|
|
254
|
-
this.realtimeDebug('[MQTT] loadPersistedMqttSession failed:',
|
|
253
|
+
this.realtimeDebug('[MQTT] loadPersistedMqttSession failed:', e?.message || e);
|
|
255
254
|
}
|
|
256
255
|
// auto-connect block preserved (no change)
|
|
257
256
|
const { useMultiFileAuthState } = require('../useMultiFileAuthState');
|
|
@@ -306,7 +305,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
306
305
|
await auth.loadCreds(this.ig);
|
|
307
306
|
}
|
|
308
307
|
catch (e) {
|
|
309
|
-
this._log('warn', '[REALTIME] loadCreds warning:',
|
|
308
|
+
this._log('warn', '[REALTIME] loadCreds warning:', e?.message || e);
|
|
310
309
|
}
|
|
311
310
|
const ready = await waitForMqttCredentials(auth, 20000, 300);
|
|
312
311
|
if (!ready) {
|
|
@@ -322,12 +321,12 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
322
321
|
await this.connectFromSavedSession(auth);
|
|
323
322
|
}
|
|
324
323
|
catch (e) {
|
|
325
|
-
this._log('error', '[REALTIME] Constructor auto-connect failed:',
|
|
324
|
+
this._log('error', '[REALTIME] Constructor auto-connect failed:', e?.message || e);
|
|
326
325
|
}
|
|
327
326
|
}
|
|
328
327
|
}
|
|
329
328
|
catch (e) {
|
|
330
|
-
this._log('error', '[REALTIME] Constructor auto-start exception:',
|
|
329
|
+
this._log('error', '[REALTIME] Constructor auto-start exception:', e?.message || e);
|
|
331
330
|
}
|
|
332
331
|
}, 100);
|
|
333
332
|
}
|
|
@@ -366,7 +365,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
366
365
|
}
|
|
367
366
|
}
|
|
368
367
|
catch (e) {
|
|
369
|
-
this.realtimeDebug('[MQTT] _loadPersistedMqttSession error',
|
|
368
|
+
this.realtimeDebug('[MQTT] _loadPersistedMqttSession error', e?.message || e);
|
|
370
369
|
}
|
|
371
370
|
return false;
|
|
372
371
|
}
|
|
@@ -423,11 +422,10 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
423
422
|
this.emit('message_live', msg);
|
|
424
423
|
});
|
|
425
424
|
this.on('receive', (topic, messages) => {
|
|
426
|
-
var _a, _b, _c, _d, _f;
|
|
427
425
|
try {
|
|
428
426
|
const topicPath = topic.path || '';
|
|
429
427
|
for (const msg of (Array.isArray(messages) ? messages : [messages])) {
|
|
430
|
-
const data =
|
|
428
|
+
const data = msg?.data || msg;
|
|
431
429
|
if (!data)
|
|
432
430
|
continue;
|
|
433
431
|
switch (topicPath) {
|
|
@@ -470,8 +468,8 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
470
468
|
break;
|
|
471
469
|
case '/t_ig_family_navigation_badge':
|
|
472
470
|
this.emit('badgeCount', {
|
|
473
|
-
count:
|
|
474
|
-
dmCount:
|
|
471
|
+
count: data.badge_count ?? data.count ?? data.total,
|
|
472
|
+
dmCount: data.dm_count ?? data.direct_count,
|
|
475
473
|
activityCount: data.activity_count,
|
|
476
474
|
raw: data,
|
|
477
475
|
});
|
|
@@ -479,7 +477,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
479
477
|
case '/t_entity_presence':
|
|
480
478
|
this.emit('entityPresence', {
|
|
481
479
|
userId: data.user_id || data.entity_id,
|
|
482
|
-
isActive:
|
|
480
|
+
isActive: data.is_active ?? data.active ?? false,
|
|
483
481
|
lastActivityAt: data.last_activity_at_ms || data.last_activity_at,
|
|
484
482
|
raw: data,
|
|
485
483
|
});
|
|
@@ -525,7 +523,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
525
523
|
}
|
|
526
524
|
}
|
|
527
525
|
catch (e) {
|
|
528
|
-
this.realtimeDebug('[EVENT_HANDLER] Error processing topic event:',
|
|
526
|
+
this.realtimeDebug('[EVENT_HANDLER] Error processing topic event:', e?.message || e);
|
|
529
527
|
}
|
|
530
528
|
});
|
|
531
529
|
}
|
|
@@ -539,15 +537,14 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
539
537
|
}
|
|
540
538
|
}
|
|
541
539
|
catch (e) {
|
|
542
|
-
this.realtimeDebug('[IRIS_RESET] Failed to re-subscribe:',
|
|
540
|
+
this.realtimeDebug('[IRIS_RESET] Failed to re-subscribe:', e?.message || e);
|
|
543
541
|
}
|
|
544
542
|
}
|
|
545
543
|
_handleGraphQLEvent(data) {
|
|
546
|
-
var _a, _b;
|
|
547
544
|
try {
|
|
548
545
|
const json = data.json || data;
|
|
549
|
-
const event =
|
|
550
|
-
const payload =
|
|
546
|
+
const event = json?.event || json?.data?.event;
|
|
547
|
+
const payload = json?.data || json;
|
|
551
548
|
if (!payload)
|
|
552
549
|
return;
|
|
553
550
|
if (payload.live_broadcast_comments) {
|
|
@@ -604,7 +601,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
604
601
|
if (payload.presence_event || payload.user_presence) {
|
|
605
602
|
this.emit('appPresence', {
|
|
606
603
|
userId: payload.user_id,
|
|
607
|
-
isActive:
|
|
604
|
+
isActive: payload.is_active ?? payload.active,
|
|
608
605
|
lastActivityAt: payload.last_activity_at_ms,
|
|
609
606
|
raw: payload,
|
|
610
607
|
});
|
|
@@ -629,13 +626,13 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
629
626
|
this.emit('graphqlEvent', { event, payload, raw: data });
|
|
630
627
|
}
|
|
631
628
|
catch (e) {
|
|
632
|
-
this.realtimeDebug('[GRAPHQL_EVENT] Parse error:',
|
|
629
|
+
this.realtimeDebug('[GRAPHQL_EVENT] Parse error:', e?.message || e);
|
|
633
630
|
}
|
|
634
631
|
}
|
|
635
632
|
_handlePubsubEvent(data) {
|
|
636
633
|
try {
|
|
637
634
|
const json = data.json || data;
|
|
638
|
-
const payload =
|
|
635
|
+
const payload = json?.data || json;
|
|
639
636
|
if (!payload)
|
|
640
637
|
return;
|
|
641
638
|
if (payload.doublePublish)
|
|
@@ -660,7 +657,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
660
657
|
this.emit('pubsubEvent', { payload, raw: data });
|
|
661
658
|
}
|
|
662
659
|
catch (e) {
|
|
663
|
-
this.realtimeDebug('[PUBSUB_EVENT] Parse error:',
|
|
660
|
+
this.realtimeDebug('[PUBSUB_EVENT] Parse error:', e?.message || e);
|
|
664
661
|
}
|
|
665
662
|
}
|
|
666
663
|
// Parse a standard realtime message packet into a simplified message object
|
|
@@ -678,10 +675,10 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
678
675
|
username: msg.username || msg.from_username || `user_${msg.user_id || 'unknown'}`,
|
|
679
676
|
text: msg.text || msg.body || '',
|
|
680
677
|
itemType: msg.item_type || 'text',
|
|
681
|
-
thread:
|
|
678
|
+
thread: threadInfo?.title || `Thread ${msg.thread_id}`,
|
|
682
679
|
thread_id: msg.thread_id,
|
|
683
680
|
timestamp: msg.timestamp,
|
|
684
|
-
isGroup: threadInfo
|
|
681
|
+
isGroup: threadInfo?.isGroup,
|
|
685
682
|
status: 'good'
|
|
686
683
|
};
|
|
687
684
|
}
|
|
@@ -691,9 +688,8 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
691
688
|
}
|
|
692
689
|
// Parse IRIS message data into a simplified message object
|
|
693
690
|
_parseIrisMessage(data) {
|
|
694
|
-
var _a;
|
|
695
691
|
try {
|
|
696
|
-
if (data.event !== 'message_create' && !
|
|
692
|
+
if (data.event !== 'message_create' && !data.type?.includes('message'))
|
|
697
693
|
return null;
|
|
698
694
|
return {
|
|
699
695
|
id: data.item_id || data.id,
|
|
@@ -761,7 +757,6 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
761
757
|
* - Pulls deviceId, sessionid, device secrets and app-specific headers to populate the payload.
|
|
762
758
|
*/
|
|
763
759
|
constructConnection() {
|
|
764
|
-
var _a, _b;
|
|
765
760
|
// Choose the best available user agent value from state fallbacks
|
|
766
761
|
const userAgent = typeof this.ig.state.userAgent === 'string'
|
|
767
762
|
? this.ig.state.userAgent
|
|
@@ -792,7 +787,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
792
787
|
}
|
|
793
788
|
if (!sessionid) {
|
|
794
789
|
try {
|
|
795
|
-
sessionid = this.ig.state.sessionId || this.ig.state.sessionid ||
|
|
790
|
+
sessionid = this.ig.state.sessionId || this.ig.state.sessionid || this.ig.state.cookies?.sessionid || null;
|
|
796
791
|
}
|
|
797
792
|
catch (e) {
|
|
798
793
|
sessionid = null;
|
|
@@ -891,7 +886,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
891
886
|
appId: BigInt(567067343352427),
|
|
892
887
|
deviceSecret: deviceSecret || '',
|
|
893
888
|
clientStack: 3,
|
|
894
|
-
...(
|
|
889
|
+
...(this.initOptions?.connectOverrides || {}),
|
|
895
890
|
},
|
|
896
891
|
password,
|
|
897
892
|
appSpecificInfo: {
|
|
@@ -921,7 +916,6 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
921
916
|
* - Starts keepalive/watchdog timers and message listeners after successful connect.
|
|
922
917
|
*/
|
|
923
918
|
async connect(options) {
|
|
924
|
-
var _a;
|
|
925
919
|
this._connectInProgress = true;
|
|
926
920
|
try {
|
|
927
921
|
this.setInitOptions(options);
|
|
@@ -965,14 +959,14 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
965
959
|
await this._afterConnectHandlers();
|
|
966
960
|
}
|
|
967
961
|
catch (e) {
|
|
968
|
-
this.realtimeDebug('[MQTT] afterConnect error',
|
|
962
|
+
this.realtimeDebug('[MQTT] afterConnect error', e?.message || e);
|
|
969
963
|
}
|
|
970
964
|
// After everything, attempt to detect and persist MQTT session id
|
|
971
965
|
try {
|
|
972
966
|
await this._onMqttConnected();
|
|
973
967
|
}
|
|
974
968
|
catch (e) {
|
|
975
|
-
this.realtimeDebug('[MQTT] _onMqttConnected error',
|
|
969
|
+
this.realtimeDebug('[MQTT] _onMqttConnected error', e?.message || e);
|
|
976
970
|
}
|
|
977
971
|
});
|
|
978
972
|
}
|
|
@@ -1009,7 +1003,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1009
1003
|
catch (e) { }
|
|
1010
1004
|
try {
|
|
1011
1005
|
this._mqtt.on('error', (err) => {
|
|
1012
|
-
this.realtimeDebug('[MQTT] client error:',
|
|
1006
|
+
this.realtimeDebug('[MQTT] client error:', err?.message || err);
|
|
1013
1007
|
this.emit('mqtt_error', err);
|
|
1014
1008
|
if (this._reconnectInProgress) {
|
|
1015
1009
|
this.realtimeDebug('[MQTT] error event ignored — reconnect already in progress');
|
|
@@ -1080,12 +1074,12 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1080
1074
|
this.realtimeDebug('[KEEPALIVE] Foreground pulse sent.');
|
|
1081
1075
|
}
|
|
1082
1076
|
catch (e) {
|
|
1083
|
-
this.realtimeDebug('[KEEPALIVE] Foreground pulse failed:',
|
|
1077
|
+
this.realtimeDebug('[KEEPALIVE] Foreground pulse failed:', e?.message || e);
|
|
1084
1078
|
}
|
|
1085
1079
|
}, KEEPALIVE_FOREGROUND_MS + Math.floor(Math.random() * 5000));
|
|
1086
1080
|
}
|
|
1087
1081
|
catch (e) {
|
|
1088
|
-
this.realtimeDebug('[KEEPALIVE] Could not start foreground timer:',
|
|
1082
|
+
this.realtimeDebug('[KEEPALIVE] Could not start foreground timer:', e?.message || e);
|
|
1089
1083
|
}
|
|
1090
1084
|
try {
|
|
1091
1085
|
if (this._syncTimer)
|
|
@@ -1100,12 +1094,12 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1100
1094
|
this.realtimeDebug('[KEEPALIVE] GraphQL subs refreshed.');
|
|
1101
1095
|
}
|
|
1102
1096
|
catch (e) {
|
|
1103
|
-
this.realtimeDebug('[KEEPALIVE] GraphQL refresh failed:',
|
|
1097
|
+
this.realtimeDebug('[KEEPALIVE] GraphQL refresh failed:', e?.message || e);
|
|
1104
1098
|
}
|
|
1105
1099
|
}, MESSAGE_SYNC_REFRESH_MS + Math.floor(Math.random() * 10000));
|
|
1106
1100
|
}
|
|
1107
1101
|
catch (e) {
|
|
1108
|
-
this.realtimeDebug('[KEEPALIVE] Could not start sync timer:',
|
|
1102
|
+
this.realtimeDebug('[KEEPALIVE] Could not start sync timer:', e?.message || e);
|
|
1109
1103
|
}
|
|
1110
1104
|
try {
|
|
1111
1105
|
if (this._trafficWatchdog)
|
|
@@ -1124,18 +1118,18 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1124
1118
|
}
|
|
1125
1119
|
}
|
|
1126
1120
|
catch (e) {
|
|
1127
|
-
this.realtimeDebug('[WATCHDOG] Ping failed, proceeding with reconnect:',
|
|
1121
|
+
this.realtimeDebug('[WATCHDOG] Ping failed, proceeding with reconnect:', e?.message || e);
|
|
1128
1122
|
}
|
|
1129
1123
|
await this._attemptReconnectSafely();
|
|
1130
1124
|
}
|
|
1131
1125
|
}
|
|
1132
1126
|
catch (e) {
|
|
1133
|
-
this.realtimeDebug('[WATCHDOG] trafficWatchdog fault:',
|
|
1127
|
+
this.realtimeDebug('[WATCHDOG] trafficWatchdog fault:', e?.message || e);
|
|
1134
1128
|
}
|
|
1135
1129
|
}, 60000);
|
|
1136
1130
|
}
|
|
1137
1131
|
catch (e) {
|
|
1138
|
-
this.realtimeDebug('[WATCHDOG] Could not start traffic watchdog:',
|
|
1132
|
+
this.realtimeDebug('[WATCHDOG] Could not start traffic watchdog:', e?.message || e);
|
|
1139
1133
|
}
|
|
1140
1134
|
try {
|
|
1141
1135
|
if (this._heartbeatTimer)
|
|
@@ -1149,21 +1143,21 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1149
1143
|
this.realtimeDebug('[HEARTBEAT] mqtt.ping() ok.');
|
|
1150
1144
|
}
|
|
1151
1145
|
catch (e) {
|
|
1152
|
-
this.realtimeDebug('[HEARTBEAT] mqtt.ping failed:',
|
|
1146
|
+
this.realtimeDebug('[HEARTBEAT] mqtt.ping failed:', e?.message || e);
|
|
1153
1147
|
}
|
|
1154
1148
|
}
|
|
1155
1149
|
}
|
|
1156
1150
|
catch (e) {
|
|
1157
|
-
this.realtimeDebug('[HEARTBEAT] fault:',
|
|
1151
|
+
this.realtimeDebug('[HEARTBEAT] fault:', e?.message || e);
|
|
1158
1152
|
}
|
|
1159
1153
|
}, HEARTBEAT_MS + Math.floor(Math.random() * 5000));
|
|
1160
1154
|
}
|
|
1161
1155
|
catch (e) {
|
|
1162
|
-
this.realtimeDebug('[HEARTBEAT] Could not start heartbeat timer:',
|
|
1156
|
+
this.realtimeDebug('[HEARTBEAT] Could not start heartbeat timer:', e?.message || e);
|
|
1163
1157
|
}
|
|
1164
1158
|
}
|
|
1165
1159
|
catch (e) {
|
|
1166
|
-
this.realtimeDebug('[WATCHDOG] initialization error:',
|
|
1160
|
+
this.realtimeDebug('[WATCHDOG] initialization error:', e?.message || e);
|
|
1167
1161
|
}
|
|
1168
1162
|
/**
|
|
1169
1163
|
* Set up on-message handler:
|
|
@@ -1171,9 +1165,8 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1171
1165
|
* then parsed by the topic's parser if available. Otherwise payload is emitted as raw.
|
|
1172
1166
|
*/
|
|
1173
1167
|
this._mqtt.on('message', async (msg) => {
|
|
1174
|
-
|
|
1175
|
-
const
|
|
1176
|
-
const topic = topicMap === null || topicMap === void 0 ? void 0 : topicMap.get(msg.topic);
|
|
1168
|
+
const topicMap = this.mqtt?.topicMap;
|
|
1169
|
+
const topic = topicMap?.get(msg.topic);
|
|
1177
1170
|
if (topic && topic.parser && !topic.noParse) {
|
|
1178
1171
|
try {
|
|
1179
1172
|
const unzipped = await (0, shared_1.tryUnzipAsync)(msg.payload);
|
|
@@ -1196,7 +1189,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1196
1189
|
await this._afterConnectHandlers();
|
|
1197
1190
|
}
|
|
1198
1191
|
catch (e) {
|
|
1199
|
-
this.realtimeDebug('[MQTT] afterConnectHandlers failed',
|
|
1192
|
+
this.realtimeDebug('[MQTT] afterConnectHandlers failed', e?.message || e);
|
|
1200
1193
|
}
|
|
1201
1194
|
// Initial subscriptions / iris
|
|
1202
1195
|
await (0, shared_1.delay)(100);
|
|
@@ -1223,7 +1216,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1223
1216
|
this._log('debug', '[REALTIME] Could not auto-fetch IRIS data:', e.message);
|
|
1224
1217
|
}
|
|
1225
1218
|
}
|
|
1226
|
-
if ((
|
|
1219
|
+
if ((this.initOptions.skywalkerSubs ?? []).length > 0) {
|
|
1227
1220
|
await this.skywalkerSubscribe(this.initOptions.skywalkerSubs);
|
|
1228
1221
|
}
|
|
1229
1222
|
else {
|
|
@@ -1322,7 +1315,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1322
1315
|
await this._persistMqttSession();
|
|
1323
1316
|
}
|
|
1324
1317
|
catch (e) {
|
|
1325
|
-
this.realtimeDebug('[MQTT] persist after connect failed',
|
|
1318
|
+
this.realtimeDebug('[MQTT] persist after connect failed', e?.message || e);
|
|
1326
1319
|
}
|
|
1327
1320
|
// start periodic persist if not already (persist every 4 hours to avoid excessive I/O and detection)
|
|
1328
1321
|
if (!this._mqttSessionPersistIntervalId) {
|
|
@@ -1357,7 +1350,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1357
1350
|
if (this._attachedAuthState && typeof this._attachedAuthState.getData === 'function') {
|
|
1358
1351
|
try {
|
|
1359
1352
|
const d = this._attachedAuthState.getData();
|
|
1360
|
-
const mqttAuth = d
|
|
1353
|
+
const mqttAuth = d?.mqttAuth;
|
|
1361
1354
|
if (mqttAuth && mqttAuth.expiresAt) {
|
|
1362
1355
|
const expires = new Date(mqttAuth.expiresAt).getTime();
|
|
1363
1356
|
if (!isNaN(expires)) {
|
|
@@ -1379,7 +1372,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1379
1372
|
await this._attemptReconnectSafely();
|
|
1380
1373
|
}
|
|
1381
1374
|
catch (e) {
|
|
1382
|
-
this.realtimeDebug('[CREDENTIAL_REFRESH] reconnect after refresh failed:',
|
|
1375
|
+
this.realtimeDebug('[CREDENTIAL_REFRESH] reconnect after refresh failed:', e?.message || e);
|
|
1383
1376
|
}
|
|
1384
1377
|
}
|
|
1385
1378
|
else {
|
|
@@ -1387,7 +1380,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1387
1380
|
}
|
|
1388
1381
|
}
|
|
1389
1382
|
catch (e) {
|
|
1390
|
-
this.realtimeDebug('[CREDENTIAL_REFRESH] unexpected error during scheduled refresh:',
|
|
1383
|
+
this.realtimeDebug('[CREDENTIAL_REFRESH] unexpected error during scheduled refresh:', e?.message || e);
|
|
1391
1384
|
}
|
|
1392
1385
|
}, msBefore);
|
|
1393
1386
|
}
|
|
@@ -1415,16 +1408,16 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1415
1408
|
}
|
|
1416
1409
|
}
|
|
1417
1410
|
catch (e) {
|
|
1418
|
-
this.realtimeDebug('[CREDENTIAL_REFRESH] scheduling failed:',
|
|
1411
|
+
this.realtimeDebug('[CREDENTIAL_REFRESH] scheduling failed:', e?.message || e);
|
|
1419
1412
|
}
|
|
1420
1413
|
}
|
|
1421
1414
|
}
|
|
1422
1415
|
catch (e) {
|
|
1423
|
-
this.realtimeDebug('[CREDENTIAL_REFRESH] schedule block failed:',
|
|
1416
|
+
this.realtimeDebug('[CREDENTIAL_REFRESH] schedule block failed:', e?.message || e);
|
|
1424
1417
|
}
|
|
1425
1418
|
}
|
|
1426
1419
|
catch (e) {
|
|
1427
|
-
this.realtimeDebug('[MQTT] _onMqttConnected fatal',
|
|
1420
|
+
this.realtimeDebug('[MQTT] _onMqttConnected fatal', e?.message || e);
|
|
1428
1421
|
}
|
|
1429
1422
|
}
|
|
1430
1423
|
/**
|
|
@@ -1454,7 +1447,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1454
1447
|
}
|
|
1455
1448
|
}
|
|
1456
1449
|
catch (e) {
|
|
1457
|
-
this.realtimeDebug('[CREDENTIAL_REFRESH] refreshMqttAuth failed:',
|
|
1450
|
+
this.realtimeDebug('[CREDENTIAL_REFRESH] refreshMqttAuth failed:', e?.message || e);
|
|
1458
1451
|
}
|
|
1459
1452
|
}
|
|
1460
1453
|
// Secondary hook: auth.refresh() or auth.loadCreds()
|
|
@@ -1466,7 +1459,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1466
1459
|
return true;
|
|
1467
1460
|
}
|
|
1468
1461
|
catch (e) {
|
|
1469
|
-
this.realtimeDebug('[CREDENTIAL_REFRESH] auth.refresh() failed:',
|
|
1462
|
+
this.realtimeDebug('[CREDENTIAL_REFRESH] auth.refresh() failed:', e?.message || e);
|
|
1470
1463
|
}
|
|
1471
1464
|
}
|
|
1472
1465
|
if (typeof auth.loadCreds === 'function') {
|
|
@@ -1477,7 +1470,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1477
1470
|
return true;
|
|
1478
1471
|
}
|
|
1479
1472
|
catch (e) {
|
|
1480
|
-
this.realtimeDebug('[CREDENTIAL_REFRESH] auth.loadCreds() failed:',
|
|
1473
|
+
this.realtimeDebug('[CREDENTIAL_REFRESH] auth.loadCreds() failed:', e?.message || e);
|
|
1481
1474
|
}
|
|
1482
1475
|
}
|
|
1483
1476
|
// If none of the above worked, attempt to re-run the useMultiFileAuthState load path if available (best-effort)
|
|
@@ -1502,7 +1495,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1502
1495
|
return false;
|
|
1503
1496
|
}
|
|
1504
1497
|
catch (e) {
|
|
1505
|
-
this.realtimeDebug('[CREDENTIAL_REFRESH] unexpected error',
|
|
1498
|
+
this.realtimeDebug('[CREDENTIAL_REFRESH] unexpected error', e?.message || e);
|
|
1506
1499
|
return false;
|
|
1507
1500
|
}
|
|
1508
1501
|
}
|
|
@@ -1511,7 +1504,6 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1511
1504
|
* Writes <authFolder>/mqtt-session.json as a local backup.
|
|
1512
1505
|
*/
|
|
1513
1506
|
async _persistMqttSession() {
|
|
1514
|
-
var _a, _b, _c, _d;
|
|
1515
1507
|
try {
|
|
1516
1508
|
const folder = this._authFolder || './authinfo_instagram';
|
|
1517
1509
|
try {
|
|
@@ -1528,7 +1520,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1528
1520
|
sessionId: this._mqttSessionId || null,
|
|
1529
1521
|
mqttSessionId: this._mqttSessionId ? String(this._mqttSessionId) : (this._clientMqttSessionId ? String(this._clientMqttSessionId) : 'boot'),
|
|
1530
1522
|
lastConnected: new Date().toISOString(),
|
|
1531
|
-
userId: String(
|
|
1523
|
+
userId: String(this.ig?.state?.cookieUserId || this.ig?.state?.userId || '')
|
|
1532
1524
|
};
|
|
1533
1525
|
// If an auth helper supports saveMqttSession, call that first (so it can save to the canonical auth state)
|
|
1534
1526
|
try {
|
|
@@ -1539,7 +1531,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1539
1531
|
this.realtimeDebug('[MQTT] authState.saveMqttSession called');
|
|
1540
1532
|
}
|
|
1541
1533
|
catch (e) {
|
|
1542
|
-
this.realtimeDebug('[MQTT] authState.saveMqttSession failed',
|
|
1534
|
+
this.realtimeDebug('[MQTT] authState.saveMqttSession failed', e?.message || e);
|
|
1543
1535
|
}
|
|
1544
1536
|
}
|
|
1545
1537
|
}
|
|
@@ -1550,12 +1542,12 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1550
1542
|
this.realtimeDebug('[MQTT] mqtt-session.json written locally');
|
|
1551
1543
|
}
|
|
1552
1544
|
catch (e) {
|
|
1553
|
-
this.realtimeDebug('[MQTT] failed writing mqtt-session.json',
|
|
1545
|
+
this.realtimeDebug('[MQTT] failed writing mqtt-session.json', e?.message || e);
|
|
1554
1546
|
}
|
|
1555
1547
|
}
|
|
1556
1548
|
catch (e) {
|
|
1557
1549
|
// swallow errors to not break main flow
|
|
1558
|
-
this.realtimeDebug('[MQTT] _persistMqttSession error',
|
|
1550
|
+
this.realtimeDebug('[MQTT] _persistMqttSession error', e?.message || e);
|
|
1559
1551
|
}
|
|
1560
1552
|
}
|
|
1561
1553
|
/**
|
|
@@ -1607,7 +1599,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1607
1599
|
}
|
|
1608
1600
|
}
|
|
1609
1601
|
catch (e) {
|
|
1610
|
-
this.realtimeDebug('[RECONNECT] Credential refresh failed:',
|
|
1602
|
+
this.realtimeDebug('[RECONNECT] Credential refresh failed:', e?.message || e);
|
|
1611
1603
|
}
|
|
1612
1604
|
}
|
|
1613
1605
|
this.realtimeDebug(`[RECONNECT] Attempt #${attempt}...`);
|
|
@@ -1621,11 +1613,11 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1621
1613
|
}
|
|
1622
1614
|
catch (e) {
|
|
1623
1615
|
lastErrorType = this.errorHandler ? this.errorHandler.classifyError(e) : 'unknown';
|
|
1624
|
-
this.realtimeDebug(`[RECONNECT] Attempt #${attempt} failed (${lastErrorType}):`,
|
|
1616
|
+
this.realtimeDebug(`[RECONNECT] Attempt #${attempt} failed (${lastErrorType}):`, e?.message || e);
|
|
1625
1617
|
}
|
|
1626
1618
|
}
|
|
1627
1619
|
catch (e) {
|
|
1628
|
-
this.realtimeDebug('[RECONNECT] Loop error:',
|
|
1620
|
+
this.realtimeDebug('[RECONNECT] Loop error:', e?.message || e);
|
|
1629
1621
|
}
|
|
1630
1622
|
let backoffMs;
|
|
1631
1623
|
if (this.errorHandler) {
|
|
@@ -1658,9 +1650,8 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1658
1650
|
* - Tries a fresh fetch after connect to get the latest snapshot.
|
|
1659
1651
|
*/
|
|
1660
1652
|
async _ensureIrisSnapshotAndSubscribe() {
|
|
1661
|
-
var _a;
|
|
1662
1653
|
try {
|
|
1663
|
-
let iris =
|
|
1654
|
+
let iris = this.initOptions?.irisData || null;
|
|
1664
1655
|
let fetched = false;
|
|
1665
1656
|
try {
|
|
1666
1657
|
const fetchedInbox = await this.ig.direct.getInbox();
|
|
@@ -1671,7 +1662,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1671
1662
|
}
|
|
1672
1663
|
}
|
|
1673
1664
|
catch (e) {
|
|
1674
|
-
this.realtimeDebug('[IRIS] Fresh fetch failed:',
|
|
1665
|
+
this.realtimeDebug('[IRIS] Fresh fetch failed:', e?.message || e);
|
|
1675
1666
|
}
|
|
1676
1667
|
if (iris) {
|
|
1677
1668
|
try {
|
|
@@ -1679,7 +1670,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1679
1670
|
this.realtimeDebug('[IRIS] irisSubscribe executed.');
|
|
1680
1671
|
}
|
|
1681
1672
|
catch (e) {
|
|
1682
|
-
this.realtimeDebug('[IRIS] irisSubscribe failed:',
|
|
1673
|
+
this.realtimeDebug('[IRIS] irisSubscribe failed:', e?.message || e);
|
|
1683
1674
|
}
|
|
1684
1675
|
}
|
|
1685
1676
|
else {
|
|
@@ -1719,7 +1710,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1719
1710
|
this.realtimeDebug('[MESSAGE_SYNC] listener attached to mqtt (idempotent).');
|
|
1720
1711
|
}
|
|
1721
1712
|
catch (e) {
|
|
1722
|
-
this.realtimeDebug('[MESSAGE_SYNC] attach failed:',
|
|
1713
|
+
this.realtimeDebug('[MESSAGE_SYNC] attach failed:', e?.message || e);
|
|
1723
1714
|
}
|
|
1724
1715
|
}
|
|
1725
1716
|
else {
|
|
@@ -1735,7 +1726,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1735
1726
|
await this._ensureIrisSnapshotAndSubscribe();
|
|
1736
1727
|
}
|
|
1737
1728
|
catch (e) {
|
|
1738
|
-
this.realtimeDebug('[AFTER_CONNECT] handlers error:',
|
|
1729
|
+
this.realtimeDebug('[AFTER_CONNECT] handlers error:', e?.message || e);
|
|
1739
1730
|
}
|
|
1740
1731
|
}
|
|
1741
1732
|
enableHealthMonitor(options = {}) {
|
|
@@ -1803,7 +1794,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1803
1794
|
};
|
|
1804
1795
|
this.on('error', (err) => {
|
|
1805
1796
|
if (this.persistentLogger)
|
|
1806
|
-
this.persistentLogger.error('[MQTT_ERROR]',
|
|
1797
|
+
this.persistentLogger.error('[MQTT_ERROR]', err?.message || err);
|
|
1807
1798
|
});
|
|
1808
1799
|
this.on('disconnect', (reason) => {
|
|
1809
1800
|
if (this.persistentLogger)
|
|
@@ -1832,7 +1823,6 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1832
1823
|
* - Attempts to fetch a fresh IRIS snapshot (up to a few attempts) for safety.
|
|
1833
1824
|
*/
|
|
1834
1825
|
async connectFromSavedSession(authStateHelper, options = {}) {
|
|
1835
|
-
var _a, _b;
|
|
1836
1826
|
if (!authStateHelper) {
|
|
1837
1827
|
throw new Error('authStateHelper is required - use useMultiFileAuthState()');
|
|
1838
1828
|
}
|
|
@@ -1850,7 +1840,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1850
1840
|
this._attachedAuthState = authStateHelper;
|
|
1851
1841
|
}
|
|
1852
1842
|
catch (e) { }
|
|
1853
|
-
const savedOptions =
|
|
1843
|
+
const savedOptions = authStateHelper.getMqttConnectOptions?.() || {};
|
|
1854
1844
|
let irisData = options.irisData || savedOptions.irisData || null;
|
|
1855
1845
|
let fetchedInbox = null;
|
|
1856
1846
|
const shouldForceFetch = true;
|
|
@@ -1867,12 +1857,12 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1867
1857
|
}
|
|
1868
1858
|
}
|
|
1869
1859
|
catch (e) {
|
|
1870
|
-
const msg = (
|
|
1860
|
+
const msg = (e?.message || String(e)).toLowerCase();
|
|
1871
1861
|
const isAuthIssue = msg.includes('login_required') || msg.includes('401') || msg.includes('403') || msg.includes('not authorized') || msg.includes('checkpoint');
|
|
1872
|
-
this._log('warn', `Failed to fetch IRIS snapshot (attempt ${attempt}):`,
|
|
1862
|
+
this._log('warn', `Failed to fetch IRIS snapshot (attempt ${attempt}):`, e?.message || e);
|
|
1873
1863
|
if (isAuthIssue) {
|
|
1874
1864
|
this._log('warn', 'IRIS fetch failed due to auth issue — session may be expired.');
|
|
1875
|
-
this.emit('warning', { type: 'auth_issue', message: 'Session may be expired - IRIS fetch returned auth error', error: e
|
|
1865
|
+
this.emit('warning', { type: 'auth_issue', message: 'Session may be expired - IRIS fetch returned auth error', error: e?.message });
|
|
1876
1866
|
break;
|
|
1877
1867
|
}
|
|
1878
1868
|
}
|
|
@@ -1903,7 +1893,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1903
1893
|
hasIrisData: !!connectOptions.irisData
|
|
1904
1894
|
});
|
|
1905
1895
|
try {
|
|
1906
|
-
const d =
|
|
1896
|
+
const d = authStateHelper.getData?.() || authStateHelper.data || {};
|
|
1907
1897
|
const mqttAuth = d.mqttAuth || null;
|
|
1908
1898
|
if (mqttAuth && mqttAuth.expiresAt) {
|
|
1909
1899
|
const t = new Date(mqttAuth.expiresAt).getTime();
|
|
@@ -1942,7 +1932,6 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1942
1932
|
* - Perform a graceful shutdown: clear timers and disconnect mqtt client.
|
|
1943
1933
|
*/
|
|
1944
1934
|
disconnect() {
|
|
1945
|
-
var _a, _b;
|
|
1946
1935
|
this.safeDisconnect = true;
|
|
1947
1936
|
try {
|
|
1948
1937
|
if (this._foregroundTimer) {
|
|
@@ -1986,7 +1975,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
1986
1975
|
this._persistMqttSession();
|
|
1987
1976
|
}
|
|
1988
1977
|
catch (e) { }
|
|
1989
|
-
return
|
|
1978
|
+
return this.mqtt?.disconnect() ?? Promise.resolve();
|
|
1990
1979
|
}
|
|
1991
1980
|
/**
|
|
1992
1981
|
* graphQlSubscribe(sub)
|
|
@@ -2087,7 +2076,7 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
2087
2076
|
}
|
|
2088
2077
|
catch (e) {
|
|
2089
2078
|
// log but continue to attempt realtime-sub reaffirmation
|
|
2090
|
-
this.realtimeDebug('[ACTIVE_QUERY] PUBSUB foreground pulse failed:',
|
|
2079
|
+
this.realtimeDebug('[ACTIVE_QUERY] PUBSUB foreground pulse failed:', e?.message || e);
|
|
2091
2080
|
}
|
|
2092
2081
|
// 2) REALTIME_SUB reaffirmation of GraphQL subs (lightweight)
|
|
2093
2082
|
try {
|
|
@@ -2100,17 +2089,17 @@ class RealtimeClient extends eventemitter3_1.EventEmitter {
|
|
|
2100
2089
|
this._lastMessageAt = Date.now(); // <--- update last-activity timestamp after realtime-sub reaffirmation
|
|
2101
2090
|
}
|
|
2102
2091
|
catch (e) {
|
|
2103
|
-
this.realtimeDebug('[ACTIVE_QUERY] REALTIME_SUB reaffirmation failed:',
|
|
2092
|
+
this.realtimeDebug('[ACTIVE_QUERY] REALTIME_SUB reaffirmation failed:', e?.message || e);
|
|
2104
2093
|
}
|
|
2105
2094
|
this.realtimeDebug('[ACTIVE_QUERY] keepalive query sent (idle ms: ' + idle + ')');
|
|
2106
2095
|
}
|
|
2107
2096
|
catch (e) {
|
|
2108
|
-
this.realtimeDebug('[ACTIVE_QUERY] unexpected error in keepalive loop:',
|
|
2097
|
+
this.realtimeDebug('[ACTIVE_QUERY] unexpected error in keepalive loop:', e?.message || e);
|
|
2109
2098
|
}
|
|
2110
2099
|
}, ms);
|
|
2111
2100
|
}
|
|
2112
2101
|
catch (e) {
|
|
2113
|
-
this.realtimeDebug('[ACTIVE_QUERY] could not start keepalive timer:',
|
|
2102
|
+
this.realtimeDebug('[ACTIVE_QUERY] could not start keepalive timer:', e?.message || e);
|
|
2114
2103
|
}
|
|
2115
2104
|
}
|
|
2116
2105
|
}
|