misskey-dev / misskey.js Goto Github PK
View Code? Open in Web Editor NEWMisskey SDK for JavaScript
License: MIT License
Misskey SDK for JavaScript
License: MIT License
メインストリームに存在するはずのregistryUpdatedが定義されていないため、型エラーが発生する。
ブラウザにしかないAPI(e.g. fetch)などを良い感じにやる必要がある
please submit npm
FetchLike型としてより多くの実装を受け入れられるようにする
ない
単に Connection だとWebSocketのコネクションと紛らわしい
my code
import * as Misskey from 'misskey-js';
var TOKEN = "redacted";
var client = new Misskey.api.APIClient({
origin: "https://misskey.io",
credential: TOKEN
});
var stream = new Misskey.Stream("https://misskey.io", {token: TOKEN});
var channel = stream.useChannel("homeTimeline");
channel.on("note", note => {
console.log("note");
});
error
me@g:~/Desktop/c30-translate$ node index.mjs
/home/me/Desktop/c30-translate/node_modules/reconnecting-websocket/dist/reconnecting-websocket-cjs.js:508
throw Error('No valid WebSocket class provided');
^
Error: No valid WebSocket class provided
at ReconnectingWebSocket._connect (/home/me/Desktop/c30-translate/node_modules/reconnecting-websocket/dist/reconnecting-websocket-cjs.js:508:19)
at new ReconnectingWebSocket (/home/me/Desktop/c30-translate/node_modules/reconnecting-websocket/dist/reconnecting-websocket-cjs.js:205:14)
at new Stream (/home/me/Desktop/c30-translate/node_modules/misskey-js/built/streaming.js:39:23)
at file:///home/me/Desktop/c30-translate/index.mjs:11:14
at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
at async loadESM (node:internal/process/esm_loader:91:5)
at async handleMainPromise (node:internal/modules/run_main:65:12)
Node.js v18.12.1
表現としてはtoStringで十分な気がする
利用環境に依っては、インスタンスはプロキシを通されたりするため、比較がfalseになることがある。
インスタンスにIDを設定しておき、それで比較するようにしたい
Node.jsではAPIClientやStreamにfetch、WebSocketのオプションを与えないと動作しないため、その旨を書く。
Since the last release of misskey.js the pollEnded
notification type has been added. Because the Misskey client depends on the notification types defined here, users are currently not able to modify preferences regarding notifications about ended polls.
entities.DriveFileがfolderIdを持っていないので型エラーになる
こっちを使ってみるのもあり
https://www.npmjs.com/package/jest-fetch-mock
misskey-dev/misskey#7854 と同じやつ
Line 4 in 043ffe3
It should be documented whether Acct.toString
returns punycoded or Unicode domain name. Maybe there should even two functions for each variant?
Other places where domain names are processed should be checked too (e.g. occurences of host
).
driveチャンネルが定義されていないので型エラーになったり型推測が効かなかったりする
Connectionクラスが公開されていないので、useChannelの結果を格納する変数の型を定義できない
チャンネルに接続するときに利用可能なチャンネル名サジェストとかしたいし、そのチャンネルがどのようなイベントをemitするかも型付けしたい
"reacted" | "pollVoted" | "deleted"
しかない
Gallery系の型定義がTODO
になっていたため、追記します。
P.S.
当issueに自分をアサインしたいのですが権限上できません。
どなたか変更可能な方がいらっしゃいましたら、お手数ですがAssignees
を@ryohidaka に変更をお願いいたします。
entities.DriveFileがcommentを持っていないので型エラーになる
notifications/read は、 IDを受取る形から IDのリストを受取る形に変更された。
API: notifications/readは配列でも受け付けるように #7667 @tamaina
しかし、型定義がその変更を追従していない
misskeyレポに統合されましたので
内部的に使い回し可能なチャンネルをリストアップしておき、自動でいい感じ™️にやる
アプリケーションでVueを使うとは限らない
Lines 31 to 35 in de81437
UserLiteが返ってくることは無いと思う
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.