nodejs-insta-private-api-mqt 1.3.83 → 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/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/account.repository.js → src-ts/dist/repositories/account.repository.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,66 @@
|
|
|
1
|
+
const Repository = require('../core/repository');
|
|
2
|
+
class BloksRepository extends Repository {
|
|
3
|
+
async action(params = {}) {
|
|
4
|
+
const { actionName, actionParams = {}, extraData = {}, } = params;
|
|
5
|
+
let userId;
|
|
6
|
+
try {
|
|
7
|
+
userId = this.client.state.cookieUserId;
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
userId = '0';
|
|
11
|
+
}
|
|
12
|
+
const data = {
|
|
13
|
+
_uuid: this.client.state.uuid,
|
|
14
|
+
_uid: userId,
|
|
15
|
+
action: actionName,
|
|
16
|
+
bk_client_context: JSON.stringify({
|
|
17
|
+
bloks_version: this.client.state.bloksVersionId,
|
|
18
|
+
styles_id: 'instagram',
|
|
19
|
+
}),
|
|
20
|
+
params: JSON.stringify(actionParams),
|
|
21
|
+
...extraData,
|
|
22
|
+
};
|
|
23
|
+
const response = await this.client.request.send({
|
|
24
|
+
method: 'POST',
|
|
25
|
+
url: '/api/v1/bloks/apps/com.bloks.www.bloks.caa.login.async.send_login_request/',
|
|
26
|
+
form: this.client.request.sign(data),
|
|
27
|
+
});
|
|
28
|
+
return response.body;
|
|
29
|
+
}
|
|
30
|
+
async changePassword(oldPassword, newPassword) {
|
|
31
|
+
const oldEnc = this.client.account.encryptPassword(oldPassword);
|
|
32
|
+
const newEnc = this.client.account.encryptPassword(newPassword);
|
|
33
|
+
let userId;
|
|
34
|
+
try {
|
|
35
|
+
userId = this.client.state.cookieUserId;
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
userId = '0';
|
|
39
|
+
}
|
|
40
|
+
const data = {
|
|
41
|
+
_uuid: this.client.state.uuid,
|
|
42
|
+
_uid: userId,
|
|
43
|
+
enc_old_password: `#PWD_INSTAGRAM:4:${oldEnc.time}:${oldEnc.encrypted}`,
|
|
44
|
+
enc_new_password1: `#PWD_INSTAGRAM:4:${newEnc.time}:${newEnc.encrypted}`,
|
|
45
|
+
enc_new_password2: `#PWD_INSTAGRAM:4:${newEnc.time}:${newEnc.encrypted}`,
|
|
46
|
+
};
|
|
47
|
+
const response = await this.client.request.send({
|
|
48
|
+
method: 'POST',
|
|
49
|
+
url: '/api/v1/bloks/apps/com.instagram.challenge.navigation.take_challenge/',
|
|
50
|
+
form: this.client.request.sign(data),
|
|
51
|
+
});
|
|
52
|
+
return response.body;
|
|
53
|
+
}
|
|
54
|
+
async getLayoutData(params = {}) {
|
|
55
|
+
const response = await this.client.request.send({
|
|
56
|
+
method: 'POST',
|
|
57
|
+
url: '/api/v1/bloks/get_layout/',
|
|
58
|
+
form: this.client.request.sign({
|
|
59
|
+
_uuid: this.client.state.uuid,
|
|
60
|
+
...params,
|
|
61
|
+
}),
|
|
62
|
+
});
|
|
63
|
+
return response.body;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
module.exports = BloksRepository;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const Repository = require('../core/repository');
|
|
2
|
+
class CaptchaRepository extends Repository {
|
|
3
|
+
async getChallengeForm(apiPath) {
|
|
4
|
+
const url = apiPath.startsWith('/') ? apiPath : `/${apiPath}`;
|
|
5
|
+
const response = await this.client.request.send({
|
|
6
|
+
method: 'GET',
|
|
7
|
+
url,
|
|
8
|
+
qs: {
|
|
9
|
+
guid: this.client.state.uuid,
|
|
10
|
+
device_id: this.client.state.deviceId,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
return response.body;
|
|
14
|
+
}
|
|
15
|
+
async submitRecaptchaResponse(apiPath, gRecaptchaResponse) {
|
|
16
|
+
const url = apiPath.startsWith('/') ? apiPath : `/${apiPath}`;
|
|
17
|
+
const response = await this.client.request.send({
|
|
18
|
+
method: 'POST',
|
|
19
|
+
url,
|
|
20
|
+
form: this.client.request.sign({
|
|
21
|
+
_uuid: this.client.state.uuid,
|
|
22
|
+
g_recaptcha_response: gRecaptchaResponse,
|
|
23
|
+
}),
|
|
24
|
+
});
|
|
25
|
+
return response.body;
|
|
26
|
+
}
|
|
27
|
+
async submitHCaptchaResponse(apiPath, hCaptchaResponse) {
|
|
28
|
+
const url = apiPath.startsWith('/') ? apiPath : `/${apiPath}`;
|
|
29
|
+
const response = await this.client.request.send({
|
|
30
|
+
method: 'POST',
|
|
31
|
+
url,
|
|
32
|
+
form: this.client.request.sign({
|
|
33
|
+
_uuid: this.client.state.uuid,
|
|
34
|
+
h_captcha_response: hCaptchaResponse,
|
|
35
|
+
}),
|
|
36
|
+
});
|
|
37
|
+
return response.body;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
module.exports = CaptchaRepository;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
const Repository = require('../core/repository');
|
|
2
|
+
class ChallengeRepository extends Repository {
|
|
3
|
+
async resolve(challengeUrl, options = {}) {
|
|
4
|
+
const { securityCode, choice } = options;
|
|
5
|
+
if (choice !== undefined) {
|
|
6
|
+
return this.selectVerifyMethod(challengeUrl, choice);
|
|
7
|
+
}
|
|
8
|
+
if (securityCode) {
|
|
9
|
+
return this.sendSecurityCode(challengeUrl, securityCode);
|
|
10
|
+
}
|
|
11
|
+
return this.getChallengePage(challengeUrl);
|
|
12
|
+
}
|
|
13
|
+
async getChallengePage(challengeUrl) {
|
|
14
|
+
const url = challengeUrl.startsWith('/') ? challengeUrl : `/${challengeUrl}`;
|
|
15
|
+
const response = await this.client.request.send({
|
|
16
|
+
method: 'GET',
|
|
17
|
+
url: `/api/v1${url}`,
|
|
18
|
+
qs: {
|
|
19
|
+
guid: this.client.state.uuid,
|
|
20
|
+
device_id: this.client.state.deviceId,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
return response.body;
|
|
24
|
+
}
|
|
25
|
+
async selectVerifyMethod(challengeUrl, choice = 1) {
|
|
26
|
+
const url = challengeUrl.startsWith('/') ? challengeUrl : `/${challengeUrl}`;
|
|
27
|
+
const response = await this.client.request.send({
|
|
28
|
+
method: 'POST',
|
|
29
|
+
url: `/api/v1${url}`,
|
|
30
|
+
form: this.client.request.sign({
|
|
31
|
+
choice: String(choice),
|
|
32
|
+
_uuid: this.client.state.uuid,
|
|
33
|
+
guid: this.client.state.uuid,
|
|
34
|
+
device_id: this.client.state.deviceId,
|
|
35
|
+
}),
|
|
36
|
+
});
|
|
37
|
+
return response.body;
|
|
38
|
+
}
|
|
39
|
+
async sendSecurityCode(challengeUrl, securityCode) {
|
|
40
|
+
const url = challengeUrl.startsWith('/') ? challengeUrl : `/${challengeUrl}`;
|
|
41
|
+
const response = await this.client.request.send({
|
|
42
|
+
method: 'POST',
|
|
43
|
+
url: `/api/v1${url}`,
|
|
44
|
+
form: this.client.request.sign({
|
|
45
|
+
security_code: String(securityCode),
|
|
46
|
+
_uuid: this.client.state.uuid,
|
|
47
|
+
guid: this.client.state.uuid,
|
|
48
|
+
device_id: this.client.state.deviceId,
|
|
49
|
+
}),
|
|
50
|
+
});
|
|
51
|
+
return response.body;
|
|
52
|
+
}
|
|
53
|
+
async replayChallenge(challengeUrl) {
|
|
54
|
+
const url = challengeUrl.startsWith('/') ? challengeUrl : `/${challengeUrl}`;
|
|
55
|
+
const replayUrl = url.replace(/\/$/, '') + '/replay/';
|
|
56
|
+
const response = await this.client.request.send({
|
|
57
|
+
method: 'POST',
|
|
58
|
+
url: `/api/v1${replayUrl}`,
|
|
59
|
+
form: this.client.request.sign({
|
|
60
|
+
_uuid: this.client.state.uuid,
|
|
61
|
+
guid: this.client.state.uuid,
|
|
62
|
+
device_id: this.client.state.deviceId,
|
|
63
|
+
}),
|
|
64
|
+
});
|
|
65
|
+
return response.body;
|
|
66
|
+
}
|
|
67
|
+
async resetChallenge(challengeUrl) {
|
|
68
|
+
const url = challengeUrl.startsWith('/') ? challengeUrl : `/${challengeUrl}`;
|
|
69
|
+
const resetUrl = url.replace(/\/$/, '') + '/reset/';
|
|
70
|
+
const response = await this.client.request.send({
|
|
71
|
+
method: 'POST',
|
|
72
|
+
url: `/api/v1${resetUrl}`,
|
|
73
|
+
form: this.client.request.sign({
|
|
74
|
+
_uuid: this.client.state.uuid,
|
|
75
|
+
guid: this.client.state.uuid,
|
|
76
|
+
device_id: this.client.state.deviceId,
|
|
77
|
+
}),
|
|
78
|
+
});
|
|
79
|
+
return response.body;
|
|
80
|
+
}
|
|
81
|
+
async auto(challengeUrl) {
|
|
82
|
+
var _a;
|
|
83
|
+
const step1 = await this.getChallengePage(challengeUrl);
|
|
84
|
+
if (step1.step_name === 'select_verify_method') {
|
|
85
|
+
const choice = ((_a = step1.step_data) === null || _a === void 0 ? void 0 : _a.choice) || '1';
|
|
86
|
+
return this.selectVerifyMethod(challengeUrl, choice);
|
|
87
|
+
}
|
|
88
|
+
return step1;
|
|
89
|
+
}
|
|
90
|
+
async submitPhoneNumber(challengeUrl, phoneNumber) {
|
|
91
|
+
const url = challengeUrl.startsWith('/') ? challengeUrl : `/${challengeUrl}`;
|
|
92
|
+
const response = await this.client.request.send({
|
|
93
|
+
method: 'POST',
|
|
94
|
+
url: `/api/v1${url}`,
|
|
95
|
+
form: this.client.request.sign({
|
|
96
|
+
phone_number: phoneNumber,
|
|
97
|
+
_uuid: this.client.state.uuid,
|
|
98
|
+
guid: this.client.state.uuid,
|
|
99
|
+
device_id: this.client.state.deviceId,
|
|
100
|
+
}),
|
|
101
|
+
});
|
|
102
|
+
return response.body;
|
|
103
|
+
}
|
|
104
|
+
async submitDelta(challengeUrl, securityCode) {
|
|
105
|
+
return this.sendSecurityCode(challengeUrl, securityCode);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
module.exports = ChallengeRepository;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
const Repository = require('../core/repository');
|
|
2
|
+
class ClipRepository extends Repository {
|
|
3
|
+
async upload(options = {}) {
|
|
4
|
+
const { videoPath, thumbnailPath, caption = '', uploadId = null, usertags = [], location = null, audio = null, shareToFeed = true, extraData = {}, } = options;
|
|
5
|
+
const actualUploadId = uploadId || String(Date.now());
|
|
6
|
+
const uploadResult = await this.client.upload.video(videoPath, {
|
|
7
|
+
uploadId: actualUploadId,
|
|
8
|
+
isClip: true,
|
|
9
|
+
thumbnail: thumbnailPath,
|
|
10
|
+
});
|
|
11
|
+
return this.configure({
|
|
12
|
+
uploadId: actualUploadId,
|
|
13
|
+
caption,
|
|
14
|
+
usertags,
|
|
15
|
+
location,
|
|
16
|
+
audio,
|
|
17
|
+
shareToFeed,
|
|
18
|
+
...extraData,
|
|
19
|
+
width: uploadResult.width,
|
|
20
|
+
height: uploadResult.height,
|
|
21
|
+
duration: uploadResult.duration,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
async configure(options = {}) {
|
|
25
|
+
const { uploadId, caption = '', usertags = [], location = null, audio = null, shareToFeed = true, width = 1080, height = 1920, duration = 0, } = options;
|
|
26
|
+
const data = {
|
|
27
|
+
_uuid: this.client.state.uuid,
|
|
28
|
+
upload_id: uploadId,
|
|
29
|
+
caption,
|
|
30
|
+
source_type: '4',
|
|
31
|
+
clips_share_preview_to_feed: shareToFeed ? '1' : '0',
|
|
32
|
+
device: {
|
|
33
|
+
manufacturer: 'samsung',
|
|
34
|
+
model: 'SM-S928B',
|
|
35
|
+
android_version: 35,
|
|
36
|
+
android_release: '15',
|
|
37
|
+
},
|
|
38
|
+
extra: JSON.stringify({ source_width: width, source_height: height }),
|
|
39
|
+
length: duration,
|
|
40
|
+
poster_frame_index: '0',
|
|
41
|
+
audio_muted: '0',
|
|
42
|
+
filter_type: '0',
|
|
43
|
+
video_result: '',
|
|
44
|
+
clips_creation_entry_point: 'clips',
|
|
45
|
+
media_folder: 'Camera',
|
|
46
|
+
camera_position: 'unknown',
|
|
47
|
+
};
|
|
48
|
+
if (usertags.length > 0) {
|
|
49
|
+
data.usertags = JSON.stringify({ in: usertags });
|
|
50
|
+
}
|
|
51
|
+
if (location) {
|
|
52
|
+
data.location = JSON.stringify(location);
|
|
53
|
+
data.media_latitude = String(location.lat || '');
|
|
54
|
+
data.media_longitude = String(location.lng || '');
|
|
55
|
+
}
|
|
56
|
+
if (audio) {
|
|
57
|
+
data.clips_audio = JSON.stringify(audio);
|
|
58
|
+
}
|
|
59
|
+
const response = await this.client.request.send({
|
|
60
|
+
method: 'POST',
|
|
61
|
+
url: '/api/v1/media/configure_to_clips/',
|
|
62
|
+
form: this.client.request.sign(data),
|
|
63
|
+
});
|
|
64
|
+
return response.body;
|
|
65
|
+
}
|
|
66
|
+
async downloadByUrl(url) {
|
|
67
|
+
const axios = require('axios');
|
|
68
|
+
const response = await axios.get(url, { responseType: 'arraybuffer' });
|
|
69
|
+
return Buffer.from(response.data);
|
|
70
|
+
}
|
|
71
|
+
async download(mediaPk) {
|
|
72
|
+
const info = await this.client.media.info(mediaPk);
|
|
73
|
+
const items = info.items || [info];
|
|
74
|
+
const item = items[0] || info;
|
|
75
|
+
const videoVersions = item.video_versions || [];
|
|
76
|
+
if (videoVersions.length === 0)
|
|
77
|
+
throw new Error('No video versions found');
|
|
78
|
+
return this.downloadByUrl(videoVersions[0].url);
|
|
79
|
+
}
|
|
80
|
+
async connectedReels(amount = 10, maxId = '') {
|
|
81
|
+
const items = [];
|
|
82
|
+
let nextMaxId = maxId;
|
|
83
|
+
while (items.length < amount) {
|
|
84
|
+
const response = await this.client.request.send({
|
|
85
|
+
method: 'POST',
|
|
86
|
+
url: '/api/v1/clips/connected/',
|
|
87
|
+
form: { max_id: nextMaxId },
|
|
88
|
+
});
|
|
89
|
+
const body = response.body;
|
|
90
|
+
for (const item of (body.items || [])) {
|
|
91
|
+
items.push(item.media || item);
|
|
92
|
+
}
|
|
93
|
+
const pagingInfo = body.paging_info || {};
|
|
94
|
+
if (!pagingInfo.more_available)
|
|
95
|
+
break;
|
|
96
|
+
nextMaxId = pagingInfo.max_id || '';
|
|
97
|
+
}
|
|
98
|
+
return items.slice(0, amount);
|
|
99
|
+
}
|
|
100
|
+
async discoverReels(amount = 10, maxId = '') {
|
|
101
|
+
const items = [];
|
|
102
|
+
let nextMaxId = maxId;
|
|
103
|
+
while (items.length < amount) {
|
|
104
|
+
const response = await this.client.request.send({
|
|
105
|
+
method: 'POST',
|
|
106
|
+
url: '/api/v1/clips/discover/',
|
|
107
|
+
form: { max_id: nextMaxId },
|
|
108
|
+
});
|
|
109
|
+
const body = response.body;
|
|
110
|
+
for (const item of (body.items || [])) {
|
|
111
|
+
items.push(item.media || item);
|
|
112
|
+
}
|
|
113
|
+
const pagingInfo = body.paging_info || {};
|
|
114
|
+
if (!pagingInfo.more_available)
|
|
115
|
+
break;
|
|
116
|
+
nextMaxId = pagingInfo.max_id || '';
|
|
117
|
+
}
|
|
118
|
+
return items.slice(0, amount);
|
|
119
|
+
}
|
|
120
|
+
async musicInfo(data = {}) {
|
|
121
|
+
const response = await this.client.request.send({
|
|
122
|
+
method: 'POST',
|
|
123
|
+
url: '/api/v1/clips/music/',
|
|
124
|
+
form: {
|
|
125
|
+
tab_type: 'clips',
|
|
126
|
+
referrer_media_id: '',
|
|
127
|
+
_uuid: this.client.state.uuid,
|
|
128
|
+
...data,
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
return response.body;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
module.exports = ClipRepository;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const Repository = require('../core/repository');
|
|
2
|
+
class CloseFriendsRepository extends Repository {
|
|
3
|
+
async list() {
|
|
4
|
+
const response = await this.client.request.send({
|
|
5
|
+
url: '/api/v1/friendships/besties/',
|
|
6
|
+
method: 'GET',
|
|
7
|
+
});
|
|
8
|
+
return response.body;
|
|
9
|
+
}
|
|
10
|
+
async setBesties(addUserIds = [], removeUserIds = []) {
|
|
11
|
+
const response = await this.client.request.send({
|
|
12
|
+
url: '/api/v1/friendships/set_besties/',
|
|
13
|
+
method: 'POST',
|
|
14
|
+
form: this.client.request.sign({
|
|
15
|
+
add: JSON.stringify(addUserIds),
|
|
16
|
+
remove: JSON.stringify(removeUserIds),
|
|
17
|
+
_uid: this.client.state.cookieUserId,
|
|
18
|
+
_uuid: this.client.state.uuid,
|
|
19
|
+
}),
|
|
20
|
+
});
|
|
21
|
+
return response.body;
|
|
22
|
+
}
|
|
23
|
+
async add(userId) {
|
|
24
|
+
return this.setBesties([userId], []);
|
|
25
|
+
}
|
|
26
|
+
async remove(userId) {
|
|
27
|
+
return this.setBesties([], [userId]);
|
|
28
|
+
}
|
|
29
|
+
async suggestions(maxId = null) {
|
|
30
|
+
const qs = {};
|
|
31
|
+
if (maxId)
|
|
32
|
+
qs.max_id = maxId;
|
|
33
|
+
const response = await this.client.request.send({
|
|
34
|
+
url: '/api/v1/friendships/bestie_suggestions/',
|
|
35
|
+
method: 'GET',
|
|
36
|
+
qs,
|
|
37
|
+
});
|
|
38
|
+
return response.body;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
module.exports = CloseFriendsRepository;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const Repository = require('../core/repository');
|
|
2
|
+
class CollectionRepository extends Repository {
|
|
3
|
+
async list(maxId = null) {
|
|
4
|
+
const qs = { collection_types: '["ALL_MEDIA_AUTO_COLLECTION","MEDIA","PRODUCT_AUTO_COLLECTION"]' };
|
|
5
|
+
if (maxId)
|
|
6
|
+
qs.max_id = maxId;
|
|
7
|
+
const response = await this.client.request.send({
|
|
8
|
+
url: '/api/v1/collections/list/',
|
|
9
|
+
method: 'GET',
|
|
10
|
+
qs,
|
|
11
|
+
});
|
|
12
|
+
return response.body;
|
|
13
|
+
}
|
|
14
|
+
async feed(collectionId, maxId = null) {
|
|
15
|
+
const qs = {};
|
|
16
|
+
if (maxId)
|
|
17
|
+
qs.max_id = maxId;
|
|
18
|
+
const response = await this.client.request.send({
|
|
19
|
+
url: `/api/v1/feed/collection/${collectionId}/`,
|
|
20
|
+
method: 'GET',
|
|
21
|
+
qs,
|
|
22
|
+
});
|
|
23
|
+
return response.body;
|
|
24
|
+
}
|
|
25
|
+
async create(name, mediaIds = []) {
|
|
26
|
+
const response = await this.client.request.send({
|
|
27
|
+
url: '/api/v1/collections/create/',
|
|
28
|
+
method: 'POST',
|
|
29
|
+
form: this.client.request.sign({
|
|
30
|
+
name,
|
|
31
|
+
added_media_ids: JSON.stringify(mediaIds),
|
|
32
|
+
_uid: this.client.state.cookieUserId,
|
|
33
|
+
_uuid: this.client.state.uuid,
|
|
34
|
+
}),
|
|
35
|
+
});
|
|
36
|
+
return response.body;
|
|
37
|
+
}
|
|
38
|
+
async edit(collectionId, name, addedMediaIds = [], removedMediaIds = []) {
|
|
39
|
+
const response = await this.client.request.send({
|
|
40
|
+
url: `/api/v1/collections/${collectionId}/edit/`,
|
|
41
|
+
method: 'POST',
|
|
42
|
+
form: this.client.request.sign({
|
|
43
|
+
name,
|
|
44
|
+
added_media_ids: JSON.stringify(addedMediaIds),
|
|
45
|
+
removed_media_ids: JSON.stringify(removedMediaIds),
|
|
46
|
+
_uid: this.client.state.cookieUserId,
|
|
47
|
+
_uuid: this.client.state.uuid,
|
|
48
|
+
}),
|
|
49
|
+
});
|
|
50
|
+
return response.body;
|
|
51
|
+
}
|
|
52
|
+
async delete(collectionId) {
|
|
53
|
+
const response = await this.client.request.send({
|
|
54
|
+
url: `/api/v1/collections/${collectionId}/delete/`,
|
|
55
|
+
method: 'POST',
|
|
56
|
+
form: this.client.request.sign({
|
|
57
|
+
_uid: this.client.state.cookieUserId,
|
|
58
|
+
_uuid: this.client.state.uuid,
|
|
59
|
+
}),
|
|
60
|
+
});
|
|
61
|
+
return response.body;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
module.exports = CollectionRepository;
|