nuxt-discord 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/module.d.mts +41 -1
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +131 -11
  4. package/dist/runtime/acknowledgement.d.ts +2 -1
  5. package/dist/runtime/acknowledgement.js +44 -12
  6. package/dist/runtime/client/components/CommandCard.d.ts +29 -0
  7. package/dist/runtime/client/components/CommandCard.js +75 -0
  8. package/dist/runtime/client/components/CommandReference.d.vue.ts +20 -0
  9. package/dist/runtime/client/components/CommandReference.vue +21 -0
  10. package/dist/runtime/client/components/CommandReference.vue.d.ts +20 -0
  11. package/dist/runtime/client/components/CommandTestBar.vue +0 -3
  12. package/dist/runtime/client/components/CommandsHeading.d.ts +24 -0
  13. package/dist/runtime/client/components/CommandsHeading.js +17 -0
  14. package/dist/runtime/client/components/DashboardHeader.d.ts +32 -0
  15. package/dist/runtime/client/components/DashboardHeader.js +32 -0
  16. package/dist/runtime/client/components/ProjectLogo.d.ts +4 -0
  17. package/dist/runtime/client/components/ProjectLogo.js +31 -0
  18. package/dist/runtime/client/components/ReferenceContent.d.ts +22 -0
  19. package/dist/runtime/client/components/ReferenceContent.js +45 -0
  20. package/dist/runtime/client/components/TheHeader.vue +33 -52
  21. package/dist/runtime/client/components/appearance-select.d.ts +1 -1
  22. package/dist/runtime/client/components/appearance-select.js +1 -1
  23. package/dist/runtime/client/pages/slash-commands.vue +28 -110
  24. package/dist/runtime/client/reference.css +133 -0
  25. package/dist/runtime/client/useDiscordCommandReference.d.ts +2 -0
  26. package/dist/runtime/client/useDiscordCommandReference.js +6 -0
  27. package/dist/runtime/dashboard/auth.js +10 -17
  28. package/dist/runtime/dashboard/oauth.d.ts +15 -1
  29. package/dist/runtime/dashboard/oauth.js +42 -21
  30. package/dist/runtime/dashboard/origin.d.ts +2 -0
  31. package/dist/runtime/dashboard/origin.js +8 -0
  32. package/dist/runtime/dashboard/signin.d.ts +2 -1
  33. package/dist/runtime/dashboard/signin.js +7 -2
  34. package/dist/runtime/dashboard/urls.d.ts +2 -0
  35. package/dist/runtime/dashboard/urls.js +8 -0
  36. package/dist/runtime/reference/access.d.ts +6 -0
  37. package/dist/runtime/reference/access.js +144 -0
  38. package/dist/runtime/reference/catalog.d.ts +2 -0
  39. package/dist/runtime/reference/catalog.js +9 -0
  40. package/dist/runtime/reference/document.d.ts +2 -0
  41. package/dist/runtime/reference/document.js +25 -0
  42. package/dist/runtime/reference/hosted.d.ts +2 -0
  43. package/dist/runtime/reference/hosted.js +16 -0
  44. package/dist/runtime/reference/oauth.d.ts +2 -0
  45. package/dist/runtime/reference/oauth.js +4 -0
  46. package/dist/runtime/server/plugins/discord.js +2 -0
  47. package/dist/types.d.mts +1 -1
  48. package/dist/types.d.ts +1 -1
  49. package/package.json +1 -1
  50. package/dist/runtime/client/components/ProjectLogo.d.vue.ts +0 -3
  51. package/dist/runtime/client/components/ProjectLogo.vue +0 -31
  52. package/dist/runtime/client/components/ProjectLogo.vue.d.ts +0 -3
@@ -12,6 +12,8 @@ export default defineNitroPlugin(async (nitro) => {
12
12
  if (import.meta.prerender)
13
13
  return;
14
14
  const runtimeConfig = useRuntimeConfig();
15
+ if (!runtimeConfig.discord.autoStart && (!process.env.DISCORD_TOKEN || !process.env.DISCORD_CLIENT_ID))
16
+ return;
15
17
  let closed = false;
16
18
  function fail(message, error) {
17
19
  logDiscordFailure(message, error);
package/dist/types.d.mts CHANGED
@@ -16,4 +16,4 @@ export { type SendHandle, type UseTextChannelReturn } from '../dist/runtime/serv
16
16
 
17
17
  export { default, type slashCommandOptionTypeIdentifiers, type typeIdentifierToEnum } from './module.mjs'
18
18
 
19
- export { type ContextMenu, type DashboardCatalog, type DiscordRuntimeConfig, type Listener, type Mentionable, type MiddlewareEntry, type NuxtDiscordContext, type NuxtDiscordOptions, type SlashCommand, type SlashCommandAttachmentOption, type SlashCommandBooleanOption, type SlashCommandChannelOption, type SlashCommandCustomReturnHandler, type SlashCommandIntegerOption, type SlashCommandMentionableOption, type SlashCommandNumberOption, type SlashCommandOption, type SlashCommandOptionBase, type SlashCommandOptionType, type SlashCommandOptionTypeIdentifier, type SlashCommandReturnType, type SlashCommandRoleOption, type SlashCommandRuntime, type SlashCommandStringOption, type SlashCommandSubcommand, type SlashCommandSubcommandGroup, type SlashCommandSubcommandGroupRuntime, type SlashCommandSubcommandRuntime, type SlashCommandUserOption, type integer } from './module.mjs'
19
+ export { type ContextMenu, type DashboardCatalog, type DiscordCommandReference, type DiscordReferenceOption, type DiscordReferenceOptions, type DiscordRuntimeConfig, type Listener, type Mentionable, type MiddlewareEntry, type NuxtDiscordContext, type NuxtDiscordOptions, type SlashCommand, type SlashCommandAttachmentOption, type SlashCommandBooleanOption, type SlashCommandChannelOption, type SlashCommandCustomReturnHandler, type SlashCommandIntegerOption, type SlashCommandMentionableOption, type SlashCommandNumberOption, type SlashCommandOption, type SlashCommandOptionBase, type SlashCommandOptionType, type SlashCommandOptionTypeIdentifier, type SlashCommandReturnType, type SlashCommandRoleOption, type SlashCommandRuntime, type SlashCommandStringOption, type SlashCommandSubcommand, type SlashCommandSubcommandGroup, type SlashCommandSubcommandGroupRuntime, type SlashCommandSubcommandRuntime, type SlashCommandUserOption, type integer } from './module.mjs'
package/dist/types.d.ts CHANGED
@@ -16,4 +16,4 @@ export { type SendHandle, type UseTextChannelReturn } from '../dist/runtime/serv
16
16
 
17
17
  export { default, type slashCommandOptionTypeIdentifiers, type typeIdentifierToEnum } from './module.mjs'
18
18
 
19
- export { type ContextMenu, type DashboardCatalog, type DiscordRuntimeConfig, type Listener, type Mentionable, type MiddlewareEntry, type NuxtDiscordContext, type NuxtDiscordOptions, type SlashCommand, type SlashCommandAttachmentOption, type SlashCommandBooleanOption, type SlashCommandChannelOption, type SlashCommandCustomReturnHandler, type SlashCommandIntegerOption, type SlashCommandMentionableOption, type SlashCommandNumberOption, type SlashCommandOption, type SlashCommandOptionBase, type SlashCommandOptionType, type SlashCommandOptionTypeIdentifier, type SlashCommandReturnType, type SlashCommandRoleOption, type SlashCommandRuntime, type SlashCommandStringOption, type SlashCommandSubcommand, type SlashCommandSubcommandGroup, type SlashCommandSubcommandGroupRuntime, type SlashCommandSubcommandRuntime, type SlashCommandUserOption, type integer } from './module.mjs'
19
+ export { type ContextMenu, type DashboardCatalog, type DiscordCommandReference, type DiscordReferenceOption, type DiscordReferenceOptions, type DiscordRuntimeConfig, type Listener, type Mentionable, type MiddlewareEntry, type NuxtDiscordContext, type NuxtDiscordOptions, type SlashCommand, type SlashCommandAttachmentOption, type SlashCommandBooleanOption, type SlashCommandChannelOption, type SlashCommandCustomReturnHandler, type SlashCommandIntegerOption, type SlashCommandMentionableOption, type SlashCommandNumberOption, type SlashCommandOption, type SlashCommandOptionBase, type SlashCommandOptionType, type SlashCommandOptionTypeIdentifier, type SlashCommandReturnType, type SlashCommandRoleOption, type SlashCommandRuntime, type SlashCommandStringOption, type SlashCommandSubcommand, type SlashCommandSubcommandGroup, type SlashCommandSubcommandGroupRuntime, type SlashCommandSubcommandRuntime, type SlashCommandUserOption, type integer } from './module.mjs'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-discord",
3
3
  "type": "module",
4
- "version": "0.1.0",
4
+ "version": "0.2.1",
5
5
  "packageManager": "bun@1.4.5",
6
6
  "description": "A Nuxt module for building Discord bots",
7
7
  "author": "Jize Zou <jeffzou2001@gmail.com> (https://github.com/zojize)",
@@ -1,3 +0,0 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
- declare const _default: typeof __VLS_export;
3
- export default _default;
@@ -1,31 +0,0 @@
1
- <script setup>
2
- import { useId } from "vue";
3
- const seamMask = useId();
4
- </script>
5
-
6
- <template>
7
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="8 5.5 84 84" width="84" height="84">
8
- <title>Nuxt Discord</title>
9
- <defs>
10
- <mask :id="seamMask" maskUnits="userSpaceOnUse" x="8" y="5.5" width="84" height="84">
11
- <rect x="8" y="5.5" width="84" height="84" fill="white" />
12
- <g transform="translate(1.3 -.65) scale(.97) translate(6.32 3.64) scale(.94155)" fill="black">
13
- <path d="M10 45.4C25.8 37.9 39.4 36.4 47.7 39.7 52.1 41.5 55.5 45.1 57.8 48.1Q58.2 48.7 57.6 49 57.2 49.2 56.8 48.7C54.2 45.9 50.8 43 47 41.6 38.9 38.5 26 41.1 10 49.7Z" />
14
- <path d="M57 19C62 23.4 66.6 30.5 67.05 37Q67.1 37.7 66.55 37.7 66.1 37.7 65.95 37.2C65.1 32.4 63.84 28.44 60.2 25.5Q56.8 22.75 53.9 19Z" />
15
- </g>
16
- </mask>
17
- </defs>
18
- <g :mask="`url(#${seamMask})`">
19
- <path fill="#00dc82" style="fill: light-dark(#00b574, #00dc82)" d="M54.49 87.24C54.49 87.24 82.18 87.24 82.18 87.24 C83.06 87.24 83.91 86.93 84.67 86.49 C85.44 86.05 86.23 85.5 86.67 84.74 C87.11 83.98 87.42 83.12 87.42 82.25 C87.41 81.37 87.11 80.51 86.67 79.75 C86.67 79.75 67.96 47.58 67.96 47.58 C67.52 46.82 66.98 46.27 66.21 45.83 C65.45 45.39 64.35 45.08 63.47 45.08 C62.59 45.08 61.74 45.39 60.98 45.83 C60.21 46.27 59.67 46.82 59.23 47.58 C59.23 47.58 54.49 55.81 54.49 55.81 C54.49 55.81 45.01 39.84 45.01 39.84 C44.57 39.09 44.03 38.29 43.27 37.85 C42.5 37.41 41.65 37.35 40.77 37.35 C39.89 37.35 39.04 37.41 38.28 37.85 C37.51 38.29 36.72 39.09 36.28 39.84 C36.28 39.84 13.08 79.75 13.08 79.75 C12.64 80.51 12.59 81.37 12.58 82.25 C12.58 83.12 12.64 83.98 13.08 84.74 C13.53 85.5 14.31 86.05 15.08 86.49 C15.84 86.93 16.69 87.24 17.57 87.24 C17.57 87.24 35.03 87.24 35.03 87.24 C41.95 87.24 46.99 84.13 50.5 78.26 C50.5 78.26 58.98 63.54 58.98 63.54 C58.98 63.54 63.47 55.81 63.47 55.81 C63.47 55.81 77.19 79.26 77.19 79.26 C77.19 79.26 58.98 79.26 58.98 79.26 C58.98 79.26 54.49 87.24 54.49 87.24 C54.49 87.24 54.49 87.24 54.49 87.24 ZM34.78 79.26C34.78 79.26 22.56 79.26 22.56 79.26 C22.56 79.26 40.77 47.83 40.77 47.83 C40.77 47.83 50 63.54 50 63.54 C50 63.54 43.89 74.2 43.89 74.2 C41.56 78.01 38.9 79.26 34.78 79.26 C34.78 79.26 34.78 79.26 34.78 79.26 Z" />
20
- <g transform="translate(1.3 -.65) scale(.97)" fill="#5865f2">
21
- <g transform="translate(6.32 3.64) scale(.94155)">
22
- <path d="M16.47 44.22C8 38.17 3.87 8.84 23.24 8.84 C40.6 8.84 53.4 20 60.2 25.5 C62.3 27.2 63.6 27.8 66.8 27.7 C74.1 27.7 79.7 28.4 81.5 32.4 C84.9 40 72.9 46.5 58.7 50C55.9 53.6 54.1 55.5 50.9 55.1 C40.6 53.1 30.4 46.2 12.4 54.1 Q10.2 55.1 10.9 52.9 Q12.3 48.3 16.47 44.22Z" />
23
- </g>
24
- <g fill="#fff">
25
- <path d="M23.78 24.8C25.16 24.39 26.8 25.77 27.44 27.9 C28.09 30.02 27.49 32.08 26.12 32.5 C24.75 32.92 23.11 31.53 22.46 29.41 C21.82 27.29 22.41 25.22 23.78 24.8 Z" />
26
- <path d="M31.25 26.36C30.22 24.37 30.53 22.17 31.93 21.45 C33.33 20.73 35.3 21.76 36.32 23.74 C37.35 25.73 37.04 27.93 35.64 28.65 C34.24 29.38 32.27 28.35 31.25 26.36 Z" />
27
- </g>
28
- </g>
29
- </g>
30
- </svg>
31
- </template>
@@ -1,3 +0,0 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
- declare const _default: typeof __VLS_export;
3
- export default _default;