mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-09 20:12:10 +10:00
chore: prettier pass
This commit is contained in:
1
.prettierignore
Normal file
1
.prettierignore
Normal file
@ -0,0 +1 @@
|
||||
drop-base/
|
||||
@ -41,6 +41,7 @@ TODO: Add Troubleshooting
|
||||
If not, look at the [Troubleshooting](https://github.com/Drop-OSS/docs/Troubleshooting)
|
||||
page for instructions on how to gather data to better debug your problem.
|
||||
-->
|
||||
|
||||
If you cannot find an existing issue, you can go ahead and create an issue with as much
|
||||
detail as you can provide.
|
||||
It should include the data gathered as indicated above, along with the following:
|
||||
@ -70,6 +71,7 @@ maintainers) by mentioning their GitHub handle (starting with `@`) in your messa
|
||||
|
||||
You should be familiar with the basics of
|
||||
[contributing on GitHub](https://help.github.com/articles/using-pull-requests)
|
||||
|
||||
<!--and have a fork
|
||||
[properly set up](https://github.com/drop/docs/Contribution-Technical-Practices).
|
||||
-->
|
||||
@ -109,7 +111,7 @@ maintainers) by mentioning their GitHub handle (starting with `@`) in your messa
|
||||
|
||||
For any extensive change, such as API changes, you will have to find testers to +1 your PR.
|
||||
|
||||
----
|
||||
---
|
||||
|
||||
## Use the Search, Luke
|
||||
|
||||
@ -126,7 +128,7 @@ to be sure your contribution has not already come up.
|
||||
If all fails, your thing has probably not been reported yet, so you can go ahead
|
||||
and [create an issue](#reporting-issues) or [submit a PR](#submitting-pull-requests).
|
||||
|
||||
----
|
||||
---
|
||||
|
||||
## Commit Guidelines
|
||||
|
||||
@ -161,11 +163,13 @@ type(scope)!: subject
|
||||
Examples:
|
||||
|
||||
- Commit that changes the `git` plugin:
|
||||
|
||||
```
|
||||
feat(git): add alias for `git commit`
|
||||
```
|
||||
|
||||
- Commit that changes many plugins:
|
||||
|
||||
```
|
||||
style: fix inline declaration of arrays
|
||||
```
|
||||
@ -203,6 +207,7 @@ type(scope)!: subject
|
||||
Formatting tricks: the commit subject may contain:
|
||||
|
||||
- Links to related issues or PRs by writing `#issue`. This will be highlighted by the changelog tool:
|
||||
|
||||
```
|
||||
feat(archlinux): add support for aura AUR helper (#9467)
|
||||
```
|
||||
@ -219,7 +224,7 @@ Try to keep the first commit line short. It's harder to do using this commit sty
|
||||
concise, and if you need more space, you can use the commit body. Try to make sure that the commit
|
||||
subject is clear and precise enough that users will know what changed by just looking at the changelog.
|
||||
|
||||
----
|
||||
---
|
||||
|
||||
<!--
|
||||
## Volunteer
|
||||
@ -229,7 +234,9 @@ Very nice!! :)
|
||||
Please have a look at the [Volunteer](https://github.com/ohmyzsh/ohmyzsh/wiki/Volunteers)
|
||||
page for instructions on where to start and more.
|
||||
-->
|
||||
|
||||
## Reference
|
||||
|
||||
This contributing guide is adapted from the
|
||||
[oh-my-zsh contribution guide](https://github.com/ohmyzsh/ohmyzsh/blob/master/CONTRIBUTING.md).
|
||||
If there are any issues with this, please email admin@deepcore.dev.
|
||||
@ -1,4 +1,5 @@
|
||||
# Security
|
||||
|
||||
To report a vulnerability, please DO NOT create an issue for it
|
||||
as this may lead to the vulnerability being exploited before it
|
||||
can be fixed. Instead, please email [security@deepcore.dev](mailto:security@deepcore.dev)
|
||||
|
||||
@ -73,5 +73,5 @@ button {
|
||||
}
|
||||
|
||||
html {
|
||||
background-color: oklch(.21 .006 285.885);
|
||||
background-color: oklch(0.21 0.006 285.885);
|
||||
}
|
||||
14
changelog.md
14
changelog.md
@ -1,8 +1,7 @@
|
||||
|
||||
|
||||
## Release 0.2.0-beta
|
||||
|
||||
### Fixes
|
||||
|
||||
- fix recursive dirs util #02d6346
|
||||
- Fix username length requirement #0a5a649
|
||||
- remove dynamic imports #0f10626
|
||||
@ -33,8 +32,8 @@
|
||||
- fix FATAL: "root"... message #dbb315a
|
||||
- only show versions that are directories #ef8f3ae
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
- update prisma & delete games #089c3e0
|
||||
- manual handshake #12e3125
|
||||
- fetch game endpoint #1f4d075
|
||||
@ -81,8 +80,8 @@
|
||||
- add support for overriding UMU id #fd4a7d1
|
||||
- add .sh for linux #fe9373a
|
||||
|
||||
|
||||
### Other Changes
|
||||
|
||||
- quexeky <git@quexeky.dev>
|
||||
- fixed manifest generation #03a37f7
|
||||
- manual ci/cd #03b0b0c
|
||||
@ -189,12 +188,12 @@
|
||||
- better server side signin redirects #ef13b68
|
||||
- patch signin #f3672f8
|
||||
|
||||
|
||||
_changelog generated by_ [go-conventional-commits](https://github.com/joselitofilho/go-conventional-commits)
|
||||
|
||||
## Release 0.1.0-beta
|
||||
|
||||
### Fixes
|
||||
|
||||
- remove dynamic imports #0f10626
|
||||
- fix for missing developers or publishers #25fc957
|
||||
- split prisma schemas #2859005
|
||||
@ -214,8 +213,8 @@ _changelog generated by_ [go-conventional-commits](https://github.com/joselitofi
|
||||
- moved icons and created PlatformClient so we can use the enum on the frontend #cada630
|
||||
- only show versions that are directories #ef8f3ae
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
- update prisma & delete games #089c3e0
|
||||
- fetch game endpoint #1f4d075
|
||||
- under the hood organisation and consolidation #26a31f6
|
||||
@ -245,8 +244,8 @@ _changelog generated by_ [go-conventional-commits](https://github.com/joselitofi
|
||||
- cleanup and raw accessors #f7d767d
|
||||
- add support for overriding UMU id #fd4a7d1
|
||||
|
||||
|
||||
### Other Changes
|
||||
|
||||
- quexeky <git@quexeky.dev>
|
||||
- fixed manifest generation #03a37f7
|
||||
- manual ci/cd #03b0b0c
|
||||
@ -350,5 +349,4 @@ _changelog generated by_ [go-conventional-commits](https://github.com/joselitofi
|
||||
- better server side signin redirects #ef13b68
|
||||
- patch signin #f3672f8
|
||||
|
||||
|
||||
_changelog generated by_ [go-conventional-commits](https://github.com/joselitofilho/go-conventional-commits)
|
||||
|
||||
@ -44,7 +44,7 @@ import {
|
||||
HomeIcon,
|
||||
LockClosedIcon,
|
||||
DevicePhoneMobileIcon,
|
||||
WrenchScrewdriverIcon
|
||||
WrenchScrewdriverIcon,
|
||||
} from "@heroicons/vue/24/outline";
|
||||
import { UserIcon } from "@heroicons/vue/24/solid";
|
||||
import type { Component } from "vue";
|
||||
|
||||
@ -1,7 +1,14 @@
|
||||
<template>
|
||||
<svg class="text-blue-400" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg
|
||||
class="text-blue-400"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M4 13.5C4 11.0008 5.38798 8.76189 7.00766 7C8.43926 5.44272 10.0519 4.25811 11.0471 3.5959C11.6287 3.20893 12.3713 3.20893 12.9529 3.5959C13.9481 4.25811 15.5607 5.44272 16.9923 7C18.612 8.76189 20 11.0008 20 13.5C20 17.9183 16.4183 21.5 12 21.5C7.58172 21.5 4 17.9183 4 13.5Z"
|
||||
stroke="currentColor" stroke-width="2" />
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
/>
|
||||
</svg>
|
||||
</template>
|
||||
@ -1,12 +1,18 @@
|
||||
<template>
|
||||
<div class="inline-flex justify-center items-center gap-x-1 -mb-1 relative">
|
||||
<svg
|
||||
aria-hidden="true" viewBox="0 0 418 42" class="absolute inset-0 h-full w-full fill-blue-300/30 scale-75"
|
||||
preserveAspectRatio="none">
|
||||
aria-hidden="true"
|
||||
viewBox="0 0 418 42"
|
||||
class="absolute inset-0 h-full w-full fill-blue-300/30 scale-75"
|
||||
preserveAspectRatio="none"
|
||||
>
|
||||
<path
|
||||
d="M203.371.916c-26.013-2.078-76.686 1.963-124.73 9.946L67.3 12.749C35.421 18.062 18.2 21.766 6.004 25.934 1.244 27.561.828 27.778.874 28.61c.07 1.214.828 1.121 9.595-1.176 9.072-2.377 17.15-3.92 39.246-7.496C123.565 7.986 157.869 4.492 195.942 5.046c7.461.108 19.25 1.696 19.17 2.582-.107 1.183-7.874 4.31-25.75 10.366-21.992 7.45-35.43 12.534-36.701 13.884-2.173 2.308-.202 4.407 4.442 4.734 2.654.187 3.263.157 15.593-.78 35.401-2.686 57.944-3.488 88.365-3.143 46.327.526 75.721 2.23 130.788 7.584 19.787 1.924 20.814 1.98 24.557 1.332l.066-.011c1.201-.203 1.53-1.825.399-2.335-2.911-1.31-4.893-1.604-22.048-3.261-57.509-5.556-87.871-7.36-132.059-7.842-23.239-.254-33.617-.116-50.627.674-11.629.54-42.371 2.494-46.696 2.967-2.359.259 8.133-3.625 26.504-9.81 23.239-7.825 27.934-10.149 28.304-14.005.417-4.348-3.529-6-16.878-7.066Z" />
|
||||
d="M203.371.916c-26.013-2.078-76.686 1.963-124.73 9.946L67.3 12.749C35.421 18.062 18.2 21.766 6.004 25.934 1.244 27.561.828 27.778.874 28.61c.07 1.214.828 1.121 9.595-1.176 9.072-2.377 17.15-3.92 39.246-7.496C123.565 7.986 157.869 4.492 195.942 5.046c7.461.108 19.25 1.696 19.17 2.582-.107 1.183-7.874 4.31-25.75 10.366-21.992 7.45-35.43 12.534-36.701 13.884-2.173 2.308-.202 4.407 4.442 4.734 2.654.187 3.263.157 15.593-.78 35.401-2.686 57.944-3.488 88.365-3.143 46.327.526 75.721 2.23 130.788 7.584 19.787 1.924 20.814 1.98 24.557 1.332l.066-.011c1.201-.203 1.53-1.825.399-2.335-2.911-1.31-4.893-1.604-22.048-3.261-57.509-5.556-87.871-7.36-132.059-7.842-23.239-.254-33.617-.116-50.627.674-11.629.54-42.371 2.494-46.696 2.967-2.359.259 8.133-3.625 26.504-9.81 23.239-7.825 27.934-10.149 28.304-14.005.417-4.348-3.529-6-16.878-7.066Z"
|
||||
/>
|
||||
</svg>
|
||||
<Logo class="h-6" />
|
||||
<span class="text-blue-400 font-display font-bold text-xl uppercase">Drop</span>
|
||||
<span class="text-blue-400 font-display font-bold text-xl uppercase"
|
||||
>Drop</span
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
@ -46,7 +46,7 @@ const min = computed(() => Math.max(props.min ?? 8, props.items.length));
|
||||
const games: Ref<Array<SerializeObject<Game> | undefined>> = computed(() =>
|
||||
Array(min.value)
|
||||
.fill(0)
|
||||
.map((_, i) => props.items[i])
|
||||
.map((_, i) => props.items[i]),
|
||||
);
|
||||
|
||||
const singlePage = ref(2);
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
<svg viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
fill="currentColor"
|
||||
d="M20.992 20.163c-1.511-0.099-2.699-1.349-2.699-2.877 0-0.051 0.001-0.102 0.004-0.153l-0 0.007c-0.003-0.048-0.005-0.104-0.005-0.161 0-1.525 1.19-2.771 2.692-2.862l0.008-0c1.509 0.082 2.701 1.325 2.701 2.847 0 0.062-0.002 0.123-0.006 0.184l0-0.008c0.003 0.050 0.005 0.109 0.005 0.168 0 1.523-1.191 2.768-2.693 2.854l-0.008 0zM11.026 20.163c-1.511-0.099-2.699-1.349-2.699-2.877 0-0.051 0.001-0.102 0.004-0.153l-0 0.007c-0.003-0.048-0.005-0.104-0.005-0.161 0-1.525 1.19-2.771 2.692-2.862l0.008-0c1.509 0.082 2.701 1.325 2.701 2.847 0 0.062-0.002 0.123-0.006 0.184l0-0.008c0.003 0.048 0.005 0.104 0.005 0.161 0 1.525-1.19 2.771-2.692 2.862l-0.008 0zM26.393 6.465c-1.763-0.832-3.811-1.49-5.955-1.871l-0.149-0.022c-0.005-0.001-0.011-0.002-0.017-0.002-0.035 0-0.065 0.019-0.081 0.047l-0 0c-0.234 0.411-0.488 0.924-0.717 1.45l-0.043 0.111c-1.030-0.165-2.218-0.259-3.428-0.259s-2.398 0.094-3.557 0.275l0.129-0.017c-0.27-0.63-0.528-1.142-0.813-1.638l0.041 0.077c-0.017-0.029-0.048-0.047-0.083-0.047-0.005 0-0.011 0-0.016 0.001l0.001-0c-2.293 0.403-4.342 1.060-6.256 1.957l0.151-0.064c-0.017 0.007-0.031 0.019-0.040 0.034l-0 0c-2.854 4.041-4.562 9.069-4.562 14.496 0 0.907 0.048 1.802 0.141 2.684l-0.009-0.11c0.003 0.029 0.018 0.053 0.039 0.070l0 0c2.14 1.601 4.628 2.891 7.313 3.738l0.176 0.048c0.008 0.003 0.018 0.004 0.028 0.004 0.032 0 0.060-0.015 0.077-0.038l0-0c0.535-0.72 1.044-1.536 1.485-2.392l0.047-0.1c0.006-0.012 0.010-0.027 0.010-0.043 0-0.041-0.026-0.075-0.062-0.089l-0.001-0c-0.912-0.352-1.683-0.727-2.417-1.157l0.077 0.042c-0.029-0.017-0.048-0.048-0.048-0.083 0-0.031 0.015-0.059 0.038-0.076l0-0c0.157-0.118 0.315-0.24 0.465-0.364 0.016-0.013 0.037-0.021 0.059-0.021 0.014 0 0.027 0.003 0.038 0.008l-0.001-0c2.208 1.061 4.8 1.681 7.536 1.681s5.329-0.62 7.643-1.727l-0.107 0.046c0.012-0.006 0.025-0.009 0.040-0.009 0.022 0 0.043 0.008 0.059 0.021l-0-0c0.15 0.124 0.307 0.248 0.466 0.365 0.023 0.018 0.038 0.046 0.038 0.077 0 0.035-0.019 0.065-0.046 0.082l-0 0c-0.661 0.395-1.432 0.769-2.235 1.078l-0.105 0.036c-0.036 0.014-0.062 0.049-0.062 0.089 0 0.016 0.004 0.031 0.011 0.044l-0-0.001c0.501 0.96 1.009 1.775 1.571 2.548l-0.040-0.057c0.017 0.024 0.046 0.040 0.077 0.040 0.010 0 0.020-0.002 0.029-0.004l-0.001 0c2.865-0.892 5.358-2.182 7.566-3.832l-0.065 0.047c0.022-0.016 0.036-0.041 0.039-0.069l0-0c0.087-0.784 0.136-1.694 0.136-2.615 0-5.415-1.712-10.43-4.623-14.534l0.052 0.078c-0.008-0.016-0.022-0.029-0.038-0.036l-0-0z"/>
|
||||
d="M20.992 20.163c-1.511-0.099-2.699-1.349-2.699-2.877 0-0.051 0.001-0.102 0.004-0.153l-0 0.007c-0.003-0.048-0.005-0.104-0.005-0.161 0-1.525 1.19-2.771 2.692-2.862l0.008-0c1.509 0.082 2.701 1.325 2.701 2.847 0 0.062-0.002 0.123-0.006 0.184l0-0.008c0.003 0.050 0.005 0.109 0.005 0.168 0 1.523-1.191 2.768-2.693 2.854l-0.008 0zM11.026 20.163c-1.511-0.099-2.699-1.349-2.699-2.877 0-0.051 0.001-0.102 0.004-0.153l-0 0.007c-0.003-0.048-0.005-0.104-0.005-0.161 0-1.525 1.19-2.771 2.692-2.862l0.008-0c1.509 0.082 2.701 1.325 2.701 2.847 0 0.062-0.002 0.123-0.006 0.184l0-0.008c0.003 0.048 0.005 0.104 0.005 0.161 0 1.525-1.19 2.771-2.692 2.862l-0.008 0zM26.393 6.465c-1.763-0.832-3.811-1.49-5.955-1.871l-0.149-0.022c-0.005-0.001-0.011-0.002-0.017-0.002-0.035 0-0.065 0.019-0.081 0.047l-0 0c-0.234 0.411-0.488 0.924-0.717 1.45l-0.043 0.111c-1.030-0.165-2.218-0.259-3.428-0.259s-2.398 0.094-3.557 0.275l0.129-0.017c-0.27-0.63-0.528-1.142-0.813-1.638l0.041 0.077c-0.017-0.029-0.048-0.047-0.083-0.047-0.005 0-0.011 0-0.016 0.001l0.001-0c-2.293 0.403-4.342 1.060-6.256 1.957l0.151-0.064c-0.017 0.007-0.031 0.019-0.040 0.034l-0 0c-2.854 4.041-4.562 9.069-4.562 14.496 0 0.907 0.048 1.802 0.141 2.684l-0.009-0.11c0.003 0.029 0.018 0.053 0.039 0.070l0 0c2.14 1.601 4.628 2.891 7.313 3.738l0.176 0.048c0.008 0.003 0.018 0.004 0.028 0.004 0.032 0 0.060-0.015 0.077-0.038l0-0c0.535-0.72 1.044-1.536 1.485-2.392l0.047-0.1c0.006-0.012 0.010-0.027 0.010-0.043 0-0.041-0.026-0.075-0.062-0.089l-0.001-0c-0.912-0.352-1.683-0.727-2.417-1.157l0.077 0.042c-0.029-0.017-0.048-0.048-0.048-0.083 0-0.031 0.015-0.059 0.038-0.076l0-0c0.157-0.118 0.315-0.24 0.465-0.364 0.016-0.013 0.037-0.021 0.059-0.021 0.014 0 0.027 0.003 0.038 0.008l-0.001-0c2.208 1.061 4.8 1.681 7.536 1.681s5.329-0.62 7.643-1.727l-0.107 0.046c0.012-0.006 0.025-0.009 0.040-0.009 0.022 0 0.043 0.008 0.059 0.021l-0-0c0.15 0.124 0.307 0.248 0.466 0.365 0.023 0.018 0.038 0.046 0.038 0.077 0 0.035-0.019 0.065-0.046 0.082l-0 0c-0.661 0.395-1.432 0.769-2.235 1.078l-0.105 0.036c-0.036 0.014-0.062 0.049-0.062 0.089 0 0.016 0.004 0.031 0.011 0.044l-0-0.001c0.501 0.96 1.009 1.775 1.571 2.548l-0.040-0.057c0.017 0.024 0.046 0.040 0.077 0.040 0.010 0 0.020-0.002 0.029-0.004l-0.001 0c2.865-0.892 5.358-2.182 7.566-3.832l-0.065 0.047c0.022-0.016 0.036-0.041 0.039-0.069l0-0c0.087-0.784 0.136-1.694 0.136-2.615 0-5.415-1.712-10.43-4.623-14.534l0.052 0.078c-0.008-0.016-0.022-0.029-0.038-0.036l-0-0z"
|
||||
/>
|
||||
</svg>
|
||||
</template>
|
||||
@ -1,13 +1,27 @@
|
||||
<template>
|
||||
<svg
|
||||
viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Dribbble-Light-Preview" transform="translate(-140.000000, -7559.000000)" fill="currentColor">
|
||||
viewBox="0 0 20 20"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
>
|
||||
<g
|
||||
id="Page-1"
|
||||
stroke="none"
|
||||
stroke-width="1"
|
||||
fill="none"
|
||||
fill-rule="evenodd"
|
||||
>
|
||||
<g
|
||||
id="Dribbble-Light-Preview"
|
||||
transform="translate(-140.000000, -7559.000000)"
|
||||
fill="currentColor"
|
||||
>
|
||||
<g id="icons" transform="translate(56.000000, 160.000000)">
|
||||
<path
|
||||
id="github-[#142]"
|
||||
d="M94,7399 C99.523,7399 104,7403.59 104,7409.253 C104,7413.782 101.138,7417.624 97.167,7418.981 C96.66,7419.082 96.48,7418.762 96.48,7418.489 C96.48,7418.151 96.492,7417.047 96.492,7415.675 C96.492,7414.719 96.172,7414.095 95.813,7413.777 C98.04,7413.523 100.38,7412.656 100.38,7408.718 C100.38,7407.598 99.992,7406.684 99.35,7405.966 C99.454,7405.707 99.797,7404.664 99.252,7403.252 C99.252,7403.252 98.414,7402.977 96.505,7404.303 C95.706,7404.076 94.85,7403.962 94,7403.958 C93.15,7403.962 92.295,7404.076 91.497,7404.303 C89.586,7402.977 88.746,7403.252 88.746,7403.252 C88.203,7404.664 88.546,7405.707 88.649,7405.966 C88.01,7406.684 87.619,7407.598 87.619,7408.718 C87.619,7412.646 89.954,7413.526 92.175,7413.785 C91.889,7414.041 91.63,7414.493 91.54,7415.156 C90.97,7415.418 89.522,7415.871 88.63,7414.304 C88.63,7414.304 88.101,7413.319 87.097,7413.247 C87.097,7413.247 86.122,7413.234 87.029,7413.87 C87.029,7413.87 87.684,7414.185 88.139,7415.37 C88.139,7415.37 88.726,7417.2 91.508,7416.58 C91.513,7417.437 91.522,7418.245 91.522,7418.489 C91.522,7418.76 91.338,7419.077 90.839,7418.982 C86.865,7417.627 84,7413.783 84,7409.253 C84,7403.59 88.478,7399 94,7399"/>
|
||||
d="M94,7399 C99.523,7399 104,7403.59 104,7409.253 C104,7413.782 101.138,7417.624 97.167,7418.981 C96.66,7419.082 96.48,7418.762 96.48,7418.489 C96.48,7418.151 96.492,7417.047 96.492,7415.675 C96.492,7414.719 96.172,7414.095 95.813,7413.777 C98.04,7413.523 100.38,7412.656 100.38,7408.718 C100.38,7407.598 99.992,7406.684 99.35,7405.966 C99.454,7405.707 99.797,7404.664 99.252,7403.252 C99.252,7403.252 98.414,7402.977 96.505,7404.303 C95.706,7404.076 94.85,7403.962 94,7403.958 C93.15,7403.962 92.295,7404.076 91.497,7404.303 C89.586,7402.977 88.746,7403.252 88.746,7403.252 C88.203,7404.664 88.546,7405.707 88.649,7405.966 C88.01,7406.684 87.619,7407.598 87.619,7408.718 C87.619,7412.646 89.954,7413.526 92.175,7413.785 C91.889,7414.041 91.63,7414.493 91.54,7415.156 C90.97,7415.418 89.522,7415.871 88.63,7414.304 C88.63,7414.304 88.101,7413.319 87.097,7413.247 C87.097,7413.247 86.122,7413.234 87.029,7413.87 C87.029,7413.87 87.684,7414.185 88.139,7415.37 C88.139,7415.37 88.726,7417.2 91.508,7416.58 C91.513,7417.437 91.522,7418.245 91.522,7418.489 C91.522,7418.76 91.338,7419.077 90.839,7418.982 C86.865,7417.627 84,7413.783 84,7409.253 C84,7403.59 88.478,7399 94,7399"
|
||||
/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
>
|
||||
<NuxtLink
|
||||
v-for="[name, link] in notification.actions.map((e) =>
|
||||
e.split('|')
|
||||
e.split('|'),
|
||||
)"
|
||||
:key="name"
|
||||
type="button"
|
||||
@ -54,7 +54,7 @@ async function deleteMe() {
|
||||
});
|
||||
const notifications = useNotifications();
|
||||
const indexOfMe = notifications.value.findIndex(
|
||||
(e) => e.id === props.notification.id
|
||||
(e) => e.id === props.notification.id,
|
||||
);
|
||||
// Delete me
|
||||
notifications.value.splice(indexOfMe, 1);
|
||||
|
||||
@ -223,7 +223,7 @@ const currentPageIndex = useCurrentNavigationIndex(navigation);
|
||||
|
||||
const notifications = useNotifications();
|
||||
const unreadNotifications = computed(() =>
|
||||
notifications.value.filter((e) => !e.read)
|
||||
notifications.value.filter((e) => !e.read),
|
||||
);
|
||||
|
||||
const sidebarOpen = ref(false);
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
import type { RouteLocationNormalized } from "vue-router";
|
||||
import type { NavigationItem } from "./types";
|
||||
|
||||
export const useCurrentNavigationIndex = (navigation: Array<NavigationItem>) => {
|
||||
export const useCurrentNavigationIndex = (
|
||||
navigation: Array<NavigationItem>,
|
||||
) => {
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
|
||||
@ -113,7 +113,7 @@
|
||||
class="h-[min(152px,40cqw)] object-cover"
|
||||
src="https://tailwindcss.com/plus-assets/img/component-images/bento-03-security.png"
|
||||
alt=""
|
||||
>
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
required
|
||||
placeholder="AwesomeDropGamer771"
|
||||
class="block w-full rounded-md border-0 py-1.5 px-3 bg-zinc-800 disabled:bg-zinc-900/80 text-zinc-100 disabled:text-zinc-400 shadow-sm ring-1 ring-inset ring-zinc-700 disabled:ring-zinc-800 placeholder:text-zinc-400 focus:ring-2 focus:ring-inset focus:ring-blue-600 sm:text-sm sm:leading-6"
|
||||
>
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
:disabled="!!invitation.data.value?.email"
|
||||
placeholder="me@example.com"
|
||||
class="block w-full rounded-md border-0 py-1.5 px-3 bg-zinc-800 disabled:bg-zinc-900/80 text-zinc-100 disabled:text-zinc-400 shadow-sm ring-1 ring-inset ring-zinc-700 disabled:ring-zinc-800 placeholder:text-zinc-400 focus:ring-2 focus:ring-inset focus:ring-blue-600 sm:text-sm sm:leading-6"
|
||||
>
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -90,7 +90,7 @@
|
||||
:disabled="!!invitation.data.value?.username"
|
||||
placeholder="myUsername"
|
||||
class="block w-full rounded-md border-0 py-1.5 px-3 bg-zinc-800 disabled:bg-zinc-900/80 text-zinc-100 disabled:text-zinc-400 shadow-sm ring-1 ring-inset ring-zinc-700 disabled:ring-zinc-800 placeholder:text-zinc-400 focus:ring-2 focus:ring-inset focus:ring-blue-600 sm:text-sm sm:leading-6"
|
||||
>
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -119,7 +119,7 @@
|
||||
autocomplete="password"
|
||||
required
|
||||
class="block w-full rounded-md border-0 py-1.5 px-3 bg-zinc-800 disabled:bg-zinc-900/80 text-zinc-100 disabled:text-zinc-400 shadow-sm ring-1 ring-inset ring-zinc-700 disabled:ring-zinc-800 placeholder:text-zinc-400 focus:ring-2 focus:ring-inset focus:ring-blue-600 sm:text-sm sm:leading-6"
|
||||
>
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -146,7 +146,7 @@
|
||||
autocomplete="confirm-password"
|
||||
required
|
||||
class="block w-full rounded-md border-0 py-1.5 px-3 bg-zinc-800 disabled:bg-zinc-900/80 text-zinc-100 disabled:text-zinc-400 shadow-sm ring-1 ring-inset ring-zinc-700 disabled:ring-zinc-800 placeholder:text-zinc-400 focus:ring-2 focus:ring-inset focus:ring-blue-600 sm:text-sm sm:leading-6"
|
||||
>
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -200,7 +200,7 @@ if (!invitationId)
|
||||
});
|
||||
|
||||
const invitation = await useFetch(
|
||||
`/api/v1/auth/signup/simple?id=${encodeURIComponent(invitationId)}`
|
||||
`/api/v1/auth/signup/simple?id=${encodeURIComponent(invitationId)}`,
|
||||
);
|
||||
|
||||
const email = ref(invitation.data.value?.email);
|
||||
@ -211,20 +211,20 @@ const confirmPassword = ref(undefined);
|
||||
|
||||
const emailValidator = type("string.email");
|
||||
const validEmail = computed(
|
||||
() => !(emailValidator(email.value) instanceof type.errors)
|
||||
() => !(emailValidator(email.value) instanceof type.errors),
|
||||
);
|
||||
|
||||
const usernameValidator = type("string.alphanumeric >= 5").to("string.lower");
|
||||
const validUsername = computed(
|
||||
() => !(usernameValidator(username.value) instanceof type.errors)
|
||||
() => !(usernameValidator(username.value) instanceof type.errors),
|
||||
);
|
||||
|
||||
const passwordValidator = type("string >= 14");
|
||||
const validPassword = computed(
|
||||
() => !(passwordValidator(password.value) instanceof type.errors)
|
||||
() => !(passwordValidator(password.value) instanceof type.errors),
|
||||
);
|
||||
const validConfirmPassword = computed(
|
||||
() => password.value == confirmPassword.value
|
||||
() => password.value == confirmPassword.value,
|
||||
);
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
@ -58,15 +58,14 @@
|
||||
Authorize client?
|
||||
</h1>
|
||||
<p class="mt-6 text-base leading-7 text-zinc-400">
|
||||
"{{ clientData.name }}" has requested access to your Drop
|
||||
account.
|
||||
"{{ clientData.name }}" has requested access to your Drop account.
|
||||
</p>
|
||||
<div
|
||||
action="/api/v1/client/callback"
|
||||
method="post"
|
||||
class="mt-10 gap-x-6"
|
||||
>
|
||||
<input type="text" class="hidden" name="id" :value="clientId" >
|
||||
<input type="text" class="hidden" name="id" :value="clientId" />
|
||||
<button
|
||||
class="rounded-md bg-blue-600 px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-blue-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-600"
|
||||
@click="() => authorize_wrapper()"
|
||||
@ -94,8 +93,9 @@
|
||||
<p
|
||||
class="mt-6 font-semibold font-display text-lg leading-8 text-zinc-100"
|
||||
>
|
||||
Accepting this request will allow "{{ clientData.name }}"
|
||||
on "{{ clientData.platform }}" to:
|
||||
Accepting this request will allow "{{ clientData.name }}" on "{{
|
||||
clientData.platform
|
||||
}}" to:
|
||||
</p>
|
||||
</div>
|
||||
<div class="mt-8 max-w-2xl sm:mt-12 lg:mt-14">
|
||||
@ -149,7 +149,7 @@ const route = useRoute();
|
||||
const clientId = route.params.id;
|
||||
|
||||
const clientData = await $dropFetch(
|
||||
`/api/v1/client/auth/callback?id=${clientId}`
|
||||
`/api/v1/client/auth/callback?id=${clientId}`,
|
||||
);
|
||||
|
||||
const completed = ref(false);
|
||||
|
||||
@ -7,7 +7,7 @@ export default defineEventHandler(async (h3) => {
|
||||
if (!allowed) throw createError({ statusCode: 403 });
|
||||
|
||||
const enabledMechanisms: AuthMec[] = await applicationSettings.get(
|
||||
"enabledAuthencationMechanisms"
|
||||
"enabledAuthencationMechanisms",
|
||||
);
|
||||
|
||||
return enabledMechanisms;
|
||||
|
||||
@ -3,9 +3,7 @@ import prisma from "~/server/internal/db/database";
|
||||
import { handleFileUpload } from "~/server/internal/utils/handlefileupload";
|
||||
|
||||
export default defineEventHandler(async (h3) => {
|
||||
const allowed = await aclManager.allowSystemACL(h3, [
|
||||
"game:image:new",
|
||||
]);
|
||||
const allowed = await aclManager.allowSystemACL(h3, ["game:image:new"]);
|
||||
if (!allowed) throw createError({ statusCode: 403 });
|
||||
|
||||
const form = await readMultipartFormData(h3);
|
||||
|
||||
@ -3,9 +3,7 @@ import prisma from "~/server/internal/db/database";
|
||||
import libraryManager from "~/server/internal/library";
|
||||
|
||||
export default defineEventHandler(async (h3) => {
|
||||
const allowed = await aclManager.allowSystemACL(h3, [
|
||||
"game:read",
|
||||
]);
|
||||
const allowed = await aclManager.allowSystemACL(h3, ["game:read"]);
|
||||
if (!allowed) throw createError({ statusCode: 403 });
|
||||
|
||||
const query = getQuery(h3);
|
||||
|
||||
@ -2,9 +2,7 @@ import aclManager from "~/server/internal/acls";
|
||||
import prisma from "~/server/internal/db/database";
|
||||
|
||||
export default defineEventHandler(async (h3) => {
|
||||
const allowed = await aclManager.allowSystemACL(h3, [
|
||||
"game:update",
|
||||
]);
|
||||
const allowed = await aclManager.allowSystemACL(h3, ["game:update"]);
|
||||
if (!allowed) throw createError({ statusCode: 403 });
|
||||
|
||||
const body = await readBody(h3);
|
||||
|
||||
@ -3,9 +3,7 @@ import prisma from "~/server/internal/db/database";
|
||||
import { handleFileUpload } from "~/server/internal/utils/handlefileupload";
|
||||
|
||||
export default defineEventHandler(async (h3) => {
|
||||
const allowed = await aclManager.allowSystemACL(h3, [
|
||||
"game:update",
|
||||
]);
|
||||
const allowed = await aclManager.allowSystemACL(h3, ["game:update"]);
|
||||
if (!allowed) throw createError({ statusCode: 403 });
|
||||
|
||||
const form = await readMultipartFormData(h3);
|
||||
|
||||
@ -2,9 +2,7 @@ import aclManager from "~/server/internal/acls";
|
||||
import prisma from "~/server/internal/db/database";
|
||||
|
||||
export default defineEventHandler(async (h3) => {
|
||||
const allowed = await aclManager.allowSystemACL(h3, [
|
||||
"game:version:delete",
|
||||
]);
|
||||
const allowed = await aclManager.allowSystemACL(h3, ["game:version:delete"]);
|
||||
if (!allowed) throw createError({ statusCode: 403 });
|
||||
|
||||
const body = await readBody(h3);
|
||||
|
||||
@ -2,9 +2,7 @@ import aclManager from "~/server/internal/acls";
|
||||
import prisma from "~/server/internal/db/database";
|
||||
|
||||
export default defineEventHandler(async (h3) => {
|
||||
const allowed = await aclManager.allowSystemACL(h3, [
|
||||
"game:version:update",
|
||||
]);
|
||||
const allowed = await aclManager.allowSystemACL(h3, ["game:version:update"]);
|
||||
if (!allowed) throw createError({ statusCode: 403 });
|
||||
|
||||
const body = await readBody(h3);
|
||||
@ -34,9 +32,9 @@ export default defineEventHandler(async (h3) => {
|
||||
versionName: true,
|
||||
platform: true,
|
||||
delta: true,
|
||||
}
|
||||
})
|
||||
)
|
||||
},
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
return newVersions;
|
||||
|
||||
@ -2,9 +2,7 @@ import aclManager from "~/server/internal/acls";
|
||||
import libraryManager from "~/server/internal/library";
|
||||
|
||||
export default defineEventHandler(async (h3) => {
|
||||
const allowed = await aclManager.allowSystemACL(h3, [
|
||||
"import:game:read",
|
||||
]);
|
||||
const allowed = await aclManager.allowSystemACL(h3, ["import:game:read"]);
|
||||
if (!allowed) throw createError({ statusCode: 403 });
|
||||
|
||||
const unimportedGames = await libraryManager.fetchAllUnimportedGames();
|
||||
|
||||
@ -7,9 +7,7 @@ import type {
|
||||
} from "~/server/internal/metadata/types";
|
||||
|
||||
export default defineEventHandler(async (h3) => {
|
||||
const allowed = await aclManager.allowSystemACL(h3, [
|
||||
"import:game:new",
|
||||
]);
|
||||
const allowed = await aclManager.allowSystemACL(h3, ["import:game:new"]);
|
||||
if (!allowed) throw createError({ statusCode: 403 });
|
||||
|
||||
const body = await readBody(h3);
|
||||
@ -30,7 +28,6 @@ export default defineEventHandler(async (h3) => {
|
||||
statusMessage: "Invalid unimported game path",
|
||||
});
|
||||
|
||||
|
||||
if (!metadata || !metadata.id || !metadata.sourceId) {
|
||||
console.log(metadata);
|
||||
return await metadataHandler.createGameWithoutMetadata(path);
|
||||
|
||||
@ -2,9 +2,7 @@ import aclManager from "~/server/internal/acls";
|
||||
import metadataHandler from "~/server/internal/metadata";
|
||||
|
||||
export default defineEventHandler(async (h3) => {
|
||||
const allowed = await aclManager.allowSystemACL(h3, [
|
||||
"import:game:read",
|
||||
]);
|
||||
const allowed = await aclManager.allowSystemACL(h3, ["import:game:read"]);
|
||||
if (!allowed) throw createError({ statusCode: 403 });
|
||||
|
||||
const query = getQuery(h3);
|
||||
|
||||
@ -2,9 +2,7 @@ import aclManager from "~/server/internal/acls";
|
||||
import libraryManager from "~/server/internal/library";
|
||||
|
||||
export default defineEventHandler(async (h3) => {
|
||||
const allowed = await aclManager.allowSystemACL(h3, [
|
||||
"import:version:read",
|
||||
]);
|
||||
const allowed = await aclManager.allowSystemACL(h3, ["import:version:read"]);
|
||||
if (!allowed) throw createError({ statusCode: 403 });
|
||||
|
||||
const query = await getQuery(h3);
|
||||
@ -15,9 +13,8 @@ export default defineEventHandler(async (h3) => {
|
||||
statusMessage: "Missing id in request params",
|
||||
});
|
||||
|
||||
const unimportedVersions = await libraryManager.fetchUnimportedVersions(
|
||||
gameId
|
||||
);
|
||||
const unimportedVersions =
|
||||
await libraryManager.fetchUnimportedVersions(gameId);
|
||||
if (!unimportedVersions)
|
||||
throw createError({ statusCode: 400, statusMessage: "Invalid game ID" });
|
||||
|
||||
|
||||
@ -4,9 +4,7 @@ import libraryManager from "~/server/internal/library";
|
||||
import { parsePlatform } from "~/server/internal/utils/parseplatform";
|
||||
|
||||
export default defineEventHandler(async (h3) => {
|
||||
const allowed = await aclManager.allowSystemACL(h3, [
|
||||
"import:version:new",
|
||||
]);
|
||||
const allowed = await aclManager.allowSystemACL(h3, ["import:version:new"]);
|
||||
if (!allowed) throw createError({ statusCode: 403 });
|
||||
|
||||
const body = await readBody(h3);
|
||||
|
||||
@ -2,9 +2,7 @@ import aclManager from "~/server/internal/acls";
|
||||
import libraryManager from "~/server/internal/library";
|
||||
|
||||
export default defineEventHandler(async (h3) => {
|
||||
const allowed = await aclManager.allowSystemACL(h3, [
|
||||
"import:version:read",
|
||||
]);
|
||||
const allowed = await aclManager.allowSystemACL(h3, ["import:version:read"]);
|
||||
if (!allowed) throw createError({ statusCode: 403 });
|
||||
|
||||
const query = await getQuery(h3);
|
||||
@ -18,7 +16,7 @@ export default defineEventHandler(async (h3) => {
|
||||
|
||||
const preload = await libraryManager.fetchUnimportedVersionInformation(
|
||||
gameId,
|
||||
versionName
|
||||
versionName,
|
||||
);
|
||||
if (!preload)
|
||||
throw createError({
|
||||
|
||||
@ -27,8 +27,7 @@ export default defineEventHandler(async (h3) => {
|
||||
take: parseInt(query.limit as string),
|
||||
skip: parseInt(query.skip as string),
|
||||
orderBy: orderBy,
|
||||
...(tags && { tags: tags
|
||||
.map((e) => e.toString()) }),
|
||||
...(tags && { tags: tags.map((e) => e.toString()) }),
|
||||
search: query.search as string,
|
||||
};
|
||||
|
||||
|
||||
@ -13,9 +13,9 @@ export default defineEventHandler(async (h3) => {
|
||||
authMecs: {
|
||||
select: {
|
||||
mec: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return users;
|
||||
|
||||
@ -31,7 +31,7 @@ export default defineEventHandler(async (h3) => {
|
||||
const certificateAuthority = useCertificateAuthority();
|
||||
const bundle = await certificateAuthority.generateClientCertificate(
|
||||
clientId,
|
||||
metadata.data.name
|
||||
metadata.data.name,
|
||||
);
|
||||
|
||||
const client = await clientHandler.finialiseClient(clientId);
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import type {
|
||||
InternalClientCapability} from "~/server/internal/clients/capabilities";
|
||||
import type { InternalClientCapability } from "~/server/internal/clients/capabilities";
|
||||
import capabilityManager, {
|
||||
validCapabilities,
|
||||
} from "~/server/internal/clients/capabilities";
|
||||
@ -34,7 +33,7 @@ export default defineClientEventHandler(
|
||||
|
||||
const isValid = await capabilityManager.validateCapabilityConfiguration(
|
||||
capability,
|
||||
configuration
|
||||
configuration,
|
||||
);
|
||||
if (!isValid)
|
||||
throw createError({
|
||||
@ -45,7 +44,7 @@ export default defineClientEventHandler(
|
||||
await capabilityManager.upsertClientCapability(
|
||||
capability,
|
||||
configuration,
|
||||
clientId
|
||||
clientId,
|
||||
);
|
||||
|
||||
const client = await fetchClient();
|
||||
@ -59,5 +58,5 @@ export default defineClientEventHandler(
|
||||
});
|
||||
|
||||
return {};
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@ -49,5 +49,5 @@ export default defineClientEventHandler(
|
||||
});
|
||||
if (!save)
|
||||
throw createError({ statusCode: 404, statusMessage: "Save not found" });
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@ -51,5 +51,5 @@ export default defineClientEventHandler(
|
||||
throw createError({ statusCode: 404, statusMessage: "Save not found" });
|
||||
|
||||
return save;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@ -44,9 +44,9 @@ export default defineClientEventHandler(
|
||||
user.id,
|
||||
slotIndex,
|
||||
h3.node.req,
|
||||
client.id
|
||||
client.id,
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@ -33,5 +33,5 @@ export default defineClientEventHandler(
|
||||
});
|
||||
|
||||
return saves;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@ -58,5 +58,5 @@ export default defineClientEventHandler(
|
||||
});
|
||||
|
||||
return newSlot;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@ -19,5 +19,5 @@ export default defineClientEventHandler(
|
||||
});
|
||||
|
||||
return saves;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@ -27,5 +27,5 @@ export default defineClientEventHandler(
|
||||
});
|
||||
|
||||
return token.token;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@ -23,7 +23,7 @@ export default defineEventHandler(async (h3) => {
|
||||
const successful = await userLibraryManager.collectionRemove(
|
||||
gameId,
|
||||
id,
|
||||
userId
|
||||
userId,
|
||||
);
|
||||
if (!successful)
|
||||
throw createError({
|
||||
|
||||
@ -17,7 +17,6 @@ export default defineEventHandler(async (h3) => {
|
||||
message: "Missing news ID",
|
||||
});
|
||||
|
||||
|
||||
const news = await newsManager.fetchById(id);
|
||||
if (!news)
|
||||
throw createError({
|
||||
@ -25,6 +24,5 @@ export default defineEventHandler(async (h3) => {
|
||||
message: "News article not found",
|
||||
});
|
||||
|
||||
|
||||
return news;
|
||||
});
|
||||
|
||||
@ -30,7 +30,7 @@ export default defineEventHandler(async (h3) => {
|
||||
setHeader(
|
||||
h3,
|
||||
"Cache-Control",
|
||||
"private, max-age=31536000, s-maxage=31536000, immutable"
|
||||
"private, max-age=31536000, s-maxage=31536000, immutable",
|
||||
);
|
||||
return object.data;
|
||||
});
|
||||
|
||||
@ -18,7 +18,7 @@ export default defineEventHandler(async (h3) => {
|
||||
const result = await objectHandler.writeWithPermissions(
|
||||
id,
|
||||
async () => buffer,
|
||||
userId
|
||||
userId,
|
||||
);
|
||||
return { success: result };
|
||||
});
|
||||
|
||||
@ -10,7 +10,6 @@ These use public HTTPS certificate, and while are authenticated, are 'public' in
|
||||
|
||||
Drop clients use P2P mTLS aided by the P2P co-ordinator to transfer chunks between themselves. This happens over HTTP.
|
||||
|
||||
|
||||
## Private mTLS Wireguard tunnels
|
||||
|
||||
Drop clients can establish P2P Wireguard
|
||||
@ -38,7 +38,8 @@ export const userACLDescriptions: ObjectFromList<typeof userACLs> = {
|
||||
};
|
||||
|
||||
export const systemACLDescriptions: ObjectFromList<typeof systemACLs> = {
|
||||
"auth:read": "Fetch the list of enabled authentication mechanisms configured.",
|
||||
"auth:read":
|
||||
"Fetch the list of enabled authentication mechanisms configured.",
|
||||
"auth:simple:invitation:read": "Fetch simple auth invitations.",
|
||||
"auth:simple:invitation:new": "Create new simple auth invitations.",
|
||||
"auth:simple:invitation:delete": "Delete a simple auth invitation.",
|
||||
@ -69,5 +70,5 @@ export const systemACLDescriptions: ObjectFromList<typeof systemACLs> = {
|
||||
|
||||
"news:read": "Read news articles.",
|
||||
"news:create": "Create a new news article.",
|
||||
"news:delete": "Delete a news article."
|
||||
"news:delete": "Delete a news article.",
|
||||
};
|
||||
|
||||
@ -24,7 +24,7 @@ class ApplicationConfiguration {
|
||||
private async init() {
|
||||
if (this.currentApplicationSettings === undefined) {
|
||||
const applicationSettingsCount = await prisma.applicationSettings.count(
|
||||
{}
|
||||
{},
|
||||
);
|
||||
if (applicationSettingsCount > 0) {
|
||||
await applicationSettings.pullConfiguration();
|
||||
@ -60,7 +60,7 @@ class ApplicationConfiguration {
|
||||
|
||||
async set<T extends keyof ApplicationSettings>(
|
||||
key: T,
|
||||
value: ApplicationSettings[T]
|
||||
value: ApplicationSettings[T],
|
||||
) {
|
||||
await this.init();
|
||||
if (!this.currentApplicationSettings)
|
||||
@ -73,7 +73,9 @@ class ApplicationConfiguration {
|
||||
}
|
||||
}
|
||||
|
||||
async get<T extends keyof ApplicationSettings>(key: T): Promise<ApplicationSettings[T]> {
|
||||
async get<T extends keyof ApplicationSettings>(
|
||||
key: T,
|
||||
): Promise<ApplicationSettings[T]> {
|
||||
await this.init();
|
||||
if (!this.currentApplicationSettings)
|
||||
throw new Error("Somehow, failed to initialise application settings");
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
import { PrismaClient } from '@prisma/client'
|
||||
import { PrismaClient } from "@prisma/client";
|
||||
|
||||
const prismaClientSingleton = () => {
|
||||
return new PrismaClient({});
|
||||
}
|
||||
};
|
||||
|
||||
declare const globalThis: {
|
||||
prismaGlobal: ReturnType<typeof prismaClientSingleton>;
|
||||
} & typeof global;
|
||||
|
||||
const prisma = globalThis.prismaGlobal ?? prismaClientSingleton()
|
||||
const prisma = globalThis.prismaGlobal ?? prismaClientSingleton();
|
||||
|
||||
export default prisma;
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') globalThis.prismaGlobal = prisma
|
||||
if (process.env.NODE_ENV !== "production") globalThis.prismaGlobal = prisma;
|
||||
|
||||
@ -87,7 +87,7 @@ export class GiantBombProvider implements MetadataProvider {
|
||||
if (!apikey)
|
||||
throw new MissingMetadataProviderConfig(
|
||||
"GIANT_BOMB_API_KEY",
|
||||
this.name()
|
||||
this.name(),
|
||||
);
|
||||
|
||||
this.apikey = apikey;
|
||||
@ -105,7 +105,7 @@ export class GiantBombProvider implements MetadataProvider {
|
||||
resource: string,
|
||||
url: string,
|
||||
query: { [key: string]: string },
|
||||
options?: AxiosRequestConfig
|
||||
options?: AxiosRequestConfig,
|
||||
) {
|
||||
const queryString = new URLSearchParams({
|
||||
...query,
|
||||
@ -120,7 +120,7 @@ export class GiantBombProvider implements MetadataProvider {
|
||||
baseURL: "",
|
||||
};
|
||||
const response = await axios.request<GiantBombResponseType<T>>(
|
||||
Object.assign({}, options, overlay)
|
||||
Object.assign({}, options, overlay),
|
||||
);
|
||||
return response;
|
||||
}
|
||||
@ -198,7 +198,7 @@ export class GiantBombProvider implements MetadataProvider {
|
||||
: DateTime.fromISO(
|
||||
`${gameData.expected_release_year ?? new Date().getFullYear()}-${
|
||||
gameData.expected_release_month ?? 1
|
||||
}-${gameData.expected_release_day ?? 1}`
|
||||
}-${gameData.expected_release_day ?? 1}`,
|
||||
).toJSDate();
|
||||
|
||||
const metadata: GameMetadata = {
|
||||
@ -229,7 +229,7 @@ export class GiantBombProvider implements MetadataProvider {
|
||||
const results = await this.request<Array<CompanySearchResult>>(
|
||||
"search",
|
||||
"",
|
||||
{ query, resources: "company" }
|
||||
{ query, resources: "company" },
|
||||
);
|
||||
|
||||
// Find the right entry
|
||||
@ -256,7 +256,7 @@ export class GiantBombProvider implements MetadataProvider {
|
||||
return metadata;
|
||||
}
|
||||
async fetchDeveloper(
|
||||
params: _FetchDeveloperMetadataParams
|
||||
params: _FetchDeveloperMetadataParams,
|
||||
): Promise<DeveloperMetadata> {
|
||||
return await this.fetchPublisher(params);
|
||||
}
|
||||
|
||||
@ -144,7 +144,7 @@ export class IGDBProvider implements MetadataProvider {
|
||||
if (!client_secret)
|
||||
throw new MissingMetadataProviderConfig(
|
||||
"IGDB_CLIENT_SECRET",
|
||||
this.name()
|
||||
this.name(),
|
||||
);
|
||||
|
||||
this.clientId = client_id;
|
||||
@ -188,14 +188,14 @@ export class IGDBProvider implements MetadataProvider {
|
||||
private async request<T extends object>(
|
||||
resource: string,
|
||||
body: string,
|
||||
options?: AxiosRequestConfig
|
||||
options?: AxiosRequestConfig,
|
||||
) {
|
||||
await this.refreshCredentials();
|
||||
|
||||
// prevent calling api before auth is complete
|
||||
if (this.accessToken.length <= 0)
|
||||
throw new Error(
|
||||
"IGDB either failed to authenticate, or has not done so yet"
|
||||
"IGDB either failed to authenticate, or has not done so yet",
|
||||
);
|
||||
|
||||
const finalURL = `https://api.igdb.com/v4/${resource}`;
|
||||
@ -213,7 +213,7 @@ export class IGDBProvider implements MetadataProvider {
|
||||
},
|
||||
};
|
||||
const response = await axios.request<T[] | IGDBErrorResponse[]>(
|
||||
Object.assign({}, options, overlay)
|
||||
Object.assign({}, options, overlay),
|
||||
);
|
||||
|
||||
if (response.status !== 200) {
|
||||
@ -224,7 +224,7 @@ export class IGDBProvider implements MetadataProvider {
|
||||
});
|
||||
|
||||
throw new Error(
|
||||
`Error in igdb \nStatus Code: ${response.status} \nCause: ${cause}`
|
||||
`Error in igdb \nStatus Code: ${response.status} \nCause: ${cause}`,
|
||||
);
|
||||
}
|
||||
|
||||
@ -323,7 +323,7 @@ export class IGDBProvider implements MetadataProvider {
|
||||
const involved_company_response =
|
||||
await this.request<IGDBInvolvedCompany>(
|
||||
"involved_companies",
|
||||
`where id = ${involvedCompany}; fields *;`
|
||||
`where id = ${involvedCompany}; fields *;`,
|
||||
);
|
||||
for (const foundInvolved of involved_company_response) {
|
||||
// now we need to get the actual company so we can get the name
|
||||
@ -348,7 +348,7 @@ export class IGDBProvider implements MetadataProvider {
|
||||
shortDescription: this.trimMessage(response[i].summary, 280),
|
||||
description: response[i].summary,
|
||||
released: DateTime.fromSeconds(
|
||||
response[i].first_release_date
|
||||
response[i].first_release_date,
|
||||
).toJSDate(),
|
||||
|
||||
reviewCount: response[i]?.total_rating_count ?? 0,
|
||||
@ -372,7 +372,7 @@ export class IGDBProvider implements MetadataProvider {
|
||||
}: _FetchPublisherMetadataParams): Promise<PublisherMetadata> {
|
||||
const response = await this.request<IGDBCompany>(
|
||||
"companies",
|
||||
`where name = "${query}"; fields *; limit 1;`
|
||||
`where name = "${query}"; fields *; limit 1;`,
|
||||
);
|
||||
|
||||
for (const company of response) {
|
||||
@ -382,7 +382,7 @@ export class IGDBProvider implements MetadataProvider {
|
||||
for (const companySite of company.websites) {
|
||||
const companySiteRes = await this.request<IGDBCompanyWebsite>(
|
||||
"company_websites",
|
||||
`where id = ${companySite}; fields *;`
|
||||
`where id = ${companySite}; fields *;`,
|
||||
);
|
||||
|
||||
for (const site of companySiteRes) {
|
||||
@ -406,7 +406,7 @@ export class IGDBProvider implements MetadataProvider {
|
||||
throw new Error("No results found");
|
||||
}
|
||||
async fetchDeveloper(
|
||||
params: _FetchDeveloperMetadataParams
|
||||
params: _FetchDeveloperMetadataParams,
|
||||
): Promise<DeveloperMetadata> {
|
||||
return await this.fetchPublisher(params);
|
||||
}
|
||||
|
||||
@ -5,8 +5,10 @@ import { ObjectTransactionalHandler } from "../objects/transactional";
|
||||
export async function handleFileUpload(
|
||||
h3: H3Event<EventHandlerRequest>,
|
||||
metadata: { [key: string]: string },
|
||||
permissions: Array<string>
|
||||
): Promise<[string | undefined, {[key: string]: string}, Pull, Dump] | undefined> {
|
||||
permissions: Array<string>,
|
||||
): Promise<
|
||||
[string | undefined, { [key: string]: string }, Pull, Dump] | undefined
|
||||
> {
|
||||
const formData = await readMultipartFormData(h3);
|
||||
if (!formData) return undefined;
|
||||
const transactionalHandler = new ObjectTransactionalHandler();
|
||||
|
||||
Reference in New Issue
Block a user