diff --git a/package-lock.json b/package-lock.json
index bbdb5944..c9fe1dea 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -21,7 +21,7 @@
"idb-keyval": "~6.2.1",
"just-debounce-it": "~3.2.0",
"lz-string": "~1.5.0",
- "masto": "~5.11.4",
+ "masto": "~6.3.1",
"mem": "~9.0.2",
"p-retry": "~6.1.0",
"p-throttle": "~5.1.0",
@@ -3133,18 +3133,6 @@
"node": ">=8"
}
},
- "node_modules/@mastojs/ponyfills": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/@mastojs/ponyfills/-/ponyfills-1.0.4.tgz",
- "integrity": "sha512-1NaIGmcU7OmyNzx0fk+cYeGTkdXlOJOSdetaC4pStVWsrhht2cdlYSAfe5NDW3FcUmcEm2vVceB9lcClN1RCxw==",
- "dependencies": {
- "@types/node": "^18.11.17",
- "@types/node-fetch": "^2.6.2",
- "abort-controller": "^3.0.0",
- "form-data": "^4.0.0",
- "node-fetch": "^2.6.7"
- }
- },
"node_modules/@nodelib/fs.scandir": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
@@ -3373,29 +3361,8 @@
"node_modules/@types/node": {
"version": "18.11.17",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.17.tgz",
- "integrity": "sha512-HJSUJmni4BeDHhfzn6nF0sVmd1SMezP7/4F0Lq+aXzmp2xm9O7WXrUtHW/CHlYVtZUbByEvWidHqRtcJXGF2Ng=="
- },
- "node_modules/@types/node-fetch": {
- "version": "2.6.2",
- "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.2.tgz",
- "integrity": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==",
- "dependencies": {
- "@types/node": "*",
- "form-data": "^3.0.0"
- }
- },
- "node_modules/@types/node-fetch/node_modules/form-data": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz",
- "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==",
- "dependencies": {
- "asynckit": "^0.4.0",
- "combined-stream": "^1.0.8",
- "mime-types": "^2.1.12"
- },
- "engines": {
- "node": ">= 6"
- }
+ "integrity": "sha512-HJSUJmni4BeDHhfzn6nF0sVmd1SMezP7/4F0Lq+aXzmp2xm9O7WXrUtHW/CHlYVtZUbByEvWidHqRtcJXGF2Ng==",
+ "dev": true
},
"node_modules/@types/resolve": {
"version": "1.17.1",
@@ -3510,17 +3477,6 @@
"optional": true,
"peer": true
},
- "node_modules/abort-controller": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
- "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
- "dependencies": {
- "event-target-shim": "^5.0.0"
- },
- "engines": {
- "node": ">=6.5"
- }
- },
"node_modules/acorn": {
"version": "8.8.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz",
@@ -3597,11 +3553,6 @@
"integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==",
"dev": true
},
- "node_modules/asynckit": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
- "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
- },
"node_modules/at-least-node": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
@@ -3790,6 +3741,7 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
"integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
+ "dev": true,
"dependencies": {
"function-bind": "^1.1.1",
"get-intrinsic": "^1.0.2"
@@ -3893,17 +3845,6 @@
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
"dev": true
},
- "node_modules/combined-stream": {
- "version": "1.0.8",
- "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
- "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
- "dependencies": {
- "delayed-stream": "~1.0.0"
- },
- "engines": {
- "node": ">= 0.8"
- }
- },
"node_modules/commander": {
"version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
@@ -4128,14 +4069,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/delayed-stream": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
- "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
- "engines": {
- "node": ">=0.4.0"
- }
- },
"node_modules/dot-case": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz",
@@ -4320,18 +4253,10 @@
"node": ">=0.10.0"
}
},
- "node_modules/event-target-shim": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
- "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==",
- "engines": {
- "node": ">=6"
- }
- },
- "node_modules/eventemitter3": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.0.tgz",
- "integrity": "sha512-riuVbElZZNXLeLEoprfNYoDSwTBRR44X3mnhdI1YcnENpWTCsTTVZ2zFuqQcpoyqPQIUXdiPEU0ECAq0KQRaHg=="
+ "node_modules/events-to-async": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/events-to-async/-/events-to-async-2.0.0.tgz",
+ "integrity": "sha512-NiZEr4g51nI4/lz/6NdwMqK/TLIctlnp9TQ3wCJjlRp47VgrthUZE4nrk2UhfZ8VzoQ/Xyth+G6MKioLCt0FVA=="
},
"node_modules/fast-blurhash": {
"version": "1.1.2",
@@ -4425,19 +4350,6 @@
"is-callable": "^1.1.3"
}
},
- "node_modules/form-data": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
- "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
- "dependencies": {
- "asynckit": "^0.4.0",
- "combined-stream": "^1.0.8",
- "mime-types": "^2.1.12"
- },
- "engines": {
- "node": ">= 6"
- }
- },
"node_modules/fraction.js": {
"version": "4.3.6",
"resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.6.tgz",
@@ -4489,7 +4401,8 @@
"node_modules/function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
- "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
+ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
+ "dev": true
},
"node_modules/function.prototype.name": {
"version": "1.1.5",
@@ -4531,6 +4444,7 @@
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz",
"integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==",
+ "dev": true,
"dependencies": {
"function-bind": "^1.1.1",
"has": "^1.0.3",
@@ -4641,6 +4555,7 @@
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
+ "dev": true,
"dependencies": {
"function-bind": "^1.1.1"
},
@@ -4682,6 +4597,7 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz",
"integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==",
+ "dev": true,
"engines": {
"node": ">= 0.4"
},
@@ -4693,6 +4609,7 @@
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
"integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
+ "dev": true,
"engines": {
"node": ">= 0.4"
},
@@ -5307,17 +5224,6 @@
"tslib": "^2.0.3"
}
},
- "node_modules/lru-cache": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
- "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
- "dependencies": {
- "yallist": "^4.0.0"
- },
- "engines": {
- "node": ">=10"
- }
- },
"node_modules/lz-string": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz",
@@ -5347,33 +5253,17 @@
}
},
"node_modules/masto": {
- "version": "5.11.4",
- "resolved": "https://registry.npmjs.org/masto/-/masto-5.11.4.tgz",
- "integrity": "sha512-sLF3SJTNZDAP57Y+8vAdd1KQTuWWxmGUrBF1R2GLPL6zij/1wXxV05+h8GZhnfg+696arkt+w6ZlKvEEfH1yvg==",
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/masto/-/masto-6.3.1.tgz",
+ "integrity": "sha512-Os3MlbGFNL6KHxlKldYY+d/1exO6oBjtF4vx8d6cmXRmeeeW3mKQeunTZz+yY5qWksPg2eVdk+FOhaEnOeclVw==",
"dependencies": {
- "@mastojs/ponyfills": "^1.0.4",
"change-case": "^4.1.2",
- "eventemitter3": "^5.0.0",
+ "events-to-async": "^2.0.0",
"isomorphic-ws": "^5.0.0",
- "qs": "^6.11.0",
- "semver": "^7.3.7",
+ "ts-custom-error": "^3.3.1",
"ws": "^8.13.0"
}
},
- "node_modules/masto/node_modules/semver": {
- "version": "7.3.8",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
- "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
- "dependencies": {
- "lru-cache": "^6.0.0"
- },
- "bin": {
- "semver": "bin/semver.js"
- },
- "engines": {
- "node": ">=10"
- }
- },
"node_modules/mem": {
"version": "9.0.2",
"resolved": "https://registry.npmjs.org/mem/-/mem-9.0.2.tgz",
@@ -5421,6 +5311,7 @@
"version": "1.52.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
+ "dev": true,
"engines": {
"node": ">= 0.6"
}
@@ -5429,6 +5320,7 @@
"version": "2.1.35",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+ "dev": true,
"dependencies": {
"mime-db": "1.52.0"
},
@@ -5492,44 +5384,6 @@
"tslib": "^2.0.3"
}
},
- "node_modules/node-fetch": {
- "version": "2.6.7",
- "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
- "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
- "dependencies": {
- "whatwg-url": "^5.0.0"
- },
- "engines": {
- "node": "4.x || >=6.0.0"
- },
- "peerDependencies": {
- "encoding": "^0.1.0"
- },
- "peerDependenciesMeta": {
- "encoding": {
- "optional": true
- }
- }
- },
- "node_modules/node-fetch/node_modules/tr46": {
- "version": "0.0.3",
- "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
- "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
- },
- "node_modules/node-fetch/node_modules/webidl-conversions": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
- "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
- },
- "node_modules/node-fetch/node_modules/whatwg-url": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
- "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
- "dependencies": {
- "tr46": "~0.0.3",
- "webidl-conversions": "^3.0.0"
- }
- },
"node_modules/node-releases": {
"version": "2.0.13",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz",
@@ -5557,6 +5411,7 @@
"version": "1.12.3",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz",
"integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==",
+ "dev": true,
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
@@ -6461,20 +6316,6 @@
"node": ">=6"
}
},
- "node_modules/qs": {
- "version": "6.11.0",
- "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
- "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
- "dependencies": {
- "side-channel": "^1.0.4"
- },
- "engines": {
- "node": ">=0.6"
- },
- "funding": {
- "url": "https://github.com/sponsors/ljharb"
- }
- },
"node_modules/queue-microtask": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
@@ -6860,6 +6701,7 @@
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
"integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
+ "dev": true,
"dependencies": {
"call-bind": "^1.0.0",
"get-intrinsic": "^1.0.2",
@@ -7137,6 +6979,14 @@
"punycode": "^2.1.0"
}
},
+ "node_modules/ts-custom-error": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/ts-custom-error/-/ts-custom-error-3.3.1.tgz",
+ "integrity": "sha512-5OX1tzOjxWEgsr/YEUWSuPrQ00deKLh6D7OTWcvNHm12/7QPyRh8SYpyWvA4IZv8H/+GQWQEh/kwo95Q9OVW1A==",
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
"node_modules/tslib": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz",
@@ -7991,11 +7841,6 @@
"optional": true
}
}
- },
- "node_modules/yallist": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
- "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
}
},
"dependencies": {
@@ -9806,18 +9651,6 @@
"resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.0.1.tgz",
"integrity": "sha512-uSvJdwQU5nK+Vdf6zxcWAY2A8r7uqe+gePwLWzJ+fsQehq18pc0I2hJKwypZ2aLM90+Er9u1xn4iLJPZ+xlL4g=="
},
- "@mastojs/ponyfills": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/@mastojs/ponyfills/-/ponyfills-1.0.4.tgz",
- "integrity": "sha512-1NaIGmcU7OmyNzx0fk+cYeGTkdXlOJOSdetaC4pStVWsrhht2cdlYSAfe5NDW3FcUmcEm2vVceB9lcClN1RCxw==",
- "requires": {
- "@types/node": "^18.11.17",
- "@types/node-fetch": "^2.6.2",
- "abort-controller": "^3.0.0",
- "form-data": "^4.0.0",
- "node-fetch": "^2.6.7"
- }
- },
"@nodelib/fs.scandir": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
@@ -9998,28 +9831,8 @@
"@types/node": {
"version": "18.11.17",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.17.tgz",
- "integrity": "sha512-HJSUJmni4BeDHhfzn6nF0sVmd1SMezP7/4F0Lq+aXzmp2xm9O7WXrUtHW/CHlYVtZUbByEvWidHqRtcJXGF2Ng=="
- },
- "@types/node-fetch": {
- "version": "2.6.2",
- "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.2.tgz",
- "integrity": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==",
- "requires": {
- "@types/node": "*",
- "form-data": "^3.0.0"
- },
- "dependencies": {
- "form-data": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz",
- "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==",
- "requires": {
- "asynckit": "^0.4.0",
- "combined-stream": "^1.0.8",
- "mime-types": "^2.1.12"
- }
- }
- }
+ "integrity": "sha512-HJSUJmni4BeDHhfzn6nF0sVmd1SMezP7/4F0Lq+aXzmp2xm9O7WXrUtHW/CHlYVtZUbByEvWidHqRtcJXGF2Ng==",
+ "dev": true
},
"@types/resolve": {
"version": "1.17.1",
@@ -10128,14 +9941,6 @@
"optional": true,
"peer": true
},
- "abort-controller": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
- "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
- "requires": {
- "event-target-shim": "^5.0.0"
- }
- },
"acorn": {
"version": "8.8.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz",
@@ -10190,11 +9995,6 @@
"integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==",
"dev": true
},
- "asynckit": {
- "version": "0.4.0",
- "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
- "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
- },
"at-least-node": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
@@ -10311,6 +10111,7 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
"integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
+ "dev": true,
"requires": {
"function-bind": "^1.1.1",
"get-intrinsic": "^1.0.2"
@@ -10391,14 +10192,6 @@
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
"dev": true
},
- "combined-stream": {
- "version": "1.0.8",
- "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
- "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
- "requires": {
- "delayed-stream": "~1.0.0"
- }
- },
"commander": {
"version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
@@ -10531,11 +10324,6 @@
"object-keys": "^1.1.1"
}
},
- "delayed-stream": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
- "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="
- },
"dot-case": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz",
@@ -10683,15 +10471,10 @@
"integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
"dev": true
},
- "event-target-shim": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
- "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ=="
- },
- "eventemitter3": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.0.tgz",
- "integrity": "sha512-riuVbElZZNXLeLEoprfNYoDSwTBRR44X3mnhdI1YcnENpWTCsTTVZ2zFuqQcpoyqPQIUXdiPEU0ECAq0KQRaHg=="
+ "events-to-async": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/events-to-async/-/events-to-async-2.0.0.tgz",
+ "integrity": "sha512-NiZEr4g51nI4/lz/6NdwMqK/TLIctlnp9TQ3wCJjlRp47VgrthUZE4nrk2UhfZ8VzoQ/Xyth+G6MKioLCt0FVA=="
},
"fast-blurhash": {
"version": "1.1.2",
@@ -10778,16 +10561,6 @@
"is-callable": "^1.1.3"
}
},
- "form-data": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
- "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
- "requires": {
- "asynckit": "^0.4.0",
- "combined-stream": "^1.0.8",
- "mime-types": "^2.1.12"
- }
- },
"fraction.js": {
"version": "4.3.6",
"resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.6.tgz",
@@ -10822,7 +10595,8 @@
"function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
- "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
+ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
+ "dev": true
},
"function.prototype.name": {
"version": "1.1.5",
@@ -10852,6 +10626,7 @@
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz",
"integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==",
+ "dev": true,
"requires": {
"function-bind": "^1.1.1",
"has": "^1.0.3",
@@ -10932,6 +10707,7 @@
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
+ "dev": true,
"requires": {
"function-bind": "^1.1.1"
}
@@ -10960,12 +10736,14 @@
"has-proto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz",
- "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg=="
+ "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==",
+ "dev": true
},
"has-symbols": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
- "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A=="
+ "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
+ "dev": true
},
"has-tostringtag": {
"version": "1.0.0",
@@ -11409,14 +11187,6 @@
"tslib": "^2.0.3"
}
},
- "lru-cache": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
- "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
- "requires": {
- "yallist": "^4.0.0"
- }
- },
"lz-string": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz",
@@ -11440,27 +11210,15 @@
}
},
"masto": {
- "version": "5.11.4",
- "resolved": "https://registry.npmjs.org/masto/-/masto-5.11.4.tgz",
- "integrity": "sha512-sLF3SJTNZDAP57Y+8vAdd1KQTuWWxmGUrBF1R2GLPL6zij/1wXxV05+h8GZhnfg+696arkt+w6ZlKvEEfH1yvg==",
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/masto/-/masto-6.3.1.tgz",
+ "integrity": "sha512-Os3MlbGFNL6KHxlKldYY+d/1exO6oBjtF4vx8d6cmXRmeeeW3mKQeunTZz+yY5qWksPg2eVdk+FOhaEnOeclVw==",
"requires": {
- "@mastojs/ponyfills": "^1.0.4",
"change-case": "^4.1.2",
- "eventemitter3": "^5.0.0",
+ "events-to-async": "^2.0.0",
"isomorphic-ws": "^5.0.0",
- "qs": "^6.11.0",
- "semver": "^7.3.7",
+ "ts-custom-error": "^3.3.1",
"ws": "^8.13.0"
- },
- "dependencies": {
- "semver": {
- "version": "7.3.8",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
- "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
- "requires": {
- "lru-cache": "^6.0.0"
- }
- }
}
},
"mem": {
@@ -11497,12 +11255,14 @@
"mime-db": {
"version": "1.52.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
- "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="
+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
+ "dev": true
},
"mime-types": {
"version": "2.1.35",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+ "dev": true,
"requires": {
"mime-db": "1.52.0"
}
@@ -11542,35 +11302,6 @@
"tslib": "^2.0.3"
}
},
- "node-fetch": {
- "version": "2.6.7",
- "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
- "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
- "requires": {
- "whatwg-url": "^5.0.0"
- },
- "dependencies": {
- "tr46": {
- "version": "0.0.3",
- "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
- "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
- },
- "webidl-conversions": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
- "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
- },
- "whatwg-url": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
- "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
- "requires": {
- "tr46": "~0.0.3",
- "webidl-conversions": "^3.0.0"
- }
- }
- }
- },
"node-releases": {
"version": "2.0.13",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz",
@@ -11591,7 +11322,8 @@
"object-inspect": {
"version": "1.12.3",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz",
- "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g=="
+ "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==",
+ "dev": true
},
"object-keys": {
"version": "1.1.1",
@@ -12059,14 +11791,6 @@
"integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==",
"dev": true
},
- "qs": {
- "version": "6.11.0",
- "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
- "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
- "requires": {
- "side-channel": "^1.0.4"
- }
- },
"queue-microtask": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
@@ -12322,6 +12046,7 @@
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
"integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
+ "dev": true,
"requires": {
"call-bind": "^1.0.0",
"get-intrinsic": "^1.0.2",
@@ -12527,6 +12252,11 @@
"punycode": "^2.1.0"
}
},
+ "ts-custom-error": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/ts-custom-error/-/ts-custom-error-3.3.1.tgz",
+ "integrity": "sha512-5OX1tzOjxWEgsr/YEUWSuPrQ00deKLh6D7OTWcvNHm12/7QPyRh8SYpyWvA4IZv8H/+GQWQEh/kwo95Q9OVW1A=="
+ },
"tslib": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz",
@@ -13153,11 +12883,6 @@
"resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz",
"integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==",
"requires": {}
- },
- "yallist": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
- "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
}
}
}
diff --git a/package.json b/package.json
index 971f628e..1bc07d4d 100644
--- a/package.json
+++ b/package.json
@@ -23,7 +23,7 @@
"idb-keyval": "~6.2.1",
"just-debounce-it": "~3.2.0",
"lz-string": "~1.5.0",
- "masto": "~5.11.4",
+ "masto": "~6.3.1",
"mem": "~9.0.2",
"p-retry": "~6.1.0",
"p-throttle": "~5.1.0",
diff --git a/src/app.jsx b/src/app.jsx
index ea7c1cc1..8c087cec 100644
--- a/src/app.jsx
+++ b/src/app.jsx
@@ -114,13 +114,13 @@ function App() {
code,
});
- const masto = initClient({ instance: instanceURL, accessToken });
+ const client = initClient({ instance: instanceURL, accessToken });
await Promise.allSettled([
- initInstance(masto, instanceURL),
- initAccount(masto, instanceURL, accessToken, vapidKey),
+ initInstance(client, instanceURL),
+ initAccount(client, instanceURL, accessToken, vapidKey),
]);
initStates();
- initPreferences(masto);
+ initPreferences(client);
setIsLoggedIn(true);
setUIState('default');
@@ -130,14 +130,15 @@ function App() {
const account = getCurrentAccount();
if (account) {
store.session.set('currentAccount', account.info.id);
- const { masto, instance } = api({ account });
- console.log('masto', masto);
+ const { client } = api({ account });
+ const { instance } = client;
+ // console.log('masto', masto);
initStates();
- initPreferences(masto);
+ initPreferences(client);
setUIState('loading');
(async () => {
try {
- await initInstance(masto, instance);
+ await initInstance(client, instance);
} catch (e) {
} finally {
setIsLoggedIn(true);
@@ -253,9 +254,9 @@ function App() {
)}
-
+ {isLoggedIn && }
-
+ {uiState !== 'loading' && }
>
);
diff --git a/src/components/account-info.jsx b/src/components/account-info.jsx
index bbe4e743..a49259d4 100644
--- a/src/components/account-info.jsx
+++ b/src/components/account-info.jsx
@@ -149,7 +149,7 @@ function AccountInfo({
const familiarFollowersCache = useRef([]);
async function fetchFollowers(firstLoad) {
if (firstLoad || !followersIterator.current) {
- followersIterator.current = masto.v1.accounts.listFollowers(id, {
+ followersIterator.current = masto.v1.accounts.$select(id).followers.list({
limit: LIMIT,
});
}
@@ -162,9 +162,9 @@ function AccountInfo({
// On first load, fetch familiar followers, merge to top of results' `value`
// Remove dups on every fetch
if (firstLoad) {
- const familiarFollowers = await masto.v1.accounts.fetchFamiliarFollowers(
- id,
- );
+ const familiarFollowers = await masto.v1.accounts
+ .familiarFollowers(id)
+ .fetch();
familiarFollowersCache.current = familiarFollowers[0].accounts;
newValue = [
...familiarFollowersCache.current,
@@ -193,7 +193,7 @@ function AccountInfo({
const followingIterator = useRef();
async function fetchFollowing(firstLoad) {
if (firstLoad || !followingIterator.current) {
- followingIterator.current = masto.v1.accounts.listFollowing(id, {
+ followingIterator.current = masto.v1.accounts.$select(id).following.list({
limit: LIMIT,
});
}
@@ -214,9 +214,12 @@ function AccountInfo({
(async () => {
try {
const fetchFamiliarFollowers =
- currentMasto.v1.accounts.fetchFamiliarFollowers(currentID);
+ currentMasto.v1.accounts.familiarFollowers.fetch({
+ id: [currentID],
+ });
const fetchStatuses = currentMasto.v1.accounts
- .listStatuses(currentID, {
+ .$select(currentID)
+ .statuses.list({
limit: 20,
})
.next();
@@ -712,7 +715,7 @@ function RelatedActions({
// Grab this account from my logged-in instance
const acctHasInstance = info.acct.includes('@');
try {
- const results = await currentMasto.v2.search({
+ const results = await currentMasto.v2.search.fetch({
q: acctHasInstance ? info.acct : `${info.username}@${instance}`,
type: 'accounts',
limit: 1,
@@ -742,9 +745,11 @@ function RelatedActions({
setRelationshipUIState('loading');
- const fetchRelationships = currentMasto.v1.accounts.fetchRelationships([
- currentID,
- ]);
+ const fetchRelationships = currentMasto.v1.accounts.relationships.fetch(
+ {
+ id: [currentID],
+ },
+ );
try {
const relationships = await fetchRelationships;
@@ -913,10 +918,9 @@ function RelatedActions({
setRelationshipUIState('loading');
(async () => {
try {
- const newRelationship =
- await currentMasto.v1.accounts.unmute(
- currentInfo?.id || id,
- );
+ const newRelationship = await currentMasto.v1.accounts
+ .$select(currentInfo?.id || id)
+ .unmute();
console.log('unmuting', newRelationship);
setRelationship(newRelationship);
setRelationshipUIState('default');
@@ -962,12 +966,11 @@ function RelatedActions({
(async () => {
try {
const newRelationship =
- await currentMasto.v1.accounts.mute(
- currentInfo?.id || id,
- {
+ await currentMasto.v1.accounts
+ .$select(currentInfo?.id || id)
+ .mute({
duration,
- },
- );
+ });
console.log('muting', newRelationship);
setRelationship(newRelationship);
setRelationshipUIState('default');
@@ -1008,19 +1011,17 @@ function RelatedActions({
(async () => {
try {
if (blocking) {
- const newRelationship =
- await currentMasto.v1.accounts.unblock(
- currentInfo?.id || id,
- );
+ const newRelationship = await currentMasto.v1.accounts
+ .$select(currentInfo?.id || id)
+ .unblock();
console.log('unblocking', newRelationship);
setRelationship(newRelationship);
setRelationshipUIState('default');
showToast(`Unblocked @${username}`);
} else {
- const newRelationship =
- await currentMasto.v1.accounts.block(
- currentInfo?.id || id,
- );
+ const newRelationship = await currentMasto.v1.accounts
+ .$select(currentInfo?.id || id)
+ .block();
console.log('blocking', newRelationship);
setRelationship(newRelationship);
setRelationshipUIState('default');
@@ -1089,14 +1090,14 @@ function RelatedActions({
// );
// if (yes) {
- newRelationship = await currentMasto.v1.accounts.unfollow(
- accountID.current,
- );
+ newRelationship = await currentMasto.v1.accounts
+ .$select(accountID.current)
+ .unfollow();
// }
} else {
- newRelationship = await currentMasto.v1.accounts.follow(
- accountID.current,
- );
+ newRelationship = await currentMasto.v1.accounts
+ .$select(accountID.current)
+ .follow();
}
if (newRelationship) setRelationship(newRelationship);
@@ -1241,9 +1242,9 @@ function AddRemoveListsSheet({ accountID, onClose }) {
(async () => {
try {
const lists = await masto.v1.lists.list();
- const listsContainingAccount = await masto.v1.accounts.listLists(
- accountID,
- );
+ const listsContainingAccount = await masto.v1.accounts
+ .$select(accountID)
+ .lists.list();
console.log({ lists, listsContainingAccount });
setLists(lists);
setListsContainingAccount(listsContainingAccount);
@@ -1285,13 +1286,17 @@ function AddRemoveListsSheet({ accountID, onClose }) {
(async () => {
try {
if (inList) {
- await masto.v1.lists.removeAccount(list.id, {
- accountIds: [accountID],
- });
+ await masto.v1.lists
+ .$select(list.id)
+ .accounts.remove({
+ accountIds: [accountID],
+ });
} else {
- await masto.v1.lists.addAccount(list.id, {
- accountIds: [accountID],
- });
+ await masto.v1.lists
+ .$select(list.id)
+ .accounts.create({
+ accountIds: [accountID],
+ });
}
// setUIState('default');
reload();
diff --git a/src/components/account-sheet.jsx b/src/components/account-sheet.jsx
index 9093dc90..6a0d74f9 100644
--- a/src/components/account-sheet.jsx
+++ b/src/components/account-sheet.jsx
@@ -46,7 +46,7 @@ function AccountSheet({ account, instance: propInstance, onClose }) {
});
return info;
} catch (e) {
- const result = await masto.v2.search({
+ const result = await masto.v2.search.fetch({
q: account,
type: 'accounts',
limit: 1,
@@ -57,7 +57,7 @@ function AccountSheet({ account, instance: propInstance, onClose }) {
} else if (/https?:\/\/[^/]+\/@/.test(account)) {
const accountURL = new URL(account);
const acct = accountURL.pathname.replace(/^\//, '');
- const result = await masto.v2.search({
+ const result = await masto.v2.search.fetch({
q: acct,
type: 'accounts',
limit: 1,
diff --git a/src/components/background-service.jsx b/src/components/background-service.jsx
index 52a514a3..8061b97b 100644
--- a/src/components/background-service.jsx
+++ b/src/components/background-service.jsx
@@ -11,10 +11,10 @@ export default memo(function BackgroundService({ isLoggedIn }) {
// - WebSocket to receive notifications when page is visible
const [visible, setVisible] = useState(true);
usePageVisibility(setVisible);
- const notificationStream = useRef();
useEffect(() => {
+ let sub;
if (isLoggedIn && visible) {
- const { masto, instance } = api();
+ const { masto, streaming, instance } = api();
(async () => {
// 1. Get the latest notification
if (states.notificationsLast) {
@@ -42,34 +42,26 @@ export default memo(function BackgroundService({ isLoggedIn }) {
}
// 2. Start streaming
- notificationStream.current = await masto.ws.stream(
- '/api/v1/streaming',
- {
- stream: 'user:notification',
- },
- );
- console.log('🎏 Streaming notification', notificationStream.current);
-
- notificationStream.current.on('notification', (notification) => {
- console.log('🔔🔔 Notification', notification);
- if (notification.status) {
- saveStatus(notification.status, instance, {
- skipThreading: true,
- });
+ if (streaming) {
+ sub = streaming.user.notification.subscribe();
+ console.log('🎏 Streaming notification', sub);
+ for await (const entry of sub) {
+ if (!sub) break;
+ console.log('🔔🔔 Notification entry', entry);
+ if (entry.event === 'notification') {
+ console.log('🔔🔔 Notification', entry);
+ saveStatus(entry.payload, instance, {
+ skipThreading: true,
+ });
+ }
+ states.notificationsShowNew = true;
}
- states.notificationsShowNew = true;
- });
-
- notificationStream.current.ws.onclose = () => {
- console.log('🔔🔔 Notification stream closed');
- };
+ }
})();
}
return () => {
- if (notificationStream.current) {
- notificationStream.current.ws.close();
- notificationStream.current = null;
- }
+ sub?.unsubscribe?.();
+ sub = null;
};
}, [visible, isLoggedIn]);
diff --git a/src/components/compose.jsx b/src/components/compose.jsx
index 2ab29f3e..570f1395 100644
--- a/src/components/compose.jsx
+++ b/src/components/compose.jsx
@@ -197,9 +197,9 @@ function Compose({
setUIState('loading');
(async () => {
try {
- const statusSource = await masto.v1.statuses.fetchSource(
- editStatus.id,
- );
+ const statusSource = await masto.v1.statuses
+ .$select(editStatus.id)
+ .source.fetch();
console.log({ statusSource });
const { text, spoilerText } = statusSource;
textareaRef.current.value = text;
@@ -749,14 +749,12 @@ function Compose({
file,
description,
});
- return masto.v2.mediaAttachments
- .create(params)
- .then((res) => {
- if (res.id) {
- attachment.id = res.id;
- }
- return res;
- });
+ return masto.v2.media.create(params).then((res) => {
+ if (res.id) {
+ attachment.id = res.id;
+ }
+ return res;
+ });
}
});
const results = await Promise.allSettled(mediaPromises);
@@ -784,6 +782,8 @@ function Compose({
/* NOTE:
Using snakecase here because masto.js's `isObject` returns false for `params`, ONLY happens when opening in pop-out window. This is maybe due to `window.masto` variable being passed from the parent window. The check that failed is `x.constructor === Object`, so maybe the `Object` in new window is different than parent window's?
Code: https://github.com/neet/masto.js/blob/dd0d649067b6a2b6e60fbb0a96597c373a255b00/src/serializers/is-object.ts#L2
+
+ // TODO: Note above is no longer true in Masto.js v6. Revisit this.
*/
let params = {
status,
@@ -818,10 +818,9 @@ function Compose({
let newStatus;
if (editStatus) {
- newStatus = await masto.v1.statuses.update(
- editStatus.id,
- params,
- );
+ newStatus = await masto.v1.statuses
+ .$select(editStatus.id)
+ .update(params);
saveStatus(newStatus, instance, {
skipThreading: true,
});
@@ -935,13 +934,13 @@ function Compose({
performSearch={(params) => {
const { type, q, limit } = params;
if (type === 'accounts') {
- return masto.v1.accounts.search({
+ return masto.v1.accounts.search.list({
q,
limit,
resolve: false,
});
}
- return masto.v2.search(params);
+ return masto.v2.search.fetch(params);
}}
/>
{mediaAttachments?.length > 0 && (
diff --git a/src/components/drafts.jsx b/src/components/drafts.jsx
index be783f15..bf2d8c2a 100644
--- a/src/components/drafts.jsx
+++ b/src/components/drafts.jsx
@@ -128,9 +128,9 @@ function Drafts({ onClose }) {
if (replyTo) {
setUIState('loading');
try {
- replyToStatus = await masto.v1.statuses.fetch(
- replyTo.id,
- );
+ replyToStatus = await masto.v1.statuses
+ .$select(replyTo.id)
+ .fetch();
} catch (e) {
console.error(e);
alert('Error fetching reply-to status!');
diff --git a/src/components/follow-request-buttons.jsx b/src/components/follow-request-buttons.jsx
index d0fa6061..12068001 100644
--- a/src/components/follow-request-buttons.jsx
+++ b/src/components/follow-request-buttons.jsx
@@ -23,7 +23,9 @@ function FollowRequestButtons({ accountID, onChange }) {
setRequestState('accept');
(async () => {
try {
- const rel = await masto.v1.followRequests.authorize(accountID);
+ const rel = await masto.v1.followRequests
+ .$select(accountID)
+ .authorize();
if (!rel?.followedBy) {
throw new Error('Follow request not accepted');
}
@@ -47,7 +49,9 @@ function FollowRequestButtons({ accountID, onChange }) {
setRequestState('reject');
(async () => {
try {
- const rel = await masto.v1.followRequests.reject(accountID);
+ const rel = await masto.v1.followRequests
+ .$select(accountID)
+ .reject();
if (rel?.followedBy) {
throw new Error('Follow request not rejected');
}
diff --git a/src/components/list-add-edit.jsx b/src/components/list-add-edit.jsx
index d5a76338..3bf6ff03 100644
--- a/src/components/list-add-edit.jsx
+++ b/src/components/list-add-edit.jsx
@@ -56,7 +56,7 @@ function ListAddEdit({ list, onClose }) {
let listResult;
if (editMode) {
- listResult = await masto.v1.lists.update(list.id, {
+ listResult = await masto.v1.lists.$select(list.id).update({
title,
replies_policy: repliesPolicy,
exclusive,
@@ -141,7 +141,7 @@ function ListAddEdit({ list, onClose }) {
(async () => {
try {
- await masto.v1.lists.remove(list.id);
+ await masto.v1.lists.$select(list.id).remove();
setUIState('default');
onClose?.({
state: 'deleted',
diff --git a/src/components/notification-service.jsx b/src/components/notification-service.jsx
index c0ff73d4..29ec2a29 100644
--- a/src/components/notification-service.jsx
+++ b/src/components/notification-service.jsx
@@ -38,7 +38,7 @@ export default memo(function NotificationService() {
? getAccountByAccessToken(accessToken)
: getCurrentAccount();
(async () => {
- const notification = await masto.v1.notifications.fetch(id);
+ const notification = await masto.v1.notifications.$select(id).fetch();
if (notification && account) {
console.log('🛎️ Notification', { id, notification, account });
const accountInstance = account.instanceURL;
diff --git a/src/components/shortcuts-settings.jsx b/src/components/shortcuts-settings.jsx
index 55c8b399..cb6105ae 100644
--- a/src/components/shortcuts-settings.jsx
+++ b/src/components/shortcuts-settings.jsx
@@ -135,7 +135,7 @@ export const SHORTCUTS_META = {
id: 'list',
title: mem(
async ({ id }) => {
- const list = await api().masto.v1.lists.fetch(id);
+ const list = await api().masto.v1.lists.$select(id).fetch();
return list.title;
},
{
@@ -169,7 +169,7 @@ export const SHORTCUTS_META = {
id: 'account-statuses',
title: mem(
async ({ id }) => {
- const account = await api().masto.v1.accounts.fetch(id);
+ const account = await api().masto.v1.accounts.$select(id).fetch();
return account.username || account.acct || account.displayName;
},
{
diff --git a/src/components/status.jsx b/src/components/status.jsx
index 8477ef2e..12625b2f 100644
--- a/src/components/status.jsx
+++ b/src/components/status.jsx
@@ -68,7 +68,7 @@ const throttle = pThrottle({
function fetchAccount(id, masto) {
try {
- return masto.v1.accounts.fetch(id);
+ return masto.v1.accounts.$select(id).fetch();
} catch (e) {
return Promise.reject(e);
}
@@ -390,11 +390,11 @@ function Status({
reblogsCount: reblogsCount + (reblogged ? -1 : 1),
};
if (reblogged) {
- const newStatus = await masto.v1.statuses.unreblog(id);
+ const newStatus = await masto.v1.statuses.$select(id).unreblog();
saveStatus(newStatus, instance);
return true;
} else {
- const newStatus = await masto.v1.statuses.reblog(id);
+ const newStatus = await masto.v1.statuses.$select(id).reblog();
saveStatus(newStatus, instance);
return true;
}
@@ -418,11 +418,11 @@ function Status({
reblogsCount: reblogsCount + (reblogged ? -1 : 1),
};
if (reblogged) {
- const newStatus = await masto.v1.statuses.unreblog(id);
+ const newStatus = await masto.v1.statuses.$select(id).unreblog();
saveStatus(newStatus, instance);
return true;
} else {
- const newStatus = await masto.v1.statuses.reblog(id);
+ const newStatus = await masto.v1.statuses.$select(id).reblog();
saveStatus(newStatus, instance);
return true;
}
@@ -446,10 +446,10 @@ function Status({
favouritesCount: favouritesCount + (favourited ? -1 : 1),
};
if (favourited) {
- const newStatus = await masto.v1.statuses.unfavourite(id);
+ const newStatus = await masto.v1.statuses.$select(id).unfavourite();
saveStatus(newStatus, instance);
} else {
- const newStatus = await masto.v1.statuses.favourite(id);
+ const newStatus = await masto.v1.statuses.$select(id).favourite();
saveStatus(newStatus, instance);
}
} catch (e) {
@@ -470,10 +470,10 @@ function Status({
bookmarked: !bookmarked,
};
if (bookmarked) {
- const newStatus = await masto.v1.statuses.unbookmark(id);
+ const newStatus = await masto.v1.statuses.$select(id).unbookmark();
saveStatus(newStatus, instance);
} else {
- const newStatus = await masto.v1.statuses.bookmark(id);
+ const newStatus = await masto.v1.statuses.$select(id).bookmark();
saveStatus(newStatus, instance);
}
} catch (e) {
@@ -708,9 +708,9 @@ function Status({