MCPcopy
hub / github.com/Mathieu2301/TradingView-API / removeUser

Method removeUser

src/classes/PinePermManager.js:138–156  ·  view source on GitHub ↗

* Removes an user to the authorized list * @param {string} username User's username * @returns {Promise<'ok' | null>}

(username)

Source from the content-addressed store, hash-verified

136 * @returns {Promise<'ok' | null>}
137 */
138 async removeUser(username) {
139 try {
140 const { data } = await axios.post(
141 'https://www.tradingview.com/pine_perm/remove/',
142 `pine_id=${this.pineId.replace(/;/g, '%3B')}&username_recip=${username}`,
143 {
144 headers: {
145 origin: 'https://www.tradingview.com',
146 'Content-Type': 'application/x-www-form-urlencoded',
147 cookie: genAuthCookies(this.sessionId, this.signature),
148 },
149 },
150 );
151
152 return data.status;
153 } catch (e) {
154 throw new Error(e.response.data.detail || 'Wrong credentials or pineId');
155 }
156 }
157}
158
159module.exports = PinePermManager;

Callers 1

PinePermManage.jsFile · 0.80

Calls 1

genAuthCookiesFunction · 0.85

Tested by

no test coverage detected