UNPKG

instagram-private-api

Version:

Instagram private API wrapper for full access to instagram

35 lines 1.36 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const repository_1 = require("../core/repository"); class FriendshipRepository extends repository_1.Repository { async show(id) { const { body } = await this.client.request.send({ url: `/api/v1/friendships/show/${id}/`, }); return body; } async create(id, mediaIdAttribution) { return this.change('create', id, mediaIdAttribution); } async destroy(id, mediaIdAttribution) { return this.change('destroy', id, mediaIdAttribution); } async change(action, id, mediaIdAttribution) { const { body } = await this.client.request.send({ url: `/api/v1/friendships/${action}/${id}/`, method: 'POST', form: this.client.request.sign({ _csrftoken: this.client.state.cookieCsrfToken, user_id: id, radio_type: this.client.state.radioType, _uid: this.client.state.cookieUserId, device_id: this.client.state.deviceId, _uuid: this.client.state.uuid, media_id_attribution: mediaIdAttribution, }), }); return body.friendship_status; } } exports.FriendshipRepository = FriendshipRepository; //# sourceMappingURL=friendship.repository.js.map