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,396 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BufferWriter = exports.thriftWriteFromObject = void 0;
|
|
4
|
-
const thrift_1 = require("./thrift");
|
|
5
|
-
const errors_1 = require("../errors");
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Thrift Compact Protocol writer (subset) optimized for MQTT-over-Thrift payloads.
|
|
9
|
-
* Improvements vs old version:
|
|
10
|
-
* - avoids Buffer.concat per write (uses chunk list + lazy concat)
|
|
11
|
-
* - faster descriptor lookup via Map
|
|
12
|
-
* - more flexible INT_64 input (number|bigint|string|{int}|Long-like)
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
function thriftWriteFromObject(obj, descriptors) {
|
|
16
|
-
const writer = BufferWriter.empty();
|
|
17
|
-
thriftWriteSingleLayerFromObject(obj, descriptors, writer);
|
|
18
|
-
writer.writeStop();
|
|
19
|
-
return writer.buffer;
|
|
20
|
-
}
|
|
21
|
-
exports.thriftWriteFromObject = thriftWriteFromObject;
|
|
22
|
-
|
|
23
|
-
function buildDescriptorMap(descriptors) {
|
|
24
|
-
const map = new Map();
|
|
25
|
-
for (const d of descriptors) map.set(d.fieldName, d);
|
|
26
|
-
return map;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function normalizeInt64(v, nameForError) {
|
|
30
|
-
if (typeof v === "bigint") return v;
|
|
31
|
-
if (typeof v === "number") return BigInt(v);
|
|
32
|
-
if (typeof v === "string") return BigInt(v);
|
|
33
|
-
if (v && typeof v === "object") {
|
|
34
|
-
if (typeof v.int === "bigint") return v.int; // our reader shape
|
|
35
|
-
if (typeof v.toString === "function") return BigInt(v.toString());
|
|
36
|
-
}
|
|
37
|
-
throw new errors_1.IllegalArgumentError(`Value of ${nameForError} is neither a bigint nor a number/string`);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function thriftWriteSingleLayerFromObject(obj, descriptors, writer) {
|
|
41
|
-
const descriptorMap = buildDescriptorMap(descriptors);
|
|
42
|
-
const entries = Object.entries(obj);
|
|
43
|
-
|
|
44
|
-
for (const [name, value] of entries) {
|
|
45
|
-
if (typeof value === "undefined") continue;
|
|
46
|
-
|
|
47
|
-
const descriptor = descriptorMap.get(name);
|
|
48
|
-
if (!descriptor) throw new errors_1.IllegalArgumentError(`Descriptor for ${name} not found`);
|
|
49
|
-
|
|
50
|
-
switch (descriptor.type & 0xff) {
|
|
51
|
-
case thrift_1.ThriftTypes.BOOLEAN:
|
|
52
|
-
case thrift_1.ThriftTypes.TRUE:
|
|
53
|
-
case thrift_1.ThriftTypes.FALSE: {
|
|
54
|
-
writer.writeBoolean(descriptor.field, !!value);
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
case thrift_1.ThriftTypes.BYTE: {
|
|
58
|
-
if (typeof value === "number") writer.writeInt8(descriptor.field, value);
|
|
59
|
-
else throw new errors_1.IllegalArgumentError(`Value of ${name} is not a number`);
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
case thrift_1.ThriftTypes.INT_16: {
|
|
63
|
-
if (typeof value === "number") writer.writeInt16(descriptor.field, value);
|
|
64
|
-
else throw new errors_1.IllegalArgumentError(`Value of ${name} is not a number`);
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
case thrift_1.ThriftTypes.INT_32: {
|
|
68
|
-
if (typeof value === "number") writer.writeInt32(descriptor.field, value);
|
|
69
|
-
else throw new errors_1.IllegalArgumentError(`Value of ${name} is not a number`);
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
case thrift_1.ThriftTypes.INT_64: {
|
|
73
|
-
writer.writeInt64Buffer(descriptor.field, normalizeInt64(value, name));
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
case thrift_1.ThriftTypes.LIST: {
|
|
77
|
-
// packed list type is stored in high byte (descriptor.type >> 8)
|
|
78
|
-
// @ts-ignore
|
|
79
|
-
writer.writeList(descriptor.field, descriptor.type >> 8, value);
|
|
80
|
-
break;
|
|
81
|
-
}
|
|
82
|
-
case thrift_1.ThriftTypes.STRUCT: {
|
|
83
|
-
writer.writeStruct(descriptor.field);
|
|
84
|
-
thriftWriteSingleLayerFromObject(value, descriptor.structDescriptors ?? [], writer);
|
|
85
|
-
writer.writeStop();
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
case thrift_1.ThriftTypes.BINARY: {
|
|
89
|
-
if (typeof value === "string") writer.writeString(descriptor.field, value);
|
|
90
|
-
else throw new errors_1.IllegalArgumentError(`Value of ${name} is not a string`);
|
|
91
|
-
break;
|
|
92
|
-
}
|
|
93
|
-
case thrift_1.ThriftTypes.MAP: {
|
|
94
|
-
if (descriptor.type === thrift_1.ThriftTypes.MAP_BINARY_BINARY) {
|
|
95
|
-
let pairs;
|
|
96
|
-
if (Array.isArray(value)) {
|
|
97
|
-
// [{key:'a', value:'b'}]
|
|
98
|
-
pairs = value.map((x) => [x.key, x.value]);
|
|
99
|
-
} else {
|
|
100
|
-
// {a:'b'}
|
|
101
|
-
pairs = Object.entries(value);
|
|
102
|
-
}
|
|
103
|
-
writer.writeMapHeader(descriptor.field, pairs.length, thrift_1.ThriftTypes.BINARY, thrift_1.ThriftTypes.BINARY);
|
|
104
|
-
if (pairs.length !== 0) {
|
|
105
|
-
for (const [k, v] of pairs) writer.writeStringDirect(k).writeStringDirect(v);
|
|
106
|
-
}
|
|
107
|
-
} else {
|
|
108
|
-
throw new errors_1.ThriftError(`Map of type ${descriptor.type} not impl.`);
|
|
109
|
-
}
|
|
110
|
-
break;
|
|
111
|
-
}
|
|
112
|
-
default: {
|
|
113
|
-
throw new errors_1.ThriftError(`Could not find type ${descriptor.type} for ${name}`);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
class BufferWriter {
|
|
120
|
-
get buffer() {
|
|
121
|
-
// Lazy concat: only when requested
|
|
122
|
-
if (this._dirty) {
|
|
123
|
-
this._buffer = Buffer.concat(this._chunks, this._length);
|
|
124
|
-
this._dirty = false;
|
|
125
|
-
// free chunks to reduce memory, keep single buffer from now on
|
|
126
|
-
this._chunks = [this._buffer];
|
|
127
|
-
}
|
|
128
|
-
return this._buffer;
|
|
129
|
-
}
|
|
130
|
-
get position() {
|
|
131
|
-
return this._position;
|
|
132
|
-
}
|
|
133
|
-
get length() {
|
|
134
|
-
return this._length;
|
|
135
|
-
}
|
|
136
|
-
get field() {
|
|
137
|
-
return this._field;
|
|
138
|
-
}
|
|
139
|
-
get stack() {
|
|
140
|
-
return this._stack;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
constructor(data, length, buffer) {
|
|
144
|
-
this._position = 0;
|
|
145
|
-
this._field = 0;
|
|
146
|
-
this._stack = [];
|
|
147
|
-
|
|
148
|
-
// internal chunked buffer state
|
|
149
|
-
this._chunks = [];
|
|
150
|
-
this._length = 0;
|
|
151
|
-
this._dirty = true;
|
|
152
|
-
|
|
153
|
-
if (data) {
|
|
154
|
-
const b = Buffer.from(data);
|
|
155
|
-
this._chunks.push(b);
|
|
156
|
-
this._length = b.length;
|
|
157
|
-
this._buffer = b;
|
|
158
|
-
this._dirty = false;
|
|
159
|
-
} else if (typeof length === "number") {
|
|
160
|
-
// not used in current library, but keep for compatibility
|
|
161
|
-
const b = Buffer.alloc(length);
|
|
162
|
-
this._chunks.push(b);
|
|
163
|
-
this._length = b.length;
|
|
164
|
-
this._buffer = b;
|
|
165
|
-
this._dirty = false;
|
|
166
|
-
} else if (buffer) {
|
|
167
|
-
this._chunks.push(buffer);
|
|
168
|
-
this._length = buffer.length;
|
|
169
|
-
this._buffer = buffer;
|
|
170
|
-
this._dirty = false;
|
|
171
|
-
} else {
|
|
172
|
-
const b = Buffer.from([]);
|
|
173
|
-
this._chunks.push(b);
|
|
174
|
-
this._length = 0;
|
|
175
|
-
this._buffer = b;
|
|
176
|
-
this._dirty = false;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
static fromLength(len) {
|
|
181
|
-
return new BufferWriter(undefined, len, undefined);
|
|
182
|
-
}
|
|
183
|
-
static fromBuffer(buf) {
|
|
184
|
-
return new BufferWriter(undefined, undefined, buf);
|
|
185
|
-
}
|
|
186
|
-
static fromString(data) {
|
|
187
|
-
return new BufferWriter(data, undefined, undefined);
|
|
188
|
-
}
|
|
189
|
-
static empty() {
|
|
190
|
-
return new BufferWriter(undefined, undefined, undefined);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
move(bytes) {
|
|
194
|
-
this._position = this._position + bytes;
|
|
195
|
-
return this._position - bytes;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
writeVarInt(num) {
|
|
199
|
-
// num is int32-ish here
|
|
200
|
-
while (true) {
|
|
201
|
-
let byte = num & ~0x7f;
|
|
202
|
-
if (byte === 0) {
|
|
203
|
-
this.writeByte(num);
|
|
204
|
-
break;
|
|
205
|
-
} else if (byte === -128) {
|
|
206
|
-
// -128 = 0b1000_0000 but it's the last and no other bytes will follow
|
|
207
|
-
this.writeByte(0);
|
|
208
|
-
break;
|
|
209
|
-
} else {
|
|
210
|
-
byte = (num & 0xff) | 0x80;
|
|
211
|
-
this.writeByte(byte);
|
|
212
|
-
num = num >> 7;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
return this;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
writeField(field, type) {
|
|
219
|
-
const delta = field - this.field;
|
|
220
|
-
if (delta > 0 && delta <= 15) {
|
|
221
|
-
this.writeByte((delta << 4) | type);
|
|
222
|
-
} else {
|
|
223
|
-
this.writeByte(type);
|
|
224
|
-
this.writeWord(field);
|
|
225
|
-
}
|
|
226
|
-
this._field = field;
|
|
227
|
-
return this;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
writeBuffer(buf) {
|
|
231
|
-
// Chunk append (no concat)
|
|
232
|
-
if (!buf || buf.length === 0) return this;
|
|
233
|
-
this._chunks.push(buf);
|
|
234
|
-
this._length += buf.length;
|
|
235
|
-
this._dirty = true;
|
|
236
|
-
this.move(buf.length);
|
|
237
|
-
return this;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
writeByte(byte) {
|
|
241
|
-
const b = Buffer.allocUnsafe(1);
|
|
242
|
-
b[0] = byte & 0xff;
|
|
243
|
-
return this.writeBuffer(b);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
writeWord(num) {
|
|
247
|
-
return this.writeVarInt(BufferWriter.toZigZag(num, 0x10));
|
|
248
|
-
}
|
|
249
|
-
writeInt(num) {
|
|
250
|
-
return this.writeVarInt(BufferWriter.toZigZag(num, 0x20));
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
writeLong(num) {
|
|
254
|
-
if (typeof num === "object") num = num.int;
|
|
255
|
-
if (typeof num !== "bigint") num = BigInt(num);
|
|
256
|
-
this.writeBigint(BufferWriter.bigintToZigZag(num));
|
|
257
|
-
return this;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
writeBigint(n) {
|
|
261
|
-
while (true) {
|
|
262
|
-
if ((n & ~BigInt(0x7f)) === BigInt(0)) {
|
|
263
|
-
this.writeByte(Number(n));
|
|
264
|
-
break;
|
|
265
|
-
} else {
|
|
266
|
-
this.writeByte(Number((n & BigInt(0x7f)) | BigInt(0x80)));
|
|
267
|
-
n = n >> BigInt(7);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
writeMapHeader(field, size, keyType, valueType) {
|
|
273
|
-
this.writeField(field, thrift_1.ThriftTypes.MAP);
|
|
274
|
-
if (size === 0) {
|
|
275
|
-
this.writeByte(0);
|
|
276
|
-
} else {
|
|
277
|
-
this.writeVarInt(size);
|
|
278
|
-
this.writeByte(((keyType & 0xf) << 4) | (valueType & 0xf));
|
|
279
|
-
}
|
|
280
|
-
return this;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
writeBoolean(field, bool) {
|
|
284
|
-
return this.writeField(field, bool ? thrift_1.ThriftTypes.TRUE : thrift_1.ThriftTypes.FALSE);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
writeString(field, s) {
|
|
288
|
-
this.writeField(field, thrift_1.ThriftTypes.BINARY);
|
|
289
|
-
return this.writeStringDirect(s);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
writeStringDirect(s) {
|
|
293
|
-
const buf = Buffer.from(s, "utf8");
|
|
294
|
-
this.writeVarInt(buf.length);
|
|
295
|
-
this.writeBuffer(buf);
|
|
296
|
-
return this;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
writeStop() {
|
|
300
|
-
this.writeByte(thrift_1.ThriftTypes.STOP);
|
|
301
|
-
if (this.stack.length > 0) this.popStack();
|
|
302
|
-
return this;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
writeInt8(field, num) {
|
|
306
|
-
this.writeField(field, thrift_1.ThriftTypes.BYTE);
|
|
307
|
-
return this.writeByte(num);
|
|
308
|
-
}
|
|
309
|
-
writeInt16(field, num) {
|
|
310
|
-
this.writeField(field, thrift_1.ThriftTypes.INT_16);
|
|
311
|
-
return this.writeWord(num);
|
|
312
|
-
}
|
|
313
|
-
writeInt32(field, num) {
|
|
314
|
-
this.writeField(field, thrift_1.ThriftTypes.INT_32);
|
|
315
|
-
return this.writeInt(num);
|
|
316
|
-
}
|
|
317
|
-
writeInt64Buffer(field, num) {
|
|
318
|
-
this.writeField(field, thrift_1.ThriftTypes.INT_64);
|
|
319
|
-
return this.writeLong(num);
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
writeList(field, type, list) {
|
|
323
|
-
this.writeField(field, thrift_1.ThriftTypes.LIST);
|
|
324
|
-
const size = list.length;
|
|
325
|
-
|
|
326
|
-
if (size < 0x0f) {
|
|
327
|
-
this.writeByte((size << 4) | type);
|
|
328
|
-
} else {
|
|
329
|
-
this.writeByte(0xf0 | type);
|
|
330
|
-
this.writeVarInt(size);
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
switch (type) {
|
|
334
|
-
case thrift_1.ThriftTypes.TRUE:
|
|
335
|
-
case thrift_1.ThriftTypes.FALSE: {
|
|
336
|
-
list.forEach((el) => this.writeByte(el ? thrift_1.ThriftTypes.TRUE : thrift_1.ThriftTypes.FALSE));
|
|
337
|
-
break;
|
|
338
|
-
}
|
|
339
|
-
case thrift_1.ThriftTypes.BYTE: {
|
|
340
|
-
list.forEach((el) => this.writeByte(el));
|
|
341
|
-
break;
|
|
342
|
-
}
|
|
343
|
-
case thrift_1.ThriftTypes.INT_16: {
|
|
344
|
-
list.forEach((el) => this.writeWord(el));
|
|
345
|
-
break;
|
|
346
|
-
}
|
|
347
|
-
case thrift_1.ThriftTypes.INT_32: {
|
|
348
|
-
list.forEach((el) => this.writeInt(el));
|
|
349
|
-
break;
|
|
350
|
-
}
|
|
351
|
-
case thrift_1.ThriftTypes.INT_64: {
|
|
352
|
-
list.forEach((el) => this.writeLong(normalizeInt64(el, "list<int64> item")));
|
|
353
|
-
break;
|
|
354
|
-
}
|
|
355
|
-
case thrift_1.ThriftTypes.BINARY: {
|
|
356
|
-
list.forEach((el) => {
|
|
357
|
-
const buf = Buffer.from(el, "utf8");
|
|
358
|
-
this.writeVarInt(buf.length);
|
|
359
|
-
this.writeBuffer(buf);
|
|
360
|
-
});
|
|
361
|
-
break;
|
|
362
|
-
}
|
|
363
|
-
default: {
|
|
364
|
-
throw new errors_1.ThriftError("not impl");
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
return this;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
writeStruct(field) {
|
|
372
|
-
this.writeField(field, thrift_1.ThriftTypes.STRUCT);
|
|
373
|
-
this.pushStack();
|
|
374
|
-
return this;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
pushStack() {
|
|
378
|
-
this._stack.push(this.field);
|
|
379
|
-
this._field = 0;
|
|
380
|
-
}
|
|
381
|
-
popStack() {
|
|
382
|
-
this._field = this._stack.pop() ?? -1;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
toString() {
|
|
386
|
-
return this.buffer.toString("ascii");
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
static bigintToZigZag(n) {
|
|
390
|
-
return (n << BigInt(1)) ^ (n >> BigInt(63));
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
exports.BufferWriter = BufferWriter;
|
|
394
|
-
|
|
395
|
-
BufferWriter.toZigZag = (n, bits) => (n << 1) ^ (n >> (bits - 1));
|
|
396
|
-
|
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type definitions for nodejs-insta-private-api
|
|
3
|
-
* These are JavaScript representations of common data structures
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
class IgUser {
|
|
7
|
-
constructor(data = {}) {
|
|
8
|
-
this.pk = data.pk;
|
|
9
|
-
this.username = data.username;
|
|
10
|
-
this.full_name = data.full_name;
|
|
11
|
-
this.is_private = data.is_private;
|
|
12
|
-
this.profile_pic_url = data.profile_pic_url;
|
|
13
|
-
this.profile_pic_id = data.profile_pic_id;
|
|
14
|
-
this.is_verified = data.is_verified;
|
|
15
|
-
this.has_anonymous_profile_picture = data.has_anonymous_profile_picture;
|
|
16
|
-
this.can_boost_post = data.can_boost_post;
|
|
17
|
-
this.can_see_organic_insights = data.can_see_organic_insights;
|
|
18
|
-
this.show_insights_terms = data.show_insights_terms;
|
|
19
|
-
this.reel_auto_archive = data.reel_auto_archive;
|
|
20
|
-
this.is_unpublished = data.is_unpublished;
|
|
21
|
-
this.is_favorite = data.is_favorite;
|
|
22
|
-
this.is_favorite_for_stories = data.is_favorite_for_stories;
|
|
23
|
-
this.is_favorite_for_highlights = data.is_favorite_for_highlights;
|
|
24
|
-
this.live_subscription_status = data.live_subscription_status;
|
|
25
|
-
this.subscription_status = data.subscription_status;
|
|
26
|
-
this.usertags_count = data.usertags_count;
|
|
27
|
-
this.total_igtv_videos = data.total_igtv_videos;
|
|
28
|
-
this.total_clips_count = data.total_clips_count;
|
|
29
|
-
this.has_videos = data.has_videos;
|
|
30
|
-
this.has_music = data.has_music;
|
|
31
|
-
this.can_be_reported_as_fraud = data.can_be_reported_as_fraud;
|
|
32
|
-
this.can_follow_hashtag = data.can_follow_hashtag;
|
|
33
|
-
this.is_business = data.is_business;
|
|
34
|
-
this.account_type = data.account_type;
|
|
35
|
-
this.is_call_to_action_enabled = data.is_call_to_action_enabled;
|
|
36
|
-
this.include_direct_blacklist_status = data.include_direct_blacklist_status;
|
|
37
|
-
this.can_boost_post = data.can_boost_post;
|
|
38
|
-
this.can_see_organic_insights = data.can_see_organic_insights;
|
|
39
|
-
this.show_insights_terms = data.show_insights_terms;
|
|
40
|
-
this.can_convert_to_business = data.can_convert_to_business;
|
|
41
|
-
this.can_create_sponsor_tags = data.can_create_sponsor_tags;
|
|
42
|
-
this.can_be_tagged_as_sponsor = data.can_be_tagged_as_sponsor;
|
|
43
|
-
this.fan_club_info = data.fan_club_info;
|
|
44
|
-
this.fbid_v2 = data.fbid_v2;
|
|
45
|
-
this.nametag = data.nametag;
|
|
46
|
-
this.allow_contacts_sync = data.allow_contacts_sync;
|
|
47
|
-
this.phone_number = data.phone_number;
|
|
48
|
-
this.country_code = data.country_code;
|
|
49
|
-
this.national_number = data.national_number;
|
|
50
|
-
this.category = data.category;
|
|
51
|
-
this.category_id = data.category_id;
|
|
52
|
-
this.public_email = data.public_email;
|
|
53
|
-
this.contact_phone_number = data.contact_phone_number;
|
|
54
|
-
this.public_phone_number = data.public_phone_number;
|
|
55
|
-
this.public_phone_country_code = data.public_phone_country_code;
|
|
56
|
-
this.city_id = data.city_id;
|
|
57
|
-
this.city_name = data.city_name;
|
|
58
|
-
this.address_street = data.address_street;
|
|
59
|
-
this.direct_messaging = data.direct_messaging;
|
|
60
|
-
this.latitude = data.latitude;
|
|
61
|
-
this.longitude = data.longitude;
|
|
62
|
-
this.zip = data.zip;
|
|
63
|
-
this.instagram_location_id = data.instagram_location_id;
|
|
64
|
-
this.interop_messaging_user_fbid = data.interop_messaging_user_fbid;
|
|
65
|
-
this.biography = data.biography;
|
|
66
|
-
this.biography_with_entities = data.biography_with_entities;
|
|
67
|
-
this.external_url = data.external_url;
|
|
68
|
-
this.external_lynx_url = data.external_lynx_url;
|
|
69
|
-
this.follower_count = data.follower_count;
|
|
70
|
-
this.following_count = data.following_count;
|
|
71
|
-
this.following_tag_count = data.following_tag_count;
|
|
72
|
-
this.media_count = data.media_count;
|
|
73
|
-
this.geo_media_count = data.geo_media_count;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
class IgMedia {
|
|
78
|
-
constructor(data = {}) {
|
|
79
|
-
this.taken_at = data.taken_at;
|
|
80
|
-
this.pk = data.pk;
|
|
81
|
-
this.id = data.id;
|
|
82
|
-
this.device_timestamp = data.device_timestamp;
|
|
83
|
-
this.media_type = data.media_type;
|
|
84
|
-
this.code = data.code;
|
|
85
|
-
this.client_cache_key = data.client_cache_key;
|
|
86
|
-
this.filter_type = data.filter_type;
|
|
87
|
-
this.is_unified_video = data.is_unified_video;
|
|
88
|
-
this.user = data.user ? new IgUser(data.user) : null;
|
|
89
|
-
this.can_viewer_reshare = data.can_viewer_reshare;
|
|
90
|
-
this.caption_is_edited = data.caption_is_edited;
|
|
91
|
-
this.like_and_view_counts_disabled = data.like_and_view_counts_disabled;
|
|
92
|
-
this.commerciality_status = data.commerciality_status;
|
|
93
|
-
this.is_paid_partnership = data.is_paid_partnership;
|
|
94
|
-
this.is_visual_reply_commenter_notice_enabled = data.is_visual_reply_commenter_notice_enabled;
|
|
95
|
-
this.original_media_has_visual_reply_media = data.original_media_has_visual_reply_media;
|
|
96
|
-
this.comment_likes_enabled = data.comment_likes_enabled;
|
|
97
|
-
this.comment_threading_enabled = data.comment_threading_enabled;
|
|
98
|
-
this.has_more_comments = data.has_more_comments;
|
|
99
|
-
this.max_num_visible_preview_comments = data.max_num_visible_preview_comments;
|
|
100
|
-
this.preview_comments = data.preview_comments;
|
|
101
|
-
this.comments = data.comments;
|
|
102
|
-
this.comment_count = data.comment_count;
|
|
103
|
-
this.inline_composer_display_condition = data.inline_composer_display_condition;
|
|
104
|
-
this.inline_composer_imp_trigger_time = data.inline_composer_imp_trigger_time;
|
|
105
|
-
this.image_versions2 = data.image_versions2;
|
|
106
|
-
this.original_width = data.original_width;
|
|
107
|
-
this.original_height = data.original_height;
|
|
108
|
-
this.is_reshare_of_text_post_app_media_in_ig = data.is_reshare_of_text_post_app_media_in_ig;
|
|
109
|
-
this.caption = data.caption;
|
|
110
|
-
this.can_viewer_save = data.can_viewer_save;
|
|
111
|
-
this.organic_tracking_token = data.organic_tracking_token;
|
|
112
|
-
this.has_liked = data.has_liked;
|
|
113
|
-
this.like_count = data.like_count;
|
|
114
|
-
this.play_count = data.play_count;
|
|
115
|
-
this.fb_play_count = data.fb_play_count;
|
|
116
|
-
this.can_see_insights_as_brand = data.can_see_insights_as_brand;
|
|
117
|
-
this.top_likers = data.top_likers;
|
|
118
|
-
this.likers = data.likers;
|
|
119
|
-
this.photo_of_you = data.photo_of_you;
|
|
120
|
-
this.can_viewer_reshare = data.can_viewer_reshare;
|
|
121
|
-
this.can_reshare = data.can_reshare;
|
|
122
|
-
this.can_reply = data.can_reply;
|
|
123
|
-
this.is_comments_gif_composer_enabled = data.is_comments_gif_composer_enabled;
|
|
124
|
-
this.comment_inform_treatment = data.comment_inform_treatment;
|
|
125
|
-
this.sharing_friction_info = data.sharing_friction_info;
|
|
126
|
-
this.product_type = data.product_type;
|
|
127
|
-
this.is_in_profile_grid = data.is_in_profile_grid;
|
|
128
|
-
this.profile_grid_control_enabled = data.profile_grid_control_enabled;
|
|
129
|
-
this.deleted_reason = data.deleted_reason;
|
|
130
|
-
this.integrity_review_decision = data.integrity_review_decision;
|
|
131
|
-
this.music_metadata = data.music_metadata;
|
|
132
|
-
this.is_artist_pick = data.is_artist_pick;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
class IgThread {
|
|
137
|
-
constructor(data = {}) {
|
|
138
|
-
this.thread_id = data.thread_id;
|
|
139
|
-
this.thread_v2_id = data.thread_v2_id;
|
|
140
|
-
this.users = data.users ? data.users.map(user => new IgUser(user)) : [];
|
|
141
|
-
this.left_users = data.left_users ? data.left_users.map(user => new IgUser(user)) : [];
|
|
142
|
-
this.admin_user_ids = data.admin_user_ids || [];
|
|
143
|
-
this.items = data.items || [];
|
|
144
|
-
this.last_activity_at = data.last_activity_at;
|
|
145
|
-
this.muted = data.muted;
|
|
146
|
-
this.is_pin = data.is_pin;
|
|
147
|
-
this.named = data.named;
|
|
148
|
-
this.canonical = data.canonical;
|
|
149
|
-
this.pending = data.pending;
|
|
150
|
-
this.archived = data.archived;
|
|
151
|
-
this.thread_type = data.thread_type;
|
|
152
|
-
this.viewer_id = data.viewer_id;
|
|
153
|
-
this.thread_title = data.thread_title;
|
|
154
|
-
this.pending_score = data.pending_score;
|
|
155
|
-
this.folder = data.folder;
|
|
156
|
-
this.vc_muted = data.vc_muted;
|
|
157
|
-
this.is_group = data.is_group;
|
|
158
|
-
this.mentions_muted = data.mentions_muted;
|
|
159
|
-
this.approval_required_for_new_members = data.approval_required_for_new_members;
|
|
160
|
-
this.input_mode = data.input_mode;
|
|
161
|
-
this.business_thread_folder = data.business_thread_folder;
|
|
162
|
-
this.read_state = data.read_state;
|
|
163
|
-
this.last_seen_at = data.last_seen_at;
|
|
164
|
-
this.oldest_cursor = data.oldest_cursor;
|
|
165
|
-
this.newest_cursor = data.newest_cursor;
|
|
166
|
-
this.next_cursor = data.next_cursor;
|
|
167
|
-
this.prev_cursor = data.prev_cursor;
|
|
168
|
-
this.has_older = data.has_older;
|
|
169
|
-
this.has_newer = data.has_newer;
|
|
170
|
-
this.last_permanent_item = data.last_permanent_item;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
class IgStory {
|
|
175
|
-
constructor(data = {}) {
|
|
176
|
-
this.taken_at = data.taken_at;
|
|
177
|
-
this.pk = data.pk;
|
|
178
|
-
this.id = data.id;
|
|
179
|
-
this.device_timestamp = data.device_timestamp;
|
|
180
|
-
this.media_type = data.media_type;
|
|
181
|
-
this.code = data.code;
|
|
182
|
-
this.client_cache_key = data.client_cache_key;
|
|
183
|
-
this.filter_type = data.filter_type;
|
|
184
|
-
this.is_unified_video = data.is_unified_video;
|
|
185
|
-
this.user = data.user ? new IgUser(data.user) : null;
|
|
186
|
-
this.can_viewer_reshare = data.can_viewer_reshare;
|
|
187
|
-
this.caption_is_edited = data.caption_is_edited;
|
|
188
|
-
this.like_and_view_counts_disabled = data.like_and_view_counts_disabled;
|
|
189
|
-
this.is_reel_media = data.is_reel_media;
|
|
190
|
-
this.timezone_offset = data.timezone_offset;
|
|
191
|
-
this.story_locations = data.story_locations;
|
|
192
|
-
this.story_events = data.story_events;
|
|
193
|
-
this.story_hashtags = data.story_hashtags;
|
|
194
|
-
this.story_polls = data.story_polls;
|
|
195
|
-
this.story_feed_media = data.story_feed_media;
|
|
196
|
-
this.story_sound_on = data.story_sound_on;
|
|
197
|
-
this.creative_config = data.creative_config;
|
|
198
|
-
this.story_static_models = data.story_static_models;
|
|
199
|
-
this.supports_reel_reactions = data.supports_reel_reactions;
|
|
200
|
-
this.show_one_tap_fb_share_tooltip = data.show_one_tap_fb_share_tooltip;
|
|
201
|
-
this.has_shared_to_fb = data.has_shared_to_fb;
|
|
202
|
-
this.image_versions2 = data.image_versions2;
|
|
203
|
-
this.original_width = data.original_width;
|
|
204
|
-
this.original_height = data.original_height;
|
|
205
|
-
this.imported_taken_at = data.imported_taken_at;
|
|
206
|
-
this.caption = data.caption;
|
|
207
|
-
this.can_viewer_save = data.can_viewer_save;
|
|
208
|
-
this.organic_tracking_token = data.organic_tracking_token;
|
|
209
|
-
this.expiring_at = data.expiring_at;
|
|
210
|
-
this.is_pride_media = data.is_pride_media;
|
|
211
|
-
this.can_reshare = data.can_reshare;
|
|
212
|
-
this.can_reply = data.can_reply;
|
|
213
|
-
this.reel_mentions = data.reel_mentions;
|
|
214
|
-
this.story_app_attribution = data.story_app_attribution;
|
|
215
|
-
this.story_bloks_stickers = data.story_bloks_stickers;
|
|
216
|
-
this.can_viewer_save = data.can_viewer_save;
|
|
217
|
-
this.is_dash_eligible = data.is_dash_eligible;
|
|
218
|
-
this.video_dash_manifest = data.video_dash_manifest;
|
|
219
|
-
this.video_codec = data.video_codec;
|
|
220
|
-
this.number_of_qualities = data.number_of_qualities;
|
|
221
|
-
this.video_versions = data.video_versions;
|
|
222
|
-
this.has_audio = data.has_audio;
|
|
223
|
-
this.video_duration = data.video_duration;
|
|
224
|
-
this.view_count = data.view_count;
|
|
225
|
-
this.viewers = data.viewers;
|
|
226
|
-
this.viewer_count = data.viewer_count;
|
|
227
|
-
this.viewer_cursor = data.viewer_cursor;
|
|
228
|
-
this.total_viewer_count = data.total_viewer_count;
|
|
229
|
-
this.multi_author_reel_names = data.multi_author_reel_names;
|
|
230
|
-
this.is_pride_media = data.is_pride_media;
|
|
231
|
-
this.can_see_insights_as_brand = data.can_see_insights_as_brand;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
// Options interfaces
|
|
236
|
-
class LoginOptions {
|
|
237
|
-
constructor(options = {}) {
|
|
238
|
-
this.username = options.username;
|
|
239
|
-
this.password = options.password;
|
|
240
|
-
this.email = options.email;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
class DMOptions {
|
|
245
|
-
constructor(options = {}) {
|
|
246
|
-
this.to = options.to;
|
|
247
|
-
this.message = options.message;
|
|
248
|
-
this.threadId = options.threadId;
|
|
249
|
-
this.imagePath = options.imagePath;
|
|
250
|
-
this.videoPath = options.videoPath;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
class UploadOptions {
|
|
255
|
-
constructor(options = {}) {
|
|
256
|
-
this.imagePath = options.imagePath;
|
|
257
|
-
this.videoPath = options.videoPath;
|
|
258
|
-
this.caption = options.caption;
|
|
259
|
-
this.width = options.width;
|
|
260
|
-
this.height = options.height;
|
|
261
|
-
this.duration_ms = options.duration_ms;
|
|
262
|
-
this.uploadId = options.uploadId;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
class StoryOptions {
|
|
267
|
-
constructor(options = {}) {
|
|
268
|
-
this.storyId = options.storyId;
|
|
269
|
-
this.reaction = options.reaction;
|
|
270
|
-
this.imagePath = options.imagePath;
|
|
271
|
-
this.videoPath = options.videoPath;
|
|
272
|
-
this.caption = options.caption;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
module.exports = {
|
|
277
|
-
IgUser,
|
|
278
|
-
IgMedia,
|
|
279
|
-
IgThread,
|
|
280
|
-
IgStory,
|
|
281
|
-
LoginOptions,
|
|
282
|
-
DMOptions,
|
|
283
|
-
UploadOptions,
|
|
284
|
-
StoryOptions
|
|
285
|
-
};
|