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