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,60 @@
|
|
|
1
|
+
const Repository = require('../core/repository');
|
|
2
|
+
class ExploreRepository extends Repository {
|
|
3
|
+
async topicalExplore(options = {}) {
|
|
4
|
+
const { clusterId = 'explore_all:0', maxId = '', module = 'explore_popular', } = options;
|
|
5
|
+
const response = await this.client.request.send({
|
|
6
|
+
method: 'GET',
|
|
7
|
+
url: '/api/v1/discover/topical_explore/',
|
|
8
|
+
qs: {
|
|
9
|
+
is_prefetch: false,
|
|
10
|
+
omit_cover_media: true,
|
|
11
|
+
use_sectional_payload: true,
|
|
12
|
+
timezone_offset: String(this.client.state.timezoneOffset),
|
|
13
|
+
session_id: this.client.state.clientSessionId,
|
|
14
|
+
include_fixed_destinations: true,
|
|
15
|
+
cluster_id: clusterId,
|
|
16
|
+
max_id: maxId,
|
|
17
|
+
module,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
return response.body;
|
|
21
|
+
}
|
|
22
|
+
async explore(maxId = '') {
|
|
23
|
+
const response = await this.client.request.send({
|
|
24
|
+
method: 'GET',
|
|
25
|
+
url: '/api/v1/discover/explore/',
|
|
26
|
+
qs: {
|
|
27
|
+
is_prefetch: false,
|
|
28
|
+
is_from_promote: false,
|
|
29
|
+
timezone_offset: String(this.client.state.timezoneOffset),
|
|
30
|
+
session_id: this.client.state.clientSessionId,
|
|
31
|
+
max_id: maxId,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
return response.body;
|
|
35
|
+
}
|
|
36
|
+
async reportExploreMedia(mediaPk, reason = 1) {
|
|
37
|
+
const response = await this.client.request.send({
|
|
38
|
+
method: 'POST',
|
|
39
|
+
url: `/api/v1/media/${mediaPk}/flag_media/`,
|
|
40
|
+
form: this.client.request.sign({
|
|
41
|
+
reason_id: String(reason),
|
|
42
|
+
_uid: this.client.state.cookieUserId,
|
|
43
|
+
_uuid: this.client.state.uuid,
|
|
44
|
+
}),
|
|
45
|
+
});
|
|
46
|
+
return response.body;
|
|
47
|
+
}
|
|
48
|
+
async markAsSeen(options = {}) {
|
|
49
|
+
const response = await this.client.request.send({
|
|
50
|
+
method: 'POST',
|
|
51
|
+
url: '/api/v1/discover/mark_su_seen/',
|
|
52
|
+
form: this.client.request.sign({
|
|
53
|
+
_uuid: this.client.state.uuid,
|
|
54
|
+
...options,
|
|
55
|
+
}),
|
|
56
|
+
});
|
|
57
|
+
return response.body;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
module.exports = ExploreRepository;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
const Repository = require('../core/repository');
|
|
2
|
+
class FBSearchRepository extends Repository {
|
|
3
|
+
async topSearch(query, options = {}) {
|
|
4
|
+
const { searchSurface = 'top_search_page', count = 30, } = options;
|
|
5
|
+
const response = await this.client.request.send({
|
|
6
|
+
method: 'GET',
|
|
7
|
+
url: '/api/v1/fbsearch/topsearch_flat/',
|
|
8
|
+
qs: {
|
|
9
|
+
query,
|
|
10
|
+
search_surface: searchSurface,
|
|
11
|
+
timezone_offset: String(this.client.state.timezoneOffset),
|
|
12
|
+
count,
|
|
13
|
+
rank_token: this.client.state.uuid,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
return response.body;
|
|
17
|
+
}
|
|
18
|
+
async topSearchFlat(query, count = 30) {
|
|
19
|
+
return this.topSearch(query, { count });
|
|
20
|
+
}
|
|
21
|
+
async searchPlaces(query, options = {}) {
|
|
22
|
+
const { lat, lng, count = 30 } = options;
|
|
23
|
+
const qs = {
|
|
24
|
+
search_query: query,
|
|
25
|
+
count,
|
|
26
|
+
rank_token: this.client.state.uuid,
|
|
27
|
+
};
|
|
28
|
+
if (lat && lng) {
|
|
29
|
+
qs.latitude = lat;
|
|
30
|
+
qs.longitude = lng;
|
|
31
|
+
}
|
|
32
|
+
const response = await this.client.request.send({
|
|
33
|
+
method: 'GET',
|
|
34
|
+
url: '/api/v1/fbsearch/places/',
|
|
35
|
+
qs,
|
|
36
|
+
});
|
|
37
|
+
return response.body;
|
|
38
|
+
}
|
|
39
|
+
async searchUsers(query, count = 30) {
|
|
40
|
+
const response = await this.client.request.send({
|
|
41
|
+
method: 'GET',
|
|
42
|
+
url: '/api/v1/users/search/',
|
|
43
|
+
qs: {
|
|
44
|
+
q: query,
|
|
45
|
+
count,
|
|
46
|
+
rank_token: this.client.state.uuid,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
return response.body;
|
|
50
|
+
}
|
|
51
|
+
async searchHashtags(query, count = 30) {
|
|
52
|
+
const response = await this.client.request.send({
|
|
53
|
+
method: 'GET',
|
|
54
|
+
url: '/api/v1/tags/search/',
|
|
55
|
+
qs: {
|
|
56
|
+
q: query,
|
|
57
|
+
count,
|
|
58
|
+
rank_token: this.client.state.uuid,
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
return response.body;
|
|
62
|
+
}
|
|
63
|
+
async searchMusic(query, options = {}) {
|
|
64
|
+
const { count = 30 } = options;
|
|
65
|
+
const response = await this.client.request.send({
|
|
66
|
+
method: 'GET',
|
|
67
|
+
url: '/api/v1/music/audio_global_search/',
|
|
68
|
+
qs: {
|
|
69
|
+
query,
|
|
70
|
+
browse_session_id: this.client.state.uuid,
|
|
71
|
+
count,
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
return response.body;
|
|
75
|
+
}
|
|
76
|
+
async getRecentSearches() {
|
|
77
|
+
const response = await this.client.request.send({
|
|
78
|
+
method: 'GET',
|
|
79
|
+
url: '/api/v1/fbsearch/recent_searches/',
|
|
80
|
+
});
|
|
81
|
+
return response.body;
|
|
82
|
+
}
|
|
83
|
+
async clearRecentSearches() {
|
|
84
|
+
const response = await this.client.request.send({
|
|
85
|
+
method: 'POST',
|
|
86
|
+
url: '/api/v1/fbsearch/clear_search_history/',
|
|
87
|
+
form: this.client.request.sign({
|
|
88
|
+
_uuid: this.client.state.uuid,
|
|
89
|
+
}),
|
|
90
|
+
});
|
|
91
|
+
return response.body;
|
|
92
|
+
}
|
|
93
|
+
async getSuggestedSearches(searchType = 'users') {
|
|
94
|
+
const response = await this.client.request.send({
|
|
95
|
+
method: 'GET',
|
|
96
|
+
url: '/api/v1/fbsearch/suggested_searches/',
|
|
97
|
+
qs: { type: searchType },
|
|
98
|
+
});
|
|
99
|
+
return response.body;
|
|
100
|
+
}
|
|
101
|
+
async registerRecentSearch(entityId, entityType = 'user') {
|
|
102
|
+
const response = await this.client.request.send({
|
|
103
|
+
method: 'POST',
|
|
104
|
+
url: '/api/v1/fbsearch/register_recent_search_click/',
|
|
105
|
+
form: this.client.request.sign({
|
|
106
|
+
entity_id: entityId,
|
|
107
|
+
entity_type: entityType,
|
|
108
|
+
_uuid: this.client.state.uuid,
|
|
109
|
+
}),
|
|
110
|
+
});
|
|
111
|
+
return response.body;
|
|
112
|
+
}
|
|
113
|
+
async nullStateDynamic() {
|
|
114
|
+
const response = await this.client.request.send({
|
|
115
|
+
method: 'GET',
|
|
116
|
+
url: '/api/v1/fbsearch/nullstate_dynamic_sections/',
|
|
117
|
+
qs: {
|
|
118
|
+
type: 'blended',
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
return response.body;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
module.exports = FBSearchRepository;
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
const Repository = require('../core/repository');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
class FeedRepository extends Repository {
|
|
4
|
+
async upload(options) {
|
|
5
|
+
const { imagePath, caption, usertags, location } = options;
|
|
6
|
+
const imageBuffer = fs.readFileSync(imagePath);
|
|
7
|
+
const uploadResult = await this.client.upload.photo({
|
|
8
|
+
file: imageBuffer,
|
|
9
|
+
uploadId: Date.now()
|
|
10
|
+
});
|
|
11
|
+
return this.client.upload.configurePhoto({
|
|
12
|
+
uploadId: uploadResult.upload_id,
|
|
13
|
+
caption: caption || '',
|
|
14
|
+
source_type: '4',
|
|
15
|
+
usertags,
|
|
16
|
+
location,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
async uploadVideo(options) {
|
|
20
|
+
const { videoPath, caption, usertags, location } = options;
|
|
21
|
+
const videoBuffer = fs.readFileSync(videoPath);
|
|
22
|
+
const uploadResult = await this.client.upload.video({
|
|
23
|
+
video: videoBuffer,
|
|
24
|
+
uploadId: Date.now(),
|
|
25
|
+
duration_ms: options.duration_ms || 15000,
|
|
26
|
+
width: options.width || 720,
|
|
27
|
+
height: options.height || 1280,
|
|
28
|
+
});
|
|
29
|
+
return this.client.upload.configureVideo({
|
|
30
|
+
uploadId: uploadResult.upload_id,
|
|
31
|
+
caption: caption || '',
|
|
32
|
+
source_type: '4',
|
|
33
|
+
length: options.duration_ms || 15000,
|
|
34
|
+
usertags,
|
|
35
|
+
location,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
async getFeed(maxId = null) {
|
|
39
|
+
const qs = {};
|
|
40
|
+
if (maxId)
|
|
41
|
+
qs.max_id = maxId;
|
|
42
|
+
const response = await this.client.request.send({
|
|
43
|
+
method: 'POST',
|
|
44
|
+
url: '/api/v1/feed/timeline/',
|
|
45
|
+
form: this.client.request.sign({
|
|
46
|
+
_uuid: this.client.state.uuid,
|
|
47
|
+
is_prefetch: '0',
|
|
48
|
+
feed_view_info: '[]',
|
|
49
|
+
seen_posts: '',
|
|
50
|
+
phone_id: this.client.state.phoneId,
|
|
51
|
+
battery_level: String(Math.floor(Math.random() * 50) + 50),
|
|
52
|
+
timezone_offset: String(this.client.state.timezoneOffset),
|
|
53
|
+
max_id: maxId || '',
|
|
54
|
+
}),
|
|
55
|
+
});
|
|
56
|
+
return response.body;
|
|
57
|
+
}
|
|
58
|
+
async getUserFeed(userId, maxId = null) {
|
|
59
|
+
const qs = {};
|
|
60
|
+
if (maxId)
|
|
61
|
+
qs.max_id = maxId;
|
|
62
|
+
const response = await this.client.request.send({
|
|
63
|
+
method: 'GET',
|
|
64
|
+
url: `/api/v1/feed/user/${userId}/`,
|
|
65
|
+
qs
|
|
66
|
+
});
|
|
67
|
+
return response.body;
|
|
68
|
+
}
|
|
69
|
+
async getUserStoryFeed(userId) {
|
|
70
|
+
const response = await this.client.request.send({
|
|
71
|
+
method: 'POST',
|
|
72
|
+
url: `/api/v1/feed/user/${userId}/story/`,
|
|
73
|
+
form: {
|
|
74
|
+
supported_capabilities_new: JSON.stringify(this.client.state.constants.SUPPORTED_CAPABILITIES),
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
return response.body;
|
|
78
|
+
}
|
|
79
|
+
async getTag(tag, maxId = null) {
|
|
80
|
+
const qs = { rank_token: this.client.state.uuid };
|
|
81
|
+
if (maxId)
|
|
82
|
+
qs.max_id = maxId;
|
|
83
|
+
const response = await this.client.request.send({
|
|
84
|
+
method: 'GET',
|
|
85
|
+
url: `/api/v1/feed/tag/${tag}/`,
|
|
86
|
+
qs
|
|
87
|
+
});
|
|
88
|
+
return response.body;
|
|
89
|
+
}
|
|
90
|
+
async getLiked(maxId = null) {
|
|
91
|
+
const qs = {};
|
|
92
|
+
if (maxId)
|
|
93
|
+
qs.max_id = maxId;
|
|
94
|
+
const response = await this.client.request.send({
|
|
95
|
+
method: 'GET',
|
|
96
|
+
url: '/api/v1/feed/liked/',
|
|
97
|
+
qs
|
|
98
|
+
});
|
|
99
|
+
return response.body;
|
|
100
|
+
}
|
|
101
|
+
async getSaved(maxId = null) {
|
|
102
|
+
const qs = {};
|
|
103
|
+
if (maxId)
|
|
104
|
+
qs.max_id = maxId;
|
|
105
|
+
const response = await this.client.request.send({
|
|
106
|
+
method: 'GET',
|
|
107
|
+
url: '/api/v1/feed/saved/',
|
|
108
|
+
qs
|
|
109
|
+
});
|
|
110
|
+
return response.body;
|
|
111
|
+
}
|
|
112
|
+
async getLocation(locationId, maxId = null) {
|
|
113
|
+
const qs = { rank_token: this.client.state.uuid };
|
|
114
|
+
if (maxId)
|
|
115
|
+
qs.max_id = maxId;
|
|
116
|
+
const response = await this.client.request.send({
|
|
117
|
+
method: 'GET',
|
|
118
|
+
url: `/api/v1/feed/location/${locationId}/`,
|
|
119
|
+
qs
|
|
120
|
+
});
|
|
121
|
+
return response.body;
|
|
122
|
+
}
|
|
123
|
+
async getExploreFeed(maxId = null) {
|
|
124
|
+
const qs = {
|
|
125
|
+
is_prefetch: false,
|
|
126
|
+
is_from_promote: false,
|
|
127
|
+
timezone_offset: this.client.state.timezoneOffset,
|
|
128
|
+
session_id: this.client.state.clientSessionId,
|
|
129
|
+
};
|
|
130
|
+
if (maxId)
|
|
131
|
+
qs.max_id = maxId;
|
|
132
|
+
const response = await this.client.request.send({
|
|
133
|
+
method: 'GET',
|
|
134
|
+
url: '/api/v1/discover/explore/',
|
|
135
|
+
qs
|
|
136
|
+
});
|
|
137
|
+
return response.body;
|
|
138
|
+
}
|
|
139
|
+
async getReelsFeed(maxId = null) {
|
|
140
|
+
const qs = {};
|
|
141
|
+
if (maxId)
|
|
142
|
+
qs.max_id = maxId;
|
|
143
|
+
const response = await this.client.request.send({
|
|
144
|
+
method: 'POST',
|
|
145
|
+
url: '/api/v1/clips/browse/',
|
|
146
|
+
form: qs,
|
|
147
|
+
});
|
|
148
|
+
return response.body;
|
|
149
|
+
}
|
|
150
|
+
async getUserReelsFeed(userId, maxId = null) {
|
|
151
|
+
const response = await this.client.request.send({
|
|
152
|
+
method: 'POST',
|
|
153
|
+
url: '/api/v1/clips/user/',
|
|
154
|
+
form: {
|
|
155
|
+
target_user_id: userId,
|
|
156
|
+
page_size: '12',
|
|
157
|
+
max_id: maxId || '',
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
return response.body;
|
|
161
|
+
}
|
|
162
|
+
async uploadCarousel(options) {
|
|
163
|
+
const { items, caption, usertags, location } = options;
|
|
164
|
+
const uploadIds = [];
|
|
165
|
+
for (const item of items) {
|
|
166
|
+
if (item.type === 'photo') {
|
|
167
|
+
const imageBuffer = fs.readFileSync(item.path);
|
|
168
|
+
const uploadResult = await this.client.upload.photo({
|
|
169
|
+
file: imageBuffer,
|
|
170
|
+
uploadId: Date.now() + Math.random() * 1000,
|
|
171
|
+
for_album: true,
|
|
172
|
+
});
|
|
173
|
+
uploadIds.push({
|
|
174
|
+
upload_id: uploadResult.upload_id,
|
|
175
|
+
source_type: '4',
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
else if (item.type === 'video') {
|
|
179
|
+
const videoBuffer = fs.readFileSync(item.path);
|
|
180
|
+
const uploadResult = await this.client.upload.video({
|
|
181
|
+
video: videoBuffer,
|
|
182
|
+
uploadId: Date.now() + Math.random() * 1000,
|
|
183
|
+
duration_ms: item.duration_ms || 15000,
|
|
184
|
+
width: item.width || 720,
|
|
185
|
+
height: item.height || 1280,
|
|
186
|
+
for_album: true,
|
|
187
|
+
});
|
|
188
|
+
uploadIds.push({
|
|
189
|
+
upload_id: uploadResult.upload_id,
|
|
190
|
+
source_type: '4',
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
const data = {
|
|
195
|
+
caption: caption || '',
|
|
196
|
+
client_sidecar_id: String(Date.now()),
|
|
197
|
+
children_metadata: uploadIds,
|
|
198
|
+
_uid: this.client.state.cookieUserId,
|
|
199
|
+
_uuid: this.client.state.uuid,
|
|
200
|
+
};
|
|
201
|
+
if (usertags)
|
|
202
|
+
data.usertags = JSON.stringify({ in: usertags });
|
|
203
|
+
if (location)
|
|
204
|
+
data.location = JSON.stringify(location);
|
|
205
|
+
const response = await this.client.request.send({
|
|
206
|
+
url: '/api/v1/media/configure_sidecar/',
|
|
207
|
+
method: 'POST',
|
|
208
|
+
form: this.client.request.sign(data),
|
|
209
|
+
});
|
|
210
|
+
return response.body;
|
|
211
|
+
}
|
|
212
|
+
async reelsMedia(userIds) {
|
|
213
|
+
const ids = Array.isArray(userIds) ? userIds : [userIds];
|
|
214
|
+
const response = await this.client.request.send({
|
|
215
|
+
method: 'POST',
|
|
216
|
+
url: '/api/v1/feed/reels_media/',
|
|
217
|
+
form: this.client.request.sign({
|
|
218
|
+
user_ids: ids,
|
|
219
|
+
_uuid: this.client.state.uuid,
|
|
220
|
+
}),
|
|
221
|
+
});
|
|
222
|
+
return response.body;
|
|
223
|
+
}
|
|
224
|
+
async reelsTray() {
|
|
225
|
+
const response = await this.client.request.send({
|
|
226
|
+
method: 'POST',
|
|
227
|
+
url: '/api/v1/feed/reels_tray/',
|
|
228
|
+
form: this.client.request.sign({
|
|
229
|
+
supported_capabilities_new: JSON.stringify(this.client.state.constants.SUPPORTED_CAPABILITIES),
|
|
230
|
+
reason: 'pull_to_refresh',
|
|
231
|
+
_uuid: this.client.state.uuid,
|
|
232
|
+
}),
|
|
233
|
+
});
|
|
234
|
+
return response.body;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
module.exports = FeedRepository;
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
const Repository = require('../core/repository');
|
|
2
|
+
class FriendshipRepository extends Repository {
|
|
3
|
+
async create(userId) {
|
|
4
|
+
const response = await this.client.request.send({
|
|
5
|
+
method: 'POST',
|
|
6
|
+
url: `/api/v1/friendships/create/${userId}/`,
|
|
7
|
+
form: this.client.request.sign({
|
|
8
|
+
_uid: this.client.state.cookieUserId,
|
|
9
|
+
_uuid: this.client.state.uuid,
|
|
10
|
+
user_id: userId,
|
|
11
|
+
}),
|
|
12
|
+
});
|
|
13
|
+
return response.body;
|
|
14
|
+
}
|
|
15
|
+
async destroy(userId) {
|
|
16
|
+
const response = await this.client.request.send({
|
|
17
|
+
method: 'POST',
|
|
18
|
+
url: `/api/v1/friendships/destroy/${userId}/`,
|
|
19
|
+
form: this.client.request.sign({
|
|
20
|
+
_uid: this.client.state.cookieUserId,
|
|
21
|
+
_uuid: this.client.state.uuid,
|
|
22
|
+
user_id: userId,
|
|
23
|
+
}),
|
|
24
|
+
});
|
|
25
|
+
return response.body;
|
|
26
|
+
}
|
|
27
|
+
async show(userId) {
|
|
28
|
+
const response = await this.client.request.send({
|
|
29
|
+
method: 'GET',
|
|
30
|
+
url: `/api/v1/friendships/show/${userId}/`,
|
|
31
|
+
});
|
|
32
|
+
return response.body;
|
|
33
|
+
}
|
|
34
|
+
async showMany(userIds) {
|
|
35
|
+
const response = await this.client.request.send({
|
|
36
|
+
method: 'POST',
|
|
37
|
+
url: '/api/v1/friendships/show_many/',
|
|
38
|
+
form: this.client.request.sign({
|
|
39
|
+
_uuid: this.client.state.uuid,
|
|
40
|
+
user_ids: Array.isArray(userIds) ? userIds.join(',') : userIds,
|
|
41
|
+
}),
|
|
42
|
+
});
|
|
43
|
+
return response.body;
|
|
44
|
+
}
|
|
45
|
+
async approve(userId) {
|
|
46
|
+
const response = await this.client.request.send({
|
|
47
|
+
method: 'POST',
|
|
48
|
+
url: `/api/v1/friendships/approve/${userId}/`,
|
|
49
|
+
form: this.client.request.sign({
|
|
50
|
+
_uid: this.client.state.cookieUserId,
|
|
51
|
+
_uuid: this.client.state.uuid,
|
|
52
|
+
user_id: userId,
|
|
53
|
+
}),
|
|
54
|
+
});
|
|
55
|
+
return response.body;
|
|
56
|
+
}
|
|
57
|
+
async ignore(userId) {
|
|
58
|
+
const response = await this.client.request.send({
|
|
59
|
+
method: 'POST',
|
|
60
|
+
url: `/api/v1/friendships/ignore/${userId}/`,
|
|
61
|
+
form: this.client.request.sign({
|
|
62
|
+
_uid: this.client.state.cookieUserId,
|
|
63
|
+
_uuid: this.client.state.uuid,
|
|
64
|
+
user_id: userId,
|
|
65
|
+
}),
|
|
66
|
+
});
|
|
67
|
+
return response.body;
|
|
68
|
+
}
|
|
69
|
+
async removeFollower(userId) {
|
|
70
|
+
const response = await this.client.request.send({
|
|
71
|
+
method: 'POST',
|
|
72
|
+
url: `/api/v1/friendships/remove_follower/${userId}/`,
|
|
73
|
+
form: this.client.request.sign({
|
|
74
|
+
_uid: this.client.state.cookieUserId,
|
|
75
|
+
_uuid: this.client.state.uuid,
|
|
76
|
+
user_id: userId,
|
|
77
|
+
}),
|
|
78
|
+
});
|
|
79
|
+
return response.body;
|
|
80
|
+
}
|
|
81
|
+
async block(userId) {
|
|
82
|
+
const response = await this.client.request.send({
|
|
83
|
+
method: 'POST',
|
|
84
|
+
url: `/api/v1/friendships/block/${userId}/`,
|
|
85
|
+
form: this.client.request.sign({
|
|
86
|
+
_uid: this.client.state.cookieUserId,
|
|
87
|
+
_uuid: this.client.state.uuid,
|
|
88
|
+
user_id: userId,
|
|
89
|
+
}),
|
|
90
|
+
});
|
|
91
|
+
return response.body;
|
|
92
|
+
}
|
|
93
|
+
async unblock(userId) {
|
|
94
|
+
const response = await this.client.request.send({
|
|
95
|
+
method: 'POST',
|
|
96
|
+
url: `/api/v1/friendships/unblock/${userId}/`,
|
|
97
|
+
form: this.client.request.sign({
|
|
98
|
+
_uid: this.client.state.cookieUserId,
|
|
99
|
+
_uuid: this.client.state.uuid,
|
|
100
|
+
user_id: userId,
|
|
101
|
+
}),
|
|
102
|
+
});
|
|
103
|
+
return response.body;
|
|
104
|
+
}
|
|
105
|
+
async mute(userId, options = {}) {
|
|
106
|
+
const form = {
|
|
107
|
+
_uid: this.client.state.cookieUserId,
|
|
108
|
+
_uuid: this.client.state.uuid,
|
|
109
|
+
user_id: userId,
|
|
110
|
+
};
|
|
111
|
+
if (options.muteStories)
|
|
112
|
+
form.target_reel_author_id = userId;
|
|
113
|
+
if (options.mutePosts)
|
|
114
|
+
form.target_posts_author_id = userId;
|
|
115
|
+
const response = await this.client.request.send({
|
|
116
|
+
method: 'POST',
|
|
117
|
+
url: '/api/v1/friendships/mute_posts_or_story_from_follow/',
|
|
118
|
+
form: this.client.request.sign(form),
|
|
119
|
+
});
|
|
120
|
+
return response.body;
|
|
121
|
+
}
|
|
122
|
+
async unmute(userId, options = {}) {
|
|
123
|
+
const form = {
|
|
124
|
+
_uid: this.client.state.cookieUserId,
|
|
125
|
+
_uuid: this.client.state.uuid,
|
|
126
|
+
user_id: userId,
|
|
127
|
+
};
|
|
128
|
+
if (options.unmuteStories)
|
|
129
|
+
form.target_reel_author_id = userId;
|
|
130
|
+
if (options.unmutePosts)
|
|
131
|
+
form.target_posts_author_id = userId;
|
|
132
|
+
const response = await this.client.request.send({
|
|
133
|
+
method: 'POST',
|
|
134
|
+
url: '/api/v1/friendships/unmute_posts_or_story_from_follow/',
|
|
135
|
+
form: this.client.request.sign(form),
|
|
136
|
+
});
|
|
137
|
+
return response.body;
|
|
138
|
+
}
|
|
139
|
+
async getPendingRequests() {
|
|
140
|
+
const response = await this.client.request.send({
|
|
141
|
+
method: 'GET',
|
|
142
|
+
url: '/api/v1/friendships/pending/',
|
|
143
|
+
});
|
|
144
|
+
return response.body;
|
|
145
|
+
}
|
|
146
|
+
async getFollowers(userId, maxId = null) {
|
|
147
|
+
const qs = {};
|
|
148
|
+
if (maxId)
|
|
149
|
+
qs.max_id = maxId;
|
|
150
|
+
const response = await this.client.request.send({
|
|
151
|
+
method: 'GET',
|
|
152
|
+
url: `/api/v1/friendships/${userId}/followers/`,
|
|
153
|
+
qs,
|
|
154
|
+
});
|
|
155
|
+
return response.body;
|
|
156
|
+
}
|
|
157
|
+
async getFollowing(userId, maxId = null) {
|
|
158
|
+
const qs = {};
|
|
159
|
+
if (maxId)
|
|
160
|
+
qs.max_id = maxId;
|
|
161
|
+
const response = await this.client.request.send({
|
|
162
|
+
method: 'GET',
|
|
163
|
+
url: `/api/v1/friendships/${userId}/following/`,
|
|
164
|
+
qs,
|
|
165
|
+
});
|
|
166
|
+
return response.body;
|
|
167
|
+
}
|
|
168
|
+
async getMutuafFollowers(userId) {
|
|
169
|
+
const response = await this.client.request.send({
|
|
170
|
+
method: 'GET',
|
|
171
|
+
url: `/api/v1/friendships/${userId}/mutual_followers/`,
|
|
172
|
+
});
|
|
173
|
+
return response.body;
|
|
174
|
+
}
|
|
175
|
+
async getBlockedUsers() {
|
|
176
|
+
const response = await this.client.request.send({
|
|
177
|
+
method: 'GET',
|
|
178
|
+
url: '/api/v1/users/blocked_list/',
|
|
179
|
+
});
|
|
180
|
+
return response.body;
|
|
181
|
+
}
|
|
182
|
+
async restrict(userId) {
|
|
183
|
+
const response = await this.client.request.send({
|
|
184
|
+
method: 'POST',
|
|
185
|
+
url: '/api/v1/restrict_action/restrict/',
|
|
186
|
+
form: this.client.request.sign({
|
|
187
|
+
_uid: this.client.state.cookieUserId,
|
|
188
|
+
_uuid: this.client.state.uuid,
|
|
189
|
+
target_user_id: userId,
|
|
190
|
+
}),
|
|
191
|
+
});
|
|
192
|
+
return response.body;
|
|
193
|
+
}
|
|
194
|
+
async unrestrict(userId) {
|
|
195
|
+
const response = await this.client.request.send({
|
|
196
|
+
method: 'POST',
|
|
197
|
+
url: '/api/v1/restrict_action/unrestrict/',
|
|
198
|
+
form: this.client.request.sign({
|
|
199
|
+
_uid: this.client.state.cookieUserId,
|
|
200
|
+
_uuid: this.client.state.uuid,
|
|
201
|
+
target_user_id: userId,
|
|
202
|
+
}),
|
|
203
|
+
});
|
|
204
|
+
return response.body;
|
|
205
|
+
}
|
|
206
|
+
async setCloseFriend(userId, add = true) {
|
|
207
|
+
if (add) {
|
|
208
|
+
const response = await this.client.request.send({
|
|
209
|
+
method: 'POST',
|
|
210
|
+
url: '/api/v1/friendships/set_besties/',
|
|
211
|
+
form: this.client.request.sign({
|
|
212
|
+
_uuid: this.client.state.uuid,
|
|
213
|
+
_uid: this.client.state.cookieUserId,
|
|
214
|
+
add: JSON.stringify([userId]),
|
|
215
|
+
remove: JSON.stringify([]),
|
|
216
|
+
}),
|
|
217
|
+
});
|
|
218
|
+
return response.body;
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
const response = await this.client.request.send({
|
|
222
|
+
method: 'POST',
|
|
223
|
+
url: '/api/v1/friendships/set_besties/',
|
|
224
|
+
form: this.client.request.sign({
|
|
225
|
+
_uuid: this.client.state.uuid,
|
|
226
|
+
_uid: this.client.state.cookieUserId,
|
|
227
|
+
add: JSON.stringify([]),
|
|
228
|
+
remove: JSON.stringify([userId]),
|
|
229
|
+
}),
|
|
230
|
+
});
|
|
231
|
+
return response.body;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
async setBesties(addUserIds = [], removeUserIds = []) {
|
|
235
|
+
const response = await this.client.request.send({
|
|
236
|
+
method: 'POST',
|
|
237
|
+
url: '/api/v1/friendships/set_besties/',
|
|
238
|
+
form: this.client.request.sign({
|
|
239
|
+
_uuid: this.client.state.uuid,
|
|
240
|
+
_uid: this.client.state.cookieUserId,
|
|
241
|
+
add: JSON.stringify(addUserIds),
|
|
242
|
+
remove: JSON.stringify(removeUserIds),
|
|
243
|
+
}),
|
|
244
|
+
});
|
|
245
|
+
return response.body;
|
|
246
|
+
}
|
|
247
|
+
async getFavoriteFriends() {
|
|
248
|
+
const response = await this.client.request.send({
|
|
249
|
+
method: 'GET',
|
|
250
|
+
url: '/api/v1/friendships/favorites/',
|
|
251
|
+
});
|
|
252
|
+
return response.body;
|
|
253
|
+
}
|
|
254
|
+
async setFavorite(userId) {
|
|
255
|
+
const response = await this.client.request.send({
|
|
256
|
+
method: 'POST',
|
|
257
|
+
url: `/api/v1/friendships/favorite/${userId}/`,
|
|
258
|
+
form: this.client.request.sign({
|
|
259
|
+
_uid: this.client.state.cookieUserId,
|
|
260
|
+
_uuid: this.client.state.uuid,
|
|
261
|
+
}),
|
|
262
|
+
});
|
|
263
|
+
return response.body;
|
|
264
|
+
}
|
|
265
|
+
async unsetFavorite(userId) {
|
|
266
|
+
const response = await this.client.request.send({
|
|
267
|
+
method: 'POST',
|
|
268
|
+
url: `/api/v1/friendships/unfavorite/${userId}/`,
|
|
269
|
+
form: this.client.request.sign({
|
|
270
|
+
_uid: this.client.state.cookieUserId,
|
|
271
|
+
_uuid: this.client.state.uuid,
|
|
272
|
+
}),
|
|
273
|
+
});
|
|
274
|
+
return response.body;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
module.exports = FriendshipRepository;
|