a
This commit is contained in:
commit
f54efe0ed4
12
.editorconfig
Normal file
12
.editorconfig
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# EditorConfig is awesome: https://EditorConfig.org
|
||||||
|
|
||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
7
.gitattributes
vendored
Normal file
7
.gitattributes
vendored
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# See https://git-scm.com/docs/gitattributes for more about git attribute files.
|
||||||
|
|
||||||
|
# Mark the Yarn files as having been vendored.
|
||||||
|
.yarn/* linguist-vendored
|
||||||
|
|
||||||
|
# Mark the Yarn lockfile as having been generated.
|
||||||
|
yarn.lock linguist-generated
|
58
.gitignore
vendored
Normal file
58
.gitignore
vendored
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
|
||||||
|
#
|
||||||
|
# If you find yourself ignoring temporary files generated by your text editor
|
||||||
|
# or operating system, you probably want to add a global ignore instead:
|
||||||
|
# git config --global core.excludesfile '~/.gitignore_global'
|
||||||
|
|
||||||
|
/.config/*
|
||||||
|
!/.config/docker-example.env
|
||||||
|
!/.config/docker-example.yml
|
||||||
|
!/.config/example.yml
|
||||||
|
/.idea
|
||||||
|
/.vscode/*
|
||||||
|
!/.vscode/extensions.json
|
||||||
|
!/.vscode/settings.example.json
|
||||||
|
/.yarn/*
|
||||||
|
!/.yarn/patches
|
||||||
|
!/.yarn/plugins
|
||||||
|
!/.yarn/releases
|
||||||
|
!/.yarn/sdks
|
||||||
|
!/.yarn/versions
|
||||||
|
/build
|
||||||
|
/coverage
|
||||||
|
/cypress/screenshots
|
||||||
|
/cypress/videos
|
||||||
|
/data
|
||||||
|
/files
|
||||||
|
/meili
|
||||||
|
/packages/frontend/src/**/*.stories.ts
|
||||||
|
/redis
|
||||||
|
/various
|
||||||
|
*.bak
|
||||||
|
*.blend1
|
||||||
|
*.blend2
|
||||||
|
*.blend3
|
||||||
|
*.blend4
|
||||||
|
*.blend5
|
||||||
|
*.code-workspace
|
||||||
|
*.log
|
||||||
|
*.pem
|
||||||
|
.DS_Store
|
||||||
|
.favorites.json
|
||||||
|
.pnp.*
|
||||||
|
.pnpm-store
|
||||||
|
.yarn-integrity
|
||||||
|
api-docs.json
|
||||||
|
built
|
||||||
|
docker-compose.yml
|
||||||
|
node_modules
|
||||||
|
npm-debug.log*
|
||||||
|
ormconfig.json
|
||||||
|
report.*.json
|
||||||
|
run.bat
|
||||||
|
temp
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
|
||||||
|
# Unfortunately, this line has to be after the initial ignore
|
||||||
|
!/.devcontainer/docker-compose.yml
|
4
.vscode/settings.example.json
vendored
Normal file
4
.vscode/settings.example.json
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"typescript.preferences.importModuleSpecifier": "non-relative",
|
||||||
|
"typescript.preferences.importModuleSpecifierEnding": "minimal"
|
||||||
|
}
|
4
.vsls.json
Normal file
4
.vsls.json
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/vsls",
|
||||||
|
"gitignore": "exclude"
|
||||||
|
}
|
2
.yarnrc.yml
Normal file
2
.yarnrc.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
checksumBehavior: update
|
||||||
|
nodeLinker: pnpm
|
661
LICENSE
Normal file
661
LICENSE
Normal file
|
@ -0,0 +1,661 @@
|
||||||
|
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 19 November 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU Affero General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works, specifically designed to ensure
|
||||||
|
cooperation with the community in the case of network server software.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
our General Public Licenses are intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
Developers that use our General Public Licenses protect your rights
|
||||||
|
with two steps: (1) assert copyright on the software, and (2) offer
|
||||||
|
you this License which gives you legal permission to copy, distribute
|
||||||
|
and/or modify the software.
|
||||||
|
|
||||||
|
A secondary benefit of defending all users' freedom is that
|
||||||
|
improvements made in alternate versions of the program, if they
|
||||||
|
receive widespread use, become available for other developers to
|
||||||
|
incorporate. Many developers of free software are heartened and
|
||||||
|
encouraged by the resulting cooperation. However, in the case of
|
||||||
|
software used on network servers, this result may fail to come about.
|
||||||
|
The GNU General Public License permits making a modified version and
|
||||||
|
letting the public access it on a server without ever releasing its
|
||||||
|
source code to the public.
|
||||||
|
|
||||||
|
The GNU Affero General Public License is designed specifically to
|
||||||
|
ensure that, in such cases, the modified source code becomes available
|
||||||
|
to the community. It requires the operator of a network server to
|
||||||
|
provide the source code of the modified version running there to the
|
||||||
|
users of that server. Therefore, public use of a modified version, on
|
||||||
|
a publicly accessible server, gives the public access to the source
|
||||||
|
code of the modified version.
|
||||||
|
|
||||||
|
An older license, called the Affero General Public License and
|
||||||
|
published by Affero, was designed to accomplish similar goals. This is
|
||||||
|
a different license, not a version of the Affero GPL, but Affero has
|
||||||
|
released a new version of the Affero GPL which permits relicensing under
|
||||||
|
this license.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, if you modify the
|
||||||
|
Program, your modified version must prominently offer all users
|
||||||
|
interacting with it remotely through a computer network (if your version
|
||||||
|
supports such interaction) an opportunity to receive the Corresponding
|
||||||
|
Source of your version by providing access to the Corresponding Source
|
||||||
|
from a network server at no charge, through some standard or customary
|
||||||
|
means of facilitating copying of software. This Corresponding Source
|
||||||
|
shall include the Corresponding Source for any work covered by version 3
|
||||||
|
of the GNU General Public License that is incorporated pursuant to the
|
||||||
|
following paragraph.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the work with which it is combined will remain governed by version
|
||||||
|
3 of the GNU General Public License.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU Affero General Public License from time to time. Such new versions
|
||||||
|
will be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU Affero General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU Affero General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU Affero General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If your software can interact with users remotely through a computer
|
||||||
|
network, you should also make sure that it provides a way for users to
|
||||||
|
get its source. For example, if your program is a web application, its
|
||||||
|
interface could display a "Source" link that leads users to an archive
|
||||||
|
of the code. There are many ways you could offer source, and different
|
||||||
|
solutions will be better for different programs; see section 13 for the
|
||||||
|
specific requirements.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||||
|
<https://www.gnu.org/licenses/>.
|
0
cypress.config.ts
Normal file
0
cypress.config.ts
Normal file
25
cypress/e2e/basic.cy.ts
Normal file
25
cypress/e2e/basic.cy.ts
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
describe('Before setup instance', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.resetState()
|
||||||
|
})
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
cy.wait(1000)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('successfully loads', () => {
|
||||||
|
cy.visitHome()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('setup instance', () => {
|
||||||
|
cy.visitHome()
|
||||||
|
|
||||||
|
cy.intercept('POST', '/api/admin/accounts/create').as('signup')
|
||||||
|
|
||||||
|
cy.get('[data-cy-admin-username] input').type('admin')
|
||||||
|
cy.get('[data-cy-admin-password] input').type('admin1234')
|
||||||
|
cy.get('[data-cy-admin-ok]').click()
|
||||||
|
|
||||||
|
cy.wait('@signup')
|
||||||
|
})
|
||||||
|
})
|
35
cypress/support/commands.ts
Normal file
35
cypress/support/commands.ts
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
Cypress.Commands.add('login', (username, password) => {
|
||||||
|
cy.visitHome()
|
||||||
|
|
||||||
|
cy.intercept('POST', '/api/signin').as('signin')
|
||||||
|
|
||||||
|
cy.get('[data-cy-signin]').click()
|
||||||
|
cy.get('[data-cy-signin-username] input').type(username)
|
||||||
|
cy.get('[data-cy-signin-password] input').type(`${password}{enter}`)
|
||||||
|
|
||||||
|
cy.wait('@signin').as('signedIn')
|
||||||
|
})
|
||||||
|
|
||||||
|
Cypress.Commands.add('registerUser', (username, password, isAdmin = false) => {
|
||||||
|
const route = isAdmin ? '/api/admin/accounts/create' : '/api/signup'
|
||||||
|
|
||||||
|
cy.request('POST', route, {
|
||||||
|
password,
|
||||||
|
username
|
||||||
|
}).its('body').as(username)
|
||||||
|
})
|
||||||
|
|
||||||
|
Cypress.Commands.add('resetState', () => {
|
||||||
|
cy.window().then(win => {
|
||||||
|
win.indexedDB.deleteDatabase('keyval-store')
|
||||||
|
})
|
||||||
|
|
||||||
|
cy.request('POST', '/api/reset-db', {}).as('reset')
|
||||||
|
cy.get('@reset').its('status').should('equal', 204)
|
||||||
|
cy.reload(true)
|
||||||
|
})
|
||||||
|
|
||||||
|
Cypress.Commands.add('visitHome', () => {
|
||||||
|
cy.visit('/')
|
||||||
|
cy.get('button', { timeout: 30000 }).should('be.visible')
|
||||||
|
})
|
17
cypress/support/e2e.ts
Normal file
17
cypress/support/e2e.ts
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
import './commands'
|
||||||
|
|
||||||
|
Cypress.on('uncaught:exception', err => {
|
||||||
|
if (
|
||||||
|
[
|
||||||
|
'The source image cannot be decoded',
|
||||||
|
|
||||||
|
// Chrome
|
||||||
|
'ResizeObserver loop limit exceeded',
|
||||||
|
|
||||||
|
// Firefox
|
||||||
|
'ResizeObserver loop completed with undelivered notifications'
|
||||||
|
].some(msg => err.message.includes(msg))
|
||||||
|
) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
19
cypress/support/index.ts
Normal file
19
cypress/support/index.ts
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
declare global {
|
||||||
|
namespace Cypress {
|
||||||
|
interface Chainable {
|
||||||
|
login(username: string, password: string): Chainable<void>
|
||||||
|
|
||||||
|
registerUser(
|
||||||
|
username: string,
|
||||||
|
password: string,
|
||||||
|
isAdmin?: boolean
|
||||||
|
): Chainable<void>
|
||||||
|
|
||||||
|
resetState(): Chainable<void>
|
||||||
|
|
||||||
|
visitHome(): Chainable<void>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export {}
|
8
cypress/tsconfig.json
Normal file
8
cypress/tsconfig.json
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"lib": ["dom", "es5"],
|
||||||
|
"target": "es5",
|
||||||
|
"types": ["cypress", "node"]
|
||||||
|
},
|
||||||
|
"include": ["./**/*.ts"]
|
||||||
|
}
|
31
package.json
Normal file
31
package.json
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
"name": "@akkohq/akkordian",
|
||||||
|
"private": true,
|
||||||
|
"version": "0.1.0",
|
||||||
|
"packageManager": "yarn@4.0.2",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/akko-devel/akkordian.git"
|
||||||
|
},
|
||||||
|
"resolutions": {
|
||||||
|
"chokidar": "3.5.3",
|
||||||
|
"lodash": "4.17.21"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "^20.10.5",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
|
"cssnano": "^6.0.2",
|
||||||
|
"cypress": "^13.6.1",
|
||||||
|
"execa": "^8.0.1",
|
||||||
|
"js-yaml": "^4.1.0",
|
||||||
|
"ncp": "^2.0.0",
|
||||||
|
"postcss": "^8.4.32",
|
||||||
|
"terser": "^5.26.0",
|
||||||
|
"typescript": "^5.3.3"
|
||||||
|
},
|
||||||
|
"workspaces": [
|
||||||
|
"./packages/akkordian.js",
|
||||||
|
"./packages/api-generator",
|
||||||
|
"./packages/sw"
|
||||||
|
]
|
||||||
|
}
|
23
packages/akkordian.js/.swcrc
Normal file
23
packages/akkordian.js/.swcrc
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/swcrc.json",
|
||||||
|
"jsc": {
|
||||||
|
"baseUrl": "./src",
|
||||||
|
"experimental": {
|
||||||
|
"keepImportAssertions": true
|
||||||
|
},
|
||||||
|
"parser": {
|
||||||
|
"decorators": true,
|
||||||
|
"dynamicImport": true,
|
||||||
|
"syntax": "typescript"
|
||||||
|
},
|
||||||
|
"paths": {
|
||||||
|
"@/*": ["./src/*"]
|
||||||
|
},
|
||||||
|
"target": "es2022",
|
||||||
|
"transform": {
|
||||||
|
"decoratorMetadata": true,
|
||||||
|
"legacyDecorator": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"minify": false
|
||||||
|
}
|
5
packages/akkordian.js/.vscode/settings.json
vendored
Normal file
5
packages/akkordian.js/.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"path-intellisense.mappings": {
|
||||||
|
"@": "${workspaceRoot}/packages/akkordian.js/src/"
|
||||||
|
}
|
||||||
|
}
|
22
packages/akkordian.js/LICENSE
Normal file
22
packages/akkordian.js/LICENSE
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2021-2022 syuilo and other contributors
|
||||||
|
Copyright (c) 2023 Luna Nova
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
51
packages/akkordian.js/package.json
Normal file
51
packages/akkordian.js/package.json
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
{
|
||||||
|
"name": "akkordian.js",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"description": "The JavaScript SDK for Akkordian",
|
||||||
|
"repository": {
|
||||||
|
"directory": "packages/akkordian.js",
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/akko-devel/akkordian.git"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"./built",
|
||||||
|
"./LICENSE"
|
||||||
|
],
|
||||||
|
"main": "./built/index.js",
|
||||||
|
"types": "./built/index.d.ts",
|
||||||
|
"scripts": {
|
||||||
|
"api": "api-extractor run --local --verbose",
|
||||||
|
"api:prod": "api-extractor run --verbose",
|
||||||
|
"build": "tsc -p \"./tsconfig.json\" && tsc-alias -p \"./tsconfig.json\"",
|
||||||
|
"build:swc": "swc -d \"./built\" -D \"./src\"",
|
||||||
|
"lint": "eslint --ext \".js,.jsx,.ts,.tsx\" \"./src\" && yarn lint:types",
|
||||||
|
"lint:types": "tsc --noEmit",
|
||||||
|
"test": "jest --coverage --detectOpenHandles && tsd",
|
||||||
|
"update-autogen-code": "echo \"TODO\"",
|
||||||
|
"watch": "nodemon -e \"cjs,js,json,mjs,ts\" --exec \"yarn build\" -w \"./src\""
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"eventemitter3": "^5.0.1",
|
||||||
|
"reconnecting-websocket": "^4.4.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@microsoft/api-extractor": "^7.39.0",
|
||||||
|
"@swc/cli": "^0.1.63",
|
||||||
|
"@swc/core": "^1.3.101",
|
||||||
|
"@swc/jest": "^0.2.29",
|
||||||
|
"@types/jest": "^29.5.11",
|
||||||
|
"@types/node": "^20.10.5",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^6.15.0",
|
||||||
|
"@typescript-eslint/parser": "^6.15.0",
|
||||||
|
"eslint": "^8.56.0",
|
||||||
|
"jest": "^29.7.0",
|
||||||
|
"jest-fetch-mock": "^3.0.3",
|
||||||
|
"jest-websocket-mock": "^2.5.0",
|
||||||
|
"mock-socket": "^9.3.1",
|
||||||
|
"ncp": "^2.0.0",
|
||||||
|
"nodemon": "^3.0.2",
|
||||||
|
"tsc-alias": "^1.8.8",
|
||||||
|
"tsd": "^0.30.0",
|
||||||
|
"typescript": "^5.3.3"
|
||||||
|
}
|
||||||
|
}
|
16
packages/akkordian.js/src/acct.ts
Normal file
16
packages/akkordian.js/src/acct.ts
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
export type Acct = {
|
||||||
|
host: string | null
|
||||||
|
username: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export function parse(acct: string) {
|
||||||
|
if (acct.startsWith('@')) { acct = acct.substring(1) }
|
||||||
|
|
||||||
|
const split = acct.split('@', 2)
|
||||||
|
|
||||||
|
return { host: split[1] || null, username: split[0] } as Acct
|
||||||
|
}
|
||||||
|
|
||||||
|
export function toString(acct: Acct) {
|
||||||
|
return acct.host ? `${acct.username}@${acct.host}` : acct.username
|
||||||
|
}
|
83
packages/akkordian.js/src/api.ts
Normal file
83
packages/akkordian.js/src/api.ts
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
import '@/autogen/api-client-jsdoc'
|
||||||
|
|
||||||
|
import type { Endpoints, SwitchCaseResponseType } from '@/api.types'
|
||||||
|
|
||||||
|
export type ApiError = {
|
||||||
|
id: string
|
||||||
|
code: string
|
||||||
|
info: Record<string, any>
|
||||||
|
kind: 'client' | 'server'
|
||||||
|
message: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type FetchLike = (
|
||||||
|
input: string,
|
||||||
|
init?: {
|
||||||
|
body?: string
|
||||||
|
cache?: RequestCache
|
||||||
|
credentials?: RequestCredentials
|
||||||
|
headers?: Record<string, string>
|
||||||
|
method?: string
|
||||||
|
}
|
||||||
|
) => Promise<{
|
||||||
|
json(): Promise<any>
|
||||||
|
status: number
|
||||||
|
}>
|
||||||
|
|
||||||
|
export class ApiClient {
|
||||||
|
public credential: string | null | undefined
|
||||||
|
public fetch: FetchLike
|
||||||
|
public origin: string
|
||||||
|
|
||||||
|
constructor(opts: {
|
||||||
|
credential?: ApiClient['credential']
|
||||||
|
fetch?: ApiClient['fetch'] | null
|
||||||
|
origin: ApiClient['origin']
|
||||||
|
}) {
|
||||||
|
this.credential = opts.credential
|
||||||
|
this.fetch = opts.fetch ?? ((...args) => fetch(...args))
|
||||||
|
this.origin = opts.origin
|
||||||
|
}
|
||||||
|
|
||||||
|
public request<E extends keyof Endpoints, P extends Endpoints[E]['req']>(
|
||||||
|
endpoint: E,
|
||||||
|
params: P = {} as P,
|
||||||
|
credential?: string | null
|
||||||
|
) {
|
||||||
|
return new Promise<SwitchCaseResponseType<E, P>>((resolve, reject) => {
|
||||||
|
this.fetch(`${this.origin}/api/${endpoint}`, {
|
||||||
|
body: JSON.stringify({
|
||||||
|
...params,
|
||||||
|
i: credential !== undefined ? credential : this.credential
|
||||||
|
}),
|
||||||
|
cache: 'no-cache',
|
||||||
|
credentials: 'omit',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
method: 'POST'
|
||||||
|
})
|
||||||
|
.then(async (res) => {
|
||||||
|
const body = res.status === 204 ? null : await res.json()
|
||||||
|
|
||||||
|
if (res.status === 200 || res.status === 204) {
|
||||||
|
resolve(body)
|
||||||
|
} else {
|
||||||
|
reject({
|
||||||
|
[AKKO_API_ERROR]: true,
|
||||||
|
...body.error
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(reject)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const AKKO_API_ERROR = Symbol()
|
||||||
|
|
||||||
|
export function isApiError(reason: any): reason is ApiError {
|
||||||
|
return reason[AKKO_API_ERROR] === true
|
||||||
|
}
|
||||||
|
|
||||||
|
export type { SwitchCaseResponseType }
|
86
packages/akkordian.js/src/api.types.ts
Normal file
86
packages/akkordian.js/src/api.types.ts
Normal file
|
@ -0,0 +1,86 @@
|
||||||
|
import { Endpoints as Gen } from '@/autogen/endpoint'
|
||||||
|
import { UsersShowRequest } from '@/autogen/entities'
|
||||||
|
import { UserDetailed } from '@/autogen/models'
|
||||||
|
|
||||||
|
type GetCaseResult<
|
||||||
|
E extends keyof Endpoints,
|
||||||
|
P extends Endpoints[E]['req'],
|
||||||
|
C extends number
|
||||||
|
> = Endpoints[E]['res'] extends SwitchCase
|
||||||
|
? StrictExtract<Endpoints[E]['res']['$switch']['$cases'][C], [P, any]>[1]
|
||||||
|
: never
|
||||||
|
|
||||||
|
type IsCaseMatched<
|
||||||
|
E extends keyof Endpoints,
|
||||||
|
P extends Endpoints[E]['req'],
|
||||||
|
C extends number
|
||||||
|
> = Endpoints[E]['res'] extends SwitchCase
|
||||||
|
? IsNeverType<
|
||||||
|
StrictExtract<Endpoints[E]['res']['$switch']['$cases'][C], [P, any]>
|
||||||
|
> extends false
|
||||||
|
? true
|
||||||
|
: false
|
||||||
|
: false
|
||||||
|
|
||||||
|
type IsNeverType<T> = [T] extends [never] ? true : false
|
||||||
|
|
||||||
|
type Overwrite<T, U extends { [Key in keyof T]?: unknown }> = Omit<T, keyof U> &
|
||||||
|
U
|
||||||
|
|
||||||
|
type StrictExtract<Union, Cond> = Cond extends Union ? Union : never
|
||||||
|
|
||||||
|
type SwitchCase = {
|
||||||
|
$switch: {
|
||||||
|
$cases: [any, any][]
|
||||||
|
$default: any
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Endpoints = Overwrite<
|
||||||
|
Gen,
|
||||||
|
{
|
||||||
|
'users/show': {
|
||||||
|
req: UsersShowRequest
|
||||||
|
res: {
|
||||||
|
$switch: {
|
||||||
|
$cases: [
|
||||||
|
[
|
||||||
|
{
|
||||||
|
userIds?: string[]
|
||||||
|
},
|
||||||
|
UserDetailed[]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
$default: UserDetailed
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
>
|
||||||
|
|
||||||
|
export type SwitchCaseResponseType<
|
||||||
|
E extends keyof Endpoints,
|
||||||
|
P extends Endpoints[E]['req']
|
||||||
|
> = Endpoints[E]['res'] extends SwitchCase
|
||||||
|
? IsCaseMatched<E, P, 0> extends true
|
||||||
|
? GetCaseResult<E, P, 0>
|
||||||
|
: IsCaseMatched<E, P, 1> extends true
|
||||||
|
? GetCaseResult<E, P, 1>
|
||||||
|
: IsCaseMatched<E, P, 2> extends true
|
||||||
|
? GetCaseResult<E, P, 2>
|
||||||
|
: IsCaseMatched<E, P, 3> extends true
|
||||||
|
? GetCaseResult<E, P, 3>
|
||||||
|
: IsCaseMatched<E, P, 4> extends true
|
||||||
|
? GetCaseResult<E, P, 4>
|
||||||
|
: IsCaseMatched<E, P, 5> extends true
|
||||||
|
? GetCaseResult<E, P, 5>
|
||||||
|
: IsCaseMatched<E, P, 6> extends true
|
||||||
|
? GetCaseResult<E, P, 6>
|
||||||
|
: IsCaseMatched<E, P, 7> extends true
|
||||||
|
? GetCaseResult<E, P, 7>
|
||||||
|
: IsCaseMatched<E, P, 8> extends true
|
||||||
|
? GetCaseResult<E, P, 8>
|
||||||
|
: IsCaseMatched<E, P, 9> extends true
|
||||||
|
? GetCaseResult<E, P, 9>
|
||||||
|
: Endpoints[E]['res']['$switch']['$default']
|
||||||
|
: Endpoints[E]['res']
|
4328
packages/akkordian.js/src/autogen/api-client-jsdoc.ts
Normal file
4328
packages/akkordian.js/src/autogen/api-client-jsdoc.ts
Normal file
File diff suppressed because it is too large
Load diff
871
packages/akkordian.js/src/autogen/endpoint.ts
Normal file
871
packages/akkordian.js/src/autogen/endpoint.ts
Normal file
|
@ -0,0 +1,871 @@
|
||||||
|
//
|
||||||
|
// Generated at: 2023-12-20T17:05:54.791Z
|
||||||
|
// Version: 2023.12.0-beta.5
|
||||||
|
//
|
||||||
|
|
||||||
|
import type {
|
||||||
|
EmptyRequest,
|
||||||
|
EmptyResponse,
|
||||||
|
AdminMetaResponse,
|
||||||
|
AdminAbuseUserReportsRequest,
|
||||||
|
AdminAbuseUserReportsResponse,
|
||||||
|
AdminAccountsCreateRequest,
|
||||||
|
AdminAccountsCreateResponse,
|
||||||
|
AdminAccountsDeleteRequest,
|
||||||
|
AdminAccountsFindByEmailRequest,
|
||||||
|
AdminAdCreateRequest,
|
||||||
|
AdminAdDeleteRequest,
|
||||||
|
AdminAdListRequest,
|
||||||
|
AdminAdUpdateRequest,
|
||||||
|
AdminAnnouncementsCreateRequest,
|
||||||
|
AdminAnnouncementsCreateResponse,
|
||||||
|
AdminAnnouncementsDeleteRequest,
|
||||||
|
AdminAnnouncementsListRequest,
|
||||||
|
AdminAnnouncementsListResponse,
|
||||||
|
AdminAnnouncementsUpdateRequest,
|
||||||
|
AdminAvatarDecorationsCreateRequest,
|
||||||
|
AdminAvatarDecorationsDeleteRequest,
|
||||||
|
AdminAvatarDecorationsListRequest,
|
||||||
|
AdminAvatarDecorationsListResponse,
|
||||||
|
AdminAvatarDecorationsUpdateRequest,
|
||||||
|
AdminDeleteAllFilesOfAUserRequest,
|
||||||
|
AdminUnsetUserAvatarRequest,
|
||||||
|
AdminUnsetUserBannerRequest,
|
||||||
|
AdminDriveFilesRequest,
|
||||||
|
AdminDriveFilesResponse,
|
||||||
|
AdminDriveShowFileRequest,
|
||||||
|
AdminDriveShowFileResponse,
|
||||||
|
AdminEmojiAddAliasesBulkRequest,
|
||||||
|
AdminEmojiAddRequest,
|
||||||
|
AdminEmojiCopyRequest,
|
||||||
|
AdminEmojiCopyResponse,
|
||||||
|
AdminEmojiDeleteBulkRequest,
|
||||||
|
AdminEmojiDeleteRequest,
|
||||||
|
AdminEmojiImportZipRequest,
|
||||||
|
AdminEmojiListRemoteRequest,
|
||||||
|
AdminEmojiListRemoteResponse,
|
||||||
|
AdminEmojiListRequest,
|
||||||
|
AdminEmojiListResponse,
|
||||||
|
AdminEmojiRemoveAliasesBulkRequest,
|
||||||
|
AdminEmojiSetAliasesBulkRequest,
|
||||||
|
AdminEmojiSetCategoryBulkRequest,
|
||||||
|
AdminEmojiSetLicenseBulkRequest,
|
||||||
|
AdminEmojiUpdateRequest,
|
||||||
|
AdminFederationDeleteAllFilesRequest,
|
||||||
|
AdminFederationRefreshRemoteInstanceMetadataRequest,
|
||||||
|
AdminFederationRemoveAllFollowingRequest,
|
||||||
|
AdminFederationUpdateInstanceRequest,
|
||||||
|
AdminGetTableStatsResponse,
|
||||||
|
AdminGetUserIpsRequest,
|
||||||
|
AdminInviteCreateRequest,
|
||||||
|
AdminInviteCreateResponse,
|
||||||
|
AdminInviteListRequest,
|
||||||
|
AdminInviteListResponse,
|
||||||
|
AdminPromoCreateRequest,
|
||||||
|
AdminQueueDeliverDelayedResponse,
|
||||||
|
AdminQueueInboxDelayedResponse,
|
||||||
|
AdminQueuePromoteRequest,
|
||||||
|
AdminQueueStatsResponse,
|
||||||
|
AdminRelaysAddRequest,
|
||||||
|
AdminRelaysAddResponse,
|
||||||
|
AdminRelaysListResponse,
|
||||||
|
AdminRelaysRemoveRequest,
|
||||||
|
AdminResetPasswordRequest,
|
||||||
|
AdminResetPasswordResponse,
|
||||||
|
AdminResolveAbuseUserReportRequest,
|
||||||
|
AdminSendEmailRequest,
|
||||||
|
AdminServerInfoResponse,
|
||||||
|
AdminShowModerationLogsRequest,
|
||||||
|
AdminShowModerationLogsResponse,
|
||||||
|
AdminShowUserRequest,
|
||||||
|
AdminShowUserResponse,
|
||||||
|
AdminShowUsersRequest,
|
||||||
|
AdminShowUsersResponse,
|
||||||
|
AdminSuspendUserRequest,
|
||||||
|
AdminUnsuspendUserRequest,
|
||||||
|
AdminUpdateMetaRequest,
|
||||||
|
AdminDeleteAccountRequest,
|
||||||
|
AdminDeleteAccountResponse,
|
||||||
|
AdminUpdateUserNoteRequest,
|
||||||
|
AdminRolesCreateRequest,
|
||||||
|
AdminRolesCreateResponse,
|
||||||
|
AdminRolesDeleteRequest,
|
||||||
|
AdminRolesListResponse,
|
||||||
|
AdminRolesShowRequest,
|
||||||
|
AdminRolesShowResponse,
|
||||||
|
AdminRolesUpdateRequest,
|
||||||
|
AdminRolesAssignRequest,
|
||||||
|
AdminRolesUnassignRequest,
|
||||||
|
AdminRolesUpdateDefaultPoliciesRequest,
|
||||||
|
AdminRolesUsersRequest,
|
||||||
|
AnnouncementsRequest,
|
||||||
|
AnnouncementsResponse,
|
||||||
|
AntennasCreateRequest,
|
||||||
|
AntennasCreateResponse,
|
||||||
|
AntennasDeleteRequest,
|
||||||
|
AntennasListResponse,
|
||||||
|
AntennasNotesRequest,
|
||||||
|
AntennasNotesResponse,
|
||||||
|
AntennasShowRequest,
|
||||||
|
AntennasShowResponse,
|
||||||
|
AntennasUpdateRequest,
|
||||||
|
AntennasUpdateResponse,
|
||||||
|
ApGetRequest,
|
||||||
|
ApGetResponse,
|
||||||
|
ApShowRequest,
|
||||||
|
ApShowResponse,
|
||||||
|
AppCreateRequest,
|
||||||
|
AppCreateResponse,
|
||||||
|
AppShowRequest,
|
||||||
|
AppShowResponse,
|
||||||
|
AuthAcceptRequest,
|
||||||
|
AuthSessionGenerateRequest,
|
||||||
|
AuthSessionGenerateResponse,
|
||||||
|
AuthSessionShowRequest,
|
||||||
|
AuthSessionShowResponse,
|
||||||
|
AuthSessionUserkeyRequest,
|
||||||
|
AuthSessionUserkeyResponse,
|
||||||
|
BlockingCreateRequest,
|
||||||
|
BlockingCreateResponse,
|
||||||
|
BlockingDeleteRequest,
|
||||||
|
BlockingDeleteResponse,
|
||||||
|
BlockingListRequest,
|
||||||
|
BlockingListResponse,
|
||||||
|
ChannelsCreateRequest,
|
||||||
|
ChannelsCreateResponse,
|
||||||
|
ChannelsFeaturedResponse,
|
||||||
|
ChannelsFollowRequest,
|
||||||
|
ChannelsFollowedRequest,
|
||||||
|
ChannelsFollowedResponse,
|
||||||
|
ChannelsOwnedRequest,
|
||||||
|
ChannelsOwnedResponse,
|
||||||
|
ChannelsShowRequest,
|
||||||
|
ChannelsShowResponse,
|
||||||
|
ChannelsTimelineRequest,
|
||||||
|
ChannelsTimelineResponse,
|
||||||
|
ChannelsUnfollowRequest,
|
||||||
|
ChannelsUpdateRequest,
|
||||||
|
ChannelsUpdateResponse,
|
||||||
|
ChannelsFavoriteRequest,
|
||||||
|
ChannelsUnfavoriteRequest,
|
||||||
|
ChannelsMyFavoritesResponse,
|
||||||
|
ChannelsSearchRequest,
|
||||||
|
ChannelsSearchResponse,
|
||||||
|
ChartsActiveUsersRequest,
|
||||||
|
ChartsActiveUsersResponse,
|
||||||
|
ChartsApRequestRequest,
|
||||||
|
ChartsApRequestResponse,
|
||||||
|
ChartsDriveRequest,
|
||||||
|
ChartsDriveResponse,
|
||||||
|
ChartsFederationRequest,
|
||||||
|
ChartsFederationResponse,
|
||||||
|
ChartsInstanceRequest,
|
||||||
|
ChartsInstanceResponse,
|
||||||
|
ChartsNotesRequest,
|
||||||
|
ChartsNotesResponse,
|
||||||
|
ChartsUserDriveRequest,
|
||||||
|
ChartsUserDriveResponse,
|
||||||
|
ChartsUserFollowingRequest,
|
||||||
|
ChartsUserFollowingResponse,
|
||||||
|
ChartsUserNotesRequest,
|
||||||
|
ChartsUserNotesResponse,
|
||||||
|
ChartsUserPvRequest,
|
||||||
|
ChartsUserPvResponse,
|
||||||
|
ChartsUserReactionsRequest,
|
||||||
|
ChartsUserReactionsResponse,
|
||||||
|
ChartsUsersRequest,
|
||||||
|
ChartsUsersResponse,
|
||||||
|
ClipsAddNoteRequest,
|
||||||
|
ClipsRemoveNoteRequest,
|
||||||
|
ClipsCreateRequest,
|
||||||
|
ClipsCreateResponse,
|
||||||
|
ClipsDeleteRequest,
|
||||||
|
ClipsListResponse,
|
||||||
|
ClipsNotesRequest,
|
||||||
|
ClipsNotesResponse,
|
||||||
|
ClipsShowRequest,
|
||||||
|
ClipsShowResponse,
|
||||||
|
ClipsUpdateRequest,
|
||||||
|
ClipsUpdateResponse,
|
||||||
|
ClipsFavoriteRequest,
|
||||||
|
ClipsUnfavoriteRequest,
|
||||||
|
ClipsMyFavoritesResponse,
|
||||||
|
DriveResponse,
|
||||||
|
DriveFilesRequest,
|
||||||
|
DriveFilesResponse,
|
||||||
|
DriveFilesAttachedNotesRequest,
|
||||||
|
DriveFilesAttachedNotesResponse,
|
||||||
|
DriveFilesCheckExistenceRequest,
|
||||||
|
DriveFilesCheckExistenceResponse,
|
||||||
|
DriveFilesCreateRequest,
|
||||||
|
DriveFilesCreateResponse,
|
||||||
|
DriveFilesDeleteRequest,
|
||||||
|
DriveFilesFindByHashRequest,
|
||||||
|
DriveFilesFindByHashResponse,
|
||||||
|
DriveFilesFindRequest,
|
||||||
|
DriveFilesFindResponse,
|
||||||
|
DriveFilesShowRequest,
|
||||||
|
DriveFilesShowResponse,
|
||||||
|
DriveFilesUpdateRequest,
|
||||||
|
DriveFilesUpdateResponse,
|
||||||
|
DriveFilesUploadFromUrlRequest,
|
||||||
|
DriveFoldersRequest,
|
||||||
|
DriveFoldersResponse,
|
||||||
|
DriveFoldersCreateRequest,
|
||||||
|
DriveFoldersCreateResponse,
|
||||||
|
DriveFoldersDeleteRequest,
|
||||||
|
DriveFoldersFindRequest,
|
||||||
|
DriveFoldersFindResponse,
|
||||||
|
DriveFoldersShowRequest,
|
||||||
|
DriveFoldersShowResponse,
|
||||||
|
DriveFoldersUpdateRequest,
|
||||||
|
DriveFoldersUpdateResponse,
|
||||||
|
DriveStreamRequest,
|
||||||
|
DriveStreamResponse,
|
||||||
|
EmailAddressAvailableRequest,
|
||||||
|
EmailAddressAvailableResponse,
|
||||||
|
EndpointRequest,
|
||||||
|
EndpointsResponse,
|
||||||
|
FederationFollowersRequest,
|
||||||
|
FederationFollowersResponse,
|
||||||
|
FederationFollowingRequest,
|
||||||
|
FederationFollowingResponse,
|
||||||
|
FederationInstancesRequest,
|
||||||
|
FederationInstancesResponse,
|
||||||
|
FederationShowInstanceRequest,
|
||||||
|
FederationShowInstanceResponse,
|
||||||
|
FederationUpdateRemoteUserRequest,
|
||||||
|
FederationUsersRequest,
|
||||||
|
FederationUsersResponse,
|
||||||
|
FederationStatsRequest,
|
||||||
|
FollowingCreateRequest,
|
||||||
|
FollowingCreateResponse,
|
||||||
|
FollowingDeleteRequest,
|
||||||
|
FollowingDeleteResponse,
|
||||||
|
FollowingUpdateRequest,
|
||||||
|
FollowingUpdateResponse,
|
||||||
|
FollowingUpdateAllRequest,
|
||||||
|
FollowingInvalidateRequest,
|
||||||
|
FollowingInvalidateResponse,
|
||||||
|
FollowingRequestsAcceptRequest,
|
||||||
|
FollowingRequestsCancelRequest,
|
||||||
|
FollowingRequestsCancelResponse,
|
||||||
|
FollowingRequestsListRequest,
|
||||||
|
FollowingRequestsListResponse,
|
||||||
|
FollowingRequestsRejectRequest,
|
||||||
|
GalleryFeaturedRequest,
|
||||||
|
GalleryFeaturedResponse,
|
||||||
|
GalleryPopularResponse,
|
||||||
|
GalleryPostsRequest,
|
||||||
|
GalleryPostsResponse,
|
||||||
|
GalleryPostsCreateRequest,
|
||||||
|
GalleryPostsCreateResponse,
|
||||||
|
GalleryPostsDeleteRequest,
|
||||||
|
GalleryPostsLikeRequest,
|
||||||
|
GalleryPostsShowRequest,
|
||||||
|
GalleryPostsShowResponse,
|
||||||
|
GalleryPostsUnlikeRequest,
|
||||||
|
GalleryPostsUpdateRequest,
|
||||||
|
GalleryPostsUpdateResponse,
|
||||||
|
GetAvatarDecorationsResponse,
|
||||||
|
HashtagsListRequest,
|
||||||
|
HashtagsListResponse,
|
||||||
|
HashtagsSearchRequest,
|
||||||
|
HashtagsSearchResponse,
|
||||||
|
HashtagsShowRequest,
|
||||||
|
HashtagsShowResponse,
|
||||||
|
HashtagsTrendResponse,
|
||||||
|
HashtagsUsersRequest,
|
||||||
|
HashtagsUsersResponse,
|
||||||
|
IResponse,
|
||||||
|
I2faDoneRequest,
|
||||||
|
I2faKeyDoneRequest,
|
||||||
|
I2faPasswordLessRequest,
|
||||||
|
I2faRegisterKeyRequest,
|
||||||
|
I2faRegisterRequest,
|
||||||
|
I2faUpdateKeyRequest,
|
||||||
|
I2faRemoveKeyRequest,
|
||||||
|
I2faUnregisterRequest,
|
||||||
|
IAppsRequest,
|
||||||
|
IAuthorizedAppsRequest,
|
||||||
|
IClaimAchievementRequest,
|
||||||
|
IChangePasswordRequest,
|
||||||
|
IDeleteAccountRequest,
|
||||||
|
IExportFollowingRequest,
|
||||||
|
IFavoritesRequest,
|
||||||
|
IFavoritesResponse,
|
||||||
|
IGalleryLikesRequest,
|
||||||
|
IGalleryLikesResponse,
|
||||||
|
IGalleryPostsRequest,
|
||||||
|
IGalleryPostsResponse,
|
||||||
|
IImportBlockingRequest,
|
||||||
|
IImportFollowingRequest,
|
||||||
|
IImportMutingRequest,
|
||||||
|
IImportUserListsRequest,
|
||||||
|
IImportAntennasRequest,
|
||||||
|
INotificationsRequest,
|
||||||
|
INotificationsResponse,
|
||||||
|
INotificationsGroupedRequest,
|
||||||
|
INotificationsGroupedResponse,
|
||||||
|
IPageLikesRequest,
|
||||||
|
IPageLikesResponse,
|
||||||
|
IPagesRequest,
|
||||||
|
IPagesResponse,
|
||||||
|
IPinRequest,
|
||||||
|
IPinResponse,
|
||||||
|
IReadAnnouncementRequest,
|
||||||
|
IRegenerateTokenRequest,
|
||||||
|
IRegistryGetAllRequest,
|
||||||
|
IRegistryGetDetailRequest,
|
||||||
|
IRegistryGetRequest,
|
||||||
|
IRegistryKeysWithTypeRequest,
|
||||||
|
IRegistryKeysRequest,
|
||||||
|
IRegistryRemoveRequest,
|
||||||
|
IRegistrySetRequest,
|
||||||
|
IRevokeTokenRequest,
|
||||||
|
ISigninHistoryRequest,
|
||||||
|
ISigninHistoryResponse,
|
||||||
|
IUnpinRequest,
|
||||||
|
IUnpinResponse,
|
||||||
|
IUpdateEmailRequest,
|
||||||
|
IUpdateRequest,
|
||||||
|
IUpdateResponse,
|
||||||
|
IMoveRequest,
|
||||||
|
IWebhooksCreateRequest,
|
||||||
|
IWebhooksShowRequest,
|
||||||
|
IWebhooksUpdateRequest,
|
||||||
|
IWebhooksDeleteRequest,
|
||||||
|
InviteCreateResponse,
|
||||||
|
InviteDeleteRequest,
|
||||||
|
InviteListRequest,
|
||||||
|
InviteListResponse,
|
||||||
|
InviteLimitResponse,
|
||||||
|
MetaRequest,
|
||||||
|
MetaResponse,
|
||||||
|
EmojisResponse,
|
||||||
|
EmojiRequest,
|
||||||
|
EmojiResponse,
|
||||||
|
MiauthGenTokenRequest,
|
||||||
|
MiauthGenTokenResponse,
|
||||||
|
MuteCreateRequest,
|
||||||
|
MuteDeleteRequest,
|
||||||
|
MuteListRequest,
|
||||||
|
MuteListResponse,
|
||||||
|
RenoteMuteCreateRequest,
|
||||||
|
RenoteMuteDeleteRequest,
|
||||||
|
RenoteMuteListRequest,
|
||||||
|
RenoteMuteListResponse,
|
||||||
|
MyAppsRequest,
|
||||||
|
MyAppsResponse,
|
||||||
|
NotesRequest,
|
||||||
|
NotesResponse,
|
||||||
|
NotesChildrenRequest,
|
||||||
|
NotesChildrenResponse,
|
||||||
|
NotesClipsRequest,
|
||||||
|
NotesClipsResponse,
|
||||||
|
NotesConversationRequest,
|
||||||
|
NotesConversationResponse,
|
||||||
|
NotesCreateRequest,
|
||||||
|
NotesCreateResponse,
|
||||||
|
NotesDeleteRequest,
|
||||||
|
NotesFavoritesCreateRequest,
|
||||||
|
NotesFavoritesDeleteRequest,
|
||||||
|
NotesFeaturedRequest,
|
||||||
|
NotesFeaturedResponse,
|
||||||
|
NotesGlobalTimelineRequest,
|
||||||
|
NotesGlobalTimelineResponse,
|
||||||
|
NotesHybridTimelineRequest,
|
||||||
|
NotesHybridTimelineResponse,
|
||||||
|
NotesLocalTimelineRequest,
|
||||||
|
NotesLocalTimelineResponse,
|
||||||
|
NotesMentionsRequest,
|
||||||
|
NotesMentionsResponse,
|
||||||
|
NotesPollsRecommendationRequest,
|
||||||
|
NotesPollsRecommendationResponse,
|
||||||
|
NotesPollsVoteRequest,
|
||||||
|
NotesReactionsRequest,
|
||||||
|
NotesReactionsResponse,
|
||||||
|
NotesReactionsCreateRequest,
|
||||||
|
NotesReactionsDeleteRequest,
|
||||||
|
NotesRenotesRequest,
|
||||||
|
NotesRenotesResponse,
|
||||||
|
NotesRepliesRequest,
|
||||||
|
NotesRepliesResponse,
|
||||||
|
NotesSearchByTagRequest,
|
||||||
|
NotesSearchByTagResponse,
|
||||||
|
NotesSearchRequest,
|
||||||
|
NotesSearchResponse,
|
||||||
|
NotesShowRequest,
|
||||||
|
NotesShowResponse,
|
||||||
|
NotesStateRequest,
|
||||||
|
NotesStateResponse,
|
||||||
|
NotesThreadMutingCreateRequest,
|
||||||
|
NotesThreadMutingDeleteRequest,
|
||||||
|
NotesTimelineRequest,
|
||||||
|
NotesTimelineResponse,
|
||||||
|
NotesTranslateRequest,
|
||||||
|
NotesTranslateResponse,
|
||||||
|
NotesUnrenoteRequest,
|
||||||
|
NotesUserListTimelineRequest,
|
||||||
|
NotesUserListTimelineResponse,
|
||||||
|
NotificationsCreateRequest,
|
||||||
|
PagePushRequest,
|
||||||
|
PagesCreateRequest,
|
||||||
|
PagesCreateResponse,
|
||||||
|
PagesDeleteRequest,
|
||||||
|
PagesFeaturedResponse,
|
||||||
|
PagesLikeRequest,
|
||||||
|
PagesShowRequest,
|
||||||
|
PagesShowResponse,
|
||||||
|
PagesUnlikeRequest,
|
||||||
|
PagesUpdateRequest,
|
||||||
|
FlashCreateRequest,
|
||||||
|
FlashDeleteRequest,
|
||||||
|
FlashFeaturedResponse,
|
||||||
|
FlashLikeRequest,
|
||||||
|
FlashShowRequest,
|
||||||
|
FlashShowResponse,
|
||||||
|
FlashUnlikeRequest,
|
||||||
|
FlashUpdateRequest,
|
||||||
|
FlashMyRequest,
|
||||||
|
FlashMyResponse,
|
||||||
|
FlashMyLikesRequest,
|
||||||
|
FlashMyLikesResponse,
|
||||||
|
PingResponse,
|
||||||
|
PinnedUsersResponse,
|
||||||
|
PromoReadRequest,
|
||||||
|
RolesListResponse,
|
||||||
|
RolesShowRequest,
|
||||||
|
RolesShowResponse,
|
||||||
|
RolesUsersRequest,
|
||||||
|
RolesNotesRequest,
|
||||||
|
RolesNotesResponse,
|
||||||
|
RequestResetPasswordRequest,
|
||||||
|
ResetPasswordRequest,
|
||||||
|
StatsResponse,
|
||||||
|
SwShowRegistrationRequest,
|
||||||
|
SwShowRegistrationResponse,
|
||||||
|
SwUpdateRegistrationRequest,
|
||||||
|
SwUpdateRegistrationResponse,
|
||||||
|
SwRegisterRequest,
|
||||||
|
SwRegisterResponse,
|
||||||
|
SwUnregisterRequest,
|
||||||
|
TestRequest,
|
||||||
|
UsernameAvailableRequest,
|
||||||
|
UsernameAvailableResponse,
|
||||||
|
UsersRequest,
|
||||||
|
UsersResponse,
|
||||||
|
UsersClipsRequest,
|
||||||
|
UsersClipsResponse,
|
||||||
|
UsersFollowersRequest,
|
||||||
|
UsersFollowersResponse,
|
||||||
|
UsersFollowingRequest,
|
||||||
|
UsersFollowingResponse,
|
||||||
|
UsersGalleryPostsRequest,
|
||||||
|
UsersGalleryPostsResponse,
|
||||||
|
UsersGetFrequentlyRepliedUsersRequest,
|
||||||
|
UsersGetFrequentlyRepliedUsersResponse,
|
||||||
|
UsersFeaturedNotesRequest,
|
||||||
|
UsersFeaturedNotesResponse,
|
||||||
|
UsersListsCreateRequest,
|
||||||
|
UsersListsCreateResponse,
|
||||||
|
UsersListsDeleteRequest,
|
||||||
|
UsersListsListRequest,
|
||||||
|
UsersListsListResponse,
|
||||||
|
UsersListsPullRequest,
|
||||||
|
UsersListsPushRequest,
|
||||||
|
UsersListsShowRequest,
|
||||||
|
UsersListsShowResponse,
|
||||||
|
UsersListsFavoriteRequest,
|
||||||
|
UsersListsUnfavoriteRequest,
|
||||||
|
UsersListsUpdateRequest,
|
||||||
|
UsersListsUpdateResponse,
|
||||||
|
UsersListsCreateFromPublicRequest,
|
||||||
|
UsersListsCreateFromPublicResponse,
|
||||||
|
UsersListsUpdateMembershipRequest,
|
||||||
|
UsersListsGetMembershipsRequest,
|
||||||
|
UsersNotesRequest,
|
||||||
|
UsersNotesResponse,
|
||||||
|
UsersPagesRequest,
|
||||||
|
UsersPagesResponse,
|
||||||
|
UsersFlashsRequest,
|
||||||
|
UsersFlashsResponse,
|
||||||
|
UsersReactionsRequest,
|
||||||
|
UsersReactionsResponse,
|
||||||
|
UsersRecommendationRequest,
|
||||||
|
UsersRecommendationResponse,
|
||||||
|
UsersRelationRequest,
|
||||||
|
UsersRelationResponse,
|
||||||
|
UsersReportAbuseRequest,
|
||||||
|
UsersSearchByUsernameAndHostRequest,
|
||||||
|
UsersSearchByUsernameAndHostResponse,
|
||||||
|
UsersSearchRequest,
|
||||||
|
UsersSearchResponse,
|
||||||
|
UsersShowRequest,
|
||||||
|
UsersShowResponse,
|
||||||
|
UsersAchievementsRequest,
|
||||||
|
UsersUpdateMemoRequest,
|
||||||
|
FetchRssRequest,
|
||||||
|
FetchExternalResourcesRequest,
|
||||||
|
RetentionResponse,
|
||||||
|
} from './entities'
|
||||||
|
|
||||||
|
export type Endpoints = {
|
||||||
|
'admin/meta': { req: EmptyRequest; res: AdminMetaResponse }
|
||||||
|
'admin/abuse-user-reports': { req: AdminAbuseUserReportsRequest; res: AdminAbuseUserReportsResponse }
|
||||||
|
'admin/accounts/create': { req: AdminAccountsCreateRequest; res: AdminAccountsCreateResponse }
|
||||||
|
'admin/accounts/delete': { req: AdminAccountsDeleteRequest; res: EmptyResponse }
|
||||||
|
'admin/accounts/find-by-email': { req: AdminAccountsFindByEmailRequest; res: EmptyResponse }
|
||||||
|
'admin/ad/create': { req: AdminAdCreateRequest; res: EmptyResponse }
|
||||||
|
'admin/ad/delete': { req: AdminAdDeleteRequest; res: EmptyResponse }
|
||||||
|
'admin/ad/list': { req: AdminAdListRequest; res: EmptyResponse }
|
||||||
|
'admin/ad/update': { req: AdminAdUpdateRequest; res: EmptyResponse }
|
||||||
|
'admin/announcements/create': { req: AdminAnnouncementsCreateRequest; res: AdminAnnouncementsCreateResponse }
|
||||||
|
'admin/announcements/delete': { req: AdminAnnouncementsDeleteRequest; res: EmptyResponse }
|
||||||
|
'admin/announcements/list': { req: AdminAnnouncementsListRequest; res: AdminAnnouncementsListResponse }
|
||||||
|
'admin/announcements/update': { req: AdminAnnouncementsUpdateRequest; res: EmptyResponse }
|
||||||
|
'admin/avatar-decorations/create': { req: AdminAvatarDecorationsCreateRequest; res: EmptyResponse }
|
||||||
|
'admin/avatar-decorations/delete': { req: AdminAvatarDecorationsDeleteRequest; res: EmptyResponse }
|
||||||
|
'admin/avatar-decorations/list': { req: AdminAvatarDecorationsListRequest; res: AdminAvatarDecorationsListResponse }
|
||||||
|
'admin/avatar-decorations/update': { req: AdminAvatarDecorationsUpdateRequest; res: EmptyResponse }
|
||||||
|
'admin/delete-all-files-of-a-user': { req: AdminDeleteAllFilesOfAUserRequest; res: EmptyResponse }
|
||||||
|
'admin/unset-user-avatar': { req: AdminUnsetUserAvatarRequest; res: EmptyResponse }
|
||||||
|
'admin/unset-user-banner': { req: AdminUnsetUserBannerRequest; res: EmptyResponse }
|
||||||
|
'admin/drive/clean-remote-files': { req: EmptyRequest; res: EmptyResponse }
|
||||||
|
'admin/drive/cleanup': { req: EmptyRequest; res: EmptyResponse }
|
||||||
|
'admin/drive/files': { req: AdminDriveFilesRequest; res: AdminDriveFilesResponse }
|
||||||
|
'admin/drive/show-file': { req: AdminDriveShowFileRequest; res: AdminDriveShowFileResponse }
|
||||||
|
'admin/emoji/add-aliases-bulk': { req: AdminEmojiAddAliasesBulkRequest; res: EmptyResponse }
|
||||||
|
'admin/emoji/add': { req: AdminEmojiAddRequest; res: EmptyResponse }
|
||||||
|
'admin/emoji/copy': { req: AdminEmojiCopyRequest; res: AdminEmojiCopyResponse }
|
||||||
|
'admin/emoji/delete-bulk': { req: AdminEmojiDeleteBulkRequest; res: EmptyResponse }
|
||||||
|
'admin/emoji/delete': { req: AdminEmojiDeleteRequest; res: EmptyResponse }
|
||||||
|
'admin/emoji/import-zip': { req: AdminEmojiImportZipRequest; res: EmptyResponse }
|
||||||
|
'admin/emoji/list-remote': { req: AdminEmojiListRemoteRequest; res: AdminEmojiListRemoteResponse }
|
||||||
|
'admin/emoji/list': { req: AdminEmojiListRequest; res: AdminEmojiListResponse }
|
||||||
|
'admin/emoji/remove-aliases-bulk': { req: AdminEmojiRemoveAliasesBulkRequest; res: EmptyResponse }
|
||||||
|
'admin/emoji/set-aliases-bulk': { req: AdminEmojiSetAliasesBulkRequest; res: EmptyResponse }
|
||||||
|
'admin/emoji/set-category-bulk': { req: AdminEmojiSetCategoryBulkRequest; res: EmptyResponse }
|
||||||
|
'admin/emoji/set-license-bulk': { req: AdminEmojiSetLicenseBulkRequest; res: EmptyResponse }
|
||||||
|
'admin/emoji/update': { req: AdminEmojiUpdateRequest; res: EmptyResponse }
|
||||||
|
'admin/federation/delete-all-files': { req: AdminFederationDeleteAllFilesRequest; res: EmptyResponse }
|
||||||
|
'admin/federation/refresh-remote-instance-metadata': { req: AdminFederationRefreshRemoteInstanceMetadataRequest; res: EmptyResponse }
|
||||||
|
'admin/federation/remove-all-following': { req: AdminFederationRemoveAllFollowingRequest; res: EmptyResponse }
|
||||||
|
'admin/federation/update-instance': { req: AdminFederationUpdateInstanceRequest; res: EmptyResponse }
|
||||||
|
'admin/get-index-stats': { req: EmptyRequest; res: EmptyResponse }
|
||||||
|
'admin/get-table-stats': { req: EmptyRequest; res: AdminGetTableStatsResponse }
|
||||||
|
'admin/get-user-ips': { req: AdminGetUserIpsRequest; res: EmptyResponse }
|
||||||
|
'admin/invite/create': { req: AdminInviteCreateRequest; res: AdminInviteCreateResponse }
|
||||||
|
'admin/invite/list': { req: AdminInviteListRequest; res: AdminInviteListResponse }
|
||||||
|
'admin/promo/create': { req: AdminPromoCreateRequest; res: EmptyResponse }
|
||||||
|
'admin/queue/clear': { req: EmptyRequest; res: EmptyResponse }
|
||||||
|
'admin/queue/deliver-delayed': { req: EmptyRequest; res: AdminQueueDeliverDelayedResponse }
|
||||||
|
'admin/queue/inbox-delayed': { req: EmptyRequest; res: AdminQueueInboxDelayedResponse }
|
||||||
|
'admin/queue/promote': { req: AdminQueuePromoteRequest; res: EmptyResponse }
|
||||||
|
'admin/queue/stats': { req: EmptyRequest; res: AdminQueueStatsResponse }
|
||||||
|
'admin/relays/add': { req: AdminRelaysAddRequest; res: AdminRelaysAddResponse }
|
||||||
|
'admin/relays/list': { req: EmptyRequest; res: AdminRelaysListResponse }
|
||||||
|
'admin/relays/remove': { req: AdminRelaysRemoveRequest; res: EmptyResponse }
|
||||||
|
'admin/reset-password': { req: AdminResetPasswordRequest; res: AdminResetPasswordResponse }
|
||||||
|
'admin/resolve-abuse-user-report': { req: AdminResolveAbuseUserReportRequest; res: EmptyResponse }
|
||||||
|
'admin/send-email': { req: AdminSendEmailRequest; res: EmptyResponse }
|
||||||
|
'admin/server-info': { req: EmptyRequest; res: AdminServerInfoResponse }
|
||||||
|
'admin/show-moderation-logs': { req: AdminShowModerationLogsRequest; res: AdminShowModerationLogsResponse }
|
||||||
|
'admin/show-user': { req: AdminShowUserRequest; res: AdminShowUserResponse }
|
||||||
|
'admin/show-users': { req: AdminShowUsersRequest; res: AdminShowUsersResponse }
|
||||||
|
'admin/suspend-user': { req: AdminSuspendUserRequest; res: EmptyResponse }
|
||||||
|
'admin/unsuspend-user': { req: AdminUnsuspendUserRequest; res: EmptyResponse }
|
||||||
|
'admin/update-meta': { req: AdminUpdateMetaRequest; res: EmptyResponse }
|
||||||
|
'admin/delete-account': { req: AdminDeleteAccountRequest; res: AdminDeleteAccountResponse }
|
||||||
|
'admin/update-user-note': { req: AdminUpdateUserNoteRequest; res: EmptyResponse }
|
||||||
|
'admin/roles/create': { req: AdminRolesCreateRequest; res: AdminRolesCreateResponse }
|
||||||
|
'admin/roles/delete': { req: AdminRolesDeleteRequest; res: EmptyResponse }
|
||||||
|
'admin/roles/list': { req: EmptyRequest; res: AdminRolesListResponse }
|
||||||
|
'admin/roles/show': { req: AdminRolesShowRequest; res: AdminRolesShowResponse }
|
||||||
|
'admin/roles/update': { req: AdminRolesUpdateRequest; res: EmptyResponse }
|
||||||
|
'admin/roles/assign': { req: AdminRolesAssignRequest; res: EmptyResponse }
|
||||||
|
'admin/roles/unassign': { req: AdminRolesUnassignRequest; res: EmptyResponse }
|
||||||
|
'admin/roles/update-default-policies': { req: AdminRolesUpdateDefaultPoliciesRequest; res: EmptyResponse }
|
||||||
|
'admin/roles/users': { req: AdminRolesUsersRequest; res: EmptyResponse }
|
||||||
|
'announcements': { req: AnnouncementsRequest; res: AnnouncementsResponse }
|
||||||
|
'antennas/create': { req: AntennasCreateRequest; res: AntennasCreateResponse }
|
||||||
|
'antennas/delete': { req: AntennasDeleteRequest; res: EmptyResponse }
|
||||||
|
'antennas/list': { req: EmptyRequest; res: AntennasListResponse }
|
||||||
|
'antennas/notes': { req: AntennasNotesRequest; res: AntennasNotesResponse }
|
||||||
|
'antennas/show': { req: AntennasShowRequest; res: AntennasShowResponse }
|
||||||
|
'antennas/update': { req: AntennasUpdateRequest; res: AntennasUpdateResponse }
|
||||||
|
'ap/get': { req: ApGetRequest; res: ApGetResponse }
|
||||||
|
'ap/show': { req: ApShowRequest; res: ApShowResponse }
|
||||||
|
'app/create': { req: AppCreateRequest; res: AppCreateResponse }
|
||||||
|
'app/show': { req: AppShowRequest; res: AppShowResponse }
|
||||||
|
'auth/accept': { req: AuthAcceptRequest; res: EmptyResponse }
|
||||||
|
'auth/session/generate': { req: AuthSessionGenerateRequest; res: AuthSessionGenerateResponse }
|
||||||
|
'auth/session/show': { req: AuthSessionShowRequest; res: AuthSessionShowResponse }
|
||||||
|
'auth/session/userkey': { req: AuthSessionUserkeyRequest; res: AuthSessionUserkeyResponse }
|
||||||
|
'blocking/create': { req: BlockingCreateRequest; res: BlockingCreateResponse }
|
||||||
|
'blocking/delete': { req: BlockingDeleteRequest; res: BlockingDeleteResponse }
|
||||||
|
'blocking/list': { req: BlockingListRequest; res: BlockingListResponse }
|
||||||
|
'channels/create': { req: ChannelsCreateRequest; res: ChannelsCreateResponse }
|
||||||
|
'channels/featured': { req: EmptyRequest; res: ChannelsFeaturedResponse }
|
||||||
|
'channels/follow': { req: ChannelsFollowRequest; res: EmptyResponse }
|
||||||
|
'channels/followed': { req: ChannelsFollowedRequest; res: ChannelsFollowedResponse }
|
||||||
|
'channels/owned': { req: ChannelsOwnedRequest; res: ChannelsOwnedResponse }
|
||||||
|
'channels/show': { req: ChannelsShowRequest; res: ChannelsShowResponse }
|
||||||
|
'channels/timeline': { req: ChannelsTimelineRequest; res: ChannelsTimelineResponse }
|
||||||
|
'channels/unfollow': { req: ChannelsUnfollowRequest; res: EmptyResponse }
|
||||||
|
'channels/update': { req: ChannelsUpdateRequest; res: ChannelsUpdateResponse }
|
||||||
|
'channels/favorite': { req: ChannelsFavoriteRequest; res: EmptyResponse }
|
||||||
|
'channels/unfavorite': { req: ChannelsUnfavoriteRequest; res: EmptyResponse }
|
||||||
|
'channels/my-favorites': { req: EmptyRequest; res: ChannelsMyFavoritesResponse }
|
||||||
|
'channels/search': { req: ChannelsSearchRequest; res: ChannelsSearchResponse }
|
||||||
|
'charts/active-users': { req: ChartsActiveUsersRequest; res: ChartsActiveUsersResponse }
|
||||||
|
'charts/ap-request': { req: ChartsApRequestRequest; res: ChartsApRequestResponse }
|
||||||
|
'charts/drive': { req: ChartsDriveRequest; res: ChartsDriveResponse }
|
||||||
|
'charts/federation': { req: ChartsFederationRequest; res: ChartsFederationResponse }
|
||||||
|
'charts/instance': { req: ChartsInstanceRequest; res: ChartsInstanceResponse }
|
||||||
|
'charts/notes': { req: ChartsNotesRequest; res: ChartsNotesResponse }
|
||||||
|
'charts/user/drive': { req: ChartsUserDriveRequest; res: ChartsUserDriveResponse }
|
||||||
|
'charts/user/following': { req: ChartsUserFollowingRequest; res: ChartsUserFollowingResponse }
|
||||||
|
'charts/user/notes': { req: ChartsUserNotesRequest; res: ChartsUserNotesResponse }
|
||||||
|
'charts/user/pv': { req: ChartsUserPvRequest; res: ChartsUserPvResponse }
|
||||||
|
'charts/user/reactions': { req: ChartsUserReactionsRequest; res: ChartsUserReactionsResponse }
|
||||||
|
'charts/users': { req: ChartsUsersRequest; res: ChartsUsersResponse }
|
||||||
|
'clips/add-note': { req: ClipsAddNoteRequest; res: EmptyResponse }
|
||||||
|
'clips/remove-note': { req: ClipsRemoveNoteRequest; res: EmptyResponse }
|
||||||
|
'clips/create': { req: ClipsCreateRequest; res: ClipsCreateResponse }
|
||||||
|
'clips/delete': { req: ClipsDeleteRequest; res: EmptyResponse }
|
||||||
|
'clips/list': { req: EmptyRequest; res: ClipsListResponse }
|
||||||
|
'clips/notes': { req: ClipsNotesRequest; res: ClipsNotesResponse }
|
||||||
|
'clips/show': { req: ClipsShowRequest; res: ClipsShowResponse }
|
||||||
|
'clips/update': { req: ClipsUpdateRequest; res: ClipsUpdateResponse }
|
||||||
|
'clips/favorite': { req: ClipsFavoriteRequest; res: EmptyResponse }
|
||||||
|
'clips/unfavorite': { req: ClipsUnfavoriteRequest; res: EmptyResponse }
|
||||||
|
'clips/my-favorites': { req: EmptyRequest; res: ClipsMyFavoritesResponse }
|
||||||
|
'drive': { req: EmptyRequest; res: DriveResponse }
|
||||||
|
'drive/files': { req: DriveFilesRequest; res: DriveFilesResponse }
|
||||||
|
'drive/files/attached-notes': { req: DriveFilesAttachedNotesRequest; res: DriveFilesAttachedNotesResponse }
|
||||||
|
'drive/files/check-existence': { req: DriveFilesCheckExistenceRequest; res: DriveFilesCheckExistenceResponse }
|
||||||
|
'drive/files/create': { req: DriveFilesCreateRequest; res: DriveFilesCreateResponse }
|
||||||
|
'drive/files/delete': { req: DriveFilesDeleteRequest; res: EmptyResponse }
|
||||||
|
'drive/files/find-by-hash': { req: DriveFilesFindByHashRequest; res: DriveFilesFindByHashResponse }
|
||||||
|
'drive/files/find': { req: DriveFilesFindRequest; res: DriveFilesFindResponse }
|
||||||
|
'drive/files/show': { req: DriveFilesShowRequest; res: DriveFilesShowResponse }
|
||||||
|
'drive/files/update': { req: DriveFilesUpdateRequest; res: DriveFilesUpdateResponse }
|
||||||
|
'drive/files/upload-from-url': { req: DriveFilesUploadFromUrlRequest; res: EmptyResponse }
|
||||||
|
'drive/folders': { req: DriveFoldersRequest; res: DriveFoldersResponse }
|
||||||
|
'drive/folders/create': { req: DriveFoldersCreateRequest; res: DriveFoldersCreateResponse }
|
||||||
|
'drive/folders/delete': { req: DriveFoldersDeleteRequest; res: EmptyResponse }
|
||||||
|
'drive/folders/find': { req: DriveFoldersFindRequest; res: DriveFoldersFindResponse }
|
||||||
|
'drive/folders/show': { req: DriveFoldersShowRequest; res: DriveFoldersShowResponse }
|
||||||
|
'drive/folders/update': { req: DriveFoldersUpdateRequest; res: DriveFoldersUpdateResponse }
|
||||||
|
'drive/stream': { req: DriveStreamRequest; res: DriveStreamResponse }
|
||||||
|
'email-address/available': { req: EmailAddressAvailableRequest; res: EmailAddressAvailableResponse }
|
||||||
|
'endpoint': { req: EndpointRequest; res: EmptyResponse }
|
||||||
|
'endpoints': { req: EmptyRequest; res: EndpointsResponse }
|
||||||
|
'export-custom-emojis': { req: EmptyRequest; res: EmptyResponse }
|
||||||
|
'federation/followers': { req: FederationFollowersRequest; res: FederationFollowersResponse }
|
||||||
|
'federation/following': { req: FederationFollowingRequest; res: FederationFollowingResponse }
|
||||||
|
'federation/instances': { req: FederationInstancesRequest; res: FederationInstancesResponse }
|
||||||
|
'federation/show-instance': { req: FederationShowInstanceRequest; res: FederationShowInstanceResponse }
|
||||||
|
'federation/update-remote-user': { req: FederationUpdateRemoteUserRequest; res: EmptyResponse }
|
||||||
|
'federation/users': { req: FederationUsersRequest; res: FederationUsersResponse }
|
||||||
|
'federation/stats': { req: FederationStatsRequest; res: EmptyResponse }
|
||||||
|
'following/create': { req: FollowingCreateRequest; res: FollowingCreateResponse }
|
||||||
|
'following/delete': { req: FollowingDeleteRequest; res: FollowingDeleteResponse }
|
||||||
|
'following/update': { req: FollowingUpdateRequest; res: FollowingUpdateResponse }
|
||||||
|
'following/update-all': { req: FollowingUpdateAllRequest; res: EmptyResponse }
|
||||||
|
'following/invalidate': { req: FollowingInvalidateRequest; res: FollowingInvalidateResponse }
|
||||||
|
'following/requests/accept': { req: FollowingRequestsAcceptRequest; res: EmptyResponse }
|
||||||
|
'following/requests/cancel': { req: FollowingRequestsCancelRequest; res: FollowingRequestsCancelResponse }
|
||||||
|
'following/requests/list': { req: FollowingRequestsListRequest; res: FollowingRequestsListResponse }
|
||||||
|
'following/requests/reject': { req: FollowingRequestsRejectRequest; res: EmptyResponse }
|
||||||
|
'gallery/featured': { req: GalleryFeaturedRequest; res: GalleryFeaturedResponse }
|
||||||
|
'gallery/popular': { req: EmptyRequest; res: GalleryPopularResponse }
|
||||||
|
'gallery/posts': { req: GalleryPostsRequest; res: GalleryPostsResponse }
|
||||||
|
'gallery/posts/create': { req: GalleryPostsCreateRequest; res: GalleryPostsCreateResponse }
|
||||||
|
'gallery/posts/delete': { req: GalleryPostsDeleteRequest; res: EmptyResponse }
|
||||||
|
'gallery/posts/like': { req: GalleryPostsLikeRequest; res: EmptyResponse }
|
||||||
|
'gallery/posts/show': { req: GalleryPostsShowRequest; res: GalleryPostsShowResponse }
|
||||||
|
'gallery/posts/unlike': { req: GalleryPostsUnlikeRequest; res: EmptyResponse }
|
||||||
|
'gallery/posts/update': { req: GalleryPostsUpdateRequest; res: GalleryPostsUpdateResponse }
|
||||||
|
'get-online-users-count': { req: EmptyRequest; res: EmptyResponse }
|
||||||
|
'get-avatar-decorations': { req: EmptyRequest; res: GetAvatarDecorationsResponse }
|
||||||
|
'hashtags/list': { req: HashtagsListRequest; res: HashtagsListResponse }
|
||||||
|
'hashtags/search': { req: HashtagsSearchRequest; res: HashtagsSearchResponse }
|
||||||
|
'hashtags/show': { req: HashtagsShowRequest; res: HashtagsShowResponse }
|
||||||
|
'hashtags/trend': { req: EmptyRequest; res: HashtagsTrendResponse }
|
||||||
|
'hashtags/users': { req: HashtagsUsersRequest; res: HashtagsUsersResponse }
|
||||||
|
'i': { req: EmptyRequest; res: IResponse }
|
||||||
|
'i/2fa/done': { req: I2faDoneRequest; res: EmptyResponse }
|
||||||
|
'i/2fa/key-done': { req: I2faKeyDoneRequest; res: EmptyResponse }
|
||||||
|
'i/2fa/password-less': { req: I2faPasswordLessRequest; res: EmptyResponse }
|
||||||
|
'i/2fa/register-key': { req: I2faRegisterKeyRequest; res: EmptyResponse }
|
||||||
|
'i/2fa/register': { req: I2faRegisterRequest; res: EmptyResponse }
|
||||||
|
'i/2fa/update-key': { req: I2faUpdateKeyRequest; res: EmptyResponse }
|
||||||
|
'i/2fa/remove-key': { req: I2faRemoveKeyRequest; res: EmptyResponse }
|
||||||
|
'i/2fa/unregister': { req: I2faUnregisterRequest; res: EmptyResponse }
|
||||||
|
'i/apps': { req: IAppsRequest; res: EmptyResponse }
|
||||||
|
'i/authorized-apps': { req: IAuthorizedAppsRequest; res: EmptyResponse }
|
||||||
|
'i/claim-achievement': { req: IClaimAchievementRequest; res: EmptyResponse }
|
||||||
|
'i/change-password': { req: IChangePasswordRequest; res: EmptyResponse }
|
||||||
|
'i/delete-account': { req: IDeleteAccountRequest; res: EmptyResponse }
|
||||||
|
'i/export-blocking': { req: EmptyRequest; res: EmptyResponse }
|
||||||
|
'i/export-following': { req: IExportFollowingRequest; res: EmptyResponse }
|
||||||
|
'i/export-mute': { req: EmptyRequest; res: EmptyResponse }
|
||||||
|
'i/export-notes': { req: EmptyRequest; res: EmptyResponse }
|
||||||
|
'i/export-favorites': { req: EmptyRequest; res: EmptyResponse }
|
||||||
|
'i/export-user-lists': { req: EmptyRequest; res: EmptyResponse }
|
||||||
|
'i/export-antennas': { req: EmptyRequest; res: EmptyResponse }
|
||||||
|
'i/favorites': { req: IFavoritesRequest; res: IFavoritesResponse }
|
||||||
|
'i/gallery/likes': { req: IGalleryLikesRequest; res: IGalleryLikesResponse }
|
||||||
|
'i/gallery/posts': { req: IGalleryPostsRequest; res: IGalleryPostsResponse }
|
||||||
|
'i/import-blocking': { req: IImportBlockingRequest; res: EmptyResponse }
|
||||||
|
'i/import-following': { req: IImportFollowingRequest; res: EmptyResponse }
|
||||||
|
'i/import-muting': { req: IImportMutingRequest; res: EmptyResponse }
|
||||||
|
'i/import-user-lists': { req: IImportUserListsRequest; res: EmptyResponse }
|
||||||
|
'i/import-antennas': { req: IImportAntennasRequest; res: EmptyResponse }
|
||||||
|
'i/notifications': { req: INotificationsRequest; res: INotificationsResponse }
|
||||||
|
'i/notifications-grouped': { req: INotificationsGroupedRequest; res: INotificationsGroupedResponse }
|
||||||
|
'i/page-likes': { req: IPageLikesRequest; res: IPageLikesResponse }
|
||||||
|
'i/pages': { req: IPagesRequest; res: IPagesResponse }
|
||||||
|
'i/pin': { req: IPinRequest; res: IPinResponse }
|
||||||
|
'i/read-all-unread-notes': { req: EmptyRequest; res: EmptyResponse }
|
||||||
|
'i/read-announcement': { req: IReadAnnouncementRequest; res: EmptyResponse }
|
||||||
|
'i/regenerate-token': { req: IRegenerateTokenRequest; res: EmptyResponse }
|
||||||
|
'i/registry/get-all': { req: IRegistryGetAllRequest; res: EmptyResponse }
|
||||||
|
'i/registry/get-detail': { req: IRegistryGetDetailRequest; res: EmptyResponse }
|
||||||
|
'i/registry/get': { req: IRegistryGetRequest; res: EmptyResponse }
|
||||||
|
'i/registry/keys-with-type': { req: IRegistryKeysWithTypeRequest; res: EmptyResponse }
|
||||||
|
'i/registry/keys': { req: IRegistryKeysRequest; res: EmptyResponse }
|
||||||
|
'i/registry/remove': { req: IRegistryRemoveRequest; res: EmptyResponse }
|
||||||
|
'i/registry/scopes-with-domain': { req: EmptyRequest; res: EmptyResponse }
|
||||||
|
'i/registry/set': { req: IRegistrySetRequest; res: EmptyResponse }
|
||||||
|
'i/revoke-token': { req: IRevokeTokenRequest; res: EmptyResponse }
|
||||||
|
'i/signin-history': { req: ISigninHistoryRequest; res: ISigninHistoryResponse }
|
||||||
|
'i/unpin': { req: IUnpinRequest; res: IUnpinResponse }
|
||||||
|
'i/update-email': { req: IUpdateEmailRequest; res: EmptyResponse }
|
||||||
|
'i/update': { req: IUpdateRequest; res: IUpdateResponse }
|
||||||
|
'i/move': { req: IMoveRequest; res: EmptyResponse }
|
||||||
|
'i/webhooks/create': { req: IWebhooksCreateRequest; res: EmptyResponse }
|
||||||
|
'i/webhooks/list': { req: EmptyRequest; res: EmptyResponse }
|
||||||
|
'i/webhooks/show': { req: IWebhooksShowRequest; res: EmptyResponse }
|
||||||
|
'i/webhooks/update': { req: IWebhooksUpdateRequest; res: EmptyResponse }
|
||||||
|
'i/webhooks/delete': { req: IWebhooksDeleteRequest; res: EmptyResponse }
|
||||||
|
'invite/create': { req: EmptyRequest; res: InviteCreateResponse }
|
||||||
|
'invite/delete': { req: InviteDeleteRequest; res: EmptyResponse }
|
||||||
|
'invite/list': { req: InviteListRequest; res: InviteListResponse }
|
||||||
|
'invite/limit': { req: EmptyRequest; res: InviteLimitResponse }
|
||||||
|
'meta': { req: MetaRequest; res: MetaResponse }
|
||||||
|
'emojis': { req: EmptyRequest; res: EmojisResponse }
|
||||||
|
'emoji': { req: EmojiRequest; res: EmojiResponse }
|
||||||
|
'miauth/gen-token': { req: MiauthGenTokenRequest; res: MiauthGenTokenResponse }
|
||||||
|
'mute/create': { req: MuteCreateRequest; res: EmptyResponse }
|
||||||
|
'mute/delete': { req: MuteDeleteRequest; res: EmptyResponse }
|
||||||
|
'mute/list': { req: MuteListRequest; res: MuteListResponse }
|
||||||
|
'renote-mute/create': { req: RenoteMuteCreateRequest; res: EmptyResponse }
|
||||||
|
'renote-mute/delete': { req: RenoteMuteDeleteRequest; res: EmptyResponse }
|
||||||
|
'renote-mute/list': { req: RenoteMuteListRequest; res: RenoteMuteListResponse }
|
||||||
|
'my/apps': { req: MyAppsRequest; res: MyAppsResponse }
|
||||||
|
'notes': { req: NotesRequest; res: NotesResponse }
|
||||||
|
'notes/children': { req: NotesChildrenRequest; res: NotesChildrenResponse }
|
||||||
|
'notes/clips': { req: NotesClipsRequest; res: NotesClipsResponse }
|
||||||
|
'notes/conversation': { req: NotesConversationRequest; res: NotesConversationResponse }
|
||||||
|
'notes/create': { req: NotesCreateRequest; res: NotesCreateResponse }
|
||||||
|
'notes/delete': { req: NotesDeleteRequest; res: EmptyResponse }
|
||||||
|
'notes/favorites/create': { req: NotesFavoritesCreateRequest; res: EmptyResponse }
|
||||||
|
'notes/favorites/delete': { req: NotesFavoritesDeleteRequest; res: EmptyResponse }
|
||||||
|
'notes/featured': { req: NotesFeaturedRequest; res: NotesFeaturedResponse }
|
||||||
|
'notes/global-timeline': { req: NotesGlobalTimelineRequest; res: NotesGlobalTimelineResponse }
|
||||||
|
'notes/hybrid-timeline': { req: NotesHybridTimelineRequest; res: NotesHybridTimelineResponse }
|
||||||
|
'notes/local-timeline': { req: NotesLocalTimelineRequest; res: NotesLocalTimelineResponse }
|
||||||
|
'notes/mentions': { req: NotesMentionsRequest; res: NotesMentionsResponse }
|
||||||
|
'notes/polls/recommendation': { req: NotesPollsRecommendationRequest; res: NotesPollsRecommendationResponse }
|
||||||
|
'notes/polls/vote': { req: NotesPollsVoteRequest; res: EmptyResponse }
|
||||||
|
'notes/reactions': { req: NotesReactionsRequest; res: NotesReactionsResponse }
|
||||||
|
'notes/reactions/create': { req: NotesReactionsCreateRequest; res: EmptyResponse }
|
||||||
|
'notes/reactions/delete': { req: NotesReactionsDeleteRequest; res: EmptyResponse }
|
||||||
|
'notes/renotes': { req: NotesRenotesRequest; res: NotesRenotesResponse }
|
||||||
|
'notes/replies': { req: NotesRepliesRequest; res: NotesRepliesResponse }
|
||||||
|
'notes/search-by-tag': { req: NotesSearchByTagRequest; res: NotesSearchByTagResponse }
|
||||||
|
'notes/search': { req: NotesSearchRequest; res: NotesSearchResponse }
|
||||||
|
'notes/show': { req: NotesShowRequest; res: NotesShowResponse }
|
||||||
|
'notes/state': { req: NotesStateRequest; res: NotesStateResponse }
|
||||||
|
'notes/thread-muting/create': { req: NotesThreadMutingCreateRequest; res: EmptyResponse }
|
||||||
|
'notes/thread-muting/delete': { req: NotesThreadMutingDeleteRequest; res: EmptyResponse }
|
||||||
|
'notes/timeline': { req: NotesTimelineRequest; res: NotesTimelineResponse }
|
||||||
|
'notes/translate': { req: NotesTranslateRequest; res: NotesTranslateResponse }
|
||||||
|
'notes/unrenote': { req: NotesUnrenoteRequest; res: EmptyResponse }
|
||||||
|
'notes/user-list-timeline': { req: NotesUserListTimelineRequest; res: NotesUserListTimelineResponse }
|
||||||
|
'notifications/create': { req: NotificationsCreateRequest; res: EmptyResponse }
|
||||||
|
'notifications/mark-all-as-read': { req: EmptyRequest; res: EmptyResponse }
|
||||||
|
'notifications/test-notification': { req: EmptyRequest; res: EmptyResponse }
|
||||||
|
'page-push': { req: PagePushRequest; res: EmptyResponse }
|
||||||
|
'pages/create': { req: PagesCreateRequest; res: PagesCreateResponse }
|
||||||
|
'pages/delete': { req: PagesDeleteRequest; res: EmptyResponse }
|
||||||
|
'pages/featured': { req: EmptyRequest; res: PagesFeaturedResponse }
|
||||||
|
'pages/like': { req: PagesLikeRequest; res: EmptyResponse }
|
||||||
|
'pages/show': { req: PagesShowRequest; res: PagesShowResponse }
|
||||||
|
'pages/unlike': { req: PagesUnlikeRequest; res: EmptyResponse }
|
||||||
|
'pages/update': { req: PagesUpdateRequest; res: EmptyResponse }
|
||||||
|
'flash/create': { req: FlashCreateRequest; res: EmptyResponse }
|
||||||
|
'flash/delete': { req: FlashDeleteRequest; res: EmptyResponse }
|
||||||
|
'flash/featured': { req: EmptyRequest; res: FlashFeaturedResponse }
|
||||||
|
'flash/like': { req: FlashLikeRequest; res: EmptyResponse }
|
||||||
|
'flash/show': { req: FlashShowRequest; res: FlashShowResponse }
|
||||||
|
'flash/unlike': { req: FlashUnlikeRequest; res: EmptyResponse }
|
||||||
|
'flash/update': { req: FlashUpdateRequest; res: EmptyResponse }
|
||||||
|
'flash/my': { req: FlashMyRequest; res: FlashMyResponse }
|
||||||
|
'flash/my-likes': { req: FlashMyLikesRequest; res: FlashMyLikesResponse }
|
||||||
|
'ping': { req: EmptyRequest; res: PingResponse }
|
||||||
|
'pinned-users': { req: EmptyRequest; res: PinnedUsersResponse }
|
||||||
|
'promo/read': { req: PromoReadRequest; res: EmptyResponse }
|
||||||
|
'roles/list': { req: EmptyRequest; res: RolesListResponse }
|
||||||
|
'roles/show': { req: RolesShowRequest; res: RolesShowResponse }
|
||||||
|
'roles/users': { req: RolesUsersRequest; res: EmptyResponse }
|
||||||
|
'roles/notes': { req: RolesNotesRequest; res: RolesNotesResponse }
|
||||||
|
'request-reset-password': { req: RequestResetPasswordRequest; res: EmptyResponse }
|
||||||
|
'reset-db': { req: EmptyRequest; res: EmptyResponse }
|
||||||
|
'reset-password': { req: ResetPasswordRequest; res: EmptyResponse }
|
||||||
|
'server-info': { req: EmptyRequest; res: EmptyResponse }
|
||||||
|
'stats': { req: EmptyRequest; res: StatsResponse }
|
||||||
|
'sw/show-registration': { req: SwShowRegistrationRequest; res: SwShowRegistrationResponse }
|
||||||
|
'sw/update-registration': { req: SwUpdateRegistrationRequest; res: SwUpdateRegistrationResponse }
|
||||||
|
'sw/register': { req: SwRegisterRequest; res: SwRegisterResponse }
|
||||||
|
'sw/unregister': { req: SwUnregisterRequest; res: EmptyResponse }
|
||||||
|
'test': { req: TestRequest; res: EmptyResponse }
|
||||||
|
'username/available': { req: UsernameAvailableRequest; res: UsernameAvailableResponse }
|
||||||
|
'users': { req: UsersRequest; res: UsersResponse }
|
||||||
|
'users/clips': { req: UsersClipsRequest; res: UsersClipsResponse }
|
||||||
|
'users/followers': { req: UsersFollowersRequest; res: UsersFollowersResponse }
|
||||||
|
'users/following': { req: UsersFollowingRequest; res: UsersFollowingResponse }
|
||||||
|
'users/gallery/posts': { req: UsersGalleryPostsRequest; res: UsersGalleryPostsResponse }
|
||||||
|
'users/get-frequently-replied-users': { req: UsersGetFrequentlyRepliedUsersRequest; res: UsersGetFrequentlyRepliedUsersResponse }
|
||||||
|
'users/featured-notes': { req: UsersFeaturedNotesRequest; res: UsersFeaturedNotesResponse }
|
||||||
|
'users/lists/create': { req: UsersListsCreateRequest; res: UsersListsCreateResponse }
|
||||||
|
'users/lists/delete': { req: UsersListsDeleteRequest; res: EmptyResponse }
|
||||||
|
'users/lists/list': { req: UsersListsListRequest; res: UsersListsListResponse }
|
||||||
|
'users/lists/pull': { req: UsersListsPullRequest; res: EmptyResponse }
|
||||||
|
'users/lists/push': { req: UsersListsPushRequest; res: EmptyResponse }
|
||||||
|
'users/lists/show': { req: UsersListsShowRequest; res: UsersListsShowResponse }
|
||||||
|
'users/lists/favorite': { req: UsersListsFavoriteRequest; res: EmptyResponse }
|
||||||
|
'users/lists/unfavorite': { req: UsersListsUnfavoriteRequest; res: EmptyResponse }
|
||||||
|
'users/lists/update': { req: UsersListsUpdateRequest; res: UsersListsUpdateResponse }
|
||||||
|
'users/lists/create-from-public': { req: UsersListsCreateFromPublicRequest; res: UsersListsCreateFromPublicResponse }
|
||||||
|
'users/lists/update-membership': { req: UsersListsUpdateMembershipRequest; res: EmptyResponse }
|
||||||
|
'users/lists/get-memberships': { req: UsersListsGetMembershipsRequest; res: EmptyResponse }
|
||||||
|
'users/notes': { req: UsersNotesRequest; res: UsersNotesResponse }
|
||||||
|
'users/pages': { req: UsersPagesRequest; res: UsersPagesResponse }
|
||||||
|
'users/flashs': { req: UsersFlashsRequest; res: UsersFlashsResponse }
|
||||||
|
'users/reactions': { req: UsersReactionsRequest; res: UsersReactionsResponse }
|
||||||
|
'users/recommendation': { req: UsersRecommendationRequest; res: UsersRecommendationResponse }
|
||||||
|
'users/relation': { req: UsersRelationRequest; res: UsersRelationResponse }
|
||||||
|
'users/report-abuse': { req: UsersReportAbuseRequest; res: EmptyResponse }
|
||||||
|
'users/search-by-username-and-host': { req: UsersSearchByUsernameAndHostRequest; res: UsersSearchByUsernameAndHostResponse }
|
||||||
|
'users/search': { req: UsersSearchRequest; res: UsersSearchResponse }
|
||||||
|
'users/show': { req: UsersShowRequest; res: UsersShowResponse }
|
||||||
|
'users/achievements': { req: UsersAchievementsRequest; res: EmptyResponse }
|
||||||
|
'users/update-memo': { req: UsersUpdateMemoRequest; res: EmptyResponse }
|
||||||
|
'fetch-rss': { req: FetchRssRequest; res: EmptyResponse }
|
||||||
|
'fetch-external-resources': { req: FetchExternalResourcesRequest; res: EmptyResponse }
|
||||||
|
'retention': { req: EmptyRequest; res: RetentionResponse }
|
||||||
|
}
|
512
packages/akkordian.js/src/autogen/entities.ts
Normal file
512
packages/akkordian.js/src/autogen/entities.ts
Normal file
|
@ -0,0 +1,512 @@
|
||||||
|
//
|
||||||
|
// Generated at: 2023-12-20T17:05:54.785Z
|
||||||
|
// Version: 2023.12.0-beta.5
|
||||||
|
//
|
||||||
|
|
||||||
|
import { operations } from './types'
|
||||||
|
|
||||||
|
export type EmptyRequest = Record<string, unknown> | undefined
|
||||||
|
export type EmptyResponse = Record<string, unknown> | undefined
|
||||||
|
|
||||||
|
export type AdminMetaResponse = operations['admin/meta']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminAbuseUserReportsRequest = operations['admin/abuse-user-reports']['requestBody']['content']['application/json']
|
||||||
|
export type AdminAbuseUserReportsResponse = operations['admin/abuse-user-reports']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminAccountsCreateRequest = operations['admin/accounts/create']['requestBody']['content']['application/json']
|
||||||
|
export type AdminAccountsCreateResponse = operations['admin/accounts/create']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminAccountsDeleteRequest = operations['admin/accounts/delete']['requestBody']['content']['application/json']
|
||||||
|
export type AdminAccountsFindByEmailRequest = operations['admin/accounts/find-by-email']['requestBody']['content']['application/json']
|
||||||
|
export type AdminAdCreateRequest = operations['admin/ad/create']['requestBody']['content']['application/json']
|
||||||
|
export type AdminAdDeleteRequest = operations['admin/ad/delete']['requestBody']['content']['application/json']
|
||||||
|
export type AdminAdListRequest = operations['admin/ad/list']['requestBody']['content']['application/json']
|
||||||
|
export type AdminAdUpdateRequest = operations['admin/ad/update']['requestBody']['content']['application/json']
|
||||||
|
export type AdminAnnouncementsCreateRequest = operations['admin/announcements/create']['requestBody']['content']['application/json']
|
||||||
|
export type AdminAnnouncementsCreateResponse = operations['admin/announcements/create']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminAnnouncementsDeleteRequest = operations['admin/announcements/delete']['requestBody']['content']['application/json']
|
||||||
|
export type AdminAnnouncementsListRequest = operations['admin/announcements/list']['requestBody']['content']['application/json']
|
||||||
|
export type AdminAnnouncementsListResponse = operations['admin/announcements/list']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminAnnouncementsUpdateRequest = operations['admin/announcements/update']['requestBody']['content']['application/json']
|
||||||
|
export type AdminAvatarDecorationsCreateRequest = operations['admin/avatar-decorations/create']['requestBody']['content']['application/json']
|
||||||
|
export type AdminAvatarDecorationsDeleteRequest = operations['admin/avatar-decorations/delete']['requestBody']['content']['application/json']
|
||||||
|
export type AdminAvatarDecorationsListRequest = operations['admin/avatar-decorations/list']['requestBody']['content']['application/json']
|
||||||
|
export type AdminAvatarDecorationsListResponse = operations['admin/avatar-decorations/list']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminAvatarDecorationsUpdateRequest = operations['admin/avatar-decorations/update']['requestBody']['content']['application/json']
|
||||||
|
export type AdminDeleteAllFilesOfAUserRequest = operations['admin/delete-all-files-of-a-user']['requestBody']['content']['application/json']
|
||||||
|
export type AdminUnsetUserAvatarRequest = operations['admin/unset-user-avatar']['requestBody']['content']['application/json']
|
||||||
|
export type AdminUnsetUserBannerRequest = operations['admin/unset-user-banner']['requestBody']['content']['application/json']
|
||||||
|
export type AdminDriveFilesRequest = operations['admin/drive/files']['requestBody']['content']['application/json']
|
||||||
|
export type AdminDriveFilesResponse = operations['admin/drive/files']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminDriveShowFileRequest = operations['admin/drive/show-file']['requestBody']['content']['application/json']
|
||||||
|
export type AdminDriveShowFileResponse = operations['admin/drive/show-file']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminEmojiAddAliasesBulkRequest = operations['admin/emoji/add-aliases-bulk']['requestBody']['content']['application/json']
|
||||||
|
export type AdminEmojiAddRequest = operations['admin/emoji/add']['requestBody']['content']['application/json']
|
||||||
|
export type AdminEmojiCopyRequest = operations['admin/emoji/copy']['requestBody']['content']['application/json']
|
||||||
|
export type AdminEmojiCopyResponse = operations['admin/emoji/copy']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminEmojiDeleteBulkRequest = operations['admin/emoji/delete-bulk']['requestBody']['content']['application/json']
|
||||||
|
export type AdminEmojiDeleteRequest = operations['admin/emoji/delete']['requestBody']['content']['application/json']
|
||||||
|
export type AdminEmojiImportZipRequest = operations['admin/emoji/import-zip']['requestBody']['content']['application/json']
|
||||||
|
export type AdminEmojiListRemoteRequest = operations['admin/emoji/list-remote']['requestBody']['content']['application/json']
|
||||||
|
export type AdminEmojiListRemoteResponse = operations['admin/emoji/list-remote']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminEmojiListRequest = operations['admin/emoji/list']['requestBody']['content']['application/json']
|
||||||
|
export type AdminEmojiListResponse = operations['admin/emoji/list']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminEmojiRemoveAliasesBulkRequest = operations['admin/emoji/remove-aliases-bulk']['requestBody']['content']['application/json']
|
||||||
|
export type AdminEmojiSetAliasesBulkRequest = operations['admin/emoji/set-aliases-bulk']['requestBody']['content']['application/json']
|
||||||
|
export type AdminEmojiSetCategoryBulkRequest = operations['admin/emoji/set-category-bulk']['requestBody']['content']['application/json']
|
||||||
|
export type AdminEmojiSetLicenseBulkRequest = operations['admin/emoji/set-license-bulk']['requestBody']['content']['application/json']
|
||||||
|
export type AdminEmojiUpdateRequest = operations['admin/emoji/update']['requestBody']['content']['application/json']
|
||||||
|
export type AdminFederationDeleteAllFilesRequest = operations['admin/federation/delete-all-files']['requestBody']['content']['application/json']
|
||||||
|
export type AdminFederationRefreshRemoteInstanceMetadataRequest = operations['admin/federation/refresh-remote-instance-metadata']['requestBody']['content']['application/json']
|
||||||
|
export type AdminFederationRemoveAllFollowingRequest = operations['admin/federation/remove-all-following']['requestBody']['content']['application/json']
|
||||||
|
export type AdminFederationUpdateInstanceRequest = operations['admin/federation/update-instance']['requestBody']['content']['application/json']
|
||||||
|
export type AdminGetTableStatsResponse = operations['admin/get-table-stats']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminGetUserIpsRequest = operations['admin/get-user-ips']['requestBody']['content']['application/json']
|
||||||
|
export type AdminInviteCreateRequest = operations['admin/invite/create']['requestBody']['content']['application/json']
|
||||||
|
export type AdminInviteCreateResponse = operations['admin/invite/create']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminInviteListRequest = operations['admin/invite/list']['requestBody']['content']['application/json']
|
||||||
|
export type AdminInviteListResponse = operations['admin/invite/list']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminPromoCreateRequest = operations['admin/promo/create']['requestBody']['content']['application/json']
|
||||||
|
export type AdminQueueDeliverDelayedResponse = operations['admin/queue/deliver-delayed']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminQueueInboxDelayedResponse = operations['admin/queue/inbox-delayed']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminQueuePromoteRequest = operations['admin/queue/promote']['requestBody']['content']['application/json']
|
||||||
|
export type AdminQueueStatsResponse = operations['admin/queue/stats']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminRelaysAddRequest = operations['admin/relays/add']['requestBody']['content']['application/json']
|
||||||
|
export type AdminRelaysAddResponse = operations['admin/relays/add']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminRelaysListResponse = operations['admin/relays/list']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminRelaysRemoveRequest = operations['admin/relays/remove']['requestBody']['content']['application/json']
|
||||||
|
export type AdminResetPasswordRequest = operations['admin/reset-password']['requestBody']['content']['application/json']
|
||||||
|
export type AdminResetPasswordResponse = operations['admin/reset-password']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminResolveAbuseUserReportRequest = operations['admin/resolve-abuse-user-report']['requestBody']['content']['application/json']
|
||||||
|
export type AdminSendEmailRequest = operations['admin/send-email']['requestBody']['content']['application/json']
|
||||||
|
export type AdminServerInfoResponse = operations['admin/server-info']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminShowModerationLogsRequest = operations['admin/show-moderation-logs']['requestBody']['content']['application/json']
|
||||||
|
export type AdminShowModerationLogsResponse = operations['admin/show-moderation-logs']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminShowUserRequest = operations['admin/show-user']['requestBody']['content']['application/json']
|
||||||
|
export type AdminShowUserResponse = operations['admin/show-user']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminShowUsersRequest = operations['admin/show-users']['requestBody']['content']['application/json']
|
||||||
|
export type AdminShowUsersResponse = operations['admin/show-users']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminSuspendUserRequest = operations['admin/suspend-user']['requestBody']['content']['application/json']
|
||||||
|
export type AdminUnsuspendUserRequest = operations['admin/unsuspend-user']['requestBody']['content']['application/json']
|
||||||
|
export type AdminUpdateMetaRequest = operations['admin/update-meta']['requestBody']['content']['application/json']
|
||||||
|
export type AdminDeleteAccountRequest = operations['admin/delete-account']['requestBody']['content']['application/json']
|
||||||
|
export type AdminDeleteAccountResponse = operations['admin/delete-account']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminUpdateUserNoteRequest = operations['admin/update-user-note']['requestBody']['content']['application/json']
|
||||||
|
export type AdminRolesCreateRequest = operations['admin/roles/create']['requestBody']['content']['application/json']
|
||||||
|
export type AdminRolesCreateResponse = operations['admin/roles/create']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminRolesDeleteRequest = operations['admin/roles/delete']['requestBody']['content']['application/json']
|
||||||
|
export type AdminRolesListResponse = operations['admin/roles/list']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminRolesShowRequest = operations['admin/roles/show']['requestBody']['content']['application/json']
|
||||||
|
export type AdminRolesShowResponse = operations['admin/roles/show']['responses']['200']['content']['application/json']
|
||||||
|
export type AdminRolesUpdateRequest = operations['admin/roles/update']['requestBody']['content']['application/json']
|
||||||
|
export type AdminRolesAssignRequest = operations['admin/roles/assign']['requestBody']['content']['application/json']
|
||||||
|
export type AdminRolesUnassignRequest = operations['admin/roles/unassign']['requestBody']['content']['application/json']
|
||||||
|
export type AdminRolesUpdateDefaultPoliciesRequest = operations['admin/roles/update-default-policies']['requestBody']['content']['application/json']
|
||||||
|
export type AdminRolesUsersRequest = operations['admin/roles/users']['requestBody']['content']['application/json']
|
||||||
|
export type AnnouncementsRequest = operations['announcements']['requestBody']['content']['application/json']
|
||||||
|
export type AnnouncementsResponse = operations['announcements']['responses']['200']['content']['application/json']
|
||||||
|
export type AntennasCreateRequest = operations['antennas/create']['requestBody']['content']['application/json']
|
||||||
|
export type AntennasCreateResponse = operations['antennas/create']['responses']['200']['content']['application/json']
|
||||||
|
export type AntennasDeleteRequest = operations['antennas/delete']['requestBody']['content']['application/json']
|
||||||
|
export type AntennasListResponse = operations['antennas/list']['responses']['200']['content']['application/json']
|
||||||
|
export type AntennasNotesRequest = operations['antennas/notes']['requestBody']['content']['application/json']
|
||||||
|
export type AntennasNotesResponse = operations['antennas/notes']['responses']['200']['content']['application/json']
|
||||||
|
export type AntennasShowRequest = operations['antennas/show']['requestBody']['content']['application/json']
|
||||||
|
export type AntennasShowResponse = operations['antennas/show']['responses']['200']['content']['application/json']
|
||||||
|
export type AntennasUpdateRequest = operations['antennas/update']['requestBody']['content']['application/json']
|
||||||
|
export type AntennasUpdateResponse = operations['antennas/update']['responses']['200']['content']['application/json']
|
||||||
|
export type ApGetRequest = operations['ap/get']['requestBody']['content']['application/json']
|
||||||
|
export type ApGetResponse = operations['ap/get']['responses']['200']['content']['application/json']
|
||||||
|
export type ApShowRequest = operations['ap/show']['requestBody']['content']['application/json']
|
||||||
|
export type ApShowResponse = operations['ap/show']['responses']['200']['content']['application/json']
|
||||||
|
export type AppCreateRequest = operations['app/create']['requestBody']['content']['application/json']
|
||||||
|
export type AppCreateResponse = operations['app/create']['responses']['200']['content']['application/json']
|
||||||
|
export type AppShowRequest = operations['app/show']['requestBody']['content']['application/json']
|
||||||
|
export type AppShowResponse = operations['app/show']['responses']['200']['content']['application/json']
|
||||||
|
export type AuthAcceptRequest = operations['auth/accept']['requestBody']['content']['application/json']
|
||||||
|
export type AuthSessionGenerateRequest = operations['auth/session/generate']['requestBody']['content']['application/json']
|
||||||
|
export type AuthSessionGenerateResponse = operations['auth/session/generate']['responses']['200']['content']['application/json']
|
||||||
|
export type AuthSessionShowRequest = operations['auth/session/show']['requestBody']['content']['application/json']
|
||||||
|
export type AuthSessionShowResponse = operations['auth/session/show']['responses']['200']['content']['application/json']
|
||||||
|
export type AuthSessionUserkeyRequest = operations['auth/session/userkey']['requestBody']['content']['application/json']
|
||||||
|
export type AuthSessionUserkeyResponse = operations['auth/session/userkey']['responses']['200']['content']['application/json']
|
||||||
|
export type BlockingCreateRequest = operations['blocking/create']['requestBody']['content']['application/json']
|
||||||
|
export type BlockingCreateResponse = operations['blocking/create']['responses']['200']['content']['application/json']
|
||||||
|
export type BlockingDeleteRequest = operations['blocking/delete']['requestBody']['content']['application/json']
|
||||||
|
export type BlockingDeleteResponse = operations['blocking/delete']['responses']['200']['content']['application/json']
|
||||||
|
export type BlockingListRequest = operations['blocking/list']['requestBody']['content']['application/json']
|
||||||
|
export type BlockingListResponse = operations['blocking/list']['responses']['200']['content']['application/json']
|
||||||
|
export type ChannelsCreateRequest = operations['channels/create']['requestBody']['content']['application/json']
|
||||||
|
export type ChannelsCreateResponse = operations['channels/create']['responses']['200']['content']['application/json']
|
||||||
|
export type ChannelsFeaturedResponse = operations['channels/featured']['responses']['200']['content']['application/json']
|
||||||
|
export type ChannelsFollowRequest = operations['channels/follow']['requestBody']['content']['application/json']
|
||||||
|
export type ChannelsFollowedRequest = operations['channels/followed']['requestBody']['content']['application/json']
|
||||||
|
export type ChannelsFollowedResponse = operations['channels/followed']['responses']['200']['content']['application/json']
|
||||||
|
export type ChannelsOwnedRequest = operations['channels/owned']['requestBody']['content']['application/json']
|
||||||
|
export type ChannelsOwnedResponse = operations['channels/owned']['responses']['200']['content']['application/json']
|
||||||
|
export type ChannelsShowRequest = operations['channels/show']['requestBody']['content']['application/json']
|
||||||
|
export type ChannelsShowResponse = operations['channels/show']['responses']['200']['content']['application/json']
|
||||||
|
export type ChannelsTimelineRequest = operations['channels/timeline']['requestBody']['content']['application/json']
|
||||||
|
export type ChannelsTimelineResponse = operations['channels/timeline']['responses']['200']['content']['application/json']
|
||||||
|
export type ChannelsUnfollowRequest = operations['channels/unfollow']['requestBody']['content']['application/json']
|
||||||
|
export type ChannelsUpdateRequest = operations['channels/update']['requestBody']['content']['application/json']
|
||||||
|
export type ChannelsUpdateResponse = operations['channels/update']['responses']['200']['content']['application/json']
|
||||||
|
export type ChannelsFavoriteRequest = operations['channels/favorite']['requestBody']['content']['application/json']
|
||||||
|
export type ChannelsUnfavoriteRequest = operations['channels/unfavorite']['requestBody']['content']['application/json']
|
||||||
|
export type ChannelsMyFavoritesResponse = operations['channels/my-favorites']['responses']['200']['content']['application/json']
|
||||||
|
export type ChannelsSearchRequest = operations['channels/search']['requestBody']['content']['application/json']
|
||||||
|
export type ChannelsSearchResponse = operations['channels/search']['responses']['200']['content']['application/json']
|
||||||
|
export type ChartsActiveUsersRequest = operations['charts/active-users']['requestBody']['content']['application/json']
|
||||||
|
export type ChartsActiveUsersResponse = operations['charts/active-users']['responses']['200']['content']['application/json']
|
||||||
|
export type ChartsApRequestRequest = operations['charts/ap-request']['requestBody']['content']['application/json']
|
||||||
|
export type ChartsApRequestResponse = operations['charts/ap-request']['responses']['200']['content']['application/json']
|
||||||
|
export type ChartsDriveRequest = operations['charts/drive']['requestBody']['content']['application/json']
|
||||||
|
export type ChartsDriveResponse = operations['charts/drive']['responses']['200']['content']['application/json']
|
||||||
|
export type ChartsFederationRequest = operations['charts/federation']['requestBody']['content']['application/json']
|
||||||
|
export type ChartsFederationResponse = operations['charts/federation']['responses']['200']['content']['application/json']
|
||||||
|
export type ChartsInstanceRequest = operations['charts/instance']['requestBody']['content']['application/json']
|
||||||
|
export type ChartsInstanceResponse = operations['charts/instance']['responses']['200']['content']['application/json']
|
||||||
|
export type ChartsNotesRequest = operations['charts/notes']['requestBody']['content']['application/json']
|
||||||
|
export type ChartsNotesResponse = operations['charts/notes']['responses']['200']['content']['application/json']
|
||||||
|
export type ChartsUserDriveRequest = operations['charts/user/drive']['requestBody']['content']['application/json']
|
||||||
|
export type ChartsUserDriveResponse = operations['charts/user/drive']['responses']['200']['content']['application/json']
|
||||||
|
export type ChartsUserFollowingRequest = operations['charts/user/following']['requestBody']['content']['application/json']
|
||||||
|
export type ChartsUserFollowingResponse = operations['charts/user/following']['responses']['200']['content']['application/json']
|
||||||
|
export type ChartsUserNotesRequest = operations['charts/user/notes']['requestBody']['content']['application/json']
|
||||||
|
export type ChartsUserNotesResponse = operations['charts/user/notes']['responses']['200']['content']['application/json']
|
||||||
|
export type ChartsUserPvRequest = operations['charts/user/pv']['requestBody']['content']['application/json']
|
||||||
|
export type ChartsUserPvResponse = operations['charts/user/pv']['responses']['200']['content']['application/json']
|
||||||
|
export type ChartsUserReactionsRequest = operations['charts/user/reactions']['requestBody']['content']['application/json']
|
||||||
|
export type ChartsUserReactionsResponse = operations['charts/user/reactions']['responses']['200']['content']['application/json']
|
||||||
|
export type ChartsUsersRequest = operations['charts/users']['requestBody']['content']['application/json']
|
||||||
|
export type ChartsUsersResponse = operations['charts/users']['responses']['200']['content']['application/json']
|
||||||
|
export type ClipsAddNoteRequest = operations['clips/add-note']['requestBody']['content']['application/json']
|
||||||
|
export type ClipsRemoveNoteRequest = operations['clips/remove-note']['requestBody']['content']['application/json']
|
||||||
|
export type ClipsCreateRequest = operations['clips/create']['requestBody']['content']['application/json']
|
||||||
|
export type ClipsCreateResponse = operations['clips/create']['responses']['200']['content']['application/json']
|
||||||
|
export type ClipsDeleteRequest = operations['clips/delete']['requestBody']['content']['application/json']
|
||||||
|
export type ClipsListResponse = operations['clips/list']['responses']['200']['content']['application/json']
|
||||||
|
export type ClipsNotesRequest = operations['clips/notes']['requestBody']['content']['application/json']
|
||||||
|
export type ClipsNotesResponse = operations['clips/notes']['responses']['200']['content']['application/json']
|
||||||
|
export type ClipsShowRequest = operations['clips/show']['requestBody']['content']['application/json']
|
||||||
|
export type ClipsShowResponse = operations['clips/show']['responses']['200']['content']['application/json']
|
||||||
|
export type ClipsUpdateRequest = operations['clips/update']['requestBody']['content']['application/json']
|
||||||
|
export type ClipsUpdateResponse = operations['clips/update']['responses']['200']['content']['application/json']
|
||||||
|
export type ClipsFavoriteRequest = operations['clips/favorite']['requestBody']['content']['application/json']
|
||||||
|
export type ClipsUnfavoriteRequest = operations['clips/unfavorite']['requestBody']['content']['application/json']
|
||||||
|
export type ClipsMyFavoritesResponse = operations['clips/my-favorites']['responses']['200']['content']['application/json']
|
||||||
|
export type DriveResponse = operations['drive']['responses']['200']['content']['application/json']
|
||||||
|
export type DriveFilesRequest = operations['drive/files']['requestBody']['content']['application/json']
|
||||||
|
export type DriveFilesResponse = operations['drive/files']['responses']['200']['content']['application/json']
|
||||||
|
export type DriveFilesAttachedNotesRequest = operations['drive/files/attached-notes']['requestBody']['content']['application/json']
|
||||||
|
export type DriveFilesAttachedNotesResponse = operations['drive/files/attached-notes']['responses']['200']['content']['application/json']
|
||||||
|
export type DriveFilesCheckExistenceRequest = operations['drive/files/check-existence']['requestBody']['content']['application/json']
|
||||||
|
export type DriveFilesCheckExistenceResponse = operations['drive/files/check-existence']['responses']['200']['content']['application/json']
|
||||||
|
export type DriveFilesCreateRequest = operations['drive/files/create']['requestBody']['content']['multipart/form-data']
|
||||||
|
export type DriveFilesCreateResponse = operations['drive/files/create']['responses']['200']['content']['application/json']
|
||||||
|
export type DriveFilesDeleteRequest = operations['drive/files/delete']['requestBody']['content']['application/json']
|
||||||
|
export type DriveFilesFindByHashRequest = operations['drive/files/find-by-hash']['requestBody']['content']['application/json']
|
||||||
|
export type DriveFilesFindByHashResponse = operations['drive/files/find-by-hash']['responses']['200']['content']['application/json']
|
||||||
|
export type DriveFilesFindRequest = operations['drive/files/find']['requestBody']['content']['application/json']
|
||||||
|
export type DriveFilesFindResponse = operations['drive/files/find']['responses']['200']['content']['application/json']
|
||||||
|
export type DriveFilesShowRequest = operations['drive/files/show']['requestBody']['content']['application/json']
|
||||||
|
export type DriveFilesShowResponse = operations['drive/files/show']['responses']['200']['content']['application/json']
|
||||||
|
export type DriveFilesUpdateRequest = operations['drive/files/update']['requestBody']['content']['application/json']
|
||||||
|
export type DriveFilesUpdateResponse = operations['drive/files/update']['responses']['200']['content']['application/json']
|
||||||
|
export type DriveFilesUploadFromUrlRequest = operations['drive/files/upload-from-url']['requestBody']['content']['application/json']
|
||||||
|
export type DriveFoldersRequest = operations['drive/folders']['requestBody']['content']['application/json']
|
||||||
|
export type DriveFoldersResponse = operations['drive/folders']['responses']['200']['content']['application/json']
|
||||||
|
export type DriveFoldersCreateRequest = operations['drive/folders/create']['requestBody']['content']['application/json']
|
||||||
|
export type DriveFoldersCreateResponse = operations['drive/folders/create']['responses']['200']['content']['application/json']
|
||||||
|
export type DriveFoldersDeleteRequest = operations['drive/folders/delete']['requestBody']['content']['application/json']
|
||||||
|
export type DriveFoldersFindRequest = operations['drive/folders/find']['requestBody']['content']['application/json']
|
||||||
|
export type DriveFoldersFindResponse = operations['drive/folders/find']['responses']['200']['content']['application/json']
|
||||||
|
export type DriveFoldersShowRequest = operations['drive/folders/show']['requestBody']['content']['application/json']
|
||||||
|
export type DriveFoldersShowResponse = operations['drive/folders/show']['responses']['200']['content']['application/json']
|
||||||
|
export type DriveFoldersUpdateRequest = operations['drive/folders/update']['requestBody']['content']['application/json']
|
||||||
|
export type DriveFoldersUpdateResponse = operations['drive/folders/update']['responses']['200']['content']['application/json']
|
||||||
|
export type DriveStreamRequest = operations['drive/stream']['requestBody']['content']['application/json']
|
||||||
|
export type DriveStreamResponse = operations['drive/stream']['responses']['200']['content']['application/json']
|
||||||
|
export type EmailAddressAvailableRequest = operations['email-address/available']['requestBody']['content']['application/json']
|
||||||
|
export type EmailAddressAvailableResponse = operations['email-address/available']['responses']['200']['content']['application/json']
|
||||||
|
export type EndpointRequest = operations['endpoint']['requestBody']['content']['application/json']
|
||||||
|
export type EndpointsResponse = operations['endpoints']['responses']['200']['content']['application/json']
|
||||||
|
export type FederationFollowersRequest = operations['federation/followers']['requestBody']['content']['application/json']
|
||||||
|
export type FederationFollowersResponse = operations['federation/followers']['responses']['200']['content']['application/json']
|
||||||
|
export type FederationFollowingRequest = operations['federation/following']['requestBody']['content']['application/json']
|
||||||
|
export type FederationFollowingResponse = operations['federation/following']['responses']['200']['content']['application/json']
|
||||||
|
export type FederationInstancesRequest = operations['federation/instances']['requestBody']['content']['application/json']
|
||||||
|
export type FederationInstancesResponse = operations['federation/instances']['responses']['200']['content']['application/json']
|
||||||
|
export type FederationShowInstanceRequest = operations['federation/show-instance']['requestBody']['content']['application/json']
|
||||||
|
export type FederationShowInstanceResponse = operations['federation/show-instance']['responses']['200']['content']['application/json']
|
||||||
|
export type FederationUpdateRemoteUserRequest = operations['federation/update-remote-user']['requestBody']['content']['application/json']
|
||||||
|
export type FederationUsersRequest = operations['federation/users']['requestBody']['content']['application/json']
|
||||||
|
export type FederationUsersResponse = operations['federation/users']['responses']['200']['content']['application/json']
|
||||||
|
export type FederationStatsRequest = operations['federation/stats']['requestBody']['content']['application/json']
|
||||||
|
export type FollowingCreateRequest = operations['following/create']['requestBody']['content']['application/json']
|
||||||
|
export type FollowingCreateResponse = operations['following/create']['responses']['200']['content']['application/json']
|
||||||
|
export type FollowingDeleteRequest = operations['following/delete']['requestBody']['content']['application/json']
|
||||||
|
export type FollowingDeleteResponse = operations['following/delete']['responses']['200']['content']['application/json']
|
||||||
|
export type FollowingUpdateRequest = operations['following/update']['requestBody']['content']['application/json']
|
||||||
|
export type FollowingUpdateResponse = operations['following/update']['responses']['200']['content']['application/json']
|
||||||
|
export type FollowingUpdateAllRequest = operations['following/update-all']['requestBody']['content']['application/json']
|
||||||
|
export type FollowingInvalidateRequest = operations['following/invalidate']['requestBody']['content']['application/json']
|
||||||
|
export type FollowingInvalidateResponse = operations['following/invalidate']['responses']['200']['content']['application/json']
|
||||||
|
export type FollowingRequestsAcceptRequest = operations['following/requests/accept']['requestBody']['content']['application/json']
|
||||||
|
export type FollowingRequestsCancelRequest = operations['following/requests/cancel']['requestBody']['content']['application/json']
|
||||||
|
export type FollowingRequestsCancelResponse = operations['following/requests/cancel']['responses']['200']['content']['application/json']
|
||||||
|
export type FollowingRequestsListRequest = operations['following/requests/list']['requestBody']['content']['application/json']
|
||||||
|
export type FollowingRequestsListResponse = operations['following/requests/list']['responses']['200']['content']['application/json']
|
||||||
|
export type FollowingRequestsRejectRequest = operations['following/requests/reject']['requestBody']['content']['application/json']
|
||||||
|
export type GalleryFeaturedRequest = operations['gallery/featured']['requestBody']['content']['application/json']
|
||||||
|
export type GalleryFeaturedResponse = operations['gallery/featured']['responses']['200']['content']['application/json']
|
||||||
|
export type GalleryPopularResponse = operations['gallery/popular']['responses']['200']['content']['application/json']
|
||||||
|
export type GalleryPostsRequest = operations['gallery/posts']['requestBody']['content']['application/json']
|
||||||
|
export type GalleryPostsResponse = operations['gallery/posts']['responses']['200']['content']['application/json']
|
||||||
|
export type GalleryPostsCreateRequest = operations['gallery/posts/create']['requestBody']['content']['application/json']
|
||||||
|
export type GalleryPostsCreateResponse = operations['gallery/posts/create']['responses']['200']['content']['application/json']
|
||||||
|
export type GalleryPostsDeleteRequest = operations['gallery/posts/delete']['requestBody']['content']['application/json']
|
||||||
|
export type GalleryPostsLikeRequest = operations['gallery/posts/like']['requestBody']['content']['application/json']
|
||||||
|
export type GalleryPostsShowRequest = operations['gallery/posts/show']['requestBody']['content']['application/json']
|
||||||
|
export type GalleryPostsShowResponse = operations['gallery/posts/show']['responses']['200']['content']['application/json']
|
||||||
|
export type GalleryPostsUnlikeRequest = operations['gallery/posts/unlike']['requestBody']['content']['application/json']
|
||||||
|
export type GalleryPostsUpdateRequest = operations['gallery/posts/update']['requestBody']['content']['application/json']
|
||||||
|
export type GalleryPostsUpdateResponse = operations['gallery/posts/update']['responses']['200']['content']['application/json']
|
||||||
|
export type GetAvatarDecorationsResponse = operations['get-avatar-decorations']['responses']['200']['content']['application/json']
|
||||||
|
export type HashtagsListRequest = operations['hashtags/list']['requestBody']['content']['application/json']
|
||||||
|
export type HashtagsListResponse = operations['hashtags/list']['responses']['200']['content']['application/json']
|
||||||
|
export type HashtagsSearchRequest = operations['hashtags/search']['requestBody']['content']['application/json']
|
||||||
|
export type HashtagsSearchResponse = operations['hashtags/search']['responses']['200']['content']['application/json']
|
||||||
|
export type HashtagsShowRequest = operations['hashtags/show']['requestBody']['content']['application/json']
|
||||||
|
export type HashtagsShowResponse = operations['hashtags/show']['responses']['200']['content']['application/json']
|
||||||
|
export type HashtagsTrendResponse = operations['hashtags/trend']['responses']['200']['content']['application/json']
|
||||||
|
export type HashtagsUsersRequest = operations['hashtags/users']['requestBody']['content']['application/json']
|
||||||
|
export type HashtagsUsersResponse = operations['hashtags/users']['responses']['200']['content']['application/json']
|
||||||
|
export type IResponse = operations['i']['responses']['200']['content']['application/json']
|
||||||
|
export type I2faDoneRequest = operations['i/2fa/done']['requestBody']['content']['application/json']
|
||||||
|
export type I2faKeyDoneRequest = operations['i/2fa/key-done']['requestBody']['content']['application/json']
|
||||||
|
export type I2faPasswordLessRequest = operations['i/2fa/password-less']['requestBody']['content']['application/json']
|
||||||
|
export type I2faRegisterKeyRequest = operations['i/2fa/register-key']['requestBody']['content']['application/json']
|
||||||
|
export type I2faRegisterRequest = operations['i/2fa/register']['requestBody']['content']['application/json']
|
||||||
|
export type I2faUpdateKeyRequest = operations['i/2fa/update-key']['requestBody']['content']['application/json']
|
||||||
|
export type I2faRemoveKeyRequest = operations['i/2fa/remove-key']['requestBody']['content']['application/json']
|
||||||
|
export type I2faUnregisterRequest = operations['i/2fa/unregister']['requestBody']['content']['application/json']
|
||||||
|
export type IAppsRequest = operations['i/apps']['requestBody']['content']['application/json']
|
||||||
|
export type IAuthorizedAppsRequest = operations['i/authorized-apps']['requestBody']['content']['application/json']
|
||||||
|
export type IClaimAchievementRequest = operations['i/claim-achievement']['requestBody']['content']['application/json']
|
||||||
|
export type IChangePasswordRequest = operations['i/change-password']['requestBody']['content']['application/json']
|
||||||
|
export type IDeleteAccountRequest = operations['i/delete-account']['requestBody']['content']['application/json']
|
||||||
|
export type IExportFollowingRequest = operations['i/export-following']['requestBody']['content']['application/json']
|
||||||
|
export type IFavoritesRequest = operations['i/favorites']['requestBody']['content']['application/json']
|
||||||
|
export type IFavoritesResponse = operations['i/favorites']['responses']['200']['content']['application/json']
|
||||||
|
export type IGalleryLikesRequest = operations['i/gallery/likes']['requestBody']['content']['application/json']
|
||||||
|
export type IGalleryLikesResponse = operations['i/gallery/likes']['responses']['200']['content']['application/json']
|
||||||
|
export type IGalleryPostsRequest = operations['i/gallery/posts']['requestBody']['content']['application/json']
|
||||||
|
export type IGalleryPostsResponse = operations['i/gallery/posts']['responses']['200']['content']['application/json']
|
||||||
|
export type IImportBlockingRequest = operations['i/import-blocking']['requestBody']['content']['application/json']
|
||||||
|
export type IImportFollowingRequest = operations['i/import-following']['requestBody']['content']['application/json']
|
||||||
|
export type IImportMutingRequest = operations['i/import-muting']['requestBody']['content']['application/json']
|
||||||
|
export type IImportUserListsRequest = operations['i/import-user-lists']['requestBody']['content']['application/json']
|
||||||
|
export type IImportAntennasRequest = operations['i/import-antennas']['requestBody']['content']['application/json']
|
||||||
|
export type INotificationsRequest = operations['i/notifications']['requestBody']['content']['application/json']
|
||||||
|
export type INotificationsResponse = operations['i/notifications']['responses']['200']['content']['application/json']
|
||||||
|
export type INotificationsGroupedRequest = operations['i/notifications-grouped']['requestBody']['content']['application/json']
|
||||||
|
export type INotificationsGroupedResponse = operations['i/notifications-grouped']['responses']['200']['content']['application/json']
|
||||||
|
export type IPageLikesRequest = operations['i/page-likes']['requestBody']['content']['application/json']
|
||||||
|
export type IPageLikesResponse = operations['i/page-likes']['responses']['200']['content']['application/json']
|
||||||
|
export type IPagesRequest = operations['i/pages']['requestBody']['content']['application/json']
|
||||||
|
export type IPagesResponse = operations['i/pages']['responses']['200']['content']['application/json']
|
||||||
|
export type IPinRequest = operations['i/pin']['requestBody']['content']['application/json']
|
||||||
|
export type IPinResponse = operations['i/pin']['responses']['200']['content']['application/json']
|
||||||
|
export type IReadAnnouncementRequest = operations['i/read-announcement']['requestBody']['content']['application/json']
|
||||||
|
export type IRegenerateTokenRequest = operations['i/regenerate-token']['requestBody']['content']['application/json']
|
||||||
|
export type IRegistryGetAllRequest = operations['i/registry/get-all']['requestBody']['content']['application/json']
|
||||||
|
export type IRegistryGetDetailRequest = operations['i/registry/get-detail']['requestBody']['content']['application/json']
|
||||||
|
export type IRegistryGetRequest = operations['i/registry/get']['requestBody']['content']['application/json']
|
||||||
|
export type IRegistryKeysWithTypeRequest = operations['i/registry/keys-with-type']['requestBody']['content']['application/json']
|
||||||
|
export type IRegistryKeysRequest = operations['i/registry/keys']['requestBody']['content']['application/json']
|
||||||
|
export type IRegistryRemoveRequest = operations['i/registry/remove']['requestBody']['content']['application/json']
|
||||||
|
export type IRegistrySetRequest = operations['i/registry/set']['requestBody']['content']['application/json']
|
||||||
|
export type IRevokeTokenRequest = operations['i/revoke-token']['requestBody']['content']['application/json']
|
||||||
|
export type ISigninHistoryRequest = operations['i/signin-history']['requestBody']['content']['application/json']
|
||||||
|
export type ISigninHistoryResponse = operations['i/signin-history']['responses']['200']['content']['application/json']
|
||||||
|
export type IUnpinRequest = operations['i/unpin']['requestBody']['content']['application/json']
|
||||||
|
export type IUnpinResponse = operations['i/unpin']['responses']['200']['content']['application/json']
|
||||||
|
export type IUpdateEmailRequest = operations['i/update-email']['requestBody']['content']['application/json']
|
||||||
|
export type IUpdateRequest = operations['i/update']['requestBody']['content']['application/json']
|
||||||
|
export type IUpdateResponse = operations['i/update']['responses']['200']['content']['application/json']
|
||||||
|
export type IMoveRequest = operations['i/move']['requestBody']['content']['application/json']
|
||||||
|
export type IWebhooksCreateRequest = operations['i/webhooks/create']['requestBody']['content']['application/json']
|
||||||
|
export type IWebhooksShowRequest = operations['i/webhooks/show']['requestBody']['content']['application/json']
|
||||||
|
export type IWebhooksUpdateRequest = operations['i/webhooks/update']['requestBody']['content']['application/json']
|
||||||
|
export type IWebhooksDeleteRequest = operations['i/webhooks/delete']['requestBody']['content']['application/json']
|
||||||
|
export type InviteCreateResponse = operations['invite/create']['responses']['200']['content']['application/json']
|
||||||
|
export type InviteDeleteRequest = operations['invite/delete']['requestBody']['content']['application/json']
|
||||||
|
export type InviteListRequest = operations['invite/list']['requestBody']['content']['application/json']
|
||||||
|
export type InviteListResponse = operations['invite/list']['responses']['200']['content']['application/json']
|
||||||
|
export type InviteLimitResponse = operations['invite/limit']['responses']['200']['content']['application/json']
|
||||||
|
export type MetaRequest = operations['meta']['requestBody']['content']['application/json']
|
||||||
|
export type MetaResponse = operations['meta']['responses']['200']['content']['application/json']
|
||||||
|
export type EmojisResponse = operations['emojis']['responses']['200']['content']['application/json']
|
||||||
|
export type EmojiRequest = operations['emoji']['requestBody']['content']['application/json']
|
||||||
|
export type EmojiResponse = operations['emoji']['responses']['200']['content']['application/json']
|
||||||
|
export type MiauthGenTokenRequest = operations['miauth/gen-token']['requestBody']['content']['application/json']
|
||||||
|
export type MiauthGenTokenResponse = operations['miauth/gen-token']['responses']['200']['content']['application/json']
|
||||||
|
export type MuteCreateRequest = operations['mute/create']['requestBody']['content']['application/json']
|
||||||
|
export type MuteDeleteRequest = operations['mute/delete']['requestBody']['content']['application/json']
|
||||||
|
export type MuteListRequest = operations['mute/list']['requestBody']['content']['application/json']
|
||||||
|
export type MuteListResponse = operations['mute/list']['responses']['200']['content']['application/json']
|
||||||
|
export type RenoteMuteCreateRequest = operations['renote-mute/create']['requestBody']['content']['application/json']
|
||||||
|
export type RenoteMuteDeleteRequest = operations['renote-mute/delete']['requestBody']['content']['application/json']
|
||||||
|
export type RenoteMuteListRequest = operations['renote-mute/list']['requestBody']['content']['application/json']
|
||||||
|
export type RenoteMuteListResponse = operations['renote-mute/list']['responses']['200']['content']['application/json']
|
||||||
|
export type MyAppsRequest = operations['my/apps']['requestBody']['content']['application/json']
|
||||||
|
export type MyAppsResponse = operations['my/apps']['responses']['200']['content']['application/json']
|
||||||
|
export type NotesRequest = operations['notes']['requestBody']['content']['application/json']
|
||||||
|
export type NotesResponse = operations['notes']['responses']['200']['content']['application/json']
|
||||||
|
export type NotesChildrenRequest = operations['notes/children']['requestBody']['content']['application/json']
|
||||||
|
export type NotesChildrenResponse = operations['notes/children']['responses']['200']['content']['application/json']
|
||||||
|
export type NotesClipsRequest = operations['notes/clips']['requestBody']['content']['application/json']
|
||||||
|
export type NotesClipsResponse = operations['notes/clips']['responses']['200']['content']['application/json']
|
||||||
|
export type NotesConversationRequest = operations['notes/conversation']['requestBody']['content']['application/json']
|
||||||
|
export type NotesConversationResponse = operations['notes/conversation']['responses']['200']['content']['application/json']
|
||||||
|
export type NotesCreateRequest = operations['notes/create']['requestBody']['content']['application/json']
|
||||||
|
export type NotesCreateResponse = operations['notes/create']['responses']['200']['content']['application/json']
|
||||||
|
export type NotesDeleteRequest = operations['notes/delete']['requestBody']['content']['application/json']
|
||||||
|
export type NotesFavoritesCreateRequest = operations['notes/favorites/create']['requestBody']['content']['application/json']
|
||||||
|
export type NotesFavoritesDeleteRequest = operations['notes/favorites/delete']['requestBody']['content']['application/json']
|
||||||
|
export type NotesFeaturedRequest = operations['notes/featured']['requestBody']['content']['application/json']
|
||||||
|
export type NotesFeaturedResponse = operations['notes/featured']['responses']['200']['content']['application/json']
|
||||||
|
export type NotesGlobalTimelineRequest = operations['notes/global-timeline']['requestBody']['content']['application/json']
|
||||||
|
export type NotesGlobalTimelineResponse = operations['notes/global-timeline']['responses']['200']['content']['application/json']
|
||||||
|
export type NotesHybridTimelineRequest = operations['notes/hybrid-timeline']['requestBody']['content']['application/json']
|
||||||
|
export type NotesHybridTimelineResponse = operations['notes/hybrid-timeline']['responses']['200']['content']['application/json']
|
||||||
|
export type NotesLocalTimelineRequest = operations['notes/local-timeline']['requestBody']['content']['application/json']
|
||||||
|
export type NotesLocalTimelineResponse = operations['notes/local-timeline']['responses']['200']['content']['application/json']
|
||||||
|
export type NotesMentionsRequest = operations['notes/mentions']['requestBody']['content']['application/json']
|
||||||
|
export type NotesMentionsResponse = operations['notes/mentions']['responses']['200']['content']['application/json']
|
||||||
|
export type NotesPollsRecommendationRequest = operations['notes/polls/recommendation']['requestBody']['content']['application/json']
|
||||||
|
export type NotesPollsRecommendationResponse = operations['notes/polls/recommendation']['responses']['200']['content']['application/json']
|
||||||
|
export type NotesPollsVoteRequest = operations['notes/polls/vote']['requestBody']['content']['application/json']
|
||||||
|
export type NotesReactionsRequest = operations['notes/reactions']['requestBody']['content']['application/json']
|
||||||
|
export type NotesReactionsResponse = operations['notes/reactions']['responses']['200']['content']['application/json']
|
||||||
|
export type NotesReactionsCreateRequest = operations['notes/reactions/create']['requestBody']['content']['application/json']
|
||||||
|
export type NotesReactionsDeleteRequest = operations['notes/reactions/delete']['requestBody']['content']['application/json']
|
||||||
|
export type NotesRenotesRequest = operations['notes/renotes']['requestBody']['content']['application/json']
|
||||||
|
export type NotesRenotesResponse = operations['notes/renotes']['responses']['200']['content']['application/json']
|
||||||
|
export type NotesRepliesRequest = operations['notes/replies']['requestBody']['content']['application/json']
|
||||||
|
export type NotesRepliesResponse = operations['notes/replies']['responses']['200']['content']['application/json']
|
||||||
|
export type NotesSearchByTagRequest = operations['notes/search-by-tag']['requestBody']['content']['application/json']
|
||||||
|
export type NotesSearchByTagResponse = operations['notes/search-by-tag']['responses']['200']['content']['application/json']
|
||||||
|
export type NotesSearchRequest = operations['notes/search']['requestBody']['content']['application/json']
|
||||||
|
export type NotesSearchResponse = operations['notes/search']['responses']['200']['content']['application/json']
|
||||||
|
export type NotesShowRequest = operations['notes/show']['requestBody']['content']['application/json']
|
||||||
|
export type NotesShowResponse = operations['notes/show']['responses']['200']['content']['application/json']
|
||||||
|
export type NotesStateRequest = operations['notes/state']['requestBody']['content']['application/json']
|
||||||
|
export type NotesStateResponse = operations['notes/state']['responses']['200']['content']['application/json']
|
||||||
|
export type NotesThreadMutingCreateRequest = operations['notes/thread-muting/create']['requestBody']['content']['application/json']
|
||||||
|
export type NotesThreadMutingDeleteRequest = operations['notes/thread-muting/delete']['requestBody']['content']['application/json']
|
||||||
|
export type NotesTimelineRequest = operations['notes/timeline']['requestBody']['content']['application/json']
|
||||||
|
export type NotesTimelineResponse = operations['notes/timeline']['responses']['200']['content']['application/json']
|
||||||
|
export type NotesTranslateRequest = operations['notes/translate']['requestBody']['content']['application/json']
|
||||||
|
export type NotesTranslateResponse = operations['notes/translate']['responses']['200']['content']['application/json']
|
||||||
|
export type NotesUnrenoteRequest = operations['notes/unrenote']['requestBody']['content']['application/json']
|
||||||
|
export type NotesUserListTimelineRequest = operations['notes/user-list-timeline']['requestBody']['content']['application/json']
|
||||||
|
export type NotesUserListTimelineResponse = operations['notes/user-list-timeline']['responses']['200']['content']['application/json']
|
||||||
|
export type NotificationsCreateRequest = operations['notifications/create']['requestBody']['content']['application/json']
|
||||||
|
export type PagePushRequest = operations['page-push']['requestBody']['content']['application/json']
|
||||||
|
export type PagesCreateRequest = operations['pages/create']['requestBody']['content']['application/json']
|
||||||
|
export type PagesCreateResponse = operations['pages/create']['responses']['200']['content']['application/json']
|
||||||
|
export type PagesDeleteRequest = operations['pages/delete']['requestBody']['content']['application/json']
|
||||||
|
export type PagesFeaturedResponse = operations['pages/featured']['responses']['200']['content']['application/json']
|
||||||
|
export type PagesLikeRequest = operations['pages/like']['requestBody']['content']['application/json']
|
||||||
|
export type PagesShowRequest = operations['pages/show']['requestBody']['content']['application/json']
|
||||||
|
export type PagesShowResponse = operations['pages/show']['responses']['200']['content']['application/json']
|
||||||
|
export type PagesUnlikeRequest = operations['pages/unlike']['requestBody']['content']['application/json']
|
||||||
|
export type PagesUpdateRequest = operations['pages/update']['requestBody']['content']['application/json']
|
||||||
|
export type FlashCreateRequest = operations['flash/create']['requestBody']['content']['application/json']
|
||||||
|
export type FlashDeleteRequest = operations['flash/delete']['requestBody']['content']['application/json']
|
||||||
|
export type FlashFeaturedResponse = operations['flash/featured']['responses']['200']['content']['application/json']
|
||||||
|
export type FlashLikeRequest = operations['flash/like']['requestBody']['content']['application/json']
|
||||||
|
export type FlashShowRequest = operations['flash/show']['requestBody']['content']['application/json']
|
||||||
|
export type FlashShowResponse = operations['flash/show']['responses']['200']['content']['application/json']
|
||||||
|
export type FlashUnlikeRequest = operations['flash/unlike']['requestBody']['content']['application/json']
|
||||||
|
export type FlashUpdateRequest = operations['flash/update']['requestBody']['content']['application/json']
|
||||||
|
export type FlashMyRequest = operations['flash/my']['requestBody']['content']['application/json']
|
||||||
|
export type FlashMyResponse = operations['flash/my']['responses']['200']['content']['application/json']
|
||||||
|
export type FlashMyLikesRequest = operations['flash/my-likes']['requestBody']['content']['application/json']
|
||||||
|
export type FlashMyLikesResponse = operations['flash/my-likes']['responses']['200']['content']['application/json']
|
||||||
|
export type PingResponse = operations['ping']['responses']['200']['content']['application/json']
|
||||||
|
export type PinnedUsersResponse = operations['pinned-users']['responses']['200']['content']['application/json']
|
||||||
|
export type PromoReadRequest = operations['promo/read']['requestBody']['content']['application/json']
|
||||||
|
export type RolesListResponse = operations['roles/list']['responses']['200']['content']['application/json']
|
||||||
|
export type RolesShowRequest = operations['roles/show']['requestBody']['content']['application/json']
|
||||||
|
export type RolesShowResponse = operations['roles/show']['responses']['200']['content']['application/json']
|
||||||
|
export type RolesUsersRequest = operations['roles/users']['requestBody']['content']['application/json']
|
||||||
|
export type RolesNotesRequest = operations['roles/notes']['requestBody']['content']['application/json']
|
||||||
|
export type RolesNotesResponse = operations['roles/notes']['responses']['200']['content']['application/json']
|
||||||
|
export type RequestResetPasswordRequest = operations['request-reset-password']['requestBody']['content']['application/json']
|
||||||
|
export type ResetPasswordRequest = operations['reset-password']['requestBody']['content']['application/json']
|
||||||
|
export type StatsResponse = operations['stats']['responses']['200']['content']['application/json']
|
||||||
|
export type SwShowRegistrationRequest = operations['sw/show-registration']['requestBody']['content']['application/json']
|
||||||
|
export type SwShowRegistrationResponse = operations['sw/show-registration']['responses']['200']['content']['application/json']
|
||||||
|
export type SwUpdateRegistrationRequest = operations['sw/update-registration']['requestBody']['content']['application/json']
|
||||||
|
export type SwUpdateRegistrationResponse = operations['sw/update-registration']['responses']['200']['content']['application/json']
|
||||||
|
export type SwRegisterRequest = operations['sw/register']['requestBody']['content']['application/json']
|
||||||
|
export type SwRegisterResponse = operations['sw/register']['responses']['200']['content']['application/json']
|
||||||
|
export type SwUnregisterRequest = operations['sw/unregister']['requestBody']['content']['application/json']
|
||||||
|
export type TestRequest = operations['test']['requestBody']['content']['application/json']
|
||||||
|
export type UsernameAvailableRequest = operations['username/available']['requestBody']['content']['application/json']
|
||||||
|
export type UsernameAvailableResponse = operations['username/available']['responses']['200']['content']['application/json']
|
||||||
|
export type UsersRequest = operations['users']['requestBody']['content']['application/json']
|
||||||
|
export type UsersResponse = operations['users']['responses']['200']['content']['application/json']
|
||||||
|
export type UsersClipsRequest = operations['users/clips']['requestBody']['content']['application/json']
|
||||||
|
export type UsersClipsResponse = operations['users/clips']['responses']['200']['content']['application/json']
|
||||||
|
export type UsersFollowersRequest = operations['users/followers']['requestBody']['content']['application/json']
|
||||||
|
export type UsersFollowersResponse = operations['users/followers']['responses']['200']['content']['application/json']
|
||||||
|
export type UsersFollowingRequest = operations['users/following']['requestBody']['content']['application/json']
|
||||||
|
export type UsersFollowingResponse = operations['users/following']['responses']['200']['content']['application/json']
|
||||||
|
export type UsersGalleryPostsRequest = operations['users/gallery/posts']['requestBody']['content']['application/json']
|
||||||
|
export type UsersGalleryPostsResponse = operations['users/gallery/posts']['responses']['200']['content']['application/json']
|
||||||
|
export type UsersGetFrequentlyRepliedUsersRequest = operations['users/get-frequently-replied-users']['requestBody']['content']['application/json']
|
||||||
|
export type UsersGetFrequentlyRepliedUsersResponse = operations['users/get-frequently-replied-users']['responses']['200']['content']['application/json']
|
||||||
|
export type UsersFeaturedNotesRequest = operations['users/featured-notes']['requestBody']['content']['application/json']
|
||||||
|
export type UsersFeaturedNotesResponse = operations['users/featured-notes']['responses']['200']['content']['application/json']
|
||||||
|
export type UsersListsCreateRequest = operations['users/lists/create']['requestBody']['content']['application/json']
|
||||||
|
export type UsersListsCreateResponse = operations['users/lists/create']['responses']['200']['content']['application/json']
|
||||||
|
export type UsersListsDeleteRequest = operations['users/lists/delete']['requestBody']['content']['application/json']
|
||||||
|
export type UsersListsListRequest = operations['users/lists/list']['requestBody']['content']['application/json']
|
||||||
|
export type UsersListsListResponse = operations['users/lists/list']['responses']['200']['content']['application/json']
|
||||||
|
export type UsersListsPullRequest = operations['users/lists/pull']['requestBody']['content']['application/json']
|
||||||
|
export type UsersListsPushRequest = operations['users/lists/push']['requestBody']['content']['application/json']
|
||||||
|
export type UsersListsShowRequest = operations['users/lists/show']['requestBody']['content']['application/json']
|
||||||
|
export type UsersListsShowResponse = operations['users/lists/show']['responses']['200']['content']['application/json']
|
||||||
|
export type UsersListsFavoriteRequest = operations['users/lists/favorite']['requestBody']['content']['application/json']
|
||||||
|
export type UsersListsUnfavoriteRequest = operations['users/lists/unfavorite']['requestBody']['content']['application/json']
|
||||||
|
export type UsersListsUpdateRequest = operations['users/lists/update']['requestBody']['content']['application/json']
|
||||||
|
export type UsersListsUpdateResponse = operations['users/lists/update']['responses']['200']['content']['application/json']
|
||||||
|
export type UsersListsCreateFromPublicRequest = operations['users/lists/create-from-public']['requestBody']['content']['application/json']
|
||||||
|
export type UsersListsCreateFromPublicResponse = operations['users/lists/create-from-public']['responses']['200']['content']['application/json']
|
||||||
|
export type UsersListsUpdateMembershipRequest = operations['users/lists/update-membership']['requestBody']['content']['application/json']
|
||||||
|
export type UsersListsGetMembershipsRequest = operations['users/lists/get-memberships']['requestBody']['content']['application/json']
|
||||||
|
export type UsersNotesRequest = operations['users/notes']['requestBody']['content']['application/json']
|
||||||
|
export type UsersNotesResponse = operations['users/notes']['responses']['200']['content']['application/json']
|
||||||
|
export type UsersPagesRequest = operations['users/pages']['requestBody']['content']['application/json']
|
||||||
|
export type UsersPagesResponse = operations['users/pages']['responses']['200']['content']['application/json']
|
||||||
|
export type UsersFlashsRequest = operations['users/flashs']['requestBody']['content']['application/json']
|
||||||
|
export type UsersFlashsResponse = operations['users/flashs']['responses']['200']['content']['application/json']
|
||||||
|
export type UsersReactionsRequest = operations['users/reactions']['requestBody']['content']['application/json']
|
||||||
|
export type UsersReactionsResponse = operations['users/reactions']['responses']['200']['content']['application/json']
|
||||||
|
export type UsersRecommendationRequest = operations['users/recommendation']['requestBody']['content']['application/json']
|
||||||
|
export type UsersRecommendationResponse = operations['users/recommendation']['responses']['200']['content']['application/json']
|
||||||
|
export type UsersRelationRequest = operations['users/relation']['requestBody']['content']['application/json']
|
||||||
|
export type UsersRelationResponse = operations['users/relation']['responses']['200']['content']['application/json']
|
||||||
|
export type UsersReportAbuseRequest = operations['users/report-abuse']['requestBody']['content']['application/json']
|
||||||
|
export type UsersSearchByUsernameAndHostRequest = operations['users/search-by-username-and-host']['requestBody']['content']['application/json']
|
||||||
|
export type UsersSearchByUsernameAndHostResponse = operations['users/search-by-username-and-host']['responses']['200']['content']['application/json']
|
||||||
|
export type UsersSearchRequest = operations['users/search']['requestBody']['content']['application/json']
|
||||||
|
export type UsersSearchResponse = operations['users/search']['responses']['200']['content']['application/json']
|
||||||
|
export type UsersShowRequest = operations['users/show']['requestBody']['content']['application/json']
|
||||||
|
export type UsersShowResponse = operations['users/show']['responses']['200']['content']['application/json']
|
||||||
|
export type UsersAchievementsRequest = operations['users/achievements']['requestBody']['content']['application/json']
|
||||||
|
export type UsersUpdateMemoRequest = operations['users/update-memo']['requestBody']['content']['application/json']
|
||||||
|
export type FetchRssRequest = operations['fetch-rss']['requestBody']['content']['application/json']
|
||||||
|
export type FetchExternalResourcesRequest = operations['fetch-external-resources']['requestBody']['content']['application/json']
|
||||||
|
export type RetentionResponse = operations['retention']['responses']['200']['content']['application/json']
|
43
packages/akkordian.js/src/autogen/models.ts
Normal file
43
packages/akkordian.js/src/autogen/models.ts
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
//
|
||||||
|
// Generated at: 2023-12-20T17:05:54.782Z
|
||||||
|
// Version: 2023.12.0-beta.5
|
||||||
|
//
|
||||||
|
|
||||||
|
import { components } from './types'
|
||||||
|
|
||||||
|
export type Error = components['schemas']['Error']
|
||||||
|
export type UserLite = components['schemas']['UserLite']
|
||||||
|
export type UserDetailedNotMeOnly = components['schemas']['UserDetailedNotMeOnly']
|
||||||
|
export type MeDetailedOnly = components['schemas']['MeDetailedOnly']
|
||||||
|
export type UserDetailedNotMe = components['schemas']['UserDetailedNotMe']
|
||||||
|
export type MeDetailed = components['schemas']['MeDetailed']
|
||||||
|
export type UserDetailed = components['schemas']['UserDetailed']
|
||||||
|
export type User = components['schemas']['User']
|
||||||
|
export type UserList = components['schemas']['UserList']
|
||||||
|
export type Announcement = components['schemas']['Announcement']
|
||||||
|
export type App = components['schemas']['App']
|
||||||
|
export type Note = components['schemas']['Note']
|
||||||
|
export type NoteReaction = components['schemas']['NoteReaction']
|
||||||
|
export type NoteFavorite = components['schemas']['NoteFavorite']
|
||||||
|
export type Notification = components['schemas']['Notification']
|
||||||
|
export type DriveFile = components['schemas']['DriveFile']
|
||||||
|
export type DriveFolder = components['schemas']['DriveFolder']
|
||||||
|
export type Following = components['schemas']['Following']
|
||||||
|
export type Muting = components['schemas']['Muting']
|
||||||
|
export type RenoteMuting = components['schemas']['RenoteMuting']
|
||||||
|
export type Blocking = components['schemas']['Blocking']
|
||||||
|
export type Hashtag = components['schemas']['Hashtag']
|
||||||
|
export type InviteCode = components['schemas']['InviteCode']
|
||||||
|
export type Page = components['schemas']['Page']
|
||||||
|
export type Channel = components['schemas']['Channel']
|
||||||
|
export type QueueCount = components['schemas']['QueueCount']
|
||||||
|
export type Antenna = components['schemas']['Antenna']
|
||||||
|
export type Clip = components['schemas']['Clip']
|
||||||
|
export type FederationInstance = components['schemas']['FederationInstance']
|
||||||
|
export type GalleryPost = components['schemas']['GalleryPost']
|
||||||
|
export type EmojiSimple = components['schemas']['EmojiSimple']
|
||||||
|
export type EmojiDetailed = components['schemas']['EmojiDetailed']
|
||||||
|
export type Flash = components['schemas']['Flash']
|
||||||
|
export type Signin = components['schemas']['Signin']
|
||||||
|
export type RoleLite = components['schemas']['RoleLite']
|
||||||
|
export type Role = components['schemas']['Role']
|
25051
packages/akkordian.js/src/autogen/types.ts
Normal file
25051
packages/akkordian.js/src/autogen/types.ts
Normal file
File diff suppressed because it is too large
Load diff
291
packages/akkordian.js/src/consts.ts
Normal file
291
packages/akkordian.js/src/consts.ts
Normal file
|
@ -0,0 +1,291 @@
|
||||||
|
export type ModerationLogPayloads = {
|
||||||
|
addCustomEmoji: {
|
||||||
|
emoji: any
|
||||||
|
emojiId: string
|
||||||
|
}
|
||||||
|
assignRole: {
|
||||||
|
expiresAt: string | null
|
||||||
|
roleId: string
|
||||||
|
roleName: string
|
||||||
|
userHost: string | null
|
||||||
|
userId: string
|
||||||
|
userUsername: string
|
||||||
|
}
|
||||||
|
clearQueue: Record<string, never>
|
||||||
|
createAvatarDecoration: {
|
||||||
|
avatarDecoration: any
|
||||||
|
avaterDecorationId: string
|
||||||
|
}
|
||||||
|
createGlobalAnnouncement: {
|
||||||
|
announcement: any
|
||||||
|
announcementId: string
|
||||||
|
}
|
||||||
|
createInvitation: {
|
||||||
|
invitations: any[]
|
||||||
|
}
|
||||||
|
createRole: {
|
||||||
|
role: any
|
||||||
|
roleId: string
|
||||||
|
}
|
||||||
|
createUserAnnouncement: {
|
||||||
|
announcement: any
|
||||||
|
announcementId: string
|
||||||
|
userHost: string | null
|
||||||
|
userId: string
|
||||||
|
userUsername: string
|
||||||
|
}
|
||||||
|
deleteAvatarDecoration: {
|
||||||
|
avatarDecoration: any
|
||||||
|
avatarDecorationId: string
|
||||||
|
}
|
||||||
|
deleteCustomEmoji: {
|
||||||
|
emoji: any
|
||||||
|
emojiId: string
|
||||||
|
}
|
||||||
|
deleteDriveFile: {
|
||||||
|
fileId: string
|
||||||
|
fileUserHost: string | null
|
||||||
|
fileUserId: string | null
|
||||||
|
fileUserUsername: string | null
|
||||||
|
}
|
||||||
|
deleteGlobalAnnouncement: {
|
||||||
|
announcement: any
|
||||||
|
announcementId: string
|
||||||
|
}
|
||||||
|
deleteNote: {
|
||||||
|
note: any
|
||||||
|
noteId: string
|
||||||
|
noteUserHost: string | null
|
||||||
|
noteUserId: string
|
||||||
|
noteUserUsername: string
|
||||||
|
}
|
||||||
|
deleteRole: {
|
||||||
|
role: any
|
||||||
|
roleId: string
|
||||||
|
}
|
||||||
|
deleteUserAnnouncement: {
|
||||||
|
announcement: any
|
||||||
|
announcementId: string
|
||||||
|
userHost: string | null
|
||||||
|
userId: string
|
||||||
|
userUsername: string
|
||||||
|
}
|
||||||
|
markSensitiveDriveFile: {
|
||||||
|
fileId: string
|
||||||
|
fileUserHost: string | null
|
||||||
|
fileUserId: string | null
|
||||||
|
fileUserUsername: string | null
|
||||||
|
}
|
||||||
|
promoteQueue: Record<string, never>
|
||||||
|
resetPassword: {
|
||||||
|
userHost: string | null
|
||||||
|
userId: string
|
||||||
|
userUsername: string
|
||||||
|
}
|
||||||
|
resolveAbuseReport: {
|
||||||
|
forwarded: boolean
|
||||||
|
report: any
|
||||||
|
reportId: string
|
||||||
|
}
|
||||||
|
suspend: {
|
||||||
|
userHost: string | null
|
||||||
|
userId: string
|
||||||
|
userUsername: string
|
||||||
|
}
|
||||||
|
suspendRemoteInstance: {
|
||||||
|
id: string
|
||||||
|
host: string
|
||||||
|
}
|
||||||
|
unassignRole: {
|
||||||
|
roleId: string
|
||||||
|
roleName: string
|
||||||
|
userHost: string | null
|
||||||
|
userId: string
|
||||||
|
userUsername: string
|
||||||
|
}
|
||||||
|
unmarkSensitiveDriveFile: {
|
||||||
|
fileId: string
|
||||||
|
fileUserHost: string | null
|
||||||
|
fileUserId: string | null
|
||||||
|
fileUserUsername: string | null
|
||||||
|
}
|
||||||
|
unsetUserAvatar: {
|
||||||
|
fileId: string
|
||||||
|
userHost: string | null
|
||||||
|
userId: string
|
||||||
|
userUsername: string
|
||||||
|
}
|
||||||
|
unsetUserBanner: {
|
||||||
|
fileId: string
|
||||||
|
userHost: string | null
|
||||||
|
userId: string
|
||||||
|
userUsername: string
|
||||||
|
}
|
||||||
|
unsuspend: {
|
||||||
|
userHost: string | null
|
||||||
|
userId: string
|
||||||
|
userUsername: string
|
||||||
|
}
|
||||||
|
unsuspendRemoteInstance: {
|
||||||
|
id: string
|
||||||
|
host: string
|
||||||
|
}
|
||||||
|
updateAvatarDecoration: {
|
||||||
|
after: any
|
||||||
|
avatarDecorationId: string
|
||||||
|
before: any
|
||||||
|
}
|
||||||
|
updateCustomEmoji: {
|
||||||
|
after: any
|
||||||
|
before: any
|
||||||
|
emojiId: string
|
||||||
|
}
|
||||||
|
updateGlobalAnnouncement: {
|
||||||
|
after: any
|
||||||
|
announcementId: string
|
||||||
|
before: any
|
||||||
|
}
|
||||||
|
updateRole: {
|
||||||
|
after: any
|
||||||
|
before: any
|
||||||
|
roleId: string
|
||||||
|
}
|
||||||
|
updateUserAnnouncement: {
|
||||||
|
after: any
|
||||||
|
announcementId: string
|
||||||
|
before: any
|
||||||
|
userHost: string | null
|
||||||
|
userId: string
|
||||||
|
userUsername: string
|
||||||
|
}
|
||||||
|
updateUserNote: {
|
||||||
|
after: string | null
|
||||||
|
before: string | null
|
||||||
|
userHost: string | null
|
||||||
|
userId: string
|
||||||
|
userUsername: string
|
||||||
|
}
|
||||||
|
updateServerSettings: {
|
||||||
|
after: any | null
|
||||||
|
before: any | null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const followersVisibilities = [
|
||||||
|
'followers',
|
||||||
|
'private',
|
||||||
|
'public'
|
||||||
|
] as const
|
||||||
|
|
||||||
|
export const followingVisibilities = [
|
||||||
|
'followers',
|
||||||
|
'private',
|
||||||
|
'public'
|
||||||
|
] as const
|
||||||
|
|
||||||
|
export const moderationLogTypes = [
|
||||||
|
'addCustomEmoji',
|
||||||
|
'assignRole',
|
||||||
|
'clearQueue',
|
||||||
|
'createAvatarDecoration',
|
||||||
|
'createGlobalAnnouncement',
|
||||||
|
'createInvitation',
|
||||||
|
'createRole',
|
||||||
|
'createUserAnnouncement',
|
||||||
|
'deleteAvatarDecoration',
|
||||||
|
'deleteCustomEmoji',
|
||||||
|
'deleteDriveFile',
|
||||||
|
'deleteGlobalAnnouncement',
|
||||||
|
'deleteNote',
|
||||||
|
'deleteRole',
|
||||||
|
'deleteUserAnnouncement',
|
||||||
|
'markSensitiveDriveFile',
|
||||||
|
'promoteQueue',
|
||||||
|
'resetPassword',
|
||||||
|
'resolveAbuseReport',
|
||||||
|
'suspend',
|
||||||
|
'suspendRemoteInstance',
|
||||||
|
'unassignRole',
|
||||||
|
'unmarkSensitiveDriveFile',
|
||||||
|
'unsetUserAvatar',
|
||||||
|
'unsetUserBanner',
|
||||||
|
'unsuspend',
|
||||||
|
'unsuspendRemoteInstance',
|
||||||
|
'updateAvatarDecoration',
|
||||||
|
'updateCustomEmoji',
|
||||||
|
'updateGlobalAnnouncement',
|
||||||
|
'updateRole',
|
||||||
|
'updateServerSettings',
|
||||||
|
'updateUserAnnouncement',
|
||||||
|
'updateUserNote'
|
||||||
|
] as const
|
||||||
|
|
||||||
|
export const mutedNoteReasons = [
|
||||||
|
'manual',
|
||||||
|
'other',
|
||||||
|
'spam',
|
||||||
|
'word'
|
||||||
|
] as const
|
||||||
|
|
||||||
|
export const noteVisibilities = [
|
||||||
|
'followers',
|
||||||
|
'home',
|
||||||
|
'public',
|
||||||
|
'specified'
|
||||||
|
] as const
|
||||||
|
|
||||||
|
export const notificationTypes = [
|
||||||
|
'achievementEarned',
|
||||||
|
'app',
|
||||||
|
'follow',
|
||||||
|
'followRequestAccepted',
|
||||||
|
'groupInvited',
|
||||||
|
'mention',
|
||||||
|
'note',
|
||||||
|
'pollEnded',
|
||||||
|
'pollVote',
|
||||||
|
'quote',
|
||||||
|
'reaction',
|
||||||
|
'receiveFollowRequest',
|
||||||
|
'renote',
|
||||||
|
'reply'
|
||||||
|
] as const
|
||||||
|
|
||||||
|
export const permissions = [
|
||||||
|
'read:account',
|
||||||
|
'read:blocks',
|
||||||
|
'read:channels',
|
||||||
|
'read:drive',
|
||||||
|
'read:favorites',
|
||||||
|
'read:flash',
|
||||||
|
'read:flash-likes',
|
||||||
|
'read:following',
|
||||||
|
'read:gallery',
|
||||||
|
'read:gallery-likes',
|
||||||
|
'read:messaging',
|
||||||
|
'read:mutes',
|
||||||
|
'read:notifications',
|
||||||
|
'read:page-likes',
|
||||||
|
'read:pages',
|
||||||
|
'read:reactions',
|
||||||
|
'read:user-groups',
|
||||||
|
'write:account',
|
||||||
|
'write:blocks',
|
||||||
|
'write:channels',
|
||||||
|
'write:drive',
|
||||||
|
'write:favorites',
|
||||||
|
'write:flash',
|
||||||
|
'write:flash-likes',
|
||||||
|
'write:following',
|
||||||
|
'write:gallery',
|
||||||
|
'write:gallery-likes',
|
||||||
|
'write:messaging',
|
||||||
|
'write:mutes',
|
||||||
|
'write:notes',
|
||||||
|
'write:notifications',
|
||||||
|
'write:page-likes',
|
||||||
|
'write:pages',
|
||||||
|
'write:reactions',
|
||||||
|
'write:user-groups',
|
||||||
|
'write:votes'
|
||||||
|
] as const
|
183
packages/akkordian.js/src/entities.ts
Normal file
183
packages/akkordian.js/src/entities.ts
Normal file
|
@ -0,0 +1,183 @@
|
||||||
|
import { ModerationLogPayloads } from '@/consts'
|
||||||
|
import {
|
||||||
|
Announcement,
|
||||||
|
EmojiDetailed,
|
||||||
|
Page,
|
||||||
|
User,
|
||||||
|
UserDetailed
|
||||||
|
} from '@/autogen/models'
|
||||||
|
|
||||||
|
export type AnnouncementCreated = {
|
||||||
|
announcement: Announcement
|
||||||
|
}
|
||||||
|
|
||||||
|
export type DateString = string
|
||||||
|
|
||||||
|
export type EmojiAdded = {
|
||||||
|
emoji: EmojiDetailed
|
||||||
|
}
|
||||||
|
|
||||||
|
export type EmojiDeleted = {
|
||||||
|
emojis: EmojiDetailed[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type EmojiUpdated = {
|
||||||
|
emojis: EmojiDetailed[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ID = string
|
||||||
|
|
||||||
|
export type ModerationLog = {
|
||||||
|
id: ID
|
||||||
|
user: UserDetailed | null
|
||||||
|
userId: User['id']
|
||||||
|
createdAt: DateString
|
||||||
|
} & ({
|
||||||
|
info: ModerationLogPayloads['addCustomEmoji']
|
||||||
|
type: 'addCustomEmoji'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['assignRole']
|
||||||
|
type: 'assignRole'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['clearQueue']
|
||||||
|
type: 'clearQueue'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['createAvatarDecoration']
|
||||||
|
type: 'createAvatarDecoration'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['createGlobalAnnouncement']
|
||||||
|
type: 'createGlobalAnnouncement'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['createInvitation']
|
||||||
|
type: 'createInvitation'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['createUserAnnouncement']
|
||||||
|
type: 'createUserAnnouncement'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['createRole']
|
||||||
|
type: 'createRole'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['deleteAvatarDecoration']
|
||||||
|
type: 'deleteAvatarDecoration'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['deleteCustomEmoji']
|
||||||
|
type: 'deleteCustomEmoji'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['deleteDriveFile']
|
||||||
|
type: 'deleteDriveFile'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['deleteGlobalAnnouncement']
|
||||||
|
type: 'deleteGlobalAnnouncement'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['deleteNote']
|
||||||
|
type: 'deleteNote'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['deleteRole']
|
||||||
|
type: 'deleteRole'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['deleteUserAnnouncement']
|
||||||
|
type: 'deleteUserAnnouncement'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['markSensitiveDriveFile']
|
||||||
|
type: 'markSensitiveDriveFile'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['promoteQueue']
|
||||||
|
type: 'promoteQueue'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['resetPassword']
|
||||||
|
type: 'resetPassword'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['resolveAbuseReport']
|
||||||
|
type: 'resolveAbuseReport'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['suspend']
|
||||||
|
type: 'suspend'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['suspendRemoteInstance']
|
||||||
|
type: 'suspendRemoteInstance'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['unassignRole']
|
||||||
|
type: 'unassignRole'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['unmarkSensitiveDriveFile']
|
||||||
|
type: 'unmarkSensitiveDriveFile'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['unsetUserAvatar']
|
||||||
|
type: 'unsetUserAvatar'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['unsetUserBanner']
|
||||||
|
type: 'unsetUserBanner'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['unsuspend']
|
||||||
|
type: 'unsuspend'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['unsuspendRemoteInstance']
|
||||||
|
type: 'unsuspendRemoteInstance'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['updateAvatarDecoration']
|
||||||
|
type: 'updateAvatarDecoration'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['updateCustomEmoji']
|
||||||
|
type: 'updateCustomEmoji'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['updateGlobalAnnouncement']
|
||||||
|
type: 'updateGlobalAnnouncement'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['updateRole']
|
||||||
|
type: 'updateRole'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['updateServerSettings']
|
||||||
|
type: 'updateServerSettings'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['updateUserAnnouncement']
|
||||||
|
type: 'updateUserAnnouncement'
|
||||||
|
} | {
|
||||||
|
info: ModerationLogPayloads['updateUserNote']
|
||||||
|
type: 'updateUserNote'
|
||||||
|
})
|
||||||
|
|
||||||
|
export type PageEvent = {
|
||||||
|
event: string
|
||||||
|
pageId: Page['id']
|
||||||
|
user: User
|
||||||
|
userId: User['id']
|
||||||
|
var: any
|
||||||
|
}
|
||||||
|
|
||||||
|
export type QueueStats = {
|
||||||
|
deliver: {
|
||||||
|
active: number
|
||||||
|
activeSincePrevTick: number
|
||||||
|
delayed: number
|
||||||
|
waiting: number
|
||||||
|
}
|
||||||
|
inbox: {
|
||||||
|
active: number
|
||||||
|
activeSincePrevTick: number
|
||||||
|
delayed: number
|
||||||
|
waiting: number
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export type QueueStatsLog = string[]
|
||||||
|
|
||||||
|
export type ServerStats = {
|
||||||
|
cpu: number
|
||||||
|
fs: {
|
||||||
|
r: number
|
||||||
|
w: number
|
||||||
|
}
|
||||||
|
mem: {
|
||||||
|
active: number
|
||||||
|
used: number
|
||||||
|
}
|
||||||
|
net: {
|
||||||
|
rx: number
|
||||||
|
tx: number
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ServerStatsLog = string[]
|
||||||
|
|
||||||
|
export * from '@/autogen/entities'
|
||||||
|
export * from '@/autogen/models'
|
0
packages/akkordian.js/src/global.d.ts
vendored
Normal file
0
packages/akkordian.js/src/global.d.ts
vendored
Normal file
26
packages/akkordian.js/src/index.ts
Normal file
26
packages/akkordian.js/src/index.ts
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
import type { Channels } from '@/streaming.types'
|
||||||
|
import { Connection, Stream } from '@/streaming'
|
||||||
|
import type { Endpoints } from '@/api.types'
|
||||||
|
import * as Entities from '@/entities'
|
||||||
|
import * as Consts from '@/consts'
|
||||||
|
import * as Acct from '@/acct'
|
||||||
|
import * as Api from '@/api'
|
||||||
|
|
||||||
|
export const followersVisibilities = Consts.followersVisibilities
|
||||||
|
export const followingVisibilities = Consts.followingVisibilities
|
||||||
|
export const moderationLogTypes = Consts.moderationLogTypes
|
||||||
|
export const mutedNoteReasons = Consts.mutedNoteReasons
|
||||||
|
export const noteVisibilities = Consts.noteVisibilities
|
||||||
|
export const notificationTypes = Consts.notificationTypes
|
||||||
|
export const permissions = Consts.permissions
|
||||||
|
|
||||||
|
export {
|
||||||
|
Acct,
|
||||||
|
Api,
|
||||||
|
Connection as ChannelConnection,
|
||||||
|
Channels,
|
||||||
|
Consts,
|
||||||
|
Endpoints,
|
||||||
|
Entities,
|
||||||
|
Stream
|
||||||
|
}
|
402
packages/akkordian.js/src/streaming.ts
Normal file
402
packages/akkordian.js/src/streaming.ts
Normal file
|
@ -0,0 +1,402 @@
|
||||||
|
import type { BroadcastEvents, Channels } from '@/streaming.types'
|
||||||
|
import ReconnectingWebSocket from 'reconnecting-websocket'
|
||||||
|
import { EventEmitter } from 'eventemitter3'
|
||||||
|
|
||||||
|
type AnyOf<T extends Record<number | string | symbol, any>> = T[keyof T]
|
||||||
|
type StreamEvents = {
|
||||||
|
_connected_: void
|
||||||
|
_disconnected_: void
|
||||||
|
} & BroadcastEvents
|
||||||
|
|
||||||
|
export function urlQuery(
|
||||||
|
obj: Record<string, boolean | number | string | undefined>
|
||||||
|
) {
|
||||||
|
const params = Object.entries(obj)
|
||||||
|
.filter(([, v]) => (Array.isArray(v) ? v.length : v !== undefined))
|
||||||
|
.reduce(
|
||||||
|
(a, [k, v]) => ((a[k] = v!), a),
|
||||||
|
{} as Record<string, boolean | number | string>
|
||||||
|
)
|
||||||
|
|
||||||
|
return Object.entries(params)
|
||||||
|
.map((e) => `${e[0]}=${encodeURIComponent(e[1])}`)
|
||||||
|
.join('&')
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class Connection<
|
||||||
|
Channel extends AnyOf<Channels> = any
|
||||||
|
> extends EventEmitter<Channel['events']> {
|
||||||
|
public channel: string
|
||||||
|
public abstract id: string
|
||||||
|
public inCount = 0
|
||||||
|
public name?: string
|
||||||
|
public outCount = 0
|
||||||
|
protected stream: Stream
|
||||||
|
|
||||||
|
constructor(stream: Stream, channel: string, name?: string) {
|
||||||
|
super()
|
||||||
|
|
||||||
|
this.send = this.send.bind(this)
|
||||||
|
|
||||||
|
this.channel = channel
|
||||||
|
this.name = name
|
||||||
|
this.stream = stream
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract dispose(): void
|
||||||
|
|
||||||
|
public send<T extends keyof Channel['receives']>(
|
||||||
|
type: T,
|
||||||
|
body: Channel['receives'][T]
|
||||||
|
) {
|
||||||
|
this.stream.send('ch', {
|
||||||
|
id: this.id,
|
||||||
|
body,
|
||||||
|
type
|
||||||
|
})
|
||||||
|
|
||||||
|
this.outCount++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class NonSharedConnection<
|
||||||
|
Channel extends AnyOf<Channels> = any
|
||||||
|
> extends Connection<Channel> {
|
||||||
|
public id: string
|
||||||
|
protected params: Channel['params']
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
stream: Stream,
|
||||||
|
channel: string,
|
||||||
|
id: string,
|
||||||
|
params: Channel['params']
|
||||||
|
) {
|
||||||
|
super(stream, channel)
|
||||||
|
|
||||||
|
this.connect = this.connect.bind(this)
|
||||||
|
this.dispose = this.dispose.bind(this)
|
||||||
|
|
||||||
|
this.id = id
|
||||||
|
this.params = params
|
||||||
|
|
||||||
|
this.connect()
|
||||||
|
}
|
||||||
|
|
||||||
|
public connect() {
|
||||||
|
this.stream.send('connect', {
|
||||||
|
id: this.id,
|
||||||
|
channel: this.channel,
|
||||||
|
params: this.params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
public dispose() {
|
||||||
|
this.removeAllListeners()
|
||||||
|
this.stream.send('disconnect', { id: this.id })
|
||||||
|
this.stream.disconnectToChannel(this)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Pool {
|
||||||
|
public channel: string
|
||||||
|
public id: string
|
||||||
|
public users = 0
|
||||||
|
protected stream: Stream
|
||||||
|
private disposeTimerId: any
|
||||||
|
private isConnected = false
|
||||||
|
|
||||||
|
constructor(stream: Stream, channel: string, id: string) {
|
||||||
|
this.connect = this.connect.bind(this)
|
||||||
|
this.dec = this.dec.bind(this)
|
||||||
|
this.disconnect = this.disconnect.bind(this)
|
||||||
|
this.inc = this.inc.bind(this)
|
||||||
|
this.onStreamDisconnected = this.onStreamDisconnected.bind(this)
|
||||||
|
|
||||||
|
this.channel = channel
|
||||||
|
this.id = id
|
||||||
|
this.stream = stream
|
||||||
|
|
||||||
|
this.stream.on('_disconnected_', this.onStreamDisconnected)
|
||||||
|
}
|
||||||
|
|
||||||
|
public connect() {
|
||||||
|
if (this.isConnected) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.isConnected = true
|
||||||
|
|
||||||
|
this.stream.send('connect', {
|
||||||
|
id: this.id,
|
||||||
|
channel: this.channel
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
public dec() {
|
||||||
|
this.users--
|
||||||
|
|
||||||
|
if (this.users === 0) {
|
||||||
|
this.disposeTimerId = setTimeout(() => {
|
||||||
|
this.disconnect()
|
||||||
|
}, 3000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public inc() {
|
||||||
|
if (this.users === 0 && !this.isConnected) {
|
||||||
|
this.connect()
|
||||||
|
}
|
||||||
|
|
||||||
|
this.users++
|
||||||
|
|
||||||
|
if (this.disposeTimerId) {
|
||||||
|
clearTimeout(this.disposeTimerId)
|
||||||
|
|
||||||
|
this.disposeTimerId = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private disconnect() {
|
||||||
|
this.stream.off('_disconnected_', this.onStreamDisconnected)
|
||||||
|
this.stream.send('disconnect', { id: this.id })
|
||||||
|
this.stream.removeSharedConnectionPool(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
private onStreamDisconnected() {
|
||||||
|
this.isConnected = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class SharedConnection<
|
||||||
|
Channel extends AnyOf<Channels> = any
|
||||||
|
> extends Connection<Channel> {
|
||||||
|
private pool: Pool
|
||||||
|
|
||||||
|
constructor(stream: Stream, channel: string, pool: Pool, name?: string) {
|
||||||
|
super(stream, channel, name)
|
||||||
|
|
||||||
|
this.dispose = this.dispose.bind(this)
|
||||||
|
|
||||||
|
this.pool = pool
|
||||||
|
|
||||||
|
this.pool.inc()
|
||||||
|
}
|
||||||
|
|
||||||
|
public dispose() {
|
||||||
|
this.pool.dec()
|
||||||
|
this.removeAllListeners()
|
||||||
|
this.stream.removeSharedConnection(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
public get id() {
|
||||||
|
return this.pool.id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Stream extends EventEmitter<StreamEvents> {
|
||||||
|
public state: 'connected' | 'initializing' | 'reconnecting' = 'initializing'
|
||||||
|
private idCounter = 0
|
||||||
|
private nonSharedConnections = [] as NonSharedConnection[]
|
||||||
|
private sharedConnectionPools = [] as Pool[]
|
||||||
|
private sharedConnections = [] as SharedConnection[]
|
||||||
|
private stream: ReconnectingWebSocket
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
origin: string,
|
||||||
|
user: { token: string } | null,
|
||||||
|
opts?: { WebSocket?: any }
|
||||||
|
) {
|
||||||
|
super()
|
||||||
|
|
||||||
|
this.close = this.close.bind(this)
|
||||||
|
this.connectToChannel = this.connectToChannel.bind(this)
|
||||||
|
this.disconnectToChannel = this.disconnectToChannel.bind(this)
|
||||||
|
this.generateId = this.generateId.bind(this)
|
||||||
|
this.onClose = this.onClose.bind(this)
|
||||||
|
this.onMessage = this.onMessage.bind(this)
|
||||||
|
this.onOpen = this.onOpen.bind(this)
|
||||||
|
this.removeSharedConnection = this.removeSharedConnection.bind(this)
|
||||||
|
this.removeSharedConnectionPool = this.removeSharedConnectionPool.bind(this)
|
||||||
|
this.send = this.send.bind(this)
|
||||||
|
this.useChannel = this.useChannel.bind(this)
|
||||||
|
this.useSharedConnection = this.useSharedConnection.bind(this)
|
||||||
|
|
||||||
|
opts ??= {}
|
||||||
|
|
||||||
|
const query = urlQuery({
|
||||||
|
// To prevent caching of an HTML error screen
|
||||||
|
_t: Date.now(),
|
||||||
|
i: user?.token
|
||||||
|
})
|
||||||
|
|
||||||
|
const wsOrigin = origin
|
||||||
|
.replace('http://', 'ws://')
|
||||||
|
.replace('https://', 'wss://')
|
||||||
|
|
||||||
|
this.stream = new ReconnectingWebSocket(
|
||||||
|
`${wsOrigin}/streaming?${query}`,
|
||||||
|
'',
|
||||||
|
{
|
||||||
|
minReconnectionDelay: 1, // pladaria/reconnecting-websocket#issue-91
|
||||||
|
WebSocket: opts.WebSocket
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
public close() {
|
||||||
|
this.stream.close()
|
||||||
|
}
|
||||||
|
|
||||||
|
public disconnectToChannel(connection: NonSharedConnection) {
|
||||||
|
this.nonSharedConnections = this.nonSharedConnections.filter(
|
||||||
|
(c) => c !== connection
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
public heartbeat() {
|
||||||
|
this.stream.send('h')
|
||||||
|
}
|
||||||
|
|
||||||
|
public ping() {
|
||||||
|
this.stream.send('ping')
|
||||||
|
}
|
||||||
|
|
||||||
|
public removeSharedConnection(connection: SharedConnection) {
|
||||||
|
this.sharedConnections = this.sharedConnections.filter(
|
||||||
|
(c) => c !== connection
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
public removeSharedConnectionPool(pool: Pool) {
|
||||||
|
this.sharedConnectionPools = this.sharedConnectionPools.filter(
|
||||||
|
(p) => p !== pool
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
public send(typeOrPayload: string): void
|
||||||
|
public send(typeOrPayload: string, payload: any): void
|
||||||
|
public send(typeOrPayload: Record<string, any> | any[]): void
|
||||||
|
public send(
|
||||||
|
typeOrPayload: Record<string, any> | any[] | string,
|
||||||
|
payload?: any
|
||||||
|
) {
|
||||||
|
if (typeof typeOrPayload === 'string') {
|
||||||
|
this.stream.send(
|
||||||
|
JSON.stringify({
|
||||||
|
...(payload ? { body: payload } : {}),
|
||||||
|
type: typeOrPayload
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.stream.send(JSON.stringify(typeOrPayload))
|
||||||
|
}
|
||||||
|
|
||||||
|
public useChannel<C extends keyof Channels>(
|
||||||
|
channel: C,
|
||||||
|
params?: Channels[C]['params'],
|
||||||
|
name?: string
|
||||||
|
): Connection<Channels[C]> {
|
||||||
|
if (params) {
|
||||||
|
return this.connectToChannel(channel, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.useSharedConnection(channel, name)
|
||||||
|
}
|
||||||
|
|
||||||
|
private connectToChannel<C extends keyof Channels>(
|
||||||
|
channel: C,
|
||||||
|
params: Channels[C]['params']
|
||||||
|
): NonSharedConnection<Channels[C]> {
|
||||||
|
const connection = new NonSharedConnection(
|
||||||
|
this,
|
||||||
|
channel,
|
||||||
|
this.generateId(),
|
||||||
|
params
|
||||||
|
)
|
||||||
|
|
||||||
|
this.nonSharedConnections.push(connection)
|
||||||
|
|
||||||
|
return connection
|
||||||
|
}
|
||||||
|
|
||||||
|
private generateId() {
|
||||||
|
return (++this.idCounter).toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
private onClose() {
|
||||||
|
if (this.state === 'connected') {
|
||||||
|
this.state = 'reconnecting'
|
||||||
|
|
||||||
|
this.emit('_disconnected_')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private onMessage(message: { data: string }) {
|
||||||
|
const { body, type } = JSON.parse(message.data)
|
||||||
|
|
||||||
|
if (type === 'channel') {
|
||||||
|
const id = body.id
|
||||||
|
|
||||||
|
let connections: Connection[]
|
||||||
|
|
||||||
|
connections = this.sharedConnections.filter((c) => c.id === id)
|
||||||
|
|
||||||
|
if (connections.length === 0) {
|
||||||
|
const found = this.nonSharedConnections.find((c) => c.id === id)
|
||||||
|
|
||||||
|
if (found) {
|
||||||
|
connections = [found]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const c of connections) {
|
||||||
|
c.emit(body.type, body.body)
|
||||||
|
|
||||||
|
c.inCount++
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.emit(type, body)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private onOpen() {
|
||||||
|
const isReconnect = this.state === 'reconnecting'
|
||||||
|
|
||||||
|
this.state = 'connected'
|
||||||
|
|
||||||
|
this.emit('_connected_')
|
||||||
|
|
||||||
|
if (isReconnect) {
|
||||||
|
for (const p of this.sharedConnectionPools) {
|
||||||
|
p.connect()
|
||||||
|
}
|
||||||
|
for (const c of this.nonSharedConnections) {
|
||||||
|
c.connect()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private useSharedConnection<C extends keyof Channels>(
|
||||||
|
channel: C,
|
||||||
|
name?: string
|
||||||
|
): SharedConnection<Channels[C]> {
|
||||||
|
let pool = this.sharedConnectionPools.find((p) => p.channel === channel)
|
||||||
|
|
||||||
|
if (!pool) {
|
||||||
|
pool = new Pool(this, channel, this.generateId())
|
||||||
|
|
||||||
|
this.sharedConnectionPools.push(pool)
|
||||||
|
}
|
||||||
|
|
||||||
|
const connection = new SharedConnection(this, channel, pool, name)
|
||||||
|
|
||||||
|
this.sharedConnections.push(connection)
|
||||||
|
|
||||||
|
return connection
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export { Connection }
|
230
packages/akkordian.js/src/streaming.types.ts
Normal file
230
packages/akkordian.js/src/streaming.types.ts
Normal file
|
@ -0,0 +1,230 @@
|
||||||
|
import {
|
||||||
|
Antenna,
|
||||||
|
DriveFile,
|
||||||
|
DriveFolder,
|
||||||
|
MeDetailed,
|
||||||
|
Note,
|
||||||
|
Notification,
|
||||||
|
Signin,
|
||||||
|
User
|
||||||
|
} from '@/autogen/models'
|
||||||
|
import {
|
||||||
|
AnnouncementCreated,
|
||||||
|
EmojiAdded,
|
||||||
|
EmojiDeleted,
|
||||||
|
EmojiUpdated,
|
||||||
|
PageEvent,
|
||||||
|
QueueStats,
|
||||||
|
QueueStatsLog,
|
||||||
|
ServerStats,
|
||||||
|
ServerStatsLog
|
||||||
|
} from '@/entities'
|
||||||
|
|
||||||
|
export type BroadcastEvents = {
|
||||||
|
announcementCreated: (payload: AnnouncementCreated) => void
|
||||||
|
emojiAdded: (payload: EmojiAdded) => void
|
||||||
|
emojiDeleted: (payload: EmojiDeleted) => void
|
||||||
|
emojiUpdated: (payload: EmojiUpdated) => void
|
||||||
|
noteUpdated: (payload: NoteUpdatedEvent) => void
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Channels = {
|
||||||
|
admin: {
|
||||||
|
events: {
|
||||||
|
newAbuseUserReport: {
|
||||||
|
id: string
|
||||||
|
comment: string
|
||||||
|
reporterId: string
|
||||||
|
targetUserId: string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
params: null
|
||||||
|
receives: null
|
||||||
|
}
|
||||||
|
antenna: {
|
||||||
|
events: {
|
||||||
|
note: (payload: Note) => void
|
||||||
|
}
|
||||||
|
params: {
|
||||||
|
antennaId: string
|
||||||
|
}
|
||||||
|
receives: null
|
||||||
|
}
|
||||||
|
channel: {
|
||||||
|
events: {
|
||||||
|
note: (payload: Note) => void
|
||||||
|
}
|
||||||
|
params: {
|
||||||
|
channelId: string
|
||||||
|
}
|
||||||
|
receives: null
|
||||||
|
}
|
||||||
|
drive: {
|
||||||
|
events: {
|
||||||
|
fileCreated: (payload: DriveFile) => void
|
||||||
|
fileDeleted: (payload: DriveFile['id']) => void
|
||||||
|
fileUpdated: (payload: DriveFile) => void
|
||||||
|
folderCreated: (payload: DriveFolder) => void
|
||||||
|
folderDeleted: (payload: DriveFolder['id']) => void
|
||||||
|
folderUpdated: (payload: DriveFolder) => void
|
||||||
|
}
|
||||||
|
params: null
|
||||||
|
receives: null
|
||||||
|
}
|
||||||
|
globalTimeline: {
|
||||||
|
events: {
|
||||||
|
note: (payload: Note) => void
|
||||||
|
}
|
||||||
|
params: {
|
||||||
|
withFiles?: boolean
|
||||||
|
withRenotes?: boolean
|
||||||
|
}
|
||||||
|
receives: null
|
||||||
|
}
|
||||||
|
hashtag: {
|
||||||
|
events: {
|
||||||
|
note: (payload: Note) => void
|
||||||
|
}
|
||||||
|
params: {
|
||||||
|
q?: string
|
||||||
|
}
|
||||||
|
receives: null
|
||||||
|
}
|
||||||
|
homeTimeline: {
|
||||||
|
events: {
|
||||||
|
note: (payload: Note) => void
|
||||||
|
}
|
||||||
|
params: {
|
||||||
|
withFiles?: boolean
|
||||||
|
withRenotes?: boolean
|
||||||
|
}
|
||||||
|
receives: null
|
||||||
|
}
|
||||||
|
hybridTimeline: {
|
||||||
|
events: {
|
||||||
|
note: (payload: Note) => void
|
||||||
|
}
|
||||||
|
params: {
|
||||||
|
withFiles?: boolean
|
||||||
|
withRenotes?: boolean
|
||||||
|
withReplies?: boolean
|
||||||
|
}
|
||||||
|
receives: null
|
||||||
|
}
|
||||||
|
localTimeline: {
|
||||||
|
events: {
|
||||||
|
note: (payload: Note) => void
|
||||||
|
}
|
||||||
|
params: {
|
||||||
|
withFiles?: boolean
|
||||||
|
withRenotes?: boolean
|
||||||
|
withReplies?: boolean
|
||||||
|
}
|
||||||
|
receives: null
|
||||||
|
}
|
||||||
|
main: {
|
||||||
|
events: {
|
||||||
|
announcementCreated: (payload: AnnouncementCreated) => void
|
||||||
|
driveFileCreated: (payload: DriveFile) => void
|
||||||
|
follow: (payload: User) => void
|
||||||
|
followed: (payload: User) => void
|
||||||
|
mention: (payload: Note) => void
|
||||||
|
meUpdated: (payload: MeDetailed) => void
|
||||||
|
myTokenRegenerated: () => void
|
||||||
|
notification: (payload: Notification) => void
|
||||||
|
pageEvent: (payload: PageEvent) => void
|
||||||
|
readAllAnnouncements: () => void
|
||||||
|
readAllAntennas: () => void
|
||||||
|
readAllNotifications: () => void
|
||||||
|
readAllUnreadMentions: () => void
|
||||||
|
readAllUnreadSpecifiedNotes: () => void
|
||||||
|
readAntenna: (payload: Antenna) => void
|
||||||
|
receiveFollowRequest: (payload: User) => void
|
||||||
|
registryUpdated: (payload: {
|
||||||
|
key: string
|
||||||
|
scope?: string[]
|
||||||
|
value: any | null
|
||||||
|
}) => void
|
||||||
|
renote: (payload: Note) => void
|
||||||
|
reply: (payload: Note) => void
|
||||||
|
signin: (payload: Signin) => void
|
||||||
|
unfollow: (payload: User) => void
|
||||||
|
unreadAntenna: (payload: Antenna) => void
|
||||||
|
unreadMention: (payload: Note['id']) => void
|
||||||
|
unreadNotification: (payload: Notification) => void
|
||||||
|
unreadSpecifiedNote: (payload: Note['id']) => void
|
||||||
|
urlUploadFinished: (payload: { file: DriveFile; marker: string }) => void
|
||||||
|
}
|
||||||
|
params: null
|
||||||
|
receives: null
|
||||||
|
}
|
||||||
|
queueStats: {
|
||||||
|
events: {
|
||||||
|
stats: (payload: QueueStats) => void
|
||||||
|
statsLog: (payload: QueueStatsLog) => void
|
||||||
|
}
|
||||||
|
params: null
|
||||||
|
receives: {
|
||||||
|
requestLog: {
|
||||||
|
id: number | string
|
||||||
|
length: number
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
roleTimeline: {
|
||||||
|
events: {
|
||||||
|
note: (payload: Note) => void
|
||||||
|
}
|
||||||
|
params: {
|
||||||
|
roleId: string
|
||||||
|
}
|
||||||
|
receives: null
|
||||||
|
}
|
||||||
|
serverStats: {
|
||||||
|
events: {
|
||||||
|
stats: (payload: ServerStats) => void
|
||||||
|
statsLog: (payload: ServerStatsLog) => void
|
||||||
|
}
|
||||||
|
params: null
|
||||||
|
receives: {
|
||||||
|
id: number | string
|
||||||
|
length: number
|
||||||
|
}
|
||||||
|
}
|
||||||
|
userList: {
|
||||||
|
events: {
|
||||||
|
note: (payload: Note) => void
|
||||||
|
}
|
||||||
|
params: {
|
||||||
|
listId: string
|
||||||
|
withFiles?: boolean
|
||||||
|
}
|
||||||
|
receives: null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export type NoteUpdatedEvent = {
|
||||||
|
body: {
|
||||||
|
deletedAt: string
|
||||||
|
}
|
||||||
|
type: 'deleted'
|
||||||
|
} | {
|
||||||
|
body: {
|
||||||
|
choice: number
|
||||||
|
userId: User['id']
|
||||||
|
}
|
||||||
|
type: 'pollVoted'
|
||||||
|
} | {
|
||||||
|
body: {
|
||||||
|
emoji: string | null
|
||||||
|
reaction: string
|
||||||
|
userId: User['id']
|
||||||
|
}
|
||||||
|
type: 'reacted'
|
||||||
|
} | {
|
||||||
|
body: {
|
||||||
|
reaction: string
|
||||||
|
userId: User['id']
|
||||||
|
}
|
||||||
|
type: 'unreacted'
|
||||||
|
}
|
22
packages/akkordian.js/tsconfig.json
Normal file
22
packages/akkordian.js/tsconfig.json
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"declaration": true,
|
||||||
|
"declarationMap": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"lib": ["dom", "esnext"],
|
||||||
|
"module": "esnext",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"noImplicitAny": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"outDir": "./built",
|
||||||
|
"paths": {
|
||||||
|
"@/*": ["./src/*"]
|
||||||
|
},
|
||||||
|
"sourceMap": true,
|
||||||
|
"strict": true,
|
||||||
|
"target": "es2022"
|
||||||
|
},
|
||||||
|
"exclude": ["./test/**/*"],
|
||||||
|
"include": ["./src/**/*"]
|
||||||
|
}
|
1
packages/api-generator/.gitignore
vendored
Normal file
1
packages/api-generator/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
api.json
|
18
packages/api-generator/package.json
Normal file
18
packages/api-generator/package.json
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"name": "api-generator",
|
||||||
|
"private": true,
|
||||||
|
"version": "0.1.0",
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"generate": "tsx ./src/generator.ts"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@apidevtools/swagger-parser": "^10.1.0",
|
||||||
|
"@types/node": "^20.10.5",
|
||||||
|
"openapi-types": "^12.1.3",
|
||||||
|
"openapi-typescript": "^6.7.3",
|
||||||
|
"ts-case-convert": "^2.0.6",
|
||||||
|
"tsx": "^4.7.0",
|
||||||
|
"typescript": "^5.3.3"
|
||||||
|
}
|
||||||
|
}
|
424
packages/api-generator/src/generator.ts
Normal file
424
packages/api-generator/src/generator.ts
Normal file
|
@ -0,0 +1,424 @@
|
||||||
|
import SwaggerParser from '@apidevtools/swagger-parser'
|
||||||
|
import { mkdir, writeFile } from 'node:fs/promises'
|
||||||
|
import openapiTS from 'openapi-typescript'
|
||||||
|
import { toPascal } from 'ts-case-convert'
|
||||||
|
import { OpenAPIV3 } from 'openapi-types'
|
||||||
|
|
||||||
|
enum OperationsAliasType {
|
||||||
|
REQUEST = 'Request',
|
||||||
|
RESPONSE = 'Response'
|
||||||
|
}
|
||||||
|
|
||||||
|
interface IOperationTypeAlias {
|
||||||
|
generateName(): string
|
||||||
|
toLine(): string
|
||||||
|
readonly type: OperationsAliasType
|
||||||
|
}
|
||||||
|
|
||||||
|
class EmptyTypeAlias implements IOperationTypeAlias {
|
||||||
|
public readonly type: OperationsAliasType
|
||||||
|
|
||||||
|
constructor(type: OperationsAliasType) {
|
||||||
|
this.type = type
|
||||||
|
}
|
||||||
|
|
||||||
|
public generateName() {
|
||||||
|
return `Empty${this.type}`
|
||||||
|
}
|
||||||
|
|
||||||
|
public toLine() {
|
||||||
|
const name = this.generateName()
|
||||||
|
|
||||||
|
return `export type ${name} = Record<string, unknown> | undefined`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Endpoint {
|
||||||
|
public readonly operationId: string
|
||||||
|
public request?: IOperationTypeAlias
|
||||||
|
public response?: IOperationTypeAlias
|
||||||
|
|
||||||
|
constructor(operationId: string) {
|
||||||
|
this.operationId = operationId
|
||||||
|
}
|
||||||
|
|
||||||
|
public toLine() {
|
||||||
|
const reqName = this.request?.generateName() ?? emptyRequest.generateName()
|
||||||
|
const resName = this.response?.generateName()
|
||||||
|
?? emptyResponse.generateName()
|
||||||
|
|
||||||
|
return `'${this.operationId}': { req: ${reqName}; res: ${resName} }`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class OperationTypeAlias implements IOperationTypeAlias {
|
||||||
|
public readonly mediaType: string
|
||||||
|
public readonly operationId: string
|
||||||
|
public readonly type: OperationsAliasType
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
operationId: string,
|
||||||
|
mediaType: string,
|
||||||
|
type: OperationsAliasType
|
||||||
|
) {
|
||||||
|
this.mediaType = mediaType
|
||||||
|
this.operationId = operationId
|
||||||
|
this.type = type
|
||||||
|
}
|
||||||
|
|
||||||
|
public generateName() {
|
||||||
|
const nameBase = this.operationId.replace(/\//g, '-')
|
||||||
|
|
||||||
|
return toPascal(nameBase + this.type)
|
||||||
|
}
|
||||||
|
|
||||||
|
public toLine() {
|
||||||
|
const name = this.generateName()
|
||||||
|
|
||||||
|
return this.type === OperationsAliasType.REQUEST
|
||||||
|
? `export type ${name} = operations['${this.operationId}']['requestBody']['content']['${this.mediaType}']`
|
||||||
|
: `export type ${name} = operations['${this.operationId}']['responses']['200']['content']['${this.mediaType}']`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const emptyRequest = new EmptyTypeAlias(OperationsAliasType.REQUEST)
|
||||||
|
const emptyResponse = new EmptyTypeAlias(OperationsAliasType.RESPONSE)
|
||||||
|
|
||||||
|
function filterUndefined<T>(item: T): item is Exclude<T, undefined> {
|
||||||
|
return item !== undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
async function generateApiClientJsDoc(
|
||||||
|
openApiDocs: OpenAPIV3.Document,
|
||||||
|
apiClientFileName: string,
|
||||||
|
endpointsFileName: string,
|
||||||
|
warningsOutputPath: string
|
||||||
|
) {
|
||||||
|
const endpoints = [] as { description: string; operationId: string }[]
|
||||||
|
|
||||||
|
const paths = openApiDocs.paths
|
||||||
|
const postPathItems = Object.keys(paths)
|
||||||
|
.map(it => paths[it]?.post)
|
||||||
|
.filter(filterUndefined)
|
||||||
|
|
||||||
|
for (const operation of postPathItems) {
|
||||||
|
const operationId = operation.operationId!
|
||||||
|
|
||||||
|
if (operation.description) {
|
||||||
|
endpoints.push({
|
||||||
|
description: operation.description,
|
||||||
|
operationId: operationId
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const endpointOutputLine = [] as string[]
|
||||||
|
|
||||||
|
endpointOutputLine.push(generateVersionHeaderComment(openApiDocs))
|
||||||
|
endpointOutputLine.push('')
|
||||||
|
|
||||||
|
endpointOutputLine.push(
|
||||||
|
`import type { SwitchCaseResponseType } from '${toImportPath(apiClientFileName)}'`
|
||||||
|
)
|
||||||
|
|
||||||
|
endpointOutputLine.push(
|
||||||
|
`import type { Endpoints } from '${toImportPath(endpointsFileName)}'`
|
||||||
|
)
|
||||||
|
|
||||||
|
endpointOutputLine.push('')
|
||||||
|
|
||||||
|
endpointOutputLine.push(
|
||||||
|
`declare module '${toImportPath(apiClientFileName)}' {`
|
||||||
|
)
|
||||||
|
|
||||||
|
endpointOutputLine.push(' export interface ApiClient {')
|
||||||
|
|
||||||
|
for (let i = 0; i < endpoints.length; i++) {
|
||||||
|
const endpoint = endpoints[i]
|
||||||
|
|
||||||
|
endpointOutputLine.push(
|
||||||
|
' /**',
|
||||||
|
` * ${endpoint.description.split('\n').join('\n * ')}`,
|
||||||
|
' */',
|
||||||
|
` request<E extends '${endpoint.operationId}', P extends Endpoints[E]['req']>(`,
|
||||||
|
' endpoint: E,',
|
||||||
|
' params: P,',
|
||||||
|
' credential?: string | null',
|
||||||
|
' ): Promise<SwitchCaseResponseType<E, P>>'
|
||||||
|
)
|
||||||
|
|
||||||
|
if (i < endpoints.length - 1) {
|
||||||
|
endpointOutputLine.push('\n')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
endpointOutputLine.push(' }')
|
||||||
|
endpointOutputLine.push('}')
|
||||||
|
endpointOutputLine.push('')
|
||||||
|
|
||||||
|
await writeFile(warningsOutputPath, endpointOutputLine.join('\n'))
|
||||||
|
}
|
||||||
|
|
||||||
|
async function generateBaseTypes(
|
||||||
|
openApiDocs: OpenAPIV3.Document,
|
||||||
|
openApiJsonPath: string,
|
||||||
|
typeFileName: string
|
||||||
|
) {
|
||||||
|
const disabledLints = [
|
||||||
|
'@typescript-eslint/naming-convention',
|
||||||
|
'@typescript-eslint/no-explicit-any'
|
||||||
|
]
|
||||||
|
|
||||||
|
const lines = [] as string[]
|
||||||
|
|
||||||
|
for (const lint of disabledLints) {
|
||||||
|
lines.push(`/* eslint ${lint}: 0 */`)
|
||||||
|
}
|
||||||
|
|
||||||
|
lines.push('')
|
||||||
|
lines.push(generateVersionHeaderComment(openApiDocs))
|
||||||
|
lines.push('')
|
||||||
|
|
||||||
|
const generatedTypes = await openapiTS(openApiJsonPath, { exportType: true })
|
||||||
|
|
||||||
|
lines.push(generatedTypes)
|
||||||
|
lines.push('')
|
||||||
|
|
||||||
|
await writeFile(typeFileName, lines.join('\n'))
|
||||||
|
}
|
||||||
|
|
||||||
|
async function generateEndpoints(
|
||||||
|
openApiDocs: OpenAPIV3.Document,
|
||||||
|
typeFileName: string,
|
||||||
|
entitiesOutputPath: string,
|
||||||
|
endpointOutputPath: string
|
||||||
|
) {
|
||||||
|
const endpoints = [] as Endpoint[]
|
||||||
|
|
||||||
|
const paths = openApiDocs.paths
|
||||||
|
const postPathItems = Object.keys(paths)
|
||||||
|
.map(it => paths[it]?.post)
|
||||||
|
.filter(filterUndefined)
|
||||||
|
|
||||||
|
for (const operation of postPathItems) {
|
||||||
|
const operationId = operation.operationId!
|
||||||
|
|
||||||
|
const endpoint = new Endpoint(operationId)
|
||||||
|
|
||||||
|
endpoints.push(endpoint)
|
||||||
|
|
||||||
|
if (isRequestBodyObject(operation.requestBody)) {
|
||||||
|
const reqContent = operation.requestBody.content
|
||||||
|
const supportMediaTypes = Object.keys(reqContent)
|
||||||
|
|
||||||
|
if (supportMediaTypes.length > 0) {
|
||||||
|
endpoint.request = new OperationTypeAlias(
|
||||||
|
operationId,
|
||||||
|
supportMediaTypes[0],
|
||||||
|
OperationsAliasType.REQUEST
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
isResponseObject(operation.responses['200'])
|
||||||
|
&& operation.responses['200'].content
|
||||||
|
) {
|
||||||
|
const resContent = operation.responses['200'].content
|
||||||
|
const supportMediaTypes = Object.keys(resContent)
|
||||||
|
|
||||||
|
if (supportMediaTypes.length > 0) {
|
||||||
|
endpoint.response = new OperationTypeAlias(
|
||||||
|
operationId,
|
||||||
|
supportMediaTypes[0],
|
||||||
|
OperationsAliasType.RESPONSE
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const entitiesOutputLine = [] as string[]
|
||||||
|
|
||||||
|
entitiesOutputLine.push(generateVersionHeaderComment(openApiDocs))
|
||||||
|
entitiesOutputLine.push('')
|
||||||
|
|
||||||
|
entitiesOutputLine.push(
|
||||||
|
`import { operations } from '${toImportPath(typeFileName)}'`
|
||||||
|
)
|
||||||
|
|
||||||
|
entitiesOutputLine.push('')
|
||||||
|
|
||||||
|
entitiesOutputLine.push(
|
||||||
|
new EmptyTypeAlias(OperationsAliasType.REQUEST).toLine()
|
||||||
|
)
|
||||||
|
|
||||||
|
entitiesOutputLine.push(
|
||||||
|
new EmptyTypeAlias(OperationsAliasType.RESPONSE).toLine()
|
||||||
|
)
|
||||||
|
|
||||||
|
entitiesOutputLine.push('')
|
||||||
|
|
||||||
|
const entities = endpoints
|
||||||
|
.flatMap(it => [it.request, it.response].filter(i => i))
|
||||||
|
.filter(filterUndefined)
|
||||||
|
|
||||||
|
entitiesOutputLine.push(...entities.map(it => it.toLine()))
|
||||||
|
entitiesOutputLine.push('')
|
||||||
|
|
||||||
|
await writeFile(entitiesOutputPath, entitiesOutputLine.join('\n'))
|
||||||
|
|
||||||
|
const endpointOutputLine = [] as string[]
|
||||||
|
|
||||||
|
endpointOutputLine.push(generateVersionHeaderComment(openApiDocs))
|
||||||
|
endpointOutputLine.push('')
|
||||||
|
|
||||||
|
endpointOutputLine.push('import type {')
|
||||||
|
|
||||||
|
endpointOutputLine.push(
|
||||||
|
...[
|
||||||
|
emptyRequest,
|
||||||
|
emptyResponse,
|
||||||
|
...entities
|
||||||
|
].map(it => ` ${it.generateName()},`)
|
||||||
|
)
|
||||||
|
|
||||||
|
endpointOutputLine.push(`} from '${toImportPath(entitiesOutputPath)}'`)
|
||||||
|
endpointOutputLine.push('')
|
||||||
|
|
||||||
|
endpointOutputLine.push('export type Endpoints = {')
|
||||||
|
|
||||||
|
endpointOutputLine.push(
|
||||||
|
...endpoints.map(it => ` ${it.toLine()}`)
|
||||||
|
)
|
||||||
|
|
||||||
|
endpointOutputLine.push('}')
|
||||||
|
endpointOutputLine.push('')
|
||||||
|
|
||||||
|
await writeFile(endpointOutputPath, endpointOutputLine.join('\n'))
|
||||||
|
}
|
||||||
|
|
||||||
|
async function generateSchemaEntities(
|
||||||
|
openApiDocs: OpenAPIV3.Document,
|
||||||
|
typeFileName: string,
|
||||||
|
outputPath: string
|
||||||
|
) {
|
||||||
|
if (!openApiDocs.components?.schemas) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const schemas = openApiDocs.components.schemas
|
||||||
|
|
||||||
|
const schemaNames = Object.keys(schemas)
|
||||||
|
const typeAliasLines = [] as string[]
|
||||||
|
|
||||||
|
typeAliasLines.push(generateVersionHeaderComment(openApiDocs))
|
||||||
|
typeAliasLines.push('')
|
||||||
|
|
||||||
|
typeAliasLines.push(
|
||||||
|
`import { components } from '${toImportPath(typeFileName)}'`
|
||||||
|
)
|
||||||
|
|
||||||
|
typeAliasLines.push('')
|
||||||
|
|
||||||
|
typeAliasLines.push(
|
||||||
|
...schemaNames.map(
|
||||||
|
it => `export type ${it} = components['schemas']['${it}']`
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
typeAliasLines.push('')
|
||||||
|
|
||||||
|
await writeFile(outputPath, typeAliasLines.join('\n'))
|
||||||
|
}
|
||||||
|
|
||||||
|
function generateVersionHeaderComment(openApiDocs: OpenAPIV3.Document) {
|
||||||
|
const contents = {
|
||||||
|
'Generated at': new Date().toISOString(),
|
||||||
|
Version: openApiDocs.info.version
|
||||||
|
}
|
||||||
|
|
||||||
|
const lines = [] as string[]
|
||||||
|
|
||||||
|
lines.push('//')
|
||||||
|
|
||||||
|
for (const [key, value] of Object.entries(contents)) {
|
||||||
|
lines.push(`// ${key}: ${value}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
lines.push('//')
|
||||||
|
|
||||||
|
return lines.join('\n')
|
||||||
|
}
|
||||||
|
|
||||||
|
function isRequestBodyObject(
|
||||||
|
value: unknown
|
||||||
|
): value is OpenAPIV3.RequestBodyObject {
|
||||||
|
if (!value) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
const {
|
||||||
|
content
|
||||||
|
} = value as Record<keyof OpenAPIV3.RequestBodyObject, unknown>
|
||||||
|
|
||||||
|
return content !== undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
function isResponseObject(value: unknown): value is OpenAPIV3.ResponseObject {
|
||||||
|
if (!value) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
const {
|
||||||
|
description
|
||||||
|
} = value as Record<keyof OpenAPIV3.ResponseObject, unknown>
|
||||||
|
|
||||||
|
return description !== undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
const generatePath = './built/autogen'
|
||||||
|
|
||||||
|
await mkdir(generatePath, { recursive: true })
|
||||||
|
|
||||||
|
const openApiJsonPath = './api.json'
|
||||||
|
const openApiParsed =
|
||||||
|
await SwaggerParser.validate(openApiJsonPath) as OpenAPIV3.Document
|
||||||
|
|
||||||
|
const typeFileName = `${generatePath}/types.ts`
|
||||||
|
|
||||||
|
await generateBaseTypes(openApiParsed, openApiJsonPath, typeFileName)
|
||||||
|
|
||||||
|
const modelFileName = `${generatePath}/models.ts`
|
||||||
|
|
||||||
|
await generateSchemaEntities(openApiParsed, typeFileName, modelFileName)
|
||||||
|
|
||||||
|
const endpointFileName = `${generatePath}/endpoint.ts`
|
||||||
|
const entitiesFileName = `${generatePath}/entities.ts`
|
||||||
|
|
||||||
|
await generateEndpoints(
|
||||||
|
openApiParsed,
|
||||||
|
typeFileName,
|
||||||
|
entitiesFileName,
|
||||||
|
endpointFileName
|
||||||
|
)
|
||||||
|
|
||||||
|
const apiClientWarningFileName = `${generatePath}/api-client-jsdoc.ts`
|
||||||
|
|
||||||
|
await generateApiClientJsDoc(
|
||||||
|
openApiParsed,
|
||||||
|
'../api.ts',
|
||||||
|
endpointFileName,
|
||||||
|
apiClientWarningFileName
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function toImportPath(
|
||||||
|
fileName: string,
|
||||||
|
fromPath = '/built/autogen',
|
||||||
|
toPath = ''
|
||||||
|
) {
|
||||||
|
return fileName.replace(fromPath, toPath).replace('.ts', '')
|
||||||
|
}
|
||||||
|
|
||||||
|
main()
|
13
packages/api-generator/tsconfig.json
Normal file
13
packages/api-generator/tsconfig.json
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"lib": ["esnext"],
|
||||||
|
"module": "esnext",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"noImplicitAny": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"strict": true,
|
||||||
|
"target": "esnext"
|
||||||
|
},
|
||||||
|
"include": ["./src/**/*"]
|
||||||
|
}
|
3
packages/meta.json
Normal file
3
packages/meta.json
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"version": "unknown"
|
||||||
|
}
|
5
packages/sw/.vscode/settings.json
vendored
Normal file
5
packages/sw/.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"path-intellisense.mappings": {
|
||||||
|
"@": "${workspaceRoot}/packages/sw/src/"
|
||||||
|
}
|
||||||
|
}
|
25
packages/sw/package.json
Normal file
25
packages/sw/package.json
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
{
|
||||||
|
"name": "@akkohq/sw",
|
||||||
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"build": "node ./build.js",
|
||||||
|
"lint": "eslint --quiet \"./src/**/*.ts\" && yarn lint:types",
|
||||||
|
"lint:types": "tsc --noEmit",
|
||||||
|
"watch": "nodemon -e json --exec \"node ./build.js watch\" -w ../../package.json"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"akkordian.js": "workspace:*",
|
||||||
|
"esbuild": "^0.19.10",
|
||||||
|
"idb-keyval": "^6.2.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@typescript-eslint/eslint-plugin": "^6.15.0",
|
||||||
|
"@typescript-eslint/parser": "^6.15.0",
|
||||||
|
"@typescript/lib-webworker": "npm:@types/serviceworker@^0.0.81",
|
||||||
|
"eslint": "^8.56.0",
|
||||||
|
"eslint-plugin-import": "^2.29.1",
|
||||||
|
"nodemon": "^3.0.2",
|
||||||
|
"typescript": "^5.3.3"
|
||||||
|
}
|
||||||
|
}
|
7
packages/sw/src/global.d.ts
vendored
Normal file
7
packages/sw/src/global.d.ts
vendored
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
declare const _DEV_: boolean
|
||||||
|
declare const _ENV_: string
|
||||||
|
declare const _LANGS_: string[][]
|
||||||
|
declare const _PERF_PREFIX_: string
|
||||||
|
declare const _VERSION_: string
|
||||||
|
|
||||||
|
type FIXME = any
|
3
packages/sw/src/sw.ts
Normal file
3
packages/sw/src/sw.ts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
function offlineContentHtml() {
|
||||||
|
return `<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Akkordian is Offline</title></head><body><p>You are currently offline. Service Worker @${_VERSION_} <button onclick="location.reload()">Reload</button></p></body></html>`
|
||||||
|
}
|
52
packages/sw/src/types.ts
Normal file
52
packages/sw/src/types.ts
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
import type * as Akkordian from 'akkordian.js'
|
||||||
|
|
||||||
|
type PushNotificationDataSourceMap = {
|
||||||
|
notification: Akkordian.Entities.Notification
|
||||||
|
readAllNotifications: undefined
|
||||||
|
unreadAntennaNote: {
|
||||||
|
antenna: {
|
||||||
|
id: string
|
||||||
|
name: string
|
||||||
|
}
|
||||||
|
note: Akkordian.Entities.Note
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export type BadgeNames =
|
||||||
|
| 'antenna'
|
||||||
|
| 'arrow-back-up'
|
||||||
|
| 'at'
|
||||||
|
| 'bell'
|
||||||
|
| 'chart-arrows'
|
||||||
|
| 'circle-check'
|
||||||
|
| 'medal'
|
||||||
|
| 'messages'
|
||||||
|
| 'null'
|
||||||
|
| 'plus'
|
||||||
|
| 'quote'
|
||||||
|
| 'repeat'
|
||||||
|
| 'user-plus'
|
||||||
|
| 'users'
|
||||||
|
|
||||||
|
export type PushNotificationData<
|
||||||
|
K extends keyof PushNotificationDataSourceMap
|
||||||
|
> = {
|
||||||
|
body: PushNotificationDataSourceMap[K]
|
||||||
|
dateTime: number
|
||||||
|
type: K
|
||||||
|
userId: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type PushNotificationDataMap = {
|
||||||
|
[K in keyof PushNotificationDataSourceMap]: PushNotificationData<K>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type SwMessage = {
|
||||||
|
loginId?: string
|
||||||
|
order: SwMessageOrderType
|
||||||
|
type: 'order'
|
||||||
|
url: string
|
||||||
|
[x: string]: unknown
|
||||||
|
}
|
||||||
|
|
||||||
|
export type SwMessageOrderType = 'post' | 'push'
|
45
packages/sw/src/utils/create-notification.ts
Normal file
45
packages/sw/src/utils/create-notification.ts
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
import type { BadgeNames, PushNotificationDataMap } from '@/types'
|
||||||
|
import { getAccountFromId } from '@/utils/get-account-from-id'
|
||||||
|
import { charToFileName } from '@/utils/twemoji-base'
|
||||||
|
import { getUserName } from '@/utils/get-user-name'
|
||||||
|
import { cli } from '@/utils/operations'
|
||||||
|
import { swLang } from '@/utils/lang'
|
||||||
|
|
||||||
|
const closeNotificationsByTags = async (tags: string[]) => {
|
||||||
|
for (
|
||||||
|
const n of (
|
||||||
|
await Promise.all(
|
||||||
|
tags.map((tag) => globalThis.registration.getNotifications({ tag }))
|
||||||
|
)
|
||||||
|
).flat()
|
||||||
|
) {
|
||||||
|
n.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// How to add a new badge
|
||||||
|
//
|
||||||
|
// 1. Find the icon you want on https://tabler-icons.io and download the PNG
|
||||||
|
// 2. Run `vips resize <icon path> /tmp/icon.png 0.4`
|
||||||
|
// 3. Run `vips scRGB2BW /tmp/icon.png <output path>"[compression=9,strip]"`
|
||||||
|
// 4. Run `rm /tmp/icon.png`
|
||||||
|
// 5. Run `mv <output path> <akkordian path>/packages/backend/assets/tabler-badges`
|
||||||
|
// 6. Add the filename to `BadgeNames`
|
||||||
|
const iconUrl = (name: BadgeNames) => `/static-assets/tabler-badges/${name}.png`
|
||||||
|
|
||||||
|
async function composeNotification(data: PushNotificationDataMap[keyof PushNotificationDataMap]): Promise<[string, NotificationOptions] | null> {
|
||||||
|
const i18n = await (swLang.i18n ?? swLang.fetchLocale())
|
||||||
|
const { t } = i18n
|
||||||
|
|
||||||
|
switch (data.type) {
|
||||||
|
case 'notification':
|
||||||
|
switch (data.body.type) {
|
||||||
|
case 'follow':
|
||||||
|
const account = await getAccountFromId(data.userId)
|
||||||
|
|
||||||
|
if (!account) { return null }
|
||||||
|
|
||||||
|
const userDetail = await cli.request('users/show', { userId: data.body.userId }, account.token)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
13
packages/sw/src/utils/get-account-from-id.ts
Normal file
13
packages/sw/src/utils/get-account-from-id.ts
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
import { get } from 'idb-keyval'
|
||||||
|
|
||||||
|
export async function getAccountFromId(id: string) {
|
||||||
|
const accounts = await get<{ id: string; token: string }[]>('accounts')
|
||||||
|
|
||||||
|
if (!accounts) {
|
||||||
|
console.log('[SW] Accounts are not recorded')
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
return accounts.find(e => e.id === id)
|
||||||
|
}
|
7
packages/sw/src/utils/get-url-with-login-id.ts
Normal file
7
packages/sw/src/utils/get-url-with-login-id.ts
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
export function getUrlWithLoginId(url: string, loginId: string) {
|
||||||
|
const u = new URL(url, origin)
|
||||||
|
|
||||||
|
u.searchParams.set('loginId', loginId)
|
||||||
|
|
||||||
|
return u.toString()
|
||||||
|
}
|
3
packages/sw/src/utils/get-user-name.ts
Normal file
3
packages/sw/src/utils/get-user-name.ts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export function getUserName(user: { name?: string | null; username: string }) {
|
||||||
|
return user.name === '' ? user.username : user.name ?? user.username
|
||||||
|
}
|
33
packages/sw/src/utils/i18n.ts
Normal file
33
packages/sw/src/utils/i18n.ts
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
export type Locale = { [x: string]: Locale | string }
|
||||||
|
|
||||||
|
export class I18n<T extends Locale = Locale> {
|
||||||
|
public ts: T
|
||||||
|
|
||||||
|
constructor(locale: T) {
|
||||||
|
this.t = this.t.bind(this)
|
||||||
|
this.ts = locale
|
||||||
|
}
|
||||||
|
|
||||||
|
public t(key: string, args?: Record<string, string>) {
|
||||||
|
try {
|
||||||
|
let str = key.split('.')
|
||||||
|
.reduce<Locale | Locale[keyof Locale]>((o, i) => (o as any)[i], this.ts)
|
||||||
|
|
||||||
|
if (typeof str !== 'string') {
|
||||||
|
throw new Error()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args) {
|
||||||
|
for (const [k, v] of Object.entries(args)) {
|
||||||
|
str = str.replace(`{${k}}`, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return str
|
||||||
|
} catch (err) {
|
||||||
|
console.warn(`[WARN] Missing localization \`${key}\``)
|
||||||
|
|
||||||
|
return key
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
44
packages/sw/src/utils/lang.ts
Normal file
44
packages/sw/src/utils/lang.ts
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
import { I18n, Locale } from '@/utils/i18n'
|
||||||
|
import { get, set } from 'idb-keyval'
|
||||||
|
|
||||||
|
class SwLang {
|
||||||
|
public cacheName = `ak-cache-${_VERSION_}`
|
||||||
|
public i18n: Promise<I18n> | null = null
|
||||||
|
public lang = get<string>('lang').then(async prelang => {
|
||||||
|
if (!prelang) { return 'en-US' }
|
||||||
|
|
||||||
|
return prelang
|
||||||
|
})
|
||||||
|
|
||||||
|
public fetchLocale() {
|
||||||
|
return (this.i18n = this._fetch())
|
||||||
|
}
|
||||||
|
|
||||||
|
public setLang(newLang: string) {
|
||||||
|
this.lang = Promise.resolve(newLang)
|
||||||
|
|
||||||
|
set('lang', newLang)
|
||||||
|
|
||||||
|
return this.fetchLocale()
|
||||||
|
}
|
||||||
|
|
||||||
|
private async _fetch() {
|
||||||
|
const localeUrl = `/assets/locales/${await this.lang}`
|
||||||
|
|
||||||
|
let localeRes = await caches.match(localeUrl)
|
||||||
|
|
||||||
|
if (!localeRes || _DEV_) {
|
||||||
|
localeRes = await fetch(localeUrl)
|
||||||
|
|
||||||
|
const clone = localeRes.clone()
|
||||||
|
|
||||||
|
if (!clone.clone().ok) { throw new Error('locale fetching error') }
|
||||||
|
|
||||||
|
caches.open(this.cacheName).then(cache => cache.put(localeUrl, clone))
|
||||||
|
}
|
||||||
|
|
||||||
|
return new I18n<Locale>(await localeRes.json())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const swLang = new SwLang()
|
121
packages/sw/src/utils/operations.ts
Normal file
121
packages/sw/src/utils/operations.ts
Normal file
|
@ -0,0 +1,121 @@
|
||||||
|
import { getUrlWithLoginId } from '@/utils/get-url-with-login-id'
|
||||||
|
import { getAccountFromId } from '@/utils/get-account-from-id'
|
||||||
|
import type { SwMessage, SwMessageOrderType } from '@/types'
|
||||||
|
import * as Akkordian from 'akkordian.js'
|
||||||
|
|
||||||
|
const readBlockingStatus = new Map<string, boolean>()
|
||||||
|
|
||||||
|
export const cli = new Akkordian.Api.ApiClient({
|
||||||
|
fetch: (...args) => fetch(...args),
|
||||||
|
origin
|
||||||
|
})
|
||||||
|
|
||||||
|
export async function api<
|
||||||
|
E extends keyof Akkordian.Endpoints,
|
||||||
|
O extends Akkordian.Endpoints[E]['req']
|
||||||
|
>(
|
||||||
|
endpoint: E,
|
||||||
|
userId?: string,
|
||||||
|
options?: O
|
||||||
|
// @ts-expect-error
|
||||||
|
): Promise<ReturnType<typeof cli.request<E, O>> | void> {
|
||||||
|
let account: { id: string; token: string } | void = undefined
|
||||||
|
|
||||||
|
if (userId) {
|
||||||
|
account = await getAccountFromId(userId)
|
||||||
|
|
||||||
|
if (!account) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error
|
||||||
|
return cli.request(endpoint, options, account?.token)
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function findClient() {
|
||||||
|
const clients = await globalThis.clients.matchAll({
|
||||||
|
type: 'window'
|
||||||
|
})
|
||||||
|
|
||||||
|
return clients.find((c) => !new URL(c.url).searchParams.has('zen')) ?? null
|
||||||
|
}
|
||||||
|
|
||||||
|
export function openAntenna(antennaId: string, loginId: string) {
|
||||||
|
return openClient('push', `/timeline/antenna/${antennaId}`, loginId, {
|
||||||
|
antennaId
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function openClient(
|
||||||
|
order: SwMessageOrderType,
|
||||||
|
url: string,
|
||||||
|
loginId?: string,
|
||||||
|
query: Record<string, SwMessage[string]> = {}
|
||||||
|
) {
|
||||||
|
const client = await findClient()
|
||||||
|
|
||||||
|
if (client) {
|
||||||
|
client.postMessage({
|
||||||
|
...query,
|
||||||
|
loginId,
|
||||||
|
order,
|
||||||
|
type: 'order',
|
||||||
|
url
|
||||||
|
} satisfies SwMessage)
|
||||||
|
|
||||||
|
return client
|
||||||
|
}
|
||||||
|
|
||||||
|
return globalThis.clients.openWindow(
|
||||||
|
loginId ? getUrlWithLoginId(url, loginId) : url
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function openNote(noteId: string, loginId?: string) {
|
||||||
|
return openClient('push', `/notes/${noteId}`, loginId, { noteId })
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function openPost(
|
||||||
|
options: {
|
||||||
|
initialText?: string
|
||||||
|
renote?: Akkordian.Entities.Note
|
||||||
|
reply?: Akkordian.Entities.Note
|
||||||
|
},
|
||||||
|
loginId?: string
|
||||||
|
) {
|
||||||
|
const query = new URLSearchParams()
|
||||||
|
const url = '/share'
|
||||||
|
|
||||||
|
if (options.initialText) {
|
||||||
|
query.set('text', options.initialText)
|
||||||
|
}
|
||||||
|
if (options.renote) {
|
||||||
|
query.set('renoteId', options.renote.id)
|
||||||
|
}
|
||||||
|
if (options.reply) {
|
||||||
|
query.set('replyId', options.reply.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
return openClient('post', `${url}?${query}`, loginId, { options })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function openUser(acct: string, loginId?: string) {
|
||||||
|
return openClient('push', `/@${acct}`, loginId, { acct })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function sendMarkAllAsRead(userId: string) {
|
||||||
|
if (readBlockingStatus.get(userId)) {
|
||||||
|
return Promise.resolve()
|
||||||
|
}
|
||||||
|
|
||||||
|
readBlockingStatus.set(userId, true)
|
||||||
|
|
||||||
|
return new Promise((res) => {
|
||||||
|
setTimeout(() => {
|
||||||
|
readBlockingStatus.set(userId, false)
|
||||||
|
|
||||||
|
api('notifications/mark-all-as-read', userId).then(res, res)
|
||||||
|
}, 1000)
|
||||||
|
})
|
||||||
|
}
|
11
packages/sw/src/utils/twemoji-base.ts
Normal file
11
packages/sw/src/utils/twemoji-base.ts
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
export function charToFileName(char: string) {
|
||||||
|
let codes = Array.from(char)
|
||||||
|
.map(x => x.codePointAt(0)?.toString(16))
|
||||||
|
.filter(<T>(x: T | undefined): x is T => x !== undefined)
|
||||||
|
|
||||||
|
if (!codes.includes('200d')) { codes = codes.filter(x => x !== 'fe0f') }
|
||||||
|
|
||||||
|
codes = codes.filter(x => x.length !== 0)
|
||||||
|
|
||||||
|
return codes.join('-')
|
||||||
|
}
|
29
packages/sw/tsconfig.json
Normal file
29
packages/sw/tsconfig.json
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
"compileOnSave": false,
|
||||||
|
"compilerOptions": {
|
||||||
|
"allowJs": true,
|
||||||
|
"baseUrl": ".",
|
||||||
|
"declaration": false,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"isolatedModules": true,
|
||||||
|
"lib": ["esnext", "webworker"],
|
||||||
|
"module": "esnext",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"noEmitOnError": false,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"noImplicitAny": true,
|
||||||
|
"noImplicitReturns": true,
|
||||||
|
"noLib": false,
|
||||||
|
"noUnusedLocals": false,
|
||||||
|
"noUnusedParameters": false,
|
||||||
|
"paths": {
|
||||||
|
"@/*": ["./src/*"]
|
||||||
|
},
|
||||||
|
"removeComments": false,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"sourceMap": false,
|
||||||
|
"strict": true,
|
||||||
|
"target": "es2022"
|
||||||
|
},
|
||||||
|
"include": ["./src/**/*"]
|
||||||
|
}
|
Loading…
Reference in a new issue