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,415 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DirectCommands = void 0;
|
|
4
|
+
const constants_1 = require("../../constants");
|
|
5
|
+
const shared_1 = require("../../shared");
|
|
6
|
+
const Chance = require("chance");
|
|
7
|
+
const thrift_1 = require("../../thrift");
|
|
8
|
+
class DirectCommands {
|
|
9
|
+
constructor(client) {
|
|
10
|
+
this.directDebug = (0, shared_1.debugChannel)('realtime', 'direct');
|
|
11
|
+
this.foregroundStateConfig = [
|
|
12
|
+
thrift_1.ThriftDescriptors.boolean('inForegroundApp', 1),
|
|
13
|
+
thrift_1.ThriftDescriptors.boolean('inForegroundDevice', 2),
|
|
14
|
+
thrift_1.ThriftDescriptors.int32('keepAliveTimeout', 3),
|
|
15
|
+
thrift_1.ThriftDescriptors.listOfBinary('subscribeTopics', 4),
|
|
16
|
+
thrift_1.ThriftDescriptors.listOfBinary('subscribeGenericTopics', 5),
|
|
17
|
+
thrift_1.ThriftDescriptors.listOfBinary('unsubscribeTopics', 6),
|
|
18
|
+
thrift_1.ThriftDescriptors.listOfBinary('unsubscribeGenericTopics', 7),
|
|
19
|
+
thrift_1.ThriftDescriptors.int64('requestId', 8),
|
|
20
|
+
];
|
|
21
|
+
this.client = client;
|
|
22
|
+
this.chance = new Chance();
|
|
23
|
+
}
|
|
24
|
+
async sendForegroundState(state) {
|
|
25
|
+
this.directDebug(`Updated foreground state: ${JSON.stringify(state)}`);
|
|
26
|
+
return this.client
|
|
27
|
+
.publish({
|
|
28
|
+
topic: constants_1.Topics.FOREGROUND_STATE.id,
|
|
29
|
+
payload: await (0, shared_1.compressDeflate)(Buffer.concat([Buffer.alloc(1, 0), (0, thrift_1.thriftWriteFromObject)(state, this.foregroundStateConfig)])),
|
|
30
|
+
qosLevel: 1,
|
|
31
|
+
})
|
|
32
|
+
.then(res => {
|
|
33
|
+
// updating the keepAlive to match the shared value
|
|
34
|
+
if ((0, shared_1.notUndefined)(state.keepAliveTimeout)) {
|
|
35
|
+
this.client.keepAlive = state.keepAliveTimeout;
|
|
36
|
+
}
|
|
37
|
+
return res;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
async sendCommand({ action, data, threadId, clientContext, }) {
|
|
41
|
+
if (clientContext) {
|
|
42
|
+
data.client_context = clientContext;
|
|
43
|
+
}
|
|
44
|
+
const json = JSON.stringify({
|
|
45
|
+
action,
|
|
46
|
+
thread_id: threadId,
|
|
47
|
+
...data,
|
|
48
|
+
});
|
|
49
|
+
return this.client.publish({
|
|
50
|
+
topic: constants_1.Topics.SEND_MESSAGE.id,
|
|
51
|
+
qosLevel: 1,
|
|
52
|
+
payload: await (0, shared_1.compressDeflate)(json),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
async sendItem({ threadId, itemType, data, clientContext }) {
|
|
56
|
+
return this.sendCommand({
|
|
57
|
+
action: 'send_item',
|
|
58
|
+
threadId,
|
|
59
|
+
clientContext: clientContext || this.chance.guid({ version: 4 }),
|
|
60
|
+
data: {
|
|
61
|
+
item_type: itemType,
|
|
62
|
+
...data,
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
async sendHashtag({ text, threadId, hashtag, clientContext, }) {
|
|
67
|
+
return this.sendItem({
|
|
68
|
+
itemType: 'hashtag',
|
|
69
|
+
threadId,
|
|
70
|
+
clientContext,
|
|
71
|
+
data: {
|
|
72
|
+
text: text || '',
|
|
73
|
+
hashtag,
|
|
74
|
+
item_id: hashtag,
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
async sendLike({ threadId, clientContext }) {
|
|
79
|
+
return this.sendItem({
|
|
80
|
+
itemType: 'like',
|
|
81
|
+
threadId,
|
|
82
|
+
clientContext,
|
|
83
|
+
data: {},
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
async sendLocation({ text, locationId, threadId, clientContext, }) {
|
|
87
|
+
return this.sendItem({
|
|
88
|
+
itemType: 'location',
|
|
89
|
+
threadId,
|
|
90
|
+
clientContext,
|
|
91
|
+
data: {
|
|
92
|
+
text: text || '',
|
|
93
|
+
venue_id: locationId,
|
|
94
|
+
item_id: locationId,
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
async sendMedia({ text, mediaId, threadId, clientContext, }) {
|
|
99
|
+
return this.sendItem({
|
|
100
|
+
itemType: 'media_share',
|
|
101
|
+
threadId,
|
|
102
|
+
clientContext,
|
|
103
|
+
data: {
|
|
104
|
+
text: text || '',
|
|
105
|
+
media_id: mediaId,
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
async sendProfile({ text, userId, threadId, clientContext, }) {
|
|
110
|
+
return this.sendItem({
|
|
111
|
+
itemType: 'profile',
|
|
112
|
+
threadId,
|
|
113
|
+
clientContext,
|
|
114
|
+
data: {
|
|
115
|
+
text: text || '',
|
|
116
|
+
profile_user_id: userId,
|
|
117
|
+
item_id: userId,
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
async sendReaction({ itemId, reactionType, clientContext, threadId, reactionStatus, targetItemType, emoji, }) {
|
|
122
|
+
return this.sendItem({
|
|
123
|
+
itemType: 'reaction',
|
|
124
|
+
threadId,
|
|
125
|
+
clientContext,
|
|
126
|
+
data: {
|
|
127
|
+
item_id: itemId,
|
|
128
|
+
node_type: 'item',
|
|
129
|
+
reaction_type: reactionType || 'like',
|
|
130
|
+
reaction_status: reactionStatus || 'created',
|
|
131
|
+
target_item_type: targetItemType,
|
|
132
|
+
emoji: emoji || '',
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
async sendUserStory({ text, storyId, threadId, clientContext, }) {
|
|
137
|
+
return this.sendItem({
|
|
138
|
+
itemType: 'reel_share',
|
|
139
|
+
threadId,
|
|
140
|
+
clientContext,
|
|
141
|
+
data: {
|
|
142
|
+
text: text || '',
|
|
143
|
+
item_id: storyId,
|
|
144
|
+
media_id: storyId,
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
async sendText({ text, clientContext, threadId }) {
|
|
149
|
+
return this.sendItem({
|
|
150
|
+
itemType: 'text',
|
|
151
|
+
threadId,
|
|
152
|
+
clientContext,
|
|
153
|
+
data: {
|
|
154
|
+
text,
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
async sendTextViaRealtime(threadId, text, clientContext) {
|
|
159
|
+
return this.sendText({
|
|
160
|
+
text,
|
|
161
|
+
threadId,
|
|
162
|
+
clientContext,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
async markAsSeen({ threadId, itemId }) {
|
|
166
|
+
return this.sendCommand({
|
|
167
|
+
action: 'mark_seen',
|
|
168
|
+
threadId,
|
|
169
|
+
data: {
|
|
170
|
+
item_id: itemId,
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
async indicateActivity({ threadId, isActive, clientContext }) {
|
|
175
|
+
return this.sendCommand({
|
|
176
|
+
action: 'indicate_activity',
|
|
177
|
+
threadId,
|
|
178
|
+
clientContext: clientContext || this.chance.guid({ version: 4 }),
|
|
179
|
+
data: {
|
|
180
|
+
activity_status: (typeof isActive === 'undefined' ? true : isActive) ? '1' : '0',
|
|
181
|
+
},
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
async sendLink({ link, text, threadId, clientContext }) {
|
|
185
|
+
return this.sendItem({
|
|
186
|
+
itemType: 'link',
|
|
187
|
+
threadId,
|
|
188
|
+
clientContext,
|
|
189
|
+
data: {
|
|
190
|
+
link_text: text || '',
|
|
191
|
+
link_urls: JSON.stringify([link]),
|
|
192
|
+
},
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
async sendAnimatedMedia({ id, isSticker, threadId, clientContext }) {
|
|
196
|
+
return this.sendItem({
|
|
197
|
+
itemType: 'animated_media',
|
|
198
|
+
threadId,
|
|
199
|
+
clientContext,
|
|
200
|
+
data: {
|
|
201
|
+
id: id,
|
|
202
|
+
is_sticker: isSticker || false,
|
|
203
|
+
},
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
async sendVoice({ uploadId, waveform, waveformSamplingFrequencyHz, threadId, clientContext }) {
|
|
207
|
+
return this.sendItem({
|
|
208
|
+
itemType: 'voice_media',
|
|
209
|
+
threadId,
|
|
210
|
+
clientContext,
|
|
211
|
+
data: {
|
|
212
|
+
upload_id: uploadId,
|
|
213
|
+
waveform: waveform,
|
|
214
|
+
waveform_sampling_frequency_hz: waveformSamplingFrequencyHz || 10,
|
|
215
|
+
},
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
async removeReaction({ itemId, threadId, clientContext }) {
|
|
219
|
+
return this.sendItem({
|
|
220
|
+
itemType: 'reaction',
|
|
221
|
+
threadId,
|
|
222
|
+
clientContext,
|
|
223
|
+
data: {
|
|
224
|
+
item_id: itemId,
|
|
225
|
+
node_type: 'item',
|
|
226
|
+
reaction_type: 'like',
|
|
227
|
+
reaction_status: 'deleted',
|
|
228
|
+
},
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
async deleteMessage(threadId, itemId) {
|
|
232
|
+
return this.sendCommand({
|
|
233
|
+
action: 'delete_item',
|
|
234
|
+
threadId,
|
|
235
|
+
clientContext: this.chance.guid({ version: 4 }),
|
|
236
|
+
data: {
|
|
237
|
+
item_id: itemId,
|
|
238
|
+
},
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
async editMessage(threadId, itemId, newText) {
|
|
242
|
+
return this.sendCommand({
|
|
243
|
+
action: 'edit_item',
|
|
244
|
+
threadId,
|
|
245
|
+
clientContext: this.chance.guid({ version: 4 }),
|
|
246
|
+
data: {
|
|
247
|
+
item_id: itemId,
|
|
248
|
+
text: newText,
|
|
249
|
+
},
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
async replyToMessage(threadId, messageId, replyText) {
|
|
253
|
+
return this.sendItem({
|
|
254
|
+
itemType: 'text',
|
|
255
|
+
threadId,
|
|
256
|
+
clientContext: this.chance.guid({ version: 4 }),
|
|
257
|
+
data: {
|
|
258
|
+
text: replyText,
|
|
259
|
+
replied_to_item_id: messageId,
|
|
260
|
+
},
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
async addMemberToThread(threadId, userId) {
|
|
264
|
+
return this.sendCommand({
|
|
265
|
+
action: 'add_users',
|
|
266
|
+
threadId,
|
|
267
|
+
clientContext: this.chance.guid({ version: 4 }),
|
|
268
|
+
data: {
|
|
269
|
+
user_ids: Array.isArray(userId) ? userId : [userId],
|
|
270
|
+
},
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
async removeMemberFromThread(threadId, userId) {
|
|
274
|
+
return this.sendCommand({
|
|
275
|
+
action: 'remove_users',
|
|
276
|
+
threadId,
|
|
277
|
+
clientContext: this.chance.guid({ version: 4 }),
|
|
278
|
+
data: {
|
|
279
|
+
user_ids: Array.isArray(userId) ? userId : [userId],
|
|
280
|
+
},
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
async leaveThread(threadId) {
|
|
284
|
+
return this.sendCommand({
|
|
285
|
+
action: 'leave',
|
|
286
|
+
threadId,
|
|
287
|
+
clientContext: this.chance.guid({ version: 4 }),
|
|
288
|
+
data: {},
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
async muteThread(threadId, muteUntil = null) {
|
|
292
|
+
return this.sendCommand({
|
|
293
|
+
action: 'mute',
|
|
294
|
+
threadId,
|
|
295
|
+
clientContext: this.chance.guid({ version: 4 }),
|
|
296
|
+
data: {
|
|
297
|
+
mute_until: muteUntil,
|
|
298
|
+
},
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
async unmuteThread(threadId) {
|
|
302
|
+
return this.sendCommand({
|
|
303
|
+
action: 'unmute',
|
|
304
|
+
threadId,
|
|
305
|
+
clientContext: this.chance.guid({ version: 4 }),
|
|
306
|
+
data: {},
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
async updateThreadTitle(threadId, title) {
|
|
310
|
+
return this.sendCommand({
|
|
311
|
+
action: 'update_title',
|
|
312
|
+
threadId,
|
|
313
|
+
clientContext: this.chance.guid({ version: 4 }),
|
|
314
|
+
data: {
|
|
315
|
+
title: title,
|
|
316
|
+
},
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
async approveThread(threadId) {
|
|
320
|
+
return this.sendCommand({
|
|
321
|
+
action: 'approve',
|
|
322
|
+
threadId,
|
|
323
|
+
clientContext: this.chance.guid({ version: 4 }),
|
|
324
|
+
data: {},
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
async declineThread(threadId) {
|
|
328
|
+
return this.sendCommand({
|
|
329
|
+
action: 'decline',
|
|
330
|
+
threadId,
|
|
331
|
+
clientContext: this.chance.guid({ version: 4 }),
|
|
332
|
+
data: {},
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
async blockUserInThread(threadId, userId) {
|
|
336
|
+
return this.sendCommand({
|
|
337
|
+
action: 'block',
|
|
338
|
+
threadId,
|
|
339
|
+
clientContext: this.chance.guid({ version: 4 }),
|
|
340
|
+
data: {
|
|
341
|
+
user_id: userId,
|
|
342
|
+
},
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
async reportThread(threadId, reason) {
|
|
346
|
+
return this.sendCommand({
|
|
347
|
+
action: 'report',
|
|
348
|
+
threadId,
|
|
349
|
+
clientContext: this.chance.guid({ version: 4 }),
|
|
350
|
+
data: {
|
|
351
|
+
reason: reason || 'spam',
|
|
352
|
+
},
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
async sendDisappearingPhoto({ uploadId, threadId, viewMode = 'once', clientContext }) {
|
|
356
|
+
return this.sendItem({
|
|
357
|
+
itemType: 'raven_media',
|
|
358
|
+
threadId,
|
|
359
|
+
clientContext,
|
|
360
|
+
data: {
|
|
361
|
+
upload_id: uploadId,
|
|
362
|
+
view_mode: viewMode,
|
|
363
|
+
allow_replay: viewMode === 'replayable',
|
|
364
|
+
send_attribution: 'direct_composer',
|
|
365
|
+
playback_duration_secs: 5,
|
|
366
|
+
},
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
async sendDisappearingVideo({ uploadId, threadId, viewMode = 'once', clientContext }) {
|
|
370
|
+
return this.sendItem({
|
|
371
|
+
itemType: 'raven_media',
|
|
372
|
+
threadId,
|
|
373
|
+
clientContext,
|
|
374
|
+
data: {
|
|
375
|
+
upload_id: uploadId,
|
|
376
|
+
view_mode: viewMode,
|
|
377
|
+
allow_replay: viewMode === 'replayable',
|
|
378
|
+
media_type: 2,
|
|
379
|
+
send_attribution: 'direct_composer',
|
|
380
|
+
playback_duration_secs: 5,
|
|
381
|
+
},
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
async markVisualMessageSeen({ threadId, itemId, clientContext }) {
|
|
385
|
+
return this.sendCommand({
|
|
386
|
+
action: 'mark_visual_item_seen',
|
|
387
|
+
threadId,
|
|
388
|
+
clientContext: clientContext || this.chance.guid({ version: 4 }),
|
|
389
|
+
data: {
|
|
390
|
+
item_id: itemId,
|
|
391
|
+
},
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
async sendScreenshotNotification({ threadId, itemId, clientContext }) {
|
|
395
|
+
return this.sendCommand({
|
|
396
|
+
action: 'screenshot_notification',
|
|
397
|
+
threadId,
|
|
398
|
+
clientContext: clientContext || this.chance.guid({ version: 4 }),
|
|
399
|
+
data: {
|
|
400
|
+
item_id: itemId,
|
|
401
|
+
},
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
async sendReplayNotification({ threadId, itemId, clientContext }) {
|
|
405
|
+
return this.sendCommand({
|
|
406
|
+
action: 'replay_notification',
|
|
407
|
+
threadId,
|
|
408
|
+
clientContext: clientContext || this.chance.guid({ version: 4 }),
|
|
409
|
+
data: {
|
|
410
|
+
item_id: itemId,
|
|
411
|
+
},
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
exports.DirectCommands = DirectCommands;
|